Commit Graph
17 Commits
Author SHA1 Message Date
ahmed mohammedandClaude Opus 4.7 6248540857 fix: candidates carry runnable T-SQL; placeholder sql is dropped, not rendered
Measured on a 2.7 MB production plan (plan-cxpaket.sqlplan, kept out of git):
- rewrite_sql becomes option_type + sql_to_run. The old name told the model 'query rewrite only', so an index option carried no CREATE INDEX anywhere in the pipeline and the report had zero SqlBlocks. It now requires paste-ready T-SQL per option, and the report prompt makes a SqlBlock per non-null sql_to_run a hard requirement.
- verify_semantics keys on option_type === 'rewrite' rather than 'has sql', so index and statistics options are not flagged just for carrying DDL.
- dropPlaceholderSql: 'SELECT ... FROM ... OPTION (MAXDOP 1)' is not runnable and was rendered as if it were. Ellipsis SQL is now nulled, and digestForModel reports sql_truncated so the model is told not to offer a rewrite for a statement it never received.
- max_tokens 2048 -> 4096 for both calls: the larger JSON outgrew the old ceiling and the user waited 38s for 'malformed JSON'. A truncated response now says how many characters it got, and extra params still override the ceiling.
- Real plan, live: 52s, 17 cards, 3 SqlBlocks with real table names and no placeholders, 3 ScoreBars, headline 'Query Plan Timeout on Parallel Join'. 43 unit, 23 e2e.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 11:30:27 +03:00
ahmed mohammedandClaude Opus 4.7 3fa436103a fix: digest real production plans (nesting depth, Object table names, character refs)
Measured against a 2.7 MB production plan that failed to import:
- maxNestedTags: real spaghettified plans nest 2729 tags deep and fast-xml-parser caps at 128, which surfaced as 'Maximum nested tags exceeded' and blamed the export. Raised to 20000; the 12 MB input cap bounds the worst case.
- table names live on <Object>, not on <IndexScan>/<TableScan>. The digest reported 0 tables for a plan with 51 objects; the analyst model never saw a table name. Now 37 distinct tables.
- SSMS writes StatementText with numeric character references (&#xD;&#xA; on every line, 90 in this plan). Attribute/tag processors decode them, so the model gets SQL instead of entity noise.
- 3 new digest tests, each from one of the three measurements above. 39 unit tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 11:16:18 +03:00
ahmed mohammedandClaude Opus 4.7 4b5c19b5d2 fix: decode .sqlplan files the way SSMS writes them; name the parse failure
- lib/plan-file.ts: BOM-aware decode for UTF-8, UTF-16LE/BE (with and without BOM) and UTF-32, with a NUL-density fallback for BOM-less UTF-16. The browser had a two-byte FF FE sniff only, so a UTF-16BE or BOM-less plan arrived as NUL-filled junk and the digest blamed the export.
- digestPlan now quotes fast-xml-parser's first line instead of a fixed sentence, so a truncated file, a stray entity and a wrong file stay distinguishable.
- plan-file.ts holds the decode so the XML parser stays out of the client bundle.
- tests: 6 encodings round-trip through decodePlan into a digest; a truncated plan's message is asserted to carry a reason; e2e drops a real UTF-16LE file. 36 unit, 23 e2e.
- history.spec picked the rail's first row, which is now one of the new failing-input rows; it selects the newest finished run instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 11:08:55 +03:00
ahmed mohammedandClaude Opus 4.7 2ebfcfb7a6 fix: session cookie over plain http, console onboarding gate, webkit qa coverage
- the session cookie was Secure whenever NODE_ENV=production, so a production build on http://localhost got no cookie back in Safari: every page after signup looked signed-out. It is now Secure only when X-Forwarded-Proto says https, or when COOKIE_SECURE=1.
- /app and /app/[id] now require an analyst and a Jev key, the same rule /api/analyze enforces with a 412. Closing the guide mid-way used to leave a console that could not run anything.
- Playwright runs the production server (pree2e builds first) and gains a webkit project for session survival; chromium-only QA could never see a Secure-cookie rejection.
- tests-e2e/session.spec.ts pins both; .env.example gains COOKIE_SECURE and stops shipping a blank APP_SECRET.
- e2e: 21 passed (setup, chromium, webkit, mobile).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 10:45:12 +03:00
ahmed mohammedandClaude Opus 4.7 5160a00db5 fix: final review pass — email collision, orphaned-run loop, null confidence guards
- changeEmail validates and refuses an address another account owns (users.email is UNIQUE; a collision was a 500 inside the settings form).
- /app/[id] no longer redirects a 'running' row to itself; it renders what exists and says the run was interrupted.
- ScoreBar / OptionRow / VerdictBlock survive null numbers from the model instead of throwing and losing the block (seen live: '[openui] runtime/render-error: Component ScoreBar render failed').
- drop the ad-hoc render-debug scripts now that Playwright covers the browser.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 09:10:29 +03:00
ahmed mohammedandClaude Opus 4.7 07dd3d6bf8 test: playwright end-to-end qa (17 tests, real models)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 09:02:53 +03:00
ahmed mohammedandClaude Opus 4.7 a5529ce542 feat: console ui, streaming report, history actions
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 08:37:28 +03:00
ahmed mohammedandClaude Opus 4.7 ac4cbdd9e6 feat: analysis pipeline with staged SSE
Adds @openuidev/lang-core (one-line reason: the prompt-side library must build in a non-React Node runtime; react-lang's createContext crashes the route's server bundle).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 08:32:22 +03:00
ahmed mohammedandClaude Opus 4.7 13bd2e6bfd fix: open sqlite lazily so parallel build workers stop locking the file
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:56:18 +03:00
ahmed mohammedandClaude Opus 4.7 396b0edd9e feat: openui report library
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:54:52 +03:00
ahmed mohammedandClaude Opus 4.7 d8caa8e6db feat: jev composite scoring and verdict
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:53:03 +03:00
ahmed mohammedandClaude Opus 4.7 816f22c227 feat: analyst proposes multiple options; README with gitea remote
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:44:01 +03:00
ahmed mohammedandClaude Opus 4.7 4fefd0f6da feat: showplan digest
No fixtures/real.sqlplan available (no SQL Server reachable from this machine); the real-plan test skips and says so.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:39:01 +03:00
ahmed mohammedandClaude Opus 4.7 1c3f222f9d feat: setup wizard + settings
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:36:55 +03:00
ahmed mohammedandClaude Opus 4.7 dd6b880f49 feat: encrypted credential vault
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:34:01 +03:00
ahmed mohammedandClaude Opus 4.7 5f8746cfae feat: email+password auth with db-backed sessions
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:32:07 +03:00
ahmed mohammedandClaude Opus 4.7 692ffa97c5 feat: sqlite layer via node:sqlite
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 07:23:20 +03:00