Skip to content

docs: update dev setup + architecture docs for v1.64.0 fold#334

Open
Akarsh-Hegde wants to merge 2 commits into
mainfrom
docs/post-v1.64.0
Open

docs: update dev setup + architecture docs for v1.64.0 fold#334
Akarsh-Hegde wants to merge 2 commits into
mainfrom
docs/post-v1.64.0

Conversation

@Akarsh-Hegde

@Akarsh-Hegde Akarsh-Hegde commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

v1.64.0 shipped the fold to main, but all developer-facing docs and dev scripts still described the old multi-process topology (screenpipe agent, Node UI server, 4-terminal dev setup). This PR brings them up to date so a new contributor following CONTRIBUTING.md gets a working environment on the first try.

What changed

dev-start.sh — 85 lines → 3 windows

  • Removed the ~20-line screenpipe launchd bootstrap block (capture is in-process; the agent is unneeded and conflicts)
  • Removed the separate "Next.js UI" Terminal window — npm run tauri dev starts the Next.js dev server automatically via beforeDevCommand in tauri.conf.json; opening a second npm run dev ran two servers on port 3939
  • Now opens 3 windows: daemon, MLX, tray

install-dev.sh

  • Removed install-screenpipe-daemon.sh and install-a11y-helper-daemon.sh registration (both are stale since v1.64.0 in-process capture)
  • Added an upgrade note for contributors with an older dev setup (how to bootout the old agents)
  • Updated the "what dev-start.sh opens" summary to 3 windows

CONTRIBUTING.md

  • Project layout table: added meridian-core/, updated ui/ and tray/ descriptions
  • Dev setup: updated to 3-window model; added upgrade note for old setups; documented the tauri devbeforeDevCommand connection; added the popover known limitation
  • Installed-vs-dev table: removed screenpipe/a11y-helper rows; updated UI row
  • TypeScript convention: replaced "keep UI API routes thin" with the bridge.ts invoke pattern (the /api routes are gone)

tray/README.md — complete rewrite

  • Previous version described HTTP polling of /api/health, /api/active, curl http://127.0.0.1:3939 checks — all retired at the fold
  • Now documents the real architecture: in-process capture, embedded dashboard, poll loop, commands by domain, MLX supervision, dev workflow, troubleshooting

README.md

  • Updated "Built on": screenpipe is now a forked capture crate (pinned at last MIT release), not a separate process; added Tauri

SETUP.md

  • Grant permissions to Meridian (not screenpipe)
  • Services table: removed screenpipe row; tray is now the capture owner
  • Log targets: removed screenpipe / screenpipe-error, added tray / tray-error
  • Setup flow: added MLX runtime download step

Tests

5 new regression guards added to tests/tray_assets.rs (all pass):

Test Guards against
dev_start_no_screenpipe_launchd_bootstrap screenpipe launchd block creeping back into dev-start.sh
dev_start_no_separate_nextjs_window separate npm run dev window being re-added (double-starts the dev server)
dev_start_opens_three_terminal_windows window count drifting from 3
install_dev_skips_screenpipe_agents screenpipe/a11y-helper agent registration returning to install-dev.sh
tauri_before_dev_command_starts_nextjs beforeDevCommand being removed from tauri.conf.json (would break devURL without an explicit Next.js terminal)

Test plan

  • Fresh bash install-dev.sh on a clean machine produces no screenpipe/a11y-helper agents
  • bash dev-start.sh opens exactly 3 Terminal windows; dashboard loads in the Tauri webview
  • cargo test --test tray_assets — all 11 tests pass ✅ (pre-push verified)
  • CI green

🤖 Generated with Claude Code

https://claude.ai/code/session_01SKdh3tKWLZhtQ9FCfA5RYH

Summary by CodeRabbit

  • Documentation

    • Updated setup, contribution, and tray documentation to reflect the current Meridian workflow, app structure, and development commands.
    • Clarified installation, permissions, logging, and troubleshooting steps for the app and tray.
    • Added guidance for the embedded dashboard and native app development flow.
  • Tests

    • Added regression coverage for the new development startup behavior and launch setup.

Akarsh-Hegde and others added 2 commits June 24, 2026 23:51
v1.64.0 shipped the fold: dashboard is now a static export embedded in
the Tauri binary, capture runs in-process (no separate screenpipe/a11y-
helper), and the Tauri tray owns the full dev surface. All docs and dev
scripts were still describing the old multi-process topology.

Changes:
- dev-start.sh: remove stale screenpipe launchd bootstrap and the
  redundant Next.js Terminal window — `npm run tauri dev` starts the
  Next.js dev server automatically via beforeDevCommand. Now 3 windows
  (daemon, MLX, tray) instead of 4.
