Metadata
| Status | done |
|---|---|
| Assigned | agent-168 |
| Agent identity | 3184716484e6f0ea08bb13539daf07686ee79d440505f1fdf2de0357707034c3 |
| Created | 2026-04-26T23:13:10.252404610+00:00 |
| Started | 2026-04-26T23:29:19.969788272+00:00 |
| Completed | 2026-04-26T23:48:32.965567447+00:00 |
| Tags | eval-scheduled |
| Eval score | 0.91 |
| └ blocking impact | 0.90 |
| └ completeness | 0.95 |
| └ coordination overhead | 0.90 |
| └ correctness | 0.95 |
| └ downstream usability | 0.88 |
| └ efficiency | 0.80 |
| └ intent fidelity | 0.37 |
| └ style adherence | 0.90 |
Description
Description
Archive ref refs/archive/wg/agent-337/agency-pipeline-should adds a constraint-fidelity lint to the agency evaluation pipeline:
- New file:
src/agency/constraint_fidelity.rs(+543 lines) - Modifies:
src/agency/mod.rs,src/agency/prompt.rs,src/agency/types.rs,src/commands/evaluate.rs,src/commands/show.rs - Adds tests in:
tests/integration_agency.rs,tests/integration_verify_first.rs,tests/prompt_snapshots.rs,tests/test_prompt_from_components.rs - Total: +762 lines across 10 files
The cherry-pick-valuable task explicitly flagged this as needing design review, not blind cherry-pick. The audit doc docs/audit-unmerged-branches-2026-04-26.md should be consulted.
Required scope of review
- Read the diff:
git diff $(git merge-base main refs/archive/wg/agent-337/agency-pipeline-should)..refs/archive/wg/agent-337/agency-pipeline-should - Review the new constraint_fidelity.rs module — what does it do, how does it integrate with existing FLIP scoring, does it duplicate any existing logic?
- Check whether main has since added similar functionality (the agency module evolved during the wave-1 evaluation work)
- Decide: cherry-pick as-is / cherry-pick with modifications / redesign / drop
- If accepting, do the cherry-pick (+ resolve any conflicts) and add tests
Validation
- Design decision documented in this task description
- If proceeding: cherry-pick committed, cargo build + cargo test pass with no NEW failures (pre-existing fix-wg-done failures excluded)
- If dropping: rationale documented; archive ref left in place for future re-evaluation
Design Decision: CHERRY-PICK AS-IS (committed 7b47846c9)
Source ref: refs/archive/wg/agent-337/agency-pipeline-should (commit 04a8d0c6e)
What it adds
- New module
src/agency/constraint_fidelity.rs(+543 lines, 19 unit tests) - Deterministic regex-based lint that detects orchestrator-fabricated gating constraints in task descriptions:
prohibition(do not, don't, must not, shall not, should not + verb)absolute_never(never + verb)gating_action(leave as draft, wait for review, drafts only, require approval, etc.)restrictive_conditional(only if/when/after, not until)
- Heuristic
find_originating_user_message()that scans<dir>/chat/*/inbox.jsonlfor user-role messages within a 60s-before / 600s-after window of task creation - Concept-anchoring with adjacency: e.g. "draft" anchors "publishing" constraints, "gating" anchors "restriction"
- Wires
constraint_fidelityas a deterministic dimension into the agency evaluation pipeline (parallel tointent_fidelity/FLIP):- New
eval_source::CONSTRAINT_FIDELITYconstant - Two new fields on
EvaluatorInput:constraint_fidelity_score,constraint_fidelity_unanchored - Mechanically injected into evaluator prompt with explicit "do not score this yourself" note
- Surfaced in
wg showoutput (with yellow flag if score < 0.5)
- New
Why cherry-pick (vs redesign or drop)
- No overlap with main — the agency module evolved during wave-1 evaluation work, but
intent_fidelity/FLIP measures self-consistency of description vs agent behavior; both inherit fabricated constraints, so they look consistent. Constraint-fidelity is the missing complementary lens. - Zero conflicts —
git merge-tree --no-messages main 04a8d0c6eproduced no conflict markers; cherry-pick auto-merged cleanly. - Real failure mode this targets — the existing memory note
feedback_autopoietic_means_publish.mddocuments that the orchestrator was historically inserting "leave as draft" gating that wasn't in the user's request. This lint is purpose-built to catch exactly that. - Modest, well-isolated — +762 lines, almost entirely in one new module. The 17 call-site additions to
EvaluatorInputconstructors are mechanical (constraint_fidelity_score: None, constraint_fidelity_unanchored: None). - Free at runtime — pure-regex deterministic lint, no LLM call.
- Generous false-positive avoidance —
test_normal_task_description_no_false_positives,test_validation_section_not_flagged,test_should_not_match_only_aloneall cover common-case task descriptions.
Known limitations (acceptable for initial deployment, can calibrate later)
- The
generic_gatingbenefit-of-the-doubt path is permissive: if the user message contains ANY restriction language ("don't deploy until tests pass"), all constraints in the description get auto-anchored. This will under-report fabrication when the user gave one constraint but the orchestrator added five. Calibration data from production runs can tighten this. find_originating_user_messageis best-effort and untested at integration level (only the lint logic has unit tests). ReturnsNoneif chat dir layout shifts or task created via CLI without chat context — graceful degradation to standalone mode.- Standalone-mode score floor of 0.1 means 6+ unanchored constraints all score the same.
Validation
cargo build: passes (warnings only, all pre-existing)cargo test --lib: 1971/1971 passcargo test --lib agency::constraint_fidelity: 19/19 passcargo test --test integration_agency: 5/5 passcargo test --test integration_verify_first: 8/8 passcargo test --test prompt_snapshots snapshot_evaluator: 4/4 passcargo test --test test_prompt_from_components: 13/13 pass- The 5
snapshot_build_prompt_*failures inprompt_snapshots.rsare PRE-EXISTING on main (verified by running tests onHEAD~1before this cherry-pick); they involvebuild_promptrendering, not the evaluator prompt that agent-337 modifies.
Commit
7b47846c9 feat: add constraint-fidelity lint to agency evaluation pipeline
Pushed to origin/wg/agent-168/design-review-agency.
Depends on
Required by
- (none)
Log
- 2026-04-26T23:29:19.775123262+00:00 Lightweight assignment: agent=Default Evaluator (31847164), exec_mode=full, context_scope=task, reason=Evaluator role is purpose-built for design review and architectural decisions; highest confidence score (0.94) with 28 prior tasks.
- 2026-04-26T23:29:19.969790887+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-26T23:29:35.131902142+00:00 Starting design review of agent-337/agency-pipeline-should constraint-fidelity lint
- 2026-04-26T23:31:49.698897186+00:00 Analysis complete. agent-337 introduces deterministic regex lint detecting fabricated gating constraints in task descriptions (do NOT, never, leave-as-draft, gating-conditionals). Compares against user message via heuristic chat-inbox lookup with concept-anchoring + adjacency. NO equivalent on main. Complements FLIP (self-consistency). git merge-tree shows zero conflicts. 19 unit tests + integration test updates included. Decision: CHERRY-PICK AS-IS.
- 2026-04-26T23:47:30.422008270+00:00 Cherry-pick committed: 7b47846c9. Build passed (warnings only, all pre-existing). Tests: 19/19 constraint_fidelity unit tests pass, 4/4 evaluator snapshots pass, 5/5 integration_agency, 8/8 integration_verify_first, 13/13 test_prompt_from_components, 1971/1971 lib tests pass. The 5 snapshot_build_prompt failures are PRE-EXISTING on main (verified by running on HEAD~1) and unrelated to this cherry-pick. Pushed to origin.
- 2026-04-26T23:48:26.806762383+00:00 Validated: design decision documented in task description. Cherry-pick committed (7b47846c9), pushed to origin. cargo build + cargo test pass with NO new failures. The 5 pre-existing snapshot_build_prompt failures on main are unrelated and pre-date this work.
- 2026-04-26T23:48:32.965588898+00:00 Task marked as done