Repository navigation
fix(loop): the awaiting census could never see a PR - #47
Conversation
`mcp__github__search_issues` scopes to `is:issue` when a query names no `is:` qualifier — the tool says so in its own description — and the census's `awaiting` query was `$SCOPE is:open label:awaiting`, with none. Every item carrying `awaiting` is currently a pull request, so that query returned zero for three consecutive runs while three PRs sat waiting on the reviewer. Two runs journalled it under `⚠️ Failed` as a fault of the label or the index. Measured against the same live data those runs saw: $SCOPE is:open label:awaiting -> 0 $SCOPE is:pr is:open label:awaiting -> 3 (#692 #691 #686) repo:sydevs/SahajCloud is:issue ... label:awaiting -> 0 repo:sydevs/SahajCloud is:open author:sydevs-bot -> 8, all issues (control) The control is what settles it: the omission hides PRs from any query, not only a label one. The label sits on issues and on PRs alike, so seeing both takes two queries; one cannot be made to do it. The general rule is stated as preflight rule 7 beside the `>` gotcha, which is the same class of failure — a qualifier problem that returns zero without erroring, and so reads as "nothing qualifies". The two other census queries that omitted the qualifier are ticket sweeps by intent (`mentions:` in preflight, `commenter:` in survey-routine). Both gain `is:issue` explicitly. Neither changes behaviour — they already returned issues only — but a census that states rule 7 while quietly breaking it is how the next reader learns to disbelieve the rule. Whether a mention of the bot ON a PR should count as feedback is a real question this does not answer, and deliberately: it has not been measured, and it would be a second behaviour. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BWsjnBcL2v4LZ4dPjCeJeP
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Holistic assessment. The diff is the size of the problem: one census query becomes two, one rule states why, one docs/why.md heading carries the story. Nothing here is an abstraction for one caller, no ceiling or config value moves, and the root cause was established against the live defect — the author:sydevs-bot control row is what turns this from a label patch into a rule, and it is the right evidence for a repo where you cannot validate a change by running it. Two claims in the body outrun the diff, though, and both are about scope stated rather than code written: the mentions query now hard-codes the narrow answer while preflight rule 4 still promises the wide one, and the new is:pr label:awaiting set quietly gives survey-routine's awaiting drift sweep a PR input it has never had — a second behaviour, in a file this PR already edits. No cross-repo contract surface is touched; the blast radius is the next run of both routines in all five repos, which is the norm here.
Findings
- should-fix —
preflight/SKILL.md:148: rule 4's "Never let one pass silently" is now false for mentions on PRs, and nothing says so. (thread) - should-fix —
preflight/SKILL.md:147: the new PR-shapedawaitingquery changes whatsurvey-routine's drift sweep can correct — an unstated second behaviour. (thread) - consider —
preflight/SKILL.md:209: rule 7 mandates hand-writtenis:pronsearch_issues; should it namesearch_pull_requests, or is one-tool-one-syntax the deliberate answer? (thread)
What was checked
- The diff, from the attached checkout:
git fetch origin claude/fix-awaiting-census-query→git diff origin/main...FETCH_HEAD. 3 files, +47/−5. - No linked ticket, and none is required —
prAllowlistGlobsis**here and the PR body is the proposal. Judged against the body accordingly. - The measured claim, re-derived from the tool contracts.
mcp__github__search_issuesdescribes itself as "Already scoped to is:issue";mcp__github__search_pull_requestsas "already scoped to is:pr". Neither documents the override the fix depends on, which is what the third finding is about. The PR's row-2 result (3 PRs) is consistent with override working, and so is the repo's existing daily use of it. - Did the rule generalise?
git grep -n search_issuesover the whole tree, onmainand on the branch. Onmain, three literal queries omitted anis:qualifier:preflight:146(label:awaiting),preflight:147(mentions:),survey-routine:84(commenter:). All three are fixed here. After the branch, every literalsearch_issuesquery in the repo carriesis:issueoris:pr—preflight×6,work-routine:42/:319,reflect:45/:56,journal:52,survey-routine:37/:84,implement-issue:70. The two remaining bare references (draft-ticket:19,triage-issue:358) are prose, not queries. The rule was applied everywhere it applies. - The consumer side of
awaiting.git grep -n awaitingacrossworkflow/skills. The label is written by the state machine, bycross-repo-issue/draft-ticket/implement-issueon local filing, and bywork-routine's four dead ends. The only thing that reads and corrects it issurvey-routine's drift sweep (:67–:79), whose table has a PR row — read whole, and the basis of the second finding.journal/SKILL.mdconfirms no📋 Awaiting youtable consumes the count, so the two result sets need no summing rule. - Surrounding files read whole:
workflow/skills/preflight/SKILL.md(census + all seven read-narrowly rules),workflow/skills/survey-routine/SKILL.md,workflow/skills/journal/SKILL.md, the newdocs/why.mdsection, andCLAUDE.md's one-behaviour-per-PR and values-only rules. - Reviewer profile: read,
workflow/skills/adversarial-review/reviewer-profile.md. It records no learned sensitivities forclaude-workflow(merged without formal reviews historically), so the findings lean on the transferable values — every layer pays rent, work with the platform, a local finding should generalise — and deliberately raise nothing about style, prose length, or test coverage.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`main` gained #48, which rewrote `preflight/SKILL.md` in Simplified Technical English, and #49, which made `version` a cache key. The one conflict was the `label:awaiting` paragraph: #48 tightened it, this branch made it plural. Kept #48's register and carried the plural fact into it in three short sentences. Folded into the same commit, because two of the three touch the file the merge had to reconcile: - Rule 4 said "never let a mention pass silently" while the mention query is now issue-scoped. It now says the query is issue-scoped, and that a mention on a PR reaches the loop through rung 2 or not at all. - `docs/why.md` records the two decisions the fix forced. First, the new `is:pr label:awaiting` query is what the survey routine's drift sweep reads, so half of that sweep's PR row becomes enforceable on the first survey after the merge — the sweep doing what its own table specifies, but worth knowing without a bisect. Second, `search_issues` with a hand-written `is:pr` stays the one tool rather than `search_pull_requests`, deliberately. - `version` 0.2.0 -> 0.2.1. #49 landed after this branch did, and this branch changes two skills, so an unchanged version would leave every installed cache serving the old ones. Gate: `claude plugin validate ./workflow --strict` passed. `rule-delta.mjs --base origin/main` reports 57 -> 57 directives and no removal. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_017bAFozAESzffZgcfH3REWX
|
All three review threads answered and resolved,
Also Validator passed. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Rewrites every prose file in this repo (skills, AGENTS.md, README.md,
docs/why.md, docs/routine-setup.md, loop-config.json's $comments, and every
comment in workflow/hooks|lib and the two CI-adjacent workflow yml files)
into strict Simplified Technical English: active voice, one instruction per
sentence, zero semicolons, no phrasal verbs, simple tenses.
Numbers (tracked *.md, git blob bytes, CLAUDE.md symlink excluded to avoid
double-counting AGENTS.md):
270,253 -> 244,765 chars (-9.4%, -25,488 chars)
Hot path (workspace CLAUDE.md + AGENTS.md + loop-config.json + preflight +
work-routine + survey-routine + journal, the files loaded on every run):
72,087 -> 66,312 chars (-8.0%)
loop-config.json $comment strings: 6,897 -> 6,743 chars (-2.2%, light polish
per the audit's "already disciplined" verdict).
Debris removed (audit report, section 3):
- Dead trigger IDs (trig_01GyUCMWmPLekwTzYL7Xzobi, trig_016XeEsVa7dfSCum7t4Vmeuw)
and the retired `sydevs-loop` name, deleted outright from routine-setup.md.
- The six-label retired roll-call (ready-to-implement, proposal, needs-info,
blocked-upstream, hold, claude:working) cut to one clause in routine-setup.md.
- why.md heading "Hand the baton back even with CI unsettled" renamed to
"Mark the PR ready despite unsettled CI" (lesson unchanged); its one citer
in finalize-pr/SKILL.md updated in this same commit (was left dangling by
the rewrite partitions — caught and fixed during finishing).
- Two genuinely-orphaned why.md headings folded into the sections they
duplicated ("The body is rewritten, not appended" into "Correcting an
earlier claim"; "Awaiting is the one label that earns its place" into
"The state machine is not the loop's job").
- Duplicated rules consolidated to one canonical home + pointers: issue
fields not-searchable (preflight), CI-truth-lives-in-check-runs
(merge-gate.mjs), PR-assignee prohibition (triage-issue + README),
branch-vs-commit preview alias (finalize-pr).
Traps preserved (compressed wording only, per the audit's exempt-from-
deletion registry — all verified present after the rewrite):
- PUT to issue-field-values replaces the whole field set (state-machine.yml,
triage-issue)
- A conflicted PR schedules zero CI runs, silently (finalize-pr, why.md)
- A write under .claude/ trips Protected Paths, stalls a run invisibly
(AGENTS.md, why.md, reflect)
- MCP read strips <details> on readback even though the write succeeded
(journal, why.md)
- Issue fields are readable/writable but not searchable via REST (preflight,
triage-issue)
- HTML-escaped > in a search qualifier is silently accepted and returns
zero (preflight rule 6)
- get_status is deploy signals only, not check runs (work-routine,
merge-gate.mjs)
- Search lags review events by tens of minutes (work-routine, why.md)
- A machine account is type: User, never type: Bot (routine-setup.md)
- api.github.com returns identical 403 with valid, invalid, or no credential
(why.md)
- Sentry is DE-region; Client Secret vs Token both 64 hex, swap easily
(survey-sentry)
- Railway Mailpit needs PORT=8025 explicit, volume before first boot
(routine-setup.md)
- enabledPlugins must be an object map, not an array (README.md)
- An installed plugin pins its commit at install; only `version` invalidates
the cache (AGENTS.md)
- The Stage: Implement write-prohibition (loop may revoke, never grant) kept
as the intentional 4x+ repetition across README, why.md, preflight,
implement-issue, draft-ticket, and triage-issue — not collapsed.
Gates run, all green:
- claude plugin validate ./workflow --strict — pass
- node --check on all 11 tracked .mjs files — pass; bash -n on
dev-server.sh — pass
- node workflow/lib/rule-delta.mjs --base origin/main workflow/skills —
57 -> 57 directives. Two ADDED/REMOVED pairs, both adjudicated as kept
(see PR body for the full run and reasoning).
- python3 workflow/lib/ste-lint.py --json on all 22 changed .md files —
zero regressions; hard violations fell from 231 to 38 combined (the
remainder is markdown-table false positives and one deliberately-kept
banned-phrasal-verb example in preflight's own Register section).
- Every `(why: docs/why.md#...)` citation across all tracked .md/.mjs/.yml
files plus loop-config.json (89 occurrences, 54 unique anchors) resolves
against a live why.md heading — verified after the heading rename.
- workflow/.claude-plugin/plugin.json version bumped 0.2.1 -> 0.2.2 (patch),
required because workflow/skills|hooks|lib/** are touched.
- .claude/worktrees/claude+feat-adversarial-review-rung (gitignored, stale)
confirmed untouched by every partition.
- PR #47 (the awaiting-census fix) is already merged into main; this branch
is up to date with origin/main, so no rebase was needed.
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Three runs today reported
label:awaitingreturns zero while PRs demonstrably carry the label, and journalled it under⚠️ Failedas a fault of the label or the index. It was the query.mcp__github__search_issuesscopes tois:issuewhen a query names nois:qualifier — its own tool description says so — and the census query was$SCOPE is:open label:awaiting, with none. Every item carryingawaitingright now is a pull request, so it could not have returned one.The failure this prevents
The census's one read-only view of what needs a human reads blank and wrong while PRs sit waiting on the reviewer — and it fails the way an empty search always fails, indistinguishable from "nothing qualifies". Two runs then spent their most valuable
⚠️ Failedline on a fact that was never true, which is the training-to-skim cost already recorded under#hasworkflows-is-a-filesystem-check.Measured, not reasoned
Four queries against the same live data the failing runs saw, in the 19:03Z run:
$SCOPE is:open label:awaiting$SCOPE is:pr is:open label:awaitingrepo:sydevs/SahajCloud is:issue is:open label:awaitingrepo:sydevs/SahajCloud is:open author:sydevs-bot(control)The control is what settles it, and it is why this is a rule rather than a patch: the omission hides PRs from any query, not just a label one. Row 2 against row 1 is the same query one qualifier apart — the "watch it fail" step, run on the live defect rather than a simulation of it.
What changes
awaitingbecomes two queries —is:issueandis:pr. The label sits on both shapes and one query cannot see both; that is not redundancy.>gotcha, which is the same class of failure: a qualifier problem that returns zero without erroring.is:issueexplicitly —mentions:here,commenter:insurvey-routine. Both are ticket sweeps by intent and neither changes behaviour; they already returned issues only. A census that states rule 7 while quietly breaking it is how the next reader learns to disbelieve the rule.⚠ One consequence to know before merging: the drift sweep gains half a row
survey-routine'sawaitingdrift sweep reads this census, and its table already has a PR row. Until theis:prquery existed, the sweep could see a PR that should carry the label (from theauthor:query) but never one that carries it wrongly. That half becomes enforceable on the first survey run after this merges.That is the sweep doing what its own table specifies, not a second behaviour — scoping it out would mean editing that table, which genuinely would be one. But if a run starts stripping
awaitingoff PRs it never touched before, this change is why, anddocs/why.mdnow says so rather than leaving it to a bisect.Two decisions, recorded rather than left as omissions
search_issueswith a hand-writtenis:prstays the one tool.mcp__github__search_pull_requestsexists and is scoped tois:prby default. Eight run-skill queries already depend on the explicit-qualifier override and return PRs daily, so it is proven by operation. One tool with one syntax is easier to check than two tools with two defaults, and rule 7 makes every query state its shape anyway.Scope, gate and the version bump
version0.2.0 → 0.2.1. #49 landed after this branch opened and madeversionthe cache key for/plugin install workflow@sydevs. This branch changes two skills, so leaving it alone would serve every installed cache the old ones.origin/mainis merged in, so this is built against #48 (the STE rewrite ofpreflight) and #49. The one conflict was thelabel:awaitingparagraph, which #48 tightened and this branch made plural — #48's register kept, the plural fact carried into it.survey-routine'scommenter:sweep is genuinely ticket-scoped by its own prose — "the ticket is not the loop's to act on", "assigning the bot is the user's call" — sois:issuestates its intent rather than narrowing it.No ceiling or hook is touched, so this is a skill change alone.
Gate:
claude plugin validate ./workflow --strict→ passed.node workflow/lib/rule-delta.mjs --base origin/main workflow/skills→ 57 directives before, 57 after, no directive removed. There is no CI in this repo, by design.🤖 Written by the sydevs autonomous loop — see what this is
🤖 Generated with Claude Code
https://claude.ai/code/session_017bAFozAESzffZgcfH3REWX