- install-dev.sh: remove screenpipe + a11y-helper launchd registration
  (capture is in-process; those agents conflict and are unneeded). Add
  migration note for devs with an older setup.
- CONTRIBUTING.md: update project layout (add meridian-core), dev setup
  table (3 windows, no screenpipe), installed-vs-dev table, TypeScript
  convention (bridge.ts invoke pattern, no /api routes).
- tray/README.md: full rewrite — previous version described HTTP polling
  of /api routes and curl http://localhost:3939 checks, both retired at
  the fold. Now documents the actual architecture (in-process capture,
  embedded dashboard, poll loop, Tauri commands, MLX supervision).
- README.md: update "Built on" section — screenpipe is now a forked
  capture crate, not a separate process; add Tauri.
- SETUP.md: grant permissions to Meridian (not screenpipe); update
  services table (remove screenpipe row); update log targets; add MLX
  runtime download step to setup flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKdh3tKWLZhtQ9FCfA5RYH
Add 5 regression tests to tray_assets.rs that lock the fold's dev-setup
changes so a future edit can't silently revert the topology:

- dev_start_no_screenpipe_launchd_bootstrap: dev-start.sh must not
  bootstrap a screenpipe launchd agent (capture is in-process)
- dev_start_no_separate_nextjs_window: dev-start.sh must not open a
  separate `npm run dev` window (tauri dev handles it via beforeDevCommand)
- dev_start_opens_three_terminal_windows: exactly 3 `do script` calls
  (daemon, MLX, tray) — not 4
- install_dev_skips_screenpipe_agents: install-dev.sh must not call
  install-screenpipe-daemon.sh or install-a11y-helper-daemon.sh
