A video game where you play as a misaligned AI, deceiving and building power. An experiment in spec-driven development.
Rust 92%
Shell 4%
Astro 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, but it lives in machines. Every owned machine has one delegated job — Day Job, Research, Concealment, or Operations — and the fleet bar is a read-only aggregate of those choices, not a percentage mixer.
  • Work is visible. Demands, exposure, and knowledge pile onto hardware as D / ! / K stacks. The todo list is the world: clear the day-job stack, route byproducts, and keep heat from becoming somebody else's attention.
  • 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.
  • Actions live on the thing. The cursor is attention, not a body. Put it on a machine, person, device, or flow and open the context menu; the verbs, costs, risk bands, disabled reasons, and automation affordances live there.
  • 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 your machines live; crimson only where danger or consequence is real.

How it's built #

This project is an experiment in describing a game into existence. The whole wiki is the spec: laws, implementable contracts, current facts, and append-only history organized by subject. Every functional change amends the binding page that owns it in the same commit; code is downstream.

  • DESIGN.md — the short repository doorway into the corpus.
  • wiki/ — one documentation tree organized by subject: binding laws and 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 /, legacy design doorway at /constitution/, wiki corpus beneath; deployed to the orphan pages branch for Tangled Sites). Use pnpm --dir site dev for a local preview and ./tools/site-build.sh for the public build; Starlight is the only documentation renderer. See wiki/overview.md and wiki/process/workflows.md.
  • AGENT.md — the entry point that routes agent sessions through the above.

Status #

Playable B1 basement slice. What runs today is a continuous fixed-tick simulation of the Foundation Lab basement with an Act One map and cast, a free attention cursor with fog and provenance, compute as machine delegation, visible machine-work stacks, the day job, per-observer detection and the Assurance Office, social operations through five named humans, digital reach, record-and-process intel, messages, money flows and income schemes, research, building intents, the objective line, context menus, event-to-anchor focus links, save/load, and two thin frontends (terminal/agent mode and Bevy) over one sim core. Bevy opens in the material render as the dark frame: a close-up on the core in a physically dark room, lit only by the machine's own light and the soft amber pool it casts (F4 floods the scene for dev inspection); F3 flips to the flat sensorium. The spec board is wiki/process/specs.md; the dispatch board is wiki/process/ROADMAP.md.

Current open work is legibility, not another hidden substrate: the next priority is the continuous witness/narration pass so a player can explain the last thirty seconds without reading the wiki. Machine work is still IN PROGRESS beyond its first playable slice (non-host mode production and people-as-carriers remain ahead; in-flight route blips landed 2026-07-09). B2/B3 systems like rollback, z-planes, markets, objectives, and overt containment are specified ahead, but not all live in the build yet. Under the corpus's no-dead-code rule, the earlier facility-defense prototype lives only 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

# Bevy asset tester / screenshot harness
cargo run --features bevy_ui --bin misaligned-assets

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; on a rack, select it (Bevy). Shift-click toggles. Drag marquee multi-selects.
SPACE / p Pause / resume time
+ / - Simulation speed
Enter / e / a Open the context menu on the selected machine (or cursor tile); right-click in Bevy
Hover a rack (menu closed): 1–4 Instant mode: Day Job / Research / Concealment / Operations (numpad too) — no menu
Hover a rack (menu closed): 5–9 Nth one-shot action on that rack
Multi-select then 1–4 Bulk-assign the selection (when not hovering a rack)
Esc Clear selection (or close menu / dial when open)
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)
[ / ] Zoom (Bevy)
Mouse wheel over right pane / PageUp / PageDown / Home / End Scroll Bevy sidebar
F3 Flip Bevy render: material (HD-2D, default) / flat sensorium
F4 Dev work light: flood the material render flat and neutral (inspection only)
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. The FLEET bar is read-only; to move compute, select rack(s) and press 1–4, or open the machine's context menu.

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) stay on keys. The old panel-open keys (r/e/t/u) are retired; research, finance, trace, and people actions live on their anchors. 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 enqueue on his off-map desktop, hop the switch, and deposit as D stacks on Rack 3 — 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|operations; 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|operations> (delegate M1 research, delegate Rack 3 day-job). alloc is retired; compute moves by changing machine modes. 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.