[PR #6648] [MERGED] feat(tools): optional Dev MCP for inspecting and safely restarting a local engine #7271

Closed
opened 2026-10-23 04:18:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6648
Author: @SirAdoni
Created: 9/25/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @SpicyMarinara

Base: staging ← Head: contrib/dev-mcp


📝 Commits (10+)

  • 6ea18c1 feat(tools): add a Dev MCP for inspecting a local Marinara engine
  • 17fcb17 fix(tools): let the Dev MCP stand alone on staging and harden its inputs
  • f024b72 docs: point contributors to the Dev MCP
  • 902c13b fix(tools): hold the Dev MCP engine lock atomically and for whole builds
  • dcf60a9 fix(tools): stop only the consecutive engine processes above the listener
  • 9442789 fix(tools): refuse unsafe Dev MCP sandbox setups and failed sandbox starts
  • 106644a fix(tools): stop a Dev MCP engine start that never answers, close log handles
  • c650905 fix(tools): read the env file the engine reads (MARINARA_ENV_FILE)
  • 2553499 fix(tools): do not mark run_regressions as read-only
  • 12c5251 test(tools): close the Dev MCP smoke client on failure, check the write guard exactly

📊 Changes

19 files changed (+4417 additions, -0 deletions)

View changed files

📝 .dockerignore (+3 -0)
📝 .gitignore (+2 -0)
📝 CHANGELOG.md (+1 -0)
📝 CONTRIBUTING.md (+1 -0)
➕ tools/dev-mcp/.gitignore (+1 -0)
➕ tools/dev-mcp/README.md (+189 -0)
➕ tools/dev-mcp/lib/api.mjs (+121 -0)
➕ tools/dev-mcp/lib/config.mjs (+101 -0)
➕ tools/dev-mcp/lib/engine.mjs (+518 -0)
➕ tools/dev-mcp/lib/logs.mjs (+192 -0)
➕ tools/dev-mcp/lib/proc.mjs (+314 -0)
➕ tools/dev-mcp/lib/prompts.mjs (+114 -0)
➕ tools/dev-mcp/lib/sandbox.mjs (+310 -0)
➕ tools/dev-mcp/lib/util.mjs (+88 -0)
➕ tools/dev-mcp/package-lock.json (+1210 -0)
➕ tools/dev-mcp/package.json (+24 -0)
➕ tools/dev-mcp/server.mjs (+700 -0)
➕ tools/dev-mcp/test/isolation.mjs (+409 -0)
➕ tools/dev-mcp/test/smoke.mjs (+119 -0)

📄 Description

Rebased 2026-09-25 onto upstream staging e15c9e558. Hashes below are the rebased ones. The rebase had no conflicts. Re-checked after it: install, shared build, tsc (shared, server, client), locale check and this branch's own regressions, all passing. The full suites and CodeRabbit reviews listed below ran on the previous base, one or two staging updates earlier.

Base: staging (e15c9e558) · Head: contrib/dev-mcp (11669c447)


Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6624
Part 2 of the engine foundations series, see #6624.

This PR is independent of the other parts. It targets staging directly and can be merged, reviewed or declined on its own. Part 1 (foundations) is not required; a few outputs are richer with it, as noted below.

Why this change

  • When a coding agent works on the engine, much of the time goes into things it can't see: the exact prompt a reply was built from, why the prompt cache hit rate dropped, which log lines belong to a failed request, and whether a rebuild and restart is safe right now.
  • tools/dev-mcp is a small, optional MCP server that answers those questions for any MCP client (Claude Code, Codex and others), and restarts the engine without the launchers' git clean step.
  • Nothing in the app depends on it. It is not a pnpm workspace package, it is not built or shipped, and it is excluded from the Docker image. Deleting the folder changes nothing.

What changed

20 commits on staging e15c9e558, oldest first, 18 files, all additions:

  • 6ea18c1fc feat(tools): add a Dev MCP for inspecting a local Marinara engine.
  • 17fcb17e5 fix(tools): let the Dev MCP stand alone on staging and harden its inputs.
  • f024b7248 docs: point contributors to the Dev MCP.
  • 902c13b67 fix(tools): hold the Dev MCP engine lock atomically and for whole builds.
  • dcf60a9e3 fix(tools): stop only the consecutive engine processes above the listener.
  • 94427897e fix(tools): refuse unsafe Dev MCP sandbox setups and failed sandbox starts.
  • 106644acc fix(tools): stop a Dev MCP engine start that never answers, close log handles.
  • c650905f6 fix(tools): read the env file the engine reads (MARINARA_ENV_FILE).
  • 255349955 fix(tools): do not mark run_regressions as read-only.
  • 12c5251e9 test(tools): close the Dev MCP smoke client on failure, check the write guard exactly.
  • 13a51e4e2 fix(tools): parse inline comments in the engine env file like dotenv.
  • 772c56e44 fix(tools): follow exact id matches first in lookup_error.
  • 00e405c6f fix(tools): take the engine lock for typecheck's shared rebuild.
  • dd4a8df80 fix(tools): restart the sandbox on the build folder it last ran.
  • 209997e19 fix(tools): do not stop a port listener the Dev MCP cannot identify.
  • 2554f3a0d fix(tools): judge an unreadable Dev MCP lock file by its age.
  • f9e7163fb fix(tools): let sandbox_refresh keep the sandbox's recorded build folder.
  • a8858b583 fix(tools): refuse a second locked operation in the same Dev MCP session.
  • 995c5aa9a fix(tools): require the port listener itself to look like the engine.
  • 11669c447 fix(tools): report whether run_regressions finished, not just its failures.

The tool (tools/dev-mcp/, with its own package.json and lockfile)

  • Read tools: engine status, git status, chats and messages, chat settings, saved prompts and a free next-turn preview, per-reply cache report, prompt diff, grouped logs, error lookup, connections (ids, providers, models and names only, never keys or base URLs), characters.
  • Write tools, each with a backup first and a dryRun option: character edits and chat metadata.
  • Development tools: typecheck, regressions, build, restart with a quiet wait and build rollback, and raw API calls (anything but GET needs confirm and a reason).
  • A sandbox: a sanitized copy of the local store on another port, with credentials blanked, remote base URLs pointed at a closed local port, and subscription logins out of reach.
  • A smoke test (tools/dev-mcp/test/smoke.mjs) and a README covering setup, settings, safety and platform support.

Standalone on staging (17fcb17e5)

  • staging writes no log files, so the log tools fall back to the engine output the tool saves when it starts the engine.
  • With the default LOG_LEVEL of warn, the restart quiet wait sees no generation activity in the logs, so it does not wait. The README says so, and asks you to check that nobody is mid-reply before a restart, or to run with LOG_LEVEL=info.
  • A fork-only continuity_status tool was removed.
  • Request ids, the errorId lookup and the startup summary are optional. They work best with part 1, which adds request ids and a startup summary, and degrade cleanly without it.

Input hardening (from a hand security review, 17fcb17e5)

  • diff_prompts reads only from inside the state folder: paths are resolved and checked with a startsWith guard.
  • Ids used in backup file names are reduced to safe characters.
  • On Windows, pnpm runs corepack.js directly without a shell. A custom MARINARA_DEV_PNPM containing shell characters is refused.
  • The .env reader uses plain string parsing instead of a regex.

Review fixes (local CodeRabbit round 1, 902c13b67 and dcf60a9e3)

  • Three majors, all fixed:
    • build now holds the engine lock for the whole build.
    • The lock is created atomically and exclusively with a per-process token. A stale lock is taken over only if it is still the same stale lock, and the lock is refreshed during long waits.
    • When finding the engine root, the tool climbs only through consecutive engine processes above the listener.

Review fixes (CodeRabbit rerun, pass 1: 9 found, 9 fixed, 94427897e to 12c5251e9)

  • The sandbox port may not equal the live engine's port; the tool refuses to start the sandbox.
  • sandbox_refresh stops after a failed stop instead of carrying on.
  • A sandbox start fails fast, with a log tail, when the process exits.
  • An engine start that never answers is stopped before recovery.
  • Log file handles are closed.
  • MARINARA_ENV_FILE is honoured, so the tool reads the env file the engine reads.
  • run_regressions is marked as a write tool, not read-only.
  • The smoke test always closes its client, also on failure.
  • The smoke test requires the write guard's own message, and posts to /health to reach it.

Review fixes (CodeRabbit rerun, pass 2: 4 found, 4 fixed, 13a51e4e2 to dd4a8df80)

  • Inline comments in the .env file are parsed like dotenv.
  • lookup_error prefers exact request id matches.
  • typecheck takes the engine lock for its shared rebuild. (Its holdsLock() shortcut was removed again in pass 4.)
  • A sandbox restart reuses the build folder it last ran on.

Review fixes (CodeRabbit rerun, pass 3: 3 found, 3 fixed, 209997e19 to f9e7163fb)

  • A port listener the tool cannot identify is stopped only if this tool started it; otherwise the operation is refused.
  • A truncated or unreadable lock file is judged by its age: held if under 45 minutes old, stale after. Before, it blocked the lock permanently.
  • sandbox_refresh reuses its last build folder, then MARINARA_DEV_SANDBOX_DIST, then dist.

Review fixes (CodeRabbit rerun, pass 4: 3 found, 3 fixed, a8858b583 to 11669c447)

  • A second locked operation in the same session is refused. The holdsLock() shortcut was removed.
  • The listening process itself must look like the engine, not just one of its ancestors.
  • run_regressions returns ok plus runError, so a timeout or a failed start is no longer reported as a pass.

Findings per pass went 9, 4, 3, 3, all fixed. The pass 4 fixes have not been re-reviewed locally; CodeRabbit will review them on this PR.

Repository files

  • .dockerignore: tools/ and .dev-mcp are not part of the image.
  • .gitignore: .dev-mcp/ local state (journal, logs, lock).
  • CHANGELOG.md: one entry under [Unreleased].
  • CONTRIBUTING.md: one line pointing to tools/dev-mcp/README.md.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

The boxes are left unticked for a human, per AGENTS.md. The repository checks in the first rows ran on dcf60a9e3. They were not rerun on 11669c447, because the fifteen commits since touch only tools/dev-mcp, which the build and the regressions don't load. The Dev MCP's own checks (last three rows) ran again on 11669c447.

Check Result
tsc --noEmit, Windows 11 clean, 5 runs
Lint 0 errors
Prettier, locales, builds pass
Full regression suite, Windows 11 only the 5 known Windows-only failures (decision-sidecar-runtime, gallery-previews, request-timeouts, server-signal-shutdown, storage-writer-lock), plus load timeouts that passed when run individually
CI-equivalent, Linux (WSL Ubuntu 24.04, Node 24.21) complete-node-regressions 370 / 371. The one failure, server-signal-shutdown, timed out, and it also times out on plain staging in the same WSL setup. The pnpm-validate steps all exit 0.
Dev MCP smoke test, on 11669c447 passes offline, and online against a staging build on a spare port
Multi-process lock test, on 11669c447 7 / 7 checks pass
node --check on every changed file, on 11669c447 pass

Manual verification notes

  • Ran the smoke test with no engine running (offline) and against a staging build started on a spare port (online).
  • Ran a 7-check test with several server processes competing for the engine lock: atomic creation, per-process tokens, stale takeover only of the same stale lock, and refresh during long waits.
  • No model was called. The sandbox blocks model calls by design.

Human to tick

Based on the evidence above:

  • pnpm check passes locally: supported. Its steps (tsc, lint, Prettier, locales, builds, regressions) all passed on Windows, apart from the 5 known Windows-only failures, and the CI-equivalent pnpm-validate steps all exit 0 on Linux. If you want the literal command, run pnpm check once before ticking.
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed: supported (CHANGELOG.md, CONTRIBUTING.md and tools/dev-mcp/README.md).

Not supported by the evidence, leave unticked unless done by hand:

  • Container built and ran: not run for this PR (see below).
  • Ran the app and clicked through: this PR has no app UI.
  • Edge cases (light/dark, mobile viewport): not applicable, no UI.
  • Above manual verification completed, and Read and followed CONTRIBUTING.md: only a human can confirm these.
  • No docs changes needed, and Version/release files updated: do not apply.
  • Translated docs: see below.

Needs manual verification

  • Build and run the Docker image once, to confirm the .dockerignore change leaves the image unchanged apart from excluding tools/.
  • Try the tool from a real MCP client on macOS. The README marks macOS as sharing the Linux code but untested.
  • Decide whether the CONTRIBUTING.md line needs a [docs-i18n] follow-up issue for the translated guides.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

The PR adds a CHANGELOG entry under [Unreleased], one line in CONTRIBUTING.md, and tools/dev-mcp/README.md. No version bump.

UI evidence (if applicable)

Not applicable. This PR has no UI.

Remaining steps

  • CodeRabbit's review of this PR on GitHub, which also covers the pass 4 fixes that have not been re-reviewed locally. Local passes 1 to 4 found 19 issues (9, 4, 3, 3), all fixed.
  • The manual checks listed above.

🤖 Generated with Claude Code

Summary by CodeRabbit

Summary

  • New Features
    • Added optional developer tools to inspect engine prompts, cache usage, logs, chats, characters, and connections.
    • Added tools to edit character and chat details, run checks and regression tests, build, and safely restart the engine.
    • Added an isolated sandbox that runs on a copied, sanitized data set.
  • Documentation
    • Added setup, usage, configuration, workflow, and safety guidance for the developer tools and sandbox.
  • Chores
    • Excluded the optional tools and their local state from application and Docker build contexts.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6648 **Author:** [@SirAdoni](https://github.com/SirAdoni) **Created:** 9/25/2026 **Status:** ✅ Merged **Merged:** 9/26/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `contrib/dev-mcp` --- ### 📝 Commits (10+) - [`6ea18c1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6ea18c1fc46e5eb7c7198aeed6bc29bbcb6701eb) feat(tools): add a Dev MCP for inspecting a local Marinara engine - [`17fcb17`](https://github.com/Pasta-Devs/Marinara-Engine/commit/17fcb17e5420602caecd3953c08c6153bd3f0425) fix(tools): let the Dev MCP stand alone on staging and harden its inputs - [`f024b72`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f024b72485ccb8ceeccf390e752c63de7f24c23f) docs: point contributors to the Dev MCP - [`902c13b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/902c13b67283935b242abe2e015774246ea60dda) fix(tools): hold the Dev MCP engine lock atomically and for whole builds - [`dcf60a9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dcf60a9e31ba4e7801d2892fbaa5209e15046954) fix(tools): stop only the consecutive engine processes above the listener - [`9442789`](https://github.com/Pasta-Devs/Marinara-Engine/commit/94427897e92449eb72e7037419f07c554a0a33d5) fix(tools): refuse unsafe Dev MCP sandbox setups and failed sandbox starts - [`106644a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/106644accfe3b92a7d48d8a88cd6a630461186ad) fix(tools): stop a Dev MCP engine start that never answers, close log handles - [`c650905`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c650905f653ca89f256e717e99b4bcbb5df137e6) fix(tools): read the env file the engine reads (MARINARA_ENV_FILE) - [`2553499`](https://github.com/Pasta-Devs/Marinara-Engine/commit/25534995521dc65c1d78d67579ecc5b17a16b3a4) fix(tools): do not mark run_regressions as read-only - [`12c5251`](https://github.com/Pasta-Devs/Marinara-Engine/commit/12c5251e945bf5f9cacda8ee52edfa13f651783a) test(tools): close the Dev MCP smoke client on failure, check the write guard exactly ### 📊 Changes **19 files changed** (+4417 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.dockerignore` (+3 -0) 📝 `.gitignore` (+2 -0) 📝 `CHANGELOG.md` (+1 -0) 📝 `CONTRIBUTING.md` (+1 -0) ➕ `tools/dev-mcp/.gitignore` (+1 -0) ➕ `tools/dev-mcp/README.md` (+189 -0) ➕ `tools/dev-mcp/lib/api.mjs` (+121 -0) ➕ `tools/dev-mcp/lib/config.mjs` (+101 -0) ➕ `tools/dev-mcp/lib/engine.mjs` (+518 -0) ➕ `tools/dev-mcp/lib/logs.mjs` (+192 -0) ➕ `tools/dev-mcp/lib/proc.mjs` (+314 -0) ➕ `tools/dev-mcp/lib/prompts.mjs` (+114 -0) ➕ `tools/dev-mcp/lib/sandbox.mjs` (+310 -0) ➕ `tools/dev-mcp/lib/util.mjs` (+88 -0) ➕ `tools/dev-mcp/package-lock.json` (+1210 -0) ➕ `tools/dev-mcp/package.json` (+24 -0) ➕ `tools/dev-mcp/server.mjs` (+700 -0) ➕ `tools/dev-mcp/test/isolation.mjs` (+409 -0) ➕ `tools/dev-mcp/test/smoke.mjs` (+119 -0) </details> ### 📄 Description > **Rebased 2026-09-25** onto upstream staging `e15c9e558`. Hashes below are the rebased ones. The rebase had no conflicts. Re-checked after it: install, shared build, tsc (shared, server, client), locale check and this branch's own regressions, all passing. The full suites and CodeRabbit reviews listed below ran on the previous base, one or two staging updates earlier. **Base:** `staging` (`e15c9e558`) · **Head:** `contrib/dev-mcp` (`11669c447`) --- > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #6624 Part 2 of the engine foundations series, see #6624. This PR is independent of the other parts. It targets `staging` directly and can be merged, reviewed or declined on its own. Part 1 (foundations) is not required; a few outputs are richer with it, as noted below. ## Why this change - When a coding agent works on the engine, much of the time goes into things it can't see: the exact prompt a reply was built from, why the prompt cache hit rate dropped, which log lines belong to a failed request, and whether a rebuild and restart is safe right now. - `tools/dev-mcp` is a small, optional MCP server that answers those questions for any MCP client (Claude Code, Codex and others), and restarts the engine without the launchers' `git clean` step. - Nothing in the app depends on it. It is not a pnpm workspace package, it is not built or shipped, and it is excluded from the Docker image. Deleting the folder changes nothing. ## What changed 20 commits on `staging` `e15c9e558`, oldest first, 18 files, all additions: - `6ea18c1fc` feat(tools): add a Dev MCP for inspecting a local Marinara engine. - `17fcb17e5` fix(tools): let the Dev MCP stand alone on staging and harden its inputs. - `f024b7248` docs: point contributors to the Dev MCP. - `902c13b67` fix(tools): hold the Dev MCP engine lock atomically and for whole builds. - `dcf60a9e3` fix(tools): stop only the consecutive engine processes above the listener. - `94427897e` fix(tools): refuse unsafe Dev MCP sandbox setups and failed sandbox starts. - `106644acc` fix(tools): stop a Dev MCP engine start that never answers, close log handles. - `c650905f6` fix(tools): read the env file the engine reads (MARINARA_ENV_FILE). - `255349955` fix(tools): do not mark run_regressions as read-only. - `12c5251e9` test(tools): close the Dev MCP smoke client on failure, check the write guard exactly. - `13a51e4e2` fix(tools): parse inline comments in the engine env file like dotenv. - `772c56e44` fix(tools): follow exact id matches first in lookup_error. - `00e405c6f` fix(tools): take the engine lock for typecheck's shared rebuild. - `dd4a8df80` fix(tools): restart the sandbox on the build folder it last ran. - `209997e19` fix(tools): do not stop a port listener the Dev MCP cannot identify. - `2554f3a0d` fix(tools): judge an unreadable Dev MCP lock file by its age. - `f9e7163fb` fix(tools): let sandbox_refresh keep the sandbox's recorded build folder. - `a8858b583` fix(tools): refuse a second locked operation in the same Dev MCP session. - `995c5aa9a` fix(tools): require the port listener itself to look like the engine. - `11669c447` fix(tools): report whether run_regressions finished, not just its failures. **The tool** (`tools/dev-mcp/`, with its own `package.json` and lockfile) - Read tools: engine status, git status, chats and messages, chat settings, saved prompts and a free next-turn preview, per-reply cache report, prompt diff, grouped logs, error lookup, connections (ids, providers, models and names only, never keys or base URLs), characters. - Write tools, each with a backup first and a `dryRun` option: character edits and chat metadata. - Development tools: typecheck, regressions, build, restart with a quiet wait and build rollback, and raw API calls (anything but GET needs `confirm` and a reason). - A sandbox: a sanitized copy of the local store on another port, with credentials blanked, remote base URLs pointed at a closed local port, and subscription logins out of reach. - A smoke test (`tools/dev-mcp/test/smoke.mjs`) and a README covering setup, settings, safety and platform support. **Standalone on staging** (`17fcb17e5`) - `staging` writes no log files, so the log tools fall back to the engine output the tool saves when it starts the engine. - With the default `LOG_LEVEL` of `warn`, the restart quiet wait sees no generation activity in the logs, so it does not wait. The README says so, and asks you to check that nobody is mid-reply before a restart, or to run with `LOG_LEVEL=info`. - A fork-only `continuity_status` tool was removed. - Request ids, the `errorId` lookup and the startup summary are optional. They work best with part 1, which adds request ids and a startup summary, and degrade cleanly without it. **Input hardening** (from a hand security review, `17fcb17e5`) - `diff_prompts` reads only from inside the state folder: paths are resolved and checked with a `startsWith` guard. - Ids used in backup file names are reduced to safe characters. - On Windows, pnpm runs `corepack.js` directly without a shell. A custom `MARINARA_DEV_PNPM` containing shell characters is refused. - The `.env` reader uses plain string parsing instead of a regex. **Review fixes** (local CodeRabbit round 1, `902c13b67` and `dcf60a9e3`) - Three majors, all fixed: - `build` now holds the engine lock for the whole build. - The lock is created atomically and exclusively with a per-process token. A stale lock is taken over only if it is still the same stale lock, and the lock is refreshed during long waits. - When finding the engine root, the tool climbs only through consecutive engine processes above the listener. **Review fixes** (CodeRabbit rerun, pass 1: 9 found, 9 fixed, `94427897e` to `12c5251e9`) - The sandbox port may not equal the live engine's port; the tool refuses to start the sandbox. - `sandbox_refresh` stops after a failed stop instead of carrying on. - A sandbox start fails fast, with a log tail, when the process exits. - An engine start that never answers is stopped before recovery. - Log file handles are closed. - `MARINARA_ENV_FILE` is honoured, so the tool reads the env file the engine reads. - `run_regressions` is marked as a write tool, not read-only. - The smoke test always closes its client, also on failure. - The smoke test requires the write guard's own message, and posts to `/health` to reach it. **Review fixes** (CodeRabbit rerun, pass 2: 4 found, 4 fixed, `13a51e4e2` to `dd4a8df80`) - Inline comments in the `.env` file are parsed like dotenv. - `lookup_error` prefers exact request id matches. - `typecheck` takes the engine lock for its shared rebuild. (Its `holdsLock()` shortcut was removed again in pass 4.) - A sandbox restart reuses the build folder it last ran on. **Review fixes** (CodeRabbit rerun, pass 3: 3 found, 3 fixed, `209997e19` to `f9e7163fb`) - A port listener the tool cannot identify is stopped only if this tool started it; otherwise the operation is refused. - A truncated or unreadable lock file is judged by its age: held if under 45 minutes old, stale after. Before, it blocked the lock permanently. - `sandbox_refresh` reuses its last build folder, then `MARINARA_DEV_SANDBOX_DIST`, then `dist`. **Review fixes** (CodeRabbit rerun, pass 4: 3 found, 3 fixed, `a8858b583` to `11669c447`) - A second locked operation in the same session is refused. The `holdsLock()` shortcut was removed. - The listening process itself must look like the engine, not just one of its ancestors. - `run_regressions` returns `ok` plus `runError`, so a timeout or a failed start is no longer reported as a pass. Findings per pass went 9, 4, 3, 3, all fixed. The pass 4 fixes have not been re-reviewed locally; CodeRabbit will review them on this PR. **Repository files** - `.dockerignore`: `tools/` and `.dev-mcp` are not part of the image. - `.gitignore`: `.dev-mcp/` local state (journal, logs, lock). - `CHANGELOG.md`: one entry under `[Unreleased]`. - `CONTRIBUTING.md`: one line pointing to `tools/dev-mcp/README.md`. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` The boxes are left unticked for a human, per `AGENTS.md`. The repository checks in the first rows ran on `dcf60a9e3`. They were not rerun on `11669c447`, because the fifteen commits since touch only `tools/dev-mcp`, which the build and the regressions don't load. The Dev MCP's own checks (last three rows) ran again on `11669c447`. | Check | Result | |---|---| | `tsc --noEmit`, Windows 11 | clean, 5 runs | | Lint | 0 errors | | Prettier, locales, builds | pass | | Full regression suite, Windows 11 | only the 5 known Windows-only failures (`decision-sidecar-runtime`, `gallery-previews`, `request-timeouts`, `server-signal-shutdown`, `storage-writer-lock`), plus load timeouts that passed when run individually | | CI-equivalent, **Linux** (WSL Ubuntu 24.04, Node 24.21) | `complete-node-regressions` **370 / 371**. The one failure, `server-signal-shutdown`, timed out, and it also times out on plain `staging` in the same WSL setup. The `pnpm-validate` steps all exit 0. | | Dev MCP smoke test, on `11669c447` | passes offline, and online against a `staging` build on a spare port | | Multi-process lock test, on `11669c447` | 7 / 7 checks pass | | `node --check` on every changed file, on `11669c447` | pass | ### Manual verification notes - Ran the smoke test with no engine running (offline) and against a `staging` build started on a spare port (online). - Ran a 7-check test with several server processes competing for the engine lock: atomic creation, per-process tokens, stale takeover only of the same stale lock, and refresh during long waits. - No model was called. The sandbox blocks model calls by design. ## Human to tick Based on the evidence above: - **`pnpm check` passes locally**: supported. Its steps (tsc, lint, Prettier, locales, builds, regressions) all passed on Windows, apart from the 5 known Windows-only failures, and the CI-equivalent `pnpm-validate` steps all exit 0 on Linux. If you want the literal command, run `pnpm check` once before ticking. - **Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed**: supported (`CHANGELOG.md`, `CONTRIBUTING.md` and `tools/dev-mcp/README.md`). Not supported by the evidence, leave unticked unless done by hand: - Container built and ran: not run for this PR (see below). - Ran the app and clicked through: this PR has no app UI. - Edge cases (light/dark, mobile viewport): not applicable, no UI. - Above manual verification completed, and Read and followed `CONTRIBUTING.md`: only a human can confirm these. - No docs changes needed, and Version/release files updated: do not apply. - Translated docs: see below. ## Needs manual verification - Build and run the Docker image once, to confirm the `.dockerignore` change leaves the image unchanged apart from excluding `tools/`. - Try the tool from a real MCP client on macOS. The README marks macOS as sharing the Linux code but untested. - Decide whether the `CONTRIBUTING.md` line needs a `[docs-i18n]` follow-up issue for the translated guides. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) The PR adds a CHANGELOG entry under `[Unreleased]`, one line in `CONTRIBUTING.md`, and `tools/dev-mcp/README.md`. No version bump. ## UI evidence (if applicable) Not applicable. This PR has no UI. ## Remaining steps - CodeRabbit's review of this PR on GitHub, which also covers the pass 4 fixes that have not been re-reviewed locally. Local passes 1 to 4 found 19 issues (9, 4, 3, 3), all fixed. - The manual checks listed above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary - **New Features** - Added optional developer tools to inspect engine prompts, cache usage, logs, chats, characters, and connections. - Added tools to edit character and chat details, run checks and regression tests, build, and safely restart the engine. - Added an isolated sandbox that runs on a copied, sanitized data set. - **Documentation** - Added setup, usage, configuration, workflow, and safety guidance for the developer tools and sandbox. - **Chores** - Excluded the optional tools and their local state from application and Docker build contexts. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:18:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7271
No description provided.