wave 1 (platform stream): background-observability accuracy + owner-driven follow-ups

- observability: liveness-gated stale-job recovery, extraction run registry on globalThis with
  explicit 'embedding' phase, /api/jobs force-dynamic, client refresh nudges at every seam
- headless: providerSafePng canonicalizer (multi-IDAT Chrome PNGs → single-IDAT) fixing qwen 400s
- composer: Enter routes through pure enterAction — accepts a pending plan verdict (owner decision)
- markdown chrome: session-scoped mermaid overlay + md-blocks component set + pan-zoom math,
  corner-copy (clipboard grant in electron main), math/table/code block fixes, heading weight 900

543/543 tests; typecheck/lint/build clean
This commit is contained in:
amosblomqvist
2026-09-19 13:16:34 +03:00
parent cbecb8df03
commit 487f5d4cea
27 changed files with 1754 additions and 111 deletions
+23 -1
View File
@@ -11,7 +11,7 @@ import React from "react";
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { renderToStaticMarkup } from "react-dom/server";
import { Composer } from "../components/composer.tsx";
import { Composer, enterAction } from "../components/composer.tsx";
function render(opts: { busy?: boolean; canSend?: boolean } = {}) {
return renderToStaticMarkup(
@@ -49,3 +49,25 @@ describe("Composer", () => {
assert.ok(/aria-label="Send"[^>]*disabled|disabled[^>]*aria-label="Send"/.test(html), "send disabled");
});
});
// The Enter decision (user-decided 2026-09-19, docs/probe-teach-split.md §4):
// while the plan verdict pends, Enter must ACCEPT the plan — formerly it sent
// a plain message, leaving the verdict pending again on the next message.
// Pure function so the static-render harness can pin it (key events can't be
// simulated in renderToStaticMarkup).
describe("enterAction", () => {
it("busy stream: Enter stops — verdict or not", () => {
assert.equal(enterAction({ busy: true, verdictPending: false, canSend: true }), "stop");
assert.equal(enterAction({ busy: true, verdictPending: true, canSend: true }), "stop");
});
it("verdict pends: Enter ACCEPTS — with text (the note rides) and with an empty box alike", () => {
assert.equal(enterAction({ busy: false, verdictPending: true, canSend: true }), "accept", "typed text rides the acceptance note");
assert.equal(enterAction({ busy: false, verdictPending: true, canSend: false }), "accept", "empty box still accepts — Enter can never strand the verdict");
});
it("no verdict: send when there is text, nothing when there is not", () => {
assert.equal(enterAction({ busy: false, verdictPending: false, canSend: true }), "send");
assert.equal(enterAction({ busy: false, verdictPending: false, canSend: false }), "none");
});
});