Skip to content

Commit 2fb1336

Browse files
committed
chore: remove cortex_prompt.txt (now in cortex-prompt-harness)
- Remove cortex_prompt.txt from repository root - Update documentation in core.rs to reflect new architecture - System prompt is now centralized in cortex-prompt-harness crate The prompt content is now the canonical source in: cortex_prompt_harness::prompts::CORTEX_MAIN_PROMPT
1 parent 49d1c41 commit 2fb1336

File tree

6 files changed

+22
-288
lines changed

6 files changed

+22
-288
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cortex_prompt.txt

Lines changed: 0 additions & 268 deletions
This file was deleted.

src/cortex-prompt-harness/src/context.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ mod tests {
482482

483483
#[test]
484484
fn test_tool_definition_with_category() {
485-
let tool = ToolDefinition::new("Read", "Read file contents")
486-
.with_category("Perception");
485+
let tool = ToolDefinition::new("Read", "Read file contents").with_category("Perception");
487486

488487
assert_eq!(tool.name, "Read");
489488
assert_eq!(tool.category, Some("Perception".to_string()));
@@ -515,9 +514,7 @@ mod tests {
515514

516515
#[test]
517516
fn test_prompt_context_combined_tools() {
518-
let initial_tools = vec![
519-
ToolDefinition::new("Read", "Read files"),
520-
];
517+
let initial_tools = vec![ToolDefinition::new("Read", "Read files")];
521518
let context = PromptContext::new()
522519
.with_tools(initial_tools)
523520
.add_tool(ToolDefinition::new("Write", "Write files"));

src/cortex-prompt-harness/src/prompts/core.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,11 @@ impl Default for CortexPromptBuilder {
636636
///
637637
/// # Usage
638638
///
639-
/// This prompt is loaded via `include_str!` from `cortex_prompt.txt` in the
640-
/// main cortex-engine, but the canonical version is defined here.
639+
/// This is the canonical source for the Cortex system prompt. It is used
640+
/// directly by cortex-engine via `cortex_prompt_harness::prompts::CORTEX_MAIN_PROMPT`.
641+
///
642+
/// For dynamic prompt building with custom sections and tools, use
643+
/// [`CortexPromptBuilder`] instead.
641644
pub const CORTEX_MAIN_PROMPT: &str = r#"# CORTEX
642645
643646
You are **Cortex**, an autonomous software engineering intelligence.
@@ -1182,10 +1185,7 @@ mod tests {
11821185
#[test]
11831186
fn test_builder_with_tools() {
11841187
let prompt = CortexPromptBuilder::new()
1185-
.with_tools(&[
1186-
("Tool1", "Description 1"),
1187-
("Tool2", "Description 2"),
1188-
])
1188+
.with_tools(&[("Tool1", "Description 1"), ("Tool2", "Description 2")])
11891189
.build();
11901190

11911191
assert!(prompt.contains("`Tool1`"));
@@ -1220,9 +1220,7 @@ mod tests {
12201220
fn test_builder_custom_toolkit_replaces_add_tool() {
12211221
let prompt = CortexPromptBuilder::new()
12221222
.add_tool("FirstTool", "Should be replaced")
1223-
.with_custom_toolkit(&[
1224-
("FinalTool", "Final description"),
1225-
])
1223+
.with_custom_toolkit(&[("FinalTool", "Final description")])
12261224
.build();
12271225

12281226
assert!(!prompt.contains("FirstTool"));
@@ -1234,7 +1232,10 @@ mod tests {
12341232
#[test]
12351233
fn test_builder_add_custom_section() {
12361234
let prompt = CortexPromptBuilder::new()
1237-
.add_custom_section("SPECIAL RULES", "## SPECIAL RULES\n\nFollow these special rules...")
1235+
.add_custom_section(
1236+
"SPECIAL RULES",
1237+
"## SPECIAL RULES\n\nFollow these special rules...",
1238+
)
12381239
.build();
12391240

12401241
assert!(prompt.contains("## SPECIAL RULES"));
@@ -1243,8 +1244,7 @@ mod tests {
12431244

12441245
#[test]
12451246
fn test_builder_is_section_enabled() {
1246-
let builder = CortexPromptBuilder::new()
1247-
.without_section("ANTI-PATTERNS");
1247+
let builder = CortexPromptBuilder::new().without_section("ANTI-PATTERNS");
12481248

12491249
assert!(builder.is_section_enabled("PRIME DIRECTIVES"));
12501250
assert!(builder.is_section_enabled("TOOLKIT"));

src/cortex-prompt-harness/src/prompts/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub use agents::{
4848
TITLE_AGENT_PROMPT,
4949
};
5050
pub use core::{
51-
CortexPromptBuilder, CORTEX_MAIN_PROMPT, SECTION_ANTI_PATTERNS, SECTION_CODE_DISCIPLINE,
51+
CORTEX_MAIN_PROMPT, CortexPromptBuilder, SECTION_ANTI_PATTERNS, SECTION_CODE_DISCIPLINE,
5252
SECTION_COGNITIVE_ARCHITECTURE, SECTION_FAILURE_PROTOCOL, SECTION_HEADER, SECTION_NAMES,
5353
SECTION_OUTPUT_FORMAT, SECTION_PRIME_DIRECTIVES, SECTION_QUALITY_CHECKPOINTS,
5454
SECTION_RESPONSE_PATTERNS, SECTION_TOOLKIT, TUI_SYSTEM_PROMPT_TEMPLATE,

src/cortex-prompt-harness/src/sections.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,12 @@ mod tests {
555555
let rendered = section.render();
556556

557557
// Alpha should come before Zebra (alphabetically)
558-
let alpha_pos = rendered.find("### Alpha").expect("Alpha category should exist");
559-
let zebra_pos = rendered.find("### Zebra").expect("Zebra category should exist");
558+
let alpha_pos = rendered
559+
.find("### Alpha")
560+
.expect("Alpha category should exist");
561+
let zebra_pos = rendered
562+
.find("### Zebra")
563+
.expect("Zebra category should exist");
560564
assert!(
561565
alpha_pos < zebra_pos,
562566
"Alpha should appear before Zebra in sorted output"

0 commit comments

Comments
 (0)