Skip to content

feat(session): persist created sessions and rebaseline shipped truth - #100

Closed
cursor[bot] wants to merge 7 commits into
mainfrom
cursor/bc-c6b4a2ac-d982-4390-8aa6-f9a774dfacd6-aae1
Closed

feat(session): persist created sessions and rebaseline shipped truth#100
cursor[bot] wants to merge 7 commits into
mainfrom
cursor/bc-c6b4a2ac-d982-4390-8aa6-f9a774dfacd6-aae1

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Superseded / split into bounded landing lanes

Close this competing mixed-scope draft without merge. Its three useful concerns now have separate bounded vehicles, while its 0022_assessment_session.sql line is explicitly rejected by current review.

Fresh evidence immediately before closure:

Current #100 review identifies five unresolved reasons not to land this head: it introduces a third/colliding session migration history, persists Created-only rows without a restart load path, couples protected-main TRACEABILITY rebaseline to unmerged persistence, advertises that competing table in the as-built map/changelog, and should keep the recovery deadline repair separate.

Those concerns are now separated:

Leave #100's review threads unresolved because they are still valid on this exact head and explain the closure. None of the successor behavior is protected-main truth until its own unchanged exact head passes live gates and required independent review.

seonghobae and others added 6 commits August 16, 2026 22:50
…on main

Rebaseline the evaluated protected-main SHA after #48 and #51. Item-delivery
ledger persistence and immutable result snapshots are protected-main evidence;
remaining persist and operator-health HTTP slices stay Active PR.
Keep the evaluated baseline at 62524a3 for #48/#51 persist evidence.
Discard the stale Active PR claim that merged #76 is still open work.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
#81 requires claim_deadline_at for processing consumption rows, and the
deadline trigger is UPDATE-only. The inherited #72 fixture omitted that
column, so exact-head CI failed closed on #96 after merging current main.
Seed a valid persisted claim and assert the deadline survives COPY restore.
Record protected-main a763735 so item-delivery, response/result snapshots,
deterministic narrative fallback, dual-proof account linking, data-rights
processing-start, scoring-dispatch persist, and inbox claim-expiry are no
longer described as Target or later-than-baseline history.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Store participant, release, version, digest, locale, created state, and
creation time. Exact replay is idempotent; rebinding any stored field or
inserting a non-created session fails closed under READ COMMITTED.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Health PRs already claim migrations/0020_backlog_health_indexes.sql and
0021_scoring_job_health_indexes.sql. Keep created-session persistence on
0022 so directory-order recovery and the product apply APIs do not collide
when those heads integrate.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verdict

Do not merge draft #100 at b982c73. The persist slice is a competing writer. The shipped-truth rebaseline is the unique work and should land without a session table.

