Skip to content

研究 skill 系统 2026-07 演进:审查加固 + evidence-first 五子系统 + 自更新 + workspace bundle#1

Merged
caozx1110 merged 257 commits into
mainfrom
feat/skill-bundle-and-hardening-2026-07
Jul 17, 2026
Merged

研究 skill 系统 2026-07 演进:审查加固 + evidence-first 五子系统 + 自更新 + workspace bundle#1
caozx1110 merged 257 commits into
mainfrom
feat/skill-bundle-and-hardening-2026-07

Conversation

@caozx1110

Copy link
Copy Markdown
Owner

本 PR 汇总 2026-07 一整条演进线(256 commits,全部经 SSOT-first 设计 → codex 施工 → 独立验收 → 回写循环),最终套件 405 passed。真实 kb/ 用户数据全程零改动;每一波带撤销点 tag。

采纳 codex 全系统审查

  • 用 6 个并行 agent 逐条独立复现审查声明(~15 真、~5 措辞夸大缺陷真、0 假警报)后才施工。
  • 新增 原则 8(用户契约):skill 用户可见输出只含自然语言 + kb <verb>,无裸命令/--flag/${…}/内部路径/NEXT FOR AGENT;伪 CLI 不依赖 TTY。

P0/P1 + 三大契约

  • ConfirmationReceipt:确认绑定内容/evidence digest,内容变更自动失效,保留 epistemic 类型,判断轨写入门 fail-closed。
  • 恢复合同:原子写 + operation journal + revision/CAS + kb undo/kb restore/kb resume
  • Workbench 安全:强制回环 + 写保护 raw + token 鉴权 + PTY 默认关。
  • 热修:中文检索 tokenizer、status 误建 program、kb next 吞参、输出清洗、installer PDF backend。

你追加的两点

  • kb init 偏好设置改 agent 中介问答 + headless 落盘(修 isatty 静默跳过)。
  • 全 verb 用户可见输出清掉裸命令(实机扫描逐 verb 验证)。

scaffold → evidence-first(五子系统实质闭环)

survey / idea 陪练 / method(读资源缩放矩阵)/ experiment(强类型指标 + 验 artifact + baseline 对比)/ report(自包含 + outline),全部改成 paper.py 式 prepare/verify + 逐字证据。成熟度 scaffold→beta。

per-paper-type element sets

初筛 agent 分类 paper_type + 3 套要素集(method_system/benchmark/survey),未知兜底。

自更新 + 版本号

.agents/VERSION(0.1.0) + updater.py + kb update(check 默认、agent 中介 apply、只 fetch/pull --ff-only/clone、绝不 push)+ kb doctor 显示版本。

multi-skill workspace bundle(8 点规格)

  • install-UX:中文数字向导、install/update/uninstall/reinstall、非法输入重问。
  • allowlistgit ls-files tracked-only,排除 tests/eval/validator);合并式安装(保留用户自带 skill + AGENTS.md prose,managed-block);原子无半安装;错误 cwd 拒写不回退源仓。
  • 卫生:Navigator 硬编码 slug 解耦;skill_validator.py 过全 17 skill;公开面清 temp/ 引用;SKILL.md 示例 KB 耦合解耦。
  • manifest version 字段落盘(install/update/reinstall 三处)。
  • CI 跑 validator + bundle lifecycle 测试。

验收纪律

每一波独立复现承重声明(实机跑 prepare/verify 证明证据门拦得住编造、实机驱动 install/uninstall 证明 kb 保留),从不 merge-on-summary。撤销点 tag pre-*-merge-20260717 覆盖每个 merge 点。

🤖 Generated with Claude Code

caozx1110 and others added 30 commits July 4, 2026 21:01
Intentional behavior fix for B9: confirmed transitions now require confirmed-by/evidence and persist confirmation provenance.
F1: add lightweight retrieval ranking over record fields, payload leaves, and unit markdown; search_records now returns score-sorted hits.
Follow-up to the Top-6 commits (dbf6d7f..b5dc066) after an adversarial
review (7 units, 18 findings, 0 blockers). Fixes the should-fix + cheap
correctness items found:

