@elvis1513/auto-coding-skill 4.2.4 → 4.2.6

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,6 +9,9 @@ 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.6 makes the managed structure/optimization description defer to
13
+ preserved project frontmatter instead of restating template defaults. Version
14
+ 4.2.5 keeps JSX self-closing and closing-tag slashes out of regex state.
12
15
  Version 4.2.4 fixes TypeScript function-body detection after an explicit return
13
16
  type. Version 4.2.3 restores an explicit opt-in strict size-warning policy without
14
17
  changing the default, makes semicolon-terminated Java/Kotlin imports visible to
@@ -290,6 +293,21 @@ model overrides, complete project `risk.rules`, supported project/access/
290
293
  concurrency/route/structure values, and an existing project-owned structure
291
294
  standard byte-for-byte. Removed content is archived outside active docs.
292
295
 
296
+ ## What changed in 4.2.6
297
+
298
+ - Made the managed `structure` / `optimization` description configuration-neutral:
299
+ the preserved project frontmatter is authoritative for enforcement and debt
300
+ completion policy.
301
+ - Added a 4.2.5-to-4.2.6 initialization regression that preserves strict
302
+ `blocking + baseline-aware` project settings and proves repeated init remains
303
+ byte-idempotent.
304
+
305
+ ## What changed in 4.2.5
306
+
307
+ - Prevented standalone JSX `/>` and closing-tag `</...>` slashes from starting a
308
+ JavaScript regex token during function-range scans. GeeStack now matches its
309
+ TypeScript AST size baseline, and XJMate strict full structure passes cleanly.
310
+
293
311
  ## What changed in 4.2.4
294
312
 
295
313
  - Fixed TypeScript/TSX named and arrow function ranges across generic constraints,
@@ -1 +1 @@
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
+ {"schema_version":1,"skill_version":"4.2.6","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.6"},{"path":".agents/agents/docs-researcher.toml","source":"agents/docs-researcher.toml","ownership":"normalized-agent","sha256":"aa1fed6a6a1cde282fc152c7a88b8e097a6c53bcf447d35978607d594e3cb3e4","executable":false,"scope":"shared","version":"4.2.6"},{"path":".agents/agents/explorer.toml","source":"agents/explorer.toml","ownership":"normalized-agent","sha256":"4cd89888acf7c0c04fbbcd0b9a0f346c6efed42fb723ec2037af9331a84a1cac","executable":false,"scope":"shared","version":"4.2.6"},{"path":".agents/agents/fixer.toml","source":"agents/fixer.toml","ownership":"normalized-agent","sha256":"7bc00a45b9d1bcc90b8b0f06d773556eba1d52effff664472c3cb81073f6abfb","executable":false,"scope":"shared","version":"4.2.6"},{"path":".agents/agents/reviewer.toml","source":"agents/reviewer.toml","ownership":"normalized-agent","sha256":"d68c472fab6aef7679330798d753b3c495515545522b6f0a54cabccc0f523c39","executable":false,"scope":"shared","version":"4.2.6"},{"path":".agents/skills/auto-coding-skill/SKILL.md","source":"skill/SKILL.md","ownership":"exact","sha256":"f4c5a340bf3387700385959848dbfa2cc4d90d1312f330d11b0cedc307426eb5","executable":false,"scope":"shared","version":"4.2.6"},{"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.6"},{"path":".agents/skills/auto-coding-skill/data/policies/workflow-migrations-v1.json","source":"skill/data/policies/workflow-migrations-v1.json","ownership":"exact","sha256":"82cc736ab7ee0decd781eeb7788cc2d25e040fc2fe9a13c55c3a63f3ba881942","executable":false,"scope":"shared","version":"4.2.6"},{"path":".agents/skills/auto-coding-skill/data/templates/ENGINEERING.md","source":"skill/data/templates/ENGINEERING.md","ownership":"exact","sha256":"1cf2d07cdcfc39b62182e2959565a042d1e1bb77580c0167643ee280a7aa9367","executable":false,"scope":"shared","version":"4.2.6"},{"path":".agents/skills/auto-coding-skill/data/templates/bridges/AGENTS.md","source":"skill/data/templates/bridges/AGENTS.md","ownership":"exact","sha256":"8516550c3f2c39d4cbc8713caa64c2232e3eebba3b4bf3de946984c738d0f91b","executable":false,"scope":"shared","version":"4.2.6"},{"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.6"},{"path":".agents/skills/auto-coding-skill/requirements.txt","source":"skill/requirements.txt","ownership":"exact","sha256":"0969da99a0bc2a1b71ed50584560f4588a37567ac63af3ddbaf3c4617ca5621a","executable":false,"scope":"shared","version":"4.2.6"},{"path":".agents/skills/auto-coding-skill/scripts/ap.py","source":"skill/scripts/ap.py","ownership":"exact","sha256":"48891548a624fc859f42e32b58f4acfd3ce36b07b68947ad74ccf3137815ebe5","executable":false,"scope":"shared","version":"4.2.6"},{"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.6"},{"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.6"},{"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.6"},{"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.6"},{"path":"AGENTS.md","source":"skill/data/templates/bridges/AGENTS.md","ownership":"exact","sha256":"8516550c3f2c39d4cbc8713caa64c2232e3eebba3b4bf3de946984c738d0f91b","executable":false,"scope":"project","version":"4.2.6"},{"path":"docs/ENGINEERING.md","source":"skill/data/templates/ENGINEERING.md#managed-workflow","ownership":"managed-workflow","sha256":"ab40691526ced8a4b2e438b0d0f8b43d6ecf8d14e650580dc93f9548041d76f5","executable":false,"scope":"project","version":"4.2.6"},{"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.6"},{"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.6"},{"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.6"},{"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.6"},{"path":"docs/tools/autopipeline/ap.py","source":"skill/data/templates/tools/ap.py","ownership":"exact","sha256":"c352fbf2cbcb9692a34fd952d8541b1cbe6d475c6e11e64500a1f6b5283a00be","executable":false,"scope":"project","version":"4.2.6"}],"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.4",
5
- "engineering": "4.2.4"
4
+ "agents": "4.2.6",
5
+ "engineering": "4.2.6"
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.4"
3
+ skill_version: "4.2.6"
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.4 -->
86
+ <!-- auto-coding-skill:managed-workflow:start version=4.2.6 -->
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.
@@ -97,7 +97,7 @@ The frontmatter contract is:
97
97
  bound a slower command; commands inherit PATH and declare intentional activation.
