Skip to content

Standalone CrumbLLM analysis package + ecosystem cleanup (free crumb_llm name)#36

Closed
slavazeph-coder wants to merge 3 commits into
mainfrom
claude/crumbllm-standalone-package-lhBDT
Closed

Standalone CrumbLLM analysis package + ecosystem cleanup (free crumb_llm name)#36
slavazeph-coder wants to merge 3 commits into
mainfrom
claude/crumbllm-standalone-package-lhBDT

Conversation

@slavazeph-coder

Copy link
Copy Markdown
Contributor

What this is

A new, self-contained CrumbLLM package — the local/cloud AI engine that reads CRUMB files and packs and produces summaries, risks, next actions, PR notes, and improved handoffs — plus the ecosystem cleanup needed to make it viable.

It lives in crumb-llm/ (package crumb_llm, CLI crumblm) and is ready to git subtree split into XioAISolutions/CrumbLLM (my GitHub access was scoped to crumb-format, so I couldn't push there directly — split command below).

Product boundaries (all enforced)

  • Does not copy the CRUMB spec — parses via crumb-format through crumb_llm/crumb/parser_adapter.py.
  • Does not contain IBM Bob logic — packs are read as plain directories of .crumb files (no Bob coupling).
  • Does not train by default — scratch training is opt-in (confirm=True) and torch-gated.
  • No secrets in config or any DB — setup stores only provider/model/base-url; keys come from env vars at call time.
  • Works with no cloud keys via local providers (ollama/lmstudio) or the built-in offline mock (the default).

Providers

BaseProvider.generate(prompt, max_tokens, temperature) with adapters: OpenAI (OPENAI_API_KEY), Anthropic (ANTHROPIC_API_KEY), Ollama (http://localhost:11434/api/generate), LM Studio (http://localhost:1234/v1), experimental Scratch (fails gracefully without torch/checkpoint), and a default mock. Cloud/local HTTP uses stdlib only — no SDK required.

Quality gates (never silently trust output)

JSON validity when JSON is requested · hallucinated-path detection vs. source CRUMB paths · generic/empty-answer detection. All surfaced via AnalysisResult.warnings.

Training (cannibalized from FareedKhan-dev/train-llm-from-scratch)

export_dataset (jsonl), prepare_sft (instruction/response + EOT, optional tiktoken), train_scratch (tiny decoder-only GPT + AdamW). Experimental, opt-in, no artifacts committed.

Ecosystem cleanup (the real "messy responsibilities" fix)

The existing physics/wave-field LM squatted on the crumb_llm import name and shipped inside the crumb-format distribution (requiring torch on import) — it would have collided with pip install crumb-llm. This PR renames it crumb_llmcrumb_wavelm and repoints the crumb llm sub-CLI, MCP wiring, scripts, Dockerfile.crumb-llm, configs, tests, and the standalone generator. See docs/CRUMB_ECOSYSTEM.md for the three-repo separation (crumb-format / Crumb-Bob / CrumbLLM) and remaining follow-ups.

Acceptance criteria

  • pip install -e . works (deps resolve once crumb-format ≥1.1.0 is on PyPI; locally use the editable monorepo install)
  • crumblm --help works
  • crumblm analyze examples/basic.crumb works with the default provider
  • 24 package tests pass
  • No Bob-specific logic in core modules (only boundary docstrings)
  • No models, checkpoints, or datasets committed (.gitignore blocks them)

Test status

  • New package: 24 passed.
  • crumb-format suite: 700 passed, 15 skipped (torch-gated), 2 failed. The 2 failures (TestCliVersion) are pre-existing and unrelated — they assert CRUMB 0.4.0 while pyproject declares 1.1.0; test_crumb.py is untouched by this PR.

Splitting into XioAISolutions/CrumbLLM

git subtree split --prefix=crumb-llm -b crumbllm-export
git push git@github.com:XioAISolutions/CrumbLLM.git crumbllm-export:main

🤖 Draft PR — opening for review.

https://claude.ai/code/session_01XNRzdaAb47vAm3UWVPDXyg


Generated by Claude Code

claude and others added 2 commits May 29, 2026 17:52
…_llm name

Introduce a clean, self-contained crumb-llm/ package (package crumb_llm, CLI
crumblm) that reads CRUMB files and packs and produces summaries, risks, next
actions, and improved handoffs. It depends on crumb-format for parsing/
validation, contains no spec code and no IBM Bob logic, never trains by
default, stores no secrets, and gates every result with quality checks
(JSON validity, hallucinated-path detection, generic/empty answer detection).

Providers are adapters behind one BaseProvider.generate() interface:
OpenAI, Anthropic, Ollama, LM Studio, an experimental scratch model
(cannibalized from FareedKhan-dev/train-llm-from-scratch, opt-in, torch-gated),
and a default offline mock so the package works with no keys.

Ecosystem cleanup: the existing physics/wave-field LM squatted on the
crumb_llm import name (and shipped inside the crumb-format distribution),
which collided with the new product. Rename it crumb_llm -> crumb_wavelm and
repoint the `crumb llm` sub-CLI, MCP wiring, scripts, Docker entrypoint,
configs, tests, and the standalone generator. Adds docs/CRUMB_ECOSYSTEM.md
describing the three-repo separation (crumb-format / Crumb-Bob / CrumbLLM).

Acceptance: pip install -e . works; crumblm --help works; crumblm analyze
examples/basic.crumb works with the default provider; 24 package tests pass;
no Bob-specific logic in core modules; no models/checkpoints/datasets
committed.
@github-actions

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

⚠️ Shadow AI Scan

Shadow AI Scan: 2 findings (0 critical, 2 high, 0 medium)

Risk Type Path Detail
🟠 HIGH ai_dependency crumb-llm/pyproject.toml AI SDK dependency: openai
🟠 HIGH ai_dependency crumb-llm/pyproject.toml AI SDK dependency: anthropic
Full text report
Shadow AI Scan Report
Scanned: /home/runner/work/crumb-format/crumb-format
Date: 2026-05-29 17:59:49
Total findings: 2

  HIGH      : 2

------------------------------------------------------------------------

[HIGH]
  ai_dependency    crumb-llm/pyproject.toml
                   AI SDK dependency: openai
  ai_dependency    crumb-llm/pyproject.toml
                   AI SDK dependency: anthropic

@github-actions

github-actions Bot commented May 29, 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 58/100 C ~1985 1.6x
./crumb-llm/examples/basic.crumb 79/100 B ~266 1.7x
./crumb-llm/examples/pack/session-01.crumb 82/100 B ~169 1.7x
./crumb-llm/examples/pack/session-02.crumb 81/100 B ~214 1.7x
./crumbs/map.crumb 79/100 B ~269 1.6x
./crumbs/mem.crumb 80/100 B ~225 1.7x
./examples/halo-trace-to-log.crumb 84/100 B ~155 2.0x
./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-content-ref.crumb 82/100 B ~193 1.8x
./examples/v12-delta.crumb 78/100 B ~344 1.8x
./examples/v12-fold.crumb 61/100 C ~317 1.4x
./examples/v12-handoff.crumb 80/100 B ~204 1.4x
./examples/v12-priority.crumb 79/100 B ~254 1.6x
./examples/v12-refs.crumb 82/100 B ~182 1.8x
./examples/v12-typed-content.crumb 80/100 B ~218 1.5x
./examples/v13-agent.crumb 82/100 B ~167 1.7x
./examples/v13-checks.crumb 80/100 B ~165 1.3x
./examples/v13-fold-priority.crumb 64/100 C ~223 1.4x
./examples/v13-guardrails.crumb 80/100 B ~205 1.5x
./examples/v13-handoff-deps.crumb 80/100 B ~201 1.6x
./examples/v13-script.crumb 80/100 B ~169 1.4x
./examples/v13-workflow.crumb 81/100 B ~178 1.6x
./examples/v14-handoff-deadlines.crumb 79/100 B ~290 1.7x
./examples/v14-release-gate.crumb 79/100 B ~295 1.8x
./examples/v14-typed-checks.crumb 80/100 B ~223 1.5x
./examples/wake-session.crumb 84/100 B ~195 2.2x
./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/agent-basic.crumb 80/100 B ~51 1.1x
./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
./fixtures/valid/v13-checks.crumb 81/100 B ~74 1.2x
./fixtures/valid/v13-handoff-deps.crumb 82/100 B ~93 1.3x

Powered by crumb-format — two-stage context compression

…llback

The version/banner operator commands resolved their version from installed
package metadata, returning "dev" in source-checkout CI (the validate job
runs without `pip install`). Meanwhile two TestCliVersion tests still asserted
the older 0.4.0 string, so CI was red on main independent of any feature work.

Fall back to the canonical CLI_VERSION (1.1.0) when the package isn't
installed so `crumb version` and the banner are stable across environments,
and update the two stale assertions to 1.1.0.

Copy link
Copy Markdown
Contributor Author

Superseded — CrumbLLM now lives in its own standalone repository: https://github.com/XioAISolutions/CrumbLLM (released as v0.1.0).

The standalone package no longer depends on crumb-format at runtime: it bundles its own CRUMB v1.1–v1.4 reader, so pip install crumb-llm has zero required dependencies. crumb-format remains available as an optional extra (crumb-llm[crumb-format]) and is preferred when installed.

Closing this PR to keep a single source of truth in the CrumbLLM repo. The crumb-llm/ subdirectory was never merged into crumb-format (it only ever existed on this PR branch), so nothing needs to be removed from main.

Follow-up for whoever prepares crumb-format for PyPI: crumb-format still bundles a top-level crumb_llm module of its own. Before both are on PyPI, that module should be dropped/renamed in crumb-format to avoid an import collision with the standalone crumb-llm package.


Generated by Claude Code

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