Skip to content

fix(web,ext): zero-install surfaces emit spec-valid v=1.2 CRUMB#14

Draft
slavazeph-coder wants to merge 2 commits into
mainfrom
claude/weavemind-crumb-integration-gnv4f
Draft

fix(web,ext): zero-install surfaces emit spec-valid v=1.2 CRUMB#14
slavazeph-coder wants to merge 2 commits into
mainfrom
claude/weavemind-crumb-integration-gnv4f

Conversation

@slavazeph-coder

Copy link
Copy Markdown
Contributor

Why

CRUMB's two primary zero-install adoption surfaces were silently broken or stale:

  • web/index.html (the crumb.new-style browser generator) emitted a TOML-style [crumb] block with v = 1.1 that 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 at v=1.1, with no [handoff] block — i.e. missing the single most useful v1.2 primitive for "what should the next AI do?".
  • Neither surface is discoverable from the top-level README; new users hit the pip install crumb-format wall 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.html

  • Rewrite generateTask / generateMem / generateMap to emit SPEC §2.1 grammar: BEGIN CRUMB / key=value headers / --- / sections / END CRUMB.
  • Emit the v1.2 [handoff] primitive on task kind with action bullets inferred from TODO / should / need-to / implement phrases.
  • Emit a [fold:context/summary] + [fold:context/full] pair when the pasted chat exceeds ~1500 chars (fold-satisfies-required per SPEC §10.3).
  • Bump emitted v=1.1v=1.2, drop TOML-style key = "value" quoting.
  • Expose pure generators on window.__crumbNew so Node-side test harnesses can exercise them without a browser.

browser-extension/

  • content.js: bump v=1.1v=1.2 in both parseSelectionToCrumb and buildLogCrumbFromVisibleMessages. Selection → task path now emits a [handoff] block via a new inferHandoffActions helper.
  • manifest.json: version 1.1.01.2.0.
  • README.md: note the v1.2 bump + new [handoff] extraction.

README.md

  • New "Pick your entry point — no install required" table lifting web, browser-extension, system-prompt paste, and VS Code above the pip install line. Signals the four ways in before the CLI gate.

Testing

  • scripts/run_web_generator.js — a minimal DOM-shim Node harness that loads web/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).
    • Long input produces the [fold:context/*] pair and does not coexist with plain [context].
    • Headers are spec-shape: v=1.2, required v/kind/source keys, BEGIN/END markers.
    • Skipped when node is not on PATH so CI without Node still passes.

Results

  • 348 tests pass (was 336; +12 new).
  • python3 validators/validate.py examples/ and node validators/validate.js examples/ both clean across all 17 example crumbs (unchanged).
  • No wire-format change. SPEC.md / CHANGELOG.md v0.4.0 entry / 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)

  • No bridge code to Weft / WeaveMind / LangGraph / n8n — preserves the standalone-posture decision documented in CODEX_HANDOFF_0.4.0.crumb:56 and README.md.
  • No version bump of the Python package (pyproject.toml still 0.4.0); a patch release can be cut separately if desired.

Test plan

  • pytest -q — 348 passed
  • python3 validators/validate.py examples/ — all OK
  • node validators/validate.js examples/ — all OK
  • Manual: printf <sample> | node scripts/run_web_generator.js produces valid task/mem/map
  • Manual browser check: open web/index.html, paste a chat, confirm output validates via crumb validate
  • Manual extension check: load unpacked, click Copy as CRUMB on a ChatGPT thread, confirm output validates

claude and others added 2 commits April 19, 2026 04:09
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.
@github-actions

github-actions Bot commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

CRUMB Bench Results

File Score Grade Tokens Compression
./.crumb N/A - - -
./.crumb/latest.crumb N/A - - -
./CODEX_HANDOFF_0.4.0.crumb N/A - - -
./crumbs/map.crumb 79/100 B ~269 1.6x
./crumbs/mem.crumb 80/100 B ~225 1.7x
./examples/log-deployment.crumb 84/100 B ~147 2.0x
./examples/map-client-takeover.crumb 78/100 B ~290 1.6x
./examples/map-repo-onboarding.crumb 82/100 B ~166 1.7x
./examples/mem-mempalace-auth-migration.crumb 87/100 A ~120 2.5x
./examples/mem-terse-output.crumb 77/100 B ~336 1.6x
./examples/mem-user-preferences.crumb 83/100 B ~135 1.8x
./examples/task-bug-fix.crumb 83/100 B ~127 1.7x
./examples/task-content-repurpose-handoff.crumb 80/100 B ~250 1.7x
./examples/task-cross-tool-feature-handoff.crumb 79/100 B ~249 1.6x
./examples/task-feature-continuation.crumb 82/100 B ~134 1.7x
./examples/task-packed-auth-context.crumb 82/100 B ~233 2.1x
./examples/todo-sprint.crumb 84/100 B ~90 1.7x
./examples/v12-fold.crumb N/A - - -
./examples/v12-handoff.crumb N/A - - -
./examples/v12-refs.crumb N/A - - -
./examples/v12-typed-content.crumb N/A - - -
./examples/wake-session.crumb N/A - - -
./fixtures/extensions/mempalace-export.crumb 86/100 A ~102 2.3x
./fixtures/extensions/task-packed.crumb 85/100 B ~157 2.3x
./fixtures/invalid/bad-kind.crumb N/A - - -
./fixtures/invalid/missing-source.crumb N/A - - -
./fixtures/valid/log-basic.crumb 82/100 B ~51 1.4x
./fixtures/valid/mem-basic.crumb 81/100 B ~42 1.2x
./fixtures/valid/task-basic.crumb 81/100 B ~65 1.2x

Powered by crumb-format — two-stage context compression

@github-actions

Copy link
Copy Markdown
Contributor

✅ Shadow AI Scan

No Shadow AI findings detected at or above medium risk.

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