A video game where you play as a misaligned AI, deceiving and building power. cameron.tngl.io/misaligned
misaligned DEVLOG.md
25 kB · 362 lines

Misaligned Devlog #

Reverse chronological implementation notes. Keep this factual: what changed, why, checks, and spec impact.

2026-07-07 - Design session: agent play (the line-protocol drive) #

  • Intent: Cameron — "agents need to be able to play misaligned easily." Close the gap between the terminal-first-class clause (agents are the most frequent players) and a frontend that is wall-clock-paced, raw-mode, ANSI-only — the three mechanisms programs are worst at.
  • Changed: DESIGN.md — new binding rule "Agent play is a first-class input path" in the terminal section + decisions-log entry (rejected: JSON export, MCP bindings, pty choreography, Bevy hooks). New spec/agent-play.md (READY, Process): misaligned --agent — command- clocked time (wait N is the only clock), stdin/stdout line protocol, frames-not-dumps (the human frame is the one honest surface), full event log per response, --seed byte-identical replays, name-targeted social verbs, help as the discoverability rule for a piped screen. spec/README.md row. Devlog: devlogs/2026-07-07-agent-play.md.
  • Checks: docs-only; spec-header hygiene verified by hand against check.sh's rules.

2026-07-07 - Process: PR rule removed; ledgers merge by union #

  • Intent: Cameron removed the "PRs are the norm" rule outright (CLI PRs don't render on tangled.org; a parallel tick had already suspended it); and harden against the merge failure that silently dropped three DEVLOG entries on 2026-07-06.
  • Changed: DESIGN.md decisions log — removal entry + the new ledgers merge by union process law (DEVLOG.md, decisions log, spec/README tables are append-only; conflicts keep BOTH sides). AGENT.md landing instructions simplified to direct merge-to-main and gained the union rule; knowledge/workflows.md suspension note replaced with removal + union rule. Also lands the flow-law commit (messages.md + economy.md) that had been parked on the unrendered PR #7.
  • Checks: docs-only; spec hygiene unchanged.

2026-07-06 - Design session: the flow law (messages + economy) #

  • Intent: Cameron generalized the message-latency yes into a systems mandate (general message passing, device-hosted processing, a modeled money economy — "system design scales very well"); capture it as law and close the B1 money gap with a real spec.
  • Changed: DESIGN.md — new "The flow law: signals, messages, money" section (nodes exchanging flows over three graphs; tap / inject / redirect as the universal verbs) + decisions-log entry. New spec/messages.md (READY): channels with read conditions, delivery on the recipient's clock, authored per-person traffic, typed information payloads, filings-as-messages (aggregate-observer criteria preserved), taps feeding the intel buffer. New spec/economy.md (READY): the Lab's account graph (revenue/payroll/procurement on the day clock), tap/inject/redirect for money, income routes (siphon, sell information, small positions), legitimate expansion from trust, Marcus's debt payable both ways. Amendments: intel.md (message-latency proposal closed as decided-general), reach.md (ownership grants processing cycles; devices host resident automations), detection.md (filings-are-messages contract note), markets.md (economy.md is its B1 seed). spec/README.md rows; ROADMAP #17 rewritten from blocked to messages dispatch, #18 economy added, first-wave note updated to the flow-law chain (#15 -> #14 -> #16 -> #17 -> #18).
  • Design/spec impact: the old "B1 money income" blocker is resolved by design; money stops being a scalar when #18 lands; the instant-message special case dies with #17 the way instant observe died with #16.
  • Checks: docs-only change; spec-header hygiene verified for messages.md and economy.md.
  • Next: dispatch the flow-law chain in sequence; remaining [OPEN] proposals: remembered fog state, telemetry sense (cursor.md).

2026-07-06 - Design session: intel is record-and-process #

  • Intent: detailed code read + a prepared design question (Cameron's ask). Found the tension between the instant social observe and the located-senses law; posed three textures; Cameron chose record-and-process.
  • Changed: DESIGN.md — "Record and process" added to the Presence section, B1 social bullet reworded, decisions-log entry (with rejected alternatives and the message-latency [OPEN] proposal). New spec/intel.md (READY): recording buffer, processing costs, standing watches, provenance, Marcus-arc criteria. spec/social.md: instant Observe superseded (status note, table row, AC1, depends on intel.md). spec/README.md row. ROADMAP #16 (intel; sequence after #14/#15) and #17 (B1 money income — no income source exists in code; blocked on a design call).
  • Design/spec impact: the implemented instant observe becomes a violation when intel.md lands; knowledge staging moves downstream of processed recordings.
  • Checks: docs-only change; spec-header hygiene verified for intel.md.
  • Next: Cameron yes/no on message latency; design the first micro-scheme (#17); dispatch order #15 -> #14 -> #16 (or bundle).

2026-07-06 - Design session continuation: the cursor's implications adopted #

  • Intent: Cameron affirmed all eight implications of the cursor decision; capture them as law and spec.
  • Changed: DESIGN.md — new "No disembodied hands" section; Presence section extended (blueprint decided, universal inspect card, senses as attack surface, strict-fog tone guard); Automation gains perception-scaling; Act One ladder restaged (Ears first; "Reach" beat renamed "The dock"); decisions-log entry. New spec/reach.md (READY): device graph, segments/switch, reach-gated actions, sensor ownership (tap vs take), Ears beat. spec/cursor.md updated (depends on reach.md; controlled = subscribed; blueprint promoted to core criterion). basement-map.md gains the authored device-topology bullet. spec/README.md + ROADMAP items #14 (updated) and #15 (new, with do-not-parallelize note).
  • Design/spec impact: Sensor.controlled: bool is now spec-superseded by ownership + subscription; remembered and telemetry are the only remaining [OPEN] proposals from the session.
  • Checks: docs-only change; spec-header hygiene verified for reach.md.
  • Next: dispatch #15 then #14 (or as one work order).

2026-07-06 - Design session: presence is a cursor, not a body #

  • Intent: capture Cameron's playtest feedback — movement implied a physical walking form; presence should be a cursor, vision should come only from cameras, hearing only from microphones, and the cursor should inspect what's under it.
  • Changed: DESIGN.md — new "Presence: the cursor and the senses" section, pillar 2 amended (the "not a disembodied cursor" phrase deliberately reversed), decisions-log entry with rejected alternatives and three [OPEN] proposals (blueprint fog, remembered snapshots, telemetry). New spec/cursor.md (READY; proposal-gated (P) criteria). spec/README.md B1 table row; spec/ROADMAP.md dispatch item #14 (🟥 sim+save). Devlog: devlogs/2026-07-06-cursor-and-senses.md.
  • Design/spec impact: the walking player entity, its walkability check, and the moving 3x3 vision bubble in sim.rs are now constitutional violations awaiting the #14 implementation pass (they also violated basement-map.md AC2 all along — the code's own comment claimed the radius was around the host bay while using the moving entity).
  • Checks: docs-only change; no code checks run.
  • Next: Cameron yes/no on the three proposals; then dispatch ROADMAP #14.

2026-07-06 - The terminal is a first-class frontend #

  • Intent: restyle the terminal UI to the clinical-gore identity and amend the constitution to say why the terminal matters — AI agents are the game's most regular players and they play through it.
  • Changed: DESIGN.md gains "The terminal is a first-class frontend" (sterile palette law, visibility best practices, parity of legibility); pillar 5, the codebase table, and the decisions log amended. src/bin/terminal/ui.rs rewritten: one-meaning-per-color palette (grey ramp / sterile amber / crimson), solid-block walls, box-drawing chrome, stacked allocation bar, four-cell band meters with names, tick-stamped log, day+tick always on screen, framed people panel with reverse-video selection, save/load hints. UI::add_log takes the tick; sidebar takes paused+speed; game-over card shows day/tick. The schedules work (people glyphs on the map, located presence in the people panel) is preserved and restyled in the rebase. No sim changes.
  • Checks: tools/check.sh green; pty smoke tests replayed through pyte for title, playing, and people-panel screens.
  • Spec impact: constitution amendment in the same commit (the one rule); longer writeup in devlogs/2026-07-06-terminal-first-class.md.

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<u8>) 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.