fix(result): bind immutable results to current session provenance - #97
fix(result): bind immutable results to current session provenance#97seonghobae wants to merge 3 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Processing consumption rows now require claim_deadline_at after #81. Seed the wall-clock deadline and prove binary restore preserves it.
There was a problem hiding this comment.
Review (36fb316)
Owner/session/instrument-version binding is the right constructor contract for this slice. ResultSnapshot::new now requires an AssessmentSession, rejects rebound participant/session/instrument-version evidence, and copies those identities from the session rather than from caller-controlled input. Existing scoring-contract and PostgreSQL persist fixtures were migrated to the new constructor. Do not merge until exact-head CI is terminal-success and an independent last-push review exists. This review is not an approval.
Ready to merge: No
Draft; required checks are still queued on this synchronize. Last-push independent review is still required.
What is sound
- Fail-closed mismatch arms have realistic tests and Display copy that tells the caller which provenance disagreed.
- Scientific values remain copied from the already-validated scoring boundary; this PR does not recompute scores.
- Persistence fixtures now construct an authoritative session instead of compiling against the predecessor constructor.
Residual product gaps (do not block this slice; do not fold into #157)
- Construction still accepts a
Createdsession. Every current fixture publishes a result for a session that never activated, completed, or began scoring. A later slice must fail closed unless the session isScoringorScored. - Assessment spec, scoring version, and calibration are still taken from the scoring request, not from the session’s published release.
#157still uses the unbound three-argument constructor. Land this owner-binding head first; do not treat #157 as a substitute.
Scope note
36fb316 seeds claim_deadline_at so recovery invariants compile after #81. Keep that minimal current-base repair if CI needs it. The documented recovery landing remains #177. Do not grow recovery docs or COPY claims on this branch.
Changelog
The public constructor signature changed and caller rebinding now fails closed. Record that under Unreleased before this head is marked ready.
Independent reviewer required. Do not self-approve. Prefer this head over closed #90. Do not open a second owner-binding PR; extend this constructor only for the session-state gate.
Sent by Cursor Automation: Fix Issues
|
Successor for the scoring-state residual is #189 ( |
|
Closing as a proven superseded predecessor. Fresh compare shows #97 head |


Why
ResultSnapshot::newmust not accept caller-rebound participant, session, or instrument-version provenance. The authoritativeAssessmentSessionalready owns those bindings under ADR-0003, ADR-0005, and ADR-0010.Current-base repair
This PR supersedes #90 because protected
mainadvanced after #90's exact-head CI. In particular, result-snapshot PostgreSQL persistence tests landed onmainwith the predecessor constructor and would not compile if #90 were merged without current-base revalidation. This branch starts from protectedmaina7637351be8f0f90c12651d3bcafd959bc52ac81, reapplies the verified ownership fix, and migrates the newly integrated persistence fixture to an authoritative assessment session.Scope
AssessmentSessionprovenance;Architecture mappings remain unchanged: this enforces existing accepted authority/provenance decisions rather than introducing a new ownership boundary. Canonical protected-main traceability should advance only after integration.