Skip to content

Fix JAML default filter crash, validate before search, make JAML view usable on phones - #4

Merged
OptimusPi merged 1 commit into
masterfrom
claude/determined-goldberg-ue8tto
Sep 12, 2026
Merged

OptimusPi merged 1 commit into
masterfrom
claude/determined-goldberg-ue8tto

Conversation

@OptimusPi

Copy link
Copy Markdown
Owner

What was broken

The first Start Search on a fresh install crashed every time. The shipped DEFAULT_JAML used two keys the JAML grammar does not have: spectral: Hex (should be spectralCard) and mixedJoker: Any (should be joker). motely-wasm 26 raises an opaque C# exception from NativeAOT on unknown keys instead of a parse error, so the UI showed that string and nothing else. Bisected clause by clause in Node; the corrected keys run clean.

WebMCP logged an AbortError for every tool on boot. registerTools() notified once per tool, each notify re-ran publish(), and each publish aborted the one before it mid-loop. Thirteen warnings per page load.

JAML view was unusable on a phone. At 390px the AppShell navbar rendered in flow at full width and, in JAML mode, contained only the view switcher, so the editor started roughly 1500px below the fold. On desktop it was an empty 400px column.

Seed-queue hotkeys and view hijack. ArrowLeft/ArrowRight stepped seeds while authoring JAML, and loading a seed list forced the view back to Blueprint.

What this does

  • Fix the two keys in DEFAULT_JAML and export it.
  • Gate the search on jaml-lang diagnostics (added as a direct dependency; it was already installed as a jaml-ui dependency). Unknown keys disable Start Search and show line N: Unknown key '...' in the Search panel. Cancel still works while a search is running. jaml-ui's parseJaml never throws, so it cannot be used as the gate.
  • registerTools() registers the batch and notifies once; a superseded publish() exits quietly instead of warning per tool.
  • Collapse the navbar in JAML mode on desktop and mobile. Move the view switcher into the header for JAML mode, sharing the option list with the navbar instead of copying it. Hide the settings burger and seed-queue controls in JAML mode.
  • Seed-queue hotkeys do nothing in JAML mode. jumpSeedQueue no longer rewrites viewMode.
  • New test ___tests___/jamlDefault.spec.ts: the default filter has zero diagnostics, declares nine should clauses, and the validator rejects the two keys that crashed the engine.

Verification

npx vite build    ✓ built in 17.11s
npx eslint src    0 errors, 13 warnings (all pre-existing)
npx vitest run    588 passed, 2 failed (ante-null.spec, spoiler_peek.spec: fail identically on master)

Headless Chromium against the built app:

check result
desktop 1440px, random 20,000 seeds Search complete, 1,145 hits, calculus measured
WebMCP could not register warnings 0 (was 13)
set a bad key via set_jaml_filter Start disabled, line 22: Unknown key 'spectral'. shown
restore the filter Start re-enabled, error cleared
mobile 390px, JAML view scrollWidth 390, editor title at 103px from top

Not fixed here, called out for later: ESLint cannot parse files under ___tests___/ because tsconfig.json only includes src (pre-existing, affects the existing specs too), and motely-wasm should return a real parse error instead of the NativeAOT exception.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RkbxDfehyheD9RSpWTSDQF


Generated by Claude Code

… usable on phones

The shipped default filter used two keys the JAML grammar does not have
(spectral, mixedJoker). motely-wasm 26 raises an opaque NativeAOT exception
on unknown keys instead of a parse error, so the first Start Search on a
fresh install died every time. Fix the keys and gate the search on
jaml-lang diagnostics: unknown keys now disable Start and show the line.

WebMCP publish re-ran once per registered tool and aborted the previous
pass, logging an AbortError for every tool on boot. Batch registration
notifies once and a superseded publish exits quietly.

In JAML mode the navbar was an empty column (desktop) or a full-width
void above the editor (phone). Collapse it there and move the view
switcher into the header. Seed-queue arrow hotkeys and header controls no
longer act while authoring JAML, and loading a seed list no longer yanks
the view back to Blueprint.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RkbxDfehyheD9RSpWTSDQF

