Skip to content

Ban Every Version Literal in the Four Instruction Documents and Catch Abbreviated SHAs - #1813

Merged
ptr727 merged 6 commits into
developfrom
feature/version-literal-consistency
Sep 25, 2026
Merged

ptr727 merged 6 commits into
developfrom
feature/version-literal-consistency

Conversation

@ptr727

@ptr727 ptr727 commented Sep 25, 2026

Copy link
Copy Markdown
Owner

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

ptr727 and others added 2 commits September 25, 2026 08:14
…ted SHAs

Settles one end state for the fleet: AGENTS.md, GOVERNANCE.md,
CODESTYLE.md, and WORKFLOW.md carry no version literal and no commit SHA,
whether a pin's value, an example, a minimum version, or a fixed
constant, since a check cannot tell them apart. Each is written as its
mechanism, a placeholder, or the name of the manifest that holds it.
The audit now also flags an abbreviated SHA of 7 to 12 characters
mixing digits and letters, with selftest cases for both directions.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Answers the strict pass: the rule names the four files the audit scans
and a three-part version or commit SHA, leaving a two-part language
minimum as the way such a rule is stated, so no rule text claims more
than the check reads. The reference item scopes itself the same way, the
comment-and-doc-style paragraph on bare commit references names the new
scan, the abbreviated-SHA pattern ignores identifier suffixes, and the
comments describe the widened scope.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 25, 2026 15:21
@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: 5880d069-48fe-4257-9c02-64768a6928a7


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.

Answers the pre-push strict review: the version ban moves out of the
reference-ban opening into its own paragraph after the carve-outs,
which neither lifts, so the surfaces test reads only the surfaces list,
and an abbreviated SHA after a hyphen, as in a sha- image tag, is
flagged again while an identifier suffix stays clean.

