Skip to content

Restore JAML seed bundles and URL-backed seed queue navigation - #6

Merged
OptimusPi merged 2 commits into
masterfrom
cursor/restore-seed-list-navigation-3c65
Oct 12, 2026
Merged

OptimusPi merged 2 commits into
masterfrom
cursor/restore-seed-list-navigation-3c65

Conversation

@OptimusPi

@OptimusPi OptimusPi commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

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-ui 4.6.0 still lists that package, so package.json overrides the install to empty-npm-package (the fake grammar is not on disk). Moving to jaml-ui 8 drops the name entirely; that line also wants motely-wasm 28.

What broke

  • Jan–Feb 2026 (3cf753fc, 23f080ec): JAML view had in-component multi-seed lists with arrow-key stepping tied to Blueprint analysis.
  • Regression (e5bdf593, 2026-04-25, “update motely jaml”): That UI was removed when JamlView was rebuilt on jaml-ui; only single-seed / sidebar flows remained.
  • Sep 2026 (c14b746) added sidebar SeedQueue + hotkeys but not JAML document ingest, URL sharing for lists, or worker-side parsing for large seeds: blocks.

Verified with: git show e5bdf593 --stat and git log -1 e5bdf593.

Changes

  • parseJamlDocument (src/modules/jamlDocumentParse.ts): splits filter from seeds: (list or inline), maps JAML Ghost / White → Blueprint deck/stake.
  • Search worker (parseDocument message): parses large documents off the main thread (46,210 seeds in ~588 KB fixture under 5s in Vitest).
  • JamlView: upload .jaml, debounced paste detect, auto queue + motely search on seedList scope; editor keeps filter + a short queue note (not 46k lines).
  • Seed queue: URL 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-ui still 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.

Open in Web Open in Cursor 

cursoragent and others added 2 commits October 7, 2026 08:15
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>
@OptimusPi
OptimusPi marked this pull request as ready for review October 12, 2026 22:15
@OptimusPi
OptimusPi merged commit ebc7f01 into master Oct 12, 2026
2 checks passed
@OptimusPi
OptimusPi deleted the cursor/restore-seed-list-navigation-3c65 branch October 12, 2026 22:16
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 0/5

[Medium impact] Adds JAML document parsing and URL-based seed queue navigation.

Fix the seed-link replacement, document update failures, list parsing, and private test fixture before merging.

Findings

  1. P1 Shared links show another seed ▶
  2. P1 Tests need a private file ▶
  3. P1 Seed edits do nothing ▶
  4. P1 Revised bundles are skipped ▶
  5. P1 Comments change seed lists ▶
  6. P1 Multiline lists break search ▶
  7. P1 Old replies replace new edits ▶
  8. P2 Returning loses search seeds ▶
  9. P2 Storage errors prevent sharing ▶

Summary

Adds full JAML bundle loading, worker-side seed extraction, and URL-backed queue navigation.

  • JAML bundles now load and search their listed seeds.
  • Short seed queues reopen at their selected seed from a URL.
  • JAML filters no longer use the separate language package.

Diagram

sequenceDiagram
    participant U as User
    participant V as JAML view
    participant W as Search worker
    participant S as Shared store
    participant B as Browser
    U->>V: Paste or upload bundle
    V->>W: parseDocument(text)
    W-->>V: documentParsed(filter, seeds, deck, stake)
    V->>S: Apply settings and seed queue
    S->>B: Save queue locally and update URL
    V->>W: start(seedList search)
    W-->>V: Scores, progress, completion
    U->>S: Step through queue
    S->>B: Update seed and queue index
Loading

Reviews (1) · Last reviewed commit: "Drop jaml-lang from Blueprint" · Reviewed by Greptile

Comment on lines +11 to +16
if (state.engineState.seed !== expected) {
state.jumpSeedQueue(index);
return;
}
if (!state.applicationState.start) {
state.setStart(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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!

Comment on lines +42 to +43
const path = "/home/ubuntu/.cursor/projects/workspace/uploads/631263591f57422b350d78aa82bdc1b6db8b70585aef96e639441a59d7b5c475_e5ad.jaml";
const text = readFileSync(path, "utf8");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Tests need a private file

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.

Comment on lines +191 to +194
const fromDocument = documentSeedsRef.current;
const seeds = fromDocument.length > 0
? fromDocument
: seedList.split(/[\s,]+/).map((s) => s.trim()).filter(Boolean);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Seed edits do nothing

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

Comment on lines +273 to +276
const fingerprint = `${doc.seeds.length}:${doc.seeds[0] ?? ""}:${doc.seeds.at(-1) ?? ""}:${doc.filterJaml.length}`;
if (fingerprint === lastParsedFingerprintRef.current) {
setDocumentStatus(null);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Revised bundles are skipped

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>>([]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Returning loses search seeds

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

Comment on lines +46 to +49
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Comments change seed lists

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

Comment on lines +70 to +73
if (after.startsWith("[")) {
parseInlineSeeds(after, seeds, seen);
i++;
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Multiline lists break search

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.

Comment on lines +344 to +345
case "documentParsed":
applyParsedDocumentRef.current(msg.document);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Old replies replace new edits

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Storage errors prevent sharing

If browser storage is full or unavailable, the existing catch returns before the newly added syncSeedQueueToUrl runs. Even a small queue then cannot be shared or restored through its URL. Run URL saving independently of the localStorage write.

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.

2 participants