fix: harden worker prompt against context compression - #57
Open
jflowers wants to merge 1 commit into
Open
Conversation
Restructure worker.md to make critical behavioral constraints compression-resistant by integrating them inline with checklist steps using MUST/NEVER language. Addresses unbound-force#49. - Integrate file reservation, progress reporting, and learning storage constraints directly into the checklist steps they govern - Add reservation failure recovery path (STOP + comms_send) - Remove separate Constraints section (compression-vulnerable) - Add TestWorkerPrompt_HardenedStructure content-verification test - Add OpenSpec change artifacts (proposal, design, specs, tasks) Assisted-by: claude-opus Generated with AI assistance (claude-opus)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens
worker.mdagent prompt against LLM context compression by restructuring critical behavioral constraints. Fixes #49.The worker's file reservation enforcement, progress reporting requirements, and learning storage constraints were in a separate "Constraints" section vulnerable to being summarized away by context compressors. This restructuring integrates each constraint inline with the checklist step it governs, making them atomic units that compressors must keep or drop together.
Key changes:
comms_sendto coordinator)## Constraintssection eliminatedHow to Test
Verify structurally:
worker.mdhas no## Constraintsheadingcomms_reserve) includes "NEVER edit unreserved files" and reservation failure recoveryHow to Demo
Compare the before (separate Constraints section with flat bullets) to the after (all constraints inline with numbered steps). Each step now reads as "do X — MUST/NEVER Y" rather than having the constraint in a disconnected section.
Key Files Changed
internal/agentkit/content/agents/worker.mdinternal/agentkit/agentkit_test.goTestWorkerPrompt_HardenedStructure— structural verification test for the hardened promptopenspec/changes/harden-worker-prompt/This PR was generated by /uf.finale (AI-assisted).