Skip to content

fix(reliability): gate compaction suite in ARC CI, deterministic server tarballs, and isolated fork Electron profile (CLO-1096, CLO-1100) - #218

Open
nullStack65 wants to merge 1 commit into
release/native-0.1.10from
fix/batch4-t3-reliability
Open

nullStack65 wants to merge 1 commit into
release/native-0.1.10from
fix/batch4-t3-reliability

Conversation

@nullStack65

Copy link
Copy Markdown
Owner

Deploy: fleet

Summary

Addresses compaction integration CI coverage (CLO-1096) and T3Code release reliability (CLO-1100):

  1. Compaction delivery integration suite gated in ARC CI (CLO-1096)
    • .github/workflows/closura-arc-ci.yml: adds apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts to voice-and-inbox-core and adds its compaction test cases to the source guard so deleting them or breaking compaction delivery fails CI.
    • .github/scripts/arc-ci-coverage.cjs & .github/scripts/arc-ci-coverage.test.cjs: adds SteeringCompletion.integration.test.ts to REQUIRED_TESTS with a regression test.
  2. Deterministic server tarball (CLO-1100)
    • scripts/build-cli-archive.ts: adds createDeterministicTarGz (--sort=name, --mtime=@$SOURCE_DATE_EPOCH, --owner=0 --group=0 --numeric-owner --format=gnu, -I "gzip -n" on Linux; normalized owner/group + gzip:!timestamp on macOS).
    • scripts/build-cli-archive.test.ts: verifies two builds with reversed file creation order and distinct mtimes produce byte-identical SHA-256 and zeroed gzip header timestamps.
  3. Isolated Closura fork Electron profile with one-time migration (CLO-1100)
    • apps/desktop/src/app/DesktopUserData.ts: moves production fork profile to closura-t3code-v2 (distinct from stock t3code-v2), copying existing t3code-v2 state once (skipping lock files and GPU caches) while leaving t3code-v2 intact for side-by-side stock installs.
    • apps/desktop/src/app/DesktopUserData.test.ts, DesktopAppIdentity.test.ts, DesktopClerk.test.ts: verifies isolation and one-time migration across linux, darwin, and win32.

Verification

  • node --test .github/scripts/arc-ci-coverage.test.cjs .github/scripts/arc-ci-trust-gate.test.cjs .github/scripts/no-hosted-runners.test.cjs: 39/39 passed.
  • vp test run apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts scripts/build-cli-archive.test.ts apps/desktop/src/app/DesktopUserData.test.ts apps/desktop/src/app/DesktopAppIdentity.test.ts apps/desktop/src/app/DesktopClerk.test.ts (Node 26.13.1): 5/5 files, 103/103 tests passed.

Model: antigravity/gemini-4-neon
Task: CLO-1096, CLO-1100, CLO-1103
Agent: implementation
Harness: antigravity
Model-family: gemini
Model-generation: 4
Skills-SHA: 648bce52b3

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nullStack65

Copy link
Copy Markdown
Owner Author

Repair worker (drain supervisor), head d9ef10b.

The failing check "Voice + founder inbox (Linux ARC)" is the aggregate gate, and it failed only because "Voice + inbox core (Linux ARC)" was cancelled. That core job never reached its tests: the ARC runner got a shutdown signal while it was saving the pnpm store cache ("The runner has received a shutdown signal", run 45717544807). This is a runner/infra flake, not a defect in this change. I made no code change and reran the failed jobs on the same head.

@nullStack65

nullStack65 commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner Author

Independent full review of the reliability gate PR (compaction suite in ARC CI, deterministic server tarballs, isolated fork Electron profile), base 08d850cf79a6 (release/native-0.1.10), head d9ef10b25c02. Fresh context; read the full diff and the surrounding source. Required ARC checks on this head are green. I ran no tests locally and did not run the macOS bsdtar path, so that path is unverified.

The CI change is fine. Both source-guard strings exist in SteeringCompletion.integration.test.ts (lines 2347 and 3456), the suite is in REQUIRED_TESTS and in the core job's file list, and "Voice + inbox core" passed with it. No non-test code still uses the old t3code-v2 name for the fork profile.

