Repository navigation
feat(finalize-pr): let a session open its PR through finalize-pr - #294
Conversation
`disable-model-invocation: true` put the ship pipeline out of reach of an ordinary conversation. Asked to raise a PR, a session hand-rolled `gh pr create` and skipped simplify, the review, the conditional security review, the docs sync and step 7's body. sydevs/SahajCloud#1238 shipped with no `## Preview` links that way, in a repo that deploys previews, and only `review-pr` would have caught it — as a `should-fix` on a missing link, once the review loop reached the PR. So this one skill drops the flag. What replaces it is the trigger surface: a description that fires on a request to open or refresh a PR and on nothing else, and a pre-flight exit when nobody asked for one. The skill pushes, so a stray phrase must not reach it. Nothing else changes. Every pipeline step keeps its gates, and the loop's own invocations — implement-ticket, address-review — behave as before. `workflow/skills/AGENTS.md` names the exception, so the next skill audit does not put the flag back, and `docs/why.md` carries the failure. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYy6xh14eBuBZcxind
Four findings from the review pass. The exit sat in step 0, which every caller runs, so a cloud run handed the branch by implement-ticket step 11 could read "nobody asked for a PR" as its own case and end with the branch unpushed. It now gates the model's own fire, and says that a person running the session asks, and so does a skill handing over the branch. It also tested that someone asked, not that the user did. The flag it replaces was what kept this pushing pipeline out of reach of untrusted GitHub text, so the exit now says GitHub text never asks, and cites docs/why.md#an-outsider-feeds-a-member-fires. `finalize-pr` is not the only skill that omits the flag — dev-server, format-ticket, start-run and finish-run do too, as helpers. The guide and the story drop the claim that it is. The description called the Preview section mandatory, which is only true where the repo deploys previews. SahajAtlasWordpress omits it, and the description is the copy a session reads without the body. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYy6xh14eBuBZcxind
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the size of its ticket: five files, 29 added lines, one behaviour, and the version bump an install needs. The recorded decision (Ardnived, 2026-11-20) picked this shape over extracting step 7, so nothing here re-litigates it, and nothing is smuggled in.
Two prose defects to fix, and prose is the whole deliverable. The new pre-flight exit names who may ask for a PR, and its list leaves out the handler start-run's incidental-finding rule sends to open a ticketless docs or test PR — the one caller with no person and no handed-over branch. And docs/why.md still claims finalize-pr is alone in dropping the flag; dev-server dropped it too.
Findings
should-fix— the pre-flight exit's askers miss start-run's ticketless-PR path (workflow/skills/finalize-pr/SKILL.md:77)should-fix— "alone among the skills a person or the loop invokes" is false (docs/why.md:303)consider— the description carries two non-trigger clauses, paid on every session (workflow/skills/finalize-pr/SKILL.md:3)
What was checked
- Ticket #292: all four acceptance criteria hold, and no step the loop's own callers reach is changed.
- Read whole on the branch:
finalize-pr/SKILL.md,skills/AGENTS.md, the newdocs/why.mdsection,docs/documentation.md. - Frontmatter of all 22 skills:
dev-serveris the second one without the flag, which is finding 2. The tool grant is unchanged, so no new reach. new-pieces.mjs:NONE. No streamliner, no ladder walk, no new dependency, no contract surface.- Preview links: none, and
.claude/workflow.jsononmaindeclares nopreviewUrland nofixture. Every path the body cites exists on the branch. rule-delta.mjsonmaincounts 93 directives to the body's 92 — #293 merged after this branch was cut.- No open question threads. Profile read.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
…ize-pr-model-invocable
start-run's incidental-finding rule sends a handler that otherwise never pushes here to open a ticketless docs or test PR. No person asks there, and the run creates the branch itself, so neither named asker covered it: a literal reader exited and dropped the fix. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXynNWRz4u2joFjv6F
dev-server carries no disable-model-invocation either, and README lists it as a user command, so "alone among the skills a person or the loop invokes" was false. The guide called dev-server a helper for the same reason; it names it as the second exception instead. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXynNWRz4u2joFjv6F
Every session in all five repos loads it. "The only path to one" is a rule, stated where it binds at implement-ticket:176 and README:112, and the opening restated the verbs the trigger sentence lists. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXynNWRz4u2joFjv6F
The branch bumped to 5.9.0 before #293 merged with the same number. An install caches by version, so merging at 5.9.0 would leave every installed plugin on #293's skills, never seeing this change. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXynNWRz4u2joFjv6F
f74cb31 widened the rule; the story behind it still listed two askers. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXynNWRz4u2joFjv6F
|
Adopted all three review threads, on a clean
Rebutted nothing. Gate: validate ✓, 156/156, Anomaly: 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Conflict: workflow/.claude-plugin/plugin.json version. main bumped 5.9.0 -> 5.10.0 for #294's new capability; this branch had bumped 5.9.0 -> 5.9.1 for its merge-gate.mjs export. Resolved to 5.10.1 — main's minor stands, and this branch's workflow/lib change still carries a bump above it, so the plugin cache key moves for both. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWpqKoZPiBkxF32cJB
The `test` check failed on "Plugin files changed but version is still 5.10.0". This branch ships a change to `workflow/lib/payload.mjs`, which an install reads, and the cache directory is named after `version`, so the change would never reach an installed plugin. The branch never bumped the version itself. It merged `main` at 03cd9ea, and #294 had already taken 5.10.0 there, so base and head arrived at the same string. The earlier green run on 3afc529 proves the collapse rather than contradicting it: at that head nothing under `workflow/lib` had changed yet, so the step exited before comparing. `payload.mjs` changed in b7b72c2, after the merge. 5.10.1, not 5.11.0: the one shipped change is a guard on a handler name, and main reserves a minor for a feature. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVt9URFoNsCm6Qw4j9
Summary
finalize-prdropsdisable-model-invocation: true, so a session asked to raise a PR runs the pipeline instead ofgh pr create.plugin.jsonmoves to 5.10.0 — an install caches byversion, and feat(review): a fresh streamliner justifies every new piece, and the critic seconds each question #293 merged with 5.9.0.Change outline
The change is this skill's trigger contract, in two parts: what now fires it, and what the run does when the trigger was wrong.
Contract — what fires finalize-pr
One rule per line, from the frontmatter. The tool grant is untouched.
Behaviour — pre-flight, when the trigger was wrong
The description is a probabilistic trigger, so the run checks who asked before it touches the branch. The existing
mainabort already stopped the worst case.Test results
claude plugin validate ./workflow --strictpassed,node --test workflow/lib/*.test.mjs156/156.rule-delta.mjs --base origin/main workflow/skills: 93 → 93, no directive disappeared. Nothing was removed; the new rules do not open withNever/Always, which is all the script counts.ste-lint.pyon the changed skill: 13 violations, 7 hard — identical toorigin/main's count for that file.comment-lint.mjs --base origin/main: no banned comment added.origin/main(f5ed5d1, feat(review): a fresh streamliner justifies every new piece, and the critic seconds each question #293) merged clean, no conflicts.Manual verification
The ticket's checklist, which only an attended run can do — a skill edit takes effect in the next session, so this one cannot test it.
src/components/admin/, ask an interactive session to "raise a PR". The body should carry a## Previewsection whose links matchfixture.linkwith the PR number filled in.finalize-prshould not fire./workflow:implement-ticket <n>somewhere and confirm step 11 still ships: the new pre-flight exit must not catch a run that a skill handed the branch to.start-run's incidental-finding path creates its own branch, so no skill hands it over.Notes for reviewer
75f4d8ascopes it to the model's own fire.Bash(*)and push rights./security-reviewran (the diff matchessecurityReview.triggerPattern) and reported no findings: the tool grant is unchanged, a cloud session pushes onlyclaude/*, and step 0 aborts onmain. The residual exposure is that a description is not an authorization check, which is why the pre-flight line names who may ask and citesdocs/why.md#an-outsider-feeds-a-member-fires.PreToolUsehook ongh pr createand a dispatcher step onpull_request.openedare recorded indocs/why.mdas set aside, not rejected. Either can sit on top of this later.AGENTS.mdcarries the exception so the next skill audit does not put the flag back.Detail
Four findings from
/code-review high, all fixed in75f4d8a:finalize-pr, the one exception" is falsedev-server,format-ticket,start-runandfinish-runomit the flag too. The guide and the story drop the claim## PreviewmandatoryThree findings from the adversarial review, all adopted:
start-run's ticketless-PR pathf74cb31)dev-serveromits the flag and README lists it as a user command, so the claim is now "alone among the skills that push". The guide stops callingdev-servera helper (82dcbf0,d0b33ac)implement-ticket:176 and README:112 (4cf94c9)Rejected nothing, in either round. All seven findings held on re-reading the source.
Why no new helper skill. The ticket's recorded decision (Ardnived, 2026-11-20) chose making
finalize-pritself model-invocable over extracting step 7, so an interactive PR gets simplify, the review, the security review and the docs sync too — not just the body.## Previewis omitted here becauseclaude-workflow's.claude/workflow.jsondeclares nopreviewUrland nofixture: the repo ships prose and config and deploys no preview.Docs sync. Swept for every surface that describes this:
workflow/skills/AGENTS.md(the rule),docs/why.md(the failure),README.md's skill table (prose now reaches it too). GreppedUser-invoked,gh pr createandhand-rollacross the tree —file-ticketandsettle-roadmapkeep their flag and their "User-invoked only", correctly, andimplement-ticket's "/workflow:finalize-pris the only path to a PR" is now true for an interactive session as well./simplifyhad no code to act on — the diff is prose, config and a version string. Its analogues in this repo,rule-delta.mjsandste-lint.py, ran instead and are reported above./code-review highwas the review pass; no routine haspr-review-toolkit.Closes #292