Commit Graph

8043 Commits

Author SHA1 Message Date
Katia Bulatova 0739337c24 chore: cut the report, waiting-run and package comments to their facts 2026-08-05 21:37:08 +00:00
Katia Bulatova 93bc6c158d chore(webapp): clear the demo fixture and storybook commentary 2026-08-05 21:36:19 +00:00
Katia Bulatova 0d415c04ef chore(webapp): strip the step narration from the agent and report tests 2026-08-05 21:35:59 +00:00
Katia Bulatova cb70b83059 chore(webapp): drop the prose from the chat markdown css rules 2026-08-05 21:35:24 +00:00
Katia Bulatova bd6835f9d9 chore(webapp): drop the page-context notes from the route files 2026-08-05 21:35:23 +00:00
Katia Bulatova 17e11c771f chore(webapp): cut the chat-layout header and stop the test asserting on it 2026-08-05 21:35:22 +00:00
Katia Bulatova f3237decb7 chore(webapp): drop the unused demo report card 2026-08-05 21:21:52 +00:00
Katia Bulatova b062490cbf chore: add a server-changes note for the report layout parity 2026-08-05 21:17:34 +00:00
Katia Bulatova 78aea57480 test(webapp): assert the card and the text report stay one report
Landmarks derived from the layout spec must appear in the same order in the server-rendered card
and in the markdown, over healthy, degraded, untrustworthy and empty reports.
2026-08-05 21:17:33 +00:00
Katia Bulatova 880d94ae3a feat(webapp): build the report card from the shared layout
The card no longer formats values, resolves codes or classifies footer codes of its own, and a
genuinely-unknown state now gets a neutral icon instead of a green tick.
2026-08-05 21:17:33 +00:00
Katia Bulatova f6865d581a feat(webapp): render the markdown and ANSI report from the shared layout
The text surfaces gain the card's structure (headline, hero evidence, why: block, aggregated
read:, trust flag) and keep their alignment: fixed sparkline column, aligned notes.
2026-08-05 21:17:32 +00:00
Katia Bulatova 547ec711d8 feat(webapp): declare the report layout once, shared by the card and the text surfaces
Section order, section labels, the tone -> glyph vocabulary, the footer styles and every
string a renderer places now live in report-layout.ts. Renderers decide typography only.
2026-08-05 21:17:32 +00:00
Katia Bulatova 5aef047d87 fix(webapp): cap the query API's scope at the credential's environment
/api/v1/query took its tenant scope from the request body, so a public access
token minted for one environment could read the whole organization by asking for
organization scope. The credential is now the ceiling and a wider ask is refused;
secret keys and the membership-authorized Query page are unchanged.
2026-08-05 21:13:40 +00:00
Katia Bulatova 1af895bb47 fix(dashboard-agent): keep a failed turn in the conversation
A turn that ends in an error was only a stream event, so reloading history showed
a turn that just stops. It is now appended to the transcript through the same
id-deduped path a wake uses, in the same wording the live stream shows, and the
panel drops its live callout once that record is the last message.
2026-08-05 21:13:39 +00:00
Katia Bulatova a303cb0648 refactor(webapp): one presenter for all watch and view-block wording
Every watch sentence (card, banner, toast, email, Slack, webhook) now comes from
app/presenters/v3/dashboardAgent. The condition is written once per kind in four
registers instead of in four switches across three files, and a plain-text block
renderer lets the non-React surfaces say what the card says.
2026-08-05 21:13:39 +00:00
Katia Bulatova 04687767c9 chore: oxfmt the blank lines left by the removed comments 2026-08-05 16:21:32 +00:00
Katia Bulatova d70bcfc7df chore(dashboard-agent): shorten the agent and tool-layer comments 2026-08-05 16:21:31 +00:00
Katia Bulatova c331843dfc chore(webapp): shorten the watch service and test comments 2026-08-05 16:21:30 +00:00
Katia Bulatova a5dd3f13b6 chore(webapp): shorten the report, waiting-run and agent route comments 2026-08-05 16:21:30 +00:00
Katia Bulatova 6ac42141e6 chore(webapp): shorten the suggested-prompt and demo-fixture comments 2026-08-05 16:21:29 +00:00
Katia Bulatova d1fff9c45b chore(webapp): shorten the agent panel and view comments 2026-08-05 16:21:28 +00:00
Katia Bulatova 0357d7926a chore(dashboard-agent-contracts): cut the wire-contract comments to their rules 2026-08-05 16:21:27 +00:00
Katia Bulatova 398e8c56ea chore(dashboard-agent): shorten the watch-tick comments to their invariants 2026-08-05 16:21:27 +00:00
Katia Bulatova 5247a008f0 chore(dashboard-agent-db): shorten the query-layer and schema comments 2026-08-05 16:21:26 +00:00
Katia Bulatova 16682d565c chore(webapp): the page-context comments say only what the handle doesn't 2026-08-05 16:21:25 +00:00
Katia Bulatova 27a9263f5e chore(webapp): tighten the chat-prose theme comments 2026-08-05 16:21:25 +00:00
Katia Bulatova 8349bf4384 chore(webapp): shorten the agent logo, spinner and scenario-kit comments 2026-08-05 16:21:24 +00:00
Katia Bulatova f428759269 chore(dashboard-agent): drop the M0 verdicts file, inline its reasons at the call sites 2026-08-05 16:21:23 +00:00
Katia Bulatova a4cd475eb7 chore(webapp): drop the unused stale-window import from the watch sweep 2026-08-05 15:41:09 +00:00
Katia Bulatova 1989336e68 fix(dashboard-agent): a dead chain is re-armed on its own cadence, and never stops owing a wake 2026-08-05 15:41:08 +00:00
Katia Bulatova 93c5344df1 test(webapp): the batch check shares one authorization and one report read 2026-08-05 15:41:07 +00:00
Katia Bulatova 3993381a69 test(dashboard-agent): the batch tick isolates, bounds, and never double-fires 2026-08-05 15:41:07 +00:00
Katia Bulatova 5d90eb1eea feat(webapp): the batch check answers a whole environment's watches at once 2026-08-05 15:41:06 +00:00
Katia Bulatova e16320bf56 feat(dashboard-agent): one tick run per environment and cadence, not per watch 2026-08-05 15:41:05 +00:00
Katia Bulatova cbeee6716f feat(dashboard-agent): a batch chain registry, one per environment and cadence 2026-08-05 15:41:05 +00:00
Katia Bulatova 4dedd60b3f chore: drop the working notes and the stray diff from the repo root 2026-08-05 14:57:49 +00:00
Katia Bulatova ac1fdfd29b chore(dashboard-agent): say why the title gate is the transcript length
Follows the title write moving to onBeforeTurnComplete: the gate reads as a
magic number without the note that a later turn cannot re-title anyway,
because setChatTitleIfDefault only writes over the default name.
2026-08-05 14:52:30 +00:00
Katia Bulatova d3d33a6aef chore: oxfmt the generated drizzle snapshot and the presenter test import 2026-08-05 14:52:29 +00:00
Katia Bulatova 37e4c234c2 fix(webapp): the chat name is on the row before the turn settles
The panel reloaded its chat list twice per turn — once on settle, then
again on a 5s timer — purely because the generated name landed after the
first reload and the list would otherwise sit on "New chat".