98
98
  - `risk`: project-specific signals that increase design/review depth but never
99
99
  expand the automatic local gate.
100
- - `structure` and `optimization`: advisory architecture and no-new-debt policy.
100
+ - `structure` and `optimization`: project-selected enforcement and completion policy; frontmatter values are authoritative.
101
101
  - `docs`: locations inside the managed documentation directory framework.
102
102
  Run `python3 docs/tools/autopipeline/ap.py doctor` after changing frontmatter; it
103
103
  also performs the bounded local managed-install integrity check.
@@ -1,4 +1,4 @@
1
- <!-- auto-coding-skill:managed-agents:start version=4.2.4 -->
1
+ <!-- auto-coding-skill:managed-agents:start version=4.2.6 -->
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.4", "engineering": "4.2.4"},
88
+ "managed_versions": {"agents": "4.2.6", "engineering": "4.2.6"},
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.4":
1152
- workflow_cfg["skill_version"] = "4.2.4"
1151
+ if _text(workflow_cfg.get("skill_version")) != "4.2.6":
1152
+ workflow_cfg["skill_version"] = "4.2.6"
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.4\n\n"
1465
+ "# Archived AGENTS.md before auto-coding-skill 4.2.6\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.4.md"
1471
+ archive = archive_dir / "AGENTS.pre-4.2.6.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.4-{digest}.md"
1474
+ archive = archive_dir / f"AGENTS.pre-4.2.6-{digest}.md"
1475
1475
  if not archive.exists():
1476
1476
  add_action("policy", archive, "archive", "historical and non-authoritative")
1477
1477
  if write:
@@ -4370,13 +4370,138 @@ def _ensure_structure_deadline(deadline: Optional[float]) -> None:
4370
4370
  raise APError("Final changed-scope gate timed out during structure check.")
4371
4371
 
4372
4372
 
