GENERATED VIEW · PRIVATE ARCHIVE · DO NOT SERVE
RobCo Industries · Archive Museum

DETERMINISTIC_FEATURES.md



RELEASE

planning/2.8.0/slates/DETERMINISTIC_FEATURES.md

sha256 964550c1d59aa0fc · 18922 bytes · original held in the private archive

# DETERMINISTIC_FEATURES.md — RobCo U.O.S. Stage B3 (Deterministic / Website-Powered Conversion) > **PLAN-ONLY.** Untracked. Implements nothing, commits nothing. Reframes/supersedes much of `AI_SLATE.md` (B2). > Baseline: `origin/main` @ `bc8c2eb` — v2.6.0, cache `robco-terminal-v2.6.0-r1`, 1078 tests / 89 suites. > **Owner reframe:** for EVERY AI-powered/AI-routed feature, if the LOCAL DATA computes it exactly, build it as a **deterministic website UI** — not a Gemini call. Deterministic = faster, offline, free (no user quota), no injection/grounding/cost risk. AI stays ONLY for genuinely **generative** output (banter, procedural fiction). --- ## 0. WHAT IS ALREADY NATIVE vs AI-ROUTED (verified in current code) **Already deterministic (the model to copy):** `NATIVE_COMMAND_ROUTER` in `api.js:894` — `[FEATURES]` (help modal), `[LOGS]` (error log), `[CROSSROADS]` (computes faction/quest/event analysis from `state` — `api.js:917`), `[SLEEP]` (heals + advances ticks), `[WAIT: X]` (advances ticks). These run **before** any network call (`api.js:1067`), mutate `state` locally, and re-render. Zero Gemini. **Everything else routes to AI via `macroCommand()` (`ui-core.js:1831`)** — it injects `> [CMD] target` into `#chatInput` and calls `transmitMessage()`, hitting Gemini. The COMM-LINK buttons `[THREAT]`, `[VATS SIM]`, `[TRADE]`, `[LOOT]` (`index.html:1846–1869`) ALL do this. The `modal` TRADE renderer (`api.js:1260`, `mType==='TRADE'`) displays **AI-returned** stock/prices. **The one partial exception — V.A.T.S. CALCULATOR (`showVATSOverlay()`, `ui-core.js:1057`):** already **pure client math** (reads PER/AGI from DOM, skills/chem-buffs from `state`, computes per-region hit %, read-only) — BUT it is a *simplified* formula, **hardcodes `targetDT = 0`** (dead constant — flagged in CODE_QUALITY QA-DEAD-6), ignores the equipped weapon's DB stats, and self-labels *"ACTUAL OUTCOME DETERMINED BY AI RESOLUTION… USE [VATS] COMMAND FOR CONTEXT-AWARE COMBAT ANALYSIS."* It is deterministic-but-incomplete and **defers authority to AI it shouldn't.** **Data on hand (the authority for conversion):** | Source | Schema (current columns) | Powers | |---|---|---| | `WEAPONS.CSV` (db_nv/db_fo3) | `Weapon_Name,Base_Damage,Crit_Damage,Crit_Multiplier,Attacks_Per_Second,Weight,Value,Req_Unarmed,Req_STR,Reach,Special_Attack_AP,Special_Rules,Ammo_Type` | VATS AP-strike, TTK, weapon info | | `ARMOR.CSV` | `Name,Type,DT,Weight,Value,Effects,Min_CND_Threshold` | DT lookup, armor info | | `AMMO.CSV` | (ammo rows) | ammo info, TRADE | | `BESTIARY.CSV` | `Name,DT,HP,Perception,Speed_Factor,Base_Damage,Attack_Rate,Weakness_Weapon,Attack_Type,Resistances,XP_Yield` | THREAT info + TTK | | `CHEMS.CSV` | `Name,Effect,Duration,Addiction_Risk,Addiction_Debuff,Chem_Family,Value,Weight` | BIO-SCAN advisory | | `VENDORS.CSV` | `Vendor_Name,Location,Base_Caps,Repair_Skill,Faction,Restock_Days,Accepted_Currencies` | TRADE vendor purse/skill | | `FALLOUT_REGISTRY` (reg_nv/reg_fo3) | items/perks/locations/quests/vendors/skillBooks/… | CONSULT, autocomplete | | `state` | `caps` `inventory[]` `equipped{weapon,armor,headgear}` `ammo{}` `skills{}` `hpCur/hpMax` `status[]` limbs | every economy/combat calc | | `lookupItemInDb()` (`api.js`, `_itemCache`) | name → row | the shared lookup primitive all of these reuse | --- ## 1. RECLASSIFICATION TABLE (every AI feature + every AI-routed command) | Feature / command | B2 verdict | **B3 verdict** | Why | |---|---|---|---| | **V.A.T.S. CALCULATOR** (`[VATS]`/`[VATS SIM]`/`[VS]`) | AI "context-aware" | **FULLY DETERMINISTIC** (complete the existing native calc) | Hit-chance + AP cost is a closed-form FNV/FO3 formula; weapon AP/skill/SPECIAL all local. Remove the "AI resolution" deferral. | | **TRADE / BARTER** (`[TRADE]`/`[TD]`) | SPEC-FIRST (AI) | **FULLY DETERMINISTIC core** (+ HYBRID banter optional) | Prices = base `Value` × canonical Barter formula; caps/inventory in `state`; mutation additive + confirm-gated. AI banter is flavor only. | | **THREAT** (`[THREAT]`/`[TH]`) | (implied AI) | **FULLY DETERMINISTIC** | `BESTIARY.CSV` lookup → info card + TTK/ammo-burn math vs equipped weapon. | | **AI-G CONSULT / databank** | SPEC-FIRST | **FULLY DETERMINISTIC** (drop AI default) | `registrySearch`/`lookupItemInDb` returns the exact record. AI only re-phrases — unnecessary; show the record. | | **AI-J BIO-SCAN** | SPLIT | **FULLY DETERMINISTIC** (core) + HYBRID phrasing | Limb status (`state`) + chem/addiction rules (`CHEMS.CSV`) compute the advisory exactly. | | **LOOT** (`[LOOT]`) | — | **HYBRID** (deterministic add-to-inventory UI; AI optional for *what* dropped) | Adding/valuing loot is deterministic (DB `Value`, additive inventory). Generating a *random drop table* from a defeated enemy is generative → optional AI/seeded-random. | | **[TACTICS]** (multi-companion guide) | — | **DETERMINISTIC-leaning / DEFER** | Mostly advice computable from state, but companion roster isn't modeled — defer until companion state exists. | | **AI-H INTERCEPT** | SPLIT | **AI-ONLY** (static lib core stays BUILD-NOW, non-data) | Procedural distress fiction; data can't compute it. Static library is canned content, not a data computation. | | **AI-A RADIO banter** | SPEC-FIRST | **AI-ONLY** | Generative ambiance; no data to compute. | | **AI-B AUDIO-LOG narration** | SPEC-FIRST | **AI-ONLY** (TTS) | Reads/voices freeform text. | | **AI-I SCAN AREA encounter gen** | SPEC-FIRST | **AI-ONLY** (seeded) | Procedural encounter fiction. | | **AI-K COMPANION MEMORY** | SPEC-FIRST (heaviest) | **AI-ONLY** | Generative stateful dialogue. | | **AI-L OVERSEER directive** | SPEC-FIRST | **AI-ONLY** | Procedural quest-hook fiction. | | **AI-C HACK-FAIL taunts** | SPLIT | **AI-ONLY** (static lib core BUILD-NOW, non-data) | Flavor text; static library is canned, not computed. | | **AI-D SHARE-TARGET → VISUAL UPLOAD** | SPEC-FIRST | **AI-ONLY** (image parse) | Vision parse is inherently generative. | | **AI-E AI-routed console commands** | SKIP | **SKIP** (confirmed) | Redundant; highest injection surface. | | **Open-ended COMM-LINK roleplay** | (core AI) | **AI-ONLY** (unchanged) | The generative heart of the app — stays AI. | **Headline conversion:** **5 features become fully native (no Gemini): VATS, TRADE-core, THREAT, CONSULT, BIO-SCAN-core.** Of those, **3 were B2 "SPEC-FIRST (AI)" items** (CONSULT/AI-G, TRADE/AI-F, plus BIO-SCAN/AI-J's split) that now move to **BUILD-NOW native**. **+1 HYBRID** (LOOT). The genuinely generative set (INTERCEPT, RADIO, AUDIO-LOG, SCAN, COMPANION, OVERSEER, HACK-taunt, SHARE-TARGET, roleplay) stays AI exactly as B2 specced. --- ## 2. FLAGSHIP DETERMINISTIC SPECS ### 2.1 VATS — complete the native calculator (FULLY DETERMINISTIC) **Reframe:** the calc already exists and is deterministic — this *completes* it and removes the AI deferral. Two modes, both pure client math: - **[VATS SIM] / AP-strike optimizer (melee/unarmed):** fully computable today. For the equipped (or chosen) weapon, read `Base_Damage`, `Attacks_Per_Second`, `Special_Attack_AP` from `WEAPONS.CSV` → show per-region AP cost, strikes affordable per AP pool, damage-per-AP, and the optimal region. No gap. - **Hit-% overlay:** keep the per-region table; **fix the gaps** — wire a real `targetDT` input (delete the dead `targetDT=0`), pull the **equipped weapon's** skill/AP from the DB instead of "best combat skill," and re-label as the authoritative estimate (drop "ACTUAL OUTCOME DETERMINED BY AI"). **Data sources:** `state.equipped.weapon` → `lookupItemInDb()` → `WEAPONS.CSV` row; `state.skills`; SPECIAL from DOM (`s_p`/`s_a`); `state.status[]` chem buffs; user-entered `targetDT` (+ optional distance). **Formula (deterministic; coefficients to confirm vs fallout.wiki at build — see §3 gap):** base hit from PER/AGI/weapon-skill, minus region modifier, minus `targetDT × k`, minus range falloff, clamped 5–95%. AP cost per region from the weapon row. The exact FNV/FO3 ranged-accuracy coefficient set is a **flagged data gap** (the weapon schema lacks spread/range columns). **UI (HOUSE_STANDARD + A7 + A2):** the existing `sysModal` overlay, upgraded — `> V.A.T.S. TACTICAL OVERLAY`, monospace region table with `#### · ` bars, a weapon selector + `targetDT`/distance number inputs (≥16px, ≥28px tap targets, labeled for SR per A2), `aria-live` on recompute. **Read-only — no state writes.** **Files:** `js/ui-core.js` (`showVATSOverlay` upgrade + AP-strike mode), `index.html` (inputs in the modal), `css/terminal.css`, `tests/check-persistence.{js,ps1}` (formula + AP-cost lookup guards), `sw.js`, docs. **Tags:** `[CACHE][TEST]` · offline · no `[NET]` · no `[DATA]` (read-only). ### 2.2 TRADE — native barter terminal (FULLY DETERMINISTIC core; AI banter HYBRID) **Reframe:** replace the AI-fed TRADE modal (`api.js:1260`) with a deterministic vendor UI. Barter is exact math; the AI was never needed for the transaction. **Data sources:** vendor purse/skill from `VENDORS.CSV` (`Base_Caps`, `Repair_Skill`, `Location`); catalog + prices from the items DB `Value` (weapons/armor/ammo/chems/misc) via `lookupItemInDb()`; player `state.caps`, `state.inventory[]`, `state.ammo{}`, `state.skills.barter`. **Barter formula (canonical FNV shape; exact coefficient confirm vs fallout.wiki — §3):** buy price = `ceil(base_Value × buyMult(barter))`, sell price = `floor(base_Value × sellMult(barter))`, where higher Barter lowers buy / raises sell; clamp to sane bounds; vendor cannot buy beyond `Base_Caps`. Prices recompute live as `state.skills.barter` changes. **State mutations — additive + confirm-gated (Protocol 34):** Buy → confirm modal → `state.caps -= price`, add item to `state.inventory[]`/`state.ammo{}` (additive push, never overwrite); Sell → confirm → `state.caps += price`, decrement/splice the item (clamp ≥0). Stamp checksum/schemaVersion via the existing save path. Reuse the **craft-style confirm gate** (`doCraft`/`doScrap` pattern). **No auto-push to cloud** (manual button only). **UI:** a TRADE panel/modal — vendor header (name, location, caps, barter skill), two columns (VENDOR STOCK / COURIER INVENTORY), each row = item · skill-adjusted price · `[BUY]`/`[SELL]` button (`.tracker-toggle`-style, ≥28px, `aria-label`), a live caps readout. HOUSE_STANDARD voice (`> BARTER UPLINK`, `CAPS: N`, `⚠ INSUFFICIENT CAPS`). **HYBRID (optional, SPEC-FIRST):** an AI "haggle" line voices flavor and may apply a **bounded** price delta within a clamp — purely cosmetic; the transaction math stays deterministic. Flag `aiTradeBanter`, fail-open, offline = no banter. **Files:** `index.html` (TRADE panel + remove/retire the AI TRADE modal path), `js/ui-render.js` (renderTrade + buy/sell), `js/api.js` (drop `[TRADE]` from AI macro routing; remove `mType==='TRADE'` AI render or repoint it), `js/state.js` (none new — uses existing caps/inventory/ammo), `css/terminal.css`, `tests/check-persistence.{js,ps1}` (price formula, additive+clamp+confirm guards, no-overwrite), `sw.js`, docs. **Tags:** `[DATA][CACHE][TEST]` · offline · **no `[NET]`** for the core (huge upgrade — was `[NET][DATA]` in B2). ### 2.3 THREAT — native bestiary + TTK (FULLY DETERMINISTIC) **Data sources:** `BESTIARY.CSV` row (`DT,HP,Base_Damage,Attack_Rate,Weakness_Weapon,Resistances,XP_Yield`) via lookup on the typed target; player's equipped weapon `Base_Damage`/`Attacks_Per_Second`/`Ammo_Type` from `WEAPONS.CSV`. **Logic:** info card (enemy stats) + **TTK = ceil(HP / max(1, (weaponDPS − DT)))**, weapon DPS = `Base_Damage × Attacks_Per_Second`, highlight `Weakness_Weapon`, estimate ammo-burn = shots-to-kill × per-attack ammo. Read-only. **UI:** `> THREAT ASSESSMENT` modal — enemy stat block + "TIME TO NEUTRALIZE" + "WEAKNESS" + "AMMO BURN EST." Empty/`NO ENTRY IN BESTIARY` when not found (refuse to invent — Protocol 3). **Files:** `js/ui-core.js` or `js/ui-render.js` (renderThreat), `js/api.js` (drop `[THREAT]` from AI macro), `index.html`, `css/terminal.css`, `tests/check-persistence.{js,ps1}`, `sw.js`, docs. **Tags:** `[CACHE][TEST]` · offline · read-only. ### 2.4 CONSULT — native databank lookup (FULLY DETERMINISTIC) **Data sources:** `FALLOUT_REGISTRY` + `databaseCSVs` via `registrySearch()`/`lookupItemInDb()`. **Logic:** `> CONSULT <topic>` → show the exact local record (item/perk/location/creature/quest). `NO ENTRY IN DATABANK` if absent. No AI phrasing in the default path (B2 already noted "lookup FIRST; AI only phrases" — B3 drops the AI entirely for the default; phrasing can be a later optional toggle). **UI:** `> DATABANK QUERY` modal/inline result + reuse the registry autocomplete. Add `[CONSULT]` to `NATIVE_COMMAND_ROUTER` (mirrors `[CROSSROADS]`). **Files:** `js/api.js` (`NATIVE_COMMAND_ROUTER` entry + handler), `js/ui-render.js` (result render), `index.html` (optional button), `tests/check-persistence.{js,ps1}`, `sw.js`, docs. **Tags:** `[CACHE][TEST]` · offline. ### 2.5 BIO-SCAN — native medical advisory (FULLY DETERMINISTIC core) **Data sources:** limb states (`state.la/ra/ll/rl/hd`), `state.hpCur/hpMax`, `state.status[]` (active effects/addictions), `CHEMS.CSV` (`Addiction_Risk`, `Addiction_Debuff`, `Effect`). **Logic:** rules → "RIGHT LEG CRIPPLED — STIMPAK ADVISED", "ADDICTION RISK: MED-X (active)", HP %, limb summary. Pure local rules, read-only. **UI:** `> BIO-SCAN ADVISORY` modal — limb grid + advisories. Add `[BIO-SCAN]` to the native router. **HYBRID:** optional AI-phrased bedside-manner version (SPEC-FIRST, flagged) — core works offline with zero network. **Files:** `js/ui-render.js`/`ui-core.js` (renderBioScan), `js/api.js` (native router entry), `index.html`, `tests/check-persistence.{js,ps1}`, `sw.js`, docs. **Tags:** `[CACHE][TEST]` · offline · read-only. ### 2.6 LOOT — HYBRID (deterministic add/value; optional generative drop) **Deterministic part (BUILD-NOW):** an "add loot to inventory" flow — pick item(s) from the DB, additive push to `state.inventory[]`/`ammo{}`, value from DB `Value`, confirm-gated. **Generative part (optional AI/seeded):** *what* a defeated enemy drops (a randomized drop table) is not in the data — either a seeded local random table or AI. Keep the add/value math deterministic regardless. **Files:** `js/ui-render.js`, `js/api.js` (drop `[LOOT]` AI macro or repoint), `index.html`, `tests/*.{js,ps1}`, `sw.js`, docs. **Tags:** `[DATA][CACHE][TEST]` · core offline. --- ## 3. DATA GAPS FLAGGED (cross-ref CONTENT_AUDIT — fallout.wiki only, Protocol 3) These are the honest gaps where the local data does **not** fully compute a feature; surface before building, fill from fallout.wiki, and add to CONTENT_AUDIT's correction backlog: 1. **No per-vendor stock lists.** `VENDORS.CSV` has vendor *metadata* (caps, repair skill, location) but **no vendor→items mapping.** TRADE's deterministic catalog therefore uses the **full items DB** (optionally filtered by category) as available stock, with `Base_Caps` as the vendor's purse. A true per-vendor inventory would need new data (a `VENDOR_STOCK` mapping) — **flag as an optional data-enrichment, not a blocker.** 2. **Weapon schema is melee/AP-oriented; no ranged spread/range-falloff.** `WEAPONS.CSV` has `Special_Attack_AP`, `Reach`, `Req_Unarmed` but **no ranged spread, range, or DAM-falloff columns.** The melee/unarmed AP-strike optimizer is fully exact; the **ranged hit-% coefficient set must be sourced from fallout.wiki** (or the schema extended) — flag the exact FNV/FO3 accuracy formula as a build-time confirm. 3. **Barter price coefficient.** The canonical FNV barter multiplier (buy/sell vs Barter skill) must be confirmed against fallout.wiki at build — present the formula *shape*, lock the coefficient at implementation (Protocol 3: data is authority, AI/assumption is not). 4. **Ammo per-attack count** for ammo-burn (THREAT/VATS) isn't a column — derive conservatively (1/attack default) or extend the schema; flag. --- ## 4. FEEDS THE SYNTHESIS RE-RUN (MASTER_PLAN update needed) DETERMINISTIC_FEATURES.md **changes the master plan**: the five conversions must **move out of Phase G (AI, App-Check-gated)** and into the **native BUILD-NOW set** (Phase F-adjacent — offline, no `[NET]`, no App Check). Concretely, when Stage C re-runs: - Add work-units **WU-N1 VATS-complete, WU-N2 TRADE-native, WU-N3 THREAT-native, WU-N4 CONSULT-native, WU-N5 BIO-SCAN-native** (+ WU-N6 LOOT-hybrid) to the **native** phase, each `[CACHE][TEST]` (N2/N6 also `[DATA]` additive/confirm-gated), **none `[NET]`, none gated on WU-G0 App Check.** - **Shrink Phase G** to the genuinely-generative residue (INTERCEPT, RADIO, AUDIO-LOG, SCAN, COMPANION, OVERSEER, HACK-taunt, SHARE-TARGET, roleplay). - These native units depend on Phase A UI standards (UI-1..5, `.tracker-toggle`) + Phase A2/A1 a11y, and on the data-gap fixes in §3 (sequence after the relevant CONTENT_AUDIT/WU-D corrections where a formula needs the data). - The B2 "SPEC-FIRST AI count" drops by 3 (CONSULT, TRADE, BIO-SCAN-phrasing-core); TRADE/BIO-SCAN retain a thin **optional** HYBRID AI banter unit (SPEC-FIRST) that no longer blocks the feature. --- ## 5. SUMMARY FOR THE OWNER - **5 features convert to fully native, offline, free (no Gemini):** VATS (complete the existing calc + kill the AI deferral), TRADE-core (barter math + additive/confirm-gated caps/inventory), THREAT (bestiary + TTK), CONSULT (databank lookup), BIO-SCAN-core (limb/chem advisory). **+1 HYBRID:** LOOT (deterministic add/value; optional generative drop). - **3 B2 "AI / SPEC-FIRST" items become native BUILD-NOW** (CONSULT/AI-G, TRADE/AI-F, BIO-SCAN/AI-J core), plus THREAT and VATS stop deferring to AI. TRADE drops from `[NET][DATA]` to **`[DATA]`-only, offline** — the single biggest upgrade. - **What stays AI (unchanged from B2):** INTERCEPT, RADIO, AUDIO-LOG, SCAN AREA, COMPANION MEMORY, OVERSEER, HACK-FAIL taunt (AI variant), SHARE-TARGET vision parse, and open-ended COMM-LINK roleplay — all genuinely generative; the data cannot compute them. AI-E console commands stay SKIP. - **VATS is already deterministic** — it just needs completing (real `targetDT` input, equipped-weapon DB stats, drop the "AI resolves it" label) and an AP-strike mode that the weapon data already supports exactly. - **Data gaps flagged** (Protocol 3, cross-ref CONTENT_AUDIT): no per-vendor stock lists; weapon schema lacks ranged spread/range; barter coefficient + ammo-per-attack need fallout.wiki confirmation. None block the melee/economy cores. - **Next:** this doc feeds a **re-run of the Stage C synthesis** — the master plan must move these five out of the AI phase into the native BUILD-NOW set (no `[NET]`, no App-Check dependency). --- *DETERMINISTIC_FEATURES.md — Stage B3, plan-only. No code changed, nothing committed.*
STAMP · generated for RELEASE v2.8.5 commit 06e5180 (06e51801b38a) · archive input-tree hash c07fbfbdd2e1ddeb · 754 files · no wall-clock timestamp (regenerates identically when nothing changed).