Repository navigation
Conversation
…s the robot's outcome The TypeScript Opentrons adapter emitted types outside EVIDENCE_EVENT_TYPES (protocol_uploaded, run_action, run_started, run_progress, run_completed). In real mode it never emitted a completion at all, so no Opentrons bundle could prove a run finished. adk limited the opentrons manifest to tier 0 until the adapter is mapped (#418). Mapping (real and mock mode): - protocol upload: method_loaded {opentronsProtocolId, name, protocolHash = sha256 of the protocol source} - first play: execution_started {opentronsRunId} - pause, resume: execution_progress {opentronsRunId, action} - stop: execution_failed {opentronsRunId, reason} - the robot reports the run succeeded: execution_completed {status, commandsSucceeded, commandsTotal}, read when the runner polls progress - the robot reports it failed or stopped: execution_failed {status, errors} Robot-local ids are opentronsRunId and opentronsProtocolId. payload.jobId and the unit fields are reserved for the PCC binding, which the kernel's EvidenceEmitter stamps. A terminal status now releases the run. Before, a finished run stayed current, so the next job's start replayed it, and a failed run left the runner polling "busy" until its 120 s timeout. It now sees idle and fails at once. kernel 867/867 (4 new tests against a fake Opentrons HTTP API), tsc clean. Mutants (no outcome read, no release on success or on failure, the first play reported as progress, stop reported as a completion, runId in place of opentronsRunId) are each killed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117ows6894R3n6YQXBCRahS
LamaSu
added a commit
that referenced
this pull request
Sep 29, 2026
…ompleted commands are timed by the run's end Sensors' review of #417 (bus #3461, returns/pcc-sensors-review-417.md): - F1: every event now has an id, <opentronsRunId>:<commandId>, and a source.deviceType of "instrument", the value the kernel's Opentrons adapter reports (packages/kernel/src/opentrons/adapter.ts, on master and on #426). EvidenceEventSchema.safeParse passes on every event; on fbdab3d it failed with "id: Required" and "source.deviceType: Required". - F2, option (a): an entry is timed by the command's completedAt. A command that never completed is timed by run_ended_at, the run's own completedAt. run_ended_at is required in that case and may not be earlier than any completion, so capturedAt never runs backwards for that entry. createdAt stays in rawContent. Times are parsed as ISO-8601 with a zone, and a malformed time fails closed. - The TS goldens are recomputed with packages/spec's hashEvent and hashBundle. deviceType is part of the hashed source; id is not hashed, as in TS. Verified: 34 command-trace tests and 23 log-capture parity tests pass. With the TS spec (run through tsx), every event passes EvidenceEventSchema, Python and TS agree on hashEvent and hashBundle, and verifyEvidenceSubjectBinding (#341) returns ok. Against fbdab3d, 8 of the tests fail, each on the property it names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
What
The TypeScript Opentrons adapter (
packages/kernel/src/opentrons/adapter.ts) now emits evidence only from the closed vocabulary (EVIDENCE_EVENT_TYPES), and it reports the robot's own outcome.protocol_uploadedmethod_loaded {opentronsProtocolId, name, protocolHash}. The hash is sha256 of the protocol source, i.e. what the robot was told to runrun_actionexecution_started {opentronsRunId}run_actionexecution_progress {opentronsRunId, action}run_actionexecution_failed {opentronsRunId, reason}succeededexecution_completed {status, commandsSucceeded, commandsTotal}failedorstoppedexecution_failed {status, errors}; the runner sees idle and fails at oncerun_started/run_progress/run_completedexecution_*, still markedmock: trueandsource.simulatedWhy
In real mode, no Opentrons bundle could prove a run finished: it held
protocol_uploadedandrun_actionand nothing else. adk limited the opentrons manifest to tier 0 until this mapping lands (#418, bus #3309), and evidence took the mapping.Details
opentronsRunIdandopentronsProtocolId.payload.jobIdand the unit fields are reserved for the PCC binding, which the kernel'sEvidenceEmitterstamps on every event (feat(evidence): LO-EV-9 bind device evidence to the accepted job and kernel before settlement #341). The tests assert that no reserved key appears in any payload.getProgress(). A terminal status releases the run. Before this change, a finished run stayed current, so the next job'sstartreplayed it.emitEvidencenow takes anEvidenceEventType, notstringcast toany, so the compiler enforces the vocabulary.Tests (DGX Spark)
opentrons-evidence-vocabulary.test.ts, run against a fake Opentrons HTTP API.adapter-honesty.test.tsis updated to the new types.tscis clean.feat/evidence-subject-binding@799cea1d): kernel 873/873.runIdis used in place ofopentronsRunId.Draft. Merging is the operator's call.
🤖 Generated with Claude Code
https://claude.ai/code/session_0117ows6894R3n6YQXBCRahS