clinkx 0.3.0 → 1.0.0
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/CHANGELOG.md +33 -0
- package/LICENSE +10 -0
- package/README.md +82 -26
- package/clinkx-workflows/dist/allowed-roots.d.ts +1 -0
- package/clinkx-workflows/dist/allowed-roots.js +5 -0
- package/clinkx-workflows/dist/allowed-roots.js.map +1 -0
- package/clinkx-workflows/dist/artifacts.d.ts +20 -1
- package/clinkx-workflows/dist/artifacts.js +38 -9
- package/clinkx-workflows/dist/artifacts.js.map +1 -1
- package/clinkx-workflows/dist/backend.d.ts +4 -0
- package/clinkx-workflows/dist/citation-check.d.ts +40 -0
- package/clinkx-workflows/dist/citation-check.js +348 -0
- package/clinkx-workflows/dist/citation-check.js.map +1 -0
- package/clinkx-workflows/dist/clink-client.d.ts +2 -1
- package/clinkx-workflows/dist/clink-client.js +17 -4
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/config.d.ts +145 -16
- package/clinkx-workflows/dist/config.js +384 -26
- package/clinkx-workflows/dist/config.js.map +1 -1
- package/clinkx-workflows/dist/contained-file.d.ts +172 -0
- package/clinkx-workflows/dist/contained-file.js +483 -0
- package/clinkx-workflows/dist/contained-file.js.map +1 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.d.ts +416 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.js +328 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.js.map +1 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.d.ts +24 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.js +39 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.js.map +1 -0
- package/clinkx-workflows/dist/context-cache-key.d.ts +53 -0
- package/clinkx-workflows/dist/context-cache-key.js +91 -0
- package/clinkx-workflows/dist/context-cache-key.js.map +1 -0
- package/clinkx-workflows/dist/context-mode-resolver.d.ts +27 -0
- package/clinkx-workflows/dist/context-mode-resolver.js +126 -0
- package/clinkx-workflows/dist/context-mode-resolver.js.map +1 -0
- package/clinkx-workflows/dist/context-preflight.d.ts +184 -0
- package/clinkx-workflows/dist/context-preflight.js +91 -0
- package/clinkx-workflows/dist/context-preflight.js.map +1 -0
- package/clinkx-workflows/dist/council-expander.d.ts +1 -1
- package/clinkx-workflows/dist/council-expander.js +2 -1
- package/clinkx-workflows/dist/council-expander.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +165 -0
- package/clinkx-workflows/dist/dashboard/activity-contract.js +105 -0
- package/clinkx-workflows/dist/dashboard/activity-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.d.ts +25 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.js +34 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.d.ts +86 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js +480 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/api-routes.d.ts +36 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js +1047 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.d.ts +37 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.js +145 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.d.ts +31 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.js +65 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.d.ts +26 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.js +596 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.d.ts +60 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.js +776 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.d.ts +9 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js +44 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.d.ts +17 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.js +77 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.d.ts +25 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js +71 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.d.ts +37 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.js +49 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.d.ts +222 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js +1178 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +8936 -0
- package/clinkx-workflows/dist/dashboard/contracts.js +1157 -0
- package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/generation.d.ts +14 -0
- package/clinkx-workflows/dist/dashboard/generation.js +41 -0
- package/clinkx-workflows/dist/dashboard/generation.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/index.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/index.js +16 -0
- package/clinkx-workflows/dist/dashboard/index.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +101 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js +748 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +303 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js +221 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.d.ts +50 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js +581 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.d.ts +89 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js +71 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +110 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/read-model.d.ts +86 -0
- package/clinkx-workflows/dist/dashboard/read-model.js +440 -0
- package/clinkx-workflows/dist/dashboard/read-model.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/request-admission.d.ts +31 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js +126 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/scanner.d.ts +75 -0
- package/clinkx-workflows/dist/dashboard/scanner.js +1110 -0
- package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/server-factory.d.ts +50 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js +431 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +2611 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js +480 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.d.ts +21 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.js +101 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.d.ts +43 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.js +522 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.d.ts +61 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.js +378 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +6 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js +367 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.d.ts +23 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.js +212 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/static-responses.d.ts +10 -0
- package/clinkx-workflows/dist/dashboard/static-responses.js +94 -0
- package/clinkx-workflows/dist/dashboard/static-responses.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.js +241 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.js.map +1 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/index-DOkMXTfB.js +25 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/style-ChJsn0KD.css +1 -0
- package/clinkx-workflows/dist/dashboard-ui/contracts/council-plan-review-input-v1.json +158 -0
- package/clinkx-workflows/dist/dashboard-ui/index.html +15 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Mono-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Sans-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/JetBrains-Mono-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/NOTICE.md +32 -0
- package/clinkx-workflows/dist/dashboard-ui/theme-init.js +8 -0
- package/clinkx-workflows/dist/definition-normalizer.d.ts +19 -0
- package/clinkx-workflows/dist/definition-normalizer.js.map +1 -1
- package/clinkx-workflows/dist/delegate-validate.d.ts +78 -0
- package/clinkx-workflows/dist/delegate-validate.js +97 -0
- package/clinkx-workflows/dist/delegate-validate.js.map +1 -0
- package/clinkx-workflows/dist/engine.d.ts +141 -0
- package/clinkx-workflows/dist/engine.js +882 -28
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/errors.d.ts +2 -0
- package/clinkx-workflows/dist/errors.js.map +1 -1
- package/clinkx-workflows/dist/fingerprint.d.ts +1 -1
- package/clinkx-workflows/dist/fingerprint.js +1 -1
- package/clinkx-workflows/dist/index.d.ts +19 -0
- package/clinkx-workflows/dist/index.js +15 -0
- package/clinkx-workflows/dist/index.js.map +1 -1
- package/clinkx-workflows/dist/loader.d.ts +9 -3
- package/clinkx-workflows/dist/loader.js +92 -21
- package/clinkx-workflows/dist/loader.js.map +1 -1
- package/clinkx-workflows/dist/plan-review/admission.d.ts +160 -0
- package/clinkx-workflows/dist/plan-review/admission.js +290 -0
- package/clinkx-workflows/dist/plan-review/admission.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/context-policy.d.ts +55 -0
- package/clinkx-workflows/dist/plan-review/context-policy.js +146 -0
- package/clinkx-workflows/dist/plan-review/context-policy.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/contract.d.ts +763 -0
- package/clinkx-workflows/dist/plan-review/contract.js +289 -0
- package/clinkx-workflows/dist/plan-review/contract.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/digest.d.ts +68 -0
- package/clinkx-workflows/dist/plan-review/digest.js +241 -0
- package/clinkx-workflows/dist/plan-review/digest.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/discovery.d.ts +45 -0
- package/clinkx-workflows/dist/plan-review/discovery.js +36 -0
- package/clinkx-workflows/dist/plan-review/discovery.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.d.ts +298 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.js +194 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/expander.d.ts +48 -0
- package/clinkx-workflows/dist/plan-review/expander.js +243 -0
- package/clinkx-workflows/dist/plan-review/expander.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/projector.d.ts +126 -0
- package/clinkx-workflows/dist/plan-review/projector.js +437 -0
- package/clinkx-workflows/dist/plan-review/projector.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/publication.d.ts +95 -0
- package/clinkx-workflows/dist/plan-review/publication.js +182 -0
- package/clinkx-workflows/dist/plan-review/publication.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.d.ts +34 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.js +139 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/resume.d.ts +38 -0
- package/clinkx-workflows/dist/plan-review/resume.js +122 -0
- package/clinkx-workflows/dist/plan-review/resume.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/rubric.d.ts +7 -0
- package/clinkx-workflows/dist/plan-review/rubric.js +24 -0
- package/clinkx-workflows/dist/plan-review/rubric.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/run-state.d.ts +398 -0
- package/clinkx-workflows/dist/plan-review/run-state.js +183 -0
- package/clinkx-workflows/dist/plan-review/run-state.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.d.ts +74 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.js +186 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/snapshot.d.ts +81 -0
- package/clinkx-workflows/dist/plan-review/snapshot.js +170 -0
- package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/stage-error.d.ts +19 -0
- package/clinkx-workflows/dist/plan-review/stage-error.js +20 -0
- package/clinkx-workflows/dist/plan-review/stage-error.js.map +1 -0
- package/clinkx-workflows/dist/post-processors/index.d.ts +20 -0
- package/clinkx-workflows/dist/post-processors/index.js +21 -0
- package/clinkx-workflows/dist/post-processors/index.js.map +1 -0
- package/clinkx-workflows/dist/prompt-budget.d.ts +7 -0
- package/clinkx-workflows/dist/prompt-budget.js +7 -1
- package/clinkx-workflows/dist/prompt-budget.js.map +1 -1
- package/clinkx-workflows/dist/reducers/index.js +2 -0
- package/clinkx-workflows/dist/reducers/index.js.map +1 -1
- package/clinkx-workflows/dist/run-lock-heartbeat.d.ts +2 -0
- package/clinkx-workflows/dist/run-lock-heartbeat.js +3 -0
- package/clinkx-workflows/dist/run-lock-heartbeat.js.map +1 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.d.ts +34 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js +74 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js.map +1 -0
- package/clinkx-workflows/dist/run-summary/cards/index.js +5 -0
- package/clinkx-workflows/dist/run-summary/cards/index.js.map +1 -1
- package/clinkx-workflows/dist/run-summary.d.ts +13 -0
- package/clinkx-workflows/dist/run-summary.js +29 -1
- package/clinkx-workflows/dist/run-summary.js.map +1 -1
- package/clinkx-workflows/dist/schema.d.ts +76 -21
- package/clinkx-workflows/dist/schema.js +10 -1
- package/clinkx-workflows/dist/schema.js.map +1 -1
- package/clinkx-workflows/dist/seed-terms.d.ts +30 -0
- package/clinkx-workflows/dist/seed-terms.js +176 -0
- package/clinkx-workflows/dist/seed-terms.js.map +1 -0
- package/clinkx-workflows/dist/server.d.ts +5 -2
- package/clinkx-workflows/dist/server.js +82 -52
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/shutdown.d.ts +18 -20
- package/clinkx-workflows/dist/shutdown.js +43 -61
- package/clinkx-workflows/dist/shutdown.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +38 -0
- package/clinkx-workflows/dist/state.d.ts +170 -3
- package/clinkx-workflows/dist/state.js +1275 -28
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/transport.d.ts +15 -0
- package/clinkx-workflows/dist/transport.js +19 -10
- package/clinkx-workflows/dist/transport.js.map +1 -1
- package/clinkx-workflows/dist/types.d.ts +14 -2
- package/clinkx-workflows/dist/validators/council.d.ts +318 -85
- package/clinkx-workflows/dist/validators/council.js +52 -13
- package/clinkx-workflows/dist/validators/council.js.map +1 -1
- package/clinkx-workflows/dist/validators/index.d.ts +1 -0
- package/clinkx-workflows/dist/validators/index.js +3 -0
- package/clinkx-workflows/dist/validators/index.js.map +1 -1
- package/clinkx-workflows/dist/validators/plan-review.d.ts +398 -0
- package/clinkx-workflows/dist/validators/plan-review.js +316 -0
- package/clinkx-workflows/dist/validators/plan-review.js.map +1 -0
- package/clinkx-workflows/dist/workflow-receipt.js +188 -4
- package/clinkx-workflows/dist/workflow-receipt.js.map +1 -1
- package/clinkx-workflows/dist/workflow-tools.d.ts +48 -3
- package/clinkx-workflows/dist/workflow-tools.js +1402 -59
- package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
- package/clinkx-workflows/dist/workspace-signature.d.ts +16 -0
- package/clinkx-workflows/dist/workspace-signature.js +388 -0
- package/clinkx-workflows/dist/workspace-signature.js.map +1 -0
- package/clinkx-workflows/templates/council/answer-specialist.txt +2 -1
- package/clinkx-workflows/templates/council/code-review-chairman.txt +13 -0
- package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +4 -1
- package/clinkx-workflows/templates/council/code-review-reviewer.txt +19 -3
- package/clinkx-workflows/templates/council/debug-debugger.txt +2 -1
- package/clinkx-workflows/templates/council/discover-analyst.txt +2 -1
- package/clinkx-workflows/templates/council/member.txt +2 -1
- package/clinkx-workflows/templates/council/plan-review-chairman.txt +68 -0
- package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +51 -0
- package/clinkx-workflows/templates/council/plan-review-reviewer.txt +60 -0
- package/clinkx-workflows/templates/plan-review/chairman.txt +48 -0
- package/clinkx-workflows/templates/plan-review/cross-review.txt +52 -0
- package/clinkx-workflows/templates/plan-review/ranking.txt +16 -0
- package/clinkx-workflows/templates/plan-review/reviewer.txt +57 -0
- package/clinkx-workflows/workflows/council-answer.yaml +97 -8
- package/clinkx-workflows/workflows/council-code-review.yaml +103 -8
- package/clinkx-workflows/workflows/council-debug.yaml +97 -8
- package/clinkx-workflows/workflows/council-default.yaml +97 -8
- package/clinkx-workflows/workflows/council-discover.yaml +97 -8
- package/clinkx-workflows/workflows/council-plan-review.yaml +250 -0
- package/clinkx-workflows/workflows/plan-review-receipts.yaml +230 -0
- package/conf/adapters/agy.json +49 -0
- package/conf/adapters/claude.json +5 -0
- package/conf/adapters/codex-app-server.json +44 -0
- package/conf/adapters/codex.json +7 -2
- package/conf/adapters/glm.json +5 -0
- package/conf/adapters/grok.json +60 -0
- package/conf/adapters/hapi/agy.json +52 -0
- package/conf/adapters/hapi/claude.json +5 -0
- package/conf/adapters/hapi/codex.json +7 -2
- package/conf/adapters/hapi/glm.json +5 -0
- package/dist/activity-journal.d.ts +42 -0
- package/dist/activity-journal.js +381 -0
- package/dist/activity-journal.js.map +1 -0
- package/dist/allowed-roots.d.ts +41 -0
- package/dist/allowed-roots.js +125 -3
- package/dist/allowed-roots.js.map +1 -1
- package/dist/codex/activity-session-log.d.ts +14 -0
- package/dist/codex/activity-session-log.js +206 -0
- package/dist/codex/activity-session-log.js.map +1 -0
- package/dist/codex/agent-tools.d.ts +23 -0
- package/dist/codex/agent-tools.js +1270 -0
- package/dist/codex/agent-tools.js.map +1 -0
- package/dist/codex/app-server-client.d.ts +76 -0
- package/dist/codex/app-server-client.js +582 -0
- package/dist/codex/app-server-client.js.map +1 -0
- package/dist/codex/app-server-registry.d.ts +389 -0
- package/dist/codex/app-server-registry.js +1407 -0
- package/dist/codex/app-server-registry.js.map +1 -0
- package/dist/codex/client-types.d.ts +109 -0
- package/dist/codex/client-types.js +2 -0
- package/dist/codex/client-types.js.map +1 -0
- package/dist/codex/protocol.d.ts +5375 -0
- package/dist/codex/protocol.js +614 -0
- package/dist/codex/protocol.js.map +1 -0
- package/dist/codex/session.d.ts +263 -0
- package/dist/codex/session.js +466 -0
- package/dist/codex/session.js.map +1 -0
- package/dist/config.d.ts +185 -19
- package/dist/config.js +82 -16
- package/dist/config.js.map +1 -1
- package/dist/context-builder/anchors.d.ts +1 -0
- package/dist/context-builder/anchors.js +3 -0
- package/dist/context-builder/anchors.js.map +1 -1
- package/dist/context-builder/bundle.d.ts +35 -2
- package/dist/context-builder/bundle.js +342 -2417
- package/dist/context-builder/bundle.js.map +1 -1
- package/dist/context-builder/codemap.d.ts +5 -0
- package/dist/context-builder/codemap.js +387 -13
- package/dist/context-builder/codemap.js.map +1 -1
- package/dist/context-builder/config.d.ts +1 -0
- package/dist/context-builder/config.js +12 -0
- package/dist/context-builder/config.js.map +1 -1
- package/dist/context-builder/context-run-catalog.d.ts +17 -0
- package/dist/context-builder/context-run-catalog.js +99 -0
- package/dist/context-builder/context-run-catalog.js.map +1 -0
- package/dist/context-builder/delegate-packet.d.ts +37 -0
- package/dist/context-builder/delegate-packet.js +359 -67
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +10 -1
- package/dist/context-builder/delegate-validation.js +153 -41
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/delegate.d.ts +2 -0
- package/dist/context-builder/delegate.js +1 -0
- package/dist/context-builder/delegate.js.map +1 -1
- package/dist/context-builder/diagnostics.d.ts +11 -2
- package/dist/context-builder/diagnostics.js +39 -6
- package/dist/context-builder/diagnostics.js.map +1 -1
- package/dist/context-builder/discovery.d.ts +29 -1
- package/dist/context-builder/discovery.js +475 -175
- package/dist/context-builder/discovery.js.map +1 -1
- package/dist/context-builder/globs.js +10 -10
- package/dist/context-builder/globs.js.map +1 -1
- package/dist/context-builder/handler.d.ts +26 -2
- package/dist/context-builder/handler.js +1158 -2416
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/lifecycle-contract.d.ts +424 -0
- package/dist/context-builder/lifecycle-contract.js +523 -0
- package/dist/context-builder/lifecycle-contract.js.map +1 -0
- package/dist/context-builder/lifecycle-journal.d.ts +62 -0
- package/dist/context-builder/lifecycle-journal.js +88 -0
- package/dist/context-builder/lifecycle-journal.js.map +1 -0
- package/dist/context-builder/lifecycle-observer.d.ts +102 -0
- package/dist/context-builder/lifecycle-observer.js +258 -0
- package/dist/context-builder/lifecycle-observer.js.map +1 -0
- package/dist/context-builder/lifecycle-reconcile.d.ts +32 -0
- package/dist/context-builder/lifecycle-reconcile.js +191 -0
- package/dist/context-builder/lifecycle-reconcile.js.map +1 -0
- package/dist/context-builder/lifecycle-recovery.d.ts +2 -0
- package/dist/context-builder/lifecycle-recovery.js +14 -0
- package/dist/context-builder/lifecycle-recovery.js.map +1 -0
- package/dist/context-builder/path-signals.js +9 -5
- package/dist/context-builder/path-signals.js.map +1 -1
- package/dist/context-builder/progress.d.ts +3 -1
- package/dist/context-builder/progress.js +23 -0
- package/dist/context-builder/progress.js.map +1 -1
- package/dist/context-builder/receipt.d.ts +6 -4
- package/dist/context-builder/receipt.js +12 -1
- package/dist/context-builder/receipt.js.map +1 -1
- package/dist/context-builder/refine-handler.d.ts +14 -0
- package/dist/context-builder/refine-handler.js +790 -0
- package/dist/context-builder/refine-handler.js.map +1 -0
- package/dist/context-builder/review-coverage.d.ts +84 -0
- package/dist/context-builder/review-coverage.js +437 -0
- package/dist/context-builder/review-coverage.js.map +1 -0
- package/dist/context-builder/schema.d.ts +239 -1
- package/dist/context-builder/schema.js +112 -6
- package/dist/context-builder/schema.js.map +1 -1
- package/dist/context-builder/secrets.d.ts +28 -0
- package/dist/context-builder/secrets.js +1473 -44
- package/dist/context-builder/secrets.js.map +1 -1
- package/dist/context-builder/selection.d.ts +7 -3
- package/dist/context-builder/selection.js +200 -738
- package/dist/context-builder/selection.js.map +1 -1
- package/dist/context-builder/session-log-identity.d.ts +1 -0
- package/dist/context-builder/session-log-identity.js +66 -0
- package/dist/context-builder/session-log-identity.js.map +1 -0
- package/dist/context-builder/slice-range-math.d.ts +16 -0
- package/dist/context-builder/slice-range-math.js +137 -0
- package/dist/context-builder/slice-range-math.js.map +1 -0
- package/dist/context-builder/status.d.ts +22 -1
- package/dist/context-builder/status.js +59 -4
- package/dist/context-builder/status.js.map +1 -1
- package/dist/context-builder/storage.d.ts +35 -2
- package/dist/context-builder/storage.js +271 -14
- package/dist/context-builder/storage.js.map +1 -1
- package/dist/context-builder/token-estimate.d.ts +13 -2
- package/dist/context-builder/token-estimate.js +77 -4
- package/dist/context-builder/token-estimate.js.map +1 -1
- package/dist/context-builder/versions.d.ts +29 -0
- package/dist/context-builder/versions.js +30 -0
- package/dist/context-builder/versions.js.map +1 -0
- package/dist/context-builder/workflow-runner.d.ts +69 -0
- package/dist/context-builder/workflow-runner.js +1051 -0
- package/dist/context-builder/workflow-runner.js.map +1 -0
- package/dist/context-builder/write-watchdog.d.ts +14 -0
- package/dist/context-builder/write-watchdog.js +38 -0
- package/dist/context-builder/write-watchdog.js.map +1 -0
- package/dist/dashboard-adapter-catalog.d.ts +9 -0
- package/dist/dashboard-adapter-catalog.js +46 -0
- package/dist/dashboard-adapter-catalog.js.map +1 -0
- package/dist/dashboard-cli.d.ts +79 -0
- package/dist/dashboard-cli.js +585 -0
- package/dist/dashboard-cli.js.map +1 -0
- package/dist/dashboard-companion/client.d.ts +36 -0
- package/dist/dashboard-companion/client.js +210 -0
- package/dist/dashboard-companion/client.js.map +1 -0
- package/dist/dashboard-companion/config.d.ts +8 -0
- package/dist/dashboard-companion/config.js +52 -0
- package/dist/dashboard-companion/config.js.map +1 -0
- package/dist/dashboard-companion/http-proxy.d.ts +10 -0
- package/dist/dashboard-companion/http-proxy.js +234 -0
- package/dist/dashboard-companion/http-proxy.js.map +1 -0
- package/dist/dashboard-companion/protocol.d.ts +80 -0
- package/dist/dashboard-companion/protocol.js +455 -0
- package/dist/dashboard-companion/protocol.js.map +1 -0
- package/dist/dashboard-companion/standalone-assets.d.ts +12 -0
- package/dist/dashboard-companion/standalone-assets.js +72 -0
- package/dist/dashboard-companion/standalone-assets.js.map +1 -0
- package/dist/dashboard-companion/standalone-entry.d.ts +1 -0
- package/dist/dashboard-companion/standalone-entry.js +17 -0
- package/dist/dashboard-companion/standalone-entry.js.map +1 -0
- package/dist/dashboard-gateway/config.d.ts +9 -0
- package/dist/dashboard-gateway/config.js +44 -0
- package/dist/dashboard-gateway/config.js.map +1 -0
- package/dist/dashboard-gateway/index.d.ts +11 -0
- package/dist/dashboard-gateway/index.js +755 -0
- package/dist/dashboard-gateway/index.js.map +1 -0
- package/dist/dashboard-gateway/main.d.ts +1 -0
- package/dist/dashboard-gateway/main.js +25 -0
- package/dist/dashboard-gateway/main.js.map +1 -0
- package/dist/dashboard-pairing-token.d.ts +1 -0
- package/dist/dashboard-pairing-token.js +5 -0
- package/dist/dashboard-pairing-token.js.map +1 -0
- package/dist/elaris/client.d.ts +73 -0
- package/dist/elaris/client.js +825 -0
- package/dist/elaris/client.js.map +1 -0
- package/dist/elaris/config.d.ts +18 -0
- package/dist/elaris/config.js +75 -0
- package/dist/elaris/config.js.map +1 -0
- package/dist/elaris/errors.d.ts +41 -0
- package/dist/elaris/errors.js +205 -0
- package/dist/elaris/errors.js.map +1 -0
- package/dist/elaris/github-repo.d.ts +18 -0
- package/dist/elaris/github-repo.js +89 -0
- package/dist/elaris/github-repo.js.map +1 -0
- package/dist/elaris/index.d.ts +10 -0
- package/dist/elaris/index.js +11 -0
- package/dist/elaris/index.js.map +1 -0
- package/dist/elaris/redact.d.ts +89 -0
- package/dist/elaris/redact.js +423 -0
- package/dist/elaris/redact.js.map +1 -0
- package/dist/elaris/run-id.d.ts +5 -0
- package/dist/elaris/run-id.js +20 -0
- package/dist/elaris/run-id.js.map +1 -0
- package/dist/elaris/status.d.ts +45 -0
- package/dist/elaris/status.js +122 -0
- package/dist/elaris/status.js.map +1 -0
- package/dist/elaris/tool-schemas.d.ts +314 -0
- package/dist/elaris/tool-schemas.js +208 -0
- package/dist/elaris/tool-schemas.js.map +1 -0
- package/dist/elaris/tools.d.ts +73 -0
- package/dist/elaris/tools.js +1065 -0
- package/dist/elaris/tools.js.map +1 -0
- package/dist/elaris/types.d.ts +1541 -0
- package/dist/elaris/types.js +252 -0
- package/dist/elaris/types.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.js +19 -0
- package/dist/errors.js.map +1 -1
- package/dist/handler.d.ts +4 -0
- package/dist/handler.js +10 -1
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/local-clink-backend.d.ts +3 -0
- package/dist/local-clink-backend.js +4 -0
- package/dist/local-clink-backend.js.map +1 -1
- package/dist/package-info.d.ts +2 -0
- package/dist/package-info.js +18 -0
- package/dist/package-info.js.map +1 -0
- package/dist/parsers/codex-jsonl.js +48 -3
- package/dist/parsers/codex-jsonl.js.map +1 -1
- package/dist/parsers/extract.d.ts +10 -1
- package/dist/parsers/extract.js +11 -3
- package/dist/parsers/extract.js.map +1 -1
- package/dist/pipeline.d.ts +4 -0
- package/dist/pipeline.js +129 -8
- package/dist/pipeline.js.map +1 -1
- package/dist/run-dir.d.ts +24 -0
- package/dist/run-dir.js +201 -2
- package/dist/run-dir.js.map +1 -1
- package/dist/runner.d.ts +13 -0
- package/dist/runner.js +184 -15
- package/dist/runner.js.map +1 -1
- package/dist/safety.d.ts +4 -4
- package/dist/safety.js +4 -4
- package/dist/schema.d.ts +7 -7
- package/dist/server.d.ts +1 -0
- package/dist/server.js +359 -17
- package/dist/server.js.map +1 -1
- package/dist/session-log-stream.d.ts +18 -0
- package/dist/session-log-stream.js +319 -0
- package/dist/session-log-stream.js.map +1 -0
- package/package.json +46 -5
- package/conf/adapters/gemini.json +0 -44
- package/conf/adapters/hapi/gemini.json +0 -47
- package/dist/parsers/gemini-json.d.ts +0 -2
- package/dist/parsers/gemini-json.js +0 -72
- package/dist/parsers/gemini-json.js.map +0 -1
|
@@ -3,7 +3,18 @@ import { buildFileCodemap } from "./codemap.js";
|
|
|
3
3
|
import { directoryDistance, genericPathKind, isTestPath, normalizedPathStem, } from "./path-signals.js";
|
|
4
4
|
import { estimateContextBuilderTokensFromUtf8Bytes } from "./token-estimate.js";
|
|
5
5
|
export function selectContextBuilderFinalContext(input) {
|
|
6
|
-
const
|
|
6
|
+
const rankedPending = buildPendingSelections(input.slices, input.search, input.task ?? "", input.budget);
|
|
7
|
+
const obligationRanges = input.coverage_policy?.id === "review_deep_v1"
|
|
8
|
+
? buildObligationRangeIndex(input.review_obligations)
|
|
9
|
+
: new Map();
|
|
10
|
+
const pending = reserveRequiredCoverageCandidates({
|
|
11
|
+
pending: rankedPending,
|
|
12
|
+
budget: input.budget,
|
|
13
|
+
policy: input.coverage_policy,
|
|
14
|
+
evidenceClassesByCandidate: input.evidence_classes_by_candidate,
|
|
15
|
+
obligations: input.review_obligations,
|
|
16
|
+
obligationRanges,
|
|
17
|
+
});
|
|
7
18
|
const selected = [];
|
|
8
19
|
const omissions = [];
|
|
9
20
|
const summaryFiles = [];
|
|
@@ -12,16 +23,6 @@ export function selectContextBuilderFinalContext(input) {
|
|
|
12
23
|
for (const item of pending) {
|
|
13
24
|
const root_index = item.root_index;
|
|
14
25
|
const paths = [item.path];
|
|
15
|
-
if (shouldOmitTaskSpecificNoise(item)) {
|
|
16
|
-
omissions.push({
|
|
17
|
-
root_index,
|
|
18
|
-
reason: "noisy_file",
|
|
19
|
-
message: "Selected context omitted low-value task-specific noise",
|
|
20
|
-
paths,
|
|
21
|
-
});
|
|
22
|
-
summaryFiles.push(selectionSummaryFile(item, "omitted", "noisy_file"));
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
26
|
if (selected.length >= input.budget.max_files) {
|
|
26
27
|
omissions.push({
|
|
27
28
|
root_index,
|
|
@@ -32,10 +33,7 @@ export function selectContextBuilderFinalContext(input) {
|
|
|
32
33
|
summaryFiles.push(selectionSummaryFile(item, "omitted", "max_files"));
|
|
33
34
|
continue;
|
|
34
35
|
}
|
|
35
|
-
const selectedItem = budgetedSelectionForItem(item, input.budget, {
|
|
36
|
-
totalBytes,
|
|
37
|
-
totalTokens,
|
|
38
|
-
});
|
|
36
|
+
const selectedItem = budgetedSelectionForItem(item, input.budget, { totalBytes, totalTokens }, obligationRanges.get(contextReviewCandidateId(item)));
|
|
39
37
|
if (selectedItem.kind === "omitted") {
|
|
40
38
|
omissions.push({
|
|
41
39
|
root_index,
|
|
@@ -54,6 +52,9 @@ export function selectContextBuilderFinalContext(input) {
|
|
|
54
52
|
bytes: selectedItem.file.bytes,
|
|
55
53
|
estimated_tokens: selectedItem.file.estimated_tokens,
|
|
56
54
|
source: selectedItem.file.source,
|
|
55
|
+
...(selectedItem.file.disposition == null
|
|
56
|
+
? {}
|
|
57
|
+
: { disposition: selectedItem.file.disposition }),
|
|
57
58
|
});
|
|
58
59
|
summaryFiles.push(selectionSummaryFile(selectedItem.file, selectedItem.tier, selectedItem.reason));
|
|
59
60
|
totalBytes += selectedItem.file.bytes;
|
|
@@ -77,9 +78,134 @@ export function selectContextBuilderFinalContext(input) {
|
|
|
77
78
|
},
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function reserveRequiredCoverageCandidates(input) {
|
|
82
|
+
const policy = input.policy;
|
|
83
|
+
if (policy?.id == null ||
|
|
84
|
+
policy.required_when_available.length === 0) {
|
|
85
|
+
return input.pending;
|
|
86
|
+
}
|
|
87
|
+
const reserved = [];
|
|
88
|
+
const reservedKeys = new Set();
|
|
89
|
+
const pendingByCandidateId = new Map();
|
|
90
|
+
for (const item of input.pending) {
|
|
91
|
+
const candidateId = contextReviewCandidateId(item);
|
|
92
|
+
if (!pendingByCandidateId.has(candidateId)) {
|
|
93
|
+
pendingByCandidateId.set(candidateId, item);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
let totalBytes = 0;
|
|
97
|
+
let totalTokens = 0;
|
|
98
|
+
const reserveCandidate = (candidateIds) => {
|
|
99
|
+
if (reserved.length >= input.budget.max_files) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
for (const candidateId of candidateIds) {
|
|
103
|
+
const item = pendingByCandidateId.get(candidateId);
|
|
104
|
+
if (item == null) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const key = pendingCandidateKey(item);
|
|
108
|
+
if (reservedKeys.has(key)) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
const budgeted = budgetedSelectionForItem(item, input.budget, { totalBytes, totalTokens }, input.obligationRanges.get(candidateId));
|
|
112
|
+
if (budgeted.kind === "omitted") {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
reserved.push(item);
|
|
116
|
+
reservedKeys.add(key);
|
|
117
|
+
totalBytes += budgeted.file.bytes;
|
|
118
|
+
totalTokens += budgeted.file.estimated_tokens;
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
};
|
|
123
|
+
if (input.obligations != null) {
|
|
124
|
+
for (const target of input.obligations.targets) {
|
|
125
|
+
reserveCandidate([target.candidate_id]);
|
|
126
|
+
if (target.regression_links.length > 0) {
|
|
127
|
+
reserveCandidate(target.regression_links.map((link) => link.candidate_id));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else if (input.evidenceClassesByCandidate != null) {
|
|
132
|
+
const evidenceClassesByCandidate = input.evidenceClassesByCandidate;
|
|
133
|
+
for (const evidenceClass of policy.required_when_available) {
|
|
134
|
+
if (reserved.some((item) => evidenceClassesForPending(item, evidenceClassesByCandidate).includes(evidenceClass))) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (reserved.length >= input.budget.max_files) {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
for (const item of input.pending) {
|
|
141
|
+
const key = pendingCandidateKey(item);
|
|
142
|
+
if (reservedKeys.has(key) ||
|
|
143
|
+
!evidenceClassesForPending(item, evidenceClassesByCandidate).includes(evidenceClass)) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const budgeted = budgetedSelectionForItem(item, input.budget, {
|
|
147
|
+
totalBytes,
|
|
148
|
+
totalTokens,
|
|
149
|
+
});
|
|
150
|
+
if (budgeted.kind === "omitted") {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
reserved.push(item);
|
|
154
|
+
reservedKeys.add(key);
|
|
155
|
+
totalBytes += budgeted.file.bytes;
|
|
156
|
+
totalTokens += budgeted.file.estimated_tokens;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (reserved.length === 0) {
|
|
162
|
+
return input.pending;
|
|
163
|
+
}
|
|
164
|
+
return [
|
|
165
|
+
...reserved,
|
|
166
|
+
...input.pending.filter((item) => !reservedKeys.has(pendingCandidateKey(item))),
|
|
167
|
+
];
|
|
168
|
+
}
|
|
169
|
+
function evidenceClassesForPending(item, byCandidate) {
|
|
170
|
+
return byCandidate.get(pendingCandidateKey(item)) ?? [];
|
|
171
|
+
}
|
|
172
|
+
function pendingCandidateKey(item) {
|
|
173
|
+
return `${item.root_index}\u0000${item.path}`;
|
|
174
|
+
}
|
|
175
|
+
function contextReviewCandidateId(item) {
|
|
176
|
+
return `c:${String(item.root_index)}:${item.path}`;
|
|
177
|
+
}
|
|
178
|
+
function buildObligationRangeIndex(obligations) {
|
|
179
|
+
const ranges = new Map();
|
|
180
|
+
for (const target of obligations?.targets ?? []) {
|
|
181
|
+
appendObligationRanges(ranges, target.candidate_id, target.ranges);
|
|
182
|
+
for (const link of target.regression_links) {
|
|
183
|
+
appendObligationRanges(ranges, link.candidate_id, link.ranges);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return ranges;
|
|
187
|
+
}
|
|
188
|
+
function appendObligationRanges(index, candidateId, ranges) {
|
|
189
|
+
index.set(candidateId, mergeLineRanges([...(index.get(candidateId) ?? []), ...ranges]));
|
|
190
|
+
}
|
|
191
|
+
function budgetedSelectionForItem(item, budget, totals, preferredRanges) {
|
|
81
192
|
const full = selectedFileFromPending(item);
|
|
82
|
-
|
|
193
|
+
const obligationSelection = preferredRanges == null
|
|
194
|
+
? null
|
|
195
|
+
: budgetFittingSelectionForRanges(item, preferredRanges, budget, totals);
|
|
196
|
+
if (obligationSelection != null) {
|
|
197
|
+
return {
|
|
198
|
+
kind: "selected",
|
|
199
|
+
file: obligationSelection,
|
|
200
|
+
tier: obligationSelection.bytes === full.bytes
|
|
201
|
+
? "full_file"
|
|
202
|
+
: "signature_slices",
|
|
203
|
+
...(obligationSelection.bytes === full.bytes
|
|
204
|
+
? {}
|
|
205
|
+
: { reason: "review_coverage_obligation" }),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
if (shouldPreferSignatureSlicesForLargeFocus(item, full, budget)) {
|
|
83
209
|
const degraded = compactLargeFocusSelection(item) ?? signatureSliceSelection(item);
|
|
84
210
|
if (degraded != null &&
|
|
85
211
|
degraded.bytes < full.bytes &&
|
|
@@ -99,8 +225,7 @@ function budgetedSelectionForItem(item, budget, totals) {
|
|
|
99
225
|
tier: "full_file",
|
|
100
226
|
};
|
|
101
227
|
}
|
|
102
|
-
const
|
|
103
|
-
const degraded = item.source === "focus" && (!item.has_search_evidence || hasTaskCriticalWindows)
|
|
228
|
+
const degraded = item.source === "focus" && !item.has_search_evidence
|
|
104
229
|
? compactLargeFocusSelection(item) ?? signatureSliceSelection(item)
|
|
105
230
|
: signatureSliceSelection(item);
|
|
106
231
|
if (degraded != null && fitsBudget(degraded, budget, totals)) {
|
|
@@ -118,6 +243,49 @@ function budgetedSelectionForItem(item, budget, totals) {
|
|
|
118
243
|
message: budgetOmissionMessage(reason),
|
|
119
244
|
};
|
|
120
245
|
}
|
|
246
|
+
function budgetFittingSelectionForRanges(item, requestedRanges, budget, totals) {
|
|
247
|
+
let best = null;
|
|
248
|
+
const admitted = [];
|
|
249
|
+
for (const range of [...requestedRanges].sort((left, right) => left.start_line - right.start_line || left.end_line - right.end_line)) {
|
|
250
|
+
const candidate = selectionForRanges(item, [...admitted, range]);
|
|
251
|
+
if (candidate == null || !fitsBudget(candidate, budget, totals)) {
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
admitted.push(range);
|
|
255
|
+
best = candidate;
|
|
256
|
+
}
|
|
257
|
+
return best;
|
|
258
|
+
}
|
|
259
|
+
function selectionForRanges(item, requestedRanges) {
|
|
260
|
+
const renderedLineNumbers = renderedContentLineNumbers(item.ranges);
|
|
261
|
+
const lines = splitTextLines(item.content);
|
|
262
|
+
const linesByOriginalLine = linesByOriginalLineNumber(lines, renderedLineNumbers);
|
|
263
|
+
const selectedLines = new Set();
|
|
264
|
+
for (const requested of requestedRanges) {
|
|
265
|
+
for (let line = requested.start_line; line <= requested.end_line; line++) {
|
|
266
|
+
if (linesByOriginalLine.has(line)) {
|
|
267
|
+
selectedLines.add(line);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (selectedLines.size === 0) {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
const ranges = mergeLineRanges([...selectedLines].map((line) => ({ start_line: line, end_line: line })));
|
|
275
|
+
const content = ranges
|
|
276
|
+
.flatMap((range) => linesForOriginalRange(range, linesByOriginalLine))
|
|
277
|
+
.join("\n");
|
|
278
|
+
const bytes = Buffer.byteLength(content, "utf8");
|
|
279
|
+
return {
|
|
280
|
+
root_index: item.root_index,
|
|
281
|
+
path: item.path,
|
|
282
|
+
ranges,
|
|
283
|
+
content,
|
|
284
|
+
bytes,
|
|
285
|
+
estimated_tokens: estimateContextBuilderTokensFromUtf8Bytes(bytes),
|
|
286
|
+
source: item.source,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
121
289
|
const LARGE_FOCUS_OUTLINE_HEAD_LINES = 80;
|
|
122
290
|
const LARGE_FOCUS_OUTLINE_SYMBOL_LINES = 12;
|
|
123
291
|
const LARGE_FOCUS_RELEVANT_SYMBOL_LINES = 96;
|
|
@@ -136,19 +304,15 @@ function compactLargeFocusSelection(item) {
|
|
|
136
304
|
if (codemap.symbols.length === 0) {
|
|
137
305
|
return null;
|
|
138
306
|
}
|
|
139
|
-
const
|
|
140
|
-
const maxLines = Math.max(taskCriticalCompactMaxLines(item.path, item.task_tokens), isTestPath(item.path)
|
|
307
|
+
const maxLines = isTestPath(item.path)
|
|
141
308
|
? LARGE_TEST_OUTLINE_MAX_LINES
|
|
142
|
-
: LARGE_FOCUS_OUTLINE_MAX_LINES
|
|
309
|
+
: LARGE_FOCUS_OUTLINE_MAX_LINES;
|
|
143
310
|
const selectedLineNumbers = new Set();
|
|
144
311
|
const lines = splitTextLines(item.content);
|
|
145
312
|
const relevanceTokens = combinedRelevanceTokens(item);
|
|
146
313
|
const relevantWindows = relevanceTokens.size > 0
|
|
147
314
|
? relevantSymbolWindows(codemap.symbols, lines, relevanceTokens)
|
|
148
315
|
: [];
|
|
149
|
-
for (const window of taskCriticalWindows) {
|
|
150
|
-
addRenderedContentLineWindow(selectedLineNumbers, renderedLineNumbers, window.start_line, window.end_line, maxLines);
|
|
151
|
-
}
|
|
152
316
|
addRenderedContentLineWindow(selectedLineNumbers, renderedLineNumbers, 1, LARGE_FOCUS_OUTLINE_HEAD_LINES, maxLines);
|
|
153
317
|
for (const window of relevantWindows) {
|
|
154
318
|
if (selectedLineNumbers.size >= maxLines) {
|
|
@@ -193,137 +357,6 @@ function compactLargeFocusSelection(item) {
|
|
|
193
357
|
source: item.source,
|
|
194
358
|
};
|
|
195
359
|
}
|
|
196
|
-
function taskCriticalCompactWindows(path, taskTokens) {
|
|
197
|
-
const normalized = path.toLowerCase();
|
|
198
|
-
if (isRuntimeSettingsDiscoveryTask(taskTokens)) {
|
|
199
|
-
if (normalized.endsWith("/components/chat/message-input/input.tsx")) {
|
|
200
|
-
return [
|
|
201
|
-
{ start_line: 430, end_line: 650 },
|
|
202
|
-
{ start_line: 880, end_line: 1060 },
|
|
203
|
-
];
|
|
204
|
-
}
|
|
205
|
-
if (normalized.endsWith("/api/endpoints/chat.py")) {
|
|
206
|
-
return [
|
|
207
|
-
{ start_line: 360, end_line: 460 },
|
|
208
|
-
{ start_line: 529, end_line: 560 },
|
|
209
|
-
{ start_line: 945, end_line: 980 },
|
|
210
|
-
{ start_line: 1299, end_line: 1383 },
|
|
211
|
-
];
|
|
212
|
-
}
|
|
213
|
-
if (normalized.endsWith("/tasks/chat_processor.py")) {
|
|
214
|
-
return [{ start_line: 1, end_line: 197 }];
|
|
215
|
-
}
|
|
216
|
-
if (normalized.endsWith("/tests/services/test_pending_initial_prompt_service.py")) {
|
|
217
|
-
return [
|
|
218
|
-
{ start_line: 107, end_line: 132 },
|
|
219
|
-
{ start_line: 137, end_line: 198 },
|
|
220
|
-
{ start_line: 977, end_line: 1018 },
|
|
221
|
-
{ start_line: 1086, end_line: 1128 },
|
|
222
|
-
{ start_line: 1150, end_line: 1225 },
|
|
223
|
-
];
|
|
224
|
-
}
|
|
225
|
-
if (normalized.endsWith("/tests/test_queue.py")) {
|
|
226
|
-
return [
|
|
227
|
-
{ start_line: 66, end_line: 113 },
|
|
228
|
-
{ start_line: 117, end_line: 226 },
|
|
229
|
-
{ start_line: 252, end_line: 321 },
|
|
230
|
-
{ start_line: 350, end_line: 391 },
|
|
231
|
-
];
|
|
232
|
-
}
|
|
233
|
-
if (normalized.endsWith("/tests/test_chat.py")) {
|
|
234
|
-
return [
|
|
235
|
-
{ start_line: 320, end_line: 416 },
|
|
236
|
-
{ start_line: 728, end_line: 758 },
|
|
237
|
-
];
|
|
238
|
-
}
|
|
239
|
-
if (normalized.endsWith("/services/streamservice.ts")) {
|
|
240
|
-
return [{ start_line: 1, end_line: 260 }];
|
|
241
|
-
}
|
|
242
|
-
if (normalized.endsWith("/components/chat/thinking-mode-selector/thinkingmodeselector.tsx") ||
|
|
243
|
-
normalized.endsWith("/components/chat/message-input/thinkingmodeselector.tsx")) {
|
|
244
|
-
return [{ start_line: 16, end_line: 83 }];
|
|
245
|
-
}
|
|
246
|
-
if (normalized.endsWith("/components/chat/permission-mode-selector/permissionmodeselector.tsx")) {
|
|
247
|
-
return [{ start_line: 1, end_line: 120 }];
|
|
248
|
-
}
|
|
249
|
-
if (normalized.endsWith("/components/chat/model-selector/modelselector.tsx")) {
|
|
250
|
-
return [{ start_line: 1, end_line: 160 }];
|
|
251
|
-
}
|
|
252
|
-
if (normalized.endsWith("/hooks/queries/usemodelqueries.ts")) {
|
|
253
|
-
return [{ start_line: 1, end_line: 160 }];
|
|
254
|
-
}
|
|
255
|
-
if (normalized.endsWith("/utils/modelprovider.ts")) {
|
|
256
|
-
return [{ start_line: 1, end_line: 160 }];
|
|
257
|
-
}
|
|
258
|
-
if (normalized.endsWith("/services/queue.py")) {
|
|
259
|
-
return [{ start_line: 1, end_line: 220 }];
|
|
260
|
-
}
|
|
261
|
-
if (normalized.endsWith("/models/schemas/effort.py") ||
|
|
262
|
-
normalized.endsWith("/models/schemas/permission_mode.py")) {
|
|
263
|
-
return [{ start_line: 1, end_line: 160 }];
|
|
264
|
-
}
|
|
265
|
-
if (normalized.endsWith("/services/runtime/resolver.py")) {
|
|
266
|
-
return [{ start_line: 16, end_line: 45 }];
|
|
267
|
-
}
|
|
268
|
-
if (normalized.endsWith("/services/model_provider_auth.py")) {
|
|
269
|
-
return [{ start_line: 42, end_line: 95 }];
|
|
270
|
-
}
|
|
271
|
-
if (normalized.endsWith("/services/claude_agent.py")) {
|
|
272
|
-
return [
|
|
273
|
-
{ start_line: 56, end_line: 75 },
|
|
274
|
-
{ start_line: 829, end_line: 872 },
|
|
275
|
-
];
|
|
276
|
-
}
|
|
277
|
-
if (normalized.endsWith("/api/endpoints/ai_models.py") ||
|
|
278
|
-
normalized.endsWith("/models/db_models/ai_model.py")) {
|
|
279
|
-
return [{ start_line: 1, end_line: 120 }];
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (isCodexRuntimeReviewTask(taskTokens)) {
|
|
283
|
-
if (normalized.endsWith("/components/chat/message-input/input.tsx")) {
|
|
284
|
-
return [
|
|
285
|
-
{ start_line: 1, end_line: 260 },
|
|
286
|
-
{ start_line: 430, end_line: 650 },
|
|
287
|
-
{ start_line: 880, end_line: 1060 },
|
|
288
|
-
];
|
|
289
|
-
}
|
|
290
|
-
if (normalized.endsWith("/components/chat/message-input/thinkingmodeselector.tsx") ||
|
|
291
|
-
normalized.endsWith("/models/db_models/ai_model.py") ||
|
|
292
|
-
normalized.endsWith("/api/endpoints/ai_models.py")) {
|
|
293
|
-
return [{ start_line: 1, end_line: 260 }];
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
if (isDevtoolsTraceDebugTask(taskTokens)) {
|
|
297
|
-
if (normalized.endsWith("/components/right-panel/rightpaneldevtools.tsx")) {
|
|
298
|
-
return [
|
|
299
|
-
{ start_line: 1, end_line: 160 },
|
|
300
|
-
{ start_line: 520, end_line: 760 },
|
|
301
|
-
{ start_line: 840, end_line: 980 },
|
|
302
|
-
];
|
|
303
|
-
}
|
|
304
|
-
if (normalized.endsWith("/components/chat/chat-window/chat.tsx")) {
|
|
305
|
-
return [{ start_line: 430, end_line: 760 }];
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
return [];
|
|
309
|
-
}
|
|
310
|
-
function taskCriticalCompactMaxLines(path, taskTokens) {
|
|
311
|
-
const normalized = path.toLowerCase();
|
|
312
|
-
if ((isRuntimeSettingsDiscoveryTask(taskTokens) ||
|
|
313
|
-
isCodexRuntimeReviewTask(taskTokens)) &&
|
|
314
|
-
normalized.endsWith("/components/chat/message-input/input.tsx")) {
|
|
315
|
-
return 640;
|
|
316
|
-
}
|
|
317
|
-
if (isDevtoolsTraceDebugTask(taskTokens) &&
|
|
318
|
-
normalized.endsWith("/components/right-panel/rightpaneldevtools.tsx")) {
|
|
319
|
-
return 640;
|
|
320
|
-
}
|
|
321
|
-
if (isDevtoolsTraceDebugTask(taskTokens) &&
|
|
322
|
-
normalized.endsWith("/components/chat/chat-window/chat.tsx")) {
|
|
323
|
-
return 420;
|
|
324
|
-
}
|
|
325
|
-
return 0;
|
|
326
|
-
}
|
|
327
360
|
function combinedRelevanceTokens(item) {
|
|
328
361
|
if (item.task_tokens.size === 0 && item.search_term_tokens.size === 0) {
|
|
329
362
|
return new Set();
|
|
@@ -544,16 +577,13 @@ function buildPendingSelections(slices, search, task, budget) {
|
|
|
544
577
|
const hasSearchEvidence = records.some((slice) => slice.source === "search");
|
|
545
578
|
const focusRecords = records.filter((slice) => slice.source === "focus");
|
|
546
579
|
const searchRecords = records.filter((slice) => slice.source === "search");
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
const rawEvidenceRecords = forceFullFocus ||
|
|
550
|
-
(focusRecords.length > 0 &&
|
|
551
|
-
shouldPreferFullFocusEvidence(focusRecords, budget))
|
|
580
|
+
const rawEvidenceRecords = (focusRecords.length > 0 &&
|
|
581
|
+
shouldPreferFullFocusEvidence(focusRecords, budget))
|
|
552
582
|
? focusRecords
|
|
553
583
|
: hasSearchEvidence
|
|
554
584
|
? searchRecords
|
|
555
585
|
: records;
|
|
556
|
-
const evidenceRecords =
|
|
586
|
+
const evidenceRecords = rawEvidenceRecords;
|
|
557
587
|
if (evidenceRecords.length === 0) {
|
|
558
588
|
continue;
|
|
559
589
|
}
|
|
@@ -584,63 +614,14 @@ function buildPendingSelections(slices, search, task, budget) {
|
|
|
584
614
|
search_hit_density_rank: searchHitDensityRank(searchHitCounts.get(`${first.root_index}\u0000${first.path}`) ?? 0),
|
|
585
615
|
name_overlap_rank: nameOverlapRank(first.path, taskTokens),
|
|
586
616
|
adjacency_rank: adjacencyRanks.get(`${first.root_index}\u0000${first.path}`) ?? 0,
|
|
587
|
-
central_focus_rank: protectedFocus ? -1 : 0,
|
|
588
|
-
task_closure_rank: taskClosureRank(first.path, bytes, task),
|
|
589
617
|
small_closure_rank: smallClosureRank(first.path, bytes, contentTokens, taskTokens, searchTermTokens),
|
|
590
618
|
has_search_evidence: hasSearchEvidence,
|
|
591
|
-
force_full_focus: forceFullFocus,
|
|
592
619
|
task_tokens: taskTokens,
|
|
593
620
|
search_term_tokens: searchTermTokens,
|
|
594
621
|
});
|
|
595
622
|
}
|
|
596
623
|
return pending.sort(comparePendingSelections);
|
|
597
624
|
}
|
|
598
|
-
function mergeTaskCriticalFocusRecords(rawEvidenceRecords, focusRecords, path, taskTokens) {
|
|
599
|
-
if (focusRecords.length === 0) {
|
|
600
|
-
return [...rawEvidenceRecords];
|
|
601
|
-
}
|
|
602
|
-
const criticalRecords = taskCriticalFocusRecords(path, taskTokens, focusRecords);
|
|
603
|
-
if (criticalRecords.length === 0) {
|
|
604
|
-
return [...rawEvidenceRecords];
|
|
605
|
-
}
|
|
606
|
-
const seen = new Set();
|
|
607
|
-
const merged = [];
|
|
608
|
-
for (const record of [...rawEvidenceRecords, ...criticalRecords]) {
|
|
609
|
-
const key = `${record.root_index}\u0000${record.path}\u0000${record.start_line}\u0000${record.end_line}\u0000${record.source}`;
|
|
610
|
-
if (seen.has(key)) {
|
|
611
|
-
continue;
|
|
612
|
-
}
|
|
613
|
-
seen.add(key);
|
|
614
|
-
merged.push(record);
|
|
615
|
-
}
|
|
616
|
-
return merged;
|
|
617
|
-
}
|
|
618
|
-
function taskCriticalFocusRecords(path, taskTokens, focusRecords) {
|
|
619
|
-
const windows = taskCriticalCompactWindows(path, taskTokens);
|
|
620
|
-
if (windows.length === 0) {
|
|
621
|
-
return [];
|
|
622
|
-
}
|
|
623
|
-
const criticalRecords = [];
|
|
624
|
-
for (const focusRecord of focusRecords) {
|
|
625
|
-
const lines = splitTextLines(focusRecord.content);
|
|
626
|
-
for (const window of windows) {
|
|
627
|
-
const startLine = Math.max(focusRecord.start_line, window.start_line);
|
|
628
|
-
const endLine = Math.min(focusRecord.end_line, window.end_line);
|
|
629
|
-
if (endLine < startLine) {
|
|
630
|
-
continue;
|
|
631
|
-
}
|
|
632
|
-
const startIndex = startLine - focusRecord.start_line;
|
|
633
|
-
const endIndex = endLine - focusRecord.start_line;
|
|
634
|
-
criticalRecords.push({
|
|
635
|
-
...focusRecord,
|
|
636
|
-
start_line: startLine,
|
|
637
|
-
end_line: endLine,
|
|
638
|
-
content: lines.slice(startIndex, endIndex + 1).join("\n"),
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
return criticalRecords;
|
|
643
|
-
}
|
|
644
625
|
function shouldPreferFullFocusEvidence(records, budget) {
|
|
645
626
|
const first = records[0];
|
|
646
627
|
if (first == null) {
|
|
@@ -650,19 +631,6 @@ function shouldPreferFullFocusEvidence(records, budget) {
|
|
|
650
631
|
return (bytes <= budget.max_bytes_per_file &&
|
|
651
632
|
estimatedTokens <= focusWholeFileTokenTarget(first.path, budget));
|
|
652
633
|
}
|
|
653
|
-
function shouldForceFullFocusEvidence(records, task, budget) {
|
|
654
|
-
if (records.length === 0 || !isPrimaryFocusIntentTask(task)) {
|
|
655
|
-
return false;
|
|
656
|
-
}
|
|
657
|
-
const first = records[0];
|
|
658
|
-
if (first == null || !isProtectedPrimaryFocusPath(first.path, task)) {
|
|
659
|
-
return false;
|
|
660
|
-
}
|
|
661
|
-
const { bytes, estimatedTokens } = fullEvidenceStats(records);
|
|
662
|
-
const wholeFileTarget = protectedFocusWholeFileTokenTarget(first.path, budget);
|
|
663
|
-
return (bytes <= budget.max_bytes_per_file &&
|
|
664
|
-
estimatedTokens <= wholeFileTarget);
|
|
665
|
-
}
|
|
666
634
|
function fullEvidenceStats(records) {
|
|
667
635
|
const sorted = [...records].sort(compareSlices);
|
|
668
636
|
const ranges = mergeLineRanges(sorted);
|
|
@@ -673,66 +641,11 @@ function fullEvidenceStats(records) {
|
|
|
673
641
|
estimatedTokens: estimateContextBuilderTokensFromUtf8Bytes(bytes),
|
|
674
642
|
};
|
|
675
643
|
}
|
|
676
|
-
function isPrimaryFocusIntentTask(task) {
|
|
677
|
-
return /\b(review|debug|debugging|diagnose|diagnosis|diagnostic|discover|discovery)\b/i.test(task);
|
|
678
|
-
}
|
|
679
|
-
function isProtectedPrimaryFocusPath(path, task) {
|
|
680
|
-
const normalizedTask = task.toLowerCase();
|
|
681
|
-
const normalizedPath = path.toLowerCase();
|
|
682
|
-
const basename = normalizedPath.split("/").at(-1) ?? normalizedPath;
|
|
683
|
-
if (/\b(discover|discovery)\b/.test(normalizedTask)) {
|
|
684
|
-
return (/\/api\/endpoints\/chat\.py$/.test(normalizedPath) ||
|
|
685
|
-
/\/services\/chat\.py$/.test(normalizedPath) ||
|
|
686
|
-
/\/services\/queue\.py$/.test(normalizedPath) ||
|
|
687
|
-
/\/services\/streaming\/orchestrator\.py$/.test(normalizedPath) ||
|
|
688
|
-
/\/services\/runtime\/codex\.py$/.test(normalizedPath) ||
|
|
689
|
-
/\/tasks\/chat_processor\.py$/.test(normalizedPath) ||
|
|
690
|
-
/\/tests\/test_chat\.py$/.test(normalizedPath) ||
|
|
691
|
-
/\/services\/queueservice\.ts$/.test(normalizedPath) ||
|
|
692
|
-
/\/store\/messagequeuestore\.ts$/.test(normalizedPath) ||
|
|
693
|
-
/\/store\/__tests__\/messagequeuestore\.test\.ts$/.test(normalizedPath) ||
|
|
694
|
-
/\/components\/chat\/chat-window\/chat\.tsx$/.test(normalizedPath) ||
|
|
695
|
-
/\/components\/chat\/message-input\/input\.tsx$/.test(normalizedPath) ||
|
|
696
|
-
/\/pages\/chatpage\.tsx$/.test(normalizedPath) ||
|
|
697
|
-
(basename === "chat.py" &&
|
|
698
|
-
normalizedPath.includes("/models/schemas/")) ||
|
|
699
|
-
(basename === "chat.py" &&
|
|
700
|
-
normalizedPath.includes("/models/db_models/")));
|
|
701
|
-
}
|
|
702
|
-
if (/\breview\b/.test(normalizedTask)) {
|
|
703
|
-
return (normalizedPath.includes("/services/runtime/") ||
|
|
704
|
-
normalizedPath.includes("/services/streaming/orchestrator.") ||
|
|
705
|
-
normalizedPath.includes("/tests/services/runtime/") ||
|
|
706
|
-
normalizedPath.endsWith("/test_runtime_session_service.py"));
|
|
707
|
-
}
|
|
708
|
-
if (/\b(debug|debugging|diagnose|diagnosis|diagnostic)\b/.test(normalizedTask)) {
|
|
709
|
-
return (basename === "rightpaneldevtools.tsx" ||
|
|
710
|
-
basename === "rightpanel.tsx" ||
|
|
711
|
-
basename === "devtools-helpers.ts" ||
|
|
712
|
-
normalizedPath.endsWith("/components/chat/chat-window/chat.tsx") ||
|
|
713
|
-
normalizedPath.includes("/right-panel/__tests__/") ||
|
|
714
|
-
normalizedPath.endsWith("/test_devtools_trace_archive.py"));
|
|
715
|
-
}
|
|
716
|
-
return false;
|
|
717
|
-
}
|
|
718
644
|
function focusWholeFileTokenTarget(path, budget) {
|
|
719
645
|
return isTestPath(path)
|
|
720
646
|
? Math.min(8_000, Math.floor(budget.target_estimated_tokens * 0.12))
|
|
721
647
|
: Math.min(12_000, Math.floor(budget.target_estimated_tokens * 0.18));
|
|
722
648
|
}
|
|
723
|
-
function protectedFocusWholeFileTokenTarget(path, budget) {
|
|
724
|
-
const normalized = path.toLowerCase();
|
|
725
|
-
if (normalized.endsWith("/rightpaneldevtools.tsx")) {
|
|
726
|
-
return Math.min(28_000, Math.floor(budget.target_estimated_tokens * 0.38));
|
|
727
|
-
}
|
|
728
|
-
if (normalized.endsWith("/components/chat/chat-window/chat.tsx")) {
|
|
729
|
-
return Math.min(18_000, Math.floor(budget.target_estimated_tokens * 0.26));
|
|
730
|
-
}
|
|
731
|
-
if (normalized.includes("/services/runtime/")) {
|
|
732
|
-
return Math.min(18_000, Math.floor(budget.target_estimated_tokens * 0.2));
|
|
733
|
-
}
|
|
734
|
-
return focusWholeFileTokenTarget(path, budget);
|
|
735
|
-
}
|
|
736
649
|
function taskSupportRank(path, normalizedTask, hasContentSupport) {
|
|
737
650
|
if (normalizedTask.length === 0) {
|
|
738
651
|
return 0;
|
|
@@ -784,10 +697,10 @@ function taskSupportRank(path, normalizedTask, hasContentSupport) {
|
|
|
784
697
|
}
|
|
785
698
|
function isGenericEndpointPath(path) {
|
|
786
699
|
// The endpoint/route/api intent boost targets implementation endpoint files.
|
|
787
|
-
// A test path that merely lives under an api/ directory
|
|
788
|
-
//
|
|
789
|
-
//
|
|
790
|
-
//
|
|
700
|
+
// A test path that merely lives under an api/ directory must NOT inherit this
|
|
701
|
+
// implementation-intent boost, or it would outrank genuine implementation
|
|
702
|
+
// evidence once task_support_rank leads the comparator. The separate
|
|
703
|
+
// test-safety rule covers test paths.
|
|
791
704
|
if (isTestPath(path)) {
|
|
792
705
|
return false;
|
|
793
706
|
}
|
|
@@ -839,157 +752,6 @@ function nameOverlapRank(path, taskTokens) {
|
|
|
839
752
|
return -score;
|
|
840
753
|
}
|
|
841
754
|
const SMALL_CLOSURE_MAX_BYTES = 24_000;
|
|
842
|
-
function taskClosureRank(path, bytes, task) {
|
|
843
|
-
if (bytes > SMALL_CLOSURE_MAX_BYTES) {
|
|
844
|
-
return 0;
|
|
845
|
-
}
|
|
846
|
-
return contextBuilderTaskClosureAnchorRank(path, task);
|
|
847
|
-
}
|
|
848
|
-
export function isContextBuilderTaskClosureAnchor(path, task) {
|
|
849
|
-
return contextBuilderTaskClosureAnchorRank(path, task) < 0;
|
|
850
|
-
}
|
|
851
|
-
export function contextBuilderTaskClosureAnchorRank(path, task) {
|
|
852
|
-
const normalizedTask = task.toLowerCase();
|
|
853
|
-
if (normalizedTask.length === 0) {
|
|
854
|
-
return 0;
|
|
855
|
-
}
|
|
856
|
-
const taskTokens = new Set(tokenizeGenericWords(normalizedTask));
|
|
857
|
-
const normalizedPath = path.toLowerCase();
|
|
858
|
-
for (const rule of TASK_CLOSURE_ANCHOR_RULES) {
|
|
859
|
-
if (!rule.intent.test(normalizedTask)) {
|
|
860
|
-
continue;
|
|
861
|
-
}
|
|
862
|
-
if (!rule.tokens.some((token) => taskTokens.has(token))) {
|
|
863
|
-
continue;
|
|
864
|
-
}
|
|
865
|
-
if (rule.paths.some((pattern) => pattern.test(normalizedPath))) {
|
|
866
|
-
return rule.rank;
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
return 0;
|
|
870
|
-
}
|
|
871
|
-
const TASK_CLOSURE_ANCHOR_RULES = [
|
|
872
|
-
{
|
|
873
|
-
intent: /\b(discover|discovery)\b.*\b(provider-specific|provider\s+semantics|providers?|claude|agent|symmetry)\b|\b(provider-specific|provider\s+semantics|providers?|claude|agent|symmetry)\b.*\b(discover|discovery)\b/,
|
|
874
|
-
tokens: ["provider", "runtime", "claude", "agent", "symmetry"],
|
|
875
|
-
paths: [/\/claude_agent\.py$/, /\/runtime\/base\.py$/],
|
|
876
|
-
rank: -30,
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
intent: /\b(discover|discovery)\b/,
|
|
880
|
-
tokens: ["queue", "migration", "runtime", "schema", "setting", "selector", "model", "provider"],
|
|
881
|
-
paths: [
|
|
882
|
-
/\/api\/endpoints\/chat\.py$/,
|
|
883
|
-
/\/services\/chat\.py$/,
|
|
884
|
-
/\/services\/queue\.py$/,
|
|
885
|
-
/\/hooks\/queries\/usemodelqueries\.ts$/,
|
|
886
|
-
/\/utils\/modelprovider\.ts$/,
|
|
887
|
-
/\/components\/chat\/model-selector\/modelselector\.tsx$/,
|
|
888
|
-
/\/components\/chat\/model-selector\/modelselector\.test\.tsx$/,
|
|
889
|
-
/\/tasks\/chat_processor\.py$/,
|
|
890
|
-
/\/services\/streaming\/orchestrator\.py$/,
|
|
891
|
-
/\/services\/runtime\/codex\.py$/,
|
|
892
|
-
/\/models\/schemas\/effort\.py$/,
|
|
893
|
-
/\/models\/schemas\/chat\.py$/,
|
|
894
|
-
/\/tests\/test_chat\.py$/,
|
|
895
|
-
/\/tests\/services\/test_pending_initial_prompt_service\.py$/,
|
|
896
|
-
/\/services\/queueservice\.ts$/,
|
|
897
|
-
/\/store\/messagequeuestore\.ts$/,
|
|
898
|
-
/\/store\/__tests__\/messagequeuestore\.test\.ts$/,
|
|
899
|
-
/\/hooks\/usemessageactions\.ts$/,
|
|
900
|
-
/\/hooks\/usechatstreaming\.ts$/,
|
|
901
|
-
/\/hooks\/usechatruntimesettings\.ts$/,
|
|
902
|
-
/\/components\/chat\/chat-window\/chat\.tsx$/,
|
|
903
|
-
/\/components\/chat\/message-input\/input\.tsx$/,
|
|
904
|
-
/\/components\/chat\/message-input\/inputsettingspopover\.tsx$/,
|
|
905
|
-
/\/pages\/chatpage\.tsx$/,
|
|
906
|
-
/\/landingpage\.tsx$/,
|
|
907
|
-
/\/models\/db_models\/chat\.py$/,
|
|
908
|
-
/\/[^/]*(permission|thinking).*selector[^/]*\.(ts|tsx)$/,
|
|
909
|
-
/\/tests?\/.*queue.*\.(py|ts|tsx)$/,
|
|
910
|
-
/\/tests\/test_chat\.py$/,
|
|
911
|
-
/\/tests?\/.*runtime.*\.(py|ts|tsx)$/,
|
|
912
|
-
],
|
|
913
|
-
rank: -24,
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
intent: /\b(review|code review)\b/,
|
|
917
|
-
tokens: ["codex", "approval", "permission", "session", "runtime"],
|
|
918
|
-
paths: [
|
|
919
|
-
/\/api\/endpoints\/permissions\.py$/,
|
|
920
|
-
/\/services\/runtime\/codex\.py$/,
|
|
921
|
-
/\/services\/runtime\/codex_approval\.py$/,
|
|
922
|
-
/\/services\/runtime\/codex_stream_processor\.py$/,
|
|
923
|
-
/\/services\/runtime_session_service\.py$/,
|
|
924
|
-
/\/services\/permission_manager\.py$/,
|
|
925
|
-
/\/services\/chat\.py$/,
|
|
926
|
-
/\/api\/endpoints\/chat\.py$/,
|
|
927
|
-
/\/models\/db_models\/runtime_session\.py$/,
|
|
928
|
-
/\/models\/db_models\/ai_model\.py$/,
|
|
929
|
-
/\/services\/chatservice\.ts$/,
|
|
930
|
-
/\/types\/chat\.types\.ts$/,
|
|
931
|
-
/\/models\/schemas\/permissions\.py$/,
|
|
932
|
-
/\/core\/config\.py$/,
|
|
933
|
-
/\/constants\.py$/,
|
|
934
|
-
/\/hooks\/usepermissionrequest\.ts$/,
|
|
935
|
-
/\/tests\/test_permissions\.py$/,
|
|
936
|
-
/\/tests\/services\/runtime\/test_codex_runtime\.py$/,
|
|
937
|
-
/\/tests\/services\/runtime\/test_codex_approval_bridge\.py$/,
|
|
938
|
-
/\/tests\/services\/runtime\/test_codex_stream_processor\.py$/,
|
|
939
|
-
/\/tests\/services\/test_runtime_session_service\.py$/,
|
|
940
|
-
/\/tests?\/.*codex.*approval.*\.(py|ts|tsx)$/,
|
|
941
|
-
/(^|\/)docs?\/.*(codex|approval|permission|session|runtime).*\.md$/,
|
|
942
|
-
],
|
|
943
|
-
rank: -24,
|
|
944
|
-
},
|
|
945
|
-
{
|
|
946
|
-
intent: /\breview\b/,
|
|
947
|
-
tokens: ["auth", "upload", "approval", "approve", "access", "request"],
|
|
948
|
-
paths: [
|
|
949
|
-
/\/[^/]*(auth|credential)[^/]*upload[^/]*\.(ts|tsx)$/,
|
|
950
|
-
/\/[^/]*upload[^/]*(auth|credential)[^/]*\.(ts|tsx)$/,
|
|
951
|
-
/\/[^/]*(approval|approve|accessrequest|requestaccess)[^/]*\.(ts|tsx)$/,
|
|
952
|
-
/\/__tests__\/.*(auth|upload|approval|approve|access|request).*\.test\.(ts|tsx)$/,
|
|
953
|
-
],
|
|
954
|
-
rank: -24,
|
|
955
|
-
},
|
|
956
|
-
{
|
|
957
|
-
intent: /\b(debug|debugging|diagnose|diagnosis|diagnostic)\b/,
|
|
958
|
-
tokens: [
|
|
959
|
-
"right",
|
|
960
|
-
"panel",
|
|
961
|
-
"devtool",
|
|
962
|
-
"trace",
|
|
963
|
-
"archive",
|
|
964
|
-
"api",
|
|
965
|
-
"chat",
|
|
966
|
-
"cache",
|
|
967
|
-
"key",
|
|
968
|
-
"query",
|
|
969
|
-
"tool",
|
|
970
|
-
"message",
|
|
971
|
-
],
|
|
972
|
-
paths: [
|
|
973
|
-
/\/rightpanel\.tsx$/,
|
|
974
|
-
/\/devtools?.*\.test\.(ts|tsx)$/,
|
|
975
|
-
/\/.*trace.*archive.*\.test\.(ts|tsx|py)$/,
|
|
976
|
-
/\/tests?\/.*trace.*archive.*\.(py|ts|tsx)$/,
|
|
977
|
-
/\/api\/endpoints\/devtools\.py$/,
|
|
978
|
-
/\/services\/session_trace_archive\.py$/,
|
|
979
|
-
/\/models\/db_models\/session_trace_archive\.py$/,
|
|
980
|
-
/\/services\/codex_trace\.py$/,
|
|
981
|
-
/\/api\.types\.ts$/,
|
|
982
|
-
/\/chatservice\.ts$/,
|
|
983
|
-
/\/querykeys\.ts$/,
|
|
984
|
-
/\/messagecacheorder\.ts$/,
|
|
985
|
-
/\/messagerenderer\.tsx$/,
|
|
986
|
-
/\/toolexpandcontext\.ts$/,
|
|
987
|
-
/\/chat\.types\.ts$/,
|
|
988
|
-
/\/devtools\.types\.ts$/,
|
|
989
|
-
],
|
|
990
|
-
rank: -24,
|
|
991
|
-
},
|
|
992
|
-
];
|
|
993
755
|
function smallClosureRank(path, bytes, contentTokens, taskTokens, searchTermTokens) {
|
|
994
756
|
if (bytes > SMALL_CLOSURE_MAX_BYTES || !isSmallClosurePath(path)) {
|
|
995
757
|
return 0;
|
|
@@ -1016,12 +778,6 @@ function isSmallClosurePath(path) {
|
|
|
1016
778
|
normalized.includes("/models/schemas/") ||
|
|
1017
779
|
normalized.includes("/constants.") ||
|
|
1018
780
|
normalized.includes("/config.") ||
|
|
1019
|
-
normalized.includes("/session_trace_archive.") ||
|
|
1020
|
-
normalized.includes("/querykeys.") ||
|
|
1021
|
-
normalized.includes("/rightpanel.") ||
|
|
1022
|
-
normalized.includes("/messagerenderer.") ||
|
|
1023
|
-
normalized.includes("/toolcard.") ||
|
|
1024
|
-
normalized.includes("/toolexpandcontext.") ||
|
|
1025
781
|
basename.endsWith(".types.ts") ||
|
|
1026
782
|
basename.endsWith(".types.tsx") ||
|
|
1027
783
|
basename === "types.ts" ||
|
|
@@ -1030,10 +786,7 @@ function isSmallClosurePath(path) {
|
|
|
1030
786
|
basename === "constants.ts" ||
|
|
1031
787
|
basename === "constants.py" ||
|
|
1032
788
|
basename === "config.ts" ||
|
|
1033
|
-
basename === "config.py"
|
|
1034
|
-
basename === "querykeys.ts" ||
|
|
1035
|
-
basename === "permission_mode.py" ||
|
|
1036
|
-
basename === "effort.py");
|
|
789
|
+
basename === "config.py");
|
|
1037
790
|
}
|
|
1038
791
|
// Tokenize the (bounded) content of a pending selection into the distinct
|
|
1039
792
|
// generic words it contains. Computed once per pending item and reused by both
|
|
@@ -1227,10 +980,7 @@ function renderMergedRange(range, records) {
|
|
|
1227
980
|
return lines.join("\n");
|
|
1228
981
|
}
|
|
1229
982
|
function comparePendingSelections(left, right) {
|
|
1230
|
-
const baseComparison = left
|
|
1231
|
-
crossSourceFocusedSafetyTestRank(left, right) ||
|
|
1232
|
-
taskSpecificPathPriorityRank(left.path, left.source, left.bytes, left.task_tokens) -
|
|
1233
|
-
taskSpecificPathPriorityRank(right.path, right.source, right.bytes, right.task_tokens) ||
|
|
983
|
+
const baseComparison = crossSourceFocusedSafetyTestRank(left, right) ||
|
|
1234
984
|
relevanceRank(left) - relevanceRank(right) ||
|
|
1235
985
|
sourceRank(left.source) - sourceRank(right.source);
|
|
1236
986
|
if (baseComparison !== 0) {
|
|
@@ -1239,9 +989,6 @@ function comparePendingSelections(left, right) {
|
|
|
1239
989
|
if (left.source === "focus" && right.source === "focus") {
|
|
1240
990
|
return (strongImplementationPathSearchRank(left) -
|
|
1241
991
|
strongImplementationPathSearchRank(right) ||
|
|
1242
|
-
taskSpecificPathPriorityRank(left.path, left.source, left.bytes, left.task_tokens) -
|
|
1243
|
-
taskSpecificPathPriorityRank(right.path, right.source, right.bytes, right.task_tokens) ||
|
|
1244
|
-
left.task_closure_rank - right.task_closure_rank ||
|
|
1245
992
|
left.task_support_rank - right.task_support_rank ||
|
|
1246
993
|
focusedSafetyTestRank(left) - focusedSafetyTestRank(right) ||
|
|
1247
994
|
// Explicit task intent (task_support_rank) wins first; then a file whose
|
|
@@ -1263,9 +1010,6 @@ function comparePendingSelections(left, right) {
|
|
|
1263
1010
|
}
|
|
1264
1011
|
return (strongImplementationPathSearchRank(left) -
|
|
1265
1012
|
strongImplementationPathSearchRank(right) ||
|
|
1266
|
-
taskSpecificPathPriorityRank(left.path, left.source, left.bytes, left.task_tokens) -
|
|
1267
|
-
taskSpecificPathPriorityRank(right.path, right.source, right.bytes, right.task_tokens) ||
|
|
1268
|
-
left.task_closure_rank - right.task_closure_rank ||
|
|
1269
1013
|
left.task_support_rank - right.task_support_rank ||
|
|
1270
1014
|
// Explicit task intent (task_support_rank) wins first; then a file whose
|
|
1271
1015
|
// actual CONTENT matches the task outranks the generic structural
|
|
@@ -1287,288 +1031,6 @@ function comparePendingSelections(left, right) {
|
|
|
1287
1031
|
function strongImplementationPathSearchRank(item) {
|
|
1288
1032
|
return isImplementationPath(item.path) && item.path_search_term_rank <= -20 ? -1 : 0;
|
|
1289
1033
|
}
|
|
1290
|
-
function taskSpecificPathPriorityRank(path, source, bytes, taskTokens) {
|
|
1291
|
-
return Math.min(runtimeSettingsDiscoveryPathPriorityRank(path, taskTokens), codexRuntimeReviewPathPriorityRank(path, bytes, taskTokens), devtoolsTraceDebugPathPriorityRank(path, source, bytes, taskTokens));
|
|
1292
|
-
}
|
|
1293
|
-
function shouldOmitTaskSpecificNoise(item) {
|
|
1294
|
-
return (taskSpecificPathPriorityRank(item.path, item.source, item.bytes, item.task_tokens) >= 12);
|
|
1295
|
-
}
|
|
1296
|
-
function runtimeSettingsDiscoveryPathPriorityRank(path, taskTokens) {
|
|
1297
|
-
if (!isRuntimeSettingsDiscoveryTask(taskTokens)) {
|
|
1298
|
-
return 0;
|
|
1299
|
-
}
|
|
1300
|
-
const normalized = path.toLowerCase();
|
|
1301
|
-
const basename = normalized.split("/").at(-1) ?? normalized;
|
|
1302
|
-
if (normalized.endsWith("/hooks/usechatruntimesettings.ts")) {
|
|
1303
|
-
return -80;
|
|
1304
|
-
}
|
|
1305
|
-
if (normalized.endsWith("/components/chat/message-input/composerruntimecontrols.tsx")) {
|
|
1306
|
-
return -78;
|
|
1307
|
-
}
|
|
1308
|
-
if (normalized.endsWith("/components/chat/message-input/input.tsx")) {
|
|
1309
|
-
return -77;
|
|
1310
|
-
}
|
|
1311
|
-
if (normalized.endsWith("/pages/chatpage.tsx")) {
|
|
1312
|
-
return -76;
|
|
1313
|
-
}
|
|
1314
|
-
if (normalized.endsWith("/services/chatservice.ts") ||
|
|
1315
|
-
normalized.endsWith("/api/endpoints/chat.py") ||
|
|
1316
|
-
normalized.endsWith("/services/chat.py")) {
|
|
1317
|
-
return normalized.endsWith("/api/endpoints/chat.py") ? -82 : -72;
|
|
1318
|
-
}
|
|
1319
|
-
if (normalized.endsWith("/api/endpoints/ai_models.py") ||
|
|
1320
|
-
normalized.endsWith("/models/db_models/ai_model.py") ||
|
|
1321
|
-
normalized.endsWith("/services/runtime/resolver.py") ||
|
|
1322
|
-
normalized.endsWith("/services/model_provider_auth.py") ||
|
|
1323
|
-
normalized.endsWith("/services/claude_agent.py") ||
|
|
1324
|
-
normalized.endsWith("/tests/test_ai_models_codex_gate.py") ||
|
|
1325
|
-
normalized.endsWith("/components/chat/model-selector/modelselector.tsx") ||
|
|
1326
|
-
normalized.endsWith("/components/chat/model-selector/modelselector.test.tsx") ||
|
|
1327
|
-
normalized.endsWith("/hooks/queries/usemodelqueries.ts") ||
|
|
1328
|
-
normalized.endsWith("/utils/modelprovider.ts") ||
|
|
1329
|
-
normalized.endsWith("/utils/__tests__/modelprovider.test.ts")) {
|
|
1330
|
-
return normalized.endsWith("/api/endpoints/ai_models.py") ||
|
|
1331
|
-
normalized.endsWith("/components/chat/model-selector/modelselector.tsx")
|
|
1332
|
-
? -81
|
|
1333
|
-
: -70;
|
|
1334
|
-
}
|
|
1335
|
-
if (normalized.endsWith("/store/messagequeuestore.ts") ||
|
|
1336
|
-
normalized.endsWith("/store/__tests__/messagequeuestore.test.ts") ||
|
|
1337
|
-
normalized.endsWith("/services/queueservice.ts") ||
|
|
1338
|
-
normalized.endsWith("/services/streamservice.ts") ||
|
|
1339
|
-
normalized.endsWith("/tests/services/test_queue.py") ||
|
|
1340
|
-
normalized.endsWith("/tests/test_queue.py") ||
|
|
1341
|
-
normalized.endsWith("/tests/services/test_pending_initial_prompt_service.py")) {
|
|
1342
|
-
return normalized.endsWith("/tests/services/test_pending_initial_prompt_service.py") ||
|
|
1343
|
-
normalized.endsWith("/tests/test_queue.py")
|
|
1344
|
-
? -74
|
|
1345
|
-
: -68;
|
|
1346
|
-
}
|
|
1347
|
-
if (normalized.endsWith("/services/runtime/codex.py") ||
|
|
1348
|
-
normalized.endsWith("/services/runtime/claude.py") ||
|
|
1349
|
-
normalized.endsWith("/services/runtime/codex_approval.py") ||
|
|
1350
|
-
normalized.endsWith("/services/runtime/codex_stream_processor.py") ||
|
|
1351
|
-
normalized.endsWith("/services/streaming/orchestrator.py") ||
|
|
1352
|
-
normalized.endsWith("/tasks/chat_processor.py") ||
|
|
1353
|
-
normalized.endsWith("/services/runtime_session_service.py")) {
|
|
1354
|
-
return normalized.endsWith("/tasks/chat_processor.py") ? -73 : -64;
|
|
1355
|
-
}
|
|
1356
|
-
if (normalized.endsWith("/hooks/__tests__/usechatruntimesettings.test.ts") ||
|
|
1357
|
-
normalized.endsWith("/pages/landingpage.test.tsx") ||
|
|
1358
|
-
normalized.endsWith("/tests/test_chat.py") ||
|
|
1359
|
-
normalized.endsWith("/tests/services/runtime/test_codex_runtime.py") ||
|
|
1360
|
-
normalized.endsWith("/tests/test_codex_runtime_data_migration.py") ||
|
|
1361
|
-
normalized.endsWith("/tests/test_codex_effort_translation.py") ||
|
|
1362
|
-
normalized.endsWith("/tests/test_effort_level.py") ||
|
|
1363
|
-
normalized.endsWith("/tests/test_permission_mode.py") ||
|
|
1364
|
-
normalized.endsWith("/tests/services/test_claude_agent.py")) {
|
|
1365
|
-
return -60;
|
|
1366
|
-
}
|
|
1367
|
-
if (basename === "effort.py" ||
|
|
1368
|
-
basename === "permission_mode.py" ||
|
|
1369
|
-
basename === "chat.types.ts" ||
|
|
1370
|
-
basename === "queue.types.ts" ||
|
|
1371
|
-
normalized.endsWith("/models/schemas/chat.py") ||
|
|
1372
|
-
normalized.endsWith("/models/db_models/chat.py") ||
|
|
1373
|
-
normalized.endsWith("/models/db_models/runtime_session.py") ||
|
|
1374
|
-
basename.includes("permissionmodeselector") ||
|
|
1375
|
-
basename.includes("thinkingmodeselector")) {
|
|
1376
|
-
return basename === "effort.py" || basename === "permission_mode.py" ? -64 : -56;
|
|
1377
|
-
}
|
|
1378
|
-
if (normalized.endsWith("/pages/landingpage.tsx") ||
|
|
1379
|
-
normalized.endsWith("/tasks/chat_processor.py")) {
|
|
1380
|
-
return 18;
|
|
1381
|
-
}
|
|
1382
|
-
if (normalized.endsWith("/components/chat/chat-window/chat.tsx")) {
|
|
1383
|
-
return 14;
|
|
1384
|
-
}
|
|
1385
|
-
if (normalized.endsWith("/hooks/usechatstreaming.ts")) {
|
|
1386
|
-
return -12;
|
|
1387
|
-
}
|
|
1388
|
-
return 0;
|
|
1389
|
-
}
|
|
1390
|
-
function codexRuntimeReviewPathPriorityRank(path, bytes, taskTokens) {
|
|
1391
|
-
if (!isCodexRuntimeReviewTask(taskTokens)) {
|
|
1392
|
-
return 0;
|
|
1393
|
-
}
|
|
1394
|
-
const normalized = path.toLowerCase();
|
|
1395
|
-
if (normalized.endsWith("/services/runtime/resolver.py")) {
|
|
1396
|
-
return -92;
|
|
1397
|
-
}
|
|
1398
|
-
if (normalized.endsWith("/services/runtime/codex.py")) {
|
|
1399
|
-
return -90;
|
|
1400
|
-
}
|
|
1401
|
-
if (normalized.endsWith("/services/runtime/codex_approval.py")) {
|
|
1402
|
-
return -88;
|
|
1403
|
-
}
|
|
1404
|
-
if (normalized.endsWith("/services/runtime/codex_stream_processor.py")) {
|
|
1405
|
-
return -86;
|
|
1406
|
-
}
|
|
1407
|
-
if (normalized.endsWith("/services/runtime_session_service.py")) {
|
|
1408
|
-
return -84;
|
|
1409
|
-
}
|
|
1410
|
-
if (normalized.endsWith("/models/db_models/runtime_session.py")) {
|
|
1411
|
-
return -82;
|
|
1412
|
-
}
|
|
1413
|
-
if (normalized.endsWith("/tests/services/runtime/test_codex_runtime.py")) {
|
|
1414
|
-
return -80;
|
|
1415
|
-
}
|
|
1416
|
-
if (normalized.endsWith("/tests/services/runtime/test_codex_approval_bridge.py")) {
|
|
1417
|
-
return -78;
|
|
1418
|
-
}
|
|
1419
|
-
if (normalized.endsWith("/tests/services/runtime/test_codex_stream_processor.py")) {
|
|
1420
|
-
return -76;
|
|
1421
|
-
}
|
|
1422
|
-
if (normalized.endsWith("/tests/services/test_runtime_session_service.py")) {
|
|
1423
|
-
return -74;
|
|
1424
|
-
}
|
|
1425
|
-
if (codexReviewWantsModelGate(taskTokens) &&
|
|
1426
|
-
(normalized.endsWith("/models/db_models/ai_model.py") ||
|
|
1427
|
-
normalized.endsWith("/api/endpoints/ai_models.py") ||
|
|
1428
|
-
normalized.endsWith("/services/model_provider_auth.py") ||
|
|
1429
|
-
normalized.endsWith("/tests/test_ai_models_codex_gate.py"))) {
|
|
1430
|
-
return -72;
|
|
1431
|
-
}
|
|
1432
|
-
if (codexReviewWantsFrontendGate(taskTokens) &&
|
|
1433
|
-
(normalized.endsWith("/components/chat/message-input/thinkingmodeselector.tsx") ||
|
|
1434
|
-
normalized.endsWith("/components/chat/thinking-mode-selector/thinkingmodeselector.tsx") ||
|
|
1435
|
-
normalized.endsWith("/components/chat/permission-mode-selector/permissionmodeselector.tsx"))) {
|
|
1436
|
-
return -71;
|
|
1437
|
-
}
|
|
1438
|
-
if (codexReviewWantsFrontendGate(taskTokens) &&
|
|
1439
|
-
normalized.endsWith("/components/chat/message-input/input.tsx")) {
|
|
1440
|
-
return -83;
|
|
1441
|
-
}
|
|
1442
|
-
if (codexReviewWantsFrontendGate(taskTokens) &&
|
|
1443
|
-
normalized.endsWith("/components/ui/fileuploaddialog.codex.test.tsx")) {
|
|
1444
|
-
return -81;
|
|
1445
|
-
}
|
|
1446
|
-
if (codexReviewWantsFrontendGate(taskTokens) &&
|
|
1447
|
-
(normalized.endsWith("/components/ui/fileuploaddialog.tsx") ||
|
|
1448
|
-
normalized.endsWith("/hooks/usemessageactions.ts") ||
|
|
1449
|
-
normalized.endsWith("/services/chatservice.ts"))) {
|
|
1450
|
-
return -68;
|
|
1451
|
-
}
|
|
1452
|
-
if (normalized.endsWith("/api/endpoints/permissions.py") ||
|
|
1453
|
-
normalized.endsWith("/services/permission_manager.py") ||
|
|
1454
|
-
normalized.endsWith("/hooks/usepermissionrequest.ts") ||
|
|
1455
|
-
normalized.endsWith("/tests/test_permissions.py") ||
|
|
1456
|
-
normalized.endsWith("/tests/services/runtime/test_codex_stream_processor_fixtures.py")) {
|
|
1457
|
-
return -58;
|
|
1458
|
-
}
|
|
1459
|
-
if (bytes > SMALL_CLOSURE_MAX_BYTES &&
|
|
1460
|
-
(normalized.includes("/sandbox/") ||
|
|
1461
|
-
normalized.includes("sandbox") ||
|
|
1462
|
-
normalized.includes("providerauth") ||
|
|
1463
|
-
normalized.includes("provider_auth") ||
|
|
1464
|
-
normalized.includes("model_provider_auth"))) {
|
|
1465
|
-
return 16;
|
|
1466
|
-
}
|
|
1467
|
-
return 0;
|
|
1468
|
-
}
|
|
1469
|
-
function devtoolsTraceDebugPathPriorityRank(path, source, bytes, taskTokens) {
|
|
1470
|
-
if (!isDevtoolsTraceDebugTask(taskTokens)) {
|
|
1471
|
-
return 0;
|
|
1472
|
-
}
|
|
1473
|
-
const normalized = path.toLowerCase();
|
|
1474
|
-
const focusBonus = source === "focus" ? -2 : 0;
|
|
1475
|
-
if (normalized.endsWith("/components/right-panel/rightpaneldevtools.tsx")) {
|
|
1476
|
-
return -90 + focusBonus;
|
|
1477
|
-
}
|
|
1478
|
-
if (normalized.endsWith("/components/right-panel/__tests__/right-panel-devtools.test.tsx") ||
|
|
1479
|
-
normalized.endsWith("/components/chat/__tests__/chat.autoscroll.test.tsx") ||
|
|
1480
|
-
normalized.endsWith("/store/devtoolsnavstore.ts") ||
|
|
1481
|
-
normalized.endsWith("/store/__tests__/devtoolsnavstore.test.ts")) {
|
|
1482
|
-
return -86 + focusBonus;
|
|
1483
|
-
}
|
|
1484
|
-
if (normalized.endsWith("/components/chat/chat-window/chat.tsx") ||
|
|
1485
|
-
normalized.endsWith("/components/chat/message-bubble/messagerenderer.tsx") ||
|
|
1486
|
-
normalized.endsWith("/components/chat/tools/common/toolcard.tsx")) {
|
|
1487
|
-
return -82 + focusBonus;
|
|
1488
|
-
}
|
|
1489
|
-
if (normalized.endsWith("/hooks/usemessagecache.ts") ||
|
|
1490
|
-
normalized.endsWith("/utils/messagecacheorder.ts") ||
|
|
1491
|
-
normalized.endsWith("/hooks/queries/querykeys.ts") ||
|
|
1492
|
-
normalized.endsWith("/hooks/queries/usedevtoolsqueries.ts") ||
|
|
1493
|
-
normalized.endsWith("/components/chat/tools/common/toolexpandcontext.ts") ||
|
|
1494
|
-
normalized.endsWith("/components/chat/tools/common/__tests__/toolexpand.test.tsx")) {
|
|
1495
|
-
return -78 + focusBonus;
|
|
1496
|
-
}
|
|
1497
|
-
if (normalized.endsWith("/components/right-panel/devtools-helpers.ts") ||
|
|
1498
|
-
normalized.endsWith("/components/right-panel/__tests__/devtools-helpers.test.ts") ||
|
|
1499
|
-
normalized.endsWith("/services/devtoolsservice.ts")) {
|
|
1500
|
-
return -66 + focusBonus;
|
|
1501
|
-
}
|
|
1502
|
-
if (normalized.endsWith("/api/endpoints/devtools.py") ||
|
|
1503
|
-
normalized.endsWith("/services/session_trace_archive.py") ||
|
|
1504
|
-
normalized.endsWith("/services/codex_trace.py") ||
|
|
1505
|
-
normalized.endsWith("/models/db_models/session_trace_archive.py") ||
|
|
1506
|
-
normalized.endsWith("/models/schemas/devtools.py") ||
|
|
1507
|
-
normalized.endsWith("/types/devtools.types.ts")) {
|
|
1508
|
-
if (devtoolsDebugIsFrontendRowTask(taskTokens)) {
|
|
1509
|
-
return -12;
|
|
1510
|
-
}
|
|
1511
|
-
return -36;
|
|
1512
|
-
}
|
|
1513
|
-
if (normalized.endsWith("/components/right-panel/rightpanel.tsx") ||
|
|
1514
|
-
normalized.endsWith("/components/chat/message-bubble/message.tsx")) {
|
|
1515
|
-
return -20;
|
|
1516
|
-
}
|
|
1517
|
-
if ((isTestPath(normalized) || normalized.includes("/__mocks__/")) &&
|
|
1518
|
-
normalized.includes("virtualizer")) {
|
|
1519
|
-
return -74 + focusBonus;
|
|
1520
|
-
}
|
|
1521
|
-
if (bytes > SMALL_CLOSURE_MAX_BYTES) {
|
|
1522
|
-
return 12;
|
|
1523
|
-
}
|
|
1524
|
-
return 0;
|
|
1525
|
-
}
|
|
1526
|
-
function devtoolsDebugIsFrontendRowTask(taskTokens) {
|
|
1527
|
-
return (taskTokens.has("row") ||
|
|
1528
|
-
taskTokens.has("search") ||
|
|
1529
|
-
taskTokens.has("filter") ||
|
|
1530
|
-
taskTokens.has("filtered") ||
|
|
1531
|
-
taskTokens.has("virtualizer") ||
|
|
1532
|
-
taskTokens.has("visible") ||
|
|
1533
|
-
taskTokens.has("click") ||
|
|
1534
|
-
taskTokens.has("click-through"));
|
|
1535
|
-
}
|
|
1536
|
-
function isRuntimeSettingsDiscoveryTask(taskTokens) {
|
|
1537
|
-
return taskTokens.has("discovery") && taskTokens.has("runtime");
|
|
1538
|
-
}
|
|
1539
|
-
function isCodexRuntimeReviewTask(taskTokens) {
|
|
1540
|
-
return (taskTokens.has("review") &&
|
|
1541
|
-
taskTokens.has("codex") &&
|
|
1542
|
-
(taskTokens.has("runtime") ||
|
|
1543
|
-
taskTokens.has("approval") ||
|
|
1544
|
-
taskTokens.has("session") ||
|
|
1545
|
-
taskTokens.has("stream") ||
|
|
1546
|
-
taskTokens.has("permission")));
|
|
1547
|
-
}
|
|
1548
|
-
function codexReviewWantsModelGate(taskTokens) {
|
|
1549
|
-
return (taskTokens.has("model") ||
|
|
1550
|
-
taskTokens.has("provider") ||
|
|
1551
|
-
taskTokens.has("capability") ||
|
|
1552
|
-
taskTokens.has("check"));
|
|
1553
|
-
}
|
|
1554
|
-
function codexReviewWantsFrontendGate(taskTokens) {
|
|
1555
|
-
return (taskTokens.has("frontend") ||
|
|
1556
|
-
taskTokens.has("consumer") ||
|
|
1557
|
-
taskTokens.has("file") ||
|
|
1558
|
-
taskTokens.has("upload") ||
|
|
1559
|
-
taskTokens.has("gating") ||
|
|
1560
|
-
taskTokens.has("attachment") ||
|
|
1561
|
-
codexReviewWantsModelGate(taskTokens));
|
|
1562
|
-
}
|
|
1563
|
-
function isDevtoolsTraceDebugTask(taskTokens) {
|
|
1564
|
-
return ((taskTokens.has("debug") ||
|
|
1565
|
-
taskTokens.has("debugging") ||
|
|
1566
|
-
taskTokens.has("diagnose") ||
|
|
1567
|
-
taskTokens.has("diagnosis") ||
|
|
1568
|
-
taskTokens.has("diagnostic")) &&
|
|
1569
|
-
(taskTokens.has("devtool") || (taskTokens.has("dev") && taskTokens.has("tool"))) &&
|
|
1570
|
-
taskTokens.has("trace"));
|
|
1571
|
-
}
|
|
1572
1034
|
function crossSourceFocusedSafetyTestRank(left, right) {
|
|
1573
1035
|
if (left.source === right.source) {
|
|
1574
1036
|
return 0;
|
|
@@ -1600,8 +1062,8 @@ function isImplementationPath(path) {
|
|
|
1600
1062
|
return false;
|
|
1601
1063
|
}
|
|
1602
1064
|
return (path.startsWith("src/") ||
|
|
1603
|
-
path.
|
|
1604
|
-
path.
|
|
1065
|
+
path.includes("/src/") ||
|
|
1066
|
+
path.includes("/app/"));
|
|
1605
1067
|
}
|
|
1606
1068
|
function isProjectDocPath(path) {
|
|
1607
1069
|
return (path.startsWith("docs/") ||
|