Commit Graph
416 Commits
Author SHA1 Message Date
bowenliang123 dd05bbda4e feat(client): price a file attachment by the handle the model receives
A file block never reaches a model as bytes: dsh projects every one to
`fileHandleText` at request assembly, and the token meter prices that handle in
place of the block's structural JSON price. An attachment therefore costs a
fixed ~60 tokens whatever its size, so the card now shows that price beside the
size — computed from the three facts a log carries (name, byte size, digest
prefix) and priced with the meter's own text arm, now shared with the fold's
message price instead of restated there.

The handle also names the stored copy's read path, which only the live
environment resolves and no log holds, so the row prices the pathless arm and
reads as a lower bound (`≥`) rather than an `≈`. The fold keeps the meter's
fixed structural price for the same block, exactly as the harness does: one
figure answers the request, the other the surface.
2026-10-13 23:15:39 +08:00
bowenliang123 f348196d3b style(client): calm the attachment cards, and stop re-reading thumbnails
Three cards-side-by-side fixes: the hover invite is one pill over the
thumbnail instead of a mask that blacked out the glyph; a file card drops the
type row its extension badge already states (an image keeps it, having no
badge), which leaves name plus size; and the thumbnail read now keys off the
attachment id instead of the reference object, which the fold re-proves on
every render — a row re-render no longer re-reads the bytes through the
harness loader. The in-flight card also reports itself busy to assistive tech.
2026-10-13 21:52:40 +08:00
bowenliang123 6487602f1e feat(client): render message attachments in order and preview them in the sidebar
A user message's image and file blocks now render as one ordered attachment
block in the Context browser: images keep their session-authorized thumbnail,
other files show their type glyph, extension, and stored size, and the row
chip counts every attachment. One click IS the preview — the card hands the
attachment's named host path to dsh's own preview column (the File Activity
card's `previewAddressOf` → `openResourceVia` path), which renders markdown,
code, PDF, office, and image viewers under the file's real name. A refused
open reports on that card alone; the image lightbox and the per-type modal it
replaced are gone with `images.tsx`.

The path comes from the plugin's own `/api/dsh-context/attachment` route (the
same authenticated `/api` fence, Connection exact-route registry, and
cold-read gate as the detail and fleet routes). It answers only an id the
session's own log cites — a depth-bounded, total walk over the event payload
(user content, tool-result blocks, spliced inbox deliveries) — and answers
the store's named alias: `attachments.fileHostPath` for verbatim files, and a
published-or-reused named hard link for images, whose objects are digest-named
and suffixless while the preview column dispatches viewers by suffix. The
link shares the immutable object bytes and lives in a disposable cache
(`<home>/cache/dsh-context/previews/`); a store that is not host-file-backed,
or a media type the harness never admits, resolves the typed null the card
reports as an unavailable preview.

`Section` moves to its own module so the attachment block heads itself
without importing the tool card, and the compat matrix probes `FileTypeIcon`
alongside the icons it already pins.
2026-10-13 21:19:47 +08:00
bowenliang123 a5438855d7 fix(client): state the compaction trigger as expected, not certain
The trigger percentage is derived from dsh-compaction-basic's mirrored
shipped defaults rather than read from the deployment's configured policy,
so hedge the copy instead of asserting it outright.
2026-10-13 19:52:41 +08:00
bowenliang123 1ff26107b5 fix(client): describe the output reserve as the model's max output tokens
The output mask's tooltip said this reply's output is reserved at the
window's end, but the value is the model's configured max output tokens.
Update the zh/en copy and the two tooltip assertions that pin it.
2026-10-13 18:53:02 +08:00
bowenliang123 396ada8754 feat(client): rename the reserve masks to Compaction Headroom and LLM Output Reservation
The two tooltip labels named the mechanism, not the thing on screen: "Max
output tokens" reads as a statistic, but the mask draws the window's tail held
back for the routed request's reply, and "Compaction headroom" said 余量 — slack
— where it is in fact reserved space. Say both as the regions they are:

  Compaction Headroom          65.5k
  LLM Output Reservation       256.0k
                               本次回复的输出预留在窗口末尾

Both English labels now share one Title Case so the three-row tooltip reads as
a set. The note lines keep their sentence form, so only labels changed.
2026-10-13 17:18:19 +08:00
bowenliang123 863d3cdcdc feat(client): true-size reserve masks, with a trigger line when the ratio detaches it 2026-10-13 16:51:25 +08:00
bowenliang123 1358603759 feat(client): give the composition bar tooltip three named rows
The bar's tooltip was one nowrap string per hover kind, the only tooltip in
the plugin not yet multi-line. Split it into head / figure / note so all four
kinds share one skeleton and wrap:

  Tool Schemas            ≈6.4k · 3% of used context
  Free Window             733.2k · 73% of window
  Compaction headroom     65.5k
                           Auto-compaction fires at 68% of the window
  Max output tokens       256.0k
                           This reply's output is reserved at the window's end

Every figure now names its denominator. The segments share the USED total and
the free track the WINDOW, which the old single line never said; the two masks
had no share at all and now state where they sit in the window instead, read
off the same clamped trackPct the masks lay out with rather than a second ratio.

Replaces the hardcoded 12/88 left clamp — a guess at half the tooltip width that
only held around a 920px pane, and cut the bubble off at narrower ones. The
percentage anchor stays the source of truth; a layout effect measures the tip and
adds a px shift only when the rows overhang. Rects, not clientWidth, whose whole-
pixel truncation lands the residue straight back on the overhang.

Also adds role="tooltip", and box-sizing so the width cap means what it says.
2026-10-13 16:15:14 +08:00
bowenliang123 fc0126992c fix(client): reserve nothing when dsh refuses the route, per code review
dsh-compaction-basic REFUSES a target at config time when the output
reservation plus headroom leave no pressure budget (resolveCompactSpec
throws TargetPressureConfigError, compactIfNeeded never runs) — it does
not clamp. The reserve comment claimed a clamp, and the geometry acted
on it: a too-small window collapsed threshold to 0 and painted a
full-width headroom band, claiming a trigger the harness never fires.
The bar now reserves nothing and paints no masks for such a window,
matching the harness. Also removes the redundant reserve comments the
review flagged and restores the dashed-border rationale the mask CSS
had displaced.
2026-10-13 15:45:13 +08:00
bowenliang123 e421a35b3b feat(client): split the Current Context reserve into headroom and output masks
The Current Context bar showed a single hatched band mirroring dsh's
default 80% threshold ratio, which reads wrong on any window where the
pressure budget binds instead (small windows, or a large routed output
cap). It now renders the two real reservations the harness spends the
top of the window on, priced by dsh-compaction-basic's own min() rule:

- the compaction headroom mask (mirrored default 65,536 tokens), then
- the routed request's output reservation, read from the durable
  request/header's materialized config.maxTokens rather than guessed.

The output cap folds off request/header at fold time, so the timeline
projection's stateVersion bumps 27 → 28 to refold cached rows from the
durable log. Geometry lives in a new client reserve module; the bar
tiles [threshold, window] with the two adjacent masks, each with its
own name-plus-length tooltip.
2026-10-13 14:47:28 +08:00
bowenliang123 e4b3012897 feat(client): print each day's tokens on its own bar in the usage chart
Reading a day's volume meant hovering every column or interpolating between
the left rail's quarters. Each blue bar now carries its own figure on its
top edge, so the common case reads straight off the chart; a day with no
tokens prints nothing, since there is nothing to say.

The label is a child of its bar rather than positioned against the column,
so it rides the bar's height without a second source of truth for where that
top is. The gridlines move into the bars' own box for the same reason: with
headroom taken above the plot, `bottom: N%` still reads the bar scale, so the
822.1M line keeps marking the 822.1M bar instead of drifting by the headroom.

Measured across ten pane widths: the labels overlap below a ~30px column, so
they fold out under the same 400px container query the day strip already
uses — the hover tip carries the exact figure there, and keeps doing so
everywhere else.
2026-10-12 13:29:54 +08:00
bowenliang123 018e92964f feat(client): add an update capsule to the Insights page head
The Context tab's Plugin-info card already hinted at a newer npm release;
the Context Insights page head had no such hint. Add one beside the
balance capsule, in that page's own capsule idiom rather than the card's
inline chip: label plus the version in the warn token, linking the release
notes through the page's portaled hover bubble.

The registry check moves out of pluginInfo into a useNewerVersion hook both
surfaces read, so the second hint costs no new fetch path, state, or
mechanism — one TTL-cached read still answers both. Its own coverage moves
with it into latestVersion.spec, leaving each surface's spec asserting only
what that surface renders.

