Repository navigation
fix(evidence): derive default authority from subject binding - #10321
Conversation
evidenceEnvelopeForAdmission defaulted a missing authority to shipped-artifact for every observation, including ones with no artifact subject and ones produced by a live debugger session. An unbound record therefore claimed authority over an artifact it cannot name, and live GDB, Rizin and Cutter observations could never qualify a live-observation contract because that contract accepts only controlled-replay or external-service Evidence. Default to analyst-inference when no subject is bound and keep shipped-artifact when one is, so the default matches what the record can actually support. Declare controlled-replay at the eight live debugger observation sites (GDB 6, Rizin 1, Cutter 1) so those records describe the controlled replay they performed and satisfy the documented contract.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge within its stated scope. SummaryThis PR derives default Evidence authority from the named subject and gives debugger and ADB observations explicit source labels.
The latest changes only adjust formatting. No new issues or security problems were found. The base still contains the old default, so this fix has not been superseded there. Reviews (17) · Last reviewed commit: "style(adb): apply oxfmt formatting to th..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50e4e928ad
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The GDB command process-exit branch was the only unbound retention path that named no authority, so this branch's new default derived it as analyst-inference. That label cannot support the live-observation contract, and every sibling path (timeout, cancellation, protocol failure, startup) already states controlled-replay. The authority and the unavailable-subject reason now live beside the provider identity so the retention paths read them from one place instead of repeating the literals and drifting apart.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a915f4dbe
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2bf721d828
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The bridge drives the documented already-running Cutter GUI, whose document state REA neither owns nor resets, so its command observations claim no controlled replay. Label them external-service like the comparable IDA and Frida bridge evidence: live-observation obligations still accept it, while controlled-replay-only verifier contracts and bundle replay scenarios no longer include these observations.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
evidenceEnvelopeForAdmission defaulted a missing authority to shipped-artifact for every observation, including ones whose subject names no target. An unknown subject therefore claimed authority over an artifact it cannot name, and live GDB, Rizin and Cutter observations inherited that label, so those records could never satisfy a live-observation contract that accepts only controlled-replay or external-service Evidence. Default to analyst-inference when the subject identity is unknown and keep shipped-artifact when it names a target. Declare the authority the live debugger paths actually performed: controlled-replay for GDB and Rizin, and external-service for Cutter, whose document state REA neither owns nor resets. Rebased onto the Evidence target-identity revision; the earlier subjectUnavailableReason field no longer exists.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Status on the red lanes: both are upstream, not this branch.
This PR does not touch that path: the diff is 8 files, all in State otherwise: Two things you could weigh in on:
|
main moved the GDB observation sites onto createGdbSessionEvidence, which left the explicit authority up to each caller. Pass GDB_OBSERVATION_AUTHORITY in the helper so every session observation keeps the controlled-replay label without repeating it at nine call sites.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Rebased onto The conflict was in Validation actually run on the merged tree:
Not run: the full |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
The admission default now derives authority from the subject, so a subjectless ADB observation fell to analyst-inference. A device is a service REA attaches to rather than drives, so the observation supports external-service and must stay eligible for live-observation contracts. Carry an explicit authority through AnalysisObservation so a producer that knows its own authority can name it, and set it for every ADB operation.
|
Handled the three open review threads on the current head ( Two were already fixed on the branch. The GDB process-exit retention and the Cutter bridge reply both go through paths that now pass an explicit authority ( The ADB one was real, and I fixed it rather than dismissing it.
Validation, actually run:
Not run: the full test suite, and no real |
The admission default derives authority from the subject, and a subjectless observation falls to analyst-inference. createAnalysisExecution never carried an authority field, so every observation the ADB adapter built through it was committed at the subject-derived default instead of the service's. Name the authority once in the domain model, stamp it on every successful execution at the adapter boundary, and route the cleanup-failure and cancellation-retention sites through one helper. Open the execution options field so other providers can name their own authority. Verified: a push whose device digest does not match now retains its receipt at external-service; removing the stamp fails that assertion. check:fast passes.
|
The greptile finding on the retained ADB observations is fixed in What changed: the authority is now stamped once at the provider's Verified with a reverse-check: the push digest-mismatch test asserts Not covered here: cancellation-retained partials in pull / package-pull / activity-start / bugreport still use their bare shapes and therefore the subject-derived default. That needs the four producer shapes and their projections updated, which I would rather land separately than fold into this fix. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fae7b4a5d7
ℹ️ 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".
Resolves the AdbProvider.execute conflict: main extracted the retained-cleanup retry into #retryPendingCleanup, which already covers both the provider-owned resources and the pending output directory that this branch retried inline. Keep the branch's observedExecution wrapper so device observations still carry external-service authority.
The verificationFailed branch built its retained receipt with createEvidence directly, so the admission default derived the authority from a subjectless target and labelled an observed push as analyst-inference. Pass the device authority through the same way the neighbouring digest-mismatch partial does, so the receipt can still support live-observation verification.
The previous commit wrapped two expressions that oxfmt keeps on one line, so npm run format:check failed on Static checks.
Summary
evidenceEnvelopeForAdmissiondefaulted a missingauthoritytoshipped-artifactfor every observation. A subject that names no identifiedtarget therefore claimed authority over an artifact it cannot name, and the live
GDB, Rizin and Cutter observation sites inherited that label, so those records
could never satisfy a
live-observationcontract:docs/reconstruction-coverage.mdaccepts only
controlled-replayorexternal-serviceEvidence for it.Fixes #10294
Problem and expected behavior
shipped-artifact, the strongest available authority,independent of what the subject actually names.
src/gdb,src/rizinandsrc/cutterdeclaredauthorityzero times, soevery live debugger command/startup observation was labeled as a statement
about a shipped artifact.
verifierHasComparableEvidencenever qualifies a verifier resultthat cites only live-session Evidence, even though the session observed the
behavior the contract describes.
Expected: the default follows what the record can actually support, and
live-session observations describe the replay they performed.
Change and scope
src/domain/evidence.ts: the default authority is derived from the subjectidentity —
analyst-inferencewhen it isunknown,shipped-artifactwhen itnames a target. An explicit
authoritystill wins in both cases.authority: "controlled-replay"at the six GDB observation sites(startup, console, retained process-exit, protocol failure, timeout,
cancellation) and on the Rizin command observation.
authority: "external-service"on the Cutter command observation:the bridge drives an already-running GUI whose document state REA neither owns
nor resets, so it claims no controlled replay.
live-observationstill acceptsit; controlled-replay-only contracts and bundle replay scenarios no longer
include it.
Not included: no change to the coverage contract table, and no re-labeling of
stored Evidence. Existing records keep the authority they were written with;
evidence_idcoversauthority, so already-persisted records are unaffectedbyte-for-byte.
This branch was rebased onto the Evidence target-identity revision (
#11416,#11568). That revision removedsubjectUnavailableReasonand made everyrecord name a target identity, so the earlier
subject === nulltest no longerdistinguished anything; the derivation now keys on
subject.identity.kind.It was then merged with
mainagain at6c4e2bba9to pick up#11686, whichrepairs the Stryker command-handler selector after
#11680moved the CLIcommands onto
registerCliCommand.Contract and boundary impact
src/domain/evidence.tsowns theenvelope default; the debugger adapters own their own observation label.
ordinary fix inside existing boundaries, no new provider or target authority.
authorityvalues inoutput change for records whose subject names no target and for debugger
observations.
is now labeled
controlled-replayand Cutterexternal-service, instead ofinheriting
shipped-artifact.records naming no target no longer claim shipment authority, and live-session
records can now back
live-observation.target interaction added; the debugger sites already ran.
Expected effects:
The debugger sites are existing behavior; this change only relabels their
Evidence.
Evidence and regression coverage
src/domain/evidence.test.ts: a new case pins the default for a target-namingsubject, an
unknownsubject, and the explicit-authority override in bothdirections.
tests/boundary/providers/CutterBridgeService.test.ts: a confirmed Cuttercommand observation reports
external-serviceand notcontrolled-replay.tests/boundary/providers/GdbSessionManagerCoverage.test.ts: the retainedprocess-exit observation reports
controlled-replay.origin/main,grep -n "?? \"shipped-artifact\"" src/domain/evidence.tsfinds the default andgrep -rn authority src/gdb src/rizin src/cutterreturns no matches.authorityfields in debugger Evidence and inEvidence whose subject names no target now report their real source.
sites are covered by the existing boundary tests, which exercise the retention
paths and now assert the label on two of them.
Validation performed
All of the following were re-run on the merged head
0be5ef06f:npm run check:fast— typecheck, lint and architecture guards passed.npm run test:local -- src/domain/evidence.test.ts— 47 passed.npm run test:focused -- tests/boundary/providers/CutterBridgeService.test.ts tests/boundary/providers/GdbSessionManagerCoverage.test.ts— 237 passed.node scripts/prepare-reverse-tools-mutation.mjs— exits 0.npm run test:focused -- tests/boundary/providers/RizinDebugSessionManagers.test.ts tests/boundary/providers/RizinDebugSessionCoverage.part1.test.ts tests/boundary/providers/RizinDebugSessionCoverage.part2.test.ts— 32 passed (run on the pre-merge headc0c1e6db8; the merge did not touch Rizin).npm run test:local -- src/application/ReconstructionObligationLedger.authority.test.ts src/application/ReconstructionObligationCandidates.test.ts src/domain/reconstructionCoverageEvidence.test.ts— 64 passed (pre-merge head).npm run test:local -- src/application/WorkflowEvidence.test.ts src/application/desktop/DesktopApplicationCapture.test.ts src/application/investigation/EvidenceLedger.test.ts src/application/binary/BinarySessionBundleResources.test.ts— 81 passed, 13 skipped (pre-merge head).many suites read; I ran the obligation, workflow, desktop-capture, ledger and
bundle-resource consumers plus the three provider boundaries.
Two boundary tests,
tests/boundary/mcp/decompileAllCaveats.test.tsandtests/boundary/mcp/environmentServeMcp.test.ts, fail on this branch. They failidentically on a clean
origin/maincheckout at6c4e2bba9, andmain's own CIis red at several of the SHAs since
f14e9a1d2, so they reflect upstream work inflight rather than this diff. Neither test reads Evidence
authority.Compatibility, safety, and release
authority; only newly created records use the derived default. Consumers that
filtered on
shipped-artifactfor an unknown subject or debugger records willsee the corrected label.
session was run (see remaining proof gaps).
provenance label, not an authority grant.
Author readiness
Human owner: @2SinceJuly
Before merge
type(scope): outcome.