Val-sss
c32e423d04
feat: v1.9.0 — 9项架构优化,工程消化反馈替代raw输出注入
...
核心思路:32B模型无法有效整合raw pytest输出,工程把反馈解析成
LLM最容易理解的形式(结构化诊断句),同时加入执行反馈内循环、
docstring注入、批次拆解等机制提升通过率。
9项改动:
1. generate_diagnosis() 结构化诊断句
2. _run_execution_feedback() 内循环
3. usage_finder.py 调用关系注入
4. _extract_docstrings() + _inject_docstrings()
5. _maybe_create_missing_module() LLM生成缺失模块
6. _run_whole_file_refactor() 批次拆解
7. _build_retry_hint() delta反馈
8. _clean_code_output() 格式清理(已覆盖)
9. _inject_skill_context() SKILL.md注入
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-09 18:38:03 +08:00
Val-sss
3c5441d6c4
docs: STATUS.md 更新到 v1.7.0
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-07 18:30:56 +08:00
Val-sss
ca55970ad8
release: v1.6.2 版本号统一 + README/CHANGELOG/STATUS更新
...
- 版本号统一到1.6.2(pyproject/__init__/formatters/telemetry/server)
- README: badge 1.6.2, License Apache-2.0, 更新日志加v1.6.2条目
- CHANGELOG: 完整v1.6.2变更记录
- STATUS: 当前版本更新到v1.6.2
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-07 14:42:21 +08:00
Val-sss
fa1390f8a9
release: v1.6.1 版本号统一 + README/STATUS更新 + License Apache-2.0
...
- pyproject.toml/formatters/telemetry/server/models/__init__ 全部统一到 1.6.1
- README: badge更新、更新日志加v1.6.0/v1.6.1条目
- STATUS: 版本号描述更新
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-07 09:23:19 +08:00
Val-sss
2d7abc8dda
v1.6.1: 删除WholeFileImplExpert/DependencyFixExpert,架构收敛到纯pipeline
...
- 存根实现由Generator通过ctx.gap scope=whole_file处理
- 依赖安装由EnvProber在Phase0处理
- Generator增强:upstream_constraints注入system prompt + retry_hint携带上次代码 + tier=small填空框架
- 513 tests green
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-07 08:38:14 +08:00
Val-sss
8f1cbe1f07
feat: MoE deterministic architecture v1.6.0
...
GapDetector + ExecutionStateTracker + EnvProber + enhanced audit logging.
Generator dynamically lifts function cap based on gap scope (stub tasks
no longer limited to 2 functions). Gate rewritten with deterministic-first
routing (gap → keywords → LLM fallback). 514 tests green + 63 diagnostic.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-07 08:16:25 +08:00
Val-sss
4bdd32bf00
docs: update STATUS with Reviewer/Verifier/syntax fixes
2026-05-07 03:01:03 +08:00
Val-sss
1a6f6c635f
feat: Test-First Loop — pre-test locating + toolchain auto-install + 0/0 fix
...
Architecture change (CC-style test-first loop):
- orchestrator: pre-test before locator for repair/refactor tasks
verifier.run_tests_only() → ctx.initial_test_failure → locator reads it
- locator.locate_from_test_error(): extract File+line+function from test output
Priority: test_error > BM25+graph > LLM fallback
Skips test files and stdlib, only returns business code
Verifier P0 fixes:
- Test file discovery: scan *_test.py/test_*.py/*_test.go/*.test.ts recursively
(was: only check tests/ directory → 0/0 false success on 36 tasks)
- When test files found outside tests/, run pytest with file paths directly
- Toolchain auto-install: go/node/rust/java not found → apt-get install
(was: report as syntax error → useless retries → circuit break)
- Go syntax: "not found" → skip (not syntax error)
501 tests green, 0 regression.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 22:01:09 +08:00
Val-sss
892e8062bc
release: v1.5.1 — update docs, fix remaining audit issues
...
- GENERATOR_PROMPT: negative indent instruction → positive ("必须4空格,与原文件完全一致")
- ast_grep_engine: json.loads wrapped in try/except (5th JSON protection)
- STATUS.md: updated to reflect all v1.5.1 features (501 tests)
- CHANGELOG.md: full v1.5.1 release notes (flywheel, telemetry, hashline, adaptthink, audit, model_capability)
- README.md: version badge 1.5.1, updated changelog table
501 tests green, 0 regression.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 21:11:45 +08:00
Val-sss
7b61af7be3
feat: audit log + model cmd + indent alignment fix
...
Audit log (audit/logger.py):
- Persists task execution trace as human-readable JSON
- Storage: ~/.kaiwu/logs/, max 100, auto-cleanup
- Records: task, gate, experts, files, tests, retries (no code content)
- orchestrator._emit() now instance method, auto-logs to audit
- CLI: kwcode log / log show <id> / log clear
Model commands (cli/commands/model_cmd.py):
- kwcode model: show current config + tier
- kwcode model set <name>: switch model (writes config.yaml)
- kwcode model probe: detect family/params/quant/reasoning via Ollama API
Indent alignment fix (Generator._align_indentation):
- Fixes systematic bug: LLM returns class methods at 0-indent,
apply_patch replaces 4-indent original → method escapes class
- Aligns modified base indent to match original before apply_patch
Tests: 10 new (audit 4 + indent 5 + hashline prompt 1), 50 total green
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 20:13:26 +08:00
Val-sss
129eed76d0
feat: P0 Hashline anchors + P1 AdaptThink + P2 Fast/Slow dual-phase
...
P0 Hashline (tools/hashline.py):
- Content-hash anchored editing: 6-char MD5 per line
- Model outputs EDIT/DELETE/INSERT_AFTER instructions, not full functions
- Hash mismatch → reject entire edit batch (stale file protection)
- Generator tries hashline first, falls back to full-function on failure
P1 AdaptThink (core/think_config.py):
- Gate-driven think budget per expert_type × difficulty
- easy=off, medium=512, hard=2048-4096, chat=always off
- Generator adjusts max_tokens based on think_config
P2 Fast/Slow (orchestrator retry loop):
- First attempt: fast (think=off, low tokens)
- First failure: escalate to slow (think=on, budget=2048)
- Second failure: max budget (4096)
- Orthogonal to retry_strategy (0→1→2)
Tests: 21 new (12 hashline + 8 think + 1 fast/slow), 40 total green
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 20:00:11 +08:00
Val-sss
9a7f13dd60
docs: update STATUS.md with telemetry guards + version unification
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 19:51:07 +08:00
Val-sss
53c08a4e28
feat: three flywheels + anonymous telemetry + prompt quantification
...
Flywheel system (all local):
- strategy_stats.py: error strategy effectiveness tracking per error_type
- user_pattern_memory.py: cross-project user error pattern warnings
- skill_drafter.py: auto-generate SKILL.md drafts from stats
Anonymous telemetry (opt-in, default off):
- telemetry/client.py: HMAC-signed fire-and-forget upload
- Only sends: error_type, retry_count, success, model
- Never sends: code, paths, descriptions, user identity
- onboarding asks opt-in, kwcode telemetry enable/disable
CLI commands:
- kwcode telemetry status/enable/disable
- kwcode skill review/accept/discard
- kwcode stats: enhanced with flywheel + telemetry status
Prompt quantification (CC-style):
- GENERATOR_BASE_SYSTEM: "only do what's asked" → "≤2 functions, ≤30 lines"
- RETRY_STRATEGIES hints: quantified line limits per error type
- CHAT_SYSTEM: "short friendly" → "≤100 chars, ≤3 sentences"
Server deployed: https://llmbbs.com (nginx → uvicorn:9753, 3 SQLite tables)
Tests: 19 new, 0 regression
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 19:39:17 +08:00
Val-sss
cfe5cc6d3f
docs: update STATUS.md with current progress
...
- 67 bench tasks (Python/Go/TS) added
- CLI file structure updated (commands/ split)
- TODO list updated with completed items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 18:57:20 +08:00
Val-sss
4856d3a617
docs: mark TODO items 1-3 as completed in STATUS.md
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 18:04:00 +08:00
Val-sss
d5ce4342f6
v1.5.0: SearchSubagent isolated search + UpstreamManifest cross-file contracts
...
Architecture upgrade to improve task completion for any model size:
- SearchSubagent: independent context window, parallel file reads, clean results only
- UpstreamManifest: deterministic AST extraction of signatures/constants, zero LLM
- PENCIL-style compression: subtask results compacted to structured artifacts
- Verifier pre-check: cross-file contract consistency before running tests
- Generator context slimmed: upstream_constraints + retry_hint injection
Code quality:
- orchestrator.py run() split into 5 private methods (410->253 lines)
- Full type annotations (Optional[DebugSubagent], Callable types)
- __all__ added to 7 core modules
- pyproject.toml: license fixed, ruff + mypy configured
- TUI: 30+ event icons, Server: /api/manifest endpoint
- STATUS.md rewritten: concise, English, professional format
451/451 tests green, 27 new tests for SearchSubagent+Manifest.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 17:08:08 +08:00
Val-sss
a502c9db63
feat: v1.4.0 多语言AST + FastAPI Server + Textual TUI + VSCode插件
...
三个模块按顺序实施,424测试全绿:
模块A - 多语言支持:
- ast-grep预定义模板查询(LLM只填参数不写pattern)
- TreeSitterParser扩展支持JS/TS/Go/Rust/Java(可选依赖)
- 多语言Verifier(jest/go test/cargo test/mvn test)
- 4个新SKILL.md(golang/typescript/rust/java)
模块B - Server + TUI:
- FastAPI + SSE事件流,端口7355
- kwcode serve命令 + kwcode --tui选项
- Textual TUI(文件树+事件流+输入框)
- pipeline_factory共享构建
模块C - VSCode插件:
- 薄客户端连接kwcode server
- SSE事件流 + Webview面板
- 文件保存触发RIG刷新
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 14:57:16 +08:00
Val-sss
0f3c9e6e61
feat: v1.3.0 架构升级 — EventBus/ToolGateway/错误策略路由/认知门控/渐进压缩/Wink自修复/SearchRouter
...
10个模块实现:
- EventBus 统一事件总线(append-only日志+replay)
- ToolGateway 专家权限隔离(deny-first+文件缓存)
- 错误策略路由(按error_type切换重试序列+import_fixer确定性修复)
- CognitiveGate 认知门控(patch行数递减检测边际收益递减)
- GraduatedCompactor 3层渐进压缩(70%/85%/95%)
- Plan自动触发(hard任务自动生成计划)
- Worktree隔离(/multi并行任务文件隔离)
- Speculative Prefetch(Locator后台预读文件)
- SearchRouter意图感知搜索(arxiv/S2/GitHub/PyPI/Open-Meteo零key)
- Wink自修复监控(偏离检测+课程纠正)
搜索层网络保护:
- DDG为主SearXNG可选,不自动拉Docker
- search_enabled开关,内网用户可完全禁用网络请求
- 所有搜索异常静默处理不阻塞流水线
357/357 tests passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 13:39:00 +08:00
Val-sss
955768f364
docs: update STATUS.md with P2 completion
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 12:10:16 +08:00
Val-sss
ce8646f57e
feat: P0+P1 optimization — circuit breaker, gate confidence, experience replay, session state
...
- P0-1: Verifier structured error output (error_type/file/line/message extraction)
- P0-2: Circuit breaker + scope narrowing (syntax/import fast-break, 3x same-error hard-break, auto-narrow on 2nd failure)
- P0-3: Gate confidence estimation (keyword signal scoring, low-confidence retry reduction)
- P1-1: Experience Replay via BM25 trajectory similarity search
- P1-2: SessionState multi-turn coherence + attention decay countermeasure
- P1-3: Locator minimal context extraction (function boundary detection, comment stripping, 60-line cap)
- Add CONTRIBUTING.md with architecture red lines and PR standards
- Update README contributing section with quick reference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-05-06 11:39:45 +08:00
Val-sss
56b9c1e7da
docs: update STATUS.md to v0.9.0, document architecture corrections
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-29 13:19:58 +08:00
Val-sss
7f2f74fbb6
feat: DAG task compiler + prompt optimizer, remove Python expert system
...
- Add TaskCompiler (kaiwu/core/task_compiler.py): lightweight DAG scheduler
with ThreadPoolExecutor + topological sort for serial/parallel multi-task
- Add PromptOptimizer (kaiwu/flywheel/prompt_optimizer.py): analyzes trajectories
via Opus/Sonnet API, appends learned rules to expert YAML system_prompt
- Add Cross-Encoder reranker (kaiwu/search/reranker.py): optional BM25+CE pipeline
- Add Reflexion persistence (kaiwu/memory/pattern_md.py): REFLECTION.md structured
pattern memory with /plan integration
- Remove Python expert system (ExpertBase, BugFixExpert.py, SelfImprovingOptimizer)
- Revert registry to YAML-only loading
- Remove _get_python_expert/_run_python_expert from orchestrator
- Replace run_self_improvement with run_prompt_optimization in ab_tester
- 277 tests passing (265 regression + 12 new task_compiler tests)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-29 11:12:13 +08:00
Val-sss
9a460d6837
update STATUS.md: comprehensive v0.7.0 progress summary
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-29 00:22:48 +08:00
Val-sss
c6197d0316
v0.7.0: P1+P2+搜索重构+UI全面优化
...
P1: KWCODE.md规则注入、/plan风险评估、Checkpoint快照、DocReader
P2: 模型能力自适应、飞轮通知、价值量化仪表盘
搜索: 四级提取管道、并行搜索+BM25重排、意图感知、ChatExpert门控
UI: spinner动画、结果摘要、静默日志、重影大字Header
新增: kwcode setup-search 一键安装SearXNG
测试: 282/282 PASS (含17个E2E真实模型测试)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-28 17:52:59 +08:00
Val-sss
65cdf9818f
Flywheel E2E verified: 5 tasks → pattern → expert gen → 3 gates → lifecycle
...
Full flywheel loop confirmed:
- 5 same-type trajectories trigger pattern detection (gate 1)
- LLM generates expert YAML from trajectories (gemma3:4b)
- Gate 2 backtest passes (valid YAML + matching pipeline)
- Expert registered with lifecycle=new
- 6 successes → mature, 10 failures → declining
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-27 10:05:46 +08:00
Val-sss
432177424d
Update STATUS: CLI rename kwqode complete
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-27 10:03:09 +08:00
Val-sss
61e7efcc32
Update STATUS: China network optimization complete
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-27 09:49:52 +08:00
Val-sss
2f28793018
Update STATUS: all spec v4 steps complete
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-27 01:14:18 +08:00
Val-sss
44cb2690cd
Expert benchmark framework + validation results
...
BugFixExpert: 5/5 = 100% (avg 3.2s, gemma3:4b)
TestGenExpert: 3/5 = 60% (codegen pipeline needs improvement for new file generation)
Known issue: Generator's "read original → generate modified" design
doesn't handle pure new-file creation well. Needs codegen-specific
generation path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-27 00:47:57 +08:00
Val-sss
ef7b0b402c
AST engine + V5 validation: tree-sitter call graph +50pp over LLM guessing
...
New module kaiwu/ast_engine/:
- parser.py: tree-sitter Python parser, extracts functions + calls
- call_graph.py: dict-based call graph with BFS expansion
- locator.py: ASTLocator using call graph for function-level location
V5 results (gemma3:4b, 10 cases):
- Group A (LLM): file 100%, function 50%, avg 2.5s/case
- Group B (AST): file 100%, function 100%, avg 0.05s/case
- Improvement: +50pp function accuracy, 50x faster
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-27 00:36:32 +08:00
Val-sss
235ecd2928
V6 expert generation validation: gemma4:e2b 3/3 PASS
...
- gemma3:4b: 1/3 (small model struggles with complex JSON generation)
- gemma4:e2b: 3/3 (FastAPI CRUD, pytest fixture, DB migration all pass)
- All generated experts have valid structure, keywords, and pipelines
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-27 00:22:31 +08:00
Val-sss
5668419bdf
Kaiwu v0.4: expert registry, flywheel, 3-layer memory, MCP router
...
Major additions:
- Expert registry with 12 builtin experts (keyword matching, lifecycle)
- 3-layer memory system (PROJECT.md / EXPERT.md / PATTERN.md)
- Expert flywheel (trajectory → pattern → generate → 3-gate → lifecycle)
- Expert packaging (.kwx import/export)
- KaiwuMCP Router (single kaiwu_execute tool)
- CLI subcommands: expert list/info/export/install/remove/create, status, serve-mcp
- V5/V6 validation script frameworks
- Install scripts (install.ps1 + install.sh) with Chinese mirror support
- README_zh.md Chinese documentation
Verified: 24/24 tests pass, E2E fibonacci bug fix (gemma3:4b, 22.4s),
10/10 CORE red line constraints satisfied, Windows cmd native OK.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-27 00:18:04 +08:00
Val-sss
7cebdba70d
Update STATUS: all planned features complete
...
14 commits, ~4500 LOC. All core features verified:
- MoE pipeline, REPL CLI, 6-step search, AST locator
- Symbol index, think=false perf opt, multi-lang support
- E2E: gemma3:4b 5.7s, gemma4:e2b 19.3s, both 5/5 tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-26 23:09:00 +08:00
Val-sss
ae07472789
Disable thinking for short-output tasks: gemma4 64.9s → 19.3s (3.4x)
...
Reasoning models now use think=false for classification tasks
(max_tokens <= 500: Gate, Locator file/func selection).
Generator (max_tokens=2048) keeps thinking for code quality.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-26 23:07:24 +08:00
Val-sss
2cf9e6c431
Update STATUS: gemma4 validation results, remaining TODOs
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-26 22:57:09 +08:00
Val-sss
b92daefc6f
Update STATUS: multi-file E2E pass, codegen limitation noted
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-26 22:18:35 +08:00
Val-sss
1375c136fc
Update STATUS.md: REPL + AST locator + SO API done
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-26 22:11:35 +08:00
Val-sss
e8fb2c853e
Update STATUS.md with search module results and lessons learned
...
Added V4 validation results, search architecture diagram,
trafilatura timeout and SO 403 pitfalls.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-26 19:56:30 +08:00
Val-sss
363d5dce36
Kaiwu v3 MVP: deterministic expert pipeline for local-model coding agent
...
Gate(JSON routing) → Locator → Generator → Verifier → KAIWU.md memory.
E2E validated with gemma3:4b (5.7s, 5/5 tests passed).
V1 Gate: 100% JSON parse rate. V3 Locator: 90% file accuracy.
Reasoning model compat (deepseek-r1): stop param + token budget fixes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-26 12:47:34 +08:00