Repository navigation
Restore JAML seed bundles and URL-backed seed queue navigation - #6
Conversation
JAML view accepts a full filter plus seeds: list via paste or upload. The worker parses large documents off the main thread, applies deck and stake to Blueprint, loads the navigable seed queue, and runs motely-wasm against the listed seeds. Shareable URLs carry seed lists up to a safe length with seedIndex for stepping. Co-authored-by: Nathanial P. Howard <admin@optimuspi.com>
Blueprint no longer imports or validates with jaml-lang. Motely reports filter errors when a search starts. jaml-ui 4.6 still names that package, so the install overrides it to an empty module. Co-authored-by: Nathanial P. Howard <admin@optimuspi.com>
|
| if (state.engineState.seed !== expected) { | ||
| state.jumpSeedQueue(index); | ||
| return; | ||
| } | ||
| if (!state.applicationState.start) { | ||
| state.setStart(true); |
There was a problem hiding this comment.
Shared links show another seed
With an old queue in localStorage, opening ?seed=ALEEB still loads that queue. This effect calls jumpSeedQueue(index) and replaces ALEEB with the saved queue’s selected seed. Keep an explicit URL seed authoritative. Move queue initialization into the store; the repository guide also forbids setting state in effects.
Context Used: CLAUDE.md (source)
Knowledge Base Used: Application state and theming
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const path = "/home/ubuntu/.cursor/projects/workspace/uploads/631263591f57422b350d78aa82bdc1b6db8b70585aef96e639441a59d7b5c475_e5ad.jaml"; | ||
| const text = readFileSync(path, "utf8"); |
There was a problem hiding this comment.
This test reads a file from the author’s private upload directory. That file is not included in the repository, so a fresh checkout cannot run the test successfully. Commit a fixture and read it through a repository-relative path, or generate the large document inside the test.
| const fromDocument = documentSeedsRef.current; | ||
| const seeds = fromDocument.length > 0 | ||
| ? fromDocument | ||
| : seedList.split(/[\s,]+/).map((s) => s.trim()).filter(Boolean); |
There was a problem hiding this comment.
After a bundle loads, buildScope always chooses the nonempty documentSeedsRef. Editing the Seeds field only changes seedList, so searching again uses the uploaded seeds instead of the list the user now sees. Clear or replace the document seeds when the user edits that field.
Knowledge Base Used: JAML editor and search
| const fingerprint = `${doc.seeds.length}:${doc.seeds[0] ?? ""}:${doc.seeds.at(-1) ?? ""}:${doc.filterJaml.length}`; | ||
| if (fingerprint === lastParsedFingerprintRef.current) { | ||
| setDocumentStatus(null); | ||
| return; |
There was a problem hiding this comment.
Different pasted bundles can have the same fingerprint. Changing Ghost to Black, or changing a middle seed while keeping the count and endpoints, leaves this value unchanged. The early return skips the new deck, queue, and search. Compare the actual document contents rather than these lengths and endpoints.
|
|
||
| const workerRef = useRef<Worker | null>(null); | ||
| const suppressDocumentParseRef = useRef(false); | ||
| const documentSeedsRef = useRef<Array<string>>([]); |
There was a problem hiding this comment.
Leaving JAML view discards documentSeedsRef, but applying the bundle has already removed seeds: from the shared editor text. On return, the parser cannot restore the list and search defaults back to random seeds, even though the queue remains loaded. Keep the document’s search scope and seeds in shared state so users do not need to upload it again.
Knowledge Base Used: Application state and theming
| const inner = rest.replace(/^\[/, "").replace(/\]\s*$/, ""); | ||
| for (const part of inner.split(/[\s,]+/)) { | ||
| const t = part.replace(/^['"]|['"]$/g, "").trim(); | ||
| if (t) pushSeed(seeds, seen, t); |
There was a problem hiding this comment.
For seeds: [ALEEB, PIROCKS] # note, parseInlineSeeds sends note through sanitizeSeed, adding NOTE to the queue. The block-list fallback also includes comments: - 0ALEEB # note becomes OALEEBNO, not OALEEB. Remove comments before converting list values to seeds in both paths.
Knowledge Base Used: Seed input and filtering
| if (after.startsWith("[")) { | ||
| parseInlineSeeds(after, seeds, seen); | ||
| i++; | ||
| continue; |
There was a problem hiding this comment.
For seeds: [ALEEB, followed by PIROCKS], this branch parses only ALEEB and advances one line. The next line is copied into filterJaml, leaving PIROCKS out of the queue and putting list text into the filter. Consume the complete bracketed list before returning to filter lines.
| case "documentParsed": | ||
| applyParsedDocumentRef.current(msg.document); |
There was a problem hiding this comment.
After parseDocument is sent, clearing the timer cannot cancel that request. If the worker is busy with a search and the user edits or uploads another document, the earlier reply still reaches applyParsedDocument and replaces the newer text, queue, and settings. Include a document version in each request and ignore replies for older versions.
| } catch { | ||
| return; | ||
| } | ||
| syncSeedQueueToUrl(queue); |
There was a problem hiding this comment.
Summary
Brings back end-to-end seed list stepping and adds the owner’s JAML workflow: paste or upload a full JAML file (filter +
seeds:list) in JAML view and it applies deck/stake, loads the navigable queue, and scores those seeds with motely-wasm in the existing search worker.Blueprint does not import
jaml-lang. Search errors come from Motely.jaml-ui4.6.0 still lists that package, sopackage.jsonoverrides the install toempty-npm-package(the fake grammar is not on disk). Moving tojaml-ui8 drops the name entirely; that line also wantsmotely-wasm28.What broke
3cf753fc,23f080ec): JAML view had in-component multi-seed lists with arrow-key stepping tied to Blueprint analysis.e5bdf593, 2026-04-25, “update motely jaml”): That UI was removed when JamlView was rebuilt on jaml-ui; only single-seed / sidebar flows remained.c14b746) added sidebarSeedQueue+ hotkeys but not JAML document ingest, URL sharing for lists, or worker-side parsing for largeseeds:blocks.Verified with:
git show e5bdf593 --statandgit log -1 e5bdf593.Changes
parseJamlDocument(src/modules/jamlDocumentParse.ts): splits filter fromseeds:(list or inline), maps JAMLGhost/White→ Blueprint deck/stake.parseDocumentmessage): parses large documents off the main thread (46,210 seeds in ~588 KB fixture under 5s in Vitest)..jaml, debounced paste detect, auto queue + motely search onseedListscope; editor keeps filter + a short queue note (not 46k lines).seeds+seedIndex(lists ≤1800 chars in URL; larger lists stay in localStorage), bootstrap on load, index sync when seed changes; header controls visible in JAML when a queue is loaded.parseSeedList: accepts whole JAML documents (sidebar + WebMCP).Verification (commands run)
npx vitest run ___tests___/jamlDocument.spec.ts ___tests___/jamlDefault.spec.ts— 5 passed.npm run build— succeeded on the seed-queue commit (before this dependency change).node --input-type=module -e "import { parseJaml } from 'jaml-ui'"—jaml-uistill loads after the override.Manual UI
Seed queue (5 seeds, Ghost / White): header
1/5→ next →2/5.Seed queue 1 of 5
Seed queue 2 of 5
JAML upload panel + small bundle upload (
uploadTest, 2 seeds):JAML upload panel
JAML document upload result
To show artifacts inline, enable in settings.