The two head capsules share one CSS chrome instead of a copy, and the head's
gap drops to 8px so the capsule cluster tightens; the title keeps its wider
16px lead-in, and the fold at narrow widths leaves every wrapped row on the
same left edge with no overflow.
2026-10-12 13:24:35 +08:00
bowenliang123 0f01900a91 fix(client): track a placement mount by its own state, not its disposer
watchPlacement inferred "this side is mounted" from the mount handle
being a function, so a face that seats the seat and hands back no disposer
(a stripped or foreign `slots`) read as never mounted — and every later
preference publish registered a second copy of the same seats. Track the
mounted state directly; the handle is unwound when there is one.
2026-10-12 08:39:50 +08:00
bowenliang123 9873eb5836 fix(client): mount the client bundle once per page (issue #137)
The same package can mount twice into one page's slot ledger — a static
profile bundle plus a later activation of the same package. The
client-plugin runner force-assigns a fresh shadowing priority to every
registration, so the registry's same-id duplicate guard never fires across
the two mounts, and the conversation header — which renders the raw ledger
and matches the active view by entry id — paints both copies of every
list-slot seat.

apply() now reads the raw ledger first (SlotRegistry.entries) and mounts
nothing when this bundle's chat-to-Context jump entry is already seated.
The read fails open: an absent, shape-shifted, or hostile face reports
unseated and the mount proceeds, so an older line never blanks a working
mount. The entries seam is pinned per baseline.

The harness-side defects (the runner forcing a rank on additive list
slots, and the header rendering the raw ledger) are left to
deepseek-ai/deepseek-harness.
2026-10-12 08:39:17 +08:00
bowenliang123 2ce5d9a7db feat(client): narrow the comms timeline by the picked agent
- A pick anywhere (graph node, member card) now steers the comms timeline
  beside the task board: rows narrow to the traffic the picked agent sent or
  received, the dropdown steps aside for the pick chip (label, never a raw
  id), and an agent without traffic says so
- The pick governs while it stands: the dropdown's own choice yields on
  landing and never resurrects stale once the pick clears; without a pick the
  dropdown keeps its free per-participant browsing
- The pick key resolves once in the view (roster name -> session id, a
  subagent's own id) — the one key both boards narrow by; zh/en gains the
  no-comms note
2026-10-12 02:21:17 +08:00
bowenliang123 ac5b36b784 feat(client): unfold task cards into boxed brief, agent, and reply sections
- A task card opens on a pick (or Enter/Space on the row): the task brief, the
  owning agent, and the final report-back each box up in the context tab's own
  section chrome, with the raw/Markdown switch on every box head — Markdown the
  default, the report-back stamped with its time
- Closed rows keep the compact read, the description clamped to two lines and
  rendered through the shared Markdown renderer (memoized per text, so board
  hover re-renders never re-parse)
- The row pick no longer pins: pinning stays with the owner chips, the band
  heads, and the agent box inside an opened card; Enter on a nested control
  keeps activating that control instead of folding the card
- zh/en gains the box labels (task brief / agent / final reply)
2026-10-12 02:05:11 +08:00
bowenliang123 a4c737b354 feat(client): rebuild the task board as the family's work board
- Plain subagents join the board: each delegation reads as a task of its own
  (the prompt as the subject, the session state as the status) with the run's
  live figures on the row — tokens · duration · steps and the pressure-tinted
  occupancy; the row itself is the agent (family-hue icon, session id on hover)
- One vertical, owner-grouped layout replaces the status/owner switch: roster
  members first (the lead in brand hue, teammates by stable roster hue), stray
  owners the roster never served, then headless delegation rows in spawn order,
  the unowned pool last; status lives on the rows
- The toolbar gains search (subject/owner/id) and status filter chips with
  counts; the completion bar now counts every row on the board
- A pick anywhere narrows the board to that agent — graph nodes and member
  cards included, subagents by their own session id (the pick chip names the
  label, never a raw id); the members board reports picks raw and the view owns
  the toggle, so a release lets go of the paired narrowing wherever it came from
- Renamed to Tasks (team tasks and subagent delegations); zh/en updated, the
  dead view-switch keys removed
2026-10-12 01:29:48 +08:00
bowenliang123 2835230485 feat(client): tighten the network graph cards and drop the corner jump
- Cards keep a 178px minimum width (slot pitch floor 150 -> 190) with tighter
  padding (9x10 -> 7x9) and a 100px height, so dense families read wider and
  calmer
- The corner arrow button is gone: in the Fleet seat a card click selects and
  the jump stays with the boards' own open buttons, while the sidebar seat
  keeps opening on click; the select-mode subtitle no longer names an arrow
2026-10-12 00:38:17 +08:00
bowenliang123 d648edec1e feat(client): give the members board's other agents the member-card form
- The other-agents section renders the family's plain subagents, ancestors, and
  siblings as the same cards the team roster uses — label as the identity (two
  clamped lines), node-state dot, status + model line, landed latest reply, and
  an open button; the card hue follows the graph's family hue
- Member cards gain the run's activity meta (tokens · duration · steps, with
  the pressure-tinted occupancy figure), team cards included
- A compact card layout (8x10 padding, tighter gaps) and a 200px grid floor
  keep the two-column read the common case; the fleet-row list is gone
2026-10-12 00:37:44 +08:00
bowenliang123 928abdac97 feat(client): rebuild the Fleet tab around one stable three-shape layout
- Overview strip: family stats (agents/running/done/tokens/est. cost) with an
  adaptive progress bar — shared tasks when a team serves any, else subagent
  completion, and no bar for a solo session
- Agent network: taller link channel (level pitch 144→168), node cap 25→40,
  and a card click now selects (ring + the task board's owner filter) instead
  of jumping sessions; the jump moves to a corner button on each card
- The graph's cursor-following inspector leaves the Fleet tab (the boards
  carry that detail); the sidebar mount keeps it
- Members board absorbs the roster: team cards section plus a compact
  other-agents section, one search/status/sort toolbar steering both; the
  standalone FleetList card is gone
- Task board: completion bar, status/owner grouping switch, owner pinning and
  hover lineage from task rows, transitive prerequisite-chain highlighting,
  and a guidance empty state without a team
- Both boards stay mounted with guidance notes in team-less and solo
  sessions, so the page never reshapes between session kinds
- Hoist displayCurrencyOf into cost.ts (was duplicated per mount)
2026-10-11 23:35:29 +08:00
GrivnandClaude Opus 5.5 edf6e24b44 fix(client): let the window be dragged by the insight page head (#136)
On DSH Desktop for macOS the shell moves the window by elements marked
`data-window-drag`, and the shipped pages mark their head, which their
top padding stretches over the hiddenInset title bar band. The insight
page head already takes that band (`--dsh-frame-top-clearance`) but was
not marked, so the window could not be dragged from the top of the page.

Mark the head. The harness keeps buttons, links, fields and anything
outside its root out of the drag area, so the settings chip, the
balance link, the date range and the range group stay clickable, and the
date picker's portaled dialog is unaffected.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:02:56 +08:00
bowenliang123 293e954fb1 feat(client): lay the Fleet team and task boards out as two columns
The Fleet tab's Team Members and Task Board cards stacked vertically no
matter how wide the pane ran. They now share a `.lc-cols` row — the
plugin's own two-column idiom (flex-wrap + the shared
`flex-1 min-w-[min(360px,100%)]` floor the head-band cards ride) — so
they sit side by side as two equal-height columns and fold back to
full-width stacking below two 360px floors plus the row gap.

Gating semantics are unchanged: the task board still serves whenever the
team projection exists, even without a family forest (the duo row then
carries it alone at full width), and the members board still needs the
forest for its roster join. Tests pin both the together case (same
`.lc-cols` parent) and the forest-null case.
2026-10-11 18:07:24 +08:00
bowenliang123 f0b0e12e58 fix(client): guard the settings binding against hostile values and dead scopes
Three review passes (standards, contract, over-engineering) over the whole
settings surface left four follow-ups worth taking:

- sync() wraps its snapshot parsing in the compatibility.md parser gate's
  bounded catch: a served value that throws on property access keeps the
  current state instead of throwing into the mirror's fan-out, with the
  mandated hostile fixture beside the happy path.
- the attach disposer now clears the scope, so a set() after disposal never
  writes into a dead form; a superseded attach keeps the newer scope bound.
- dead surface trimmed: six type re-exports nothing imported through the
  module, a single-caller query helper, and an orphaned export on the
  settings-card props interface.
2026-10-11 17:03:42 +08:00
bowenliang123 fd782119e8 feat(client): organize the preference card into three titled groups
The card's eleven rows had grown into one flat list whose only structure
was "Topic · Field" prefixes baked into the labels. The rows now sit under
three titled groups — Entry & Visibility, View Defaults, System Prompt —
so the card reads as where the plugin appears, what its surfaces show by
default, and what it injects, in that order.

The harness projects no group chrome into the `plugins.bundle.config`
slot, so the card draws its own: group heads mirror the harness's
Plugins-page `.sectionTitle` (14px/500 primary, one weight step above the
pinned-400 row labels), separated by its row-separator token. Each group
carries `role="group"` + `aria-label`; the prompt hint moves inside the
prompt group it describes.

Labels drop the prefixes the group titles now carry ("Trend Chart ·
Default granularity" → "Trend Chart · Granularity", "System Prompt ·
Prefix" → "Prefix"), zh/en in lockstep. The spec test asserts the three
groups, their order, and the hint's seat; row order is unchanged.
2026-10-11 16:41:45 +08:00
bowenliang123 d75b539419 feat: system prompt prefix/suffix settings joined into every session
Two new per-user preferences, `promptPrefix`/`promptSuffix`, hold free text
joined at the very start / end of the harness's assembled system prompt for
all agents (subagents included) — a per-deployment persona or behavioral rule
riding the harness's own prompt registry instead of session-log surgery:

- src/host/promptInjection.ts registers two global prompt sections through a
  deferred `ctx.inject(['systemPrompt'], …)` (a composition without the
  registry degrades to a no-op; the registration unwinds with this plugin's
  fiber). Orders anchor on the harness's own section-order registry, so a
  central renumbering keeps the prefix first and the suffix last. Text is
  registered `interpolate: false`, so `{{...}}` in user text stays literal.
- The section text providers read the volatile config references the loader
  rewrites in place on preference edits, so an edit applies from the next
  turn without remounting the entry; new sessions carry the text from their
  first turn through the harness's own system-prompt projection.
- The settings card grows two free-text rows (local draft, committed on blur
  and on unmount; a host push never clobbers in-progress typing), zh/en
  strings, and the served-value sanitize/degrade path for the string fields.

Verified against a running harness: the committed text persists in the
profile layer, and a new session's system prompt starts with the prefix and
ends with the suffix. docs/compatibility.md documents the seams, and the
compat matrix probes them on both supported lines.
2026-10-11 13:55:14 +08:00
bowenliang123 f0ee3195ac feat: rebuild the Fleet tab as the agent fleet cockpit
Split the Agent network card into graph + cursor-following inspector
(delegation prompt, latest reply, descriptor, owned tasks, comms), add
the members board and the status-grouped task board off the agentTeam
projection with inline dependency chains, a filterable/sortable roster,
and an on-demand comms timeline over relay/mailbox/settled records.

Data rides a new /api/dsh-context/fleet route (one observeSession read
per session through the shared cold-read gate); hover, pin, owner
filter, and task focus are lifted to the view so every panel steers the
same inspector.
2026-10-11 07:52:58 +08:00
bowenliang123 9b0618a7a6 feat(client): gate the Fleet tab behind a preference
The preferences card gains a "Fleet tab" row (Show/Hide, default Show): the tab is
registered or unwound live, and the placement preference still has the final say —
'sidebar' serves no conversation tabs at all. The ninth preference field rides the
same Config schema and settings transport as the rest, including the fail-open read
(a value the plugin cannot read degrades to Show) and the rollback when a write is
refused.

The three on/off rows (entry visibility, the Fleet tab, the duration curve) now
share one row shape and one set of Show/Hide labels instead of a copy each, and the
mount/unmount/subscribe watcher both gates ride is one helper (toggleGate.ts) —
watchInsightPage and watchFleetTab were the same skeleton twice, down to the
registration-handle guard.

One preference now costs several coordinated edits in the settings store, so the
snapshot comparison is a shallow compare over the state's own keys and the refused-
write rollback is one table lookup, not a chain that has to grow with every field.

The stats board's family cell hands its jump to the caller: statsContext no longer
reaches into the tab bar for the Agent Network view. contextView owns the targets —
the Fleet tab when the preferences serve one, else the right Sidebar panel that
keeps the card inline — and drops the cell's button role when it serves neither, so
a hidden tab can never leave a dead button behind.
2026-10-10 20:21:57 +08:00
bowenliang123 ace15cac11 feat(client): move the agent network onto its own Fleet tab
The Agent network card leaves the Context tab's foot for a page of its own —
the Fleet / 编队 tab, right of Context (order 30). The card is unchanged,
but both mounts now read one shared `useContextSession` data path and fold
the current agent's figures with one `agentSelfOf`, so the panel and the tab
cannot disagree; the Fleet page keeps the same cold-start retry note and the
same baseline gate. The tab label key splits into `tab.context` / `tab.fleet`.

The right Sidebar's Context panel keeps the card inline — its column has no
room for a tab of its own — so the center Context tab renders it only for the
sidebar host, and nothing else leaves that tab.

The stats board's Agent Network cell used to scroll to the card further down
the same page; it now activates the Fleet tab (activateContextTab is
generalized to activateViewTab). Its miss arm is unreachable for our own
tabs: the board and the Fleet tab ride the same placement gate.

The bundle smoke's fake registry now records `register()` calls instead of an
inject callback's return value, matching the real registry — one inject may
declare several registrations, which the second tab exposed.
2026-10-10 20:10:55 +08:00
bowenliang123 3aed76b493 feat(client): reveal an injection's item from its events row
An injection row's label is now a link into the Context Browser: hovering
underlines it, and a click selects the step that first carried the item,
opens its category, expands its row, and scrolls the browser card into
view. An injection event's seq IS the seq of the surface node it added
(fold.ts), so the events row and the browser row are the same item; the
node's own `gone` stamp bounds the reveal to the steps before its removal.

The step comes from the existing locateStepOf(), which now sorts the wire
the way the browser's own entry stamps do — a re-ordered log must not move
the reveal past the step that actually carried the item.
2026-10-10 19:28:00 +08:00
bowenliang123 f1505420a5 feat(client): stamp turn/step positions as the compact T1 S9
The events card's position column spelled the same fact out in full
("第 1 轮 · 第 9 步"), crowding the row's meta tail on narrow panes. It now
uses the notation the browser's own rows already carry (browser.stepAt):
T1 S9, T2 S3→4, T50 S8 → T51 S1.

eventAt() is shared, so the request detail's marker chip and the trend
chart's marker tooltip read the compact form too — one notation for one datum.
2026-10-10 19:27:32 +08:00
bowenliang123 667e1a9c71 fix(client): hold every data-dependent lane so the page stops reflowing
Opening the Context tab, and every step landing after it, moved the cards
below: the page grew 343px on a cold open and the trend card jitters by a few
pixels on each step. Seven independent sources, all the same shape — a box
whose height came from its content instead of from its role:

- The brief lane under the chart held a 76px floor but its rows were 24.5px
  bare and 26.5px carrying a chip, so the lane measured 79.5px or 81.5px
  depending on the step. Every row is now a constant 27px.
- The detail header let its metric pills share a wrapped line with the title,
  so its height followed which pill topped each line as the figures changed.
  The pills now claim a full row of their own.
- The file card's empty state replaced the controls and the 320px list with
  a one-line note, a 265px collapse on the first read of a session. The band
  and the list lane now render in every state, and the lane holds the list's
  height.
- The file card's filter band rewrapped as its tallies gained digits; it now
  reserves its folded height, which depends on the card's width alone.
- The context browser's category rows wrapped as the per-step item counts
  changed; they now stay on one line and the name ellipsizes.
- A title carrying only text wrapped when its scope chip changed length
  (longest in English), resizing the card mid-scrub. Text-only titles keep
  one line; titles carrying toggle groups keep the wrap they need.
- The trend card's pending body rendered as a one-line note and grew by its
  whole height when the first step arrived, shoving the page down. It now
  stands in the panel's OWN boxes — same classes, same grid — so the detail
  fills the card instead of growing it.

Measured across 360px–1440px in both locales: every card's height variance
while scrubbing a 40-step session is 0, and the cold-open fold is 5px.
2026-10-10 17:15:37 +08:00
bowenliang123 861ee77d03 refactor(client): spell out the tools that fit, fold the rest into one chip
The stats card's tools row capped the tally at an arbitrary top three, so a
session that used five tools showed three and quietly dropped two, and the
row wrapped to a second line whenever the count grew a digit — which resized
the node, the stats card, and every card below it mid-scrub.

ToolPills now keeps ONE line, like the Input/Output row above it, and folds
whatever does not fit into a trailing "其他 +N". The fit is measured, not
guessed: an off-flow gauge carries every pill and every chip width at its
natural size, and a layout pass picks the widest set that fits alongside the
chip it would actually carry. A pill's width does not depend on whether its
neighbours are on screen, so the gauge answers for the tail the row is not
showing, and the row renders only what fits — nothing is ever clipped or
overlapped. Measuring the live chip instead would feed the pass's own output
back into its input; measuring only the widest chip would cost a pill to
digits the chip never shows.

With no tally — the split generation's head carries none until the detail
lands — the row holds a lone "其他 +0", so the card reads as a figure
settling into place rather than a blank gap filling in. Because the row never
wraps, the node's height depends on the card's width alone and stops
resizing as a session's tool mix changes.
2026-10-10 17:14:54 +08:00
bowenliang123 209169df86 refactor(i18n): check the en dictionary against zh at compile time
Both dictionaries were annotated Record<string, string>, which is an
index signature and a promise of nothing: a key added to zh alone, or
to en alone, typechecked and shipped. The only gate was a runtime
deepEqual in the spec, so the asymmetry reached a built bundle before
anything failed.

zh is now the key-set source of truth and en is checked against it, the
harness's own idiom (see ui-conversation/src/client/locales.ts in
deepseek-harness, where 51 of 61 locale files do this). A key reaching
only one side is now a compile error, verified in both directions.

The spec keeps what types cannot see — non-empty values and placeholder
agreement — and drops the key-set test, which can no longer fail.

Translate keeps its key as string. Call sites compose keys at runtime
(`'form.' + form`, a weekday template), so a DictKey union would mean a
cast at each one, and the cast would suppress the check this change
buys.
2026-10-10 12:55:43 +08:00
bowenliang123 887615497d feat(client): show the agent cards' work state in the harness's own glyphs
The header popup marks each subagent with a rolling spinner while it
works and a green dot once it is done; the cards had no marker at all,
because their only candidate signal never existed. SessionSummary has
no completion field, so the row read was dead and always false — the
popup takes its answer from subagentTiming.lastTurnCompleted, and so
does a card now. A session that is not a subagent never carries that
projection, so its own folded steps against a stopped session stand in.

The glyph is the harness's own StateDot primitive at one fixed size, so
a card flipping between states never shifts its title.
2026-10-10 12:33:05 +08:00
bowenliang123 cd26173459 style(client): widen the agent card grid
The natural cell pitch was 208px, which left the two-line titles on a
subagent's card hugging the edge. Every card takes the same, larger
pitch — 276px — so the graph stays one grid and no card claims room
its neighbour does not get. A stage narrower than the pitch still
compresses it, so the family never overflows horizontally.
2026-10-10 12:00:41 +08:00
bowenliang123 38fe279213 feat(client): give every agent card a duration and a step count
The card footer carried the run's duration alone, so two things were
missing: a node that never produced timing rendered a footer with no
figure on the left, and the current agent's card showed nothing at all —
the harness only ever writes a subagentTiming projection onto subagent
sessions, so a parent session has no duration to read from the list.

The step count joins the duration, and the current agent's own
whole-step time reaches its card from the tab's timing totals. The
inspector reads the same figure under the same name, and the README
follows.
2026-10-10 11:59:54 +08:00
bowenliang123 32cb738e88 feat(client): rework the agent network as live cards
Each node becomes a card: title over a fixed two-line zone (every card's
rows align), the agent's consumed tokens with an estimated price when the
models.dev book has the rate, a composition bar replacing the donut (free
window is the track), and a footer with the run's duration at the left and
the bar's occupancy figure at the right.

Links are S-curves fanned out of the parent card's foot in the family hue
with joint plugs at both ends; hovering or focusing a card lights its whole
lineage (ancestors + subtree) while the rest of the graph dims. Sibling
order follows the parent's subagentCatalog projection (the harness header
popup's own spawn order) when cached, with the activity heuristic as the
degrade. Narrow panes fold the family into single-column bands instead of
crushing cards, and the stage measures its content box, so the phantom
horizontal scrollbar at exact-fit widths is gone.

The inspector gains the hovered node's composition readout; keyboard focus
drives the same inspector/lineage affordance as hover. Card surfaces step
one layer up with the l2 border (the inspector's own nesting recipe) so the
cards read clearly in both themes.
2026-10-10 11:24:47 +08:00
bowenliang123 9ccf236123 test(host): collapse the duplicated per-baseline registry run
RegistryDriver's constructor took a Baseline and stored it as a public
field it never read, and registry.spec.ts looped the whole suite over
BASELINES to pass it in — so eleven tests ran twice, identically. Every
supported line shares one documented registry contract, which is what the
driver already mirrors; the driver now takes no baseline and the suite runs
once. The per-tag complement, the ACTUAL dsh registry sources, still runs
in the compat project.
2026-10-10 02:18:37 +08:00
bowenliang123 ba8d7c7624 refactor(client): unwrap the zero-argument component factories
makeDonut() and makeSliceList() took no arguments, closed over nothing,
and returned a component their callers then held in a per-mount local —
seven call sites paying for a factory that bought no identity stability a
plain module-level export does not already give. Both export the component
directly now; sliceList's inline props type becomes a named interface,
since it was written out twice in the signature.

objectsOf and rpcCallOf lose an export keyword each: whole-tree search finds
no consumer outside the module that defines them.
2026-10-10 02:18:13 +08:00
bowenliang123 483e76b0c4 fix(host): copy a day's nested activity records before serving them
The contextActivity view copied each day entry shallowly while its own
comment promised the registry, the cache writer and the wire could never
mutate the fold's record. Since stateVersion 2 and 4 the entry carries a
four-level `cost` ledger and a `skills` table, and both stayed aliased to
the persisted state — the exact rule foldWire.ts states for its own served
fields and honours by copying every level of `cost`.

The copy is conditional-spread throughout: one `undefined`-valued property
fails the whole lossless-JSON push. The ledger walk moves beside
addBilledUsage as its mirror, so the timeline and activity halves price and
serve through one implementation.
2026-10-10 02:17:18 +08:00
bowenliang123 3611d50419 fix(host): skip the reserved prototype key in the tool-timing tally
A durable tool/call naming itself `__proto__` reached bumpToolTotals, whose
Object.hasOwn guard passes for it — the key is never an own property. The
plain assignment then set the tally's prototype instead of booking a row:
the count was lost, the 16-name cap never saw the key, and foldWire's
`for...in` copied the inherited `calls`/`ms` as `{}`, which the strict
tool-timing schema rejects. The registry parses every served view with no
error boundary, so that throw stalls the unit's push feed — the "loading"
forever failure compatibility.md designs out, and the same defect the
compat matrix already pins as `poisonedStarves`.

The client boundary has skipped this name since issue #44, with a
regression test beside it; the host fold, where the untrusted name first
lands, did not. The hostile fixture needs no second tool run to reproduce:
a later one re-clones the tally through a spread, which launders the damage.
2026-10-10 02:16:50 +08:00
bowenliang123 f50f33d58b fix(ci): run the compat seam matrix on pull requests
The matrix skipped itself on every PR: pr-checks.yml never fetched the
baseline tags and never set DSH_REPO, so skipReasons() always reported a
missing checkout and describe.skipIf dropped the whole per-baseline block —
the registry apply, the wire keys, the checkpoint JSON gate, cold restore
and every client seam probe. Only the release workflow fetched them, so
the compatibility proof compatibility.md claims for "every pnpm test" was
a no-op until a tag was cut.

Both workflows now fetch the tags and export DSH_REPO, and a skip under CI
fails the run instead of hiding behind green: a missing prerequisite there
is a broken gate, not an absent one. The two test runs collapse into one,
which also brings the lint gate the release workflow had and PRs did not.

The matrix's own vocabulary guard compared a hand-copied constant against
hand-copied baseline lists, so it could never see a drift in the fold — and
had drifted: approval/asked, approval/decided and session/end-seed are
folded but declared by no baseline. It now reads the fold's case labels out
of src/host/fold.ts, so a new fold case cannot go unprobed, and the history
probe pins the `records` envelope historyPage's rowsOf rejects without, not
just the remote's service name.
2026-10-10 02:16:22 +08:00
bowenliang123 9aaa11591a test(client): split the oversized specs into siblings with shared harnesses
browser.spec.ts (2360), trendChart.spec.ts (1629), contextView.spec.ts (1504), and
overview.spec.ts (1065) exceeded the 1000-line limit. Each splits along its existing
describe seams into same-directory siblings, with the fixtures that more than one
sibling needs extracted once into a shared harness.

The move is verbatim: test titles, describe blocks, and every assertion line are
preserved exactly (2061 tests before and after, no duplicate titles, no skips), and
the suite reports the same coverage.
2026-10-10 01:21:15 +08:00
bowenliang123 c4f5500de7 refactor(host): split the fold module into state, metering, and wire siblings
fold.ts held the persisted state shape, the retention bounds, the untrusted-usage
sanitizer with its accumulators, the surface projection, and the served-value
builders at 1234 lines. The state, the metering accumulators, and the wire builders
move into flat siblings; applyTimeline and the surface projection stay together
because the clone contract they enforce spans both.

The metering extraction also unifies BilledUsage with the shared CostBucketTotals:
one four-bucket vocabulary, so the accumulator input is spelled `uncached` like the
totals it feeds. The persisted and wire shapes are unchanged (both already carried
`uncached`), so no stateVersion bump and no cached-row invalidation.

Production callers import the owning sibling; fold.ts keeps re-exporting the
pre-split surface for the specs.
2026-10-10 01:19:59 +08:00
bowenliang123 87a2893190 refactor(comments): clean up the test-suite comments to the guideline
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.
2026-10-10 00:50:55 +08:00
bowenliang123 eb8368fb64 refactor(comments): drop two stale test comments
Remove browser.spec.ts's file header (a coverage inventory the describe blocks
already state) and reword trendChart.spec.ts's tooltip note that quoted the zh
UI string, keeping the assertion's intent in English.
2026-10-10 00:27:04 +08:00
bowenliang123 7c87ce2b76 refactor(comments): rewrap test comments onto fuller lines
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.
2026-10-10 00:26:42 +08:00
bowenliang123 def268b7bb perf(trend): rise only the newest columns on mount
Every retained bar carried `animate-lc-bar-in`, so the chart's mount animated
each one — the host retains up to maxRequestSteps (1500) requests — and every
animating bar layerizes on its own. Only the columns a pane can reach are ever
seen: the chart mounts anchored to the newest bars, so the rise is now drawn by
the newest RISE_CAP (200) columns, the stagger counted from the window's edge
so those columns still cascade left to right. Bars appended to a live session
keep rising, and a log shorter than the window is unchanged.

Measured on the 218-step session, the per-bar animations cost 17ms of the worst
frame gap and 16ms of blocking on top of the strip fix. With both changes the
open measures 243 animations, a 133ms worst frame gap (was 250ms) and 98ms of
blocking (was 173ms); with every CSS animation disabled it measures the same
133ms, so what remains is plain mount cost. Three tests pin the window in
total, DNA and DNA+delta modes.
2026-10-09 23:42:35 +08:00
bowenliang123 20826dcaf7 perf(timing): sweep the strip's bands on one wrapper, not one animation each
Opening the Context tab on the 218-step session started 1584 CSS animations at
once, 1324 of them the timing card's strip — one `animate-lc-stacked-in` per
band. Tracing the open showed 1582 animationstart / 1578 animationend
dispatches, 343 Layerize events (392ms of layer churn) and a 250ms worst frame
gap where the shell's own tab switch measures 67-83ms. Disabling just the
strip's per-band animations on the same build already cut that open to a 150ms
gap and 109ms of blocking (from 173ms).

The bands now ride one `.lc-tstrip-fill` wrapper carrying the single sweep, so
the strip wipes open on one composited transform over the same track. Packing,
colours, the kind hover link and the tip are untouched; the per-band ripple it
replaces was capped at eight stagger slots, so a packed strip already settled
as a sweep. A regression test pins the single wrapper and the absence of any
per-band animation class.
2026-10-09 23:42:13 +08:00
bowenliang123 6475afc8d6 fix(client): end the price-book retry cycle when its last subscriber leaves
The backoff timer re-armed unconditionally after every failed read, so an
unreachable models.dev registry kept being polled for the rest of the page's
life even after the Insights page that subscribed had gone. Measured with
fake timers: 7 polls in the 20 minutes after the last unsubscribe, at the
capped 240s cadence, forever.

The timer callback now ends the cycle when no subscriber remains; the next
subscribe already kicks a fresh read. Measured after: 0 polls in the same
window, and the first subscribe still fills the book as before.
2026-10-09 22:42:07 +08:00