Skip to content

Add Gate outcome report ledgers for living roster consequence #137

@JOY

Description

@JOY

Summary

Connect AI NPC memory, relationships, body death/failure state, and outcome consequences to the Garden -> Gate -> Return loop.

Source Docs

  • docs/design/64-gate-outcome-report-and-memory-flow-design.md
  • docs/design/102-alpha-body-death-and-failed-attempt-flow.md
  • docs/design/105-alpha-garden-return-state-and-consequence-staging.md
  • docs/design/81-alpha-gameplay-ledger-event-taxonomy.md
  • docs/design/103-alpha-second-earn-spend-pacing-and-economy-beats.md
  • docs/design/25-core-loop-v1.md
  • docs/design/37-ai-npc-backend-client-roadmap.md
  • docs/design/23-gameplay-ledger-technical-design.md
  • docs/playtests/_templates/gate-outcome-report/README.md
  • docs/playtests/_templates/reward-ledger-authority/README.md

Scope

  • Store mission entrants, objective result, SECOND gained, TIME spent or lost, injuries, deaths, failed attempt state, memory deltas, and relationship deltas.
  • Apply outcome report effects through server-owned ledgers only.
  • Feed outcome summaries into memory consolidation and future NPC dialogue.
  • Support body death and failed attempt event chains without treating death as respawn.
  • Feed server-owned outcome state into Garden visible-memory staging after the report.
  • Map every visible outcome report row to a server-owned source row, or label it debug-simulated, not implemented, or hidden by cut.
  • Keep LLM output limited to commentary or intent, never reward mutation.

Minimum Ledger Proof

  • attempt_id, body_id, and mission_id are present.
  • One accepted outcome row or one clear denial row exists.
  • Attempt, proof, extraction, outcome, and Garden return staging transitions are accepted only in valid order or labeled debug-simulated.
  • Repeating the same outcome write does not create a second reward or report.
  • Reward is granted or denied by server-owned event state.
  • Death before proof does not grant a normal reward.
  • Balance before, delta, and balance after reconcile when SECOND changes.
  • Visible outcome rows do not show reward, memory, relationship, temporary loot, or Garden consequence before source events exist.
  • Memory and relationship refs are bounded server-validated proposals or labeled debug-simulated.
  • Unauthorized client writes, client-supplied amounts, stale attempt ids, and debug-only mutations are rejected or clearly labeled.
  • LLM output cannot mutate reward, memory, relationship, TIME, or body condition.

Acceptance Criteria

  • A prototype Gate outcome can create an auditable ledger record.
  • Outcome records can generate bounded memory and relationship delta proposals that Nakama validates.
  • Outcome state transitions reject stale, repeated, unauthorized, or out-of-order requests.
  • Unity can show a basic outcome report with reward, cost, injury, memory, relationship, failed attempt, and body death sections.
  • Outcome UI rows map to server-owned payload rows or honest missing/debug labels.
  • Garden return staging can display the correct visible slot after outcome state exists.
  • Tests cover accepted outcome writes, duplicate outcome rejection, unauthorized client mutation rejection, no reward after death-before-proof, stale attempt rejection, client amount rejection, and report-row mapping.

Evidence Closeout

Use docs/playtests/_templates/gate-outcome-report/ and include:

  • outcome-payload-note.md
  • outcome-state-transition-note.md
  • reward-time-note.md
  • body-condition-note.md
  • memory-relationship-note.md
  • ledger-authority-note.md
  • report-row-mapping-note.md
  • mutation-guard-note.md
  • ui-readability-note.md
  • garden-return-staging-note.md
  • console-summary.md
  • known-gaps.md

Use docs/playtests/_templates/reward-ledger-authority/ when SECOND reward/spend mutation is tested in the same PR.

Cut Line

If the full outcome stack is too large, keep one attempt id, one accepted or denied outcome row, one visible report, one valid state-transition path, one duplicate guard, one mutation guard, one report-row mapping note, and one death-before-proof reward denial. Defer full relationship simulation, final injury balance, rich NPC reaction writing, and final economy tuning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ai-agentOffline player agent, NPC intelligence, and agent observabilityarea:economyBodyTime, SECOND token, rewards, sinks, and loot economyarea:nakamaNakama runtime, storage, auth, social, or backend modulesenhancementNew feature or requestpriority:p1High priority for current milestonesize:lLarge task

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions