Skip to content

Promote the Stash, D4.1 Guard, Citation, and Handoff Read Fixes to Main - #2908

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

ptr727 merged 4 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Closes #2896
Closes #2889
Closes #2888

🤖 Generated with Claude Code

ptr727 and others added 4 commits October 12, 2026 12:11
## Summary

`git stash` keeps one stash list per repository, `refs/stash`, and every
worktree of that repository shares it, so a `git stash pop` in one
worktree can pop another task's entry. The `repo-worktree` Skill's "The
Mandate" section now states that a task in a worktree does not use `git
stash`. It copies work in progress to a scratch directory of its own
instead, or, where it is authorized to commit, commits it on its own
branch.

The scope is the Skill only. Whether `GOVERNANCE.md` "Repository
Boundaries and Write Safety" and the host-wide agent-safety block should
also name the stash is a separate maintainer decision, filed as a
follow-up.

## Changes

- `.agents/skills/repo-worktree/SKILL.md`: one new bullet in "The
Mandate". The section has no include region, so the text is
source-authored.
- `.github/skills/` and `.claude-plugin/fleet-skills/`: regenerated with
`python3 scripts/build_dist.py`, and `--check` passes.

## Verification

- `python3 scripts/prose_lint.py --diff <merge-base>` passes, with and
without `--check sentence-length`.
- `python3 scripts/repo_gate.py --check eol` and `--check eol-coverage`
pass.
- `python3 spec/validate.py` passes.
- `python3 scripts/build_dist.py --check` passes.
- `scripts/docker_lint.py --linter markdownlint --linter
editorconfig-checker` passes.
- Two local strict review passes ran. The first raised two findings,
both fixed in 93ae5c7: a sentence over the length limit, and a commit
remedy stated without the commit-authorization condition from
`git-commit-conventions`. The second pass raised none.

Closes #2896

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

## Summary

- **D4.1:** the dispatch guard a retest-only schedule needs is now
required as an `&&` term of the job's job-level `if:`, not of a
single-line `if:`. The single-line wording contradicted the `if: >-`
form that D9.3 and GOVERNANCE.md "Workflow YAML Conventions" set for a
multi-line condition. `spec/audit.py` already accepts the folded form:
`_code_view` folds a block-scalar `if:` onto its key line, and the
`--selftest` case "a folded dispatch gate" expects no finding. The
audit's DRIFT message is unchanged, since it was already accurate. Issue
#2889's premise (that a folded `if:` reduces to an empty condition) is
disproved there, and this change resolves it by aligning D4.1 with the
parser.
- **5B:** a publisher whose schedule never publishes (D4.1) records the
schedule paths of S7 and S9 N/A. Its push paths stay under the existing
rule that keys N/A on the trigger. S7 is included because its Input also
lists a schedule as a publish run, and the dispatch guard skips that run
too.

The local review raised two older gaps between D4.1 and the audit that
this change does not touch. They are filed as #2904.
- The workflow-ci-contract `d-guarantees.md` and `test-methodology.md`
includes are regenerated with `scripts/build_dist.py`.

No other surface states the single-line requirement. I swept
WORKFLOW.md, AUDIT.md, docs/, catalog/snippets, the plan task header,
the Skills trees and the `spec/audit.py` docstrings.

Closes #2889
Closes #2888

🤖 Generated with [Claude Code](https://claude.com/claude-code)
The Comments rule in the comment-and-doc-style Skill said a comment
carries no rule citations. Copilot relied on that line when it flagged a
contract-section citation on #2894, #2895, and #2901, and the tree
already carries such citations. The rule now forbids restating a rule
inline and permits a comment to name the contract section holding its
why, such as D5.2, without echoing that section's text.

The earlier Disproved Claims entry on this branch is reverted, so the
Copilot instructions file is unchanged: the finding was grounded in a
real line, which is amended here rather than declined.

Local review: one recorded pass, six findings. Wording ambiguities in
the maintainer-specified text and pre-existing comments that echo a
section are deferred to #2907, which also notes the pre-existing
design-notes conflict in the Python codestyle reference.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…ch Index (#2906)

## Summary

`scripts/handoff.py` listed the handoff chain with `gh issue list
--label handoff`. gh sends a label-filtered list to GitHub's search API.
Its index is updated after a write lands, not with it. So a `current`
run straight after `new` still returned the link `new` had just closed.
Agents then re-read and retried, spending time and tokens. A `new` run
shortly after another could also resolve a stale predecessor. This is a
permanent property of the search API, not an outage.

Both list reads, `open_handoffs` and `read_closed`, now page the
repository's own issue connection through `gh api graphql`, which reads
the write itself:

- The new `labeled()` helper pages at GitHub's ceiling of 100 up to each
caller's window. It keeps newest-first ordering, so the existing
truncation checks (`WINDOW`, `CLOSED_WINDOW`) mean what they did.
- The query also reads `hasIssuesEnabled`. On a repository with issues
turned off, GitHub answers the connection empty rather than with an
error, which was verified live against a public repository with issues
disabled. It is refused at exit 2, as `gh issue list` refused it, rather
than read as a chain never started.
- A malformed response is an Execution failure (exit 2) naming the
shape, not an unmodeled crash.

## Tests

- `FakeGh` answers the GraphQL list and checks:
  - the query's declared variables;
  - `first` passed through `-F` and within 1-100;
- the query's own `nodes { }` selection, so a field a caller reads that
the query drops fails.
- `ConsistentReadCase` models a lagging search index with `StaleSearch`:
  - `current` straight after `new` names the new link;
  - a second `new` chains onto the first;
  - no read uses `gh issue list`;
  - paging reaches a track whose head is on page two;
  - an issues-disabled repository fails;
  - a malformed response is named.
- All five original new cases fail against the unfixed script. Mutations
that cut paging to one page, pass `first` with `-f`, or drop a selected
field each fail the suite.
- Gates run locally: unittest (162 tests), ruff format and check, mypy,
`prose_lint` (diff-scoped, plus sentence-length), the EOL gate, and
`spec/validate.py`.
- Live: `tracks` and `chain` against this repository read correctly.

## Open Local Review Finding

`local-strict-review` left this `introduced` finding open after its
two-round edit budget. **Fixed in fb8c05c**, the PR's first fix push. A
recorded local pass over that head came back clean:

- `scripts/handoff.py` `labeled()`: an issues-disabled repository raises
`Execution` (exit 2). The module's contract keeps exit 2 for a command
that did not run to an answer. This state is a settled one the operator
can act on, so it should be a `Refusal` (exit 1), matching how
`without_label` already reports it.

## Follow-ups

- #2902: the `session-handoff` and `unattended-handoff` skills still
tell agents to read the open chain with `gh issue list --label handoff`.
That is the same stale read, and it is kept out of this PR because
another lane holds the skills tree.
- #2903: share one GraphQL cursor walker with `pr_review.py`. Its
`gh_graphql` exits through `SystemExit` (exit 1), which would turn a
failed read into a refusal under this script's exit-code contract.

Carries the `comments` label for two constant comments, on `WINDOW` and
`PAGE`.

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


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

## Summary by CodeRabbit

* **Bug Fixes**
* Handoff issue reads now retrieve results in newest-first order across
multiple pages, avoiding missed results when matching issues span pages.
* Closed handoff reads can retrieve up to 1,000 issues; open handoff
reads retain the 100-issue limit and report when that limit is exceeded.
* Handoff operations now stop with a clear error if repository issues
are disabled or issue data is malformed.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 12, 2026 19:48
@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: 9dd99f00-1158-4e38-a5e6-f2871a2fe744

  • 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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.75%. Comparing base (c978e6e) to head (9b93724).
⚠️ Report is 370 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2908      +/-   ##
==========================================
+ Coverage   59.63%   59.75%   +0.11%     
==========================================
  Files          16       16              
  Lines        8684     8709      +25     
==========================================
+ Hits         5179     5204      +25     
  Misses       3505     3505              
Flag Coverage Δ
python-3.13 59.75% <100.00%> (+0.11%) ⬆️

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.

🟢 Approval recommended

The contract and reader changes are supported by the reviewed code and tests, with only minor docstring polish remaining.

0 open findings

What changed in this PR

This promotion updates ProjectTemplate’s fleet guidance and handoff tooling so worktree tasks avoid the shared stash, release audits recognize folded guards, and handoff reads do not depend on a lagging search index.

Changes:

  • Clarifies the worktree, comment, and release-audit rules.
  • Reads handoff issues through the repository issue connection and adds regression tests.
  • Regenerates distributed skill copies and their digests.
File Description
WORKFLOW.md Clarifies release guards and schedule trace rules.
tests/​test_handoff.py Tests consistent handoff reads and paging.
scripts/​handoff.py Replaces search-backed issue lists with connection reads.
.github/​skills/​workflow-ci-contract/​references/​test-methodology.md Distributes the schedule trace rule.
.github/​skills/​workflow-ci-contract/​references/​d-guarantees.md Distributes the release guard rule.
.github/​skills/​repo-worktree/​SKILL.md Distributes the shared-stash warning.
.github/​skills/​comment-and-doc-style/​SKILL.md Distributes the citation guidance.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​test-methodology.md Distributes the schedule trace rule.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​d-guarantees.md Distributes the release guard rule.
.claude-plugin/​fleet-skills/​skills/​repo-worktree/​SKILL.md Distributes the shared-stash warning.
.claude-plugin/​fleet-skills/​skills/​comment-and-doc-style/​SKILL.md Distributes the citation guidance.
.claude-plugin/​fleet-skills/​.source-digests/​workflow-ci-contract Updates the generated source digest.
.claude-plugin/​fleet-skills/​.source-digests/​repo-worktree Updates the generated source digest.
.claude-plugin/​fleet-skills/​.source-digests/​comment-and-doc-style Updates the generated source digest.
.agents/​skills/​workflow-ci-contract/​references/​test-methodology.md Updates the source schedule trace rule.
.agents/​skills/​workflow-ci-contract/​references/​d-guarantees.md Updates the source release guard rule.
.agents/​skills/​repo-worktree/​SKILL.md Adds the source shared-stash warning.
.agents/​skills/​comment-and-doc-style/​SKILL.md Updates the source citation guidance.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727
ptr727 merged commit 444f3cb 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