Find a file
failerko 01f9e956a1
Some checks are pending
CI / Lint, format, typecheck, docs (push) Waiting to run
CI / Storybook tests (vitest + playwright) (push) Waiting to run
CI / E2E (Playwright + Electron, packaged) (push) Waiting to run
Design: reversal integrity for link rows and delete payloads (#568)
Settles the `4.2c planning gate — Reversals leave link rows and delete
payloads out of step with the log` followup in a design session. Docs
only; the implementation is a new followup, a standalone PR before
4.2c's merge.

## What was wrong (reproduced on `main` after #567)

- **Dangling links.** CTRL-Z of a user-created character leaves the
pass's involvement, awareness and relationship rows naming her. CTRL-Z,
regenerate and rollback run no closure, and where a closure ran it
followed only a happening's links.
- **Rows back with no history.** A reversal of a write to a row held
only in a delete's `undo_payload` touched nothing, was pruned, and the
payload kept the stale copy. Undoing the delete then restored a
relationship, an awareness row, or the deleted happening itself with no
delta. Reproduced through abort and through a prose edit's sweep.

## The contract

- **Every reversal closes over the rows its creates delete, and the rows
naming them**, on every path, through one reference registry (link
tables and translations), live or held in a payload. Reference removal
beats `rowKeepingColumns`; a fact taken by reference loses its
survival-anchor shield.
- **A reversal applies to a row a delete holds:** a create's undo strips
it from the payload, or prunes the delete when it was the target; an
update's undo patches the payload copy. Captured facts follow live ones:
swept with the prose, re-derived when it returns. Accepted cost: a pass
running between undoing the edit and undoing the delete loses links
naming the still-deleted row.
- **Two integrity refusals**, both unreachable today: pruning a delete
whose group would write the removed id back (entity deletes), and a
captured row in a CTRL-Z redo snapshot.
- **Redo** restores the closure's rows; a sweep's rows stay re-derived.
- **No-gate write phase:** a periodic pass's writes hold a per-branch
write lock exclusively, so no other write can interleave with the burst.

## Files

- `generation-pipeline.md` → Reverse-replay (rewritten closure
paragraphs, new payload and refusal paragraphs, sketch), Concurrency
model (new `### No-gate write phase`).
- `data-model.md` → Entry mutability & rollback, Survival anchor, Branch
model (fork), Translation.
- `memory/cadence.md`, `memory/classifier.md`, `rollback-confirm.md`,
`roadmap.md` (M6.1), `02c-collision-review.md` (merge question, History
refresh input).
- `followups.md`: the gate entry replaced by the implementation entry.
- Record: `docs/explorations/2026-10-04-reversal-integrity.md` (probes,
decisions, rejected options, adversarial pass).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:06:48 +02:00
.agents/skills E1 executor: pinned subagents, implementer v2, batched plan writing (#566) 2026-10-04 05:52:13 +02:00
.claude E1 executor: pinned subagents, implementer v2, batched plan writing (#566) 2026-10-04 05:52:13 +02:00
.github Runner pin and cache quota (#532) 2026-09-24 03:30:55 +02:00
.storybook M3 smaller followups (#466) 2026-08-25 18:03:13 +02:00
app M4.2b (3/3): delete surfaces, lead interim, delete E2E (#557) 2026-09-30 02:01:25 +02:00
assets/images chore: initialize Expo + Electron foundation 2026-04-22 22:52:27 +02:00
bench feat: Q4 — classifier-emitted retrieval queries on the piggyback path (#493) 2026-09-08 23:04:17 +02:00
components Triage pass after M4.2b: fixes, canon edits and routing (#567) 2026-10-04 19:49:58 +02:00
constants M4.3 (2/2): Plot panel — route, list pane, thread and happening panes, E2E (#527) 2026-09-23 19:10:39 +02:00
docs Design: reversal integrity for link rows and delete payloads (#568) 2026-10-04 23:06:48 +02:00
e2e Triage pass after M4.2b: fixes, canon edits and routing (#567) 2026-10-04 19:49:58 +02:00
electron Dev slots: per-worktree ports and userData for parallel workers (#543) 2026-09-27 18:13:09 +02:00
hooks Triage pass after M4.2b: fixes, canon edits and routing (#567) 2026-10-04 19:49:58 +02:00
lib Triage pass after M4.2b: fixes, canon edits and routing (#567) 2026-10-04 19:49:58 +02:00
locales/en M4.2b (3/3): delete surfaces, lead interim, delete E2E (#557) 2026-09-30 02:01:25 +02:00
patches Slice M3.8 per entry worldtime click to edit (#453) 2026-08-17 10:30:05 +02:00
scripts Keep the main checkout on slot 0 under dev-slot auto (#547) 2026-09-27 23:49:45 +02:00
types feat: exact local token counts without loading a model 2026-09-10 01:18:48 +02:00
.coderabbit.yaml Coordination gaps from the M4.2b run, pinned workers, independent plan review (#563) 2026-09-30 22:14:19 +02:00
.editorconfig chore: add lefthook, editorconfig, node pin; drop semicolons 2026-04-23 03:14:32 +02:00
.gitattributes feat: db migration guards 2026-06-10 16:42:24 +02:00
.gitignore Coordination gaps from the M4.2b run, pinned workers, independent plan review (#563) 2026-09-30 22:14:19 +02:00
.mcp.json Dev slots: per-worktree ports and userData for parallel workers (#543) 2026-09-27 18:13:09 +02:00
.npmrc chore: code conventions 2026-05-29 01:30:08 +02:00
.nvmrc Slice/m2.1 (#348) 2026-06-16 21:42:06 +02:00
.prettierignore fix: milestone 1 review issues 2026-06-04 00:09:10 +02:00
.prettierrc.json chore: add lefthook, editorconfig, node pin; drop semicolons 2026-04-23 03:14:32 +02:00
.remarkignore Coordination gaps from the M4.2b run, pinned workers, independent plan review (#563) 2026-09-30 22:14:19 +02:00
AGENTS.md fix(ci): point AGENTS.md symlink at relative CLAUDE.md 2026-05-24 02:59:42 +02:00
app.json fix: use single-page web output, not static SSR (#366) 2026-07-14 20:03:51 +02:00
babel.config.js Slice/m3.1a substrate (#389) 2026-07-21 23:18:01 +02:00
CLAUDE.md E1 executor: pinned subagents, implementer v2, batched plan writing (#566) 2026-10-04 05:52:13 +02:00
components.json chore: set up proper ESLint + Prettier 2026-04-23 02:44:23 +02:00
drizzle.config.ts M1.2-drizzle-schema 2026-05-29 23:16:20 +02:00
drizzle.studio.config.ts Dev slots: per-worktree ports and userData for parallel workers (#543) 2026-09-27 18:13:09 +02:00
eslint.config.js Coordination gaps from the M4.2b run, pinned workers, independent plan review (#563) 2026-09-30 22:14:19 +02:00
global.css Triage pass 2026 09 23 (#531) 2026-09-24 02:40:06 +02:00
lefthook.yml fix(ci): point AGENTS.md symlink at relative CLAUDE.md 2026-05-24 02:59:42 +02:00
LICENSE.md chore: transfer license from old codebase 2026-04-30 02:07:51 +02:00
metro.config.js Slice/m3.1a substrate (#389) 2026-07-21 23:18:01 +02:00
nativewind-env.d.ts feat(styling): set up NativeWind v4 with Tailwind CSS 2026-04-22 23:58:41 +02:00
package.json Dev slots: per-worktree ports and userData for parallel workers (#543) 2026-09-27 18:13:09 +02:00
playwright.config.ts Test/e2e setup (#395) 2026-07-24 02:05:13 +02:00
pnpm-lock.yaml Dev slots: per-worktree ports and userData for parallel workers (#543) 2026-09-27 18:13:09 +02:00
pnpm-workspace.yaml M3.12b (#463) 2026-08-22 23:15:10 +02:00
postcss.config.js chore: add lefthook, editorconfig, node pin; drop semicolons 2026-04-23 03:14:32 +02:00
README.md chore: local-first mentions cleaned up, app is local, but use api llm access 2026-05-17 22:12:12 +02:00
tailwind.config.js feat(chrome): dedicated bar-height token + larger top-bar actions 2026-06-01 21:34:55 +02:00
tsconfig.json fix(themes): revert .web.tsx rename + tsconfig moduleSuffixes 2026-05-03 01:28:42 +02:00
vite.config.ts chore: add lefthook, editorconfig, node pin; drop semicolons 2026-04-23 03:14:32 +02:00
vitest.config.ts M4.2b (2/3): History tab and lore detail pane (#555) 2026-09-30 02:01:24 +02:00
vitest.setup.ts Triage pass after M4.2b: fixes, canon edits and routing (#567) 2026-10-04 19:49:58 +02:00
vitest.shims.d.ts chore: set up proper ESLint + Prettier 2026-04-23 02:44:23 +02:00

Aventuras

An AI-collaborative writing app. You write fiction with an AI co-author against backed by an advanced memory system that ensures characters, locations, items, factions, lore, plot threads, and event history are all tracked as the story unfolds. Branch the narrative freely. Roll back any change. All data lives on your machine.

Cross-platform via a single Expo app: mobile (iOS / Android) through Expo Go, desktop (Linux / macOS / Windows) through Electron wrapping the web build. No accounts, no cloud, no environment variables; everything in local database file.

Note on history. The previous iteration of this project lives on the legacy/master branch. The main branch is a ground-up rewrite taking lessons learned. Same idea, different architecture. Old issues, branches, and history remain reachable via legacy/master.

Status

Pre-implementation. The project is in the design + foundation phase:

  • Domain, schema, architecture, and UI surfaces are comprehensively specified in docs/.
  • Tooling is wired (Expo, Electron, Storybook, ESLint, Prettier, remark, lefthook, Vitest, Playwright story tests, CI).
  • A handful of design-system primitives have been scaffolded (components/ui/* with Storybook stories).
  • The writing-app domain itself, stories, entries, the classifier pipeline, world-state retrieval, the AI collaborator, has not yet been built.

This README describes the project's intent. Documentation describes the design. Code-following-design lands incrementally.

Documentation

The substance of the project today is the design corpus. Start here:

  • docs/README.md index of all documentation.
  • docs/architecture.md pipeline, generation context, retrieval, translation. How the code will be organized.
  • docs/data-model.md schema decisions: stories, branches, entries, entities, lore, threads, happenings, chapters, delta log.
  • docs/ui/ UI design: principles, cross-cutting patterns, and per-screen wireframes (interactive HTML + companion .md rationale per surface).
  • docs/tech-stack.md full stack with rationale.
  • docs/followups.md open design questions (current milestone).
  • docs/explorations/ dated session records of design decisions.

Stack

  • Runtime: Expo SDK 55, React 19, React Native 0.83, React Native Web, Electron 41.
  • Styling: NativeWind 4 + Tailwind 3 with shadcn-style theme CSS variables.
  • Storage: expo-sqlite (no external backend).
  • Build / dev: pnpm 10, Node 24, Vite (via Storybook), TypeScript.
  • Quality: ESLint 9, Prettier 3, remark (doc lint), lefthook (pre-commit hooks), Vitest + Playwright (story tests).

Full rationale in docs/tech-stack.md.

Repository layout

.
├── app/                Expo Router routes (mobile + web)
├── electron/           Electron main + preload (desktop shell)
├── components/         Shared UI components (RN + RN Web)
│   └── ui/             Design-system primitives + Storybook stories
├── lib/ hooks/ types/ constants/
├── docs/               Project documentation (the canonical spec)
│   ├── ui/             UI principles, patterns, per-screen designs
│   ├── explorations/   Dated design-session records
│   └── followups.md / parked.md
├── scripts/            Repository scripts
├── .storybook/         Storybook config
├── .github/            CI workflows
└── .claude/            Claude-Code-specific tooling (rules, skills)

Development

Requires Node 24 and pnpm 10 (both pinned via .nvmrc and packageManager).

pnpm install

Doc tooling

pnpm lint:docs       # remark over docs/

Wireframes are static HTML colocated with each screen's .md under docs/ui/screens/<screen>/. Open the .html directly in a browser.

Storybook (design-system primitives)

pnpm storybook       # http://localhost:6006

Runs the active design-system catalog. Stories under components/ui/*.stories.tsx.

Web / mobile (Expo)

pnpm web             # web build via Expo
pnpm android         # Android emulator
pnpm ios             # iOS simulator

The app shell is currently the default Expo scaffold, domain implementation hasn't started. These commands work but won't show the writing app itself.

Desktop (Electron)

pnpm desktop         # web build + Electron, hot-reloaded

Quality

pnpm lint            # ESLint
pnpm format:check    # Prettier
pnpm typecheck       # tsc --noEmit
pnpm test            # Vitest watch
pnpm test:run        # Vitest single-run + Playwright story tests

CI runs all of the above on every push / PR.

Workflow

  • Pre-commit hooks (lefthook.yml) run prettier + eslint + remark in parallel on staged files. Don't bypass with --no-verify.
  • Commits are small and focused. Multiple commits beat a single omnibus commit when the work is logically separable.
  • File moves use git mv to preserve history; inbound references update in the same commit.

Project-specific Claude-Code rules live under .claude/ (skills + topic-scoped rules that auto-load when relevant files are read).