Skip to content

bug: /forge command review-before-complete ordering collapses under context compression #47

Description

@jflowers

Summary

internal/agentkit/content/command/forge.md defines a 9-step workflow where Step 7 (review) must happen before Step 8 (complete). Under DCP context compression, this ordering dependency is the most likely thing to be lost — the two steps get compressed into a single "review and complete workers" action, allowing the agent to skip reviews or complete before reviewing.

Related to unbound-force/unbound-force#346 — same class of vulnerability (prompt constraints that do not survive context compression).

Specific Fragilities

1. Review-before-complete ordering (lines 21-22)

7. Review: forge_review(task_id, files_touched) for each completed worker
8. Complete: forge_complete(bead_id, summary, files_touched)

Numbered steps preserve ordering better than bullets, but a compressor summarizing a 9-step workflow is likely to merge these into "review and complete." The review step IS the quality gate.

2. Critical rule buried in middle of list (line 31)

- Review every worker's output before marking complete

Fifth of six bullets in the "Rules" section. Compressors tend to keep first and last items and drop the middle. This is the most important rule in the file and has the lowest compression survival position.

3. Error Recovery section dropped entirely (lines 61-67)

The "what to do when things go wrong" section is the first thing compressors drop — it looks like supplementary content. A coordinator with compressed context encountering a blocked worker would have no recovery instructions and could stall indefinitely or skip the blocked worker.

4. Strategy Selection section dropped (lines 34-42)

forge_get_strategy_insights call gets dropped, meaning the agent always uses default decomposition instead of learning from historical outcomes.

Proposed Hardening

  • Embed the ordering constraint directly in the step text: "7. Review FIRST: forge_review(...) — MUST complete before step 8"
  • Move "Review every worker before marking complete" from 5th bullet to 1st bullet, or promote to its own section header
  • Add a "Critical Invariants" section at the top of the file (before Workflow) that states the non-negotiable rules — compressors prioritize opening content
  • Consider inlining error recovery guidance at the monitoring step rather than as a separate section at the end

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions