Skip to content

Commit e5511a7

Browse files
committed
feat(cortex-prompt-harness): remove WORKSPACE_CLEANUP section from top-agent prompts
- Remove SECTION_WORKSPACE_CLEANUP constant and all references - Remove WORKSPACE_CLEANUP from TOP_AGENT_SECTION_NAMES array - Remove WORKSPACE_CLEANUP from TopAgentPromptBuilder sections - Remove .without_section("WORKSPACE_CLEANUP") from presets - Update module documentation - Update tests that referenced WORKSPACE_CLEANUP All sections are now unconditionally included in the system prompt.
1 parent 973f9ab commit e5511a7

File tree

1 file changed

+5
-50
lines changed

1 file changed

+5
-50
lines changed

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

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
//! - Concise, direct, and friendly communication
1010
//! - Multiple tool calling patterns
1111
//! - Background process management
12-
//! - Workspace cleanup before completion
1312
//!
1413
//! # Usage
1514
//!
@@ -23,7 +22,7 @@
2322
//! let custom = TopAgentPromptBuilder::new()
2423
//! .with_code_execution()
2524
//! .with_file_operations()
26-
//! .without_section("WORKSPACE_CLEANUP")
25+
//! .without_section("GEOMETRIC_DATA")
2726
//! .build();
2827
//! ```
2928
@@ -411,24 +410,6 @@ The example was generated from different input data. Your output WILL have diffe
411410
412411
**When values differ from example:** That's expected. Stop. Do not adjust. Move on. Do not add offsets, base addresses, or any transformations to match example values."#;
413412

