@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/serve-entry.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* serve-entry — the project builds a server app, expects to SERVE, and nothing in
|
|
3
|
-
* the tree ever starts a listener
|
|
3
|
+
* the tree ever starts a listener.
|
|
4
4
|
*
|
|
5
|
-
* THE FAILURE THIS CLOSES
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* THE FAILURE THIS CLOSES. A `src/server/index.ts` constructs a Hono app, mounts
|
|
6
|
+
* its `/api` routers, adds an SPA fallback reading `Bun.file('dist/index.html')` —
|
|
7
|
+
* and ends at `export {app}`. No `Bun.serve`, no `export default app`, no `serve()`
|
|
8
|
+
* from an adapter. Running that entry exits 0 immediately: the product cannot be
|
|
9
|
+
* started at all.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* boot command resolved to a `docker compose up` orchestrator, docker was absent in
|
|
15
|
-
* the sandbox, and the boot SKIPPED. This is the SECOND run to lose this exact
|
|
16
|
-
* clause — mx5 run 16 shipped a server that never served the client bundle
|
|
17
|
-
* (scripts/live-owned-requirement-compose-ab.ts) — so a dynamic-only gate has now
|
|
18
|
-
* failed to catch it twice.
|
|
11
|
+
* A dynamic gate does not necessarily catch it. If the boot command resolves to an
|
|
12
|
+
* orchestrator the environment cannot run, the boot SKIPS under the env-gap
|
|
13
|
+
* contract and the run ships green.
|
|
19
14
|
*
|
|
20
15
|
* WHY STATIC. The check needs no runtime, no browser, no docker, no database and no
|
|
21
16
|
* model: the tree either contains a bind or it does not. It runs in milliseconds and
|
|
@@ -50,9 +45,9 @@ const CONSTRUCT_PATTERNS = [
|
|
|
50
45
|
{ re: /(?:^|[^.\w])express\s*\(\s*\)/, construct: 'express()' },
|
|
51
46
|
{ re: /(?:^|[^.\w])[Ff]astify\s*\(/, construct: 'fastify()' },
|
|
52
47
|
{ re: /(?:^|[^.\w])polka\s*\(/, construct: 'polka()' }
|
|
53
|
-
// `connect()` (the middleware framework) is deliberately absent:
|
|
54
|
-
//
|
|
55
|
-
//
|
|
48
|
+
// `connect()` (the middleware framework) is deliberately absent: `connect()` is
|
|
49
|
+
// also what a database module calls, and a construct signal that cannot tell a
|
|
50
|
+
// server from a db handle is not a construct signal.
|
|
56
51
|
];
|
|
57
52
|
/**
|
|
58
53
|
* Anything that starts (or hands off) a listener. Deliberately GENEROUS: every
|
|
@@ -72,7 +67,8 @@ const BIND_PATTERNS = [
|
|
|
72
67
|
* Vercel) starts whatever is exported. A default-exported config object
|
|
73
68
|
* (`export default defineConfig({…})`) is not one of them, and neither is a React
|
|
74
69
|
* component — hence the identifier must be a name the tree BOUND to a server-app
|
|
75
|
-
* construction
|
|
70
|
+
* construction. `export default App` on a component names nothing this scan
|
|
71
|
+
* constructed, so it is not a bind. */
|
|
76
72
|
function defaultExportBind(src, appNames) {
|
|
77
73
|
for (const m of src.matchAll(/export\s+default\s+([A-Za-z_$][\w$]*)/g)) {
|
|
78
74
|
if (appNames.has(m[1]))
|
|
@@ -147,7 +143,7 @@ export function findServeExpectation(src) {
|
|
|
147
143
|
return null;
|
|
148
144
|
}
|
|
149
145
|
/** A design/spec clause that names a served path — the plan-side half of the same
|
|
150
|
-
* expectation
|
|
146
|
+
* expectation, e.g. a design that says "serves `/api` + static `dist/`". */
|
|
151
147
|
export function planExpectsServing(planText) {
|
|
152
148
|
if (!planText)
|
|
153
149
|
return null;
|
|
@@ -182,8 +178,8 @@ export function opaqueLauncher(cwd) {
|
|
|
182
178
|
return null;
|
|
183
179
|
}
|
|
184
180
|
// The tree walk, the caps, the skip sets and the comment strip live in
|
|
185
|
-
// task/shipped-source.ts
|
|
186
|
-
//
|
|
181
|
+
// task/shipped-source.ts, shared with artifact-closure's scan so the two cannot
|
|
182
|
+
// drift apart on which directories they skip.
|
|
187
183
|
const scanCandidates = (cwd) => shippedSources(cwd, { ext: SOURCE_JS_RE });
|
|
188
184
|
/** A `/…/flags` literal whose body carries a regex METACHARACTER — `[`, `\`, `+`,
|
|
189
185
|
* `?`, `|`, a group. A path string like `'/api/admin'` has none, so it survives. */
|
|
@@ -192,10 +188,11 @@ const METACHAR_RE = /[\\[\]+*?^$|(){}]/;
|
|
|
192
188
|
/**
|
|
193
189
|
* Blank out regex literals. A project that MATCHES on `new Hono` — a linter, a
|
|
194
190
|
* codemod, this very module — does not construct one, and a source scanner that
|
|
195
|
-
* cannot tell the two apart reports every detector as an app
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
191
|
+
* cannot tell the two apart reports every detector as an app. With this in place
|
|
192
|
+
* `scanServeEntry` finds ZERO apps in pi-task's own tree, whose pattern tables name
|
|
193
|
+
* every construct it looks for. Only literals carrying a metacharacter are
|
|
194
|
+
* stripped, so `'/api/v1'` is untouched, and because stripping can only REMOVE
|
|
195
|
+
* matches it is safe in the FP direction by construction.
|
|
199
196
|
*/
|
|
200
197
|
function stripRegexLiterals(src) {
|
|
201
198
|
return src.replace(REGEX_LITERAL_RE, (whole, body) => METACHAR_RE.test(body) ? ' ' : whole);
|
|
@@ -5,8 +5,10 @@ export function formatServiceBlock(name, fullQuery, results) {
|
|
|
5
5
|
const bullets = results.map(r => `- **${r.title}** — ${r.url}\n ${r.description}`).join('\n');
|
|
6
6
|
return `${header}\n${bullets}`;
|
|
7
7
|
}
|
|
8
|
-
// Only
|
|
9
|
-
//
|
|
8
|
+
// Only brave can be unconfigured: `SEARCH_PROVIDER_KEY_ENV` (search-types.ts)
|
|
9
|
+
// lists no env var for exa or ddg, so `searchProviderKey` answers '' for them and
|
|
10
|
+
// the `no_key` result this block reports is unreachable. The reason therefore
|
|
11
|
+
// names brave's key outright rather than describing a generic misconfiguration.
|
|
10
12
|
export function formatFreshnessSkippedBlock(names) {
|
|
11
13
|
return `### freshness-check skipped\nCould not verify external services (search provider is brave but BRAVE_SEARCH_API_KEY is not set):\n${names.map(n => `- ${n}`).join('\n')}`;
|
|
12
14
|
}
|
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What counts as SHIPPED SOURCE — the input
|
|
2
|
+
* What counts as SHIPPED SOURCE — the input the run-level closure scans read.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* ONE walker, ONE skip set, ONE extension regex, ONE comment strip, shared by
|
|
5
|
+
* `serve-entry.ts` and `artifact-closure.ts`. Two copies of this drift: a skip set
|
|
6
|
+
* that gains a directory on one side makes a file a run-level finding for one scan
|
|
7
|
+
* while the sibling scan cannot see it at all, and nothing in either file would say
|
|
8
|
+
* so.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* benchmark file was a run-level finding while the same file was invisible to
|
|
14
|
-
* the sibling scan. Nothing in either file acknowledged the other.
|
|
15
|
-
* - The same extension regex was declared twice under two names (`SCAN_RE`,
|
|
16
|
-
* `SCAN_JS_RE`), and `stripCommentLines` was byte-identical in both.
|
|
17
|
-
* - `.pi-tasks` was hardcoded into both skip sets rather than derived from
|
|
18
|
-
* `TASKS_DIR_NAME`.
|
|
19
|
-
*
|
|
20
|
-
* The locality proof is in the suites: `artifact-closure.test.ts` has 28
|
|
21
|
-
* references to the pure extractors and 5 calls to the driver, and NO test in the
|
|
22
|
-
* cluster asserted a skip set at all. That is the shape recorded under
|
|
23
|
-
* `resolveTypeSource` — pure functions extracted for testability while the real
|
|
24
|
-
* logic stayed in how they are CALLED.
|
|
25
|
-
*
|
|
26
|
-
* NOT unified here: `env-template-closure.ts`. It asks a different question —
|
|
27
|
-
* which TRACKED files could read an env var, including `.py`/`.go`, including
|
|
28
|
-
* tests — and answering it over this walk would silently change which env
|
|
29
|
-
* findings a run produces. Its comment rule is not this one either: it is a
|
|
30
|
-
* per-line predicate that also treats `#` as a comment opener, which it must,
|
|
31
|
-
* and which would be wrong for JS/TS. Recorded as a real divergence rather than
|
|
32
|
-
* harmonised; changing it is an env-policy change with its own A/B.
|
|
10
|
+
* NOT unified here: `env-template-closure.ts`. It asks a different question — which
|
|
11
|
+
* TRACKED files could read an env var, `.py` and `.go` included, tests included —
|
|
12
|
+
* and answering it over this walk would silently change which env findings a run
|
|
13
|
+
* produces. Its comment rule differs too: a per-line predicate that also treats `#`
|
|
14
|
+
* as an opener, which it must, and which would be wrong for JS/TS.
|
|
33
15
|
*/
|
|
34
16
|
/** Authored JS/TS. The one declaration — it was two constants under two names. */
|
|
35
17
|
export declare const SOURCE_JS_RE: RegExp;
|
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What counts as SHIPPED SOURCE — the input
|
|
2
|
+
* What counts as SHIPPED SOURCE — the input the run-level closure scans read.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* ONE walker, ONE skip set, ONE extension regex, ONE comment strip, shared by
|
|
5
|
+
* `serve-entry.ts` and `artifact-closure.ts`. Two copies of this drift: a skip set
|
|
6
|
+
* that gains a directory on one side makes a file a run-level finding for one scan
|
|
7
|
+
* while the sibling scan cannot see it at all, and nothing in either file would say
|
|
8
|
+
* so.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* benchmark file was a run-level finding while the same file was invisible to
|
|
14
|
-
* the sibling scan. Nothing in either file acknowledged the other.
|
|
15
|
-
* - The same extension regex was declared twice under two names (`SCAN_RE`,
|
|
16
|
-
* `SCAN_JS_RE`), and `stripCommentLines` was byte-identical in both.
|
|
17
|
-
* - `.pi-tasks` was hardcoded into both skip sets rather than derived from
|
|
18
|
-
* `TASKS_DIR_NAME`.
|
|
19
|
-
*
|
|
20
|
-
* The locality proof is in the suites: `artifact-closure.test.ts` has 28
|
|
21
|
-
* references to the pure extractors and 5 calls to the driver, and NO test in the
|
|
22
|
-
* cluster asserted a skip set at all. That is the shape recorded under
|
|
23
|
-
* `resolveTypeSource` — pure functions extracted for testability while the real
|
|
24
|
-
* logic stayed in how they are CALLED.
|
|
25
|
-
*
|
|
26
|
-
* NOT unified here: `env-template-closure.ts`. It asks a different question —
|
|
27
|
-
* which TRACKED files could read an env var, including `.py`/`.go`, including
|
|
28
|
-
* tests — and answering it over this walk would silently change which env
|
|
29
|
-
* findings a run produces. Its comment rule is not this one either: it is a
|
|
30
|
-
* per-line predicate that also treats `#` as a comment opener, which it must,
|
|
31
|
-
* and which would be wrong for JS/TS. Recorded as a real divergence rather than
|
|
32
|
-
* harmonised; changing it is an env-policy change with its own A/B.
|
|
10
|
+
* NOT unified here: `env-template-closure.ts`. It asks a different question — which
|
|
11
|
+
* TRACKED files could read an env var, `.py` and `.go` included, tests included —
|
|
12
|
+
* and answering it over this walk would silently change which env findings a run
|
|
13
|
+
* produces. Its comment rule differs too: a per-line predicate that also treats `#`
|
|
14
|
+
* as an opener, which it must, and which would be wrong for JS/TS.
|
|
33
15
|
*/
|
|
34
16
|
import { readdirSync, statSync } from 'node:fs';
|
|
35
17
|
import * as path from 'node:path';
|
package/dist/task/skip-escape.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Deterministic skip-escape scanner for authored VERIFY blocks
|
|
2
|
+
* Deterministic skip-escape scanner for authored VERIFY blocks.
|
|
3
3
|
*
|
|
4
4
|
* A skip-escape is a `||` fallback that lets a REQUIRED check pass SILENTLY when
|
|
5
5
|
* its tool is absent or it fails — e.g. `playwright test … || echo "skipping"`.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* and the verify child blessed it as "correctly skipped".
|
|
6
|
+
* A spec whose only behavioural check is wrapped that way passes its gate on a
|
|
7
|
+
* machine without the tool, and the verify child reads it as "correctly skipped".
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* the actionable finding here. Bare `|| true` is left to the verify child's runtime
|
|
18
|
-
* rule 5c, which can actually observe whether the check ran (a static scan cannot
|
|
19
|
-
* tell a required-check `|| true` from a teardown `|| true`).
|
|
9
|
+
* Flagging every `|| true` would be almost all false positives: teardown
|
|
10
|
+
* (`kill … || true`, `docker compose down … || true`), setup (`… install
|
|
11
|
+
* … || true`) and negative tests (`… && exit 1 || true`, where `|| true` catches
|
|
12
|
+
* an EXPECTED failure) are all legitimate, and a static scan cannot tell a
|
|
13
|
+
* required-check `|| true` from a teardown one. The crisp signal is narrower: a
|
|
14
|
+
* fallback whose TEXT admits it is dodging the check. Bare `|| true` is left to
|
|
15
|
+
* the verify child's runtime rule 5c, which can observe whether the check ran.
|
|
20
16
|
*
|
|
21
17
|
* Pure shell-shape / text analysis; no stack or tool-name assumptions.
|
|
22
18
|
*/
|
package/dist/task/spec-urls.d.ts
CHANGED
|
@@ -1,60 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* The design document's own cited URLs, ranked as fetch candidates for the APIS
|
|
3
|
+
* research worker.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* afterwards (scripts/spec-url-reach.ts): 31 of 44 tasks asked pi-worker-docs about a package
|
|
11
|
-
* for which the design cites a page, 215 (task, URL) pairs, and 15 of the 17 reachable cited
|
|
12
|
-
* URLs were never fetched by anyone. The pages were named, in the project's own spec, and the
|
|
13
|
-
* worker went looking somewhere else.
|
|
5
|
+
* A design that names its references by URL has already chosen which pages
|
|
6
|
+
* document the packages it uses. Nothing makes a research worker prefer them: it
|
|
7
|
+
* searches, and lands wherever the search lands. This module extracts the cited
|
|
8
|
+
* URLs, keeps the ones documenting a package THIS task touches, and renders them
|
|
9
|
+
* as a ranked prompt block.
|
|
14
10
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* above, measured before any of this was written.
|
|
11
|
+
* RANKING, NOT REPLACING. The block says the cited pages outrank a page the model
|
|
12
|
+
* would pick itself, and says in terms that they are not the only pages it may
|
|
13
|
+
* fetch. A worker that can no longer follow a question off the design's reference
|
|
14
|
+
* list has been narrowed, not improved.
|
|
20
15
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* ── *** NOT WIRED. THE LIVE A/B FAILED. READ THIS BEFORE RE-ENABLING IT. *** ─────────────
|
|
27
|
-
*
|
|
28
|
-
* scripts/live-spec-url-fetch-ab.ts, 2026-07-22, 40 reps, both arms in one process, real
|
|
29
|
-
* phaseResearch, offline fixture web, metric = WHICH URL WAS FETCHED at the tool layer:
|
|
30
|
-
*
|
|
31
|
-
* task27-hono baseline 2/10 treatment 3/10 Fisher one-tailed p = 0.50
|
|
32
|
-
* task28-wouter baseline 0/10 treatment 0/10 p = 1.00
|
|
33
|
-
* POOLED baseline 2/20 treatment 3/20 p = 0.50
|
|
34
|
-
*
|
|
35
|
-
* Everything that could have made that a false negative was ruled out, not assumed:
|
|
36
|
-
* - the surgery held in every rep (baseline block 0 chars 20/20, treatment non-empty 20/20);
|
|
37
|
-
* - a positive control proved a real child can reach the stubbed pi-worker-fetch;
|
|
38
|
-
* - the block was proven to REACH the APIS prompt, not merely to be built — the prompt is
|
|
39
|
-
* 19,473 chars and ends with the six ranked URLs
|
|
40
|
-
* (scripts/spec-url-prompt-delivery-check.ts).
|
|
41
|
-
* So the model reads the instruction and does not act on it.
|
|
42
|
-
*
|
|
43
|
-
* AND THE PREMISE ITSELF DID NOT SURVIVE. PROMPT 4 rests on run 15 having fetched the WRONG
|
|
44
|
-
* pages. Across all 40 reps the only URL any worker ever fetched, in either arm, was
|
|
45
|
-
* https://hono.dev/docs/guides/rpc — the cited one. The worker does not choose badly between
|
|
46
|
-
* pages; it almost never fetches at all (5 of 40 reps). A lever that improves URL RANKING is
|
|
47
|
-
* aimed at a decision this worker rarely makes.
|
|
48
|
-
*
|
|
49
|
-
* The module is kept — deterministic, unit-tested against the real run-15 design text, and
|
|
50
|
-
* the A/B harness's string surgery targets it — so the experiment can be re-run cheaply if
|
|
51
|
-
* the fetch rate itself is ever moved. It is NOT called from phases.ts, deliberately.
|
|
16
|
+
* NOT WIRED. `buildSpecUrlBlock` has no production caller — phases.ts says so at
|
|
17
|
+
* the site where it would go. The module is kept deterministic and unit-tested
|
|
18
|
+
* against real design text so the experiment can be re-run cheaply, but nothing in
|
|
19
|
+
* a run reads it today.
|
|
52
20
|
*/
|
|
53
21
|
/**
|
|
54
|
-
* How many cited pages the block may name.
|
|
55
|
-
* every APIS prompt
|
|
56
|
-
* enough to skim past is a list the model ignores.
|
|
57
|
-
*
|
|
22
|
+
* How many cited pages the block may name. A design's whole reference list, repeated in
|
|
23
|
+
* every APIS prompt, is prefill spent on pages the task has no use for, and a list long
|
|
24
|
+
* enough to skim past is a list the model ignores. The ranking already drops every URL
|
|
25
|
+
* documenting nothing this task touches, so this only bounds a task that touches a lot.
|
|
58
26
|
*/
|
|
59
27
|
export declare const MAX_SPEC_URLS = 8;
|
|
60
28
|
/** http(s) URLs in a text, deduped, with local and placeholder hosts dropped. */
|
|
@@ -72,7 +40,7 @@ export declare function packageTokens(pkg: string): string[];
|
|
|
72
40
|
* Does this cited URL document this package? Host OR path, deliberately: wouter's page is
|
|
73
41
|
* github.com/molefrog/wouter#readme and @hono/zod-validator's is
|
|
74
42
|
* github.com/honojs/middleware/tree/main/packages/zod-validator — both real associations that
|
|
75
|
-
* live in the path
|
|
43
|
+
* live in the path, and a host-only rule matches neither.
|
|
76
44
|
*/
|
|
77
45
|
export declare function urlDocumentsPackage(url: string, pkg: string): boolean;
|
|
78
46
|
export interface RankedSpecUrl {
|
|
@@ -92,24 +60,17 @@ export interface RankedSpecUrl {
|
|
|
92
60
|
export declare function rankSpecUrls(urls: string[], packages: string[]): RankedSpecUrl[];
|
|
93
61
|
/**
|
|
94
62
|
* The prompt block, or '' when nothing is cited for anything this task uses.
|
|
95
|
-
*
|
|
96
|
-
* NOTE FOR ANYONE EDITING THE GUARD CLAUSE BELOW: scripts/live-spec-url-fetch-ab.ts strips
|
|
97
|
-
* this lever for its baseline arm by replacing that exact statement in the compiled output,
|
|
98
|
-
* and asserts it occurs exactly once. Reshaping it (an early `return` on the caller's side, a
|
|
99
|
-
* ternary, a different variable name) silently makes both arms identical, which reads as
|
|
100
|
-
* "the lever had no effect". Update the harness's anchor in the same commit.
|
|
101
63
|
*/
|
|
102
64
|
export declare function buildSpecUrlBlock(urls: string[], packages: string[]): string;
|
|
103
65
|
/**
|
|
104
66
|
* The manifest dependencies this task's refined text actually names — the relevance signal
|
|
105
|
-
* the ranking needs, and the reason the block does not simply list
|
|
67
|
+
* the ranking needs, and the reason the block does not simply list every cited URL.
|
|
106
68
|
*
|
|
107
|
-
* WHY NOT extractEnrichTargets. That parser is tuned for the
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* deterministic and impossible to fool with prose.
|
|
69
|
+
* WHY NOT extractEnrichTargets (enrichment.ts). That parser is tuned for the
|
|
70
|
+
* EXTERNAL-DEPENDENCIES section, so over an ordinary refined text it returns whatever
|
|
71
|
+
* identifiers and config filenames the prose mentions rather than the packages the task is
|
|
72
|
+
* about. The manifest is the authoritative list of what the project actually depends on;
|
|
73
|
+
* matching it against the task text is deterministic and cannot be fooled by prose.
|
|
113
74
|
*
|
|
114
75
|
* Word-boundary matched, so `react` does not match inside `react-dom` or `@types/react`, and
|
|
115
76
|
* a package genuinely named twice is still listed once.
|
package/dist/task/spec-urls.js
CHANGED
|
@@ -1,63 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* The design document's own cited URLs, ranked as fetch candidates for the APIS
|
|
3
|
+
* research worker.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* afterwards (scripts/spec-url-reach.ts): 31 of 44 tasks asked pi-worker-docs about a package
|
|
11
|
-
* for which the design cites a page, 215 (task, URL) pairs, and 15 of the 17 reachable cited
|
|
12
|
-
* URLs were never fetched by anyone. The pages were named, in the project's own spec, and the
|
|
13
|
-
* worker went looking somewhere else.
|
|
5
|
+
* A design that names its references by URL has already chosen which pages
|
|
6
|
+
* document the packages it uses. Nothing makes a research worker prefer them: it
|
|
7
|
+
* searches, and lands wherever the search lands. This module extracts the cited
|
|
8
|
+
* URLs, keeps the ones documenting a package THIS task touches, and renders them
|
|
9
|
+
* as a ranked prompt block.
|
|
14
10
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* above, measured before any of this was written.
|
|
11
|
+
* RANKING, NOT REPLACING. The block says the cited pages outrank a page the model
|
|
12
|
+
* would pick itself, and says in terms that they are not the only pages it may
|
|
13
|
+
* fetch. A worker that can no longer follow a question off the design's reference
|
|
14
|
+
* list has been narrowed, not improved.
|
|
20
15
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* ── *** NOT WIRED. THE LIVE A/B FAILED. READ THIS BEFORE RE-ENABLING IT. *** ─────────────
|
|
27
|
-
*
|
|
28
|
-
* scripts/live-spec-url-fetch-ab.ts, 2026-07-22, 40 reps, both arms in one process, real
|
|
29
|
-
* phaseResearch, offline fixture web, metric = WHICH URL WAS FETCHED at the tool layer:
|
|
30
|
-
*
|
|
31
|
-
* task27-hono baseline 2/10 treatment 3/10 Fisher one-tailed p = 0.50
|
|
32
|
-
* task28-wouter baseline 0/10 treatment 0/10 p = 1.00
|
|
33
|
-
* POOLED baseline 2/20 treatment 3/20 p = 0.50
|
|
34
|
-
*
|
|
35
|
-
* Everything that could have made that a false negative was ruled out, not assumed:
|
|
36
|
-
* - the surgery held in every rep (baseline block 0 chars 20/20, treatment non-empty 20/20);
|
|
37
|
-
* - a positive control proved a real child can reach the stubbed pi-worker-fetch;
|
|
38
|
-
* - the block was proven to REACH the APIS prompt, not merely to be built — the prompt is
|
|
39
|
-
* 19,473 chars and ends with the six ranked URLs
|
|
40
|
-
* (scripts/spec-url-prompt-delivery-check.ts).
|
|
41
|
-
* So the model reads the instruction and does not act on it.
|
|
42
|
-
*
|
|
43
|
-
* AND THE PREMISE ITSELF DID NOT SURVIVE. PROMPT 4 rests on run 15 having fetched the WRONG
|
|
44
|
-
* pages. Across all 40 reps the only URL any worker ever fetched, in either arm, was
|
|
45
|
-
* https://hono.dev/docs/guides/rpc — the cited one. The worker does not choose badly between
|
|
46
|
-
* pages; it almost never fetches at all (5 of 40 reps). A lever that improves URL RANKING is
|
|
47
|
-
* aimed at a decision this worker rarely makes.
|
|
48
|
-
*
|
|
49
|
-
* The module is kept — deterministic, unit-tested against the real run-15 design text, and
|
|
50
|
-
* the A/B harness's string surgery targets it — so the experiment can be re-run cheaply if
|
|
51
|
-
* the fetch rate itself is ever moved. It is NOT called from phases.ts, deliberately.
|
|
16
|
+
* NOT WIRED. `buildSpecUrlBlock` has no production caller — phases.ts says so at
|
|
17
|
+
* the site where it would go. The module is kept deterministic and unit-tested
|
|
18
|
+
* against real design text so the experiment can be re-run cheaply, but nothing in
|
|
19
|
+
* a run reads it today.
|
|
52
20
|
*/
|
|
53
21
|
/** Never candidates: a local dev URL is not documentation. */
|
|
54
22
|
const LOCAL_HOST = /^(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\]|.*\.local)$/i;
|
|
55
23
|
const PLACEHOLDER_HOST = /^(example\.(com|org|net)|your-.*|<.*)$/i;
|
|
56
24
|
/**
|
|
57
|
-
* How many cited pages the block may name.
|
|
58
|
-
* every APIS prompt
|
|
59
|
-
* enough to skim past is a list the model ignores.
|
|
60
|
-
*
|
|
25
|
+
* How many cited pages the block may name. A design's whole reference list, repeated in
|
|
26
|
+
* every APIS prompt, is prefill spent on pages the task has no use for, and a list long
|
|
27
|
+
* enough to skim past is a list the model ignores. The ranking already drops every URL
|
|
28
|
+
* documenting nothing this task touches, so this only bounds a task that touches a lot.
|
|
61
29
|
*/
|
|
62
30
|
export const MAX_SPEC_URLS = 8;
|
|
63
31
|
/** http(s) URLs in a text, deduped, with local and placeholder hosts dropped. */
|
|
@@ -110,7 +78,7 @@ export function packageTokens(pkg) {
|
|
|
110
78
|
* Does this cited URL document this package? Host OR path, deliberately: wouter's page is
|
|
111
79
|
* github.com/molefrog/wouter#readme and @hono/zod-validator's is
|
|
112
80
|
* github.com/honojs/middleware/tree/main/packages/zod-validator — both real associations that
|
|
113
|
-
* live in the path
|
|
81
|
+
* live in the path, and a host-only rule matches neither.
|
|
114
82
|
*/
|
|
115
83
|
export function urlDocumentsPackage(url, pkg) {
|
|
116
84
|
const toks = packageTokens(pkg);
|
|
@@ -152,12 +120,6 @@ export function rankSpecUrls(urls, packages) {
|
|
|
152
120
|
}
|
|
153
121
|
/**
|
|
154
122
|
* The prompt block, or '' when nothing is cited for anything this task uses.
|
|
155
|
-
*
|
|
156
|
-
* NOTE FOR ANYONE EDITING THE GUARD CLAUSE BELOW: scripts/live-spec-url-fetch-ab.ts strips
|
|
157
|
-
* this lever for its baseline arm by replacing that exact statement in the compiled output,
|
|
158
|
-
* and asserts it occurs exactly once. Reshaping it (an early `return` on the caller's side, a
|
|
159
|
-
* ternary, a different variable name) silently makes both arms identical, which reads as
|
|
160
|
-
* "the lever had no effect". Update the harness's anchor in the same commit.
|
|
161
123
|
*/
|
|
162
124
|
export function buildSpecUrlBlock(urls, packages) {
|
|
163
125
|
const ranked = rankSpecUrls(urls, packages);
|
|
@@ -189,14 +151,13 @@ export function buildSpecUrlBlock(urls, packages) {
|
|
|
189
151
|
}
|
|
190
152
|
/**
|
|
191
153
|
* The manifest dependencies this task's refined text actually names — the relevance signal
|
|
192
|
-
* the ranking needs, and the reason the block does not simply list
|
|
154
|
+
* the ranking needs, and the reason the block does not simply list every cited URL.
|
|
193
155
|
*
|
|
194
|
-
* WHY NOT extractEnrichTargets. That parser is tuned for the
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* deterministic and impossible to fool with prose.
|
|
156
|
+
* WHY NOT extractEnrichTargets (enrichment.ts). That parser is tuned for the
|
|
157
|
+
* EXTERNAL-DEPENDENCIES section, so over an ordinary refined text it returns whatever
|
|
158
|
+
* identifiers and config filenames the prose mentions rather than the packages the task is
|
|
159
|
+
* about. The manifest is the authoritative list of what the project actually depends on;
|
|
160
|
+
* matching it against the task text is deterministic and cannot be fooled by prose.
|
|
200
161
|
*
|
|
201
162
|
* Word-boundary matched, so `react` does not match inside `react-dom` or `@types/react`, and
|
|
202
163
|
* a package genuinely named twice is still listed once.
|
|
@@ -13,15 +13,15 @@ export declare function parseVerifyBlock(spec: string): VerifyCommand[] | null;
|
|
|
13
13
|
/**
|
|
14
14
|
* parseVerifyBlock, but only when the fenced block is actually CLOSED.
|
|
15
15
|
*
|
|
16
|
-
* An unterminated fence makes the lenient parser swallow the rest of the file:
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* An unterminated fence makes the lenient parser swallow the rest of the file: a
|
|
17
|
+
* task file that opens ```sh and never closes it yields "VERIFY commands" that
|
|
18
|
+
* include every line appended after the spec — a timings table, a gate-trail line.
|
|
19
19
|
* That is harmless where the parser only asks "is there something runnable here",
|
|
20
|
-
* and NOT harmless where a parsed line is treated as
|
|
21
|
-
* quoting `bun run lint` would match a
|
|
20
|
+
* and NOT harmless where a parsed line is treated as PROVENANCE: a debt reason
|
|
21
|
+
* quoting `bun run lint` would then match a trail sentence and mint a stored,
|
|
22
22
|
* re-runnable command the spec never asked for (accept-debt.ts
|
|
23
|
-
* verifyCommandFromReason
|
|
24
|
-
* to MEAN something use this one: an unclosed fence is no block at all.
|
|
23
|
+
* `verifyCommandFromReason`, `inv-command-provenance`). Callers that need the
|
|
24
|
+
* block to MEAN something use this one: an unclosed fence is no block at all.
|
|
25
25
|
*/
|
|
26
26
|
export declare function parseVerifyBlockStrict(spec: string): VerifyCommand[] | null;
|
|
27
27
|
export declare function isCritiqueClean(text: string): boolean;
|
|
@@ -40,24 +40,21 @@ export declare const REFINE_SECTIONS: readonly ["GOAL", "CONSTRAINTS", "KNOWN-UN
|
|
|
40
40
|
/**
|
|
41
41
|
* Is a refine child's output shaped like a refined prompt?
|
|
42
42
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* `
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* once and says nothing. This names the contract in one place.
|
|
43
|
+
* Every downstream reader of a refined prompt is a PARTIAL parser that tolerates a
|
|
44
|
+
* missing section SILENTLY: `extractCapsSection` (refuted-constraint.ts) returns
|
|
45
|
+
* null, `scopedToolingGoal` (phases.ts) returns the whole text, and `deriveTitle`
|
|
46
|
+
* (parsers.ts) and `extractEnrichTargets` (enrichment.ts) fall back. So a refine
|
|
47
|
+
* answer that dropped a heading degrades four features at once and says nothing.
|
|
48
|
+
* This names the contract in one place; phases.ts calls it after refine.
|
|
50
49
|
*
|
|
51
50
|
* WHAT IT CHECKS, and why it is only this. Every one of those consumers looks
|
|
52
51
|
* for a BARE ALL-CAPS heading alone on its own line — `l.trim() === heading`,
|
|
53
52
|
* `/^GOAL[ \t]*\n/m`. That is the operative contract, so that is the test.
|
|
54
53
|
*
|
|
55
|
-
* It does NOT require the text to START with GOAL, even though REFINE_PROMPT
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* refine output usually looks like, and production has always consumed it fine.
|
|
60
|
-
* A validator stricter than its consumers would reject work that works.
|
|
54
|
+
* It does NOT require the text to START with GOAL, even though REFINE_PROMPT asks
|
|
55
|
+
* for the four headings in order and forbids a preamble. None of the four
|
|
56
|
+
* consumers above cares where the heading sits, so a validator that did would
|
|
57
|
+
* reject work every one of them handles.
|
|
61
58
|
*
|
|
62
59
|
* Returns a problem string, or null when the shape is good — same contract as
|
|
63
60
|
* `validateSpecShape` above.
|