diff --git a/content/README.md b/content/README.md index cdb789b..51f0360 100644 --- a/content/README.md +++ b/content/README.md @@ -13,7 +13,8 @@ Data-driven definitions (skills, items, recipes, quests) validated in CI with ** | [`npc-behaviors/`](npc-behaviors/) | NPC behavior archetype catalogs; each row matches [`schemas/npc-behavior-def.schema.json`](schemas/npc-behavior-def.schema.json) — **stable `id`**, **`archetypeKind`**, aggro/leash radii, telegraph + attack timings for [E5.M2](../docs/decomposition/modules/E5_M2_NpcAiAndBehaviorProfiles.md) | | [`encounters/`](encounters/) | Encounter templates; each row matches [`schemas/encounter-def.schema.json`](schemas/encounter-def.schema.json) — **stable `id`**, completion criteria, **`rewardTableId`** for [E5.M3](../docs/decomposition/modules/E5_M3_EncounterAndRewardTables.md) | | [`reward-tables/`](reward-tables/) | Reward table catalogs; each row matches [`schemas/reward-table.schema.json`](schemas/reward-table.schema.json) — **stable `id`**, **`fixedGrants`** referencing frozen item ids for [E5.M3](../docs/decomposition/modules/E5_M3_EncounterAndRewardTables.md) | -| [`quests/`](quests/) | Quest catalogs; each row matches [`schemas/quest-def.schema.json`](schemas/quest-def.schema.json) (steps via [`quest-step-def.schema.json`](schemas/quest-step-def.schema.json), objectives via [`quest-objective-def.schema.json`](schemas/quest-objective-def.schema.json)) — **stable `id`**, **`prerequisiteQuestIds`**, step/objective graph for [E7.M1](../docs/decomposition/modules/E7_M1_QuestStateMachine.md) | +| [`quests/`](quests/) | Quest catalogs; each row matches [`schemas/quest-def.schema.json`](schemas/quest-def.schema.json) (steps via [`quest-step-def.schema.json`](schemas/quest-step-def.schema.json), objectives via [`quest-objective-def.schema.json`](schemas/quest-objective-def.schema.json)) — **stable `id`**, **`prerequisiteQuestIds`**, optional **`factionGateRules`**, step/objective graph for [E7.M1](../docs/decomposition/modules/E7_M1_QuestStateMachine.md) / [E7.M3](../docs/decomposition/modules/E7_M3_FactionReputationLedger.md) | +| [`factions/`](factions/) | Faction catalogs; each row matches [`schemas/faction-def.schema.json`](schemas/faction-def.schema.json) — **stable `id`**, standing band for [E7.M3](../docs/decomposition/modules/E7_M3_FactionReputationLedger.md) | | [`resource-nodes/`](resource-nodes/) | Resource node + yield catalogs; node rows match [`schemas/resource-node-def.schema.json`](schemas/resource-node-def.schema.json), yield rows match [`schemas/resource-yield-row.schema.json`](schemas/resource-yield-row.schema.json) — **stable `nodeDefId`**, **`gatherLens`**, **`maxGathers`** for [E3.M1](../docs/decomposition/modules/E3_M1_ResourceNodeAndGatherLoop.md) | **Prototype Slice 1 (NEO-33):** CI expects **exactly three** skill rows with ids **`salvage`**, **`refine`**, **`intrusion`** (gather + process + tech). Each row must declare **`allowedXpSourceKinds`** (non-empty); see [E2.M1 — Designer note: `allowedXpSourceKinds`](../docs/decomposition/modules/E2_M1_SkillDefinitionRegistry.md#designer-note-allowedxpsourcekinds-and-grant-call-sites) for what each kind means for grant wiring. @@ -32,7 +33,9 @@ Data-driven definitions (skills, items, recipes, quests) validated in CI with ** **Prototype E7 Slice 1 — quests (NEO-112):** CI expects **exactly four** quest ids aligned to [E7.M1 quest freeze](../docs/decomposition/modules/E7_M1_QuestStateMachine.md#prototype-slice-1-freeze-e7m1-01) — **`prototype_quest_gather_intro`**, **`prototype_quest_refine_intro`**, **`prototype_quest_combat_intro`**, **`prototype_quest_operator_chain`**. Objective **`itemId`** / **`recipeId`** / **`encounterId`** cross-refs must resolve to frozen item, recipe, and encounter catalogs; **`prerequisiteQuestIds`** must be acyclic and reference known quest ids; operator chain terminal step is **`inventory_has_item`** **`contract_handoff_token`** ×1. **Do not rename** quest `id` after ship—change **`displayName`** only. See [E7M1-prototype-backlog.md](../docs/plans/E7M1-prototype-backlog.md) and [NEO-112 plan](../docs/plans/NEO-112-implementation-plan.md). -**Prototype E7 Slice 2 — quest completion bundles (NEO-124):** Each of the four frozen quest ids must include **`completionRewardBundle`** with **`itemGrants`** / **`skillXpGrants`** per [E7.M2 completion freeze](../docs/decomposition/modules/E7_M2_RewardAndUnlockRouter.md#prototype-slice-2-freeze-e7m2-01). Bundle **`itemGrants[].itemId`** must resolve to the frozen item catalog; **`skillXpGrants[].skillId`** must resolve to a skill that lists **`mission_reward`** in **`allowedXpSourceKinds`**. Omit empty **`itemGrants`**. See [E7M2-prototype-backlog.md](../docs/plans/E7M2-prototype-backlog.md) and [NEO-124 plan](../docs/plans/NEO-124-implementation-plan.md). +**Prototype E7 Slice 2 — quest completion bundles (NEO-124):** Each frozen quest id must include **`completionRewardBundle`** with **`itemGrants`** / **`skillXpGrants`** per [E7.M2 completion freeze](../docs/decomposition/modules/E7_M2_RewardAndUnlockRouter.md#prototype-slice-2-freeze-e7m2-01). Bundle **`itemGrants[].itemId`** must resolve to the frozen item catalog; **`skillXpGrants[].skillId`** must resolve to a skill that lists **`mission_reward`** in **`allowedXpSourceKinds`**. Omit empty **`itemGrants`**. See [E7M2-prototype-backlog.md](../docs/plans/E7M2-prototype-backlog.md) and [NEO-124 plan](../docs/plans/NEO-124-implementation-plan.md). + +**Prototype E7 Slice 3 — factions + gated quest line (NEO-133):** CI expects **exactly two** faction ids aligned to [E7.M3 faction freeze](../docs/decomposition/modules/E7_M3_FactionReputationLedger.md#prototype-slice-3-freeze-e7m3-01) — **`prototype_faction_grid_operators`**, **`prototype_faction_rust_collective`**. Quest roster expands to **five** ids (four E7.M1 onboarding + **`prototype_quest_grid_contract`**). **`factionGateRules[].factionId`** and **`completionRewardBundle.reputationGrants[].factionId`** must resolve to the frozen faction catalog; grid contract shape is frozen in CI. See [E7M3-pre-production-backlog.md](../docs/plans/E7M3-pre-production-backlog.md) and [NEO-133 plan](../docs/plans/NEO-133-implementation-plan.md). **Prototype Slice 4 (NEO-45):** CI expects **exactly one** `MasteryTrack` for **`salvage`** only (`refine` / `intrusion` have no mastery rows yet). Tier 1 @ skill level **2** is a **mutually exclusive** branch pick (`scrap_efficiency` vs `bulk_haul`) with **no** perks; tier 2 @ level **4** unlocks one perk per branch path. **Do not rename** `branchId` / `perkId` after ship—change `displayName` only. See [E2.M3 — Designer note](../docs/decomposition/modules/E2_M3_MasteryAndPerkUnlocks.md#designer-note-tiers-branches-and-level-gates) and [freeze table](../docs/decomposition/modules/E2_M3_MasteryAndPerkUnlocks.md#prototype-slice-4-freeze--salvage-flagship-neo-45). diff --git a/content/factions/prototype_factions.json b/content/factions/prototype_factions.json new file mode 100644 index 0000000..bb06737 --- /dev/null +++ b/content/factions/prototype_factions.json @@ -0,0 +1,19 @@ +{ + "schemaVersion": 1, + "factions": [ + { + "id": "prototype_faction_grid_operators", + "displayName": "Grid Operators", + "minStanding": -100, + "maxStanding": 100, + "neutralStanding": 0 + }, + { + "id": "prototype_faction_rust_collective", + "displayName": "Rust Collective", + "minStanding": -100, + "maxStanding": 100, + "neutralStanding": 0 + } + ] +} diff --git a/content/quests/prototype_quests.json b/content/quests/prototype_quests.json index 4ebae45..32ae65f 100644 --- a/content/quests/prototype_quests.json +++ b/content/quests/prototype_quests.json @@ -76,7 +76,10 @@ ], "completionRewardBundle": { "itemGrants": [{ "itemId": "survey_drone_kit", "quantity": 1 }], - "skillXpGrants": [{ "skillId": "salvage", "amount": 50 }] + "skillXpGrants": [{ "skillId": "salvage", "amount": 50 }], + "reputationGrants": [ + { "factionId": "prototype_faction_grid_operators", "amount": 15 } + ] }, "steps": [ { @@ -128,6 +131,36 @@ ] } ] + }, + { + "id": "prototype_quest_grid_contract", + "displayName": "Grid Contract", + "prerequisiteQuestIds": ["prototype_quest_operator_chain"], + "factionGateRules": [ + { + "factionId": "prototype_faction_grid_operators", + "minStanding": 15 + } + ], + "completionRewardBundle": { + "reputationGrants": [ + { "factionId": "prototype_faction_rust_collective", "amount": 10 } + ] + }, + "steps": [ + { + "id": "grid_contract_step_kit", + "displayName": "Deliver survey drone kit", + "objectives": [ + { + "id": "grid_contract_obj_kit", + "kind": "inventory_has_item", + "itemId": "survey_drone_kit", + "quantity": 1 + } + ] + } + ] } ] } diff --git a/content/schemas/faction-def.schema.json b/content/schemas/faction-def.schema.json new file mode 100644 index 0000000..dd9ab84 --- /dev/null +++ b/content/schemas/faction-def.schema.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://neon-sprawl.local/schemas/faction-def.json", + "title": "FactionDef", + "description": "Single faction row for catalogs (e.g. content/factions/*_factions.json). IDs are stable forever—rename display in displayName only. See docs/decomposition/modules/E7_M3_FactionReputationLedger.md.", + "type": "object", + "additionalProperties": false, + "required": ["id", "displayName", "minStanding", "maxStanding", "neutralStanding"], + "properties": { + "id": { + "type": "string", + "pattern": "^[a-z][a-z0-9_]*$", + "description": "Immutable faction key for standing, gates, telemetry, and reputation grants." + }, + "displayName": { + "type": "string", + "minLength": 1, + "description": "Player-facing label; safe to change without migrating character data." + }, + "minStanding": { + "type": "integer", + "description": "Lowest standing value after clamp on apply." + }, + "maxStanding": { + "type": "integer", + "description": "Highest standing value after clamp on apply." + }, + "neutralStanding": { + "type": "integer", + "description": "Default standing for new players when no snapshot exists." + } + } +} diff --git a/content/schemas/faction-gate-rule.schema.json b/content/schemas/faction-gate-rule.schema.json new file mode 100644 index 0000000..20b0fd5 --- /dev/null +++ b/content/schemas/faction-gate-rule.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://neon-sprawl.local/schemas/faction-gate-rule.json", + "title": "FactionGateRule", + "description": "Minimum faction standing required to accept gated content (e.g. on QuestDef.factionGateRules). See docs/decomposition/modules/E7_M3_FactionReputationLedger.md.", + "type": "object", + "additionalProperties": false, + "required": ["factionId", "minStanding"], + "properties": { + "factionId": { + "type": "string", + "pattern": "^[a-z][a-z0-9_]*$", + "description": "Faction catalog id that must meet minStanding." + }, + "minStanding": { + "type": "integer", + "description": "Inclusive minimum standing required to pass the gate." + } + } +} diff --git a/content/schemas/quest-def.schema.json b/content/schemas/quest-def.schema.json index 30ccfbd..f1515c4 100644 --- a/content/schemas/quest-def.schema.json +++ b/content/schemas/quest-def.schema.json @@ -33,9 +33,16 @@ }, "description": "Ordered steps; prototype Slice 1 uses sequential advance only." }, + "factionGateRules": { + "type": "array", + "items": { + "$ref": "https://neon-sprawl.local/schemas/faction-gate-rule.json" + }, + "description": "Optional accept gates evaluated against faction standing (E7.M3)." + }, "completionRewardBundle": { "$ref": "https://neon-sprawl.local/schemas/quest-reward-bundle.json", - "description": "Optional completion payout (E7.M2); required on all four prototype quest ids in CI." + "description": "Optional completion payout (E7.M2/E7.M3); required on all prototype quest ids in CI." } } } diff --git a/content/schemas/quest-reward-bundle.schema.json b/content/schemas/quest-reward-bundle.schema.json index ae2aa8d..34bc6fc 100644 --- a/content/schemas/quest-reward-bundle.schema.json +++ b/content/schemas/quest-reward-bundle.schema.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://neon-sprawl.local/schemas/quest-reward-bundle.json", "title": "QuestRewardBundle", - "description": "Composite completion rewards on QuestDef.completionRewardBundle. Grant kinds v1: itemGrants + skillXpGrants only. See docs/decomposition/modules/E7_M2_RewardAndUnlockRouter.md.", + "description": "Composite completion rewards on QuestDef.completionRewardBundle. Grant kinds: itemGrants, skillXpGrants, reputationGrants. See docs/decomposition/modules/E7_M2_RewardAndUnlockRouter.md and E7_M3_FactionReputationLedger.md.", "type": "object", "additionalProperties": false, "properties": { @@ -19,6 +19,13 @@ "$ref": "https://neon-sprawl.local/schemas/quest-skill-xp-grant.json" }, "description": "Skill XP rows applied via mission_reward on first-time completion." + }, + "reputationGrants": { + "type": "array", + "items": { + "$ref": "https://neon-sprawl.local/schemas/reputation-grant-row.json" + }, + "description": "Faction reputation rows applied on first-time completion (E7.M3)." } }, "anyOf": [ @@ -37,6 +44,14 @@ "minItems": 1 } } + }, + { + "required": ["reputationGrants"], + "properties": { + "reputationGrants": { + "minItems": 1 + } + } } ] } diff --git a/content/schemas/reputation-grant-row.schema.json b/content/schemas/reputation-grant-row.schema.json new file mode 100644 index 0000000..6dd2a15 --- /dev/null +++ b/content/schemas/reputation-grant-row.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://neon-sprawl.local/schemas/reputation-grant-row.json", + "title": "ReputationGrantRow", + "description": "Faction reputation payout row on QuestRewardBundle.reputationGrants. See docs/decomposition/modules/E7_M3_FactionReputationLedger.md.", + "type": "object", + "additionalProperties": false, + "required": ["factionId", "amount"], + "properties": { + "factionId": { + "type": "string", + "pattern": "^[a-z][a-z0-9_]*$", + "description": "Faction catalog id receiving the standing change." + }, + "amount": { + "type": "integer", + "description": "Signed reputation delta applied on first-time completion delivery." + } + } +} diff --git a/docs/decomposition/modules/E7_M3_FactionReputationLedger.md b/docs/decomposition/modules/E7_M3_FactionReputationLedger.md index 79e6b30..087f9de 100644 --- a/docs/decomposition/modules/E7_M3_FactionReputationLedger.md +++ b/docs/decomposition/modules/E7_M3_FactionReputationLedger.md @@ -7,7 +7,7 @@ | **Module ID** | E7.M3 | | **Epic** | [Epic 7 — Quest / Faction](../epics/epic_07_quest_faction.md) | | **Stage target** | Pre-production | -| **Status** | In Progress — Slice 3 backlog [E7M3-pre-production-backlog.md](../../plans/E7M3-pre-production-backlog.md): **E7M3-01** [NEO-133](https://linear.app/neon-sprawl/issue/NEO-133) → **E7M3-11** [NEO-143](https://linear.app/neon-sprawl/issue/NEO-143) (decomposed). Upstream: E7.M1 **Ready**, E7.M2 **Ready**. | +| **Status** | In Progress — **E7M3-01 catalog landed** ([NEO-133](https://linear.app/neon-sprawl/issue/NEO-133)): faction schemas + `prototype_factions.json` + quest gate/rep extensions + CI. Slice 3 backlog [E7M3-pre-production-backlog.md](../../plans/E7M3-pre-production-backlog.md): **E7M3-02** [NEO-134](https://linear.app/neon-sprawl/issue/NEO-134) → **E7M3-11** [NEO-143](https://linear.app/neon-sprawl/issue/NEO-143). Upstream: E7.M1 **Ready**, E7.M2 **Ready**. | | **Linear** | Label **`E7.M3`** · [E7M3-pre-production-backlog.md](../../plans/E7M3-pre-production-backlog.md) | ## Purpose @@ -77,7 +77,9 @@ Epic 7 **Slice 3** — at least one faction quest line with rep grant + gated ac | **`prototype_quest_operator_chain`** | **`completionRewardBundle.reputationGrants`**: **`prototype_faction_grid_operators`** **+15** (existing item + skill XP unchanged) | | **`prototype_quest_grid_contract`** *(new)* | **`prerequisiteQuestIds`**: operator chain; **`factionGateRules`**: Grid Operators **`minStanding` 15**; objective **`inventory_has_item`** **`survey_drone_kit` ×1**; completion rep **Rust Collective +10** | -**Roster:** five quests total (four E7.M1 onboarding + one faction line). E7.M1 four-quest freeze expands under E7M3 CI gates. +**Roster:** five quests total (four E7.M1 onboarding + one faction line). E7.M1 four-quest freeze expands under E7M3 CI gates (`PROTOTYPE_E7M3_QUEST_IDS` in `scripts/validate_content.py`). + +**CI enforcement (NEO-133):** `scripts/validate_content.py` validates `content/factions/*_factions.json`, five-quest roster, faction cross-refs on gates and `reputationGrants`, E7M3 completion bundle freeze, and grid-contract shape. ## Source anchors diff --git a/docs/decomposition/modules/documentation_and_implementation_alignment.md b/docs/decomposition/modules/documentation_and_implementation_alignment.md index 80edc77..b89c922 100644 --- a/docs/decomposition/modules/documentation_and_implementation_alignment.md +++ b/docs/decomposition/modules/documentation_and_implementation_alignment.md @@ -61,7 +61,7 @@ Rows appear when work starts; default for unlisted modules is **Planned** / not | E5.M3 | Ready | **E5M3-01 catalog landed ([NEO-100](https://linear.app/neon-sprawl/issue/NEO-100)):** encounter + reward-table schemas, `prototype_encounters.json`, `prototype_reward_tables.json`, CI gates. **E5M3-02 server load ([NEO-101](https://linear.app/neon-sprawl/issue/NEO-101)):** fail-fast startup loaders for encounter + reward-table catalogs (CI parity). **E5M3-03 registries ([NEO-102](https://linear.app/neon-sprawl/issue/NEO-102)):** `IEncounterDefinitionRegistry` + `IRewardTableDefinitionRegistry` + DI. **E5M3-04 HTTP read ([NEO-103](https://linear.app/neon-sprawl/issue/NEO-103)):** **`GET /game/world/encounter-definitions`** — `EncounterDefinitionsWorldApi` + nested **`rewardTable`** summary ([NEO-103](../../plans/NEO-103-implementation-plan.md)); [server README — Encounter definitions (NEO-103)](../../../server/README.md#encounter-definitions-neo-103); Bruno `bruno/neon-sprawl-server/encounter-definitions/`. **E5M3-05 stores ([NEO-104](https://linear.app/neon-sprawl/issue/NEO-104)):** **`IEncounterProgressStore`** + **`IEncounterCompletionStore`** + **`EncounterProgressOperations`** ([NEO-104](../../plans/NEO-104-implementation-plan.md)); [server README — Encounter progress (NEO-104)](../../../server/README.md#encounter-progress--completion-stores-neo-104). **E5M3-06 completion grants ([NEO-105](https://linear.app/neon-sprawl/issue/NEO-105)):** **`EncounterCompletionOperations`** + **`EncounterCompleteEvent`** result payload ([NEO-105](../../plans/NEO-105-implementation-plan.md)); [server README — Encounter completion (NEO-105)](../../../server/README.md#encounter-completion--inventory-grants-neo-105). **E5M3-07 combat wiring ([NEO-106](https://linear.app/neon-sprawl/issue/NEO-106)):** **`EncounterCombatWiring`** on **`AbilityCastApi`** ([NEO-106](../../plans/NEO-106-implementation-plan.md)); [server README — Encounter combat wiring (NEO-106)](../../../server/README.md#encounter-combat-wiring-neo-106). **E5M3-09 event record ([NEO-107](https://linear.app/neon-sprawl/issue/NEO-107)):** **`IEncounterCompleteEventStore`** + E7.M2 hook stub ([NEO-107](../../plans/NEO-107-implementation-plan.md)); [server README — Encounter complete event (NEO-107)](../../../server/README.md#encounter-complete-event-record-neo-107). **E5M3-08 per-player GET ([NEO-108](https://linear.app/neon-sprawl/issue/NEO-108)):** **`GET /game/players/{id}/encounter-progress`** — `EncounterProgressApi` + DTOs ([NEO-108](../../plans/NEO-108-implementation-plan.md)); [server README — Per-player encounter progress (NEO-108)](../../../server/README.md#per-player-encounter-progress-neo-108); Bruno `bruno/neon-sprawl-server/encounter-progress/`. **E5M3-10 telemetry ([NEO-109](https://linear.app/neon-sprawl/issue/NEO-109)):** comment-only **`encounter_start`**, **`encounter_complete`**, **`reward_attribution`**, **`encounter_complete_denied`** in **`EncounterProgressOperations`** / **`EncounterCompletionOperations`** ([NEO-109](../../plans/NEO-109-implementation-plan.md)); [server README — Encounter telemetry hooks (NEO-109)](../../../server/README.md#encounter-telemetry-hooks-neo-109). **E5M3-11 client HUD ([NEO-110](https://linear.app/neon-sprawl/issue/NEO-110)):** **`encounter_progress_client.gd`**, **`EncounterProgressLabel`** / **`EncounterCompleteLabel`**; boot + defeat-triggered GET; inventory refresh on **`completed`** ([NEO-110](../../plans/NEO-110-implementation-plan.md), [`NEO-110` manual QA](../../manual-qa/NEO-110.md)); [client README — Encounter progress + loot HUD (NEO-110)](../../../client/README.md#encounter-progress--loot-hud-neo-110). **E5M3-12 client capstone ([NEO-111](https://linear.app/neon-sprawl/issue/NEO-111)):** playable encounter clear loop — [`NEO-111` manual QA](../../manual-qa/NEO-111.md); [client README — End-to-end encounter clear loop (NEO-111)](../../../client/README.md#end-to-end-encounter-clear-loop-neo-111); plan [NEO-111](../../plans/NEO-111-implementation-plan.md). **Epic 5 Slice 3 client capstone complete.** Epic 5 Slice 3 backlog [E5M3-prototype-backlog.md](../../plans/E5M3-prototype-backlog.md) **E5M3-01** [NEO-100](https://linear.app/neon-sprawl/issue/NEO-100) → **E5M3-12** [NEO-111](https://linear.app/neon-sprawl/issue/NEO-111) **landed**. Prototype spine: **`prototype_combat_pocket`** → **`prototype_combat_pocket_clear`**; idempotent completion; per-defeat gig XP unchanged ([NEO-44](../../plans/NEO-44-implementation-plan.md)). Upstream **E5.M2 Ready**, **E3.M3** inventory landed. | [NEO-111 plan](../../plans/NEO-111-implementation-plan.md), [NEO-110 plan](../../plans/NEO-110-implementation-plan.md), [NEO-109 plan](../../plans/NEO-109-implementation-plan.md), [NEO-108 plan](../../plans/NEO-108-implementation-plan.md), [NEO-107 plan](../../plans/NEO-107-implementation-plan.md), [NEO-106 plan](../../plans/NEO-106-implementation-plan.md), [NEO-105 plan](../../plans/NEO-105-implementation-plan.md), [NEO-104 plan](../../plans/NEO-104-implementation-plan.md), [NEO-103 plan](../../plans/NEO-103-implementation-plan.md), [NEO-102 plan](../../plans/NEO-102-implementation-plan.md), [E5_M3](E5_M3_EncounterAndRewardTables.md), label **`E5.M3`** on NEO-100–NEO-111 | | E7.M2 | Ready | **E7M2-01 catalog landed ([NEO-124](https://linear.app/neon-sprawl/issue/NEO-124)):** `quest-reward-bundle` + `quest-skill-xp-grant` schemas; **`completionRewardBundle`** on four frozen E7.M1 quests; CI bundle freeze + cross-ref gates. **E7M2-02 server load ([NEO-125](https://linear.app/neon-sprawl/issue/NEO-125)):** fail-fast quest catalog **`completionRewardBundle`** validation at startup — `PrototypeE7M2QuestCatalogRules` + bundle schema `$ref` registration ([NEO-125](../../plans/NEO-125-implementation-plan.md)); [server README — Quest catalog (NEO-125)](../../../server/README.md#quest-catalog-contentquests-neo-113). **E7M2-03 delivery store ([NEO-126](https://linear.app/neon-sprawl/issue/NEO-126)):** idempotent **`IRewardDeliveryStore`** + **`RewardDeliveryEvent`** in `Game/Rewards/` — in-memory prototype ([NEO-126](../../plans/NEO-126-implementation-plan.md)); [server README — Reward delivery store (NEO-126)](../../../server/README.md#reward-delivery-store-neo-126). **E7M2-04 router apply ([NEO-127](https://linear.app/neon-sprawl/issue/NEO-127)):** **`RewardRouterOperations.TryDeliverQuestCompletion`** — item + skill XP bundle apply with compensating rollback + store record ([NEO-127](../../plans/NEO-127-implementation-plan.md)); [server README — Reward router (NEO-127)](../../../server/README.md#reward-router-neo-127). **E7M2-05 quest-state wiring ([NEO-128](https://linear.app/neon-sprawl/issue/NEO-128)):** **`QuestStateOperations.TryMarkComplete`** + **`QuestObjectiveWiring`** deliver-then-mark via router ([NEO-128](../../plans/NEO-128-implementation-plan.md)); [server README — Quest state operations (NEO-117)](../../../server/README.md#quest-state-operations-neo-117). **E7M2-06 HTTP read ([NEO-129](https://linear.app/neon-sprawl/issue/NEO-129)):** **`GET …/quest-progress`** **`completionRewardSummary`** from **`IRewardDeliveryStore`** ([NEO-129](../../plans/NEO-129-implementation-plan.md)); Bruno `bruno/neon-sprawl-server/quest-progress/Get quest progress after gather intro complete.bru`. **E7M2-07 telemetry ([NEO-130](https://linear.app/neon-sprawl/issue/NEO-130)):** comment-only **`reward_delivery`** + **`unlock_granted`** stub hook sites in **`RewardRouterOperations.TryDeliverQuestCompletion`** ([NEO-130](../../plans/NEO-130-implementation-plan.md)); [server README — Reward telemetry hooks (NEO-130)](../../../server/README.md#reward-telemetry-hooks-neo-130). **E7M2-08 client HUD ([NEO-131](https://linear.app/neon-sprawl/issue/NEO-131)):** Godot **`QuestRewardDeliveryLabel`** paints **`completionRewardSummary`** on in-session completion transition ([NEO-131](../../plans/NEO-131-implementation-plan.md)); [client README — Quest completion reward HUD (NEO-131)](../../../client/README.md#quest-completion-reward-hud-neo-131). **E7M2-09 client capstone ([NEO-132](https://linear.app/neon-sprawl/issue/NEO-132)):** playable quest reward delivery loop — [`NEO-132` manual QA](../../manual-qa/NEO-132.md); [client README — End-to-end quest reward loop (NEO-132)](../../../client/README.md#end-to-end-quest-reward-loop-neo-132); plan [NEO-132](../../plans/NEO-132-implementation-plan.md). **Epic 7 Slice 2 client capstone complete.** Backlog **E7M2-01** [NEO-124](https://linear.app/neon-sprawl/issue/NEO-124) → **E7M2-09** [NEO-132](https://linear.app/neon-sprawl/issue/NEO-132) **landed**. **NEO-43 prep landed:** **`MissionRewardSkillXpGrant`**. **Encounter loot unchanged** (E5.M3 direct grants). Upstream: E7.M1 **Ready**, E2.M2 grant stack, E3.M3 inventory **Ready**. | [E7M2-prototype-backlog.md](../../plans/E7M2-prototype-backlog.md), [E7_M2](E7_M2_RewardAndUnlockRouter.md), [NEO-124](../../plans/NEO-124-implementation-plan.md), [NEO-125](../../plans/NEO-125-implementation-plan.md), [NEO-126](../../plans/NEO-126-implementation-plan.md), [NEO-127](../../plans/NEO-127-implementation-plan.md), [NEO-128](../../plans/NEO-128-implementation-plan.md), [NEO-129](../../plans/NEO-129-implementation-plan.md), [NEO-130](../../plans/NEO-130-implementation-plan.md), [NEO-131](../../plans/NEO-131-implementation-plan.md), [NEO-132](../../plans/NEO-132-implementation-plan.md), [NEO-43](../../plans/NEO-43-implementation-plan.md), label **`E7.M2`** on NEO-124–NEO-132 | | E7.M1 | Ready | **E7M1-01 catalog landed ([NEO-112](https://linear.app/neon-sprawl/issue/NEO-112)):** quest schemas, `prototype_quests.json`, CI gates (four frozen quest ids, objective cross-refs, acyclic prerequisites, chain terminal token). **E7M1-02 server load ([NEO-113](https://linear.app/neon-sprawl/issue/NEO-113)):** fail-fast startup load of `content/quests/*_quests.json` — `server/NeonSprawl.Server/Game/Quests/` ([NEO-113](../../plans/NEO-113-implementation-plan.md)); [server README — Quest catalog](../../../server/README.md#quest-catalog-contentquests-neo-113). **E7M1-03 registry ([NEO-114](https://linear.app/neon-sprawl/issue/NEO-114)):** **`IQuestDefinitionRegistry`** + DI ([NEO-114](../../plans/NEO-114-implementation-plan.md)). **E7M1-04 HTTP read ([NEO-115](https://linear.app/neon-sprawl/issue/NEO-115)):** **`GET /game/world/quest-definitions`** — `QuestDefinitionsWorldApi` + DTOs ([NEO-115](../../plans/NEO-115-implementation-plan.md)); [server README — Quest definitions (NEO-115)](../../../server/README.md#quest-definitions-neo-115); Bruno `bruno/neon-sprawl-server/quest-definitions/`. **E7M1-05 store ([NEO-116](https://linear.app/neon-sprawl/issue/NEO-116)):** **`IPlayerQuestStateStore`** + in-memory/Postgres persistence ([NEO-116](../../plans/NEO-116-implementation-plan.md)); [server README — Quest progress store (NEO-116)](../../../server/README.md#quest-progress-store-neo-116). **E7M1-06 operations ([NEO-117](https://linear.app/neon-sprawl/issue/NEO-117)):** **`QuestStateOperations`** + reason codes ([NEO-117](../../plans/NEO-117-implementation-plan.md)); [server README — Quest state operations (NEO-117)](../../../server/README.md#quest-state-operations-neo-117). **E7M1-07 objective wiring ([NEO-118](https://linear.app/neon-sprawl/issue/NEO-118)):** **`QuestObjectiveWiring`** on gather/craft/encounter + **`inventory_has_item`** snapshot passes ([NEO-118](../../plans/NEO-118-implementation-plan.md)); [server README — Quest objective wiring (NEO-118)](../../../server/README.md#quest-objective-wiring-neo-118). **E7M1-08 per-player GET ([NEO-119](https://linear.app/neon-sprawl/issue/NEO-119)):** **`GET /game/players/{id}/quest-progress`** — `QuestProgressApi` + DTOs; GET-side inventory refresh ([NEO-119](../../plans/NEO-119-implementation-plan.md)); [server README — Per-player quest progress (NEO-119)](../../../server/README.md#per-player-quest-progress-neo-119); Bruno `bruno/neon-sprawl-server/quest-progress/`. **E7M1-09 accept POST ([NEO-120](https://linear.app/neon-sprawl/issue/NEO-120)):** **`POST /game/players/{id}/quests/{questId}/accept`** — `QuestAcceptApi` + DTOs; **`QuestStateOperations.TryAccept`** ([NEO-120](../../plans/NEO-120-implementation-plan.md)); [server README — Quest accept POST (NEO-120)](../../../server/README.md#quest-accept-post-neo-120); Bruno accept spine in `bruno/neon-sprawl-server/quest-progress/`. **E7M1-10 telemetry ([NEO-121](https://linear.app/neon-sprawl/issue/NEO-121)):** comment-only **`quest_start`**, **`quest_step_complete`**, **`quest_complete`**, **`quest_accept_denied`** hook sites in **`QuestStateOperations`** ([NEO-121](../../plans/NEO-121-implementation-plan.md)); [server README — Quest telemetry hooks (NEO-121)](../../../server/README.md#quest-telemetry-hooks-neo-121). **E7M1-11 client HUD ([NEO-122](https://linear.app/neon-sprawl/issue/NEO-122)):** **`quest_progress_client.gd`**, **`quest_definitions_client.gd`**, **`QuestProgressLabel`** / **`QuestAcceptFeedbackLabel`**; boot + event-driven GET refresh; **Q** / **Shift+Q** accept ([NEO-122](../../plans/NEO-122-implementation-plan.md), [`NEO-122` manual QA](../../manual-qa/NEO-122.md)); [client README — Quest progress + accept HUD (NEO-122)](../../../client/README.md#quest-progress--accept-hud-neo-122). **E7M1-12 client capstone ([NEO-123](https://linear.app/neon-sprawl/issue/NEO-123)):** playable four-quest onboarding chain — [`NEO-123` manual QA](../../manual-qa/NEO-123.md); [client README — End-to-end onboarding quest loop (NEO-123)](../../../client/README.md#end-to-end-onboarding-quest-loop-neo-123); plan [NEO-123](../../plans/NEO-123-implementation-plan.md). **Epic 7 Slice 1 client capstone complete.** Backlog **E7M1-01** [NEO-112](https://linear.app/neon-sprawl/issue/NEO-112) → **E7M1-12** [NEO-123](https://linear.app/neon-sprawl/issue/NEO-123) **landed**. Upstream: E3.M1 gather **Ready**, E3.M2 craft **Ready**, E5.M3 encounter **`contract_handoff_token`** + **`EncounterCompleteEvent`** **Ready**. | [NEO-123 plan](../../plans/NEO-123-implementation-plan.md), [NEO-122 plan](../../plans/NEO-122-implementation-plan.md), [NEO-121 plan](../../plans/NEO-121-implementation-plan.md), [NEO-120 plan](../../plans/NEO-120-implementation-plan.md), [NEO-119 plan](../../plans/NEO-119-implementation-plan.md), [NEO-118 plan](../../plans/NEO-118-implementation-plan.md), [NEO-117 plan](../../plans/NEO-117-implementation-plan.md), [NEO-116 plan](../../plans/NEO-116-implementation-plan.md), [NEO-115 plan](../../plans/NEO-115-implementation-plan.md), [NEO-114 plan](../../plans/NEO-114-implementation-plan.md), [NEO-113 plan](../../plans/NEO-113-implementation-plan.md), [NEO-112 plan](../../plans/NEO-112-implementation-plan.md), [E7M1-prototype-backlog.md](../../plans/E7M1-prototype-backlog.md), [E7_M1](E7_M1_QuestStateMachine.md), label **`E7.M1`** on NEO-112–NEO-123 | -| E7.M3 | In Progress | **Decomposed** — Epic 7 Slice 3 backlog [E7M3-pre-production-backlog.md](../../plans/E7M3-pre-production-backlog.md) **E7M3-01** [NEO-133](https://linear.app/neon-sprawl/issue/NEO-133) → **E7M3-11** [NEO-143](https://linear.app/neon-sprawl/issue/NEO-143). Two frozen factions (**Grid Operators**, **Rust Collective**); operator-chain **`reputationGrants`** (+15 Grid Operators); new gated quest **`prototype_quest_grid_contract`** (**`minStanding` 15**); **`faction_gate_blocked`** accept deny; rep apply via extended **`RewardRouterOperations`**; client capstone [NEO-143](https://linear.app/neon-sprawl/issue/NEO-143). Upstream: E7.M1 **Ready**, E7.M2 **Ready**. | [E7M3-pre-production-backlog.md](../../plans/E7M3-pre-production-backlog.md), [E7_M3](E7_M3_FactionReputationLedger.md), label **`E7.M3`** on NEO-133–NEO-143 | +| E7.M3 | In Progress | **E7M3-01 catalog landed ([NEO-133](https://linear.app/neon-sprawl/issue/NEO-133)):** faction + gate/rep schemas, `prototype_factions.json`, quest extensions (`factionGateRules`, `reputationGrants`), five-quest CI gates, minimal server roster parity. **E7M3-02+** [NEO-134](https://linear.app/neon-sprawl/issue/NEO-134) → **E7M3-11** [NEO-143](https://linear.app/neon-sprawl/issue/NEO-143). Two frozen factions; operator-chain **`reputationGrants`** (+15 Grid Operators); gated **`prototype_quest_grid_contract`**; client capstone [NEO-143](https://linear.app/neon-sprawl/issue/NEO-143). Upstream: E7.M1 **Ready**, E7.M2 **Ready**. | [NEO-133 plan](../../plans/NEO-133-implementation-plan.md), [E7M3-pre-production-backlog.md](../../plans/E7M3-pre-production-backlog.md), [E7_M3](E7_M3_FactionReputationLedger.md), label **`E7.M3`** on NEO-133–NEO-143 | --- diff --git a/docs/plans/E7M3-pre-production-backlog.md b/docs/plans/E7M3-pre-production-backlog.md index b3400fc..25f3fb5 100644 --- a/docs/plans/E7M3-pre-production-backlog.md +++ b/docs/plans/E7M3-pre-production-backlog.md @@ -108,9 +108,9 @@ Accepting **`prototype_quest_grid_contract`** before operator-chain completion o **Acceptance criteria** -- [ ] PR gate validates faction JSON and extended quest JSON. -- [ ] Exactly two prototype faction ids; fifth quest id present with gate + objective cross-refs. -- [ ] Invalid faction refs in gates or grants fail CI. +- [x] PR gate validates faction JSON and extended quest JSON. +- [x] Exactly two prototype faction ids; fifth quest id present with gate + objective cross-refs. +- [x] Invalid faction refs in gates or grants fail CI. **Client counterpart:** none (infrastructure-only). diff --git a/docs/plans/NEO-133-implementation-plan.md b/docs/plans/NEO-133-implementation-plan.md index 4c92a18..07eb56f 100644 --- a/docs/plans/NEO-133-implementation-plan.md +++ b/docs/plans/NEO-133-implementation-plan.md @@ -101,3 +101,11 @@ None for E7M3-01. Client faction HUD and capstone: **NEO-142** / **NEO-143**. ## Blocks **NEO-134** (server faction catalog load) is blocked until this catalog + CI lands. + +## Implementation reconciliation (shipped) + +- **Schemas:** `faction-def`, `faction-gate-rule`, `reputation-grant-row`; extended `quest-def` + `quest-reward-bundle`. +- **Catalog:** `prototype_factions.json` (two factions); `prototype_quests.json` operator-chain rep + `prototype_quest_grid_contract`. +- **CI:** `PROTOTYPE_E7M3_*` gates in `validate_content.py` (roster, faction freeze, bundle freeze, cross-refs, grid-contract shape). +- **Server parity:** five-quest `ExpectedQuestIds`, grid-contract E7M2 bundle freeze, schema registry for new `$ref`s. +- **Docs:** `content/README.md` E7 Slice 3 paragraph; E7_M3 module CI line. diff --git a/scripts/validate_content.py b/scripts/validate_content.py index fd578de..7d67034 100644 --- a/scripts/validate_content.py +++ b/scripts/validate_content.py @@ -15,7 +15,9 @@ Validates: - reward table catalogs: content/reward-tables/*_reward_tables.json rows vs content/schemas/reward-table.schema.json (NEO-100) - encounter catalogs: content/encounters/*_encounters.json rows vs content/schemas/encounter-def.schema.json (NEO-100) - quest catalogs: content/quests/*_quests.json rows vs content/schemas/quest-def.schema.json (NEO-112); - optional completionRewardBundle via quest-reward-bundle.schema.json (NEO-124) + optional completionRewardBundle via quest-reward-bundle.schema.json (NEO-124); + optional factionGateRules + reputationGrants (NEO-133) +- faction catalogs: content/factions/*_factions.json rows vs content/schemas/faction-def.schema.json (NEO-133) """ from __future__ import annotations @@ -46,6 +48,9 @@ QUEST_STEP_DEF_SCHEMA = REPO_ROOT / "content/schemas/quest-step-def.schema.json" QUEST_DEF_SCHEMA = REPO_ROOT / "content/schemas/quest-def.schema.json" QUEST_REWARD_BUNDLE_SCHEMA = REPO_ROOT / "content/schemas/quest-reward-bundle.schema.json" QUEST_SKILL_XP_GRANT_SCHEMA = REPO_ROOT / "content/schemas/quest-skill-xp-grant.schema.json" +FACTION_DEF_SCHEMA = REPO_ROOT / "content/schemas/faction-def.schema.json" +FACTION_GATE_RULE_SCHEMA = REPO_ROOT / "content/schemas/faction-gate-rule.schema.json" +REPUTATION_GRANT_ROW_SCHEMA = REPO_ROOT / "content/schemas/reputation-grant-row.schema.json" SKILLS_DIR = REPO_ROOT / "content/skills" MASTERY_DIR = REPO_ROOT / "content/mastery" ITEMS_DIR = REPO_ROOT / "content/items" @@ -56,6 +61,7 @@ NPC_BEHAVIORS_DIR = REPO_ROOT / "content/npc-behaviors" REWARD_TABLES_DIR = REPO_ROOT / "content/reward-tables" ENCOUNTERS_DIR = REPO_ROOT / "content/encounters" QUESTS_DIR = REPO_ROOT / "content/quests" +FACTIONS_DIR = REPO_ROOT / "content/factions" # Slice 1 prototype lock (NEO-33): exact ids + category coverage after schema passes. PROTOTYPE_SLICE1_SKILL_IDS = frozenset({"salvage", "refine", "intrusion"}) @@ -195,6 +201,74 @@ PROTOTYPE_E7M2_COMPLETION_BUNDLES: dict[str, dict] = { }, } +# Epic 7 Slice 3 prototype lock (NEO-133): five-quest roster + faction catalog. +# Keep in sync with E7.M3 freeze table and future NEO-134 server loader. +PROTOTYPE_E7M3_FACTION_IDS = frozenset( + { + "prototype_faction_grid_operators", + "prototype_faction_rust_collective", + } +) +PROTOTYPE_E7M3_FACTION_FREEZE: dict[str, dict] = { + "prototype_faction_grid_operators": { + "displayName": "Grid Operators", + "minStanding": -100, + "maxStanding": 100, + "neutralStanding": 0, + }, + "prototype_faction_rust_collective": { + "displayName": "Rust Collective", + "minStanding": -100, + "maxStanding": 100, + "neutralStanding": 0, + }, +} +PROTOTYPE_E7M3_QUEST_IDS = frozenset( + { + "prototype_quest_gather_intro", + "prototype_quest_refine_intro", + "prototype_quest_combat_intro", + "prototype_quest_operator_chain", + "prototype_quest_grid_contract", + } +) +PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID = "prototype_quest_grid_contract" +PROTOTYPE_E7M3_GRID_CONTRACT_PREREQ_QUEST_ID = "prototype_quest_operator_chain" +PROTOTYPE_E7M3_GRID_CONTRACT_GATE_FACTION_ID = "prototype_faction_grid_operators" +PROTOTYPE_E7M3_GRID_CONTRACT_MIN_STANDING = 15 +PROTOTYPE_E7M3_GRID_CONTRACT_OBJECTIVE_ITEM_ID = "survey_drone_kit" +PROTOTYPE_E7M3_COMPLETION_BUNDLES: dict[str, dict] = { + "prototype_quest_gather_intro": { + "itemGrants": [], + "skillXpGrants": [{"skillId": "salvage", "amount": 25}], + "reputationGrants": [], + }, + "prototype_quest_refine_intro": { + "itemGrants": [], + "skillXpGrants": [{"skillId": "refine", "amount": 25}], + "reputationGrants": [], + }, + "prototype_quest_combat_intro": { + "itemGrants": [], + "skillXpGrants": [{"skillId": "salvage", "amount": 25}], + "reputationGrants": [], + }, + "prototype_quest_operator_chain": { + "itemGrants": [{"itemId": "survey_drone_kit", "quantity": 1}], + "skillXpGrants": [{"skillId": "salvage", "amount": 50}], + "reputationGrants": [ + {"factionId": "prototype_faction_grid_operators", "amount": 15} + ], + }, + "prototype_quest_grid_contract": { + "itemGrants": [], + "skillXpGrants": [], + "reputationGrants": [ + {"factionId": "prototype_faction_rust_collective", "amount": 10} + ], + }, +} + def _normalize_completion_bundle(bundle: dict) -> dict: """Normalize grant rows for stable freeze-table comparison.""" @@ -224,6 +298,23 @@ def _normalize_completion_bundle(bundle: dict) -> dict: } +def _normalize_e7m3_completion_bundle(bundle: dict) -> dict: + """Normalize item, skill XP, and reputation grant rows for E7M3 freeze-table comparison.""" + normalized = _normalize_completion_bundle(bundle) + reputation_grants = bundle.get("reputationGrants") + normalized["reputationGrants"] = sorted( + [ + {"factionId": grant["factionId"], "amount": grant["amount"]} + for grant in (reputation_grants if isinstance(reputation_grants, list) else []) + if isinstance(grant, dict) + and isinstance(grant.get("factionId"), str) + and isinstance(grant.get("amount"), int) + ], + key=lambda grant: (grant["factionId"], grant["amount"]), + ) + return normalized + + def _prototype_slice1_gate(seen_ids: dict[str, str], id_to_category: dict[str, str]) -> str | None: """Return a human-readable error if Slice 1 contract fails, else None.""" ids = frozenset(seen_ids.keys()) @@ -895,13 +986,15 @@ def _prototype_e5m3_encounter_cross_ref_gate(id_to_row: dict[str, dict]) -> str def _quest_def_validator() -> Draft202012Validator: - """Build a validator that resolves quest-def $ref to step, objective, and bundle schemas.""" + """Build a validator that resolves quest-def $ref to step, objective, bundle, and gate schemas.""" objective_schema = json.loads(QUEST_OBJECTIVE_DEF_SCHEMA.read_text(encoding="utf-8")) step_schema = json.loads(QUEST_STEP_DEF_SCHEMA.read_text(encoding="utf-8")) def_schema = json.loads(QUEST_DEF_SCHEMA.read_text(encoding="utf-8")) bundle_schema = json.loads(QUEST_REWARD_BUNDLE_SCHEMA.read_text(encoding="utf-8")) skill_xp_grant_schema = json.loads(QUEST_SKILL_XP_GRANT_SCHEMA.read_text(encoding="utf-8")) grant_row_schema = json.loads(REWARD_GRANT_ROW_SCHEMA.read_text(encoding="utf-8")) + faction_gate_rule_schema = json.loads(FACTION_GATE_RULE_SCHEMA.read_text(encoding="utf-8")) + reputation_grant_row_schema = json.loads(REPUTATION_GRANT_ROW_SCHEMA.read_text(encoding="utf-8")) registry = Registry().with_resources( [ (def_schema["$id"], Resource.from_contents(def_schema)), @@ -910,11 +1003,62 @@ def _quest_def_validator() -> Draft202012Validator: (bundle_schema["$id"], Resource.from_contents(bundle_schema)), (skill_xp_grant_schema["$id"], Resource.from_contents(skill_xp_grant_schema)), (grant_row_schema["$id"], Resource.from_contents(grant_row_schema)), + (faction_gate_rule_schema["$id"], Resource.from_contents(faction_gate_rule_schema)), + (reputation_grant_row_schema["$id"], Resource.from_contents(reputation_grant_row_schema)), ] ) return Draft202012Validator(def_schema, registry=registry) +def _validate_faction_catalogs( + *, + faction_files: list[Path], + faction_validator: Draft202012Validator, +) -> tuple[int, dict[str, str], dict[str, dict]]: + """Validate faction JSON files. Returns (error_count, seen_ids, id_to_row).""" + errors = 0 + seen_ids: dict[str, str] = {} + id_to_row: dict[str, dict] = {} + + for path in faction_files: + rel = str(path.relative_to(REPO_ROOT)) + data = json.loads(path.read_text(encoding="utf-8")) + schema_version = data.get("schemaVersion") + if schema_version != 1: + print(f"error: {rel}: expected schemaVersion 1, got {schema_version!r}", file=sys.stderr) + errors += 1 + continue + + factions = data.get("factions") + if not isinstance(factions, list): + print(f"error: {rel}: expected top-level 'factions' array", file=sys.stderr) + errors += 1 + continue + + for i, row in enumerate(factions): + if not isinstance(row, dict): + print(f"error: {rel}: factions[{i}] must be an object", file=sys.stderr) + errors += 1 + continue + row_schema_errors = 0 + for err in sorted(faction_validator.iter_errors(row), key=lambda e: e.path): + loc = ".".join(str(p) for p in err.path) or "(root)" + print(f"error: {rel} factions[{i}] {loc}: {err.message}", file=sys.stderr) + row_schema_errors += 1 + errors += 1 + fid = row.get("id") + if isinstance(fid, str) and row_schema_errors == 0: + prev = seen_ids.get(fid) + if prev: + print(f"error: duplicate faction id {fid!r} in {prev} and {rel}", file=sys.stderr) + errors += 1 + else: + seen_ids[fid] = rel + id_to_row[fid] = row + + return errors, seen_ids, id_to_row + + def _validate_quest_catalogs( *, quest_files: list[Path], @@ -998,6 +1142,17 @@ def _validate_quest_catalogs( return errors, seen_ids, id_to_row +def _prototype_e7m3_quest_roster_gate(seen_ids: dict[str, str]) -> str | None: + """Return a human-readable error if E7M3 five-quest roster fails, else None.""" + ids = frozenset(seen_ids.keys()) + if ids != PROTOTYPE_E7M3_QUEST_IDS: + return ( + "error: prototype E7M3 expects exactly quest ids " + f"{sorted(PROTOTYPE_E7M3_QUEST_IDS)!r}, got {sorted(ids)!r}" + ) + return None + + def _prototype_e7m1_quest_gate(seen_ids: dict[str, str]) -> str | None: """Return a human-readable error if E7M1 quest contract fails, else None.""" ids = frozenset(seen_ids.keys()) @@ -1132,7 +1287,7 @@ def _prototype_e7m1_chain_terminal_gate(id_to_row: dict[str, dict]) -> str | Non def _prototype_e7m2_completion_bundle_presence_gate(id_to_row: dict[str, dict]) -> str | None: """Return a human-readable error if a frozen quest lacks completionRewardBundle, else None.""" - for qid in sorted(PROTOTYPE_E7M1_QUEST_IDS): + for qid in sorted(PROTOTYPE_E7M3_QUEST_IDS): row = id_to_row.get(qid) if not isinstance(row, dict): return f"error: missing quest {qid!r}" @@ -1166,7 +1321,7 @@ def _prototype_e7m2_completion_bundle_cross_ref_gate( skill_id_to_allowed_kinds: dict[str, list[str]], ) -> str | None: """Return a human-readable error if bundle refs fail cross-checks, else None.""" - for qid in sorted(PROTOTYPE_E7M1_QUEST_IDS): + for qid in sorted(PROTOTYPE_E7M3_QUEST_IDS): row = id_to_row.get(qid) if not isinstance(row, dict): continue @@ -1206,6 +1361,147 @@ def _prototype_e7m2_completion_bundle_cross_ref_gate( return None +def _prototype_e7m3_faction_roster_gate(faction_seen_ids: dict[str, str]) -> str | None: + """Return a human-readable error if E7M3 faction roster fails, else None.""" + ids = frozenset(faction_seen_ids.keys()) + if ids != PROTOTYPE_E7M3_FACTION_IDS: + return ( + "error: prototype E7M3 expects exactly faction ids " + f"{sorted(PROTOTYPE_E7M3_FACTION_IDS)!r}, got {sorted(ids)!r}" + ) + return None + + +def _prototype_e7m3_faction_freeze_gate(id_to_row: dict[str, dict]) -> str | None: + """Return a human-readable error if faction rows diverge from E7M3 freeze table, else None.""" + for fid, expected in PROTOTYPE_E7M3_FACTION_FREEZE.items(): + row = id_to_row.get(fid) + if not isinstance(row, dict): + return f"error: missing faction {fid!r}" + for key, expected_value in expected.items(): + if row.get(key) != expected_value: + return ( + f"error: faction {fid!r} must match E7M3 freeze table " + f"(expected {key}={expected_value!r}, got {row.get(key)!r})" + ) + return None + + +def _prototype_e7m3_faction_cross_ref_gate( + id_to_row: dict[str, dict], + faction_seen_ids: dict[str, str], +) -> str | None: + """Return a human-readable error if quest faction refs fail, else None.""" + known_factions = frozenset(faction_seen_ids.keys()) + for qid, row in id_to_row.items(): + gate_rules = row.get("factionGateRules") + if isinstance(gate_rules, list): + for gi, rule in enumerate(gate_rules): + if not isinstance(rule, dict): + continue + faction_id = rule.get("factionId") + if isinstance(faction_id, str) and faction_id not in known_factions: + return ( + f"error: quest {qid!r} factionGateRules[{gi}]: factionId {faction_id!r} " + "is not in the frozen prototype faction catalog" + ) + bundle = row.get("completionRewardBundle") + if isinstance(bundle, dict): + reputation_grants = bundle.get("reputationGrants") + if isinstance(reputation_grants, list): + for gi, grant in enumerate(reputation_grants): + if not isinstance(grant, dict): + continue + faction_id = grant.get("factionId") + if isinstance(faction_id, str) and faction_id not in known_factions: + return ( + f"error: quest {qid!r} completionRewardBundle.reputationGrants[{gi}]: " + f"factionId {faction_id!r} is not in the frozen prototype faction catalog" + ) + return None + + +def _prototype_e7m3_completion_bundle_freeze_gate(id_to_row: dict[str, dict]) -> str | None: + """Return a human-readable error if bundle contents diverge from E7M3 freeze table, else None.""" + for qid, expected in PROTOTYPE_E7M3_COMPLETION_BUNDLES.items(): + row = id_to_row.get(qid) + if not isinstance(row, dict): + return f"error: missing quest {qid!r}" + bundle = row.get("completionRewardBundle") + if not isinstance(bundle, dict): + return f"error: quest {qid!r} must include completionRewardBundle object" + actual = _normalize_e7m3_completion_bundle(bundle) + expected_normalized = _normalize_e7m3_completion_bundle(expected) + if actual != expected_normalized: + return ( + f"error: quest {qid!r} completionRewardBundle must match E7M3 freeze table " + f"(expected {expected_normalized!r}, got {actual!r})" + ) + return None + + +def _prototype_e7m3_grid_contract_shape_gate(id_to_row: dict[str, dict]) -> str | None: + """Return a human-readable error if grid contract quest shape fails, else None.""" + row = id_to_row.get(PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID) + if not isinstance(row, dict): + return f"error: missing quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r}" + + prereqs = row.get("prerequisiteQuestIds") + if prereqs != [PROTOTYPE_E7M3_GRID_CONTRACT_PREREQ_QUEST_ID]: + return ( + f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} prerequisiteQuestIds must be " + f"{[PROTOTYPE_E7M3_GRID_CONTRACT_PREREQ_QUEST_ID]!r}, got {prereqs!r}" + ) + + gate_rules = row.get("factionGateRules") + expected_gate = [ + { + "factionId": PROTOTYPE_E7M3_GRID_CONTRACT_GATE_FACTION_ID, + "minStanding": PROTOTYPE_E7M3_GRID_CONTRACT_MIN_STANDING, + } + ] + if gate_rules != expected_gate: + return ( + f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} factionGateRules must be " + f"{expected_gate!r}, got {gate_rules!r}" + ) + + steps = row.get("steps") + if not isinstance(steps, list) or len(steps) != 1: + return ( + f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} must have exactly one step" + ) + step = steps[0] + if not isinstance(step, dict): + return f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} step must be an object" + objectives = step.get("objectives") + if not isinstance(objectives, list) or len(objectives) != 1: + return ( + f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} must have exactly one objective" + ) + obj = objectives[0] + if not isinstance(obj, dict): + return ( + f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} objective must be an object" + ) + if obj.get("kind") != "inventory_has_item": + return ( + f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} objective kind must be " + "'inventory_has_item'" + ) + if obj.get("itemId") != PROTOTYPE_E7M3_GRID_CONTRACT_OBJECTIVE_ITEM_ID: + return ( + f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} objective itemId must be " + f"{PROTOTYPE_E7M3_GRID_CONTRACT_OBJECTIVE_ITEM_ID!r}, got {obj.get('itemId')!r}" + ) + if obj.get("quantity") != 1: + return ( + f"error: quest {PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID!r} objective quantity must be 1, " + f"got {obj.get('quantity')!r}" + ) + return None + + def _prototype_slice4_gate(track_skill_ids: list[str]) -> str | None: """Return a human-readable error if Slice 4 contract fails, else None.""" if len(track_skill_ids) != 1: @@ -1556,6 +1852,15 @@ def main() -> int: if not QUEST_SKILL_XP_GRANT_SCHEMA.is_file(): print(f"error: missing schema {QUEST_SKILL_XP_GRANT_SCHEMA}", file=sys.stderr) return 1 + if not FACTION_DEF_SCHEMA.is_file(): + print(f"error: missing schema {FACTION_DEF_SCHEMA}", file=sys.stderr) + return 1 + if not FACTION_GATE_RULE_SCHEMA.is_file(): + print(f"error: missing schema {FACTION_GATE_RULE_SCHEMA}", file=sys.stderr) + return 1 + if not REPUTATION_GRANT_ROW_SCHEMA.is_file(): + print(f"error: missing schema {REPUTATION_GRANT_ROW_SCHEMA}", file=sys.stderr) + return 1 skill_schema = json.loads(SKILL_SCHEMA.read_text(encoding="utf-8")) skill_validator = Draft202012Validator(skill_schema) @@ -1578,6 +1883,8 @@ def main() -> int: encounter_schema = json.loads(ENCOUNTER_DEF_SCHEMA.read_text(encoding="utf-8")) encounter_validator = Draft202012Validator(encounter_schema) quest_validator = _quest_def_validator() + faction_schema = json.loads(FACTION_DEF_SCHEMA.read_text(encoding="utf-8")) + faction_validator = Draft202012Validator(faction_schema) if not SKILLS_DIR.is_dir(): print(f"error: missing directory {SKILLS_DIR}", file=sys.stderr) @@ -1679,6 +1986,15 @@ def main() -> int: print(f"error: no *_quests.json files under {QUESTS_DIR}", file=sys.stderr) return 1 + if not FACTIONS_DIR.is_dir(): + print(f"error: missing directory {FACTIONS_DIR}", file=sys.stderr) + return 1 + + faction_files = sorted(FACTIONS_DIR.glob("*_factions.json")) + if not faction_files: + print(f"error: no *_factions.json files under {FACTIONS_DIR}", file=sys.stderr) + return 1 + seen_ids: dict[str, str] = {} id_to_category: dict[str, str] = {} skill_id_to_allowed_kinds: dict[str, list[str]] = {} @@ -1950,6 +2266,24 @@ def main() -> int: print(e5m3_encounter_cross_ref_err, file=sys.stderr) return 1 + faction_errors, faction_seen_ids, faction_id_to_row = _validate_faction_catalogs( + faction_files=faction_files, + faction_validator=faction_validator, + ) + if faction_errors: + print(f"content validation failed with {faction_errors} error(s)", file=sys.stderr) + return 1 + + e7m3_faction_roster_err = _prototype_e7m3_faction_roster_gate(faction_seen_ids) + if e7m3_faction_roster_err: + print(e7m3_faction_roster_err, file=sys.stderr) + return 1 + + e7m3_faction_freeze_err = _prototype_e7m3_faction_freeze_gate(faction_id_to_row) + if e7m3_faction_freeze_err: + print(e7m3_faction_freeze_err, file=sys.stderr) + return 1 + quest_errors, quest_seen_ids, quest_id_to_row = _validate_quest_catalogs( quest_files=quest_files, quest_validator=quest_validator, @@ -1958,9 +2292,9 @@ def main() -> int: print(f"content validation failed with {quest_errors} error(s)", file=sys.stderr) return 1 - e7m1_quest_err = _prototype_e7m1_quest_gate(quest_seen_ids) - if e7m1_quest_err: - print(e7m1_quest_err, file=sys.stderr) + e7m3_quest_roster_err = _prototype_e7m3_quest_roster_gate(quest_seen_ids) + if e7m3_quest_roster_err: + print(e7m3_quest_roster_err, file=sys.stderr) return 1 e7m1_prereq_err = _prototype_e7m1_quest_prerequisite_gate(quest_id_to_row) @@ -1996,6 +2330,24 @@ def main() -> int: print(e7m2_bundle_cross_ref_err, file=sys.stderr) return 1 + e7m3_faction_cross_ref_err = _prototype_e7m3_faction_cross_ref_gate( + quest_id_to_row, + faction_seen_ids, + ) + if e7m3_faction_cross_ref_err: + print(e7m3_faction_cross_ref_err, file=sys.stderr) + return 1 + + e7m3_bundle_freeze_err = _prototype_e7m3_completion_bundle_freeze_gate(quest_id_to_row) + if e7m3_bundle_freeze_err: + print(e7m3_bundle_freeze_err, file=sys.stderr) + return 1 + + e7m3_grid_contract_err = _prototype_e7m3_grid_contract_shape_gate(quest_id_to_row) + if e7m3_grid_contract_err: + print(e7m3_grid_contract_err, file=sys.stderr) + return 1 + print( "content OK: " f"{len(skill_files)} skill catalog file(s), " @@ -2009,6 +2361,7 @@ def main() -> int: f"{len(npc_behavior_files)} npc behavior catalog file(s), " f"{len(reward_table_files)} reward table catalog file(s), " f"{len(encounter_files)} encounter catalog file(s), " + f"{len(faction_files)} faction catalog file(s), " f"{len(quest_files)} quest catalog file(s), " f"{len(seen_ids)} unique skill id(s), " f"{len(item_seen_ids)} unique item id(s), " @@ -2018,6 +2371,7 @@ def main() -> int: f"{len(npc_behavior_seen_ids)} unique npc behavior id(s), " f"{len(reward_table_seen_ids)} unique reward table id(s), " f"{len(encounter_seen_ids)} unique encounter id(s), " + f"{len(faction_seen_ids)} unique faction id(s), " f"{len(quest_seen_ids)} unique quest id(s), " f"{len(track_skill_ids)} mastery track(s)" ) diff --git a/server/NeonSprawl.Server.Tests/Game/Quests/QuestCatalogTestPaths.cs b/server/NeonSprawl.Server.Tests/Game/Quests/QuestCatalogTestPaths.cs index 78f953f..26f0911 100644 --- a/server/NeonSprawl.Server.Tests/Game/Quests/QuestCatalogTestPaths.cs +++ b/server/NeonSprawl.Server.Tests/Game/Quests/QuestCatalogTestPaths.cs @@ -35,4 +35,12 @@ internal static class QuestCatalogTestPaths internal static string DiscoverRepoQuestRewardBundleSchemaPath() => QuestCatalogPathResolution.ResolveQuestRewardBundleSchemaPath(DiscoverRepoQuestsDirectory()); + + internal static string DiscoverRepoFactionGateRuleSchemaPath() => + Path.GetFullPath( + Path.Combine(DiscoverRepoQuestsDirectory(), "..", "schemas", "faction-gate-rule.schema.json")); + + internal static string DiscoverRepoReputationGrantRowSchemaPath() => + Path.GetFullPath( + Path.Combine(DiscoverRepoQuestsDirectory(), "..", "schemas", "reputation-grant-row.schema.json")); } diff --git a/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionCatalogLoaderTests.cs b/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionCatalogLoaderTests.cs index 37ead2a..50edc16 100644 --- a/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionCatalogLoaderTests.cs +++ b/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionCatalogLoaderTests.cs @@ -115,7 +115,10 @@ public class QuestDefinitionCatalogLoaderTests ], "completionRewardBundle": { "itemGrants": [{ "itemId": "survey_drone_kit", "quantity": 1 }], - "skillXpGrants": [{ "skillId": "salvage", "amount": 50 }] + "skillXpGrants": [{ "skillId": "salvage", "amount": 50 }], + "reputationGrants": [ + { "factionId": "prototype_faction_grid_operators", "amount": 15 } + ] }, "steps": [ { @@ -167,6 +170,36 @@ public class QuestDefinitionCatalogLoaderTests ] } ] + }, + { + "id": "prototype_quest_grid_contract", + "displayName": "Grid Contract", + "prerequisiteQuestIds": ["prototype_quest_operator_chain"], + "factionGateRules": [ + { + "factionId": "prototype_faction_grid_operators", + "minStanding": 15 + } + ], + "completionRewardBundle": { + "reputationGrants": [ + { "factionId": "prototype_faction_rust_collective", "amount": 10 } + ] + }, + "steps": [ + { + "id": "grid_contract_step_kit", + "displayName": "Deliver survey drone kit", + "objectives": [ + { + "id": "grid_contract_obj_kit", + "kind": "inventory_has_item", + "itemId": "survey_drone_kit", + "quantity": 1 + } + ] + } + ] } ] } @@ -188,6 +221,8 @@ public class QuestDefinitionCatalogLoaderTests File.Copy(QuestCatalogTestPaths.DiscoverRepoRewardGrantRowSchemaPath(), Path.Combine(schemaDir, "reward-grant-row.schema.json"), overwrite: true); File.Copy(QuestCatalogTestPaths.DiscoverRepoQuestSkillXpGrantSchemaPath(), Path.Combine(schemaDir, "quest-skill-xp-grant.schema.json"), overwrite: true); File.Copy(QuestCatalogTestPaths.DiscoverRepoQuestRewardBundleSchemaPath(), Path.Combine(schemaDir, "quest-reward-bundle.schema.json"), overwrite: true); + File.Copy(QuestCatalogTestPaths.DiscoverRepoFactionGateRuleSchemaPath(), Path.Combine(schemaDir, "faction-gate-rule.schema.json"), overwrite: true); + File.Copy(QuestCatalogTestPaths.DiscoverRepoReputationGrantRowSchemaPath(), Path.Combine(schemaDir, "reputation-grant-row.schema.json"), overwrite: true); return (root.FullName, questsDir, defSchemaPath, stepSchemaPath, objectiveSchemaPath); } @@ -238,7 +273,7 @@ public class QuestDefinitionCatalogLoaderTests // Act var catalog = LoadCatalog(questsDir, defSchemaPath, stepSchemaPath, objectiveSchemaPath); // Assert - Assert.Equal(4, catalog.DistinctQuestCount); + Assert.Equal(PrototypeE7M1QuestCatalogRules.ExpectedQuestIds.Count, catalog.DistinctQuestCount); } [Fact] @@ -250,7 +285,7 @@ public class QuestDefinitionCatalogLoaderTests // Act var catalog = LoadCatalog(questsDir, defSchemaPath, stepSchemaPath, objectiveSchemaPath); // Assert - Assert.Equal(4, catalog.DistinctQuestCount); + Assert.Equal(PrototypeE7M1QuestCatalogRules.ExpectedQuestIds.Count, catalog.DistinctQuestCount); Assert.Equal(1, catalog.CatalogJsonFileCount); Assert.True(catalog.TryGetQuest("prototype_quest_gather_intro", out var gather)); Assert.NotNull(gather); @@ -734,7 +769,7 @@ public class QuestDefinitionCatalogLoaderTests // Assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); var questCatalog = factory.Services.GetRequiredService(); - Assert.Equal(4, questCatalog.DistinctQuestCount); + Assert.Equal(PrototypeE7M1QuestCatalogRules.ExpectedQuestIds.Count, questCatalog.DistinctQuestCount); Assert.True(questCatalog.TryGetQuest("prototype_quest_gather_intro", out var gather)); Assert.NotNull(gather); Assert.Equal("Intro: Salvage Run", gather!.DisplayName); diff --git a/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionRegistryTests.cs b/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionRegistryTests.cs index 671f6f6..b48685c 100644 --- a/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionRegistryTests.cs +++ b/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionRegistryTests.cs @@ -260,7 +260,7 @@ public class QuestDefinitionRegistryTests Assert.Equal(GatherIntroId, questId); Assert.False(unknownNormalized); Assert.Equal("prototype_unknown", unknownQuestId); - Assert.Equal(4, list.Count); + Assert.Equal(PrototypeE7M1QuestCatalogRules.ExpectedQuestIds.Count, list.Count); Assert.Equal(PrototypeE7M1QuestCatalogRules.ExpectedQuestIds.Order(StringComparer.Ordinal), list.Select(q => q.Id)); foreach (var expectedId in PrototypeE7M1QuestCatalogRules.ExpectedQuestIds) { diff --git a/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionsWorldApiTests.cs b/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionsWorldApiTests.cs index bb1c333..40ee9ec 100644 --- a/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionsWorldApiTests.cs +++ b/server/NeonSprawl.Server.Tests/Game/Quests/QuestDefinitionsWorldApiTests.cs @@ -8,7 +8,7 @@ namespace NeonSprawl.Server.Tests.Game.Quests; public class QuestDefinitionsWorldApiTests { [Fact] - public async Task GetQuestDefinitions_ShouldReturnSchemaV1_WithFourFrozenQuestsInIdOrder() + public async Task GetQuestDefinitions_ShouldReturnSchemaV1_WithFrozenQuestsInIdOrder() { // Arrange await using var factory = new InMemoryWebApplicationFactory(); @@ -21,7 +21,7 @@ public class QuestDefinitionsWorldApiTests Assert.NotNull(body); Assert.Equal(QuestDefinitionsListResponse.CurrentSchemaVersion, body!.SchemaVersion); Assert.NotNull(body.Quests); - Assert.Equal(4, body.Quests.Count); + Assert.Equal(PrototypeE7M1QuestCatalogRules.ExpectedQuestIds.Count, body.Quests.Count); Assert.Equal( PrototypeE7M1QuestCatalogRules.ExpectedQuestIds.Order(StringComparer.Ordinal).ToArray(), body.Quests.Select(q => q.Id).ToArray()); diff --git a/server/NeonSprawl.Server/Game/Quests/PrototypeE7M1QuestCatalogRules.cs b/server/NeonSprawl.Server/Game/Quests/PrototypeE7M1QuestCatalogRules.cs index 0c168e0..e0512b7 100644 --- a/server/NeonSprawl.Server/Game/Quests/PrototypeE7M1QuestCatalogRules.cs +++ b/server/NeonSprawl.Server/Game/Quests/PrototypeE7M1QuestCatalogRules.cs @@ -17,12 +17,16 @@ public static class PrototypeE7M1QuestCatalogRules "prototype_quest_refine_intro", "prototype_quest_combat_intro", "prototype_quest_operator_chain", + "prototype_quest_grid_contract", ], StringComparer.Ordinal); /// Keep in sync with scripts/validate_content.py PROTOTYPE_E7M1_CHAIN_QUEST_ID. public const string ChainQuestId = "prototype_quest_operator_chain"; + /// Keep in sync with scripts/validate_content.py PROTOTYPE_E7M3_GRID_CONTRACT_QUEST_ID. + public const string GridContractQuestId = "prototype_quest_grid_contract"; + /// First frozen onboarding quest id (gather intro). public const string GatherIntroQuestId = "prototype_quest_gather_intro"; diff --git a/server/NeonSprawl.Server/Game/Quests/PrototypeE7M2QuestCatalogRules.cs b/server/NeonSprawl.Server/Game/Quests/PrototypeE7M2QuestCatalogRules.cs index 959425f..321638f 100644 --- a/server/NeonSprawl.Server/Game/Quests/PrototypeE7M2QuestCatalogRules.cs +++ b/server/NeonSprawl.Server/Game/Quests/PrototypeE7M2QuestCatalogRules.cs @@ -30,6 +30,9 @@ public static class PrototypeE7M2QuestCatalogRules [PrototypeE7M1QuestCatalogRules.ChainQuestId] = new( [new RewardGrantRow("survey_drone_kit", 1)], [new QuestSkillXpGrantRow("salvage", 50)]), + [PrototypeE7M1QuestCatalogRules.GridContractQuestId] = new( + [], + []), }.ToFrozenDictionary(StringComparer.Ordinal); /// Returns a human-readable error if a frozen quest lacks a completion bundle, otherwise . diff --git a/server/NeonSprawl.Server/Game/Quests/QuestDefinitionCatalogLoader.cs b/server/NeonSprawl.Server/Game/Quests/QuestDefinitionCatalogLoader.cs index 5d80031..1e456d1 100644 --- a/server/NeonSprawl.Server/Game/Quests/QuestDefinitionCatalogLoader.cs +++ b/server/NeonSprawl.Server/Game/Quests/QuestDefinitionCatalogLoader.cs @@ -451,6 +451,9 @@ public static class QuestDefinitionCatalogLoader if (_questDefSchema is not null) return; + var schemaDir = Path.GetDirectoryName(questDefSchemaPath)!; + CatalogSchemaRegistry.GetOrRegisterFromFile(Path.Combine(schemaDir, "faction-gate-rule.schema.json")); + CatalogSchemaRegistry.GetOrRegisterFromFile(Path.Combine(schemaDir, "reputation-grant-row.schema.json")); CatalogSchemaRegistry.GetOrRegisterFromFile(rewardGrantRowSchemaPath); CatalogSchemaRegistry.GetOrRegisterFromFile(questSkillXpGrantSchemaPath); CatalogSchemaRegistry.GetOrRegisterFromFile(questRewardBundleSchemaPath);