# R3/R4 evidence capture for PR [#32744](https://git.cafe/pingdotgg/t3code/pull/32744)

Synthetic data only; no live database read or copied. No server started. No repository files edited or committed.
Environment: Linux x86_64; Node v26.12.1; Node SQLite 3.54.0.
Requested rows: R3, R4. Captured: 2/2. Unverified requested rows: none.
Same driver and identical source payload fixture used for both revisions.

Setup commands (all exit 0):
```
git -C <repo> worktree add <base-checkout> f12bb6229c007a12d24fd2e539222733778ac9ea
cd <base-checkout>
vp install
```

Driver invocations (both exit 0):
```
node <scratch>/driver.mjs <head-checkout> <scratch> fixed
node <scratch>/driver.mjs <base-checkout> <scratch> baseline
```
Each driver uses the checkout's server migrations and validates all synthetic links against its real contracts schema, then invokes the real CLI from the checkout root. The exact CLI command, revision, complete stdout/stderr, exit code, file hashes, and assertions follow below.

R3: retained stopped root has 13 mixed watched/unwatched links in deliberately nonnumeric order. Retained fork and settled root each have one watched link. All links have populated snapshot, stack, endedWatch, and other metadata. Before: all 9 active watches survive. After: all 9 are absent (both Object.hasOwn and SQLite json_type); structural equality proves watch is the only removed property. All 17 links across six threads retain order, count and history.
R4: all three controls retained: absent pullRequests, empty array, and two unwatched links with endedWatch. Exact payload_json string equality passes on both revisions, including source whitespace. Sources reread identically, with unchanged SHA-256 file hashes. Cross-revision source payload captures are also exactly equal.
The fixed-behavior assertion run on the merge-base destination exits 1 as expected because the watch survives; it is a deliberate negative control, not a capture failure.

# Synthetic R3/R4 CLI capture (baseline)

Node v26.12.1; SQLite 3.54.0; revision f12bb6229c007a12d24fd2e539222733778ac9ea
CWD: <base-checkout>
Schema validation: PASS (17 populated links)

$ node apps/server/scripts/migrate-dev-db.ts --base-dir <scratch>/2026-11-10T12-21-12.286Z-baseline/dest --source <scratch>/2026-11-10T12-21-12.286Z-baseline/src/userdata/statev2.sqlite --threads-per-project 100

STDOUT:
Copying visible threads from <scratch>/2026-11-10T12-21-12.286Z-baseline/src/userdata/statev2.sqlite (read-only)...
Running migrations on the snapshot...
Pruning to 5 projects, 100 stopped threads each...
Compacting into <scratch>/2026-11-10T12-21-12.286Z-baseline/dest/userdata/statev2.sqlite...

Dev database ready: <scratch>/2026-11-10T12-21-12.286Z-baseline/dest/userdata/statev2.sqlite (912 KB)
  Synthetic R3 R4: 6 threads
  0 orchestration events kept
  Migrations: already current (no new migrations in this checkout)

STDERR:

Exit code: 0; signal: none

Source SHA-256 before: b53839dc45ad49cf31a7bb78afe55a77b1b2a8b8f331a8da6ef31fa0be26a908
Source SHA-256 after:  b53839dc45ad49cf31a7bb78afe55a77b1b2a8b8f331a8da6ef31fa0be26a908
Source bytes unchanged: true

$ node <scratch>/assertions.mjs <scratch>/2026-11-10T12-21-12.286Z-baseline baseline
PASS: all 6 threads retained; 6 completed runs retained; stopped root, fork and settled root validated
PASS: synthetic source reread matches exactly; source file SHA-256 unchanged (b53839dc45ad49cf31a7bb78afe55a77b1b2a8b8f331a8da6ef31fa0be26a908)
PASS control-absent: 0 links; order/count/history preserved; payload_json exact string equality
PASS control-empty: 0 links; order/count/history preserved; payload_json exact string equality
PASS control-ended: 2 links; order/count/history preserved; payload_json exact string equality
PASS fork-thread: 1 links; order/count/history preserved; original watches preserved
PASS settled-root: 1 links; order/count/history preserved; original watches preserved
PASS stopped-root: 13 links; order/count/history preserved; original watches preserved
PASS R3/R4 (baseline): source watches 9; destination watches 9; 17 total links; 3 exact-string controls; no missing threads


