Skip to content

Dev Infrastructure Meta Audit — Multiplayer + Classes Readiness

Dev Infrastructure Meta Audit (2026-10-07)

Section titled “Dev Infrastructure Meta Audit (2026-10-07)”

How to make building Dark Cosmos easier, faster and more effective as internet multiplayer and a class system start. Method: a 7-lane audit workflow (Claude harness, tests/verification, autopilot, netcode readiness, class-system readiness, build/feedback loop, external research), a merged plan, two adversarial reviewers checking each recommendation against the repo, then a manual edit pass (git stats, transcripts, scripts verified directly). Read-only; nothing was changed by the audit. Shareable page: https://claude.ai/artifact/XLWbhdrQiSXLFYj2eq26JE

Tags: [Certain] verified in repo · [Likely] strong evidence · [Guessing] judgement.

  1. The team is one person right now. [Certain] Since 2026-08-01: Chris 1,131 commits, Toby 0. Coordination tooling (collision hooks, ownership protocols, CI for a second pusher) solves a problem that doesn’t currently exist. The real bottleneck is Chris’s attention: ~30 open 📍 memory threads, mostly awaiting an eyeball or on-device verdict.
  2. The netcode go/no-go hasn’t run. [Certain] Phase 0 of docs/superpowers/specs/2026-10-07-networked-coop-design.md is measuring cross-platform float determinism. Still unmeasured; 26 sim files use sin/cos/atan2/pow. If iPhone/ATV/Android/web disagree, the answer is Apple-only cross-play or a fixed-point rewrite.
  3. “Class system” isn’t designed. [Certain] Archetype tags are build labels (the spec excludes class locks/role bonuses/co-op changes); ShipBonuses.TABLE has 7 hulls. Co-op P2 gets no hull stats at all (sim/meta_run_setup.gd applies to P1 only).
  4. High throughput, low closure. [Certain] ~1,130 commits in the month to 2026-10-07, ~213 of them fix/revert (~19%). 56 git worktrees, 69 merged branches, NEXT_TASKS.md 47 KB, 84 memory files, 15 of 27 bh-* skills with no recorded Skill-tool invocation in 75 transcripts.
  1. Cross-platform determinism probe on real devices (M, high). Dev command: seed-1234, 3,600 ticks, net_checksum() every 600 ticks → Remote Console. Run on Mac/iPhone/iPad/ATV/Android/web. Decides internet-play scope. No CI needed (Linux x86 runners say nothing about ARM devices).
  2. Fix the two run-costing tooling bugs (S). scripts/economy-careers.sh ends with rm -f "$snap" under set -u → unbound-variable exit on every run + leaked temp dir (should be rm -rf "$snapdir"). test_remote_config_state reads the real user:// dir (hit the gate 3× on 2026-10-07) → inject a test dir.
  3. iOS multicast entitlement request now (S). Apple lead time days–weeks. Add NSLocalNetworkUsageDescription to iOS presets (missing). Manual-IP fallback ships meanwhile.
  4. One “waiting on Chris” decision page instead of 30 📍 threads (S, high). Memory holds facts, not a to-do list; sessions read verdicts from the page.
  5. Prune worktrees/branches and keep them pruned (S). scripts/dev/prune-worktrees.sh (merged into origin/main + clean → remove, dry-run first); SessionStart hook reports count > 15.

Tier 1 — netcode tooling before more netcode code

