Skip to content

Enforce positive and negative evidence proofs - #12

Merged
alanhoff merged 2 commits into
mainfrom
chore/evidence-proofs
Sep 1, 2026
Merged

alanhoff merged 2 commits into
mainfrom
chore/evidence-proofs

Conversation

@alanhoff

@alanhoff alanhoff commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • upgrade Coordinator workflow state to schema v8
  • require and execute positive/negative proof commands across node and runtime surfaces
  • persist positive output, enforce atomic closeout reruns, and retain legacy exemptions
  • update documentation and add proof runner/state/runtime coverage

Validation

  • python3 -m unittest discover -s tests (124 passing)
  • Ruff checks pass
  • skill quick validator passes

Copilot AI lite review requested due to automatic review settings September 1, 2026 05:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-01T05:10:52.281268Z c5e5eb3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c5e5eb300f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +101 to +103
reader.join(timeout=1)
process.stdout.close()
if reader.is_alive() or read_error:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Terminate inherited-output children before closing the pipe

When a proof shell exits after backgrounding a child that inherits stdout, process.wait() succeeds while the reader remains blocked on that child's open pipe. After the one-second join expires, process.stdout.close() can itself block waiting for the reader, so execution never reaches the reader.is_alive() error and the configured proof timeout no longer bounds the mutation; this can leave the workflow lock held indefinitely. Stop the process group or otherwise unblock the reader before closing the stream when it is still alive.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new proof runner’s timeout/overflow handling can hang indefinitely and can mask overflow errors, which is risky in an enforcement path invoked during completion/closeout.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR upgrades the Coordinator workflow state to schema v8 and enforces a new “proof contract” for non-legacy nodes: every node must carry descriptive evidence plus positive/negative proof commands, which are executed at node completion and again during workflow closeout to validate outcomes and persist positive output.

Changes:

  • Bump workflow state schema to v8, introducing proof contracts (evidence_*_proof_command), proof metadata, and legacy proof exemptions for pre-migration nodes.
  • Add bounded proof command runner and integrate proof execution into node completion, judge completion, runtime reconcile, and workflow closeout flows.
  • Expand test coverage and update user-facing documentation to describe proof requirements, closeout behavior, and security considerations.
File summaries
File Description
tests/test_state.py Updates state tests for schema v8 and adds extensive proof-enforcement scenarios.
tests/test_proofs.py Adds unit tests for the proof command runner (cwd/env/output/timeout/limits).
tests/test_dynamic_runtime.py Extends dynamic runtime tests to require proof bundles and validate proof propagation.
skill/SKILL.md Documents the new proof contract requirements and lifecycle semantics.
skill/scripts/lib/coordinator/state/store.py Implements schema v8, validates proof contracts, executes proofs on completion/closeout, and upgrades v6/v7 state.
skill/scripts/lib/coordinator/state/proofs.py Introduces bounded shell execution for proof commands with output limits and timeouts.
skill/scripts/lib/coordinator/cli/state.py Updates CLI surface to require proof plan input for reconcile and removes mandatory result/evidence for proof-enforced completion.
skill/references/workflow-protocol.md Updates protocol docs for proof execution at completion and closeout.
skill/references/state-schema.md Updates schema docs to v8, including proof fields, legacy exemptions, and closeout reruns.
skill/references/model-routing.md Updates schema version references used by routing docs.
skill/references/dynamic-runtime-graphs.md Documents proof bundles for runtime reconcile/expansion and proof-enforced loops.
skill/references/complexity-accounting.md Updates digest and plan/split documentation to include proof contract fields.
skill/README.md Highlights v8 proof requirements and closeout enforcement in the skill overview.
SECURITY.md Adds security guidance for proof commands (inherited env, no secrets in output/commands).
README.md Updates top-level README to describe proof-enforced closeout behavior for v8 nodes.
README.zh-CN.md Mirrors proof-enforcement docs in the Chinese README.
README.pt-BR.md Mirrors proof-enforcement docs in the Portuguese README.
README.es.md Mirrors proof-enforcement docs in the Spanish README.
Review details
  • Files reviewed: 18/18 changed files
  • Comments generated: 5
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +93 to +100
except subprocess.TimeoutExpired as exc:
_stop_process(process)
process.wait()
reader.join(timeout=1)
process.stdout.close()
raise ProofExecutionError(
f"proof command exceeded the {timeout}-second timeout"
) from exc
Comment on lines +103 to +106
if reader.is_alive() or read_error:
raise ProofExecutionError("unable to capture proof command output")
if overflow.is_set():
raise ProofExecutionError(f"proof command output exceeds {output_limit} bytes")
Comment thread tests/test_state.py
Comment on lines +58 to +62
def proof_contract(node_id: str, *, succeeds: bool = True) -> dict[str, str]:
output = f"{node_id} positive proof"
positive_body = f"print({output!r})" + ("" if succeeds else "; raise SystemExit(1)")
negative_body = "raise SystemExit(1)" if succeeds else "print('negative proof reproduced')"
return {
Comment thread tests/test_proofs.py
Comment on lines +21 to +27
def python_command(body: str) -> str:
arguments = [sys.executable, "-c", body]
return (
subprocess.list2cmdline(arguments)
if os.name == "nt"
else shlex.join(arguments)
)
Comment on lines +47 to +51
def proof_contract(node_id: str, *, succeeds: bool = True) -> dict[str, str]:
output = f"{node_id} positive proof"
positive_body = f"print({output!r})" + ("" if succeeds else "; raise SystemExit(1)")
negative_body = "raise SystemExit(1)" if succeeds else "print('negative proof reproduced')"
return {
@alanhoff
alanhoff merged commit fb3d646 into main Sep 1, 2026
4 checks passed
@alanhoff
alanhoff deleted the chore/evidence-proofs branch September 1, 2026 05:12
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.

2 participants