# Changelog

All notable changes to SoloForge will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added
- **产物契约三分离架构**：Schema + ProcessRules + Validator 三分离框架，覆盖全部 19 种 ArtifactKind
  - `artifact_schema_registry.ts`：集中注册 19 种产物类型的结构定义（必填章节、表格、字段）
  - `artifact_process_rules.ts`：按 extract/review/fix/iterate 四操作类型区分的过程规则
  - `template_schema_loader.ts`：模板 YAML frontmatter 解析加载器（运行时可覆盖 Schema）
  - L4 产物结构校验：check_write/check_bash Hook 层写入时校验（warning/blocked 分级）
  - Schema 独立注入通道：绕过三道门预算，产物结构约束始终注入到 prompt
  - TemplateData→prompt 完整传递链：artifact_schema/process_rules 字段贯穿 11 个 Handlebars 模板
  - consumable_asset_registry 新增 artifact_schema_ref 字段，关联模板资产与 Schema
  - 能力登记：CAP-026~CAP-029 四项新能力注册
- Monolith split: engine/ sub-directory reorganization into 9 functional modules (207 files)
- MCP Server extracted from adapters/ to dedicated server/ directory
- E2E test suite and CI/CD pipeline
- Plan archive files moved to ~/.claude/plans/
- `sideEffects: false` in package.json for tree-shaking
- `lint:full` script: 全项目（含 tests/）零警告 ESLint 检查
- `noFallthroughCasesInSwitch` tsconfig 严格模式
- `noUnusedLocals` + `noUnusedParameters` tsconfig 严格模式
- `safeJsonParse` / `safeJsonStringify` 安全 JSON 工具函数
- CLI 子命令注册：`validate-knowledge`、`validate-foundation`

### Fixed
- Pipeline state machine fixes and multi-domain chain completion (11 high-severity vulnerability fixes)
- Plan 003 missing paths and plan 001 intent tests expanded to 53 cases
- prepublishOnly 缺少 build 步骤
- hooks.ts JSON 解析失败会清空用户 settings.json 的问题
- ESM 项目中 require() 导致的运行时崩溃
- 知识索引 build/watch 并发竞态条件
- Trae 配置默认值 bug
- 空数组 [0] 越界保护（6 处）
- 不安全 JSON.parse 缺少运行时验证（66 处 → 全部替换为 safeJsonParse）
- 非空断言消除（31 处 → 0，14 个文件）
- 显式 any 类型消除（20 处 → 1 处，12 个文件）
- 静默吞错修复（9 处 `.catch(() => {})` → 添加 debug 日志）
- 死常量删除（4 处：_SELF_DESTRUCT_PATTERNS 等）
- 未使用变量/参数修复（43 处，noUnusedLocals/noUnusedParameters 启用）
- 删除未使用模块 state_update_bypass.ts
- 7 处 `||` → `??` 安全替换（数组/数值 fallback）
- 657 项测试 ESLint 问题清零（no-explicit-any, no-unused-vars 等）
- project_stage_detector 旧/新数据格式兼容性修复

### Changed
- Link audit optimization: 14 modules re-registered, adapter enhancements, trae host_type fix
- Comprehensive optimization: architecture violation fixes, type safety, types split, async fs, test performance
- Test overhaul: fragment consolidation, failure fixes, boundary coverage enhancement, release gate zeroing
- Cleaned up batch legacy files, deprecated modules, and configuration updates
- Removed gitignored docs files from git tracking
- 11 个 as any 类型绕过 → 具体类型或 unknown 断言
- 11 个循环依赖修复（类型提取 + 模块拆分 + import 重定向）
- 删除废弃模块：policy_drift_detector, audit_verifier, extension_scenario deprecated 函数
- N+1 串行查询 → Promise.allSettled 并行化
- ESLint 配置：tests/ 允许 any 类型（测试 mock 场景）

## [1.4.16] - 2026-05-28

### Added
- `confirm` and `authorized` fields to Learn/Deliver tool schemas

## [1.4.15] - 2026-05-28

### Added
- Plan proposal gate lightweight path with `local_acceptance` type auto-pass

## [1.4.14] - 2026-05-28

