Skip to content

feat: desktop viewer for decisions and rules (ingrain viewer) - #19

Merged
M0xoo merged 3 commits into
mainfrom
wisp/let-s-have-a-beautiful-viewer-fo-b418ca
Nov 17, 2026
Merged

M0xoo merged 3 commits into
mainfrom
wisp/let-s-have-a-beautiful-viewer-fo-b418ca

Conversation

@M0xoo

@M0xoo M0xoo commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What

ingrain viewer opens a native desktop viewer, built into the ingrain binary with Rune, for a repository's decisions and learned rules. It's for reading, reviewing and tracing them. User stories and how each is solved: docs/viewer/PLAN.md.

Inbox

  • Inbox: proposals one at a time. A accepts, R rejects with a reason, J/K move. A replacement shows the decision it retires.
  • Decision page: why, not chosen, scope (click to see what else applies), the check that enforces it, lineage, sources, and git history with each commit's diff. Supersede from the page.
  • Learned rules: Shadow / Warn / Block switch, weekly hits and overrides, the fix it learned from, backtest.
  • Timeline, Archive, and Applies to… for a typed path or a dropped file.
  • Stores: project, local and global items together, tagged, with a sidebar filter.
  • Opens from any folder (ingrain viewer [PATH] [--select ID]; --local / --global for one store), a recent list, ⌘O or a dropped folder. It returns at once; the window updates when files change.
  • No toast after accept / reject / supersede / mode: only failures, and long jobs finishing out of sight.

Decision

How

  • The viewer is crates/cli/src/viewer/, a subcommand of the single ingrain binary (D-0001), behind the default viewer Cargo feature. It reads with ingrain-core / ingrain-ledger / ingrain-engine, so parsing and scope matching are the CLI's own.
  • Every write runs this same binary's commands, one at a time (accept, reject, supersede, rules mode, extract, mine + propose). The viewer never writes a record itself.
  • ingrain viewer starts itself again detached with --wait (its own process group; no console on Windows) and returns.
  • Shipping:
    • macOS and Windows release binaries include the viewer (+~30 MB; --version 3.8 → 6.3 ms).
    • Linux release binaries are built --no-default-features: Rune links libxkbcommon and libwayland-client, which would stop ingrain (hooks included) from starting in containers and on servers. Linux desktops build from source.
  • MSRV: the CLI keeps 1.90 (D-0033; the msrv job checks --no-default-features). The viewer needs 1.99.
  • deny.toml:
    • allows Rune's git source;
    • allows BSD-2-Clause (arrayref, via winit) and MPL-2.0 (spellbook, Rune's spellchecker);
    • ignores three unmaintained zbus crates, which come only through the Linux folder dialog.
    • Rune's audio and SVG features are off.
  • CI: Linux jobs install libxkbcommon-dev / libwayland-dev, and lint also runs clippy --no-default-features.

Testing

  • cargo test --all --locked passes: 133 tests with the viewer, 125 without, including a Runtime test that renders every lens and clicks a row.
  • Clippy is clean in both configurations, cargo +1.90 check --no-default-features passes, and cargo deny check passes.
  • Headless runs of ingrain viewer -- --snap/--script against a seeded repo (scripts/viewer-demo-repo.py):
    • accept wrote D-0007 through the same binary;
    • two rapid accepts gave distinct ids;
    • --local viewer opens filtered to the local store.

Notes

  • The windows-11-arm and x86_64-apple-darwin release targets now build Rune too. They are only exercised by the release workflow.

🤖 Generated with Claude Code

M0xoo and others added 2 commits November 17, 2026 20:38
A native app (`ingrain-viewer`, built with Rune, in its own `viewer/` workspace) to read,
review and trace decisions and learned rules:

- Inbox: proposals one at a time; A accepts, R rejects with a reason, J/K move.
- A page per decision: why, not chosen, scope, enforcing checks, lineage, sources, and git
  history with each commit's diff. Supersede from the page.
- Learned rules: mode switch, weekly hits and overrides, the fix it learned from, backtest.
- Timeline by month, Archive, and "Applies to" for a path or a dropped file.
- Project, local and global stores together, tagged, with a Stores filter.
- Opens from any folder (`ingrain view [PATH] [--select ID]`), recents, ⌘O or a dropped
  folder; updates when files change.

Every write runs the `ingrain` CLI, one at a time. The CLI only gains `ingrain view`, which
starts the viewer; it stays free of GUI dependencies and on MSRV 1.90. CI builds and tests the
viewer on macOS. Docs: README, book page, CHANGELOG, skills, and docs/viewer/PLAN.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The viewer was a separate `ingrain-viewer` program; it is now a subcommand of the one `ingrain`
binary (D-0001), in crates/cli/src/viewer/, behind the default `viewer` Cargo feature.

- `ingrain viewer [PATH] [--select ID] [--wait]` starts itself again detached (own process
  group; no console on Windows) and returns. `--local` / `--global` show only that store.
- Writes run this same binary's commands, one at a time.
- No toast after accept, reject, supersede or a mode change: only failures, and long jobs
  (extract, learn) finishing with their log closed.
- macOS and Windows release binaries include the viewer. Linux release binaries are built
  `--no-default-features`: Rune links libxkbcommon and libwayland-client, which would stop
  `ingrain` (hooks included) from starting in containers and on servers.
- The CLI keeps MSRV 1.90 (D-0033), checked without the viewer; the viewer needs Rust 1.99.
- deny.toml: allow Rune's git source, BSD-2-Clause (arrayref, via winit) and MPL-2.0
  (spellbook, Rune's spellchecker); ignore three unmaintained zbus crates that come only through
  the Linux folder dialog. Rune's audio and SVG features are off.
- Viewer tests take the global store's path instead of setting INGRAIN_HOME.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@M0xoo M0xoo changed the title feat: desktop viewer for decisions and rules feat: desktop viewer for decisions and rules (ingrain viewer) Nov 17, 2026
Bump the version in Cargo.toml, Cargo.lock, plugin.json, the action and the docs, and date
the CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@M0xoo
M0xoo merged commit d342220 into main Nov 17, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant