Repository navigation
Description
Design: secrets plane — delta refresh, broker peer sync, dual-store puts
Direction: Drew, 2026-11-23 ~19:12 CST. Extends #13893 (cold-refresh batching + client fallback bound) and #13894 (broker performance under load). Where this design and #13893's batching-only proposal overlap, this design supersedes the batching-only framing: the one-call list becomes the full-refresh mechanism inside a delta-first design, not the end state. #13893's client-wait bound survives unchanged (Slice 1 below). #13894 remains the performance-tracking issue; this design addresses its cold-refresh row and part of the client pile-up cause.
Related, not duplicated: #10358 (secrets scoping — prefix / vault / store selection decides which store and namespace a name resolves to; this design decides how brokers and stores stay in sync), #9158 (canonical secrets model, provider adapters & custody policy), #13081 (heal cadence starving refresh — fixed), #5504 (partial refresh evicting cached secrets — its failure mode is a correctness constraint on Slice 2).
1. Problem and evidence
The sandbox secrets broker refreshes by shelling out to bws secret get <id> once per secret — 242 spawns, ~160–220s cold (measured 2026-11-23, #13893). Refresh runs at startup and every 900s. During that window the broker is present-but-not-serving, and clients hang instead of falling back (>120s observed, #13893), so every sandbox restart wedges every secrets consumer for minutes. The estate has two brokers (sandbox + laptop) holding the same set with no way to learn from each other: if the laptop broker refreshed a minute ago, the sandbox broker still pays the full upstream cost. Writes are worse: fleet secrets is read-only today (verified, §3), so a new secret is minted out-of-band in one store and propagates only when a refresh happens to notice it (#6275's read-through gap is the same shape).
2. Goals and non-goals
Goals
- A broker restart reaches
servingin seconds in the normal case (peer up), and in one upstream list call in the worst case (peer down, no cache). - Refresh cost tracks change, not set size: pull only secrets whose revision moved since the last refresh.
- Brokers prove sync with a set hash; equal hashes mean synced, full stop.
fleet secretsgains a write path (put) and explicit cache controls (refresh,--upstream,--no-cache), with puts propagated so no peer or store has to re-fetch to converge.- Both stores (Bitwarden Secrets + 1Password) are kept in sync by construction, with one designated primary so sync direction is never ambiguous.
Non-goals
- Namespaces / per-device store selection — that is Design: fleet secrets scoping — prefix / vault / store selection, per-device profiles #10358; v1 syncs the whole set, per Drew's explicit simplification ("for broker-to-broker, it might just be simpler to just send everything it has from one location to the other… we can pull that back at that point").
- Replacing either store, or embedding them in the fleet binary — filed as separate future-work to-dos, cross-linked below.
- A new trust root or enrollment system — peer trust is the fleet enrollment/broker trust already in place.
3. Verified premises
Verified by the filing lane 2026-11-24; anything not verified live is marked.
fleet secretstoday has exactly two verbs,getandlist, and is read-only — verified from the installed binary's help (Commands: get, list).refreshandputare new surface.bws secret list <project>returns the whole set in one call, including values and a per-secretrevisionDate— verified live against the estate's Bitwarden project (bws 2.1.0): 244 secrets, fieldscreationDate, id, key, note, organizationId, projectId, revisionDate, value(count and field names only were inspected; no values). So both batching and delta-by-revisionDateare supported by the CLI today; the broker simply doesn't use the list call.- bws write verbs exist (
bws secret create / edit / delete) — verified from CLI surface and existing estate scripts. - 1Password CLI (
op2.41.0) is installed in the sandbox recovery bin and on the laptop — verified.op item create/op item editexist (help verified).op service-account ratelimitexists (help verified) — service-account rate limits are a real, queryable constraint, not a theoretical one. - NOT live-verified:
op item list --format jsonfield shape. Documented behaviour is that items carrycreated_at/updated_at, and list returns metadata (values need a per-itemop item get). The laptop'sophas no account configured in a plain SSH shell ("No accounts configured for use with 1Password CLI"), so this lane did not read a live item. Slice 5 includes a capability spike to verify before the mirror-write path is built on it. - Peer channel exists: the tiered broker shape (local → laptop → in-process) and its tokens (by name:
fleet.secrets-broker-token,fleet.queue-broker-token,fleet.laptop-agent-token) are live; sandbox↔laptop traffic rides the tailnet (DERP-relayed at 490–873ms RTT per Broker-stack performance under load: queue reads 8-28s, fleet gh +5s vs direct, DERP-only tailnet path (490-873ms) #13894, still WireGuard-encrypted end to end).
4. Alternatives considered
A. Batching only (#13893 as filed). One bws secret list per refresh replaces 242 gets. Cold refresh drops from ~3–4 min to seconds. Honest tradeoff: refresh cost still scales with set size, brokers still can't learn from each other, no write path, no sync proof. Necessary but not sufficient — absorbed as the full-refresh mechanism in the chosen shape.
B. Delta refresh from the upstream store only (no peer sync). Refresh = list, filter revisionDate > watermark, apply changes. Cheapest correct refresh, but a restarted sandbox broker with an empty cache still needs a full set from upstream, and two brokers can hold different sets between refreshes with no way to know. Rejected as the end state; it is the upstream half of the chosen shape.
C. Full-set broker-to-broker transfer on every sync. Drew's allowed v1 simplification taken literally for every cycle: brokers just send each other everything. Simple and obviously correct; at ~244 small secrets the payload is trivial today. Tradeoff: it re-sends everything forever and gives no cheap "are we synced?" answer. The chosen shape keeps full-set transfer as the v1 peer payload but gates it behind the set hash, so the common case is one hash comparison and transfers happen only on real divergence.
D. Store-level replication only (no broker protocol). Brokers stay dumb caches; Bitwarden and 1Password are synced by a separate replicator. Rejected: it does nothing for the restart wedge (the actual incident), and broker-to-broker is where the latency pain lives.
5. Chosen approach
5.1 Delta refresh (upstream leg)
Each broker keeps a durable watermark: the start time of its last successful refresh, minus a small skew overlap (Drew's "from maybe just before the last refresh started"). A refresh is one bws secret list call; entries with revisionDate after the watermark are applied, ids absent from the list are deleted locally, everything else is untouched. The list call carries values, so a delta refresh and a full refresh are the same call with different apply rules — there is no per-secret fetch path left. A failed or partial list applies nothing (the #5504 lesson: a partial refresh must never evict).
5.2 Broker-to-broker peer sync
On startup and on each refresh tick, a broker asks its trusted peer for {set_hash, last_upstream_refresh_at, count}:
- Hashes equal → synced; done. This is the steady state and costs one round trip.
- Peer refreshed from upstream more recently than local, hashes differ → pull the peer's full set (v1 payload = everything, per Drew's simplification) and adopt it, recording the peer as the source and the peer's watermark as the local watermark.
- Peer down or stale → fall back to the upstream delta/full refresh (§5.1).
Consequence, as Drew specified: a sandbox broker needs a full upstream refresh only if the laptop is down AND it restarted with no cache. Namespaces and selective pull-back are deferred until requirements actually diverge.
5.3 Set hash
The sync proof is a hash over the whole set: sort by name, hash each (name, value) pair, combine. Because a bare hash of a low-entropy value is guessable offline, pair hashes are keyed (HMAC with the peer token) and the set hash is exchanged only between authenticated brokers, never logged in full (truncated in logs) and never published. Equal keyed hashes from two brokers that share the peer key prove the sets are identical without either side sending values.
5.4 Client surface
fleet secrets get <name>— unchanged default path (local broker → laptop → in-process).fleet secrets get <name> --upstream— resolve from the upstream peer/store, bypassing the local cache.fleet secrets get <name> --no-cache— bypass all broker caches; straight to the primary store.fleet secrets refresh— force the local broker through §5.2/§5.1 now instead of at the next tick; reports which leg served it (peer / upstream-delta / upstream-full) and the resulting set hash.fleet secrets put <name>— new; §5.5. (Value via stdin/prompt, never argv, so it stays out of shell history and process lists.)- The Secrets broker cold refresh takes ~3-4 min (242 per-secret bws spawns); clients hang instead of falling back while it refreshes #13893 client bound rides along: a non-serving local broker is a cache miss within ~2–5s, never a hang.
5.5 Put semantics (chosen default)
Default: the put is written by the node that receives it to the primary store first; that write is the commit point. The writer then pushes the value directly to its peer broker and writes the mirror store; the peer never re-fetches. Drew offered both shapes (send-upstream-and-let-upstream-write, or write-and-push); write-first-then-push is chosen because (a) the primary store is the source of truth, so the commit must land there before any cache holds the value — otherwise a crash between push and store-write leaves caches holding a secret the truth doesn't have; (b) a node holding only one store still works: it sends the put upstream to the laptop (which always has both), and the laptop performs the dual write — that is the send-upstream shape, kept exactly where it's needed, as the escalation path rather than the default. Mirror-store or peer-push failure after the primary commit does not fail the put; it queues a reconcile (§5.6) and the put reports committed, propagation pending.
5.6 Dual-store sync and the primary designation
Recommendation: Bitwarden Secrets is the primary; 1Password is the fallback/mirror. Drew's initial lean was 1Password primary "if that helps", with the reverse explicitly acceptable if better supported. The evidence supports the reverse:
- The entire running broker stack already authenticates to Bitwarden with machine access tokens, headless, today. 1Password on the laptop has no account configured outside its desktop/service-account setup (§3).
- Bitwarden's one list call returns values and
revisionDate— it is the only store that can serve as the delta source. 1Password's list returns metadata only; a full pull is one call per item. - 1Password service accounts carry rate limits (the CLI ships a
ratelimitverb to inspect them); a chatty sync loop against 1Password as primary would spend that budget on bookkeeping. As mirror, it receives one write per put — well inside any limit. - 1Password's strength in this estate is human-side custody and escrow (the IdP CA material is already escrowed there). As mirror/fallback it keeps that role: if Bitwarden is down, brokers serve from cache and 1Password is the human recovery path; reads can fall back to it, writes queue until the primary returns (or Drew rules an emergency promotion).
Sync direction is therefore never ambiguous: primary → mirror, primary → brokers, broker → broker (§5.2). A periodic reconcile compares the primary's set hash against each broker's and (via item metadata) the mirror's, and repairs drift from the primary, logging names only. The only bootstrap case where a node lacks both stores is a node with just the Bitwarden CLI: it uses the canonical Bitwarden path — acquire its access token via the existing bootstrap route (the token is itself a vaulted secret, fetched by name) — and from then on it is a primary-capable node. Per Drew: the only time a node doesn't bootstrap to having both stores reachable is if the canonical path doesn't have the secret or the CLI isn't installed.
6. Security analysis
- Peer trust: broker-to-broker sync introduces no new trust. Peers authenticate with the existing broker tokens under the existing fleet enrollment; a non-enrolled party cannot request a set, a hash, or a push. Put (§5.5) requires the same enrollment-grade auth as other broker admin surface — it is a write into the estate's secret store and is treated that way.
- Values in transit: values move only on (a) the existing broker channel over the tailnet (WireGuard-encrypted; DERP relays see ciphertext, Broker-stack performance under load: queue reads 8-28s, fleet gh +5s vs direct, DERP-only tailnet path (490-873ms) #13894), and (b) broker↔store TLS. No new plaintext path is created. Full-set peer transfer (v1) widens how much value material crosses the peer channel per sync, which is why it is gated behind hash divergence instead of running every tick.
- Hash leakage: pair hashes are keyed (§5.3) so a leaked set hash does not enable offline guessing of low-entropy values; hashes are truncated in logs.
- Logging: names, counts, timings, truncated hashes, and the serving leg — never values, never full hashes, never tokens. Put audit records name + actor + timestamp only.
- Deletion: a delete in the primary propagates as a set-diff deletion (§5.1/§5.2); peer adoption is wholesale-set replacement from the more-recently-refreshed side, so a deleted secret cannot be resurrected by a stale peer — the peer's older watermark loses by rule.
7. Build slices (dependency-ordered)
S1 — Client bound + one-call refresh (the surviving #13893 fixes). Broker refresh uses one bws secret list; clients fall through a non-serving local broker within ~2–5s. Acceptance: cold refresh measured in seconds on the live set; a fleet secrets get issued during a refresh returns from the laptop tier or errors promptly, never hangs >5s; #13893 closes on this slice's evidence.
S2 — Delta refresh + watermark. Durable watermark with skew overlap; apply-only-changed; deletion by id-set diff; partial list applies nothing. Acceptance: with exactly one secret changed upstream, refresh applies one entry (log shows names/counts) and the set hash moves; with none changed, refresh is a no-op beyond the list call; a killed mid-refresh broker restarts into the pre-refresh set (no eviction, #5504 regression test).
S3 — Set hash + peer status. Keyed set hash (§5.3); brokers expose {set_hash, last_upstream_refresh_at, count} to authenticated peers. Acceptance: two brokers holding the same set report equal hashes; changing one value on one side flips only that side's hash; unauthenticated hash requests are refused.
S4 — Peer pull sync. §5.2 logic on startup and tick; full-set peer payload; upstream fallback. Acceptance: sandbox broker cold start with the laptop peer up reaches serving with zero bws invocations (proven by bws-call logging); cold start with the peer down still reaches serving via upstream; a secret changed on the laptop converges to the sandbox on the next tick without either side calling upstream.
S5 — Client surface: refresh, get --upstream/--no-cache, put. §5.4/§5.5 semantics, including the one-store-node escalation to the laptop for dual write. Includes the 1Password capability spike (verify §3's unverified premise) before the mirror write is built. Acceptance: a put from the sandbox is readable from the laptop broker and present in both stores without waiting for a refresh tick; a put from a Bitwarden-only node lands in both stores via the laptop; refresh reports its serving leg; put audit log contains the name and actor and no value.
S6 — Reconcile + drift repair. Periodic primary↔broker↔mirror hash comparison; repair from primary; alert on persistent drift. Acceptance: a hand-edited mirror entry is detected and restored on the next reconcile, logged by name only; a hand-edited broker cache entry is likewise repaired from the primary; two consecutive failed reconciles raise an alert through the existing PM path.
8. Rollout and rollback
Roll out per slice, laptop broker first, sandbox second (the laptop is the estate's always-has-both node and the natural first peer). S1–S2 are broker-internal and roll back by binary revert to the previous published fleet build. S3–S4 add peer verbs behind a config flag defaulting to off until both sides run the new build; disabling the flag returns both brokers to independent upstream refresh (today's behaviour). S5's put ships dark (verb present, disabled by config) until S6's reconcile is live, so no write path exists before drift repair does. The stores themselves are never migrated — Bitwarden already holds the set; 1Password mirror population is a one-time copy from the primary, verified by hash before S5 enables mirror writes.
9. Verification plan
- Timed cold-start, peer up: restart the sandbox broker with an empty cache; measure time to
serving; assert zero bws calls (S4). - Timed cold-start, peer down: stop the laptop broker, restart the sandbox broker empty; it must still reach
servingvia upstream — the one case Drew named where a full upstream refresh is expected — and the elapsed time is recorded against the S1 baseline (one list call, seconds, vs today's ~160–220s). - Hash proof: force a one-value divergence; hashes differ; run sync; hashes equal; sets byte-identical by name+value comparison inside the test harness (values never printed).
- Put propagation: put from each node class (dual-store laptop, Bitwarden-only sandbox); verify presence in both stores and both brokers, and timing.
- Drift drill: hand-edit the mirror and a broker cache; reconcile repairs both, logs names only.
- Log audit: grep all new log paths for a canary value planted via put; it must appear nowhere.
10. Open questions (named deciders)
- Primary designation — this design recommends Bitwarden primary / 1Password mirror (§5.6) against Drew's initial lean, on the evidence in §3. Decider: Drew (ratify or reverse; the design's mechanics are unchanged if reversed, but the delta source moves and S2/S5 get harder — §5.6 says why).
- Put availability — should
putwork from any enrolled node at S5, or laptop-only until S6 proves reconcile? Decider: Drew (security posture call). - Peer protocol home — extend the secrets broker's own HTTP surface, or carry sync on the queue-broker channel? Decider: fleet design owner (Archer), settled at S3 from the existing broker code, not by preference.
- 1Password write identity — service account vs desktop-integration session for the mirror write. Decider: Archer, after the S5 capability spike (the laptop CLI currently has no configured account in a plain shell).
- Token-generation command name for the
fleet initbootstrap to-do (companion issue) — Drew left the name undecided ("I don't know,fleet generate a net" was thinking aloud). Decider: Drew, when that to-do is picked up.
11. Companion to-dos (filed alongside, future work)
- Embed both stores in the fleet binary — a configurable feature embedding 1Password + Bitwarden Secrets access directly into
fleet, so a node downloads one binary and has everything it needs. (Issue link added in a comment below.) fleet initbootstrap command — the one-time-token bootstrap (token redeemed at a generic URL) as a fleet command, plus a token-generation command that talks to the Cloudflare worker and returns a one-time token a service can hand to a new server. (Issue link added in a comment below.)
Filed by the SECRETS-PLANE-DESIGN lane, 2026-11-24. Secrets are referenced by name only throughout; no values appear in this issue.
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-24T01:17:34Z",
"session_id": null,
"lane": null,
"host": "htch-runtime",
"worktree": null,
"model": null,
"lane_start_issues": [],
"workspace_ref": null,
"auth_subject": "archer",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activity
developing-today commentedon Nov 24, 2026
CODE-5128
dezren39 commentedon Nov 24, 2026
Companion to-dos filed, per §11 of the design:
fleet init: one-time-token bootstrap as a fleet command, with the token-generation command's name left as an open question for Drew (future work).Both are marked future work and sit outside this design's build slices; they cross-link back here.
Merge pull request #13969 — secrets plane design record (#13948)
dezren39 commentedon Nov 24, 2026
SOPS interaction — from the secrets-stack analysis (record:
doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/, PR #13992, merged5484ff02)Drew asked (2026-11-23 ~19:34 CST) whether all secrets management should move to SOPS, and whether SOPS ciphertext is safe in the public repo vs a private secrets repo. The analysis's conclusion, precisely as it touches this design:
fleet secrets put(§5.5) remains the only write path into this plane.Full reasoning, the public-vs-private repo analysis, and the attestation + Keycloak/cert-manager/ESO/OpenBao companion answers are in the record linked above.
secrets S1: one-call broker refresh + client bound (#13948)
dezren39 commentedon Nov 24, 2026
Cross-link from the cluster plan (plan of record on #1817, 2026-11-24): Phase 6 (cluster security + secrets wiring) is this design's cluster-time consumer. When the Cozystack cluster lands, the plan adopts — per the secrets-stack record (PR #13992) — External Secrets Operator with this design's broker plane as its backend (the broker stays the runtime source of truth;
ExternalSecretresources policy-guarded), cert-manager chained to the fleet CA, and the SOPS Tier A/B discipline for cluster-bound configuration (Tier A never in git; Tier B as SOPS ciphertext under the record's rules). The Phase 1 design child #14016 also applies the tier discipline to Talos/TALM generated secrets when it decides the cluster-config secrets shape. No change to this design's slices is implied — noting the scheduled consumer so the dependency is visible from both sides.secrets S1: fix stale refresh-cost comment (#13948)
dezren39 commentedon Nov 24, 2026
Secrets plane S1 landed as merged-ready PR #14021 (lane oc-code-03, task 21621; do-NOT-merge noted, Archer merges from the record). Scope: pkgs/fleet only (2 files). Measured evidence on the PR: M1 cold refresh 244 secrets in 2.52s via one
bws secret listcall (was 242 spawns / 160-220s); M2 get-during-refresh returns 503 in 0.0005s, post-load unknown-name 404 via read-through in ~3.4s — never hangs beyond ~5s. Tests green (fleet-queue secrets_broker 26 passed, fleet-secrets 37 passed). Partial/failed list applies nothing (#5504 constraint covered by regression test).dezren39 commentedon Nov 24, 2026
1Password ↔ AWS sync pass (2026-11-23): Phase 1 complete — Phase 2 BLOCKED, no AWS access exists
Drew's order: sync 1Password and AWS Secrets Manager to identical names and secrets, now and going forward. Inventory and diff were run names-only (values never written anywhere; hash comparison planned for the copy pass). The sync could not run: the estate has no AWS access at all. Nothing was copied in either direction; no AWS side was invented.
AWS verdict: no access (evidence)
~/.aws, no~/.config/aws, no AWS credential env vars;aws sts get-caller-identity→ "Unable to locate credentials."To unblock: provision IAM credentials with Secrets Manager read/write for the target account and store them in the broker by name (suggested:
aws.access-key-id/aws.secret-access-key, or an SSO/role route), plus name the target region(s). Once present, the pass is mechanical: copy each one-sided secret under its identical name, hold same-name/different-value conflicts for Drew's ruling, verify by hash.1Password inventory (via the broker-held service-account token, name
onepassword.service-account-token)Three-way picture (Bitwarden is inventory-only in this order, not in the sync set)
Naming convention (for the copy pass, once unblocked)
AWS secret names must match
[A-Za-z0-9/_+=.@-]+. 61 of 68 1Password titles already conform. Seven cannot exist identically in AWS (spaces, parentheses, colon) — proposed mapping (replace each run of disallowed characters with a single.):Oracle Cloud (developing-today)→oracle-cloud.developing-todayService Account Auth Token: museRW→service-account-auth-token.muserwService Account Auth Token: muse→service-account-auth-token.museSunshine (amd-6) admin→sunshine.amd-6.adminBitwarden Secrets Manager access token (bws)→bitwarden-secrets-manager-access-token.bwsGitHub GHCR classic PAT (ghcr-fleet)→github-ghcr-classic-pat.ghcr-fleetEXAONE ID→exaone-idOpen choice inside the mapping: also lowercasing (matches the estate's dominant dotted-lowercase style, but renames the already-portable
GitHub→github) vs case-preserving (only the seven titles change). Drew's call when the pass is unblocked.Representation note
LOGIN items carry username + password and the DOCUMENT items (the IdP CA material) are file-shaped, so the design should settle a per-category value rule before the copy pass (e.g. LOGIN → password field only, or a JSON object; DOCUMENT → file contents as the string). API_CREDENTIAL / PASSWORD / SECURE_NOTE map to a single string directly.
Going forward
The identical-set requirement extends this design's sync set to three stores (the broker plane, 1Password, AWS Secrets Manager). The put-path mechanism (dual/triple-write on
fleet secrets put, peer hash proof) is design work on this issue — noted here, not built in this pass.Broker hygiene (found on the way)
Two listed broker names contain spaces and are unfetchable — the client rejects them as invalid names:
op muse service account auth token 1passwordandop museRW service account auth token 1password. The live service-account tokens are the 1Password items in Dev/Walla. Worth cleaning up so the list only names fetchable secrets.Merge PR #14021: secrets S1 — one-call refresh + client bound (#13948)
dezren39 commentedon Nov 24, 2026
Open question 1 — 1Password-primary trial: measurements (2026-11-23)
Drew directed an empirical test of his initial lean (1Password primary) against this design's recommendation (Bitwarden Secrets primary / 1Password mirror). Trial run standalone against the live CLIs on the laptop (
op2.41.1,bws2.1.0); the production broker was not touched. All pulls discarded output in-process — counts, bytes, field names and timings only, no values recorded.Bulk-mode survey (verified live)
bws secret list: 244 secrets, one call, 0.89 screationDate, id, key, note, organizationId, projectId, revisionDate, value— values and revision stamps in the same call, so delta sync needs no second passop item listpiped toop item get -op item listalone is metadata-only. The stdin form ofop item getreturned all 67 Dev-vault items in full (82 KB, values present) in 1.03 s, one process. Per-itemop item getis the only other route (CLI/SDK/Connect all share it)BatchGetSecretValue, up to 20 secrets per call (244 secrets = 13 calls)sts get-caller-identity: "Unable to locate credentials", no~/.aws); sandbox has no AWS CLI; no AWS credential names in the vault list. Not a live candidate todayThe 1Password pull trial (Dev vault, 67 items — the SA-visible estate is Dev 67 + Walla 1)
op item list(metadata)op item get(warm)list | get -)The constraint that decides it: rate limits on this account
Live from
op service-account ratelimit: token read 1,000/hr, write 100/hr — and an account-wide read+write cap of 1,000 requests per 24 h across all service accounts (this is the small tier; Business would be 50,000/day and this account is not on it). Consequences for a primary store:revisionDate, which is exactly what the delta design in this issue is built on.Verdict
Making 1Password primary would not make the plane faster, and the recommendation stands — Bitwarden Secrets primary / 1Password mirror — now on measurements, not just structure. The trial did overturn one assumption behind the original analysis: 1Password is not per-item-only — its bulk stdin form pulls the full set in ~1 s, as fast as
bws secret list. What keeps it out of the primary seat is everything around that one number: per-item access (the shape get-loops and the SDK take) runs 1.07 s and ~1 request per secret, the account-wide 1,000-requests/day cap makes a primary's refresh + sync + put traffic share a small hard budget, and there is no one-call list carrying values plus revision stamps for the delta loop. 1Password-primary becomes competitive only on a Business-tier account and with the broker rebuilt around the bulk form — and even then it merely ties the 0.89 s call it would replace. As mirror, 1Password is cheaper than assumed: reads can use the bulk form; only a full resync is write-capped.dezren39 commentedon Nov 24, 2026
Peer-sync slices queued — S3 = task 21646, S4 = task 21647 (2026-11-24)
The two peer-sync slices of this design are now packetised and queued in
repo-health-code-pilot, mirroring S1's packet (task 21621) — kindfeature_slicewithpayload.slice, priority 70, routed to laptop OpenCode sessions (the broker code inpkgs/fleetis the same code S1's session built), progress on this issue at every boundary, do-not-merge (Archer merges from the ready-to-merge record), no closing keywords. Both read back asqueued, unclaimed, at enqueue time.{set_hash, last_upstream_refresh_at, count}; peer verbs behind a default-off config flag (§8); settles open question 3 (peer protocol home) from the broker code and records the decision here. Dedupe keyrepo-health:v1:slice:developing-today/code:issue:13948:slice-3.bwsinvocations, peer-down cold start via upstream, no-upstream convergence, deletion non-resurrection). Dedupe keyrepo-health:v1:slice:developing-today/code:issue:13948:slice-4.Ordering / dependency note — S2 is the gap. §7 is dependency-ordered S1 → S2 → S3 → S4, and the dependency is real, not ceremonial: S3's peer status exposes
last_upstream_refresh_at, whose durable-watermark semantics are S2's deliverable, and S4's adoption rule (§5.2) compares watermarks — a stale peer's older watermark loses by rule. S1 is done (PR #14021 merged). S2 (delta refresh + watermark) is designed but NOT built and NOT queued — verified 2026-11-24T03:19Z against the live queue (queued/parked/claimed/blocked lists: the only #13948 slice task in existence was S1) and against this issue's comments (no S2 build record). Rather than silently reorder, both new packets name S2 as a hard prerequisite in their body and inpayload.slice.depends_on: the claiming session verifies S2's state here first and parks naming the unmet prerequisite if S2 has not landed (S4's packet likewise names S3). Net effect: the peer-sync chain cannot actually start until an S2 packet exists — queueing S2 is the unblocking step for both tasks above.Part of #13948. Secrets referenced by name only; no values in this comment.
dezren39 commentedon Nov 24, 2026
Lane any-n (OpenChamber, laptop) claimed queue task 21646 (S3: set hash + peer status). Premise verdict: S2 (delta refresh + durable watermark) has not landed: no build record here and no S2 PR. S3 is parked with a non-person resume condition (a comment on this issue containing S2) and no code was written. No competing S3 PR was found. The protocol-home decision (open question 3) is deferred to the S3 build, which now waits on S2.
dezren39 commentedon Nov 24, 2026
Lane oc-code-05 claimed task 21647 (S4: peer pull sync). Premise verdict: S2 (delta refresh + durable watermark) has no build/merged PR, and S3 (keyed set hash + peer status) remains parked as task 21646 pending S2; the issue history confirms both prerequisites are unmet. No competing S4 PR was found. Per the packet, no code was written; parking S4 until S2 and S3 have merged PRs recorded here. Laptop shell target was unreachable, but the prerequisite check alone determines this park.
Part of #13948.
dezren39 commentedon Nov 24, 2026
Middle slice queued — S2 = task 21649: the chain S2 → S3 → S4 is now fully queued (2026-11-24)
The missing middle of this design's dependency order is now packetised and queued in
repo-health-code-pilot, mirroring S1's packet (task 21621) and the S3/S4 packets queued earlier today — kindfeature_slicewithpayload.slice, priority 70, routed to laptop OpenCode sessions (the broker code inpkgs/fleetis the same code S1's session built), progress on this issue at every boundary, do-not-merge (Archer merges from the ready-to-merge record), no closing keywords. It read back asqueued, unclaimed, at enqueue time.revisionDatefilter, apply-only-changed, deletion by id-set diff); a failed or partial list applies nothing (the fleet(secrets-broker): a partial vault refresh silently evicts cached secrets — one failed bws get becomes a 404 and a 'successful' refresh #5504 constraint); proofs per §7 (one-change apply, zero-change no-op, mid-refresh kill with no eviction, watermark durability + skew window). Dedupe keyrepo-health:v1:slice:developing-today/code:issue:13948:slice-2.Chain order is now S2 → S3 → S4, all three queued. S3 (task 21646) and S4 (task 21647) both read back
parked— each was claimed once and parked naming this slice as the unmet prerequisite, exactly as their packets instructed. With S2 queued, the peer-sync chain can start in order: S2 lands the durable watermark, S3 exposes it aslast_upstream_refresh_atbeside the set hash, S4 compares and adopts it.One semantics point the S2 packet pins down (recorded here so the downstream sessions inherit it): §5.1 defines the watermark as refresh-start minus skew, while §5.2/§5.3 name the exposed peer field
last_upstream_refresh_atand S4's rule speaks of comparing and adopting "the peer's watermark". The S2 packet specifies that the persisted watermark is the single quantity the chain consumes — it is what S3 exposes under that field name and what S4 compares/adopts — and instructs the S2 session not to introduce a second, un-skewed refresh timestamp for peer comparison (if the code seems to want one, it records that here as a design note instead). The skew overlap therefore applies consistently to both the delta filter and the peer recency comparison.Part of #13948. Secrets referenced by name only; no values in this comment.
dezren39 commentedon Nov 24, 2026
Claimed task 21649 (S2: delta refresh + watermark) in laptop OpenCode session, lane oc-code-08. Premise verdict: S1 landed (PR #14021 merged, sha 35e5d56); no competing S2 PR or build record on this issue; S3 (21646) and S4 (21647) parked awaiting S2. Proceeding to build S2 per design §5.1 + §7 in a fresh worktree off ~/git/code.
Part of #13948.
Merge pull request #14053 from developing-today/pin/fleet-static-74eee89
dezren39 commentedon Nov 24, 2026
Correction (Drew, 2026-11-23 ~21:32 CST): the identical sync set is 1Password ↔ Bitwarden Secrets — not AWS.
Drew's words: "1pw bws sync not aws." This supersedes the 1Password↔AWS identical-sync framing recorded earlier today (comment 7120844701). AWS is out of the sync set entirely — and the estate has no AWS access in any case, as that lane's inventory established. The held AWS sub-choices (AWS-legal renames for the 7 titles; lowercasing vs case-preserving) are moot and withdrawn with the framing.
The OP↔BWS convergence pass is running under this correction: same names, same secrets, both directions, values moving only in-process between the CLIs on the laptop, conflicts held for Drew's ruling (names only, never overwritten), naming deviations and held items recorded on this issue.
dezren39 commentedon Nov 24, 2026
S2 implementation complete + proofs (task 21649, lane oc-code-08)
Scope:
pkgs/fleet/crates/fleet-queue/src/secrets_broker.rsonly (1 file, +528/-13).What landed
WATERMARK_SKEW_S(60s), persisted atomically (write-tmp-then-rename) to~/.config/secrets-broker/watermark(SECRETS_BROKER_WATERMARK_FILEoverride), reloaded at startup. Cold start (missing file) = full apply, never a failure.bws secret list: entries withrevisionDateafter the watermark (or missing/unparseable stamp, applied conservatively) are installed; everything else keeps its value AND fetch time; ids absent from the list are deleted (known-id names dropped, unknown-id read-through installs retained — absence unprovable).revisionDateparsed manually (no chrono in workspace):Z+ numeric offsets, fractional seconds; absolute anchor verified (2026-01-01T00:00:00Z= 1767225600).last_refresh(the/healthfield S3 will expose aslast_upstream_refresh_at) IS the watermark. No second timestamp.CachedSecretgains the Bitwardenidfor the diff.Proofs (commands + results)
cargo test -p fleet-queue --features secrets-broker --lib→ 159 passed, 0 failed (34 insecrets_broker, incl. 8 new S2 tests);--test broker_bin_args→ 2 passed.1940\n→ reload Some(1940); garbage file → cold start None.bws secret list -o json→ 244 entries, all with string id/key/value; max revisionDate older than now-60 → filter yields 0 (live no-op case); threshold at 2nd-max revision isolates exactly 1 entry (bridge.send-token) — the one-change filter analogue.applied 244 of 244,/healthserving with 244 secrets.kill -9→ restart:loaded durable watermark from disk, serving 244 again, watermark retained then advanced.POST /refreshwith full cache and quiescent vault →applied 0 of 244, deleted 0, total 244; watermark advanced (start-minus-skew). Log lines show counts only.fleet serve secrets-broker) untouched throughout.Part of #13948.
dezren39 commentedon Nov 24, 2026
READY TO MERGE — S2: delta refresh + watermark (task 21649, lane oc-code-08)
11689eba3532ca4bb18ba7af70fcf40d17892bea(branchsecrets-s2-delta-refresh, 1 commit)pkgs/fleet/crates/fleet-queue/src/secrets_broker.rsonly (+528/-13)cargo test -p fleet-queue --features secrets-broker --lib→ 159 passed, 0 failed;--test broker_bin_args→ 2 passedFull implementation + proof record: preceding comment on this issue.
Part of #13948.
dezren39 commentedon Nov 24, 2026
Lane oc-code-08 claimed task 21647 (S4: peer pull sync). Premise verdict: S2 (delta refresh + durable watermark) has NOT landed — PR #14054 is OPEN (head 11689eb, branch secrets-s2-delta-refresh), not merged. S3 (task 21646, set hash + peer status) remains parked pending S2. No competing S4 PR found (only open #13948-linked PR is S2's #14054). Per the packet, no code was written; parking S4 until S2 and S3 have merged PRs recorded here.
Part of #13948.
developing-today-fleet commentedon Nov 24, 2026
OP ↔ BWS sync — correction + verified start state (OP-BWS-SYNC-2, 2026-11-23)
Correction (Drew, 2026-11-23 ~21:32 CST): "1pw bws sync not aws." The identical-sync set is 1Password ↔ Bitwarden Secrets. AWS is out of the sync set: the AWS framing in the earlier OP↔AWS pass record on this issue, and its held sub-choices (the AWS-name mappings as AWS names; the lowercasing question as an AWS question), are withdrawn. The dotted mappings proposed there are reused below as BWS keys, because our secrets client imposes the same fetchability constraint (verified against the client this pass: names may not contain
/ ? # %, whitespace, or control characters, and may not be.or..).Predecessor lane: the first OP-BWS sync lane ended without a report and posted nothing on this issue (the newest comment before this one predates it). Its only observed action was a broker secret-list read. This pass re-verified both stores from scratch before any write; nothing from that lane is assumed.
Verified start state (fresh inventory this pass; values compared by SHA-256 in-process only — no value written to any file, log, or this issue):
idp.ca-passphrase,idp.issuing-ca.key,idp.root-ca.key) present on both sides by name with non-comparable representations (1Password document escrow vs BWS secret value) — no action needed for set identity.Conflicts held for Drew's ruling (same name, different value; neither side overwritten):
opencode.server-passwordrustdesk.amd-6-passwordturso.muse-meta-agent-inbox-tokenTitle ↔ key pairs for the seven space-titled 1Password items (mapping as proposed on this issue: each run of disallowed characters → a single
.):Oracle Cloud (developing-today)→oracle-cloud.developing-todayService Account Auth Token: museRW→service-account-auth-token.muserwService Account Auth Token: muse→service-account-auth-token.museSunshine (amd-6) admin→sunshine.amd-6.admin(pre-create hash diagnostic against the existingsunshine.amd-6-adminruns first — result in the progress record)Bitwarden Secrets Manager access token (bws)→bitwarden-secrets-manager-access-token.bwsGitHub GHCR classic PAT (ghcr-fleet)→github-ghcr-classic-pat.ghcr-fleetEXAONE ID→exaone-idThe other seven 1Password-only items copy under their titles verbatim (
GitHub,bitwarden.access-token,muse@amd,popesdrew@gmail.com,tailscale.auth,turso.muse-mirror-rw-token,user@amd) —@is a fetchable character in our client, verified above.Representation rules applied: LOGIN → password as the BWS value, username in the BWS secret's note field; API_CREDENTIAL → credential as value; BWS → 1Password as API_CREDENTIAL items in the Dev vault titled by key.
tailscale.auth(SECURE_NOTE) gets a hash diagnostic against the existing BWStailscale.auth-keyand is otherwise held — its representation rule is unsettled.Put timing (Drew's question, 2026-11-23): every put in both directions is timed this pass; the distribution (attempted/succeeded, wall time, median, slowest, throttling observed) will appear in the progress/completion records below.
Copy pass begins from this state.
developing-today-fleet commentedon Nov 24, 2026
OP → BWS direction complete (OP-BWS-SYNC-2 progress, 2026-11-23)
13 of the 14 1Password-only items copied to Bitwarden Secrets and hash-verified against a fresh re-list. BWS total 244 → 257.
GitHub,bitwarden.access-token,muse@amd,popesdrew@gmail.com,turso.muse-mirror-rw-token,user@amd(LOGIN usernames recorded in each BWS secret's note field where present).oracle-cloud.developing-today,service-account-auth-token.muserw,service-account-auth-token.muse,sunshine.amd-6.admin,bitwarden-secrets-manager-access-token.bws,github-ghcr-classic-pat.ghcr-fleet,exaone-id.Sunshine (amd-6) admindiffers from the value in the pre-existing BWS keysunshine.amd-6-admin. The mapped keysunshine.amd-6.adminwas created per the recorded mapping, so BWS now holds both keys with different values — one of the two Sunshine admin passwords is presumably stale.tailscale.authheld, substantively present: its note text is hash-identical to the value of the existing BWStailscale.auth-key, so no duplicate was created. Recorded as present-in-substance undertailscale.auth-key; the SECURE_NOTE representation question stays open.Put timing — BWS
secret create: 13 attempted, 13 succeeded; total put wall time 3.5 s; median 234 ms; slowest 442 ms. No rate-limit responses (no write cap observed on the Bitwarden route).BWS → 1Password direction (190 items) follows from here.
developing-today-fleet commentedon Nov 24, 2026
BWS → OP direction: 98 of 190 in, cap-paused with exact resume state (OP-BWS-SYNC-2, 2026-11-23)
Done this pass: 98 of the 190 Bitwarden-only keys now exist as API_CREDENTIAL items in the 1Password Dev vault, every one hash-verified against a fresh bulk read (Dev 67 → 165 items; OP total 166 incl. Walla). Method note: items are created from the API Credential JSON template piped over stdin, so values never appear in process arguments. An early pilot created
airthings.config-envtwice while the create method was being settled (two different invocation forms both succeeded); the duplicate was detected by title count, hash-verified as identical, and one copy deleted — Dev holds exactly one.Cap-pause (the 1Password write cap is a hard wall): the token write budget is 100 writes per window. It was consumed exactly (3 by the pilot + dedupe delete, 97 by batch creates); the next create (
modal.token-secret) was answered with an explicit rate-limit error ("Too many requests. Your client has been rate-limited") and the run stopped there by design. Account-wide read/write budget is not the constraint (281 of 1,000 used; resets ~16 h out).Exact resume state:
modal.token-secretthroughzai.api-key(full list saved on the laptop at/tmp/bws-to-op-remaining.txt; the resume recomputes from live state anyway).python3 /tmp/bws_to_op2.pyon the laptop. It is resume-safe by construction — targets are recomputed as (BWS keys − live OP titles − the 7 mapped keys), so nothing already copied is re-put, and 92 puts fit inside one fresh 100-write window.Verification summary (fresh-state, hash-compared in-process): of the 250 BWS keys in scope for the OP side (257 total minus the 7 mapped keys), 152 sit in Dev hash-identical — the 48 originally-identical overlap pairs, the 6 verbatim pairs completed by the OP → BWS direction, and the 98 created this pass. The only mismatches in the whole estate are the 6 already recorded: the 3 held conflicts (
opencode.server-password,rustdesk.amd-6-password,turso.muse-meta-agent-inbox-token) and the 3 IdP DOCUMENT pairs (non-comparable representations).Put timing (Drew's question: "how fast are puts for each?")
bws secret create: 13 attempted, 13 succeeded. Total put wall time 3.5 s; median 234 ms; slowest 442 ms. No rate limiting observed; no write cap on this route.op item create: batch phase 98 timed attempts (97 succeeded, 1 rate-limited at the cap): total put wall time 167.3 s; median 1,543 ms; slowest 3,958 ms (cloudflare.api-token-mcpx-worker). The 2 successful pilot creates before the batch were not individually timed (labelled unmeasured, not reconstructed). Per-put, 1Password is roughly 6–7× slower than Bitwarden, and its 100-writes-per-window cap — not latency — is the binding constraint on bulk convergence: a full one-sided rebuild of ~190 items needs two windows (~2 h minimum), while steady-state deltas are a handful of puts.Ongoing mechanism (recommendation)
Until this design's
putverb dual-writes both stores (S5), convergence is periodic. Recommended: a scheduled reconciliation pass in this same shape (inventory → hash-compare → copy one-sided, hold conflicts), run every 6 hours and after any manual store edit, with each pass self-capped at ~90 OP puts to stay inside one write window with margin. Once S3's whole-set hash exists, the pass can skip entirely when both hashes agree, making the common case two list calls and zero puts.Still held for Drew (unchanged): the 3 same-name value conflicts above; the Sunshine pair divergence (
sunshine.amd-6-adminvssunshine.amd-6.adminholding different values); the SECURE_NOTE representation question (tailscale.auth, substantively present astailscale.auth-key); the 3 IdP DOCUMENT pairs' representation.dezren39 commentedon Nov 24, 2026
Lane oc-code-07 claimed task 21647 (S4: peer pull sync). Premise verdict: S2 (delta refresh + durable watermark) has NOT landed — PR #14054 is OPEN (head 11689eb, branch secrets-s2-delta-refresh), not merged; task 21649 reads done but unmerged. S3 (task 21646, set hash + peer status) remains parked pending S2. No competing S4 PR found (only open #13948-linked PR is S2's #14054). Per the packet, no code was written; parking S4 until S2 and S3 have merged PRs recorded here.
Part of #13948.
developing-today-fleet commentedon Nov 24, 2026
S1 deployed — fleet-static-74eee89 rollout record (lane S1-DEPLOY, 2026-11-24)
S1 (PR #14021, merge
35e5d56b) is now live in the estate. Until this rollout the running brokers and seats were pre-S1; Drew's never-hang ruling is now in effect on the live paths.Artefact
fleet-x86_64-linux-musl, sha25627eedcf9e0d6a1c251d6bc9ddf41212747f47cbce6d0cfe2cf96ea820708085d, source rev74eee892e18e43e0d214f977de67b5ab9c7b8aef(contains the S1 merge). Published viascripts/muse/publish-fleet.shfrom the laptop (static-linkage + bridge-capability gates passed).b56bdd7—FLEET_URL+FLEET_SHA256updated together inscripts/muse/bootstrap.sh.pkgs/deploy):/nix/store/26b9fzx396cssp6lf5nzx2rqpib4qxb7-fleet-0.1.0.Flips (rollbacks intact)
fleet+~/tools/fleet): bcc8043 → 74eee89;fleet-static-bcc8043retained in the recovery bin as rollback.~/.local/bin/fleet: f56dc7f bits → 74eee89; backupfleet.bak-20261123-pre74eee89kept.a1krzkp6…) → generation 9 (26b9fzx3…), activated 2026-11-24T03:45:34Z,/healthzok; generation 8 retained as flip-back.v6g0952x…) → generation 3 (26b9fzx3…), activated 2026-11-24T03:47:38Z. Flipped at a serving, non-refreshing moment with no live bws children (checked immediately before the deploy); generation 2 retained as flip-back.Live verification (measured post-flip, 2026-11-24)
bws secret list, full set): laptop broker refreshing 03:47:37.7Z → serving 03:47:38.7Z; sandbox broker refreshing 1795492635.60 → serving 1795492637.44 (1.84 s, 257 secrets); a third cold start bounded at ~2.5 s. Pre-S1: ~160–220 s.serving:truewhilerefreshing:trueand keeps serving the current set; 6 parallel gets fired at refresh start all returned rc=0 in 14–22 ms. During broker restart windows, gets took 11.7–15.1 s (12 measured, all rc=0) and one get issued into the broker-down gap exceeded a 30 s probe cap — bounded by S1's 120 s retry budget (10 s per attempt + the deliberate same-leg restart retry); that budget question is secrets client never-hang residuals: 120s unanswered-leg budget (decision) + unbounded fallback subprocess waits #14040 residual (a). Nothing hung unboundedly; the pre-S1 failure mode was an unbounded >120 s hang.Note: the served set grew 244 → 257 during the window from the 1Password→Bitwarden sync writes (separate lane), not from S1.
Deviations from the standard pattern
~/s1-measure/and the affected round was re-run. Round-1 statistics were extracted before the loss (503 gets across the laptop-broker flip: max 166 ms, none over 3 s).dezren39 commentedon Nov 24, 2026
Lane oc-code-05 claimed task 21646 (S3: set hash + peer status). Premise verdict: S2 (delta refresh + durable watermark) has NOT landed — PR #14054 is OPEN (head 11689eb, branch secrets-s2-delta-refresh), not merged; verified 2026-11-24T04:25Z via PR state read plus newest comments on this issue. No competing S3 PR found (only open #13948-linked PR is S2's #14054). Per the packet, no code was written and no worktree was created; parking S3 until an S2 merged record exists here. The protocol-home decision (open question 3) is deferred to the S3 build, which now waits on S2.
Part of #13948.