@mc-and-his-agents/loom-installer 0.1.49 → 0.1.50

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.
Files changed (22) hide show
  1. package/package.json +1 -1
  2. package/payload/manifest.json +42 -42
  3. package/payload/plugin/loom/skills/shared/scripts/loom_check.py +36 -0
  4. package/payload/plugin/loom/skills/shared/scripts/loom_flow.py +29 -7
  5. package/payload/skills/loom-adopt/.loom-runtime/shared/scripts/loom_check.py +36 -0
  6. package/payload/skills/loom-adopt/.loom-runtime/shared/scripts/loom_flow.py +29 -7
  7. package/payload/skills/loom-handoff/.loom-runtime/shared/scripts/loom_check.py +36 -0
  8. package/payload/skills/loom-handoff/.loom-runtime/shared/scripts/loom_flow.py +29 -7
  9. package/payload/skills/loom-init/.loom-runtime/shared/scripts/loom_check.py +36 -0
  10. package/payload/skills/loom-init/.loom-runtime/shared/scripts/loom_flow.py +29 -7
  11. package/payload/skills/loom-merge-ready/.loom-runtime/shared/scripts/loom_check.py +36 -0
  12. package/payload/skills/loom-merge-ready/.loom-runtime/shared/scripts/loom_flow.py +29 -7
  13. package/payload/skills/loom-pre-review/.loom-runtime/shared/scripts/loom_check.py +36 -0
  14. package/payload/skills/loom-pre-review/.loom-runtime/shared/scripts/loom_flow.py +29 -7
  15. package/payload/skills/loom-resume/.loom-runtime/shared/scripts/loom_check.py +36 -0
  16. package/payload/skills/loom-resume/.loom-runtime/shared/scripts/loom_flow.py +29 -7
  17. package/payload/skills/loom-retire/.loom-runtime/shared/scripts/loom_check.py +36 -0
  18. package/payload/skills/loom-retire/.loom-runtime/shared/scripts/loom_flow.py +29 -7
  19. package/payload/skills/loom-review/.loom-runtime/shared/scripts/loom_check.py +36 -0
  20. package/payload/skills/loom-review/.loom-runtime/shared/scripts/loom_flow.py +29 -7
  21. package/payload/skills/loom-spec-review/.loom-runtime/shared/scripts/loom_check.py +36 -0
  22. package/payload/skills/loom-spec-review/.loom-runtime/shared/scripts/loom_flow.py +29 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mc-and-his-agents/loom-installer",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "description": "Node installer for Loom plugin and single-skill installation surfaces.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,9 +2,9 @@
2
2
  "schema_version": "loom-installer-payload/v1",
3
3
  "loom_version": "0.4.0",
4
4
  "source_repository": "https://github.com/MC-and-his-Agents/Loom",
5
- "source_commit": "bcb61000e8157a08d51f2817b8768e5be8439343",
5
+ "source_commit": "e0d9542d7f67ae153e1b884c11bbc848943941cb",
6
6
  "source_ref": "main",
7
- "built_at": "2026-04-28T10:56:14+08:00",
7
+ "built_at": "2026-04-28T11:55:17+08:00",
8
8
  "runtime": {
9
9
  "python_minimum": "3.10",
10
10
  "python_recommended": "3.11+"
@@ -633,13 +633,13 @@
633
633
  },
634
634
  {
635
635
  "path": "plugin/loom/skills/shared/scripts/loom_check.py",
636
- "bytes": 363725,
637
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
636
+ "bytes": 365681,
637
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
638
638
  },
639
639
  {
640
640
  "path": "plugin/loom/skills/shared/scripts/loom_flow.py",
641
- "bytes": 342513,
642
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
641
+ "bytes": 343536,
642
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
643
643
  },
644
644
  {
645
645
  "path": "plugin/loom/skills/shared/scripts/loom_init.py",
@@ -1223,13 +1223,13 @@
1223
1223
  },
1224
1224
  {
1225
1225
  "path": "skills/loom-adopt/.loom-runtime/shared/scripts/loom_check.py",
1226
- "bytes": 363725,
1227
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
1226
+ "bytes": 365681,
1227
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
1228
1228
  },