Copy link
Copy Markdown
Owner Author

CI: the deploy check is red for a reason outside this diff.

The workflow has one job, deploy, bound to environment: github-pages. That environment only allows deployments from master, so on every pull_request run GitHub rejects the job before checkout: it finishes in one second with no runner assigned and no log (the log download returns 404). This is the same signature on every PR run in the repo's history, including all five runs on #3 (for example run 34717264069: started 20:30:27, completed 20:30:28), while every push to master succeeds. Nothing in this PR touches the workflow, and the app builds locally (vite build exit 0).

A re-run would fail identically, so I have not spent one.

Proposed patch (not applied here, since it changes the production deploy path): split the workflow so PRs run the build and only master pushes deploy.

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'
      - run: npm ci
      - run: npm run build
        env:
          BASE_PATH: /Blueprint/
      - uses: actions/upload-pages-artifact@v3
        with:
          path: './dist'

  deploy:
    if: github.event_name != 'pull_request'
    needs: build
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/configure-pages@v4
      - id: deployment
        uses: actions/deploy-pages@v4

With that, PRs get a real build check and the deploy job no longer appears red on them.


Generated by Claude Code

@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR corrects the shipped JAML filter, prevents invalid JAML from reaching the search engine, improves JAML-mode navigation on narrow screens, isolates seed-queue controls from JAML authoring, and batches WebMCP registry publication.

  • Adds diagnostics-based search gating while preserving cancellation of active searches.
  • Moves JAML navigation into the header and collapses analysis-only navigation.
  • Prevents queue navigation from changing the active view or responding to authoring hotkeys.
  • Coalesces WebMCP registry notifications and quietly exits superseded publications.
  • Adds regression coverage for the default JAML document and invalid legacy keys.

Confidence Score: 5/5

The PR appears safe to merge; no concrete correctness, security, or repository-rule failures remain.

The corrected default validates cleanly, invalid documents are prevented from starting while active searches remain cancellable, navigation changes preserve reachable mode transitions, and batched WebMCP publication converges on the complete registry.

Important Files Changed

Filename Overview
src/components/blueprint/jamlView/JamlView.tsx Adds diagnostics-driven search validation and preserves cancellation while a worker search is active.
src/modules/state/jamlSearchContext.tsx Corrects and exports the default JAML filter used on first launch.
src/components/blueprint/layout/header.tsx Moves the shared view selector into the header during JAML mode and hides analysis-only controls.
src/components/blueprint/standardView/index.tsx Fully collapses the settings navbar while JAML mode is active.
src/components/SeedQueue.tsx Prevents seed-queue hotkeys from firing while users author JAML.
src/modules/state/store.ts Stops seed-queue navigation from forcing JAML users back to Blueprint mode.
src/modules/webmcp/registry.ts Batches tool registration and unregistration into one registry notification.
src/modules/webmcp/register.ts Makes superseded WebMCP publication loops exit without logging expected abort failures.
tests/jamlDefault.spec.ts Covers the corrected default filter, its clause count, and rejection of the legacy invalid keys.
package.json Promotes the already-resolved jaml-lang package to a direct dependency.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Edit[Edit JAML document] --> Validate[jaml-lang diagnostics]
    Validate -->|Errors| Block[Disable Start Search and show errors]
    Validate -->|No errors| Start[Start worker search]
    Start --> Engine[motely-wasm search engine]
    Engine --> Progress[Progress and scored results]
    Progress --> Results[Render matching seeds]
    Start -->|User cancels| Cancel[Send cancellation request]
Loading

Reviews (1): Last reviewed commit: "Fix JAML default filter crash, validate ..." | Re-trigger Greptile

@OptimusPi
OptimusPi merged commit 113e5c8 into master Sep 12, 2026
1 of 2 checks passed
@OptimusPi
OptimusPi deleted the claude/determined-goldberg-ue8tto branch September 12, 2026 22:08

This branch had an error being deployed

1 failed deployment
github-pages — 5948332a Deployed Sep 12, 2026 by OptimusPi via deploy #58
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