Skip to content

Drop the private-repo premise, and stop auditing the hub against itself - #505

Merged
ptr727 merged 3 commits into
developfrom
feature/audit-template-xref-premise
Aug 1, 2026
Merged

Drop the private-repo premise, and stop auditing the hub against itself#505
ptr727 merged 3 commits into
developfrom
feature/audit-template-xref-premise

Conversation

@ptr727

Copy link
Copy Markdown
Owner

Found by running the live audit against the hub itself while checking that the tooling handles the shape Blog is about to become. Two defects in one check, both in spec/audit.py's carried-file template-reference rule.

1. The stated reason is false

The check justified itself this way, in the code comment, the finding text, and the recurring.norepoxref assertion in spec/project-types.json:

private, so it 404s for the carrying repo's readers

This repository has been public since 2026-07-26, confirmed live:

$ gh api repos/ptr727/ProjectTemplate --jq '{private, visibility}'
{"private": false, "visibility": "public"}

So a reference does not 404, and that half of the justification is dead.

The rule itself survives, on the second reason project-types.json already gave: the coordination flow is machinery a consumer should not see, so a carried file states the behavior rather than the destination. The wording now rests on that alone, corrected in all three places that carried the dead premise.

This matters beyond tidiness. A rule whose stated reason is checkably false is a rule the next agent argues with, and a downstream repo carrying the assertion inherits the false claim.

2. It fired on the hub itself

Auditing ProjectTemplate reported its own AGENTS.md as drift for naming the repository it lives in:

DRIFT carried: AGENTS.md references the template repo by name or link ...

That is a false positive. The hub's carried files are the source, and naming itself there is correct and unavoidable. A downstream repo naming it is still flagged, which is the actual point of the rule.

The fix reuses the guard the section check at the same layer already uses (entry.get("name") != HUB_NAME), whose comment states the same rationale: "Skip the hub itself: its copies are the source." The idiom existed; this check had simply omitted it.

Verification

The check reads the repo over the API, so it is not reachable from the offline --selftest. The evidence is the live audit before and after, not a unit test.

Before:

== ProjectTemplate (source-only, docs; release) @ main@6501479 ==
DEFECT settings: has_discussions live=False expected=True
DRIFT carried: AGENTS.md references the template repo by name or link (private - 404s ...)
1 repo(s) audited; 1 defect/letter/error finding(s).

After:

== ProjectTemplate (source-only, docs; release) @ main@6501479 ==
DEFECT settings: has_discussions live=False expected=True
1 repo(s) audited; 1 defect/letter/error finding(s).

The false DRIFT is gone and the real defect is untouched.

python3 spec/audit.py --selftest SELFTEST PASS
python3 spec/validate.py OK, 21 cataloged
python3 scripts/test_prose_lint.py 141 tests, OK
python3 scripts/repo_gate.py eol 0, sha-pin 0
prose_lint --check charset --check dupword --check spelling clean

spec/audit.py carries a large pre-existing comment backlog. This PR does not sweep it, but the rewritten block leaves the file slightly better rather than worse: 105 -> 103.

A separate finding this surfaced, for the maintainer

has_discussions is false on this repository while repo-config/settings.json and configure.sh expect true for a public repo. It is a real settings drift, not a tooling bug, and repo-config/configure.sh apply would set it. Enabling Discussions is a visible change to the repository, so it is left for the maintainer rather than applied here.

🤖 Generated with Claude Code

The template-reference check justified itself with "the template is private,
so a reference 404s for this repo's readers". This repository has been public
since 2026-07-26, so that reason is false. The rule survives on its second
justification, that the coordination flow is machinery a consumer should not
see, so the wording keeps that and drops the dead half. Corrected in both
places that stated it, the audit finding and the recurring.norepoxref check.
The check also fired on the hub itself, reporting its own AGENTS.md as drift
for naming the repository it lives in. That is a false positive: the hub's
carried files are the source, and naming itself is correct there. The section
check at the same layer already excludes the hub, so this reuses that guard.
Verified against the live audit rather than the offline self-test, since the
check reads the repo over the API. Before: two findings on ProjectTemplate,
one of them this false DRIFT. After: only the real has_discussions defect.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 1, 2026 14:28

CopilotAI 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.

Pull request overview

This PR updates the hub’s live-audit “carried files must not reference the template repo” rule to (1) remove the now-false “template is private” premise and (2) avoid falsely flagging the hub repository when it audits itself.

Changes:

  • Updates the recurring.norepoxref intent assertion to remove the “private repo / 404” justification.
  • Adjusts spec/audit.py to skip the template-reference check when auditing the hub itself, preventing a self-audit false positive.
  • Refines the drift message/commentary to focus on “coordination machinery” as the reason.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
spec/project-types.jsonUpdates the documented intent for the “no coordination references in carried files” rule.
spec/audit.pyChanges the carried-file template-reference check to skip the hub itself while continuing to flag downstream repos.

Comment threadspec/project-types.json Outdated
The assertion said `spec/audit.py` checks "the two agent-instruction files",
while the check reads three: AGENTS.md, GOVERNANCE.md and
.github/copilot-instructions.md. GOVERNANCE.md is rule text rather than an
agent-instruction file, which is likely how the count drifted.
The doc now names all three rather than counting them, so adding a path
cannot silently re-open the gap, and records the hub exemption this PR added.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings August 1, 2026 14:30