Assertion exit code: 0

Negative control: fixed-behavior assertions against the merge-base destination (expected failure)
$ node <scratch>/assertions.mjs <scratch>/2026-11-10T12-21-12.286Z-baseline fixed
PASS: all 6 threads retained; 6 completed runs retained; stopped root, fork and settled root validated
PASS: synthetic source reread matches exactly; source file SHA-256 unchanged (b53839dc45ad49cf31a7bb78afe55a77b1b2a8b8f331a8da6ef31fa0be26a908)
PASS control-absent: 0 links; order/count/history preserved; payload_json exact string equality
PASS control-empty: 0 links; order/count/history preserved; payload_json exact string equality
PASS control-ended: 2 links; order/count/history preserved; payload_json exact string equality

node:internal/modules/run_main:111
    triggerUncaughtException(
    ^

AssertionError [ERR_ASSERTION]: fork-thread: destination equals source with only watch properties removed
+ actual - expected
... Skipped lines

  {
    activeProviderThreadId: null,
    archivedAt: null,
    branch: 'synthetic/fork-thread',
    createdAt: '2026-08-01T00:00:00.000Z',
...
        url: 'https://github.com/evidence-fixture/synthetic/pull/201',
+       watch: {
+         approvalAnnounced: true,
+         awaitingApproval: [
+           'https://example.invalid/workflows/201'
+         ],
+         checksAwaitedSince: '2026-08-01T00:00:00.000Z',
+         conflicting: true,
+         failedChecks: [
+           'synthetic-check-201'
+         ],
+         headSha: '00000000000000000000000000000000000000c9',
+         owedChecks: [
+           'synthetic-owed-201'
+         ],
+         passed: false,
+         passedChecks: [
+           'synthetic-passed-201'
+         ],
+         remarkIds: [
+           'synthetic-remark-201',
+           'synthetic-review-201'
+         ],
+         remarksThrough: '2026-08-01T00:00:00.000Z',
+         startedAt: '2026-08-01T00:00:00.000Z',
+         wakes: 1
+       }
      }
    ],
    runtimeMode: 'full-access',
    settledAt: null,
    settledOverride: null,

    at file://<scratch>/assertions.mjs:54:10
    at ModuleJob.run (node:internal/modules/esm/module_job:569:25)
    at async node:internal/modules/esm/loader:650:26
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:105:5) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: {
    id: 'fork-thread',
    projectId: 'synthetic-project',
    title: 'Synthetic fork-thread',
    providerInstanceId: 'codex',
    modelSelection: { instanceId: 'codex', model: 'synthetic-model' },
    runtimeMode: 'full-access',
    interactionMode: 'default',
    branch: 'synthetic/fork-thread',
    worktreePath: '<scratch-checkout>',
    activeProviderThreadId: null,
    lineage: {
      rootThreadId: 'stopped-root',
      parentThreadId: 'stopped-root',
      relationshipToParent: 'fork'
    },
    forkedFrom: null,
    createdBy: 'user',
    creationSource: 'web',
    createdAt: '2026-08-01T00:00:00.000Z',
    updatedAt: '2026-08-01T00:00:00.000Z',
    archivedAt: null,
    settledOverride: null,
    settledAt: null,
    lastVisitedAt: null,
    deletedAt: null,
    pullRequests: [
      {
        host: 'github.com',
        repository: 'evidence-fixture/synthetic',
        number: 201,
        url: 'https://github.com/evidence-fixture/synthetic/pull/201',
        repositoryWebUrl: 'https://github.com/evidence-fixture/synthetic',
        source: 'created',
        linkedAt: '2026-08-01T00:00:00.000Z',
        snapshot: {
          state: 'open',
          title: 'Synthetic PR 201: "quotes" \\ slash — history',
          headBranch: 'synthetic/201',
          baseBranch: 'main',
          isDraft: false,
          updatedAt: '2026-08-01T00:00:00.000Z',
          syncedAt: '2026-08-01T00:00:00.000Z',
          closedAt: null,
          mergedAt: null,
          author: {
            login: 'synthetic-author-201',
            name: 'Synthetic 201',
            avatarUrl: null,
            isBot: false
          },
          additions: 211,
          deletions: 5,
          changedFiles: 2,
          reviewDecision: 'approved',
          checksState: 'passing',
          mergeability: 'mergeable'
        },
        stack: {
          kind: 'native',
          id: 'synthetic-stack-201',
          number: 201,
          url: 'https://github.com/evidence-fixture/synthetic/stacks/201',
          base: 'main',
          layers: [ [Object], [Object] ]
        },
        watch: {
          startedAt: '2026-08-01T00:00:00.000Z',
          headSha: '00000000000000000000000000000000000000c9',
          failedChecks: [ 'synthetic-check-201' ],
          passed: false,
          passedChecks: [ 'synthetic-passed-201' ],
          owedChecks: [ 'synthetic-owed-201' ],
          awaitingApproval: [ 'https://example.invalid/workflows/201' ],
          approvalAnnounced: true,
          remarksThrough: '2026-08-01T00:00:00.000Z',
          remarkIds: [ 'synthetic-remark-201', 'synthetic-review-201' ],
          conflicting: true,
          wakes: 1,
          checksAwaitedSince: '2026-08-01T00:00:00.000Z'
        },
        endedWatch: {
          startedAt: '2026-08-01T00:00:00.000Z',
          headSha: '00000000000000000000000000000000000002bd',
          failedChecks: [],
          passed: true,
          passedChecks: [ 'synthetic-passed-701' ],
          owedChecks: [ 'synthetic-owed-701' ],
          awaitingApproval: [ 'https://example.invalid/workflows/701' ],
          approvalAnnounced: true,
          remarksThrough: '2026-08-01T00:00:00.000Z',
          remarkIds: [ 'synthetic-remark-701', 'synthetic-review-701' ],
          conflicting: false,
          wakes: 1,
          checksAwaitedSince: null
        }
      }
    ]
  },
  expected: {
    id: 'fork-thread',
    projectId: 'synthetic-project',
    title: 'Synthetic fork-thread',
    providerInstanceId: 'codex',
    modelSelection: { instanceId: 'codex', model: 'synthetic-model' },
    runtimeMode: 'full-access',
    interactionMode: 'default',
    branch: 'synthetic/fork-thread',
    worktreePath: '<scratch-checkout>',
    activeProviderThreadId: null,
    lineage: {
      rootThreadId: 'stopped-root',
      parentThreadId: 'stopped-root',
      relationshipToParent: 'fork'
    },
    forkedFrom: null,
    createdBy: 'user',
    creationSource: 'web',
    createdAt: '2026-08-01T00:00:00.000Z',
    updatedAt: '2026-08-01T00:00:00.000Z',
    archivedAt: null,
    settledOverride: null,
    settledAt: null,
    lastVisitedAt: null,
    deletedAt: null,
    pullRequests: [
      {
        host: 'github.com',
        repository: 'evidence-fixture/synthetic',
        number: 201,
        url: 'https://github.com/evidence-fixture/synthetic/pull/201',
        repositoryWebUrl: 'https://github.com/evidence-fixture/synthetic',
        source: 'created',
        linkedAt: '2026-08-01T00:00:00.000Z',
        snapshot: {
          state: 'open',
          title: 'Synthetic PR 201: "quotes" \\ slash — history',
          headBranch: 'synthetic/201',
          baseBranch: 'main',
          isDraft: false,
          updatedAt: '2026-08-01T00:00:00.000Z',
          syncedAt: '2026-08-01T00:00:00.000Z',
          closedAt: null,
          mergedAt: null,
          author: {
            login: 'synthetic-author-201',
            name: 'Synthetic 201',
            avatarUrl: null,
            isBot: false
          },
          additions: 211,
          deletions: 5,
          changedFiles: 2,
          reviewDecision: 'approved',
          checksState: 'passing',
          mergeability: 'mergeable'
        },
        stack: {
          kind: 'native',
          id: 'synthetic-stack-201',
          number: 201,
          url: 'https://github.com/evidence-fixture/synthetic/stacks/201',
          base: 'main',
          layers: [ [Object], [Object] ]
        },
        endedWatch: {
          startedAt: '2026-08-01T00:00:00.000Z',
          headSha: '00000000000000000000000000000000000002bd',
          failedChecks: [],
          passed: true,
          passedChecks: [ 'synthetic-passed-701' ],
          owedChecks: [ 'synthetic-owed-701' ],
          awaitingApproval: [ 'https://example.invalid/workflows/701' ],
          approvalAnnounced: true,
          remarksThrough: '2026-08-01T00:00:00.000Z',
          remarkIds: [ 'synthetic-remark-701', 'synthetic-review-701' ],
          conflicting: false,
          wakes: 1,
          checksAwaitedSince: null
        }
      }
    ]
  },
  operator: 'deepStrictEqual',
  diff: 'simple'
}