### Changed
- Unified persistence refactor: single-load shared context to eliminate write overwrite; `setExpansion`/`setArtifact`/`setPlanProposalGate` support `existingCtx` passthrough

## [1.4.13] - 2026-05-28

### Fixed
- Lightweight path S4 gate skip; plan proposal gate write timing fix; `updateStatus` duplicate load prevention

## [1.4.12] - 2026-05-28

### Added
- Contract JSON parse error enhancement, brainstorming session passthrough, plan gate auto-setup, lightweight path auto-pass

## [1.4.11] - 2026-05-28

### Added
- Gate `expected_schema` passthrough, source code matcher, expansion pipeline stage split, E2E test coverage

## [1.4.10] - 2026-05-28

### Added
- Acceptance routing for intent router, contract parse loop refactor, expansion pipeline strategy, validation self-correction assistant

## [1.4.9] - 2026-05-28

### Fixed
- MCP index JSON decoding, schema type fixes, release gate adaptation, unit test coverage

## [1.4.8] - 2026-05-28

### Changed
- Scope parser refactor, workspace lease enhancement, impact analyzer streamlining, tool call chain extension

## [1.4.7] - 2026-05-28

### Added
- Extension platform contract enhancement, release gate supplement, tool call chain test coverage, CLAUDE.md hard rules annotation

## [1.4.6] - 2026-05-28

### Changed
- `next_action_planner` refactor, project knowledge contract strengthening, conflict detector fix, workflow navigation test coverage

## [1.4.5] - 2026-05-28

### Added
- Knowledge consumption boundary governance, design lifecycle contract, conflict detector enhancement, release gate hardening

## [1.4.4] - 2026-05-28

### Added
- `next_action` enhancement, asset registry extension, traceability supplement, workflow navigation upgrade

## [1.4.3] - 2026-05-28

### Added
- Traceability enhancement, decision workshop extension, release gate hardening, tool call chain coverage

## [1.4.0] - 2026-05-27

### Added
- Control plane contract, release gate enhancement, tool invocation contract strengthening

## [1.3.10] - 2026-05-27

### Added
- Config auto-repair, release readiness gate enhancement, documentation updates

## [1.3.8] - 2026-05-27

### Added
- Confirmation tiering mechanism, next navigation enhancement, empty project onboarding

## [1.3.5] - 2026-05-27

### Fixed
- Step 2-3 acceptance credibility fix, system capability loop activation

## [1.3.4] - 2026-05-26

### Added
- Centralized diagnostic codes, mechanism self-governance, knowledge governance, config boundaries, log governance, health check
- Code maintainability and observability contract

## [1.3.3] - 2026-05-26

### Added
- Workflow navigation, backend implementation contract, OOD/SOLID design rules

## [1.3.2] - 2026-05-26

### Added
- Standard asset contract, decision workshop, template visibility governance

## [1.3.1] - 2026-05-26

### Fixed
- Release fix, dependency vulnerability scanning

## [1.3.0] - 2026-05-24

### Added
- Construction instruction contract, log governance, evidence-driven anti-hallucination mechanism
- Log governance (problem 59), release operations manual, repository hygiene archival
- Release package freeze revalidation: stale dist cleanup, RC acceptance pass
- Release Candidate Steps 2-7: post-batch cleanup, knowledge asset standardization, corpus regression, init/sync acceptance, E2E smoke test, migration dry-run
- Batch 5 real main-path loop closure and documentation convergence
- Batch 4 contract governance: workflow template package, decision sovereignty, local acceptance, evolution regression
- Batch 3 CLI real-data loop: user modification protection, migrate safe state fix
- Batch 2 Verification/Delivery Contract full-chain loop closure
- Chinese localization of all English comments and logs with `check:comments` regression guard

### Fixed
- MCP connection timeout, hook input parsing, hot-path log noise reduction

## [1.2.17] - 2026-05-21