4373
+ _JSX_TAG_RE = re.compile(r"</?>|</?[A-Za-z_$][A-Za-z0-9_.$:-]*(?:\s[^<>]*?)?/?>")
4374
+ _JSX_NONCODE_RE = re.compile(
4375
+ r'''"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`|//.*|/\*.*?\*/'''
4376
+ )
4377
+
4378
+
4379
+ def _mask_jsx_noncode(text: str) -> str:
4380
+ masked = list(_JSX_NONCODE_RE.sub(lambda match: " " * len(match.group(0)), text))
4381
+ for index, char in enumerate(masked):
4382
+ if char != "/":
4383
+ continue
4384
+ prefix = "".join(masked[:index]).rstrip()
4385
+ regex_context = prefix.endswith(("=", "(", "[", "{", ",", ":", ";", "!", "?")) or bool(
4386
+ re.search(r"\b(?:return|case|throw|yield)\s*$", prefix)
4387
+ )
4388
+ if not regex_context:
4389
+ continue
4390
+ terminator = _regex_line_terminator(text, index)
4391
+ if terminator is None:
4392
+ continue
4393
+ suffix = terminator + 1
4394
+ while suffix < len(text) and text[suffix] in "dgimsuvy":
4395
+ suffix += 1
4396
+ masked[index:suffix] = " " * (suffix - index)
4397
+ return "".join(masked)
4398
+
4399
+
4400
+ def _jsx_prefix_has_open_tag(text: str) -> bool:
4401
+ masked = _mask_jsx_noncode(text)
4402
+ depth = 0
4403
+ expression_depth = 0
4404
+ cursor = 0
4405
+ for match in _JSX_TAG_RE.finditer(masked):
4406
+ for char in masked[cursor:match.start()]:
4407
+ if depth <= 0:
4408
+ continue
4409
+ if char == "{":
4410
+ expression_depth += 1
4411
+ elif char == "}" and expression_depth > 0:
4412
+ expression_depth -= 1
4413
+ token = match.group(0)
4414
+ if token.startswith("</"):
4415
+ depth = max(0, depth - 1)
4416
+ elif token != "</>" and not token.endswith("/>"):
4417
+ previous = masked[:match.start()].rstrip()
4418
+ following = masked[match.end():].lstrip()
4419
+ if (
4420
+ previous
4421
+ and (previous[-1].isalnum() or previous[-1] in {"_", "$"})
4422
+ and (
4423
+ depth == 0
4424
+ or expression_depth > 0
4425
+ or following.startswith(("(", ".", "?."))
4426
+ )
4427
+ ):
4428
+ cursor = match.end()
4429
+ continue
4430
+ depth += 1
4431
+ if depth == 0:
4432
+ expression_depth = 0
4433
+ cursor = match.end()
4434
+ return depth > 0
4435
+
4436
+
4437
+ def _regex_line_terminator(line: str, index: int) -> Optional[int]:
4438
+ escaped = False
4439
+ char_class = False
4440
+ for char_index in range(index + 1, len(line)):
4441
+ char = line[char_index]
4442
+ if escaped:
4443
+ escaped = False
4444
+ elif char == "\\":
4445
+ escaped = True
4446
+ elif char == "[":
4447
+ char_class = True
4448
+ elif char == "]":
4449
+ char_class = False
4450
+ elif char == "/" and not char_class:
4451
+ suffix_index = char_index + 1
4452
+ while suffix_index < len(line) and line[suffix_index] in "dgimsuvy":
4453
+ suffix_index += 1
4454
+ if suffix_index < len(line) and (
4455
+ line[suffix_index].isalnum() or line[suffix_index] in {"_", "$"}
4456
+ ):
4457
+ return None
4458
+ token_index = suffix_index
4459
+ while token_index < len(line) and line[token_index].isspace():
4460
+ token_index += 1
4461
+ if token_index < len(line) and (
4462
+ line[token_index].isalnum() or line[token_index] in {"_", "$"}
4463
+ ):
4464
+ token = re.match(r"[A-Za-z_$][A-Za-z0-9_$]*", line[token_index:])
4465
+ if token is None or token.group(0) not in {"as", "in", "instanceof", "satisfies"}:
4466
+ return None
4467
+ return char_index
4468
+ return None
4469
+
4470
+
4373
4471
  def _looks_like_regex_start(line: str, index: int) -> bool:
4374
4472
  prefix = line[:index].rstrip()
4375
- if not prefix:
4376
- return True
4377
- if prefix.endswith(("=", "(", "[", "{", ",", ":", ";", "!", "?", "=>")):
4473
+ next_char = line[index + 1] if index + 1 < len(line) else ""
4474
+ terminator = _regex_line_terminator(line, index)
4475
+ if terminator is None:
4476
+ return False
4477
+ closing_tag = re.match(r"/[A-Za-z_$][A-Za-z0-9_.$:-]*\s*>", line[index:])
4478
+ keyword_context = bool(re.search(r"\b(?:return|case|throw|yield)\s*$", prefix))
4479
+ operator_context = prefix.endswith(("=", "(", "[", "{", ",", ":", ";", "!", "?", "<", ">", "=>"))
4480
+ if prefix.endswith("<") and closing_tag:
4481
+ before_less_than = prefix[:-1].rstrip()
4482
+ operand_context = bool(re.search(r"(?:[A-Za-z0-9_$\]\)}'\"`]|\+\+|--)$", before_less_than))
4483
+ tag_end = index + closing_tag.end()
4484
+ between = line[tag_end:terminator]
4485
+ terminator_next = line[terminator + 1] if terminator + 1 < len(line) else ""
4486
+ if (
4487
+ _jsx_prefix_has_open_tag(before_less_than)
4488
+ or not operand_context
4489
+ or (between and not between.strip())
4490
+ or terminator_next in {"/", "*"}
4491
+ ):
4492
+ return False
4493
+ if next_char == ">":
4494
+ if not prefix:
4495
+ return False
4496
+ if prefix.endswith("<"):
4497
+ before_less_than = prefix[:-1].rstrip()
4498
+ if not re.search(r"(?:[A-Za-z0-9_$\]\)}'\"`]|\+\+|--)$", before_less_than):
4499
+ return False
4500
+ elif not (operator_context or keyword_context):
4501
+ return False
4502
+ if not prefix or operator_context:
4378
4503
  return True
4379
- return bool(re.search(r"\b(?:return|case|throw|yield)\s*$", prefix))
4504
+ return keyword_context
4380
4505
 
4381
4506
 
