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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mc-and-his-agents/loom-installer",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
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": "e0d9542d7f67ae153e1b884c11bbc848943941cb",
5
+ "source_commit": "b63bb9c0ffc94f9c3f9d16d1aa8293e58e56609a",
6
6
  "source_ref": "main",
7
- "built_at": "2026-04-28T11:55:17+08:00",
7
+ "built_at": "2026-04-28T15:13:56+08:00",
8
8
  "runtime": {
9
9
  "python_minimum": "3.10",
10
10
  "python_recommended": "3.11+"
@@ -633,8 +633,8 @@
633
633
  },
634
634
  {
635
635
  "path": "plugin/loom/skills/shared/scripts/loom_check.py",
636
- "bytes": 365681,
637
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
636
+ "bytes": 372465,
637
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
638
638
  },
639
639
  {
640
640
  "path": "plugin/loom/skills/shared/scripts/loom_flow.py",
@@ -1223,8 +1223,8 @@
1223
1223
  },
1224
1224
  {
1225
1225
  "path": "skills/loom-adopt/.loom-runtime/shared/scripts/loom_check.py",
1226
- "bytes": 365681,
1227
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
1226
+ "bytes": 372465,
1227
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
1228
1228
  },
1229
1229
  {
1230
1230
  "path": "skills/loom-adopt/.loom-runtime/shared/scripts/loom_flow.py",
@@ -1843,8 +1843,8 @@
1843
1843
  },
1844
1844
  {
1845
1845
  "path": "skills/loom-handoff/.loom-runtime/shared/scripts/loom_check.py",
1846
- "bytes": 365681,
1847
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
1846
+ "bytes": 372465,
1847
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
1848
1848
  },
1849
1849
  {
1850
1850
  "path": "skills/loom-handoff/.loom-runtime/shared/scripts/loom_flow.py",
@@ -2463,8 +2463,8 @@
2463
2463
  },
2464
2464
  {
2465
2465
  "path": "skills/loom-init/.loom-runtime/shared/scripts/loom_check.py",
2466
- "bytes": 365681,
2467
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
2466
+ "bytes": 372465,
2467
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
2468
2468
  },
2469
2469
  {
2470
2470
  "path": "skills/loom-init/.loom-runtime/shared/scripts/loom_flow.py",
@@ -3088,8 +3088,8 @@
3088
3088
  },
3089
3089
  {
3090
3090
  "path": "skills/loom-merge-ready/.loom-runtime/shared/scripts/loom_check.py",
3091
- "bytes": 365681,
3092
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
3091
+ "bytes": 372465,
3092
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
3093
3093
  },
3094
3094
  {
3095
3095
  "path": "skills/loom-merge-ready/.loom-runtime/shared/scripts/loom_flow.py",
@@ -3708,8 +3708,8 @@
3708
3708
  },
3709
3709
  {
3710
3710
  "path": "skills/loom-pre-review/.loom-runtime/shared/scripts/loom_check.py",
3711
- "bytes": 365681,
3712
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
3711
+ "bytes": 372465,
3712
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
3713
3713
  },
3714
3714
  {
3715
3715
  "path": "skills/loom-pre-review/.loom-runtime/shared/scripts/loom_flow.py",
@@ -4328,8 +4328,8 @@
4328
4328
  },
4329
4329
  {
4330
4330
  "path": "skills/loom-resume/.loom-runtime/shared/scripts/loom_check.py",
4331
- "bytes": 365681,
4332
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
4331
+ "bytes": 372465,
4332
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
4333
4333
  },
4334
4334
  {
4335
4335
  "path": "skills/loom-resume/.loom-runtime/shared/scripts/loom_flow.py",
@@ -4948,8 +4948,8 @@
4948
4948
  },
4949
4949
  {
4950
4950
  "path": "skills/loom-retire/.loom-runtime/shared/scripts/loom_check.py",
4951
- "bytes": 365681,
4952
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
4951
+ "bytes": 372465,
4952
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
4953
4953
  },
4954
4954
  {
4955
4955
  "path": "skills/loom-retire/.loom-runtime/shared/scripts/loom_flow.py",
@@ -5568,8 +5568,8 @@
5568
5568
  },
