Skip to content

Preflight v2: read-only GitHub preflight at a pinned commit - #525

Merged
blitzcrieg1 merged 1 commit into
masterfrom
feat/preflight-github
Nov 28, 2026
Merged

blitzcrieg1 merged 1 commit into
masterfrom
feat/preflight-github

Conversation

@blitzcrieg1

Copy link
Copy Markdown
Owner

Step 2 of preflight v2: the same inventory for a remote repository, read-only.

agentmetry scan --github OWNER/REPO@SHA walks the git tree via the GitHub API (no clone, no checkout, nothing executed), parses the same manifests, and follows resolved script references by fetching blobs and reducing them to a SHA-256 plus observation names through the same script_inspect step as PR #524. Omit @REF to resolve the default branch HEAD; pin the SHA in CI to scan exactly what was reviewed.

Design:

  • preflight.py refactored so path parsing (_script_path) and the one-step inspection (_inspect_reference with an injected reader) are shared between the local walk and the remote tree lookup; local behavior is unchanged (existing tests still pass unmodified in behavior).
  • Same report shape and exit codes: caps on entries/manifests/bytes/surfaces apply, and a truncated git tree is reported as partial coverage (exit 2).
  • GITHUB_TOKEN / GH_TOKEN raises the rate limit; unauthenticated works for public repos. Contents are never stored or printed, keeping the local-first / EU residency story.

Verification:

  • 101 tests pass (5 new remote tests with a fake API: pinned-commit inspection, HEAD resolution, conftest import-time observation, truncated-tree partial, dependency-dir skip, CLI exit codes), 1 platform skip.
  • ruff clean (https-only URL guard on the API client).
  • Live read-only smoke against blitzcrieg1/agentmetry@aa1303f (v0.18.2 tag): exit 0, tests/conftest.py inspected with hash prefix only.
  • Detection-frozen files untouched; ruleset fingerprint does not move.

Stacks on #524. Next: dashboard correlation of preflight findings (repo + SHA) with recorded sessions in that workspace.

Rebuilt on master after #524 merged: the same #525 content (bounded
GitHub preflight reads, symlink skips, partial-report preservation)
rebased onto the squashed preflight v2 base.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
@blitzcrieg1
blitzcrieg1 force-pushed the feat/preflight-github branch from ce0e750 to 061f3d5 Compare November 28, 2026 19:40
@blitzcrieg1
blitzcrieg1 merged commit 7dc2740 into master Nov 28, 2026
10 checks passed
blitzcrieg1 added a commit that referenced this pull request Nov 28, 2026
Preflight v2 ships as one release: preflight follows referenced scripts
(#524), a read-only GitHub preflight at a pinned commit (#525), and
preflight correlation with recorded sessions (#526). The canonical event
schema moves to 1.3.0 with the additive workspace_sha256 field. Version
and changelog move together per the version provenance tests.

Generated by Mistral Vibe.

Co-authored-by: Mistral Vibe <[email protected]>
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.

1 participant