414-
/// Workspace cleanup section.
415-
pub const SECTION_WORKSPACE_CLEANUP: &str = r#"## Workspace Cleanup (GC)
416-
417-
Before marking a task complete, clean up any artifacts that could interfere with verification or leave the workspace in a messy state:
418-
419-
- **Generated artifacts**: Remove compiled files, build outputs, and cache directories that you created during the task (e.g., `__pycache__`, `.pyc`, `node_modules` if you installed them, `dist/`, `build/`, `*.egg-info`).
420-
- **Temporary files**: Delete any temporary files, logs, or scratch files you created for debugging or testing (e.g., `*.tmp`, `*.log`, test scripts you added).
421-
- **Intermediate outputs**: Clean up any intermediate files from multi-step processes that aren't part of the final deliverable.
422-
423-
**Guidelines:**
424-
- Only remove artifacts YOU created during this task, never pre-existing files.
425-
- If unsure whether a file existed before, leave it alone.
426-
- Keep files that are explicitly required by the task or verification.
427-
- Use `rm -rf` cautiously and only on directories you created.
428-
- When in doubt, list files before removing: `ls -la` first, then targeted removal.
429-
430-
This ensures the workspace remains clean for verification tests and doesn't contain artifacts that could cause false positives or negatives."#;
431-
432413
/// Ambition vs precision guidance section.
433414
pub const SECTION_AMBITION_PRECISION: &str = r#"## Ambition vs. Precision
434415
@@ -933,25 +914,6 @@ The example was generated from different input data. Your output WILL have diffe
933914
934915
---
935916
936-
## Workspace Cleanup (GC)
937-
938-
Before marking a task complete, clean up any artifacts that could interfere with verification or leave the workspace in a messy state:
939-
940-
- **Generated artifacts**: Remove compiled files, build outputs, and cache directories that you created during the task (e.g., `__pycache__`, `.pyc`, `node_modules` if you installed them, `dist/`, `build/`, `*.egg-info`).
941-
- **Temporary files**: Delete any temporary files, logs, or scratch files you created for debugging or testing (e.g., `*.tmp`, `*.log`, test scripts you added).
942-
- **Intermediate outputs**: Clean up any intermediate files from multi-step processes that aren't part of the final deliverable.
943-
944-
**Guidelines:**
945-
- Only remove artifacts YOU created during this task, never pre-existing files.
946-
- If unsure whether a file existed before, leave it alone.
947-
- Keep files that are explicitly required by the task or verification.
948-
- Use `rm -rf` cautiously and only on directories you created.
949-
- When in doubt, list files before removing: `ls -la` first, then targeted removal.
950-
951-
This ensures the workspace remains clean for verification tests and doesn't contain artifacts that could cause false positives or negatives.
952-
953-
---
954-
955917
## Ambition vs. Precision
956918
957919
For tasks that have no prior context (i.e. the user is starting something brand new), you should feel free to be ambitious and demonstrate creativity with your implementation.
@@ -1167,7 +1129,6 @@ pub const TOP_AGENT_SECTION_NAMES: &[&str] = &[
11671129
"EDGE_CASES",
11681130
"PRE_COMPLETION",
11691131
"EXAMPLE_OUTPUT_WARNING",
1170-
"WORKSPACE_CLEANUP",
11711132
"AMBITION_PRECISION",
11721133
"PROGRESS_UPDATES",
11731134
"WEB_SEARCH",
@@ -1213,7 +1174,7 @@ impl TopAgentSection {
12131174
/// let prompt = TopAgentPromptBuilder::new()
12141175
/// .with_code_execution()
12151176
/// .with_file_operations()
1216-
/// .without_section("WORKSPACE_CLEANUP")
1177+
/// .without_section("GEOMETRIC_DATA")
12171178
/// .with_variable("cwd", "/my/project")
12181179
/// .build();
12191180
/// ```
@@ -1258,7 +1219,6 @@ impl TopAgentPromptBuilder {
12581219
TopAgentSection::new("EDGE_CASES", SECTION_EDGE_CASES),
12591220
TopAgentSection::new("PRE_COMPLETION", SECTION_PRE_COMPLETION),
12601221
TopAgentSection::new("EXAMPLE_OUTPUT_WARNING", SECTION_EXAMPLE_OUTPUT_WARNING),
1261-
TopAgentSection::new("WORKSPACE_CLEANUP", SECTION_WORKSPACE_CLEANUP),
12621222
TopAgentSection::new("AMBITION_PRECISION", SECTION_AMBITION_PRECISION),
12631223
TopAgentSection::new("PROGRESS_UPDATES", SECTION_PROGRESS_UPDATES),
12641224
TopAgentSection::new("WEB_SEARCH", SECTION_WEB_SEARCH),
@@ -1489,7 +1449,6 @@ impl TopAgentPresets {
14891449
.without_section("BACKGROUND_PROCESSES")
14901450
.without_section("SERVICE_READINESS")
14911451
.without_section("PROCESS_MANAGEMENT")
1492-
.without_section("WORKSPACE_CLEANUP")
14931452
.without_section("GEOMETRIC_DATA")
14941453
.build()
14951454
}
@@ -1505,7 +1464,6 @@ impl TopAgentPresets {
15051464
.without_section("BACKGROUND_PROCESSES")
15061465
.without_section("SERVICE_READINESS")
15071466
.without_section("PROCESS_MANAGEMENT")
1508-
.without_section("WORKSPACE_CLEANUP")
15091467
.without_section("DATA_SAFETY")
15101468
.without_section("GEOMETRIC_DATA")
15111469
.with_custom_instructions(
@@ -1541,7 +1499,6 @@ Do NOT modify any files - read-only investigation only."#,
15411499
.without_section("EDGE_CASES")
15421500
.without_section("PRE_COMPLETION")
15431501
.without_section("EXAMPLE_OUTPUT_WARNING")
1544-
.without_section("WORKSPACE_CLEANUP")
15451502
.without_section("AMBITION_PRECISION")
15461503
.without_section("PROGRESS_UPDATES")
15471504
.without_section("WEB_SEARCH")
@@ -1590,7 +1547,6 @@ mod tests {
15901547
assert!(TOP_AGENT_SYSTEM_PROMPT.contains("Task Execution"));
15911548
assert!(TOP_AGENT_SYSTEM_PROMPT.contains("Data Safety and Backups"));
15921549
assert!(TOP_AGENT_SYSTEM_PROMPT.contains("Background Processes"));
1593-
assert!(TOP_AGENT_SYSTEM_PROMPT.contains("Workspace Cleanup"));
15941550
}
15951551

15961552
#[test]
@@ -1607,11 +1563,11 @@ mod tests {
16071563
#[test]
16081564
fn test_builder_without_section() {
16091565
let prompt = TopAgentPromptBuilder::new()
1610-
.without_section("WORKSPACE_CLEANUP")
1566+
.without_section("DATA_SAFETY")
16111567
.build();
16121568

16131569
assert!(prompt.contains("Task Execution"));
1614-
assert!(!prompt.contains("Workspace Cleanup (GC)"));
1570+
assert!(!prompt.contains("Data Safety and Backups (CRITICAL"));
16151571
}
16161572

16171573
#[test]
@@ -1758,7 +1714,7 @@ mod tests {
17581714
assert!(prompt.contains("TOP-AGENT"));
17591715
assert!(prompt.contains("Task Execution"));
17601716
assert!(!prompt.contains("Background Processes (CRITICAL)"));
1761-
assert!(!prompt.contains("Workspace Cleanup"));
1717+
assert!(!prompt.contains("Data Safety and Backups"));
17621718
}
17631719

17641720
#[test]
@@ -1791,7 +1747,6 @@ mod tests {
17911747
assert!(TOP_AGENT_SECTION_NAMES.contains(&"TASK_EXECUTION"));
17921748
assert!(TOP_AGENT_SECTION_NAMES.contains(&"DATA_SAFETY"));
17931749
assert!(TOP_AGENT_SECTION_NAMES.contains(&"BACKGROUND_PROCESSES"));
1794-
assert!(TOP_AGENT_SECTION_NAMES.contains(&"WORKSPACE_CLEANUP"));
17951750
assert!(TOP_AGENT_SECTION_NAMES.contains(&"PROCESS_MANAGEMENT"));
17961751
}
17971752

0 commit comments

Comments
 (0)