Commit e765a3b
authored
Stage 2's main agent listed `.claude/agents/bess-analyst.md` (25,681 B) as
REQUIRED READING item 3. That file IS the bess-analyst sub-agent's system
prompt -- frontmatter `name: bess-analyst`, `tools: Read, Grep, Glob, Bash,
WebFetch` -- so the main agent was loading a second copy of another agent's
instructions into its own context, on every turn.
Nothing consumed it. The six PROCESS steps are: get issue context, identify
the current problem, delegate, verify the cited file:line, publish, label.
No step applies a "domain expertise checklist". The one distinctive task,
step 4, needs the cited code -- not a triage procedure the main agent never
runs.
The content was in fact loaded three times. The section that could plausibly
serve as a judging standard, "Separate Evidence from Claims", is already
restated almost verbatim in the sub-agent task the same prompt passes:
hypothesis-not-diagnosis, triage-the-bundle-first, verify-the-code-path-
matches-this-user's-setup, intentional-design-is-not-a-bug. Sub-agent system
prompt, main-agent file read, and inline paraphrase.
All four landed Stage 2 analyses (#118, #252, #624, #627) use the workflow's
four headings, never bess-analyst.md's seven-item Output Format or its
six-item type-B shape -- the main agent follows the prompt, not the file.
So item 3 is removed, with an explicit note saying why, and step 4 gains the
check that was missing: a report fails verification if it claims a CODE bug
with no file:line, if a cited location does not say what is claimed, or if
it blends P-optimality / forecast error / control noise into one verdict
when actual behavior diverged from plan. Dead weight becomes an instruction
that fires.
Three things the first draft got wrong, found in review:
- "cites no file:line" alone would have rejected CORRECT diagnoses. The same
prompt tells the analyst that unavailable sensors, wrong inverter type or
an HA integration mismatch are likely the real cause, and those cite no
code. Now qualified to code-bug claims only.
- The inconclusive path never removed `ready-for-analysis`, and
backlog-digest.sh checks that label BEFORE `needs-human-review`, so the
backlog pass reports the issue as un-analysed and re-dispatches analyze --
re-billing the stage. Widening that path without fixing it would have made
a cost bug worse. It now clears the label.
- The new criterion used vocabulary defined only in the file this diff stops
the agent reading. P-optimality had a gloss; P≠R never expanded P or R and
control noise had no definition. All three are now glossed inline.
quality-check.sh gains a context contract gate, written RED first: no
workflow may list a `.claude/agents/*.md` file as a numbered required read,
and Stage 2 must still delegate. Both assertions were mutation-tested --
removing the delegation reddens it, and reformatting `subagent_type` with
backticks or quotes does not, which the first bare-substring version got
wrong in both directions.
Saving is up to 25,681 B off the main agent per turn; the prompt itself grew
7,098 -> 7,821 B, so net is roughly -24.9 KB. "Up to", because whether a run
obeyed the read instruction is not observable -- #646 showed it need not.
No CHANGELOG entry: agent-facing, zero user-visible effect, as #649 and #651.
Closes #654
1 parent dd47d59 commit e765a3b
2 files changed
Lines changed: 94 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
123 | 153 | | |
124 | 154 | | |
125 | 155 | | |
| |||
169 | 199 | | |
170 | 200 | | |
171 | 201 | | |
172 | | - | |
| 202 | + | |
173 | 203 | | |
174 | 204 | | |
175 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
518 | 580 | | |
519 | 581 | | |
520 | 582 | | |
| |||
0 commit comments