fix(web,ext): zero-install surfaces emit spec-valid v=1.2 CRUMB#14
Draft
slavazeph-coder wants to merge 2 commits into
Draft
fix(web,ext): zero-install surfaces emit spec-valid v=1.2 CRUMB#14slavazeph-coder wants to merge 2 commits into
slavazeph-coder wants to merge 2 commits into
Conversation
The web generator at web/index.html shipped broken — it emitted a TOML-style [crumb]/v = 1.1 block that never validated against the reference parsers. The browser extension emitted valid v=1.1 but was frozen there. Both are CRUMB's primary zero-install adoption surfaces and both are now brought up to the v=1.2 wire format. web/index.html - Rewrite generateTask/generateMem/generateMap to emit the SPEC §2.1 grammar (BEGIN CRUMB / key=value headers / --- / sections / END CRUMB) - Emit the v1.2 [handoff] primitive on task kind with actions inferred from TODO / should / need-to / implement phrases - Emit a [fold:context/summary] + [fold:context/full] pair when the pasted chat exceeds ~1500 chars - Expose pure generators on window.__crumbNew so Node-side test harnesses can exercise them without a browser browser-extension/ - Bump v=1.1 → v=1.2 in both parseSelectionToCrumb and buildLogCrumbFromVisibleMessages; manifest version 1.1.0 → 1.2.0 - Selection → task path emits a [handoff] block README.md - Lift zero-install entry points (web, extension, system-prompt paste, VS Code) above the pip install wall in a new "Pick your entry point" section so non-CLI users aren't gated by tooling Testing - Add scripts/run_web_generator.js — a minimal DOM-shim harness that loads web/index.html's <script> inside Node and prints kind outputs - Add tests/test_web_generator.py — 12 tests covering short/normal/long inputs across all three kinds, the [handoff] presence contract, the fold-pair on long input, and header shape. Skipped when node is not on PATH so CI without Node still passes 348 tests pass (+12). Reference validators (Python + Node) clean on examples/. No wire-format change; v=1.2 spec unchanged.
Contributor
CRUMB Bench Results
Powered by crumb-format — two-stage context compression |
Contributor
✅ Shadow AI ScanNo Shadow AI findings detected at or above medium risk. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CRUMB's two primary zero-install adoption surfaces were silently broken or stale:
web/index.html(thecrumb.new-style browser generator) emitted a TOML-style[crumb]block withv = 1.1that does not validate against either reference parser. Every user who opened the page and hit "Convert" got an invalid crumb.browser-extension/emitted valid CRUMB but was frozen atv=1.1, with no[handoff]block — i.e. missing the single most useful v1.2 primitive for "what should the next AI do?".pip install crumb-formatwall first.Net effect: the format's adoption story ("it's just copy-paste, zero install") was contradicted by the only two zero-install paths actually shipping.
What changed
web/index.htmlgenerateTask/generateMem/generateMapto emit SPEC §2.1 grammar:BEGIN CRUMB/key=valueheaders /---/ sections /END CRUMB.[handoff]primitive on task kind with action bullets inferred from TODO / should / need-to / implement phrases.[fold:context/summary]+[fold:context/full]pair when the pasted chat exceeds ~1500 chars (fold-satisfies-required per SPEC §10.3).v=1.1→v=1.2, drop TOML-stylekey = "value"quoting.window.__crumbNewso Node-side test harnesses can exercise them without a browser.browser-extension/content.js: bumpv=1.1→v=1.2in bothparseSelectionToCrumbandbuildLogCrumbFromVisibleMessages. Selection → task path now emits a[handoff]block via a newinferHandoffActionshelper.manifest.json: version1.1.0→1.2.0.README.md: note the v1.2 bump + new[handoff]extraction.README.mdpip installline. Signals the four ways in before the CLI gate.Testing
scripts/run_web_generator.js— a minimal DOM-shim Node harness that loadsweb/index.html's inline<script>, calls the three generators on stdin input, and prints kind outputs.tests/test_web_generator.py— 12 tests spanning short/normal/long-input × task/mem/map, plus dedicated contracts:[handoff]is present on task kind (the v1.2 killer feature must not regress).[fold:context/*]pair and does not coexist with plain[context].v=1.2, requiredv/kind/sourcekeys,BEGIN/ENDmarkers.nodeis not onPATHso CI without Node still passes.Results
python3 validators/validate.py examples/andnode validators/validate.js examples/both clean across all 17 example crumbs (unchanged).SPEC.md/CHANGELOG.md v0.4.0entry / example crumbs / CLI parser are all untouched. This is purely an adoption-surface fix on top of the already-shipped v1.2.Out of scope (deliberate)
CODEX_HANDOFF_0.4.0.crumb:56andREADME.md.pyproject.tomlstill 0.4.0); a patch release can be cut separately if desired.Test plan
pytest -q— 348 passedpython3 validators/validate.py examples/— all OKnode validators/validate.js examples/— all OKprintf <sample> | node scripts/run_web_generator.jsproduces valid task/mem/mapweb/index.html, paste a chat, confirm output validates viacrumb validate