Commit Graph
139 Commits
Author SHA1 Message Date
marcopan cddd906719 fix: wait for workspace policy before creation 2026-08-04 05:48:13 +02:00
marcopan 959c6871ee fix: validate workspace drafts and reconcile models 2026-08-04 05:38:43 +02:00
marcopan cee4cfa63d feat: store workspace preferences and drafts locally 2026-08-04 05:28:13 +02:00
marcopan 301db4bd85 feat: pin sessions to workspace revisions 2026-08-04 05:05:20 +02:00
marcopan 18233d59af fix: refine session report and live activity layout 2026-07-24 00:21:36 +02:00
marcopan 6ca4275ff2 fix: improve memory markdown layout 2026-07-23 23:01:29 +02:00
marcopan 724c446087 fix: expand session summary prose with panel 2026-07-23 16:06:22 +02:00
marcopan 9b5fca59e8 fix: expand final SQL to session panel width 2026-07-23 15:44:16 +02:00
marcopan 0db85e4e4e feat: redesign persisted session summaries 2026-07-23 15:35:31 +02:00
marcopan 694b7dd21f fix: harden reviewer workflow and memory handling 2026-07-23 12:34:23 +02:00
marcopan 4c9424f1e3 feat: add button press feedback 2026-07-21 15:10:08 +02:00
marcopan 2ff63d371f feat: harden workflow gates and expose token usage 2026-07-21 12:14:26 +02:00
marcopanandClaude Opus 4.6 3b52c8c08c feat: DWH connectivity probe at startup — modal alert within 5s if unreachable
Backend: GET /health/dwh (unauthenticated) calls tht db ping with a 5s
timeout. Frontend: checkDwhHealth() races a 5s timer against the fetch;
on failure a non-dismissable Dialog with Retry appears immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-20 13:59:11 +02:00
marcopanandClaude Fable 5 3e072fe652 fix: realign workflow advance semantics and phase labels with workflow.yaml
Audit findings 2.1 + 2.2 (high).

2.1 WorkflowBar's static phase list was fiction from F2 on (F2 "Schema
linking" vs memoria, F4 "SQL plan" vs schema_linking, …): every live
session showed the wrong phase name. Both maps now mirror
harness/workflow.yaml (F1 chiarimento … F8 datamart).

2.2 forceAdvance (6ee5bda) let reviewer_decide advance:true bypass the
phase gate on ANY phase, contradicting SKILL.md's "auto-advance only
empty F2 / skipped F6". reviewer_decide is back on advanceIfReady (exit-6
no-op) and tells the model to close via reviewer_confirm; forceAdvance
stays only where selection IS the approval by design: reviewer_schema_linking
(F4) and the F8 promotion close path. SKILL.md now names the three
self-closing gates (F3 rewrite_question, F4 schema-linking advance:true,
F8 memory_promote) so gate and skill state one contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 01:28:18 +02:00
marcopanandClaude Fable 5 803b98de36 fix(frontend): center gate dialogs on the app area, not the browser viewport
Embedded in the Omics Portal the SPA sits to the right of the portal sidebar,
but dialogs used `fixed left-1/2` — centered on the whole browser window, so
gates rendered visibly off-center (overlapping the sidebar).

- AppShell publishes the app area's horizontal geometry (--app-area-left/width)
  as CSS vars on <html> via ResizeObserver + window resize.
- DialogContent centers on those vars (falls back to the viewport when the app
  is standalone, where the two coincide).
- ArtifactGateWidget: narrower — cap at 52rem instead of 70vw.
- tools/replay: resume now returns {id, alreadyActive} JSON — the post-f979ada
  frontend reads result.alreadyActive and a bare 204 broke replay resume.

Verified on the replay harness: with a simulated 300px portal sidebar the gate
centers on the app area (center 790 = 300 + 980/2); standalone unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 17:08:20 +02:00
marcopanandClaude Opus 4.6 6ee5bda7f0 feat: gate decision-type validation, force-advance, and frontend fixes
Gate (tht-gate.js):
- Pre-validate decision types against workflow.yaml before showing reviewer widget
- Reject decisions emitted by later phases (min-phase check)
- Copy top-level `kind` into artifact when model forgets it (prevents loop)
- Force-advance on reviewer_decide/schema_linking when advance:true — skip
  redundant reviewer_confirm gate

Backend:
- Emit agent_end on clean Pi exit (code 0 + bridge idle) instead of marking failed

Frontend:
- Strip <think> tags from transcript and activity panel
- Fix mermaid render with offscreen container + cleanup
- Graceful mermaid error: show source code instead of red error, fall back to table

Workflow:
- F2 now emits table_promoted and table_excluded (early schema linking decisions)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-19 14:14:44 +02:00
marcopanandClaude Opus 4.8 ccfa3a18bf feat(frontend): pulse the stop dot while the harness is working
Give live feedback that something is happening the moment a session starts
processing: the red stop dot in the composer beats with a soft heartbeat + halo
while the harness is actively working (running — not waiting at a gate or
finalized), and settles the instant the model hands control back to the reviewer
or the session ends. Ring/scale only (no layout properties animated); honors
prefers-reduced-motion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 12:33:25 +02:00
marcopanandClaude Opus 4.8 3453f3ae23 feat: pre-check DWH reachability before creating a session (local dev only)
New session now refuses to spawn a Pi runtime that would only die in bootstrap
retrieval when the DWH/vector host is unreachable (e.g. a dropped VPN). Before
`session new`, POST /sessions probes the DWH via `tht db ping`; if it is down it
returns 503 {code:"dwh_unreachable"} with a clear message and creates nothing.