### Added
- Task status auto-termination: executing/verifying/learning auto-fail after 30 minutes
- User prompt submit hook with auto-injected `sf_classify` reminder
- Entry routing modular split: signal-driven routing + suffix-driven material extraction + structured logging
- Full runtime logging, Chinese JSDoc annotations, and comment standards
- Contract Registry system: Workflow, Tool Invocation, Input Material, Artifact, Configuration Precedence, Privacy/Secret/Data Sovereignty
- Mechanism Contract Registry with fact pre-validation and terminal pointer cleanup
- Consumable Asset Registry covering 161 built-in assets
- Intent Router replacing task_type-to-strategy routing
- Diff Ownership phases 1 and 2: state model, CAS verification, task lifecycle integration, advisory conflict reports
- Governance phases P1-P2: Capability Registry, Policy ID drift detection, persistent audit pool, risk-weighted sampling, escape report, capability action advisor, governance health report, audit sampling, MCP tool expansion (31 tools)
- Phases 1-14: consistency closure, knowledge template completion, scope lease, conflict merge gate, resume workspace, semantic delivery evidence, mutation audit, knowledge sovereignty, developer sovereignty, long-running jobs with context replay, zero-config init, Java quality guard, runtime safety package, real-project regression

### Changed
- Removed dynamic fact pollution; project facts declared not hardcoded

### Fixed
- Release Gate false-green elimination: 35 rules fully covered
- UserPromptSubmit hook event name, stdin input, and JSON output format
- Security hardening: 23 audit fixes covering hash/injection/race-condition/sandbox
- Scenario A source hash and artifact_ready with real reference and snapshot hash evidence
- Test TS type errors, AssetKind union type build break
- `sf_capability_update` empty evidence_ids rejection
- P0 handler lifecycle fix and tool registration strategy
- Diff Ownership phase 2 scope directory expansion and three preWriteCheck fixes
- CAS check deletion boundary and reverse traversal fixes
- Audit pool test isolation from process.cwd()

### Removed
- Legacy `setup.sh` (replaced by regression test)
- Obsolete `verify-test-counts` gate

## [1.2.18] - 2026-05-21

### Fixed
- npm bin missing executable permission: added prepublishOnly chmod +x

## [1.2.1] - 2026-05-17

### Fixed
- `init` supports `--project-path`; eight-dimension knowledge files deployed to templates/

## [1.2.0] - 2026-05-17

### Added
- Eight-dimension closed-loop defense and knowledge layer alignment (602 tests, 51 files)

## [1.1.2] - 2026-05-17

### Changed
- Appendix restructure: A/B/C appendices with 100% coverage matrix

## [1.1.1] - 2026-05-17

### Added
- `version` command (`soloforge version` / `-v` / `--version`)

## [1.1.0] - 2026-05-17

### Added
- Five engineering mechanisms and `sf_explore` autonomous tech selection engine
- Knowledge layer sync: five mechanisms + sf_explore knowledge entries
- Codex `AGENTS.md` generation, shared workflow templates, adapter cleanup
- Chinese JSDoc comments, scaffolding template annotation standards, classifier keyword expansion

### Fixed
- Full security audit: command injection prevention, gitleaks cache TTL, watcher leak fix, parallel IO optimization, enable/disable fallback
- 27 audit issue fixes: Codex hooks format, environment detection, deep copy, merge write, security hardening
- Audit completion: 3 unit test groups, design doc data correction, sf_brainstorm clarification

## [1.0.0] - 2026-05-15

### Added
- SoloForge Phase 1/2/2.5 complete: MCP server with 9 tools, 48 knowledge entries, 172 tests
- Phase 3 team collaboration: 5 engine modules + 5 MCP tools (284 tests)
- Phase 3b Trae IDE adapter: multi-IDE support (305 tests)
- Phase 2.6 knowledge-driven planning + architecture governance principles (312 tests)
- `sf_plan_advance` tool for multi-stage plan step progression
- Figma-to-delivery pipeline template and prototype description template
- Phase 2.7 knowledge-driven system expansion: 108 knowledge entries + 18 MCP tools
- Phase 3b: template renaming, prototype template upgrade, self-maintenance tool isolation
- Knowledge entry format specification with regression prevention
- Template content industry-grade optimization and `auto_enrich` mechanism
- Phase 4 continuous optimization, E2E verification, and release preparation

### Fixed
- Full review fix: 30 logic bugs + 13 review issues + 4 informational issues
- Unified all template file formats
- `sf_plan_advance` output format aligned with design doc
