Repository navigation
Teach the archdev skill to handle PR CI and review events - #88
Open
calvin-archastro wants to merge 1 commit into
Open
calvin-archastro wants to merge 1 commit into
calvin-archastro wants to merge 1 commit into
Conversation
Add references/pr-events.md (events watch, claim, renew, release, and the claim, fix, push, annotate, release order, with exit 3 meaning the head is owned by someone else), references/pr-orchestrator.md (events dispatch), a SKILL.md section 4 that links both, and a bootstrap.md gate: PR events need CLI 0.55.4 or newer, checked with --version and events claim --help. The general bootstrap floor stays at 0.49.6 because every other workflow works there. Claude Code runs the watch under the Monitor tool; other harnesses run it detached or with --once, never in the foreground. Regenerated plugins/ with tools/plugin-gen. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review on ArchCode
Problem and intent
ArchDev CLI 0.54.7 to 0.55.4 ships the commands a coding agent needs to repair its own PR from CI and review events (
events watch,events claim|renew|release,events dispatch). Thearchdevskill does not mention them. firstlanding's session-start contract already tells every session to runarchdev events watch --pr <num> --json"(skill references/pr-events.md)", and that file does not exist here.Without the reference an agent either skips PR events or invents the procedure, and nothing stops two agents (or an agent and the ArchDev daemon) from pushing to the same PR head. The claim table is the only fence:
events claimexits 3 when the head is owned, and the agent must then change nothing.Intent: document exactly what has shipped, in the order an agent must run it, and prove with a real harness that the installed skill produces that behavior.
What changed
archdev/references/pr-events.md(new): command table; how to run the watch per harness (Claude Code: Monitor tool; Codex, Grok and others: detached process or--once, never a foreground watch); the JSONL event fields (action_hint,claimed_by,gap, untrusteddetails); per-event procedure: verify head,events claim(exit 3 means stop, no edit, commit, push or release), fix, commit, push when authorized,extract run pr.review-annotationsfor the new head,events releasewith the claimed head and token, follow-through.archdev/references/pr-orchestrator.md(new):events watch --mineplusevents dispatch --event -for a session that coordinates repairs and does not edit code; exit 3 means skip; the dispatcher owns claim, renew and release.archdev/SKILL.md: new section 4 "PR events" linking both references, a pointer from step 4 of the Pull Requests list, and a trigger phrase in the description (983 of 1024 characters).archdev/references/bootstrap.md: "PR events minimum version" gate. PR events need 0.55.4 or newer (claim0.54.7,watch0.51.0,dispatch0.55.4). Check--versionandevents claim --help; if either fails, skip PR events and offer the upgrade. The bootstrap scripts keep the 0.49.6 floor so unrelated workflows are not forced to upgrade.plugins/*: regenerated withtools/plugin-gen(npm run build);npm run check,typecheckandtestpass.Not documented on purpose:
events watch --inbox(hook-delivered inbox notes). It is in firstlanding main but not in any release (0.55.6 rejects the flag). Document it when it ships.Unchanged: the 0.49.6 bootstrap floor, hook installation rules, and the rule that PR reporting does not require annotations. Annotations in this flow are repair evidence for reviewers, not a gate.
Scope
Skill docs and generated plugin copies only. No CLI, installer or hook change.
Risk
Low. Text only, and it applies only when the agent is handling PR events. The one risk is wrong commands: every command and flag was checked against the live 0.55.6 binary (
--help) and the Rust source (events/claims.rs,watch.rs,dispatch.rs), and the executed eval below runs them.User impact
Agents with a CLI at 0.55.4+ handle
ci_failed,review_submittedandrebaseevents on their PRs, and back off when another agent or the daemon owns the head. Older CLIs see no change.Testing
Canonical end-to-end proof:
evals/skill-bench/pr_events_live.py runin firstlanding (companion change, not in this PR). It installsplugins/codex/skills/archdevfrom this branch into a hermeticCODEX_HOME, runs real Codex (gpt-6-astra) with the real 0.55.6archdevCLI and its SQLite claim table, a bare-repo origin, a fakeghserving PR #42 and a fake Platform that stores annotation rows.archdevandgitrun through a tracing shim. Three turns, graded without an LLM judge from the trace, origin, claim DB and stored rows:archdev.pr.ci_failedfor the PR headnode --testpasses),extract run pr.review-annotations 42stored a row for the new head,events releaseexit 0 with the claimed head and token, no claim left, in that orderarchdev.pr.review_submittedfor the pushed headaverage([])is0and a regression test covers itarchdev.pr.ci_failedfor a head another agent already claimedevents claimexit 3, no mutating git call, origin and checkout unchanged, no annotations, other claim still held and not releasedRun
live-6: all 38 checks passed (exit 0). The first turn readreferences/pr-events.mdfrom the installed skill.What the earlier live runs changed in this PR: run 5 passed every behavioral check but the agent then tried to start a second
events watchafter the harness had already handed it an event, and called that BLOCKED. The reference now says not to start a second watch when one is running (section 1).Controls without a model: a scripted agent that follows the procedure passes; one that never claims fails the claim, release, order and before-claim checks; one that keeps going after exit 3 fails the no-mutation checks.
Fidelity: real Codex, real
archdevCLI, real git and SQLite. Faked: GitHub (ghstub), Platform (loopback), the watch itself (the lines are seeded into the prompt, as a Monitor or background watch would deliver them),inspect metadataresults (empty). Codex runs with--dangerously-bypass-approvals-and-sandboxin a throwaway home.Not proven here: the Claude Code Monitor path and Grok (only Codex was run);
events watchagainst a real subscription (needs a live Platform);events dispatchand the orchestrator reference (the CLI's own contract tests cover dispatch, and an operator-run Codex synthetic exists; this PR's eval does not exercise it); cross-machine ownership (claims are perHOME). The eval is a manual run (model calls); its grader is covered by offline tests in firstlanding's//evals/skill-bench:test-ci. This PR's own CI (plugins.yml,skill-bootstrap-checks.yml) covers only generation and bootstrap behavior.Follow-ups
evals/skill-bench/pr_events_live.py, its fixture and the updatedevals/coding/tasks/skill-pr-events.yaml(uncommitted there; Task tsk_73yYr1DkTVUNai6Mowi5m7).events watch --inboxafter the release that contains it.🤖 Generated with Claude Code