feat: add pinned inventory location enrichment

This commit is contained in:
jb
2026-09-20 12:13:51 -04:00
parent fe7d218195
commit 0c9197f841
32 changed files with 3116 additions and 55 deletions
+23 -15
View File
@@ -8,17 +8,17 @@
**Planning baseline:** `fdcc486` (`Initial Commit`). The roadmap records an earlier 97-test gate; each prototype change reruns the current local suite. Existing `jobs`, `userPreferences` and `referenceSyncMetadata` tables are placeholders, not services.
**T06/T07 evidence:** The centralized ESI client has fixed typed asset, asset-name,
asset-location, wallet-balance, and market-read strategies with bounded response
bytes/rows/pages, bounded retries, abort-first cleanup, validators, canonical int64
helper bodies, complete scoped authority-context cache identity, cooldown queries,
and runtime schemas. T07 durable scheduling/worker orchestration is implemented as
a local prototype: the current full suite records 204 passing tests, including the
bundled dedicated worker, durable leases, fencing, cancellation/recovery, refresh
coordination and restricted startup. T08 location/service orchestration and T13
wallet persistence/UI/service orchestration remain pending; T07/T08 integration is
not complete and production-readiness gates remain deferred. No deployed/live ESI
claim is made here. The narrow `beginSync` expected-authority fence is part of T06's
**T06/T07/T08 evidence:** The centralized ESI client has fixed typed asset,
asset-name, asset-location, wallet-balance, and market-read strategies with bounded
response bytes/rows/pages, bounded retries, abort-first cleanup, validators,
canonical int64 helper bodies, complete scoped authority-context cache identity,
cooldown queries, and runtime schemas. T07 durable scheduling/worker orchestration
and T08 location/containment enrichment are implemented as local prototypes. The
combined suite currently records 254 passing tests; that count includes parallel-core
T09/T13 tests and is not a T08-only count. T08 is implemented and undeployed;
production/live ESI/live Convex-capacity evidence remains deferred. T09 inventory
projection/query and T13 wallet work remain separate roadmap tasks with no
completion claim here. The narrow `beginSync` expected-authority fence is part of T06's
atomic bridge contract: it prevents transport cache authority from being published
under a different T05 grant/revision/credential fence; it is not T07 durable worker
orchestration.
@@ -147,20 +147,26 @@ Implement the prototype identity enforcement needed by the pipeline: revalidate
**Deliver:** enqueue/status instead of long-running request work; typed deduplicated jobs, bounded attempts/due times, cancellation, fair scheduling/backpressure, shared cooldown/error budgets, renewable leases and fenced success **and failure** publication. Stage/validate assets before active-generation publication and retain validated `isSingleton` facts throughout ingestion.
Share a per-character refresh lease across web and workers, retaining token CAS. At-least-once delivery is not exactly-once remote refresh: an uncertain rotated result produces actionable reauthorization instead of automatic replay. Keep reference extraction separate and minimize worker secrets. Public feeds must be coordinated rather than independently refreshed per process. The worker requires the distinct `CONVEX_SYNC_WORKER_SECRET`; standalone startup uses a worker-only environment and Compose startup uses the explicit `worker` profile.
Share a per-character refresh lease across web and workers, retaining token CAS. At-least-once delivery is not exactly-once remote refresh: an uncertain rotated result produces actionable reauthorization instead of automatic replay. Keep reference extraction separate and minimize worker secrets. Public feeds must be coordinated rather than independently refreshed per process. The worker requires the distinct `CONVEX_SYNC_WORKER_SECRET`; standalone startup uses a worker-only environment and Compose startup uses the explicit `worker` profile. T08 adds only `REFERENCE_DIR` and a read-only reference-data volume to this environment; the worker opens an immutable artifact reader and has no import/write credentials.
**Verified locally:** process kill/restart, long paging beyond the old five-minute lease, duplicate delivery, cancellation, scope loss, stale-worker completion/failure, refresh races, uncertain rotation, restricted runtime startup and configuration boundaries. The full suite currently records 204 passing tests. T08 enrichment integration at the post-assets/pre-publication seam remains pending; production migration/release evidence remains deferred.
**Verified locally:** process kill/restart, long paging beyond the old five-minute lease, duplicate delivery, cancellation, scope loss, stale-worker completion/failure, refresh races, uncertain rotation, restricted runtime startup and configuration boundaries. T08 enrichment is staged and atomically published at the post-assets/pre-publication seam; production migration/release evidence remains deferred.
### T08 — Private locations, custom names and containment
**Own:** proposed location/containment modules, feature-local authorization-context caches and tests. Consume T03 readers/T06 adapters; no second reference compiler or transport.
**Status:** implemented local prototype; undeployed. No live ESI, live Convex-capacity, production-reference, or production-readiness claim.
**Checkpoint manifest:** see [the exact T08 manifest in the verification record](verification.md#exact-t08-checkpoint-manifest). T09 projection/query files/tests/fixtures and T13 wallet files/tests/fixtures are explicitly excluded.
**Own:** location/containment modules, feature-local authorization-context caches, typed ESI structure adapter, incremental consent wiring, generation enrichment persistence and tests. Consume T03 readers; the shared ESI adapter is extended only with the fixed structure operation.
**Deliver:** parent/item relationships, fitted flags, breadcrumb inputs and unresolved reasons. Resolve NPC stations from reference facts and private structures/custom names only under valid character scope/evidence. Integrate bounded enrichment with dataset freshness and revision invalidation; enrichment failures must remain explicit and cannot authorize or fabricate a complete location result.
**Done:** nested/fitted items, identical names, cycles, missing parents, stale/forbidden structures and large IDs pass tests. No numeric-ID guessing, hull/contents multiplier or cross-character private-name leakage. Provide versioned/pinned enrichment inputs for T09, not mutable names that silently change a cursor's filter results.
**Done locally:** nested/fitted items, identical names, cycles, missing parents, stale/forbidden structures, large IDs, multi-batch helper observations and 50k bounded chains pass synthetic tests. The worker stages private rows against the exact asset generation and authority/reference pin, publishes partial coverage honestly, and exposes generation-matching manifest/chunk reads. Public/private source facts are pinned and validated against persisted rows; oversized optional enrichment falls back before staging. No numeric-ID guessing, hull/contents multiplier, docking inference or cross-character private-name leakage. T09 receives versioned/pinned enrichment inputs rather than mutable names. The limits are conservative prototype bounds, not measured live Convex capacity.
### T09 — Inventory projections and query service
**Status:** separate accepted core task; not claimed complete by this T08 checkpoint. Its projection/query files, tests and fixture are excluded from the T08 manifest.
**Own:** generation-bound indexed inventory rows, inventory query service/repository and dedicated query tests; additive schema/store changes coordinated with T13.
**Deliver:** staged projections published with validated generations; validated filters for character/type/custom name/category/group/quantity/location/system/region/pricing/BPC state; stable sorting and server-side paging. Pin selected input generations, location enrichment, reference/price versions and authorization revisions. Reuse or extend `AssetService` authorization/valuation rather than cloning it.
@@ -199,6 +205,8 @@ Compute selected summaries across **all matching rows**, not the visible page, w
### T13 — Wallet balance vertical slice
**Status:** separate accepted task; not claimed complete by this T08 checkpoint. All wallet files, tests and fixtures are excluded from the T08 manifest.
**Own:** new wallet domain/service/ESI-adapter orchestration, balance snapshot storage, wallet job handler, compact finance component/route and tests. Central schema/capability/application/assistant registrations land serially with other feature tasks.
**Deliver:** opt-in balance capability using T05 consent/T07 jobs, exact signed cents from T04 and independently timestamped balance coverage. Ship a deterministic balance service, conventional UI and typed assistant/manual query adapter. Keep the wallet amount a **separately labelled component**, not a combined wealth total.