Apply the AGENTS.md comments guideline to every .ts under tests/: remove
what the code already expresses, keep only what it cannot.
Removed: spec-header coverage inventories the describe/test tree already
names; comments restating the next line's assertion or its message; helper
JSDoc whose body already says it; within-file duplicates; five stale
claims (trendChart's "six aggregated turns" against agg.length === 8,
agentGraph's "six categories" against CATS' seven, fold-timing's "cheapest
call LAST" against a loop that feeds it first, fold-surface's unreachable
plain-JSON note, contextView's "two turns" for a one-turn fixture).
Kept and condensed: the projection-freeze class, strict wire/state-schema
hazards, retention and pricing windows, pairing rules, hostile-input
rationale, fixture and expectation-array ground truth, jsdom mechanics,
and issue-numbered regressions.
Comment lines 2604 -> 2014 (-22%); 85 module headers kept, 30 coverage
inventories dropped; every surviving comment line is within the 140-column
limit, with 36 wrapped lines joined onto fuller ones.
No logic, string, identifier, import or directive changed: a comment-strip
gate proves each file's comment-free code is byte-identical to HEAD, and a
line-level proof pairs all 845 changed lines with an unchanged code part.
pnpm run lint && pnpm run test (106 files / 2061 tests, per-file 100%
coverage) && pnpm run build all pass.
Merge consecutive short comment lines in tests/** up to the 140-col limit
without touching their text: comment-stripped content, comment text (whitespace
normalised) and line-comment runs are all proven identical per file. This is the
line-count half of the cleanup only; the content pass over tests/** is still
outstanding.
The slash menu candidate carried only its name, section, and description,
so the row rendered the bare "context" while every built-in command row
showed its icon and localized title. The candidate now carries the plugin
emblem and a cmd.label title (the name renders as the trailing alias on
builds that show titles). Both fields are pure display data: harness
builds that predate their rendering ignore them and keep the bare name.
The slash menu renders one source-title row per trigger source, titled
from the harness's own slash.menu dictionary; the plugin's source name
`context` is not a key there, so the row showed the bare raw name and
read as a duplicate command (closes#67). Candidates now carry a
localized `section`, which the menu renders in place of the
source-title row — 上下文 in Chinese, Context in English.
0.1.2 rewrote the client composition and the history transport; every seam
this plugin touches now resolves by feature detection and degrades visibly
instead of erroring:
- history reads: `remote.session.page` (0.1.2; the inclusive cut
`throughSeq` pinned to the target seq) over `connection.api.sessions.history`
(0.1.1); both served envelopes unwrap ({ok,value} and {result:{ok,value}});
packed chunk-row records skip (final events always ride verbatim); a
malformed payload rejects into the retryable state instead of claiming
absence.
- conversation join: `useChat` (ChatSnapshot.legacy.nodes) over the session
snapshot's top-level `nodes`, both seats invoked in a stable hook order —
fixes the empty File Activity card on 0.1.2 (#26).
- image loading: `uiConversation.imageUrl` (0.1.2) over
`conversation.resolveImage` (0.1.1); absent faces degrade the cards to
metadata-only.
- `/context` command: waits for the `inputTriggers` service (ctx.inject)
instead of racing module arrival order, which 0.1.2's finer modules broke;
the modal resolves `sessions` at close time for the same reason.
Absent faces drop features (static out-of-window hints, no command) — the
tab and the modal never render an error page.
The old suite exercised the built lib/ bundle, so v8 remapped almost
nothing (8% src coverage) and every run needed a build first. The new
suite imports src/ directly under two vitest projects (node for
host/shared, jsdom for client), rendering real React 18 trees against
the real dictionaries and ui-primitives, with faithful in-memory
harness faces (cordis inject/effect, locale chain, slots, sessions
provide) instead of plugin mocks.
- 43 fine-grained, stateless, single-module spec files (606 tests)
forked across workers: ~2.5s wall, no build step
- v8 thresholds at 100/100/100/100 per file over src/**
- host specs drive the real projection definitions (init/apply/view)
plus one full cordis + SessionStore + SessionProjectionRegistry
integration; the framework's snapshotJsonValue pins the
projection-cache precondition on every intermediate fold state
- oxlint's src ruleset now covers tests/** as well
- typecheck covers the tests via tsconfig.tests.json