[codex] implement policy-pack v0.5 - #2
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new policy-pack feature to generate local, explainable custody/audit “evidence pack” reports by reusing the existing review-pack analyzers and layering in policy-notes/metadata evidence summaries.
Changes:
- Added
btc-risk-lab policy-pack --input DIR --format json|markdown [--output FILE]and a new schema0.5PolicyPackReport. - Implemented policy-pack analysis + Markdown/JSON rendering, including evidence document summaries, findings, warnings, missing evidence, review questions, and limitations.
- Added fixtures, CLI/unit tests, and documentation/sample output; bumped crate version to
0.5.0.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/fixtures/policy-packs/multisig-timelock/tx.json | Adds a transaction fixture used by policy-pack tests/sample output. |
| tests/fixtures/policy-packs/multisig-timelock/script.txt | Adds a script fixture to drive timelock signal detection in reports. |
| tests/fixtures/policy-packs/multisig-timelock/psbt.base64 | Adds a PSBT fixture for policy-pack analysis. |
| tests/fixtures/policy-packs/multisig-timelock/policy.yaml | Adds YAML policy notes fixture for evidence-document summarization. |
| tests/fixtures/policy-packs/multisig-timelock/policy.md | Adds Markdown policy notes fixture for evidence-document summarization. |
| tests/fixtures/policy-packs/multisig-timelock/metadata.json | Adds optional metadata fixture consumed by policy-pack. |
| tests/fixtures/policy-packs/multisig-timelock/descriptor.txt | Adds a descriptor fixture to exercise multisig/weight findings. |
| tests/fixtures/policy-packs/missing-policy-notes/psbt.base64 | Adds fixture to validate missing policy notes behavior. |
| tests/cli.rs | Adds CLI regression tests for policy-pack JSON and Markdown-to-file output. |
| src/report/mod.rs | Adds policy-pack rendering entrypoint + Markdown renderer for PolicyPackReport. |
| src/policy_pack.rs | Implements PolicyPackReport schema 0.5 and policy-pack analysis logic (evidence docs + findings/questions/limitations). |
| src/main.rs | Adds policy-pack CLI subcommand wired into analysis + rendering + output handling. |
| src/lib.rs | Exposes policy_pack module from the library crate. |
| ROADMAP.md | Documents policy-pack as completed MVP and clarifies non-goals. |
| README.md | Documents policy-pack command usage, supported evidence files, and security/limitations. |
| docs/policy-pack-sample.md | Adds a sample policy-pack Markdown report for users to reference. |
| CHANGELOG.md | Adds v0.5.0 release notes for the policy-pack feature set. |
| Cargo.toml | Bumps crate version to 0.5.0. |
| Cargo.lock | Updates lockfile to reflect the new crate version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Adds
policy-pack, a local, explainable Bitcoin policy/risk evidence report for directories containing descriptor, PSBT, transaction, policy notes, and optional metadata.What changed
btc-risk-lab policy-pack --input DIR --format json|markdown [--output FILE].0.5PolicyPackReportwith artifacts detected, evidence document summaries, per-artifact summaries, consolidated findings, warnings, missing evidence, review questions, and limitations.review-packlayer and the descriptor, PSBT, transaction, and script analyzers instead of duplicating parsing logic.tests/fixtures/policy-packs/plus CLI and unit tests.docs/policy-pack-sample.md.0.5.0.Security boundaries
policy-packis local-only by default. It does not sign, create wallets, handle keys, broadcast transactions, or make network calls. The report is evidence for human review, not consensus/policy validity, wallet ownership proof, or formal descriptor/PSBT/transaction equivalence.Validation
cargo fmt --all --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-featurescargo run --quiet -- policy-pack --input tests/fixtures/policy-packs/multisig-timelock --format markdownWhy this matters
This strengthens the OpenSats-facing story for
btc-risk-lab: reproducible, offline, explainable Bitcoin review reports that bridge raw protocol artifacts and the evidence custodians, auditors, educators, and technical teams need to reason about risk without relying on closed-source scoring.