clinkx 0.3.0 → 1.1.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 +119 -0
- package/LICENSE +10 -0
- package/README.md +154 -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/chairman-knobs.d.ts +24 -0
- package/clinkx-workflows/dist/chairman-knobs.js +27 -0
- package/clinkx-workflows/dist/chairman-knobs.js.map +1 -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 +12 -1
- package/clinkx-workflows/dist/clink-client.js +56 -5
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/config.d.ts +173 -16
- package/clinkx-workflows/dist/config.js +417 -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 +189 -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-execution-policy.d.ts +68 -0
- package/clinkx-workflows/dist/council-execution-policy.js +110 -0
- package/clinkx-workflows/dist/council-execution-policy.js.map +1 -0
- package/clinkx-workflows/dist/council-expander.d.ts +10 -9
- package/clinkx-workflows/dist/council-expander.js +20 -10
- package/clinkx-workflows/dist/council-expander.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +5718 -0
- package/clinkx-workflows/dist/dashboard/activity-contract.js +157 -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 +90 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js +493 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/api-routes.d.ts +40 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js +1155 -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-builder-invocation-contract.d.ts +3865 -0
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.js +69 -0
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.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 +256 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js +1301 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +28483 -0
- package/clinkx-workflows/dist/dashboard/contracts.js +1284 -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 +32 -0
- package/clinkx-workflows/dist/dashboard/index.js +20 -0
- package/clinkx-workflows/dist/dashboard/index.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.d.ts +786 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.js +201 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +114 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js +799 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.d.ts +90 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.js +31 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.d.ts +12 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.js +286 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +446 -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 +529 -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 +29 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +111 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.d.ts +194 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js +89 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.d.ts +26 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.js +102 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-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 +130 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/scanner.d.ts +78 -0
- package/clinkx-workflows/dist/dashboard/scanner.js +1154 -0
- package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/server-factory.d.ts +63 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js +483 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +2778 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js +506 -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 +529 -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 +14 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js +1101 -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-JPHQVtn9.js +106 -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-DOMHk-j6.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-finalizer-policy.d.ts +26 -0
- package/clinkx-workflows/dist/delegate-finalizer-policy.js +72 -0
- package/clinkx-workflows/dist/delegate-finalizer-policy.js.map +1 -0
- package/clinkx-workflows/dist/delegate-signature.d.ts +14 -0
- package/clinkx-workflows/dist/delegate-signature.js +14 -0
- package/clinkx-workflows/dist/delegate-signature.js.map +1 -0
- package/clinkx-workflows/dist/delegate-validate.d.ts +108 -0
- package/clinkx-workflows/dist/delegate-validate.js +148 -0
- package/clinkx-workflows/dist/delegate-validate.js.map +1 -0
- package/clinkx-workflows/dist/engine.d.ts +251 -0
- package/clinkx-workflows/dist/engine.js +1342 -92
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/errors.d.ts +24 -2
- package/clinkx-workflows/dist/errors.js +30 -2
- package/clinkx-workflows/dist/errors.js.map +1 -1
- package/clinkx-workflows/dist/fidelity.d.ts +47 -1
- package/clinkx-workflows/dist/fidelity.js +54 -1
- package/clinkx-workflows/dist/fidelity.js.map +1 -1
- package/clinkx-workflows/dist/fingerprint.d.ts +25 -7
- package/clinkx-workflows/dist/fingerprint.js +33 -10
- package/clinkx-workflows/dist/fingerprint.js.map +1 -1
- package/clinkx-workflows/dist/index.d.ts +19 -0
- package/clinkx-workflows/dist/index.js +68 -1
- 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/logger.d.ts +1 -1
- package/clinkx-workflows/dist/logger.js +17 -3
- package/clinkx-workflows/dist/logger.js.map +1 -1
- package/clinkx-workflows/dist/monotonic-clock.d.ts +19 -0
- package/clinkx-workflows/dist/monotonic-clock.js +22 -0
- package/clinkx-workflows/dist/monotonic-clock.js.map +1 -0
- 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/roster-contract.d.ts +889 -0
- package/clinkx-workflows/dist/roster-contract.js +180 -0
- package/clinkx-workflows/dist/roster-contract.js.map +1 -0
- package/clinkx-workflows/dist/rosters.d.ts +14 -0
- package/clinkx-workflows/dist/rosters.js +169 -0
- package/clinkx-workflows/dist/rosters.js.map +1 -0
- package/clinkx-workflows/dist/run-health.d.ts +7 -0
- package/clinkx-workflows/dist/run-health.js +25 -0
- package/clinkx-workflows/dist/run-health.js.map +1 -0
- 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 +140 -21
- package/clinkx-workflows/dist/schema.js +34 -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 +84 -52
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/shutdown.d.ts +29 -18
- package/clinkx-workflows/dist/shutdown.js +90 -64
- package/clinkx-workflows/dist/shutdown.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +61 -0
- package/clinkx-workflows/dist/state.d.ts +175 -3
- package/clinkx-workflows/dist/state.js +1398 -44
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/stdio-watchdog.d.ts +52 -0
- package/clinkx-workflows/dist/stdio-watchdog.js +212 -0
- package/clinkx-workflows/dist/stdio-watchdog.js.map +1 -0
- 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 +20 -2
- package/clinkx-workflows/dist/validators/council.d.ts +334 -101
- 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 +118 -3
- package/clinkx-workflows/dist/workflow-tools.js +2110 -175
- 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-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/answer-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/answer-specialist.txt +5 -1
- package/clinkx-workflows/templates/council/chairman.txt +3 -0
- package/clinkx-workflows/templates/council/code-review-chairman.txt +16 -0
- package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +7 -1
- package/clinkx-workflows/templates/council/code-review-reviewer.txt +22 -3
- package/clinkx-workflows/templates/council/debug-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/debug-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/debug-debugger.txt +5 -1
- package/clinkx-workflows/templates/council/discover-analyst.txt +5 -1
- package/clinkx-workflows/templates/council/discover-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/discover-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/member.txt +5 -1
- package/clinkx-workflows/templates/council/plan-review-chairman.txt +71 -0
- package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +54 -0
- package/clinkx-workflows/templates/council/plan-review-reviewer.txt +63 -0
- package/clinkx-workflows/templates/council/reviewer.txt +3 -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 +100 -8
- package/clinkx-workflows/workflows/council-code-review.yaml +106 -8
- package/clinkx-workflows/workflows/council-debug.yaml +100 -8
- package/clinkx-workflows/workflows/council-default.yaml +104 -8
- package/clinkx-workflows/workflows/council-discover.yaml +100 -8
- package/clinkx-workflows/workflows/council-plan-review.yaml +253 -0
- package/clinkx-workflows/workflows/plan-review-receipts.yaml +230 -0
- package/conf/adapters/agy.json +56 -0
- package/conf/adapters/claude.json +12 -0
- package/conf/adapters/codex-app-server.json +44 -0
- package/conf/adapters/codex.json +14 -2
- package/conf/adapters/glm.json +24 -3
- package/conf/adapters/grok.json +67 -0
- package/conf/adapters/hapi/agy.json +59 -0
- package/conf/adapters/hapi/claude.json +12 -0
- package/conf/adapters/hapi/codex.json +14 -2
- package/conf/adapters/hapi/glm.json +25 -4
- package/conf/rosters/default-council.json +21 -0
- package/dist/activity-journal.d.ts +56 -0
- package/dist/activity-journal.js +706 -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 +1306 -0
- package/dist/codex/agent-tools.js.map +1 -0
- package/dist/codex/app-server-client.d.ts +79 -0
- package/dist/codex/app-server-client.js +593 -0
- package/dist/codex/app-server-client.js.map +1 -0
- package/dist/codex/app-server-registry.d.ts +407 -0
- package/dist/codex/app-server-registry.js +1493 -0
- package/dist/codex/app-server-registry.js.map +1 -0
- package/dist/codex/client-types.d.ts +115 -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 +386 -23
- package/dist/config.js +184 -15
- 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 +48 -2
- package/dist/context-builder/bundle.js +388 -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-finalizer-effective.d.ts +33 -0
- package/dist/context-builder/delegate-finalizer-effective.js +82 -0
- package/dist/context-builder/delegate-finalizer-effective.js.map +1 -0
- package/dist/context-builder/delegate-packet.d.ts +55 -0
- package/dist/context-builder/delegate-packet.js +430 -74
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-reconstruction.d.ts +29 -0
- package/dist/context-builder/delegate-reconstruction.js +110 -41
- package/dist/context-builder/delegate-reconstruction.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +41 -1
- package/dist/context-builder/delegate-validation.js +237 -48
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/delegate.d.ts +11 -0
- package/dist/context-builder/delegate.js +210 -58
- 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-progress.d.ts +25 -0
- package/dist/context-builder/discovery-progress.js +64 -0
- package/dist/context-builder/discovery-progress.js.map +1 -0
- package/dist/context-builder/discovery-watchdog.d.ts +15 -0
- package/dist/context-builder/discovery-watchdog.js +39 -0
- package/dist/context-builder/discovery-watchdog.js.map +1 -0
- package/dist/context-builder/discovery.d.ts +36 -1
- package/dist/context-builder/discovery.js +584 -172
- package/dist/context-builder/discovery.js.map +1 -1
- package/dist/context-builder/external-gaps.d.ts +73 -0
- package/dist/context-builder/external-gaps.js +248 -0
- package/dist/context-builder/external-gaps.js.map +1 -0
- package/dist/context-builder/globs.d.ts +1 -0
- package/dist/context-builder/globs.js +25 -10
- package/dist/context-builder/globs.js.map +1 -1
- package/dist/context-builder/handler.d.ts +67 -2
- package/dist/context-builder/handler.js +1810 -2440
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/invocation-sidecar.d.ts +41 -0
- package/dist/context-builder/invocation-sidecar.js +189 -0
- package/dist/context-builder/invocation-sidecar.js.map +1 -0
- 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/mutation-lock.d.ts +32 -0
- package/dist/context-builder/mutation-lock.js +321 -0
- package/dist/context-builder/mutation-lock.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 +116 -0
- package/dist/context-builder/review-coverage.js +544 -0
- package/dist/context-builder/review-coverage.js.map +1 -0
- package/dist/context-builder/schema.d.ts +315 -2
- package/dist/context-builder/schema.js +133 -7
- package/dist/context-builder/schema.js.map +1 -1
- package/dist/context-builder/secrets.d.ts +59 -0
- package/dist/context-builder/secrets.js +2255 -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 +23 -2
- package/dist/context-builder/status.js +60 -4
- package/dist/context-builder/status.js.map +1 -1
- package/dist/context-builder/storage.d.ts +59 -2
- package/dist/context-builder/storage.js +500 -168
- 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 +44 -0
- package/dist/context-builder/versions.js +45 -0
- package/dist/context-builder/versions.js.map +1 -0
- package/dist/context-builder/workflow-runner.d.ts +75 -0
- package/dist/context-builder/workflow-runner.js +1241 -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 +53 -0
- package/dist/dashboard-adapter-catalog.js.map +1 -0
- package/dist/dashboard-cli.d.ts +81 -0
- package/dist/dashboard-cli.js +623 -0
- package/dist/dashboard-cli.js.map +1 -0
- package/dist/dashboard-companion/client.d.ts +37 -0
- package/dist/dashboard-companion/client.js +229 -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 +458 -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 +12 -0
- package/dist/dashboard-gateway/index.js +786 -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 +15 -2
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +20 -2
- package/dist/index.js +154 -6
- 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/logger.d.ts +1 -1
- package/dist/logger.js +18 -3
- package/dist/logger.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/agy-stream-json.d.ts +14 -0
- package/dist/parsers/agy-stream-json.js +172 -0
- package/dist/parsers/agy-stream-json.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 +16 -4
- package/dist/parsers/extract.js.map +1 -1
- package/dist/parsers/observed-invocation.d.ts +20 -0
- package/dist/parsers/observed-invocation.js +42 -0
- package/dist/parsers/observed-invocation.js.map +1 -0
- package/dist/pipeline.d.ts +17 -0
- package/dist/pipeline.js +181 -10
- package/dist/pipeline.js.map +1 -1
- package/dist/progress-report/lock.d.ts +74 -0
- package/dist/progress-report/lock.js +343 -0
- package/dist/progress-report/lock.js.map +1 -0
- package/dist/progress-report/schema.d.ts +808 -0
- package/dist/progress-report/schema.js +119 -0
- package/dist/progress-report/schema.js.map +1 -0
- package/dist/progress-report/store.d.ts +66 -0
- package/dist/progress-report/store.js +766 -0
- package/dist/progress-report/store.js.map +1 -0
- package/dist/progress-report/tools.d.ts +20 -0
- package/dist/progress-report/tools.js +141 -0
- package/dist/progress-report/tools.js.map +1 -0
- package/dist/prompt-mode.d.ts +1 -1
- package/dist/prompt-mode.js +7 -2
- package/dist/prompt-mode.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 +20 -0
- package/dist/runner.js +192 -16
- package/dist/runner.js.map +1 -1
- package/dist/safety.d.ts +54 -4
- package/dist/safety.js +186 -5
- package/dist/safety.js.map +1 -1
- package/dist/schema.d.ts +15 -7
- package/dist/schema.js +20 -0
- package/dist/schema.js.map +1 -1
- package/dist/server.d.ts +7 -1
- package/dist/server.js +451 -23
- package/dist/server.js.map +1 -1
- package/dist/session-log-stream.d.ts +18 -0
- package/dist/session-log-stream.js +566 -0
- package/dist/session-log-stream.js.map +1 -0
- package/dist/stdio-activity.d.ts +28 -0
- package/dist/stdio-activity.js +72 -0
- package/dist/stdio-activity.js.map +1 -0
- package/package.json +47 -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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { boundContextBuilderOmissions, isRequestedEvidenceOmission, requestedEvidenceOmission, } from "./diagnostics.js";
|
|
2
2
|
import { normalizeContextBuilderRootRelativePath, } from "./paths.js";
|
|
3
|
-
import {
|
|
3
|
+
import { orderEvidenceClasses, } from "./review-coverage.js";
|
|
4
|
+
import { hasConservativeResidualSecret, scanSecretPath } from "./secrets.js";
|
|
4
5
|
import { estimateContextBuilderTokensFromUtf8Bytes } from "./token-estimate.js";
|
|
5
6
|
export const CONTEXT_BUILDER_DELEGATE_PACKET_CAP_DEFAULTS = Object.freeze({
|
|
6
7
|
max_candidates: 300,
|
|
@@ -48,6 +49,11 @@ const MAX_CURATOR_PROPOSAL_RANGES_PER_SELECTION = 20;
|
|
|
48
49
|
const MAX_CURATOR_PROPOSAL_WARNINGS = 50;
|
|
49
50
|
const MAX_CURATOR_PROPOSAL_OPEN_QUESTIONS = 50;
|
|
50
51
|
const MAX_DELEGATE_PACKET_JSON_BYTES = 92_000;
|
|
52
|
+
// Neither packet bound is caller-tunable, so the only real lever is less
|
|
53
|
+
// focused material.
|
|
54
|
+
const PACKET_CAP_LEVER = "reduce or split focus_paths (workflow: cb_focus_paths)";
|
|
55
|
+
const PACKET_JSON_BYTE_CAP_OMISSION_MESSAGE = `focused or selected coverage exceeded the fixed delegate packet size (${MAX_DELEGATE_PACKET_JSON_BYTES} JSON bytes, not configurable); ${PACKET_CAP_LEVER}`;
|
|
56
|
+
const PACKET_TOKEN_CAP_OMISSION_MESSAGE = `focused or selected coverage was pruned from the delegate packet token budget; ${PACKET_CAP_LEVER}`;
|
|
51
57
|
export function buildContextBuilderCuratorPacket(input) {
|
|
52
58
|
return buildContextBuilderDelegatePacket("curator", input);
|
|
53
59
|
}
|
|
@@ -62,8 +68,15 @@ export function contextBuilderRangeId(candidateId, startLine, endLine) {
|
|
|
62
68
|
}
|
|
63
69
|
function buildContextBuilderDelegatePacket(purpose, input) {
|
|
64
70
|
const caps = normalizeCaps(input.caps, input.budget);
|
|
71
|
+
// Packet BUILD defaults allow-secrets ON to match the feature's global
|
|
72
|
+
// default (resolveAllowSecrets → true); the delegate VALIDATOR defaults
|
|
73
|
+
// fail-closed (?? false) as a conservative validation boundary. These never
|
|
74
|
+
// diverge on the live path — the handler always passes the resolved boolean
|
|
75
|
+
// to both. The asymmetry is intentional, not a missed seam.
|
|
76
|
+
const allowSecrets = input.allowSecrets ?? true;
|
|
65
77
|
const state = {
|
|
66
78
|
caps,
|
|
79
|
+
allowSecrets,
|
|
67
80
|
evidenceBytes: 0,
|
|
68
81
|
evidenceByteCapHit: false,
|
|
69
82
|
searchIncluded: 0,
|
|
@@ -76,11 +89,13 @@ function buildContextBuilderDelegatePacket(purpose, input) {
|
|
|
76
89
|
contextBuilderCandidateId(selected.root_index, selected.path),
|
|
77
90
|
index,
|
|
78
91
|
]));
|
|
79
|
-
const selectedRanges = buildSelectedRangeIndex(input.selection.selected);
|
|
80
|
-
const evidence = buildCandidateEvidenceIndex(input);
|
|
81
|
-
const
|
|
92
|
+
const selectedRanges = buildSelectedRangeIndex(input.selection.selected, allowSecrets);
|
|
93
|
+
const evidence = buildCandidateEvidenceIndex(input, allowSecrets);
|
|
94
|
+
const coveragePolicy = normalizeCoveragePolicy(input.coveragePolicy, input.discovery.review_obligations, caps);
|
|
95
|
+
const seeds = orderCandidateSeedsForCoverage(buildCandidateSeeds(input, selectedIds, selectedRanks, evidence).filter(shouldIncludeDelegateCandidateSeed), coveragePolicy);
|
|
82
96
|
const requestedCoverage = buildRequestedPacketCoverage(input, selectedRanges);
|
|
83
97
|
const requestedCoverageIndex = buildRequestedCoverageIndex(requestedCoverage);
|
|
98
|
+
const protection = buildPacketProtectionIndex(input, allowSecrets);
|
|
84
99
|
const candidates = seeds
|
|
85
100
|
.map((seed) => buildPacketCandidate(seed, input, selectedRanges, requestedCoverageIndex, state))
|
|
86
101
|
.filter((candidate) => candidate.ranges.length > 0)
|
|
@@ -88,11 +103,11 @@ function buildContextBuilderDelegatePacket(purpose, input) {
|
|
|
88
103
|
const candidatesOmittedByCountCap = Math.max(0, seeds.length - candidates.length);
|
|
89
104
|
const candidateLineCounts = new Map(candidates.map((candidate) => [candidate.id, candidate.line_count]));
|
|
90
105
|
const candidateIds = new Set(candidateLineCounts.keys());
|
|
91
|
-
const deterministicSelection = buildDeterministicSelection(input.selection.selected, candidateIds);
|
|
106
|
+
const deterministicSelection = buildDeterministicSelection(input.selection.selected, candidateIds, allowSecrets);
|
|
92
107
|
const packet = {
|
|
93
108
|
version: "context-builder.delegate-packet.v1",
|
|
94
109
|
purpose,
|
|
95
|
-
task: sanitizePacketText(input.task, caps.max_task_chars).text,
|
|
110
|
+
task: sanitizePacketText(input.task, caps.max_task_chars, allowSecrets).text,
|
|
96
111
|
rules: {
|
|
97
112
|
local_candidate_universe_only: true,
|
|
98
113
|
provider_must_not_discover_paths: true,
|
|
@@ -101,12 +116,13 @@ function buildContextBuilderDelegatePacket(purpose, input) {
|
|
|
101
116
|
raw_full_content_included: false,
|
|
102
117
|
},
|
|
103
118
|
budget: input.budget,
|
|
119
|
+
coverage_policy: coveragePolicy,
|
|
104
120
|
candidates,
|
|
105
121
|
deterministic_selection: {
|
|
106
122
|
metrics: input.selection.metrics,
|
|
107
123
|
selected: deterministicSelection,
|
|
108
124
|
},
|
|
109
|
-
omissions: buildPacketOmissions(input.discovery.omissions, input.selection.omissions, caps),
|
|
125
|
+
omissions: buildPacketOmissions(input.discovery.omissions, input.selection.omissions, caps, allowSecrets),
|
|
110
126
|
metrics: {
|
|
111
127
|
discovery: input.discovery.metrics,
|
|
112
128
|
selection: input.selection.metrics,
|
|
@@ -120,10 +136,23 @@ function buildContextBuilderDelegatePacket(purpose, input) {
|
|
|
120
136
|
evidence_byte_cap_hit: state.evidenceByteCapHit,
|
|
121
137
|
packet_estimated_tokens: 0,
|
|
122
138
|
packet_token_cap_hit: false,
|
|
139
|
+
packet_json_byte_cap_hit: false,
|
|
140
|
+
compaction: {
|
|
141
|
+
candidates_before_compaction: candidates.length,
|
|
142
|
+
candidates_after_compaction: candidates.length,
|
|
143
|
+
candidates_evicted_by_compaction: 0,
|
|
144
|
+
evidence_bytes_before_compaction: 0,
|
|
145
|
+
evidence_bytes_after_compaction: 0,
|
|
146
|
+
search_records_before_compaction: 0,
|
|
147
|
+
search_records_after_compaction: 0,
|
|
148
|
+
slice_records_before_compaction: 0,
|
|
149
|
+
slice_records_after_compaction: 0,
|
|
150
|
+
all_non_focus_candidates_evidence_free: false,
|
|
151
|
+
},
|
|
123
152
|
},
|
|
124
153
|
...(purpose === "finalizer" && "curator_proposal" in input
|
|
125
154
|
? {
|
|
126
|
-
curator_proposal: sanitizeCuratorProposal(input.curator_proposal, candidateLineCounts, caps),
|
|
155
|
+
curator_proposal: sanitizeCuratorProposal(input.curator_proposal, candidateLineCounts, caps, allowSecrets),
|
|
127
156
|
local_selection_summary: {
|
|
128
157
|
selected: deterministicSelection,
|
|
129
158
|
},
|
|
@@ -131,16 +160,17 @@ function buildContextBuilderDelegatePacket(purpose, input) {
|
|
|
131
160
|
: {}),
|
|
132
161
|
};
|
|
133
162
|
syncSelectionSummariesToCandidateRanges(packet);
|
|
134
|
-
enforcePacketTokenCap(packet, caps, requestedCoverageIndex);
|
|
163
|
+
enforcePacketTokenCap(packet, caps, requestedCoverageIndex, protection);
|
|
135
164
|
syncCandidateCoverageToPacketRanges(packet);
|
|
136
165
|
syncSelectionSummariesToCandidateRanges(packet);
|
|
137
166
|
appendMissingRequestedCoverageOmissions(packet, requestedCoverage);
|
|
138
167
|
return packet;
|
|
139
168
|
}
|
|
140
169
|
function buildCandidateSeeds(input, selectedIds, selectedRanks, evidence) {
|
|
170
|
+
const allowSecrets = input.allowSecrets ?? true;
|
|
141
171
|
const eligibleTree = new Map();
|
|
142
172
|
for (const file of input.discovery.tree) {
|
|
143
|
-
const normalized = normalizePacketPath(file.path);
|
|
173
|
+
const normalized = normalizePacketPath(file.path, allowSecrets);
|
|
144
174
|
if (normalized == null ||
|
|
145
175
|
!file.eligible ||
|
|
146
176
|
!file.content_eligible ||
|
|
@@ -154,7 +184,7 @@ function buildCandidateSeeds(input, selectedIds, selectedRanks, evidence) {
|
|
|
154
184
|
}
|
|
155
185
|
const seeds = [];
|
|
156
186
|
for (const candidate of input.discovery.content_candidates) {
|
|
157
|
-
const normalized = normalizePacketPath(candidate.path);
|
|
187
|
+
const normalized = normalizePacketPath(candidate.path, allowSecrets);
|
|
158
188
|
if (normalized == null) {
|
|
159
189
|
continue;
|
|
160
190
|
}
|
|
@@ -163,6 +193,7 @@ function buildCandidateSeeds(input, selectedIds, selectedRanks, evidence) {
|
|
|
163
193
|
continue;
|
|
164
194
|
}
|
|
165
195
|
const id = contextBuilderCandidateId(candidate.root_index, normalized);
|
|
196
|
+
const classifiedCandidate = candidate;
|
|
166
197
|
seeds.push({
|
|
167
198
|
id,
|
|
168
199
|
root_index: candidate.root_index,
|
|
@@ -175,6 +206,7 @@ function buildCandidateSeeds(input, selectedIds, selectedRanks, evidence) {
|
|
|
175
206
|
has_focus_evidence: evidence.focusIds.has(id),
|
|
176
207
|
has_slice_evidence: evidence.sliceIds.has(id),
|
|
177
208
|
has_search_evidence: evidence.searchIds.has(id),
|
|
209
|
+
evidence_classes: orderEvidenceClasses(classifiedCandidate.evidence_classes ?? []),
|
|
178
210
|
});
|
|
179
211
|
}
|
|
180
212
|
return seeds.sort(compareCandidateSeeds);
|
|
@@ -188,12 +220,12 @@ function shouldIncludeDelegateCandidateSeed(seed) {
|
|
|
188
220
|
function isWorkbenchArtifactPath(path) {
|
|
189
221
|
return path.startsWith(".ai/") || path.includes("/.ai/");
|
|
190
222
|
}
|
|
191
|
-
function buildCandidateEvidenceIndex(input) {
|
|
223
|
+
function buildCandidateEvidenceIndex(input, allowSecrets) {
|
|
192
224
|
const focusIds = new Set(input.discovery.slices
|
|
193
225
|
.filter((slice) => slice.source === "focus")
|
|
194
226
|
.map((slice) => contextBuilderCandidateId(slice.root_index, slice.path)));
|
|
195
227
|
for (const candidate of input.discovery.content_candidates) {
|
|
196
|
-
const normalized = normalizePacketPath(candidate.path);
|
|
228
|
+
const normalized = normalizePacketPath(candidate.path, allowSecrets);
|
|
197
229
|
if (normalized != null &&
|
|
198
230
|
candidateMatchesFocusPath(candidate.root_index, normalized, input.focus_paths ?? [])) {
|
|
199
231
|
focusIds.add(contextBuilderCandidateId(candidate.root_index, normalized));
|
|
@@ -232,6 +264,7 @@ function buildPacketCandidate(seed, input, selectedRanges, requestedCoverage, st
|
|
|
232
264
|
size_bytes: seed.size_bytes,
|
|
233
265
|
estimated_tokens: seed.estimated_tokens,
|
|
234
266
|
discovery_reason: discoveryReason(ranges, searchHits),
|
|
267
|
+
evidence_classes: [...seed.evidence_classes],
|
|
235
268
|
focus_requested: seed.has_focus_evidence,
|
|
236
269
|
...(requiredFocusRanges.length === 0
|
|
237
270
|
? {}
|
|
@@ -244,10 +277,10 @@ function buildPacketCandidate(seed, input, selectedRanges, requestedCoverage, st
|
|
|
244
277
|
search_hits: searchHits,
|
|
245
278
|
};
|
|
246
279
|
}
|
|
247
|
-
function buildSelectedRangeIndex(selected) {
|
|
280
|
+
function buildSelectedRangeIndex(selected, allowSecrets) {
|
|
248
281
|
const byCandidate = new Map();
|
|
249
282
|
for (const file of selected) {
|
|
250
|
-
const normalized = normalizePacketPath(file.path);
|
|
283
|
+
const normalized = normalizePacketPath(file.path, allowSecrets);
|
|
251
284
|
if (normalized == null) {
|
|
252
285
|
continue;
|
|
253
286
|
}
|
|
@@ -279,14 +312,14 @@ function buildRequestedPacketCoverage(input, selectedRanges) {
|
|
|
279
312
|
};
|
|
280
313
|
for (const [candidateId, ranges] of selectedRanges) {
|
|
281
314
|
const selection = input.selection.selected.find((file) => {
|
|
282
|
-
const normalized = normalizePacketPath(file.path);
|
|
315
|
+
const normalized = normalizePacketPath(file.path, input.allowSecrets ?? true);
|
|
283
316
|
return (normalized != null &&
|
|
284
317
|
contextBuilderCandidateId(file.root_index, normalized) === candidateId);
|
|
285
318
|
});
|
|
286
319
|
if (selection == null) {
|
|
287
320
|
continue;
|
|
288
321
|
}
|
|
289
|
-
const normalized = normalizePacketPath(selection.path);
|
|
322
|
+
const normalized = normalizePacketPath(selection.path, input.allowSecrets ?? true);
|
|
290
323
|
if (normalized == null) {
|
|
291
324
|
continue;
|
|
292
325
|
}
|
|
@@ -298,7 +331,7 @@ function buildRequestedPacketCoverage(input, selectedRanges) {
|
|
|
298
331
|
}
|
|
299
332
|
}
|
|
300
333
|
for (const slice of input.discovery.slices) {
|
|
301
|
-
const normalized = normalizePacketPath(slice.path);
|
|
334
|
+
const normalized = normalizePacketPath(slice.path, input.allowSecrets ?? true);
|
|
302
335
|
if (normalized == null) {
|
|
303
336
|
continue;
|
|
304
337
|
}
|
|
@@ -314,6 +347,24 @@ function buildRequestedPacketCoverage(input, selectedRanges) {
|
|
|
314
347
|
end_line: slice.end_line,
|
|
315
348
|
});
|
|
316
349
|
}
|
|
350
|
+
for (const target of input.discovery.review_obligations?.targets ?? []) {
|
|
351
|
+
for (const range of target.ranges) {
|
|
352
|
+
appendRange(target.root_index, target.path, {
|
|
353
|
+
id: contextBuilderRangeId(target.candidate_id, range.start_line, range.end_line),
|
|
354
|
+
start_line: range.start_line,
|
|
355
|
+
end_line: range.end_line,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
for (const link of target.regression_links) {
|
|
359
|
+
for (const range of link.ranges) {
|
|
360
|
+
appendRange(link.root_index, link.path, {
|
|
361
|
+
id: contextBuilderRangeId(link.candidate_id, range.start_line, range.end_line),
|
|
362
|
+
start_line: range.start_line,
|
|
363
|
+
end_line: range.end_line,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
317
368
|
return [...requestedByCandidate.values()].map((coverage) => ({
|
|
318
369
|
...coverage,
|
|
319
370
|
ranges: coverage.ranges.sort((left, right) => left.start_line - right.start_line || left.end_line - right.end_line),
|
|
@@ -397,10 +448,10 @@ function buildSearchHits(seed, search, state) {
|
|
|
397
448
|
}
|
|
398
449
|
return hits;
|
|
399
450
|
}
|
|
400
|
-
function buildDeterministicSelection(selected, candidateIds) {
|
|
451
|
+
function buildDeterministicSelection(selected, candidateIds, allowSecrets) {
|
|
401
452
|
return selected
|
|
402
453
|
.map((file) => {
|
|
403
|
-
const normalized = normalizePacketPath(file.path);
|
|
454
|
+
const normalized = normalizePacketPath(file.path, allowSecrets);
|
|
404
455
|
if (normalized == null) {
|
|
405
456
|
return undefined;
|
|
406
457
|
}
|
|
@@ -424,7 +475,7 @@ function buildDeterministicSelection(selected, candidateIds) {
|
|
|
424
475
|
})
|
|
425
476
|
.filter((item) => item != null);
|
|
426
477
|
}
|
|
427
|
-
function sanitizeCuratorProposal(proposal, candidateLineCounts, caps) {
|
|
478
|
+
function sanitizeCuratorProposal(proposal, candidateLineCounts, caps, allowSecrets) {
|
|
428
479
|
const maxSelected = Math.min(caps.max_candidates, MAX_CURATOR_PROPOSAL_SELECTED);
|
|
429
480
|
const maxRangesPerSelection = Math.min(caps.max_paths_per_omission, MAX_CURATOR_PROPOSAL_RANGES_PER_SELECTION);
|
|
430
481
|
const maxWarnings = Math.min(caps.max_omissions, MAX_CURATOR_PROPOSAL_WARNINGS);
|
|
@@ -444,9 +495,9 @@ function sanitizeCuratorProposal(proposal, candidateLineCounts, caps) {
|
|
|
444
495
|
.map((range) => ({
|
|
445
496
|
start_line: range.start_line,
|
|
446
497
|
end_line: range.end_line,
|
|
447
|
-
reason: sanitizePacketText(range.reason, caps.max_preview_bytes).text,
|
|
498
|
+
reason: sanitizePacketText(range.reason, caps.max_preview_bytes, allowSecrets).text,
|
|
448
499
|
})),
|
|
449
|
-
reason: sanitizePacketText(selection.reason, caps.max_preview_bytes).text,
|
|
500
|
+
reason: sanitizePacketText(selection.reason, caps.max_preview_bytes, allowSecrets).text,
|
|
450
501
|
};
|
|
451
502
|
})
|
|
452
503
|
.filter((selection) => selection != null && selection.ranges.length > 0)
|
|
@@ -454,13 +505,13 @@ function sanitizeCuratorProposal(proposal, candidateLineCounts, caps) {
|
|
|
454
505
|
.slice(0, maxSelected),
|
|
455
506
|
warnings: proposal.warnings
|
|
456
507
|
.slice(0, maxWarnings)
|
|
457
|
-
.map((warning) => sanitizePacketText(warning, caps.max_preview_bytes).text),
|
|
508
|
+
.map((warning) => sanitizePacketText(warning, caps.max_preview_bytes, allowSecrets).text),
|
|
458
509
|
open_questions: proposal.open_questions
|
|
459
510
|
.slice(0, maxOpenQuestions)
|
|
460
|
-
.map((question) => sanitizePacketText(question, caps.max_preview_bytes).text),
|
|
511
|
+
.map((question) => sanitizePacketText(question, caps.max_preview_bytes, allowSecrets).text),
|
|
461
512
|
};
|
|
462
513
|
}
|
|
463
|
-
function buildPacketOmissions(discoveryOmissions, selectionOmissions, caps) {
|
|
514
|
+
function buildPacketOmissions(discoveryOmissions, selectionOmissions, caps, allowSecrets) {
|
|
464
515
|
return boundContextBuilderOmissions([...discoveryOmissions, ...selectionOmissions].map((omission) => ({
|
|
465
516
|
...(omission.root_index == null ? {} : { root_index: omission.root_index }),
|
|
466
517
|
reason: omission.reason,
|
|
@@ -469,7 +520,7 @@ function buildPacketOmissions(discoveryOmissions, selectionOmissions, caps) {
|
|
|
469
520
|
? {}
|
|
470
521
|
: {
|
|
471
522
|
paths: omission.paths
|
|
472
|
-
.map(normalizePacketPath)
|
|
523
|
+
.map((path) => normalizePacketPath(path, allowSecrets))
|
|
473
524
|
.filter((item) => item != null),
|
|
474
525
|
}),
|
|
475
526
|
})), {
|
|
@@ -477,48 +528,212 @@ function buildPacketOmissions(discoveryOmissions, selectionOmissions, caps) {
|
|
|
477
528
|
max_paths_per_omission: caps.max_paths_per_omission,
|
|
478
529
|
});
|
|
479
530
|
}
|
|
480
|
-
function enforcePacketTokenCap(packet, caps, requestedCoverage) {
|
|
531
|
+
function enforcePacketTokenCap(packet, caps, requestedCoverage, protection) {
|
|
481
532
|
const maxTokens = Math.max(1, caps.max_packet_estimated_tokens);
|
|
533
|
+
const before = countPacketEvidence(packet);
|
|
534
|
+
const compaction = packet.metrics.compaction;
|
|
535
|
+
compaction.candidates_before_compaction = packet.candidates.length;
|
|
536
|
+
compaction.evidence_bytes_before_compaction = before.evidenceBytes;
|
|
537
|
+
compaction.search_records_before_compaction = before.searchRecords;
|
|
538
|
+
compaction.slice_records_before_compaction = before.sliceRecords;
|
|
539
|
+
refreshPacketCompactionState(packet);
|
|
482
540
|
packet.metrics.packet_estimated_tokens = estimatePacketTokens(packet);
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
541
|
+
// Attribute pruning to the bound that actually binds. An oversized packet
|
|
542
|
+
// usually exceeds both at first, but only the tighter one decides where
|
|
543
|
+
// reduction stops; the fixed JSON-byte bound binds before the token bound
|
|
544
|
+
// at the default caps, and naming the wrong one sends callers after a lever
|
|
545
|
+
// that does not exist.
|
|
546
|
+
const jsonBytesTighter = estimateContextBuilderTokensFromUtf8Bytes(MAX_DELEGATE_PACKET_JSON_BYTES) <=
|
|
547
|
+
maxTokens;
|
|
548
|
+
const markBindingBound = (overTokens, overJsonBytes) => {
|
|
549
|
+
if (overJsonBytes && (!overTokens || jsonBytesTighter)) {
|
|
550
|
+
packet.metrics.packet_json_byte_cap_hit = true;
|
|
489
551
|
}
|
|
490
|
-
if (
|
|
552
|
+
else if (overTokens) {
|
|
491
553
|
packet.metrics.packet_token_cap_hit = true;
|
|
492
|
-
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
while (true) {
|
|
557
|
+
const overTokens = packet.metrics.packet_estimated_tokens > maxTokens;
|
|
558
|
+
const overJsonBytes = estimatePacketJsonBytes(packet) > MAX_DELEGATE_PACKET_JSON_BYTES;
|
|
559
|
+
if (!overTokens && !overJsonBytes) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
// Reduction ladder: evict low-value candidates before touching evidence,
|
|
563
|
+
// preserve one discriminative evidence item on protected candidates
|
|
564
|
+
// (focus, deterministic-baseline, exact-caller-hit) for as long as they
|
|
565
|
+
// remain in the packet, and only fall back to unrestricted stripping when
|
|
566
|
+
// nothing else can shrink the packet — caps stay hard.
|
|
567
|
+
const reduced = evictOneCompactionCandidate(packet, requestedCoverage, protection, "no_evidence") ||
|
|
568
|
+
evictOneCompactionCandidate(packet, requestedCoverage, protection, "unprotected") ||
|
|
569
|
+
dropOneCuratorProposalMetadata(packet) ||
|
|
570
|
+
dropOneEvidence(packet, protection) ||
|
|
571
|
+
dropOneCandidateRecord(packet, requestedCoverage, protection) ||
|
|
572
|
+
dropOneCandidate(packet, requestedCoverage) ||
|
|
573
|
+
dropOneEvidence(packet, null) ||
|
|
574
|
+
dropOneCandidateRecord(packet, requestedCoverage, null);
|
|
575
|
+
markBindingBound(overTokens, overJsonBytes);
|
|
576
|
+
refreshPacketCompactionState(packet);
|
|
577
|
+
packet.metrics.packet_estimated_tokens = estimatePacketTokens(packet);
|
|
578
|
+
if (!reduced) {
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
function countPacketEvidence(packet) {
|
|
584
|
+
let evidenceBytes = 0;
|
|
585
|
+
let searchRecords = 0;
|
|
586
|
+
let sliceRecords = 0;
|
|
587
|
+
for (const candidate of packet.candidates) {
|
|
588
|
+
sliceRecords += candidate.ranges.length;
|
|
589
|
+
searchRecords += candidate.search_hits.length;
|
|
590
|
+
for (const range of candidate.ranges) {
|
|
591
|
+
evidenceBytes += Buffer.byteLength(range.excerpt, "utf8");
|
|
592
|
+
}
|
|
593
|
+
for (const hit of candidate.search_hits) {
|
|
594
|
+
evidenceBytes += Buffer.byteLength(hit.preview, "utf8");
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return { evidenceBytes, searchRecords, sliceRecords };
|
|
598
|
+
}
|
|
599
|
+
function refreshPacketCompactionState(packet) {
|
|
600
|
+
const counts = countPacketEvidence(packet);
|
|
601
|
+
const compaction = packet.metrics.compaction;
|
|
602
|
+
compaction.candidates_after_compaction = packet.candidates.length;
|
|
603
|
+
compaction.candidates_evicted_by_compaction = Math.max(0, compaction.candidates_before_compaction - packet.candidates.length);
|
|
604
|
+
compaction.evidence_bytes_after_compaction = counts.evidenceBytes;
|
|
605
|
+
compaction.search_records_after_compaction = counts.searchRecords;
|
|
606
|
+
compaction.slice_records_after_compaction = counts.sliceRecords;
|
|
607
|
+
const nonFocusCandidates = packet.candidates.filter((candidate) => candidate.focus_requested !== true);
|
|
608
|
+
const evidenceFree = nonFocusCandidates.length > 0 &&
|
|
609
|
+
nonFocusCandidates.every((candidate) => !candidateHasEvidence(candidate));
|
|
610
|
+
compaction.all_non_focus_candidates_evidence_free = evidenceFree;
|
|
611
|
+
if (evidenceFree) {
|
|
612
|
+
packet.evidence_warning = {
|
|
613
|
+
code: "all_non_focus_candidates_evidence_free",
|
|
614
|
+
message: "packet compaction left every non-focus candidate without a search-hit preview or slice excerpt; non-focus candidates carry path metadata only",
|
|
615
|
+
non_focus_candidate_count: nonFocusCandidates.length,
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
delete packet.evidence_warning;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function buildPacketProtectionIndex(input, allowSecrets) {
|
|
623
|
+
const callerTerms = new Set((input.caller_search_terms ?? [])
|
|
624
|
+
.map((term) => term.trim())
|
|
625
|
+
.filter((term) => term.length > 0));
|
|
626
|
+
const callerHitIds = new Set();
|
|
627
|
+
const callerTermIndexes = new Set();
|
|
628
|
+
if (callerTerms.size > 0) {
|
|
629
|
+
for (const record of input.discovery.search) {
|
|
630
|
+
if (!callerTerms.has(record.search_term.trim())) {
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
callerTermIndexes.add(record.search_term_index);
|
|
634
|
+
const normalized = normalizePacketPath(record.path, allowSecrets);
|
|
635
|
+
if (normalized != null) {
|
|
636
|
+
callerHitIds.add(contextBuilderCandidateId(record.root_index, normalized));
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return { callerHitIds, callerTermIndexes };
|
|
641
|
+
}
|
|
642
|
+
function isProtectedPacketCandidate(candidate, protection) {
|
|
643
|
+
return (candidate.focus_requested === true ||
|
|
644
|
+
candidate.deterministic_selected ||
|
|
645
|
+
protection.callerHitIds.has(candidate.id));
|
|
646
|
+
}
|
|
647
|
+
function candidateHasEvidence(candidate) {
|
|
648
|
+
return (candidate.ranges.some((range) => range.excerpt.length > 0) ||
|
|
649
|
+
candidate.search_hits.some((hit) => hit.preview.length > 0));
|
|
650
|
+
}
|
|
651
|
+
function reservedEvidenceFor(candidate, protection) {
|
|
652
|
+
if (!isProtectedPacketCandidate(candidate, protection)) {
|
|
653
|
+
return null;
|
|
654
|
+
}
|
|
655
|
+
if (protection.callerHitIds.has(candidate.id)) {
|
|
656
|
+
const callerHitIndex = candidate.search_hits.findIndex((hit) => hit.preview.length > 0 &&
|
|
657
|
+
protection.callerTermIndexes.has(hit.search_term_index));
|
|
658
|
+
if (callerHitIndex >= 0) {
|
|
659
|
+
return { kind: "hit", index: callerHitIndex };
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
const rangeIndex = candidate.ranges.findIndex((range) => range.excerpt.length > 0);
|
|
663
|
+
if (rangeIndex >= 0) {
|
|
664
|
+
return { kind: "range", index: rangeIndex };
|
|
665
|
+
}
|
|
666
|
+
const hitIndex = candidate.search_hits.findIndex((hit) => hit.preview.length > 0);
|
|
667
|
+
if (hitIndex >= 0) {
|
|
668
|
+
return { kind: "hit", index: hitIndex };
|
|
669
|
+
}
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
function evictOneCompactionCandidate(packet, requestedCoverage, protection, mode) {
|
|
673
|
+
if (packet.candidates.length <= 1) {
|
|
674
|
+
return false;
|
|
675
|
+
}
|
|
676
|
+
for (let index = packet.candidates.length - 1; index >= 0; index -= 1) {
|
|
677
|
+
const candidate = packet.candidates[index];
|
|
678
|
+
if (candidate == null || isProtectedPacketCandidate(candidate, protection)) {
|
|
493
679
|
continue;
|
|
494
680
|
}
|
|
495
|
-
if (
|
|
496
|
-
packet.metrics.packet_token_cap_hit = true;
|
|
497
|
-
packet.metrics.packet_estimated_tokens = estimatePacketTokens(packet);
|
|
681
|
+
if (mode === "no_evidence" && candidateHasEvidence(candidate)) {
|
|
498
682
|
continue;
|
|
499
683
|
}
|
|
500
|
-
if (
|
|
501
|
-
packet.
|
|
502
|
-
packet
|
|
684
|
+
if (requestedCoverage.has(candidate.id) ||
|
|
685
|
+
wouldRemoveCuratorProposalSelection(packet, candidate.id) ||
|
|
686
|
+
wouldRemoveRequiredEvidenceClass(packet, candidate)) {
|
|
503
687
|
continue;
|
|
504
688
|
}
|
|
505
|
-
packet
|
|
506
|
-
|
|
689
|
+
evictPacketCandidateAt(packet, index);
|
|
690
|
+
return true;
|
|
691
|
+
}
|
|
692
|
+
return false;
|
|
693
|
+
}
|
|
694
|
+
function evictPacketCandidateAt(packet, index) {
|
|
695
|
+
const candidate = packet.candidates[index];
|
|
696
|
+
if (candidate == null) {
|
|
507
697
|
return;
|
|
508
698
|
}
|
|
699
|
+
packet.candidates.splice(index, 1);
|
|
700
|
+
packet.metrics.candidates_included = packet.candidates.length;
|
|
701
|
+
packet.metrics.candidates_omitted_by_packet_cap += 1;
|
|
702
|
+
for (const range of candidate.ranges) {
|
|
703
|
+
packet.metrics.evidence_bytes -= Buffer.byteLength(range.excerpt, "utf8");
|
|
704
|
+
}
|
|
705
|
+
for (const hit of candidate.search_hits) {
|
|
706
|
+
packet.metrics.evidence_bytes -= Buffer.byteLength(hit.preview, "utf8");
|
|
707
|
+
}
|
|
708
|
+
packet.metrics.search_records_omitted_by_packet_cap += candidate.search_hits.length;
|
|
709
|
+
packet.metrics.slice_records_omitted_by_packet_cap += candidate.ranges.length;
|
|
710
|
+
pruneReferencesToCandidate(packet, candidate.id);
|
|
509
711
|
}
|
|
510
|
-
function dropOneEvidence(packet) {
|
|
712
|
+
function dropOneEvidence(packet, protection) {
|
|
511
713
|
for (const candidate of [...packet.candidates].reverse()) {
|
|
512
|
-
const
|
|
513
|
-
|
|
714
|
+
const reserved = protection == null ? null : reservedEvidenceFor(candidate, protection);
|
|
715
|
+
for (let index = candidate.ranges.length - 1; index >= 0; index -= 1) {
|
|
716
|
+
if (reserved?.kind === "range" && reserved.index === index) {
|
|
717
|
+
continue;
|
|
718
|
+
}
|
|
719
|
+
const range = candidate.ranges[index];
|
|
720
|
+
if (range == null || range.excerpt.length === 0) {
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
514
723
|
packet.metrics.evidence_bytes -= Buffer.byteLength(range.excerpt, "utf8");
|
|
515
724
|
range.excerpt = "";
|
|
516
725
|
range.excerpt_truncated = true;
|
|
517
726
|
packet.metrics.evidence_byte_cap_hit = true;
|
|
518
727
|
return true;
|
|
519
728
|
}
|
|
520
|
-
|
|
521
|
-
|
|
729
|
+
for (let index = candidate.search_hits.length - 1; index >= 0; index -= 1) {
|
|
730
|
+
if (reserved?.kind === "hit" && reserved.index === index) {
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
const hit = candidate.search_hits[index];
|
|
734
|
+
if (hit == null || hit.preview.length === 0) {
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
522
737
|
packet.metrics.evidence_bytes -= Buffer.byteLength(hit.preview, "utf8");
|
|
523
738
|
hit.preview = "";
|
|
524
739
|
hit.preview_truncated = true;
|
|
@@ -553,22 +768,37 @@ function dropOneCuratorProposalMetadata(packet) {
|
|
|
553
768
|
}
|
|
554
769
|
return false;
|
|
555
770
|
}
|
|
556
|
-
function dropOneCandidateRecord(packet, requestedCoverage) {
|
|
771
|
+
function dropOneCandidateRecord(packet, requestedCoverage, protection) {
|
|
557
772
|
for (const candidate of [...packet.candidates].reverse()) {
|
|
558
|
-
const
|
|
559
|
-
|
|
773
|
+
const reserved = protection == null ? null : reservedEvidenceFor(candidate, protection);
|
|
774
|
+
for (let index = candidate.search_hits.length - 1; index >= 0; index -= 1) {
|
|
775
|
+
if (reserved?.kind === "hit" && reserved.index === index) {
|
|
776
|
+
continue;
|
|
777
|
+
}
|
|
778
|
+
const hit = candidate.search_hits[index];
|
|
779
|
+
if (hit == null) {
|
|
780
|
+
continue;
|
|
781
|
+
}
|
|
782
|
+
candidate.search_hits.splice(index, 1);
|
|
560
783
|
packet.metrics.evidence_bytes -= Buffer.byteLength(hit.preview, "utf8");
|
|
561
784
|
packet.metrics.search_records_omitted_by_packet_cap += 1;
|
|
562
785
|
return true;
|
|
563
786
|
}
|
|
564
787
|
if (candidate.ranges.length > 1) {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
788
|
+
for (let index = candidate.ranges.length - 1; index >= 0; index -= 1) {
|
|
789
|
+
if (reserved?.kind === "range" && reserved.index === index) {
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
792
|
+
const range = candidate.ranges[index];
|
|
793
|
+
if (range == null) {
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
const remaining = candidate.ranges.filter((_, rangeIndex) => rangeIndex !== index);
|
|
797
|
+
if (!curatorProposalStillCovered(packet, candidate.id, remaining) ||
|
|
798
|
+
!requestedCoverageStillCovered(requestedCoverage, candidate.id, remaining)) {
|
|
570
799
|
continue;
|
|
571
800
|
}
|
|
801
|
+
candidate.ranges.splice(index, 1);
|
|
572
802
|
packet.metrics.evidence_bytes -= Buffer.byteLength(range.excerpt, "utf8");
|
|
573
803
|
packet.metrics.slice_records_omitted_by_packet_cap += 1;
|
|
574
804
|
pruneReferencesToRange(packet, candidate.id, range.id);
|
|
@@ -586,17 +816,21 @@ function dropOneCandidate(packet, requestedCoverage) {
|
|
|
586
816
|
const candidate = packet.candidates[index];
|
|
587
817
|
if (candidate == null ||
|
|
588
818
|
requestedCoverage.has(candidate.id) ||
|
|
589
|
-
wouldRemoveCuratorProposalSelection(packet, candidate.id)
|
|
819
|
+
wouldRemoveCuratorProposalSelection(packet, candidate.id) ||
|
|
820
|
+
wouldRemoveRequiredEvidenceClass(packet, candidate)) {
|
|
590
821
|
continue;
|
|
591
822
|
}
|
|
592
|
-
packet
|
|
593
|
-
packet.metrics.candidates_included = packet.candidates.length;
|
|
594
|
-
packet.metrics.candidates_omitted_by_packet_cap += 1;
|
|
595
|
-
pruneReferencesToCandidate(packet, candidate.id);
|
|
823
|
+
evictPacketCandidateAt(packet, index);
|
|
596
824
|
return true;
|
|
597
825
|
}
|
|
598
826
|
return false;
|
|
599
827
|
}
|
|
828
|
+
function wouldRemoveRequiredEvidenceClass(packet, candidate) {
|
|
829
|
+
const required = new Set(packet.coverage_policy.required_when_available);
|
|
830
|
+
return candidate.evidence_classes.some((evidenceClass) => required.has(evidenceClass) &&
|
|
831
|
+
!packet.candidates.some((other) => other.id !== candidate.id &&
|
|
832
|
+
other.evidence_classes.includes(evidenceClass)));
|
|
833
|
+
}
|
|
600
834
|
function buildRequestedCoverageIndex(requestedCoverage) {
|
|
601
835
|
return new Map(requestedCoverage.map((coverage) => [coverage.candidate_id, coverage.ranges]));
|
|
602
836
|
}
|
|
@@ -662,12 +896,16 @@ function appendMissingRequestedCoverageOmissions(packet, requestedCoverage) {
|
|
|
662
896
|
}
|
|
663
897
|
packet.omissions.push(requestedEvidenceOmission({
|
|
664
898
|
root_index: coverage.root_index,
|
|
665
|
-
kind: packet.metrics.
|
|
666
|
-
? "
|
|
667
|
-
:
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
899
|
+
kind: packet.metrics.packet_json_byte_cap_hit
|
|
900
|
+
? "packet_json_byte_cap"
|
|
901
|
+
: packet.metrics.packet_token_cap_hit
|
|
902
|
+
? "packet_token_cap"
|
|
903
|
+
: "candidate_cap",
|
|
904
|
+
message: packet.metrics.packet_json_byte_cap_hit
|
|
905
|
+
? PACKET_JSON_BYTE_CAP_OMISSION_MESSAGE
|
|
906
|
+
: packet.metrics.packet_token_cap_hit
|
|
907
|
+
? PACKET_TOKEN_CAP_OMISSION_MESSAGE
|
|
908
|
+
: "focused or selected coverage could not be represented within delegate packet candidate caps",
|
|
671
909
|
paths: [coverage.path],
|
|
672
910
|
}));
|
|
673
911
|
existingRequestedOmissionPaths.add(coverage.path);
|
|
@@ -764,15 +1002,15 @@ function takeEvidenceText(text, maxBytes, state) {
|
|
|
764
1002
|
return { text: "", truncated: true };
|
|
765
1003
|
}
|
|
766
1004
|
const remaining = state.caps.max_total_evidence_bytes - state.evidenceBytes;
|
|
767
|
-
const bounded = sanitizePacketText(text, Math.min(maxBytes, remaining));
|
|
1005
|
+
const bounded = sanitizePacketText(text, Math.min(maxBytes, remaining), state.allowSecrets);
|
|
768
1006
|
state.evidenceBytes += Buffer.byteLength(bounded.text, "utf8");
|
|
769
1007
|
if (bounded.truncated || state.evidenceBytes >= state.caps.max_total_evidence_bytes) {
|
|
770
1008
|
state.evidenceByteCapHit = true;
|
|
771
1009
|
}
|
|
772
1010
|
return bounded;
|
|
773
1011
|
}
|
|
774
|
-
function sanitizePacketText(text, maxBytes) {
|
|
775
|
-
const secretSafe =
|
|
1012
|
+
function sanitizePacketText(text, maxBytes, allowSecrets) {
|
|
1013
|
+
const secretSafe = !allowSecrets && hasConservativeResidualSecret(text)
|
|
776
1014
|
? "[redacted-sensitive]"
|
|
777
1015
|
: redactAbsolutePaths(text);
|
|
778
1016
|
return boundUtf8(secretSafe.replace(/\u0000/g, "?"), maxBytes);
|
|
@@ -791,7 +1029,7 @@ function boundUtf8(text, maxBytes) {
|
|
|
791
1029
|
}
|
|
792
1030
|
return { text: output, truncated: false };
|
|
793
1031
|
}
|
|
794
|
-
function normalizePacketPath(input) {
|
|
1032
|
+
function normalizePacketPath(input, allowSecrets) {
|
|
795
1033
|
if (input.includes("\u0000") ||
|
|
796
1034
|
input.startsWith("/") ||
|
|
797
1035
|
input.startsWith("\\") ||
|
|
@@ -800,7 +1038,8 @@ function normalizePacketPath(input) {
|
|
|
800
1038
|
}
|
|
801
1039
|
try {
|
|
802
1040
|
const normalized = normalizeContextBuilderRootRelativePath(input);
|
|
803
|
-
if (normalized === "" ||
|
|
1041
|
+
if (normalized === "" ||
|
|
1042
|
+
(!allowSecrets && scanSecretPath(normalized).length > 0)) {
|
|
804
1043
|
return undefined;
|
|
805
1044
|
}
|
|
806
1045
|
return normalized;
|
|
@@ -828,6 +1067,101 @@ function normalizeCaps(caps, budget) {
|
|
|
828
1067
|
max_packet_estimated_tokens: positiveInteger(merged.max_packet_estimated_tokens),
|
|
829
1068
|
};
|
|
830
1069
|
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Observability-only count of what normalizeCoveragePolicy sliced off the
|
|
1072
|
+
* review obligations it serializes into the packet. Terminal coverage
|
|
1073
|
+
* evaluation (review-coverage.ts) always uses the FULL discovery obligation
|
|
1074
|
+
* set, so a delegate can satisfy every packet obligation and the run can still
|
|
1075
|
+
* report degraded coverage. Returns undefined when nothing was sliced.
|
|
1076
|
+
* "ranges" counts target ranges plus regression-link ranges.
|
|
1077
|
+
*/
|
|
1078
|
+
export function countDelegatePacketObligationTruncation(fullObligations, packetPolicy) {
|
|
1079
|
+
if (fullObligations == null || packetPolicy.obligations == null) {
|
|
1080
|
+
return undefined;
|
|
1081
|
+
}
|
|
1082
|
+
const tally = (model) => ({
|
|
1083
|
+
targets: model.targets.length,
|
|
1084
|
+
ranges: model.targets.reduce((total, target) => total +
|
|
1085
|
+
target.ranges.length +
|
|
1086
|
+
target.regression_links.reduce((linkTotal, link) => linkTotal + link.ranges.length, 0), 0),
|
|
1087
|
+
links: model.targets.reduce((total, target) => total + target.regression_links.length, 0),
|
|
1088
|
+
});
|
|
1089
|
+
const full = tally(fullObligations);
|
|
1090
|
+
const included = tally(packetPolicy.obligations);
|
|
1091
|
+
if (full.targets === included.targets &&
|
|
1092
|
+
full.ranges === included.ranges &&
|
|
1093
|
+
full.links === included.links) {
|
|
1094
|
+
return undefined;
|
|
1095
|
+
}
|
|
1096
|
+
return {
|
|
1097
|
+
targets_total: full.targets,
|
|
1098
|
+
targets_included: included.targets,
|
|
1099
|
+
ranges_total: full.ranges,
|
|
1100
|
+
ranges_included: included.ranges,
|
|
1101
|
+
regression_links_total: full.links,
|
|
1102
|
+
regression_links_included: included.links,
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
function normalizeCoveragePolicy(policy, obligations, caps) {
|
|
1106
|
+
if (policy?.id !== "review_deep_v1") {
|
|
1107
|
+
return { policy_id: null, required_when_available: [] };
|
|
1108
|
+
}
|
|
1109
|
+
return {
|
|
1110
|
+
policy_id: policy.id,
|
|
1111
|
+
required_when_available: orderEvidenceClasses(policy.required_when_available),
|
|
1112
|
+
...(obligations == null
|
|
1113
|
+
? {}
|
|
1114
|
+
: {
|
|
1115
|
+
obligations: {
|
|
1116
|
+
targets: obligations.targets.slice(0, caps.max_candidates).map((target) => ({
|
|
1117
|
+
...target,
|
|
1118
|
+
ranges: target.ranges.slice(0, caps.max_paths_per_omission),
|
|
1119
|
+
regression_links: target.regression_links
|
|
1120
|
+
.slice(0, caps.max_candidates)
|
|
1121
|
+
.map((link) => ({
|
|
1122
|
+
...link,
|
|
1123
|
+
ranges: link.ranges.slice(0, caps.max_paths_per_omission),
|
|
1124
|
+
})),
|
|
1125
|
+
})),
|
|
1126
|
+
},
|
|
1127
|
+
}),
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
function orderCandidateSeedsForCoverage(seeds, policy) {
|
|
1131
|
+
if (policy.policy_id === null || policy.required_when_available.length === 0) {
|
|
1132
|
+
return [...seeds];
|
|
1133
|
+
}
|
|
1134
|
+
const ordered = [];
|
|
1135
|
+
const included = new Set();
|
|
1136
|
+
for (const target of policy.obligations?.targets ?? []) {
|
|
1137
|
+
for (const candidateId of [
|
|
1138
|
+
target.candidate_id,
|
|
1139
|
+
...target.regression_links.map((link) => link.candidate_id),
|
|
1140
|
+
]) {
|
|
1141
|
+
const seed = seeds.find((candidate) => candidate.id === candidateId);
|
|
1142
|
+
if (seed != null && !included.has(seed.id)) {
|
|
1143
|
+
ordered.push(seed);
|
|
1144
|
+
included.add(seed.id);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
for (const evidenceClass of policy.required_when_available) {
|
|
1149
|
+
if (ordered.some((seed) => seed.evidence_classes.includes(evidenceClass))) {
|
|
1150
|
+
continue;
|
|
1151
|
+
}
|
|
1152
|
+
const representative = seeds.find((seed) => seed.evidence_classes.includes(evidenceClass));
|
|
1153
|
+
if (representative != null && !included.has(representative.id)) {
|
|
1154
|
+
ordered.push(representative);
|
|
1155
|
+
included.add(representative.id);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
for (const seed of seeds) {
|
|
1159
|
+
if (!included.has(seed.id)) {
|
|
1160
|
+
ordered.push(seed);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
return ordered;
|
|
1164
|
+
}
|
|
831
1165
|
function positiveInteger(value) {
|
|
832
1166
|
return Number.isSafeInteger(value) && value > 0 ? value : 1;
|
|
833
1167
|
}
|
|
@@ -858,7 +1192,29 @@ function estimatePacketJsonBytes(packet) {
|
|
|
858
1192
|
function redactAbsolutePaths(text) {
|
|
859
1193
|
return text
|
|
860
1194
|
.replace(/\b[A-Za-z]:[\\/][^\s"'`)]+/g, "[redacted-absolute-path]")
|
|
861
|
-
.replace(/(^|[\s"'(])\/[^\s"'`)]
|
|
1195
|
+
.replace(/(^|[\s"'(])(\/[^\s"'`)]+)/g, (_match, boundary, token) => {
|
|
1196
|
+
// Compact comments and slash-led paths share the same token shape, so
|
|
1197
|
+
// classify the complete token instead of inferring intent via lookahead.
|
|
1198
|
+
if (token === "/*") {
|
|
1199
|
+
return `${boundary}${token}`;
|
|
1200
|
+
}
|
|
1201
|
+
if (token.startsWith("/*") && token[2] !== "/") {
|
|
1202
|
+
const closeIndex = token.indexOf("*/", 2);
|
|
1203
|
+
if (closeIndex >= 0) {
|
|
1204
|
+
const commentEnd = closeIndex + 2;
|
|
1205
|
+
const suffix = token.slice(commentEnd);
|
|
1206
|
+
return /^[\\/]/.test(suffix)
|
|
1207
|
+
? `${boundary}${token.slice(0, commentEnd)}[redacted-absolute-path]`
|
|
1208
|
+
: `${boundary}${token}`;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
// A bare //host is indistinguishable from //comment; preserving it is
|
|
1212
|
+
// an accepted residual limitation needed for compact comment fidelity.
|
|
1213
|
+
if (/^\/\/[^/\\]*$/.test(token)) {
|
|
1214
|
+
return `${boundary}${token}`;
|
|
1215
|
+
}
|
|
1216
|
+
return `${boundary}[redacted-absolute-path]`;
|
|
1217
|
+
});
|
|
862
1218
|
}
|
|
863
1219
|
function compareCandidateSeeds(left, right) {
|
|
864
1220
|
return (booleanRank(right.has_focus_evidence) - booleanRank(left.has_focus_evidence) ||
|