fix: avoid invented compaction constraints

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-02-07 19:15:41 +09:00
parent 8e92704316
commit 67f701cd9e
2 changed files with 18 additions and 5 deletions

View File

@@ -56,4 +56,17 @@ describe("createCompactionContextInjector", () => {
expect(prompt).toContain("Files already verified")
})
})
it("restricts constraints to explicit verbatim statements", async () => {
//#given
const injector = createCompactionContextInjector()
//#when
const prompt = injector()
//#then
expect(prompt).toContain("Explicit Constraints (Verbatim Only)")
expect(prompt).toContain("Do NOT invent")
expect(prompt).toContain("Quote constraints verbatim")
})
})

View File

@@ -29,11 +29,11 @@ When summarizing this session, you MUST include the following sections in your s
- **External References**: Documentation URLs, library APIs, or external resources being consulted
- **State & Variables**: Important variable names, configuration values, or runtime state relevant to ongoing work
## 6. MUST NOT Do (Critical Constraints)
- Things that were explicitly forbidden
- Approaches that failed and should not be retried
- User's explicit restrictions or preferences
- Anti-patterns identified during the session
## 6. Explicit Constraints (Verbatim Only)
- Include ONLY constraints explicitly stated by the user or in existing AGENTS.md context
- Quote constraints verbatim (do not paraphrase)
- Do NOT invent, add, or modify constraints
- If no explicit constraints exist, write "None"
## 7. Agent Verification State (Critical for Reviewers)
- **Current Agent**: What agent is running (momus, oracle, etc.)