Skip to content

Verify laboratory observations and executable-adapter gates - #257

Merged
sodejm merged 5 commits into
mainfrom
codex/issue-190-lab-observations
Oct 11, 2026
Merged

sodejm merged 5 commits into
mainfrom
codex/issue-190-lab-observations

Conversation

@sodejm

@sodejm sodejm commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Verify signed, owner-provided VM/container isolation, egress, canary, clean-baseline, and reset observations before an executable laboratory run.
  • Require worker authorization and verified endpoint/capability inventories before dispatch; apply scope and egress gates, and journal the dispatch request ID for recovery.
  • Derive positive, negative, and remediated case outcomes from post-run observations and worker results. Missing, stale, or contradictory evidence remains failed or unknown, with ownership-safe cleanup.
  • Load the optional cryptography dependency only during signed receipt verification so the standard-library operator CLI can start before contributor dependencies are installed. Verification fails closed when the package is absent.

Validation and review

  • Focused laboratory harness and CLI startup tests passed, including missing-cryptography and python -S regression cases.
  • make check passed in the issue worktree (All COPS checks passed).
  • Outgoing gitleaks scan covered all four branch commits with no leaks; git diff --check passed.
  • Independent agent critique found a request-ID correlation issue and then a missing fail-closed regression test. Both were fixed; follow-up critique found no remaining material issue. This does not replace required human review.

Evidence limits

Validation used inert local fixtures. No live operator VM/container receipts were available, so this PR does not claim observed isolation or a live reset. The operator-provisioned signer, worker, and inventory remain trust boundaries, documented in the updated threat model and laboratory guidance.

Human review is requested for exact head b476937cf850aad655ccbee826d374425e16af83, including the authorization and scope gates, signed observation handling, outcome classification, recovery journal, negative cases, and documentation.

Closes #190

Require authenticated VM or container isolation, canary, and reset observations before verification. Derive case outcomes from signed adapter observations and require completed worker authorization, isolation, scope, and egress gates for executable adapters. Journal dispatch intent and correlate unknown attempts with worker audit request IDs.

Checks: focused laboratory and skill tests passed; make check passed; staged diff check and gitleaks staged scan passed.

Recovery: revert this commit to restore prior harness behavior. Operator-owned laboratory state and journal records require separate review and cleanup; no live operator receipt was available for this offline validation.

Refs #190
@sodejm
sodejm marked this pull request as ready for review October 11, 2026 15:52
@sodejm
sodejm merged commit f6a3251 into main Oct 11, 2026
18 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 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-10-11T15:59:04.366922Z ba9a7ac Draft marked ready
ℹ️ 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: ba9a7acfa6

ℹ️ 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".


canary_found = case_observation.canary_token_detected
blocked = case_observation.control_blocked
cleaned = result.cleanup_status in ("completed", "not_required")

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 Invalidate labs after incomplete worker cleanup

When a remote run reports cleanup_status as partial or failed—statuses the worker uses when effects remain unresolved—this only makes the case result failed; the environment remains verified. A subsequent execute_case therefore passes the status and isolation gates and can run against a contaminated laboratory, corrupting case results or compounding residual effects. Invalidate the environment and require a verified reset whenever cleanup is incomplete.

Useful? React with 👍 / 👎.

Comment on lines +123 to +125
"UPDATE cases SET state = 'pending', result_id = ?, payload_json = ? "
"WHERE attempt_id = ? AND state = 'dispatching'",
(result_id, json.dumps({"failure_result": failure_result}, sort_keys=True), attempt_id),

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 Preserve dispatch metadata when binding a result

After dispatch succeeds, this update replaces the entire intent payload with only failure_result, discarding dispatch_request_id, authorization_id, and plan_digest. If the controller restarts before classification, the in-memory RemoteAuthorizedRun is lost and the journal converts this pending record to failed without the identifiers needed to correlate the execution with worker audit evidence. Merge the failure result into the existing payload instead of overwriting the dispatch metadata.

AGENTS.md reference: AGENTS.md:L189-L194

Useful? React with 👍 / 👎.

environment.isolation["verification_status"] = "failed"
environment.isolation["verification_notes"] = f"Unsupported isolation type: {iso_type}"
environment.transition_to("failed")
expected_type = {"container": "container_unprivileged", "vm": "vm_hypervisor"}.get(environment.environment_type)

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 Restore verification for process-sandbox environments

For every schema-valid process_sandbox environment using process_isolated, this lookup returns None, so verification always marks the environment failed. The parent implementation accepted process_isolated, and both the current public schema and TestedMatrix.supported_runtimes still advertise process_sandbox; existing contracts can therefore register successfully but can never verify. Add the missing type pair or remove it through a coordinated migration.

AGENTS.md reference: AGENTS.md:L132-L134

Useful? React with 👍 / 👎.

Comment on lines +280 to +281
if lower_bound is not None and observed_at <= lower_bound:
raise LaboratoryGateError("laboratory receipt predates the operation")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow valid second-resolution receipt timestamps

Receipt timestamps accept values without fractional seconds, but requested_at records microseconds and this strict comparison rejects a legitimately post-challenge receipt whenever its signer emits second-resolution RFC 3339 within the same wall-clock second. classify_case applies the same strict comparison against result.finished_at, so live observation and reset integrations can fail intermittently despite a valid nonce and signature. Normalize timestamp precision or use a bounded causal tolerance while retaining the nonce and freshness checks.

Useful? React with 👍 / 👎.

@sodejm
sodejm deleted the codex/issue-190-lab-observations branch October 18, 2026 15:14
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.

Verify laboratory observations and require executable-adapter gates

1 participant