@elvis1513/auto-coding-skill 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,6 +22,11 @@ npm install -g git+https://github.com/elvis1513/auto-coding-skill.git
22
22
 
23
23
  ## Release Notes
24
24
 
25
+ ### v2.1.2
26
+
27
+ - Fixed `docs-ledger-archive` so settled task states such as `Superseded by ...`, `External Dependency`, `Deployed`, `Completed`, `Archived`, `Local PASS`, and `Local Verified` are recognized as archivable instead of blocking physical ledger cleanup.
28
+ - Added a package-safe regression test for those docs ledger archive states.
29
+
25
30
  ### v2.1.1
26
31
 
27
32
  - Removed client-specific init targets from the npm CLI; installs now target the shared `.agents` layout only.
@@ -295,6 +300,7 @@ python3 docs/tools/autopipeline/ap.py upgrade --dry-run
295
300
 
296
301
  `structure-check` is intentionally generic. Project-specific paths and stricter rules belong in `docs/ENGINEERING.md` under `structure.*`, `optimization.*`, and optional `commands.structure_check`.
297
302
  Historical large-file debt can be listed in `structure.accepted_debt_paths` after it is recorded in the health baseline or optimization backlog; continued large additions to those files still fail.
303
+ Do not split files only to reduce line count. Split only when a clear business or technical boundary improves cohesion and change safety; keep cohesive transaction, state-machine, workflow, or test-scenario code together and track it as accepted debt when appropriate.
298
304
 
299
305
  `docs-ledger-check` is intentionally separate from `structure-check`. It treats `docs/tasks/taskbook.md`, `docs/tasks/closure-log.md`, and top-level `docs/design/T*.md` as active working sets. When they exceed `docs.active_*` budgets, the fix is physical archiving under `docs.task_archive_dir` / `docs.design_archive_dir`; `docs.archive_index` is only a navigation index and does not count as archive slimming.
300
306
 
@@ -200,6 +200,7 @@ python3 docs/tools/autopipeline/ap.py gen-summary <TASK_ID>
200
200
  - Put new code in the correct layer: domain rules stay out of controllers/pages, orchestration belongs in application/service/usecase code, external systems belong behind infrastructure adapters, and UI components should not own deep business workflows.
201
201
  - Reuse before building: search existing utilities, components, clients, validation, permissions, caching, retry, formatting, and automation scripts before adding another helper.
202
202
  - Do not add new responsibilities to large files. If a file exceeds `structure.max_file_lines_warn`, prefer extracting a focused module or component; if it exceeds `structure.max_file_lines_block`, only small fixes are acceptable unless the path is explicitly allowed.
203
+ - Never split files just to reduce line count. Split only when the business or technical boundary is clear, cohesion improves, tests can cover the move, and the change does not break transaction, state-machine, workflow, or reading continuity. Otherwise record or keep accepted debt and avoid adding new responsibilities.
203
204
  - Historical large files can be listed in `structure.accepted_debt_paths` only after they are recorded in the health baseline or optimization backlog; this does not permit large new additions to those files.
204
205
  - `structure.layer_rules` enforces configurable import boundaries between domain, application, infrastructure, interface, and shared layers.
205
206
  - Self-built algorithms, concurrency controls, caches, protocol clients, or framework-like helpers require a concrete reason such as performance, concurrency, offline/deploy constraints, licensing, security, or compatibility, plus tests or benchmark/runtime evidence.
@@ -429,6 +429,7 @@ docs:
429
429
  3) 单文件容量控制
430
430
  - 超过 `structure.max_file_lines_warn` 的文件只允许小修和缺陷修复,新增职责应优先抽取模块。
431
431
  - 超过 `structure.max_file_lines_block` 的文件不得继续承载新职责,除非该文件在 `structure.allow_large_files` 中声明为生成物或外部产物。
432
+ - 禁止仅为了降低行数而拆文件。拆分必须服务于清晰的业务边界、技术边界、变更安全和阅读连续性;如果事务、状态机、用例流程或测试场景需要放在一起维护,应保留内聚结构并记录为接受债务。
432
433
  - 已记录为接受债务的历史大文件可放入 `structure.accepted_debt_paths`,但继续大幅新增仍会被阻塞。
433
434
  - 对已偏大的文件一次性增加超过 `structure.max_added_lines_to_large_file` 行时,`structure-check` 会阻塞,要求拆分或写明例外理由。
434
435
 
@@ -46,6 +46,7 @@
46
46
 
47
47
  - 文件超过 `structure.max_file_lines_warn`:只允许小修、缺陷修复、类型补充;新增职责应先抽取模块。
48
48
  - 文件超过 `structure.max_file_lines_block`:不得继续承载新职责,除非是生成物、外部产物或已在 `structure.allow_large_files` 中声明。
49
+ - 禁止仅为了降低行数而拆文件。拆分必须服务于清晰的业务边界、技术边界、变更安全和阅读连续性;如果事务、状态机、用例流程或测试场景需要放在一起维护,应保留内聚结构并记录为接受债务。
49
50
  - 历史大文件如果已进入健康基线 / backlog,可在 `structure.accepted_debt_paths` 中登记;登记只豁免历史体量,不豁免继续大幅新增。
50
51
  - 函数 / 方法 / 组件超过 `structure.max_function_lines_warn`:应拆分为命名清晰的子函数、hook、service、query、mapper 或 view component。
51
52
  - 对大文件新增超过 `structure.max_added_lines_to_large_file` 行:默认阻塞,必须拆分或记录例外理由。