- Gated behind the THT_DWH_PRECHECK flag (default off), enabled only by the local
  dev launcher (run-stack.sh) — containers/CI never pay the probe, and existing
  tests that don't set it are unaffected.
- ThtRunner.dbPing() runs `tht db ping` with a 10s timeout (run() gains an optional
  timeout that SIGKILLs a hung child).
- Frontend: apiFetch throws a typed ApiError (status + parsed payload); the new-
  session composer shows the specific alert on `dwh_unreachable` instead of the
  generic retry hint, keeping the question for retry.

Verified live on an isolated backend (precheck on + broken DWH host → 503
dwh_unreachable, no session created) and via unit tests (backend 228, frontend 308).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 12:08:47 +02:00
marcopanandClaude Opus 4.8 f979ada5e7 feat(frontend): open a live session straight to its pending gate
Opening an in-progress session that has a live Pi runtime now reconnects to
its pending gate instead of the empty landing screen that read as "stopped".
Cold/completed sessions keep the read-only documents panel with its explicit
Resume, so a mere click never spawns a runtime. Backend GET /sessions now
reports a per-session `active` flag (live runtime bound) to drive this.

Also:
- "New session" now closes any open session detail panel (left box).
- The model-activity separator can be dragged to a full 50/50 split
  (was capped at 576px); central-min still guards narrow viewports.

Test fixes uncovered along the way:
- Node 25 ships an experimental global localStorage that shadows jsdom's and
  lacks clear(), failing every jsdom test at setup; install a spec-compliant
  in-memory Storage (feature-detected, inert on CI/LTS).
- Fix 4 pre-existing session-mgmt tests that used an ambiguous getByText for a
  session shown in both nav and header; target the nav item by test id.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 22:56:12 +02:00
marcopanandClaude Opus 4.8 c252c95c5f fix(frontend): pin the question as a stable first line during processing
The central column was top-anchored with no fixed header, so the user's
question was never shown while the model worked and the activity/gate
content drifted upward. Render the active session's question as a sticky,
always-present first row of the central area so it stays evident and
anchored at the top of the form.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 16:30:18 +02:00
User c6a74c9ccb fix(frontend): harden owner action confirmation 2026-07-16 18:51:02 +02:00
User 58e0884df1 feat(frontend): expose owned session scopes 2026-07-16 18:46:18 +02:00
User 1f540fcb78 fix(frontend): harden activity split responsiveness 2026-07-15 15:52:22 +02:00
User f1af1f909b style(frontend): tighten CTE plan vertical rhythm 2026-07-15 15:15:56 +02:00
User d177e1c0af feat(frontend): add resizable activity split 2026-07-15 15:04:15 +02:00
User 30e76a968d fix(frontend): restore readable model activity timeline 2026-07-15 14:55:57 +02:00
User bef21f9e43 test(frontend): harden live log contract 2026-07-15 12:45:26 +02:00
User 09f9bdffe5 fix(frontend): restore live log text contrast 2026-07-15 12:27:19 +02:00
User 6b0da84a3d style(frontend): compact CTE plan spacing 2026-07-15 12:09:04 +02:00
User 00c1af5a5a fix(frontend): reset live log follow state on resume 2026-07-15 12:04:05 +02:00
User 279b79516c fix(frontend): deduplicate live workflow activity 2026-07-15 11:55:14 +02:00
User 72085990ef fix(frontend): hide model activity execution noise 2026-07-15 03:24:22 +02:00
User 56d73d246b fix: preserve unrelated resume during delete 2026-07-15 02:16:36 +02:00
User 0bcec1591b fix: close delete resume and SSE replay races 2026-07-15 02:08:11 +02:00
User 6747f6f8a0 fix: serialize session lifecycle transitions 2026-07-15 01:37:42 +02:00
User 08b1f4909e fix: make session resume atomic across restarts 2026-07-15 00:42:35 +02:00
User 2b4797f133 fix: harden resume and SSE replay 2026-07-15 00:06:00 +02:00
User e5366d14a6 fix(frontend): harden CTE step semantics and padding 2026-07-14 23:33:40 +02:00
User 964bff9612 fix(frontend): restore CTE card padding and hierarchy 2026-07-14 23:24:02 +02:00
User d2d8029ff2 fix(security): sanitize session bootstrap failures 2026-07-14 23:13:21 +02:00
User f58b1d84ae fix(frontend): show complete model activity from phase one 2026-07-14 23:06:07 +02:00
User f0f6c3c223 feat(frontend): build chronological activity timeline 2026-07-14 22:56:41 +02:00
User df1e7dea9c fix(resume): recover cleanly after Pi exits 2026-07-14 21:35:50 +02:00
User 1393c6358e fix(frontend): reconnect stream on same-session resume 2026-07-14 20:53:19 +02:00
User e286b9131e test(frontend): cover configured model selector 2026-07-14 18:48:12 +02:00
User bc02213d3e fix: subscribe to model activity events 2026-07-14 15:14:25 +02:00
User f21df47bce test: align model activity integration contract 2026-07-14 15:11:07 +02:00
User e228c6f2fd fix: harden phase summary open questions 2026-07-14 15:09:50 +02:00
User 18701f020e fix: improve cte review presentation 2026-07-14 15:08:10 +02:00
User 27af6733c8 fix: make join review read only 2026-07-14 15:06:16 +02:00