Skip to content

✨ feat(lab): add report generator and redaction gate (LAB-H06) - #268

Merged
konih merged 1 commit into
mainfrom
feat/lab-h06-report
Aug 5, 2026
Merged

konih merged 1 commit into
mainfrom
feat/lab-h06-report

Conversation

@konih

@konih konih commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • LAB-H06: report generator + redaction gate for DOC-02 publication drafts
  • Meta tests: lab_report_redaction_meta_test.sh, lab_harness_meta_suite.sh green
  • Serialized integrator lane — P2s deferred by coordinator

Test plan

  • bash hack/test/lab_report_redaction_meta_test.sh
  • bash hack/test/lab_harness_meta_suite.sh

Emit DOC-02 summary.md + checksums from H05 evidence trees; block
publication on seeded secret patterns. Thin H09 golden schema covered
via synthetic sample-bundle and lab_report_schema_golden_test.sh.
Copilot AI lite review requested due to automatic review settings August 5, 2026 11:02
@konih
konih merged commit 7f396a3 into main Aug 5, 2026
22 of 25 checks passed
@konih
konih deleted the feat/lab-h06-report branch August 5, 2026 11:02
Copilot stopped reviewing on behalf of konih due to an error August 5, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an offline lab report generator and accompanying redaction + golden-schema tests, backed by a synthetic DOC-02–shaped sample evidence bundle.

Changes:

  • Introduces hack/lab/report.sh to generate summary.md and checksums.txt for an evidence run directory.
  • Adds redaction scanning/gating library (hack/lab/lib/redact.sh) and meta/golden tests to validate report output and redaction behavior.
  • Adds a synthetic hack/lab/testdata/sample-bundle fixture used by the tests.

Reviewed changes

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

Show a summary per file
File Description
hack/test/lab_report_schema_golden_test.sh Golden checks for report output schema/anchors and checksums format.
hack/test/lab_report_redaction_meta_test.sh End-to-end meta test: clean fixture passes, seeded fake secrets fail; invokes golden schema test.
hack/lab/testdata/sample-bundle/timings/.keep Ensures timings dir exists in the synthetic bundle.
hack/lab/testdata/sample-bundle/scenario-matrix.md Fixture scenario matrix content used by report/tests.
hack/lab/testdata/sample-bundle/pprof/.keep Ensures pprof dir exists in the synthetic bundle.
hack/lab/testdata/sample-bundle/manifest.md Fixture manifest used by summary generation and anchor checks.
hack/lab/testdata/sample-bundle/limitations.md Fixture limitations content used by summary generation and “honesty gate” checks.
hack/lab/testdata/sample-bundle/RUN_ID.txt Fixture run id source used by report.
hack/lab/testdata/sample-bundle/RETENTION.notes Fixture documentation about retention/size expectations.
hack/lab/testdata/sample-bundle/README.md Fixture documentation and RUN_ID note.
hack/lab/report.sh New report generator CLI (summary + checksums) with redaction gate.
hack/lab/lib/redact.sh New redaction scan/gate library used by report and tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hack/lab/report.sh
Comment on lines +187 to +194
_lab_report_write_summary "${RUN_DIR}"
_lab_report_write_checksums "${RUN_DIR}"

# Redaction gate last: seeded secrets must fail; clean synthetic sample passes.
if ! lab_redact_gate "${RUN_DIR}"; then
printf 'report: redaction gate failed — refuse publication for %s\n' "${RUN_DIR}" >&2
exit 1
fi
Comment thread hack/lab/report.sh
cat <<EOF
# Lab evidence summary — \`${run_id}\`

Publication draft for [lab evidence bundle](../../docs/operator-manual/lab-evidence-bundle.md).
Comment thread hack/lab/report.sh
Comment on lines +167 to +184
tmp="$(mktemp "${TMPDIR:-/tmp}/lab-checksums.XXXXXX")"

(
cd "${run_dir}"
# Stable order; skip the checksums file we are writing and any prior copy.
find . -type f ! -name 'checksums.txt' -print | LC_ALL=C sort | while IFS= read -r f; do
rel="${f#./}"
if command -v sha256sum >/dev/null 2>&1; then
# sha256sum prints "digest path" — rewrite to relative path only.
digest="$(sha256sum -- "${rel}" | awk '{print $1}')"
else
digest="$(shasum -a 256 -- "${rel}" | awk '{print $1}')"
fi
printf '%s %s\n' "${digest}" "${rel}"
done
) >"${tmp}"

mv "${tmp}" "${out}"
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

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