- docs: repo-analyst/blog-analyst SKILL.md confirm examples now include the
  B9-required --confirmed-by/--evidence (the documented commands previously
  failed argparse).
- fix: require_confirmation_provenance accepts a bare-string evidence value
  instead of silently treating it as empty (list|str hint is now honest).
- fix: kb.py review_sort_key orders by the true instant (parsed.timestamp())
  rather than the isoformat string, so mixed-offset timestamps sort correctly.
- test: add non-regression guard (auto_confirmed/pending/rejected still promote
  without provenance) + bare-string evidence acceptance.
- docs: SCHEMAS.md documents the new confirmation{by,at,evidence,method} field
  and the confirm-provenance gate rule.
- plan: OPTIMIZATION_PLAN.md marks Top 6 done (F1 partial: persistent index +
  alias deferred), records the review outcome and remaining test-coverage nits.

56 tests pass; all skill scripts compile.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Document what the workspace can actually do now, grounded in the real
argparse CLI surface (every documented command validated via --help):

- New docs/FEATURES.md: a task-oriented, plain-language tour of all 16
  skills' capabilities, each with a one-line how-to and the principle
  behind it, plus the 3 core mental models (knowledge-unit-first,
  confirmation gate, program orchestration) and a directory map.
- Highlights the round-4 additions (review-queue confirmation inbox,
  confirmation provenance, program dashboard/next, workflow lifecycle
  commands, ranked full-text search).
- README: link FEATURES from Start Here.
- SKILLS_GUIDE: refresh the CLI cheatsheet with the new commands and the
  confirm-provenance flags; note the confirmation-inbox workflow.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- docs/RESEARCH_WORKFLOW.md: user-facing "what you do vs what the system
  does" guide — how to expand the KB, iterate ideas, iterate method/
  experiments, and form a complete research output, framed around the
  four things only the user can do (provide sources, confirm, decide,
  give experiment feedback).
- docs/GETTING_STARTED.md: add the missing "Step 0: run kb.py init" —
  onboarding docs previously never mentioned initialization (a first-run
  cliff for new users).
- README: link both new docs from Start Here.
- OPTIMIZATION_PLAN.md Part C: a UX/usability audit (7 user-journey
  friction lenses) validating "too much manual operation" with grounded
  evidence (batch-confirm absent → 54 required inputs/week; exact hash-id
  hand-carried across skills; empty-kb dead-ends), a 4-way burden
  taxonomy, ranked improvements, Top 5, and a north-star direction.

No code behavior changed; docs + plan only.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Records the outcome of reviewing Codex's Top-5 UX commits and folds in the
end-to-end user-simulation report:
- R1-R6: must-fix defects in the Top-5 implementation (wikilink-lookup
  regression via widened fuzzy locate_record; batch-confirm parity +
  pending-guard; last/current ordering + case-insensitive id prefix + dead
  param; confirm_command triplication; SCHEMAS default-confirmer doc;
  --all-reviewed limit misnomer).
- S1-S7: adopted findings from docs/RESEARCH_SKILLS_UX_SIMULATION_2026-07-04.md
  (idea select confirmation-semantics P0; sandbox --root safety P1; polished
  weekly renderer; next-step navigator; synthesizer fuzzy recall; paper-note
  coverage/reading-status; repo readiness grading).
- Governance red line verified intact (evidence required; auto never self-signs).
Next Codex batch scoped to R1-R6 + S1 + S2; S3-S7 adopted for a later batch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Adversarial review of R1-R6+S1+S2 (90 tests, 0 blockers, governance verified
intact). Records the F-group follow-ups: F1 orchestrate-auto must thread
--root/RESEARCH_PROJECT_ROOT to its subprocess children (S2 gap in its own
fan-out); F2 kb-browser scripts expose --project-root not --root; F3 add the
missing end-to-end test pinning the empty-evidence batch-confirm rejection
(governance red line); F4 test-strengthening nits.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
§18: agreed design (with user) for a lightweight capture→recall→promote
memory that extends skill-evolution-advisor. Two audiences (skill-defect =
record-only for user review, agent never auto-changes skills; user-preference
/recurring-issue = agent memory). Confirmation-gated; recall surfaced at
session start; confirmed prefs promoted into runtime-preferences.

