Describes a backtest tool that applies a rulebook to a synthetic week of recorded events, explaining the sample files, how to run it, and what the resulting report shows for the aisle-5 robot limit and related rules. Source: README.md — Neuroverseos-governance Brought in: 2026-11-22 18 understandings read from it. - Every event in `sample-week.ts` / `sample-week.jsonl` is made up and generated the same way every time, as an illustrative synthetic sample week not from a real store. — 2026-10-18 - The backtest is run with `npx tsx examples/backtest/backtest.ts`. — 2026-10-18 - `backtest.ts` runs the backtest, prints the report, then compares limit 2 with limit 3 on the same week. — 2026-10-18 - For this week the aisle-5 rule would have blocked 11 entries that the record says happened, since the rule was not live when the week was recorded. — 2026-10-18 - Three Wednesday-evening requests could not be decided at all because the log carried no `robotsInZone`. — 2026-10-18 - `back_room_evening_approval` never fired. — 2026-10-18 - The shopper-photo override and the lunchtime-audio contradiction both occurred. — 2026-10-18 - `open_door` is a gap. — 2026-10-18 - Raising the limit to three newly allows exactly the seven third-robot entries and nothing else. — 2026-10-18 - The event format is SPEC.md § 13: `{ at, request, outcome? }`, in time order, where `request` is exactly what `evaluateDomainAction` receives and `outcome` is `happened`, `did_not_happen` or `unknown` — reported, never decided on. — 2026-10-18 - A store manager writes a rule — "only two robots can be in aisle 5 at the same time" — and before it goes live asks what the rulebook would have decided for last week's recorded requests. — 2026-10-18 - `backtest(rulebook, events)` is pure, deterministic, uses no model and no clock, with every time coming from the log. — 2026-10-18 - The site supplies the recorded events and the facts each one carried, and the tool only applies the rules. — 2026-10-18 - The tool says what the rules would have decided but never says why things happened. — 2026-10-18 - `rulebook.ts` holds the sample site: the grocery template, the switchboard's grocery vocabulary, aisle 5, a `robotsInZone` count fact every request must bring, the rule under test (`aisle5_robot_limit`, limit 2 — `sampleSite(3)` gives the proposed version), a history rule (`scan_budget`), the grocery example's manager rules (two deliberately at odds with the company's answers), and one rule nothing ever reaches. — 2026-10-18 - `sample-week.ts` covers seven days, Mon 2026-10-05 to Sun 2026-10-11, with 189 hand-structured events: robots file into aisle 5 one after another (a fourth on four days); three events with no occupancy count and one with no people count; a shopper's photo and a lunchtime voice note that hit the conflicting rules; five scans of one aisle in an hour; a planner asking for an action the rulebook does not know; a Saturday-afternoon restock, a fire alarm, a robot after hours; each event carries an `outcome` — what the imaginary record says happened next. — 2026-10-18 - `sample-week.jsonl` is the same week written out by `backtest.ts`, one event per line after a header record, and the switchboard's importer skips the header. — 2026-10-18 - `sample-week.jsonl` can be imported in the switchboard's Test mode or fed to your own tooling. — 2026-10-18 ## Who, where and what Places: [[Bevia/World/Places/aisle 5|aisle 5]] Things: [[Bevia/World/Things/aisle5_robot_limit|aisle5_robot_limit]], [[Bevia/World/Things/back_room_evening_approval|back_room_evening_approval]], [[Bevia/World/Things/backtest.ts|backtest.ts]], [[Bevia/World/Things/backtest(rulebook, events)|backtest(rulebook, events)]], [[Bevia/World/Things/did_not_happen|did_not_happen]], [[Bevia/World/Things/evaluateDomainAction|evaluateDomainAction]], [[Bevia/World/Things/examples-backtest-backtest.ts|examples/backtest/backtest.ts]], [[Bevia/World/Things/happened|happened]], [[Bevia/World/Things/open_door|open_door]], [[Bevia/World/Things/outcome|outcome]], [[Bevia/World/Things/robotsInZone|robotsInZone]], [[Bevia/World/Things/rulebook.ts|rulebook.ts]], [[Bevia/World/Things/sample-week.jsonl|sample-week.jsonl]], [[Bevia/World/Things/sample-week.ts|sample-week.ts]], [[Bevia/World/Things/sampleSite(3)|sampleSite(3)]], [[Bevia/World/Things/scan_budget|scan_budget]], [[Bevia/World/Things/SPEC.md § 13|SPEC.md § 13]] ## Connections to other sources - **Echoes** — Both stress determinism: no model or clock, and deterministic rules on stated facts. - Here: `backtest(rulebook, events)` is pure, deterministic, uses no model and no clock, with every time coming from the log. — 2026-10-18 - There: NeuroverseOS decides at runtime with deterministic rules on stated facts. — from [[Bevia/World/Sources/NeuroverseOS-Neuroverseos-governance- RELATED-WORK|NeuroverseOS/Neuroverseos-governance: RELATED-WORK]] — 2026-10-18 - **Emerging** — One defines the backtest signature and input shape; the other adds that it is pure and deterministic with time taken from the log. - Here: `backtest(rulebook, events)` is pure, deterministic, uses no model and no clock, with every time coming from the log. — 2026-10-18 - There: backtest(rulebook, events, options?) replays a recorded log — [{ at, request, outcome? }] in time order — through a rulebook and reports what it would have dec… — from [[Bevia/World/Sources/NeuroverseOS-Neuroverseos-governance- docs-provenance-robot-domain-rules-CHANGEL|NeuroverseOS/Neuroverseos-governance: docs/provenance/robot-domain-rules-CHANGEL]] — 2026-10-18 - **Same point** — Both describe the backtest printing a report and comparing a limit of three against another limit. - Here: `backtest.ts` runs the backtest, prints the report, then compares limit 2 with limit 3 on the same week. — 2026-10-18 - There: backtest.ts prints the report and the comparison with "at most three", and writes sample-week.jsonl. — from [[Bevia/World/Sources/NeuroverseOS-Neuroverseos-governance- docs-provenance-robot-domain-rules-CHANGEL|NeuroverseOS/Neuroverseos-governance: docs/provenance/robot-domain-rules-CHANGEL]] — 2026-10-18 - **Same point** — Both say the sample week JSONL can be loaded in the switchboard's Test mode. - Here: `sample-week.jsonl` can be imported in the switchboard's Test mode or fed to your own tooling. — 2026-10-18 - There: Switchboard Test mode can load the sample week (with its site) or import a JSON/JSONL log. — from [[Bevia/World/Sources/NeuroverseOS-Neuroverseos-governance- docs-provenance-robot-domain-rules-CHANGEL|NeuroverseOS/Neuroverseos-governance: docs/provenance/robot-domain-rules-CHANGEL]] — 2026-10-18