@elvis1513/auto-coding-skill 2.2.0 → 2.2.1

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
@@ -4,6 +4,15 @@ A generic `.agents` engineering workflow with adaptive execution profiles,
4
4
  minimal project scaffolding, evidence-backed closure, and optional CI/Jenkins and
5
5
  target-environment verification.
6
6
 
7
+ ## What changed in v2.2.1
8
+
9
+ - Made same-period ledger archiving update one cumulative archive-index entry
10
+ instead of appending duplicate month headings.
11
+ - Recognized Markdown-wrapped and localized settled statuses such as
12
+ `` `Done / PASS` `` and `Done(PASS)` during physical history archiving.
13
+ - Added regression coverage for repeated same-month archives and these status
14
+ formats.
15
+
7
16
  ## What changed in v2.2.0
8
17
 
9
18
  - Added `micro`, `standard`, and `high-risk` execution profiles.
@@ -2131,8 +2131,8 @@ def _is_closed_task_section(section: dict) -> bool:
2131
2131
  if not status_match:
2132
2132
  return False
2133
2133
  status = status_match.group(1).strip()
2134
- normalized = re.sub(r"\s+", " ", status).strip().lower()
2135
- first_token = re.split(r"[\s/,,;;。]+", normalized, maxsplit=1)[0].strip()
2134
+ normalized = re.sub(r"\s+", " ", status).strip().lower().strip("`*_")
2135
+ first_token = re.split(r"[\s/,,;;。()()]+", normalized, maxsplit=1)[0].strip("`*_")
2136
2136
  if first_token in _CLOSED_TASK_STATUSES or normalized in _CLOSED_TASK_STATUSES:
2137
2137
  return True
