Skip to content

feat(studio): L04 version summary pass and version.summary event - #1073

Merged
LinuxDevil merged 2 commits into
mainfrom
fb-l04
Nov 12, 2026
Merged

LinuxDevil merged 2 commits into
mainfrom
fb-l04

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • VersionStore gains onVersionWritten (fires after every successful capture, skipped no-ops excluded) and setSummary — a conditional write that rewrites the record file and its index.jsonl line together under withAgentLock, so a late second pass never overwrites.
  • New server/passes/versionSummary.ts: attachVersionSummaries subscribes per workspace inside createWorkspaceContext (L06a's shared PassRunner, Studio-global secrets/settings). Every create/update/publish write enqueues version_summary (key: agentId:version, timeoutMs: 20_000) through callPassModel.
  • buildVersionDigest (≤ 4000 chars): create → one-fact-per-line digest with Instructions: last; update → Label: before → after blocks, long strings as capped diffLines diffs (20 changed lines, collapsed context, … N further changed regions not shown), per-block 900-char cap, … N more fields changed tail.
  • Any non-ok outcome — including the kind disabled in settings — writes fallbackSummary (Changed <labels>. / kind phrases) so the timeline never stays pending; version.summary publishes only when setSummary wins. Restore/baseline never summarized.
  • Field labels moved to shared/specFieldLabels.ts, now shared by the Versions tab chips and the digest.
  • Drops two stale fallow suppressions (passRunner.enqueue now has a real caller; UNSUPPORTED_PREFIX is consumed by schemaIssues.ts).

Test plan

  • versionSummary.test.ts (17): digest shapes/caps, fallback cases, schema clamping, attach flows (ok→summary+event, failed→fallback, restore ignored, unsubscribe), prompt snapshot
  • versionStore.summary.test.ts (7): conditional write, index line, concurrent calls, listener fan-out
  • npm run test:server — 1403 pass; client suite — 3916 pass; both typechecks clean
  • npm run fallow — dead code & duplication clean (health count is a local-coverage artifact; CI regenerates coverage)

Generated with Devin

LinuxDevil and others added 2 commits November 12, 2026 02:29
…passes card

- server/passes/passModel.ts: callPassModel resolves the provider like the
  judge (stored keys first), asks for a JSON object, validates it against a
  zod schema, records model/usage/cost on the PassContext before parsing,
  and maps failures onto the PassRunner's settle classes.
- server/passes/jsonReply.ts: firstJsonObject moved out of judge.ts so the
  judge and the passes share one implementation.
- shared/wireTypes.ts + settingsStore.ts: PassSettings, PassSettingsPatch,
  PassSpendSummary, PASS_KINDS/PASS_KIND_LABELS and SettingsFile.passes;
  passes()/setPasses() merge stored values over the haiku-5-5 defaults.
- passRoutes.ts + app.ts + index.ts: GET/PUT /settings/passes and the
  PassRunner's isEnabled hook reading settings.passes().enabled.
- runtimeClient.ts + PassesSection.tsx + passes.css: getPassSettings/
  savePassSettings/getPassSpend and the screen-variant "Background passes"
  card (model inputs save on blur, kind switches on toggle, this month's
  spend table).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Every create/update/publish version write now enqueues a version_summary
pass on the workspace PassRunner: the model gets a bounded digest of the
saved change (facts for creates, per-field before/after or capped line
diffs for updates, requestText when present) and its <=25-word sentence
lands on the version via a conditional setSummary, with the
deterministic fallback written on every non-ok outcome so the timeline
never stays pending. version.summary publishes only when the write wins.
Restore and baseline versions are never summarized.

VersionStore gains onVersionWritten + setSummary (record and index line
rewritten together under withAgentLock); attachVersionSummaries subscribes
per workspace inside createWorkspaceContext. The Versions tab's field
labels move to shared/specFieldLabels.ts so UI chips and the digest agree.
Also drops two stale fallow suppressions (passRunner.enqueue now has a
real caller; UNSUPPORTED_PREFIX is consumed by schemaIssues.ts).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil merged commit 25e0d3d into main Nov 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant