release: 0.3.5 — codemap recall <query> CLI (P3-1, half 1)#16
Merged
Conversation
Lockstep version bump 0.3.4 → 0.3.5 across all 20 packages; the only
source change is in codemap-aimemory. First half of the AI-Enterprise-
Delivery-System roadmap P3-1: a deterministic recall CLI that lets
downstream tools (specode, custom Agents) pull relevant knowledge from
.ai-memory/ before drafting requirements.
New 'codemap recall' subcommand:
codemap recall '<query>' [--project <abs>] [--top-k N]
[--types rules,cases,...] [-o yaml|json]
Scans <project>/.ai-memory/knowledge/{rules,business,modules,cases,
pitfalls}/*.yml and ranks by token overlap with each yml's searchable
fields (title / tags / statement / related_code / fix / symptom / ...).
Title hits weighted higher than body hits.
Tokenizer is dependency-free: English/digit words >= 2 chars plus
Chinese char-bigrams. Good enough for the few-word query that shows up
at the requirements stage; embeddings land in P1-3.
Output (yaml or json) carries:
- query (original)
- tokens (parsed)
- matched_entities (id-based hits against _global/entities.yml)
- knowledge (top-K rows with knowledge_id / type / category / title
/ summary / score / file path)
Registered through the codemap.cli_commands entry-point group, same
mechanism as 'enrich' and 'llm'. Without codemap-aimemory installed
the subcommand simply isn't there.
Tests: 18 new in test_recall.py cover tokenizer edge cases (English /
Chinese / mixed / empty), ranking, top-k, type filter, title weight,
related_code / symptom / fix matching, malformed yml graceful skip,
matched_entities, and full output shape. Aimemory plugin: 97 -> 115.
Root and other plugins unchanged.
The companion change in pluginhub extends specode's requirements
phase to call 'codemap recall' and inject the top hits into the
"已知约束 / 历史坑" section — closing the P3-1 loop end-to-end.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: qxbyte <qiang_xue0@outlook.com>
qxbyte
added a commit
that referenced
this pull request
Jun 28, 2026
试跑发现的 3 个 onboarding 痛点一起修,都在 cli.py 加 echo + 2 个 helper: 🟢 v0.9 #15: codemap embed 首次跑(未走 install)静默下 1.2GB 模型 - 检测 config 不存在 + 默认走 local backend + 模型未 cache → echo "First-time embed... will download ~1.2GB" + 给两个 alternative (`embed install` / `backend set --provider qwen`) - 已存在 config 或模型已 cache → 不啰嗦 🟢 v0.9 #16: HF Hub 大陆超时无镜像提示 - 同样首次跑分支下,HF_ENDPOINT 未设 → echo CN mirror workaround: `export HF_ENDPOINT=https://hf-mirror.com` + HF_TOKEN - 用户已设 HF_ENDPOINT → 不啰嗦 🟢 v0.9 #5: codemap embed 空 knowledge-base 提示太隐晦 - result.n_total==0 时按 3 种 case 分别 echo: a) knowledge-base/ 不存在 → "normal for fresh project, run distill/swarm first" b) 存在但 0 个 .md → "exists but has no .md files" c) 有 .md 但切出 0 chunks → "unusual, check heading/size" 新增 helper: _model_cached(model_id) — 探 ~/.cache/huggingface/hub _emit_first_run_hints(cfg) — #15+#16 一体 _emit_zero_chunks_hint(project_root) — #5 6 regression tests in tests/test_cli_onboarding_hints.py: * 首次跑 + 模型未 cache → 1.2GB hint emitted * 同上 + HF_ENDPOINT 未设 → hf-mirror hint emitted * 已设 HF_ENDPOINT → 不 emit hint * config 存在 → 不 emit hint * 空 KB dir 不存在 → distill/swarm hint * 空 KB dir 存在但无 .md → "no .md files" hint 81/81 plugin tests pass,ruff/format/mypy clean. No version bump in this PR — lead agent merges and bumps with phase 4 release. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
qxbyte
added a commit
that referenced
this pull request
Jun 28, 2026
First plugin-only release using the new tag suffix support (publish.yml regex updated in 0.4.6 / PR #33). Lockstep 20 packages unchanged at 0.4.6 — no noop bump needed. semantic-index 0.2.1 → 0.2.2 ships: v0.9 痛点 #5 (empty KB hint) v0.9 痛点 #15 (first-run download warn) v0.9 痛点 #16 (CN HF mirror hint) + INSTALL.md / INSTALL.zh-CN.md HF mirror onboarding doc All from merged PR #35 (now on main). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-Authored-By: qxbyte <qiang_xue0@outlook.com>
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.
Summary
codemap recall '<query>'CLI incodemap-aimemorythat token-matches the user's request against<project>/.ai-memory/knowledge/*.ymland returns the top-K most relevant knowledge.specodeat the start of the requirements phase so the spec author sees prior rules / cases / pitfalls before writing.Why
AI-Enterprise-Delivery-System roadmap P3-1: "Agent terminally becomes like an old employee." Until now
.ai-memory/knowledge/was write-only — the data was there but no one queried it. This PR adds the query CLI. The pluginhub-side companion PR wiresspecodeto actually call it.This is P3-1 half 1. Half 2 (the
specodeSKILL.md change to invoke this CLI) lands inpluginhubnext.Usage
codemap recall '新增优惠券互斥规则' --top-k 3 --types rules,pitfallsOutput (yaml default):
Algorithm (v1, no embeddings)
Embeddings + freshness reranking land in P1-3 / P4-1 respectively.
Test plan
pytest plugins/codemap-aimemory/tests/— 115 passed (97 → 115; 18 new intest_recall.py)pytest tests/— 297 passedcodemap recall --helpshows the new subcommand afterpip install -eruff check+ruff format --check+mypycleanv0.3.5→ publish workflow uploads 20 packagesRoadmap progress
After this PR: P0-1/P0-2/P0-3/P0-3-follow-up/P1-2/P3-1 half 1 shipped. Next: pluginhub PR wires
specoderequirements phase to callcodemap recall.🤖 Generated with Claude Code