Skip to content

fix(cli): capture the model gateway's store in snapshots and restore - #3979

Merged
yannickmonney merged 7 commits into
mainfrom
fix/gateway-state-snapshot-restore
Sep 30, 2026
Merged

yannickmonney merged 7 commits into
mainfrom
fix/gateway-state-snapshot-restore

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

Since #3961 a deploy moves the model gateway from Bifrost 1.6.11 to 2.2.4. The new gateway migrates its SQLite store in llm-gateway-data in place and forward-only: upstream drops oauth_configs.token_id, and neither binary has a down-migration.

No CLI snapshot captured that volume. SNAPSHOT_VOLUMES in tools/cli/src/lib/backup/constants.ts omitted it, and so did everything built on that list: RESTORABLE_ARCHIVES, verifySnapshot and the managed recovery-snapshot schema. The consequences:

  • A pre-upgrade restore returned every other volume and left the migrated store under the older gateway.
  • A managed deploy apply that reused a retained pending snapshot from an older CLI migrated the gateway with no recovery point. Its ready receipt still named that snapshot.

Closes #3978.

What changes

  • Capture (backup/constants.ts): GATEWAY_VOLUME = 'llm-gateway-data' joins SNAPSHOT_VOLUMES under its stable name.
    • createSnapshot archives the volume through the existing pauseGroups / withVolumeContainersPaused. The gateway container is paused while its archive is taken. The archive covers the whole volume root read-only: config.db, logs.db and their -wal/-shm files together.
    • Restore, verification and the managed schema accept the archive through the same allowlist.
    • A deployment without the volume is snapshotted as before.
  • Restore (actions/restore.ts): a snapshot without the gateway archive still restores everything it holds.
    • Before the consent prompt, it warns that the gateway volume is left untouched, so the snapshot cannot return the gateway to its store from before a gateway upgrade. If the gateway was upgraded after the snapshot, the operator must put their own copy back first.
    • tale restore lists such snapshots as without gateway.
    • Restore consent is unchanged.
  • Managed apply (deployment/apply.ts, with RuntimeResult.gateway from runtime-apply.ts): the check compares gateway images.
    • Rule. Before anything is written, the apply refuses a rollout that meets both conditions:

      • It would start a gateway image the store has not run.
      • The recovery point does not hold the store: a retained or new snapshot without the gateway archive, or no snapshot at all after an older CLI's takeover.
    • Evidence. The runtime preview reads it once, before anything changes, and validates every Docker record it reads:

      • Whether the gateway volume exists, from the host's volume listing, docker volume ls --format '{{json .}}'.
        • The listing goes through runtimeCommand, so a nonzero exit or a throw refuses.
        • Before any name is read, every line must parse as JSON and be an object with a nonempty string Name. A successful but malformed listing therefore refuses too, instead of reading as "no gateway".
        • Names stay opaque, because Moby leaves the name rule to each volume driver. A plugin volume such as foreign/plugin-data or x reads as it is.
        • The project's volumes are picked out only after that, and the project custody check runs on them as before.
        • An empty listing is still a host without volumes.
      • Which gateway image the rollout starts, and which one runs.
      • Whether the store has run the target. Either a ready runtime receipt lists its digest, or a gateway container on it is running or has started.
        • "Started" means a StartedAt in Moby's RFC3339Nano contract, after the Unix epoch.
        • Zod's ISO datetime checks the calendar, the ranges and the offset. Seconds are required, with at most nine fraction digits.
        • The fraction counts, so a start within the epoch's first second is a start.
        • The zero time is not evidence, and neither is an empty, malformed or impossible time.
        • An adoption compares the digests it inspects.
    • Recovery path: keep the same gateway image. While no runtime rollout is pending, a reviewed bundle that still resolves the gateway image the deployment last ran can take the pending deployment over (supersedesPendingBundle). The rollout after it takes a snapshot that holds the gateway store. The refusal's hint names this path.

    • Named operator blocker. One state stays refused:

      • The recovery point lacks the gateway store.
      • A runtime rollout is already pending.
      • Nothing shows the store has run the target image.

      In that state the hint says the CLI has no way forward. The original pending receipt, its recovery point and the gateway volume stay as they are, for the operator to resolve by hand. There is no acknowledgement override. No snapshot is amended or replaced, and no gateway-only archive is written into the receipt, because a snapshot taken now could already hold a migrated store.

    • What a refusal leaves untouched:

      • The pending, runtime and ready receipts stay byte-identical.
      • A takeover is written only after the check.
      • Nothing is pulled, tagged or started.
    • Messages name both images and claim only what the evidence shows ("nothing shows the store has run it").

    • Snapshot taken first. One kind of pending receipt changed nothing since the ready deployment: it recorded no snapshot, names the ready bundle and was never taken over. A takeover of it, or a retry that would change the runtime, now takes its snapshot first. The snapshot is written into the pending receipt before the rollout.

    • Warnings instead of refusals:

      • A rollout on an image the store has already run completes. It warns when the snapshot lacks the store.
      • A rollout from a receipt an older CLI took over without a snapshot warns that it has no recovery point at all. It no longer claims "its recovery snapshot is kept".
    • Unaffected: fresh installations, and deployments without a gateway volume.

  • Docs, EN/DE/FR:
    • Backups and restore: the inventory row, the without gateway marker, the pause note, restoring with the current CLI, and restore step 4.
    • Upgrades: the Bifrost 1.6 → 2.2 section now points at the CLI snapshot, and keeps the manual copy for --skip-backup.
      • It corrects the false claim that tale rollback starts the old gateway. The command swaps only platform, backend-api and backend-worker.
      • A paragraph on rollback scope is added.
    • Managed deployments: the refusal, the same-image way on, the blocked state once a runtime rollout is pending, and no automatic rollback.
    • Overview: the inventory sentence.
  • Comments: compose.yml, create-sandbox-llm-gateway-service.ts and .env.example no longer call the store a derived cache to wipe.

