@planu/cli 5.3.14 → 5.3.16

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 (51) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/engine/cascade-hooks/hooks/housekeeping-on-done.hook.js +2 -3
  3. package/dist/engine/execution/validate-job-executor.js +51 -44
  4. package/dist/engine/housekeeping/find-stale-branches.d.ts +3 -3
  5. package/dist/engine/housekeeping/find-stale-branches.js +25 -29
  6. package/dist/engine/housekeeping/sweep-runner.js +105 -19
  7. package/dist/engine/planu-core.darwin-arm64.node.manifest.json +7 -7
  8. package/dist/engine/planu-core.darwin-arm64.node.sbom.json +4 -4
  9. package/dist/engine/planu-core.darwin-x64.node.manifest.json +7 -7
  10. package/dist/engine/planu-core.darwin-x64.node.sbom.json +4 -4
  11. package/dist/engine/planu-core.linux-arm64-gnu.node.manifest.json +7 -7
  12. package/dist/engine/planu-core.linux-arm64-gnu.node.sbom.json +4 -4
  13. package/dist/engine/planu-core.linux-arm64-musl.node.manifest.json +7 -7
  14. package/dist/engine/planu-core.linux-arm64-musl.node.sbom.json +4 -4
  15. package/dist/engine/planu-core.linux-x64-gnu.node.manifest.json +7 -7
  16. package/dist/engine/planu-core.linux-x64-gnu.node.sbom.json +4 -4
  17. package/dist/engine/planu-core.linux-x64-musl.node.manifest.json +7 -7
  18. package/dist/engine/planu-core.linux-x64-musl.node.sbom.json +4 -4
  19. package/dist/engine/planu-core.win32-arm64-msvc.node.manifest.json +7 -7
  20. package/dist/engine/planu-core.win32-arm64-msvc.node.sbom.json +4 -4
  21. package/dist/engine/planu-core.win32-x64-msvc.node.manifest.json +7 -7
  22. package/dist/engine/planu-core.win32-x64-msvc.node.sbom.json +4 -4
  23. package/dist/engine/spec-migrator/planu-root-cleaner.d.ts +2 -2
  24. package/dist/engine/spec-migrator/planu-root-cleaner.js +3 -2
  25. package/dist/engine/spec-migrator/strict-planu-cleanup.d.ts +2 -2
  26. package/dist/engine/spec-migrator/strict-planu-cleanup.js +18 -2
  27. package/dist/engine/validation/validation-freshness.d.ts +7 -0
  28. package/dist/engine/validation/validation-freshness.js +46 -5
  29. package/dist/tools/git/cleanup-ops.d.ts +2 -2
  30. package/dist/tools/git/cleanup-ops.js +123 -58
  31. package/dist/tools/github-release-handler.js +3 -12
  32. package/dist/tools/housekeeping-sweep.d.ts +1 -0
  33. package/dist/tools/housekeeping-sweep.js +17 -10
  34. package/dist/tools/init-project/git-setup.d.ts +1 -0
  35. package/dist/tools/init-project/git-setup.js +7 -23
  36. package/dist/tools/init-project/handler.js +4 -1
  37. package/dist/tools/init-project/migration-runner.js +8 -1
  38. package/dist/tools/init-project/scaffold-writer.d.ts +1 -0
  39. package/dist/tools/init-project/scaffold-writer.js +1 -0
  40. package/dist/tools/update-status/batch.js +1 -1
  41. package/dist/tools/update-status/index.js +1 -0
  42. package/dist/tools/update-status-actions.d.ts +2 -2
  43. package/dist/tools/update-status-actions.js +20 -10
  44. package/dist/types/git.d.ts +19 -0
  45. package/dist/types/housekeeping.d.ts +9 -1
  46. package/dist/types/index.d.ts +1 -0
  47. package/dist/types/index.js +1 -0
  48. package/dist/types/spec-format.d.ts +3 -0
  49. package/package.json +11 -10
  50. package/planu-native.json +1 -1
  51. package/planu-plugin.json +1 -1
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "cliVersion": "5.3.14",
4
- "engineVersion": "5.3.14",
5
- "buildId": "1-5.3.14-aarch64-unknown-linux-musl",
3
+ "cliVersion": "5.3.16",
4
+ "engineVersion": "5.3.16",
5
+ "buildId": "1-5.3.16-aarch64-unknown-linux-musl",
6
6
  "protocolAbi": 1,
