feat(governance): minimal gates + evidence + TaskCertificate slice (#1393)#1544
Closed
ohdearquant wants to merge 2 commits into
Closed
feat(governance): minimal gates + evidence + TaskCertificate slice (#1393)#1544ohdearquant wants to merge 2 commits into
ohdearquant wants to merge 2 commits into
Conversation
…1393) Implements the minimal governance slice as directed (Ocean 2026-06-18): - GatePolicy / GateExecutor / GateVerdict / GateResult / Enforcement Declarative policy rules bound to tool names. HARD enforcement short- circuits with DENY; SOFT/ADVISORY policies accumulate and collapse to a single ADVISORY verdict. gate_fn is a plain callable so policies need no DSL dependency. - EvidenceChain / EvidenceNode / ChainVerifier / ChainVerification Blockchain-style append-only log with SHA-256 hash linkage. Thread- safe via threading.Lock. ChainVerifier detects tamper, reorder, and delete violations. Uses stdlib list instead of Pile (no append_only on current Pile). - TaskCertificate / CertificateGrade Immutable Element minted at task completion. Grade computed from op counts: FULL (zero denials), PARTIAL (advisory only), FAILED (hard denial). mint() factory encapsulates grading logic. - GoverningContext Per-run handle binding the three above: check(tool_name) evaluates policies, writes to the evidence chain, emits GateDenied signal to a branch if one is provided (duck-typed ctx.emit), raises GovernanceViolationError on DENY unless raise_on_deny=False. complete() mints the TaskCertificate. Out of scope: charter DSL, SoD, JIT grants, break-glass, all pile/branch/session rewiring. GateDenied from session/signal.py is the only integration point. 43 tests, all passing. ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…idity, drop scope leak - evidence: compute_node_hash now includes the node tier, so an IMMUTABLE->MUTABLE downgrade is caught as a tamper by ChainVerifier (previously tier was outside the digest and silently mutable). - certificate: mint() refuses FULL/PARTIAL when chain_verified is False; GoverningContext.complete() verifies the chain before minting. - __init__: remove the public docstring line enumerating out-of-scope features; describe only what the module does. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
Closing while unreviewed and stale; #1393 remains the tracking issue and the branch is preserved. The governance slice will be re-cut through the current review gate when the lane is prioritized. |
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 #1393.
Implements the minimal governance slice: option 1 (gates + evidence + TaskCertificate, with restricted break-glass).
lionagi/governance/module:gates.py,evidence.py,certificate.py,context.py,errors.pytests/governance/(48 tests, green on current main)Rebased clean onto main. Harvested from a stale fanout branch during disk/branch cleanup.
🤖 Generated with Claude Code