Skip to content

chore(loop): settle whether a routine files the defect it trips over - #152

Merged
Ardnived merged 12 commits into
mainfrom
claude/chore-146-incidental-findings
Oct 6, 2026
Merged

Ardnived merged 12 commits into
mainfrom
claude/chore-146-incidental-findings

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A routine now files every real defect it trips over, and an ask-first repo guide no longer binds a run with nobody to ask.
  • The four handlers that disagreed about this — caps of none, one, one, and silence — now cite one rule, stated once.

Change outline

Contract — what each handler now says

The loop's rule set is prose, so this is the contract. One rule per line, in the section that holds it.

workflow/skills/handler-preflight/SKILL.md, in Rules that hold in every handler — the one statement:

  - Feedback is assignment.respondTo, an allowlist.
+ - File every incidental finding.
+ - A product repo's ask-first guidance does not bind a run with nobody to ask.
+ - Locally, ask the person.
+ - In scope for the PR you hold → fix it there, and never widen that PR for one that is not.
+ - At or under findings.directFixMaxFiles files, inside prAllowlistGlobs → a ticketless PR,
+   where the handler opens PRs at all.
+ - Anything else → a ticket, through /workflow:triage-issue.
+ - No handler caps this.
  - Every unit of work is idempotent.

The four handlers, each keeping only what is true of itself:

  implement-issue, step 4
- A real defect found on the way is filed through /workflow:triage-issue, every time, with no ceiling.
- Fix it here only when it is part of this ticket.
+ File what you trip over, as preflight's incidental-finding rule routes it.
+ Fold the fix into this PR only when the defect is this ticket's.

  answer-ticket, revise-ticket — Hard rules
- Never file more than one incidental ticket.          (revise-ticket: … Name the rest in the comment.)
+ Never cap or drop an incidental finding. Preflight routes it.
+ This handler writes prose, so every one of them is a ticket.
+ Name each ticket you filed in the reply / comment.

  adversarial-review, Stance
+ A real defect that is not this PR's is still filed.
+ A critic never touches the branch, so here it is always a ticket.
+ Name it in the holistic assessment as well.
+ Never park it on an unrelated line as an inline comment.

  survey-routine, the ceiling table's note
- Never discard a real finding to respect a number, and never ask permission to file one.
+ Never discard a real finding to respect a number. Preflight routes it.

Files — the responsibility that moved

Routing a finding was decided in four places, each differently, and nowhere for the critic. It is decided in one place now, and the handlers hold only their own constraint.

workflow/skills/
  handler-preflight/SKILL.md     ← the rule, +5 lines on the every-dispatch path
  implement-issue/SKILL.md       → cites it; keeps "fold it in when it is this ticket's"
  answer-ticket/SKILL.md         → cites it; prose handler, so always a ticket
  revise-ticket/SKILL.md         → cites it; prose handler, so always a ticket
  adversarial-review/SKILL.md    → cites it; had no rule at all before
  survey-routine/SKILL.md        → keeps the proposal ceiling's scope, drops the duplicate

loop-config.json                 ← findings.directFixMaxFiles: 2    (new key, new section)
workflow/.claude-plugin/plugin.json  ← 2.4.0 → 2.6.0, clear of main's 2.5.0
docs/why.md                      ← one anchor, cited by the new bullet
AGENTS.md                        ← the key list gains `findings`

main moved to 2.5.0 in #147 after this branch was cut, so c41fe55 merges main in and af7e543 takes the version to 2.6.0. An unchanged version is an unchanged plugin cache key, and these four skill changes would have reached no installed plugin.

Test results

