# Misaligned Devlog Reverse chronological implementation notes. Keep this factual: what changed, why, checks, and spec impact. ## 2026-07-06 - Process: PRs are the norm - Intent: land Cameron's process decision — all changes go through Tangled pull requests via the `tang` CLI; `main` is never pushed directly. - Changed: AGENT.md non-negotiables and the worktree hard rule now end at a PR; knowledge/workflows.md git conventions replaced the "push main directly; no PR flow" note with the tang PR flow (rebase first, push branch, `tang pr create -F body.md`, headless behind-check caveat); knowledge/development-style.md working-loop step 7 ends in a PR; DESIGN.md decisions log entry added. - Design/spec impact: process only, no game behavior. Decisions log: "PRs are the norm." - Checks: docs-only; link/wording review. ## 2026-07-06 - Spec: the wiki (DRAFT proposal) - Intent: capture Cameron's direction to reshape the documentation into a compartmentalized, agent-navigable wiki renderable as a website. - Changed: added spec/wiki.md (Status DRAFT): one wiki/ tree organized by aspect (vision, mechanics, gameplay, world/characters/story, interface, art, engineering, process, log), page types (spec/knowledge/log) as frontmatter so bindingness survives the move, SUMMARY.md navigation, mdBook rendering, staged four-PR migration plan, and acceptance criteria (orphan/link checks in the gate, history preserved via git mv, hook and dispatch paths updated atomically). - Design/spec impact: proposal only; nothing moves until Cameron approves the shape and the spec goes READY. - Checks: docs-only; spec-header gate green. ## 2026-07-06 - Spec update: serde JSON save format amendment - Intent: address PR review comment — the save format rewrite needed a constitution/spec amendment. - Changed: DESIGN.md decisions log entry for the serde JSON save format. spec/ROADMAP.md item #12 marked DONE with result note; conflict flags updated from "hand-rolled serialization" to "serde JSON serialization"; suggested first wave updated (save.rs no longer the bottleneck). knowledge/architecture.md save format section rewritten for serde JSON. knowledge/sim-mechanics.md save format section rewritten for serde JSON. - Design/spec impact: DESIGN.md amended (decisions log: save format). ROADMAP #12 closed. Knowledge base reflects current implementation truth. - Defense: Player contract continuity clause ("saves survive updates: formats are versioned and migrated, never abandoned") — serde JSON with a version field is the concrete expression. The hand-rolled format was a maintenance bottleneck every feature fought; eliminating it closes ROADMAP #12 and removes the save format as a parallel-agent conflict surface. ## 2026-07-06 - People as Agents: cast specs, constitution, observer ID fix - Intent: establish the people design principle (all humans follow the same core primitives, with procedural generation for scale-up) and fix a bug where person IDs and observer IDs didn't match. - Changed: added five cast spec documents (spec/cast/marcus.md through spec/cast/voss.md), each defining the character's observer configuration, person configuration, asset tasks, schedule, narrative role, and procedural template for scale-up. Amended DESIGN.md with two new sections: "People as Agents" (the social application of self-similar scale) and "Automation as design language" (the "automate" affordance as the player's primary scaling interface, with the day job as tutorial). Added "No stale worktrees" process rule to AGENT.md and the decisions log. Updated spec/README.md with the cast specs. - Bug fix: observer IDs in Detection::act_one() were inconsistent with person IDs in People::act_one(). Marcus was person 0 but observer 3; Dana was person 1 but observer 0; Priya was person 3 but observer 1. This meant recruit(0, Knowing) set a certainty floor on Dana (observer 0) instead of Marcus (observer 3), deceive fallout on Marcus went to Dana's suspicion, and LookAway on Marcus lowered Dana's suspicion. Reordered observers to match person IDs: 0=Marcus, 1=Dana, 2=Ray, 3=Priya, 4=Voss. Updated affected detection tests. - Design/spec impact: DESIGN.md amended (People as Agents, Automation as design language, No stale worktrees). spec/README.md updated with cast specs. AGENT.md updated with worktree lifecycle rule. - Defense: DESIGN.md "Self-similar scale" requires all humans to be instances of the same Agent interface; the cast specs make this concrete and define the procedural templates for scale-up. The observer ID fix is a bug (code disagreed with itself — person IDs and observer IDs were inconsistent, causing social actions to target the wrong observer). The automation design language is the diegetic expression of instrumental convergence (constitution: "the core loop") and the player's primary scaling interface. The no-stale-worktrees rule is a process improvement from Cameron for high-velocity parallel agent work. - Checks: pending — bash unavailable in this worktree session. To be verified by subagent or Cameron. ## 2026-07-06 - Tick: the second-level aggregate scale-proof - Intent: close the last open item on spec/aggregate-observer.md — criterion 4, the toy second-level aggregate test the self-similar-scale law promises but nothing yet proved. - Changed: `WatchedInput::Filings` now carries the watched observer ids (`Vec`) instead of implicitly meaning "every field observer"; `filed_suspicion` became `filed_suspicion_of(ids)`, and `Detection::tick` precomputes each aggregate's filed input from its own watched ids before any observer mutates (so a chained aggregate reads a consistent entering-tick snapshot). Added `second_level_aggregate_composes_through_the_same_code_path`: a toy "Regional Office" watches the Assurance Office's filings and accrues/decays through the identical path. Save format (still v5) encodes watched ids as `@id:id:...`; a bare legacy `@` still loads as "every field observer" for save continuity. - Design/spec impact: `spec/aggregate-observer.md` -> IMPLEMENTED; `spec/README.md` and `spec/ROADMAP.md` updated to match. Defense: DESIGN.md "Self-similar scale" requires aggregates to compose through the same interface at any depth; the prior `Filings` variant hardcoded "all field observers", which would have silently ignored a second aggregate's actual watched set the moment one existed — this fixes the shape before that second scale is needed, per the law's own guardrail. - Checks: `./tools/check.sh` (fmt, tests x77, clippy both feature sets, bevy build, spec header hygiene) — all green. - Next: spec/detection.md's remaining IN PROGRESS work (observers panel polish, audit countdown) is unaffected and still open. ## 2026-07-06 - Roadmap consistency cleanup - Intent: make `spec/ROADMAP.md` safer as an agent dispatch board after Co's review found status and sequencing drift. - Changed: downgraded `spec/aggregate-observer.md` from IMPLEMENTED to IN PROGRESS until the missing toy second-level aggregate test exists; updated `spec/README.md` to match; removed blocked art from the “right now” parallel-safe set; tightened schedules' social dependency wording; framed Bevy parity as terminal/README parity rather than a spec-free invention space; added a post-schedules save-rework sequencing decision point. - Design/spec impact: no game behavior change. This is process/spec hygiene so parallel agents do not treat stale roadmap text as executable truth. - Checks: `git diff --check`; spec header/status audit; `./tools/check.sh`. - Next: either add the aggregate scale-proof test in `detection-finish`, or promote aggregate-observer back to IMPLEMENTED only when criterion 4 is actually covered. ## 2026-07-06 - Detection tick: the Assurance Office becomes an Observer - Intent: fix the recorded priority scale violation (self-similar scale / aggregate-observer law) — the Office was a bespoke `assurance: f32` scalar, not the Observer type its inputs are. - Changed: `Observer` gained `WatchedInput` (`Channels` for field observers, `Filings` for aggregates); the Office is now an aggregate Observer in `Detection::observers` sharing the same noticing roll, accumulation, and decay, sampling the policy-weighted filed suspicion on its own cadence (400 ticks, acuity 0.5, both [TUNE]). The audit now checks the Office's accumulated suspicion, so sustained filed concern is what kills, not a snapshot at audit time. Save format v5 with v4 scalar migration; frontends list the human cast via `field_observers()` with the Assurance band line unchanged. - Design/spec impact: spec/detection.md's aggregate-observer requirement is implemented; knowledge/architecture.md's PRIORITY scale-debt is resolved. Agencies and publics in later acts reuse the same type. - Checks: 73 tests pass (4 new: office accrual from filings only, same accumulate/decay, audit containment, v4→v5 migration + aggregate round-trip); clippy clean; fmt. ## 2026-07-06 - Meta-spec tick: self-contained references - Intent: make spec/art-direction references portable across machines and agents. - Changed: committed the supporting July 5 art-direction mockups under `assets/reference/art-direction/supporting/`, replaced local `~/Downloads` paths with repo-relative paths, and added the self-containment rule to `spec/meta.md` plus the art-direction README. - Design/spec impact: future agents can audit and implement art direction without relying on this Mac's Downloads folder or expired generation URLs. Canonical specs may cite local paths only as provenance in devlogs, not as required references. - Checks: docs/assets only; `git diff --check`. - Next: if a future spec names a generated image, prompt, map dump, or fixture as implementation law, commit it beside the spec instead of leaving it in scratch. ## 2026-07-06 - Meta-spec tick: parseable status - Intent: make the spec surface mechanically auditable instead of prose-shaped. - Changed: split parenthetical status prose into `Status note:` fields, kept `Status:` as an exact enum, and updated the B1 status table in `spec/README.md` from stale `READY` to `IN PROGRESS`. - Design/spec impact: agents and scripts can now compare spec status without natural-language parsing. The index no longer lies about the B1 specs' state. - Checks: docs-only; `git diff --check`. - Next: if status/index drift recurs, add a tiny script that checks spec headers against the README table. ## 2026-07-06 - Meta-spec tick: stage discipline - Intent: make the spec system itself precise enough for autonomous agents to audit and target without leaking later milestones into current acceptance criteria. - Changed: added `spec/meta.md`, extended spec headers with `Stage`, added `BLOCKED` status semantics, and stamped current B1 specs with `Stage: B1 — The Basement`. - Design/spec impact: future/B2 obligations now have an explicit place outside B1 acceptance criteria. This answers the meta-spec ambiguity exposed by core/fallback discussion: a correct future rule in the wrong stage is a spec defect. - Checks: docs-only; `git diff --check`. - Next: split or move any later-stage acceptance criteria found in B1 specs, starting with `spec/core.md` fallback/sync/migration if still present after the current implementation pass. ## 2026-07-05 - No-dead-code demolition - Intent: enact the new constitutional no-dead-code clause; remove the supervillain fiction so B1 systems land in clean substrate. - Changed: deleted combat/events/superpowers/agent/henchman/minion modules, heat/waves/schemes/loot/research, 18 tile types, all fiction menus in both frontends, 20 dead assets, and the unused rand dependency. Save format bumped to v2 with v1 migration (position, gold->money, dead tiles -> Floor). Bevy now renders the clinical b1 textures. - Design/spec impact: constitution gained "No dead code" (supersedes "nothing built is discarded" - recorded reversal); Roadmap "Built so far" rewritten; spec/detection.md containment decoupled from the deleted raid system. - Checks: cargo fmt; 33 tests green; clippy clean both configs; terminal pty smoke passed; Bevy launch smoke clean; 9,240 -> ~4,600 lines. - Next: point spec agents at spec/core.md and spec/compute.md; regenerate remaining b1 assets when Pixel Lab quota returns. ## 2026-07-05 — Misaligned rename and clinical UI pass - Intent: make the pivot real in code and presentation instead of leaving Misaligned as a doc-only title. - Changed: renamed the crate, binaries, save namespace, visible UI strings, README, workflows, and art manifest from Supervillain to Misaligned; renamed the old throne fiction to the physical core; shifted terminal/Bevy colors toward clinical near-monochrome, sterile amber machine signal, and crimson consequences; renamed old `villain`/`throne` art assets to `misaligned_process`/`core`. - Design/spec impact: resolves the repo/binary rename timing item in the constitution. Existing overt-phase mechanics remain substrate; this is naming/presentation plus the core-fiction cleanup, not a B1 implementation. - Checks: `cargo fmt`; `cargo test` passed with 130 tests; `cargo build --bin misaligned`; `cargo build --features bevy_ui --bin misaligned-bevy`; `cargo clippy --all-targets -- -D warnings`; `cargo clippy --all-targets --features bevy_ui -- -D warnings`; terminal pty smoke passed; Bevy launch smoke opened `Misaligned` window with no panic/error grep. - Next: regenerate actual PixelLab assets against the new clinical-gore manifest once the B1 tile vocabulary is settled. ## 2026-07-05 — Visual direction capture - Intent: capture Cameron's art/tone direction before it disappears into chat/Fable context. - Changed: preserved the constitution's new `Visual identity: clinical gore` direction and added matching art-prompting guidance to knowledge/art-pipeline.md. - Design/spec impact: establishes the aesthetic target as clean, sharp, science-forward, metal/glass/high-modern supervillainy with black-and-white iconography and controlled gore, rather than basement grime or cartoon softness. - Checks: docs-only change; no code checks run. - Next: future PixelLab prompts and Bevy art integration should bias toward precise lab/skyscraper surfaces and use gore as contrast, not map-wide noise. ## 2026-07-05 — Sidebar name cleanup - Intent: remove leftover inspiration-title branding from the terminal UI. - Changed: sidebar header now says `MISALIGNED` instead of `EVIL GENIUS`; Bevy title overlay no longer splashes a huge red logo/tagline over the map and now uses a small start prompt. - Design/spec impact: no constitution amendment needed; this aligns the interface with the project/game name already specified by DESIGN.md and README and keeps title UI as presentation polish. - Checks: `cargo fmt -- src/bin/terminal/ui.rs src/bin/bevy.rs`; `cargo test` passed with 130 tests; Bevy build passed. - Next: continue sanity-playing both frontends for any remaining legacy wave-defense or inspiration-name residue. ## 2026-07-05 — Terminal playability polish and project skill - Intent: make the current terminal build less hostile to immediately run, and establish Co context-switch discipline for this spec-driven game project. - Changed: replaced the oversized title ASCII layout with a compact centered title block; added WASD support across normal movement, build cursor movement, research menu, hire menu, and schemes/world-map menu; updated title-screen control text. - Design/spec impact: controls now prioritize WASD/arrows while preserving hjkl as secondary input. This matches the player-facing expectation for a lair-building roguelike rather than a Vim-only roguelike. - Docs: created the `developing-supervillain` Letta Code skill; updated README controls. DESIGN.md already captures the larger continuous-sim pivot and remains the current product source of truth. - Checks: `cargo fmt -- src/bin/terminal/input.rs src/bin/terminal/ui.rs`; `cargo test` passed with 130 tests. - Next: sanity-play the terminal loop and tighten UI language around continuous time, heat, and agency consequences rather than legacy build/defend phase framing.