Local-shell data plane, Slice A: fleet routing mode, merged projection, hub credential (amicissimo#391) - #846
Merged
Merged
Conversation
… mode, merged projection, hub credential amicissimo#391 (spec spec-20260905-193000-local-shell-data-plane, Slice A; D1/D2/D5). The transport composes the #394 resolver's dispatch: the fleet surfaces arm ONLY through the entitlement-staged gate — with no entitlement the option is ignored entirely and client-visible bytes are identical to the base service (the H3 staging fixture pins it). - fleet_staging.ts: the transport-side dispatch (entitlement gate, overlay source ladder, envelope + data-plane-routing surface check, provenance receipt with the skew note; absence/rejection always NAMED) - server.ts: the late-bound routing mode (engine | fleet); fleet routes data + SSE to the hub, the shelf still serves the UI locally (zero assets cross the WAN); a fleet boot with the tunnel down answers its own named 503 — no silent engine fallback - hub_proxy.ts: the hub upstream proxy with mint translation (strips the client's Authorization + ?auth_token= carrier, attaches the hub mint; missing credential = named hub-credential-missing 503) - merged_projection.ts: the D2 read path — both stores into ONE merged, provenance-tagged projection (hub the store of record on conflicts, the founding pain #779 dead in both directions); currency derived over what is actually fetched (count/max/sum + /global/health version per source), tagged with its data sources - hub_credential.ts: the hub mint's credential-store entry (F4 version stamp + base-reader guarantee: unknown keys tolerated on read, preserved on rewrite) + the three-mint registry with per-mode scope - /amicode/fleet/sessions + /amicode/fleet/status: staged routes only; status surfaces the mode, the named mints, the named hub-credential outcome, and the staging receipt
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Slice A of spec
spec-20260905-193000-local-shell-data-plane(rev 2, design-of-record) — the transport slice of harmoniqs/amicissimo#391, per D1 (one service, three upstream modes), D2 (the merged projection; currency derived over what is fetched), D5 (three mints, one honesty rule). Composes amicissimo#394's resolver dispatch: the fleet mode is entitlement-staged, never hardcoded-on.What lands
engine|fleet; Slice B ownsdegraded). In fleet mode, data + SSE route to the hub over the tunnel; the app shelf still serves the UI locally — zero UI assets cross the WAN (the founding diagnosis, fleet client: first-attach probe timeout (1500 ms) makes attach impossible on high-RTT links (plane wifi) — SSE override only covers post-attach #777). No silent fallback: a fleet boot with the tunnel down answers its own named 503, never the engine's.GET /amicode/fleet/sessionscomposes the hub store AND the local engine into ONE merged, provenance-tagged list (amicode_provenance; hub the store of record on conflicts, locals stay visible — the founding pain Read-only Fleet Sessions view: list hub sessions from a standalone client #779 dead in both directions). Currency is derived over what is actually fetched (count/max/sum +/global/healthversion per source) and tagged with its data sources — a token derived over one upstream is never compared against another. The hub-only read path that review rejected is not rebuilt.~/.amico/fleet-hub.json, $AMICO_FLEET_HUB_FILE override) carries the lifecycle spec's F4 version stamp + base-reader guarantee (unknown keys tolerated on read, preserved on rewrite). Three mints, named and scoped (/amicode/fleet/statusrenders the registry); the hub mint is upstream-hop only and never accepted client-side; a missing credential is a named outcome (hub-credential-missing/ projectioncredential-missing), never a silent fallback.fleet_staging.tsmirrors the resolver's dispatch: without theamicissimoentitlement the overlay source is never even read and nothing arms; with it, the fleet surfaces stage only through a lawfulfleet-data-planeoverlay manifest declaring thedata-plane-routingsurface (freeze-class checked, base-version stamped, skew named). Absence and rejection are named, never dead ends.The staging fixture (H3)
The first describe block pins the no-entitlement byte identity: with the entitlement absent, the full client-visible request set (document, assets, manifest, API, proxied, unknown, fleet paths, anonymous) is byte-identical to the base service — the fleet mode does not exist.
Verification
pnpm run typecheckclean; new suite green (25 tests).Out of scope (Slices B/C)
Degraded entry rule, write-failure contract, SSE liveness, revocation handoff, rejoin fixture (#392); the native merged view (#393); offline/mirror.
Closes the transport ACs of harmoniqs/amicissimo#391; the overlay manifest itself lands amicissimo-side (cross-referenced there).
Companion PR (amicissimo-side overlay content): harmoniqs/amicissimo#395 — the
fleet-data-planeoverlay manifest this staging gate consumes.