7
7
  "capabilityAbi": 2,
8
8
  "nodeApiAbi": 4,
@@ -16,15 +16,15 @@
16
16
  "platform": "linux",
17
17
  "arch": "arm64",
18
18
  "libc": "musl",
19
- "artifactSha256": "bd0f6ff601ab21a2052364567465ba319d847a5b67f061bb5107360a88c03971",
19
+ "artifactSha256": "9b0683851a369169cda5c0e4141df24a59f94da03fdf7b8fc1230da65e38eb36",
20
20
  "sbom": {
21
21
  "format": "CycloneDX-1.5",
22
22
  "path": "planu-core.linux-arm64-musl.node.sbom.json",
23
- "sha256": "8fbe609d1e94a3650544e02908b35b6ebdf93eac6dcd1ddf7983add76da5b57e"
23
+ "sha256": "463cb73768477635328836a2a13d34038a2c7aeb83de4d17212274135af77e9e"
24
24
  },
25
25
  "provenance": {
26
26
  "builder": "scripts/build-rust-local.sh",
27
- "sourceCommit": "a847a7442e7735a9f4f2a9878eccbd52fc54509b",
27
+ "sourceCommit": "0cde0ff71b6b07e6bb7c059c7f03a7a58910e221",
28
28
  "sourceTreeDirty": false,
29
29
  "sourceDateEpoch": 1,
30
30
  "rustToolchain": "rustc 1.95.0 (59807616e 2026-04-14)",
@@ -33,6 +33,6 @@
33
33
  "signature": {
34
34
  "algorithm": "Ed25519",
35
35
  "keyId": "e2ee765cb5ad9fbdc433ece332bce26d746d5e350b3acde0721a4c8c6337ff7b",
36
- "value": "dUqTPahkHmCiAEmSaMEnq3zUKFiVBV+ZuMZTP4c8AryvORF2OoCGUglSVf+Ol9Ww8H4CIyByxkftL01Awk8rAw=="
36
+ "value": "LGOiA63xus7b3/9w0/8qTyrKDhkRV0y3EMRV7F5NHxj8oDGqLz81viGJvBU+iri4Xhh0Ku03hxoD377vhE4TBQ=="
37
37
  }
38
38
  }
@@ -4,14 +4,14 @@
4
4
  "version": 1,
5
5
  "metadata": {
6
6
  "component": {
7
- "bom-ref": "pkg:cargo/planu-core@5.3.14",
7
+ "bom-ref": "pkg:cargo/planu-core@5.3.16",
8
8
  "type": "library",
9
9
  "name": "planu-core",
10
- "version": "5.3.14",
10
+ "version": "5.3.16",
11
11
  "hashes": [
12
12
  {
13
13
  "alg": "SHA-256",
14
- "content": "bd0f6ff601ab21a2052364567465ba319d847a5b67f061bb5107360a88c03971"
14
+ "content": "9b0683851a369169cda5c0e4141df24a59f94da03fdf7b8fc1230da65e38eb36"
15
15
  }
16
16
  ]
17
17
  }
@@ -1106,7 +1106,7 @@
1106
1106
  "dependsOn": []
1107
1107
  },