@@ -1880,18 +1880,31 @@ _TASK_RESULT_RE = re.compile(r"(?:^|\n)\s*-\s*Result\s*[::]\s*(DEV-CLOSED|PASS
1880
1880
  _TASK_STATUS_RE = re.compile(r"(?:^|\n)\s*-\s*(?:状态|Status)\s*[::]\s*([^|\n]+)", re.IGNORECASE)
1881
1881
  _DESIGN_TASK_FILE_RE = re.compile(r"^([Tt][A-Za-z0-9]*\d+(?:-\d+)?)")
1882
1882
  _CLOSED_TASK_STATUSES = {
1883
+ "archived",
1884
+ "completed",
1885
+ "deployed",
1883
1886
  "done",
1884
1887
  "closed",
1885
1888
  "dev-closed",
1889
+ "external",
1886
1890
  "pass",
1887
1891
  "passed",
1888
1892
  "fail",
1889
1893
  "failed",
1890
1894
  "partial",
1895
+ "superseded",
1891
1896
  "完成",
1892
1897
  "已完成",
1893
1898
  "关闭",
1894
1899
  "已关闭",
1900
+ "已部署",
1901
+ "已归档",
1902
+ "外部依赖",
1903
+ "已转外部依赖",
1904
+ "被替代",
1905
+ "已替代",
1906
+ "废弃",
1907
+ "已废弃",
1895
1908
  }
1896
1909
 
1897
1910
 
@@ -1958,8 +1971,16 @@ def _is_closed_task_section(section: dict) -> bool:
1958
1971
  if not status_match:
1959
1972
  return False
1960
1973
  status = status_match.group(1).strip()
1961
- status = re.split(r"[\s/,,;;。]+", status, maxsplit=1)[0].strip().lower()
1962
- return status in _CLOSED_TASK_STATUSES
1974
+ normalized = re.sub(r"\s+", " ", status).strip().lower()
1975
+ first_token = re.split(r"[\s/,,;;。]+", normalized, maxsplit=1)[0].strip()
1976
+ if first_token in _CLOSED_TASK_STATUSES or normalized in _CLOSED_TASK_STATUSES:
1977
+ return True
1978
+ return normalized.startswith((
1979
+ "local pass",
1980
+ "local verified",
1981
+ "本地通过",
1982
+ "本地验证通过",
1983
+ ))
1963
1984
 
1964
1985
 
1965
1986
  def _append_archive_sections(path: Path, title: str, period: str, sections: list[dict]) -> bool:
@@ -136,11 +136,55 @@ function testUpgradeCleansManagedBridgeExtrasOnly() {
136
136
  assert(exists(path.join(repo, ".agents", "skills", "auto-coding-skill", "custom.txt")), "non-managed extra should remain");
137
137
  }
138
138
 
139
+ function testLedgerArchiveRecognizesSettledStatuses() {
140
+ const repo = tmpdir("ledger-status");
141
+ run("git", ["init", "-q"], { cwd: repo });
142
+ run("node", [cli, "init", "--force"], { cwd: repo });
143
+ run("node", [cli, "sync", "--projects", repo]);
144
+ writeFile(path.join(repo, "docs", "tasks", "taskbook.md"), [
145
+ "# Taskbook",
146
+ "",
147
+ "## Task T001 - superseded work",
148
+ "- Status: Superseded by T002",
149
+ "",
150
+ "## Task T002 - external dependency",
151
+ "- Status: External Dependency",
152
+ "",
153
+ "## Task T003 - deployed work",
154
+ "- Status: Deployed / Jenkins #123 SUCCESS",
155
+ "",
156
+ "## Task T004 - local pass",
157
+ "- Status: Local PASS,待生产迁移窗口",
158
+ "",
159
+ ].join("\n"));
160
+ writeFile(path.join(repo, "docs", "tasks", "closure-log.md"), [
161
+ "# Closure Log",
162
+ "",
163
+ "## T001 - superseded work",
164
+ "- Result: DEV-CLOSED",
165
+ "",
166
+ "## T002 - external dependency",
167
+ "- Result: PARTIAL",
168
+ "",
169
+ "## T003 - deployed work",
170
+ "- Result: PASS",
171
+ "",
172
+ "## T004 - local pass",
173
+ "- Result: DEV-CLOSED",
174
+ "",
175
+ ].join("\n"));
176
+ const result = run("python3", [assetAp, "--repo", repo, "docs-ledger-archive", "--plan", "--period", "2026-06", "--json"]);
177
+ const parsed = JSON.parse(result.stdout);
178
+ assert(parsed.counts.taskbook_sections === 4, `settled task sections should archive: ${result.stdout}`);
179
+ assert(parsed.active_task_conflicts.length === 0, `settled statuses should not conflict: ${result.stdout}`);
180
+ }
181
+
139
182
  testPreflightAvoidsPartialInstall();
140
183
  testDestVariants();
141
184
  testSyncCreatesScaffoldAndStatusConverges();
142
185
  testForcePreservesCustomAgents();
143
186
  testBridgeIsGeneric();
144
187
  testUpgradeCleansManagedBridgeExtrasOnly();
188
+ testLedgerArchiveRecognizesSettledStatuses();
145
189
 
146
190
  console.log("cli-installer-regression-ok");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvis1513/auto-coding-skill",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "CLI installer for a generic .agents engineering workflow with optional CI/Jenkins and target-environment verification.",
5
5
  "type": "module",
6
6
  "bin": {