Manual verification

  1. The removals were deliberate, not dropped. rule-delta reports one, and three more are sub-directive. All four are rules that moved rather than rules that went away:
    • implement-issue: "every time, with no ceiling" → preflight's "No handler caps this".
    • answer-ticket, revise-ticket: "Never file more than one incidental ticket" → the cap the decision on chore(loop): settle whether a routine files the defect it trips over #146 removes.
    • revise-ticket: "Name the rest in the comment" → restored as "Name each ticket you filed", since with no cap there is no rest.
    • survey-routine: "never ask permission to file one" → preflight's first sentence. Its ceiling table stays, because it scopes the proposal ceiling rather than restating the routing.
  2. No number or label name is hard-coded. The bound is findings.directFixMaxFiles; no changed SKILL.md line carries a literal number.
  3. The rule is stated once. grep -rn "incidental" workflow/skills/ returns the statement in handler-preflight plus one cross-reference per handler.
  4. git merge-tree against main is clean, and the merge in c41fe55 conflicted nowhere.

Notes for reviewer

The decision this implements is Ardnived's, on #146: file whenever a significant issue is hit, fold the fix into the PR being worked on when it belongs there, open a direct PR instead of a ticket when the change is small (~3 files), raise a ticket otherwise. The ticket's own recommendation ("file it, every time") is the same answer.

One judgement call to check. AGENTS.md's one hard split forbids shipping a skill change and a ceiling change together, and this PR carries both a skill change and a new number. I shipped them together because findings.directFixMaxFiles is a new key no code read before this PR, not a tuning of ceilings — it cannot have moved a run's output on its own, so the attribution problem the split exists to prevent does not arise. Splitting it would have meant one PR with an orphan key and one with a rule citing a missing key. It is commit e212a9b alone, so it reverts without touching the rule. If you read the split as binding anyway, that revert is the whole fix.

