Skip to content

Consume octi-desktop's published wire-format fixtures#319

Merged
d4rken merged 1 commit into
mainfrom
feat/consume-desktop-fixtures
May 21, 2026
Merged

Consume octi-desktop's published wire-format fixtures#319
d4rken merged 1 commit into
mainfrom
feat/consume-desktop-fixtures

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented May 21, 2026

What changed

No user-facing behavior change. Internal: app-main now consumes d4rken-org/octi-desktop's published wire-format fixtures alongside the existing d4rken-org/octi-web ones. A serializer change in either producer that drops a required field, retypes a value, or renames an enum entry breaks the matching consumer test here.

Mirror of B2 (d4rken-org/octi#318, merged) pointed at the second producer. The multi-source v2 lockfile + sync infrastructure landed in B2 already supports two (or more) sources; this PR just wires up the desktop entry.

Technical Context

  • Second source pinned in fixture-lock.json. d4rken-org/octi-desktop @ 1e00e71fc60841fda80d7db4f630aa99b1112c9d (the C1 merge SHA), manifest_sha256 ce2fd860ff124599bfc61a94f824c17c521cf79d744f06bc3551e284e6a37fe4. The existing d4rken-org/octi-web entry is untouched. Each source bumps independently; one stale entry doesn't poison the other on cache (though the first sync call still does fetch both — see note in InteropFixtureSync.kt).
  • SyncRefResolver.SOURCE_PATHS gains "d4rken-org/octi-desktop" to "src/test/resources/interop/published". The doc comment was sharpened along the way ("Keep in lockstep across all three" → "for any shared source, the path string must agree across consumers") — the registry is subset-based per consumer, not a single global allowlist.
  • Three new Desktop*InteropTest files, one per module, sitting next to the existing Web*InteropTest siblings. Each calls InteropFixtureSync.ensureSynced("d4rken-org/octi-desktop") in @BeforeAll, parses every vector through the production decoder, and asserts field-by-field against octi-desktop's canonical inputs in InteropFixtureGenerator.kt.
  • Wire-shape differences pinned explicitly:
    • MetaInfo.deviceType = DESKTOP (not BROWSER like web).
    • MetaInfo.deviceBootedAt = Instant.parse("2026-05-01T10:00:00Z") in the full and unicode-label vectors. Desktop's MetaWriter calls ProcessHandle.startInstant() and emits a real Instant — never null, unlike web.
    • The minimal meta vector's deviceBootedAt is absent on the wire (the test pins payloadJson.contains("deviceBootedAt") shouldBe false AND info.deviceBootedAt shouldBe null so a future shift from "absent" to "explicitly null" is caught).
    • SharedFile.blobKey is a plain UUID (00000000-0000-0000-0000-000000000001), NOT the sha256:<hex> shape web/android use. Verified via FileShareRepo.kt — desktop calls UUID.randomUUID().toString(). Consumers see two different blobKey shapes on the wire depending on which producer wrote the payload; the dashboard treats the string as opaque so the asymmetry is fine. Codex confirmed app-main itself also emits UUIDs for its own blobs.
    • Connector IDs are desktop-flavoured (kserver-prod.kserver.octi.darken.eu-77777777-... vs web's aaaaaaaa-...). Routed through ConnectorId(...).idString on the producer side so a future format change propagates.
  • SyncRefResolverTest gets one new regression test + one comment cleanup. The renamed resolveAllFromEnv throws when override targets a source not present in the lock now goes through the full env → parseOverrides → resolveAll path (was directly hitting resolveAll, which bypassed SOURCE_PATHS validation). A new resolveAllFromEnv applies an override to one source of a multi-source lock and leaves the other anchored test pins the exact path the C4 cross-repo workflow will exercise: override desktop, leave web on its locked ref + manifestSha256.
  • InteropFixtureSync doc comment softened. The previous "per-source independent" framing was misleading: cache directories are per-source, but the first ensureSynced() call syncs all sources before any test executes. Codex flagged this; the doc now states it explicitly.

Review guidance

  • Diff is ~500 lines, ~400 of which are three DesktopInteropTest files that mirror the existing WebInteropTest pattern. Compare the meta tests side-by-side for the most informative diff.
  • The lockfile bump is the C1 merge SHA on d4rken-org/octi-desktop — verified by fetching manifest.json at that SHA and sha256sum-ing it.
  • Desktop's UUID blobKey shape is intentional, not a fixture bug. The consumer test pins it explicitly so a future desktop-side migration to sha256: would surface here.

Test plan

  • ./gradlew :sync-core:testDebugUnitTest :modules-meta:testDebugUnitTest :modules-clipboard:testDebugUnitTest :modules-files:testDebugUnitTest green on cold cache (fetched both octi-web and octi-desktop fixtures).
  • Same command green on warm cache (both sources cache-hit).
  • 4 new tests in DesktopMetaInteropTest, 4 in DesktopClipboardInteropTest, 7 in DesktopFilesInteropTest, +1 new resolver test.
  • Existing Web*InteropTest files untouched and still pass — the two consumer test families coexist without coupling.
  • Live cross-repo verify: covered by the symmetric upstream-gating workflow that lands on octi-desktop in C4 (after both consumers — this PR + C3 — are on main).

Sister PRs:

Adds d4rken-org/octi-desktop as a second pinned source on app-main's multi-source fixture-lock.json and ships per-module Desktop*InteropTest files that decode each payloadJson through the production decoder. Desktop's wire shape differs from web in places — SharedFile.blobKey is a plain UUID (not sha256:<hex>), deviceBootedAt emits a real Instant for the full meta vector — and the tests pin those values.

Multi-source infrastructure from B2 reused as-is. SyncRefResolverTest gains a multi-source resolveAllFromEnv regression test that goes through the full env → parseOverrides → resolveAll path so SOURCE_PATHS validation is exercised end-to-end.

Pairs with octi-desktop#56 (the producer).
@d4rken d4rken added Build/Deploy c: sync Component: Synchronization c: module Component: Info Modules c: module/meta Related to meta module (`module-meta`) that contains the basic device infos. c: module/clipboard Related to the clipboard module (`module-clipboard`). c: module/files Related to the file sharing module (`module-files`). labels May 21, 2026
@d4rken d4rken merged commit 105f582 into main May 21, 2026
17 checks passed
@d4rken d4rken deleted the feat/consume-desktop-fixtures branch May 21, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build/Deploy c: module/clipboard Related to the clipboard module (`module-clipboard`). c: module/files Related to the file sharing module (`module-files`). c: module/meta Related to meta module (`module-meta`) that contains the basic device infos. c: module Component: Info Modules c: sync Component: Synchronization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant