Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs([med-ai-dispatch-server-lib-tuipromptrunner-js-198]): remove from PLAN.md and log to changelog
[._.]/ Adam Eivy7f01bda8ebc4
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 95b7896e43..c516630054 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,8 @@## Changed+- **[med-ai-dispatch-server-lib-tuipromptrunner-js-198] TUI prompt-runner output buffer raised 1MB → 8MB and overflow no longer silent.** `server/lib/tuiHandshake.js` `OUTPUT_BUFFER_CAP` / `OUTPUT_BUFFER_HEADROOM` bumped from 1MB / 1.25MB to 8MB / 10MB so realistic full-context LLM replies (~600KB UTF-8 from a 200K-token window plus screen chrome) no longer head-truncate mid-token when the TUI fails to write its response file and the central handler falls back to the cleaned PTY scrape. `server/lib/tuiPromptRunner.js#executeTuiRun` now tracks an `outputBufferTruncated` flag, logs a one-time warning the first time the new cap is exceeded, and surfaces the flag in the run record's `extras` (`outputTruncated`) so /runs can flag responses where the start may have been lost. The pinned-constants test in `tuiHandshake.test.js` was updated with the new sizes; nothing else moved. 1537/1537 server lib tests pass.+- **[drop-redundant-getissue-precheck-comic-cover-render] Comic-cover render routes drop their redundant `getIssue` precheck.** The two comic-issue cover-render routes in `server/routes/pipeline.js` (`/issues/:id/stages/comicPages/cover/render` and `…/back-cover/render`) carried a `prepare: (req) => issuesSvc.getIssue(req.params.id)` callback that ran an extra `data/issues.json` read on every render request — `enqueueComicCover` / `enqueueComicBackCover` already call `loadBibleContext(issueId)` (`server/services/pipeline/visualStages.js:401`), whose first step at `loadBibleContext`:141 is the same `getIssue(issueId)` raising `PIPELINE_ISSUE_NOT_FOUND` with the same `mapServiceError` → 404 mapping. The precheck was a duplicate read with no behavior difference. Dropped the `prepare` callback at both routes and dropped the `prepare` knob from `makeCoverRenderHandler` entirely — there were no other callers. The route comment block now points at the real upstream source of the 404 instead of the misleading "before we spend the bible-context load" framing. Per-request `data/issues.json` reads on the affected routes drop from 2 to 1. 85/85 pipeline route tests pass (including the unchanged `404s for an unknown issue` case, now serviced from `loadBibleContext`). Captured `[audit-remaining-getissue-prechecks-in-pipeline-routes]` as a follow-up to sweep the same precheck pattern at ~10 other sites in pipeline.js where the called service may already raise the same error.- **[med-ai-dispatch-server-services-digital-twin] `callProviderAI` migrated to `runPromptThroughProvider` — TUI providers now work for Digital Twin AI calls.** `server/services/digital-twin-helpers.js#callProviderAI` previously had a hand-rolled `if (provider.type === 'api') fetch(...) else spawn(provider.command, ...)` split that silently routed TUI providers (claude-code, etc.) into the CLI spawn branch. That branch piped the prompt into stdin against a process expecting a PTY — depending on the binary either it hung until the per-call timeout or scraped its interactive banner chrome into the returned text, so every Digital Twin AI feature was unusable when the user's active provider was a TUI. Migrated to the shared `runPromptThroughProvider` from `server/lib/promptRunner.js` (`source: 'digital-twin'`) so dispatch goes through `executeCliRun` / `executeApiRun` / `executeTuiRun` per `provider.type`, with the same TUI-chrome stripping the rest of the codebase relies on. Return shape (`{ text }` / `{ error }`) is preserved so the 12 call sites across `digital-twin-testing.js`, `digital-twin-import.js`, `digital-twin-enrichment.js`, and `digital-twin-analysis.js` don't change behavior on the parse-and-fallback paths. The legacy `temperature` / `max_tokens` named options were dropped from both the function signature and all 12 call sites — the toolkit's `executeApiRun` doesn't forward them, matching every other unified-runner caller in the repo, so keeping them at call sites would have been cargo-culted. `server/services/digital-twin.test.js` switched from mocking `global.fetch` to mocking `../lib/promptRunner.js` for the goodreads-CSV provider-call test. 87/87 digital-twin tests pass; 6150/6150 server tests pass.diff --git a/PLAN.md b/PLAN.mdindex f5bdbc1171..bc49c5e588 100644--- a/PLAN.md+++ b/PLAN.md@@ -18,7 +18,6 @@ _Nothing currently parked — pick the next item from the Backlog._### v2.1.0 pre-release review residue (deferred from main→release multi-agent review, 2026-05-16)-- [ ] [med-ai-dispatch-server-lib-tuipromptrunner-js-198] **[MED][AI-DISPATCH]** `server/lib/tuiPromptRunner.js:198-200` — `OUTPUT_BUFFER_CAP = 1MB` silently truncates the _head_ of TUI responses >1.25MB mid-token. Persists to disk AND returns truncated. Either stream incrementally to `output.txt` (like agentTuiSpawning does) or raise the cap + log a warning.- [ ] [med-tests-no-direct-tests-for-executetuirun-pty] **[MED][TESTS]** No direct tests for `executeTuiRun` PTY mechanics — idle-complete, hard-timeout, missing-binary early-fail, `emitRunStarted` shape, CLAUDECODE env stripping. The new `tuiPromptRunner.test.js` only covers `cleanTuiResponse`.- [ ] [med-importer-server-routes-importer-test-js-no] **[MED][IMPORTER]** `server/routes/importer.test.js` — no test pins `ERR_PARTIAL_COMMIT_ISSUES → 207` status mapping. Future refactor that drops the entry from `SERVICE_ERROR_STATUS` would 500 on partial commits and trigger pager alerts (the in-code comment's stated regression).- [ ] [med-importer-server-services-importer-test-js-no] **[MED][IMPORTER]** `server/services/importer.test.js` — no test exercises `existingCanonBlock` dedupe wiring. A regression that wires `null` would silently degrade second-pass imports. Assert `mockRunStagedLLM.mock.calls[0][1].existingCanonBlock` contains a seeded character name.