fix(item-delivery): reject item-set rebinding under reused digest - #99
fix(item-delivery): reject item-set rebinding under reused digest#99cursor[bot] wants to merge 19 commits into
Conversation
Session creation now copies the published ordered item-version set. from_session compares that set and copies allowed items from the session, so a caller cannot enlarge, shrink, or reorder the form by reusing a well-formed content digest. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
ADR-0005, TRACEABILITY, ERD, UML, and CHANGELOG now describe the authoritative session constructor, isolated provenance checks, and the remaining PostgreSQL instrument_version_ref persistence gap. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Each persistence test compiles item_delivery_support independently, so helpers used by other contracts are dead_code here under -Dwarnings.
There was a problem hiding this comment.
Stale comment
Verdict: domain fix is on this head, not #94
HEAD
c28768ccloses the #94 authority hole.AssessmentSessionnow pins the published ordered item-version set.from_sessioncompares release, version, digest, locale, and that ordered set, then copies allowed items from the session. Isolated mismatch tests and same-session_ref/ different-releasedeliverare present. ADR-0005, TRACEABILITY, ERD, UML, and CHANGELOG record the contract.Keep #94 Draft. Do not merge
5f6142b.Residuals (do not block this domain slice)
- Durable
instrument_version_refonitem_delivery_ledgeris still omitted. Name that adapter gap until a follow-up migration lands.- Session persist PRs (#100 and successors) must store the pinned
item_version_refs. Otherwise the pin is lost across restart and the same rebinding hole reopens after reload.- Detached
SessionStateinsrc/response.rsremains a separate ADR-0005 slice (#107).Next action
Independent last-push review from seonghobae, then mark Ready only after exact-head Runtime CI, coverage, and security checks are green. Do not self-approve. Do not merge #94 in parallel.
Sent by Cursor Automation: Fix Issues
There was a problem hiding this comment.
Finding
from_session now rejects a reused digest that enlarges, shrinks, or reorders the pinned item set. deliver does not.
InstrumentReleaseManifest::new still accepts any well-formed SHA-256 and does not hash the item list. A second AssessmentSession with the same session_ref, release, version, digest, and locale can therefore present a rebound form. On this head, deliver records item_version_001 as Ok instead of SessionMismatch.
That is the same authority hole #94 and this PR set out to close. Construction-time pinning is not enough if later delivery still treats the item set as honor-system.
What to do next
Do not merge this tip. The complete domain fix is PR #185 (a0752a6) on cursor/bc-fbb857d9-64db-4130-8ff4-546ba5119582-9baf. Keep #94 Draft as well.
Still out of scope here
- PostgreSQL
item_delivery_ledgerstill omitsinstrument_version_ref. - Ledger reload remains #110.
- Detached
SessionStateinsrc/response.rsremains #107.
Sent by Cursor Automation: Fix Issues
| let session_provenance = ( | ||
| session.session_ref(), | ||
| session.instrument_release_ref(), | ||
| session.instrument_version_ref(), | ||
| session.instrument_release_content_digest(), | ||
| session.locale(), |
There was a problem hiding this comment.
deliver compares session_ref, release, version, digest, and locale, then stops. A reused digest with an enlarged, reordered, or reduced item_version_refs still matches this tuple, so an active rebound session can append delivery evidence.
Add session.item_version_refs() / self.allowed_item_version_refs to this check. The successor that does that is #185.


Superseded
This session-authority/item-set binding slice is fully contained in #185. Do not merge this predecessor.
Fresh exact ancestry evidence immediately before closure:
c28768c723b443494e18df92c240868a06821709a0752a6a78d3af3823adbb4fbdf402d026d8d474#185 retains the constructor-side exact ordered item-set pin and adds the missing deliver-time item-set comparison, with RED/GREEN coverage for enlarge/reorder/subset rebinding. #185 remains Draft and subject to unchanged exact-head CI/security/review gates. Closing this PR does not promote successor behavior to protected-main truth.