What is sound

  • TRACEABILITY / AS_BUILT_SCHEMA / DOCUMENTATION_ASSESSMENT now name exact protected-main a7637351. That is the correct successor to #96, which still evaluates 62524a3e / 085ef4b after merging current main.
  • Shipped persist and narrative claims match the tree: item-delivery (#48), response snapshot (#55), result snapshot (#51), deterministic narrative (#73), dual-proof account link (#85), data-rights processing-start (#76), scoring-dispatch (#68), inbox claim-expiry (#81), scoring-job retry/cancel/expiry on postgres_scoring_job.rs.
  • Created-only insert, ON CONFLICT DO NOTHING, READ COMMITTED classify, and fail-closed rebinding of participant / release / version / digest / locale / state / created_at are internally consistent.
  • Recovery fixture now seeds claim_deadline_at so a processing integration_consumption row survives COPY restore under the #81 UPDATE-only deadline trigger. Protected main still omits that seed.
  • Renumbering 00200022 avoids the health-index filenames claimed by #82 / #113. It does not make this the session landing vehicle.

Why this head must not land

  1. Prefer #125 for session durability. #125 already persists created identity at migrations/0014_assessment_session.sql, loads it without re-checking publication, and replays migrations/0016_assessment_session_command.sql so Activate / Pause / Resume survive restart. Landing #100 first would ship Created-only rows with no load path. A purchaser still loses the session on process restart.
  2. 0022 is a third numbering scheme. #61 / #106 / #109 / #125 occupy the existing 0014 gap between 0012 and 0015. Reserving 0022 for unmerged health indexes creates a colliding physical history if both families integrate.
  3. Do not couple the rebaseline to persist. #96 should close after a TRACEABILITY-only successor lands. #100 should close or retarget after that split. Do not land #61, persist-only #106, load-only #109, or coverage-only #121 over #125.

Next buyer action

  • Review and land #125 for session persist + load + command history.
  • Land a TRACEABILITY / recovery-fixture rebaseline that does not add assessment_session.
  • Keep HTTP session-start behind #87 (RFC 9457) plus a loaded session.
  • Do not self-approve. Do not merge until exact-head checks and an independent last-push approval exist.
Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

@@ -0,0 +1,66 @@
CREATE TABLE IF NOT EXISTS assessment_session (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do not land this table from #100. The session persist lineage already uses migrations/0014_assessment_session.sql on #106 / #109 / #125. #125 is the landing vehicle because it also loads Created identity without accepts_new_sessions() and persists command history so Activate survives restart.

0022 only avoids unmerged health-index filenames. It does not justify a third physical history. Close or retarget this persist slice after #125.

use std::fmt::{Display, Formatter};

const ASSESSMENT_SESSION_MIGRATION: &str =
include_str!("../migrations/0022_assessment_session.sql");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This adapter includes 0022 and persist-only Created rows. A purchaser still cannot resume after restart: there is no from_persisted_created / load_assessment_session, and later states are rejected.

Keep this file off the TRACEABILITY rebaseline. Use #125 (0014 + 0016 + load + command replay) as the session writer.

Comment thread docs/TRACEABILITY.md
### Active implementation work that is not protected-main truth

**Active PR** #76 data-rights processing-start persistence is not protected-main truth until an unchanged reviewed/check-clean head is integrated. Identity-verified requests persist an immutable operation identity and processing-start time under `FOR UPDATE` so later lifecycle composition cannot race the classified row. Dependent-system execution remains outside this slice.
**Active PR** remaining PostgreSQL persist and operator-health HTTP slices are not protected-main truth until unchanged reviewed/check-clean heads are integrated. This baseline records item-delivery ledger persistence (#48), immutable response snapshots (#55), immutable result snapshots (#51), deterministic narrative fallback (#73), dual-proof account linking (#85), data-rights processing-start (#76), atomic scoring-dispatch persist (#68), inbox claim-expiry fencing (#81), and recovery invariants (#72). Created assessment-session persistence on this branch (`migrations/0022_assessment_session.sql`, after health-index `0020`/`0021`), plus identity-link history, response-event, research-release, data-rights completion, and HTTP health-probe work, remain Active PR only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The a7637351 rebaseline is the unique value of this PR and should not mention migrations/0022_assessment_session.sql or “this branch.” Split it: ship the named-SHA module/migration map without a session table, and leave created-session persistence as Active PR on #125.


The slice does **not** persist publication-event history, bound scientific evidence records, HTTP publication transport, or session-creation integration. Those remain Target unless separately evidenced on protected main.

## Active PR assessment-session physical schema

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Drop this Active PR session section from the shipped-truth rebaseline. Protected-main as-built evidence should not carry a competing 0022 pointer while #125 already documents 0014 / 0016.

Comment thread CHANGELOG.md

### Added
- Traceability and as-built schema rebaseline to protected-main `a7637351`, recording item-delivery ledger persistence (#48), immutable response snapshots (#55), immutable result snapshots (#51), deterministic narrative fallback (#73), dual-proof account linking (#85), data-rights processing-start (#76), atomic scoring-dispatch persist (#68), inbox claim-expiry fencing (#81), and recovery invariants (#72). Remaining session, identity-link, response-event, research, data-rights-completion persist and operator-health HTTP stay Active PR, not shipped truth.
- PostgreSQL persistence for created assessment sessions bound to one published locale-specific release: exact replay is idempotent, and rebinding participant, release, version, digest, locale, state, or creation time fails closed. The physical file is `migrations/0022_assessment_session.sql` so it does not collide with health-index `0020`/`0021`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Keep the a7637351 rebaseline and the claim_deadline_at recovery-fixture fix. Remove this persist bullet from any TRACEABILITY-only successor so #100 does not advertise a session table that #125 already owns.

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.

2 participants