Skip to content

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

Merge remote-tracking branch 'origin/main' into claim/issue-2453

Adam Eivyd8e0ccb87629
diff --cc .changelog/NEXT.md
index 992faa1770,67c002ba41..61703c0000
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@@ -2,7 -2,10 +2,12 @@@
## Changes
+- **The inline-claim task prompts now name `grok` as a local-CLI reviewer (#2453).** After Grok became a selectable Review Loop reviewer, the four inline-claim prompt defaults (`plan-task`, `claim-issue`, `claim-issue-gitlab`, `claim-issue-jira`) still enumerated only `` `claude` / `codex` / `antigravity` `` in their per-kind reviewer-handling bullets, leaving grok un-categorized as a CLI reviewer when a user set it as their default. All seven bullet sites now list `` `grok` `` alongside the other coding-agent CLIs. Following the cross-install prompt-upgrade contract, each of the four task types gets a `PROMPT_VERSIONS` bump with the entire prior default preserved in `PREVIOUS_DEFAULT_PROMPTS`, so non-customized installs auto-upgrade; the integrity snapshot is regenerated. Text-only change.
++
+ - **CoS investigation tasks now use a human-facing "What happened / What to approve / What unblocks" template with a redacted failure snippet (#2442).** When a CoS agent failure is classified as *actionable*, `createInvestigationTask()` filed a fixed 6-field stub (Failed Agent / Original Task / Error Category / Suggested Fix / Model) that read identically for every category, while the useful diagnostic context stayed buried in `learning.json` telemetry. The body is now restructured into three sections — **What happened** (plain-language category + provider/model attribution + a short captured failure snippet), **What to approve** (the concrete decision/action to take), and **What unblocks** (which original task resumes) — and each `ERROR_PATTERN` may optionally supply category-specific escalation prose so the note varies by failure kind (model-not-found, context-length, spawn-error, task-rejected, content-filtered, etc.) instead of being uniform. The folded-in snippet and task description are passed through a new `redactFailureSnippet()` helper that strips OS usernames from home paths, emails, IPs, Tailscale/mDNS hostnames, and bearer/secret tokens before anything lands in the human-facing (and potentially federated) task body. Additive copy/structure change to one function plus optional per-pattern fields — no status-model change.
+
+ - **A CoS sub-agent can now challenge a wrong reviewer rejection instead of silently fixing it or getting blocked (#2441).** When a review-loop reviewer rejects work — common with noisy local/CLI reviewers — the task can be parked in a new `challenged` status with the worker's case attached (`reason` + optional `evidence` + which `reviewer` is disputed) via `POST /api/cos/tasks/:id/challenge`. Disputes are bounded to exactly one per task (a second is refused with `409 CHALLENGE_EXHAUSTED`), so an agent can't loop forever. Resolving via `POST /api/cos/tasks/:id/challenge/resolve` either **overturns** the rejection (`upheld` → task re-queues to pending) or **escalates** the unresolved dispute to the single PortOS user (`escalated` → task blocked with a `challenge-escalation` reason AND an approval-required arbitration task filed into `COS-TASKS.md`) — surfacing a sustained disagreement rather than quietly fixing or blocking. The full challenge trio (case + resolution + count) rides task metadata, so it round-trips the TASKS.md store, is auditable in the CoS task UI, and federates + converges across sync peers: `challenged` is wired into the claim-aware merge rank (above `in_progress`, below the terminal states), the peer-sync wire status vocab, and a `cosTasks` schema bump (v1→v2) so an older peer gently pauses cos-task sync instead of choking on the unknown status. Partial slice of the Conductor↔CoS challenge protocol — the automatic reviewer re-check and the agent-side auto-invocation land in a follow-up.
+
- **The dashboard's Quick Image widget now offers custom output dimensions and no longer shows a blank size dropdown for off-preset sizes (#2437).** The quick widget had its own inline resolution `<select>` over the universal presets and never gained the **Custom…** option added to the full Image Gen page, so its size picker was inconsistent — and a remix/off-preset size (any width/height not on the preset list) rendered a blank dropdown because no matching `<option>` existed. It now reuses the shared `ResolutionField` control, so selecting **Custom…** reveals Width/Height inputs (any edge 64–3840px, total ≤ 8,294,400px, matching the server's `imageEdgeSchema` + pixel cap), and an off-preset size auto-opens those inputs with the exact dimensions visible instead of collapsing to a blank select. No behavior change to the presets themselves.
- **Duplicated child-process stream/discovery helpers converged into shared lib modules (#2392).** Three hand-copied "split a stdout/stderr chunk stream into lines with a carry buffer" implementations (`ytdlpAudioImport.js`, `videoDownload.js`, `hfDownload.js`) had already drifted — only hfDownload's copy flushed the final unterminated line. They now share `server/lib/streamLines.js#createLineReader(onLine, {splitRe?, maxCarry?})`, which carries the partial trailing line across chunks, exposes a `flush()` for the last newline-less line (so the two yt-dlp paths stop dropping it — and skip the flush on cancel so a partial marker can't fire a stray progress frame), clamps the carry buffer against a newline-less runaway stream, and takes a `splitRe: /[\r\n]+/` option for bare-`\r` torch/tqdm progress redraws. The four bare-`\r` progress-splitter siblings (`midiRuntime.js`, `videoGen.js`, `music.js` install-log routes, and `pythonSetup.js#streamSpawn`) are converged onto the same reader with that option, so a progress line split across a chunk boundary is no longer torn. Separately, the inline `which`/`where` PATH probes in `ytdlp.js`, `ffmpeg.js` (×2), `pythonSetup.js`, and voice `bootstrap.js` are replaced by a single `whichFirst(name)` in `server/lib/processEnv.js` (Malloc-stripped env, 5s timeout, first-line result). The vendored `aiToolkit/providers.js` copy is intentionally left alone (self-contained by design). Behavior-preserving; both new helpers are unit-tested.