1229
1229
  {
1230
1230
  "path": "skills/loom-adopt/.loom-runtime/shared/scripts/loom_flow.py",
1231
- "bytes": 342513,
1232
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
1231
+ "bytes": 343536,
1232
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
1233
1233
  },
1234
1234
  {
1235
1235
  "path": "skills/loom-adopt/.loom-runtime/shared/scripts/loom_init.py",
@@ -1843,13 +1843,13 @@
1843
1843
  },
1844
1844
  {
1845
1845
  "path": "skills/loom-handoff/.loom-runtime/shared/scripts/loom_check.py",
1846
- "bytes": 363725,
1847
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
1846
+ "bytes": 365681,
1847
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
1848
1848
  },
1849
1849
  {
1850
1850
  "path": "skills/loom-handoff/.loom-runtime/shared/scripts/loom_flow.py",
1851
- "bytes": 342513,
1852
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
1851
+ "bytes": 343536,
1852
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
1853
1853
  },
1854
1854
  {
1855
1855
  "path": "skills/loom-handoff/.loom-runtime/shared/scripts/loom_init.py",
@@ -2463,13 +2463,13 @@
2463
2463
  },
2464
2464
  {
2465
2465
  "path": "skills/loom-init/.loom-runtime/shared/scripts/loom_check.py",
2466
- "bytes": 363725,
2467
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
2466
+ "bytes": 365681,
2467
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
2468
2468
  },
2469
2469
  {
2470
2470
  "path": "skills/loom-init/.loom-runtime/shared/scripts/loom_flow.py",
2471
- "bytes": 342513,
2472
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
2471
+ "bytes": 343536,
2472
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
2473
2473
  },
2474
2474
  {
2475
2475
  "path": "skills/loom-init/.loom-runtime/shared/scripts/loom_init.py",
@@ -3088,13 +3088,13 @@
3088
3088
  },
3089
3089
  {
3090
3090
  "path": "skills/loom-merge-ready/.loom-runtime/shared/scripts/loom_check.py",
3091
- "bytes": 363725,
3092
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
3091
+ "bytes": 365681,
3092
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
3093
3093
  },
3094
3094
  {
3095
3095
  "path": "skills/loom-merge-ready/.loom-runtime/shared/scripts/loom_flow.py",
3096
- "bytes": 342513,
3097
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
3096
+ "bytes": 343536,
3097
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
3098
3098
  },
3099
3099
  {
3100
3100
  "path": "skills/loom-merge-ready/.loom-runtime/shared/scripts/loom_init.py",
@@ -3708,13 +3708,13 @@
3708
3708
  },
3709
3709
  {
3710
3710
  "path": "skills/loom-pre-review/.loom-runtime/shared/scripts/loom_check.py",
3711
- "bytes": 363725,
3712
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
3711
+ "bytes": 365681,
3712
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
3713
3713
  },
3714
3714
  {
3715
3715
  "path": "skills/loom-pre-review/.loom-runtime/shared/scripts/loom_flow.py",
3716
- "bytes": 342513,
3717
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
3716
+ "bytes": 343536,
3717
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
3718
3718
  },
3719
3719
  {
3720
3720
  "path": "skills/loom-pre-review/.loom-runtime/shared/scripts/loom_init.py",
@@ -4328,13 +4328,13 @@
4328
4328
  },
4329
4329
  {
4330
4330
  "path": "skills/loom-resume/.loom-runtime/shared/scripts/loom_check.py",
4331
- "bytes": 363725,
4332
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
4331
+ "bytes": 365681,
4332
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
4333
4333
  },
4334
4334
  {
4335
4335
  "path": "skills/loom-resume/.loom-runtime/shared/scripts/loom_flow.py",
4336
- "bytes": 342513,
4337
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
4336
+ "bytes": 343536,
4337
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
4338
4338
  },
4339
4339
  {
4340
4340
  "path": "skills/loom-resume/.loom-runtime/shared/scripts/loom_init.py",
@@ -4948,13 +4948,13 @@
4948
4948
  },
4949
4949
  {
4950
4950
  "path": "skills/loom-retire/.loom-runtime/shared/scripts/loom_check.py",
4951
- "bytes": 363725,
4952
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
4951
+ "bytes": 365681,
4952
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
4953
4953
  },
4954
4954
  {
4955
4955
  "path": "skills/loom-retire/.loom-runtime/shared/scripts/loom_flow.py",
4956
- "bytes": 342513,
4957
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
4956
+ "bytes": 343536,
4957
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
4958
4958
  },
4959
4959
  {
4960
4960
  "path": "skills/loom-retire/.loom-runtime/shared/scripts/loom_init.py",
@@ -5568,13 +5568,13 @@
5568
5568
  },
5569
5569
  {
5570
5570
  "path": "skills/loom-review/.loom-runtime/shared/scripts/loom_check.py",
5571
- "bytes": 363725,
5572
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
5571
+ "bytes": 365681,
5572
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
5573
5573
  },
5574
5574
  {
5575
5575
  "path": "skills/loom-review/.loom-runtime/shared/scripts/loom_flow.py",
5576
- "bytes": 342513,
5577
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
5576
+ "bytes": 343536,
5577
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
5578
5578
  },
5579
5579
  {
5580
5580
  "path": "skills/loom-review/.loom-runtime/shared/scripts/loom_init.py",
@@ -6188,13 +6188,13 @@
6188
6188
  },
6189
6189
  {
6190
6190
  "path": "skills/loom-spec-review/.loom-runtime/shared/scripts/loom_check.py",
6191
- "bytes": 363725,
6192
- "sha256": "a2e8c10cda53568e099b6c9ce242b524d84b7a7b0bbcb8efb4163b92e9150bb4"
6191
+ "bytes": 365681,
6192
+ "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
6193
6193
  },
6194
6194
  {
6195
6195
  "path": "skills/loom-spec-review/.loom-runtime/shared/scripts/loom_flow.py",
6196
- "bytes": 342513,
6197
- "sha256": "00a5476d3e1a1b6215558d1d840e852be898cd818749c3caaa442bc657dde5eb"
6196
+ "bytes": 343536,
6197
+ "sha256": "f8fe63875c5abce92281c4fce0fa329c3584a25a85c131ba2d0364ac39b78997"
6198
6198
  },