{
  "reviewed_base": "08d850cf79a66dcda77320bb72ec6b281e745bf4",
  "reviewed_head": "d9ef10b25c02532bff9bf5f2f313a568a983c9cc",
  "reviewer": "claude-opus-5-5, Claude Code via T3 Code (drain supervisor clean-room review)",
  "author_session": "antigravity/gemini-4-neon implementation agent (native session id not exposed to reviewer)",
  "reviewer_session": "claude-code:bff925c3-fce9-4f9e-966c-43792df3001c",
  "fresh_context": true,
  "review_kind": "full",
  "round_id": "claude-code:bff925c3-fce9-4f9e-966c-43792df3001c",
  "intent": [
    "CLO-1096: compaction delivery integration suite runs and is source-guarded in ARC CI",
    "CLO-1100: server CLI tarballs are byte-reproducible",
    "CLO-1100: fork Electron profile is isolated from stock t3code-v2 with a one-time migration that leaves t3code-v2 intact"
  ],
  "prior_findings": [],
  "findings": [
    {
      "id": "F1",
      "severity": "important",
      "outcome": "fixed",
      "file": "apps/desktop/src/app/DesktopUserData.ts",
      "line": 123,
      "summary": "The profile migration is not atomic, and a partial copy becomes permanent. copyProfileTree creates closura-t3code-v2 first and then copies files into it one by one. If the copy stops partway (a crash, a force-quit, or an EBUSY/EACCES error on one file, which fails startup with DesktopUserDataInitializationError), the next launch sees that closura-t3code-v2 exists and skips migration. The .migrated-from-t3code-v2 marker is written but nothing ever reads it. The fork then runs on a partial profile and silently loses the rest of its Local Storage, IndexedDB and cookies. Fix: copy into a temporary sibling directory and rename it into place, or make the migration decision depend on the marker and resume or redo it.",
      "check": "fixed in 1a159f89784f1ba51526c0889c9723830d3f6ceb: migration copies into closura-t3code-v2.migrating, writes the marker there, then renames into place; a leftover staging dir is removed and the copy redone. New test 'redoes an interrupted t3code-v2 migration...' in apps/desktop/src/app/DesktopUserData.test.ts fails on d9ef10b25c02 and passes on 1a159f8978 (vp test run: 10 passed). Awaiting focused re-check."
    },
    {
      "id": "F2",
      "severity": "nit",
      "outcome": "open",
      "file": "scripts/build-cli-archive.ts",
      "line": 102,
      "summary": "SOURCE_DATE_EPOCH is not set in any workflow, so every file in the archive gets mtime 0. That includes the bundled web client, and tar -x in install.sh and pinnedRuntime keeps those mtimes. apps/server/src/http.ts:678 builds static ETag and Last-Modified from size plus mtime. For non-hashed files (manifest.webmanifest, icons, hashed assets outside the immutable set), a changed file with the same size now returns 304 across upgrades. Consider setting SOURCE_DATE_EPOCH to the commit time in the release build."
    },
    {
      "id": "F3",
      "severity": "nit",
      "outcome": "open",
      "file": "scripts/build-cli-archive.ts",
      "line": 119,
      "summary": "On a macOS host, bsdtar only normalizes owner/group and the gzip timestamp. It does not sort entries or fix file mtimes, so archives built on macOS are not reproducible. The new reproducibility test uses process.platform as hostPlatform, so it would fail on a Mac dev machine. CI does not exercise this path."
    },
    {
      "id": "F4",
      "severity": "nit",
      "outcome": "open",
      "file": "apps/desktop/src/app/DesktopUserData.ts",
      "line": 37,
      "summary": "The migration skip list leaves out the large Chromium caches (Cache, Code Cache, Service Worker/CacheStorage), so a big stock profile is copied in full and blocks first launch. copyProfileTree uses stat, which follows symlinks, so a symlinked directory is copied as a full tree, and a symlink loop would recurse without end."
    }
  ]
}

Verdict: changes required. F1 is important and needs a fix plus a focused re-check on the new head before merge. F2 to F4 are nits.

@nullStack65

Copy link
Copy Markdown
Owner Author

