{
  "schema": "omnius.chat-session-shared-store-verification.v1",
  "recordedAt": "2026-10-17",
  "scope": "source-only canonical session persistence repair; no title-helper integration",
  "baseCommit": "118b3e99ce131f5e032ff5c9f52788de966ffcae",
  "before": {
    "schema": "omnius.chat-store-before-source-fixture.v1",
    "baseCommit": "118b3e99ce131f5e032ff5c9f52788de966ffcae",
    "kind": "actual independent process plus held-source-reference storage reproduction",
    "staleLookup": true,
    "lostExternalAppend": true,
    "externalDeleteConfirmed": true,
    "resurrectedDeletedRecord": true,
    "inferenceCalls": 0,
    "servicesChanged": 0,
    "sourceSha256": "92745a12ffc69276205b2c05e42991ea3776512c2944fbf31b94cbcb33d83ee6",
    "fixtureSource": "import {mkdtempSync,mkdirSync,readFileSync,existsSync,writeFileSync,rmSync} from \"node:fs\";\nimport {join} from \"node:path\";import {tmpdir} from \"node:os\";import {spawnSync} from \"node:child_process\";import {createHash} from \"node:crypto\";\nglobalThis.fetch=async()=>{throw new Error(\"Storage-only fixture forbids network\");};\nconst {getSession,lookupSession,addAssistantMessage}=await import(\"./src/api/chat-session.ts\");\nconst {omniusConfigDir}=await import(\"./src/config-home.ts\");\nconst root=mkdtempSync(join(tmpdir(),\"omnius-chat-before-fixture-\"));process.env.OMNIUS_CONFIG_HOME=root;const project=join(root,\"project\");mkdirSync(project);\nconst id=\"controlled-store-before\",held=getSession(id,\"fixture\",project),file=omniusConfigDir(\"chat-sessions\",id+\".json\");\nconst child=(operation:string)=>{const result=spawnSync(process.execPath,[\"-e\",`globalThis.fetch=async()=>{throw new Error(\"Network forbidden\");}; const s=await import(${JSON.stringify(new URL(\"./src/api/chat-session.ts\",import.meta.url).pathname)});${operation};process.exit(0);`],{env:{...process.env},encoding:\"utf8\",timeout:10000});if(result.status!==0)throw new Error(result.stderr);};\nchild(`s.addAssistantMessage(s.getSession(${JSON.stringify(id)},\"fixture\",${JSON.stringify(project)}),\"REMOTE_PROCESS_ANSWER\")`);\nconst staleLookup=lookupSession(id)===held&&!held.messages.some(m=>m.content===\"REMOTE_PROCESS_ANSWER\");\naddAssistantMessage(held,\"LOCAL_APPEND_FROM_STALE_REFERENCE\");\nconst lostExternalAppend=!JSON.parse(readFileSync(file,\"utf8\")).messages.some((m:any)=>m.content===\"REMOTE_PROCESS_ANSWER\");\nchild(`s.deleteSession(${JSON.stringify(id)})`);const externalDeleteConfirmed=!existsSync(file);\naddAssistantMessage(held,\"LATE_STALE_ANSWER\");const resurrectedDeletedRecord=existsSync(file);\nconst report={schema:\"omnius.chat-store-before-source-fixture.v1\",baseCommit:\"118b3e99ce131f5e032ff5c9f52788de966ffcae\",kind:\"actual independent process plus held-source-reference storage reproduction\",staleLookup,lostExternalAppend,externalDeleteConfirmed,resurrectedDeletedRecord,inferenceCalls:0,servicesChanged:0,sourceSha256:createHash(\"sha256\").update(readFileSync(new URL(\"./src/api/chat-session.ts\",import.meta.url))).digest(\"hex\")};\nwriteFileSync(\"/tmp/omnius-chat-store-before-proof.json\",JSON.stringify(report,null,2)+\"\\n\");console.log(JSON.stringify(report));rmSync(root,{recursive:true,force:true});process.exit(staleLookup&&lostExternalAppend&&externalDeleteConfirmed&&resurrectedDeletedRecord?0:1);\n",
    "fixtureSha256": "76a3458bc6b88d312251ec63e9caa4f4606396bf679fd6610702abe55f69e291",
    "log": "{\"schema\":\"omnius.chat-store-before-source-fixture.v1\",\"baseCommit\":\"118b3e99ce131f5e032ff5c9f52788de966ffcae\",\"kind\":\"actual independent process plus held-source-reference storage reproduction\",\"staleLookup\":true,\"lostExternalAppend\":true,\"externalDeleteConfirmed\":true,\"resurrectedDeletedRecord\":true,\"inferenceCalls\":0,\"servicesChanged\":0,\"sourceSha256\":\"92745a12ffc69276205b2c05e42991ea3776512c2944fbf31b94cbcb33d83ee6\"}\n"
  },
  "after": {
    "tests": {
      "status": "passed",
      "files": 9,
      "tests": 103,
      "command": "pnpm exec vitest run --config /tmp/omnius-chat-store-MmoiqU/chat-store-vitest.config.mts --maxWorkers=3 --minWorkers=1 --reporter=verbose",
      "log": "/tmp/omnius-chat-store-frozen-tests.log",
      "summary": "  9 passed (9)\n      Tests  103 passed (103)\n   Start at  12:34:25\n   Duration  11.56s (transform 4.65s, setup 132ms, collect 21.91s, tests 5.77s, environment 1ms, prepare 326ms)\n\n"
    },
    "typecheck": {
      "status": "passed",
      "diagnostics": 0,
      "command": "pnpm exec tsc -p tsconfig.json --noEmit --incremental false --composite false",
      "log": "/tmp/omnius-chat-store-frozen-typecheck.log"
    },
    "diffCheck": "passed",
    "coverage": [
      "Actual separate source-importing Bun processes append 40 messages each; all 80 unique messages and revision increments retained.",
      "Actual separate producers append 25 mailbox entries each while parent drains; all 50 retained.",
      "Held Session references hydrate in place after external atomic writes and strong-cache expiry.",
      "External deletion rejects stale held writes, fresh-process imports, and explicit recreation of the exact physical identity.",
      "Wrong project ownership and sanitized filename identity collisions fail closed.",
      "Every public canonical mutation refreshes inside the shared store lock before committing.",
      "Storage commit/delete failures surface without publishing phantom state.",
      "Bounded typed live projections preserve timestamps/terminal ordering without acquiring foreign run or Stop authority.",
      "Full imported transcript and structured messages remain available; bounded model context remains separate."
    ],
    "sourceSha256": {
      "packages/cli/src/api/chat-session.ts": "2f813be68b6bcc45388634afdb6547bd7e78744c6427b516e8d622ffc6d09038",
      "packages/cli/tests/chat-session-tool-events.test.ts": "fb813545602aeeb1b38f18df1bff9ef0c1d6eaab1a9e979d21154806c049f1dc",
      "packages/cli/tests/chat-session-shared-store.test.ts": "368de8943277e89071d4752dd213eefdfe5ddef21d645d290085558c70c80424",
      "packages/cli/tests/chat-session-store-failure.test.ts": "82c9720424ebf21033e9e0afa7c3d8d2a13d5cb6f61caa70fb5cfaa46a9609d2",
      "packages/cli/tests/chat-session-cache-retention.test.ts": "cdfd52be8cb91d5aa2331b49c23ae03be9816fb376a46ba99a31a645c4e0f216",
      "packages/cli/tests/fixtures/chat-session-store-child.ts": "748290f07e500f28b37bd6a30c73af50856b29242bc665d0b5e2077a04724ba6"
    },
    "parentOwnedCoordinator": {
      "copiedForVerificationOnly": true,
      "includedInPatch": false,
      "sha256": "14bc0d0231122427a4af28c0c33bd485aa10a15abdac2cee5a7c063cf672dc30"
    }
  },
  "artifact": {
    "sourcePatch": "/tmp/omnius-chat-store-source.patch",
    "sourcePatchSha256": "0e9431ed9b0e667669bdbaee04a4dd177ed6a1d815b5a2e63df9cf45284a5832",
    "ownedSourcePaths": [
      "packages/cli/src/api/chat-session.ts",
      "packages/cli/tests/chat-session-tool-events.test.ts",
      "packages/cli/tests/chat-session-shared-store.test.ts",
      "packages/cli/tests/chat-session-store-failure.test.ts",
      "packages/cli/tests/chat-session-cache-retention.test.ts",
      "packages/cli/tests/fixtures/chat-session-store-child.ts"
    ]
  },
  "boundaries": [
    "This verifies source storage behavior, not an installed package or daemon/frontend transport.",
    "Callers retain run ownership and must fence different-run late live callbacks and explicit live clearing.",
    "Tombstones protect the exact physical storage key; root-owned project deletion must mark proven logical bare/tui aliases.",
    "Listing projections expose additive optional revision/live fields for legacy synthetic row compatibility."
  ],
  "safety": {
    "liveInferenceRequests": 0,
    "modelLoadRequests": 0,
    "cudaWorkloads": 0,
    "servicesChanged": 0,
    "sharedBuilds": 0,
    "globalInstalls": 0,
    "publishes": 0
  }
}