Node.js v26.12.1

Negative-control exit code: 1

# Synthetic R3/R4 CLI capture (fixed)

Node v26.12.1; SQLite 3.54.0; revision f219ff96d124b536fd79bf09e64d8dd71e10dee5
CWD: <head-checkout>
Schema validation: PASS (17 populated links)

$ node apps/server/scripts/migrate-dev-db.ts --base-dir <scratch>/2026-11-10T12-20-54.277Z-fixed/dest --source <scratch>/2026-11-10T12-20-54.277Z-fixed/src/userdata/statev2.sqlite --threads-per-project 100

STDOUT:
Copying visible threads from <scratch>/2026-11-10T12-20-54.277Z-fixed/src/userdata/statev2.sqlite (read-only)...
Running migrations on the snapshot...
Pruning to 5 projects, 100 stopped threads each...
Compacting into <scratch>/2026-11-10T12-20-54.277Z-fixed/dest/userdata/statev2.sqlite...

Dev database ready: <scratch>/2026-11-10T12-20-54.277Z-fixed/dest/userdata/statev2.sqlite (896 KB)
  Synthetic R3 R4: 6 threads
  0 orchestration events kept
  Migrations: already current (no new migrations in this checkout)

STDERR:

Exit code: 0; signal: none

Source SHA-256 before: 031c9ea63f678e29a7fb81beb6638aa8e770367a8ab0868ed55c02a2ae8a11f2
Source SHA-256 after:  031c9ea63f678e29a7fb81beb6638aa8e770367a8ab0868ed55c02a2ae8a11f2
Source bytes unchanged: true