2138
2138
  return normalized.startswith((
@@ -2163,19 +2163,47 @@ def _append_archive_index(repo: Path, archive_index: Path, period: str, result:
2163
2163
  return False
2164
2164
 
2165
2165
  paths = result.get("paths") or {}
2166
+ taskbook_archive = Path(repo, str(paths.get("taskbook_archive") or ""))
2167
+ closure_archive = Path(repo, str(paths.get("closure_archive") or ""))
2168
+ design_archive_dir = Path(repo, str(paths.get("design_archive_dir") or ""))
2169
+
2170
+ taskbook_sections = 0
2171
+ if taskbook_archive.is_file():
2172
+ _preamble, sections = _split_markdown_sections(
2173
+ taskbook_archive.read_text(encoding="utf-8"),
2174
+ _TASKBOOK_ARCHIVE_HEADING_RE,
2175
+ )
2176
+ taskbook_sections = len(sections)
2177
+
2178
+ closure_sections = 0
2179
+ if closure_archive.is_file():
2180
+ _preamble, sections = _split_markdown_sections(
2181
+ closure_archive.read_text(encoding="utf-8"),
2182
+ _CLOSURE_ARCHIVE_HEADING_RE,
2183
+ )
2184
+ closure_sections = len(sections)
2185
+
2186
+ design_files = 0
2187
+ if design_archive_dir.is_dir():
2188
+ design_files = sum(1 for path in design_archive_dir.rglob("*") if path.is_file())
2189
+
2166
2190
  entry = (
2167
2191
  f"## {period}\n"
2168
2192
  f"- Generated: {_now_iso()}\n"
2169
- f"- Taskbook archive: `{paths.get('taskbook_archive', '')}` ({counts.get('taskbook_sections', 0)} sections)\n"
2170
- f"- Closure archive: `{paths.get('closure_archive', '')}` ({counts.get('closure_sections', 0)} sections)\n"
2171
- f"- Design archive: `{paths.get('design_archive_dir', '')}` ({counts.get('design_files', 0)} files)\n"
2193
+ f"- Taskbook archive: `{paths.get('taskbook_archive', '')}` ({taskbook_sections} sections)\n"
2194
+ f"- Closure archive: `{paths.get('closure_archive', '')}` ({closure_sections} sections)\n"
2195
+ f"- Design archive: `{paths.get('design_archive_dir', '')}` ({design_files} files)\n"
2172
2196
  )
2173
2197
  archive_index.parent.mkdir(parents=True, exist_ok=True)
2174
2198
  existing = archive_index.read_text(encoding="utf-8") if archive_index.exists() else ""
2175
- if existing.strip():
2176
- archive_index.write_text(existing.rstrip() + "\n\n" + entry, encoding="utf-8")
2177
- else:
2178
- archive_index.write_text("# Docs Archive Index\n\n" + entry, encoding="utf-8")
2199
+ period_section = re.compile(
2200
+ rf"^##\s+{re.escape(period)}\s*$.*?(?=^##\s+|\Z)",
2201
+ re.MULTILINE | re.DOTALL,
2202
+ )
2203
+ retained = period_section.sub("", existing).rstrip()
2204
+ if not retained:
2205
+ retained = "# Docs Archive Index"
2206
+ archive_index.write_text(retained + "\n\n" + entry, encoding="utf-8")
2179
2207
  return True
2180
2208
 
2181
2209
 
@@ -464,19 +464,48 @@ function testLedgerArchiveRecognizesSettledStatuses() {
464
464
  "## Task T002 - external dependency", "- Status: External Dependency", "",
465
465
  "## Task T003 - deployed work", "- Status: Deployed / Jenkins #123 SUCCESS", "",
466
466
  "## Task T004 - local pass", "- Status: Local PASS,待生产迁移窗口", "",
467
+ "## Task T005 - markdown done", "- Status: `Done / PASS`", "",
468
+ "## Task T006 - localized done", "- 状态:Done(PASS)", "",
467
469
  ].join("\n"));
468
470
  writeFile(path.join(repo, "docs", "tasks", "closure-log.md"), [
469
471
  "# Closure Log", "", "## T001 - superseded work", "- Result: DEV-CLOSED", "",
470
472
  "## T002 - external dependency", "- Result: PARTIAL", "",
471
473
  "## T003 - deployed work", "- Result: PASS", "",
472
474
  "## T004 - local pass", "- Result: DEV-CLOSED", "",
475
+ "## T005 - markdown done", "- Result: PASS", "",
476
+ "## T006 - localized done", "- Result: PASS", "",
473
477
  ].join("\n"));
474
478
  const result = run("python3", [assetAp, "--repo", repo, "docs-ledger-archive", "--plan", "--period", "2026-06", "--json"]);
475
479
  const parsed = JSON.parse(result.stdout);
476
- assert(parsed.counts.taskbook_sections === 4, `settled task sections should archive: ${result.stdout}`);
480
+ assert(parsed.counts.taskbook_sections === 6, `settled task sections should archive: ${result.stdout}`);
477
481
  assert(parsed.active_task_conflicts.length === 0, `settled statuses should not conflict: ${result.stdout}`);
478
482
  }
479
483
 
484
+ function testLedgerArchiveUpdatesExistingPeriodIndex() {
485
+ const repo = tmpdir("ledger-index-update");
486
+ run("git", ["init", "-q"], { cwd: repo });
487
+ run("node", [cli, "init", "--force"], { cwd: repo });
488
+ run("node", [cli, "sync", "--projects", repo]);
489
+
490
+ const taskbook = path.join(repo, "docs", "tasks", "taskbook.md");
491
+ const closure = path.join(repo, "docs", "tasks", "closure-log.md");
492
+ const designDir = path.join(repo, "docs", "design");
493
+ writeFile(taskbook, "# Taskbook\n\n## Task T001 - first\n- Status: Done\n");
494
+ writeFile(closure, "# Closure Log\n\n## T001 - first\n- Result: PASS\n");
495
+ writeFile(path.join(designDir, "T001-first.md"), "# T001\n");
496
+ run("python3", [assetAp, "--repo", repo, "docs-ledger-archive", "--write", "--period", "2026-06", "--json"]);
497
+
498
+ fs.appendFileSync(taskbook, "\n## Task T002 - second\n- Status: `Done / PASS`\n");
499
+ fs.appendFileSync(closure, "\n## T002 - second\n- Result: PASS\n");
500
+ writeFile(path.join(designDir, "T002-second.md"), "# T002\n");
501
+ run("python3", [assetAp, "--repo", repo, "docs-ledger-archive", "--write", "--period", "2026-06", "--json"]);
502
+
503
+ const index = fs.readFileSync(path.join(repo, "docs", "tasks", "archive-index.md"), "utf8");
504
+ assert((index.match(/^## 2026-06$/gm) || []).length === 1, `archive period should be unique: ${index}`);
505
+ assert(index.includes("(2 sections)"), `archive index should report cumulative task/closure counts: ${index}`);
506
+ assert(index.includes("(2 files)"), `archive index should report cumulative design count: ${index}`);
507
+ }
508
+
480
509
  testPreflightAvoidsPartialInstall();
481
510
  testDestVariants();
482
511
  testLauncherFallsBackToGlobalRuntime();
@@ -497,5 +526,6 @@ testUpgradePrefersModernProjectAssetsAndIgnoresRetiredTemplates();
497
526
  testUpgradeInitializesNewEngineeringDefaults();
498
527
  testUpgradeInstallsRuntimeRequiredByLauncher();
499
528
  testLedgerArchiveRecognizesSettledStatuses();
529
+ testLedgerArchiveUpdatesExistingPeriodIndex();
500
530
 
501
531
  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.2.0",
3
+ "version": "2.2.1",
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": {