Skip to content

Name a Pin by Its Mechanism, Never Its Value, and Audit for Copies - #1809

Merged
ptr727 merged 7 commits into
developfrom
feature/no-version-pins-in-docs
Sep 25, 2026
Merged

ptr727 merged 7 commits into
developfrom
feature/no-version-pins-in-docs

Conversation

@ptr727

@ptr727 ptr727 commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

Agents repeatedly proposed "updating governance" after a Dependabot bump, because an instruction document had copied a pin's current value, such as "SHA-pinned at hub release 2.0.x". The value goes stale at every bump. This PR stops that at the rule and at the audit.

  • GOVERNANCE.md "References": an instruction document names no value a pin holds, whether a release number or a commit SHA. It names the mechanism instead. The ban sits with the issue/PR/commit ban, ahead of the carve-outs, so the revision carve-out still covers a disproved-claims record.
  • comment-and-doc-style reference: carried-doc-references.md item 3 gives the reason and what to write instead.
  • spec/audit.py: version_literals_outside_verbatim flags a three-part version or a 40-hex SHA as a drift finding. It reads AGENTS.md, GOVERNANCE.md, CODESTYLE.md, and WORKFLOW.md. Downstream, it skips the verbatim sections; in the hub, it reads the whole file, since the verbatim sections are the hub's own copies. .github/copilot-instructions.md is excluded, because its disproved-claims records name revisions by design. strip_sections gains keep_pins, because its normalization rewrites a pinned uses: line to <pin> and would hide the value. The selftest has 8 cases.
  • AUDIT.md and spec/fidelity-model.md describe the new content scan.

The hub's four instruction documents scan clean. Two downstream repos currently carry copied values in their own sections, and each gets its own cleanup PR after this merges.

Verification

  • audit.py --selftest passes.
  • build_dist.py --check, prose_lint.py --diff origin/develop --allow-comments, docker_lint.py (7 linters), and spec/validate.py pass.
  • The new code comments match the surrounding density, so this PR carries the comments label.
  • The local strict review ran two edit rounds. The last pass raised 2 findings, which go into this PR's first fix commit.

🤖 Generated with Claude Code

ptr727 and others added 3 commits September 25, 2026 07:13
Instruction documents stop copying a pin's release number or SHA, which
goes stale at every Dependabot bump and sends an agent to edit
governance for a change that needed none. GOVERNANCE.md References and
the comment-and-doc-style reference state the rule. spec/audit.py flags
a three-part version or full SHA in AGENTS.md, GOVERNANCE.md,
CODESTYLE.md, or WORKFLOW.md outside their verbatim sections, with
selftest cases.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… Check

Answers the strict review: the hub's own run scans verbatim sections,
where a copied pin would otherwise go undetected everywhere, an
unreadable file is reported rather than skipped, the finding names what
it matched, the pin ban moves ahead of the References carve-outs, and
AUDIT.md and spec/fidelity-model.md name the new content scan.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Answers the second strict pass: the reference file names where the
revision carve-out lives, the References test cites the sentences above
it, AUDIT.md stops calling the version scan the only content scan, the
no-remote warning names both hub-identity checks, and an uppercase SHA
gains a selftest case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 25, 2026 14:23
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Sep 25, 2026
@coderabbitai

coderabbitai Bot commented Sep 25, 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: 36175630-30b5-4f7a-aa0e-f24c1419667c


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.

…ning

Answers the pre-push strict review: the comment-and-doc-style section
GOVERNANCE References defers to now states the pin ban and its remedy,
and the no-remote warning covers every hub-scoped check, and false
findings as well as misses.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

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.

Copilot review overview

🟡 Changes recommended

It introduces a concrete pinned-version example in the rule text and contains an incomplete warning message that should be corrected for clarity.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)
What changed in this PR

This PR tightens the fleet documentation contract by banning copied pin values (release numbers or commit SHAs) in instruction documents, and extends the audit tooling to detect and report those copied literals as drift so they do not keep triggering unnecessary governance edits after Dependabot bumps.