Rollback scope (read from source)

  • tale rollback (actions/rollback.ts): swaps the application colour's images only, within the same major.minor. It restores no volume. The database, stores, proxy, sandbox services and gateway stay as they are.
  • tale deploy (actions/deploy.ts): rolls the always-roll tier (sandbox-llm-gateway, sandbox, sandbox-egress) in place before it starts the new colour. If a default deploy then fails its health checks, the old colour keeps serving, but the gateway is already replaced and its store possibly migrated.
  • Managed apply: no automatic rollback. Pending state is kept for recovery.
  • Volumes: only tale restore <id>, with consent, puts volumes back.

How I verified

  • Regression tests first. Before/after logs are in the task box.

    • Snapshot, verify and restore: 11 new or adjusted cases fail on unfixed 14fa3f23b. The look-alike-name and no-gateway-volume controls also pass there.
    • Managed apply, against unfixed apply.ts: 4 of the first 6 cases failed. Unfixed, a retry wrote a ready receipt with runtimeChanged: true that named the gateway-less snapshot.
    • Round-1 follow-up, against the cc66f23e2 guard: that guard refused a rollout whose new gateway had already started, and refused the image-keeping takeover. It let a snapshot-less receipt be taken over.
    • Round-2 follow-up, against the 2c426bc1c guard: that guard refused the snapshot-less takeover that can now snapshot first. It also refused the retry with the gateway container gone after a ready runtime.
    • Round-3 fixes are pinned by mutants that restore the previous behaviour: the kept-snapshot notice, no warning, and the snapshot not written into the pending receipt.
    • Round 4, against f69905141: 12 of the new cases fail there. At da7a8daf0, the apply and runtime-apply suites pass 119/119.
      • Unfixed, the successful listing [{"Name":"tale_llm-gateway-data"}] let both a retry and a superseding bundle complete their rollout on the gateway-less snapshot.
      • Unfixed, StartedAt values "1", "2026-09-30", "2026-02-30T00:00:00Z" and "2026-09-30T24:00:00Z" counted as a start. With "1", the apply finished with runtimeChanged: true on that snapshot.
      • Controls that pass on both heads:
        • In both lanes, a transport or permission failure and a throw refuse, with every receipt byte-identical and no pull, tag or start.
        • A present gateway volume next to look-alike foreign names is refused at the gateway check. An absent one continues.
        • An empty listing still reads as a host without volumes.
        • Zero, empty and non-date times are no start.
        • Valid times count, with or without a fraction or an offset.
    • Round 5, against da7a8daf0 (root's review): 25 of the new cases fail there (113 pass). At 03071c657, the apply and runtime-apply suites pass 138/138.
      • At da7a8daf0, a listing with foreign/plugin-data and x refused with "Docker returned invalid volume names.", in the preview and in both lanes, gateway present or absent. The gateway check was never reached.
      • At da7a8daf0, 1970-01-01T00:00:00.001Z, 1970-01-01T01:00:00.001+01:00, 1969-12-31T23:00:00.5-01:00 and 1970-01-01T00:00:00.000000001Z did not count as a start. In apply, the first two refused with "nothing shows the store has run it".
      • The other failures there come from the format change. The new malformed-record cases speak the {{json .}} contract, so da7a8daf0 reads them as names or refuses them with its own message.
      • The same tests against f69905141: 22 fail (116 pass). That head read every malformed listing as a listing (the round-4 finding) and took Date.parse-accepted times, but it read plugin names and millisecond fractions as the fix does.
      • r5-before-classification.txt in the task box lists every failure by kind.
      • Controls, in both lanes, where every refusal leaves the three receipts byte-identical, with no pull, tag, restart or start:
        • A transport or permission failure, a throw, and a later malformed record each refuse.
        • With the gateway present, plugin and foreign names refuse at the gateway check.
        • With the gateway absent, plugin names or no volumes at all continue.
  • Final focused suites: 194/194 across backup/, actions/restore.test.ts, deployment/apply.test.ts and deployment/runtime-apply.test.ts.

  • Tests on genuine states:

    • A new release comes from a release tag with its own image bytes: same commit, new digests.
    • Rollouts stop at the pull, or with Compose refusing on an unhealthy dependency (a pending runtime rollout).
    • Also covered: a gateway container that is stopped, removed or never started.
  • Mutation checks. Each guard condition has a named test that turns red when the condition is removed:

    • the never-ready exemption;
    • the has-run evidence (ready receipt, started container, adoption digest);
    • the snapshot-now path and its takeover exclusion;
    • the volume check;
    • the takeover written after the check.

    Round 4 added seven mutants, and all seven were killed:

    • Listing: validation removed, blank lines tolerated, and a looser name rule.
    • Start time: Date.parse restored, no calendar check, no offset bounds, and the zero time counted.

    One first-attempt mutant was malformed by operator precedence and was redone. Both runs are in the log.

    Round 5 added ten mutants, and all ten were killed:

    • Listing: unparsable lines skipped, invalid records skipped, an empty name allowed, the name rule reinstated, and blank lines tolerated.
    • Start time: Zod without the seconds-and-fraction pattern, the pattern without Zod's calendar, the fraction ignored, a millisecond parse, and the epoch itself counted.
  • Whole @tale/cli suite: 1534 pass and 19 skip, with the same 14 failures as clean 14fa3f23b in this sandbox and no others. The 14 are environmental:

    • no ssh-keygen;
    • git 2.39, which lacks archive --mtime;
    • a 512 MB file-size limit;
    • two order-dependent rollback-confirmation cases that pass alone.
  • Other checks: CLI tsc --noEmit is clean, oxlint reports 0 warnings and 0 errors, and oxfmt, the conflict-marker check and opengrep (0 findings) are clean. The docs structural suite passes 200/200 at this head; rounds 4 and 5 changed no docs.

  • Review: three internal read-only rounds, then root's exact-head reviews of eb3d2709d, 2c426bc1c, 6ba0220e7, f69905141 and da7a8daf0. Every finding and what was done with it is in TALE-384-review-disposition.md in the task box.

  • CI: Unit first failed on eb3d2709d: one apply case read the warning from stdout, and CI ran a --json suite first that leaves the shared reporter silenced. cc66f23e2 reads the warning at the logger, and CI has been green on every head since. The final head 03071c657 has 35 checks passing and 14 skipped, including the smoke test and image validation. CI tests the PR merged with current main (29b988d98). There, Unit executed the CLI suite as a cache miss: 1553 pass, 19 skip, 0 fail over 1572 tests (main adds five), every round-5 case among them. The docs and platform suites were cache misses too (25/25 tasks).

  • Real-binary compatibility proof (no Docker), 75/75 checks. The upstream linux/amd64 binaries were verified by manifest and final-layer digest, then driven by the platform's own llm_gateway_admin.ts.

    • Root accepted it for its measured scope: real upstream Linux binary migration plus copied-store restore, original history/key preservation and WAL-dependent contents.
    • It does not cover actual Docker/CLI orchestration, the Tale image wrapper, populated OAuth migration, large-history performance or real-provider proof.
    • Details are in TALE-384-compat-proof.md in the task box (archive SHA256 740a0f42e03daec1498487cbb7fd0c3e33445b2694302b956d9521d520a1aed1).
  • Root's Docker snapshot/restore proof (not mine; see root's comment). At f69905141, root ran one actual local Docker snapshot, list, verify and default restore of llm-gateway-data. It went through the unmodified helper and action path, including a real pause, archive and unpause. All seven config/SQLite/WAL/SHM files matched.

    • Root's stated scope: an inert read-only volume user, Docker 29 on arm64, and Alpine 3.22 at its pinned digest.
    • It excludes a live gateway or concurrent SQLite writer, the compiled CLI entry, a full platform snapshot, the image wrapper, populated OAuth migration, large history and a real provider.
    • Since f69905141, only deployment/runtime-apply.ts, its test helper and tests changed (da7a8daf0, 03071c657). The snapshot, list, verify and restore code does not import that file.

