Skip to content

chore: fix pre-existing main breakages blocking clean overlay composition (#821) - #832

Draft
aarontrowbridge wants to merge 3 commits into
mainfrom
chore/main-composition-fixes
Draft

chore: fix pre-existing main breakages blocking clean overlay composition (#821)#832
aarontrowbridge wants to merge 3 commits into
mainfrom
chore/main-composition-fixes

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #821. Fixes the two pre-existing breakages that red every overlay composition check on pristine origin/main, verified on a fresh origin/main (6afdb9d) worktree and materialized tree before and after.

Breakage 1 — server-session.ts(497) diff_version type clash

Repro: materialize (canonical v1.18.29 + overlay) → tsgo -b in packages/app:
error TS2741: Property 'diff_version' is missing ... but required in type 'SessionCache'.

Root cause: canonical's server-session.ts builds its store literal without diff_version (v1.18.29 and current upstream HEAD) and passes that draft to dropSessionCaches, which the overlay types with diff_version required. The field is an overlay-only cache-invalidation counter — there is no canonical wire shape to match — so the reconciliation widens the parameter type: diff_version becomes optional on SessionCache and the delete is guarded. The overlay's own global store type (global-sync/types.ts State) still declares it required; only dropSessionCaches' parameter widens.

Verification: the materialized typecheck error set on the fixed branch is byte-identical to the base set minus exactly this one error (19 → 18; the remaining 18 are the known overlay-vs-v1.18.29 API drift on surfaces PR #819 re-homes — out of scope here, no drive-bys).

Breakage 2 — i18n parity failure

Repro: bun test packages/app/src/i18n/parity.test.ts in the materialized tree fails with missing: ["session.exportTrace"] (en.ts has the key — added at the fork pin — none of the 17 non-English app locale dicts do; the ui and desktop domains are clean).

On the issue's 'am' attribution: it traces to PR #819's review notes and does not reproduce — the overlay carries no am dict and its parity test checks the 17 locales it owns; the materialized tree's only parity failure is this missing key across all 17. Restored the key in all 17, following each table's own terminology (br is pt-BR upstream). Inventing overlay am dicts was rejected deliberately: in the composed tree they would overwrite canonical's complete Amharic tables with a smaller fork-era keyset — the opposite of restoring keys.

Also (third pre-existing main breakage, surfaced by the repo's own tooling)

refresh_manifest.mjs / drift_gate.mjs revealed that the committed manifest lags the overlay by the three #774 session-ui files (diff-gutter-extension.ts, editable-diff-view-core.ts, editable-diff-view.tsx — in overlay/, absent from manifest.files), so the drift gate fails on pristine main with "stray files". Commit 1 adopts them via the canonical repair path (refresh_manifest.mjs against the v1.18.29 upstream tree). Flagging it here since it's adjacent to #821's scope but not named by it — happy to split it out if reviewers prefer.

Commits (each green, drift gate PASS at each)

Commit Behavior
948ca66 manifest refresh — adopt the three #774 session-ui overlay files
dc08246 reconcile SessionCache with canonical server-session shape (optional diff_version)
872a521 restore session.exportTrace in the 17 non-English app locales

Verification summary

  • Drift gate: PASS at every commit (579 files, overlay and manifest in sync).
  • Materialized tree (fresh, from this branch): server-session.ts(497) error gone; parity test 4/4 pass.
  • global-sync unit tests: 37 pass, unchanged from base (the 2 bun-test Solid-server module errors are identical on pristine main — environment artifacts, not touched).
  • No collision with sibling PR Re-home the session & device lifecycle base contract onto the app overlay (canonical v1.18.29) #819 (it touches session-list-state/snapshot code on its own branch; this branch touches session-cache.ts, i18n tables, manifest.json only).

… overlay files

The committed manifest lagged the overlay by three files added in #774
(packages/session-ui/src/v2/components/{diff-gutter-extension,
editable-diff-view-core,editable-diff-view}.ts): present in overlay/, absent
from manifest.files — the drift gate fails on pristine main with 'stray files
in overlay/ not in the manifest'. Repair path per #796: recompute the manifest
from the committed overlay against the v1.18.29 upstream tree
(scripts/refresh_manifest.mjs).
… shape

Canonical's server-session.ts builds its store literal without diff_version
(v1.18.29 and current upstream HEAD alike) and passes that draft to
dropSessionCaches — which the overlay types with diff_version REQUIRED, so the
materialized tree fails typecheck at server-session.ts(497):

  error TS2741: Property 'diff_version' is missing ... but required in type 'SessionCache'

The field is an overlay-only cache-invalidation counter (no canonical wire
shape to match), so the reconciliation is to widen the parameter type:
diff_version becomes optional on SessionCache and the delete is guarded.
The overlay's own global store type (global-sync/types.ts State) still
declares diff_version required — only dropSessionCaches' parameter widens.
…ocales

The overlay's i18n parity test fails on pristine main: en.ts carries
"session.exportTrace" (added at the fork pin) but none of the 17 non-English
app locale dicts do — the parity test aborts on the first locale (ar) with
missing: ["session.exportTrace"]. The ui and desktop domains are clean.

Issue #821 attributes this to the 'am' locale; that attribution traces to
PR #819's review notes and does not reproduce: the overlay carries no am
dict and its parity test checks the 17 locales it owns. The reproducible
failure is the missing key across all 17, restored here following each
table's own terminology (br is pt-BR upstream).
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

Comment @coderabbitai help to get the list of available commands.

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.

chore: fix pre-existing main breakages blocking clean overlay composition (server-session diff_version type clash; i18n 'am' locale parity)

1 participant