Section titled “Tier 1 — netcode tooling before more netcode code”
  1. Two-peer bot harness scripts/net-pair.sh (M, high). Host + client headless with SkilledAutoPlayer over LoopbackTransport/ENet 127.0.0.1, flags for latency/jitter/loss/reorder, checksum compare every 30 ticks, first-divergence report. Replaces four separate suggestions (lan-pair-test, chaos DevFlags, networked soak, LAN pair test). Injection knobs already exist in LoopbackTransport but only inside GUT.
  2. Per-tick state diff (M, high). Sim.snapshot_dict() + differ → “tick 156, enemies[12].x”. Serves #6, desync telemetry, and determinism re-pins (today pass/fail + manual bisect). On NEXT_TASKS.md since 2026-07-16.
  3. Lint new direct sim. writes outside SimCommands (S, high). Gate test with an allowlist ratchet over the ~90 existing out-of-tick mutation sites in main.gd/ui/; the list only shrinks.
  4. Lockstep fault-injection tests (S). Corrupt checksum, reordered input, pick not in offer, wrong pilot, duplicate pick, stale packet — additions to test_lockstep_session.gd.
  5. Pre-push gate stamp instead of CI, for now (S). gate.sh writes .git/gate-ok-<sha> on green; a pre-push hook refuses main without it. Build GitHub Actions when a second committer is active or the web build needs coverage.
  1. Decide what a class is (brainstorm). Hull class, pilot role, or both; per-pilot or per-team; lobby selection. Blocks #13–#16. Peers (Brotato, DRG Survivor, Death Must Die) use characters with starting kit + stat skew rather than hard role locks. [Likely]
  2. bible.json validation in the gate (S, high). Schema + node test: required fields per category (archetypes, gold, biomass…) and cross-references. Catches the “silently zero” class (XP-was-zero shipped for months).
  3. Per-pilot hull application + pre-tick agreement (M, high). MetaRunSetup loops pilots; networked runs carry every pilot’s hull/class in the welcome frame and validate before tick 0.
  4. One bot batch runner scripts/bots.sh (M, high). One JSON row per run (build, seed, hull/class, profile, pilots, run_time, death cause, gold, DPS); summary by class × skill profile; diff vs the previous build. Then recalibrate skill profiles (n=18 human runs, predating two AI reworks). Today soak/economy_sim/autopilot_bench/sim_bench/difficulty_probe/story_trace each have their own output.
  5. Run-twice determinism per hull/class × pilot count (S). Self-consistency (+ one replay pass), not more pinned hashes — avoids re-pin churn on every balance change. Keep the three existing pins.
  6. bh-add-class skill + completeness test (S). The test iterates the class table and asserts stats, art, bible entry, economy-sim profile and co-op application all exist.
  1. Trim the skill roster (S). Recorded invocations (75 transcripts): bh-telemetry 24, bh-sdd-concurrent 22, bh-dev-chunk 14, bh-deploy 12, bh-worktree-device-install 10, bh-merge-reviewed-branch 8, bh-vfx-iteration 6, bh-appstore-release 6, bh-overnight-audit-loop 4, bh-diagnose-render-timing / bh-deploy-mac-dev / bh-android-tester-build 2. The other 15 show none (counts may miss cron/slash firings — check each before archiving).
  2. Netcode checklist in bh-reviewer, not a new agent (S). Triggered on sim//net/ diffs: RNG stream, new out-of-tick mutation, quantization, protocol version, replay round-trip test. Dispatch counts: general-purpose 320, bh-implementer 300, bh-reviewer 228, bh-visual-qa 14, bh-feedback-triage 2 — move general-purpose code work onto bh-implementer.
  3. Shrink per-session context (M). CLAUDE.md 26 KB (warning at 30). Each rule made structural (#8, #10, #12) earns a CLAUDE.md deletion. dark-cosmos/<role>/ROLE.md has zero transcript references — delete or drop its table row.
Merged-plan item Call Why
GitHub Actions CI, “Now”, XL Deferred One active committer; Linux runners can’t test ARM determinism; #10 gives the guarantee at S.
Pre-commit branch-collision hook Dropped Collisions came from Chris’s own parallel Claude sessions; worktree isolation covers it.
Toby coordination protocol Open question Only matters if Toby returns.
Per-class pinned determinism hashes Replaced #15 run-twice self-consistency.
Class balance invariants (“Interceptor finishes by wave 5”) Dropped Invented classes.
ui-sweep baseline determinism fix Refuted Already fixed 2026-09-23.
Parallel device installs, co-op telemetry session id, chaos DevFlags Later Once LAN device testing is routine; #6 covers chaos headlessly.
“26K correction messages”, “hooks dir empty” Discarded Grep noise; hooks dir has check-claude-md-size.sh.
LLM balance-testing agents (TITAN-style) Not yet Deterministic bots + #14 give the signal cheaper; revisit once classes exist.
  • Pure-RefCounted /sim + fixed-tick determinism — the base for lockstep, bots and replay.
  • Host-scheduled input lockstep with quantized inputs; rollback correctly rejected at 2–4 ms/tick on ATV. External research: Vampire Survivors’ online co-op used a host-canonical input table too (with 1 Hz position sync + local prediction for its own enemy model).
  • bh-implementer → bh-reviewer in worktrees.
  • Telemetry v2, Remote Console, remote config.
  • gate.sh + test-count guard; 463 GUT scripts.
  • One memory file / CLAUDE.md line per incident when a test or hook could prevent it.
  • New overnight loops while ~30 verdicts are pending.
  • Unpruned worktrees, branches and BUILD numbers.
  • More netcode before Phase 0 is measured.
  1. Is Toby active again for multiplayer? (Moves CI + ownership split to Tier 0 if yes.)
  2. Apple-only cross-play acceptable if Android/web diverge? (Alternative: fixed-point rewrite.)
  3. What is a class — hull, pilot role, or both? Can co-op pilots differ?
  4. Archive the 15 skills with no recorded use (after checking cron/slash usage)?
  1. Toby may come back, but as a playtester who sends change requests, not a coder. Dev stays effectively solo: CI and an ownership split stay deferred; the tester-feedback pipeline (bh-feedback-triage, in-game feedback) matters more than multi-dev tooling.
  2. Target is full cross-play eventually: Apple, Android, web AND PlayStation, Xbox, Switch. That spans x86-64 (PS/Xbox), ARM (Switch/Apple/Android) and WASM, so “Apple-only” is off the table. The determinism probe now decides between float lockstep (if every platform matches) and a fixed-point sim / different netcode model (if not). Consoles also need a third-party Godot porting route (Godot ships no console export) — verify options before committing.
  3. Classes follow EVE Online / World of Warcraft / League of Legends archetypes: some clearly defined roles first (tank / healer / damage / control style), more exotic hard-to-define ones later. Needs a class design spec; the career archetype tags are the starting vocabulary. (EVE-style economy/fitting/loss still belongs in ~/Claude/sovereign; class roles are fine here.)
  4. Don’t archive yet: audit every skill — why it was made, why it went unused, and how to fix it so it gets used.

External research notes (from the research lane)

Section titled “External research notes (from the research lane)”
  • Klotho (Godot Asset Library, 2026-07): deterministic lockstep + rollback with FP64 fixed-point — reference only if Phase 4 latency forces rollback.
  • Backends for accounts/matchmaking later: Nakama (self-host), Talo, Crux, PlayFab. Not needed for LAN/dev relay phases.
  • Cloudflare Durable Objects relay: use the WebSocket Hibernation API so idle rooms bill ~zero; spec cost model ~USD 0.003 per 20-min 2-player match.
  • Float determinism: x87/FMA contraction/ARM NEON/WASM differences mean IEEE 754 per-op guarantees don’t make sequences identical across platforms — measure, don’t assume.