diff --git a/PROJECT_STATE.md b/PROJECT_STATE.md index ea376129..c398709a 100644 --- a/PROJECT_STATE.md +++ b/PROJECT_STATE.md @@ -1,6 +1,6 @@ # ThothII — Project State -> Starting-point snapshot for new sessions. Last updated: 2026-07-01. +> Starting-point snapshot for new sessions. Last updated: 2026-07-07. > Point a fresh session here ("read PROJECT_STATE.md") before substantial work. ## What ThothII is @@ -53,7 +53,7 @@ Opens frontend at http://localhost:5173 → backend :8787. - frontend: `cd frontend && npm run dev` (Vite; `VITE_BACKEND_URL` → backend) - harness install: `cd harness && python -m venv .venv && pip install -e ".[dev]"` → `tht` on PATH -## How to test (all green as of 2026-07-01: harness 281 / backend 67 / frontend 96) +## How to test (all green as of 2026-07-07: harness pytest 314 / gate JS 103 / backend 71 / frontend 182) - harness: `cd harness && .venv/bin/pytest -q` (5 L2/real-DB tests are deselected by default) - backend: `cd backend && npx vitest run` · typecheck `npx tsc --noEmit -p .` - frontend: `cd frontend && npx vitest run` · typecheck `npx tsc -b` · e2e `npm run e2e` (Playwright) @@ -78,6 +78,56 @@ Opens frontend at http://localhost:5173 → backend :8787. - Global user rules (`~/.claude/CLAUDE.md`): think before coding, simplicity first, surgical changes, goal-driven verification. +## Review gates v2 — payload strutturati + viewer dedicati — COMPLETE (2026-07-07) + +Plan: `~/.claude/plans/prima-di-passare-ai-inherited-marshmallow.md`. Merged to `main` @ `2410f01` +(ff, pushed). Executed via subagent-driven-development (4 workstreams, task reviews, final +whole-branch review + fix wave). + +- **Contracts:** `artifact.data.schema_version: 2` for `cte_plan` / `cte_result` / `phase`, + built **deterministically by the gate** (catalog descriptions via `tht schema columns`; SQL + from `ctes/.sql`; preview rows persisted by `tht cte test`); the model contributes only + purpose/rationale/note. Non-v2 payloads fall through to the legacy renderers — old sessions + and `tools/replay/replay.json` keep working. +- **Harness (Python):** `CteTestRecord.preview_rows` (+ `_jsonable` coercer, ≤10 rows, cells + ≤200 chars); new read-only `tht cte info --session --json` (index/total from + `cte_plan.json`, same source as `next_cte`); `tht cte plan --doc -` writes + `cte_plan_doc.json` (chain documentation; `cte_plan.json` stays a load-bearing `list[str]`). +- **Gate (JS):** `gate/artifact-contracts.js` (soft validators → self-corrective `textResult`, + TypeBox untouched) + `gate/enrich.js` (pure, catalog lookups injected); + `prepareReviewerArguments` now coerces `artifact.data` too (GLM stringified-param + mitigation); `SKILL.md` Phase 5/6 + disciplines rewritten (plan via `reviewer_confirm + kind:"cte_plan"` with payload A; `cte_result` gates send THIN data only — never SQL/preview + as text). +- **Frontend:** `artifactV2.ts` types; `CtePlanViewer` (per-CTE cards + chain strip), + `CteResultViewer` (shiki SQL + AG Grid preview), `PhaseSummaryViewer` (checks + criteria + with the VALUES driving choices), `PreviewGrid` extracted from `ResultsPanel`, + `statusBadge.ts` shared success/warn/error tokens. +- **Replay:** v2 fixtures + `tools/replay/augment-review-gates.mjs`; `replay.json` regenerated; + offline visual pass ok (screenshots in the SDD scratch dir). +- **LIVE E2E (session `2026-07-07-011858`, GLM 5.2):** all 8 phases completed with the v2 + gates; session **finalized** (DWH validation battery green, needs VPN). +- **Bug found live + FIXED (`2410f01`):** infinite spinner at workflow end — the bridge dropped + Pi's `agent_end` (the ONLY end-of-turn signal) and `working` was released only by the next + gate, which the final turn doesn't have. Now: bridge maps `agent_end` → SSE + `system_event`; FE tracks `agentActive`; an unexpected Pi child exit notifies the client + (info error + synthetic `agent_end`). Memory: `pi-rpc-event-vocabulary`. +- **Open (non-blocking):** `tht.sqlcheck` maps table aliases by first occurrence (found and + worked around by the model in F6 — spawned as a separate task); one more live confirmation + that the spinner stops at F8 (the chain is unit-tested end to end). + +## F4 schema-linking column curation + look&feel v2 — COMPLETE (2026-07-06) + +Branches `feat/f4-schema-linking-column-curation` (PR #1) + `feat/frontend-lookfeel-v2`, landed +on `main` (`d942635` … `7491e8c`). The F4 gate (`reviewer_schema_linking`) presents +catalog-enriched tables/columns (descriptions from `tht schema columns`, hardened enrichment), +per-table columns modal (suggested pre-checked, suggested-first ordering + filter box); +decisions `column_promoted`/`column_excluded` + deterministic `tht session +sync-schema-linking` projection into `schema_linking.json`. Live-verified including the +clobber test (the model's joins write preserves curated columns). Look&feel v2: shadows/radii/ +mono labels, 70% gate modal, structured cards (colors untouched). Memory: +`thothii-visual-language-v2`. + ## Workflow contract hardening — COMPLETE (2026-07-01) Spec: `docs/superpowers/specs/2026-07-01-workflow-contract-hardening-design.md` · Plan: @@ -274,15 +324,11 @@ Full session management modeled on Claude's UI, all three layers: resume cold-start stall, GLM 5.2 F1 slow≠stuck). ## Git -`main` @ `3dadc6f`, **pushed to `origin`** (github.com/mptyl/ThothII); working tree clean, no stashes. -Workflow-hardening landed on top of the redesign: `d5af7b5` (spec) · `0193341` (plan) · `47a5217` -(cte next) · `160d7f0` (F6 by-name) · `92caaac`+`0077792` (schema_linking store+CLI) · `20bc3de` -(write_schema_linking gate) · `01de6f3`+`3dadc6f` (SKILL corrections + F7). Feature branch -`feat/workflow-contract-hardening` deleted after the ff-merge. -**`main` is the only branch** — the three stale branches (`feat/settings-menu` `bcaf670`, -`feat/thothII-debugging` `d67409f`, `feat/ui-redesign-resume` `0eeb3f7`) were fully merged ancestors -(no unique work) and were deleted on 2026-06-30 (SHAs recoverable via reflog). -Redesign+resume commits on top of `0eeb3f7`: `b056ff3` (B/C dots+sidebar) · `cef9ae4` (F -auto-confirm) · `0a13f71` (A resume menu + kickoff hardening) · `e8cdd00` (G scope) · `cbb8e18` -(G results). Earlier today: `418187a` (F1 hang fix) · `d27afd0` (reviewer_select choices fix) · -`c12bdcd` (D) · `0eeb3f7` (E). +`main` @ `2410f01`, **pushed to `origin`** (github.com/mptyl/ThothII); working tree clean, no stashes. +Latest arc (2026-07-07): review-gates-v2 ff-merged — `9b4f6b9` (WS1 harness) · `3ad93cd` (WS2 +gate+SKILL) · `1c97289` (WS3 viewers) · `4042d0b`+`b089482` (WS4 replay) · `b59b57c` (review fix +wave) · `2410f01` (agent_end spinner fix). Branch `feat/review-gates-v2` still exists (local + +origin), fully merged. Before that (2026-07-05/06): F4 column curation (PR #1) + look&feel v2 — +`0d9e035` · `0a63ba9` · `d942635` · `9fe1c93` · `e9b2934` · `9403147` · `7491e8c`. +Older history (workflow hardening 2026-07-01, UI redesign 2026-06-30): see the sections above; +stale branches were pruned on 2026-06-30 (SHAs recoverable via reflog).