@elvis1513/auto-coding-skill 4.2.3 → 4.2.4

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
@@ -9,7 +9,8 @@ The Skill is a selectable guardrail, not a command sequence that must run for
9
9
  every task. The model skips machinery whose expected benefit does not exceed its
10
10
  cost; read-only work and obvious small clean-checkout changes normally stay direct.
11
11
 
12
- Version 4.2.3 restores an explicit opt-in strict size-warning policy without
12
+ Version 4.2.4 fixes TypeScript function-body detection after an explicit return
13
+ type. Version 4.2.3 restores an explicit opt-in strict size-warning policy without
13
14
  changing the default, makes semicolon-terminated Java/Kotlin imports visible to
14
15
  project layer rules, and hardens function-range detection. Version 4.2.2 preserves
15
16
  project-owned risk and structure policy during upgrades, restores explicit full
@@ -289,6 +290,13 @@ model overrides, complete project `risk.rules`, supported project/access/
289
290
  concurrency/route/structure values, and an existing project-owned structure
290
291
  standard byte-for-byte. Removed content is archived outside active docs.
291
292
 
293
+ ## What changed in 4.2.4
294
+
295
+ - Fixed TypeScript/TSX named and arrow function ranges across generic constraints,
296
+ predicates, conditional/object/function return types, and multiple same-line
297
+ arrows. Exact arrow locations are evaluated with bounded longest-range selection,
298
+ so type arrows neither truncate real bodies nor create duplicate findings.
299
+
292
300
  ## What changed in 4.2.3
293
301
 
294
302
  - Added the explicit `structure.block_warnings` policy with a default of `false`.
