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
Merge remote-tracking branch 'origin/main' into claim/issue-2453
Adam Eivy3394e035585a
diff --cc .changelog/NEXT.mdindex 61703c0000,e7e42c18b6..0e8d54be52--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@@ -2,8 -2,8 +2,10 @@@## 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.++ - **Media-gen marker parsers converged onto `createLineReader` too (#2463, follow-up to #2392).** The two remaining hand-copied per-chunk splitters — `imageGen/local.js` (stderr + stdout) and `videoGen/local.js` (stderr, plus a stdout `'\n'`-carry that never flushed the last line and decoded each chunk independently) — parsed `STAGE:`/`STATUS:`/`DOWNLOAD:` protocol markers with no carry buffer, so a marker or multibyte char split across a pipe chunk boundary could tear a progress event. Both services now route line parsing through `server/lib/streamLines.js#createLineReader` (StringDecoder-backed, carry across chunks, `flush()` on `close`), while the render-critical machinery is left exactly as-is: idle-stall + completion watchdogs still fire on the same signals (`resetIdleStallTimer` stays in the per-chunk `data` handler; the videoGen flush runs *before* the watchdog clears so a final result-JSON line can't re-arm a stray SIGKILL), the imageGen `stderrBuffer` error tail keeps accumulating raw chunk text, and the stdout JSON `video_path`/result capture is unchanged. Behavior-preserving; adds a chunk-boundary test proving a marker split across two chunks parses as one event.+- **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.