MC/docs/design/Q0-STARTER-REPAIR.md
2026-11-27 23:43:05 +00:00

6.3 KiB

Q0 starter kit and repair — ticket 406

The existing faction-kit mission S1-H-01 precedes S1-H-02 (Repair Your Starter Kit). The shared starter-kit-policy.mjs describes Q0 as 5,000 remaining durability basis points (50%). Q0 is a starter condition, not equipment mark zero or a new rarity. Existing faction blueprint equipment and item metadata remain the source; paid/historical snapshots are never rewritten.

The four version-one repair components each require quantity one:

Registered component Material/art Purpose
starter-repair-plate-v1 Iron ingot Protective plate repair
starter-binding-patch-v1 Leather, existing fabric artwork Fabric binding and sealing
starter-tool-fitting-v1 Copper ingot Equipment fittings
starter-calibration-piece-v1 Quartz Suit calibration

Both existing quest views read these same definitions. No new page, second kit designer, inventory database or replacement catalogue is created. Exchange retains its existing central current-kit catalogue bridge. These components are a registered recipe; this batch does not claim physical Minecraft item generation.

Evidence and reward flow

A trusted equipment producer records two ordinary QSM milestones through the existing key service: acquisition of the actual half-durability faction kit, then surrender of that exact kit instance with all four consumed parts. The source pins the linked Minecraft UUID, account, active season, faction at acquisition, original blueprint/version, validated immutable version-three equipment snapshot, event identity and timestamps. Replay cannot change the original source or grant another acquisition/repair for the account/season. Revoked or altered evidence is rejected. Browser sessions cannot assert inventory events.

Private protocol: authenticated GET /internal/equipment/starter-policy exposes the recipe; authenticated POST /internal/equipment/starter-event accepts the bounded typed acquired/repaired event. It uses the existing private game authority. No new Minecraft plugin, GUI or actual event producer is included. Authentication is not a substitute for the future producer actually committing its inventory operation. The source event must be emitted after that operation commits.

The progression collector reads the actual QSM dossiers. Missing game events remain visibly pending; it does not infer physical repair from XP, form fields or a browser assertion. Existing QST quest claims and their once-only jarvis_quest_reward_jobs outbox carry the one-kit reward. S01 progression policy revision two installs only the repair reward when the existing configuration is empty; a custom administrator reward is preserved and requires review. The policy itself grants no item or currency.

The existing central scheduler feeds validated reward jobs into the existing PostgreSQL dune_kit_deliveries table using the consumed QST key UUID as the immutable delivery ID. It reuses the private kit-delivery.json inventory connection, with one lazy pool and no additional timer/daemon. Existing paid-sale delivery code remains unchanged; a repair is never fabricated as a paid sale. The existing kit inventory consumer sees its supported intact version-three snapshot. The job stays delivery_queued until the durable inventory acknowledgement exists; only then is it delivered. Retry, lost acknowledgement, a conflicting recipient/snapshot or an outage cannot create another delivery or falsely mark the reward delivered.

XP-threshold completion may settle the existing XP objective and queue its reward, but no intact kit enters inventory without both physical evidence keys. A later valid repair can fulfill that same pending reward. This preserves the existing XP completion contract while avoiding invented surrender or duplicated equipment.

Verification boundaries

Fixtures exercise the actual key issuer, policy consumer, progression collector, QST claim and reward job, with an isolated shared-inventory adapter. They cover prerequisite order, half durability, all four parts, surrender and instance binding, current linked identity/faction/season, malicious snapshots, duplicate events/claims, native delivery mismatch, revoked proof, pending game events, XP-threshold bypass, configuration privacy, outages, replay and acknowledgement. No production acquisition, repair, player item or fake paid sale is generated for testing. Live publication must separately verify the ordinary policy receipt, source hashes, recipe routes and pending-source state. Physical Minecraft generation and surrender remain future game integration work.

Public catalogue hosting and inventory connection

The public Node host registers /api/kits/catalogue before the generic Worker routes. It reuses the same authenticated central catalogue bridge in process rather than calling an obsolete control-panel port. The bridge reads the native inventory catalogue and merges current website clan designs, preserves native purchase restrictions, sanitizes all output and shares a bounded public cache. Private service credentials never reach the response. Missing inventory data remains unavailable.

On 21 November the existing inventory SSH tunnel was found restarting because its dedicated key and trusted host entry had not migrated to the new webserver. A new private root-owned key was generated on that server; only its public key was added to the existing dune-inventory account, restricted to the new webserver address and the two existing loopback inventory/control ports. The host identity was checked against the previously trusted local host key and the remote host public key. Existing authorizations were retained. The existing service was restarted; no game/plugin code, inventory records or payments were changed. The private Postgres delivery table became reachable again.

The native catalogue also depended on an existing return tunnel to the migrated gameplay MySQL database. That tunnel was failing public-key authentication on the new host. Its existing public key was restored on the existing account with a source-address restriction, single loopback database port and forced no-command policy. Both pre-existing tunnels then stayed active; native authenticated catalogue reads returned HTTP 200 with two actual listings, and the shared Postgres delivery table was verified. No private key was transferred or printed.