Changes:

  • Extend GOVERNANCE.md "References" to forbid naming a pin's current value in instruction documents, requiring mechanism-based phrasing instead.
  • Add a new audit scan in spec/audit.py to flag three-part versions and 40-hex SHAs found in instruction-doc prose (with verbatim-section handling and selftests).
  • Update audit documentation (AUDIT.md, spec/fidelity-model.md) and the comment-and-doc-style reference to describe the new rule and scan.
File Description
spec/​fidelity-model.md Updates the fidelity model narrative to include the new copied-version scan impact.
spec/​audit.py Implements version/SHA literal detection outside verbatim sections and adds selftests.
GOVERNANCE.md Adds the new "pin mechanism, not value" rule alongside existing reference bans.
AUDIT.md Documents the new drift scan for copied versions/SHAs in instruction documents.
.github/​skills/​comment-and-doc-style/​references/​carried-doc-references.md Updates the generated skill reference to include the new banned category for pin values.
.claude-plugin/​fleet-skills/​skills/​comment-and-doc-style/​references/​carried-doc-references.md Updates the generated plugin copy of the same skill reference content.
.claude-plugin/​fleet-skills/​.source-digests/​comment-and-doc-style Updates the plugin digest to reflect the skill content change.
.agents/​skills/​comment-and-doc-style/​references/​carried-doc-references.md Updates the source skill reference content that the generated copies are derived from.

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

Comment thread .agents/skills/comment-and-doc-style/references/carried-doc-references.md Outdated
Comment thread spec/audit.py Outdated
Copilot AI review requested due to automatic review settings September 25, 2026 14:27
ptr727 and others added 2 commits September 25, 2026 07:29
Answers the strict pass: the warning says the template-reference scan
may miss in every repo while false findings land on the hub's own entry,
and AUDIT.md names the full 40-character SHA the scan actually matches.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Every enumeration of what the fallback hub name breaks missed a case, so
the warning now says every check that depends on the hub's identity is
unreliable in that run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

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.

Copilot review overview

🔵 Needs a closer look

The new audit scope and related prose have a few correctness/conformance issues (scan coverage gap, style violation, and docstring mismatch) that should be fixed before approval.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (1)
Previously missed (4)

In code that hasn't changed since last review

Medium severity VERSION_LITERAL_SCANNED misses AUDIT.md

spec/​audit.py:733

VERSION_LITERAL_SCANNED omits AUDIT.md, but GOVENANCE.md frames the rule as applying to instruction documents in general, and carried-doc-references.md item 3 already lists the carried AUDIT.md as governed. Without scanning AUDIT.md, the new enforcement can miss copied pin values added there.

Low severity Reference list omits AUDIT.md from scanned docs

.agents/​skills/​comment-and-doc-style/​references/​carried-doc-references.md:36

This reference says the version-literal audit flags copies in AGENTS.md/GOVERNANCE.md/CODESTYLE.md/WORKFLOW.md, but the surrounding text says the carried AUDIT.md is governed too. If the audit is updated to scan AUDIT.md, include it here so the documented contract matches the implementation.

Low severity Docstring misstates normalization output format

spec/​audit.py:744

The strip_sections docstring says normalization reduces an action pin to <pin>, but normalize() actually rewrites uses: ...@<sha> to ...@<pin>. This mismatch makes the new keep_pins behavior harder to reason about when reading the code.

Low severity Audit message uses a prohibited semicolon

spec/​audit.py:2679

The audit finding message uses a mid-sentence semicolon, which violates the repository's no-semicolon-in-agent-authored-prose rule (it is user-facing prose emitted by a hub tool). Recast as two sentences or with a comma.

Copilot AI review requested due to automatic review settings September 25, 2026 14:33

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.

Copilot review overview

🔵 Needs a closer look

It introduces a rule forbidding pin values in instruction documents but still includes a concrete pin value example in the source skill references, and there is also a small docstring/behavior mismatch in the new audit code.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Previously missed (1)

In code that hasn't changed since last review

Low severity Fix normalize docstring to match @​<pin> output