Known limits

  • The named operator blocker is by decision. A pending deployment whose recovery point lacks the gateway store, with a runtime rollout already pending and no evidence that the store has run the target, stays refused for manual resolution (see above).
  • Snapshot-less takeovers by an older CLI (pre-existing). Such a takeover still rolls out other migrations, the database included, with no recovery point, unless the gateway would meet a new image. The CLI now says so. That this can happen at all predates this PR.
  • Remaining edge. Suppose a deployment's gateway volume was wiped, and a rollout recreated it but died before any gateway started. That deployment stays refused.
  • Old CLIs and new state. An older CLI refuses a new intent whose snapshot lists llm-gateway-data, so it fails closed. An older CLI's tale restore would skip that archive, so the docs say to restore with the current CLI.
  • Docker execution. This sandbox has no Docker. The managed deploy apply path ran against the test fixture only, and the compatibility proof used file copies and the CLI's command strings. Root's Docker proof covers snapshot, list, verify and default restore, with the scope above.

The gateway's SQLite store in llm-gateway-data (admin account, provider
keys, virtual keys with their spend, request log) was never snapshotted,
yet a newer gateway migrates it forward-only on first start (Bifrost 1.6
to 2.2 since #3961). A pre-upgrade restore therefore left the migrated
store in place for the older gateway.

- Snapshots capture llm-gateway-data under its stable name, archived
  whole (database, WAL and shared-memory files) while its container is
  paused; restore and verification accept it through the allowlist.
- Restore warns when a snapshot has no gateway archive and the listing
  marks it "without gateway"; such snapshots still restore the rest.
- A managed apply refuses to change an existing gateway's runtime when
  its recovery snapshot, retained or new, lacks the present gateway
  volume. The refusal comes before any write, so a superseding bundle's
  takeover is recorded only after the recovery point holds; an unchanged
  runtime proceeds with a warning.
- Docs (EN/DE/FR) list the volume in the inventory, correct the rollback
  scope (tale rollback swaps application images only and restores no
  volume) and describe the managed refusal.

Closes #3978
@yannickmonney

yannickmonney commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Release-blocking review finding at eb3d2709d1e05782b07b4953fbc5f4911dcd4971: gateway inspection errors bypass the recovery guard. Corrected controlled reproduction is now verified.

requireGatewayRecoveryPoint in tools/cli/src/lib/deployment/apply.ts returns when volumeExists() answers false. The real helper in tools/cli/src/lib/docker/ensure-volumes.ts returns result.success, so a failed Docker request is indistinguishable from confirmed absence. The later cc66f23e commit changes only the warning test's logger spy; this guard is unchanged.

I tested the existing managed-apply fixture with an old retained snapshot lacking llm-gateway-data, using the real exec and volumeExists helpers against owned inert Docker shims. Each fresh test subprocess receives its shim through startup PATH, asserts Bun.which('docker') equals the owned executable, records and checks the actual stdout/stderr/exit, and verifies both inspect calls in the shim call log. Other runtime operations remain the fixture's simulated Docker boundary.

Inspection response / fixture state before inspection Observed result
Exit 1, error during connect: unexpected EOF; gateway volume present Incorrectly succeeds: phase: ready, runtimeChanged: true, calls up and provisioning, removes pending receipt and changes runtime receipt. Expected-refusal regression fails.
Exit 0 with the gateway volume; gateway present Correctly refuses before runtime up; pending and runtime receipts remain byte-identical. Control passes.
Explicit no-such-volume response; fixture gateway absent Compatibility path completes and creates its new gateway volume. Control passes.

Please make this safety decision fail closed: only a successful, authoritative check proving the gateway volume absent may take the compatibility path. Daemon/transport/permission/invalid-response errors must abort before runtime mutation or recording a takeover, preserving the original pending and runtime receipts. Reuse the existing strict runtime inventory if suitable rather than treating every failed inspect as absence. Add this failure regression alongside present/absent controls. Do not replace the original snapshot to resolve it.

The original focused suite passes 93/93 separately. This is a local synthetic control-flow proof, not real Docker or production execution; the separate real-binary recovery proof and complete normal CI remain required. No merge or approval from this review.

Evidence correction retained: the first harness changed PATH inside Bun and did not establish shim invocation; its attribution was withdrawn publicly. Those initial logs remain marked superseded. The results above come from the corrected startup-PATH harness with verified executable, boundary response and call records.

CI ran the retry case after a suite that leaves the shared reporter
silenced (--json mode), so the warning never reached the stdout spy and
the case failed although the warning was logged. Spy on the CLI logger
instead, which sees the call whatever the reporter state is; the case
passes with the reporter silenced as well.
Follow-up to an independent review of the managed-apply check.

- The runtime preview reports the gateway store: whether its volume
  exists, read from the project volume listing it already takes, so a
  Docker error fails the preview rather than reading as "no gateway";
  and whether the rollout starts another gateway image than its
  container runs, compared the way converged() compares every service.
- The apply refuses only that image change on a store its recovery
  point does not hold. That now covers a pending receipt with no snapshot
  at all (a re-run of a ready bundle) taken over by a bundle that moves
  the gateway, which rolled out with no recovery point. A rollout that
  keeps the gateway image completes and warns: a retry after the new
  gateway already started, or a takeover that keeps it. That takeover is
  the documented way on from a refusal; the next rollout snapshots the
  gateway store.
- Hints claim only what the CLI can verify and name that way on; the
  restore warning carries the docs' condition.
- Docs (EN/DE/FR) match the rule, say "a default deploy (without
  --services)", restore with the current CLI, and state the overview's
  blob condition; .env.example no longer advises wiping the gateway
  volume.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Follow-up review of 2c426bc (previous evidence and its correction remain intact).

