Skip to content

feat: add deterministic promotion gate - #36

Closed
divo12 wants to merge 3 commits into
stack/v2-02-candidatefrom
stack/v2-03-gate
Closed

feat: add deterministic promotion gate#36
divo12 wants to merge 3 commits into
stack/v2-02-candidatefrom
stack/v2-03-gate

Conversation

@divo12

@divo12 divo12 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • add pure decide_promotion(policy, accepted_run, candidate_run) over PR1 policy and PR2 candidate receipts
  • validate recomputed policy/control-bound CandidateId identities, distinct Git tree/commit identities, exact ordered task and verifier receipt sets
  • return immutable typed status/reasons and canonical JSON+SHA256 decision IDs
  • fail closed for unsupported, error, abstain, unverified, incomplete, and configured-but-unavailable metrics

Scope

This PR performs no Git, Harbor, Langfuse, filesystem, MCP, clock, randomness, or runtime I/O. It targets stack/v2-02-candidate only and is stacked on PR #35.

Verification

  • uv run ruff check src tests plugins/openflywheel/scripts/mcp_server.py
  • uv run mypy src tests plugins/openflywheel/scripts/mcp_server.py
  • uv run pytest --cov=ofw --cov-report=term-missing --cov-fail-under=90 -q: 308 passed, 2 skipped, 95.22%
  • uvx --from radon radon cc -s -a ...: all gate production functions CC <= 5
  • four skill quick validators and plugin validation passed
  • gate-focused coverage: 100% statement/branch

Known interface boundary

Current PR2 receipts do not carry verifier scores, cost, or latency. Configured cost/latency limits therefore fail closed as missing evidence; accepting measured metrics requires the subsequent PR2 contract update.


Summary by cubic

Adds a pure, deterministic promotion gate that decides whether a candidate run can be promoted over the accepted run, replacing the provisional gate. It validates experiment and candidate identity, exact task ordering, receipt uniqueness, and outcome verdicts, then returns an immutable decision with canonical JSON and a SHA-256 decision ID. Any unsupported, error, abstain, unverified, or incomplete outcome fails closed as inconclusive.

Known boundary

  • PR2 receipts don't yet carry cost or latency, so configured limits always fail closed until that contract is updated.

Written for commit fe3c124. Summary will update on new commits.

Review in cubic

Blocked: PR2 must first publish the immutable, self-validating EvaluatedRunReceipt contract; the current observation-based gate is not ready for review.

Blocked on PR2 EvaluatedRunReceipt; current observation interface will be replaced

@divo12

divo12 commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

Closing this premature PR. PR2 has not yet published the confirmed immutable EvaluatedRunReceipt contract, so PR3 gate implementation is intentionally paused and will be recreated only after that receipt is available.

@divo12 divo12 closed this Sep 3, 2026
@divo12 divo12 reopened this Sep 3, 2026
@divo12
divo12 marked this pull request as draft September 3, 2026 09:13
@divo12

divo12 commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

Obsolete observation-based PR; current receipt-based implementation is tracked in #37.

@divo12 divo12 closed this Sep 3, 2026
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