{
  "schema_version": 1,
  "project": {
    "id": "ocean-mmo",
    "name": "Aftertide",
    "version": "0.0.0",
    "status": "Planned",
    "game_runtime": "not_implemented",
    "language": "en",
    "additional_languages": "planned",
    "hostname": "aftertide.gatehouse.nu"
  },
  "source": {
    "commit": "59a96e84f0c679a223bcc768b46c25e763f97c11",
    "dirty": false
  },
  "architecture": {
    "schema_version": 1,
    "project_id": "ocean-mmo",
    "title": "Aftertide architecture",
    "decisions": [
      "D-013",
      "D-033",
      "D-034",
      "D-035",
      "D-036",
      "D-039",
      "D-041"
    ],
    "modules": [
      {
        "id": "portal",
        "name": "Web portal",
        "layer": "interface",
        "status": "website",
        "x": 30,
        "y": 22,
        "w": 240,
        "h": 78,
        "description": "The public home of Aftertide: the world, architecture, API catalogue and development status.",
        "responsibility": "Presents curated Git information. Sign-in opens Gatehouse. It does not run the simulation or grant player authority.",
        "inputs": [
          "Curated architecture and API catalogues",
          "PROJECT.md metadata and exact source commit"
        ],
        "outputs": [
          "Public documentation",
          "Gatehouse sign-in handoff"
        ],
        "decisions": [
          "D-037",
          "D-038",
          "D-040",
          "D-041"
        ]
      },
      {
        "id": "identity",
        "name": "Identity & authority",
        "layer": "application",
        "status": "planned",
        "x": 660,
        "y": 22,
        "w": 260,
        "h": 78,
        "description": "Separates a verified account from the right to act as a character or organisation.",
        "responsibility": "Gatehouse authentication remains conditional. Game roles, work assignments and vessel mandates are checked by the game server.",
        "inputs": [
          "Verified issuer and subject",
          "Current character and mandate revisions"
        ],
        "outputs": [
          "Scoped allow/deny evidence"
        ],
        "decisions": [
          "D-020",
          "D-035"
        ]
      },
      {
        "id": "commands",
        "name": "Command boundary",
        "layer": "application",
        "status": "planned",
        "x": 30,
        "y": 157,
        "w": 240,
        "h": 78,
        "description": "Receives an intention and returns a durable receipt, rather than claiming the work is already done.",
        "responsibility": "Normalises input, checks identity and revisions, and applies the same rules to player and NPC orders.",
        "inputs": [
          "Versioned commands",
          "Idempotency key",
          "Expected revision"
        ],
        "outputs": [
          "Admission receipt",
          "Typed rejection"
        ],
        "decisions": [
          "D-029",
          "D-034"
        ]
      },
      {
        "id": "clock",
        "name": "World / tick / resolver",
        "layer": "domain",
        "status": "planned",
        "x": 350,
        "y": 157,
        "w": 260,
        "h": 78,
        "description": "Turns frozen input into an ordered, reproducible plan and commits complete effect groups.",
        "responsibility": "One authoritative writer per world/tick. Named random draws, durable ownership and recovery checkpoints.",
        "inputs": [
          "Frozen world and order revisions",
          "Rules, seed and observations"
        ],
        "outputs": [
          "Sealed effect plan",
          "Atomic group commits",
          "Complete tick revision"
        ],
        "decisions": [
          "D-033",
          "D-034",
          "D-035",
          "D-036",
          "D-039",
          "D-042"
        ]
      },
      {
        "id": "orders",
        "name": "Orders & reservations",
        "layer": "domain",
        "status": "planned",
        "x": 660,
        "y": 157,
        "w": 260,
        "h": 78,
        "description": "Keeps admission, allocation, binding reservations and actual completion distinct.",
        "responsibility": "R2 resolves competing claims. R1 represents a real binding hold backed by available resources.",
        "inputs": [
          "Admitted orders",
          "Rights, policies and resource availability"
        ],
        "outputs": [
          "Allocation decisions",
          "Holds and lifecycle outcomes"
        ],
        "decisions": [
          "D-010",
          "D-024",
          "D-043"
        ]
      },
      {
        "id": "activities",
        "name": "Work, salvage & voyages",
        "layer": "domain",
        "status": "planned",
        "x": 30,
        "y": 305,
        "w": 270,
        "h": 78,
        "description": "Two independent careers in a physical ocean world: salvage and technical work.",
        "responsibility": "Domain modules propose legitimate work, cargo, travel and maintenance effects through shared contracts.",
        "inputs": [
          "Assignments and equipment",
          "Finite sites, vessels, fuel and crew"
        ],
        "outputs": [
          "Typed domain outcomes"
        ],
        "decisions": [
          "D-006",
          "D-008",
          "D-013"
        ]
      },
      {
        "id": "ledger",
        "name": "Property & resource ledger",
        "layer": "domain",
        "status": "planned",
        "x": 350,
        "y": 305,
        "w": 260,
        "h": 78,
        "description": "Tracks real money, materials, custody and labour without duplicating them on retry.",
        "responsibility": "Separates legal ownership, physical location and operating authority. Economic groups commit together.",
        "inputs": [
          "Legitimate effect group",
          "Resource and authority revisions"
        ],
        "outputs": [
          "Balanced ledger entries",
          "Unique material location",
          "Stable effect receipt"
        ],
        "decisions": [
          "D-004",
          "D-011",
          "D-025",
          "D-036"
        ]
      },
      {
        "id": "npc",
        "name": "NPC organisations",
        "layer": "domain",
        "status": "planned",
        "x": 660,
        "y": 305,
        "w": 260,
        "h": 78,
        "description": "Bounded autonomous groups act with their own resources and incomplete knowledge.",
        "responsibility": "Produces orders through the same command and resource gates as players. No privileged money or future knowledge.",
        "inputs": [
          "Known observations",
          "Goals, budget and institutional memory"
        ],
        "outputs": [
          "Proposed orders",
          "Typed observations"
        ],
        "decisions": [
          "D-012",
          "D-026",
          "D-027",
          "D-028"
        ]
      },
      {
        "id": "database",
        "name": "PostgreSQL authority",
        "layer": "storage",
        "status": "planned",
        "x": 350,
        "y": 460,
        "w": 260,
        "h": 78,
        "description": "The future transactional source of truth, with state, ledgers, receipts, audit and outbox.",
        "responsibility": "Keeps each effect group atomic. Snapshots and outbox complement, rather than replace, recovery and backup.",
        "inputs": [
          "Short fenced transactions"
        ],
        "outputs": [
          "Durable state and evidence"
        ],
        "decisions": [
          "D-019",
          "D-025",
          "D-035",
          "D-036"
        ]
      },
      {
        "id": "reads",
        "name": "Published views & events",
        "layer": "application",
        "status": "planned",
        "x": 30,
        "y": 460,
        "w": 270,
        "h": 78,
        "description": "Shows a complete published world revision while the next tick may still be applying.",
        "responsibility": "Returns authorised views, ETags and durable event cursors. A notification never creates an economic effect.",
        "inputs": [
          "Complete committed tick",
          "Current access checks"
        ],
        "outputs": [
          "Versioned read models",
          "Authorised event feed"
        ],
        "decisions": [
          "D-029",
          "D-033"
        ]
      }
    ],
    "edges": [
      [
        "portal",
        "commands"
      ],
      [
        "portal",
        "reads"
      ],
      [
        "identity",
        "commands"
      ],
      [
        "commands",
        "clock"
      ],
      [
        "orders",
        "clock"
      ],
      [
        "npc",
        "orders"
      ],
      [
        "activities",
        "clock"
      ],
      [
        "clock",
        "ledger"
      ],
      [
        "ledger",
        "database"
      ],
      [
        "database",
        "reads"
      ]
    ],
    "tick": [
      {
        "id": "open",
        "name": "Accept orders",
        "text": "A protected admission check must pass before the published deadline. Acceptance is not completion."
      },
      {
        "id": "freeze",
        "name": "Freeze input",
        "text": "Preserve the exact order revisions, world input, rules and seed. Late changes do not rewrite history."
      },
      {
        "id": "plan",
        "name": "Resolve & plan",
        "text": "Validate rights, allocate resources and produce a reproducible, sealed effect plan."
      },
      {
        "id": "apply",
        "name": "Commit effect groups",
        "text": "One writer records each complete group with ledger, receipt, audit/outbox and progress."
      },
      {
        "id": "publish",
        "name": "Publish complete result",
        "text": "Activate a complete read revision before its events can be delivered."
      }
    ],
    "tick_note": "These stages explain the RC-01 evidence baseline. The future game engine and its runtime verification do not exist yet."
  },
  "api": {
    "schema_version": 1,
    "project_id": "ocean-mmo",
    "description": "Website routes and proposed MMO contracts. A listed game route is not a deployed endpoint.",
    "entries": [
      {
        "id": "web.home",
        "method": "GET",
        "path": "/",
        "module": "Web portal",
        "status": "website",
        "summary": "Open the Aftertide public portal.",
        "auth": "Public",
        "detail": "World overview, architecture, API catalogue and development status."
      },
      {
        "id": "web.login",
        "method": "GET",
        "path": "/login",
        "module": "Web portal",
        "status": "website",
        "summary": "Continue to Gatehouse sign-in.",
        "auth": "Gatehouse owns authentication",
        "detail": "Redirects to the existing Gatehouse login. This first portal does not establish an Aftertide session or grant game access."
      },
      {
        "id": "web.health",
        "method": "GET",
        "path": "/healthz",
        "module": "Web portal",
        "status": "website",
        "summary": "Read the portal health and source identity.",
        "auth": "Public",
        "detail": "Reports only the information website. It is not evidence that a game server or database is running."
      },
      {
        "id": "web.catalogue",
        "method": "GET",
        "path": "/data.json",
        "module": "Web portal",
        "status": "website",
        "summary": "Read the public documentation catalogue.",
        "auth": "Public",
        "detail": "Curated public architecture, API entries and build provenance generated from Git. No private repository files are served."
      },
      {
        "id": "identity.me",
        "method": "GET",
        "path": "/v1/me",
        "module": "Identity",
        "status": "proposed",
        "summary": "Read the verified player's game identity.",
        "auth": "Authenticated, scoped to the current principal",
        "detail": "Account identity, selected character and scoped capabilities. Gatehouse authentication does not automatically grant a game mandate."
      },
      {
        "id": "world.summary",
        "method": "GET",
        "path": "/v1/worlds/{world_id}",
        "module": "World",
        "status": "proposed",
        "summary": "Read a complete published world summary.",
        "auth": "Visibility and current access checks",
        "detail": "Includes published revision and logical tick. Partial current state is not a public world result."
      },
      {
        "id": "orders.create",
        "method": "POST",
        "path": "/v1/worlds/{world_id}/orders",
        "module": "Orders",
        "status": "proposed",
        "summary": "Submit a versioned game intention.",
        "auth": "Verified principal and domain mandate",
        "detail": "Requires an idempotency key and expected relevant revision. Returns admission or typed rejection; never a premature paid/completed result."
      },
      {
        "id": "orders.read",
        "method": "GET",
        "path": "/v1/worlds/{world_id}/orders/{order_id}",
        "module": "Orders",
        "status": "proposed",
        "summary": "Read an authorised order receipt and status.",
        "auth": "Order visibility and current access",
        "detail": "Distinguishes accepted, allocated, in progress and actually completed. Names and exact wire schema remain design work."
      },
      {
        "id": "orders.cancel",
        "method": "POST",
        "path": "/v1/worlds/{world_id}/orders/{order_id}/cancel",
        "module": "Orders",
        "status": "proposed",
        "summary": "Request a permitted order cancellation.",
        "auth": "Domain authority, revision and cutoff checks",
        "detail": "A cancellation cannot rewrite a frozen plan or undo an already committed effect. Binding-contract cancellation follows its own rules."
      },
      {
        "id": "jobs.list",
        "method": "GET",
        "path": "/v1/worlds/{world_id}/jobs",
        "module": "Work",
        "status": "proposed",
        "summary": "Discover known and visible work opportunities.",
        "auth": "Visibility filtering",
        "detail": "Supports independent salvage and technical careers. A job listing does not guarantee resources or payment."
      },
      {
        "id": "inventory.read",
        "method": "GET",
        "path": "/v1/worlds/{world_id}/inventory",
        "module": "Property",
        "status": "proposed",
        "summary": "Read inventory the principal may inspect.",
        "auth": "Owner, custodian or explicit visibility scope",
        "detail": "Distinguishes title, physical location, reservations and installed items."
      },
      {
        "id": "ledger.read",
        "method": "GET",
        "path": "/v1/worlds/{world_id}/ledger",
        "module": "Property",
        "status": "proposed",
        "summary": "Read authorised economic receipts.",
        "auth": "Account and organisation visibility",
        "detail": "Returns stable cause/effect references and a published view. It does not expose another actor's private balances."
      },
      {
        "id": "vessels.read",
        "method": "GET",
        "path": "/v1/worlds/{world_id}/vessels/{vessel_id}",
        "module": "Voyages",
        "status": "proposed",
        "summary": "Read a visible vessel and voyage state.",
        "auth": "Visibility and vessel mandate",
        "detail": "Separates estimated arrival from actual arrival, and an employee's assignment from ownership."
      },
      {
        "id": "sites.read",
        "method": "GET",
        "path": "/v1/worlds/{world_id}/sites/{site_id}",
        "module": "Salvage",
        "status": "proposed",
        "summary": "Read known survey and recovery information.",
        "auth": "Knowledge and access scope",
        "detail": "Observations may be incomplete. A visible finding is not automatically recoverable or owned by the viewer."
      },
      {
        "id": "events.read",
        "method": "GET",
        "path": "/v1/worlds/{world_id}/events",
        "module": "Events",
        "status": "proposed",
        "summary": "Resume an authorised event stream with a durable cursor.",
        "auth": "Current visibility; cursor is not an authority token",
        "detail": "HTTP polling first. A private event or a duplicate notification never becomes a second world effect."
      }
    ]
  }
}