6199
6199
  {
6200
6200
  "path": "skills/loom-spec-review/.loom-runtime/shared/scripts/loom_init.py",
@@ -4466,6 +4466,42 @@ def check_daily_execution_cli(root: Path) -> list[Failure]:
4466
4466
  elif payload.get("result") != "pass":
4467
4467
  failures.append(Failure("daily-execution-cli", "`installed spec review record allow` must pass"))
4468
4468
 
4469
+ spec_plan_path = positive_target / ".loom/specs/INIT-0001/plan.md"
4470
+ spec_plan_text = spec_plan_path.read_text(encoding="utf-8")
4471
+ spec_plan_path.unlink()
4472
+ try:
4473
+ payload, error = load_command_json(
4474
+ root,
4475
+ [
4476
+ "python3",
4477
+ str(install_root / "loom-spec-review" / "scripts" / "loom-spec-review.py"),
4478
+ "review",
4479
+ "record",
4480
+ "--target",
4481
+ str(positive_target),
4482
+ "--item",
4483
+ "INIT-0001",
4484
+ "--review-file",
4485
+ ".loom/reviews/INIT-0001.spec.json",
4486
+ "--decision",
4487
+ "allow",
4488
+ "--kind",
4489
+ "spec_review",
4490
+ "--summary",
4491
+ "Incomplete formal spec suite should not be approved.",
4492
+ "--reviewer",
4493
+ "loom-check",
4494
+ ],
4495
+ )
4496
+ if error:
4497
+ failures.append(Failure("daily-execution-cli", f"`installed incomplete spec review record` failed: {error}"))
4498
+ elif payload.get("result") != "block":
4499
+ failures.append(Failure("daily-execution-cli", "`installed incomplete spec review record` must block"))
4500
+ elif not any("plan.md" in str(item) for item in payload.get("missing_inputs", [])):
4501
+ failures.append(Failure("daily-execution-cli", "`installed incomplete spec review record` must name the missing plan.md"))
4502
+ finally:
4503
+ spec_plan_path.write_text(spec_plan_text, encoding="utf-8")
4504
+
4469
4505
  payload, error = load_command_json(
4470
4506
  root,
4471
4507
  [
@@ -1541,6 +1541,16 @@ def formal_spec_path(context: dict[str, Any]) -> str | None:
1541
1541
  return None
1542
1542
 
1543
1543
 
1544
+ def formal_spec_suite_status(context: dict[str, Any]) -> tuple[dict[str, str], list[str]]:
1545
+ suite = spec_suite_paths(context)
1546
+ missing = [
1547
+ path
1548
+ for path in (suite["spec"], suite["plan"], suite["implementation_contract"])
1549
+ if not (context["target_root"] / path).is_file()
1550
+ ]
1551
+ return suite, missing
1552
+
1553
+
1544
1554
  def spec_suite_paths(context: dict[str, Any]) -> dict[str, str]:
1545
1555
  item_id = context["item_id"]
1546
1556
  candidates = [
@@ -1757,15 +1767,25 @@ def review_gate_payload(
1757
1767
 
1758
1768
 
1759
1769
  def spec_review_gate_payload(context: dict[str, Any]) -> dict[str, Any]:
1760
- spec_path = formal_spec_path(context)
1761
- return review_gate_payload(
1770
+ suite, missing_suite_paths = formal_spec_suite_status(context)
1771
+ spec_path = suite["spec"] if not missing_suite_paths else formal_spec_path(context)
1772
+ payload = review_gate_payload(
1762
1773
  context,
1763
1774
  review_path=default_spec_review_path(context["item_id"]),
1764
1775
  expected_kind="spec_review",
1765
1776
  gate_name="spec_review",
1766
- required=spec_path is not None,
1777
+ required=not missing_suite_paths,
1767
1778
  path_label=spec_path,
1768
1779
  )
1780
+ payload["formal_spec_suite"] = suite
1781
+ if missing_suite_paths:
1782
+ payload["result"] = "block"
1783
+ payload["summary"] = "spec review is blocked until the complete formal spec suite is present."
1784
+ payload["missing_inputs"] = [
1785
+ f"missing formal spec suite file: {path}" for path in missing_suite_paths
1786
+ ] + list(payload.get("missing_inputs", []))
1787
+ payload["fallback_to"] = "build"
1788
+ return payload
1769
1789
 
1770
1790
 
1771
1791
  def implementation_review_status_payload(context: dict[str, Any]) -> dict[str, Any]:
@@ -6813,15 +6833,17 @@ def handle_review(args: argparse.Namespace) -> int:
6813
6833
  }
6814
6834
  )
6815
6835
  if args.decision == "allow" and args.kind == "spec_review":
6816
- spec_path = formal_spec_path(context)
6817
- if spec_path is None:
6836
+ _, missing_suite_paths = formal_spec_suite_status(context)
6837
+ if missing_suite_paths:
6818
6838
  return emit(
6819
6839
  {
6820
6840
  "command": "review",
6821
6841
  "operation": "record",
6822
6842
  "result": "block",
6823
- "summary": "spec review cannot be recorded as `allow` without a readable formal spec path.",
6824
- "missing_inputs": ["formal spec path"],
6843
+ "summary": "spec review cannot be recorded as `allow` without the complete formal spec suite.",
6844
+ "missing_inputs": [
6845
+ f"missing formal spec suite file: {path}" for path in missing_suite_paths
6846
+ ],
6825
6847
  "fallback_to": "build",
6826
6848
  "build_checkpoint": build_payload,
6827
6849
  }
@@ -4466,6 +4466,42 @@ def check_daily_execution_cli(root: Path) -> list[Failure]:
4466
4466
  elif payload.get("result") != "pass":
4467
4467
  failures.append(Failure("daily-execution-cli", "`installed spec review record allow` must pass"))
4468
4468
 
4469
+ spec_plan_path = positive_target / ".loom/specs/INIT-0001/plan.md"
4470
+ spec_plan_text = spec_plan_path.read_text(encoding="utf-8")
4471
+ spec_plan_path.unlink()
4472
+ try:
4473
+ payload, error = load_command_json(
4474
+ root,
4475
+ [
4476
+ "python3",
4477
+ str(install_root / "loom-spec-review" / "scripts" / "loom-spec-review.py"),
4478
+ "review",
4479
+ "record",
4480
+ "--target",
4481
+ str(positive_target),
4482
+ "--item",
4483
+ "INIT-0001",
4484
+ "--review-file",
4485
+ ".loom/reviews/INIT-0001.spec.json",
4486
+ "--decision",
4487
+ "allow",
4488
+ "--kind",
4489
+ "spec_review",
4490
+ "--summary",
4491
+ "Incomplete formal spec suite should not be approved.",
4492
+ "--reviewer",
4493
+ "loom-check",
4494
+ ],
4495
+ )
4496
+ if error:
4497
+ failures.append(Failure("daily-execution-cli", f"`installed incomplete spec review record` failed: {error}"))
4498
+ elif payload.get("result") != "block":
4499
+ failures.append(Failure("daily-execution-cli", "`installed incomplete spec review record` must block"))
4500
+ elif not any("plan.md" in str(item) for item in payload.get("missing_inputs", [])):
4501
+ failures.append(Failure("daily-execution-cli", "`installed incomplete spec review record` must name the missing plan.md"))
4502
+ finally:
4503
+ spec_plan_path.write_text(spec_plan_text, encoding="utf-8")
4504
+
4469
4505
  payload, error = load_command_json(
4470
4506
  root,
4471
4507
  [
@@ -1541,6 +1541,16 @@ def formal_spec_path(context: dict[str, Any]) -> str | None:
1541
1541
  return None
1542
1542
 
1543
1543
 
1544
+ def formal_spec_suite_status(context: dict[str, Any]) -> tuple[dict[str, str], list[str]]:
1545
+ suite = spec_suite_paths(context)
1546
+ missing = [
1547
+ path
1548
+ for path in (suite["spec"], suite["plan"], suite["implementation_contract"])
1549
+ if not (context["target_root"] / path).is_file()
1550
+ ]
1551
+ return suite, missing
1552
+
1553
+
1544
1554
  def spec_suite_paths(context: dict[str, Any]) -> dict[str, str]:
1545
1555
  item_id = context["item_id"]
1546
1556
  candidates = [
@@ -1757,15 +1767,25 @@ def review_gate_payload(
1757
1767
 
1758
1768
 
1759
1769
  def spec_review_gate_payload(context: dict[str, Any]) -> dict[str, Any]:
1760
- spec_path = formal_spec_path(context)
1761
- return review_gate_payload(
1770
+ suite, missing_suite_paths = formal_spec_suite_status(context)
1771
+ spec_path = suite["spec"] if not missing_suite_paths else formal_spec_path(context)
1772
+ payload = review_gate_payload(
1762
1773
  context,
1763
1774
  review_path=default_spec_review_path(context["item_id"]),
1764
1775
  expected_kind="spec_review",
1765
1776
  gate_name="spec_review",
1766
- required=spec_path is not None,
1777
+ required=not missing_suite_paths,
1767
1778
  path_label=spec_path,
1768
1779
  )
1780
+ payload["formal_spec_suite"] = suite
1781
+ if missing_suite_paths:
1782
+ payload["result"] = "block"
1783
+ payload["summary"] = "spec review is blocked until the complete formal spec suite is present."
1784
+ payload["missing_inputs"] = [
1785
+ f"missing formal spec suite file: {path}" for path in missing_suite_paths
1786
+ ] + list(payload.get("missing_inputs", []))
1787
+ payload["fallback_to"] = "build"
1788
+ return payload
1769
1789
 
1770
1790
 
1771
1791
  def implementation_review_status_payload(context: dict[str, Any]) -> dict[str, Any]:
@@ -6813,15 +6833,17 @@ def handle_review(args: argparse.Namespace) -> int:
6813
6833
  }
6814
6834
  )
6815
6835
  if args.decision == "allow" and args.kind == "spec_review":
6816
- spec_path = formal_spec_path(context)
6817
- if spec_path is None:
6836
+ _, missing_suite_paths = formal_spec_suite_status(context)
6837
+ if missing_suite_paths:
6818
6838
  return emit(
6819
6839
  {
6820
6840
  "command": "review",
6821
6841
  "operation": "record",
6822
6842
  "result": "block",
6823
- "summary": "spec review cannot be recorded as `allow` without a readable formal spec path.",
6824
- "missing_inputs": ["formal spec path"],
6843
+ "summary": "spec review cannot be recorded as `allow` without the complete formal spec suite.",
6844
+ "missing_inputs": [
6845
+ f"missing formal spec suite file: {path}" for path in missing_suite_paths
6846
+ ],
6825
6847
  "fallback_to": "build",
6826
6848
  "build_checkpoint": build_payload,
6827
6849
  }
@@ -4466,6 +4466,42 @@ def check_daily_execution_cli(root: Path) -> list[Failure]:
4466
4466
  elif payload.get("result") != "pass":
4467
4467
  failures.append(Failure("daily-execution-cli", "`installed spec review record allow` must pass"))
4468
4468
 
4469
+ spec_plan_path = positive_target / ".loom/specs/INIT-0001/plan.md"
4470
+ spec_plan_text = spec_plan_path.read_text(encoding="utf-8")
4471
+ spec_plan_path.unlink()
4472
+ try:
4473
+ payload, error = load_command_json(
4474
+ root,
4475
+ [
4476
+ "python3",
4477
+ str(install_root / "loom-spec-review" / "scripts" / "loom-spec-review.py"),
4478
+ "review",
4479
+ "record",
4480
+ "--target",
4481
+ str(positive_target),
4482
+ "--item",
4483
+ "INIT-0001",
4484
+ "--review-file",
4485
+ ".loom/reviews/INIT-0001.spec.json",
4486
+ "--decision",
4487
+ "allow",
4488
+ "--kind",
4489
+ "spec_review",
4490
+ "--summary",
4491
+ "Incomplete formal spec suite should not be approved.",
4492
+ "--reviewer",
4493
+ "loom-check",
4494
+ ],
4495
+ )
4496
+ if error:
4497
+ failures.append(Failure("daily-execution-cli", f"`installed incomplete spec review record` failed: {error}"))
4498
+ elif payload.get("result") != "block":
4499
+ failures.append(Failure("daily-execution-cli", "`installed incomplete spec review record` must block"))
4500
+ elif not any("plan.md" in str(item) for item in payload.get("missing_inputs", [])):
4501
+ failures.append(Failure("daily-execution-cli", "`installed incomplete spec review record` must name the missing plan.md"))
4502
+ finally:
4503
+ spec_plan_path.write_text(spec_plan_text, encoding="utf-8")
4504
+
4469
4505
  payload, error = load_command_json(
4470
4506
  root,
4471
4507
  [
@@ -1541,6 +1541,16 @@ def formal_spec_path(context: dict[str, Any]) -> str | None:
1541
1541
  return None
1542
1542
 
1543
1543
 
1544
+ def formal_spec_suite_status(context: dict[str, Any]) -> tuple[dict[str, str], list[str]]:
1545
+ suite = spec_suite_paths(context)
1546
+ missing = [
1547
+ path
1548
+ for path in (suite["spec"], suite["plan"], suite["implementation_contract"])
1549
+ if not (context["target_root"] / path).is_file()
1550
+ ]
1551
+ return suite, missing
1552
+
1553
+
1544
1554
  def spec_suite_paths(context: dict[str, Any]) -> dict[str, str]:
1545
1555
  item_id = context["item_id"]
1546
1556
  candidates = [
@@ -1757,15 +1767,25 @@ def review_gate_payload(
1757
1767
 
1758
1768
 
1759
1769
  def spec_review_gate_payload(context: dict[str, Any]) -> dict[str, Any]:
1760
- spec_path = formal_spec_path(context)
1761
- return review_gate_payload(
1770
+ suite, missing_suite_paths = formal_spec_suite_status(context)
1771
+ spec_path = suite["spec"] if not missing_suite_paths else formal_spec_path(context)
1772
+ payload = review_gate_payload(
1762
1773
  context,
1763
1774
  review_path=default_spec_review_path(context["item_id"]),
1764
1775
  expected_kind="spec_review",
1765
1776
  gate_name="spec_review",
1766
- required=spec_path is not None,
1777
+ required=not missing_suite_paths,
1767
1778
  path_label=spec_path,
1768
1779
  )
1780
+ payload["formal_spec_suite"] = suite
1781
+ if missing_suite_paths:
1782
+ payload["result"] = "block"
1783
+ payload["summary"] = "spec review is blocked until the complete formal spec suite is present."
1784
+ payload["missing_inputs"] = [
1785
+ f"missing formal spec suite file: {path}" for path in missing_suite_paths
1786
+ ] + list(payload.get("missing_inputs", []))
1787
+ payload["fallback_to"] = "build"
1788
+ return payload
1769
1789
 
1770
1790
 
1771
1791
  def implementation_review_status_payload(context: dict[str, Any]) -> dict[str, Any]:
@@ -6813,15 +6833,17 @@ def handle_review(args: argparse.Namespace) -> int:
6813
6833
  }
6814
6834
  )
6815
6835
  if args.decision == "allow" and args.kind == "spec_review":
6816
- spec_path = formal_spec_path(context)
6817
- if spec_path is None:
6836
+ _, missing_suite_paths = formal_spec_suite_status(context)
6837
+ if missing_suite_paths:
6818
6838
  return emit(
6819
6839
  {
6820
6840
  "command": "review",
6821
6841
  "operation": "record",
6822
6842
  "result": "block",
6823
- "summary": "spec review cannot be recorded as `allow` without a readable formal spec path.",
6824
- "missing_inputs": ["formal spec path"],
6843
+ "summary": "spec review cannot be recorded as `allow` without the complete formal spec suite.",
6844
+ "missing_inputs": [
6845
+ f"missing formal spec suite file: {path}" for path in missing_suite_paths
6846
+ ],
6825
6847
  "fallback_to": "build",
6826
6848
  "build_checkpoint": build_payload,
6827
6849
  }
@@ -4466,6 +4466,42 @@ def check_daily_execution_cli(root: Path) -> list[Failure]:
4466
4466
  elif payload.get("result") != "pass":
4467
4467
  failures.append(Failure("daily-execution-cli", "`installed spec review record allow` must pass"))
4468
4468
 
4469
+ spec_plan_path = positive_target / ".loom/specs/INIT-0001/plan.md"
4470
+ spec_plan_text = spec_plan_path.read_text(encoding="utf-8")
4471
+ spec_plan_path.unlink()
4472
+ try:
4473
+ payload, error = load_command_json(
4474
+ root,
4475
+ [
4476
+ "python3",
4477
+ str(install_root / "loom-spec-review" / "scripts" / "loom-spec-review.py"),
4478
+ "review",
4479
+ "record",
4480
+ "--target",
4481
+ str(positive_target),
4482
+ "--item",
4483
+ "INIT-0001",
4484
+ "--review-file",
4485
+ ".loom/reviews/INIT-0001.spec.json",
4486
+ "--decision",
4487
+ "allow",
4488
+ "--kind",
4489
+ "spec_review",
4490
+ "--summary",
4491
+ "Incomplete formal spec suite should not be approved.",
4492
+ "--reviewer",
4493
+ "loom-check",
4494
+ ],
4495
+ )
4496
+ if error:
4497
+ failures.append(Failure("daily-execution-cli", f"`installed incomplete spec review record` failed: {error}"))
4498
+ elif payload.get("result") != "block":
4499
+ failures.append(Failure("daily-execution-cli", "`installed incomplete spec review record` must block"))
4500
+ elif not any("plan.md" in str(item) for item in payload.get("missing_inputs", [])):
4501
+ failures.append(Failure("daily-execution-cli", "`installed incomplete spec review record` must name the missing plan.md"))
4502
+ finally:
4503
+ spec_plan_path.write_text(spec_plan_text, encoding="utf-8")
4504
+
4469
4505
  payload, error = load_command_json(
4470
4506
  root,
4471
4507
  [
@@ -1541,6 +1541,16 @@ def formal_spec_path(context: dict[str, Any]) -> str | None:
1541
1541
  return None
1542
1542
 
1543
1543
 
1544
+ def formal_spec_suite_status(context: dict[str, Any]) -> tuple[dict[str, str], list[str]]:
1545
+ suite = spec_suite_paths(context)
1546
+ missing = [
1547
+ path
1548
+ for path in (suite["spec"], suite["plan"], suite["implementation_contract"])
1549
+ if not (context["target_root"] / path).is_file()
1550
+ ]
1551
+ return suite, missing
1552
+
1553
+
1544
1554
  def spec_suite_paths(context: dict[str, Any]) -> dict[str, str]:
1545
1555
  item_id = context["item_id"]
1546
1556
  candidates = [
@@ -1757,15 +1767,25 @@ def review_gate_payload(
1757
1767
 
1758
1768
 
1759
1769
  def spec_review_gate_payload(context: dict[str, Any]) -> dict[str, Any]:
1760
- spec_path = formal_spec_path(context)
1761
- return review_gate_payload(
1770
+ suite, missing_suite_paths = formal_spec_suite_status(context)
1771
+ spec_path = suite["spec"] if not missing_suite_paths else formal_spec_path(context)
1772
+ payload = review_gate_payload(
1762
1773
  context,
1763
1774
  review_path=default_spec_review_path(context["item_id"]),
1764
1775
  expected_kind="spec_review",
1765
1776
  gate_name="spec_review",
1766
- required=spec_path is not None,
1777
+ required=not missing_suite_paths,
1767
1778
  path_label=spec_path,
1768
1779
  )
1780
+ payload["formal_spec_suite"] = suite
1781
+ if missing_suite_paths:
1782
+ payload["result"] = "block"
1783
+ payload["summary"] = "spec review is blocked until the complete formal spec suite is present."
1784
+ payload["missing_inputs"] = [
1785
+ f"missing formal spec suite file: {path}" for path in missing_suite_paths
1786
+ ] + list(payload.get("missing_inputs", []))
1787
+ payload["fallback_to"] = "build"
1788
+ return payload
1769
1789
 
1770
1790
 
1771
1791
  def implementation_review_status_payload(context: dict[str, Any]) -> dict[str, Any]:
@@ -6813,15 +6833,17 @@ def handle_review(args: argparse.Namespace) -> int:
6813
6833
  }
6814
6834
  )
6815
6835
  if args.decision == "allow" and args.kind == "spec_review":
6816
- spec_path = formal_spec_path(context)
6817
- if spec_path is None:
6836
+ _, missing_suite_paths = formal_spec_suite_status(context)
6837
+ if missing_suite_paths:
6818
6838
  return emit(
6819
6839
  {
6820
6840
  "command": "review",
6821
6841
  "operation": "record",
6822
6842
  "result": "block",
6823
- "summary": "spec review cannot be recorded as `allow` without a readable formal spec path.",
6824
- "missing_inputs": ["formal spec path"],
6843
+ "summary": "spec review cannot be recorded as `allow` without the complete formal spec suite.",
6844
+ "missing_inputs": [
6845
+ f"missing formal spec suite file: {path}" for path in missing_suite_paths
6846
+ ],
6825
6847
  "fallback_to": "build",
6826
6848
  "build_checkpoint": build_payload,
6827
6849
  }