Skip to content

docs: add module-level rustdoc to ck-policy#267

Closed
brandon-coproduct wants to merge 10 commits intomainfrom
feat/policy-manifest
Closed

docs: add module-level rustdoc to ck-policy#267
brandon-coproduct wants to merge 10 commits intomainfrom
feat/policy-manifest

Conversation

@brandon-coproduct
Copy link
Contributor

Add module-level documentation to ck-policy/src/lib.rs explaining
the monotonicity checker and the four constitutional invariants.

This is a Config-class change (documentation only) — the constitutional
gate should admit it automatically.

Testing the constitutional merge gate.

brandon-coproduct and others added 10 commits March 17, 2026 18:21
… Kani proofs

These two harnesses were missing #[kani::unwind(4)], causing unbounded
loop unwinding in BTreeSet<Operation> internals (alloc::btree::node::
correct_childrens_parent_links). This led to 339s symex, 61K VCCs, and
CI timeout on the Kani (full) tier.

The third normalize harness (normalize_monotone) already had unwind(4).

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Constitutional kernel proofs timed out at 20 min because all 11
harnesses run together, and BTreeSet construction in parent_policy()
pulls in alloc::btree node machinery even for concrete data.

Changes:
- Split into fast tier (4 concrete-policy proofs, every PR, 15min)
  and full tier (all 11 including symbolic_set() proofs, nightly, 60min)
- Add #[kani::unwind(5)] to the 4 fast-tier proofs to bound BTreeSet
  loop unrolling in CBMC

Fast tier harnesses:
  proof_rejected_never_in_lineage
  proof_budget_escalation_always_rejected
  proof_constitutional_self_merge_impossible
  proof_identical_policy_config_patch_admitted

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
… nightly

Any proof touching admit() pulls in BTreeSet node machinery that takes
>15 min in CBMC regardless of unwind bounds. Root cause is concrete
BTreeSet construction in parent_policy(), not symbolic traversal.

Solution: two-tier architecture.

**Fast tier (every PR, <2 min):** 5 pure bitmask proofs that never
import BTreeSet. Models set-valued axes as u8 bitmasks where subset
is (child & !parent) == 0. Proves:
- F1: Budget escalation detected (symbolic u64)
- F2: Capability escalation biconditional (symbolic u8×6)
- F3: I/O confinement biconditional (symbolic u8×5)
- F4: Combined monotonicity = conjunction of axes
- F5: Subset transitivity (lattice property)

**Full tier (nightly, 60 min):** 11 proofs through admit() with
bounded symbolic BTreeSets + unwind(5). Verifies the production
code path including check_monotonicity, escalations_over, etc.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Defines the invariant rules that AI-generated changes must preserve:

Classification:
  Config         — docs, tests, examples (auto-admittable)
  Controller     — ck-kernel, portcullis, nucleus (requires Kani)
  Evaluator      — ck-policy, ck-types (requires build + tests)
  Constitutional — this file, kani.rs proofs, LICENSE (human sigs)

Invariants:
  - Capabilities cannot escalate (monotone)
  - I/O surface cannot widen (monotone)
  - Proof requirements cannot weaken (monotone)
  - Constitutional files require 1 human signature

Protected paths (may_not_modify without constitutional amendment):
  - PolicyManifest.toml
  - crates/ck-kernel/src/kani.rs (48 Kani proofs)
  - crates/portcullis/src/kani.rs
  - LICENSE, SECURITY.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mergeconstitution
Copy link

Constitutional Gate: Rejected

Patch class: Config
Lineage depth: 1

Reasons:

  • Signature verification failed: Missing required role signatures: [Admission]

@mergeconstitution
Copy link

Constitutional Gate: Rejected

Patch class: Config
Lineage depth: 1

Reasons:

  • Test report missing

@mergeconstitution
Copy link

This PR needs changes before it can be merged

This PR was classified as a Config change but couldn't be admitted.

  1. This PR requires verification that hasn't been completed. The policy requires certain checks to pass before this class of change can be admitted.

Test report missing

What is this? Your repo has a PolicyManifest.toml that defines rules AI-generated changes must follow — like "don't add new network access" or "don't weaken test requirements". This PR would violate one of those rules.


Constitutional Gate · What is this? · Edit policy

@mergeconstitution
Copy link

This PR needs changes before it can be merged

This PR was classified as a Config change but couldn't be admitted.

Bounded Termination
This PR affects termination guarantees — wall time or CPU limits.

PolicyManifest.toml[budget_bounds]

Test report missing


What is this? Your repo has a PolicyManifest.toml that defines rules AI-generated changes must follow. This PR would violate one of those rules. Learn more


Constitutional Gate · What is this? · Edit policy

@brandon-coproduct
Copy link
Contributor Author

Superseded by #269 (clean PolicyManifest bootstrap).

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