@@ -1 +1 @@
1
- {"schema_version":1,"skill_version":"4.2.3","manifest_path":".agents/managed-install.json","entries":[{"path":".agents/agents/browser-debugger.toml","source":"agents/browser-debugger.toml","ownership":"normalized-agent","sha256":"40727952944917eb0b573bb96dca2906c27bc794737f3b6b392b56df7b4208aa","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/agents/docs-researcher.toml","source":"agents/docs-researcher.toml","ownership":"normalized-agent","sha256":"aa1fed6a6a1cde282fc152c7a88b8e097a6c53bcf447d35978607d594e3cb3e4","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/agents/explorer.toml","source":"agents/explorer.toml","ownership":"normalized-agent","sha256":"4cd89888acf7c0c04fbbcd0b9a0f346c6efed42fb723ec2037af9331a84a1cac","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/agents/fixer.toml","source":"agents/fixer.toml","ownership":"normalized-agent","sha256":"7bc00a45b9d1bcc90b8b0f06d773556eba1d52effff664472c3cb81073f6abfb","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/agents/reviewer.toml","source":"agents/reviewer.toml","ownership":"normalized-agent","sha256":"d68c472fab6aef7679330798d753b3c495515545522b6f0a54cabccc0f523c39","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/SKILL.md","source":"skill/SKILL.md","ownership":"exact","sha256":"f4c5a340bf3387700385959848dbfa2cc4d90d1312f330d11b0cedc307426eb5","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/data/contracts/orchestration-v1.schema.json","source":"skill/data/contracts/orchestration-v1.schema.json","ownership":"exact","sha256":"0e8d5ebb06b47414be1218a1fc93cdbba94a7300fc7ba1c0e12d9c1ca60aeb43","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/data/policies/workflow-migrations-v1.json","source":"skill/data/policies/workflow-migrations-v1.json","ownership":"exact","sha256":"179eba27cc728127a715ec5f73d7220ff814b46b1e98a918cfa015fc0c212fdb","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/data/templates/ENGINEERING.md","source":"skill/data/templates/ENGINEERING.md","ownership":"exact","sha256":"748f68b2199d85599a0a68f04da76db7ad7828878e625f53e23afcf1c72131ad","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/data/templates/bridges/AGENTS.md","source":"skill/data/templates/bridges/AGENTS.md","ownership":"exact","sha256":"ec64f06faaff3a1a8b754f914acb1143b68c1830981f91dfb58795d4898fffc5","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/data/templates/tools/ap.py","source":"skill/data/templates/tools/ap.py","ownership":"exact","sha256":"c352fbf2cbcb9692a34fd952d8541b1cbe6d475c6e11e64500a1f6b5283a00be","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/requirements.txt","source":"skill/requirements.txt","ownership":"exact","sha256":"0969da99a0bc2a1b71ed50584560f4588a37567ac63af3ddbaf3c4617ca5621a","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/scripts/ap.py","source":"skill/scripts/ap.py","ownership":"exact","sha256":"35dd6d32e783aba9ac811a9eb0dd8d4219ee71c15e3600845b11c2e9433f0251","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/scripts/core.py","source":"skill/scripts/core.py","ownership":"exact","sha256":"640c37e8b274d90d6b7765d4243e054360d5a5a85b3150fbfe6449527c1cd28f","executable":true,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/scripts/http_checks.py","source":"skill/scripts/http_checks.py","ownership":"exact","sha256":"5620e187a0129f135621425a84b3a4e8f31137263c7e549a36a801fc36ff54ea","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/scripts/install_integrity.py","source":"skill/scripts/install_integrity.py","ownership":"exact","sha256":"a9ca7bd67893bbd2d7b35ece30a40457f0cbcb9ae01580cfc5daca2cd96fd676","executable":false,"scope":"shared","version":"4.2.3"},{"path":".agents/skills/auto-coding-skill/scripts/scaffold_templates.py","source":"skill/scripts/scaffold_templates.py","ownership":"exact","sha256":"6f0ee92eff2d5db9627a64b332738c9c917a93cc559d5bbacf771c5966215821","executable":false,"scope":"shared","version":"4.2.3"},{"path":"AGENTS.md","source":"skill/data/templates/bridges/AGENTS.md","ownership":"exact","sha256":"ec64f06faaff3a1a8b754f914acb1143b68c1830981f91dfb58795d4898fffc5","executable":false,"scope":"project","version":"4.2.3"},{"path":"docs/ENGINEERING.md","source":"skill/data/templates/ENGINEERING.md#managed-workflow","ownership":"managed-workflow","sha256":"6fcab61ec631c0fdc8056a3ec23834a1aaca016c4065a198dc209d0da695e795","executable":false,"scope":"project","version":"4.2.3"},{"path":"docs/architecture/adr/_TEMPLATE-ADR.md","source":"generated:scaffold_templates:docs/architecture/adr/_TEMPLATE-ADR.md","ownership":"exact","sha256":"88c89065ae0f8555412dbe096c05342152efc7becae8d8981e6442cdfee8e672","executable":false,"scope":"project","version":"4.2.3"},{"path":"docs/deployment/deploy-records/_TEMPLATE-DEPLOY-RECORD.md","source":"generated:scaffold_templates:docs/deployment/deploy-records/_TEMPLATE-DEPLOY-RECORD.md","ownership":"exact","sha256":"f2c17c0febc322b0ad50fb9d6f7e64e6c0cfb15c8a3e445a99da40f0a0dd1901","executable":false,"scope":"project","version":"4.2.3"},{"path":"docs/design/_TEMPLATE-DD.md","source":"generated:scaffold_templates:docs/design/_TEMPLATE-DD.md","ownership":"exact","sha256":"6ca022d127bfff68521f466b60bace4f1206baf0913daa855b9f751e74198db3","executable":false,"scope":"project","version":"4.2.3"},{"path":"docs/reviews/_TEMPLATE-REVIEW.md","source":"generated:scaffold_templates:docs/reviews/_TEMPLATE-REVIEW.md","ownership":"exact","sha256":"134f0d1bd3c7a317ef3cf4c2aea9f0539f3d53dccd5bcdabf6915b3629ef8802","executable":false,"scope":"project","version":"4.2.3"},{"path":"docs/tools/autopipeline/ap.py","source":"skill/data/templates/tools/ap.py","ownership":"exact","sha256":"c352fbf2cbcb9692a34fd952d8541b1cbe6d475c6e11e64500a1f6b5283a00be","executable":false,"scope":"project","version":"4.2.3"}],"managed_namespaces":[{"path":".agents/skills/auto-coding-skill","scope":"shared"},{"path":"docs/tools/autopipeline","scope":"project"}],"preserved":[".agents/archive/**",".agents/agents/* (except paths listed in entries)","docs/project/**","docs/architecture/structure-standard.md","docs/architecture/adr/[0-9]*.md","docs/design/*.md","docs/interfaces/*.md","docs/deployment/deploy-records/*.md","docs/reviews/*.md"]}
1
+ {"schema_version":1,"skill_version":"4.2.4","manifest_path":".agents/managed-install.json","entries":[{"path":".agents/agents/browser-debugger.toml","source":"agents/browser-debugger.toml","ownership":"normalized-agent","sha256":"40727952944917eb0b573bb96dca2906c27bc794737f3b6b392b56df7b4208aa","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/agents/docs-researcher.toml","source":"agents/docs-researcher.toml","ownership":"normalized-agent","sha256":"aa1fed6a6a1cde282fc152c7a88b8e097a6c53bcf447d35978607d594e3cb3e4","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/agents/explorer.toml","source":"agents/explorer.toml","ownership":"normalized-agent","sha256":"4cd89888acf7c0c04fbbcd0b9a0f346c6efed42fb723ec2037af9331a84a1cac","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/agents/fixer.toml","source":"agents/fixer.toml","ownership":"normalized-agent","sha256":"7bc00a45b9d1bcc90b8b0f06d773556eba1d52effff664472c3cb81073f6abfb","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/agents/reviewer.toml","source":"agents/reviewer.toml","ownership":"normalized-agent","sha256":"d68c472fab6aef7679330798d753b3c495515545522b6f0a54cabccc0f523c39","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/SKILL.md","source":"skill/SKILL.md","ownership":"exact","sha256":"f4c5a340bf3387700385959848dbfa2cc4d90d1312f330d11b0cedc307426eb5","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/data/contracts/orchestration-v1.schema.json","source":"skill/data/contracts/orchestration-v1.schema.json","ownership":"exact","sha256":"0e8d5ebb06b47414be1218a1fc93cdbba94a7300fc7ba1c0e12d9c1ca60aeb43","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/data/policies/workflow-migrations-v1.json","source":"skill/data/policies/workflow-migrations-v1.json","ownership":"exact","sha256":"90472b2aacb36de4af2ba0b6e4802e3ffd1c21afacdb3bcef33fed874964ecd3","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/data/templates/ENGINEERING.md","source":"skill/data/templates/ENGINEERING.md","ownership":"exact","sha256":"b316217a4fa83f10dc53756acd99c250cb53c87ce90780f01c5840e313683dc4","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/data/templates/bridges/AGENTS.md","source":"skill/data/templates/bridges/AGENTS.md","ownership":"exact","sha256":"7b2709d5b64cc13df6a3077217a58145243e4702754a927197343f8f2b9c2d59","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/data/templates/tools/ap.py","source":"skill/data/templates/tools/ap.py","ownership":"exact","sha256":"c352fbf2cbcb9692a34fd952d8541b1cbe6d475c6e11e64500a1f6b5283a00be","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/requirements.txt","source":"skill/requirements.txt","ownership":"exact","sha256":"0969da99a0bc2a1b71ed50584560f4588a37567ac63af3ddbaf3c4617ca5621a","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/scripts/ap.py","source":"skill/scripts/ap.py","ownership":"exact","sha256":"3636f84a9b29b5ab8f5db43607d3505d45ae87021a4e206d5488fda1947467bd","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/scripts/core.py","source":"skill/scripts/core.py","ownership":"exact","sha256":"640c37e8b274d90d6b7765d4243e054360d5a5a85b3150fbfe6449527c1cd28f","executable":true,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/scripts/http_checks.py","source":"skill/scripts/http_checks.py","ownership":"exact","sha256":"5620e187a0129f135621425a84b3a4e8f31137263c7e549a36a801fc36ff54ea","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/scripts/install_integrity.py","source":"skill/scripts/install_integrity.py","ownership":"exact","sha256":"a9ca7bd67893bbd2d7b35ece30a40457f0cbcb9ae01580cfc5daca2cd96fd676","executable":false,"scope":"shared","version":"4.2.4"},{"path":".agents/skills/auto-coding-skill/scripts/scaffold_templates.py","source":"skill/scripts/scaffold_templates.py","ownership":"exact","sha256":"6f0ee92eff2d5db9627a64b332738c9c917a93cc559d5bbacf771c5966215821","executable":false,"scope":"shared","version":"4.2.4"},{"path":"AGENTS.md","source":"skill/data/templates/bridges/AGENTS.md","ownership":"exact","sha256":"7b2709d5b64cc13df6a3077217a58145243e4702754a927197343f8f2b9c2d59","executable":false,"scope":"project","version":"4.2.4"},{"path":"docs/ENGINEERING.md","source":"skill/data/templates/ENGINEERING.md#managed-workflow","ownership":"managed-workflow","sha256":"83aa173407bd3096a3f7d1d861dc7dedeb17d322d1889ef18ee2da841a2c1e6c","executable":false,"scope":"project","version":"4.2.4"},{"path":"docs/architecture/adr/_TEMPLATE-ADR.md","source":"generated:scaffold_templates:docs/architecture/adr/_TEMPLATE-ADR.md","ownership":"exact","sha256":"88c89065ae0f8555412dbe096c05342152efc7becae8d8981e6442cdfee8e672","executable":false,"scope":"project","version":"4.2.4"},{"path":"docs/deployment/deploy-records/_TEMPLATE-DEPLOY-RECORD.md","source":"generated:scaffold_templates:docs/deployment/deploy-records/_TEMPLATE-DEPLOY-RECORD.md","ownership":"exact","sha256":"f2c17c0febc322b0ad50fb9d6f7e64e6c0cfb15c8a3e445a99da40f0a0dd1901","executable":false,"scope":"project","version":"4.2.4"},{"path":"docs/design/_TEMPLATE-DD.md","source":"generated:scaffold_templates:docs/design/_TEMPLATE-DD.md","ownership":"exact","sha256":"6ca022d127bfff68521f466b60bace4f1206baf0913daa855b9f751e74198db3","executable":false,"scope":"project","version":"4.2.4"},{"path":"docs/reviews/_TEMPLATE-REVIEW.md","source":"generated:scaffold_templates:docs/reviews/_TEMPLATE-REVIEW.md","ownership":"exact","sha256":"134f0d1bd3c7a317ef3cf4c2aea9f0539f3d53dccd5bcdabf6915b3629ef8802","executable":false,"scope":"project","version":"4.2.4"},{"path":"docs/tools/autopipeline/ap.py","source":"skill/data/templates/tools/ap.py","ownership":"exact","sha256":"c352fbf2cbcb9692a34fd952d8541b1cbe6d475c6e11e64500a1f6b5283a00be","executable":false,"scope":"project","version":"4.2.4"}],"managed_namespaces":[{"path":".agents/skills/auto-coding-skill","scope":"shared"},{"path":"docs/tools/autopipeline","scope":"project"}],"preserved":[".agents/archive/**",".agents/agents/* (except paths listed in entries)","docs/project/**","docs/architecture/structure-standard.md","docs/architecture/adr/[0-9]*.md","docs/design/*.md","docs/interfaces/*.md","docs/deployment/deploy-records/*.md","docs/reviews/*.md"]}
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema_version": 1,
3
3
  "managed_versions": {
4
- "agents": "4.2.3",
5
- "engineering": "4.2.3"
4
+ "agents": "4.2.4",
5
+ "engineering": "4.2.4"
6
6
  },
7
7
  "known_official_agents_sha256": [
8
8
  "ebaaadab60327b3a4852948443d7191a4d48cb00bf4910038ab78c9149089373"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  workflow:
3
- skill_version: "4.2.3"
3
+ skill_version: "4.2.4"
4
4
  mode: "dev"
5
5
  profile: "auto"
6
6
  completion: "push"
@@ -83,7 +83,7 @@ docs:
83
83
  api_change_log: "docs/interfaces/api-change-log.md"
84
84
  ---
85
85
  # Engineering Configuration and Project Facts
86
- <!-- auto-coding-skill:managed-workflow:start version=4.2.3 -->
86
+ <!-- auto-coding-skill:managed-workflow:start version=4.2.4 -->
87
87
  Root `AGENTS.md` is the single shared behavioral protocol. The installed
88
88
  `SKILL.md` contains invocation guidance. This file is the exact-schema source for
89
89
  project workflow configuration and access values that neither file can infer.
@@ -1,4 +1,4 @@
1
- <!-- auto-coding-skill:managed-agents:start version=4.2.3 -->
1
+ <!-- auto-coding-skill:managed-agents:start version=4.2.4 -->
2
2
  # Shared Engineering Protocol
3
3
 
4
4
  This file is fully managed by `auto-coding-skill`. Keep project-specific facts,
@@ -85,7 +85,7 @@ _FINAL_GATE_CACHE_ALGORITHM = "final-gate-v1"
85
85
  _WORKFLOW_MIGRATION_POLICY = Path("data/policies/workflow-migrations-v1.json")
86
86
  _FALLBACK_WORKFLOW_MIGRATION_POLICY = {
87
87
  "schema_version": 1,
88
- "managed_versions": {"agents": "4.2.3", "engineering": "4.2.3"},
88
+ "managed_versions": {"agents": "4.2.4", "engineering": "4.2.4"},
89
89
  "known_official_engineering_body_sha256": [
90
90
  "d1306cc626e8baf8c83c953b760fd771066de2bf125168eca3a7b7d6ff2b87a2",
91
91
  "305931c6edef770033a4f1970b00e5fb1c1728351856a173dbfa497daf563021",
@@ -1148,8 +1148,8 @@ def _migrate_fast_development_defaults(cfg: dict, repo: Path) -> list[str]:
1148
1148
  if _text(workflow_cfg.get("completion")).lower() != "push":
1149
1149
  workflow_cfg["completion"] = "push"
1150
1150
  changed.append("workflow.completion")
1151
- if _text(workflow_cfg.get("skill_version")) != "4.2.3":
1152
- workflow_cfg["skill_version"] = "4.2.3"
1151
+ if _text(workflow_cfg.get("skill_version")) != "4.2.4":
1152
+ workflow_cfg["skill_version"] = "4.2.4"
1153
1153
  changed.append("workflow.skill_version")
1154
1154
 
1155
1155
  commands_cfg = cfg.setdefault("commands", {})
@@ -1462,16 +1462,16 @@ def cmd_upgrade(args: argparse.Namespace) -> None:
1462
1462
  if current_agents:
1463
1463
  archive_dir = repo / "docs" / "archive" / "workflow"
1464
1464
  archive_header = (
1465
- "# Archived AGENTS.md before auto-coding-skill 4.2.3\n\n"
1465
+ "# Archived AGENTS.md before auto-coding-skill 4.2.4\n\n"
1466
1466
  "This file is historical and non-authoritative. The root AGENTS.md is fully managed.\n"
1467
1467
  "Move any still-current project facts into docs/ENGINEERING.md or docs/project/,\n"
1468
1468
  "without copying workflow rules back into the root AGENTS.md.\n\n---\n\n"
1469
1469
  )
1470
1470
  archive_content = archive_header + current_agents
1471
- archive = archive_dir / "AGENTS.pre-4.2.3.md"
1471
+ archive = archive_dir / "AGENTS.pre-4.2.4.md"
1472
1472
  if archive.exists() and archive.read_text(encoding="utf-8") != archive_content:
1473
1473
  digest = hashlib.sha256(current_agents.encode("utf-8")).hexdigest()[:12]
1474
- archive = archive_dir / f"AGENTS.pre-4.2.3-{digest}.md"
1474
+ archive = archive_dir / f"AGENTS.pre-4.2.4-{digest}.md"
1475
1475
  if not archive.exists():
1476
1476
  add_action("policy", archive, "archive", "historical and non-authoritative")
1477
1477
  if write:
@@ -4445,18 +4445,20 @@ def _python_function_ranges(
4445
4445
  return sorted(ranges)
4446
4446
 
4447
4447
 
4448
- def _find_arrow_line(
4448
+ def _find_arrow_locations(
4449
4449
  lines: list[str],
4450
4450
  start: int,
4451
4451
  deadline: Optional[float],
4452
- ) -> Optional[int]:
4453
- """Find a declaration's top-level arrow, ignoring arrows inside parameters."""
4452
+ ) -> list[tuple[int, int]]:
4453
+ """Find a declaration's top-level arrow candidates with exact columns."""
4454
4454
  state = "code"
4455
4455
  escaped = False
4456
4456
  regex_char_class = False
4457
4457
  paren_depth = 0
4458
4458
  bracket_depth = 0
4459
4459
  brace_depth = 0
4460
+ angle_depth = 0
4461
+ locations: list[tuple[int, int]] = []
4460
4462
  indent = len(lines[start]) - len(lines[start].lstrip())
4461
4463
  limit = min(len(lines), start + 200)
4462
4464
  equals = lines[start].find("=")
@@ -4467,8 +4469,10 @@ def _find_arrow_line(
4467
4469
  if line_index > start:
4468
4470
  stripped = line.strip()
4469
4471
  current_indent = len(line) - len(line.lstrip())
4470
- if stripped and current_indent <= indent and not (paren_depth or bracket_depth or brace_depth):
4471
- return None
4472
+ if stripped and current_indent <= indent and not (
4473
+ paren_depth or bracket_depth or brace_depth or angle_depth
4474
+ ):
4475
+ return locations
4472
4476
  char_index = equals + 1 if line_index == start and equals >= 0 else 0
4473
4477
  while char_index < len(line):
4474
4478
  char = line[char_index]
@@ -4526,25 +4530,32 @@ def _find_arrow_line(
4526
4530
  bracket_depth += 1
4527
4531
  elif char == "]":
4528
4532
  bracket_depth = max(0, bracket_depth - 1)
4533
+ elif char == "<" and not (paren_depth or bracket_depth or brace_depth):
4534
+ angle_depth += 1
4535
+ elif char == ">" and angle_depth and not (paren_depth or bracket_depth or brace_depth):
4536
+ angle_depth -= 1
4529
4537
  elif char == "{":
4530
4538
  brace_depth += 1
4531
4539
  elif char == "}":
4532
4540
  brace_depth = max(0, brace_depth - 1)
4533
- elif char == "=" and next_char == ">" and not (paren_depth or bracket_depth or brace_depth):
4534
- return line_index
4535
- elif char == ";" and not (paren_depth or bracket_depth or brace_depth):
4536
- return None
4541
+ elif char == "=" and next_char == ">":
4542
+ if not (paren_depth or bracket_depth or brace_depth or angle_depth):
4543
+ locations.append((line_index, char_index))
4544
+ char_index += 2
4545
+ continue
4546
+ elif char == ";" and not (paren_depth or bracket_depth or brace_depth or angle_depth):
4547
+ return locations
4537
4548
  char_index += 1
4538
4549
  if line_index > start:
4539
4550
  stripped = line.strip()
4540
4551
  current_indent = len(line) - len(line.lstrip())
4541
- if stripped and current_indent <= indent and not (paren_depth or bracket_depth or brace_depth):
4542
- return None
4543
- return None
4552
+ if stripped and current_indent <= indent and not (paren_depth or bracket_depth or brace_depth or angle_depth):
4553
+ return locations
4554
+ return locations
4544
4555
 
4545
4556
 
4546
- def _arrow_body_kind(lines: list[str], arrow_line: int) -> str:
4547
- arrow_column = lines[arrow_line].find("=>")
4557
+ def _arrow_body_kind(lines: list[str], arrow_location: tuple[int, int]) -> str:
4558
+ arrow_line, arrow_column = arrow_location
4548
4559
  for line_index in range(arrow_line, min(len(lines), arrow_line + 20)):
4549
4560
  text = lines[line_index][arrow_column + 2 :] if line_index == arrow_line else lines[line_index]
4550
4561
  stripped = text.strip()
@@ -4556,10 +4567,7 @@ def _arrow_body_kind(lines: list[str], arrow_line: int) -> str:
4556
4567
 
4557
4568
  def _looks_like_return_type_brace(line: str, index: int) -> bool:
4558
4569
  prefix = line[:index].rstrip()
4559
- if re.search(r"\b(?:struct|interface)\s*$", prefix):
4560
- return True
4561
- close_paren = prefix.rfind(")")
4562
- return close_paren >= 0 and ":" in prefix[close_paren + 1 :]
4570
+ return bool(re.search(r"\b(?:struct|interface)\s*$", prefix))
4563
4571
 
4564
4572
 
4565
4573
  def _brace_function_end(
@@ -4567,7 +4575,8 @@ def _brace_function_end(
4567
4575
  start: int,
4568
4576
  threshold: int,
4569
4577
  deadline: Optional[float],
4570
- arrow_line: Optional[int] = None,
4578
+ arrow_location: Optional[tuple[int, int]] = None,
4579
+ suffix: str = "",
4571
4580
  ) -> Optional[tuple[int, bool]]:
4572
4581
  depth = 0
4573
4582
  opened = False
@@ -4577,7 +4586,13 @@ def _brace_function_end(
4577
4586
  paren_depth = 0
4578
4587
  bracket_depth = 0
4579
4588
  type_brace_depth = 0
4580
- arrow_seen = arrow_line is None
4589
+ arrow_seen = arrow_location is None
4590
+ typescript_declaration = arrow_location is None and suffix in {".ts", ".tsx"}
4591
+ ts_phase = "before_params"
4592
+ ts_pre_angle_depth = ts_pre_brace_depth = 0
4593
+ ts_type_angle_depth = ts_type_paren_depth = ts_type_bracket_depth = 0
4594
+ ts_type_brace_depth = 0
4595
+ ts_type_expects_operand = True
4581
4596
  limit = min(len(lines), start + threshold + 1)
4582
4597
 
4583
4598
  for line_index in range(start, limit):
@@ -4643,10 +4658,107 @@ def _brace_function_end(
4643
4658
  char_index += 1
4644
4659
  continue
4645
4660
  if char == "=" and next_char == ">":
4646
- if arrow_line is not None and line_index == arrow_line:
4661
+ if arrow_location == (line_index, char_index):
4647
4662
  arrow_seen = True
4663
+ if typescript_declaration and ts_phase == "return_type":
4664
+ ts_type_expects_operand = True
4648
4665
  char_index += 2
4649
4666
  continue
4667
+ if typescript_declaration and not opened:
4668
+ if char in {"'", '"', "`"}:
4669
+ state = {"'": "single_quote", '"': "double_quote", "`": "backtick"}[char]
4670
+ escaped = False
4671
+ if ts_phase == "return_type":
4672
+ ts_type_expects_operand = False
4673
+ char_index += 1
4674
+ continue
4675
+ if ts_phase == "before_params":
4676
+ if ts_pre_brace_depth > 0:
4677
+ if char == "{":
4678
+ ts_pre_brace_depth += 1
4679
+ elif char == "}":
4680
+ ts_pre_brace_depth -= 1
4681
+ elif char == "<":
4682
+ ts_pre_angle_depth += 1
4683
+ elif char == ">":
4684
+ ts_pre_angle_depth = max(0, ts_pre_angle_depth - 1)
4685
+ elif char == "{":
4686
+ ts_pre_brace_depth = 1
4687
+ elif char == "(" and ts_pre_angle_depth == 0:
4688
+ ts_phase = "params"
4689
+ paren_depth = 1
4690
+ elif ts_phase == "params":
4691
+ if char == "(":
4692
+ paren_depth += 1
4693
+ elif char == ")":
4694
+ paren_depth = max(0, paren_depth - 1)
4695
+ if paren_depth == 0:
4696
+ ts_phase = "after_params"
4697
+ elif ts_phase == "after_params":
4698
+ if char == ":":
4699
+ ts_phase = "return_type"
4700
+ ts_type_expects_operand = True
4701
+ elif char == "{":
4702
+ opened = True
4703
+ depth = 1
4704
+ elif char == ";":
4705
+ return None
4706
+ elif ts_type_brace_depth > 0:
4707
+ if char == "{":
4708
+ ts_type_brace_depth += 1
4709
+ elif char == "}":
4710
+ ts_type_brace_depth -= 1
4711
+ if ts_type_brace_depth == 0:
4712
+ ts_type_expects_operand = False
4713
+ elif char == "{":
4714
+ if (
4715
+ ts_type_angle_depth
4716
+ or ts_type_paren_depth
4717
+ or ts_type_bracket_depth
4718
+ or ts_type_expects_operand
4719
+ ):
4720
+ ts_type_brace_depth = 1
4721
+ ts_type_expects_operand = False
4722
+ else:
4723
+ opened = True
4724
+ depth = 1
4725
+ elif char == "<":
4726
+ ts_type_angle_depth += 1
4727
+ ts_type_expects_operand = True
4728
+ elif char == ">":
4729
+ ts_type_angle_depth = max(0, ts_type_angle_depth - 1)
4730
+ ts_type_expects_operand = False
4731
+ elif char == "(":
4732
+ ts_type_paren_depth += 1
4733
+ ts_type_expects_operand = True
4734
+ elif char == ")":
4735
+ ts_type_paren_depth = max(0, ts_type_paren_depth - 1)
4736
+ ts_type_expects_operand = False
4737
+ elif char == "[":
4738
+ ts_type_bracket_depth += 1
4739
+ ts_type_expects_operand = True
4740
+ elif char == "]":
4741
+ ts_type_bracket_depth = max(0, ts_type_bracket_depth - 1)
4742
+ ts_type_expects_operand = False
4743
+ elif char in "|&?:,.=":
4744
+ ts_type_expects_operand = True
4745
+ elif char.isalpha() or char in {"_", "$"}:
4746
+ word_match = re.match(r"[A-Za-z_$][\w$]*", line[char_index:])
4747
+ word = word_match.group(0) if word_match else char
4748
+ ts_type_expects_operand = word in {
4749
+ "abstract", "asserts", "extends", "in", "infer", "is",
4750
+ "keyof", "new", "readonly", "typeof", "unique",
4751
+ }
4752
+ char_index += len(word)
4753
+ continue
4754
+ elif char.isdigit():
4755
+ ts_type_expects_operand = False
4756
+ elif char == ";" and not (
4757
+ ts_type_angle_depth or ts_type_paren_depth or ts_type_bracket_depth
4758
+ ):
4759
+ return None
4760
+ char_index += 1
4761
+ continue
4650
4762
  if char == "'":
4651
4763
  state = "single_quote"
4652
4764
  escaped = False
@@ -4669,14 +4781,14 @@ def _brace_function_end(
4669
4781
  if not arrow_seen:
4670
4782
  char_index += 1
4671
4783
  continue
4672
- if arrow_line is None and (paren_depth > 0 or bracket_depth > 0):
4784
+ if arrow_location is None and (paren_depth > 0 or bracket_depth > 0):
4673
4785
  char_index += 1
4674
4786
  continue
4675
4787
  if type_brace_depth > 0:
4676
4788
  type_brace_depth += 1
4677
4789
  char_index += 1
4678
4790
  continue
4679
- if arrow_line is None and _looks_like_return_type_brace(line, char_index):
4791
+ if arrow_location is None and _looks_like_return_type_brace(line, char_index):
4680
4792
  type_brace_depth = 1
4681
4793
  char_index += 1
4682
4794
  continue
@@ -4706,7 +4818,7 @@ _JSX_TAG_RE = re.compile(r"</?>|</?[A-Za-z][A-Za-z0-9_.:-]*(?:\s[^<>]*?)?/?>")
4706
4818
  def _expression_arrow_end(
4707
4819
  lines: list[str],
4708
4820
  start: int,
4709
- arrow_line: int,
4821
+ arrow_location: tuple[int, int],
4710
4822
  threshold: int,
4711
4823
  deadline: Optional[float],
4712
4824
  suffix: str,
@@ -4720,7 +4832,7 @@ def _expression_arrow_end(
4720
4832
  jsx_mode = False
4721
4833
  jsx_depth = 0
4722
4834
  saw_jsx_tag = False
4723
- arrow_column = lines[arrow_line].find("=>")
4835
+ arrow_line, arrow_column = arrow_location
4724
4836
 
4725
4837
  for line_index in range(arrow_line, limit):
4726
4838
  if (line_index - arrow_line) % 32 == 0:
@@ -4848,37 +4960,51 @@ def _function_size_warnings(
4848
4960
  if suffix == ".py":
4849
4961
  ranges = _python_function_ranges(lines, threshold, deadline)
4850
4962
  else:
4851
- candidates: dict[int, Optional[int]] = {}
4963
+ candidates: dict[int, list[Optional[tuple[int, int]]]] = {}
4964
+ claimed_arrow_lines: set[int] = set()
4852
4965
  for index, line in enumerate(lines):
4853
4966
  if index % 256 == 0:
4854
4967
  _ensure_structure_deadline(deadline)
4855
4968
  if _ARROW_DECLARATION_RE.search(line):
4856
- arrow_line = _find_arrow_line(lines, index, deadline)
4857
- if arrow_line is not None:
4858
- candidates[index] = arrow_line
4969
+ arrow_locations = _find_arrow_locations(lines, index, deadline)
4970
+ if arrow_locations:
4971
+ candidates[index] = list(arrow_locations)
4972
+ claimed_arrow_lines.update(location[0] for location in arrow_locations)
4859
4973
  continue
4860
- if _ARROW_FUNCTION_BODY_RE.search(line):
4861
- candidates[index] = index
4862
- elif Path(path).name == "Jenkinsfile":
4974
+ if Path(path).name == "Jenkinsfile":
4863
4975
  if re.match(r"^\s*def\s+[A-Za-z_]\w*\s*\(", line):
4864
- candidates[index] = None
4976
+ candidates[index] = [None]
4865
4977
  elif _FUNCTION_START_RE.search(line):
4866
- candidates[index] = None
4978
+ candidates[index] = [None]
4979
+ elif index not in claimed_arrow_lines:
4980
+ arrow_matches = list(_ARROW_FUNCTION_BODY_RE.finditer(line))
4981
+ if arrow_matches:
4982
+ candidates[index] = [(index, match.start()) for match in arrow_matches]
4867
4983
 
4868
4984
  ranges = []
4869
- for start, arrow_line in sorted(candidates.items()):
4985
+ for start, arrow_locations in sorted(candidates.items()):
4870
4986
  _ensure_structure_deadline(deadline)
4871
- if arrow_line is not None and _arrow_body_kind(lines, arrow_line) == "expression":
4872
- end, truncated = _expression_arrow_end(
4873
- lines, start, arrow_line, threshold, deadline, suffix
4987
+ candidate_ranges: list[tuple[int, bool]] = []
4988
+ for arrow_location in arrow_locations:
4989
+ if arrow_location is not None and _arrow_body_kind(lines, arrow_location) == "expression":
4990
+ candidate_ranges.append(
4991
+ _expression_arrow_end(
4992
+ lines, start, arrow_location, threshold, deadline, suffix
4993
+ )
4994
+ )
4995
+ continue
4996
+ result = _brace_function_end(
4997
+ lines,
4998
+ start,
4999
+ threshold,
5000
+ deadline,
5001
+ arrow_location=arrow_location,
5002
+ suffix=suffix,
4874
5003
  )
4875
- ranges.append((start, end, truncated))
4876
- continue
4877
- result = _brace_function_end(
4878
- lines, start, threshold, deadline, arrow_line=arrow_line
4879
- )
4880
- if result is not None:
4881
- end, truncated = result
5004
+ if result is not None:
5005
+ candidate_ranges.append(result)
5006
+ if candidate_ranges:
5007
+ end, truncated = max(candidate_ranges, key=lambda item: (item[0], item[1]))
4882
5008
  ranges.append((start, end, truncated))
4883
5009
 
4884
5010
  warnings: list[str] = []
@@ -1694,6 +1694,188 @@ class AutoCodingProfileTests(unittest.TestCase):
1694
1694
  1,
1695
1695
  6,
1696
1696
  ),
1697
+ (
1698
+ "typed-arrow-factory.ts",
1699
+ [
1700
+ "const factory = (): (x: string) => { value: string } => {",
1701
+ " const build = (value: string) => ({ value });",
1702
+ " return build;",
1703
+ "};",
1704
+ "const after = 1;",
1705
+ ],
1706
+ 1,
1707
+ 4,
1708
+ ),
1709
+ (
1710
+ "typed-generic-arrow-factory.ts",
1711
+ [
1712
+ "const factory = (): <T>(x: T) => { value: T } => {",
1713
+ " const build = <T>(value: T) => ({ value });",
1714
+ " return build;",
1715
+ "};",
1716
+ "const after = 1;",
1717
+ ],
1718
+ 1,
1719
+ 4,
1720
+ ),
1721
+ (
1722
+ "typed-constrained-generic-arrow.ts",
1723
+ [
1724
+ "const factory = <T extends (x: string) => { value: string }>(cb: T): void => {",
1725
+ " void cb;",
1726
+ " return;",
1727
+ "};",
1728
+ "const after = 1;",
1729
+ ],
1730
+ 1,
1731
+ 4,
1732
+ ),
1733
+ (
1734
+ "typed-defaulted-generic-arrow.ts",
1735
+ [
1736
+ "const factory = <T = () => { value: string }>(cb?: T): void => {",
1737
+ " void cb;",
1738
+ " return;",
1739
+ "};",
1740
+ "const after = 1;",
1741
+ ],
1742
+ 1,
1743
+ 4,
1744
+ ),
1745
+ (
1746
+ "typed-function.ts",
1747
+ [
1748
+ "export async function listBudgetRanges(",
1749
+ " scope: string,",
1750
+ "): Promise<BudgetRange[]> {",
1751
+ " return request(scope);",
1752
+ "}",
1753
+ "const after = 1;",
1754
+ ],
1755
+ 1,
1756
+ 5,
1757
+ ),
1758
+ (
1759
+ "typed-literal-function.ts",
1760
+ [
1761
+ "export function buildValue(): {",
1762
+ " value: string;",
1763
+ "} {",
1764
+ " return { value: 'ready' };",
1765
+ "}",
1766
+ "const after = 1;",
1767
+ ],
1768
+ 1,
1769
+ 5,
1770
+ ),
1771
+ (
1772
+ "typed-generic-constraint.ts",
1773
+ [
1774
+ "export function constrained<T extends { kind: string }>(",
1775
+ " value: T,",
1776
+ "): T {",
1777
+ " return value;",
1778
+ "}",
1779
+ "const after = 1;",
1780
+ ],
1781
+ 1,
1782
+ 5,
1783
+ ),
1784
+ (
1785
+ "typed-function-return.ts",
1786
+ [
1787
+ "export function makeFactory(): (x: string) => { value: string } {",
1788
+ " return value => ({ value });",
1789
+ "}",
1790
+ "const after = 1;",
1791
+ ],
1792
+ 1,
1793
+ 3,
1794
+ ),
1795
+ (
1796
+ "typed-generic-function-return.ts",
1797
+ [
1798
+ "export function makeGenericFactory(): <T>(x: T) => { value: T } {",
1799
+ " return value => ({ value });",
1800
+ "}",
1801
+ "const after = 1;",
1802
+ ],
1803
+ 1,
1804
+ 3,
1805
+ ),
1806
+ (
1807
+ "typed-conditional-return.ts",
1808
+ [
1809
+ "export function choose<T>(",
1810
+ " value: T,",
1811
+ "): T extends { kind: string } ? { matched: T } : { matched: never } {",
1812
+ " return { matched: value } as never;",
1813
+ "}",
1814
+ "const after = 1;",
1815
+ ],
1816
+ 1,
1817
+ 5,
1818
+ ),
1819
+ (
1820
+ "typed-keyof-return.ts",
1821
+ [
1822
+ "export function key(): keyof { ready: boolean } {",
1823
+ " return 'ready';",
1824
+ "}",
1825
+ "const after = 1;",
1826
+ ],
1827
+ 1,
1828
+ 3,
1829
+ ),
1830
+ (
1831
+ "typed-predicate-return.ts",
1832
+ [
1833
+ "export function isReady(value: unknown): value is { ready: true } {",
1834
+ " return Boolean(value);",
1835
+ "}",
1836
+ "const after = 1;",
1837
+ ],
1838
+ 1,
1839
+ 3,
1840
+ ),
1841
+ (
1842
+ "typed-multiline-generic-return.ts",
1843
+ [
1844
+ "export function load(): Promise<",
1845
+ " { value: string }",
1846
+ "> {",
1847
+ " return Promise.resolve({ value: 'ready' });",
1848
+ "}",
1849
+ "const after = 1;",
1850
+ ],
1851
+ 1,
1852
+ 5,
1853
+ ),
1854
+ (
1855
+ "typed-multiline-union-return.ts",
1856
+ [
1857
+ "export function union():",
1858
+ " | { kind: 'a' }",
1859
+ " | { kind: 'b' }",
1860
+ "{",
1861
+ " return { kind: 'a' };",
1862
+ "}",
1863
+ "const after = 1;",
1864
+ ],
1865
+ 1,
1866
+ 6,
1867
+ ),
1868
+ (
1869
+ "typed-commented-return.ts",
1870
+ [
1871
+ "export function commented(): /* result */ { value: string } {",
1872
+ " return { value: 'ready' };",
1873
+ "}",
1874
+ "const after = 1;",
1875
+ ],
1876
+ 1,
1877
+ 3,
1878
+ ),
1697
1879
  (
1698
1880
  "same-indent-plus.ts",
1699
1881
  [
@@ -1746,6 +1928,28 @@ class AutoCodingProfileTests(unittest.TestCase):
1746
1928
  lines = ["def ready(): return True"] + [f"top_level_{index} = {index}" for index in range(200)]
1747
1929
  self.assertEqual([], ap._function_size_warnings("inline.py", lines, 120))
1748
1930
 
1931
+ def test_multiline_arrow_declaration_has_one_size_finding(self) -> None:
1932
+ lines = [
1933
+ "const multi = (",
1934
+ " value: string,",
1935
+ ") => {",
1936
+ *[f" const value_{index} = value;" for index in range(10)],
1937
+ "};",
1938
+ ]
1939
+ warnings = ap._function_size_warnings("multi.ts", lines, 5)
1940
+ self.assertEqual(1, len(warnings), warnings)
1941
+ self.assertIn("multi.ts:1", warnings[0])
1942
+
1943
+ def test_same_line_fallback_uses_longest_callback(self) -> None:
1944
+ lines = [
1945
+ "consume(first => {}, second => {",
1946
+ *[f" const value_{index} = second;" for index in range(10)],
1947
+ "});",
1948
+ ]
1949
+ warnings = ap._function_size_warnings("callbacks.ts", lines, 5)
1950
+ self.assertEqual(1, len(warnings), warnings)
1951
+ self.assertIn("callbacks.ts:1", warnings[0])
1952
+
1749
1953
  def test_function_ranges_ignore_type_braces_regex_literals_and_prior_assignments(self) -> None:
1750
1954
  long_body = [f" value_{index} := {index}" for index in range(130)]
1751
1955
  go_lines = [
@@ -314,7 +314,7 @@ function testInitFullyConvergesExistingProject() {
314
314
  }
315
315
  assert(exists(path.join(repo, ".agents", "agents", "custom.toml")), "project-owned custom agents must survive init");
316
316
  assert(!exists(path.join(repo, ".agents", "skills", "auto-coding-skill", "obsolete.txt")), "extra Skill files must be removed");
317
- assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.3", "docs", "legacy", "old-taskbook.md")), "removed docs must be archived outside active docs");
317
+ assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.4", "docs", "legacy", "old-taskbook.md")), "removed docs must be archived outside active docs");
318
318
  assert(fs.readFileSync(structureStandard, "utf8") === customStructureStandard, "init must preserve a project-owned structure standard");
319
319
  assert(fs.readFileSync(path.join(repo, "docs", "architecture", "adr", "0042-project-choice.md"), "utf8").includes("Keep me"), "numbered ADR artifacts must survive init");
320
320
  assert(fs.readFileSync(path.join(repo, "docs", "architecture", "system-context.md"), "utf8").includes("Keep me"), "architecture artifacts must survive init");
@@ -440,7 +440,7 @@ function testMinimalInitConvergesWithinBudget() {
440
440
  // Integrity, staging, fail-closed classification, contract helpers, and the
441
441
  // language-aware structure scanner are executable support code, not prompt
442
442
  // context. Keep a measured ceiling while leaving deterministic checks readable.
443
- assert(lines <= 14860, `minimal scaffold line budget exceeded: ${lines}`);
443
+ assert(lines <= 14990, `minimal scaffold line budget exceeded: ${lines}`);
444
444
  const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
445
445
  assert(engineering.includes("profile: auto"), "engineering should enable adaptive profiles");
446
446
  assert(engineering.includes("isolation: adaptive"), "engineering should default to adaptive clean-branch/worktree isolation");
@@ -979,7 +979,7 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
979
979
 
980
980
  const engineering = path.join(repo, "docs", "ENGINEERING.md");
981
981
  const initial = fs.readFileSync(engineering, "utf8");
982
- const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.3 -->/;
982
+ const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.4 -->/;
983
983
  const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
984
984
  assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
985
985
  assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
@@ -993,21 +993,21 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
993
993
  const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
994
994
  const dryResult = JSON.parse(dryRun.stdout).results[0];
995
995
  assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
996
- assert(dryResult.managedWorkflow.version === "4.2.3", "dry-run should expose the target workflow version");
996
+ assert(dryResult.managedWorkflow.version === "4.2.4", "dry-run should expose the target workflow version");
997
997
  assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
998
998
  assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
999
999
 
1000
1000
  run("node", [cli, "init"], { cwd: repo });
1001
1001
  const updated = fs.readFileSync(engineering, "utf8");
1002
1002
  assert(!updated.includes("project note before") && !updated.includes("project note after"), "init must remove text outside the canonical ENGINEERING body");
1003
- assert(updated.includes("version=4.2.3"), "init should install the current managed workflow version");
1003
+ assert(updated.includes("version=4.2.4"), "init should install the current managed workflow version");
1004
1004
  assert(updated.includes("The frontmatter contract is:"), "init should refresh stale managed workflow content");
1005
1005
 
1006
1006
  fillRequiredAccess(repo);
1007
1007
  const status = run("node", [cli, "status", "--projects", repo, "--json"]);
1008
1008
  const statusResult = JSON.parse(status.stdout).results[0];
1009
1009
  assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
1010
- assert(statusResult.managedWorkflow.version === "4.2.3", "status should expose the installed managed workflow version");
1010
+ assert(statusResult.managedWorkflow.version === "4.2.4", "status should expose the installed managed workflow version");
1011
1011
 
1012
1012
  const beforeSecondInit = fs.readFileSync(engineering, "utf8");
1013
1013
  run("node", [cli, "init"], { cwd: repo });
@@ -1034,7 +1034,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
1034
1034
  assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
1035
1035
  run("node", [cli, "sync", "--projects", repo]);
1036
1036
  const migrated = fs.readFileSync(engineering, "utf8");
1037
- assert(migrated.includes("version=4.2.3"), "legacy migration should insert the current managed workflow");
1037
+ assert(migrated.includes("version=4.2.4"), "legacy migration should insert the current managed workflow");
1038
1038
  assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
1039
1039
  const stable = fs.readFileSync(engineering, "utf8");
1040
1040
  run("node", [cli, "sync", "--projects", repo]);
@@ -1134,7 +1134,7 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
1134
1134
  run("node", [cli, "sync", "--projects", repo]);
1135
1135
  const agents = path.join(repo, "AGENTS.md");
1136
1136
  const initial = fs.readFileSync(agents, "utf8");
1137
- assert(initial.includes("managed-agents:start version=4.2.3"), "new projects should receive the versioned root AGENTS block");
1137
+ assert(initial.includes("managed-agents:start version=4.2.4"), "new projects should receive the versioned root AGENTS block");
1138
1138
 
1139
1139
  const custom = [
1140
1140
  "# Project rules",
@@ -1153,12 +1153,12 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
1153
1153
 
1154
1154
  run("node", [cli, "sync", "--projects", repo]);
1155
1155
  const migrated = fs.readFileSync(agents, "utf8");
1156
- assert(migrated.includes("managed-agents:start version=4.2.3"), "AGENTS migration should install the current managed block");
1156
+ assert(migrated.includes("managed-agents:start version=4.2.4"), "AGENTS migration should install the current managed block");
1157
1157
  assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
1158
1158
  assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
1159
1159
  const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
1160
1160
  assert(migrated === canonical, "root AGENTS must be byte-identical to the packaged canonical file");
1161
- const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.3.md");
1161
+ const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.4.md");
1162
1162
  assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
1163
1163
  const stable = fs.readFileSync(agents);
1164
1164
  run("node", [cli, "sync", "--projects", repo]);
@@ -1215,7 +1215,7 @@ function testEngineeringFrameworkRejectsAnyNonCanonicalWorkflowText() {
1215
1215
 
1216
1216
  run("node", [cli, "init"], { cwd: repo });
1217
1217
  assert(!fs.readFileSync(engineering, "utf8").includes("backend owns APIs"), "init must restore the canonical ENGINEERING body");
1218
- const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.3", "docs", "ENGINEERING.md");
1218
+ const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.4", "docs", "ENGINEERING.md");
1219
1219
  assert(fs.readFileSync(archived, "utf8").includes("backend owns APIs"), "removed project text should remain in non-authoritative history");
1220
1220
  }
1221
1221
 
@@ -1227,12 +1227,12 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
1227
1227
 
1228
1228
  const manifestPath = path.join(repo, ".agents", "managed-install.json");
1229
1229
  const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
1230
- assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.3", "installed manifest must identify the release");
1230
+ assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.4", "installed manifest must identify the release");
1231
1231
  assert(manifest.entries.length > 0, "installed manifest must list managed files");
1232
1232
  for (const entry of manifest.entries) {
1233
1233
  assert(typeof entry.path === "string" && !path.isAbsolute(entry.path) && !entry.path.includes(".."), "manifest paths must be safe relative paths");
1234
1234
  assert(/^[0-9a-f]{64}$/.test(entry.sha256), `${entry.path}: manifest hash must be sha256`);
1235
- assert(entry.version === "4.2.3" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
1235
+ assert(entry.version === "4.2.4" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
1236
1236
  }
1237
1237
  assert(!manifest.managed_namespaces.some(item => item.path === ".agents" || item.path === "docs"), "manifest must not mirror entire project-owned trees");
1238
1238
 
@@ -1302,14 +1302,14 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
1302
1302
  }
1303
1303
 
1304
1304
  function testReleaseVersionMarkersStayInSync() {
1305
- const expected = "4.2.3";
1305
+ const expected = "4.2.4";
1306
1306
  const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
1307
1307
  const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
1308
1308
  const policy = JSON.parse(fs.readFileSync(
1309
1309
  path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
1310
1310
  "utf8",
1311
1311
  ));
1312
- assert(pkg.version === expected, "package version must match the 4.2.3 release");
1312
+ assert(pkg.version === expected, "package version must match the 4.2.4 release");
1313
1313
  assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
1314
1314
  assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
1315
1315
  const manifest = JSON.parse(fs.readFileSync(path.join(repoRoot, "cli", "assets", "managed-install.json"), "utf8"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvis1513/auto-coding-skill",
3
- "version": "4.2.3",
3
+ "version": "4.2.4",
4
4
  "description": "CLI installer for a delivery-first .agents workflow with adaptive Git isolation, routed changed-scope validation, risk-based review, push completion, and safe cleanup.",
5
5
  "type": "module",
6
6
  "bin": {