Skip to content

Promote the Handoff Read, Stash Law, GraphQL Walker, D4.1, and Comment Citation Fixes to Main - #2919

Merged
ptr727 merged 6 commits into
mainfrom
develop
Oct 12, 2026
Merged

ptr727 merged 6 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Closes #2902
Closes #2900
Closes #2903
Closes #2904
Closes #2907

🤖 Generated with Claude Code

ptr727 and others added 5 commits October 12, 2026 13:40
…Skills (#2910)

Closes on promotion: #2902

Both handoff skills read the open chain with `gh issue list --label
handoff`, which GitHub answers from its lagging search index. They now
run `handoff.py tracks --json`, which reads the repository's issue
connection.

- `tracks --json` prints number, title, track (null where the block is
absent or unreadable), labels, and updatedAt. Exit codes are unchanged.
- session-handoff step 1 and unattended-handoff's picker step 1 and
worker blocked-promotion read use it. Picking order is unchanged.
- Tests cover the JSON shape, the empty and fork cases, the
filled-window refusal, and no search call. Each fails with the handler
change reverted.

Local review: 7 findings. Fixed: strict labels read, label page size,
step references, walk wording, `$handoff` path, null-track wording.
Declined: the closed-side read fetching labels it does not use, since a
shared query is simpler than two.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
## Summary

Names the shared stash in the write-safety law, per the maintainer's
decision on #2900.

- `GOVERNANCE.md` "Repository Boundaries and Write Safety": the
task-isolation bullet lists `git stash pop` beside the blanket add, the
hard reset, and the branch switch, with its reason (the stash is one
list per repository shared by every worktree). A closing sentence says
no working directory scopes the stash list, so a task leaves the stash
alone, since the absolute-path habit does not protect it.
- The footprint-cleanup bullet now says to save work aside in a scratch
directory of your own, so "save aside" no longer reads as the stash this
rule rules out.
- `host-setup/agent-safety/claude/claude-md-safety.md`: the same rule in
the host block's compact form, as its own sentence, so the absolute-path
remedy is not read as covering the stash.

Matches the `repo-worktree` Skill's existing stash bullet. No Skill
carries this bullet as a generated include.

## Local Review

Three `local-strict-review` passes at the frontier tier. The last one is
recorded.

- Fixed: the absolute-path "so" covering the stash in the host block,
"no path scopes" read as false for a pathspec, the pop's harm to the
other task, and the footprint bullet's "save aside" read as the stash.
- Declined (style): advisory `sentence-length` on the two lengthened
GOVERNANCE sentences. That check is not in the gate's default rule set,
and splitting the enumeration would take the stash out of the list the
decision asked for.
- Pre-existing, filed as #2912: the pre-commit framework is described as
one that "stashes" unstaged changes.

## Verification

The full local gate block in `OPERATIONS.md` passed: ruff, mypy,
unittest, the selftests, `test_install.py`, `build_dist.py --check`,
`repo_gate.py`, prose lint, `spec/validate.py`, and every docker linter.
After the review fixes, prose lint, `repo_gate.py`, `spec/validate.py`,
and markdownlint were re-run.

Closes #2900

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…d handoff.py (#2914)

## Summary

- Adds `scripts/gh_graphql.py`, one GraphQL transport (`request`,
raising `GraphQLError`, never exiting) and one cursor walker (`walk`,
connection path as a parameter).
- `pr_review.py` keeps its exit 1 and messages by mapping `GraphQLError`
to its existing `SystemExit`. `handoff.py` maps it to `Execution`, exit
2.
- No new exit code. All existing tests pass unchanged. Added
`tests/test_gh_graphql.py` and a handoff test that a transport failure
exits 2 (the "errors beside rows" case fails on the old code, which
answered from the rows).

## Intended behavior changes

- `pr_review.py`: a null `pullRequest` now ends in a clean exit 1 with a
message, where it used to raise a traceback.
- `pr_review.py`: a page claiming another without an advancing cursor
now ends in a clean exit 1, where it used to loop forever.
- `handoff.py`: a response carrying `errors`, or lacking
`pageInfo.hasNextPage`, is now exit 2, where it used to answer from the
rows it had.

Closes #2903

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
## Summary

Resolves the D4.1 and audit disagreement that #2904 reports, for the
publisher whose schedule retests and never publishes.

- **No-push condition stated in D4.1.** `_schedule_never_publishes`
already reads a schedule as never publishing only where the publisher's
`on:` carries no `push` trigger. D4.1 now says so, as "a publisher with
no `push` trigger whose schedule retests and never publishes gates its
release itself", which replaces "a dispatch-only publisher". The next
sentence already requires the dispatch gate on each release job. The
generated `workflow-ci-contract` include copies are regenerated by
`scripts/build_dist.py`.
- **`github.event_name != 'schedule'` dropped from the audit.** It was
equivalent to `== 'workflow_dispatch'` only if the publisher's triggers
stop at `workflow_dispatch` and `schedule`, and the audit never proves
that. `_workflow_triggers` returns every key under `on:`, and
`_schedule_never_publishes` checks only that `schedule` is present and
`push` is absent. So on a publisher that also carries `pull_request` or
`workflow_call`, `!= 'schedule'` holds on a non-dispatch event.
`_DISPATCH_TESTS` is now the single `_DISPATCH_TEST`, and D4.1 already
named only that form.
- **DRIFT message names the exact condition.** It used to say "a
dispatch test". It now names `github.event_name == 'workflow_dispatch'`
as a top-level conjunct of an `if:` holding no `||` or negated group,
which is what the check at the `_schedule_never_publishes` conjunct test
enforces.

## Tests

- Selftest case "a parenthesized not-schedule test as the last conjunct"
now expects one finding. It fails against the old two-form set.
- New case "a parenthesized dispatch test as the last conjunct" expects
none, so paren stripping on the dispatch term stays covered.
- Gates run locally: the full `OPERATIONS.md` local block (ruff, mypy,
unittest, every `--selftest`, `build_dist.py --check`, `repo_gate.py`,
both prose invocations, `spec/validate.py`, `docker_lint.py`) plus a
diff-scoped `prose_lint`.

## Local Review

Three recorded `local-strict-review` passes. Pass 1 found the DRIFT
message gap (fixed in 4d5cdb4). Pass 2 found the message still omitted
the no-disjunction condition (fixed in 209220b). Pass 3 came back
clean.

- Declined: aligning the "dispatch-only repo" comments in
`catalog/snippets/workflows/publish-release.yml` and
`docs/reusable-workflows.md`. That wording is correct for a
`releaseTrigger: dispatch-only` repo, and snippet comments are being
reshaped separately.
- Pre-existing, not addressed: `--check sentence-length` flags the
unchanged "A publish runs on..." sentence in D4.1. That rule is not
gated.

Refs #2904

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Clarified that a publisher without a `push` trigger can retest on a
schedule without publishing.
* **Bug Fixes**
* Tightened workflow checks so scheduled runs qualify as non-publishing
only when every release job explicitly limits execution to manual
dispatches. Parenthesized dispatch conditions are accepted.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Refs #2907

## Summary

- Comments that named a contract section and also copied or paraphrased
its reasoning now keep the citation and drop the copy. Where nothing
local remained, the comment became a bare pointer such as `See D5.2.`
This covers the hub workflows, the catalog snippets, and the stubs
docs/reusable-workflows.md mirrors.
- GOVERNANCE.md "Workflow YAML Conventions", Concurrency bullet: each
documented exception is cited by number, never restated, in the comment
above its implementing workflow's `concurrency:` key. The tails of (3)
and (4) that placed the rationale in the bullet rather than a header
comment are gone. The merge-bot, publisher, and canonical-review-sweep
comments now carry the citation alone.
- The comment-and-doc-style Comments bullet now settles that a
paraphrase counts as echoing, that an id unique across the instruction
set (a WORKFLOW.md D-id) may stand alone while any other citation names
its file, and that a citable section is one of the fleet's own
instruction set.
- Distributions regenerated with `scripts/build_dist.py`.

Carries the `comments` label, since editing comments is the change.

## Local review findings and their outcomes

- Fixed in 00f2519: the root-default comment in
`.github/workflows/validate-task.yml` is now the bare pointer `See D1.2
for the undeclared root.`
- Fixed in 00f2519: the prune comment in
`.github/workflows/deploy-site-task.yml` no longer says a write-only
repo skips a step that still runs its no-op hook.
- Declined with evidence in the thread: Concurrency exception (3) is
implemented only in a site repository's own deploy caller, which holds
the carried bullet itself.
- `style`, declined: the Concurrency bullet's "never restated" and the
Skill's "echoes or paraphrases" use different verbs for one rule.
- Declined with evidence: positional exception numbers can shift on
insertion, but WORKFLOW.md D-ids are positional numbers cited from
comments the same way.
- Declined: the prune comment describes a write-only repo's hook per
repo, as WORKFLOW.md's own hook-target row does, so a per-environment
refinement belongs in that row first.

## Filed

- #2915: the codegen snippet's workflow-only concurrency group matches
no documented exception.
- #2916: whether a comment may cite a hub `docs/` section.
- #2917: the validate action's burn-down comment restates "Verification
Discipline".

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 12, 2026 22:12
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c98d5fc7-33f5-421a-b47f-089cc66b693b
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.57522% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.00%. Comparing base (9b93724) to head (24d1df3).
⚠️ Report is 371 commits behind head on main.

Files with missing lines Patch % Lines
scripts/pr_review.py 86.66% 2 Missing ⚠️
scripts/gh_graphql.py 98.59% 1 Missing ⚠️
scripts/handoff.py 96.00% 1 Missing ⚠️
spec/audit.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2919      +/-   ##
==========================================
+ Coverage   59.75%   60.00%   +0.24%     
==========================================
  Files          16       17       +1     
  Lines        8709     8773      +64     
==========================================
+ Hits         5204     5264      +60     
- Misses       3505     3509       +4     
Flag Coverage Δ
python-3.13 60.00% <95.57%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Four unresolved P1 findings affect handoff execution and GraphQL error handling.

3 open findings
What changed in this PR

Promotes handoff, shared GraphQL, workflow-contract, stash-safety, and comment-citation updates to main.

Changes:

  • Adds shared GraphQL transport/cursor walking and JSON handoff listings.
  • Aligns D4.1 auditing and stash-safety guidance.
  • Updates comments, documentation, tests, and generated skill distributions.

Review findings:

  • P1 critical, 1 vote: .agents/skills/unattended-handoff/SKILL.md:214,272 must invoke scripts/handoff.py explicitly.
  • P1 critical, 1 vote: scripts/gh_graphql.py:103 must reject a null pullRequest.
  • P1 moderate, 2 votes: scripts/handoff.py:562 must route GraphQL subprocess failures through shared transport.
  • P1 moderate, 1 vote: scripts/handoff.py:547 must validate the issues connection before calling .get.
File Summary
WORKFLOW.md Clarifies the no-push D4.1 condition.
tests/​test_handoff.py Tests JSON output and GraphQL failures.
tests/​test_gh_graphql.py Tests shared GraphQL behavior.
spec/​audit.py Aligns schedule-publisher auditing.
scripts/​README.md Documents the shared library and JSON command.
scripts/​pr_review.py Uses shared GraphQL transport and walker.
scripts/​handoff.py Adds JSON output and shared GraphQL integration.
scripts/​gh_graphql.py Adds shared transport and cursor walking.
host-setup/​agent-safety/​claude/​claude-md-safety.md Names shared stash safety.
GOVERNANCE.md Updates stash and citation rules.
docs/​reusable-workflows.md Simplifies workflow comments.
catalog/​snippets/​workflows/​test-pull-request.yml Simplifies contract citation.
catalog/​snippets/​workflows/​publish-release.yml Simplifies publish comments.
catalog/​snippets/​workflows/​merge-bot-pull-request.yml Simplifies concurrency comments.
.github/​workflows/​validate-task.yml Simplifies validation comments.
.github/​workflows/​publish-release.yml Simplifies publish comments.
.github/​workflows/​merge-bot-pull-request.yml Simplifies concurrency comments.
.github/​workflows/​get-version-task.yml Simplifies versioning comments.
.github/​workflows/​deploy-site-task.yml Simplifies prune documentation.
.github/​workflows/​canonical-review-sweep.yml Simplifies concurrency documentation.
.github/​workflows/​build-release-task.yml Simplifies the D4.7 citation.
.github/​skills/​workflow-ci-contract/​references/​d-guarantees.md Regenerated D4.1 copy.
.github/​skills/​unattended-handoff/​SKILL.md Regenerated handoff skill.
.github/​skills/​session-handoff/​SKILL.md Regenerated session skill.
.github/​skills/​comment-and-doc-style/​SKILL.md Regenerated citation guidance.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​d-guarantees.md Regenerated D4.1 distribution.
.claude-plugin/​fleet-skills/​skills/​unattended-handoff/​SKILL.md Regenerated handoff distribution.
.claude-plugin/​fleet-skills/​skills/​session-handoff/​SKILL.md Regenerated session distribution.
.claude-plugin/​fleet-skills/​skills/​comment-and-doc-style/​SKILL.md Regenerated citation distribution.
.claude-plugin/​fleet-skills/​.source-digests/​workflow-ci-contract Updates source digest.
.claude-plugin/​fleet-skills/​.source-digests/​unattended-handoff Updates source digest.
.claude-plugin/​fleet-skills/​.source-digests/​session-handoff Updates source digest.
.claude-plugin/​fleet-skills/​.source-digests/​comment-and-doc-style Updates source digest.
.agents/​skills/​workflow-ci-contract/​references/​d-guarantees.md Updates canonical D4.1 guidance.
.agents/​skills/​unattended-handoff/​SKILL.md Updates canonical handoff commands.
.agents/​skills/​session-handoff/​SKILL.md Updates canonical session guidance.
.agents/​skills/​comment-and-doc-style/​SKILL.md Updates canonical citation rules.

🧠 Review effort: Lite


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/gh_graphql.py Resolved
Comment thread scripts/handoff.py Resolved
Refs #2919

unattended-handoff now defines
`handoff="<hub-checkout>/scripts/handoff.py"` once, each seat setting it
for itself, and writes every handoff.py invocation as `python3
"$handoff" ...`, matching session-handoff. The affected paragraphs are
re-wrapped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The shared GraphQL helper needs parse-specific handling for malformed JSON, and one documentation nit remains.

0 open findings

3 resolved since last review

🧠 Review effort: Lite

@ptr727

ptr727 commented Oct 12, 2026

Copy link
Copy Markdown
Owner Author

Answering the round-2 headline on 24d1df3, which counts no finding and opens no thread. (1) Malformed JSON: gh_graphql.request already catches the parse failure. A non-object payload raises GraphQLError carrying the bounded stderr detail, which pr_review ends at exit 1 and handoff.py ends at exit 2, so every caller gets a clean failure on its own exit contract. The message says "gh graphql failed rc=0" where the exit was 0 and the body did not parse. That is a wording nit, and #2914 declined it in its own review because the exit contract a caller acts on is correct. No change. (2) The documentation nit is not named anywhere in the round, so there is nothing specific to act on. The four files changed since round 1 (#2920) are the unattended-handoff skill and its generated copies, which this round covers.

@ptr727
ptr727 merged commit 1049f4d into main Oct 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants