feat(report): compliance reporting aggregator + report subcommand (#19)#30
Merged
Conversation
Pure aggregator (src/report/compliance.ts) folds ReconcileResult[] (drift counts, guardrail trips/blocks, applied/failed, errored, deferred) plus an optional audit PostureReport into a unified, clock-free compliance snapshot, with human render + committable JSON artifact. Detect-only. New `github-warden report` subcommand runs cycles in dry-run (+ optional --audit), prints the snapshot, writes --out artifact, and exits 4 on --fail-on attention. Unit-tested aggregation with mock run results. Action bundle rebuilt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #19.
Adds the compliance reporting aggregator — a unified posture snapshot across all cycles plus the audit engine. Unlike a reconcile cycle, this is detect-and-report only and never touches GitHub: it aggregates the structured results the cycles already produced.
Aggregator (
src/report/compliance.ts) — pure, clock-freebuildComplianceReport(results: ReconcileResult[], audit?: PostureReport)folds in:mergeWorthy(quick-win + needs-review)cleanflag (nothing needs attention)Plus
renderComplianceReport(human/check-run summary, mirroring the audit summary layout) andcomplianceArtifact(stable committable JSON). The aggregator is clock-free; the CLI stampsgeneratedAt.reportsubcommandgithub-warden report --config … <auth>runs all (or--cycles-selected) cycles in dry-run, optionally an audit pass (--audit), prints the snapshot, writes a JSON artifact (--out), and exits 4 when--fail-on attentionand the report isn't clean.Verification
npx tsc --noEmitcleannpm testgreen (390 tests; +17 aggregator tests with mockReconcileResult/PostureReport, +5parseReportArgstests)--helplistsreport;reportwithout auth exits 2🤖 Generated with Claude Code