Focused re-check of the reliability gate pull request (compaction suite in ARC CI, deterministic server tarballs, isolated fork Electron profile). It covers only the PR's own change from the reviewed head d9ef10b25c02 to the current head 1a159f89784f. Both heads share the base 08d850cf79a6 (release/native-0.1.10), and git range-diff shows the reviewed commit unchanged plus one new commit, 1a159f8978 ("stage fork profile migration and rename it into place"). There are no merge commits in the range, so there were no conflict resolutions to inspect. This is not a new review round. Required ARC checks on this head are green. I did not run tests locally.

F1, the non-atomic profile migration, is confirmed fixed. resolveUserDataPath now removes any leftover closura-t3code-v2.migrating directory, copies the stock profile into it, writes the marker there and renames it to closura-t3code-v2. The decision to migrate still depends on whether closura-t3code-v2 exists, but that directory now appears only through the final rename, so an interrupted copy leaves only the staging directory. The next launch removes it and copies again. On the same parent directory the rename is atomic. The new test covers a leftover partial staging directory plus a failed copy, then a successful retry.

F2 to F4 are untouched by this diff and stay open nits.

There is one new nit, F5, introduced by the new test.

{
  "reviewed_base": "08d850cf79a66dcda77320bb72ec6b281e745bf4",
  "reviewed_head": "d9ef10b25c02532bff9bf5f2f313a568a983c9cc",
  "rechecked_head": "1a159f89784f1ba51526c0889c9723830d3f6ceb",
  "reviewer": "claude-opus-5-5, Claude Code via T3 Code (drain supervisor focused re-check)",
  "author_session": "antigravity/gemini-4-neon implementation agent (native session id not exposed to reviewer)",
  "reviewer_session": "claude-code:bff925c3-fce9-4f9e-966c-43792df3001c",
  "fresh_context": true,
  "review_kind": "focused_recheck",
  "round_id": "claude-code:bff925c3-fce9-4f9e-966c-43792df3001c",
  "intent": [
    "CLO-1096: compaction delivery integration suite runs and is source-guarded in ARC CI",
    "CLO-1100: server CLI tarballs are byte-reproducible",
    "CLO-1100: fork Electron profile is isolated from stock t3code-v2 with a one-time migration that leaves t3code-v2 intact"
  ],
  "prior_findings": ["F1", "F2", "F3", "F4"],
  "findings": [
    {
      "id": "F1",
      "severity": "important",
      "outcome": "confirmed",
      "rechecked_head": "1a159f89784f1ba51526c0889c9723830d3f6ceb",
      "file": "apps/desktop/src/app/DesktopUserData.ts",
      "line": 131,
      "summary": "The profile migration is not atomic, and a partial copy becomes permanent. copyProfileTree creates closura-t3code-v2 first and then copies files into it one by one. If the copy stops partway, the next launch sees that closura-t3code-v2 exists and skips migration, and the fork runs on a partial profile.",
      "check": "Confirmed on 1a159f89784f. The migration copies into closura-t3code-v2.migrating, which it first clears with remove(recursive, force). It writes the marker into the staging directory, then renames that directory to closura-t3code-v2. The existence check that decides whether to migrate now sees closura-t3code-v2 only after the full copy and the marker are done. An interrupted run leaves only the staging directory, and the next launch discards it and copies again. The new test in DesktopUserData.test.ts covers this case."
    },
    {
      "id": "F2",
      "severity": "nit",
      "outcome": "open",
      "rechecked_head": "1a159f89784f1ba51526c0889c9723830d3f6ceb",
      "file": "scripts/build-cli-archive.ts",
      "line": 102,
      "summary": "SOURCE_DATE_EPOCH is not set in any workflow, so every archived file gets mtime 0. That includes the bundled web client. apps/server/src/http.ts builds static ETag and Last-Modified from size plus mtime, so a changed non-hashed file with the same size can return 304 across upgrades. Not touched by this diff."
    },
    {
      "id": "F3",
      "severity": "nit",
      "outcome": "open",
      "rechecked_head": "1a159f89784f1ba51526c0889c9723830d3f6ceb",
      "file": "scripts/build-cli-archive.ts",
      "line": 119,
      "summary": "On a macOS host, bsdtar does not sort entries or fix file mtimes, so archives built on macOS are not reproducible, and the reproducibility test would fail on a Mac dev machine. Not touched by this diff."
    },
    {
      "id": "F4",
      "severity": "nit",
      "outcome": "open",
      "rechecked_head": "1a159f89784f1ba51526c0889c9723830d3f6ceb",
      "file": "apps/desktop/src/app/DesktopUserData.ts",
      "line": 44,
      "summary": "The migration skip list leaves out the large Chromium caches (Cache, Code Cache, Service Worker/CacheStorage), so a big stock profile is copied in full and blocks first launch. copyProfileTree uses stat, which follows symlinks, so a symlink loop would recurse without end. Not touched by this diff."
    },
    {
      "id": "F5",
      "severity": "nit",
      "outcome": "open",
      "rechecked_head": "1a159f89784f1ba51526c0889c9723830d3f6ceb",
      "file": "apps/desktop/src/app/DesktopUserData.test.ts",
      "line": 86,
      "summary": "The new interrupted-migration test makes the copy fail with chmod(cookies, 0o000), but it has no skip for root or Windows. As root, and on Windows where chmod does not block reads, the first resolveUserDataPath call succeeds, so Effect.flip fails the test. The sibling DesktopPreReadyFileSystem.test.ts already guards the same technique with skipIf(win32 || getuid() === 0). The test passes on the current non-root Linux CI."
    }
  ]
}

