Skip to content

S19 (AD9 half) — data version pin: stamp authoredAgainstVersion - #14

Closed
oskarhagberg wants to merge 1 commit into
mainfrom
ali-269-s19-data-version-pin
Closed

oskarhagberg wants to merge 1 commit into
mainfrom
ali-269-s19-data-version-pin

Conversation

@oskarhagberg

Copy link
Copy Markdown
Collaborator

Implements ALI-269: the data-pin half of S19. The AH15 retention seam is deliberately not included and is still pending.

What

  • Domain. DataEntry.authoredAgainstVersion: string | null stores the artefact's payload content hash at the last write. upsertDataEntry requires it, so no write path can skip the stamp. It is advisory only: it never gates a read or write (AD3–AD5), and the blob stays opaque (AD8).
  • Command. putOwnDataEntry stamps the payload hash of the artefact it has already resolved, so PUT …/data/me and set_artefact_data (S31) get the same pin. There is no connector-specific code.
  • Persistence. Migration 0008 adds a nullable authored_against_version column with no backfill; rows from before the pin read null. The Drizzle upsert's ON CONFLICT DO UPDATE SET also sets the pin, so it updates on every write. Without that it would stay at the first write's value.
  • MCP. get_artefact_data now returns the entry's pin in the field S30 reserved. The return shape is unchanged.
  • Specs. artefact-data.md marks AD9 implemented. slice-dag.md splits S19 into the done data-pin half and the pending AH15 half. CLAUDE.md status lines are updated. No doctrine rewrite was needed: SKILL.md / PERSISTENCE_CONTRACT_SUMMARY already describe null, ≠ and = correctly.

Not in scope

  • Exposing the pin on the BFF DataEntryResponse or the S12 author list (no consumer yet).
  • The AH15 PayloadRetentionPolicy seam.

Tests

383/383 green; pnpm check clean. New tests cover:

  • Domain: stamp on create, re-stamp on update, and a null pin gets stamped on its next write.
  • Command: a fresh write records the hash; a payload edit makes the pin differ from the new hash, and the next write updates it; a pre-pin entry reads null and still reads and writes normally; the pin never grants or blocks access.
  • Drizzle end-to-end: the pin updates after a real PATCH of the payload; a null column is served normally. I checked this test by removing the pin from the SET clause: it fails.
  • MCP: null with no entry, equal to currentPayloadVersion after a write, different after update_artefact; set_artefact_data stamps the same pin as putOwnDataEntry.

🤖 Generated with Claude Code

https://claude.ai/code/session_016k2yeDPhXBHfqCQJLVuUj7

…ersion

Every write through putOwnDataEntry now records the artefact's payload
content hash on the DataEntry, so a reader can tell whether a user's saved
data predates the live HTML. One stamp covers both writers — PUT …/data/me
(the served shim) and the S31 set_artefact_data connector tool — with no
connector-specific path.

- Domain: DataEntry.authoredAgainstVersion (string | null); upsertDataEntry
  requires it, so no write path can skip the stamp. Advisory only — never
  gates a read or write (AD3–AD5), never interprets the blob (AD8).
- Persistence: migration 0008 adds the nullable authored_against_version
  column (no backfill; pre-pin rows read null). The Drizzle upsert's
  ON CONFLICT DO UPDATE SET carries the pin, so it re-stamps on update
  instead of freezing at the first write (Drizzle-backed test guards it).
- MCP: get_artefact_data returns the entry's pin in the field S30 reserved;
  return shape unchanged.
- Specs: AD9 marked implemented; S19 split into the done data-pin half and
  the still-pending AH15 retention-seam half.

Refs ALI-269.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016k2yeDPhXBHfqCQJLVuUj7
@oskarhagberg

Copy link
Copy Markdown
Collaborator Author

Closing: wrong flow. Per ee/CLAUDE.md (sync model A1) this is developed cloud-first as oskarhagberg/artefactor-cloud#1 and the core commit is synced up to OSS with ee/scripts/sync-fix-to-oss.sh after it merges.

@oskarhagberg
oskarhagberg deleted the ali-269-s19-data-version-pin branch September 13, 2026 08:20
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.

1 participant