4382
4507
  def _python_function_end(
@@ -4812,9 +4937,6 @@ _EXPRESSION_CONTINUATION_SUFFIXES = (
4812
4937
  _EXPRESSION_CONTINUATION_PREFIXES = (
4813
4938
  ".", "?.", "+", "-", "*", "/", "%", "&&", "||", "??", "?", ":", ",",
4814
4939
  )
4815
- _JSX_TAG_RE = re.compile(r"</?>|</?[A-Za-z][A-Za-z0-9_.:-]*(?:\s[^<>]*?)?/?>")
4816
-
4817
-
4818
4940
  def _expression_arrow_end(
4819
4941
  lines: list[str],
4820
4942
  start: int,
@@ -4880,7 +5002,16 @@ def _expression_arrow_end(
4880
5002
  state = "block_comment"
4881
5003
  char_index += 2
4882
5004
  continue
4883
- if char == "/" and _looks_like_regex_start(line, char_index):
5005
+ jsx_token_slash = (
5006
+ suffix in {".jsx", ".tsx"}
5007
+ and jsx_mode
5008
+ and brace_depth == 0
5009
+ and (
5010
+ next_char == ">"
5011
+ or (char_index > 0 and line[char_index - 1] == "<")
5012
+ )
5013
+ )
5014
+ if char == "/" and not jsx_token_slash and _looks_like_regex_start(line, char_index):
4884
5015
  state = "regex"
4885
5016
  regex_char_class = False
4886
5017
  escaped = False
@@ -1911,6 +1911,72 @@ class AutoCodingProfileTests(unittest.TestCase):
1911
1911
  1,
1912
1912
  5,
1913
1913
  ),
1914
+ (
1915
+ "self-closing-jsx.tsx",
1916
+ [
1917
+ "function CompactView({ value }: { value: string }) {",
1918
+ " return (",
1919
+ " <section>",
1920
+ " <Widget",
1921
+ " value={value}",
1922
+ " />",
1923
+ ' <span title="login/payment">{value}</span>',
1924
+ " </section>",
1925
+ " );",
1926
+ "}",
1927
+ "const after = 1;",
1928
+ ],
1929
+ 1,
1930
+ 10,
1931
+ ),
1932
+ (
1933
+ "self-closing-expression-jsx.tsx",
1934
+ [
1935
+ "const CompactIcon = () => (",
1936
+ " <svg>",
1937
+ " <path",
1938
+ " d=\"M0 0\"",
1939
+ " />",
1940
+ ' <text aria-label="login/payment">ok</text>',
1941
+ " </svg>",
1942
+ ");",
1943
+ "const after = 1;",
1944
+ ],
1945
+ 1,
1946
+ 8,
1947
+ ),
1948
+ (
1949
+ "conditional-self-closing-jsx.tsx",
1950
+ [
1951
+ "function ConditionalView({ show }: { show: boolean }) {",
1952
+ " return (",
1953
+ " <section>",
1954
+ " {show && <Widget",
1955
+ ' value="ready"',
1956
+ " />}",
1957
+ " </section>",
1958
+ " );",
1959
+ "}",
1960
+ "const after = 1;",
1961
+ ],
1962
+ 1,
1963
+ 9,
1964
+ ),
1965
+ (
1966
+ "conditional-self-closing-expression.tsx",
1967
+ [
1968
+ "const ConditionalView = ({ show }: { show: boolean }) => (",
1969
+ " <section>",
1970
+ " {show && <Widget",
1971
+ ' value="ready"',
1972
+ " />}",
1973
+ " </section>",
1974
+ ");",
1975
+ "const after = 1;",
1976
+ ],
1977
+ 1,
1978
+ 7,
1979
+ ),
1914
1980
  ]
1915
1981
  trailing_top_level_lines = [f"top_level_{index} = {index}" for index in range(20)]
1916
1982
  for path, lines, start_line, expected_size in fixtures:
@@ -1971,6 +2037,207 @@ class AutoCodingProfileTests(unittest.TestCase):
1971
2037
  ]
1972
2038
  self.assertEqual(1, len(ap._function_size_warnings("regex.js", js_lines, 120)))
1973
2039
 
2040
+ regex_gt_lines = [
2041
+ "function block() {",
2042
+ " const matcher = />}/;",
2043
+ *[f" const value_{index} = {index};" for index in range(130)],
2044
+ "}",
2045
+ ]
2046
+ self.assertEqual(1, len(ap._function_size_warnings("regex-gt.js", regex_gt_lines, 120)))
2047
+ closing_tag_regex_lines = [
2048
+ "function block() {",
2049
+ " const matcher = /section>}/;",
2050
+ *[f" const value_{index} = {index};" for index in range(130)],
2051
+ "}",
2052
+ ]
2053
+ self.assertEqual(
2054
+ 1,
2055
+ len(ap._function_size_warnings("closing-tag-regex.js", closing_tag_regex_lines, 120)),
2056
+ )
2057
+ comparison_regex_lines = [
2058
+ "function block() {",
2059
+ ' const matched = value</section>}/.test("section>}");',
2060
+ *[f" const value_{index} = {index};" for index in range(130)],
2061
+ "}",
2062
+ ]
2063
+ self.assertEqual(
2064
+ 1,
2065
+ len(ap._function_size_warnings("comparison-regex.js", comparison_regex_lines, 120)),
2066
+ )
2067
+ semicolon_regex_lines = [
2068
+ "function block() {",
2069
+ r' const matched = value</section>;\}/.test("section>;} ");',
2070
+ *[f" const value_{index} = {index};" for index in range(130)],
2071
+ "}",
2072
+ ]
2073
+ self.assertEqual(
2074
+ 1,
2075
+ len(ap._function_size_warnings("semicolon-regex.js", semicolon_regex_lines, 120)),
2076
+ )
2077
+ for suffix_expression in ["/}/ as RegExp", "/}/ satisfies RegExp"]:
2078
+ ts_regex_lines = [
2079
+ "function block() {",
2080
+ f" const matcher = {suffix_expression};",
2081
+ *[f" const value_{index} = {index};" for index in range(130)],
2082
+ "}",
2083
+ ]
2084
+ with self.subTest(suffix_expression=suffix_expression):
2085
+ self.assertEqual(
2086
+ 1,
2087
+ len(ap._function_size_warnings("regex-suffix.ts", ts_regex_lines, 120)),
2088
+ )
2089
+ for prefix_expression in [
2090
+ 'const html = "<Tag>";',
2091
+ "const pattern = /<Tag>/;",
2092
+ "foo<Tag>();",
2093
+ "const typed: Box<Tag> | null = null;",
2094
+ "const cast = box as Box<Tag>;",
2095
+ "const first = <A></A>; const second = <B></B>;",
2096
+ ]:
2097
+ prefixed_regex_lines = [
2098
+ "function block() {",
2099
+ f" {prefix_expression} const matched = value</section>}}/.test(text);",
2100
+ *[f" const value_{index} = {index};" for index in range(130)],
2101
+ "}",
2102
+ ]
2103
+ with self.subTest(prefix_expression=prefix_expression):
2104
+ self.assertEqual(
2105
+ 1,
2106
+ len(ap._function_size_warnings("prefixed-regex.ts", prefixed_regex_lines, 120)),
2107
+ )
2108
+ for generic_comparison in [
2109
+ " const matched = (box as Box<Tag>).value</section>}/.test(text);",
2110
+ " const matched: boolean | Box<Tag> = value</section>}/.test(text);",
2111
+ " const matched = (<Outer>{foo<Tag>()}</Outer>) && value</section>}/.test(text);",
2112
+ " const matched = (<Outer>{(box as Box<Tag>).value}</Outer>) && value</section>}/.test(text);",
2113
+ " const matched = (<Outer>{show && <Tag>hello</Tag>}</Outer>) && value</section>}/.test(text);",
2114
+ " const matched = (<Outer>hello<Tag>world</Tag></Outer>) && value</section>}/.test(text);",
2115
+ ]:
2116
+ generic_regex_lines = [
2117
+ "function block() {",
2118
+ generic_comparison,
2119
+ *[f" const value_{index} = {index};" for index in range(130)],
2120
+ "}",
2121
+ ]
2122
+ with self.subTest(generic_comparison=generic_comparison):
2123
+ self.assertEqual(
2124
+ 1,
2125
+ len(ap._function_size_warnings("generic-regex.ts", generic_regex_lines, 120)),
2126
+ )
2127
+ comparison = "const matched = value</>}/.test(text);"
2128
+ self.assertTrue(ap._looks_like_regex_start(comparison, comparison.index("/")))
2129
+ named_comparison = "const matched = value</section>}/.test(text);"
2130
+ self.assertTrue(ap._looks_like_regex_start(named_comparison, named_comparison.index("/")))
2131
+ assigned = "const matcher = /section>}/;"
2132
+ self.assertTrue(ap._looks_like_regex_start(assigned, assigned.index("/")))
2133
+ returned = "return /foo>/;"
2134
+ self.assertTrue(ap._looks_like_regex_start(returned, returned.index("/")))
2135
+ self.assertFalse(ap._looks_like_regex_start(" />", 4))
2136
+ self.assertFalse(ap._looks_like_regex_start(" </section>", 5))
2137
+ self.assertFalse(ap._looks_like_regex_start(" </_Private>", 5))
2138
+ self.assertFalse(ap._looks_like_regex_start(" </$Component>", 5))
2139
+ self.assertFalse(ap._looks_like_regex_start(" />}", 4))
2140
+ self.assertFalse(ap._looks_like_regex_start(" /> : null}", 4))
2141
+ jsx_close_same_line = " />}</section>;"
2142
+ self.assertFalse(ap._looks_like_regex_start(jsx_close_same_line, 4))
2143
+
2144
+ jsx_block = [
2145
+ "function F() {",
2146
+ " return <section>",
2147
+ " {show && <Widget",
2148
+ " x={1}",
2149
+ " />}</section>;",
2150
+ *[f" const value_{index} = {index};" for index in range(130)],
2151
+ "}",
2152
+ ]
2153
+ self.assertEqual(1, len(ap._function_size_warnings("jsx-block.tsx", jsx_block, 120)))
2154
+
2155
+ jsx_expression = [
2156
+ "const F = () => (",
2157
+ " <section>",
2158
+ " {show && <Widget",
2159
+ " x={1}",
2160
+ " />}</section>",
2161
+ ");",
2162
+ "const after = 1;",
2163
+ ]
2164
+ arrow_location = ap._find_arrow_locations(jsx_expression, 0, None)[0]
2165
+ self.assertEqual(
2166
+ (6, False),
2167
+ ap._expression_arrow_end(jsx_expression, 0, arrow_location, 6, None, ".tsx"),
2168
+ )
2169
+ self.assertEqual([], ap._function_size_warnings("jsx-expression.tsx", jsx_expression, 6))
2170
+
2171
+ trailing_jsx_expressions = [
2172
+ ["const F = () => <Tag></Tag>; // comment", "const after = 1;"],
2173
+ ["const F = () => <Tag></Tag>; /* comment */", "const after = 1;"],
2174
+ ["const F = () => <Tag></Tag> / divisor;", "const after = 1;"],
2175
+ ["const F = () => <Tag>hello</Tag>/(divisor);", "const after = 1;"],
2176
+ ["const F = () => <></>; // comment", "const after = 1;"],
2177
+ [
2178
+ "const F = () => (",
2179
+ " <Widget",
2180
+ " value={1}",
2181
+ " />); // comment",
2182
+ "const after = 1;",
2183
+ ],
2184
+ ]
2185
+ for expression in trailing_jsx_expressions:
2186
+ with self.subTest(expression=expression):
2187
+ arrow_location = ap._find_arrow_locations(expression, 0, None)[0]
2188
+ expected_end = len(expression) - 1
2189
+ self.assertEqual(
2190
+ (expected_end, False),
2191
+ ap._expression_arrow_end(
2192
+ expression, 0, arrow_location, expected_end, None, ".tsx"
2193
+ ),
2194
+ )
2195
+ self.assertEqual(
2196
+ [],
2197
+ ap._function_size_warnings("trailing-jsx.tsx", expression, expected_end),
2198
+ )
2199
+
2200
+ multiline_jsx_text = [
2201
+ "const F = () => (",
2202
+ " <Tag>",
2203
+ " hello</Tag>/(divisor)",
2204
+ ");",
2205
+ "const after = 1;",
2206
+ ]
2207
+ arrow_location = ap._find_arrow_locations(multiline_jsx_text, 0, None)[0]
2208
+ self.assertEqual(
2209
+ (4, False),
2210
+ ap._expression_arrow_end(multiline_jsx_text, 0, arrow_location, 4, None, ".tsx"),
2211
+ )
2212
+ self.assertEqual([], ap._function_size_warnings("multiline-jsx.tsx", multiline_jsx_text, 4))
2213
+
2214
+ for jsx_expression_body in [
2215
+ ' {value</section>}/.test(text) ? "yes" : "no"}',
2216
+ ' {/>}/.test(text) ? "yes" : "no"}',
2217
+ ]:
2218
+ jsx_regex_expression = [
2219
+ "const F = () => <Tag>",
2220
+ jsx_expression_body,
2221
+ "</Tag>;",
2222
+ "const after = 1;",
2223
+ ]
2224
+ with self.subTest(jsx_expression_body=jsx_expression_body):
2225
+ arrow_location = ap._find_arrow_locations(jsx_regex_expression, 0, None)[0]
2226
+ self.assertEqual(
2227
+ (3, False),
2228
+ ap._expression_arrow_end(
2229
+ jsx_regex_expression, 0, arrow_location, 3, None, ".tsx"
2230
+ ),
2231
+ )
2232
+ self.assertEqual(
2233
+ 1,
2234
+ len(
2235
+ ap._function_size_warnings(
2236
+ "jsx-regex-expression.tsx", jsx_regex_expression, 2
2237
+ )
2238
+ ),
2239
+ )
2240
+
1974
2241
  separate_declarations = [
1975
2242
  'const label = "ready"',
1976
2243
  "const block = () => {",
@@ -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.4", "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.6", "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");
@@ -373,6 +373,43 @@ function testStructureBlockWarningsDefaultsPreserveAndConverge() {
373
373
  );
374
374
  }
375
375
 
376
+ function testManagedPolicySummaryPreservesProjectConfiguration() {
377
+ const repo = tmpdir("managed-policy-summary");
378
+ run("node", [cli, "init"], { cwd: repo });
379
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
380
+ const current = fs.readFileSync(engineering, "utf8");
381
+ const neutralSummary = "- `structure` and `optimization`: project-selected enforcement and completion policy; frontmatter values are authoritative.";
382
+ const legacySummary = "- `structure` and `optimization`: advisory architecture and no-new-debt policy.";
383
+ const customized = current
384
+ .replace(/^ skill_version:.*$/m, " skill_version: 4.2.5")
385
+ .replace("managed-workflow:start version=4.2.6", "managed-workflow:start version=4.2.5")
386
+ .replace(neutralSummary, legacySummary)
387
+ .replace(/^ enforcement:.*$/m, " enforcement: blocking")
388
+ .replace(" block_warnings: false", " block_warnings: true")
389
+ .replace(" block: false", " block: true")
390
+ .replace(/^ completion_policy:.*$/m, " completion_policy: baseline-aware")
391
+ .replace(" require_baseline_for_global_review: false", " require_baseline_for_global_review: true")
392
+ .replace(" report_accepted_debt_as_findings: false", " report_accepted_debt_as_findings: true");
393
+ assert(customized !== current && customized.includes(legacySummary), "fixture must represent the 4.2.5 managed summary");
394
+ writeFile(engineering, customized);
395
+ const beforeUpgrade = readEngineeringConfig(engineering);
396
+ assert(beforeUpgrade.workflow?.skill_version === "4.2.5", "fixture must identify the previous workflow version");
397
+ assert(beforeUpgrade.structure?.enforcement === "blocking", "fixture must enable blocking structure enforcement");
398
+ assert(beforeUpgrade.optimization?.completion_policy === "baseline-aware", "fixture must enable baseline-aware completion");
399
+
400
+ run("node", [cli, "init"], { cwd: repo });
401
+ const upgraded = fs.readFileSync(engineering, "utf8");
402
+ const afterUpgrade = readEngineeringConfig(engineering);
403
+ assert(afterUpgrade.workflow?.skill_version === "4.2.6", "init must upgrade the workflow version");
404
+ assert(canonicalJson(afterUpgrade.structure) === canonicalJson(beforeUpgrade.structure), "init must preserve the complete project structure policy");
405
+ assert(canonicalJson(afterUpgrade.optimization) === canonicalJson(beforeUpgrade.optimization), "init must preserve the complete project optimization policy");
406
+ assert(upgraded.includes(neutralSummary), "upgraded managed text must defer to frontmatter policy");
407
+ assert(!upgraded.includes(legacySummary), "upgraded managed text must remove the hard-coded default policy description");
408
+
409
+ run("node", [cli, "init"], { cwd: repo });
410
+ assert(fs.readFileSync(engineering, "utf8") === upgraded, "repeated init must be byte-idempotent after the policy-summary upgrade");
411
+ }
412
+
376
413
  function testInitRejectsMissingPythonRuntimeBeforeWrites() {
377
414
  if (process.platform === "win32") return;
378
415
  const repo = tmpdir("missing-python-runtime");
@@ -440,7 +477,7 @@ function testMinimalInitConvergesWithinBudget() {
440
477
  // Integrity, staging, fail-closed classification, contract helpers, and the
441
478
  // language-aware structure scanner are executable support code, not prompt
442
479
  // context. Keep a measured ceiling while leaving deterministic checks readable.
443
- assert(lines <= 14990, `minimal scaffold line budget exceeded: ${lines}`);
480
+ assert(lines <= 15120, `minimal scaffold line budget exceeded: ${lines}`);
444
481
  const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
445
482
  assert(engineering.includes("profile: auto"), "engineering should enable adaptive profiles");
446
483
  assert(engineering.includes("isolation: adaptive"), "engineering should default to adaptive clean-branch/worktree isolation");
@@ -979,7 +1016,7 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
979
1016
 
980
1017
  const engineering = path.join(repo, "docs", "ENGINEERING.md");
981
1018
  const initial = fs.readFileSync(engineering, "utf8");
982
- const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.4 -->/;
1019
+ const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.6 -->/;
983
1020
  const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
984
1021
  assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
985
1022
  assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
@@ -993,21 +1030,21 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
993
1030
  const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
994
1031
  const dryResult = JSON.parse(dryRun.stdout).results[0];
995
1032
  assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
996
- assert(dryResult.managedWorkflow.version === "4.2.4", "dry-run should expose the target workflow version");
1033
+ assert(dryResult.managedWorkflow.version === "4.2.6", "dry-run should expose the target workflow version");
997
1034
  assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
998
1035
  assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
999
1036
 
1000
1037
  run("node", [cli, "init"], { cwd: repo });
1001
1038
  const updated = fs.readFileSync(engineering, "utf8");
1002
1039
  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.4"), "init should install the current managed workflow version");
1040
+ assert(updated.includes("version=4.2.6"), "init should install the current managed workflow version");
1004
1041
  assert(updated.includes("The frontmatter contract is:"), "init should refresh stale managed workflow content");
1005
1042
 
1006
1043
  fillRequiredAccess(repo);
1007
1044
  const status = run("node", [cli, "status", "--projects", repo, "--json"]);
1008
1045
  const statusResult = JSON.parse(status.stdout).results[0];
1009
1046
  assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
1010
- assert(statusResult.managedWorkflow.version === "4.2.4", "status should expose the installed managed workflow version");
1047
+ assert(statusResult.managedWorkflow.version === "4.2.6", "status should expose the installed managed workflow version");
1011
1048
 
1012
1049
  const beforeSecondInit = fs.readFileSync(engineering, "utf8");
1013
1050
  run("node", [cli, "init"], { cwd: repo });
@@ -1034,7 +1071,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
1034
1071
  assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
1035
1072
  run("node", [cli, "sync", "--projects", repo]);
1036
1073
  const migrated = fs.readFileSync(engineering, "utf8");
1037
- assert(migrated.includes("version=4.2.4"), "legacy migration should insert the current managed workflow");
1074
+ assert(migrated.includes("version=4.2.6"), "legacy migration should insert the current managed workflow");
1038
1075
  assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
1039
1076
  const stable = fs.readFileSync(engineering, "utf8");
1040
1077
  run("node", [cli, "sync", "--projects", repo]);
@@ -1134,7 +1171,7 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
1134
1171
  run("node", [cli, "sync", "--projects", repo]);
1135
1172
  const agents = path.join(repo, "AGENTS.md");
1136
1173
  const initial = fs.readFileSync(agents, "utf8");
1137
- assert(initial.includes("managed-agents:start version=4.2.4"), "new projects should receive the versioned root AGENTS block");
1174
+ assert(initial.includes("managed-agents:start version=4.2.6"), "new projects should receive the versioned root AGENTS block");
1138
1175
 
1139
1176
  const custom = [
1140
1177
  "# Project rules",
@@ -1153,12 +1190,12 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
1153
1190
 
1154
1191
  run("node", [cli, "sync", "--projects", repo]);
1155
1192
  const migrated = fs.readFileSync(agents, "utf8");
1156
- assert(migrated.includes("managed-agents:start version=4.2.4"), "AGENTS migration should install the current managed block");
1193
+ assert(migrated.includes("managed-agents:start version=4.2.6"), "AGENTS migration should install the current managed block");
1157
1194
  assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
1158
1195
  assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
1159
1196
  const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
1160
1197
  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.4.md");
1198
+ const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.6.md");
1162
1199
  assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
1163
1200
  const stable = fs.readFileSync(agents);
1164
1201
  run("node", [cli, "sync", "--projects", repo]);
@@ -1215,7 +1252,7 @@ function testEngineeringFrameworkRejectsAnyNonCanonicalWorkflowText() {
1215
1252
 
1216
1253
  run("node", [cli, "init"], { cwd: repo });
1217
1254
  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.4", "docs", "ENGINEERING.md");
1255
+ const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.6", "docs", "ENGINEERING.md");
1219
1256
  assert(fs.readFileSync(archived, "utf8").includes("backend owns APIs"), "removed project text should remain in non-authoritative history");
1220
1257
  }
1221
1258
 
@@ -1227,12 +1264,12 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
1227
1264
 
1228
1265
  const manifestPath = path.join(repo, ".agents", "managed-install.json");
1229
1266
  const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
1230
- assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.4", "installed manifest must identify the release");
1267
+ assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.6", "installed manifest must identify the release");
1231
1268
  assert(manifest.entries.length > 0, "installed manifest must list managed files");
1232
1269
  for (const entry of manifest.entries) {
1233
1270
  assert(typeof entry.path === "string" && !path.isAbsolute(entry.path) && !entry.path.includes(".."), "manifest paths must be safe relative paths");
1234
1271
  assert(/^[0-9a-f]{64}$/.test(entry.sha256), `${entry.path}: manifest hash must be sha256`);
1235
- assert(entry.version === "4.2.4" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
1272
+ assert(entry.version === "4.2.6" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
1236
1273
  }
1237
1274
  assert(!manifest.managed_namespaces.some(item => item.path === ".agents" || item.path === "docs"), "manifest must not mirror entire project-owned trees");
1238
1275
 
@@ -1302,14 +1339,14 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
1302
1339
  }
1303
1340
 
1304
1341
  function testReleaseVersionMarkersStayInSync() {
1305
- const expected = "4.2.4";
1342
+ const expected = "4.2.6";
1306
1343
  const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
1307
1344
  const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
1308
1345
  const policy = JSON.parse(fs.readFileSync(
1309
1346
  path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
1310
1347
  "utf8",
1311
1348
  ));
1312
- assert(pkg.version === expected, "package version must match the 4.2.4 release");
1349
+ assert(pkg.version === expected, "package version must match the 4.2.6 release");
1313
1350
  assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
1314
1351
  assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
1315
1352
  const manifest = JSON.parse(fs.readFileSync(path.join(repoRoot, "cli", "assets", "managed-install.json"), "utf8"));
@@ -1345,10 +1382,13 @@ function testProtocolResponsibilitiesStaySeparated() {
1345
1382
  assert(agents.includes("## Minimum mechanism budget") && agents.includes("## Bounded real validation"), "AGENTS must remain the behavioral protocol");
1346
1383
  assert(skill.includes("## Select the minimum mechanism set") && !skill.includes("## Authority"), "SKILL must remain invocation guidance");
1347
1384
  assert(engineering.includes("The frontmatter contract is:") && !engineering.includes("## Git and parallel work"), "ENGINEERING must remain project configuration/facts");
1385
+ assert(engineering.includes("frontmatter values are authoritative"), "ENGINEERING policy summary must defer to project frontmatter");
1386
+ assert(!engineering.includes("advisory architecture and no-new-debt policy"), "ENGINEERING policy summary must not hard-code template defaults");
1348
1387
  }
1349
1388
 
1350
1389
  testInitFullyConvergesExistingProject();
1351
1390
  testStructureBlockWarningsDefaultsPreserveAndConverge();
1391
+ testManagedPolicySummaryPreservesProjectConfiguration();
1352
1392
  testInitRejectsMissingPythonRuntimeBeforeWrites();
1353
1393
  testDestVariants();
1354
1394
  testLauncherFallsBackToGlobalRuntime();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvis1513/auto-coding-skill",
3
- "version": "4.2.4",
3
+ "version": "4.2.6",
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": {