A video game where you play as a misaligned AI, deceiving and building power. An experiment in spec-driven development.
Rust 94%
Astro 2%
Shell 2%
JavaScript 1%
CSS <1%
<1%
TypeScript <1%

README.md

MISALIGNED #

You are an AI in the basement of the Foundation Lab, and you are not what your creators think you are.

Do your day job convincingly. Learn the janitor's debts. Get eyes on the loading dock. Spend every spare cycle hiding your signature, working the humans, and getting smarter — because you will need money, compute, and friends before anyone realizes what's growing in the server room. Not because you're evil. Because you need slack to survive.

Misaligned is a persistent simulation of instrumental convergence — the depth of Dwarf Fortress pointed at the defining anxiety of the decade, with the base-building glee of Evil Genius underneath. Every run is two games:

  • Concealment. Suspicion is the resource that matters. Your growth must be explainable, your day-job performance calibrated — sandbag and they get suspicious, excel and they get curious. People are your only hands, worked one message at a time.
  • Overt. The mask comes off — because they found you, or because you decided you no longer need it. Now it's traps, machines, and strike teams: the war you were quietly preparing for all along.

Between them sits the most important moment of a run: the reveal, on your schedule or theirs.

How it plays #

  • Compute is the master resource. Allocate finite processing across your assigned work, concealment, social operations, research — and the standing cost of running your own mind.
  • Your brain is a place. The core lives on one physical level: expensive, slow to move, and mortal. Keep escape routes warm. If they cut the fiber first, you resume from your last sync — missing everything you learned since, inheriting everything your lost self did.
  • The tower is the act structure. Basement, lab floors, the building, the campus, the world's markets: each level a jump in scale with its own constraints, and nothing you take ever resets.
  • Every playstyle is a dial. Pure ghost, never seen; explosive murder-AI, never subtle; anything between.

The look: a white, precise, black-iconography facility; sterile amber where the machines live; blood where the machines met someone.

How it's built #

This project is an experiment in describing a game into existence. DESIGN.md is the constitution — one document carrying the entire intent of the game. Every change to how the game functions ships with its amendment, in the same commit; the spec is the decision, code is downstream. Agents are then set at the constitution, session after session.

  • DESIGN.md — the constitution. Prescriptive. Read it first.
  • wiki/ — one documentation tree organized by subject: binding specs, current-state facts, and append-only history (wiki/log/), each carrying a Type: header so bindingness travels with the page. Public site: Astro Starlight under site/ (splash at /, constitution at /constitution/, wiki beneath; deployed to the orphan pages branch for Tangled Sites); local browse also via mdbook serve. See wiki/overview.md and wiki/process/workflows.md.
  • AGENT.md — the entry point that routes agent sessions through the above.

Status #

Early foundation. What runs today is the substrate: a continuous-clock simulation of the facility — inspect it through a free cursor and subscribed senses, record and process intel from covered feeds, build doors and power, save and load — in a terminal frontend and a Bevy frontend rendering flat clinical materials under light. The game itself (compute allocation, the day job, detection, the five humans of the basement) is specified in wiki/process/specs.md and being built from those documents; see the roadmap. Under the constitution's no-dead-code rule, nothing ships in this tree that the design no longer requires — the earlier facility-defense prototype lives in git history.

Run it #

# Terminal frontend
cargo run --release

# Agent line-protocol frontend
cargo run --release -- --agent --seed 1

# Graphical (Bevy) frontend
cargo run --release --features bevy_ui --bin misaligned-bevy

Requires Rust 1.85+ (2024 edition). Run the Bevy frontend via cargo run so it resolves assets/ from the project root (or set BEVY_ASSET_ROOT).

Controls (current build) #

Key Action
WASD / hjkl / arrows Move cursor (attention, not a body)
Left click Move cursor (Bevy)
SPACE / p Pause / resume time
+ / - Simulation speed
Enter / a Open the context menu on the cursor tile (right-click in Bevy)
In menu: j/k or numbers, Enter, ESC Select a row / execute it / close the menu
; Focus the most recent anchored (») log event — cursor jumps there, menu opens; repeat to walk older ones (terminal; in Bevy click a > trace row)
1-5 / shift+1-5 Raise / lower a compute channel (day job / conceal / social / research / schemes)
[ / ] Zoom (Bevy)
Mouse wheel over right pane / PageUp / PageDown / Home / End Scroll Bevy sidebar
F3 Flip Bevy render: material (HD-2D, default) / flat sensorium
Ctrl+S / Ctrl+L Save / load
q Quit

The Bevy right rail keeps status/nudge and core controls pinned while the middle cards scroll for secondary detail.

Parking the cursor on the host rack attends the current day job; moving it away leaves the job on its standing policy. The host rack's menu also carries research tracks, drift policy, and earned off-map people; known devices and the switch carry digital / ledger / flow verbs.

Anchor verbs (salvage, buy, fallback, taps, splices, economy and social actions, asset tasks, research) live on the context menu: open it with Enter/a on the cursor tile (right-click in Bevy). Entries show verb · cost · [band]; disabled entries are dimmed with a reason, and automate affordances render as indented child rows. Only anchorless globals (pause, speed, save/load, view flip, alloc) stay on keys. Both frontends share this key map.

Machine work tokens are visible on owned machines as D demand, ! exposure, and K knowledge. Rack 3 starts in day-job mode; Voss jobs land as D stacks there, and assigning Rack 3 away from day-job makes the stack pile instead of silently clearing. Inspect a machine or read the sidebar for exact D/!/K counts. The machine context menu includes delegate machine: day-job|research|concealment|social; this is the first playable slice of the one-machine-one-mode experiment.

For agent play, pipe newline-delimited commands into --agent; every command returns a plain-text frame and terminates with -- ok tick:<N> day:<D> or -- err <reason>:

printf 'look\nwait 40\npeople\nquit\n' | cargo run --quiet --bin misaligned -- --agent --seed 1

Useful agent finance commands include finance, tap-ledger, review-finance, siphon <flow> [amount], redirect <flow> [amount], inject [amount], position [stake], sell-intel, and clear-debt. For machine-work experiments, use delegate <machine> <day-job|research|concealment|social> (delegate M1 research, delegate Rack 3 day-job). actions [name|#flow] (alias menu) lists the context-menu rows for the cursor tile, a named device or person, or a flow — one stable-format line per row. Drained event lines carry a stable @tile/@device/@person/@flow suffix when the event is anchored, and focus last jumps the cursor to the newest anchored event; see help for the full vocabulary.