docs(#5751): document compose/diff bidirectional invariant - #5753
Conversation
Add docs/contributing/harness-composition.md documenting the requirement that merge functions in compose.go/forge.go and path-rewriting functions in migrate.go must stay in sync when harness fields are added or modified. The doc lists the current paired functions, explains why the invariant matters (PR #5450 regression), and provides a checklist for harness field changes. Add a corresponding row to the AGENTS.md guidance table so agents and contributors discover this constraint when modifying harness merge, diff, or migration code. Note: pre-commit could not run (git fetch blocked by sandbox network policy, exit 3). Post-script runs authoritative pre-commit. Closes #5751
|
🤖 Finished Review · ✅ Success · Started 8:40 AM UTC · Completed 8:52 AM UTC |
Site previewPreview: https://c81a58ad-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsMedium
Low
Labels: PR adds documentation about harness composition invariant |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 11:58 AM UTC · Completed 12:04 PM UTC |
The invariant description and AGENTS.md trigger mentioned "diff functions" alongside merge and path-rewriting functions, but no diff functions exist in internal/harness/ or internal/cli/migrate.go. The paired function tables correctly omitted them, creating an internal inconsistency. Remove "diff" from the prose and trigger to match the actual function inventory. Addresses review feedback on #5753
🔧 Fix agent — iteration 1 (human-triggered)Addressed 2 of 2 actionable review findings by removing spurious 'diff' references from the harness composition doc (lines 3 and 28) and the AGENTS.md trigger column. The protected-path finding is informational and handled by existing enforcement. Fixed (2):
Disagreed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 12:05 PM UTC · Completed 12:21 PM UTC |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 1:39 PM UTC · Completed 1:45 PM UTC |
Add a blockquote in "How they correspond" explaining that DiffHarness and diffForgeConfig were removed per ADR-0045, bridging the gap between issue #5751's "compose/diff" framing and the actual compose/migration invariant this document covers. Add a "When reviewing PRs" section with severity guidance for flagging merge-function changes missing counterpart rewrite-function updates. Addresses review feedback on #5753
🔧 Fix agent — iteration 2 (human-triggered)Addressed 3 of 4 review findings. Added a diff-function provenance note explaining why DiffHarness/diffForgeConfig are absent (resolving both the consumer-completeness and terminology-consistency findings), and added a 'When reviewing PRs' section with reviewer severity guidance. Disagreed with 1 finding (protected-path is informational enforcement, not fixable). Fixed (3):
Disagreed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 1:46 PM UTC · Completed 2:01 PM UTC |
|
🤖 Finished Retro · ✅ Success · Started 9:29 AM UTC · Completed 9:47 AM UTC |
Retro: PR #5753 — docs(#5751): document compose/diff bidirectional invariantTimeline
Total: 3 review cycles, 2 fix iterations, 6 days wall-clock for a 122-line docs-only PR. What went well
Improvement opportunities (all covered by existing issues)All candidate proposals overlap with existing open issues. Evidence from this PR is noted below for each cluster. 1. Cascading new findings on re-review — Each review iteration raised entirely new findings on largely unchanged content. Review 2 raised a medium-severity "consumer completeness" finding that was equally true during Review 1 (the doc always covered migration rather than diff). Review 3 raised stylistic nits about heading format that existed since the fix iteration 2 commit. The root cause (per configuration analysis of
2. Code agent did not verify referenced code artifacts exist — Issue #5751 used "compose/diff" framing. The code agent faithfully wrote about "diff functions" without checking whether
3. Low-severity stylistic nits driving fix cycles on docs PRs — Reviews 2 and 3 were dominated by low-severity findings about section structure conventions. The human chose to ignore them. The
Workflow qualityThe overall workflow functioned correctly — triage → code → review → fix → re-review → human approval. The fix agent and human reviewer both performed well. The primary inefficiency was the review agent's cascading findings pattern, which turned a simple docs PR into a 3-review, 2-fix cycle. This is a known architectural property with extensive existing issue coverage, not a novel problem. |
Summary
Documents the bidirectional invariant between merge/compose functions and path-rewriting/diff functions in the harness package. This constraint was undiscoverable by agents, causing PR #5450 to fail through 6 fix iterations when field-level merge changes in
compose.gowere not mirrored in the migration path-rewriting code.Related Issue
Closes #5751
Changes
docs/contributing/harness-composition.mdwith:compose.go,forge.go) and path-rewriting side (migrate.go)internal/harness/orinternal/cli/migrate.go"Testing
make lintdeferred to post-script (pre-commit sandbox network issue)Checklist
!for breaking changes)Closes #5751
Post-script verification
agent/5751-compose-diff-invariant-docs)c9df5fedf91d54a0d0debffed98598908959e4c0..HEAD)