Skip to content

Add fail-closed operational decision gates - #12

Draft
Deathcharge wants to merge 6 commits into
mainfrom
codex/decision-plans
Draft

Add fail-closed operational decision gates#12
Deathcharge wants to merge 6 commits into
mainfrom
codex/decision-plans

Conversation

@Deathcharge

@Deathcharge Deathcharge commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a zero-dependency operational decision-gate layer over existing consensus results
  • support explicit pass choices, minority vetoes, closed vocabularies, required participants, and minimum successful weight
  • return deterministic passed, blocked, or indeterminate verdicts with stable reason codes, the applied policy snapshot, and complete consensus evidence
  • add optional versioned policy IDs, schema-v1 serialization, and deterministic SHA-256 policy digests
  • add end-to-end release-gate and policy-panel examples plus API, integration, security, roadmap, and productization documentation
  • close still-valid review feedback from merged PR Productize agent-consensus as a standalone library #4: shared setting validation, response hashing, real metadata serialization coverage, alias normalization, CI action pinning, least-privilege release guidance, and stale evidence wording

Why

The core tally engine was credible but stopped at “what did the group agree on?” Real release, output-safety, authorization, and routing workflows also need a deterministic answer to “may the application act on this evidence?” Keeping policy evaluation separate preserves the small provider-neutral core while giving the package concrete operational use cases.

Blocking evidence takes precedence: a configured veto or agreed non-pass choice is blocked. Missing reviewers, insufficient successful weight, unknown choices, quorum failure, or no consensus is indeterminate. Only a fully satisfied policy is passed.

Read-only inspection of optional Samsarix producer contracts informed the policy-panel recipe: action policy emits allow/deny with policy identity, ethics emits allow/deny/review with decision identity, orchestration needs an approval primitive, and LaunchGuard has release/readiness evidence. The package imports none of them.

Developer impact

New public API:

  • DecisionPolicy
  • DecisionStatus
  • DecisionReason
  • DecisionVerdict
  • evaluate_decision()

DecisionPolicy.digest covers normalized schema-v1 policy content using canonical UTF-8 JSON and SHA-256. A fixed contract vector protects the encoding from drift. The digest is not a signature.

There are still no runtime dependencies, network calls, persistence, provider SDKs, sibling-repository imports, or protected-action side effects. Hosts remain responsible for authenticated identity, authorization, redaction, policy distribution, and enforcement.

Exact-head validation

Head: 310372a

  • python -m ruff format --check . — 18 files formatted
  • python -m ruff check . — passed
  • python -m mypy agent_consensus — passed, 6 source files
  • python -m pytest — 79 passed, 99.62% branch-aware coverage
  • python -m build — sdist and wheel built; wheel built from sdist
  • python -m twine check <artifacts> — both passed
  • clean environment pip install --no-deps <wheel> — passed
  • installed schema-v1 policy/digest smoke outside checkout — passed
  • installed-wheel pip check — no broken requirements
  • all seven offline examples — passed, including release and policy-panel gates
  • hosted CI — passed twice across quality, Linux Python 3.10–3.14, Windows Python 3.14, package build/check, isolated wheel install, and all examples

Local artifact snapshot:

  • wheel SHA-256: 0EC23FA1C984E7044B03CD23E3ABDBA7A0C2C260F7E4D0AFCF2637AFC6236402
  • sdist SHA-256: 0245C34A52F6C51FE847C21332EEDA489BB3AD86A975F2D8C2B6FD4127F9C251

Review and release gates

  • The full Codex Security workspace scan is pending its setup confirmation; targeted source/sink, credential-pattern, and placeholder scans found no matches.
  • A separate real consumer with a pinned producer version remains the next adoption proof.
  • PyPI name ownership, release version/tag, Trusted Publisher setup, and the final MIT/Apache-2.0/MPL-2.0 choice remain owner-controlled.
  • No package was published and no production infrastructure was changed.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 320d28eb-0d84-46bc-add6-d26b117f7465

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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