web/docs/design/DUNEREALM-ITEM-CODEX.md

153 lines
9.4 KiB
Markdown

# J.A.R.V.I.S. — design agreement
Renamed J.A.R.V.I.S. on 17 November 2026. Existing technical identifiers,
database names and links remain compatible; the previous system name was Codex.
Status: design implementation and CI publication authorised. New J.A.R.V.I.S. backend
operations remain placeholders until design approval.
The J.A.R.V.I.S. is the shared repository for item/kit definitions,
keys, entitlements, deeds and Writs. The existing key generator becomes its
Keys & Entitlements module; Chancery handles Writ records and lifecycle.
Dedicated typed tables and validated metadata, rather than one unstructured
Writ table for everything. Existing bank, mail, clan and election services
remain authoritative for their operations.
Exchange reads existing cargo listings and eligible public J.A.R.V.I.S. records into
one shared card model. Categories and sorting make items, jobs, quests, events,
political positions and companies/deeds easy to find. Jobs may be clan,
company or faction recruitment. Private diplomacy is displayed through its own
inbox, not public listings. Mail provides notifications. New behaviour still
requires a handler; metadata alone cannot enforce objectives or authority.
GUI proposal: compact starport heading; left category/filter column; prominent
search; sort and grid/list controls; one card grid; My listings and Create
listing actions; compact icon/explanation guide below the results. No separate
illustrated Cargo/Company tabs, no repeated explanatory paragraphs on cards.
Minecraft goods use actual item icons/renders. Existing deed/key artwork is
reused. Five new scroll icons are recorded in EXCHANGE-ICON-SET-v1.json.
Full visual proposal: exchange-gui-concept-v1.png.
Recruitment: Basic/Keyed/Royal proposed member caps 5/25/50. Vacancies cannot
exceed actual remaining capacity. Basic recruitment is free (up to four open
places when owner is the only member); other clans pay per advertised place
from their organisational account. Apply creates a join request; accept or deny
notifies the applicant through internal mail. Acceptance adds membership and
closes that vacancy; denial leaves it available. Recheck capacity and eligibility
on acceptance. Existing pending requests remain reviewable.
Optional Discord promotion proposal: a poster can opt into a separately priced
Exchange News announcement. Administrators configure the fee, rather than the
poster choosing their own price. Only public active listings qualify. Confirm
payment, queue through the existing Discord delivery system, prevent duplicate
posts and duplicate charges, retry delivery failures, and release/refund the
promotion fee on permanent failure. No automatic announcement for every listing.
Workflow: agree on the images and interactions here, then implement the page
and its backend together in a focused CI-reviewed change. Initial integration
order: shared typed J.A.R.V.I.S./key metadata, Exchange adapter, clan recruitment flow;
reuse the same foundation for later companies, factions, quests and politics.
## Design batch: J.A.R.V.I.S. Management and lifecycle contracts
Status: design implementation authorised. Backend operations stay disabled until approved.
Imperial Bureau > Management > J.A.R.V.I.S. Management replaces the separate Item
Management, Kit Management, Kit Publishing, Kit Claims and Exchange Management
navigation entries. Legacy links resolve to the corresponding consolidated tab.
Keep shop administration, honours/seal design, banks and personal reward registers.
Reuse existing access nodes for visibility; backend department authority and Big 4.1
checks must be resolved server-side before any operation is enabled.
Tabs: Keys & deeds, Issuance, Items & definitions, Kits, Publication, Delivery,
Listings, History and Seasons. No pretend successful writes or live balances.
### Proposed API contract (not implemented endpoints)
- GET /api/codex/definitions?type=&query=&cursor= : public/authorised definitions.
- GET /api/codex/instances?scope=owned|organisation|subclans&state=&cursor= :
only authorised records, masked private codes, explicit pagination.
- POST /api/codex/staff/issuances : definitionId, recipient, decisionRef, reason,
optional expiresAt, idempotency key; server chooses environment, season,
key version, instanceId and issuer. Staff issue proof is server-signed.
- POST /api/codex/instances/:id/replace : reason, decisionRef, idempotency key;
invalidate unused predecessor atomically, retain provenance and entitlement.
- POST /api/codex/instances/:id/revoke : authorisation and immutable audit reason.
- POST /api/codex/instances/:id/use : signed proof, action and idempotency key;
atomic compare-and-consume, authority checks and effect in one transaction or
durable idempotent handler. A copied game item is not a second entitlement.
- POST /api/codex/instances/:id/transfer : recipient, expected revision and
idempotency key; verify ownership, transferability and unused state atomically.
- GET /api/codex/deliveries?state=&cursor= and POST /:id/retry : delivery ledger,
safe retry with the original delivery identity, not minting a new item.
- GET /api/codex/history?instanceId=&cursor= : authorised, secret-free audit view.
- GET /api/codex/seasons and POST /api/codex/staff/signing-keys/rotate : privileged
configuration only. Never return secret signing/encryption material to browsers.
Standard results: data plus nextCursor; errors carry code/message/requestId.
401 unauthenticated, 403 unauthorised, 409 already-used/revision-conflict,
422 invalid input, 503 dependency unavailable. No new endpoints are called by
this design commit.
### Instance identity, seasons and natural rarity
Each instance has immutable instanceId, definitionId, issuedSeasonId, issuedAt,
environmentId, optional testRunId, provenance (original/staff/replacement),
signingKeyId, issuer, decisionRef, state and revision. Secret redemption material
is separate from public display fields and never a substitute for authority.
Rotate the active signing key for a new season or isolated test. Retain prior
verification keys and ledger records: unused S1 keys and items can remain valid
and tradable in S2 when their type permits. Deeds carry over. Historical S1
items (such as a sword) retain S1 origin; rarity emerges from actual remaining
instances, not invented scarcity totals. Rotation alone does not revoke items.
Tests use a separate namespace/ledger and cannot redeem into production.
Signing ensures authenticity; encryption, if used for private secrets, has a
separate versioned encryption key and rotation/migration policy.
Validate on use/redemption/transfer, without recurring inventory scans. Staff
proof does not bypass duplicate protection. Copying metadata copies the same
instance ID and cannot produce another successful consumption or delivery.
Original key redemption can replace a staff seal on the deed without duplicating
rights; preserve both events in history. Replacement retains original provenance.
### Clan presentation and entitlement policy
Dashboard tabs: Overview, People, Household, Activity. Settings tabs include Keys:
unused owner/member upgrade keys plus subclans, masked until server-authorised
access. A borrowed/traded key follows its type's transfer rules; a UI list never
confers ownership. Basic/Keyed/Royal limits 5/25/50 derive from the deed.
Basic receives four recruitment vacancies subject to actual free slots, and five
shared promotion credits: one per Board post and one per Discord post. Both cost
two. Credits may be earned from quests. Upgrades remove the Basic token limit;
other promotions use configurable fees. Credits never bypass membership/authority.
### Immutable edition metadata
Issued instances include issuedSeasonId, releaseStage (alpha/beta/live) and
releaseVersion (server release identity, initially Alpha 1.0.1.0), plus issuedAt.
These are server-assigned and immutable: staff cannot backdate/regenerate an S1
original. Regeneration creates a distinct current-stage/current-version instance
and may reference the historical template. An exact lost-key replacement retains
entitlement/provenance lineage but is explicitly a replacement, not a second
historical collectible. Never increase historical original issuance counts.
Display origin in item detail and filters when the backend supplies it; do not
label unversioned legacy Minecraft listings as Alpha originals. Actual scarcity
counts require the authoritative instance ledger.
Quality reuses existing Common / Uncommon / Rare / Very Rare / Legendary tiers.
Quality is independent of immutable edition, season and actual surviving count.
A Rare Netherite Shovel from an older Alpha release remains that edition; no
promise of resale value or artificial rarity count is made.
Issuer provenance also stores the issuing citizen and, where applicable, verified
political deed/office and term references. A royal key issued by the first Emperor
can retain that factual provenance without granting a second political entitlement.
### Persistent versus consumable items
Declare lifecycle as consumable, entitlement or persistent. Consuming a key is
atomic and single-use. A persistent sword/shovel is not consumed on every swing:
its uses validate the unique active custody/binding and current instance revision.
The game bridge must enforce one active physical binding per persistent instance
and reject conflicting copies on relevant use/transfer events. An ID or signature
alone cannot distinguish bit-identical copies held by the same player; custody
enforcement is required, without claiming inventory-wide periodic scans.