$ node <scratch>/assertions.mjs <scratch>/2026-11-10T12-20-54.277Z-fixed fixed
PASS: all 6 threads retained; 6 completed runs retained; stopped root, fork and settled root validated
PASS: synthetic source reread matches exactly; source file SHA-256 unchanged (031c9ea63f678e29a7fb81beb6638aa8e770367a8ab0868ed55c02a2ae8a11f2)
PASS control-absent: 0 links; order/count/history preserved; payload_json exact string equality
PASS control-empty: 0 links; order/count/history preserved; payload_json exact string equality
PASS control-ended: 2 links; order/count/history preserved; payload_json exact string equality
PASS fork-thread: 1 links; order/count/history preserved; only watch removed
PASS settled-root: 1 links; order/count/history preserved; only watch removed
PASS stopped-root: 13 links; order/count/history preserved; only watch removed
PASS R3/R4 (fixed): source watches 9; destination watches 0; 17 total links; 3 exact-string controls; no missing threads


Assertion exit code: 0

Cleanup and final read-only checks:
```
git -C <repo> worktree remove --force <base-checkout>
```
Exit 0. Temporary base checkout absent. PR checkout status clean; head unchanged at [f219ff96d1](https://github.com/pingdotgg/t3code/commit/f219ff96d124b536fd79bf09e64d8dd71e10dee5). No processes started except completed drivers/CLIs/install. 240 GB available.
PR status observed: 34/34 checks successful, 0 pending/failing. Existing reviews: Macroscope approval and CodeRabbit comment (two test-coverage nitpicks), both on earlier [9f04b777d8](https://github.com/pingdotgg/t3code/commit/9f04b777d8d0cb3036143516d2cb51ff794b8618); no current-head review observed. This capture does not certify merge readiness.

AI-assisted; verified with the tests and tools listed above.

FRICTION: none