spec/​audit.py:744

strip_sections says normalization reduces an action pin to <pin>, but normalize() actually rewrites @<sha> to @<pin> (including the @). Updating the docstring to match the actual normalized form avoids confusion when someone is debugging why a pin literal no longer appears in normalized text.

…Real Release Number

Fixes the failing test_prose_lint check, which reads the opening
paragraph's backticked Markdown paths as the instruction-doc list, by
naming the reference file without a path. Answers Copilot on #1809 by
replacing the example release number with a placeholder.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 25, 2026 14:43

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.

Copilot review overview

🟢 Approval recommended

The rule change and the new drift scan are consistent with the updated documentation, and spec/audit.py --selftest completes successfully with the added cases.

Review effort: Lite
Findings: None

Resolved since last review (1)

@ptr727
ptr727 merged commit 2471843 into develop Sep 25, 2026
9 checks passed
@ptr727
ptr727 deleted the feature/no-version-pins-in-docs branch September 25, 2026 14:50
ptr727 added a commit that referenced this pull request Sep 25, 2026
… Abbreviated SHAs (#1813)

## Summary

This settles one end state for the fleet, which the maintainer chose.
`AGENTS.md`, `GOVERNANCE.md`, `CODESTYLE.md`, and `WORKFLOW.md` carry no
three-part version and no commit SHA, full or abbreviated. That covers
four kinds of literal, because no check can tell them apart:

| Kind | Written instead as |
| --- | --- |
| a pin's value | its mechanism ("SHA-pinned to a hub release") |
| an illustrative example | a placeholder (`1.0.N`) |
| a minimum version | the name of the manifest or skill that holds the
number |
| a fixed constant | a description ("the all-zero placeholder version")
|

A two-part language minimum, such as a Python minor, stays. It is how
such a rule is stated.

- **Rule text:** GOVERNANCE.md "References", `comment-and-doc-style`,
and its `carried-doc-references.md` item 3 state exactly what the audit
enforces.
- **Audit:** `spec/audit.py` also flags an abbreviated SHA of 7 to 12
characters mixing digits and letters, as a standalone token. Selftest
cases cover both directions: an abbreviated SHA and a worked example are
flagged, while a placeholder, a hex color, a hex constant, an all-letter
word, and an identifier suffix are not.
- **Docs:** AUDIT.md and spec/fidelity-model.md describe the widened
scan.

This follows up #1809, which banned only a pin's value. A fleet scan
found worked examples, minimum-version floors, and constants in the same
files. Downstream fixes follow, one PR per affected repository.

## Verification

- `audit.py --selftest` passes, and the hub's four files scan clean.
- `build_dist.py --check`, `prose_lint.py --diff origin/develop
--allow-comments`, `docker_lint.py` (7 linters), and the
`test_prose_lint` and `test_build_dist` suites pass.
- The local strict review ran two edit rounds. The last pass raised 3
findings, which are answered in this PR's first fix commit.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ptr727 added a commit that referenced this pull request Sep 25, 2026
…rship to Main (#1827)

Promotes `develop` to `main`.

## Carried

- #1806: adds the unattended handoff loop and the attended resume
procedure.
- #1807: renames three skills and states which skill wins each shared
trigger.
- #1809: names a pin by its mechanism rather than its value, and audits
for copies.
- #1808: leads every choice with a recommendation and closes every
session in order.
- #1813: bans every version literal in the four instruction documents
and catches abbreviated SHAs, following #1809.
- #1820: refuses a coverage marker indented into a code block, per
#1725.
- #1823: states that the hub commits audit reports and that a downstream
session resyncs itself. This covers the Fleet Bootstrap section, the
host fleet block, `RESYNC.md`, `AUDIT.md`, `check-this-repo`, and
`resync-a-repo`, and settles #1822. The Fleet Bootstrap section is
byte-locked, so every carrier reports drift on it until its next resync.
- #1825: strips a tilde or unclosed fence before reading review
coverage, per #1821.

Closes #1725
Closes #1821
Closes #1822

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants