Skip to content

feat(ADR-0015): doom as nine-stream accumulating rate — no printed deltas#643

Merged
PipFoweraker merged 4 commits into
mainfrom
adr-0015-doom-streams
Jul 15, 2026
Merged

feat(ADR-0015): doom as nine-stream accumulating rate — no printed deltas#643
PipFoweraker merged 4 commits into
mainfrom
adr-0015-doom-streams

Conversation

@PipFoweraker

Copy link
Copy Markdown
Owner

ADR-0015 — doom as a nine-stream accumulating rate (no printed deltas)

Implements ADR-0015 on the fully-vetoed DQ-21 intermediary semantics. Doom is now an accumulating rate computed each day tick from a sum of named streams, each fed by a world-state intermediary. No action or event writes doom directly. Reproduces the L1 calibration (docs/balance/L1_CALIBRATION_2026-07-14.md) within tolerance.

Base: origin/main@4a0f4ae (the #638 calibration squash). Regression is measured, not asserted.

The nine streams (DQ-21)

doom_rate = Σ streamsdoom_level += rate each tick. baseline←ambient_risk · overhang←frontier−safety_absorption (max over actors, clamped ≥0 v1) · diffusion←general_capability · compute←dedicated_ai_compute · panic←global_panic · alarm←−global_alarm (native-negative) · ledger (routed input) · technical_debt · pulse:* (hooked, no content) · momentum (gated modifier). political_pressure/global_compute are gate/derivation-only.

What changed

  • doom_system.gd rewritten: streams read intermediaries via _advance_intermediaries (flow→stock); single-authority integration; per-stream API (get_doom_rate/get_doom_level/get_stream_contributions/get_dominant_stream) for the F3 overlay + two-instrument readouts; N=6-month trend telemetry invariant as a LOUD flag (never a clamp).
  • Rivals→frontier→overhang: rivals.gd raises capability_progress (its frontier_capability slice) + global_panic; the overhang stream converts it. The per-action doom literals, CAPABILITY_OVERHANG_DOOM_PER_PROGRESS, and the per_tick_doom_scale shim are retired.
  • Ledger bills route via add_stream_input("ledger", …) — a stream input, not a parallel level write (completes the balance: L1 recalibration — dials 1-4 applied + iteration log #638 single-authority fix; no clobber).
  • Momentum is a gated stream-level modifier (doom.momentum_enabled/weight preserved, mid-run toggle-safe).
  • Intermediaries added to GameState (+ reset + save/load).
  • No printed deltas: code doom writes in actions.gd/upgrades.gd/turn_manager.gd migrated to intermediaries (frontier/absorption/alarm/panic).

Regression (72-run sweep, same seeds/policies — calibrated → migrated)

policy calibrated migrated
do_nothing 14 (13–15) 14.0 (14–15)
reserve_heavy 19 19.5 (17–21)
greedy 7 (min 6) 7.5 (min 7) ✅ T9
loan_desperation 7, ledger 7.0, 8/8 ledger ✅ T9
safety_lean 16.5 18.0 🟠 +1.5 (in n=8 variance)
random_walk 8, ledger 6.0, 30/30 ledger 🟠 −2 (ledger-rooted)

MORTALITY: max 26 mo, 0 immortal (« 400). do_nothing median 14 ✅ · T9 floor ≥6 all standard ✅ · ordering greedy≈loan≈random < do_nothing < safety < reserve ✅ · loan ledger-rooted ✅. Coefficient table + per-stream rationale + deviations: docs/balance/DOOM_STREAMS_v1.md.

Legacy §6 shopping-list execution (15 items)

Follow-ups flagged (v1 hooks, not this lane)

  • Event-content doom (data/events/*.json) — the un-migrated clobber remainder (Legacy Add multiple opponent labs as events with stats tracking #15 / memo §7.1); inert no-ops today, re-authored to intermediaries by a content lane. The generic add_resources/resource_accessor doom sinks are annotated as this remainder.
  • Scheduled pulses / typed dampers — engine + gates wired, no content (R2-Q4/Q5/Q6).
  • Founder safety-action intermediary pricing — priced at 0 in v1 (influence flows via the researcher advance).
  • R2-Q9 stream clamp — hazard streams clamp ≥0 v1; the natively-negative alarm stream is exempt (LOUD REVISIT MARKER in code).

FLAGSHIP — for review, do not merge.

🤖 Generated with Claude Code

…ltas

Restructure doom into the DQ-21 nine-stream model: doom_rate = sum of named
streams (baseline/overhang/diffusion/compute/panic/alarm/ledger/tech-debt/
pulses + gated momentum), each fed by a world-state intermediary on GameState
(ambient_risk, frontier_capability map w/ player slice, general_capability,
global_compute, dedicated_ai_compute, safety_absorption, global_alarm,
global_panic, political_pressure gate-only). No action/event writes doom.

- rivals: per-action doom literals + CAPABILITY_OVERHANG_DOOM_PER_PROGRESS +
  per_tick_doom_scale shim RETIRED; rivals raise capability_progress (their
  frontier slice) + global_panic; overhang stream converts stock to hazard
- ledger doom routes as a named stream input (single-authority, no clobber)
- momentum: gated stream-level modifier (momentum_enabled/weight preserved)
- N=6-month negative-trend telemetry invariant (loud flag, never a clamp)
- per-stream API for F3 overlay + two-instrument rate/level readouts
- code doom writes in actions/upgrades/turn_manager migrated to intermediaries
- Legacy #6 list executed (see PR body); event-JSON content doom flagged as
  the remaining follow-up (inert no-ops today)

Regression: 72-run sweep reproduces the L1 calibration headline within
tolerance (do_nothing 14.0; T9 floor >=6; mortality max 26/0 immortal;
loan_desperation 8/8 ledger-rooted; policy ordering preserved).
Coefficients + rationale: docs/balance/DOOM_STREAMS_v1.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

PipFoweraker and others added 2 commits July 15, 2026 10:47
- Quantize doom-adjacent live floats (streams, stocks, level, momentum) to a
  BINARY-EXACT grid (2^-20). Godot's JSON parse is not correctly-rounded
  (calibration section 7.2); power-of-two-grid doubles round-trip losslessly,
  so save/load + the "next turn identical" replay stay bit-stable. Sweep
  medians are byte-identical (grid ~1e-6, far below any gameplay scale).
- Migrate the doom-assertion unit tests to ADR-0015: safety_research/audit/
  team_building/desperation_lever assert intermediary writes (absorption),
  not a printed doom delta. test_liability_ledger detaches doom_system so the
  ledger's isolated synchronous-doom soak keeps its hand-rolled arithmetic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PipFoweraker
PipFoweraker force-pushed the adr-0015-doom-streams branch from cbad24d to 4a4bc85 Compare July 15, 2026 05:56
A sustained N=6-month negative doom trend is LEGAL play (only the exploit
sweep gates on it), but push_warning surfaced it as an engine fault — and GUT
counts any warning pushed during a sim run as a test failure (the non-blocking
Simulation gate: test_seed_schedule + others tripped "Unexpected Errors").
Emit the telemetry as a tagged print instead: still loud in logs/telemetry,
no longer a false engine warning. Determinism was never affected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PipFoweraker
PipFoweraker merged commit 74074c8 into main Jul 15, 2026
15 of 16 checks passed
@PipFoweraker
PipFoweraker deleted the adr-0015-doom-streams branch July 15, 2026 08:27
PipFoweraker added a commit that referenced this pull request Jul 15, 2026
Verified current main (post #636/#638/#639/#640/#641/#643 merge stack)
launches clean headless, plays a full month through the End Turn ->
MonthController path, and passes the fast unit gate CI runs
(345 tests, 0 failures, 36/36 files). Nine-stream doom, finance offers,
and flight recorder all pass their unit suites with no wiring gaps
found. No code changes needed -- green light for tomorrow.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
PipFoweraker added a commit that referenced this pull request Jul 15, 2026
…ats -> stream base

Merged origin/main (74074c8, ADR-0015 nine-stream doom). Framework is orthogonal to
the doom internals — clean merge, no conflicts, and all three instruments ran clean
against stream-based doom (no breakage). Refreshed numbers + caveats now read "on
nine-stream doom (post-#643)" instead of "pre-migration".

Ordering is migration-robust:
- Policy sweep: safety_lean 18.0 best, balanced_operator 16.0, fundraise_first 14.5
  (still beats loan_desperation_reactive 13.0), passive 14.5 (~= calibrator do_nothing
  14.0, cross-harness anchor holds), capability_rush 7.0 / loan_hoard 5.0 worst. T9
  HOLDS for all reactive standard lines.
- Desperation solver: the trap SURVIVED and got STEEPER on stream doom — lever@always
  now -5.0 median months (was -2.5), doom->ledger death conversion total (2 -> 12/12).
  Added two bullets to DESPERATION_SOLVER.md so the divergence isn't misread: the
  solver (isolates the mechanic) is the trap's instrument; the opening book's
  near-neutral lone-lever signal is a lever washed out among random picks, not a
  contradiction.
- Opening book: winners over-index on money-in + doom-down (apply_grant +1.67,
  fundraise_big, publish_paper); losers on safety_research, take_loan,
  hire_capability_researcher.

Determinism re-verified (policy sweep identical across runs). Full suite green
(quick 355 / sim 93 / integration 14).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PipFoweraker added a commit that referenced this pull request Jul 15, 2026
…r (unified harness) (#642)

* feat(balance): EE-9 reactive-policy framework + solver + EE-10 opening-book miner

Tooling-only balance instruments (tests/manual, excluded from CI). No gameplay
code changed.

EE-9 · Reactive rule-policy framework (reactive_policy.gd): a policy = ordered
(condition -> action) rules evaluated at the plan phase (action priority) and per
response window (verb), reading a features snapshot (cash, runway, doom, reserve,
ledger load, offers). Declarative + parameterized so future sweeps vary the dials.

Named policies (sweep_policies.gd): fundraise_first (the new standard finance line
— fundraise by default, loan only when runway < N months), balanced_operator,
scout_heavy (proxy pending DQ-18 scouting), loan_desperation (naive foil), plus the
five exploit-sweep dispositions re-expressed as reactive policies (unit-tested to
reproduce the old _choose_actions priority — the "keep existing policies working"
regression link).

MonthRunner: deterministic headless driver of the real L1 month loop (plan ->
day-tick playback -> window auto-pause -> boundary), shared by all three instruments.

test_l1_month_sweep.gd — month-grain sibling of the exploit sweep (kept untouched).
test_desperation_solver.gd — EE-9 solver-bot isolating the desperation lever (DQ-25).
test_opening_book_miner.gd — EE-10: random opening prefix + fixed continuation,
feature -> outcome deciles, raw CSV.

Framework unit tests + full suite + determinism verified green. Outputs carry a
prominent pre-migration caveat and a one-line regenerate command (DQ-21 re-run).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(balance): unify EE-9/EE-10 onto the calibrator's harness; regen on calibrated base

Correction round (PR #642): the earlier work branched a stale origin/main (58a5a17,
pre-calibration). Rebased onto true main (4a0f4ae calibration + ef06ec1 #641 L5
finance).

Harness unification (fixes the two-month-runners smell):
- Extracted the calibrator's run loop (test_l1_month_sweep.gd _run/_answer_windows)
  VERBATIM into l1_month_driver.gd — one shared driver. Parity verified: the
  calibrator's regenerated docs/balance/L1_sweep_runs.csv is BYTE-IDENTICAL to the
  tracked calibration copy, so the extraction is outcome-neutral and the calibration
  table stands unchanged.
- test_l1_month_sweep.gd now delegates to the driver (LegacyPolicyAdapter); its
  policies + reporting are untouched. Deleted the parallel month_runner.gd.
- reactive_adapter.gd bridges reactive policies (ReactivePolicy) to the driver, with
  the opening-prefix override seam for EE-10.
- Renamed the reactive policy loan_desperation -> loan_desperation_reactive to avoid
  colliding with the calibrator's loan_desperation.

Regenerated ALL data on calibrated constants (runs now last months, so strategy
expresses):
- Policy headline (docs/balance/POLICY_SWEEP.md): safety_lean 18.5 mo best, passive
  14.0 (== calibrator do_nothing, cross-harness anchor), fundraise_first 14.0 beats
  loan_desperation_reactive 13.0, capability_rush 6.0 worst. T9 floor HOLDS for all
  reactive standard lines (measured, not gated).
- Desperation solver: the lever does NOT pay — firing earlier/more is monotonically
  worse (lever@always -2.5 mo) and converts doom deaths into ledger deaths (1 -> 12).
  fundraise_first now uses the L5 raise-as-campaign flow (seek/accept offer, pay_bills).
- Opening book v0: winners over-index on money-in (fundraise_small +1.56, apply_grant);
  losers on hire_capability_researcher (-2.11), take_loan, desperation_lever —
  cross-validating the solver.

Doc caveats rewritten to the true base. Full suite green (quick 365 / sim 93 /
integration 14).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(balance): regenerate desperation-solver report with dose-response bullet

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* balance(EE-9/EE-10): regenerate on nine-stream doom (post-#643); caveats -> stream base

Merged origin/main (74074c8, ADR-0015 nine-stream doom). Framework is orthogonal to
the doom internals — clean merge, no conflicts, and all three instruments ran clean
against stream-based doom (no breakage). Refreshed numbers + caveats now read "on
nine-stream doom (post-#643)" instead of "pre-migration".

Ordering is migration-robust:
- Policy sweep: safety_lean 18.0 best, balanced_operator 16.0, fundraise_first 14.5
  (still beats loan_desperation_reactive 13.0), passive 14.5 (~= calibrator do_nothing
  14.0, cross-harness anchor holds), capability_rush 7.0 / loan_hoard 5.0 worst. T9
  HOLDS for all reactive standard lines.
- Desperation solver: the trap SURVIVED and got STEEPER on stream doom — lever@always
  now -5.0 median months (was -2.5), doom->ledger death conversion total (2 -> 12/12).
  Added two bullets to DESPERATION_SOLVER.md so the divergence isn't misread: the
  solver (isolates the mechanic) is the trap's instrument; the opening book's
  near-neutral lone-lever signal is a lever washed out among random picks, not a
  contradiction.
- Opening book: winners over-index on money-in + doom-down (apply_grant +1.67,
  fundraise_big, publish_paper); losers on safety_research, take_loan,
  hire_capability_researcher.

Determinism re-verified (policy sweep identical across runs). Full suite green
(quick 355 / sim 93 / integration 14).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
PipFoweraker added a commit that referenced this pull request Jul 15, 2026
Developer-facing architecture map (audience: future junior dev). Maps each
major system to its code and deciding ADR(s), with honest built/partial/designed
status. Preserves the prior funder pitch at ARCHITECTURE_FUNDERS.md.

Written against the L1 wave (month engine #636, nine-stream doom #643, finance
#641, calibration #638, honest CI #640). Surfaces coherence-check findings in §7.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant