Skip to content

Hold Every Registry Field to the Shape Its Consumer Requires, and Settle the Declarations No Consumer Reads - #1520

Merged
ptr727 merged 1 commit into
mainfrom
develop
Sep 11, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Promotes develop to main, carrying one merged pull request.

Closes #1508

What this promotes

#1517, which settles every item the #1503 sweep turned up: six registry fields whose validation was looser than what their consumer requires, or whose declaration nothing read, plus the missing unknown-key check.

#1508 item Disposition
1. name and url validated independently Fixed: name must equal its own url's repo segment
2. name still tested by .strip() truthiness Closed by the same check, with no second grammar to drift
3. requiredSecrets[] has no element shape check Fixed: the shape a name needs to resolve against the actions store
4. hasDevelop coerced with bool() Fixed: boolean where declared, required on a cataloged repo
5. driftNotes[] element type unchecked Fixed: non-empty string
6. defaults.groundTruthBranch read by nothing Wired through ground_branch_of()
6. configLayout.* read by nothing Retired from the registry, the schema and STANDUP.md
6. lineEndings read by nothing Declined, with evidence
Also: no unknown-key check for a repo entry Fixed, at the entry and the defaults object, keyed off the schema

Why lineEndings was declined rather than retired

No tool reads it, which is what the sweep measured. Three readers do: GOVERNANCE.md "Line Endings" names it as the source of an operational repo's [*] default, docs/eol-lf-rollout.md tracks the fleet rollout by it, and spec/project-types.json's recurring.eol check takes its expected value from it. A field an auditor and a governance rule read is not an unread declaration.

Left open deliberately

  • #1518: AUDIT.md section 1 says a groundTruthBranch naming develop contradicts it, while GROUND_TRUTH_BRANCH_PATTERN admits any branch and its tests pin release/2.0. Wiring the defaults key made that disagreement reachable from one more place. Settling it either way undoes recently merged work, so it is its own change.
  • #1519: five of the six ground_branch_of() call sites are pinned by no test, and the obvious AST assertion cannot pin them, since it tests arity where the property is wiring. Raised by CodeRabbit and by the branch's own review passes; the gap is declared in the code rather than papered over.

Verification

Six local strict-review passes ran before the pull request opened, then two hosted review rounds. The local passes found 38 defects; the distribution is the useful part, since the code column reaching zero is what closed the loop.

Pass Findings Code Prose
1 7 6 1
2 5 3 2
3 4 2 2
4 5 3 2
5 8 3 5
6 2 0 2

Copilot reviewed both heads at full coverage and independently raised the two prose findings the last local pass had already listed as open in the pull request description. Both are fixed. CodeRabbit raised one nitpick, declined with evidence and filed as #1519.

Every new check was also measured against the malformed input it exists for, on develop's validator and on the branch's, and a 34-mutation battery over every guard the change adds was run in the final pass.