CopilotAI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

spec/audit.py:626

  • The comment says this check targets the "agent-instruction files", but the path list includes GOVERNANCE.md, which is primarily rule text. Consider rewording to something like "carried guidance docs" (or explicitly listing the files) to avoid misleading future maintainers about what’s being scanned.
 # The coordination flow is machinery a consumer should not see, so a carried file states the behavior rather than the destination.
# This checks the agent-instruction files, where a stale "report drift upstream" paragraph once spread.
# Skip the hub itself, whose own carried files are the source, where naming the repo they live in is correct.

The previous commit named the three paths in the spec assertion but left the
code comment calling them "the agent-instruction files", which GOVERNANCE.md
is not: it is rule text. That is the same mismatch, half-fixed.
Found as a suppressed finding in the Copilot round, verified against the path
tuple before accepting it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ptr727

Copy link
Copy Markdown
OwnerAuthor

Closing the loop on the suppressed finding from the second round, since a suppressed finding gets verified rather than skipped.

Real, and fixed in 21f67da. The comment described the scanned paths as "the agent-instruction files" while the tuple includes GOVERNANCE.md, which is rule text rather than agent instructions:

forpathin ("AGENTS.md", "GOVERNANCE.md", ".github/copilot-instructions.md"):

This is the same mismatch the previous round raised against spec/project-types.json, and I had only half-fixed it: the spec assertion got the three names, the code comment kept the wrong collective noun. It now names them too, so the code and the spec describe the same three paths in the same terms.

Worth noting the two rounds found the identical defect in two places. Naming the files rather than characterizing them is what stops it recurring.

CopilotAI review requested due to automatic review settings August 1, 2026 14:33

CopilotAI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 4d79182 into developAug 1, 2026
7 checks passed
@ptr727
ptr727 deleted the feature/audit-template-xref-premise branch August 1, 2026 14:53
ptr727 added a commit that referenced this pull request Aug 1, 2026
… the carried-file corrections to main (#517)
Promotes twelve commits to `main`. Three of them change **carried**
files, so downstream repos read the stale text until this lands, which
is what makes the promotion the delivery step rather than bookkeeping.
## What this delivers to the fleet
**Carried-file corrections**, picked up by every repo on its next
re-vendor:
| PR | File | Correction |
| --- | --- | --- |
| #514 | `.github/copilot-instructions.md` | Described the pre-split
`AGENTS.md`, wrong in both halves. `GOVERNANCE.md` holds the rule
sections and the two `intent` ones; `AGENTS.md` carries two verbatim
sections and none repo-specific |
| #514 | `CODESTYLE.md` | Said MD033 flags HTML elements while the
config allows `details` and `summary`; also gains the `HISTORY.md`
mirror rule, moved from a hub-only spec file so a repo can read the rule
it is graded against |
| #514 | `WORKFLOW.md` | D2.2 "skipped on smoke" read as the job rather
than the validation, and a review acting on it proposed a change that
would have coupled the release to smoke |
| #503 | `.editorconfig`, `.gitattributes` | 36 comment findings in the
files a new repo copies first |
| #501 (earlier) | `repo-config/configure.sh` | Already on `main` |
**Spec and requirement changes**:
- **#507** makes `OPERATIONS.md` `appliesTo: "*"`, keyed to the need
rather than to `workflowModel`. Measured: 3 of 21 repos carry it, so
**17 will report a new `LETTER file:` finding**. Intended, and a headed
stub satisfies it.
- **#512** declares `.github/workflows/merge-bot-pull-request.yml` at
`interface` fidelity, closing a graded contract (`WORKFLOW.md` D8.1)
that no spec required. 15 of 21 already carry it, so this ratifies a de
facto standard; the other **6 report a new `DRIFT`**, and those six have
Dependabot pull requests piling up with nothing to merge them.
- **#505** stops the audit flagging the hub against itself and drops a
premise that was false since this repo went public.
- **#511** fixes the README shape across repository visibility.
- **#515** puts audit-report authorship with the hub and names the base
branch, after a downstream conformance PR targeted `main` and I merged
it without checking.
- **#513** forward-ports that PR's content, restoring the forward-only
invariant.
**Backlog and reports**: #504, #506, #510, #516 record the README shape
rework, the branch-bootstrap step, the declared-description design, and
why the audit is on demand.
## Fleet consequence, stated before it lands
Two owed follow-ups this promotion creates or carries:
1. **Re-vendor `repo-config/configure.sh`**, already owed from #501,
since it is `verbatim` with `appliesTo: "*"` and every repo holding a
copy is byte-mismatched.
2. **The next fleet audit reads noisier**, by 17 `OPERATIONS.md` letters
and 6 merge-bot drifts. Both are new requirements rather than repo
regressions.
## Verification
Run on `develop` at `e4c76bc`:
```
python3 scripts/test_prose_lint.py 144 tests, OK
python3 scripts/test_repo_gate.py 23 tests, OK
python3 scripts/test_pr_review.py 27 tests, OK
python3 spec/audit.py --selftest SELFTEST PASS
python3 scripts/repo_gate.py eol 0, sha-pin 0
python3 spec/validate.py OK, 21 cataloged
prose_lint --check charset --check dupword --check spelling clean
editorconfig-checker (docker, canonical) clean
```
Every one of the twelve was merged green with a Copilot review covering
its head SHA.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ptr727