leerness 1.36.303 → 1.36.304

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 (177) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/CONTRIBUTING.md +2 -0
  3. package/README.md +4 -4
  4. package/bin/leerness.js +1 -1
  5. package/package.json +1 -1
  6. package/scripts/agents-bench-output-probe.js +1 -0
  7. package/scripts/api-skill-match-probe.js +1 -0
  8. package/scripts/audit-env-text-probe.js +1 -0
  9. package/scripts/audit-readme-text-probe.js +1 -0
  10. package/scripts/audit-text-probe.js +1 -0
  11. package/scripts/authoring-language-probe.js +1 -0
  12. package/scripts/auto-update-hooks-probe.js +1 -0
  13. package/scripts/brief-text-probe.js +1 -0
  14. package/scripts/bugfix-areas-probe.js +1 -0
  15. package/scripts/ci-shard-probe.js +99 -0
  16. package/scripts/ci-shard.js +35 -3
  17. package/scripts/claim-runtime-cache-probe.js +1 -0
  18. package/scripts/claim-sweep-git-probe.js +1 -0
  19. package/scripts/claims-baseline-concurrency-probe.js +1 -0
  20. package/scripts/claims-baseline-probe.js +1 -0
  21. package/scripts/command-flags-probe.js +1 -0
  22. package/scripts/context-current-probe.js +1 -0
  23. package/scripts/context-reading-probe.js +1 -0
  24. package/scripts/copy-tree-probe.js +1 -0
  25. package/scripts/crud-check-probe.js +1 -0
  26. package/scripts/dead-flags-probe.js +1 -0
  27. package/scripts/done-status-probe.js +1 -0
  28. package/scripts/dry-run-refusal-probe.js +1 -0
  29. package/scripts/e2e-child-diagnostics-probe.js +1 -0
  30. package/scripts/e2e-command-surface.js +1 -0
  31. package/scripts/e2e-concurrency.js +1 -0
  32. package/scripts/e2e-core.js +1 -0
  33. package/scripts/e2e-lived-in-harness.js +1 -0
  34. package/scripts/e2e-repo-guard.js +1 -0
  35. package/scripts/e2e-temp-scope-probe.js +1 -0
  36. package/scripts/e2e.js +5 -0
  37. package/scripts/encoding-diagnostics-probe.js +1 -0
  38. package/scripts/encoding-selftest-probe.js +1 -0
  39. package/scripts/env-snapshot-text-probe.js +1 -0
  40. package/scripts/env-sync-text-probe.js +1 -0
  41. package/scripts/execution-ledger-sync-probe.js +1 -0
  42. package/scripts/false-claim-probe.js +1 -0
  43. package/scripts/feature-graph-text-probe.js +1 -0
  44. package/scripts/file-lease-probe.js +1 -0
  45. package/scripts/fix-evidence-language-probe.js +1 -0
  46. package/scripts/free-text-args-probe.js +1 -0
  47. package/scripts/generation-text-probe.js +1 -0
  48. package/scripts/git-resolution-cache-probe.js +1 -0
  49. package/scripts/github-login-probe.js +1 -0
  50. package/scripts/handoff-history-text-probe.js +1 -0
  51. package/scripts/handoff-i18n-probe.js +1 -0
  52. package/scripts/handoff-preservation-probe.js +1 -0
  53. package/scripts/handoff-readonly-probe.js +1 -0
  54. package/scripts/handoff-text-probe.js +1 -0
  55. package/scripts/harness-text-probe.js +1 -0
  56. package/scripts/history-retention-probe.js +1 -0
  57. package/scripts/history-retention-write-probe.js +1 -0
  58. package/scripts/i18n-next-cluster-probe.js +1 -0
  59. package/scripts/i18n-priority-surface-probe.js +1 -0
  60. package/scripts/install-text-probe.js +1 -0
  61. package/scripts/installed-cleanroom-probe.js +1 -0
  62. package/scripts/installed-handoff-lifecycle-probe.js +1 -0
  63. package/scripts/lazy-auto-track-probe.js +1 -0
  64. package/scripts/legacy-runtime-negative-probe.js +1 -0
  65. package/scripts/lock-heartbeat-probe.js +1 -0
  66. package/scripts/lock-probe.js +1 -0
  67. package/scripts/managed-text-probe.js +1 -0
  68. package/scripts/mcp-presence-probe.js +1 -0
  69. package/scripts/memory-archive-check-probe.js +1 -0
  70. package/scripts/memory-archive-retention-probe.js +1 -0
  71. package/scripts/memory-arena-cleanup-probe.js +1 -0
  72. package/scripts/memory-checked-input-probe.js +1 -0
  73. package/scripts/memory-guard-order-probe.js +1 -0
  74. package/scripts/memory-input-preflight-probe.js +1 -0
  75. package/scripts/memory-input-unit-probe.js +1 -0
  76. package/scripts/memory-language-probe.js +1 -0
  77. package/scripts/memory-legacy-retention-probe.js +1 -0
  78. package/scripts/memory-migration-concurrency-probe.js +1 -0
  79. package/scripts/memory-migration-test-support.js +11 -28
  80. package/scripts/memory-migration-transport-probe.js +1 -0
  81. package/scripts/memory-output-parent-race-probe.js +1 -0
  82. package/scripts/memory-output-posix-probe.js +1 -0
  83. package/scripts/memory-output-publication-probe.js +1 -0
  84. package/scripts/memory-output-unit-probe.js +1 -0
  85. package/scripts/memory-projection-retention-probe.js +1 -0
  86. package/scripts/memory-recovery-external-probe.js +1 -0
  87. package/scripts/memory-recovery-receipt-probe.js +1 -0
  88. package/scripts/memory-restore-canonical-probe.js +1 -0
  89. package/scripts/memory-utf8-admission-probe.js +1 -0
  90. package/scripts/memory-write-budget-meter.js +1 -0
  91. package/scripts/migration-compat.js +1 -0
  92. package/scripts/mode-text-probe.js +1 -0
  93. package/scripts/mutation-integrity-probe.js +1 -0
  94. package/scripts/next-action-suggestion-probe.js +1 -0
  95. package/scripts/openai-response-retrieval-probe.js +1 -0
  96. package/scripts/openai-ui-review-dispatch-probe.js +1 -0
  97. package/scripts/openai-ui-review-observation-probe.js +1 -0
  98. package/scripts/openai-ui-review-receipt-probe.js +1 -0
  99. package/scripts/parent-detect-selftest-probe.js +1 -0
  100. package/scripts/plain-language-reporting-probe.js +1 -0
  101. package/scripts/plan-text-probe.js +1 -0
  102. package/scripts/platform-smoke.js +1 -0
  103. package/scripts/provider-capacity-probe.js +1 -0
  104. package/scripts/race-overlap-probe.js +1 -0
  105. package/scripts/release-bump-probe.js +1 -0
  106. package/scripts/release-runtime-probe.js +1 -0
  107. package/scripts/reminder-text-probe.js +1 -0
  108. package/scripts/review-checkpoint-transport-probe.js +1 -0
  109. package/scripts/review-control-probe.js +1 -0
  110. package/scripts/review-feedback-probe.js +1 -0
  111. package/scripts/review-request-labels-probe.js +1 -0
  112. package/scripts/review-request-signals-probe.js +1 -0
  113. package/scripts/review-snapshot-transport-probe.js +1 -0
  114. package/scripts/role-agent-schema-probe.js +1 -0
  115. package/scripts/role-fallback-probe.js +1 -0
  116. package/scripts/role-file-identity-probe.js +1 -0
  117. package/scripts/role-store-loader-probe.js +1 -0
  118. package/scripts/rule-applicability-probe.js +1 -0
  119. package/scripts/rule-text-probe.js +1 -0
  120. package/scripts/rule-verification-probe.js +1 -0
  121. package/scripts/runtime-admission-probe.js +1 -0
  122. package/scripts/runtime-cost-probe.js +1 -0
  123. package/scripts/runtime-descriptor-identity-probe.js +1 -0
  124. package/scripts/runtime-layout-probe.js +1 -0
  125. package/scripts/runtime-repl-probe.js +1 -0
  126. package/scripts/runtime-replacement-probe.js +1 -0
  127. package/scripts/runtime-write-probe.js +1 -0
  128. package/scripts/secret-scan-scope-probe.js +1 -0
  129. package/scripts/selftest-cleanup-probe.js +1 -0
  130. package/scripts/session-close-text-probe.js +1 -0
  131. package/scripts/shared-state-lock-probe.js +1 -0
  132. package/scripts/skill-archive-probe.js +1 -0
  133. package/scripts/smoke.js +1 -0
  134. package/scripts/state-inspect-cli-probe.js +1 -0
  135. package/scripts/state-scopes-probe.js +1 -0
  136. package/scripts/store-diagnostic-identity-probe.js +1 -0
  137. package/scripts/store-diagnostic-probe.js +1 -0
  138. package/scripts/store-values-probe.js +1 -0
  139. package/scripts/task-sync-roundtrip-probe.js +1 -0
  140. package/scripts/teams-text-probe.js +1 -0
  141. package/scripts/temp-cleanup-probe.js +433 -0
  142. package/scripts/temp-cleanup.js +182 -1
  143. package/scripts/test-execution-plan-probe.js +1 -0
  144. package/scripts/test-firestore-probe.js +1 -0
  145. package/scripts/test-http-probe.js +1 -0
  146. package/scripts/test-node-runner-probe.js +1 -0
  147. package/scripts/test-npm-script-probe.js +1 -0
  148. package/scripts/test-npm-script-runner-probe.js +1 -0
  149. package/scripts/test-prerequisite-probe.js +1 -0
  150. package/scripts/test-suite-list-runner-probe.js +1 -0
  151. package/scripts/title-args-probe.js +1 -0
  152. package/scripts/tracker-write-language-probe.js +1 -0
  153. package/scripts/ui-boundary-browser-probe.js +1 -0
  154. package/scripts/ui-boundary-contracts-probe.js +1 -0
  155. package/scripts/ui-boundary-dashboard-probe.js +1 -0
  156. package/scripts/ui-copy-boundary-probe.js +1 -0
  157. package/scripts/ui-review-attempt-probe.js +1 -0
  158. package/scripts/ui-review-authority-floor-probe.js +1 -0
  159. package/scripts/ui-review-authority-host-probe.js +1 -0
  160. package/scripts/ui-review-authorization-probe.js +1 -0
  161. package/scripts/ui-review-ledger-probe.js +1 -0
  162. package/scripts/ui-review-observation-probe.js +1 -0
  163. package/scripts/ui-review-proof-use-probe.js +1 -0
  164. package/scripts/ui-review-publication-probe.js +1 -0
  165. package/scripts/ui-review-recovery-probe.js +1 -0
  166. package/scripts/ui-review-result-probe.js +1 -0
  167. package/scripts/ui-review-run-probe.js +1 -0
  168. package/scripts/ui-review-target-probe.js +1 -0
  169. package/scripts/ui-review-transport-probe.js +1 -0
  170. package/scripts/verify-code-cross-runtime-probe.js +1 -0
  171. package/scripts/which-shim-probe.js +1 -0
  172. package/scripts/workspace-dir-lock-order-probe.js +1 -0
  173. package/scripts/workspace-dir-migration-probe.js +1 -0
  174. package/scripts/workspace-migration-heartbeat-probe.js +1 -0
  175. package/scripts/workspace-selection-probe.js +1 -0
  176. package/scripts/write-path-language-probe.js +1 -0
  177. package/scripts/write-primitive-language-probe.js +1 -0
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { removeTree } = require('./temp-cleanup');
4
5
  if (!process.argv.includes('--worker')) {
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // Exact-file leases are an opt-in coordination primitive. This probe deliberately
5
6
  // distinguishes them from the discarded ambient scope advisory: only explicit calls
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0333: `task fix-evidence` speaks the project's language. It printed Korean everywhere: in an English project the
3
4
  // header, the guidance, the per-row lines, the suggested evidence and the results of `--set` and of an empty list were
4
5
  // Korean. English projects now get English; Korean output stays byte for byte (every expected line below is the text
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0321: free text given to a command is exactly the positional text the user typed.
3
4
  // Reported: `clarify "<request>" --path <dir>` appends <dir> to the request. That did not reproduce —
4
5
  // main() builds args with nonFlagArgs(), which already drops registered value flags and their values; the
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { createHash } = require('crypto');
4
5
  const { removeTree } = require('./temp-cleanup');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  const assert = require('assert');
5
6
  const fs = require('fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  // Real loopback TLS; only the test intercepts DNS destination/trust roots.
4
5
  const assert = require('node:assert/strict');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { createHash } = require('crypto');
4
5
  const { removeTree } = require('./temp-cleanup');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0317: English handoff output carries no Korean-only tool text. An English project on Korean Windows saw the
3
4
  // terminal-encoding notice, skill suggestions, the official-skill cache note, next-step suggestions and the compact
4
5
  // "다음:" line in Korean. Every line the tool writes on the handoff paths now goes through a language helper whose
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0307: session close keeps user-written handoff text by position, and every reader of the
5
6
  // handoff looks at the current generated region rather than the whole file.
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0136: default handoff is a tracked-workspace read boundary while ignored,
5
6
  // per-session presence records retain concurrent agent identity and freshness.
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { createHash } = require('crypto');
4
5
  const { removeTree } = require('./temp-cleanup');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // Exercise actual generation, migration and handoff; never filter user Unicode.
3
4
  const assert = require('assert');
4
5
  const fs = require('fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert');
3
4
  const crypto = require('crypto');
4
5
  const fs = require('fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  const assert = require('assert/strict');
4
5
  const fs = require('fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  const fs = require('fs');
4
5
  const os = require('os');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  const fs = require('fs');
4
5
  const os = require('os');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { createHash } = require('crypto');
4
5
  const { removeTree } = require('./temp-cleanup');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0140: prove the packed artifact, rather than the source checkout, works in a
5
6
  // separate consumer project. The probe also runs the exhaustive command-surface
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // Exercise the actual installed harness function with real, owned Node children.
5
6
  // Only long timeout/output limits are shortened; production argv/env are observed.
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0345: `lazy detect --auto-track` registers a task for each new TODO whose file no tracker row references, and
3
4
  // only those. A batch that mixed such files with a file a task already referenced registered every new TODO, so the
4
5
  // TODOs in the referenced file got tasks of their own as well. known-todos.json gains exactly the registered TODOs.
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  // Release-only negative controls. Supply an existing installed v1.36.186 package;
4
5
  // this probe never downloads a client or changes that installation.
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  // The state-lock heartbeat worker re-checks the admission of the operation that holds the lock.
4
5
  // It used to make a new admission on every touch, which ran `git rev-parse` with the project as its
@@ -8,6 +8,7 @@
8
8
  //
9
9
  // 사용: node --require scripts/lock-probe.js bin/leerness.js <명령> ... (LOCKPROBE_OUT 에 jsonl 기록)
10
10
  'use strict';
11
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
11
12
  const fs = require('fs');
12
13
  const os = require('os');
13
14
  const path = require('path');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { createHash } = require('crypto');
4
5
  const { removeTree } = require('./temp-cleanup');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0110: MCP lifecycle calls with an explicit sessionKey must participate in
5
6
  // the same presence registry as direct CLI handoff/session-close calls. Generic
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0331: drop archive integrity record. Each decisions or lessons drop block starts, after its header line, with
3
4
  // "- Archive check: N entries, sha256 <hex>" over the entry text the drop wrote. A restore refuses a block that no
4
5
  // longer matches (archive_changed), so an edit or a cut anywhere in it is caught, including the cases T-0328 left as
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0193: real CLI coverage for fail-closed legacy archive retention plus
5
6
  // operation-local checked-file snapshot primitives used by restore.
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0354: scripts/memory-migration-test-support.js removes its arena at finish() when every test passed, and keeps
3
4
  // it when one failed. A link inside the arena that points outside it is removed as a link: its target and the files
4
5
  // in it must survive. An arena, or a folder in it, that was replaced with a link is not walked, whether that happened
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
  // Actual CLI processes, with bounded filesystem fault injection only in owned fixtures.
4
5
  const fs = require('fs'), path = require('path'), os = require('os');
5
6
  const cp = require('child_process'), assert = require('assert/strict'), crypto = require('crypto');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // 기존 JSON 구문 검사의 실행 순서만 검증한다. 완전한 schema/트랜잭션 검사가 아니다.
5
6
  const fs = require('fs');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // Actual CLI regression coverage for canonical array-root admission and preparation
5
6
  // before domain writes. Not a full item schema, UTF-8/size gate, transaction, or
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
  const fs=require('fs'),os=require('os'),path=require('path'),assert=require('assert/strict');
4
5
  const {captureMemoryInput,assertMemoryInputCurrent,getLegacyMemoryInput,assertCheckedFileCurrent}=require('../lib/memory-input');
5
6
  const temp=fs.mkdtempSync(path.join(os.tmpdir(),'leerness-memory-input-unit-'));
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0318: decision add / lesson add re-render decisions.md and lessons.md behind a generated header. The header
3
4
  // was Korean in every project; it now follows the harness authoring language (explicit choice, else the stored
4
5
  // project language). Existing files keep working: every known header variant is accepted as the generated one and
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0193: legacy-only Markdown mutation must retain opaque suffixes or refuse
5
6
  // before domain writes. Exercise the actual CLI, including migration backfill.
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const S = require('./memory-migration-write-support');
3
4
  const { fs, path, cp, assert, fixture, prepared, hook, modulePath } = S;
4
5
  const pause = ms => new Promise(resolve => setTimeout(resolve, ms));
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert');
3
4
  const fs = require('fs');
4
5
  const os = require('os');
@@ -58,39 +59,21 @@ const legacy = surface => surface === 'decisions'
58
59
  // the temp directory (1,206 were found). A failed run keeps it for inspection. Links inside the arena are removed
59
60
  // first, as links, so the removal never walks into a link's target, wherever that points. The arena itself must
60
61
  // still be the folder made above (same file identity, not a link): a test that renamed it away and put a link in its
61
- // place would otherwise have the walk run inside the link's target (review round 1).
62
- const arenaIdentity = fs.lstatSync(arena, { bigint: true });
63
- function sameArena() {
64
- const st = fs.lstatSync(arena, { bigint: true });
65
- return !st.isSymbolicLink() && st.isDirectory() && st.dev === arenaIdentity.dev && st.ino === arenaIdentity.ino;
66
- }
67
- // Review round 2: a folder can also be replaced by a link after its lstat, and the arena right after sameArena().
68
- // So each folder must still resolve inside the arena just before it is listed and before a link in it is removed.
69
- // finish() runs after the tests, so nothing else changes the arena then; a process that kept swapping folders
70
- // during finish() could still race these checks.
71
- const arenaReal = fs.realpathSync.native(arena);
72
- const replaced = () => Object.assign(new Error('the arena was replaced'), { code: 'E_ARENA_REPLACED' });
73
- function resolvesInArena(dir) {
74
- const relative = path.relative(arenaReal, fs.realpathSync.native(dir));
75
- return !(relative === '..' || relative.startsWith('..' + path.sep) || path.isAbsolute(relative));
76
- }
77
- function removeLinks(dir) {
78
- if (!resolvesInArena(dir)) throw replaced();
79
- for (const name of fs.readdirSync(dir)) {
80
- const file = path.join(dir, name), st = fs.lstatSync(file);
81
- if (st.isSymbolicLink()) {
82
- if (!resolvesInArena(dir)) throw replaced();
83
- try { fs.unlinkSync(file); } catch { fs.rmdirSync(file); }
84
- } else if (st.isDirectory()) removeLinks(file);
85
- }
86
- }
62
+ // place would otherwise have the walk run inside the link's target (review round 1). Review round 2: a folder can
63
+ // also be replaced by a link after its lstat, and the arena right after the identity check, so each folder must still
64
+ // resolve inside the arena just before it is listed and before a link in it is removed. finish() runs after the
65
+ // tests, so nothing else changes the arena then; a process that kept swapping folders during finish() could still
66
+ // race these checks. T-0357 moved these checks to scripts/temp-cleanup.js (ownTree, removeOwnedTree) for every probe.
67
+ // finish() reports its own removal attempt. Under the test runner the tracker (line 2) also records the arena: the
68
+ // runner keeps it after a failed run, and after a clean run in which finish() could not remove it, tries once more with
69
+ // the same checks.
70
+ const ownedArena = require('./temp-cleanup').ownTree(arena);
87
71
  function finish(label) {
88
72
  let kept = '';
89
73
  if (failed) { process.exitCode = 1; kept = ' (kept)'; }
90
74
  else {
91
75
  try {
92
- if (!sameArena()) throw replaced();
93
- removeLinks(arena); require('./temp-cleanup').removeTree(arena, { recursive: true, force: true }); kept = ' (removed)';
76
+ require('./temp-cleanup').removeOwnedTree(ownedArena, { code: 'E_ARENA_REPLACED' }); kept = ' (removed)';
94
77
  }
95
78
  catch (error) { kept = ` (not removed: ${error.code || error.message})`; }
96
79
  }
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const S = require('./memory-migration-test-support');
3
4
  const { assert, fs, path, test, project, snapshot, command, privateMetadata, legacy } = S;
4
5
  const adapter = require('../lib/memory-migration-transport');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0193: focused low-level evidence for parent/ancestor pathname replacement.
5
6
  // This probe does not claim that Node path APIs provide openat-style ancestor fencing.
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // POSIX-only race probe for T-0193 memory output publication. Windows has a
5
6
  // separate ReplaceFileW probe. This script is intentionally skipped on win32 so
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0193: actual CLI final-publication race probe.
5
6
  // The preload hook simulates a non-cooperating writer at the last pathname
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  const fs = require('fs');
5
6
  const os = require('os');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0193: canonical JSON이 authoritative인 상태에서 projection Markdown 뒤에
5
6
  // 붙은 사용자/producer 원문은 보존하고, projection 내부 divergence는 덮어쓰지 않는다.
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const S=require('./memory-write-budget-support');
3
4
  const {assert,fs,path,cp,test,finish,fixture,arena}=S;
4
5
  const os=require('os'),runtime=require('../lib/runtime-writes'),{attachMemoryRecovery}=require('../lib/memory-recovery');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0193: actual CLI fault injection for memory-domain partial-write recovery.
5
6
  // A receipt is evidence/recovery material, not an automatic rollback claim.
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // Real CLI tests for canonical-value preservation during legacy archive restore.
5
6
  // Raw JSON bytes, manual Markdown, and already-lossy archived fields are separate contracts.
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // Real CLI regression: invalid UTF-8 must not pass a memory mutation guard.
5
6
  // Scope is canonical decisions/lessons; Markdown retention and checked snapshots
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // Test-only meter adapted from the ML-04D experiment. Requires an owned fixture;
3
4
  // records path lengths at actual filesystem/replacement boundaries, not allocation.
4
5
  const fs=require('fs'), path=require('path'), cp=require('child_process');
@@ -3,6 +3,7 @@
3
3
  // (b) 언어 전환 (1.36.60 사고: 구 언어 템플릿이 커스텀으로 오인돼 이월)
4
4
  // (c) 연쇄 업그레이드 (구버전 → 중간 → 현재)
5
5
  // (d) 사용자가 **템플릿과 같은 문장**을 의도적으로 쓴 경우(차감이 지우면 안 된다)
6
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
6
7
  const fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
7
8
  const { spawnNpmSync } = require('../lib/npm-process');
8
9
  const CUR = require('path').join(__dirname, '..', 'bin', 'leerness.js'); // 저장소 어디에 있든 동작
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { createHash } = require('crypto');
4
5
  const { removeTree } = require('./temp-cleanup');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0022: destructive shell-encoding repair must fail closed when encoding
5
6
  // provenance, file identity, metadata, or concurrent-writer state is uncertain.
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  const fs = require('fs');
5
6
  const os = require('os');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  // Offline transport integration: ephemeral TLS certificate + real loopback
4
5
  // sockets. The request shim is test-local; the shipped API has no host override.
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  const assert = require('node:assert/strict');
4
5
  const fs = require('node:fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  const assert = require('node:assert/strict');
4
5
  const fs = require('node:fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  const assert = require('node:assert/strict');
4
5
  const fs = require('node:fs');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // T-0091: the parent-detect selftest must be independent of a Leerness
5
6
  // workspace above the OS temp directory, and partial setup must be cleaned if
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  const assert = require('assert');
4
5
  const fs = require('fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { createHash } = require('crypto');
4
5
  const { removeTree } = require('./temp-cleanup');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // Windows/Linux 플랫폼 경계의 빠른 회귀:
5
6
  // 1) selftest가 Windows 8.3(`RUNNER~1`) 실행 경로를 허용하는지,
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  // Provider-capacity observation must never turn installation, enablement, or generic
5
6
  // authentication into a model-entitlement or remaining-quota claim. All provider
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0346: the e2e-concurrency handshake (scripts/lock-probe.js reports, scripts/race-overlap.js judgement) with two
3
4
  // small processes instead of leerness commands, so each schedule is fixed. The first process takes
4
5
  // .leerness/x.json.lock (and y.json.lock when asked), prepares x.json and renames it into place; the preload stalls
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  const cp = require('child_process');
5
6
  const fs = require('fs');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  const fs = require('fs');
5
6
  const os = require('os');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { createHash } = require('crypto');
4
5
  const { removeTree } = require('./temp-cleanup');
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
3
4
 
4
5
  const assert = require('node:assert/strict');
5
6
  const fs = require('node:fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
 
3
4
  const assert = require('node:assert/strict');
4
5
  const fs = require('node:fs');
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  const assert = require('assert'), fs = require('fs'), path = require('path'), os = require('os'), cp = require('child_process');
3
4
  const { removeTree } = require('./temp-cleanup');
4
5
  if (!process.argv.includes('--worker')) {
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0320: `review-request --ladder` printed "[object Object]" in the in-codebase rung, in text and in --json, for every
3
4
  // reuse-map candidate. The rung labelled a candidate with r.name || r.id; reuse-map rows ({ capability, where }) have
4
5
  // neither, so it fell back to the row object. The rung and the reuse-candidate section now share one label per kind:
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('./temp-cleanup').trackTemp(module); // T-0357: records this run's temp folders; the runner that started it removes them after a clean exit
2
3
  // T-0322: review-request read brainstorm fields that brainstorm never emits. Failure lessons ({ title, line }) were read
3
4
  // as text/preview and printed as a blank "[lesson]" line; task-log failures ({ title, line }) printed a blank
4
5
  // "[task-log-failure]" line; in-progress task rows (which carry request, not title) printed only their id; milestones