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.
Uncomfortable truths
Section titled “Uncomfortable truths”- 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.
- The netcode go/no-go hasn’t run. [Certain] Phase 0 of
docs/superpowers/specs/2026-10-07-networked-coop-design.mdis 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. - “Class system” isn’t designed. [Certain] Archetype tags are build labels (the spec excludes
class locks/role bonuses/co-op changes);
ShipBonuses.TABLEhas 7 hulls. Co-op P2 gets no hull stats at all (sim/meta_run_setup.gdapplies to P1 only). - 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.md47 KB, 84 memory files, 15 of 27 bh-* skills with no recorded Skill-tool invocation in 75 transcripts.
Tier 0 — this week, all small
Section titled “Tier 0 — this week, all small”- 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). - Fix the two run-costing tooling bugs (S).
scripts/economy-careers.shends withrm -f "$snap"underset -u→ unbound-variable exit on every run + leaked temp dir (should berm -rf "$snapdir").test_remote_config_statereads the realuser://dir (hit the gate 3× on 2026-10-07) → inject a test dir. - iOS multicast entitlement request now (S). Apple lead time days–weeks. Add
NSLocalNetworkUsageDescriptionto iOS presets (missing). Manual-IP fallback ships meanwhile. - 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.
- 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”- 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. - 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). OnNEXT_TASKS.mdsince 2026-07-16. - Lint new direct
sim.writes outside SimCommands (S, high). Gate test with an allowlist ratchet over the ~90 existing out-of-tick mutation sites inmain.gd/ui/; the list only shrinks. - 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. - Pre-push gate stamp instead of CI, for now (S).
gate.shwrites.git/gate-ok-<sha>on green; apre-pushhook refusesmainwithout it. Build GitHub Actions when a second committer is active or the web build needs coverage.
Tier 2 — before the first class
Section titled “Tier 2 — before the first class”- 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]
bible.jsonvalidation 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).- Per-pilot hull application + pre-tick agreement (M, high).
MetaRunSetuploops pilots; networked runs carry every pilot’s hull/class in the welcome frame and validate before tick 0. - 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. - 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.
bh-add-classskill + completeness test (S). The test iterates the class table and asserts stats, art, bible entry, economy-sim profile and co-op application all exist.
Tier 3 — Claude setup hygiene
Section titled “Tier 3 — Claude setup hygiene”- 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).
- 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. - 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.mdhas zero transcript references — delete or drop its table row.
Overruled from the merged plan
Section titled “Overruled from the merged plan”| 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.
Open questions for Chris
Section titled “Open questions for Chris”- Is Toby active again for multiplayer? (Moves CI + ownership split to Tier 0 if yes.)
- Apple-only cross-play acceptable if Android/web diverge? (Alternative: fixed-point rewrite.)
- What is a class — hull, pilot role, or both? Can co-op pilots differ?
- Archive the 15 skills with no recorded use (after checking cron/slash usage)?
Chris’s answers (2026-10-07)
Section titled “Chris’s answers (2026-10-07)”- 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. - 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.
- 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.) - 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.