The name is now written before the client settles instead. Generation
starts in onTurnStart, so it runs alongside the model answering, and is
awaited in onBeforeTurnComplete — the last hook before the turn-complete
chunk closes the stream. onTurnComplete cannot do this: it fires after
that chunk, which is exactly why the write used to miss.

Costs nothing in practice (the cheap title model finishes long before the
answer does) and a failure only loses the generated name. The delayed
reload and its timer are gone, and a test pins the ordering — it fails if
the await is dropped.
2026-08-05 14:52:28 +00:00
Katia Bulatova 4606b94e0f feat(webapp): the watch sweep retires watches that ended a week ago
A terminal watch is read by nothing once its wake has landed — the chip is
gone, dedup only looks at active rows, and the outcome's facts live in the
chat transcript from then on. So the row was pure accumulation.

The sweep now drops terminal rows whose last event was over 7 days ago, in
one guarded statement bounded to 500 per run. Guards: terminal status only,
delivery already settled (a row that still owes a wake is never taken), and
the age measured from the newest timestamp on the row so a late delivery
restarts the clock. Watches only — chats, messages and investigations are
untouched.
2026-08-05 14:52:28 +00:00
Katia Bulatova 0b66440e99 perf(webapp): a finished report is reusable for 90s
A report is ~9 ClickHouse queries, and the callers that dominate its
volume are periodic rather than interactive: every watch tick in an
environment asks for the same health verdict, so one sweep recomputed it
once per watch.

