{
  "schema": "omnius.chat-session-document-revision-verification.v1",
  "recordedAt": "2026-10-17",
  "scope": "Separate semantic document commits from live/title/token metadata for bounded shared frontend refresh.",
  "behavior": {
    "Session.documentRevision": "Optional durable field, normalized to a nonnegative integer. Legacy records derive it from existing revision until the next successful commit persists it.",
    "mutateSession": "Third argument documentChanged defaults true; metadata-only live/token/title writers pass false.",
    "persistSession": "Document and store versions are published only after successful atomic rename. Direct getSession metadata commits preserve document identity.",
    "import": "Changes to full transcript or removal of the legacy visible import notice advance documentRevision. Title/description-only system scaffold updates do not.",
    "catalog": "Additive optional documentRevision projection alongside revision/live.",
    "read": "No read-side persistence or inference."
  },
  "tests": {
    "status": "passed",
    "tests": 109,
    "files": 10,
    "newCases": 6,
    "counting": "This batch includes the prior store/restore regressions; do not sum109 with earlier103.",
    "log": "/tmp/omnius-session-document-version-final-tests.log",
    "command": "pnpm exec vitest run --config /tmp/omnius-session-document-version-vmyoqv6o/document-version-vitest.config.mts --maxWorkers=3 --minWorkers=1 --reporter=verbose",
    "checks": [
      "Every authored/tool/check-in/intake mutation advances the visible document version.",
      "Live/token/get/read operations retain document identity while global revision advances as appropriate.",
      "Full >32k transcript imports version content changes while metadata-only imports remain stable.",
      "Legacy normalization is read-only and stabilizes on the next metadata commit.",
      "A controlled atomic commit failure publishes neither phantom content nor advanced versions.",
      "Two actual independent Bun processes interleave40 total assistant appends and metadata commits; all content and exact40 document increments are retained."
    ]
  },
  "sourceNoEmit": {
    "status": "passed",
    "diagnostics": 0,
    "log": "/tmp/omnius-session-document-version-typecheck.log"
  },
  "diffCheck": "passed",
  "sourceSha256": {
    "packages/cli/src/api/chat-session.ts": "f0d45d96a2d5f7a9ec834110c15812f28dc2456c68e8a20bbaa7a9bdb798f0d3",
    "packages/cli/tests/chat-session-document-revision.test.ts": "cf2d1c799a5a9fa5a82a93623f09a1fff83fbd1d0fcdda161ab48aa0df412b2f"
  },
  "excludedVerificationDependencies": [
    "packages/cli/src/api/session-coordination.ts",
    "packages/cli/src/session-quality.ts",
    "Current root store-regression fixtures and tests copied for compatibility only."
  ],
  "boundaries": [
    "Source storage validation only; frontend integration must use documentRevision to skip full reconstruction for metadata-only changes.",
    "System import scaffold changes are metadata; authored/tool messages and the complete display transcript define the document."
  ],
  "safety": {
    "inferenceRequests": 0,
    "modelLoadRequests": 0,
    "servicesChanged": 0,
    "cudaWorkloads": 0,
    "sharedBuilds": 0,
    "publishes": 0
  }
}
