@mjasnikovs/pi-task 0.38.28 → 0.38.30
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/dist/config/config.d.ts +70 -70
- package/dist/config/config.js +26 -35
- package/dist/config/extension-list.d.ts +6 -5
- package/dist/config/extension-list.js +3 -2
- package/dist/config/reasoning-args.d.ts +9 -7
- package/dist/config/reasoning-args.js +12 -10
- package/dist/config/reasoning.d.ts +44 -105
- package/dist/config/reasoning.js +27 -704
- package/dist/config/register.d.ts +34 -48
- package/dist/config/register.js +41 -51
- package/dist/config/tool-list.d.ts +16 -16
- package/dist/config/tool-list.js +1 -1
- package/dist/remote/bridge.d.ts +19 -10
- package/dist/remote/bridge.js +3 -2
- package/dist/remote/broadcast.js +3 -1
- package/dist/remote/events.js +12 -11
- package/dist/remote/history.d.ts +1 -1
- package/dist/remote/protocol.d.ts +6 -3
- package/dist/remote/protocol.js +2 -1
- package/dist/remote/push.d.ts +16 -16
- package/dist/remote/push.js +27 -27
- package/dist/remote/register.d.ts +3 -3
- package/dist/remote/register.js +17 -19
- package/dist/remote/server.d.ts +9 -8
- package/dist/remote/server.js +15 -14
- package/dist/remote/session-state.d.ts +5 -4
- package/dist/remote/session-state.js +8 -5
- package/dist/remote/sw.d.ts +7 -6
- package/dist/remote/sw.js +7 -6
- package/dist/remote/tailscale.d.ts +4 -2
- package/dist/remote/tailscale.js +4 -2
- package/dist/remote/ui-highlight.js +6 -5
- package/dist/remote/ui-render.js +4 -4
- package/dist/remote/ui-script.js +24 -24
- package/dist/remote/ui-styles.d.ts +1 -1
- package/dist/remote/ui-styles.js +10 -13
- package/dist/remote/ui-tools.js +9 -6
- package/dist/shared/child-extensions.d.ts +29 -17
- package/dist/shared/child-extensions.js +29 -17
- package/dist/shared/child-output.d.ts +30 -24
- package/dist/shared/child-output.js +25 -17
- package/dist/shared/child-process.d.ts +47 -40
- package/dist/shared/child-process.js +50 -59
- package/dist/shared/command-watchdog.d.ts +22 -16
- package/dist/shared/command-watchdog.js +28 -21
- package/dist/shared/fs-text.d.ts +16 -10
- package/dist/shared/fs-text.js +16 -10
- package/dist/shared/git-runner.d.ts +25 -25
- package/dist/shared/git-runner.js +25 -25
- package/dist/shared/leaked-tool-call.d.ts +17 -11
- package/dist/shared/leaked-tool-call.js +23 -15
- package/dist/shared/model-endpoint.d.ts +29 -16
- package/dist/shared/model-endpoint.js +33 -21
- package/dist/shared/pi-invocation.d.ts +7 -4
- package/dist/shared/pi-invocation.js +12 -7
- package/dist/shared/pkg-version.d.ts +13 -5
- package/dist/shared/pkg-version.js +13 -5
- package/dist/shared/reasoning-capability.d.ts +35 -24
- package/dist/shared/reasoning-capability.js +35 -24
- package/dist/shared/stream-watchdog.d.ts +60 -44
- package/dist/shared/stream-watchdog.js +62 -45
- package/dist/task/accept-debt.d.ts +41 -43
- package/dist/task/accept-debt.js +73 -65
- package/dist/task/api-synthesis.d.ts +24 -21
- package/dist/task/api-synthesis.js +32 -26
- package/dist/task/apis-contract.d.ts +32 -64
- package/dist/task/apis-contract.js +32 -64
- package/dist/task/artifact-closure.d.ts +27 -13
- package/dist/task/artifact-closure.js +95 -67
- package/dist/task/auto-commit.d.ts +46 -35
- package/dist/task/auto-commit.js +51 -38
- package/dist/task/auto-io.d.ts +45 -25
- package/dist/task/auto-io.js +57 -29
- package/dist/task/auto-orchestrator.d.ts +26 -24
- package/dist/task/auto-orchestrator.js +178 -162
- package/dist/task/auto-prompts.d.ts +36 -24
- package/dist/task/auto-prompts.js +40 -26
- package/dist/task/autofix-ledger.d.ts +27 -25
- package/dist/task/autofix-ledger.js +29 -26
- package/dist/task/batch-test-task.d.ts +20 -12
- package/dist/task/batch-test-task.js +67 -60
- package/dist/task/boot-probe.d.ts +60 -44
- package/dist/task/boot-probe.js +91 -72
- package/dist/task/cancel-input.d.ts +30 -16
- package/dist/task/cancel-input.js +20 -11
- package/dist/task/cancel-points.d.ts +27 -20
- package/dist/task/cancel-points.js +30 -22
- package/dist/task/child-runner.d.ts +46 -51
- package/dist/task/child-runner.js +48 -49
- package/dist/task/child-status.d.ts +23 -16
- package/dist/task/child-status.js +23 -16
- package/dist/task/clamp-output.js +12 -5
- package/dist/task/command-run.d.ts +31 -28
- package/dist/task/command-run.js +44 -35
- package/dist/task/command-shrink.d.ts +25 -18
- package/dist/task/command-shrink.js +37 -31
- package/dist/task/command-watchdog.d.ts +9 -6
- package/dist/task/command-watchdog.js +21 -15
- package/dist/task/context-attribution.d.ts +34 -26
- package/dist/task/context-attribution.js +34 -26
- package/dist/task/context-silence.d.ts +39 -29
- package/dist/task/context-silence.js +35 -25
- package/dist/task/context-usage.d.ts +25 -7
- package/dist/task/context-usage.js +21 -6
- package/dist/task/contracts.d.ts +8 -4
- package/dist/task/contracts.js +25 -17
- package/dist/task/coverage-loop.d.ts +22 -18
- package/dist/task/coverage-loop.js +35 -30
- package/dist/task/critique-probes.d.ts +13 -14
- package/dist/task/critique-probes.js +50 -39
- package/dist/task/debug-log.d.ts +13 -5
- package/dist/task/debug-log.js +32 -20
- package/dist/task/decompose-fidelity.d.ts +11 -9
- package/dist/task/decompose-fidelity.js +38 -33
- package/dist/task/decompose-granularity.d.ts +41 -38
- package/dist/task/decompose-granularity.js +41 -38
- package/dist/task/deep-render-check.d.ts +22 -14
- package/dist/task/deep-render-check.js +40 -31
- package/dist/task/dropped-input.d.ts +12 -7
- package/dist/task/dropped-input.js +5 -2
- package/dist/task/enforce-attribution.d.ts +38 -47
- package/dist/task/enforce-attribution.js +46 -52
- package/dist/task/enforce-guidelines.d.ts +31 -20
- package/dist/task/enforce-guidelines.js +32 -21
- package/dist/task/enrichment.d.ts +7 -2
- package/dist/task/enrichment.js +26 -14
- package/dist/task/env-notes.d.ts +16 -7
- package/dist/task/env-notes.js +48 -31
- package/dist/task/env-template-closure.d.ts +4 -4
- package/dist/task/env-template-closure.js +42 -34
- package/dist/task/external-context.d.ts +28 -21
- package/dist/task/external-context.js +17 -12
- package/dist/task/failure-classifier.d.ts +4 -5
- package/dist/task/failure-classifier.js +6 -7
- package/dist/task/file-inventory.d.ts +15 -11
- package/dist/task/file-inventory.js +25 -22
- package/dist/task/final-gate-fix.d.ts +74 -86
- package/dist/task/final-gate-fix.js +97 -116
- package/dist/task/final-gate-progress.d.ts +29 -46
- package/dist/task/final-gate-progress.js +40 -51
- package/dist/task/final-gate.d.ts +64 -97
- package/dist/task/final-gate.js +192 -199
- package/dist/task/fix-child.d.ts +21 -27
- package/dist/task/fix-child.js +21 -27
- package/dist/task/foreign-path.d.ts +6 -5
- package/dist/task/foreign-path.js +0 -0
- package/dist/task/frozen-conflict.d.ts +9 -10
- package/dist/task/frozen-conflict.js +61 -64
- package/dist/task/frozen-path-guard.d.ts +35 -14
- package/dist/task/frozen-path-guard.js +56 -39
- package/dist/task/gate-child.d.ts +27 -28
- package/dist/task/gate-child.js +37 -35
- package/dist/task/gate-deps.d.ts +34 -27
- package/dist/task/gate-deps.js +169 -159
- package/dist/task/gate-tally.d.ts +77 -80
- package/dist/task/gate-tally.js +65 -68
- package/dist/task/git-state-guard.d.ts +15 -11
- package/dist/task/git-state-guard.js +76 -66
- package/dist/task/impl-widget.d.ts +25 -16
- package/dist/task/impl-widget.js +27 -17
- package/dist/task/implementation-thinking.d.ts +33 -31
- package/dist/task/implementation-thinking.js +5 -6
- package/dist/task/implementation-turn.d.ts +34 -31
- package/dist/task/implementation-turn.js +29 -27
- package/dist/task/inline-markdown.d.ts +20 -7
- package/dist/task/inline-markdown.js +15 -6
- package/dist/task/launch-config-gap.js +25 -39
- package/dist/task/launch-contract.d.ts +18 -21
- package/dist/task/launch-contract.js +28 -30
- package/dist/task/launch-manifest.d.ts +6 -2
- package/dist/task/launch-manifest.js +35 -34
- package/dist/task/ledger.js +16 -14
- package/dist/task/lint-fix.d.ts +6 -8
- package/dist/task/lint-fix.js +67 -69
- package/dist/task/loop-detector.d.ts +9 -8
- package/dist/task/loop-detector.js +16 -12
- package/dist/task/mid-run-input.d.ts +17 -15
- package/dist/task/mid-run-input.js +17 -15
- package/dist/task/orchestrator.d.ts +24 -28
- package/dist/task/orchestrator.js +62 -64
- package/dist/task/orientation.d.ts +18 -23
- package/dist/task/orientation.js +24 -31
- package/dist/task/owned-freeze-conflict.d.ts +21 -20
- package/dist/task/owned-freeze-conflict.js +52 -85
- package/dist/task/owned-freeze-reassign.d.ts +40 -60
- package/dist/task/owned-freeze-reassign.js +41 -61
- package/dist/task/parsers.d.ts +4 -2
- package/dist/task/parsers.js +4 -4
- package/dist/task/phases.d.ts +41 -48
- package/dist/task/phases.js +180 -248
- package/dist/task/plan-io.d.ts +6 -7
- package/dist/task/plan-io.js +6 -7
- package/dist/task/plan-orchestrator.d.ts +10 -8
- package/dist/task/plan-orchestrator.js +14 -10
- package/dist/task/plan-prompts.d.ts +6 -5
- package/dist/task/plan-prompts.js +6 -5
- package/dist/task/plan-readonly.d.ts +4 -5
- package/dist/task/plan-readonly.js +4 -5
- package/dist/task/plan-rounds.d.ts +17 -29
- package/dist/task/plan-rounds.js +21 -34
- package/dist/task/plan-session.d.ts +58 -72
- package/dist/task/plan-session.js +61 -83
- package/dist/task/probe-gaming.d.ts +28 -27
- package/dist/task/probe-gaming.js +0 -0
- package/dist/task/prohibition-probe.d.ts +14 -16
- package/dist/task/prompts.d.ts +3 -4
- package/dist/task/prompts.js +17 -26
- package/dist/task/qa-transcript.d.ts +15 -22
- package/dist/task/qa-transcript.js +15 -21
- package/dist/task/question-box.d.ts +17 -13
- package/dist/task/question-box.js +19 -15
- package/dist/task/question-dedup.d.ts +6 -7
- package/dist/task/question-dedup.js +13 -14
- package/dist/task/question-dialog.d.ts +22 -32
- package/dist/task/question-dialog.js +22 -32
- package/dist/task/question-source.d.ts +18 -44
- package/dist/task/question-source.js +22 -51
- package/dist/task/refuted-constraint.d.ts +11 -31
- package/dist/task/refuted-constraint.js +27 -51
- package/dist/task/regenerable-artifacts.d.ts +12 -31
- package/dist/task/regenerable-artifacts.js +12 -31
- package/dist/task/render-check.d.ts +11 -22
- package/dist/task/render-check.js +33 -46
- package/dist/task/repo-health-check.d.ts +10 -14
- package/dist/task/repo-health-check.js +17 -23
- package/dist/task/requirements.d.ts +38 -71
- package/dist/task/requirements.js +78 -126
- package/dist/task/research-fanout-budget.d.ts +51 -88
- package/dist/task/research-fanout-budget.js +51 -88
- package/dist/task/research-worker.d.ts +33 -36
- package/dist/task/research-worker.js +39 -61
- package/dist/task/resume-gap.d.ts +14 -15
- package/dist/task/root-cause-repair.d.ts +9 -9
- package/dist/task/root-cause-repair.js +28 -40
- package/dist/task/run-bracket.d.ts +10 -13
- package/dist/task/run-end.d.ts +12 -22
- package/dist/task/run-end.js +8 -16
- package/dist/task/run-final-gate.d.ts +19 -21
- package/dist/task/run-final-gate.js +62 -80
- package/dist/task/runner-globs.d.ts +12 -13
- package/dist/task/runner-globs.js +12 -13
- package/dist/task/runner-resolve.d.ts +9 -9
- package/dist/task/runner-resolve.js +22 -23
- package/dist/task/script-escape.d.ts +10 -12
- package/dist/task/script-escape.js +13 -14
- package/dist/task/serve-entry.d.ts +1 -1
- package/dist/task/serve-entry.js +22 -25
- package/dist/task/service-blocks.js +4 -2
- package/dist/task/shipped-source.d.ts +11 -29
- package/dist/task/shipped-source.js +11 -29
- package/dist/task/skip-escape.js +10 -14
- package/dist/task/spec-urls.d.ts +26 -65
- package/dist/task/spec-urls.js +26 -65
- package/dist/task/spec-validation.d.ts +17 -20
- package/dist/task/spec-validation.js +17 -20
- package/dist/task/stall-detector.d.ts +23 -30
- package/dist/task/stall-detector.js +23 -30
- package/dist/task/stream-watchdog.d.ts +14 -12
- package/dist/task/stream-watchdog.js +14 -12
- package/dist/task/substitution-probe.d.ts +17 -20
- package/dist/task/substitution-probe.js +17 -20
- package/dist/task/task-gates.d.ts +36 -41
- package/dist/task/task-gates.js +95 -106
- package/dist/task/task-io.d.ts +4 -4
- package/dist/task/task-io.js +4 -4
- package/dist/task/task-parsers.js +4 -3
- package/dist/task/task-provenance.d.ts +2 -2
- package/dist/task/task-provenance.js +11 -13
- package/dist/task/task-types.d.ts +4 -3
- package/dist/task/terminal-outcome.d.ts +14 -16
- package/dist/task/terminal-outcome.js +12 -14
- package/dist/task/test-assembly.d.ts +13 -20
- package/dist/task/test-assembly.js +13 -20
- package/dist/task/timings.d.ts +5 -3
- package/dist/task/timings.js +5 -3
- package/dist/task/title-label.d.ts +9 -4
- package/dist/task/title-label.js +9 -4
- package/dist/task/type-only-answer.d.ts +44 -52
- package/dist/task/type-only-answer.js +44 -52
- package/dist/task/unfailable-command.d.ts +18 -24
- package/dist/task/unfailable-command.js +21 -27
- package/dist/task/unknown-routing.d.ts +10 -4
- package/dist/task/unknown-routing.js +10 -4
- package/dist/task/user-directives.d.ts +5 -8
- package/dist/task/user-directives.js +5 -8
- package/dist/task/verify-quality.d.ts +18 -22
- package/dist/task/verify-quality.js +45 -46
- package/dist/task/verify-reconcile.d.ts +15 -10
- package/dist/task/verify-reconcile.js +45 -43
- package/dist/task/verify-resolution.d.ts +24 -20
- package/dist/task/verify-resolution.js +51 -50
- package/dist/task/verify-work.d.ts +59 -66
- package/dist/task/verify-work.js +101 -138
- package/dist/task/widget.d.ts +15 -14
- package/dist/task/widget.js +22 -17
- package/dist/task/wiring-claims.d.ts +25 -32
- package/dist/task/wiring-claims.js +30 -35
- package/dist/task/write-guard.d.ts +39 -39
- package/dist/task/write-guard.js +48 -51
- package/dist/task/yolo.d.ts +34 -30
- package/dist/task/yolo.js +42 -37
- package/dist/workers/abstention.d.ts +21 -41
- package/dist/workers/abstention.js +27 -48
- package/dist/workers/brave-search.d.ts +4 -3
- package/dist/workers/brave-search.js +5 -2
- package/dist/workers/brave-warning.d.ts +7 -4
- package/dist/workers/brave-warning.js +19 -7
- package/dist/workers/ddg-search.d.ts +6 -6
- package/dist/workers/ddg-search.js +18 -12
- package/dist/workers/docs-cache.js +5 -2
- package/dist/workers/docs-chunk.d.ts +30 -37
- package/dist/workers/docs-chunk.js +37 -41
- package/dist/workers/docs-core.d.ts +28 -44
- package/dist/workers/docs-core.js +25 -44
- package/dist/workers/docs-index.js +4 -3
- package/dist/workers/docs-lookup.d.ts +15 -22
- package/dist/workers/docs-lookup.js +12 -21
- package/dist/workers/docs-project.d.ts +15 -9
- package/dist/workers/docs-project.js +17 -10
- package/dist/workers/docs-resolve.d.ts +19 -20
- package/dist/workers/docs-resolve.js +35 -32
- package/dist/workers/docs-retrieve.d.ts +5 -6
- package/dist/workers/docs-retrieve.js +18 -15
- package/dist/workers/exa-search.d.ts +9 -6
- package/dist/workers/exa-search.js +23 -12
- package/dist/workers/fetch-core.d.ts +13 -16
- package/dist/workers/fetch-core.js +23 -23
- package/dist/workers/focused-extractor.d.ts +12 -12
- package/dist/workers/focused-extractor.js +16 -19
- package/dist/workers/html-clean.js +24 -14
- package/dist/workers/http-request.d.ts +28 -20
- package/dist/workers/http-request.js +22 -17
- package/dist/workers/npm-version.d.ts +28 -11
- package/dist/workers/npm-version.js +24 -15
- package/dist/workers/phantom-imports.d.ts +15 -12
- package/dist/workers/phantom-imports.js +30 -24
- package/dist/workers/pi-worker-core.d.ts +86 -54
- package/dist/workers/pi-worker-core.js +112 -112
- package/dist/workers/pi-worker-docs.d.ts +24 -19
- package/dist/workers/pi-worker-docs.js +67 -76
- package/dist/workers/pi-worker-fetch.d.ts +7 -3
- package/dist/workers/pi-worker-fetch.js +27 -19
- package/dist/workers/pi-worker-search.js +12 -8
- package/dist/workers/pi-worker.d.ts +9 -4
- package/dist/workers/pi-worker.js +23 -10
- package/dist/workers/reasoning-warning.d.ts +18 -17
- package/dist/workers/reasoning-warning.js +22 -20
- package/dist/workers/research-cache.js +50 -78
- package/dist/workers/search-core.js +7 -5
- package/dist/workers/search-types.d.ts +10 -9
- package/dist/workers/search-types.js +9 -8
- package/dist/workers/session-hint.d.ts +13 -14
- package/dist/workers/session-hint.js +8 -9
- package/dist/workers/shared.d.ts +21 -25
- package/dist/workers/shared.js +0 -0
- package/dist/workers/single-read-extension.d.ts +14 -7
- package/dist/workers/single-read-extension.js +14 -7
- package/dist/workers/single-read-guard.d.ts +25 -28
- package/dist/workers/single-read-guard.js +32 -32
- package/dist/workers/typeonly-log.d.ts +12 -9
- package/dist/workers/typeonly-log.js +29 -33
- package/dist/workers/worker-channels.d.ts +15 -23
- package/dist/workers/worker-channels.js +15 -23
- package/dist/workers/worker-failure.d.ts +38 -46
- package/dist/workers/worker-failure.js +31 -39
- package/dist/workers/worker-kill.d.ts +25 -26
- package/dist/workers/worker-kill.js +16 -19
- package/dist/workers/worker-profiles.d.ts +43 -53
- package/dist/workers/worker-profiles.js +30 -38
- package/package.json +10 -8
|
@@ -1,68 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* of the block into the assembled prompt PROVEN separately. A pointer only helps a
|
|
35
|
-
* worker that has an unmet slot to fill.
|
|
36
|
-
* Both acted on the ANSWER side or the TARGET side. This one adds a FIELD A SIGNATURE CANNOT
|
|
37
|
-
* FILL, which is the variable that is not flat.
|
|
38
|
-
*
|
|
39
|
-
* ── STEP 3 OF THE FALLBACK IS LOAD-BEARING. DO NOT "CLOSE" IT ─────────────────────────────
|
|
40
|
-
*
|
|
41
|
-
* The `UNVERIFIED:` escape is mandatory and is not a loophole. Forbidding abstention is
|
|
42
|
-
* precisely how F-1 manufactured the confident wrong claim that killed run 15: worker:context,
|
|
43
|
-
* holding one true citable fact (the pinned hono version), fused it with an uncheckable one
|
|
44
|
-
* (what `hc`'s base URL means) under a single attribution — `hc<AppType>('/api')` — and every
|
|
45
|
-
* request in the shipped product went to /api/api/… and 404'd. A lever that buys behaviour
|
|
46
|
-
* questions with fabrication is a FAIL, not a win. The A/B asserts it: excerptVerified===false
|
|
47
|
-
* and the ungrounded-symbol rate must not rise.
|
|
48
|
-
*
|
|
49
|
-
* Exported unwired first, wired into RESEARCH_APIS_PROMPT in the same series; the STEP A
|
|
50
|
-
* feasibility probe splices this exact text into a patched dist so the probe and the shipped
|
|
51
|
-
* lever can never drift apart.
|
|
52
|
-
*/
|
|
53
|
-
/**
|
|
54
|
-
* The extra output-contract clause for RESEARCH_APIS_PROMPT.
|
|
55
|
-
*
|
|
56
|
-
* Wording notes, because each of these is answering something measured:
|
|
57
|
-
* - "NOT DONE WHEN THEY HAVE A SIGNATURE" is the whole lever. Stage 1's mechanism is
|
|
58
|
-
* completion-by-format, so the change has to move the completion bar, not add advice.
|
|
59
|
-
* - the worked example is the run-15 fatal case verbatim (`hc(baseUrl: Prefix, …)`), because
|
|
60
|
-
* a rule without an instance of what does NOT satisfy it reads as satisfied by anything.
|
|
61
|
-
* - step 2 says escalation is EXPECTED rather than permitted: bundled .d.ts files genuinely
|
|
62
|
-
* do not carry semantics, and a worker that reads "you may escalate" has been told nothing
|
|
63
|
-
* it did not already have (PROMPT 4 measured what permission alone achieves: nothing).
|
|
64
|
-
* - step 3 is stated as CORRECT and REQUIRED, in those words, so the field cannot be closed
|
|
65
|
-
* by guessing. See the header.
|
|
2
|
+
* An output-contract clause for the APIS research prompt that is NOT wired in.
|
|
3
|
+
*
|
|
4
|
+
* READ THIS FIRST: nothing splices this into `RESEARCH_APIS_PROMPT`. The only
|
|
5
|
+
* references to `APIS_SEMANTICS_CONTRACT` in the tree are its own tests and a
|
|
6
|
+
* regression guard in prompts.test.ts that asserts the shipped prompt does NOT
|
|
7
|
+
* contain it. The text is kept, and pinned by tests, so the lever can be read and
|
|
8
|
+
* re-tried — not because it is in use.
|
|
9
|
+
*
|
|
10
|
+
* WHAT IT WOULD CHANGE. `worker:apis` treats an entry as finished once it has a
|
|
11
|
+
* SIGNATURE, because that is what its output format asks for. A signature says
|
|
12
|
+
* nothing about what an argument MEANS, and the implementing agent has to guess —
|
|
13
|
+
* a plausible wrong guess about a base URL or a default is the most damaging thing
|
|
14
|
+
* this section can carry. The clause moves the completion bar: an entry is
|
|
15
|
+
* unfinished until it also carries a SEMANTICS field.
|
|
16
|
+
*
|
|
17
|
+
* STEP 3 OF THE FALLBACK IS LOAD-BEARING. DO NOT "CLOSE" IT. The `UNVERIFIED:`
|
|
18
|
+
* escape is mandatory and is not a loophole: a worker that may not abstain has
|
|
19
|
+
* nowhere to put an uncheckable fact except into a confident claim. A lever that
|
|
20
|
+
* buys behaviour questions with fabrication is a regression, not a win.
|
|
21
|
+
*
|
|
22
|
+
* Wording notes, each answering something the shape of the prompt forces. All four
|
|
23
|
+
* are present in the string below, checked:
|
|
24
|
+
* - "NOT DONE WHEN THEY HAVE A SIGNATURE" is the whole lever. The worker stops by
|
|
25
|
+
* format, so the change has to move the format's bar, not add advice.
|
|
26
|
+
* - the worked example (`hc(baseUrl: Prefix, …)`) shows an entry that does NOT
|
|
27
|
+
* satisfy the rule. A rule with no counter-example reads as satisfied by
|
|
28
|
+
* anything.
|
|
29
|
+
* - step 2 says escalation is EXPECTED — "Expect this:" — rather than permitted.
|
|
30
|
+
* Bundled `.d.ts` files genuinely carry no semantics, and "you may escalate"
|
|
31
|
+
* tells a worker nothing it did not already have.
|
|
32
|
+
* - step 3 is stated as "A CORRECT AND REQUIRED OUTCOME", in those words, so the
|
|
33
|
+
* field cannot be closed by guessing.
|
|
66
34
|
*/
|
|
67
35
|
export const APIS_SEMANTICS_CONTRACT = `THIRD-PARTY PACKAGE ENTRIES ARE NOT DONE WHEN THEY HAVE A SIGNATURE. For every entry whose symbol comes from a third-party npm package — not this project's own source, not a runtime builtin — the line carries a SECOND field saying what the thing MEANS in use: what one of its arguments stands for, what it defaults to, what a path/URL/prefix it is handed is relative to, or what its return value actually is. Format:
|
|
68
36
|
<name> <one-line signature or use> — SEMANTICS: <what it means in use>
|
|
@@ -32,9 +32,16 @@ export interface ProducedOutputs {
|
|
|
32
32
|
outdirs: Set<string>;
|
|
33
33
|
}
|
|
34
34
|
export declare function emptyProducers(): ProducedOutputs;
|
|
35
|
-
/** Normalize a literal path: posix separators, strip
|
|
36
|
-
* tails (HTML), trailing slash. Returns null when the literal
|
|
37
|
-
* checkable
|
|
35
|
+
/** Normalize a literal path: posix separators, strip `./` prefixes, query/hash
|
|
36
|
+
* tails (HTML), wrapping quotes, trailing slash. Returns null when the literal
|
|
37
|
+
* is not a checkable repo path — a scheme URL, protocol-relative `//host/x`,
|
|
38
|
+
* `~`, a `${…}` hole, a glob, anything with embedded whitespace, and anything
|
|
39
|
+
* under `node_modules/`.
|
|
40
|
+
*
|
|
41
|
+
* A single leading `/` is NOT a rejection: it is treated as root-relative and
|
|
42
|
+
* resolved from the repo root, which is what `<script src="/app.js">` means.
|
|
43
|
+
* So `/app.js` normalizes to `app.js`. A drive-letter path like `C:\win\a.js`
|
|
44
|
+
* is rejected, but as a SCHEME, not as an absolute path. */
|
|
38
45
|
export declare function normalizeRefPath(raw: string): string | null;
|
|
39
46
|
/** Extract runtime refs from one JS/TS source. */
|
|
40
47
|
export declare function extractJsRefs(source: string, referencer: string): RuntimeRef[];
|
|
@@ -84,22 +91,29 @@ export declare function collectProducersFromCommand(cmd: string, prod: ProducedO
|
|
|
84
91
|
* `writeFile(Sync)`, `createWriteStream`, `copyFile` dest, `mkdir(Sync)`),
|
|
85
92
|
* `Bun.build({entrypoints, outdir})` (enumerable — unless a `naming` option
|
|
86
93
|
* makes the output names underivable, then opaque), `outfile:`, and `Bun.spawn`
|
|
87
|
-
* argv arrays re-fed through the shell-command collector
|
|
88
|
-
* shape
|
|
94
|
+
* argv arrays re-fed through the shell-command collector, for the build-script
|
|
95
|
+
* shape where a tool's `-o dist/app.css` lives inside a spawn array rather than
|
|
96
|
+
* in package.json. All four run as described: entrypoints give
|
|
97
|
+
* `dist{a,b}`, adding `naming` turns `dist` opaque and drops the stems, the spawn
|
|
98
|
+
* array yields `dist/app.css`, and `outfile:` yields its exact file.
|
|
89
99
|
*/
|
|
90
100
|
export declare function collectProducersFromSource(source: string, prod: ProducedOutputs): void;
|
|
91
101
|
/**
|
|
92
102
|
* A WATCH/DEV script — one a production build never invokes.
|
|
93
103
|
*
|
|
94
|
-
* The
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
104
|
+
* The rule this exists for: a file whose ONLY producer is a watch-mode script —
|
|
105
|
+
* `dev:css` running `tailwindcss … -o dist/app.css --watch` — is not produced by
|
|
106
|
+
* a release at all. The gate runs `build`, `test`, `lint`; none of them invokes
|
|
107
|
+
* it, so the shipped page loads no CSS while a naive producer table reports the
|
|
108
|
+
* file "produced". A production artifact closed only by a watch script is
|
|
109
|
+
* dangling by construction.
|
|
100
110
|
*
|
|
101
|
-
* Deterministic
|
|
102
|
-
*
|
|
111
|
+
* Deterministic, name-or-flag based: a script whose NAME starts with
|
|
112
|
+
* `dev`/`watch` (bare or before `:`/`_`/`-`), or whose BODY carries `--watch`.
|
|
113
|
+
* Run across the edge cases — `development` and `predev` are NOT dev scripts,
|
|
114
|
+
* while a script literally named `build` running `tsc --watch` IS one. And
|
|
115
|
+
* end-to-end: with `excludeDevScripts`, a `dist/app.css` produced only by
|
|
116
|
+
* `dev:css` drops out of the producer table entirely.
|
|
103
117
|
*/
|
|
104
118
|
export declare function isDevScript(name: string, body: string): boolean;
|
|
105
119
|
export interface ProducerOpts {
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* artifact-closure — dangling runtime file references
|
|
3
|
-
* class, nexttask PROMPT 2).
|
|
2
|
+
* artifact-closure — dangling runtime file references.
|
|
4
3
|
*
|
|
5
|
-
* The failure this closes
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
4
|
+
* The failure this closes: a runtime file reference with NO producer anywhere in
|
|
5
|
+
* the plan ships silently. A server's SPA fallback reads
|
|
6
|
+
* `Bun.file('dist/index.html')`; the build emits only `app.css` and `main.js`;
|
|
7
|
+
* nothing — no task, no script, no build output — ever CREATES `index.html`, so
|
|
8
|
+
* the app 404s on every non-API GET. Sentence-grounded coverage cannot see it,
|
|
9
|
+
* because it credits the SERVING side to the server's task and is structurally
|
|
10
|
+
* blind to the missing PRODUCING side. The spec can be internally dangling the
|
|
11
|
+
* same way: prose requiring `index.html` be served while the file tree and build
|
|
12
|
+
* section never define it.
|
|
13
|
+
*
|
|
14
|
+
* Reproduced end-to-end while checking this file. A tree whose build runs
|
|
15
|
+
* `bun build entry.ts --outdir dist` and `tailwindcss -o dist/app.css`, with a
|
|
16
|
+
* server reading `dist/index.html`, `dist/app.css` and `dist/entry.js`, reports
|
|
17
|
+
* exactly ONE dangle — `dist/index.html` — and the other two stay silent.
|
|
14
18
|
*
|
|
15
19
|
* Two seams consume this module:
|
|
16
20
|
* • plan-time (auto-orchestrator): refs extracted from the SPEC's own snippets
|
|
@@ -19,26 +23,30 @@
|
|
|
19
23
|
* `missing` list (forcing a round that assigns a producing task) and are
|
|
20
24
|
* carried into `.pi-tasks/requirements.md` when still unowned at exhaustion.
|
|
21
25
|
* • final gate: the shipped tree is scanned; a dangling reference is a ranked
|
|
22
|
-
* failure naming referencer + missing path
|
|
26
|
+
* failure naming referencer + missing path.
|
|
23
27
|
*
|
|
24
|
-
* FP discipline
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
+
* FP discipline — ground in artifacts the model cannot fake, and treat
|
|
29
|
+
* inconclusive as never being evidence. Each rule below was run:
|
|
30
|
+
* • literal string paths only. A template hole, a bare variable and a
|
|
31
|
+
* concatenation each extract nothing; the literal beside them extracts.
|
|
28
32
|
* • a ref is DANGLING only on POSITIVE producer evidence: it must sit under a
|
|
29
|
-
* directory whose outputs
|
|
33
|
+
* directory whose outputs could actually be ENUMERATED (parsed build
|
|
30
34
|
* script/flags) and not be among them — or be a missing source-extension
|
|
31
35
|
* script entrypoint, which nothing ever builds. A ref under a directory
|
|
32
|
-
* produced by machinery
|
|
33
|
-
*
|
|
36
|
+
* produced by machinery that could NOT be enumerated is OPAQUE and steps
|
|
37
|
+
* aside. Demonstrated on ONE tree by changing only the build command:
|
|
38
|
+
* `vite build` (opaque `dist`) reports zero dangles, while
|
|
39
|
+
* `bun build entry.ts --outdir dist` (enumerable `dist`) reports both refs.
|
|
34
40
|
* • gitignored-but-built paths therefore never fire: being built means a
|
|
35
41
|
* producer names them (exact file, enumerable stem, or opaque dir).
|
|
36
|
-
* • existence is checked on the live tree
|
|
37
|
-
*
|
|
42
|
+
* • existence is checked on the live tree, so anything already present —
|
|
43
|
+
* committed, generated or hand-made — is satisfied. Creating a GITIGNORED
|
|
44
|
+
* `dist/index.html` took the same tree from one dangle to none.
|
|
38
45
|
*
|
|
39
|
-
*
|
|
40
|
-
* c.notFound()`)
|
|
41
|
-
* 404
|
|
46
|
+
* A GUARDED read does NOT step aside, deliberately. An existence guard
|
|
47
|
+
* (`if (!(await htmlFile.exists())) return c.notFound()`) is exactly how this bug
|
|
48
|
+
* presents — a permanent 404 rather than a crash — so the guard is a symptom, not
|
|
49
|
+
* an all-clear. Confirmed: the same ref flags with and without the guard.
|
|
42
50
|
*/
|
|
43
51
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
44
52
|
import * as path from 'node:path';
|
|
@@ -52,9 +60,16 @@ export function emptyProducers() {
|
|
|
52
60
|
outdirs: new Set()
|
|
53
61
|
};
|
|
54
62
|
}
|
|
55
|
-
/** Normalize a literal path: posix separators, strip
|
|
56
|
-
* tails (HTML), trailing slash. Returns null when the literal
|
|
57
|
-
* checkable
|
|
63
|
+
/** Normalize a literal path: posix separators, strip `./` prefixes, query/hash
|
|
64
|
+
* tails (HTML), wrapping quotes, trailing slash. Returns null when the literal
|
|
65
|
+
* is not a checkable repo path — a scheme URL, protocol-relative `//host/x`,
|
|
66
|
+
* `~`, a `${…}` hole, a glob, anything with embedded whitespace, and anything
|
|
67
|
+
* under `node_modules/`.
|
|
68
|
+
*
|
|
69
|
+
* A single leading `/` is NOT a rejection: it is treated as root-relative and
|
|
70
|
+
* resolved from the repo root, which is what `<script src="/app.js">` means.
|
|
71
|
+
* So `/app.js` normalizes to `app.js`. A drive-letter path like `C:\win\a.js`
|
|
72
|
+
* is rejected, but as a SCHEME, not as an absolute path. */
|
|
58
73
|
export function normalizeRefPath(raw) {
|
|
59
74
|
let p = raw.trim().replace(/\\/g, '/');
|
|
60
75
|
// Markdown/shell wrapping (a spec bullet's `-o dist/app.css` arrives with a
|
|
@@ -147,26 +162,27 @@ export function extractHtmlRefs(source, referencer) {
|
|
|
147
162
|
return out;
|
|
148
163
|
}
|
|
149
164
|
// ---------------------------------------------------------------------------
|
|
150
|
-
// GENERATED HTML
|
|
165
|
+
// GENERATED HTML.
|
|
151
166
|
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
// source GENERATES. So one dangling reference was closed by creating another one
|
|
158
|
-
// indirection deeper.
|
|
167
|
+
// Without this pass there is a way to "fix" a dangle by moving it one
|
|
168
|
+
// indirection deeper. The extractor scans HTML FILES and JS READS; it does not
|
|
169
|
+
// see the HTML a source GENERATES. So a build script can satisfy a missing
|
|
170
|
+
// `dist/index.html` by writing one from a template literal — and that page can
|
|
171
|
+
// point at an asset the production build never emits, which nothing then checks.
|
|
159
172
|
//
|
|
160
173
|
// Scope discipline, the reason this does not become an FP machine: a literal is
|
|
161
174
|
// scanned ONLY when it reaches a write whose destination is an HTML file inside a
|
|
162
|
-
// directory a BUILD TOOL declared as its output (`prod.outdirs`).
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
175
|
+
// directory a BUILD TOOL declared as its output (`prod.outdirs`). Both halves
|
|
176
|
+
// were run. The same `Bun.write("dist/index.html", …)` source yields refs when
|
|
177
|
+
// `dist` is a declared outdir and NOTHING when it is not; a write into `report/`
|
|
178
|
+
// — enumerable, but never an outdir — yields nothing either. An email-body
|
|
179
|
+
// template that is only exported, never written, is not collected at all,
|
|
180
|
+
// `<img src="cid:logo">` and all.
|
|
166
181
|
// ---------------------------------------------------------------------------
|
|
167
|
-
/** Asset attributes scanned in GENERATED HTML
|
|
168
|
-
*
|
|
169
|
-
*
|
|
182
|
+
/** Asset attributes scanned in GENERATED HTML: everything HTML_PATTERNS matches,
|
|
183
|
+
* plus `<source>`, `<video>` and `<audio>` src. On-disk `.html` files keep using
|
|
184
|
+
* the narrower HTML_PATTERNS — confirmed, a `<video src>` in a real HTML file
|
|
185
|
+
* extracts nothing. */
|
|
170
186
|
const GENERATED_HTML_PATTERNS = [
|
|
171
187
|
...HTML_PATTERNS,
|
|
172
188
|
{
|
|
@@ -199,8 +215,10 @@ function readLiteral(src, i) {
|
|
|
199
215
|
}
|
|
200
216
|
return null;
|
|
201
217
|
}
|
|
202
|
-
/** `const NAME = <literal>` bindings (also let/var)
|
|
203
|
-
* `const html = \`…\`` followed by
|
|
218
|
+
/** `const NAME = <literal>` bindings (also let/var). The shape this exists for is
|
|
219
|
+
* a build script holding its page in a variable — `const html = \`…\`` followed by
|
|
220
|
+
* `Bun.write('dist/index.html', html)` — where the literal and the write are not
|
|
221
|
+
* the same expression. */
|
|
204
222
|
function literalBindings(src) {
|
|
205
223
|
const out = new Map();
|
|
206
224
|
const re = /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?=['"`])/g;
|
|
@@ -486,8 +504,11 @@ export function collectProducersFromCommand(cmd, prod, opts = {}) {
|
|
|
486
504
|
* `writeFile(Sync)`, `createWriteStream`, `copyFile` dest, `mkdir(Sync)`),
|
|
487
505
|
* `Bun.build({entrypoints, outdir})` (enumerable — unless a `naming` option
|
|
488
506
|
* makes the output names underivable, then opaque), `outfile:`, and `Bun.spawn`
|
|
489
|
-
* argv arrays re-fed through the shell-command collector
|
|
490
|
-
* shape
|
|
507
|
+
* argv arrays re-fed through the shell-command collector, for the build-script
|
|
508
|
+
* shape where a tool's `-o dist/app.css` lives inside a spawn array rather than
|
|
509
|
+
* in package.json. All four run as described: entrypoints give
|
|
510
|
+
* `dist{a,b}`, adding `naming` turns `dist` opaque and drops the stems, the spawn
|
|
511
|
+
* array yields `dist/app.css`, and `outfile:` yields its exact file.
|
|
491
512
|
*/
|
|
492
513
|
export function collectProducersFromSource(source, prod) {
|
|
493
514
|
const src = stripCommentLines(source);
|
|
@@ -637,15 +658,19 @@ function packageScripts(cwd) {
|
|
|
637
658
|
/**
|
|
638
659
|
* A WATCH/DEV script — one a production build never invokes.
|
|
639
660
|
*
|
|
640
|
-
* The
|
|
641
|
-
*
|
|
642
|
-
*
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
*
|
|
661
|
+
* The rule this exists for: a file whose ONLY producer is a watch-mode script —
|
|
662
|
+
* `dev:css` running `tailwindcss … -o dist/app.css --watch` — is not produced by
|
|
663
|
+
* a release at all. The gate runs `build`, `test`, `lint`; none of them invokes
|
|
664
|
+
* it, so the shipped page loads no CSS while a naive producer table reports the
|
|
665
|
+
* file "produced". A production artifact closed only by a watch script is
|
|
666
|
+
* dangling by construction.
|
|
646
667
|
*
|
|
647
|
-
* Deterministic
|
|
648
|
-
*
|
|
668
|
+
* Deterministic, name-or-flag based: a script whose NAME starts with
|
|
669
|
+
* `dev`/`watch` (bare or before `:`/`_`/`-`), or whose BODY carries `--watch`.
|
|
670
|
+
* Run across the edge cases — `development` and `predev` are NOT dev scripts,
|
|
671
|
+
* while a script literally named `build` running `tsc --watch` IS one. And
|
|
672
|
+
* end-to-end: with `excludeDevScripts`, a `dist/app.css` produced only by
|
|
673
|
+
* `dev:css` drops out of the producer table entirely.
|
|
649
674
|
*/
|
|
650
675
|
export function isDevScript(name, body) {
|
|
651
676
|
return /^(?:dev|watch)\b|^(?:dev|watch)[:._-]/i.test(name) || /(?:^|\s)--watch\b/.test(body);
|
|
@@ -666,7 +691,8 @@ export function discoverProducers(cwd, opts = {}) {
|
|
|
666
691
|
for (const cmd of splitShellCommands(body)) {
|
|
667
692
|
collectProducersFromCommand(cmd, prod);
|
|
668
693
|
// A script that runs a local JS/TS file may produce through it —
|
|
669
|
-
// parse that file's source too
|
|
694
|
+
// parse that file's source too, for the `bun build.ts` shape where
|
|
695
|
+
// the real output flags live inside the script, not the command.
|
|
670
696
|
for (const t of cmd.split(/\s+/)) {
|
|
671
697
|
if (isPathToken(t) && /\.(?:ts|js|mjs|cjs)$/.test(t)) {
|
|
672
698
|
const p = normalizeRefPath(t);
|
|
@@ -796,9 +822,9 @@ export function findDanglingArtifacts(cwd) {
|
|
|
796
822
|
const prod = discoverProducers(cwd);
|
|
797
823
|
// Second, PRODUCTION-only table: identical machinery minus watch/dev scripts.
|
|
798
824
|
// Generated-HTML refs resolve against this one, so a file whose only producer
|
|
799
|
-
// is
|
|
800
|
-
//
|
|
801
|
-
//
|
|
825
|
+
// is a `--watch` script does not close a reference the built page makes.
|
|
826
|
+
// Everything else keeps resolving against the full table, so widening the
|
|
827
|
+
// production view cannot move an existing finding.
|
|
802
828
|
const prodProduction = discoverProducers(cwd, { excludeDevScripts: true });
|
|
803
829
|
const refs = [];
|
|
804
830
|
const sources = [];
|
|
@@ -880,9 +906,9 @@ export function danglingGateFailureText(d) {
|
|
|
880
906
|
+ `but nothing in the tree, build outputs, or scripts produces it — ${d.reason}`);
|
|
881
907
|
}
|
|
882
908
|
// ---------------------------------------------------------------------------
|
|
883
|
-
// Plan-time seam: the SPEC's own snippets referencing artifacts the
|
|
884
|
-
// defines
|
|
885
|
-
// file tree
|
|
909
|
+
// Plan-time seam: the SPEC's own snippets and prose referencing artifacts the
|
|
910
|
+
// spec never defines — a design document whose behaviour section requires
|
|
911
|
+
// serving `index.html` while its file tree and build section never produce it.
|
|
886
912
|
// ---------------------------------------------------------------------------
|
|
887
913
|
/** Does the spec LIST the file as its own artifact — a file-tree entry or a
|
|
888
914
|
* bullet whose first token is (or ends with) the basename? Prose that merely
|
|
@@ -903,14 +929,16 @@ export function specListsFile(spec, refPath) {
|
|
|
903
929
|
return false;
|
|
904
930
|
}
|
|
905
931
|
/** Consuming-side prose verbs: a spec sentence that SERVES/READS/LOADS a
|
|
906
|
-
* backticked file is referencing it at runtime
|
|
907
|
-
* "**SPA fallback:** non-`/api` GETs serve the built `index.html`."
|
|
932
|
+
* backticked file is referencing it at runtime — the shape being a line like
|
|
933
|
+
* "**SPA fallback:** non-`/api` GETs serve the built `index.html`." */
|
|
908
934
|
const PROSE_CONSUME_RE = /\b(?:serves?|serving|served|fallback|reads?|loads?|renders?)\b/i;
|
|
909
935
|
/** Runtime-artifact extensions the prose channel accepts. Prose is the loosest
|
|
910
|
-
* signal, so
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
*
|
|
936
|
+
* signal, so the list is a tight whitelist rather than a blocklist: a backticked
|
|
937
|
+
* dotted identifier must never read as a file, and neither must a doc file a
|
|
938
|
+
* spec tells the READER to open. Run on a consuming-verb line, `c.var.user`,
|
|
939
|
+
* `Bun.password.hash`, `foo.bar` and `README.md` all extract nothing, while
|
|
940
|
+
* `index.html`, `data/seed.json` and `assets/logo.svg` all extract.
|
|
941
|
+
* Code-construct refs are not subject to this list. */
|
|
914
942
|
const PROSE_ASSET_EXT_RE = /\.(?:html?|css|m?js|cjs|json|svg|png|jpe?g|gif|webp|ico|woff2?|ttf|otf|wasm|webmanifest|xml|csv|sql|ya?ml|toml|pdf|mp[34]|db|sqlite)$/i;
|
|
915
943
|
/** Backticked, asset-extension, path-shaped tokens on consuming-verb lines. */
|
|
916
944
|
export function extractSpecProseRefs(spec) {
|
|
@@ -8,17 +8,23 @@ export interface CommitResult {
|
|
|
8
8
|
/** UNTRACKED regenerable test-runner output this commit deliberately left out
|
|
9
9
|
* of the index (see `stagePathspec`). Empty/absent when nothing was excluded.
|
|
10
10
|
* Present so the caller can TRAIL it: a silent exclusion is the same failure
|
|
11
|
-
* class as
|
|
11
|
+
* class as a silent write to an ignored path. */
|
|
12
12
|
excluded?: string[];
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Does this git stderr describe a missing author identity?
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Does this git stderr describe a missing author identity?
|
|
16
|
+
*
|
|
17
|
+
* The failure it catches is total rather than partial: with no usable gitconfig
|
|
18
|
+
* every per-task commit fails, which silently disables enforce and every
|
|
19
|
+
* commit-based differential guard for the rest of the run. Reproduced with real
|
|
20
|
+
* git — committing with `HOME` unset and both config files pointed at
|
|
21
|
+
* `/dev/null` prints "Author identity unknown" plus the `user.email` /
|
|
22
|
+
* `user.name` advice, and this predicate matches that text while rejecting an
|
|
23
|
+
* unrelated `fatal: not a git repository`.
|
|
19
24
|
*/
|
|
20
25
|
export declare function isIdentityFailure(stderr: string): boolean;
|
|
21
|
-
/** Fallback identity for environments with no git config
|
|
26
|
+
/** Fallback identity for environments with no git config. Confirmed against real
|
|
27
|
+
* git: the same commit that fails with no identity succeeds with these args. */
|
|
22
28
|
export declare const FALLBACK_IDENTITY_ARGS: readonly ["-c", "user.name=pi-task", "-c", "user.email=pi-task@local"];
|
|
23
29
|
export declare function git(cwd: string, args: string[], signal: AbortSignal | undefined, spawnFn?: SpawnFn): Promise<{
|
|
24
30
|
stdout: string;
|
|
@@ -31,40 +37,43 @@ export declare function git(cwd: string, args: string[], signal: AbortSignal | u
|
|
|
31
37
|
* `test-results/`, `playwright-report/`, `coverage/`, `.nyc_output/`,
|
|
32
38
|
* `.last-run.json`, `*.tsbuildinfo`.
|
|
33
39
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* final-gate fix attempts were then rejected for deleting them. The deletion guard
|
|
39
|
-
* fix (write-guard.ts) stops the rejection; this stops the tracking.
|
|
40
|
+
* The failure this closes: a bare `git add -A` sweeps up whatever the test run
|
|
41
|
+
* just littered the tree with — a failure screenshot, a coverage dir — and commits
|
|
42
|
+
* it, making regenerable output a TRACKED deliverable. A later task that cleans it
|
|
43
|
+
* up then reads as deleting someone's work.
|
|
40
44
|
*
|
|
41
45
|
* ONLY UNTRACKED PATHS ARE EXCLUDED, and that is load-bearing rather than tidy.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
46
|
+
* Both halves measured with real git in a repo with a gitignored `coverage/` and
|
|
47
|
+
* an untracked `test-results/`:
|
|
48
|
+
* • `ls-files --others --exclude-standard` returned the untracked file alone;
|
|
49
|
+
* dropping the flag brought the gitignored one back too.
|
|
50
|
+
* • a TRACKED file never appears, even while modified.
|
|
51
|
+
* So a project that deliberately commits, say, a `coverage/` badge keeps having
|
|
52
|
+
* its edits to it committed. Excluding by directory pathspec instead
|
|
53
|
+
* (`:(exclude)coverage/`) would silently stop committing those.
|
|
47
54
|
*
|
|
48
|
-
* Best-effort: any git failure yields an empty list, i.e.
|
|
55
|
+
* Best-effort: any git failure yields an empty list, i.e. a plain `git add -A`.
|
|
49
56
|
*/
|
|
50
57
|
export declare function untrackedArtifacts(cwd: string, signal?: AbortSignal, spawnFn?: SpawnFn): Promise<string[]>;
|
|
51
58
|
/** `:(exclude)` pathspecs for `git add -A`; empty when nothing is excluded, so the
|
|
52
|
-
* common case
|
|
59
|
+
* common case adds no arguments at all and stays a bare `git add -A`. */
|
|
53
60
|
export declare function stagePathspec(excluded: readonly string[]): string[];
|
|
54
61
|
/**
|
|
55
62
|
* Paths with unmerged index entries (an in-progress merge conflict), deduped.
|
|
56
63
|
* Empty outside a git repo or on any git error — this is a GUARD input, and a
|
|
57
64
|
* guard that cannot conclude must not block.
|
|
58
65
|
*
|
|
59
|
-
* Why it exists
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
66
|
+
* Why it exists: with an unmerged index every later commit is doomed, verify runs
|
|
67
|
+
* against a conflicted tree, and — worst — a blind `git add -A` SILENTLY resolves
|
|
68
|
+
* the conflict with whatever is on disk. Reproduced on a real conflict: `git
|
|
69
|
+
* status` showed `UU c.txt`, then a bare `git add -A` turned it into `M c.txt`
|
|
70
|
+
* and left `ls-files -u` empty. The conflict markers become staged content and
|
|
71
|
+
* nothing says so.
|
|
63
72
|
*/
|
|
64
73
|
export declare function gitUnmergedPaths(cwd: string, signal?: AbortSignal, spawnFn?: SpawnFn): Promise<string[]>;
|
|
65
74
|
/** Sha of `refs/stash`, or null when there is no stash (or not a git repo). Used
|
|
66
75
|
* to detect a stash created (or consumed) during a task and left behind — the
|
|
67
|
-
* exact landmine that
|
|
76
|
+
* exact landmine that detonates days after it is pushed. */
|
|
68
77
|
export declare function gitStashRef(cwd: string, signal?: AbortSignal, spawnFn?: SpawnFn): Promise<string | null>;
|
|
69
78
|
/**
|
|
70
79
|
* Stage everything (`git add -A`) and commit it with `message`. Honors
|
|
@@ -81,17 +90,19 @@ export declare function gitCommitAll(cwd: string, message: string, signal?: Abor
|
|
|
81
90
|
* verified task commit underneath it.
|
|
82
91
|
*
|
|
83
92
|
* `reset --hard` targets the enforce pass's in-place SOURCE edits. But it must NOT
|
|
84
|
-
* rewind the forensic gate trail
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* the
|
|
93
|
+
* rewind the forensic gate trail. `.pi-tasks/` is frequently TRACKED here — unlike
|
|
94
|
+
* the accept-debt ledger's writers, the per-task snapshot stages it with a plain
|
|
95
|
+
* `git add -A` and no exclusion — so a bare reset rewinds the task file along with
|
|
96
|
+
* the source and ERASES every trail line written after the snapshot.
|
|
97
|
+
*
|
|
98
|
+
* Both halves were run on a real repo. A bare `reset --hard HEAD~1` restored the
|
|
99
|
+
* source AND dropped the trail line added after the snapshot; calling this
|
|
100
|
+
* function on the identical setup restored the source and kept that line. The
|
|
101
|
+
* revert undoes code, the audit log survives.
|
|
92
102
|
*
|
|
93
|
-
* Best-effort and never throws: a git failure is swallowed
|
|
94
|
-
* already decided to keep the verified work
|
|
95
|
-
* enforce commit in place, which is surfaced as a warning
|
|
103
|
+
* Best-effort and never throws: a git failure is swallowed, since the caller has
|
|
104
|
+
* already decided to keep the verified work and a failed reset only leaves the
|
|
105
|
+
* enforce commit in place, which is surfaced as a warning. Called on a directory
|
|
106
|
+
* that is not a repo at all, it returns without throwing.
|
|
96
107
|
*/
|
|
97
108
|
export declare function gitDropLastCommit(cwd: string, signal?: AbortSignal, spawnFn?: SpawnFn): Promise<void>;
|