@mjasnikovs/pi-task 0.38.29 → 0.38.31
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/index.js +2 -0
- 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 +85 -16
- package/dist/shared/command-watchdog.js +115 -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 +192 -165
- 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 +124 -55
- package/dist/task/child-runner.js +298 -90
- 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 +16 -9
- package/dist/task/context-usage.js +16 -9
- 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 +30 -8
- 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 +36 -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-guards.d.ts +26 -0
- package/dist/task/implementation-guards.js +177 -0
- package/dist/task/implementation-thinking.d.ts +33 -31
- package/dist/task/implementation-thinking.js +5 -6
- package/dist/task/implementation-turn.d.ts +39 -31
- package/dist/task/implementation-turn.js +41 -28
- 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 +27 -8
- package/dist/task/loop-detector.js +38 -14
- 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 +89 -66
- 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 +196 -252
- 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 +29 -39
- package/dist/task/research-worker.js +37 -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 +13 -12
- package/dist/workers/focused-extractor.js +27 -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 +65 -96
- package/dist/workers/pi-worker-core.js +93 -181
- 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 +21 -14
- 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 +27 -30
- package/dist/workers/single-read-guard.js +36 -36
- 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 +54 -56
- package/dist/workers/worker-profiles.js +63 -39
- package/package.json +10 -8
package/dist/task/accept-debt.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* accept-debt — a per-run ledger of tasks the user ACCEPTED despite a verify-FAIL.
|
|
3
3
|
*
|
|
4
|
-
* The failure this closes
|
|
4
|
+
* The failure this closes:
|
|
5
5
|
* when a task's VERIFY gate FAILs and the resolution picker's ACCEPT branch is
|
|
6
6
|
* chosen, the human blesses the artifact AS-IS — a real, recorded defect ships and
|
|
7
|
-
* NOTHING revisits it.
|
|
8
|
-
*
|
|
9
|
-
* still be broken at run end, and no gate ever said which.
|
|
7
|
+
* NOTHING revisits it. A later task could have fixed it, or it could still be
|
|
8
|
+
* broken at run end, and no gate ever said which.
|
|
10
9
|
*
|
|
11
|
-
* Mechanism (mirrors env-notes.ts / contracts.ts): each
|
|
12
|
-
* appended HOST-SIDE to `.pi-tasks/accept-debt.md` as a
|
|
13
|
-
* record
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* Mechanism (mirrors env-notes.ts / contracts.ts, which share `makeLedger`): each
|
|
11
|
+
* ACCEPT-despite-FAIL is appended HOST-SIDE to `.pi-tasks/accept-debt.md` as a
|
|
12
|
+
* durable tab-separated record. The gate sequence never lets a child write the
|
|
13
|
+
* file, so it cannot be corrupted by the work it is recording.
|
|
14
|
+
*
|
|
15
|
+
* Living under `.pi-tasks/` is what makes it durable, and both exclusions are
|
|
16
|
+
* explicit rather than incidental. `discardEdits` runs
|
|
17
|
+
* `git checkout -- . ':(exclude).pi-tasks'` then `git clean -fd -e .pi-tasks`, and
|
|
18
|
+
* the git-state guard writes its tree with the same `:(exclude).pi-tasks` pathspec.
|
|
19
|
+
* Confirmed against a real repo: a discard restored the tracked file, removed the
|
|
20
|
+
* untracked one, and left the ledger byte-identical; and appending a debt did not
|
|
21
|
+
* move the guard's tree hash, while a one-line source edit did.
|
|
16
22
|
*
|
|
17
23
|
* RE-CHECK at run end (final-gate.ts): the final integration gate reads the ledger,
|
|
18
24
|
* re-checks each debt against the CURRENT tree, and SURFACES the ones still open in
|
|
@@ -49,11 +55,11 @@ const FIELD_SEP = '\t';
|
|
|
49
55
|
/**
|
|
50
56
|
* Origin → the one-line provenance label the surfaced report prints for it
|
|
51
57
|
* (describeDebt). This table IS the origin registry: `Record<DebtOrigin, string>`
|
|
52
|
-
* makes a new union member a compile error until it has a label, and
|
|
53
|
-
* describe side and the parse side read it
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
58
|
+
* makes a new union member a compile error until it has a label, and BOTH the
|
|
59
|
+
* describe side and the parse side read it — `isKnownOrigin` tests membership of
|
|
60
|
+
* this very table — so adding an origin is one union member plus one line here.
|
|
61
|
+
* The label text is user-facing: it lands in the final gate's report and in the
|
|
62
|
+
* FAIL picker, so these strings are byte-frozen.
|
|
57
63
|
*/
|
|
58
64
|
const DEBT_LABELS = {
|
|
59
65
|
accepted: 'accepted despite verify-FAIL',
|
|
@@ -100,7 +106,7 @@ export function parseAcceptDebts(raw) {
|
|
|
100
106
|
continue;
|
|
101
107
|
}
|
|
102
108
|
const origin = parts[2]?.trim();
|
|
103
|
-
// 4th field: the verbatim VERIFY command the reason names
|
|
109
|
+
// 4th field: the verbatim VERIFY command the reason names.
|
|
104
110
|
// Absent in every legacy record, and absent in most new ones.
|
|
105
111
|
const verifyCommand = parts[3]?.trim();
|
|
106
112
|
out.push({
|
|
@@ -165,7 +171,7 @@ async function appendDebt(cwd, entry) {
|
|
|
165
171
|
return;
|
|
166
172
|
try {
|
|
167
173
|
// Classify AT RECORD TIME, against the spec as it stands when the defect is
|
|
168
|
-
// recorded
|
|
174
|
+
// recorded. Doing it later would read a spec a subsequent task
|
|
169
175
|
// may have rewritten — the provenance claim has to be made where it is true.
|
|
170
176
|
const verifyCommand = entry.verifyCommand ?? (await classifyVerifyCommand(cwd, entry.taskId, entry.reason));
|
|
171
177
|
if (verifyCommand !== null && verifyCommand !== undefined)
|
|
@@ -188,19 +194,18 @@ async function appendDebt(cwd, entry) {
|
|
|
188
194
|
* Best-effort by construction (appendDebt swallows its own faults): the ledger is an
|
|
189
195
|
* auditing aid and must never break the gate sequence that calls it.
|
|
190
196
|
*
|
|
191
|
-
* `origin` is REQUIRED and deliberately has no default.
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* Making it explicit turns that whole class of slip into a compile error.
|
|
197
|
+
* `origin` is REQUIRED and deliberately has no default. A default of 'accepted'
|
|
198
|
+
* would be the tempting one, since that is the legacy 2-field on-disk shape — and
|
|
199
|
+
* that is exactly what makes it dangerous. A dropped argument would then be
|
|
200
|
+
* absorbed in silence, stamping a run-level 'final-gate' demotion as a human
|
|
201
|
+
* 'accepted': the one confusion this type exists to prevent. Requiring it turns
|
|
202
|
+
* that slip into a compile error instead.
|
|
198
203
|
*/
|
|
199
204
|
export async function recordDebt(cwd, taskId, reason, origin) {
|
|
200
205
|
await appendDebt(cwd, { taskId: taskId.trim(), reason: normaliseReason(reason), origin });
|
|
201
206
|
}
|
|
202
207
|
/**
|
|
203
|
-
* The reason text a CROSS-TASK DELETION debt stores
|
|
208
|
+
* The reason text a CROSS-TASK DELETION debt stores: the task's
|
|
204
209
|
* work deleted a file a DIFFERENT task's commit introduced, verify FAILed, and the
|
|
205
210
|
* user ACCEPTed — so the deletion survives into the next commit. The shape is fixed
|
|
206
211
|
* and machine-parseable so the final gate's re-check can extract the path and prove
|
|
@@ -237,16 +242,14 @@ export function isStaticClassDebt(reason) {
|
|
|
237
242
|
return isStaticClass(failClassOfReason(reason));
|
|
238
243
|
}
|
|
239
244
|
/**
|
|
240
|
-
* The VERIFY-COMMAND class
|
|
245
|
+
* The VERIFY-COMMAND class: the ONE command a recorded reason itself
|
|
241
246
|
* NAMES, quoted verbatim in backticks, and present byte-identically in the owning
|
|
242
247
|
* task's VERIFY block.
|
|
243
248
|
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* could ever have closed it (see recheckAcceptDebts: two classes, neither reachable
|
|
249
|
-
* for a `work did not verify:` reason).
|
|
249
|
+
* Without it, a debt whose reason reads `work did not verify: The VERIFY block
|
|
250
|
+
* command \`…\` fails unaided` can be FIXED by a later autofix and still be
|
|
251
|
+
* reported STILL OPEN at run end, because no reachable code path could close it:
|
|
252
|
+
* see recheckAcceptDebts, whose other two classes never match such a reason.
|
|
250
253
|
*
|
|
251
254
|
* Deliberately NOT fuzzy: a backticked span is accepted only when it equals a parsed
|
|
252
255
|
* VERIFY line exactly (after trimming). No paraphrase, no reconstruction, no prefix
|
|
@@ -262,16 +265,18 @@ export function isStaticClassDebt(reason) {
|
|
|
262
265
|
* than a command. Any of those ⇒ not stored ⇒ the debt is simply unclassified, i.e.
|
|
263
266
|
* exactly as un-closable as it is today.
|
|
264
267
|
*
|
|
265
|
-
* …and one more condition
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
* contains
|
|
270
|
-
*
|
|
271
|
-
*
|
|
268
|
+
* …and one more condition: a command whose EXIT STATUS IS DESTROYED BY ITS OWN
|
|
269
|
+
* CONSTRUCTION is not storable either. The whole auto-close rests on a ZERO exit
|
|
270
|
+
* meaning "the check passed" (see recheckAcceptDebts below), and a VERIFY line
|
|
271
|
+
* shaped like `test -f … && echo "PASS" || echo "FAIL"` exits zero whatever the
|
|
272
|
+
* tree contains. Run in a real shell with the file absent, it prints FAIL and
|
|
273
|
+
* exits 0; the bare `test -f` exits 1. So the chain does not merely weaken the
|
|
274
|
+
* signal, it inverts it — the one output a human would read as failure is the one
|
|
275
|
+
* a re-check would read as resolved.
|
|
276
|
+
*
|
|
272
277
|
* Refusing to store one leaves the debt OPEN and surfaced, which is strictly the
|
|
273
|
-
* smaller claim. See unfailable-command.ts for what is and is not decidable
|
|
274
|
-
*
|
|
278
|
+
* smaller claim. See unfailable-command.ts for what is and is not decidable; bare
|
|
279
|
+
* `|| true` stays out of scope, and is confirmed NOT to match.
|
|
275
280
|
*/
|
|
276
281
|
function isStorableCommand(cmd) {
|
|
277
282
|
return (cmd.length > 0
|
|
@@ -285,9 +290,9 @@ function isStorableCommand(cmd) {
|
|
|
285
290
|
* VERIFY fence, or a reason that quotes nothing all yield null, and null simply
|
|
286
291
|
* means the debt keeps today's behaviour (surfaced, never auto-closed).
|
|
287
292
|
*
|
|
288
|
-
* The STRICT parse matters here.
|
|
289
|
-
*
|
|
290
|
-
*
|
|
293
|
+
* The STRICT parse matters here. A spec that opens ```sh and never closes it
|
|
294
|
+
* makes the lenient parser hand back the phase-timings table and every appended
|
|
295
|
+
* gate-trail line as "VERIFY commands" — including sentences that quote
|
|
291
296
|
* `bun run lint`. Matching a reason against that would mint a stored, re-runnable
|
|
292
297
|
* command with fabricated provenance, which is the one thing this class may not do.
|
|
293
298
|
*/
|
|
@@ -323,10 +328,11 @@ export function verifyCommandFromReason(reason, verifyCommands) {
|
|
|
323
328
|
return null;
|
|
324
329
|
}
|
|
325
330
|
/**
|
|
326
|
-
* Re-runs allowed per re-check. `inv-bounded`: a run that accepted many
|
|
327
|
-
* FAILs must not turn its own report into an unbounded second test
|
|
328
|
-
*
|
|
329
|
-
*
|
|
331
|
+
* Re-runs allowed per re-check. `inv-bounded`: a run that accepted many
|
|
332
|
+
* command-shaped FAILs must not turn its own report into an unbounded second test
|
|
333
|
+
* suite. The cap is a ceiling, not a target — a debt past it stays OPEN with the
|
|
334
|
+
* budget named in the trail, never closed. Confirmed by running the re-check with
|
|
335
|
+
* more command-class debts than the budget: the extras come back open.
|
|
330
336
|
*/
|
|
331
337
|
const MAX_VERIFY_RERUNS = 3;
|
|
332
338
|
/**
|
|
@@ -336,7 +342,7 @@ const MAX_VERIFY_RERUNS = 3;
|
|
|
336
342
|
* task or a human restored it, so the deletion no longer holds); every other debt
|
|
337
343
|
* stays OPEN (unprovable ⇒ surface, never re-hide) — unless it carries a stored
|
|
338
344
|
* `verifyCommand` and `rerunVerify` re-runs that command to a ZERO exit, which is the
|
|
339
|
-
* third class
|
|
345
|
+
* third class: the debt named a command, the command was run, and it
|
|
340
346
|
* passed. FP-safe: the only auto-closes are ones a deterministic check can stand
|
|
341
347
|
* behind, and here the check is the task spec's own command.
|
|
342
348
|
*/
|
|
@@ -401,16 +407,15 @@ export async function recheckAcceptDebts(debts, opts) {
|
|
|
401
407
|
}
|
|
402
408
|
return { open, resolved, trail };
|
|
403
409
|
}
|
|
404
|
-
// ─── Conflicting-claim classification
|
|
410
|
+
// ─── Conflicting-claim classification ──────────────────────────
|
|
405
411
|
//
|
|
406
412
|
// A recorded debt is a CLAIM about the tree, not an instruction to change it. The
|
|
407
413
|
// one class a deterministic check can prove SELF-CONTRADICTORY is an
|
|
408
414
|
// existence-as-failure claim ("<path> exists" fails the verify) whose named path is
|
|
409
415
|
// a DIFFERENT task's committed deliverable: the plan shipped the file on purpose
|
|
410
416
|
// and a sibling's verify indicts it — a plan defect (sibling scope-fence leaked
|
|
411
|
-
// into a verify assertion), not a fixable fault.
|
|
412
|
-
//
|
|
413
|
-
// final-gate autofix child, seeded with it, ran `rm` on the verified page.
|
|
417
|
+
// into a verify assertion), not a fixable fault. A debt reading "<path> exists"
|
|
418
|
+
// hands a final-gate autofix child a reason to `rm` a verified page.
|
|
414
419
|
/** A path-like token: at least one directory separator, ending in a file name. */
|
|
415
420
|
const PATH_TOKEN_RE = /(?:[\w.@-]+\/)+[\w.@-]+\.\w+/g;
|
|
416
421
|
/**
|
|
@@ -418,7 +423,7 @@ const PATH_TOKEN_RE = /(?:[\w.@-]+\/)+[\w.@-]+\.\w+/g;
|
|
|
418
423
|
* token immediately followed by "exists" / "still exists", or by "must/should not
|
|
419
424
|
* exist". Only this narrow shape qualifies: a reason that merely MENTIONS a path
|
|
420
425
|
* (a prohibition violation, a broken import) is an ordinary defect claim, not an
|
|
421
|
-
* existence assertion, and must never be flagged (
|
|
426
|
+
* existence assertion, and must never be flagged (such debts name paths
|
|
422
427
|
* this way and are genuine).
|
|
423
428
|
*/
|
|
424
429
|
export function extractExistenceClaims(reason) {
|
|
@@ -481,7 +486,7 @@ export function describeDebt(d) {
|
|
|
481
486
|
return isKnownOrigin(d.origin) ? DEBT_LABELS[d.origin] : DEBT_LABELS.accepted;
|
|
482
487
|
}
|
|
483
488
|
/**
|
|
484
|
-
* ACCEPT-debt re-check
|
|
489
|
+
* ACCEPT-debt re-check: read the ledger of tasks
|
|
485
490
|
* the user accepted despite a verify-FAIL and re-check each against the CURRENT
|
|
486
491
|
* tree. A static-class debt whose statics now pass is provably RESOLVED (a later
|
|
487
492
|
* task fixed it) and pruned from the ledger; every other debt cannot be proven
|
|
@@ -490,9 +495,9 @@ export function describeDebt(d) {
|
|
|
490
495
|
* accept-debt.ts). Best-effort: a ledger read/write failure must never break the
|
|
491
496
|
* caller.
|
|
492
497
|
*
|
|
493
|
-
* FACTORED OUT of runFinalIntegrationGate
|
|
498
|
+
* FACTORED OUT of runFinalIntegrationGate: the derivation has to be
|
|
494
499
|
* runnable at a SECOND moment — after a converged final-gate autofix, where the
|
|
495
|
-
* orchestrator
|
|
500
|
+
* orchestrator rebuilds its gate outcome as a bare `{ok, reason}` and drops
|
|
496
501
|
* `openDebts` entirely. The report a run ends on has to be derived from the tree
|
|
497
502
|
* the run ends with, not from the tree as it was before the fix pass.
|
|
498
503
|
*
|
|
@@ -509,14 +514,14 @@ run = spawnCommand, signal) {
|
|
|
509
514
|
// tree — a deterministic existence check, corroborating the per-file
|
|
510
515
|
// provenance the record already carries.
|
|
511
516
|
fileExists: rel => existsSync(path.join(cwd, rel)),
|
|
512
|
-
// VERIFY-COMMAND class
|
|
517
|
+
// VERIFY-COMMAND class: a debt that NAMES a command is settled
|
|
513
518
|
// by running that command, under the gate's own env-gap contract and behind
|
|
514
519
|
// the no-write guard below.
|
|
515
520
|
rerunVerify: cmd => rerunDebtVerifyCommand(cwd, cmd, run, signal)
|
|
516
521
|
});
|
|
517
522
|
if (resolved.length > 0)
|
|
518
523
|
await writeAcceptDebts(cwd, openRaw);
|
|
519
|
-
// Conflicting-claim annotation
|
|
524
|
+
// Conflicting-claim annotation: an existence-as-failure debt whose
|
|
520
525
|
// named file is another task's committed deliverable is a plan defect — surface
|
|
521
526
|
// the contradiction with the debt so nobody (human or child) treats the claim as
|
|
522
527
|
// a deletion instruction. Pure git-history lookup; degrades to no annotation.
|
|
@@ -529,10 +534,11 @@ const DEBT_RERUN_TIMEOUT_MS = 300_000;
|
|
|
529
534
|
/**
|
|
530
535
|
* Extra infrastructure-gap shapes recognised ONLY when re-running a debt's command,
|
|
531
536
|
* never in the gate's own verdicts. A driver that reports its connection simply
|
|
532
|
-
* closed
|
|
533
|
-
*
|
|
534
|
-
*
|
|
535
|
-
*
|
|
537
|
+
* closed is an absent dependency, not a defect, and calling it "the defect is
|
|
538
|
+
* still present" would be a finding the environment invented. The postgres code is
|
|
539
|
+
* verbatim from the runtime: pointed at a port with nothing behind it, bun's SQL
|
|
540
|
+
* client throws a `PostgresError` whose `code` is exactly
|
|
541
|
+
* `ERR_POSTGRES_CONNECTION_CLOSED`. Kept out of INFRA_GAP_OUTPUT_RE on purpose: in a
|
|
536
542
|
* gate verdict the same wording can be a real fault the suite must own, and only the
|
|
537
543
|
* debt re-check needs the conservative reading — where it costs nothing, because gap
|
|
538
544
|
* and fail both leave the debt open.
|
|
@@ -547,9 +553,11 @@ const DEBT_INFRA_GAP_RE = /ERR_POSTGRES_CONNECTION_CLOSED|ERR_MYSQL_CONNECTION|E
|
|
|
547
553
|
* a passing tree and have that count as the debt being fixed — the run would then be
|
|
548
554
|
* certifying its own side effect. So tracked state is captured before and after, and
|
|
549
555
|
* a pass that came with a tracked change is downgraded to INCONCLUSIVE with the
|
|
550
|
-
* change named. Untracked output is left alone
|
|
551
|
-
*
|
|
552
|
-
*
|
|
556
|
+
* change named. Untracked output is left alone because the guard asks git not to
|
|
557
|
+
* report it: `--untracked-files=no` is doing that work, NOT the project's ignore
|
|
558
|
+
* rules. Checked both ways — with and without a matching `.gitignore`, the flag
|
|
559
|
+
* returns an empty status for a fresh untracked build directory, while plain
|
|
560
|
+
* `--porcelain` reports it when it is not ignored.
|
|
553
561
|
*
|
|
554
562
|
* A repository the guard cannot read (no git, git absent) is not a licence to skip
|
|
555
563
|
* the guard: the re-run is INCONCLUSIVE there, because "nothing changed" would be an
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Anti-synthesis guard for grill/clarify auto-answers
|
|
2
|
+
* Anti-synthesis guard for grill/clarify auto-answers.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* The failure: an auto-answer names an API that does not exist, and nothing
|
|
5
|
+
* cross-checks it against the research the task already gathered. A
|
|
6
|
+
* plausible-looking invention is then promoted into the title, the requirements,
|
|
7
|
+
* the acceptance criteria and the VERIFY block, and the implementation fakes a
|
|
8
|
+
* declaration to make it compile. `Bun.mkdirSync` is the shape of it, and it is
|
|
9
|
+
* real: against the runtime, `typeof Bun.mkdirSync` is `undefined`, while
|
|
10
|
+
* `Bun.build` and `Bun.spawn` are both functions.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
* registry
|
|
12
|
-
* an identifier is
|
|
12
|
+
* The lever is verbatim-substring membership, never a model judgement — the same
|
|
13
|
+
* technique the contract registry uses to reject a paraphrased key. Extract
|
|
14
|
+
* API-shaped identifiers (`Namespace.member`) from the answer; an identifier is
|
|
15
|
+
* SYNTHESIZED when
|
|
13
16
|
* (a) the full identifier appears nowhere in the research (APIS/docs/context
|
|
14
|
-
* sections,
|
|
15
|
-
* question itself, AND
|
|
17
|
+
* sections, case-sensitive substring) and nowhere in the question, AND
|
|
16
18
|
* (b) the research DOES mention that namespace's API surface (`Bun.` appears
|
|
17
|
-
* somewhere) —
|
|
18
|
-
*
|
|
19
|
-
* Gate (b) is the step-aside rule: when research never mentions the namespace
|
|
20
|
-
* at all (React.StrictMode in a task whose research covered no React API), the
|
|
21
|
-
* check is INCONCLUSIVE and must not fire — the guard may only cost time,
|
|
22
|
-
* never work. Same for the clarify-triage seam, whose research slot is a stub:
|
|
23
|
-
* no namespace coverage ⇒ no findings ⇒ guard inert by construction.
|
|
19
|
+
* somewhere) — research claims coverage of the namespace, so a member
|
|
20
|
+
* absent from it is suspicious rather than merely uncovered.
|
|
24
21
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
22
|
+
* Gate (b) is the step-aside rule, and it is what keeps the guard costing time
|
|
23
|
+
* rather than work. Run both ways: `React.StrictMode` against research that
|
|
24
|
+
* mentions only `Bun.` produces NO finding, and research that is empty produces
|
|
25
|
+
* none either — so a caller with nothing gathered leaves the guard inert by
|
|
26
|
+
* construction instead of trigger-happy.
|
|
27
|
+
*
|
|
28
|
+
* Caller contract (phaseAutoAnswer): findings ⇒ re-ask exactly ONCE with the
|
|
29
|
+
* verified research lines injected; an answer that STILL carries a flagged
|
|
30
|
+
* identifier is surfaced to the user as `unknown` rather than promoted.
|
|
28
31
|
*/
|
|
29
32
|
export interface SynthesizedApiFinding {
|
|
30
33
|
/** The full flagged identifier, e.g. "Bun.mkdirSync". */
|
|
@@ -1,42 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Anti-synthesis guard for grill/clarify auto-answers
|
|
2
|
+
* Anti-synthesis guard for grill/clarify auto-answers.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* The failure: an auto-answer names an API that does not exist, and nothing
|
|
5
|
+
* cross-checks it against the research the task already gathered. A
|
|
6
|
+
* plausible-looking invention is then promoted into the title, the requirements,
|
|
7
|
+
* the acceptance criteria and the VERIFY block, and the implementation fakes a
|
|
8
|
+
* declaration to make it compile. `Bun.mkdirSync` is the shape of it, and it is
|
|
9
|
+
* real: against the runtime, `typeof Bun.mkdirSync` is `undefined`, while
|
|
10
|
+
* `Bun.build` and `Bun.spawn` are both functions.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
* registry
|
|
12
|
-
* an identifier is
|
|
12
|
+
* The lever is verbatim-substring membership, never a model judgement — the same
|
|
13
|
+
* technique the contract registry uses to reject a paraphrased key. Extract
|
|
14
|
+
* API-shaped identifiers (`Namespace.member`) from the answer; an identifier is
|
|
15
|
+
* SYNTHESIZED when
|
|
13
16
|
* (a) the full identifier appears nowhere in the research (APIS/docs/context
|
|
14
|
-
* sections,
|
|
15
|
-
* question itself, AND
|
|
17
|
+
* sections, case-sensitive substring) and nowhere in the question, AND
|
|
16
18
|
* (b) the research DOES mention that namespace's API surface (`Bun.` appears
|
|
17
|
-
* somewhere) —
|
|
18
|
-
*
|
|
19
|
-
* Gate (b) is the step-aside rule: when research never mentions the namespace
|
|
20
|
-
* at all (React.StrictMode in a task whose research covered no React API), the
|
|
21
|
-
* check is INCONCLUSIVE and must not fire — the guard may only cost time,
|
|
22
|
-
* never work. Same for the clarify-triage seam, whose research slot is a stub:
|
|
23
|
-
* no namespace coverage ⇒ no findings ⇒ guard inert by construction.
|
|
19
|
+
* somewhere) — research claims coverage of the namespace, so a member
|
|
20
|
+
* absent from it is suspicious rather than merely uncovered.
|
|
24
21
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
22
|
+
* Gate (b) is the step-aside rule, and it is what keeps the guard costing time
|
|
23
|
+
* rather than work. Run both ways: `React.StrictMode` against research that
|
|
24
|
+
* mentions only `Bun.` produces NO finding, and research that is empty produces
|
|
25
|
+
* none either — so a caller with nothing gathered leaves the guard inert by
|
|
26
|
+
* construction instead of trigger-happy.
|
|
27
|
+
*
|
|
28
|
+
* Caller contract (phaseAutoAnswer): findings ⇒ re-ask exactly ONCE with the
|
|
29
|
+
* verified research lines injected; an answer that STILL carries a flagged
|
|
30
|
+
* identifier is surfaced to the user as `unknown` rather than promoted.
|
|
28
31
|
*/
|
|
29
32
|
/**
|
|
30
33
|
* `Namespace.member` where the namespace starts uppercase (Bun, React, Deno —
|
|
31
|
-
* the global
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
+
* the global or imported-namespace API shape) and BOTH sides are at least two
|
|
35
|
+
* characters. Run against the prose shapes it has to survive: `U.S. policy`,
|
|
36
|
+
* `e.G thing`, `A.b` and `fs.readFile` all extract nothing, while
|
|
37
|
+
* `Bun.mkdirSync` and `React.StrictMode` both match — the member may start
|
|
38
|
+
* either case.
|
|
34
39
|
*/
|
|
35
40
|
const API_IDENT_RE = /\b([A-Z][A-Za-z0-9_$]+)\.([A-Za-z_$][A-Za-z0-9_$]+)\b/g;
|
|
36
41
|
/**
|
|
37
42
|
* Member names that make the match a file name, domain, or version-ish token
|
|
38
|
-
* rather than an API (Node.js, App.tsx, README.md, Fly.io, Express.com).
|
|
39
|
-
*
|
|
43
|
+
* rather than an API (Node.js, App.tsx, README.md, Fly.io, Express.com). The
|
|
44
|
+
* comparison is lowercased, so shouting does not slip through: `INDEX.HTML`
|
|
45
|
+
* extracts nothing, same as `App.tsx`.
|
|
40
46
|
*/
|
|
41
47
|
const NON_API_MEMBERS = new Set([
|
|
42
48
|
'js',
|
|
@@ -1,67 +1,35 @@
|
|
|
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 declare 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 \u2014 not this project's own source, not a runtime builtin \u2014 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:\n <name> <one-line signature or use> \u2014 SEMANTICS: <what it means in use>\n\nA TYPE SIGNATURE IS NOT A SEMANTICS CLAUSE, and restating one in prose does not make it one. `hc(baseUrl: Prefix, options?: ClientRequestOptions)` names the argument and says nothing about whether that argument is an origin, or a mount prefix, or how it is joined to each route path \u2014 which is the fact the implementing agent actually needs, and the one it will otherwise guess wrong. An entry whose SEMANTICS field is missing is UNFINISHED, and your section is not ready to emit while any package entry is unfinished.\n\nHOW TO FILL THAT FIELD \u2014 in this order. Do not skip a step, and do not stop after step 1 because you already hold the declaration:\n 1. ASK `pi-worker-docs` A BEHAVIOUR QUESTION about that package. NOT \"what is X's signature\", NOT \"what types does X export\" \u2014 those return the declaration you already have. Ask what an argument MEANS, what it DEFAULTS to, what it is RELATIVE to, what HAPPENS when it is given a particular value. For example: `pi-worker-docs(\"hono/client\", \"what does the baseUrl argument to hc MEAN \u2014 an origin or a mount prefix \u2014 and how is it joined to each route path?\")`.\n 2. IF THE PACKAGE TEXT DOES NOT ANSWER IT, ESCALATE. Expect this: bundled `.d.ts` declarations frequently carry no semantics at all, because the semantics live in the package's documentation. Call `pi-worker-search` with the question, or `pi-worker-fetch` on a documentation URL \u2014 including any `@see {@link https://\u2026}` link that appeared in the text `pi-worker-docs` just returned to you.\n 3. ONLY IF BOTH FAIL, WRITE THE OPEN QUESTION DOWN, in this exact form:\n <name> <signature> \u2014 SEMANTICS: UNVERIFIED: <the exact question you could not answer>\n THIS IS A CORRECT AND REQUIRED OUTCOME, not a failure. A named open question is worth far more to the implementing agent than a confident guess, and it is the only acceptable way to finish an entry you could not verify. NEVER fill this field from memory, from what the symbol is named, or from what the API \"obviously\" does: a plausible wrong semantics clause is the single most damaging thing this section can carry.";
|