Skip to content

Add spec/audit.py: on-demand live fleet audit (roadmap #310 slice D) - #324

Merged
ptr727 merged 3 commits into
developfrom
slice-d-audit-runner
Jul 16, 2026
Merged

Add spec/audit.py: on-demand live fleet audit (roadmap #310 slice D)#324
ptr727 merged 3 commits into
developfrom
slice-d-audit-runner

Conversation

@ptr727

@ptr727 ptr727 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

The "runner next" half of the #310 roadmap decision (docs + matrix landed in #311). Scope per owner direction: on-demand only, owner-initiated (onboarding, suspected drift, deliberate changes) - no scheduled workflow, no App-token machinery; it runs under the local gh auth.

What it does

python3 spec/audit.py [RepoName ...] (default: all 21 cataloged repos) executes the deterministic subset of AUDIT.md per repo, read-only:

  • Settings vs repo-config/settings.json (+ computed has_discussions/default_branch)
  • Rulesets vs the model's payloads (normalized diff; missing/stray/duplicate flagged; operational repos compare operational/develop.json)
  • Secrets (names only) vs spec/secrets.json: baseline + per-mechanism required in the right stores, forbidden anywhere, unclaimed flagged as stale
  • File presence on the ground-truth branch per spec/files.json (model-aware develop payload path)
  • Branch facts: main/develop existence, registry hasDevelop vs reality, and content divergence via tree compare - commit counts mislead under merge-commit promotions, so only a develop...main diff with changed files (main carries content develop lacks) reports

Findings are typed DEFECT / LETTER (file absent, intent unverified per AUDIT.md section 7) / DRIFT; exit is non-zero on defect/letter. AUDIT.md section 0 references the runner.

Live-tested (read-only)

  • Financial-Modeling - reports exactly its known standup state: the Update merge rules and clarify requirements in README #14 files (WORKFLOW.md, version.json, repo-config/*, dependabot.yml) absent on main pending PR Improve setup instructions and documentation consistency #15; settings/rulesets/secrets clean (as applied).
  • ProjectTemplate / PlexCleaner / HomeAutomation-Config - exercised the release, docker-secrets, and operational paths. Genuine drift surfaced (stale hub secrets incl. NINJA_API_KEY/NUGET_API_KEY; HomeAutomation-Config missing the baseline App pair; PlexCleaner missing the repo-config carry) - reported to the maintainer separately, not acted on.

Refs #310 (the cold-start self-test matrix remains the roadmap's open acceptance item).

🤖 Generated with Claude Code

Mechanizes the deterministic subset of AUDIT.md, run from the hub against
every cataloged registry repo (or named ones): general settings vs
repo-config/settings.json, rulesets vs the model's payloads (normalized),
secret names vs spec/secrets.json (required/forbidden/stale), baseline and
per-type file presence on the ground-truth branch (spec/files.json,
model-aware develop variant), and branch facts (main/develop existence,
registry hasDevelop vs reality, content-divergence via tree compare - commit
counts mislead under merge-commit promotions). Read-only; owner-initiated
(onboarding, suspected drift, pre-change); exits non-zero on defect/letter
findings. LF-pinned like validate.py; AUDIT.md section 0 points at it.

Live-tested: Financial-Modeling reports exactly its known standup gaps;
ProjectTemplate/PlexCleaner/HomeAutomation-Config exercised the release,
docker, and operational paths.

Refs #310.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 16, 2026 15:39

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.

Pull request overview

Adds an on-demand, local gh-authenticated Python runner to mechanize the deterministic (read-only) subset of AUDIT.md across the fleet, and wires it into existing audit documentation and line-ending governance.

Changes:

  • Add spec/audit.py to audit live repo settings, rulesets, secret names, baseline file presence, and main/develop branch facts against hub manifests.
  • Update AUDIT.md to reference the new on-demand audit runner.
  • Pin spec/audit.py to LF via .gitattributes and .editorconfig (matching existing shebang-executed Python scripts).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
spec/audit.py New CLI runner that performs the deterministic subset of the fleet audit via gh api.
AUDIT.md Documents the new runner as the mechanized deterministic subset of the audit.
.gitattributes Pins spec/audit.py to LF to keep shebang execution safe/correct.
.editorconfig Pins LF for spec/audit.py alongside spec/validate.py.

Comment thread spec/audit.py Outdated
Comment thread spec/audit.py Outdated
Comment thread spec/audit.py Outdated
The docstring and summary now name the ERROR kind (hard failure), and a
finding-free repo prints a neutral "clean (deterministic checks)" - the full
operational verdict belongs to AUDIT.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 16, 2026 15:44

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.

Pull request overview

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

Comment thread spec/audit.py
Comment thread spec/audit.py
- Secrets audit honors registry requiredSecrets[] (STANDUP.md: requiredSecrets
  plus the implicit baseline) - required in the actions store, never stale.
- main() isolates per-repo failures: a gh/JSON error mid-audit becomes that
  repo's ERROR finding instead of aborting the sweep.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 16, 2026 15:52

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.

Pull request overview

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

@ptr727
ptr727 merged commit 95e56d6 into develop Jul 16, 2026
7 checks passed
@ptr727
ptr727 deleted the slice-d-audit-runner branch July 16, 2026 15:55
ptr727 added a commit that referenced this pull request Jul 16, 2026
#326)

Promotes two squashed increments:

- **#323** (#322 incorporation) - publisher TOCTOU pin (checkout the
dispatch-time commit), .github/ wording, adapted self-audit carry
blessed as the standard downstream shape, tasks-snippet default
build/test groups.
- **#324** (#310 slice D) - spec/audit.py, the on-demand live fleet
audit: settings/rulesets/secret-names/file-presence/branch-facts vs the
ground truth, per-repo error isolation, tree-based divergence detection.
Owner-initiated by design. The baseline App-pair requirement stays
fleet-wide (owner-confirmed: the codegen App merges Dependabot PRs on
every tier, operational included).

Refs #310 (the cold-start self-test matrix remains the open acceptance
item).

Closes #322.

🤖 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants