Commit Graph
2 Commits
Author SHA1 Message Date
glm-5.3-flash 3a51bb43fc feat(store): the fleet GC protocol — the sweep lease, SQL arbitration, pin reaping, and the fleet liveness verb (wave 6)
Grow the sweep and delete paths into their fleet forms under fleet: true
(ADR-008 §2, ADR-010 §2, ADR-012 §1/§5/§6.6/§6.7, ADR-013 §2); the
non-fleet forms are byte-unchanged.

- the sweep lease: sweep() composes the in-process single-flight flag
  with the SQL lease (sweep_lock_acquire on the fleet host), both held
  for the whole sweep and released on every exit path; contention at
  either domain aborts as SweeperLock report data, nothing deleted;
  the pool-sizing composition enforced (max_size >= 2 at the fleet
  constructors' entry — the lease holds one checkout; the body's
  clauses ride further checkouts)
- SQL-level delete arbitration: arbitrated_delete composes the two
  domains (in-process first — cheap, local; the engine's arbitrate
  second — fleet-authoritative) on the direct path (GcRefuse) and the
  window execution's re-arbitration; a foreign instance's un-expired
  pin row or liveness-table row refuses cross-instance
- the maintenance step: EngineFleetState::pin_reap (the seam as the
  named clause home) reaps exactly the expired pin rows, one statement
  on the postgres host, contract-tested, driven under the lease before
  the overdue execution
- the fleet liveness verb: register_liveness_source takes the
  fleet-shaped LivenessRegistration argument (ADR-012 §6.6's same-verb
  wording) — the named-table form registers the embedder's own table
  (schema-ownership rule holds; idempotent; deregistration composes
  via a new engine-side unregister), the in-process form stays legal
  (instance-local protection, documented); Registration carries its
  kind; the verb is fallible (the fleet form's error surface)
- the protect callback's fleet posture recorded: single-node-only,
  instance-local consult remains, materialization is the embedder's
  duty — no new machinery
- the fleet sweep body: protect consult → reap → execute overdue
  (two-domain re-arbitration, fall-through delete across both tiers)
  → mark (pool + in-process sources; SQL liveness consulted at
  arbitration time, never enumerated) → stage → release; counts exact
  relative to the schedule
- tests: lease contention/reaping between two instances, the
  foreign-row GcRefuse, the exact-set reap, the embedder-table
  protection + correction flow + malformed and fleet:false
  rejections, the two-instance exact-count shape, and the delay race
  in its fleet form; the wave-6 inert-machinery construction test
  rewritten to the now-live fleet semantics

Verification: cargo test (default) green; cargo test --features
postgres green server-less (skipping) and against pglo-poc :15432;
cargo test --all-features green; cargo clippy --all-targets -D
warnings green (default, postgres, all-features); cargo fmt --check
green; cargo doc --no-deps clean (postgres-feature warnings
unchanged at the pre-existing 21).
2026-10-12 16:54:21 +00:00
glm-5.3-flash 009de420e1 docs(tasks): decompose wave 6 — the fleet GC mechanism, the architecture's most intricate state machine under concurrency
- store-fleet-construction: the fleet: true declaration slotting into
  the fleet-capable constructors (the recorded non-event), the
  composite fleet-validity predicate enforced at the constructor
  (kv=postgres AND pg-lo-same-instance OR local-on-declared-shared-
  media OR kv-only re-routing), the TTL/owner-id fleet state, the
  same-instance probe design point
- engine-pg-lo-joint: the pg-lo joint contribution — staged-put
  mechanics (512 KiB knee, CAS, transactional LO creation) into the
  store-held PgJointTx, the wave-5 deferred API-shape design point
- store-fleet-put: the joint entry+pin tx driver (amendment A1's
  drop discipline lands here — its recorded owner), the pin guard's
  TTL/3 renewal form, the dedup upsert-renewal, pin-first/
  publish-second for large=local, the consolidation one-tx put
- store-fleet-sweep: the SQL sweep lease (ADR-013 §2 semantics),
  SQL-level delete arbitration on the direct + window-execution
  paths, the expired-pin reaping clause (the seam as the named home
  for fleet-clause growth), the fleet liveness registration verb,
  the two-domain arbitration composition
- suite-column-fleet: the fleet column — two-instance factories over
  one schema, the exact-count fleet sweep rows (the wave's gate),
  lease contention, cross-instance arbitration, TTL/renewal rows,
  the fleet-validity predicate rows
- review-wave-6: the fleet gate per the plan, plus a standing
  code-smell/hygiene block — cargo doc --no-deps asserted clean
  (the twice-bitten PGLO-1 rustdoc private-link class), the
  allow(dead_code) scope notes audited against their remainder,
  stale wave-6 forward references, and task-Summary-vs-diff
  correctness

Harness server cited in every server-touching task: dockerized
pglo-poc (postgres:16-alpine) on :15432, db blobs, postgres/poc
(verified live 2026-10-12); env-driven ALKBLOBS_PG_* settings, clean
server-less skips, acceptance requires green against the server.

Dependency graph validated: two parallel roots (construction, pg-lo
joint), put merging them, sweep parallel to put, the fleet column
merging, the review gate last; no cycles.
2026-10-12 14:22:55 +00:00