Co-Authored-By: Claude Opus 5.5 (1M context) <[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.

Copilot review overview

🟡 Changes recommended

The abbreviated-SHA regex currently only matches lowercase hex, so uppercase abbreviated SHAs can still evade the new scan.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates the fleet documentation and audit logic so the four instruction documents (AGENTS.md, GOVERNANCE.md, CODESTYLE.md, WORKFLOW.md) avoid copying any three-part version literals and any commit SHA (full or abbreviated), and so the audit can detect those literals in carried prose.

Changes:

  • Expand spec/audit.py’s version-literal scan to flag abbreviated SHAs (in addition to three-part versions and full 40-hex SHAs), with corresponding selftests.
  • Update governance and audit documentation to describe the broader “no version literal / SHA literal” rule and its rationale.
  • Propagate the updated rule text into the distributed skill copies and source digest.
File Description
spec/​fidelity-model.md Updates fidelity documentation to reflect the broadened version-literal / SHA scan behavior.
spec/​audit.py Extends the version-literal detector regex and expands selftests to cover new literal categories.
GOVERNANCE.md Broadens the “References” rule to ban three-part versions and full/abbrev SHAs in the four instruction docs.
AUDIT.md Updates audit documentation to describe the widened literal scan and its new abbreviated-SHA coverage.
.github/​skills/​comment-and-doc-style/​SKILL.md Updates distributed skill text to reflect the broadened literal ban (generated copy).
.github/​skills/​comment-and-doc-style/​references/​carried-doc-references.md Updates distributed reference doc to describe the broadened literal ban (generated copy).
.claude-plugin/​fleet-skills/​skills/​comment-and-doc-style/​SKILL.md Updates plugin-distributed skill text to match the broadened literal ban (generated copy).
.claude-plugin/​fleet-skills/​skills/​comment-and-doc-style/​references/​carried-doc-references.md Updates plugin-distributed reference doc to match the broadened literal ban (generated copy).
.claude-plugin/​fleet-skills/​.source-digests/​comment-and-doc-style Updates the plugin digest to reflect the new skill source content.
.agents/​skills/​comment-and-doc-style/​SKILL.md Updates the hand-authored skill source text to reflect the broadened literal ban.
.agents/​skills/​comment-and-doc-style/​references/​carried-doc-references.md Updates the hand-authored reference doc to reflect the broadened literal ban.

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

Comment thread spec/audit.py Resolved
Copilot AI review requested due to automatic review settings September 25, 2026 15:26
Answers Copilot on #1813: the abbreviated-SHA branch now matches either
case, as the full-SHA branch does, with a selftest case.

Co-Authored-By: Claude Opus 5.5 (1M context) <[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.

Copilot review overview

🟡 Changes recommended

The abbreviated-SHA regex currently misses uppercase short SHAs and the newly edited skill/reference prose is hard-wrapped despite the repo’s “one logical paragraph per line” convention.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 3 Low severity

Open (4)
Resolved since last review (1)

Comment thread spec/audit.py Resolved
Comment thread spec/audit.py Resolved
Copilot AI review requested due to automatic review settings September 25, 2026 15:30

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 DRIFT finding message in spec/audit.py still uses the narrower pre-change wording and should be updated to match the expanded abbreviated-SHA and version-literal scope.

Review effort: Lite
Findings: 2 Low severity

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

In code that hasn't changed since last review

Low severity Update DRIFT wording to reflect broader version literal checks

spec/​audit.py:2684

The DRIFT finding message still says the file “names a three-part version or a commit SHA”, but the scan now flags a broader “version literal” set including abbreviated SHAs; the user-facing wording should match the expanded rule so the remediation guidance is accurate.

Answers Copilot's out-of-thread finding on #1813: the drift message
names the abbreviated SHAs the scan now flags.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@ptr727

ptr727 commented Sep 25, 2026

Copy link
Copy Markdown
Owner Author

Answering Copilot's out-of-thread finding:

Update DRIFT wording to reflect broader version literal checks (spec/audit.py)

Fixed in e90c5fc: the finding now says "a three-part version or a commit SHA, full or abbreviated". The two hard-wrap threads are declined in-thread, and the tree-wide mismatch behind them is filed as #1814.

Copilot AI review requested due to automatic review settings September 25, 2026 15:36

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 abbreviated-SHA regex currently allows a #-prefixed abbreviated SHA (e.g. #f3b4cc9) to bypass detection, and the selftest suite should cover (and/or enforce) the intended behavior for that case.

Review effort: Lite
Findings: None

Resolved since last review (2)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Match #-prefixed abbreviated SHAs too

spec/​audit.py:742

The abbreviated-SHA branch intentionally excludes tokens preceded by '#', which means a commit abbreviation can slip through the scan if written as #f3b4cc9 (common Markdown shorthand). If the rule is meant to ban commit SHAs regardless of a leading '#', add a dedicated '#'-prefixed abbreviated-SHA branch that does not overlap with 8-hex CSS colors.

Low severity Add selftest for #-prefixed abbreviated SHA

spec/​audit.py:3976

The selftest suite does not cover a '#'-prefixed abbreviated SHA (e.g. #f3b4cc9), which currently is not matched by VERSION_LITERAL due to the leading '#'. Add a selftest case so the intended behavior is locked in (and to prevent regressions if the regex is adjusted).

Answers Copilot's out-of-thread findings on #1813 by adding the selftest
case that pins the intended behavior: a hash introduces an issue or pull
request number on GitHub, never a commit, so the scan leaves it alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@ptr727

ptr727 commented Sep 25, 2026

Copy link
Copy Markdown
Owner Author

Answering Copilot's two out-of-thread findings:

Match #-prefixed abbreviated SHAs too (spec/audit.py)

Declining. On GitHub a leading # introduces an issue or pull request number, and a commit is referenced bare or as owner/repo@sha, so #f3b4cc9 is not a commit-reference form. The # exclusion also keeps hex colors out. The two SHA forms that do occur, bare and sha- prefixed, are both flagged.

Add selftest for #-prefixed abbreviated SHA (spec/audit.py)

Done in c309a94: "a hash-prefixed hex token is not a SHA" pins the intended behavior, using the same token that the abbreviated-SHA case flags when it is bare.

Copilot AI review requested due to automatic review settings September 25, 2026 15:45

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 audit logic, selftests, and documentation updates are consistent with the stated end state and introduce no evident correctness or maintenance issues in the reviewed changes.

Review effort: Lite
Findings: None

@ptr727
ptr727 merged commit fddeab3 into develop Sep 25, 2026
9 checks passed
@ptr727
ptr727 deleted the feature/version-literal-consistency branch September 25, 2026 15:50
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