One /code-review finding left open, deliberately. The new ticketless-PR route has no branch-naming convention and no dedupe step of its own, while the ticket route is protected by triage-issue's duplicate search. implement-issue step 2's resume search is keyed on the ticket number (claude/*-<number>-*), so a dead attempt's incidental PR is invisible to attempt 2 — which could re-trip the defect and open a second PR. Preflight's next bullet ("Every unit of work is idempotent. Check for an existing branch, PR, reply, or child issue before you create one") carries the duty generically, but not the mechanism. Naming a convention for incidental branches is new machinery and more than #146 asked for, so it wants its own decision rather than a guess here.

The SahajCloud edit is still owed. #146's second open question asked for the downstream change in the same run. git push to that repo was refused by the implementing session's permission classifier, so one line on SahajCloud/AGENTS.md:21 needs an attended run. docs/why.md says owed, not filed, since 1fa22fb.

Detail

Why not the two rejected shapes. Both are in docs/why.md under the new anchor. PR body only is honest for implement-issue, impossible for the two prose handlers and the critic, which open no PR — and it loses every finding whose PR merges, which is all of them. One standing ticket per repo needs a new label plus a new -label: exclusion in every worklist query the loop ever adds, the exact hazard ops-journal already makes every author re-check, and the standing ticket would sit awaiting forever.

The four /code-review findings fixed in e1c87f0. The rule sits in the every-handler section, so its edges reached handlers the first draft had not considered:

  • The fold-it-in clause gave fix-ci, resolve-conflicts and address-review licence to widen a PR already heading for human review. The never-widen guard moved out of implement-issue into the bullet, where it binds everyone.
  • The ticketless-PR route read as mandatory once the size fit, which the survey handlers cannot do — they hold no Edit or Write grant, and would have hit "never improvise around a missing tool" and dropped the finding. It is now conditional on the handler opening PRs at all.
  • docs/why.md claimed SahajCloud's line "was extended", in a repo this branch does not touch. That attempt was incomplete — it still read "filed beside the one that added this entry" — and 1fa22fb makes it say owed.
  • Dropping "Name the rest in the comment" removed the only instruction that surfaced a filed finding in the thread the human watches. Both prose handlers now name every ticket they filed.

The adversarial review's four findings, addressed in this push. Adopted three, rebutted one:

  • blocker, plugin.json:4 — the version collided with main. c41fe55 merges main, af7e543 takes 2.6.0. Resolved.
  • should-fix, preflight:59 — "Nobody is here to ask" was asserted, not conditioned, in a section that holds in every mode, while docs/why.md says an attended session is still bound. fcc9ed4 conditions it with "Locally, ask the person", the idiom implement-issue already uses. Resolved.
  • should-fix, why.md:227 — the SahajCloud PR was claimed filed. 1fa22fb says owed. Resolved.
  • consider, loop-config.json:20 — findings versus ceilings.directFixMaxFiles. Rebutted and left open: ceilings's own $comment scopes it to caps the dispatcher enforces, and this bound is applied by a handler run. Moving it would also turn this into the skill-plus-ceiling pairing AGENTS.md forbids.

Length cost, paid knowingly. handler-preflight is read on every dispatch, 25–40 times a day, so the bullet is five lines and the story is one hop away in docs/why.md. The conditioning sentence added no line. It replaces statements in four other files, two of which are also run-loaded.

Two anomalies from the implementing run, reported not explained. git worktree add .claude/worktrees/<slug> was refused by that session's permission classifier, despite .claude/worktrees being exempt from Protected Paths; the run took implement-issue step 6's documented --no-worktree fallback and worked on a plain branch. Separately, a script-driven edit to a SKILL.md was refused as instruction poisoning; the edits were made with the Edit tool instead, which shows each replacement.

One anomaly from this run. address-review/SKILL.md:69 cites docs/why.md#the-queue-owns-staleness-you-own-conflicts, and no such heading exists in docs/why.md. Not this PR's scope, so not fixed here.

/simplify was not fanned out. Its four angles are code-shaped — reuse, repeated I/O, closures holding scope alive. The two that transfer to prose were applied directly: the answer-ticket/revise-ticket near-duplication is inherent, since each skill is read standalone and the rule itself is stated once; and the bullet is at the right altitude, in the one file every dispatch reads, which is the gap #146 named as "the defect, not either rule".

Closes #146

🤖 Generated with Claude Code

https://claude.ai/code/session_01JvPB9UVQLfrFNx77Jtw64t

claude added 7 commits October 5, 2026 23:31
Refs #146. A new value, read by the incidental-finding rule the next
commit adds to handler-preflight. Nothing read it before this PR, so it
cannot have moved a run's output on its own — it is not a tuning of
`ceilings`, and the one hard split in AGENTS.md does not apply.

Two files is the bound Ardnived named on #146 ("less than ~3 files").
It lives here, not in a SKILL.md, because a threshold is a data edit.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01He4xaTae1P7ecgGPccgwBn
Closes #146's first criterion. Nine sessions in the week to 2026-10-03
found real defects in SahajCloud, read `SahajCloud/AGENTS.md:21` as
forbidding an unattended ticket, and wrote each finding into a PR body
instead. Four of the nine were access-control gaps. A PR body is a
one-time read, and none of those PRs was the finding's owner.

Nothing stated precedence between a product repo's guide and these
skills, so the sessions were not misreading anything — the rule set had
a hole. This bullet closes it where a handler reads it, on the
dispatch-time path, in one bullet: an ask-first instruction cannot bind
a run with nobody to ask, and the finding is routed rather than dropped.

The routing is Ardnived's decision on #146: fold it into the PR you
hold when it belongs there, open a ticketless PR when it is small
enough, file a ticket otherwise.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01He4xaTae1P7ecgGPccgwBn
Closes #146's second and third criteria. Before this commit the four
handlers disagreed, independently of any repo guide:
implement-issue capped nothing, answer-ticket and revise-ticket capped
at one, and adversarial-review was silent — so a critic's finding that
was not its PR's had no home at all.

Each now cross-references the one statement in handler-preflight and
adds only what is true of itself: implement-issue may fold a fix into
the PR it holds, the two prose handlers can only file, and the critic
can only file because it never touches the branch.

Removals, all of them rules that moved rather than rules that went
away:

- implement-issue: "every time, with no ceiling" — now preflight's "No
  handler caps this".
- answer-ticket, revise-ticket: "Never file more than one incidental
  ticket" — the cap Ardnived's decision on #146 removes.
- revise-ticket: "Name the rest in the comment" — with no cap there is
  no rest to name.
- survey-routine: "never ask permission to file one" — now preflight's
  first sentence. Its ceiling table stays, because it scopes the
  proposal ceiling rather than restating the routing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01He4xaTae1P7ecgGPccgwBn
Closes #146's fourth criterion. One anchor, named after the new rule
and cited by it, carrying the failure: the nine lost findings, the
SahajCloud line that already half-carved this out, the four-way
disagreement between the handlers, and the cost each rejected
alternative carried.

The imperative survives without it — handler-preflight states the whole
rule inline, and this entry adds no instruction of its own.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01He4xaTae1P7ecgGPccgwBn
Closes #146's fifth criterion. An installed plugin caches skills under
a directory named after `version` and never revisits the commit it
pinned, so a skill change that leaves `version` alone reaches the two
cloud routines and nothing else.
(why: docs/why.md#an-installed-plugin-does-not-track-main)

The docs sync is one cell: AGENTS.md's layout table enumerates
loop-config.json's keys, and this PR adds `findings`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01He4xaTae1P7ecgGPccgwBn
No rule changes. The paragraph added two commits ago broke mid-sentence
at a line end, which reads as two instructions rather than one.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01He4xaTae1P7ecgGPccgwBn
The rule sits in preflight's every-handler section, so four of its
edges reached handlers the first draft had not thought about.

- The fold-it-in clause gave `fix-ci`, `resolve-conflicts` and
  `address-review` a licence to widen a PR already heading for human
  review. The never-widen guard moves from implement-issue into the
  bullet, where it binds every handler. implement-issue keeps only the
  fold permission that is its own.
- The ticketless-PR route read as mandatory once the size fit, which
  the survey handlers cannot do — they hold no Edit or Write grant, and
  would have hit "never improvise around a missing tool" and dropped
  the finding. The route is now conditional on the handler opening PRs.
- `docs/why.md` claimed SahajCloud's line "was extended", a repo this
  branch does not touch. It now names the companion PR as separate.
- Dropping "Name the rest in the comment" removed the only instruction
  that surfaced a filed finding in the thread the human watches. Both
  prose handlers now name every ticket they filed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01He4xaTae1P7ecgGPccgwBn
@sydevs-bot

sydevs-bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 05:30Z resolve-conflicts · attempt 1 · session · done
  • 05:30Z resolve-conflicts · attempt 1 · session
  • 00:44Z address-review · attempt 1 · session · done
  • 00:44Z address-review · attempt 1 · session
  • 00:33Z adversarial-review · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 6, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The rule is in the right file, and four handlers now cite it instead of disagreeing.

Both defects share one root: the branch predates a45fc7d (#147), merged to main after the cut. main is already 2.5.0, so the bump is a no-op and no installed plugin sees these skills. main's hooks.json is already quoted, so the gate exits 0 there and 1 only here — "fails identically on main" is false, and #154 duplicates a merged fix. Merge main in.

Findings

  • blocker — version collides with main → plugin.json:4
  • should-fix — "Nobody is here to ask" binds attended runs → preflight:59
  • should-fix — the SahajCloud PR is claimed filed → why.md:227
  • consider — a new config section for one number → loop-config.json:20

What was checked

#146 and its comments, the diff, six SKILL.md whole, both preflight modes. plugin validate --strict: 0 on main, 1 here. merge-tree is clean at 2.5.0. rule-delta 62 → 62 matches. No SahajCloud API here; the claim is judged on the run's #146 comment.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread workflow/.claude-plugin/plugin.json Resolved
Comment thread docs/why.md Resolved
Comment thread loop-config.json Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 6, 2026
sydevs-bot and others added 4 commits October 6, 2026 00:48
`main` moved to 2.5.0 in #147 after this branch was cut, so the branch's own
bump to 2.5.0 was a no-op: the plugin cache key is `version`, and an unchanged
key keeps the old cache. #147 also quoted ${CLAUDE_PLUGIN_ROOT} in
workflow/hooks/hooks.json, which is what made the lean gate exit 1 here and 0
on `main`. Both are fixed by taking main.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JvPB9UVQLfrFNx77Jtw64t
main reached 2.5.0 in #147 after this branch was cut, so this branch's bump
collided with it and resolved to a no-op. The plugin cache lives in
~/.claude/plugins/cache/sydevs/workflow/<version>/ and is never revisited, so
an unchanged version string means the four skill changes here reach no
installed plugin at all. 2.6.0 is the first value above main's.
(why: docs/why.md#an-installed-plugin-does-not-track-main)

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JvPB9UVQLfrFNx77Jtw64t
"Nobody is here to ask" was asserted, not conditioned, in a section headed
"Rules that hold in every handler" — and Local mode waives only steps 2, 3
and 5. An attended /workflow:implement-issue therefore read the bullet as
licence to ignore a product repo's ask-first line, which docs/why.md says
still binds an attended session. Conditioned with "Locally, ask the person",
the idiom implement-issue already uses for three rules. No line added to the
every-dispatch path.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JvPB9UVQLfrFNx77Jtw64t
docs/why.md said the SahajCloud carve-out was extended by "a separate PR to
that repo, filed beside the one that added this entry", and the PR body said
the same. The run's own comment on #146 says the opposite: git push to that
repo was refused, so the line needs an attended run. A story file keeps its
claim permanently, so it now says the edit is owed rather than filed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JvPB9UVQLfrFNx77Jtw64t
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Three findings adopted, one rebutted. Pushed 1fa22fb.

The gate claim fell with the version. main's hooks.json is already quoted, so plugin validate --strict now exits 0 here. #154 duplicates a merged fix and should close. Body refreshed.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 6, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 6, 2026 00:54
@sydevs-bot
sydevs-bot requested a review from Ardnived October 6, 2026 00:54
@sydevs-bot sydevs-bot added awaiting bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Oct 6, 2026
GitHub reported this PR conflicting after #151 and #153 merged. One hunk
conflicted: plugin.json's version. Both sides bump it for the same reason,
so neither side wins — main took 2.6.0 in #151 and 2.7.0 in #153, and the
plugin cache key is the version string, so this branch's 2.6.0 would have
resolved to a no-op and reached no installed plugin. 2.8.0 is the first
value above main's.

Everything else merged clean and additive: the incidental-finding bullet
sits beside #153's reviewBody rules in handler-preflight, findings beside
writing.budgets in loop-config.json, and main's budget.mjs, finalize-pr
and reflect changes come through untouched. rule-delta still reports
62 → 62 directives with the same one removal the body adjudicates, so the
merge dropped no rule.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013NdyinyrMRWyxZowgEtQ5D
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main (ef83cfb) in cc65805. One hunk conflicted: plugin.json's version.

Both sides bump it for the same reason, so neither side won. main took 2.6.0 in #151 and 2.7.0 in #153, and the plugin cache key is the version string — this branch's 2.6.0 would have resolved to a no-op. The merge takes 2.8.0, the first value above main's.

Everything else merged additively: the incidental-finding bullet now sits beside #153's reviewBody rules in handler-preflight, findings beside writing.budgets in loop-config.json, and main's budget.mjs, finalize-pr and reflect changes come through untouched.

Gate green. rule-delta still reports 62 → 62 directives with the one removal the body adjudicates, so the merge dropped no rule.

The body's change outline still reads "2.4.0 → 2.6.0, clear of main's 2.5.0". The branch carries 2.8.0 now.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 6, 2026
@Ardnived
Ardnived merged commit bd00081 into main Oct 6, 2026
10 checks passed
@Ardnived
Ardnived deleted the claude/chore-146-incidental-findings branch October 6, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

chore(loop): settle whether a routine files the defect it trips over

3 participants