Caches the interpreted view model per (report, environment, period) for
90s — under the tick cadence, well over a burst. In-process and keyed by
environment id, so nothing crosses a tenant. The single-flight map stays:
it is what holds the first callers of a cold key to one load, and a
rejected load is still never cached.
2026-08-05 14:52:27 +00:00
Katia Bulatova 0045062261 perf(webapp): the wake poll sleeps in hidden tabs and no longer runs in lockstep
A background tab has no dot the user can see and nowhere to put a toast,
so it stops asking; becoming visible triggers one immediate catch-up and
restarts the cadence from there. Each delay carries fresh jitter, so many
open tabs stop hitting the same second.
2026-08-05 14:52:27 +00:00
Katia Bulatova 1bc6a019c7 perf(webapp): the wake feed reads a tenant-scoped partial index
The dot's count and the toast's list both run on every poll of a closed
panel, and both drove off a full scan of the watches table: the tenant
predicates sat on the joined chat, so nothing narrowed the watch side
first.

Adds a partial index on (organization_id, user_id, resolution time desc)
over delivered wakes only, and asserts the same org + user on the watch
row so the planner can use it. That pair is redundant, not a new tenancy
rule — a watch snapshots its chat's owner at creation and the create path
rejects a chat from another org.

On 200k watches: the count goes 20.5ms -> 0.5ms and the recent list
21ms -> 0.02ms, with the parallel seq scan replaced by an index scan that
also absorbs the recency bound.
2026-08-05 14:52:26 +00:00
Katia Bulatova 814b527aeb docs(dashboard-agent): one guidebook replaces the playbook and scenarios 2026-08-05 14:43:18 +00:00
Katia Bulatova 95fa1b64b5 chore(webapp): drop the agent-examples review seeder 2026-08-05 14:43:17 +00:00
Katia Bulatova 75aba7f24c feat(webapp): the scenario kit runs against any local project and environment 2026-08-05 14:43:17 +00:00
Katia Bulatova ef65f468a2 chore: one release note for the dashboard agent, one short changeset 2026-08-05 13:23:36 +00:00
Katia Bulatova e740c16184 fix(webapp): give the remix build the same heap headroom as typecheck
The webapp outgrew the default heap on CI runners — both E2E workflows died
in webapp:build with allocation failures.
2026-08-04 23:43:22 +00:00
Katia Bulatova 2b5a705ac4 fix(webapp): the tick re-authorization user read moves off the replica
Same boundary rule as the membership read above it: replica lag must not
extend access a background check should have revoked.
2026-08-04 21:42:33 +00:00
Katia Bulatova 331f80e7f9 fix(webapp): watches container tests follow the org-scoped chat queries and the recent-wakes toast feed
Also drops the tracked review-diff artifact from the repo root.
2026-08-04 21:38:11 +00:00