@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,36 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Clarify: asks ONE question at a time. Output MUST match parseClarifyList —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Clarify: asks ONE question at a time. Output MUST match `parseClarifyList` —
|
|
3
|
+
* the shared parser in parsers.ts that question-source.ts actually calls on this
|
|
4
|
+
* reply — so the shape is a single numbered question, then a "SUGGESTED: <default>"
|
|
5
|
+
* line, then an optional "ALT: <alternative>" line for binary "A or B?" forks, or
|
|
6
|
+
* the literal token NONE when no clarification remains. `priorQA` is interpolated
|
|
7
|
+
* as ANSWERS SO FAR, so each next question adapts to what has been settled.
|
|
8
|
+
*
|
|
9
|
+
* Runs with the read tool (`--tools read`), which is what the "you may use the read
|
|
10
|
+
* tool" line above depends on.
|
|
7
11
|
*/
|
|
8
12
|
export declare const AUTO_CLARIFY_PROMPT: (feature: string, priorQA: string) => string;
|
|
9
13
|
/**
|
|
10
14
|
* Decompose: output a markdown checkbox list of task titles (one line each).
|
|
11
|
-
* `requirementsLedger` is buildRequirementsLedger's grounded quote list (goal E's
|
|
12
|
-
* belt): the spec's obligations ride into decompose explicitly, so mirroring the
|
|
13
|
-
* spec's own milestone/section structure cannot silently discharge them. '' ⇒
|
|
14
|
-
* the prompt is unchanged.
|
|
15
15
|
*
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* `requirementsLedger` is buildRequirementsLedger's grounded quote list: the spec's
|
|
17
|
+
* obligations ride into decompose explicitly, so mirroring the spec's own
|
|
18
|
+
* milestone/section structure cannot silently discharge them. An empty or
|
|
19
|
+
* whitespace-only ledger leaves the prompt byte-identical to the default — checked.
|
|
20
|
+
*
|
|
21
|
+
* `noBatchTests` adds the anti-batch-test rule (batch-test-task.ts), emitted ONLY
|
|
22
|
+
* when the decisions mandate tests-in-the-same-change; `false` also leaves the
|
|
23
|
+
* prompt byte-identical, so every other run sees the same text. It is the belt —
|
|
24
|
+
* `rewriteBatchTestPlan` is the host-side lever.
|
|
19
25
|
*
|
|
20
|
-
* Plan GRANULARITY is deliberately NOT a rule here
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
26
|
+
* Plan GRANULARITY is deliberately NOT a rule here. The only count-shaped line in
|
|
27
|
+
* RULES is the FORMAT one ("One task per line"); the floor reaches the model as a
|
|
28
|
+
* CLARIFICATION instead, through the host-set plan-shape answer in the transcript
|
|
29
|
+
* (decompose-granularity.ts), with a split-retry hint if the drawn plan still comes
|
|
30
|
+
* in under it. Kept out of RULES so it lands as one input among several rather
|
|
31
|
+
* than as another imperative competing with the ones already there.
|
|
25
32
|
*/
|
|
26
33
|
export declare const AUTO_DECOMPOSE_PROMPT: (feature: string, clarifications: string, requirementsLedger?: string, noBatchTests?: boolean) => string;
|
|
27
34
|
/**
|
|
28
|
-
* Coverage triage: judge whether a decomposed task list covers the whole
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
+
* Coverage triage: judge whether a decomposed task list covers the whole feature.
|
|
36
|
+
* Guards the plan — the highest-leverage artifact in /task-auto — against a
|
|
37
|
+
* degenerate-but-nonempty decompose completion: one task emitted for a whole
|
|
38
|
+
* design document, with a natural end-of-stream, which a `titles.length === 0`
|
|
39
|
+
* gate waves through so the run "completes" after that single task.
|
|
40
|
+
*
|
|
41
|
+
* Pure judgment over text already in hand, so it runs with NO tools: the call site
|
|
42
|
+
* passes an empty tools string, which childArgs turns into `--no-tools`.
|
|
43
|
+
*
|
|
44
|
+
* Output MUST match `parseCoverageVerdict`, including the at-most-8 bound — the
|
|
45
|
+
* parser stops collecting MISSING lines at eight, so a longer list is truncated
|
|
46
|
+
* rather than rejected.
|
|
35
47
|
*/
|
|
36
48
|
export declare const DECOMPOSE_COVERAGE_PROMPT: (feature: string, clarifications: string, list: string[]) => string;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* The three feature-level prompts /task-auto sends before any task starts: one
|
|
3
|
+
* clarifying QUESTION at a time, one task LIST, and one coverage VERDICT over
|
|
4
|
+
* that list. None of them produces a spec — all research and spec depth is
|
|
5
|
+
* /task's job, run per title later.
|
|
4
6
|
*/
|
|
5
7
|
import { DECOMPOSE_SOURCE_RULE } from './decompose-fidelity.js';
|
|
6
8
|
import { DECOMPOSE_NO_BATCH_TESTS_RULE } from './batch-test-task.js';
|
|
7
9
|
/**
|
|
8
|
-
* Clarify: asks ONE question at a time. Output MUST match parseClarifyList —
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Clarify: asks ONE question at a time. Output MUST match `parseClarifyList` —
|
|
11
|
+
* the shared parser in parsers.ts that question-source.ts actually calls on this
|
|
12
|
+
* reply — so the shape is a single numbered question, then a "SUGGESTED: <default>"
|
|
13
|
+
* line, then an optional "ALT: <alternative>" line for binary "A or B?" forks, or
|
|
14
|
+
* the literal token NONE when no clarification remains. `priorQA` is interpolated
|
|
15
|
+
* as ANSWERS SO FAR, so each next question adapts to what has been settled.
|
|
16
|
+
*
|
|
17
|
+
* Runs with the read tool (`--tools read`), which is what the "you may use the read
|
|
18
|
+
* tool" line above depends on.
|
|
13
19
|
*/
|
|
14
20
|
export const AUTO_CLARIFY_PROMPT = (feature, priorQA) => `You are planning how to split a feature into separate implementation tasks, one clarifying question at a time.
|
|
15
21
|
|
|
@@ -68,20 +74,23 @@ No question remains:
|
|
|
68
74
|
NONE`;
|
|
69
75
|
/**
|
|
70
76
|
* Decompose: output a markdown checkbox list of task titles (one line each).
|
|
71
|
-
* `requirementsLedger` is buildRequirementsLedger's grounded quote list (goal E's
|
|
72
|
-
* belt): the spec's obligations ride into decompose explicitly, so mirroring the
|
|
73
|
-
* spec's own milestone/section structure cannot silently discharge them. '' ⇒
|
|
74
|
-
* the prompt is unchanged.
|
|
75
77
|
*
|
|
76
|
-
* `
|
|
77
|
-
*
|
|
78
|
-
*
|
|
78
|
+
* `requirementsLedger` is buildRequirementsLedger's grounded quote list: the spec's
|
|
79
|
+
* obligations ride into decompose explicitly, so mirroring the spec's own
|
|
80
|
+
* milestone/section structure cannot silently discharge them. An empty or
|
|
81
|
+
* whitespace-only ledger leaves the prompt byte-identical to the default — checked.
|
|
82
|
+
*
|
|
83
|
+
* `noBatchTests` adds the anti-batch-test rule (batch-test-task.ts), emitted ONLY
|
|
84
|
+
* when the decisions mandate tests-in-the-same-change; `false` also leaves the
|
|
85
|
+
* prompt byte-identical, so every other run sees the same text. It is the belt —
|
|
86
|
+
* `rewriteBatchTestPlan` is the host-side lever.
|
|
79
87
|
*
|
|
80
|
-
* Plan GRANULARITY is deliberately NOT a rule here
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
88
|
+
* Plan GRANULARITY is deliberately NOT a rule here. The only count-shaped line in
|
|
89
|
+
* RULES is the FORMAT one ("One task per line"); the floor reaches the model as a
|
|
90
|
+
* CLARIFICATION instead, through the host-set plan-shape answer in the transcript
|
|
91
|
+
* (decompose-granularity.ts), with a split-retry hint if the drawn plan still comes
|
|
92
|
+
* in under it. Kept out of RULES so it lands as one input among several rather
|
|
93
|
+
* than as another imperative competing with the ones already there.
|
|
85
94
|
*/
|
|
86
95
|
export const AUTO_DECOMPOSE_PROMPT = (feature, clarifications, requirementsLedger = '', noBatchTests = false) => `Split this feature into an ordered list of implementation tasks. Each task
|
|
87
96
|
will be handed, by its title, to a separate pipeline that does its own research
|
|
@@ -108,13 +117,18 @@ RULES:
|
|
|
108
117
|
${DECOMPOSE_SOURCE_RULE}${noBatchTests ? `\n${DECOMPOSE_NO_BATCH_TESTS_RULE}` : ''}
|
|
109
118
|
- Output the checkbox list and NOTHING else (no preamble, no numbering).`;
|
|
110
119
|
/**
|
|
111
|
-
* Coverage triage: judge whether a decomposed task list covers the whole
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
120
|
+
* Coverage triage: judge whether a decomposed task list covers the whole feature.
|
|
121
|
+
* Guards the plan — the highest-leverage artifact in /task-auto — against a
|
|
122
|
+
* degenerate-but-nonempty decompose completion: one task emitted for a whole
|
|
123
|
+
* design document, with a natural end-of-stream, which a `titles.length === 0`
|
|
124
|
+
* gate waves through so the run "completes" after that single task.
|
|
125
|
+
*
|
|
126
|
+
* Pure judgment over text already in hand, so it runs with NO tools: the call site
|
|
127
|
+
* passes an empty tools string, which childArgs turns into `--no-tools`.
|
|
128
|
+
*
|
|
129
|
+
* Output MUST match `parseCoverageVerdict`, including the at-most-8 bound — the
|
|
130
|
+
* parser stops collecting MISSING lines at eight, so a longer list is truncated
|
|
131
|
+
* rather than rejected.
|
|
118
132
|
*/
|
|
119
133
|
export const DECOMPOSE_COVERAGE_PROMPT = (feature, clarifications, list) => `You are auditing a task decomposition for completeness. Below is a FEATURE
|
|
120
134
|
REQUEST (with any referenced design spec inlined), the CLARIFICATIONS the user
|
|
@@ -2,28 +2,25 @@
|
|
|
2
2
|
* autofix-ledger — what the run-end RESOLUTION LOOP records, and the decisions
|
|
3
3
|
* that record makes.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* rejected-edits flag.
|
|
5
|
+
* Six pieces of state that would otherwise be mutable locals threaded through
|
|
6
|
+
* `runFinalGateStage` by closure: the attempt count, the accumulated gitignored
|
|
7
|
+
* writes, the stranded sub-fixes, the previous failure signature, the demoted
|
|
8
|
+
* set, and the rejected-edits flag. The same shape `GateTally` uses one altitude
|
|
9
|
+
* down.
|
|
11
10
|
*
|
|
12
11
|
* The reason is not tidiness. `final-gate-progress.ts` holds five pure functions,
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* mx5 run 21 shipped a product whose every page was blank as a `completed` run
|
|
21
|
-
* through that gap. Here the evidence and the decision sit in one module, and the
|
|
22
|
-
* loop body reads as picker → apply → record.
|
|
12
|
+
* and all five are consumed HERE and nowhere else — run-final-gate.ts names the
|
|
13
|
+
* module only in comments and does not import it. The judgement therefore sits
|
|
14
|
+
* beside the evidence it judges: `judge` reads `observedFailures` off the SAME
|
|
15
|
+
* outcome the failure came from, and enters the demoted signature and breaks the
|
|
16
|
+
* previous-signature chain in that one call. A caller cannot apply those steps
|
|
17
|
+
* out of order or skip one, and the loop body reads as picker → apply → record.
|
|
23
18
|
*
|
|
24
19
|
* What is NOT here: anything that talks to the user, writes a ledger file, or
|
|
25
|
-
* commits
|
|
26
|
-
*
|
|
20
|
+
* commits — confirmed, the module's only import is final-gate-progress and it
|
|
21
|
+
* touches no filesystem, UI or git. The loop keeps those, the same way
|
|
22
|
+
* `GateTally` keeps no I/O: a record that performs effects cannot be driven by a
|
|
23
|
+
* test that only wants the verdict.
|
|
27
24
|
*/
|
|
28
25
|
/** The gate-outcome fields this record reads. Structural, so a caller can hand it
|
|
29
26
|
* a `FinalGateOutcome` without this module importing the gate. */
|
|
@@ -51,11 +48,15 @@ export declare class AutofixLedger {
|
|
|
51
48
|
private _attempts;
|
|
52
49
|
/**
|
|
53
50
|
* Gitignored paths the fix passes have written so far. ACCUMULATED across
|
|
54
|
-
* attempts
|
|
55
|
-
*
|
|
51
|
+
* attempts, and that asymmetry with `_stranded` below is deliberate: a `.env`
|
|
52
|
+
* written by a failed attempt is still on disk for the next one, and that
|
|
53
|
+
* attempt's own before/after diff cannot see it. Run: two calls carrying an
|
|
54
|
+
* overlapping path yield the union, deduplicated, in first-seen order.
|
|
56
55
|
*/
|
|
57
56
|
private _ignoredWritten;
|
|
58
|
-
/** Sub-fixes a non-converging attempt left uncommitted. REPLACED each attempt
|
|
57
|
+
/** Sub-fixes a non-converging attempt left uncommitted. REPLACED each attempt,
|
|
58
|
+
* unlike `_ignoredWritten` above — this is a snapshot of what is uncommitted
|
|
59
|
+
* right now, not a history. Run: a second `setStranded` discards the first. */
|
|
59
60
|
private _stranded;
|
|
60
61
|
/** The previous attempt's normalized ranked-first failure. */
|
|
61
62
|
private _prevFailSig;
|
|
@@ -64,7 +65,7 @@ export declare class AutofixLedger {
|
|
|
64
65
|
/**
|
|
65
66
|
* A write-guard rejected an attempt whose edits could NOT be discarded, so
|
|
66
67
|
* REJECTED edits are sitting in the tree and the terminal paths must not commit
|
|
67
|
-
* what they find there (
|
|
68
|
+
* what they find there (the cheat guard is never weakened
|
|
68
69
|
* to ease committing).
|
|
69
70
|
*/
|
|
70
71
|
private _rejectedEditsInTree;
|
|
@@ -85,9 +86,10 @@ export declare class AutofixLedger {
|
|
|
85
86
|
/**
|
|
86
87
|
* May a terminal path commit what is in the working tree?
|
|
87
88
|
*
|
|
88
|
-
* False once a guard has rejected an attempt without discarding its edits
|
|
89
|
-
*
|
|
90
|
-
*
|
|
89
|
+
* False once a guard has rejected an attempt without discarding its edits, and
|
|
90
|
+
* it never flips back — rejected edits stay rejected for the rest of the loop.
|
|
91
|
+
* Exposed as a method rather than a public boolean so the question is asked in
|
|
92
|
+
* one vocabulary wherever a terminal path needs it.
|
|
91
93
|
*/
|
|
92
94
|
mayCommitTree(): boolean;
|
|
93
95
|
/**
|
|
@@ -2,28 +2,25 @@
|
|
|
2
2
|
* autofix-ledger — what the run-end RESOLUTION LOOP records, and the decisions
|
|
3
3
|
* that record makes.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* rejected-edits flag.
|
|
5
|
+
* Six pieces of state that would otherwise be mutable locals threaded through
|
|
6
|
+
* `runFinalGateStage` by closure: the attempt count, the accumulated gitignored
|
|
7
|
+
* writes, the stranded sub-fixes, the previous failure signature, the demoted
|
|
8
|
+
* set, and the rejected-edits flag. The same shape `GateTally` uses one altitude
|
|
9
|
+
* down.
|
|
11
10
|
*
|
|
12
11
|
* The reason is not tidiness. `final-gate-progress.ts` holds five pure functions,
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* mx5 run 21 shipped a product whose every page was blank as a `completed` run
|
|
21
|
-
* through that gap. Here the evidence and the decision sit in one module, and the
|
|
22
|
-
* loop body reads as picker → apply → record.
|
|
12
|
+
* and all five are consumed HERE and nowhere else — run-final-gate.ts names the
|
|
13
|
+
* module only in comments and does not import it. The judgement therefore sits
|
|
14
|
+
* beside the evidence it judges: `judge` reads `observedFailures` off the SAME
|
|
15
|
+
* outcome the failure came from, and enters the demoted signature and breaks the
|
|
16
|
+
* previous-signature chain in that one call. A caller cannot apply those steps
|
|
17
|
+
* out of order or skip one, and the loop body reads as picker → apply → record.
|
|
23
18
|
*
|
|
24
19
|
* What is NOT here: anything that talks to the user, writes a ledger file, or
|
|
25
|
-
* commits
|
|
26
|
-
*
|
|
20
|
+
* commits — confirmed, the module's only import is final-gate-progress and it
|
|
21
|
+
* touches no filesystem, UI or git. The loop keeps those, the same way
|
|
22
|
+
* `GateTally` keeps no I/O: a record that performs effects cannot be driven by a
|
|
23
|
+
* test that only wants the verdict.
|
|
27
24
|
*/
|
|
28
25
|
import { applyDemotions, isNonProgress, normalizeFailureDetail, rankedFirstFailure, unobservedDebtReason } from './final-gate-progress.js';
|
|
29
26
|
export class AutofixLedger {
|
|
@@ -32,11 +29,15 @@ export class AutofixLedger {
|
|
|
32
29
|
_attempts = 0;
|
|
33
30
|
/**
|
|
34
31
|
* Gitignored paths the fix passes have written so far. ACCUMULATED across
|
|
35
|
-
* attempts
|
|
36
|
-
*
|
|
32
|
+
* attempts, and that asymmetry with `_stranded` below is deliberate: a `.env`
|
|
33
|
+
* written by a failed attempt is still on disk for the next one, and that
|
|
34
|
+
* attempt's own before/after diff cannot see it. Run: two calls carrying an
|
|
35
|
+
* overlapping path yield the union, deduplicated, in first-seen order.
|
|
37
36
|
*/
|
|
38
37
|
_ignoredWritten = [];
|
|
39
|
-
/** Sub-fixes a non-converging attempt left uncommitted. REPLACED each attempt
|
|
38
|
+
/** Sub-fixes a non-converging attempt left uncommitted. REPLACED each attempt,
|
|
39
|
+
* unlike `_ignoredWritten` above — this is a snapshot of what is uncommitted
|
|
40
|
+
* right now, not a history. Run: a second `setStranded` discards the first. */
|
|
40
41
|
_stranded = [];
|
|
41
42
|
/** The previous attempt's normalized ranked-first failure. */
|
|
42
43
|
_prevFailSig = null;
|
|
@@ -45,7 +46,7 @@ export class AutofixLedger {
|
|
|
45
46
|
/**
|
|
46
47
|
* A write-guard rejected an attempt whose edits could NOT be discarded, so
|
|
47
48
|
* REJECTED edits are sitting in the tree and the terminal paths must not commit
|
|
48
|
-
* what they find there (
|
|
49
|
+
* what they find there (the cheat guard is never weakened
|
|
49
50
|
* to ease committing).
|
|
50
51
|
*/
|
|
51
52
|
_rejectedEditsInTree = false;
|
|
@@ -89,9 +90,10 @@ export class AutofixLedger {
|
|
|
89
90
|
/**
|
|
90
91
|
* May a terminal path commit what is in the working tree?
|
|
91
92
|
*
|
|
92
|
-
* False once a guard has rejected an attempt without discarding its edits
|
|
93
|
-
*
|
|
94
|
-
*
|
|
93
|
+
* False once a guard has rejected an attempt without discarding its edits, and
|
|
94
|
+
* it never flips back — rejected edits stay rejected for the rest of the loop.
|
|
95
|
+
* Exposed as a method rather than a public boolean so the question is asked in
|
|
96
|
+
* one vocabulary wherever a terminal path needs it.
|
|
95
97
|
*/
|
|
96
98
|
mayCommitTree() {
|
|
97
99
|
return !this._rejectedEditsInTree;
|
|
@@ -123,7 +125,8 @@ export class AutofixLedger {
|
|
|
123
125
|
})) {
|
|
124
126
|
this._demoted.add(normalizeFailureDetail(detail));
|
|
125
127
|
// A demotion ends the chain: the next attempt has no previous signature
|
|
126
|
-
// to match, so one demotion cannot cascade into a second.
|
|
128
|
+
// to match, so one demotion cannot cascade into a second. Run on three
|
|
129
|
+
// identical outcomes — only the SECOND demotes, the third does not.
|
|
127
130
|
this._prevFailSig = null;
|
|
128
131
|
return { detail, demoted: true, debtReason: unobservedDebtReason(detail) };
|
|
129
132
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Does the decisions/spec text mandate tests-in-the-same-change?
|
|
3
3
|
*
|
|
4
|
-
* Scans sentence by sentence and requires BOTH signals in the SAME sentence, so
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Scans sentence by sentence and requires BOTH signals in the SAME sentence, so a
|
|
5
|
+
* testing section that happens to sit near an unrelated "don't defer" line cannot
|
|
6
|
+
* trigger the ban — confirmed, "Don't defer the docs. Every route has tests."
|
|
7
|
+
* returns false. `decisions` is checked first and alone is sufficient; the spec is
|
|
8
|
+
* scanned too, and a mandate found only there is enough, because a cadence rule is
|
|
9
|
+
* often stated in the doc body and only echoed into the decisions channel.
|
|
9
10
|
*/
|
|
10
11
|
export declare function mandatesTestsInSameChange(decisions: string, spec?: string): boolean;
|
|
11
12
|
/**
|
|
@@ -25,9 +26,11 @@ export declare function findBatchTestTitles(titles: string[], spec?: string): nu
|
|
|
25
26
|
* The spec's own coverage source — the command whose report scopes the sweep.
|
|
26
27
|
*
|
|
27
28
|
* Only backticked spans are considered, so the result is a command the spec
|
|
28
|
-
* actually writes down rather than a phrase inferred from prose
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* actually writes down rather than a phrase inferred from prose: a plain-prose
|
|
30
|
+
* "bun test" is ignored and falls through to the generic phrase. A span carrying a
|
|
31
|
+
* coverage flag wins over a plain test run — a spec naming both `bun test` and
|
|
32
|
+
* `bun test --coverage` yields the latter. The fallback keeps the sweep title
|
|
33
|
+
* well-formed when the spec names no command at all.
|
|
31
34
|
*/
|
|
32
35
|
export declare function coverageSourceFromSpec(spec: string): string;
|
|
33
36
|
/**
|
|
@@ -56,15 +59,20 @@ export interface BatchTestRewrite {
|
|
|
56
59
|
* Rewrite a decomposed plan so it carries no whole-project batch test task when
|
|
57
60
|
* the decisions mandate tests-in-the-same-change.
|
|
58
61
|
*
|
|
59
|
-
* No mandate, or no batch title ⇒ the plan is returned untouched
|
|
60
|
-
* every non-cadence run
|
|
62
|
+
* No mandate, or no batch title ⇒ the plan is returned untouched, with no actions,
|
|
63
|
+
* so every non-cadence run is unaffected. Both identity paths run as described.
|
|
61
64
|
*
|
|
62
65
|
* With a mandate, ALL batch titles are removed at once before coverage is
|
|
63
66
|
* re-measured — otherwise two batch tasks would each mask the other's orphans and
|
|
64
67
|
* both would look droppable. The orphaned set is then whatever grounded coverage
|
|
65
68
|
* the removal costs; it is non-empty only when no other task's title claims that
|
|
66
|
-
* requirement, and it becomes the sweep's scope. At most ONE sweep is emitted
|
|
67
|
-
* the first batch title's position, so plan order is preserved
|
|
69
|
+
* requirement, and it becomes the sweep's scope. At most ONE sweep is emitted, in
|
|
70
|
+
* the first batch title's position, so plan order is preserved.
|
|
71
|
+
*
|
|
72
|
+
* Run on the SAME batch title twice, changing only the requirement list: when
|
|
73
|
+
* another task grounds the requirement the title is DROPPED, and when the batch
|
|
74
|
+
* title is its only owner it is SCOPED into a sweep naming that quote and the
|
|
75
|
+
* spec's own coverage command. Any `[decisions: …]` tail rides onto the sweep.
|
|
68
76
|
*/
|
|
69
77
|
export declare function rewriteBatchTestPlan(titles: string[], decisions: string, spec: string, requirementQuotes: string[], isCrossCutting: (quote: string) => boolean): BatchTestRewrite;
|
|
70
78
|
/**
|