§19: necessity triage of all outstanding plan items into DO-NOW (must-fix +
pure-positive low-risk cleanup/tests) vs HOLD-for-user (large refactors, new
features, behavior-changing items).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
caozx1110 and others added 25 commits July 17, 2026 17:55
Verified: 384 green; reporting_style read from user-profile (config.py untouched):
详细=20 events/32 lines vs 简洁=5 events/17 lines, missing-markers preserved in both;
diagnosis evidence verified against own run artifacts (valid passes, fabricated
'not verbatim' rejected), claimless diagnosis still works. Gates untouched. Real kb/ untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
….1.0)

Verified: 393 green; NO push anywhere (fetch/pull --ff-only/clone --depth only);
offline-safe (status unknown, no crash); kb update check-only default, apply
agent-mediated (NEXT FOR AGENT, never auto-applies); user output natural-language
only (no raw commands); kb doctor shows skill_version; install.sh/ws_sync.py
UNTOUCHED (invoked, not edited); real kb/ untouched. manifest version field
deferred (install-UX track in flight).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…earer scope/confirm/finish

Verified (acceptance): bash -n OK, git diff --check clean, test_installer.py 9/9,
full suite 400 green; drove install/update/uninstall on a temp workspace — .agents
+ manifest land, update non-destructive, uninstall removes managed config while
kb/ + .venv/ + user files survive; duplicate install cleanly rejected (use update).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…all + atomic + source/target

Verified independently on temp workspaces: allowlist ships only skills+lib(no tests)+
VERSION+LICENSE, EXCLUDES tests/ + eval_research_value.py + untracked (git ls-files);
merge-install preserves user's own skill + AGENTS.md prose (managed block); wrong-cwd
non-interactive REFUSES without touching source repo (0 dirty); reinstall + update +
uninstall all preserve kb/.venv/user files; no half-install (rollback). 404 green.
Real kb/ untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…a + docs reposition + temp scrub + CI

Verified: 405 green; skill_validator exits 0 over all 17 skills (blog-analyst 274->130
char description fixed; 25-64 short_description cap); Navigator hardcoded slug removed
(kb.js title.trim() fallback); public temp/ refs scrubbed (README->SCHEMAS.md, evidence.py
docstring, skill-evolution SKILL.md dev-eval section removed); KB coupling in SKILL.md
examples decoupled (p-openvla->p-example, czx->research-lead) — metadata/example only, no
skill logic/triggers changed; residual temp/ ref only in eval_research_value.py which is
allowlist-EXCLUDED from installs. install.sh/ws_sync untouched. CI runs validator. Real kb/ untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Found in whole-bundle acceptance: skill_validator.py (dev/CI tool, not imported by
any runtime skill) shipped because the allowlist includes .agents/lib/research/
wholesale. Added to EXCLUDED_NAMES alongside eval_research_value.py. updater.py stays
(runtime — kb update uses it). Verified: fresh install excludes validator, keeps
updater, 17 skills, 405 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The deferred 3.15 item: manifest now stamps the bundle semver (read from
source .agents/VERSION) alongside source_commit, for local display/provenance
without a fetch. schema stays 1 (additive — existing manifests still load; the
field is optional on read). Wired at all 3 build_manifest call sites
(install/update/reinstall) via read_source_version helper. Verified: fresh
install records 0.1.0, update + reinstall preserve it, 405 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 17, 2026 12:53

Copilot AI 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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Two CI-only failures (all 9 pass locally):
1. 4 git-checkpoint tests failed with 'empty ident name' — CI runner has no git
   identity. Added a git config step.
2. 5 installer PTY tests failed 'prompt not found' — install.sh's
   is_interactive_input() correctly returns false when $CI is set (real-CI safety
   guard), so the wizard was skipped under GitHub's CI=true even with a real PTY.
   Run pytest with 'env -u CI' for that step only; the guard itself is unchanged.

Verified locally: git-identity set + CI unset -> all 9 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@caozx1110
caozx1110 merged commit 339ea15 into main Jul 17, 2026
6 checks passed
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