From 95ba9c8272fe8ee2145e1ebe13ed3f81fbb701c1 Mon Sep 17 00:00:00 2001 From: amosblomqvist Date: Tue, 6 Oct 2026 14:18:05 +0300 Subject: [PATCH] =?UTF-8?q?compaction:=20not=20viewable=20=E2=80=94=20the?= =?UTF-8?q?=20dividers=20stay,=20inert=20(release=20polish=204)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Owner ruling (release polish round, 2026-10-06): the compaction summary dialog is gone. The content is model-facing plumbing — anyone who wants to inspect it reads their provider logs. Both dividers survive as INERT markers: the moment divider's 'Context compacted' note and the cut divider's 'HISTORY COMPACTED · 152k tok' seam chip render as plain text; no button, no dialog, no state. The marker parts and the server fold are untouched — this is a pure render-side removal. Pins: dividers render without + ); } @@ -34,80 +31,18 @@ export function CompactionMomentDivider({ data, onOpen }: { data: CompactionDivi /** The cut divider (owner round 14): the LONGER divider at the actual * compaction cut — the seam where verbatim history ends and the kept * recent tail begins. Phase-divider's geometry (dotted rules + centered - * chip) so it reads as a transcript boundary, not a message. */ -export function CompactionCutDivider({ data, onOpen }: { data: CompactionDividerData; onOpen: () => void }) { + * chip) so it reads as a transcript boundary, not a message. Inert + * since release polish 2026-10-06 — the token count stays, the summary + * is inspectable only in provider logs. */ +export function CompactionCutDivider({ data }: { data: CompactionDividerData }) { const kTok = data.details.tokensBefore > 0 ? ` · ${Math.round(data.details.tokensBefore / 1000)}k tok` : ""; return ( - - ); -} - -/** The dialog's pure body — exported for SSR pins (the delete-dialog / - * node-dialog body pattern; the wrapper owns the portal + Esc effect). */ -export function CompactionSummaryBody({ summary, onClose }: { summary: CompactionDividerData; onClose: () => void }) { - return ( -
-
- Compacted context - -
-
-
-					{summary.content}
-				
-
); } - -/** The full-summary view both dividers open (owner round 14): the - * marker's content verbatim — the compaction header + the summary the - * model itself reads — in a scrollable document block. Esc and the - * Close row both dismiss; the backdrop click does not (the summary is - * reference material, not a decision — an accidental dismissal costs a - * re-click, and a stray click-through mid-read costs more). */ -export function CompactionSummaryDialog({ - summary, - onClose, -}: { - summary: CompactionDividerData | null; - onClose: () => void; -}) { - useEffect(() => { - if (!summary) return; - const onKey = (e: KeyboardEvent) => { - if (e.key === "Escape") onClose(); - }; - window.addEventListener("keydown", onKey); - return () => window.removeEventListener("keydown", onKey); - }, [summary, onClose]); - - if (!summary) return null; - return createPortal( -
- -
, - document.body, - ); -} diff --git a/tests/render-compaction-divider.test.tsx b/tests/render-compaction-divider.test.tsx index 633a280..ad237fb 100644 --- a/tests/render-compaction-divider.test.tsx +++ b/tests/render-compaction-divider.test.tsx @@ -1,15 +1,16 @@ /** - * THE COMPACTION DIVIDERS — SSR render pins (owner round 14). Two ruled - * surfaces from one marker: the MOMENT divider (minimal centered small - * text, the retrying-message register — no rule lines) where the user - * is when compaction lands, and the CUT divider (the longer one — - * phase-divider geometry, dotted rules + a chip carrying the summarized - * token count) at the kept boundary. Both open the same summary dialog - * (the marker's full model-facing content, verbatim, scrollable). + * THE COMPACTION DIVIDERS — SSR render pins (owner round 14; inert since + * release polish 2026-10-06). Two ruled surfaces from one marker: the + * MOMENT divider (minimal centered small text, the retrying-message + * register — no rule lines) where the user is when compaction lands, and + * the CUT divider (the longer one — phase-divider geometry, dotted rules + * + a chip carrying the summarized token count) at the kept boundary. * - * The dialog portals to document.body at z-50; SSR renders null when - * closed — the pins hold the open state through a jsdom-free server - * render (createPortal is a no-op passthrough on the server). + * NOT VIEWABLE (owner, 2026-10-06): the summary dialog is gone — the + * compaction content is model-facing plumbing; anyone who wants to + * inspect it reads their provider logs. The pins below hold the + * dividers INERT: plain markup, no button, no affordance, and the + * marker's summary text never reaches the DOM. */ import React from "react"; @@ -21,8 +22,6 @@ import { describe, it } from "node:test"; import { CompactionCutDivider, CompactionMomentDivider, - CompactionSummaryBody, - CompactionSummaryDialog, type CompactionDividerData, } from "../components/compaction-divider.tsx"; @@ -35,9 +34,11 @@ const data: CompactionDividerData = { }, }; +const INERT = ["no click affordance survives the 2026-10-06 ruling"]; + describe("CompactionMomentDivider", () => { it("renders the minimal centered note — no rule lines, retrying-message register", () => { - const html = renderToStaticMarkup( {}} />); + const html = renderToStaticMarkup(); assert.ok(html.includes('data-testid="compaction-divider"')); assert.ok(html.includes("Context compacted")); // NO horizontal rule (the owner ruling: minimal, unlike the cut) @@ -47,7 +48,7 @@ describe("CompactionMomentDivider", () => { describe("CompactionCutDivider", () => { it("renders the longer seam — dotted rules + chip with the token count", () => { - const html = renderToStaticMarkup( {}} />); + const html = renderToStaticMarkup(); assert.ok(html.includes('data-testid="compaction-cut-divider"')); assert.ok(html.includes("border-t-2 border-dotted")); assert.ok(html.includes("History compacted")); @@ -56,17 +57,24 @@ describe("CompactionCutDivider", () => { }); }); -describe("CompactionSummaryDialog", () => { - it("renders the marker content verbatim, scrollable (the pure body — portals need document)", () => { - const html = renderToStaticMarkup( - {}} />, - ); - assert.ok(html.includes('data-testid="compaction-summary-dialog"')); - assert.ok(html.includes("[SESSION HISTORY COMPACTED]")); - assert.ok(html.includes("overflow-y-auto")); - assert.ok(html.includes('data-testid="compaction-summary-close"')); +describe("not viewable (owner, release polish 2026-10-06)", () => { + it("neither divider is a button — plain markup, no click affordance", () => { + for (const html of [ + renderToStaticMarkup(), + renderToStaticMarkup(), + ]) { + assert.ok(!html.includes(" { - assert.equal(renderToStaticMarkup( {}} />), ""); + + it("the marker's summary text never reaches the DOM — provider logs are the inspection path", () => { + for (const html of [ + renderToStaticMarkup(), + renderToStaticMarkup(), + ]) { + assert.ok(!html.includes("[SESSION HISTORY COMPACTED]"), "the header stays out"); + assert.ok(!html.includes("THE LEARNER"), "the summary stays out"); + } }); });