Skip to content

Add safe agent implant scaffold and CLI hook patch#10

Open
slavazeph-coder wants to merge 14 commits into
mainfrom
agent-implant
Open

Add safe agent implant scaffold and CLI hook patch#10
slavazeph-coder wants to merge 14 commits into
mainfrom
agent-implant

Conversation

@slavazeph-coder

Copy link
Copy Markdown
Contributor

This PR uploads the safe CRUMB-native agent implant discussed in chat.

Included in this branch:

  • cli/agent.py — safe local agent scaffold with template, run, and eval actions
  • examples/agent_experiment.json — starter experiment spec
  • patches/cli_crumb_agent.patch — exact patch to wire crumb agent ... into cli/crumb.py

Notes:

  • This is a clean-room orchestration/eval implant only.
  • It does not implement refusal-removal or guardrail-stripping behavior.
  • The branch contains the exact CLI patch needed for cli/crumb.py; the connector path used here allowed file creation cleanly, so I included the live patch file in-repo for application/review.

Suggested follow-up after merge/apply:

crumb agent template -o examples/agent_experiment.json
crumb agent run --config examples/agent_experiment.json --output-dir .runs

claude and others added 14 commits March 30, 2026 13:41
…n stats

- `crumb compress`: two-stage compression pipeline inspired by Google's
  TurboQuant. Stage 1 (PolarQuant-like) does semantic dedup, Stage 2
  (QJL-like) does signal-scored pruning. Configurable target ratio.
- `crumb bench`: gamified compression scoring — grades crumbs A-F on
  density, compressibility, structure, and conciseness (out of 100).
- `crumb inspect` now shows token cost, content density, keyword density.
- `crumb dream` now reports compression ratio after consolidation.

CLI now at 26 commands.

https://claude.ai/code/session_018rgag4FMarjfsCwLpaRXSZ
- `crumb from-git`: auto-generate task crumb from git history — recent
  commits, changed files, branch context. Instant handoff for any dev
  switching contexts mid-branch.

- CI bench action (.github/workflows/bench-pr.yml): runs `crumb bench`
  on all .crumb files in PRs, posts score table as a comment. Reusable
  workflow + copy-paste template for other repos.

- VS Code extension (vscode-extension/): command palette commands
  (new task, validate, compress, bench, "crumb it"), .crumb syntax
  highlighting, and 5 snippet templates. Ready for marketplace publish.

CLI now at 27 commands.

https://claude.ai/code/session_018rgag4FMarjfsCwLpaRXSZ
* feat: ship MeTalk and PyPI-ready crumb-format 0.2.0

* fix: install crumb-format from checkout in CI workflows

* chore: auto-generate .crumb handoff for PR #3

* fix: use local reusable bench workflow in CI template

* chore: auto-generate .crumb handoff for PR #3

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* feat: add crumb REST API for cross-AI access

* chore: auto-generate .crumb handoff for PR #4

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

CRUMB Bench Results

File Score Grade Tokens Compression
./.crumb N/A - - -
./.crumb/latest.crumb N/A - - -
./crumbs/map.crumb 79/100 B ~269 1.6x
./crumbs/mem.crumb 80/100 B ~225 1.7x
./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-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
./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 — TurboQuant-inspired context compression

@github-actions

Copy link
Copy Markdown
Contributor

CRUMB Bench Results

File Score Grade Tokens Compression
./.crumb N/A - - -
./.crumb/latest.crumb N/A - - -
./crumbs/map.crumb 79/100 B ~269 1.6x
./crumbs/mem.crumb 80/100 B ~225 1.7x
./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-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.0x
./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 — TurboQuant-inspired context compression

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1379fd4a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cli/agent.py
Comment on lines +465 to +466
def cmd_agent(args: argparse.Namespace) -> None:
action = args.agent_action

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 Badge Wire agent subcommand into live CLI parser

cmd_agent is implemented here but never reachable because this commit only ships the parser wiring as a text patch (patches/cli_crumb_agent.patch) instead of modifying cli/crumb.py itself. In the current tree, crumb --help still has no agent command, so all crumb agent template/run/eval flows described in the PR are non-functional until a separate manual patch step is done.

Useful? React with 👍 / 👎.

Comment thread cli/agent.py
Comment on lines +266 to +269
"agent": asdict(experiment.agent),
"backend": asdict(experiment.backend),
"metadata": experiment.metadata,
"seed": experiment.seed,

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 Badge Include evaluation config in run-id hash

stable_run_id hashes title/goal/context/constraints/agent/backend/metadata/seed but omits experiment.evaluation, so two experiments with different required/banned terms resolve to the same run directory and overwrite each other’s metrics.json/log artifacts. This makes run outputs non-isolated and can silently corrupt experiment comparisons when only evaluation criteria change.

Useful? React with 👍 / 👎.

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