From 7347b3b3b380985f498a7d4525cf364ab85fe1a7 Mon Sep 17 00:00:00 2001 From: VinPropane Date: Tue, 16 Jun 2026 17:50:07 -0400 Subject: [PATCH] NEO-139: reset faction standing before default Bruno GET. Seq 2 pre-request clears prototype faction rows so re-runs pass after operator-chain flows leave +15 standing. --- .../Get faction standing default.bru | 8 +++++-- .../faction-standing/folder.bru | 4 ++-- .../scripts/bruno-dev-fixture-helper.js | 21 +++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/bruno/neon-sprawl-server/faction-standing/Get faction standing default.bru b/bruno/neon-sprawl-server/faction-standing/Get faction standing default.bru index b5a620b..3144d25 100644 --- a/bruno/neon-sprawl-server/faction-standing/Get faction standing default.bru +++ b/bruno/neon-sprawl-server/faction-standing/Get faction standing default.bru @@ -6,8 +6,12 @@ meta { docs { NEO-139: per-player standing snapshot for all catalog factions. - Fresh in-memory server (or reset standing) returns neutral 0 for both prototype factions. - Postgres may retain prior standing until reset — restart server or clear player_faction_standing for dev-local-1. + Pre-request clears prototype faction standing via POST …/__dev/quest-fixture resetFactionIds so re-runs stay neutral after seq 4 or quest-progress operator-chain flows. +} + +script:pre-request { + const { resetPrototypeFactionStanding } = require("./scripts/bruno-dev-fixture-helper"); + await resetPrototypeFactionStanding(bru); } get { diff --git a/bruno/neon-sprawl-server/faction-standing/folder.bru b/bruno/neon-sprawl-server/faction-standing/folder.bru index 89b2cb6..de51b0d 100644 --- a/bruno/neon-sprawl-server/faction-standing/folder.bru +++ b/bruno/neon-sprawl-server/faction-standing/folder.bru @@ -3,6 +3,6 @@ meta { } docs { - Run seq 1–3 on a fresh dev player for neutral standing defaults. - Seq 4 (operator chain) leaves Grid Operators standing at 15 — re-run seq 2 only after server restart or standing reset, or expect non-zero values. + Run seq 2 self-resets faction standing before asserting neutral defaults. + Seq 4 (operator chain) leaves Grid Operators standing at 15 — expected; re-run seq 2 anytime to verify reset + neutral read. } diff --git a/bruno/neon-sprawl-server/scripts/bruno-dev-fixture-helper.js b/bruno/neon-sprawl-server/scripts/bruno-dev-fixture-helper.js index b998ced..89ec479 100644 --- a/bruno/neon-sprawl-server/scripts/bruno-dev-fixture-helper.js +++ b/bruno/neon-sprawl-server/scripts/bruno-dev-fixture-helper.js @@ -47,6 +47,25 @@ const ALL_PROTOTYPE_QUEST_IDS = [ "prototype_quest_refine_intro", ]; +const PROTOTYPE_FACTION_IDS = [ + "prototype_faction_grid_operators", + "prototype_faction_rust_collective", +]; + +async function resetPrototypeFactionStanding(bru) { + const { baseUrl, playerId, jsonHeaders } = resolveConfig(bru); + const response = await axios.post( + `${baseUrl}/game/players/${playerId}/__dev/quest-fixture`, + { schemaVersion: 1, resetFactionIds: PROTOTYPE_FACTION_IDS }, + jsonHeaders, + ); + if (response.status !== 200 || response.data?.applied !== true) { + throw new Error( + `quest-fixture resetFactionIds failed: ${response.status} ${JSON.stringify(response.data)}`, + ); + } +} + async function assertAllPrototypeQuestsNotStarted(bru) { const { baseUrl, playerId } = resolveConfig(bru); const response = await axios.get(`${baseUrl}/game/players/${playerId}/quest-progress`, { @@ -91,7 +110,9 @@ module.exports = { resetAllPrototypeQuestProgress, resetGatherIntroQuestProgress, resetGatherIntroSpine, + resetPrototypeFactionStanding, clearInventory, assertAllPrototypeQuestsNotStarted, ALL_PROTOTYPE_QUEST_IDS, + PROTOTYPE_FACTION_IDS, };