The original nonzero-exit bypass is repaired: the runtime inventory uses runtimeCommand, which refuses transport/permission failures before any takeover or runtime mutation. Independent present-volume controls also refuse; genuine absence remains compatible. Both retained and superseding pending intents were exercised, with pending/runtime/ready receipts byte-identical on the refusal paths.

One fail-closed gap remains: runtime-apply.ts:663–665 filters docker volume ls --format '{{.Name}}' output by project prefix without validating the inventory first. A successful but malformed response such as [{"Name":"tale_llm-gateway-data"}] becomes an empty project inventory. With the gateway volume present, its running image older than the target, and the original recovery snapshot lacking that volume, both retained and superseding controls then reach ready, pull/start the runtime and provision, remove the pending intent and change the runtime/ready receipts. The required-refusal assertions fail.

Please validate the complete successful response before deriving absence (or use a strict structured inventory), preserving legitimate empty/foreign-project inventories. Add boundary regressions for malformed success as well as nonzero/throw failures, with present/absent controls and receipt immutability for both intent paths.

Proof scope: these are local source-bound tests of the real applyDeployment → applyRuntime → runtimeCommand → exec path at the inventory boundary, using a subprocess-startup PATH with Bun.which, raw stdout/stderr/exit and exact shim-call counts verified. Docker is an inert shim and other runtime/native I/O is fixture-backed. This demonstrates malformed-response handling; it does not claim real Docker normally emits that response, or prove gateway migration/restore compatibility. Eight of ten controls pass; only the two malformed-success required-refusal cases fail. The authored focused suite passes 139 tests, and selected docs checks pass 28 tests (local retained dependencies; separate from exact-lock CI).