1108
1108
  {
1109
- "ref": "pkg:cargo/planu-core@5.3.14",
1109
+ "ref": "pkg:cargo/planu-core@5.3.16",
1110
1110
  "dependsOn": [
1111
1111
  "pkg:cargo/core-foundation@0.10.1",
1112
1112
  "pkg:cargo/hmac@0.12.1",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "cliVersion": "5.3.14",
4
- "engineVersion": "5.3.14",
5
- "buildId": "1-5.3.14-x86_64-unknown-linux-gnu",
3
+ "cliVersion": "5.3.16",
4
+ "engineVersion": "5.3.16",
5
+ "buildId": "1-5.3.16-x86_64-unknown-linux-gnu",
6
6
  "protocolAbi": 1,
7
7
  "capabilityAbi": 2,
8
8
  "nodeApiAbi": 4,
@@ -16,15 +16,15 @@
16
16
  "platform": "linux",
17
17
  "arch": "x64",
18
18
  "libc": "glibc",
19
- "artifactSha256": "ab11f8980f5b174b9c2d5b6806daa3d356a12e841b2eaf668c106a3c45cd816e",
19
+ "artifactSha256": "2d8c9186e43c03eb451a9772c3dac7931039e5326997364bc2bcc5aa38726b48",
20
20
  "sbom": {
21
21
  "format": "CycloneDX-1.5",
22
22
  "path": "planu-core.linux-x64-gnu.node.sbom.json",
23
- "sha256": "24889fae3a9cff6f55b7cd1d60b6ea1ccb7fa9a8e53f3e2609e1aab97d6fa88b"
23
+ "sha256": "a27023f31bf2290b52d4e344d1859f3bbb49f5a19ce9998800987440ce834964"
24
24
  },
25
25
  "provenance": {
26
26
  "builder": "scripts/build-rust-local.sh",
27
- "sourceCommit": "a847a7442e7735a9f4f2a9878eccbd52fc54509b",
27
+ "sourceCommit": "0cde0ff71b6b07e6bb7c059c7f03a7a58910e221",
28
28
  "sourceTreeDirty": false,
29
29
  "sourceDateEpoch": 1,
30
30
  "rustToolchain": "rustc 1.95.0 (59807616e 2026-04-14)",
@@ -33,6 +33,6 @@
33
33
  "signature": {
34
34
  "algorithm": "Ed25519",
35
35
  "keyId": "e2ee765cb5ad9fbdc433ece332bce26d746d5e350b3acde0721a4c8c6337ff7b",
36
- "value": "Scj9Wqin6lntJ7TVv9I4nGUPwfYEIkvDW957suo9QXU3oLZIdwo+gWy+8r0jfMvNzqkbJrXuaUseiGzMnV31Aw=="
36
+ "value": "FEn6GiPlQVBmOEc8zw6SxFzCxNF9OfYAakAa36oR0r5fbCQBFBgfbuuKGdLar7rdnaU3vcgiexCzHJIuYdwFCg=="
37
37
  }
38
38
  }
@@ -4,14 +4,14 @@
4
4
  "version": 1,
5
5
  "metadata": {
6
6
  "component": {
7
- "bom-ref": "pkg:cargo/planu-core@5.3.14",
7
+ "bom-ref": "pkg:cargo/planu-core@5.3.16",
8
8
  "type": "library",
9
9
  "name": "planu-core",
10
- "version": "5.3.14",
10
+ "version": "5.3.16",
11
11
  "hashes": [
12
12
  {
13
13
  "alg": "SHA-256",
14
- "content": "ab11f8980f5b174b9c2d5b6806daa3d356a12e841b2eaf668c106a3c45cd816e"
14
+ "content": "2d8c9186e43c03eb451a9772c3dac7931039e5326997364bc2bcc5aa38726b48"
15
15
  }
16
16
  ]
17
17
  }
@@ -1106,7 +1106,7 @@
1106
1106
  "dependsOn": []
1107
1107
  },
1108
1108
  {
1109
- "ref": "pkg:cargo/planu-core@5.3.14",
1109
+ "ref": "pkg:cargo/planu-core@5.3.16",
1110
1110
  "dependsOn": [
1111
1111
  "pkg:cargo/core-foundation@0.10.1",
1112
1112
  "pkg:cargo/hmac@0.12.1",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "cliVersion": "5.3.14",
4
- "engineVersion": "5.3.14",
5
- "buildId": "1-5.3.14-x86_64-unknown-linux-musl",
3
+ "cliVersion": "5.3.16",
4
+ "engineVersion": "5.3.16",
5
+ "buildId": "1-5.3.16-x86_64-unknown-linux-musl",
6
6
  "protocolAbi": 1,
7
7
  "capabilityAbi": 2,
8
8
  "nodeApiAbi": 4,
@@ -16,15 +16,15 @@
16
16
  "platform": "linux",
17
17
  "arch": "x64",
18
18
  "libc": "musl",
19
- "artifactSha256": "c23996625c6b938358150cf4179453e12e2e0fd13e8eea0e84f5fcc85c55e150",
19
+ "artifactSha256": "50547de5b23c0671447358eebc95d3841a2ce278236f5000655182ffb998d547",
20
20
  "sbom": {
21
21
  "format": "CycloneDX-1.5",
22
22
  "path": "planu-core.linux-x64-musl.node.sbom.json",
23
- "sha256": "6dc9f80ab3206c95cc8a9f3eff39bf21f21e8fbb30e0cf31c4dbcd26e095c675"
23
+ "sha256": "a074e28e92546729d7347be57236bd8a0678ea1396fd756770915db6efecfa18"
24
24
  },
25
25
  "provenance": {
26
26
  "builder": "scripts/build-rust-local.sh",
27
- "sourceCommit": "a847a7442e7735a9f4f2a9878eccbd52fc54509b",
27
+ "sourceCommit": "0cde0ff71b6b07e6bb7c059c7f03a7a58910e221",
28
28
  "sourceTreeDirty": false,
29
29
  "sourceDateEpoch": 1,
30
30
  "rustToolchain": "rustc 1.95.0 (59807616e 2026-04-14)",
@@ -33,6 +33,6 @@
33
33
  "signature": {
34
34
  "algorithm": "Ed25519",
35
35
  "keyId": "e2ee765cb5ad9fbdc433ece332bce26d746d5e350b3acde0721a4c8c6337ff7b",
36
- "value": "813Dm95ogKfJ0gWnnob2MqAjFqrZiGqBFsOKm9fbJB1y3MWxQn1ntV1t/eONh0I1r6qA/LJFarprcALWHEMbAA=="
36
+ "value": "qvTXfNiZUTxm+mdb2A7/P6wjxEhdCr9WIVZkzDDOoxu4k4NgFeBmrSGKdRays0RSEivQ9f23gnvhS1myJ+DIAQ=="
37
37
  }
38
38
  }
@@ -4,14 +4,14 @@
4
4
  "version": 1,
5
5
  "metadata": {
6
6
  "component": {
7
- "bom-ref": "pkg:cargo/planu-core@5.3.14",
7
+ "bom-ref": "pkg:cargo/planu-core@5.3.16",
8
8
  "type": "library",
9
9
  "name": "planu-core",
10
- "version": "5.3.14",
10
+ "version": "5.3.16",
11
11
  "hashes": [
12
12
  {
13
13
  "alg": "SHA-256",
14
- "content": "c23996625c6b938358150cf4179453e12e2e0fd13e8eea0e84f5fcc85c55e150"
14
+ "content": "50547de5b23c0671447358eebc95d3841a2ce278236f5000655182ffb998d547"
15
15
  }
16
16
  ]
17
17
  }
@@ -1106,7 +1106,7 @@
1106
1106
  "dependsOn": []
1107
1107
  },
1108
1108
  {
1109
- "ref": "pkg:cargo/planu-core@5.3.14",
1109
+ "ref": "pkg:cargo/planu-core@5.3.16",
1110
1110
  "dependsOn": [
1111
1111
  "pkg:cargo/core-foundation@0.10.1",
1112
1112
  "pkg:cargo/hmac@0.12.1",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "cliVersion": "5.3.14",
4
- "engineVersion": "5.3.14",
5
- "buildId": "1-5.3.14-aarch64-pc-windows-msvc",
3
+ "cliVersion": "5.3.16",
4
+ "engineVersion": "5.3.16",
5
+ "buildId": "1-5.3.16-aarch64-pc-windows-msvc",
6
6
  "protocolAbi": 1,
7
7
  "capabilityAbi": 2,
8
8
  "nodeApiAbi": 4,
@@ -16,15 +16,15 @@
16
16
  "platform": "win32",
17
17
  "arch": "arm64",
18
18
  "libc": null,
19
- "artifactSha256": "0668394e6f892080771e2f878c2f75d7692f7d2db03c543bdda4fd2fbbf27bd4",
19
+ "artifactSha256": "151f0906eac861f554ce19ede7347d8267048f67aeb71b5f2521c7eaf8fbc034",
20
20
  "sbom": {
21
21
  "format": "CycloneDX-1.5",
22
22
  "path": "planu-core.win32-arm64-msvc.node.sbom.json",
23
- "sha256": "8bd0170c6b52aed934ad9d080190e2d63cf012bd6d6f132449e599e1770c60fa"
23
+ "sha256": "2acb3f0615fee3f77ca7be0110f41c245b760d81811c0299a57aac2f7aa15fc9"
24
24
  },
25
25
  "provenance": {
26
26
  "builder": "scripts/build-rust-local.sh",
27
- "sourceCommit": "a847a7442e7735a9f4f2a9878eccbd52fc54509b",
27
+ "sourceCommit": "0cde0ff71b6b07e6bb7c059c7f03a7a58910e221",
28
28
  "sourceTreeDirty": false,
29
29
  "sourceDateEpoch": 1,
30
30
  "rustToolchain": "rustc 1.95.0 (59807616e 2026-04-14)",
@@ -33,6 +33,6 @@
33
33
  "signature": {
34
34
  "algorithm": "Ed25519",
35
35
  "keyId": "e2ee765cb5ad9fbdc433ece332bce26d746d5e350b3acde0721a4c8c6337ff7b",
36
- "value": "Pse3AY39p2tC7McGWVjvSCG/TOprOtT1W9dvf0XwP/ZWVEd4fVCQUwrTyoXKGAwXCOp4vQjViiE+CvHuSkQ2Dw=="
36
+ "value": "qMuwIDaEU/3JJj3BuHx/uv8ZCDScOhZGUSHuIKSS64I31OESsH7QuSd6+7QYT9THm5hb0nxuol3BtyyQ3AX3Dg=="
37
37
  }
38
38
  }
@@ -4,14 +4,14 @@
4
4
  "version": 1,
5
5
  "metadata": {
6
6
  "component": {
7
- "bom-ref": "pkg:cargo/planu-core@5.3.14",
7
+ "bom-ref": "pkg:cargo/planu-core@5.3.16",
8
8
  "type": "library",
9
9
  "name": "planu-core",
10
- "version": "5.3.14",
10
+ "version": "5.3.16",
11
11
  "hashes": [
12
12
  {
13
13
  "alg": "SHA-256",
14
- "content": "0668394e6f892080771e2f878c2f75d7692f7d2db03c543bdda4fd2fbbf27bd4"
14
+ "content": "151f0906eac861f554ce19ede7347d8267048f67aeb71b5f2521c7eaf8fbc034"
15
15
  }
16
16
  ]
17
17
  }
@@ -1106,7 +1106,7 @@
1106
1106
  "dependsOn": []
1107
1107
  },
1108
1108
  {
1109
- "ref": "pkg:cargo/planu-core@5.3.14",
1109
+ "ref": "pkg:cargo/planu-core@5.3.16",
1110
1110
  "dependsOn": [
1111
1111
  "pkg:cargo/core-foundation@0.10.1",
1112
1112
  "pkg:cargo/hmac@0.12.1",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "cliVersion": "5.3.14",
4
- "engineVersion": "5.3.14",
5
- "buildId": "1-5.3.14-x86_64-pc-windows-msvc",
3
+ "cliVersion": "5.3.16",
4
+ "engineVersion": "5.3.16",
5
+ "buildId": "1-5.3.16-x86_64-pc-windows-msvc",
6
6
  "protocolAbi": 1,
7
7
  "capabilityAbi": 2,
8
8
  "nodeApiAbi": 4,
@@ -16,15 +16,15 @@
16
16
  "platform": "win32",
17
17
  "arch": "x64",
18
18
  "libc": null,
19
- "artifactSha256": "60f4555904763ce92bb3193d78ce261c98334ff4630466214ba8ab1c257a2482",
19
+ "artifactSha256": "b002099edf523c6aa0ca6f658a19514ff0a20ccf154bd88e4e205d49d9135590",
20
20
  "sbom": {
21
21
  "format": "CycloneDX-1.5",
22
22
  "path": "planu-core.win32-x64-msvc.node.sbom.json",
23
- "sha256": "4754b2b3a274f43a3ee5d1bcece2ae4c8a02373bf9ba646291dce44574304df5"
23
+ "sha256": "c1b0d2ac50e19c7133dccb297d19f3a317125bfd88e87508ae0743acba413c5f"
24
24
  },
25
25
  "provenance": {
26
26
  "builder": "scripts/build-rust-local.sh",
27
- "sourceCommit": "a847a7442e7735a9f4f2a9878eccbd52fc54509b",
27
+ "sourceCommit": "0cde0ff71b6b07e6bb7c059c7f03a7a58910e221",
28
28
  "sourceTreeDirty": false,
29
29
  "sourceDateEpoch": 1,
30
30
  "rustToolchain": "rustc 1.95.0 (59807616e 2026-04-14)",
@@ -33,6 +33,6 @@
33
33
  "signature": {
34
34
  "algorithm": "Ed25519",
35
35
  "keyId": "e2ee765cb5ad9fbdc433ece332bce26d746d5e350b3acde0721a4c8c6337ff7b",
36
- "value": "KLoEL/AX7y2xHycyQKsFA2zksyqZ8uDBBixdAqVnSTf5Oa/aEUsOS7CbH2dt3vpY034HSgbZO319iN+ws/taBA=="
36
+ "value": "wQa0ygTquWBg4jFcHX8+sVqOETbJGfViThB7wyshllPFfdCF8s8chApggB+dgjCJd6qz2JaI1aJyifFFsIF9BQ=="
37
37
  }
38
38
  }
@@ -4,14 +4,14 @@
4
4
  "version": 1,
5
5
  "metadata": {
6
6
  "component": {
7
- "bom-ref": "pkg:cargo/planu-core@5.3.14",
7
+ "bom-ref": "pkg:cargo/planu-core@5.3.16",
8
8
  "type": "library",
9
9
  "name": "planu-core",
10
- "version": "5.3.14",
10
+ "version": "5.3.16",
11
11
  "hashes": [
12
12
  {
13
13
  "alg": "SHA-256",
14
- "content": "60f4555904763ce92bb3193d78ce261c98334ff4630466214ba8ab1c257a2482"
14
+ "content": "b002099edf523c6aa0ca6f658a19514ff0a20ccf154bd88e4e205d49d9135590"
15
15
  }
16
16
  ]
17
17
  }
@@ -1106,7 +1106,7 @@
1106
1106
  "dependsOn": []
1107
1107
  },
1108
1108
  {
1109
- "ref": "pkg:cargo/planu-core@5.3.14",
1109
+ "ref": "pkg:cargo/planu-core@5.3.16",
1110
1110
  "dependsOn": [
1111
1111
  "pkg:cargo/core-foundation@0.10.1",
1112
1112
  "pkg:cargo/hmac@0.12.1",
@@ -1,5 +1,5 @@
1
- import type { CleanupResult } from '../../types/index.js';
1
+ import type { CleanupResult, HousekeepingAuthority } from '../../types/index.js';
2
2
  export type { CleanupResult };
3
3
  /** Remove all non-canonical files from planu/ root and per-spec directories. */
4
- export declare function cleanPlanuRoot(planuDir: string, projectPath?: string): Promise<CleanupResult>;
4
+ export declare function cleanPlanuRoot(planuDir: string, projectPath?: string, authority?: HousekeepingAuthority): Promise<CleanupResult>;
5
5
  //# sourceMappingURL=planu-root-cleaner.d.ts.map
@@ -2,9 +2,9 @@
2
2
  import { dirname } from 'node:path';
3
3
  import { runStrictPlanuCleanup } from './strict-planu-cleanup.js';
4
4
  /** Remove all non-canonical files from planu/ root and per-spec directories. */
5
- export async function cleanPlanuRoot(planuDir, projectPath) {
5
+ export async function cleanPlanuRoot(planuDir, projectPath, authority = { mode: 'report' }) {
6
6
  const root = projectPath ?? dirname(planuDir);
7
- const strict = await runStrictPlanuCleanup(root);
7
+ const strict = await runStrictPlanuCleanup(root, authority);
8
8
  const deletedRootFiles = [];
9
9
  const deletedSpecFiles = [];
10
10
  for (const path of [...strict.deleted, ...strict.merged]) {
@@ -20,6 +20,7 @@ export async function cleanPlanuRoot(planuDir, projectPath) {
20
20
  deletedRootFiles,
21
21
  deletedSpecFiles,
22
22
  totalDeleted: strict.deleted.length + strict.merged.length,
23
+ proposed: strict.proposed,
23
24
  };
24
25
  }
25
26
  //# sourceMappingURL=planu-root-cleaner.js.map
@@ -1,6 +1,6 @@
1
- import type { StrictPlanuCleanupResult, StrictPlanuValidationOptions, StrictPlanuValidationResult } from '../../types/index.js';
1
+ import type { StrictPlanuCleanupResult, StrictPlanuValidationOptions, StrictPlanuValidationResult, HousekeepingAuthority } from '../../types/index.js';
2
2
  import { PLANU_CANONICAL_POLICY } from './planu-canonical-policy.js';
3
- export declare function runStrictPlanuCleanup(projectPath: string): Promise<StrictPlanuCleanupResult>;
3
+ export declare function runStrictPlanuCleanup(projectPath: string, authority?: HousekeepingAuthority): Promise<StrictPlanuCleanupResult>;
4
4
  export declare function validateStrictPlanuLayout(projectPath: string, options?: StrictPlanuValidationOptions): Promise<StrictPlanuValidationResult>;
5
5
  export { PLANU_CANONICAL_POLICY };
6
6
  //# sourceMappingURL=strict-planu-cleanup.d.ts.map
@@ -139,8 +139,24 @@ async function shouldDeleteOrphanSpecDir(specDir) {
139
139
  // Keeping them without spec.md leaves a permanently non-canonical orphan behind.
140
140
  return !entries.includes('spec.md');
141
141
  }
142
- export async function runStrictPlanuCleanup(projectPath) {
143
- const result = { deleted: [], merged: [], gitignoreUpdated: false };
142
+ export async function runStrictPlanuCleanup(projectPath, authority = { mode: 'report' }) {
143
+ if (authority.mode === 'report') {
144
+ const validation = await validateStrictPlanuLayout(projectPath);
145
+ return {
146
+ mode: 'report',
147
+ deleted: [],
148
+ merged: [],
149
+ proposed: validation.offenders,
150
+ gitignoreUpdated: false,
151
+ };
152
+ }
153
+ const result = {
154
+ mode: 'execute',
155
+ deleted: [],
156
+ merged: [],
157
+ proposed: [],
158
+ gitignoreUpdated: false,
159
+ };
144
160
  const planuDir = join(projectPath, 'planu');
145
161
  if (!existsSync(planuDir)) {
146
162
  return result;
@@ -29,6 +29,13 @@ export declare function injectValidationWatchEventForTests(input: {
29
29
  }): ValidationWatchEventClassification | undefined;
30
30
  /** Pause or observe authoritative verification turns without changing watcher topology. */
31
31
  export declare function setValidationFreshnessVerificationHookForTests(hook: (() => Promise<void>) | undefined): void;
32
+ /**
33
+ * Mark one exact epoch's receipt publication as in flight. A same-identity
34
+ * resubmission that arrives while the window is open waits for the returned
35
+ * closer before superseding this epoch, instead of closing it mid-publication.
36
+ * Returns a no-op closer once the epoch is no longer the active one.
37
+ */
38
+ export declare function beginValidationFreshnessPublicationWindow(lease: Pick<ValidationFreshnessLease, 'projectId' | 'specId' | 'epoch'>): () => void;
32
39
  /** Start both watchers before snapshotting and invalidate any older receipt immediately. */
33
40
  export declare function beginValidationFreshnessBarrier(input: {
34
41
  projectId: string;
@@ -71,6 +71,19 @@ let verificationHookForTests;
71
71
  function key(projectId, specId) {
72
72
  return `${projectId}:${specId}`;
73
73
  }
74
+ function noop() {
75
+ /* no-op */
76
+ }
77
+ function raceWithTimeout(promise, timeoutMs) {
78
+ return new Promise((resolve) => {
79
+ const timer = setTimeout(resolve, timeoutMs);
80
+ timer.unref();
81
+ void promise.finally(() => {
82
+ clearTimeout(timer);
83
+ resolve();
84
+ });
85
+ });
86
+ }
74
87
  async function invalidateDurably(projectId, specId) {
75
88
  const env_1 = { stack: [], error: void 0, hasError: false };
76
89
  try {
@@ -380,6 +393,29 @@ async function evidenceFingerprint(path) {
380
393
  }
381
394
  return hash.digest('hex');
382
395
  }
396
+ /**
397
+ * Mark one exact epoch's receipt publication as in flight. A same-identity
398
+ * resubmission that arrives while the window is open waits for the returned
399
+ * closer before superseding this epoch, instead of closing it mid-publication.
400
+ * Returns a no-op closer once the epoch is no longer the active one.
401
+ */
402
+ export function beginValidationFreshnessPublicationWindow(lease) {
403
+ const state = active.get(key(lease.projectId, lease.specId));
404
+ if (state?.epoch !== lease.epoch) {
405
+ return noop;
406
+ }
407
+ let release;
408
+ const window = new Promise((resolve) => {
409
+ release = resolve;
410
+ });
411
+ state.publicationInFlight = window;
412
+ return () => {
413
+ release();
414
+ if (state.publicationInFlight === window) {
415
+ state.publicationInFlight = undefined;
416
+ }
417
+ };
418
+ }
383
419
  /** Start both watchers before snapshotting and invalidate any older receipt immediately. */
384
420
  // eslint-disable-next-line max-lines-per-function -- serialized setup and rollback form one auditable ownership boundary
385
421
  export async function beginValidationFreshnessBarrier(input) {
@@ -395,11 +431,16 @@ export async function beginValidationFreshnessBarrier(input) {
395
431
  try {
396
432
  const previous = active.get(identity);
397
433
  if (previous) {
398
- await closeValidationFreshnessLease({
399
- projectId: input.projectId,
400
- specId: input.specId,
401
- epoch: previous.epoch,
402
- });
434
+ if (previous.publicationInFlight) {
435
+ await raceWithTimeout(previous.publicationInFlight, getRuntimePolicy().validation.receiptPublicationDeadlineMs + 1000);
436
+ }
437
+ if (active.get(identity) === previous) {
438
+ await closeValidationFreshnessLease({
439
+ projectId: input.projectId,
440
+ specId: input.specId,
441
+ epoch: previous.epoch,
442
+ });
443
+ }
403
444
  }
404
445
  await mkdir(input.handoffPath, { recursive: true, mode: 0o700 });
405
446
  const initialEvidenceFingerprint = await evidenceFingerprint(input.handoffPath);
@@ -1,4 +1,4 @@
1
- import type { ToolResult, GitConfig, SpecDoneCleanupResult } from '../../types/index.js';
1
+ import type { ToolResult, GitConfig, HousekeepingAuthority, SpecDoneCleanupResult } from '../../types/index.js';
2
2
  /**
3
3
  * AC-02: Eliminate gone branches + remote prune.
4
4
  * AC-03: List stale stashes (>7d); drop if force=true.
@@ -11,5 +11,5 @@ export declare function handleCleanup(projectId: string, config?: GitConfig): Pr
11
11
  * AC-01: When a spec is marked done, clean its worktree, local branch, and remote branch.
12
12
  * Best-effort — never throws. Caller should fire-and-forget or log result.
13
13
  */
14
- export declare function cleanupSpecOnDone(projectPath: string, specId: string, gitBranch: string | undefined): Promise<SpecDoneCleanupResult>;
14
+ export declare function cleanupSpecOnDone(projectPath: string, specId: string, gitBranch: string | undefined, authority?: HousekeepingAuthority): Promise<SpecDoneCleanupResult>;
15
15
  //# sourceMappingURL=cleanup-ops.d.ts.map