5569
5569
  {
5570
5570
  "path": "skills/loom-review/.loom-runtime/shared/scripts/loom_check.py",
5571
- "bytes": 365681,
5572
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
5571
+ "bytes": 372465,
5572
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
5573
5573
  },
5574
5574
  {
5575
5575
  "path": "skills/loom-review/.loom-runtime/shared/scripts/loom_flow.py",
@@ -6188,8 +6188,8 @@
6188
6188
  },
6189
6189
  {
6190
6190
  "path": "skills/loom-spec-review/.loom-runtime/shared/scripts/loom_check.py",
6191
- "bytes": 365681,
6192
- "sha256": "e48281477bbb35b887e21034570ed519a40dae718ea97e99886a66b04dbd1d50"
6191
+ "bytes": 372465,
6192
+ "sha256": "c9dc22036e5b4ce50f3b434136d6398334a3845b9b705aa8746fc0049186bdff"
6193
6193
  },
6194
6194
  {
6195
6195
  "path": "skills/loom-spec-review/.loom-runtime/shared/scripts/loom_flow.py",
@@ -2410,6 +2410,131 @@ def check_demo_repo_local_cli(root: Path) -> list[Failure]:
2410
2410
  return failures
2411
2411
 
2412
2412
 
2413
+ def check_root_self_adoption_carrier(root: Path) -> list[Failure]:
2414
+ failures: list[Failure] = []
2415
+ carrier_root = root / ".loom"
2416
+ if not carrier_root.exists():
2417
+ return failures
2418
+
2419
+ required_paths = (
2420
+ ".loom/bootstrap/manifest.json",
2421
+ ".loom/bootstrap/init-result.json",
2422
+ ".loom/bin/loom_init.py",
2423
+ ".loom/bin/loom_flow.py",
2424
+ ".loom/companion/README.md",
2425
+ ".loom/companion/manifest.json",
2426
+ ".loom/companion/repo-interface.json",
2427
+ ".loom/companion/interop.json",
2428
+ ".loom/work-items/INIT-0001.md",
2429
+ ".loom/progress/INIT-0001.md",
2430
+ ".loom/reviews/INIT-0001.json",
2431
+ ".loom/status/current.md",
2432
+ "docs/evidence/validations/validation-loom-self-governance-adoption.md",
2433
+ )
2434
+ failures.extend(check_required_paths(root, "root-self-adoption", required_paths))
2435
+
2436
+ commands = (
2437
+ (
2438
+ "root verify",
2439
+ ["python3", ".loom/bin/loom_init.py", "verify", "--target", "."],
2440
+ "loom-init-verify",
2441
+ {"ok": True},
2442
+ ),
2443
+ (
2444
+ "root governance status",
2445
+ ["python3", ".loom/bin/loom_flow.py", "governance-profile", "status", "--target", "."],
2446
+ "governance-status",
2447
+ {"result": "pass"},
2448
+ ),
2449
+ (
2450
+ "root runtime parity",
2451
+ ["python3", ".loom/bin/loom_flow.py", "runtime-parity", "validate", "--target", "."],
2452
+ "runtime-parity",
2453
+ {"result": "pass", "schema_version": "loom-runtime-parity/v1"},
2454
+ ),
2455
+ (
2456
+ "root adopt verify",
2457
+ ["python3", ".loom/bin/loom_flow.py", "adopt", "verify", "--target", ".", "--item", "INIT-0001"],
2458
+ "adopt-verify",
2459
+ {"result": "pass", "schema_version": "loom-adoption-verify/v1"},
2460
+ ),
2461
+ (
2462
+ "root carrier refresh",
2463
+ ["python3", ".loom/bin/loom_flow.py", "carrier", "refresh", "--target", ".", "--dry-run"],
2464
+ "carrier-refresh",
2465
+ {"result": "pass", "schema_version": "loom-carrier-refresh/v1"},
2466
+ ),
2467
+ (
2468
+ "root shadow parity",
2469
+ ["python3", ".loom/bin/loom_flow.py", "shadow-parity", "--target", "."],
2470
+ "shadow-parity",
2471
+ {"result": "pass"},
2472
+ ),
2473
+ )
2474
+ for label, args, kind, expected in commands:
2475
+ payload, error = load_command_json(root, args)
2476
+ if error:
2477
+ failures.append(Failure("root-self-adoption", f"`{label}` failed: {error}"))
2478
+ continue
2479
+ for key, value in expected.items():
2480
+ if payload.get(key) != value:
2481
+ failures.append(Failure("root-self-adoption", f"`{label}` must report `{key}: {value}`"))
2482
+ runtime_payload = payload.get("runtime_state")
2483
+ if kind == "loom-init-verify":
2484
+ runtime_payload = payload.get("runtime_state")
2485
+ if runtime_payload is not None:
2486
+ require_runtime_state_payload(
2487
+ failures,
2488
+ category="root-self-adoption",
2489
+ context=f"`{label}`",
2490
+ payload=runtime_payload,
2491
+ expected_scene="installed-runtime",
2492
+ expected_carrier="bootstrapped-target-runtime",
2493
+ allowed_results={"pass"},
2494
+ )
2495
+ if kind == "governance-status":
2496
+ maturity = payload.get("maturity")
2497
+ if not isinstance(maturity, dict) or maturity.get("current") != "strong":
2498
+ failures.append(Failure("root-self-adoption", "`root governance status` must report strong maturity after self-management binding"))
2499
+ if kind == "runtime-parity":
2500
+ checks = payload.get("checks")
2501
+ names = {check.get("name") for check in checks if isinstance(check, dict)} if isinstance(checks, list) else set()
2502
+ if "shadow_parity_boundary" not in names or "controlled_merge_contract" not in names:
2503
+ failures.append(Failure("root-self-adoption", "`root runtime parity` must cover shadow and controlled merge boundaries"))
2504
+ if kind == "adopt-verify":
2505
+ roundtrip = payload.get("producer_consumer_roundtrip")
2506
+ if not isinstance(roundtrip, dict):
2507
+ failures.append(Failure("root-self-adoption", "`root adopt verify` must include producer_consumer_roundtrip"))
2508
+ elif roundtrip.get("bypass_check", {}).get("result") != "pass":
2509
+ failures.append(Failure("root-self-adoption", "`root adopt verify` must prove required section deletion blocks"))
2510
+ if kind == "carrier-refresh":
2511
+ if payload.get("refresh_needed") not in ([], None):
2512
+ failures.append(Failure("root-self-adoption", "`root carrier refresh --dry-run` must not report runtime provenance drift"))
2513
+ review = payload.get("review")
2514
+ if isinstance(review, dict):
2515
+ head_binding = review.get("head_binding")
2516
+ if isinstance(head_binding, dict) and head_binding.get("status") == "stale":
2517
+ failures.append(Failure("root-self-adoption", "`root carrier refresh --dry-run` must detect stale review head binding"))
2518
+ if kind == "shadow-parity":
2519
+ reports = payload.get("reports")
2520
+ report_surfaces = {
2521
+ report.get("surface")
2522
+ for report in reports
2523
+ if isinstance(report, dict)
2524
+ } if isinstance(reports, list) else set()
2525
+ if report_surfaces != {"admission", "review", "merge_ready", "closeout"}:
2526
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must cover admission, review, merge_ready, and closeout"))
2527
+ surface = payload.get("governance_surface")
2528
+ if isinstance(surface, dict):
2529
+ repo_interface = surface.get("repo_interface")
2530
+ repo_interop = surface.get("repo_interop")
2531
+ if not isinstance(repo_interface, dict) or repo_interface.get("availability") != "present":
2532
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must consume the root repo companion interface"))
2533
+ if not isinstance(repo_interop, dict) or repo_interop.get("availability") != "present":
2534
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must consume the root repo interop contract"))
2535
+ return failures
2536
+
2537
+
2413
2538
  def check_deep_existing_repo_bootstrap(root: Path) -> list[Failure]:
2414
2539
  failures: list[Failure] = []
2415
2540
  with tempfile.TemporaryDirectory(prefix="loom-check-deep-existing-") as tmp:
@@ -5000,7 +5125,11 @@ def check_daily_execution_cli(root: Path) -> list[Failure]:
5000
5125
  except subprocess.TimeoutExpired:
5001
5126
  gh_auth_probe = None
5002
5127
  gh_auth_ready = gh_auth_probe is not None and gh_auth_probe.returncode == 0
5003
- if gh_auth_ready:
5128
+ # GitHub Actions' ephemeral token is enough for self-governance host binding
5129
+ # reads, but it is not a stable authority for historical live issue/PR/project
5130
+ # samples. Keep those samples as local authenticated coverage instead of
5131
+ # making CI depend on mutable host permissions.
5132
+ if gh_auth_ready and os.environ.get("GITHUB_ACTIONS") != "true":
5004
5133
  with tempfile.TemporaryDirectory(prefix="loom-check-installed-post-merge-") as tmp:
5005
5134
  tmp_root = Path(tmp)
5006
5135
  install_root = tmp_root / "installed" / "skills"
@@ -7449,6 +7578,7 @@ def collect_failures(root: Path) -> list[Failure]:
7449
7578
  failures.extend(check_demo_assets(root))
7450
7579
  failures.extend(check_demo_fact_chain(root))
7451
7580
  failures.extend(check_demo_repo_local_cli(root))
7581
+ failures.extend(check_root_self_adoption_carrier(root))
7452
7582
  failures.extend(check_deep_existing_repo_bootstrap(root))
7453
7583
  failures.extend(check_daily_execution_cli(root))
7454
7584
  failures.extend(check_repo_companion_interface_contracts(root))
@@ -7463,7 +7593,7 @@ def collect_failures(root: Path) -> list[Failure]:
7463
7593
 
7464
7594
 
7465
7595
  def print_report(root: Path, failures: list[Failure]) -> None:
7466
- categories_checked = 18
7596
+ categories_checked = 19
7467
7597
  if not failures:
7468
7598
  print(f"loom_check: OK ({root})")
7469
7599
  print(f"checked {categories_checked} surfaces")
@@ -2410,6 +2410,131 @@ def check_demo_repo_local_cli(root: Path) -> list[Failure]:
2410
2410
  return failures
2411
2411
 
2412
2412
 
2413
+ def check_root_self_adoption_carrier(root: Path) -> list[Failure]:
2414
+ failures: list[Failure] = []
2415
+ carrier_root = root / ".loom"
2416
+ if not carrier_root.exists():
2417
+ return failures
2418
+
2419
+ required_paths = (
2420
+ ".loom/bootstrap/manifest.json",
2421
+ ".loom/bootstrap/init-result.json",
2422
+ ".loom/bin/loom_init.py",
2423
+ ".loom/bin/loom_flow.py",
2424
+ ".loom/companion/README.md",
2425
+ ".loom/companion/manifest.json",
2426
+ ".loom/companion/repo-interface.json",
2427
+ ".loom/companion/interop.json",
2428
+ ".loom/work-items/INIT-0001.md",
2429
+ ".loom/progress/INIT-0001.md",
2430
+ ".loom/reviews/INIT-0001.json",
2431
+ ".loom/status/current.md",
2432
+ "docs/evidence/validations/validation-loom-self-governance-adoption.md",
2433
+ )
2434
+ failures.extend(check_required_paths(root, "root-self-adoption", required_paths))
2435
+
2436
+ commands = (
2437
+ (
2438
+ "root verify",
2439
+ ["python3", ".loom/bin/loom_init.py", "verify", "--target", "."],
2440
+ "loom-init-verify",
2441
+ {"ok": True},
2442
+ ),
2443
+ (
2444
+ "root governance status",
2445
+ ["python3", ".loom/bin/loom_flow.py", "governance-profile", "status", "--target", "."],
2446
+ "governance-status",
2447
+ {"result": "pass"},
2448
+ ),
2449
+ (
2450
+ "root runtime parity",
2451
+ ["python3", ".loom/bin/loom_flow.py", "runtime-parity", "validate", "--target", "."],
2452
+ "runtime-parity",
2453
+ {"result": "pass", "schema_version": "loom-runtime-parity/v1"},
2454
+ ),
2455
+ (
2456
+ "root adopt verify",
2457
+ ["python3", ".loom/bin/loom_flow.py", "adopt", "verify", "--target", ".", "--item", "INIT-0001"],
2458
+ "adopt-verify",
2459
+ {"result": "pass", "schema_version": "loom-adoption-verify/v1"},
2460
+ ),
2461
+ (
2462
+ "root carrier refresh",
2463
+ ["python3", ".loom/bin/loom_flow.py", "carrier", "refresh", "--target", ".", "--dry-run"],
2464
+ "carrier-refresh",
2465
+ {"result": "pass", "schema_version": "loom-carrier-refresh/v1"},
2466
+ ),
2467
+ (
2468
+ "root shadow parity",
2469
+ ["python3", ".loom/bin/loom_flow.py", "shadow-parity", "--target", "."],
2470
+ "shadow-parity",
2471
+ {"result": "pass"},
2472
+ ),
2473
+ )
2474
+ for label, args, kind, expected in commands:
2475
+ payload, error = load_command_json(root, args)
2476
+ if error:
2477
+ failures.append(Failure("root-self-adoption", f"`{label}` failed: {error}"))
2478
+ continue
2479
+ for key, value in expected.items():
2480
+ if payload.get(key) != value:
2481
+ failures.append(Failure("root-self-adoption", f"`{label}` must report `{key}: {value}`"))
2482
+ runtime_payload = payload.get("runtime_state")
2483
+ if kind == "loom-init-verify":
2484
+ runtime_payload = payload.get("runtime_state")
2485
+ if runtime_payload is not None:
2486
+ require_runtime_state_payload(
2487
+ failures,
2488
+ category="root-self-adoption",
2489
+ context=f"`{label}`",
2490
+ payload=runtime_payload,
2491
+ expected_scene="installed-runtime",
2492
+ expected_carrier="bootstrapped-target-runtime",
2493
+ allowed_results={"pass"},
2494
+ )
2495
+ if kind == "governance-status":
2496
+ maturity = payload.get("maturity")
2497
+ if not isinstance(maturity, dict) or maturity.get("current") != "strong":
2498
+ failures.append(Failure("root-self-adoption", "`root governance status` must report strong maturity after self-management binding"))
2499
+ if kind == "runtime-parity":
2500
+ checks = payload.get("checks")
2501
+ names = {check.get("name") for check in checks if isinstance(check, dict)} if isinstance(checks, list) else set()
2502
+ if "shadow_parity_boundary" not in names or "controlled_merge_contract" not in names:
2503
+ failures.append(Failure("root-self-adoption", "`root runtime parity` must cover shadow and controlled merge boundaries"))
2504
+ if kind == "adopt-verify":
2505
+ roundtrip = payload.get("producer_consumer_roundtrip")
2506
+ if not isinstance(roundtrip, dict):
2507
+ failures.append(Failure("root-self-adoption", "`root adopt verify` must include producer_consumer_roundtrip"))
2508
+ elif roundtrip.get("bypass_check", {}).get("result") != "pass":
2509
+ failures.append(Failure("root-self-adoption", "`root adopt verify` must prove required section deletion blocks"))
2510
+ if kind == "carrier-refresh":
2511
+ if payload.get("refresh_needed") not in ([], None):
2512
+ failures.append(Failure("root-self-adoption", "`root carrier refresh --dry-run` must not report runtime provenance drift"))
2513
+ review = payload.get("review")
2514
+ if isinstance(review, dict):
2515
+ head_binding = review.get("head_binding")
2516
+ if isinstance(head_binding, dict) and head_binding.get("status") == "stale":
2517
+ failures.append(Failure("root-self-adoption", "`root carrier refresh --dry-run` must detect stale review head binding"))
2518
+ if kind == "shadow-parity":
2519
+ reports = payload.get("reports")
2520
+ report_surfaces = {
2521
+ report.get("surface")
2522
+ for report in reports
2523
+ if isinstance(report, dict)
2524
+ } if isinstance(reports, list) else set()
2525
+ if report_surfaces != {"admission", "review", "merge_ready", "closeout"}:
2526
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must cover admission, review, merge_ready, and closeout"))
2527
+ surface = payload.get("governance_surface")
2528
+ if isinstance(surface, dict):
2529
+ repo_interface = surface.get("repo_interface")
2530
+ repo_interop = surface.get("repo_interop")
2531
+ if not isinstance(repo_interface, dict) or repo_interface.get("availability") != "present":
2532
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must consume the root repo companion interface"))
2533
+ if not isinstance(repo_interop, dict) or repo_interop.get("availability") != "present":
2534
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must consume the root repo interop contract"))
2535
+ return failures
2536
+
2537
+
2413
2538
  def check_deep_existing_repo_bootstrap(root: Path) -> list[Failure]:
2414
2539
  failures: list[Failure] = []
2415
2540
  with tempfile.TemporaryDirectory(prefix="loom-check-deep-existing-") as tmp:
@@ -5000,7 +5125,11 @@ def check_daily_execution_cli(root: Path) -> list[Failure]:
5000
5125
  except subprocess.TimeoutExpired:
5001
5126
  gh_auth_probe = None
5002
5127
  gh_auth_ready = gh_auth_probe is not None and gh_auth_probe.returncode == 0
5003
- if gh_auth_ready:
5128
+ # GitHub Actions' ephemeral token is enough for self-governance host binding
5129
+ # reads, but it is not a stable authority for historical live issue/PR/project
5130
+ # samples. Keep those samples as local authenticated coverage instead of
5131
+ # making CI depend on mutable host permissions.
5132
+ if gh_auth_ready and os.environ.get("GITHUB_ACTIONS") != "true":
5004
5133
  with tempfile.TemporaryDirectory(prefix="loom-check-installed-post-merge-") as tmp:
5005
5134
  tmp_root = Path(tmp)
5006
5135
  install_root = tmp_root / "installed" / "skills"
@@ -7449,6 +7578,7 @@ def collect_failures(root: Path) -> list[Failure]:
7449
7578
  failures.extend(check_demo_assets(root))
7450
7579
  failures.extend(check_demo_fact_chain(root))
7451
7580
  failures.extend(check_demo_repo_local_cli(root))
7581
+ failures.extend(check_root_self_adoption_carrier(root))
7452
7582
  failures.extend(check_deep_existing_repo_bootstrap(root))
7453
7583
  failures.extend(check_daily_execution_cli(root))
7454
7584
  failures.extend(check_repo_companion_interface_contracts(root))
@@ -7463,7 +7593,7 @@ def collect_failures(root: Path) -> list[Failure]:
7463
7593
 
7464
7594
 
7465
7595
  def print_report(root: Path, failures: list[Failure]) -> None:
7466
- categories_checked = 18
7596
+ categories_checked = 19
7467
7597
  if not failures:
7468
7598
  print(f"loom_check: OK ({root})")
7469
7599
  print(f"checked {categories_checked} surfaces")
@@ -2410,6 +2410,131 @@ def check_demo_repo_local_cli(root: Path) -> list[Failure]:
2410
2410
  return failures
2411
2411
 
2412
2412
 
2413
+ def check_root_self_adoption_carrier(root: Path) -> list[Failure]:
2414
+ failures: list[Failure] = []
2415
+ carrier_root = root / ".loom"
2416
+ if not carrier_root.exists():
2417
+ return failures
2418
+
2419
+ required_paths = (
2420
+ ".loom/bootstrap/manifest.json",
2421
+ ".loom/bootstrap/init-result.json",
2422
+ ".loom/bin/loom_init.py",
2423
+ ".loom/bin/loom_flow.py",
2424
+ ".loom/companion/README.md",
2425
+ ".loom/companion/manifest.json",
2426
+ ".loom/companion/repo-interface.json",
2427
+ ".loom/companion/interop.json",
2428
+ ".loom/work-items/INIT-0001.md",
2429
+ ".loom/progress/INIT-0001.md",
2430
+ ".loom/reviews/INIT-0001.json",
2431
+ ".loom/status/current.md",
2432
+ "docs/evidence/validations/validation-loom-self-governance-adoption.md",
2433
+ )
2434
+ failures.extend(check_required_paths(root, "root-self-adoption", required_paths))
2435
+
2436
+ commands = (
2437
+ (
2438
+ "root verify",
2439
+ ["python3", ".loom/bin/loom_init.py", "verify", "--target", "."],
2440
+ "loom-init-verify",
2441
+ {"ok": True},
2442
+ ),
2443
+ (
2444
+ "root governance status",
2445
+ ["python3", ".loom/bin/loom_flow.py", "governance-profile", "status", "--target", "."],
2446
+ "governance-status",
2447
+ {"result": "pass"},
2448
+ ),
2449
+ (
2450
+ "root runtime parity",
2451
+ ["python3", ".loom/bin/loom_flow.py", "runtime-parity", "validate", "--target", "."],
2452
+ "runtime-parity",
2453
+ {"result": "pass", "schema_version": "loom-runtime-parity/v1"},
2454
+ ),
2455
+ (
2456
+ "root adopt verify",
2457
+ ["python3", ".loom/bin/loom_flow.py", "adopt", "verify", "--target", ".", "--item", "INIT-0001"],
2458
+ "adopt-verify",
2459
+ {"result": "pass", "schema_version": "loom-adoption-verify/v1"},
2460
+ ),
2461
+ (
2462
+ "root carrier refresh",
2463
+ ["python3", ".loom/bin/loom_flow.py", "carrier", "refresh", "--target", ".", "--dry-run"],
2464
+ "carrier-refresh",
2465
+ {"result": "pass", "schema_version": "loom-carrier-refresh/v1"},
2466
+ ),
2467
+ (
2468
+ "root shadow parity",
2469
+ ["python3", ".loom/bin/loom_flow.py", "shadow-parity", "--target", "."],
2470
+ "shadow-parity",
2471
+ {"result": "pass"},
2472
+ ),
2473
+ )
2474
+ for label, args, kind, expected in commands:
2475
+ payload, error = load_command_json(root, args)
2476
+ if error:
2477
+ failures.append(Failure("root-self-adoption", f"`{label}` failed: {error}"))
2478
+ continue
2479
+ for key, value in expected.items():
2480
+ if payload.get(key) != value:
2481
+ failures.append(Failure("root-self-adoption", f"`{label}` must report `{key}: {value}`"))
2482
+ runtime_payload = payload.get("runtime_state")
2483
+ if kind == "loom-init-verify":
2484
+ runtime_payload = payload.get("runtime_state")
2485
+ if runtime_payload is not None:
2486
+ require_runtime_state_payload(
2487
+ failures,
2488
+ category="root-self-adoption",
2489
+ context=f"`{label}`",
2490
+ payload=runtime_payload,
2491
+ expected_scene="installed-runtime",
2492
+ expected_carrier="bootstrapped-target-runtime",
2493
+ allowed_results={"pass"},
2494
+ )
2495
+ if kind == "governance-status":
2496
+ maturity = payload.get("maturity")
2497
+ if not isinstance(maturity, dict) or maturity.get("current") != "strong":
2498
+ failures.append(Failure("root-self-adoption", "`root governance status` must report strong maturity after self-management binding"))
2499
+ if kind == "runtime-parity":
2500
+ checks = payload.get("checks")
2501
+ names = {check.get("name") for check in checks if isinstance(check, dict)} if isinstance(checks, list) else set()
2502
+ if "shadow_parity_boundary" not in names or "controlled_merge_contract" not in names:
2503
+ failures.append(Failure("root-self-adoption", "`root runtime parity` must cover shadow and controlled merge boundaries"))
2504
+ if kind == "adopt-verify":
2505
+ roundtrip = payload.get("producer_consumer_roundtrip")
2506
+ if not isinstance(roundtrip, dict):
2507
+ failures.append(Failure("root-self-adoption", "`root adopt verify` must include producer_consumer_roundtrip"))
2508
+ elif roundtrip.get("bypass_check", {}).get("result") != "pass":
2509
+ failures.append(Failure("root-self-adoption", "`root adopt verify` must prove required section deletion blocks"))
2510
+ if kind == "carrier-refresh":
2511
+ if payload.get("refresh_needed") not in ([], None):
2512
+ failures.append(Failure("root-self-adoption", "`root carrier refresh --dry-run` must not report runtime provenance drift"))
2513
+ review = payload.get("review")
2514
+ if isinstance(review, dict):
2515
+ head_binding = review.get("head_binding")
2516
+ if isinstance(head_binding, dict) and head_binding.get("status") == "stale":
2517
+ failures.append(Failure("root-self-adoption", "`root carrier refresh --dry-run` must detect stale review head binding"))
2518
+ if kind == "shadow-parity":
2519
+ reports = payload.get("reports")
2520
+ report_surfaces = {
2521
+ report.get("surface")
2522
+ for report in reports
2523
+ if isinstance(report, dict)
2524
+ } if isinstance(reports, list) else set()
2525
+ if report_surfaces != {"admission", "review", "merge_ready", "closeout"}:
2526
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must cover admission, review, merge_ready, and closeout"))
2527
+ surface = payload.get("governance_surface")
2528
+ if isinstance(surface, dict):
2529
+ repo_interface = surface.get("repo_interface")
2530
+ repo_interop = surface.get("repo_interop")
2531
+ if not isinstance(repo_interface, dict) or repo_interface.get("availability") != "present":
2532
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must consume the root repo companion interface"))
2533
+ if not isinstance(repo_interop, dict) or repo_interop.get("availability") != "present":
2534
+ failures.append(Failure("root-self-adoption", "`root shadow parity` must consume the root repo interop contract"))
2535
+ return failures
2536
+
2537
+
2413
2538
  def check_deep_existing_repo_bootstrap(root: Path) -> list[Failure]:
2414
2539
  failures: list[Failure] = []
2415
2540
  with tempfile.TemporaryDirectory(prefix="loom-check-deep-existing-") as tmp:
@@ -5000,7 +5125,11 @@ def check_daily_execution_cli(root: Path) -> list[Failure]:
5000
5125
  except subprocess.TimeoutExpired:
5001
5126
  gh_auth_probe = None
5002
5127
  gh_auth_ready = gh_auth_probe is not None and gh_auth_probe.returncode == 0
5003
- if gh_auth_ready:
5128
+ # GitHub Actions' ephemeral token is enough for self-governance host binding
5129
+ # reads, but it is not a stable authority for historical live issue/PR/project
5130
+ # samples. Keep those samples as local authenticated coverage instead of
5131
+ # making CI depend on mutable host permissions.
5132
+ if gh_auth_ready and os.environ.get("GITHUB_ACTIONS") != "true":
5004
5133
  with tempfile.TemporaryDirectory(prefix="loom-check-installed-post-merge-") as tmp:
5005
5134
  tmp_root = Path(tmp)
5006
5135
  install_root = tmp_root / "installed" / "skills"
@@ -7449,6 +7578,7 @@ def collect_failures(root: Path) -> list[Failure]:
7449
7578
  failures.extend(check_demo_assets(root))
7450
7579
  failures.extend(check_demo_fact_chain(root))
7451
7580
  failures.extend(check_demo_repo_local_cli(root))
7581
+ failures.extend(check_root_self_adoption_carrier(root))
7452
7582
  failures.extend(check_deep_existing_repo_bootstrap(root))
7453
7583
  failures.extend(check_daily_execution_cli(root))
7454
7584
  failures.extend(check_repo_companion_interface_contracts(root))
@@ -7463,7 +7593,7 @@ def collect_failures(root: Path) -> list[Failure]:
7463
7593
 
7464
7594
 
7465
7595
  def print_report(root: Path, failures: list[Failure]) -> None:
7466
- categories_checked = 18
7596
+ categories_checked = 19
7467
7597
  if not failures:
7468
7598
  print(f"loom_check: OK ({root})")
7469
7599
  print(f"checked {categories_checked} surfaces")