Verdict: F1 is confirmed fixed on 1a159f89784f. No important or critical findings remain open. F2 to F5 are nits.

@nullStack65

Copy link
Copy Markdown
Owner Author

Independent full review of the fix for gating the compaction suite in CI, making server tarballs deterministic and isolating the fork's Electron profile. Reviewed head 1a159f89784f, base release/native-0.1.10 at merge base 08d850cf79a6.

I reviewed this against the acceptance tests in the compaction-suite CI gap issue (CLO-1096) and the fleet release reliability issue (CLO-1100). The reviewer ran in a fresh context and read the source only; it did not edit code. Required ARC checks on this head are green.

Result: 1 important finding, 3 nits.

Important

  • F1: apps/desktop/src/app/DesktopUserData.ts:141. The one-time profile copy is all-or-nothing and blocks startup, so any copy error stops the app from launching. copyProfileTree turns every stat or copyFile failure into a DesktopUserDataInitializationError. The error passes through DesktopClerk.layer into NodeRuntime.runMain, so the fork app exits. Each later launch sees closura-t3code-v2 missing again, removes the staging directory, and fails the same way. Triggers include a dangling symlink anywhere in the stock profile (stat follows links), an unreadable file, ENOSPC, or a file that a running stock install holds open on Windows. Running stock and fork side by side is the very case this change targets. The failure blocks the install until someone fixes it by hand. Suggested fix: treat a migration failure as "start fresh" by logging it, removing the staging directory and returning destinationPath. Alternatively, skip entries that fail instead of failing the whole copy. Add a test that injects a copy failure.