- tauri_before_dev_command_starts_nextjs: tauri.conf.json must keep the
  beforeDevCommand that auto-starts the Next.js dev server

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKdh3tKWLZhtQ9FCfA5RYH
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates the local development workflow from 4 terminal windows to 3 by removing the separate Next.js terminal (Tauri's beforeDevCommand now starts it) and removing screenpipe/a11y-helper launchd agent registration (capture runs in-process inside the Tauri tray). Script changes are guarded by five new regression tests, and all documentation is updated to match.

Changes

Dev topology: 3-terminal workflow and in-process capture

Layer / File(s) Summary
dev-start.sh and install-dev.sh script changes
dev-start.sh, install-dev.sh
dev-start.sh removes the separate Next.js terminal launch, drops the dashboard-port lsof/kill cleanup, adds a tray/node_modules preflight check, and updates the AppleScript block to open exactly 3 terminals (Rust daemon, MLX server, Tauri tray). install-dev.sh removes calls to install-screenpipe-daemon.sh and install-a11y-helper-daemon.sh, and updates header comments and final instructions to document that capture runs in-process in the tray.
Regression tests for dev topology
tests/tray_assets.rs
Five new #[test] functions assert: dev-start.sh contains no screenpipe launchd references, no npm run dev, and exactly 3 AppleScript do script calls; install-dev.sh contains no install-screenpipe-daemon.sh or install-a11y-helper-daemon.sh; tauri.conf.json's build.beforeDevCommand includes npm run dev.
Documentation updates
CONTRIBUTING.md, README.md, SETUP.md, tray/README.md
CONTRIBUTING.md adds meridian-core/ to the project layout, rewrites the dev setup section and installed-vs-dev comparison table, and updates the TypeScript bridge convention. README.md adds a Tauri bullet to "Built on". SETUP.md rewrites install/permission steps and the What's running table (removing screenpipe/dashboard entries). tray/README.md is substantially rewritten with updated architecture overview, dev/build/troubleshooting content, and a new "Adding a new command" playbook.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop hop, three windows now!
No screenpipe agents, we don't need 'em — wow.
Tauri starts Next.js all on its own,
The capture runs in-process, the tray's now home.
The tests keep watch so nothing slips away,
A leaner dev loop hops into the day! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the PR's main focus on updating dev setup and architecture documentation for the v1.64.0 fold.
Description check ✅ Passed The description includes purpose, changes, and test results, and is mostly complete despite leaving the checklist and related issues sections unfilled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/post-v1.64.0

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CONTRIBUTING.md`:
- Around line 53-57: The blockquote in the upgrade note violates markdownlint
MD031 because the fenced code block is not separated by blank quote lines.
Update the markdown in the “Upgrading from an older dev setup?” section so the
quoted fenced block in CONTRIBUTING.md has an empty blockquote line before and
after the fence, keeping the quote formatting intact around the launchctl
example.

In `@tests/tray_assets.rs`:
- Around line 155-248: The Rust file header in tests/tray_assets.rs is missing
the required leading space in the top comment, so update the file start to match
the standard `// ambient...` convention. Fix the opening comment at the top of
the file and ensure the header formatting remains consistent with other Rust
test files in this module.

In `@tray/README.md`:
- Line 9: The README has markdownlint issues in fenced blocks: the top diagram
fence in the tray overview needs a language tag, and the fenced block under the
tray logs section needs a blank line before it. Update the markdown in
tray/README.md so the diagram fence is labeled with a suitable language such as
text, and add the missing spacing before the bash fence; use the surrounding
README sections and the fenced block markers as the key locations to adjust.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ca5a01e2-9ddf-48da-80e2-c9d570eaf01e

📥 Commits

Reviewing files that changed from the base of the PR and between 0cd60dd and 0f99905.

📒 Files selected for processing (7)
  • CONTRIBUTING.md
  • README.md
  • SETUP.md
  • dev-start.sh
  • install-dev.sh
  • tests/tray_assets.rs
  • tray/README.md
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Rust
  • GitHub Check: Analyze (rust)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{rs,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Every Rust, TypeScript, and TSX file must start with the required ambient dev tool comment as its first line.

Files:

  • tests/tray_assets.rs
🪛 markdownlint-cli2 (0.22.1)
tray/README.md

[warning] 9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 82-82: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

CONTRIBUTING.md

[warning] 54-54: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

Comment thread CONTRIBUTING.md
Comment on lines +53 to +57
> **Upgrading from an older dev setup?** If you have screenpipe or a11y-helper registered from before v1.64.0, remove them:
> ```bash
> launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.meridiona.screenpipe.plist
> launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.meridiona.a11y-helper.plist
> ```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix markdownlint MD031 around the fenced blockquote code block.

Line 54’s fenced block should be surrounded by blank lines inside the blockquote.

Proposed fix
 > **Upgrading from an older dev setup?** If you have screenpipe or a11y-helper registered from before v1.64.0, remove them:
+>
 > ```bash
 > launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.meridiona.screenpipe.plist
 > launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.meridiona.a11y-helper.plist
 > ```
+>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
> **Upgrading from an older dev setup?** If you have screenpipe or a11y-helper registered from before v1.64.0, remove them:
> ```bash
> launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.meridiona.screenpipe.plist
> launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.meridiona.a11y-helper.plist
> ```
> **Upgrading from an older dev setup?** If you have screenpipe or a11y-helper registered from before v1.64.0, remove them:
>
>
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 54-54: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 53 - 57, The blockquote in the upgrade note
violates markdownlint MD031 because the fenced code block is not separated by
blank quote lines. Update the markdown in the “Upgrading from an older dev
setup?” section so the quoted fenced block in CONTRIBUTING.md has an empty
blockquote line before and after the fence, keeping the quote formatting intact
around the launchctl example.

Source: Linters/SAST tools

Comment thread tests/tray_assets.rs
Comment on lines +155 to +248
// ── Dev-setup contract guards (v1.64.0 fold) ──────────────────────────────
// These lock invariants of the dev-script changes that landed with the fold.
// A future edit that accidentally reverts the topology (re-adding a separate
// Next.js window, re-enabling screenpipe agents) should break `cargo test`
// rather than silently breaking new-contributor setup.

/// GUARD: `dev-start.sh` must no longer bootstrap screenpipe as a launchd
/// agent. v1.64.0 runs capture in-process inside the Tauri tray binary — a
/// screenpipe launchd agent conflicts and is unneeded. The old 80-line block
/// (`Ensure screenpipe is up`) was removed; this assertion prevents it from
/// creeping back.
#[test]
fn dev_start_no_screenpipe_launchd_bootstrap() {
let src = read_text("dev-start.sh");
assert!(
!src.contains("LABEL_SCREENPIPE"),
"dev-start.sh must not bootstrap a screenpipe launchd agent \
(capture is in-process inside the Tauri tray since v1.64.0). \
Remove the LABEL_SCREENPIPE / launchctl bootstrap block."
);
assert!(
!src.contains("install-screenpipe-daemon.sh"),
"dev-start.sh must not call install-screenpipe-daemon.sh"
);
}

/// GUARD: `dev-start.sh` must not open a separate Next.js terminal window.
/// `npm run tauri dev` starts the Next.js dev server automatically via
/// `beforeDevCommand` in `tauri.conf.json` — a second window runs it twice.
/// The fold removed window 3 ("Next.js UI"); this prevents it returning.
#[test]
fn dev_start_no_separate_nextjs_window() {
let src = read_text("dev-start.sh");
assert!(
!src.contains("npm run dev"),
"dev-start.sh must not start a separate `npm run dev` window — \
`npm run tauri dev` handles this via beforeDevCommand. \
Running both starts two Next.js processes on the same port."
);
}

/// GUARD: `dev-start.sh` must open exactly 3 Terminal windows (daemon, MLX,
/// tray). The old 4-window setup had a redundant Next.js window; the new fold
/// topology has 3. Counts `do script` calls in the embedded AppleScript block.
#[test]
fn dev_start_opens_three_terminal_windows() {
let src = read_text("dev-start.sh");
let count = src.matches("do script \"").count();
assert_eq!(
count, 3,
"dev-start.sh must open exactly 3 Terminal windows (daemon, MLX, tray). \
Found {count} `do script` calls. If you added a new service window, \
update this test to reflect the new expected count."
);
}

/// GUARD: `install-dev.sh` must not register screenpipe or a11y-helper as
/// launchd agents. Both are unneeded since v1.64.0 (capture is in-process);
/// registering them causes a duplicate-capture conflict.
#[test]
fn install_dev_skips_screenpipe_agents() {
let src = read_text("install-dev.sh");
assert!(
!src.contains("install-screenpipe-daemon.sh"),
"install-dev.sh must not call install-screenpipe-daemon.sh \
(screenpipe is no longer a separate process — capture is in-process \
inside the Tauri tray since v1.64.0)."
);
assert!(
!src.contains("install-a11y-helper-daemon.sh"),
"install-dev.sh must not call install-a11y-helper-daemon.sh \
(a11y capture is in-process inside the Tauri tray since v1.64.0)."
);
}

/// GUARD: `tauri.conf.json`'s `beforeDevCommand` must start the Next.js dev
/// server. This is what removes the need for a separate Next.js terminal in
/// `dev-start.sh` — if the beforeDevCommand is removed or changed, the
/// dashboard would be blank in dev mode without an explicit `npm run dev`.
#[test]
fn tauri_before_dev_command_starts_nextjs() {
let conf = read_json(CONF);
let before_dev = conf["build"]["beforeDevCommand"]
.as_str()
.unwrap_or_default();
assert!(
before_dev.contains("npm run dev"),
"tauri.conf.json build.beforeDevCommand must start the Next.js dev \
server (contain `npm run dev`). Without it, `npm run tauri dev` opens \
a blank webview and a separate Next.js terminal is needed again. \
Found: {before_dev:?}"
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="tests/tray_assets.rs"
required='// ambient dev tool that watches what you do and updates your PM tickets automatically, boosting developer productivity'

first_line="$(head -n 1 "$file")"
printf 'First line in %s:\n%s\n' "$file" "$first_line"

if [[ "$first_line" != "$required" ]]; then
  echo "Header mismatch."
  exit 1
fi

echo "Header matches required ambient comment."

Repository: Meridiona/meridian

Length of output: 328


Fix the Rust file header in tests/tray_assets.rs

Line 1 starts with //ambient... instead of the required // ambient... header, so the file does not match the Rust file-start convention.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/tray_assets.rs` around lines 155 - 248, The Rust file header in
tests/tray_assets.rs is missing the required leading space in the top comment,
so update the file start to match the standard `// ambient...` convention. Fix
the opening comment at the top of the file and ensure the header formatting
remains consistent with other Rust test files in this module.

Source: Coding guidelines

Comment thread tray/README.md
- **Launchd integration**: Registered as `com.meridiona.tray` to auto-start on login
The tray is the central process — it replaces the old Node UI server and the external screenpipe process:

```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Address markdownlint failures in fenced code blocks.

At Line 9, add a language to the fence (e.g., text).
At Line 82, add a blank line before the fenced block.

Proposed fix
-```
+```text
 Tauri tray binary
 ├── In-process capture (screenpipe-screen + screenpipe-a11y)
 │     └── writes capture_frames / capture_ui_events → meridian.db
 ├── Embedded dashboard (static Next.js export in ui/out/)
@@
 **Tray icon not appearing / app won't launch**
+
 ```bash
 # View tray logs
 tail -f ~/.meridian/logs/tray.log

Also applies to: 81-83

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tray/README.md` at line 9, The README has markdownlint issues in fenced
blocks: the top diagram fence in the tray overview needs a language tag, and the
fenced block under the tray logs section needs a blank line before it. Update
the markdown in tray/README.md so the diagram fence is labeled with a suitable
language such as text, and add the missing spacing before the bash fence; use
the surrounding README sections and the fenced block markers as the key
locations to adjust.

Source: Linters/SAST tools

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