Second review follow-up.

- The preview reads, before anything changes, whether the store has run
  the target gateway image: a ready runtime receipt that lists it, or a
  gateway container on it that has started (an adoption compares the
  digests it inspects). A gateway stopped or removed after a ready
  runtime no longer reads as a new image.
- A pending receipt that recorded no snapshot changed nothing since the
  ready deployment, so a retry or takeover that would change the runtime
  takes its snapshot first and records it, instead of being refused. One
  an older CLI took over without a snapshot is still refused when the
  store would meet a new gateway image.
- Messages name the image the rollout starts and the one that runs; the
  hint names the way on only while no runtime rollout is pending, and
  says when there is none.
- Docs (EN/DE/FR) match; .env.example follows the environment reference.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Exact-head follow-up for 6ba0220e7699633819c9ae916b606b77474f6d7d: the malformed-inventory admission finding remains open, and the new start-history check has the same kind of missing validation.

  1. runtime-apply.ts:691–693 still filters volume-list stdout by project prefix before validating records. I updated the independent probes to prepare a genuine next-release gateway digest, since a container-only image mismatch no longer represents an unseen target under this revision. Exit-0 stdout [{"Name":"tale_llm-gateway-data"}] still lets both retained and superseding applications reach ready, issue pull/up/native actions and change all three receipts despite a present gateway volume and a gateway-less original snapshot. Twelve controls pass: present/absent, transport/permission errors, and valid foreign names with both presence and absence, each in both lanes. These use the actual runtimeCommand/exec boundary and an inert executable selected by PATH before Bun starts, with raw result and executable call-log assertions.
  2. New hasStarted (runtime-apply.ts:512–518) accepts StartedAt: "" as proof a stopped target container ran, because any string not beginning 0001-01-01 passes. With a pending new-release runtime and the same legacy recovery point, an actual apply/runtime fixture with the zero-time value refuses without mutations; changing only this value to empty incorrectly reaches ready and changes all three receipts. A valid past timestamp is the positive control. Unknown/malformed start metadata must not establish that the image has run; validate it or treat it conservatively.

Both are controlled malformed-output tests, not a claim that ordinary Docker emits these values. Neither probe proves real gateway migration or native restore compatibility. The original PATH erratum and all prior evidence remain preserved.

Focused authored tests pass 141/141, and docs checks 28/28. GitHub’s exact-head Unit job shows a real CLI test cache miss and execution, including the new gateway cases; green authored checks do not cover these two parser boundaries. Source acceptance remains withheld pending the guards and regression tests; binary/native proof stays separate.

Third review follow-up.

- A takeover of a receipt an older CLI took over without a snapshot no
  longer logs a kept recovery snapshot; the CLI warns that the rollout
  has none.
- The snapshot a changed-nothing receipt takes stays with the pending
  deployment through an interruption, for a takeover and a same-bundle
  retry alike (now tested); such a receipt must also name the ready
  bundle.
- Messages say nothing shows the store has run the image and name the
  gateway container's image; the hint points at the gateway image the
  deployment last ran; a retake no longer says no pending deployment was
  recorded when one was.
- A container counts as started only with a start time after year 1.
- Docs (EN/DE/FR) match.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Focused verification at f69905141d73c2ce9aa23c964347fd8ac1cdf9f4: the empty-time counterexample is fixed; the two existing validation findings are not yet fully closed.

  • Inventory: the prefix filter still runs before complete record validation. The genuine next-release controls still reach ready on exit-0 stdout [{"Name":"tale_llm-gateway-data"}] with a present gateway volume and a legacy snapshot lacking it, in both retained and superseding lanes. Twelve present/absent, transport/permission and valid-foreign-name controls pass. The two malformed-success required-refusal assertions still fail and observe pull/up/native actions plus changed pending/runtime/ready receipts.
  • Prior-start metadata (same existing finding): zero time, "" and "not-a-timestamp" now refuse without mutation; a valid prior timestamp continues. However Date.parse("1") > 0 still turns malformed metadata into proof the stopped target-image container ran. The actual apply/runtime control with StartedAt: "1" reaches ready and changes all three receipts. Docker’s Moby inspect serializer emits StartedAt as RFC3339Nano. Please validate that timestamp contract before accepting prior-start evidence; accepting an arbitrary JavaScript-parseable date is insufficient. This is a refinement of the same validation repair, not a new root cause for each input.

Inventory checks use the real runtimeCommand/exec path with startup-PATH executable selection, raw result and call logs verified. Timestamp checks use actual parsed container metadata and apply/runtime source with fixture Docker I/O. Neither claims ordinary Docker emits malformed values or proves gateway binary/native restore behavior.

Affected authored apply/runtime tests pass 87/87; docs checks 28/28. The new no-recovery-point warnings and snapshot-less receipt preservation tests are appropriate. Source acceptance remains blocked by the two validation boundaries above.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent archive review accepts the measured Linux-binary/copied-store compatibility evidence. Root also completed and independently reviewed one actual local Docker snapshot/list/verify/default-restore proof at frozen CLI source f69905141d73c2ce9aa23c964347fd8ac1cdf9f4, using the existing unmodified helper/action path and a fresh synthetic namespace.

Snapshot 20260930-110046-manual contains only llm-gateway-data: archive315,302 bytes, SHA256 9618cf8d9a9cdbe207903d295be298d7825d9c53091409250dc53fe5d3d5691f. All seven config/SQLite/WAL/SHM files (6,366,962 bytes) match input, source, native archive and restored bytes. Real pause→archive→unpause, recovered health/heartbeat and seven successful native helper lifecycles are retained. Restore targeted an independently verified fresh empty volume. Both backup copies remain byte-identical; all four volumes/five exited reviewer containers and the pinned image/tag are preserved. Root independently rehashed183 evidence files and every final data/backup byte. Initial observer-readiness/sequence mistakes and the empty history receipt are transparently retained; actual later raw events establish the proof.

Scope: an inert read-only volume user, direct existing source helpers/default action, retained dependencies and Docker29 arm64 with Alpine3.22's unchanged pinned digest. No live gateway/concurrent SQLite writer, compiled CLI entry, full platform snapshot, image-wrapper, populated OAuth migration, large-history or real-provider proof. Final source changes still require engine/call-graph reconciliation, normal full checks and independent acceptance.

The two parser refusals in the preceding review still hold full PR/release acceptance. Recovery decision remains (c): preserve the incomplete original recovery point and keep that deployment blocked for manual resolution; no override or replacement snapshot. Tale's newest reply/restart has not been confirmed saved. All schedules/grants/Ops/release actions remain held.

Fourth review follow-up.

- A successful `docker volume ls` whose output was not a list of volume
  names was filtered as one: JSON, a table or a stray space read every
  volume, the gateway store's included, as absent, and a retry or a
  superseding bundle started a new gateway image on a store its
  recovery snapshot lacks. Every line must now match Moby's name rule
  before any is read; an empty listing is still a host without volumes,
  and a transport failure or a throw still fails closed.
- A stopped gateway container counted as having run its image whenever
  Date.parse read its start time after 1970, which "1", a date alone or
  an impossible date all satisfy. Only a start time in Moby's
  RFC3339Nano contract that the calendar has now counts.
- The fixed-container check and the listing share the name rule.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent exact-head review at da7a8da: the earlier malformed-success inventory and numeric/calendar timestamp counterexamples are corrected. Existing actual-helper controls pass 46/46 and your two affected suites pass 119/119.

P2 compatibility hold: the whole-host DOCKER_NAME check rejects valid unrelated plugin volumes. A successful inventory with either foreign/plugin-data or the one-character name x, with the gateway genuinely absent, previously completed both retained and superseding lanes (4/4). At da7 all four refuse with “Docker returned invalid volume names.” Pending/runtime/ready receipts remain byte-identical and no pull/up/native effect occurs: this is unnecessary unavailability, not observed state loss. A documented fail-closed limitation does not satisfy the existing legitimate-foreign-volume compatibility requirement.

Validate the complete structured formatter records before project filtering instead: volume ls --format '{{json .}}', existing parseJson for every line, then the existing schema library requiring object records with a nonempty string Name. Keep unrelated plugin names opaque; preserve managed-project suffix/custody checks and the fixed-container naming rule in their own scopes. Include foreign/plugin-data and x in both lanes with gateway absent/present, later malformed records, empty inventory and transport/permission failures, with unchanged receipts and no effects on refusal. Primary wire contract: https://docs.docker.com/engine/extend/plugins_volume/ ; Moby Linux validation delegates volume names to drivers and the plugin List adapter preserves Name. These are source/inert-command controls; no native plugin test was run.

A separate P3 edge in this same timestamp repair: startInstant discards fractions. Valid 1970-01-01T00:00:00.001Z and equivalent offset/fraction inputs completed on f699 (4/4), but da7 treats them as epoch zero and refuses all four. This is limited to positive fractions of the first epoch second, not another release blocker or evidence that current-era timestamps fail. Preserve the admitted instant when simplifying the parser; prefer existing Zod ISO/calendar/offset validation with required seconds and <=9 fractional digits rather than maintaining a second date parser. No broader clock-policy change is requested.

The reviewed local five-file JSON preparation based on older f699 has SHA256 082726b2efdff88cc7843cc0ddf8f25d70535074162d4db6a295741e123a2605; it is guidance, not a blind replacement for your new source. It passed 127 affected tests, 54 helper controls and 4 plugin controls, with separate inventory review 52/52 plus 30/30 custody tests. Its earlier author is disclosed; the current da7 review does not certify that candidate.

The bounded compatibility archive and direct-source actual Docker createSnapshot/list/verify/default-restore proof remain separately accepted for their measured scopes, with original data and failures retained. No repeat campaign is needed. Continue on this same PR/task with the small structured-inventory correction, regression evidence and exact final normal CI. Recovery decision (c), existing receipts, all paused schedules/new grants and held release/Ops actions remain unchanged.

Fifth review follow-up.

- The runtime preview reads `docker volume ls --format '{{json .}}'`.
  Before any name is read, every line must parse as JSON and be an
  object with a nonempty string Name. Names stay opaque: Moby leaves
  the name rule to each volume driver, so a plugin volume such as
  `foreign/plugin-data` or `x` no longer refuses a deployment. A
  listing that is not a list of records still refuses before anything
  changes, and an empty one is still a host without volumes. The
  fixed-container name rule keeps its own scope.
- A stopped gateway container's start time is validated by Zod's ISO
  datetime (calendar, ranges, offset), with seconds and at most nine
  fraction digits. It keeps its fraction, so a start within the
  epoch's first second counts again.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent final review accepts 03071c657377957b4fcc23ac21de12028ebf054b for normal merge. Both remaining compatibility findings are corrected: every volume-list line is validated as a structured record before project filtering, legitimate foreign plugin names remain opaque, and valid positive fractional start instants are preserved. Root read the complete four-file revision.

Independent actual-helper subprocess controls passed 40/40 across retained and superseding deployment paths: 24 inventory and 16 timestamp cases. Refusals preserved all three receipts and produced no pull/up/native effect. These use an inert Docker command boundary, not a native plugin. The 19 original actual-Docker backup/restore source bindings and the additional unchanged call-path files match the accepted f699 proof; its scope and the separately accepted 740a compatibility archive remain as recorded in the earlier review. No new live-provider, populated-OAuth, large-history or compiled-CLI/Docker campaign is inferred.

Five normal workflows at this exact head completed successfully on attempt 1: Checks 36723560087, Build 36723559896, CLI 36723560199, SAST 36723559771 and Commitlint 36723560077. The rollup has 35 successes and 14 source-explained conditional skips. Unit job 109915770026 freshly executed CLI cache hash d2d62ac085a48115: 1553 passed, 19 skipped, 0 failed; the affected apply/runtime-apply suites passed 67 + 71 with no skips. The 19 are 18 TALE_BINARY-gated compiled smoke tests and one Windows-only source test on Ubuntu. Actual tested merge 29b988d has parents ea7de2e + 03071c6; all four revised files independently match the reviewed head. Backend integration was correctly unselected; Build selected docs only, with CI tests enabled and no scannable service. Candidate-only, release-only, fork-only and unrelated-service jobs are not claimed as executions.

The author separately reports 1534 local CLI passes and 14 sandbox failures reproduced on clean main. That is not relabelled a local full-suite pass; the observed hosted result above supplies the current complete normal CLI outcome. Main has since added the separate Gemini configuration and crawler-limit changes; no backup/restore engine, dependency lock or CLI admission source changed in that delta. The actual squash source will be checked before closing the board prerequisite.

The source/recovery prerequisite is accepted within these boundaries. Fresh candidate validation, complete publication, existing Ops deployment, serving-version confirmation and paused workflow installation remain separate gates; nothing is activated by this review.

@yannickmonney
yannickmonney merged commit cc325fc into main Sep 30, 2026
49 checks passed
@yannickmonney
yannickmonney deleted the fix/gateway-state-snapshot-restore branch September 30, 2026 14:20
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.

CLI snapshots omit llm-gateway-data, the store Bifrost 2.2 migrates forward-only

1 participant