…tle the Declarations No Consumer Reads (#1517)

Closes #1508.

The sweep #1503 asked for found six registry fields whose validation was
looser than what their consumer requires, or whose declaration nothing
read, plus a missing unknown-key check. Each is local to a different
consumer, so each gets the narrowest check that closes it rather than
one broad rule over the registry.

## What each item got

| #1508 item | Disposition |
| --- | --- |
| 1. `name` and `url` validated independently | Fixed: `name` must equal
its own url's repo segment |
| 2. `name` still tested by `.strip()` truthiness | Fixed by the same
check, no second grammar |
| 3. `requiredSecrets[]` has no element shape check | Fixed: GitHub's
own secret-name grammar, mirrored in the schema |
| 4. `hasDevelop` coerced with `bool()`, validated by nothing | Fixed:
boolean where declared, required on a cataloged repo |
| 5. `driftNotes[]` element type unchecked | Fixed: non-empty string |
| 6. `defaults.groundTruthBranch` read by nothing | Wired |
| 6. `configLayout.rulesetsDir` / `.pythonConfig` read by nothing |
Retired |
| 6. `lineEndings` read by nothing | Declined, with evidence below |
| Also: no unknown-key check for a repo entry | Fixed, at both the entry
and the defaults object |

## Items 1 and 2 collapse into one rule

`repo-config/configure.sh` derives its lookup key from the repo
argument, `name="${repo##*/}"`, rather than from the registry. An entry
whose `name` disagreed with its url's repo segment therefore resolved to
nothing there, and every consequence was silent: the environment
assertions skipped while the run still reported no drift, the
description lookup degraded the same way, and the workflow-model lookup
fell through to `defaults.workflowModel`, checking a repo declared
`operational` against the release ruleset payload.

Requiring agreement is also the whole of the name's own grammar.
`GITHUB_URL_RE` already holds the repo segment to the letters, digits,
`.`, `_` and `-` GitHub itself allows, so a name equal to one carries
nothing invisible without a pattern of its own. That is what closes item
2 without reopening the design question #1503 reverted on: the ASCII
floor is not being asserted over a legal non-ASCII repository name,
because no GitHub repository url can carry one.

All 25 entries already agree, so the check is a no-op against today's
registry.

## The unknown-key check reads the schema rather than restating it

`registry/repos.schema.json` marks both the defaults object and a repo
entry `additionalProperties: false`, and no gate runs that schema, so a
misspelled `groundTruthBranch` validated clean and the audit read `main`
without ever saying the declaration it was handed went unread. The
allowed key set is read out of the schema, so the rule keeps one
statement and a key added there is never reported as unknown on the
entry that legitimately declares it.

## `lineEndings` is declined rather than retired

The sweep listed it under "four declarations no consumer reads". No tool
reads it, which is true. Three readers do: `GOVERNANCE.md` "Line
Endings" names it as the source of an operational repo's `[*]` default,
`docs/eol-lf-rollout.md` tracks the fleet rollout by it, and
`spec/project-types.json`'s `recurring.eol` check takes its expected
value from it. A field an auditor and a governance rule read is not an
unread declaration.

## `defaults.groundTruthBranch` is wired

Every reader fell back to a literal `"main"` and consulted no defaults,
so a registry setting this key validated clean and was never read.
`ground_branch_of()` now resolves entry, then defaults, then the fleet
value, the same three-step shape `audit_repo()` already uses for
`workflowModel`, and its three callers across `spec/audit.py`,
`spec/fidelity_honesty.py` and `spec/workflow_reuse.py` pass the
defaults in. This makes `RESYNC.md`'s own sentence true for the first
time: "Every cataloged repository declares `main` or omits the field and
takes it as the default."

## Verification

Each new check was run against the malformed input it exists for, on
`develop`'s validator and on this branch's. All are silent before and
reported after:

| Input | Before | After |
| --- | --- | --- |
| `name` disagreeing with its url | nothing | reported |
| a name carrying a zero-width space | nothing | reported |
| `"hasDevelop": "no"` | nothing | reported |
| `"requiredSecrets": [" CODECOV_TOKEN"]` | nothing | reported |
| `"driftNotes": [7]` | nothing | reported |
| a misspelled `groundTruthBanch` | nothing | reported |
| a re-added `configLayout` | nothing | reported |
| a cataloged repo omitting `hasDevelop` | nothing | reported |

Gates run locally: ruff format and check, mypy, `spec/validate.py`,
`spec/audit.py --selftest`, the full 1380-test suite, `prose_lint.py`
whole-tree and diff-scoped, `repo_gate.py --check eol`, and
`docker_lint.py` (editorconfig-checker, actionlint, markdownlint,
cspell, shellcheck, shfmt, PSScriptAnalyzer). `canonical_review.py
check` reports no carried canonical unit changed.

Two local strict-review rounds ran against the accumulated diff. The
first found seven defects, every one this change's own, fixed in the
second commit: two guards written as `is not None` that skipped their
own check on a declared null, an unguarded set() that turned a malformed
value into a traceback in place of the message naming it, a schema load
outside the guard whose comment claimed a coverage it did not have, a
docstring quoting a body this branch replaced, and two tests that
survived mutation.

## Review history, and what is still open

Six local strict-review passes ran against the accumulated diff, at the
strongest tier available. They found 38 defects across the six rounds.
The distribution is the useful part:

| Pass | Findings | Code | Prose |
| --- | --- | --- | --- |
| 1 | 7 | 6 | 1 |
| 2 | 5 | 3 | 2 |
| 3 | 4 | 2 | 2 |
| 4 | 5 | 3 | 2 |
| 5 | 8 | 3 | 5 |
| 6 | 2 | 0 | 2 |

The code column reaching zero is what closed the loop. The last pass ran
a 34-mutation battery over every guard the branch adds: 24 caught, and
every survivor is either an equivalent mutant or the call-site gap
`GroundBranchReaderCase`'s own docstring declares open.

**Both prose findings listed here as open were then raised independently
by Copilot in review round 1, and are now fixed in 2c35b73.** They were:

- `scripts/tests/test_spec_validate.py:1044` said "each reader carried
its own `entry.get("groundTruthBranch", "main")`", which is false of
`spec/audit.py`, the first file the class names. At the merge base that
expression sat inside `ground_branch_of()` itself, and
`spec/fidelity_honesty.py` and `spec/workflow_reuse.py` carried the
copies of their own.
- `scripts/tests/test_spec_validate.py:897` said the requires/forbids
cross-check is "below the loop". It runs inside the same per-entry
iteration, about a hundred lines further down; what follows the loop is
the printing, which is what the test turns on.

The first took three attempts to correct, each producing a different
false claim about `spec/audit.py`, so the history clause is deleted
rather than corrected again. A docstring asserting another file's
history has no way to stay true, because the fact lives in git rather
than beside the text, and the rule the class pins never depended on it.

**One thing a reviewer is likely to raise, answered in advance.**
`reports/plexcleaner/audit.md` and
`reports/homeassistant-purpleair/audit.md` still name `configLayout` and
`pythonConfig`. Those are dated audit snapshots rather than live
documentation, no gate reads them, and editing a historical report to
match a later decision would misrepresent what that audit found on the
day it ran.

## One thing deliberately not settled here

Wiring `defaults.groundTruthBranch` makes it load-bearing fleet-wide,
and two committed surfaces disagree about what the field may hold.
[`AUDIT.md`](../blob/develop/AUDIT.md) section 1 says a
`groundTruthBranch` naming `develop` "contradicts this section, for
either model", while `GROUND_TRUTH_BRANCH_PATTERN`, added in #1503,
deliberately admits any branch name and its tests pin `release/2.0` as
valid. Resolving that either way would undo recently merged work, so it
is filed as #1518 rather than decided in this pull request.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 11, 2026 00:00
@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 8ede2576-dac1-4602-8b1c-7b394a1cbb46

📥 Commits

Reviewing files that changed from the base of the PR and between 80d0f6d and b21059f.

📒 Files selected for processing (8)
  • STANDUP.md
  • registry/repos.json
  • registry/repos.schema.json
  • scripts/tests/test_spec_validate.py
  • spec/audit.py
  • spec/fidelity_honesty.py
  • spec/validate.py
  • spec/workflow_reuse.py

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.

@ptr727

ptr727 commented Sep 11, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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 changes consistently align registry validation and readers with their consumers, and the added tests cover the new constraints without introducing regressions.

Pull request overview

This promotion PR carries the previously-merged registry hardening work into main, tightening validation and wiring so registry fields are validated to the shapes their consumers actually require, and retiring declarations that no consumer reads.

Changes:

  • Wire defaults.groundTruthBranch through audit.ground_branch_of() and update readers to consult registry defaults rather than falling back to a literal "main".
  • Strengthen registry validation: unknown-key detection keyed off registry/repos.schema.json, plus stricter shapes for requiredSecrets, hasDevelop, and driftNotes, and a name vs url agreement check.
  • Retire configLayout from the registry schema and data, and update standup instructions accordingly.
File summaries
File Description
STANDUP.md Removes retired configLayout from the registry-entry authoring checklist.
spec/workflow_reuse.py Uses audit.ground_branch_of() with registry defaults and extends selftest to pin the three-step resolution.
spec/validate.py Adds consumer-aligned validation for name/url, requiredSecrets, hasDevelop, driftNotes, and implements schema-driven unknown-key checks.
spec/fidelity_honesty.py Routes both readers through audit.ground_branch_of() so defaults are honored consistently.
spec/audit.py Extends ground_branch_of() to resolve entry, then defaults, then fleet value, and wires callers to pass defaults.
scripts/tests/test_spec_validate.py Adds coverage for the new validation and introduces AST-based guards to prevent readers from resolving groundTruthBranch directly.
registry/repos.schema.json Retires configLayout, adds/aligns constraints for requiredSecrets, driftNotes, and requires hasDevelop for cataloged repos.
registry/repos.json Removes the retired configLayout field from all entries.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@ptr727
ptr727 merged commit f4e3f31 into main Sep 11, 2026
9 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

Development

Successfully merging this pull request may close these issues.

The Remaining Six Registry Fields Whose Validation Is Looser Than Their Consumer, or Whose Declaration Has No Consumer

2 participants