Nits

  • F2: apps/desktop/src/app/DesktopClerk.ts:111. The migration runs before requestSingleInstanceLock (line 115). Two launches on first run (for example a double-click plus a t3:// deep link) both see no fork profile. Each removes the other's closura-t3code-v2.migrating directory, and one copy or rename fails. With F1 that instance crashes once. It heals on the next launch.
  • F3: scripts/build-cli-archive.ts:119. The macOS (bsdtar) branch sets owner and group and drops the gzip timestamp. It does not sort entries or fix mtimes, so the macOS arm64 server archive is still not deterministic, which falls short of the "sorted entries, fixed mtimes" scope. The new test in scripts/build-cli-archive.test.ts passes hostPlatform: process.platform and its inputs have different mtimes, so it will fail on any macOS host. ARC CI is Linux-only, so CI does not catch this. Codesigning and notarization may make full byte reproducibility on macOS impossible anyway. Either document Linux-only reproducibility and skip the test on macOS with a reason, or add --mtime/mtree-style normalization.
  • F4: apps/desktop/src/app/DesktopUserData.ts:44. The skip list leaves out Cache, Code Cache and Service Worker/CacheStorage. These can be hundreds of MB, and they are copied with the synchronous filesystem before the first window, so the first launch after upgrade can stall with no window shown.

Checked and fine

  • The compaction suite is in both the voice-and-inbox-core run list and REQUIRED_TESTS. The new coverage test proves that removing it from the workflow fails the guard. The source-guard strings match two real test names, and CI passed on this head. Note that the guard pins only those two cases, not every compaction case.
  • On Linux the archive is built deterministically with GNU tar: --sort=name, a fixed --mtime, numeric owner 0, gzip -n, and --hard-dereference kept.
  • The Windows Local State fallback still runs when there is no stock profile to migrate. The migration returns early only after a full copy, and that copy includes Local State.

Limitations

  • I did not run tests locally. The macOS behaviour is inferred from bsdtar semantics.
  • I did not check whether tooling outside this repo, such as closura-agent-config fleet scripts, reads ~/.config/t3code-v2 by path. Nothing in this repo outside the changed file references it.
  • There is no verify-t3code evidence for the desktop profile change. That is not a blocking finding.
{
  "reviewed_base": "08d850cf79a66dcda77320bb72ec6b281e745bf4",
  "reviewed_head": "1a159f89784f1ba51526c0889c9723830d3f6ceb",
  "reviewer": "claude-opus-5-5, Claude Code via T3 Code",
  "author_session": "antigravity/gemini-4-neon implementation session (native id not supplied to reviewer)",
  "reviewer_session": "claude-code:d6602651-bf2c-4122-9a52-e8a0a5c348d4",
  "fresh_context": true,
  "review_kind": "full",
  "round_id": "claude-code:d6602651-bf2c-4122-9a52-e8a0a5c348d4",
  "intent": [
    "CLO-1096 AT1: closura-arc-ci.yml runs SteeringCompletion.integration.test.ts and the coverage guard lists it",
    "CLO-1100 AT3: building the server tarball twice yields byte-identical SHA-256 (sorted entries, fixed mtimes/owners)",
    "CLO-1100 AT4: fork and stock use different profile directories; existing fork state migrates once and is preserved"
  ],
  "prior_findings": [],
  "findings": [
    {"id": "F1", "severity": "important", "outcome": "open", "file": "apps/desktop/src/app/DesktopUserData.ts", "line": 141, "summary": "Any copy error in the one-time t3code-v2 -> closura-t3code-v2 migration (dangling symlink, unreadable/locked file, ENOSPC) fails the Clerk layer and exits the app, and retries and fails on every launch; migration should fall back to a fresh profile."},
    {"id": "F2", "severity": "nit", "outcome": "open", "file": "apps/desktop/src/app/DesktopClerk.ts", "line": 111, "summary": "Migration runs before the single-instance lock, so concurrent first launches remove each other's staging dir and one crashes once."},
    {"id": "F3", "severity": "nit", "outcome": "open", "file": "scripts/build-cli-archive.ts", "line": 119, "summary": "macOS bsdtar branch does not sort entries or fix mtimes, so the macOS archive is not deterministic and the new reproducibility test fails on macOS hosts."},
    {"id": "F4", "severity": "nit", "outcome": "open", "file": "apps/desktop/src/app/DesktopUserData.ts", "line": 44, "summary": "Skip list omits Cache/Code Cache/CacheStorage, so a large synchronous pre-window copy can stall first launch."}
  ]
}

@nullStack65
nullStack65 force-pushed the fix/batch4-t3-reliability branch from 1a159f8 to e5a6430 Compare November 27, 2026 03:56
…er tarballs, and isolated fork Electron profile (CLO-1096, CLO-1100)

Squash-rebase of PR #218 onto current release/native-0.1.10; no behavior change from the original
commits. Original authoring trailers: Model antigravity/gemini-4-neon / Task CLO-1096, CLO-1100, CLO-1103 / Agent implementation

Model: claude-opus-5-5
Task: fix
Agent: Builder drain parked-PR lane (Claude Code worker F3)
Lane: magpie
Harness: t3/claude-code
Model-family: Claude
Model-generation: Opus 5.5
Skills-SHA: unknown (source unavailable)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nullStack65
nullStack65 force-pushed the fix/batch4-t3-reliability branch from e5a6430 to c24b1c6 Compare November 28, 2026 05:47

This branch has not been deployed

No deployments
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