2sagaco48 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/diagnostics.mjs +141 -0
- package/dist/compute.worker-j5ahIpF-.js +1 -0
- package/dist/graph.worker-DG6iGCB9.js +1 -0
- package/dist/index.html +2314 -0
- package/flatten-guide.md +248 -0
- package/index.html +12 -0
- package/package.json +38 -0
- package/src/App.orig.tsx +204 -0
- package/src/App.orig1.tsx +27 -0
- package/src/App.orig2.tsx +25 -0
- package/src/App.tsx +3 -0
- package/src/BaseApp.tsx +18 -0
- package/src/INTEGRATION_LEDGER.md +22 -0
- package/src/PERSIST_CANARY.orig.txt +1 -0
- package/src/PERSIST_CANARY.txt +1 -0
- package/src/REGRESSION_LEDGER.md +651 -0
- package/src/TEMPLATE_PIPELINE_AUDIT.md +208 -0
- package/src/WILLIAMS_PERSONA_GUIDE.md +62 -0
- package/src/chat/VeritasChat.tsx +69 -0
- package/src/chat/synthesis.ts +31 -0
- package/src/chat/tier.ts +45 -0
- package/src/components/AdaptersPage.orig.tsx +99 -0
- package/src/components/AdaptersPage.tsx +3 -0
- package/src/components/AdversarialPanel.tsx +136 -0
- package/src/components/AnchorBaselinePanel.tsx +75 -0
- package/src/components/AnswerPanel.tsx +60 -0
- package/src/components/ArtifactPanel.tsx +43 -0
- package/src/components/ChatApp.orig.tsx +1582 -0
- package/src/components/ChatApp.orig1.tsx +722 -0
- package/src/components/ChatApp.tsx +95 -0
- package/src/components/ChatAugmentPanels.tsx +73 -0
- package/src/components/CitationLedgerPanel.tsx +313 -0
- package/src/components/ComputeSandboxPanel.tsx +130 -0
- package/src/components/ConfigPanel.tsx +110 -0
- package/src/components/ControlPlanePage.tsx +195 -0
- package/src/components/CreativeTreeLifePage.tsx +234 -0
- package/src/components/CreativeTreeOfLifePanel.tsx +149 -0
- package/src/components/DebugTracePanel.tsx +137 -0
- package/src/components/DeepReasoningTrace.tsx +48 -0
- package/src/components/EntitySheetPanel.tsx +51 -0
- package/src/components/FailureModesPanel.tsx +104 -0
- package/src/components/GBSDashboard.tsx +239 -0
- package/src/components/GraphView.tsx +116 -0
- package/src/components/HUD.tsx +125 -0
- package/src/components/HypothesisPanel.tsx +67 -0
- package/src/components/InnovationGenomeEngine.tsx +792 -0
- package/src/components/InnovationPersonaGuide.tsx +348 -0
- package/src/components/InnovationPersonaPanel.tsx +289 -0
- package/src/components/LiveResourceHUD.tsx +109 -0
- package/src/components/LongWriterPanel.tsx +112 -0
- package/src/components/MainPipelineV10Bridge.tsx +72 -0
- package/src/components/MarkdownLite.tsx +63 -0
- package/src/components/MemoryInspector.tsx +38 -0
- package/src/components/MemoryMonitor.tsx +52 -0
- package/src/components/MemoryStressPanel.tsx +176 -0
- package/src/components/ModulesPage.tsx +171 -0
- package/src/components/PipelineDebugConsole.orig.tsx +1856 -0
- package/src/components/PipelineDebugConsole.tsx +3 -0
- package/src/components/PreFlightHUD.tsx +67 -0
- package/src/components/PrismaFetchTracePanel.tsx +87 -0
- package/src/components/ReportOSPanel.tsx +165 -0
- package/src/components/ResourceEstimatorPage.tsx +327 -0
- package/src/components/RichText.tsx +181 -0
- package/src/components/SagaOsPanel.tsx +605 -0
- package/src/components/SagaOsReference.tsx +421 -0
- package/src/components/SagaOsV2Panel.tsx +594 -0
- package/src/components/SagaStyleTab.tsx +382 -0
- package/src/components/SageBlueprintPanel.tsx +416 -0
- package/src/components/SharedChatInput.tsx +77 -0
- package/src/components/StatFinancePanel.tsx +190 -0
- package/src/components/StylePersonaPanel.tsx +128 -0
- package/src/components/TemplatesPage.tsx +300 -0
- package/src/components/TestPanel.tsx +63 -0
- package/src/components/TraceLog.tsx +89 -0
- package/src/components/V15CalibrationAugment.tsx +1134 -0
- package/src/components/V15CalibrationDialog.tsx +1871 -0
- package/src/components/V15Overlay.orig.tsx +120 -0
- package/src/components/V15Overlay.tsx +4 -0
- package/src/components/V15OverlayWrapper.tsx +362 -0
- package/src/components/V15Toggle.tsx +34 -0
- package/src/console/DiagnosticRecoveryPanel.tsx +358 -0
- package/src/console/EngineeringConsole.tsx +103 -0
- package/src/console/FictionSystemPanels.tsx +882 -0
- package/src/console/InspectorPanels.tsx +254 -0
- package/src/console/ManuscriptGraderPanel.tsx +182 -0
- package/src/console/RecursiveReviserPanel.tsx +245 -0
- package/src/console/SeedControlPanel.tsx +135 -0
- package/src/console/StoryControllerPanel.tsx +443 -0
- package/src/console/engineBridge.ts +258 -0
- package/src/console/gemini.ts +106 -0
- package/src/console/grading.ts +250 -0
- package/src/console/util.ts +45 -0
- package/src/fiction/continuity.ts +372 -0
- package/src/fiction/crash-protection.ts +111 -0
- package/src/fiction/diagnostics.ts +208 -0
- package/src/fiction/diff.ts +74 -0
- package/src/fiction/entity-state-machine.ts +214 -0
- package/src/fiction/nive-engine.ts +404 -0
- package/src/fiction/pipeline-selftest.ts +132 -0
- package/src/fiction/seed-control.ts +193 -0
- package/src/fiction/story-engine.ts +326 -0
- package/src/fiction/types.ts +68 -0
- package/src/flatten-guide.md +379 -0
- package/src/index.css +14 -0
- package/src/index.orig.css +13 -0
- package/src/lib/academic-sources.base.ts +188 -0
- package/src/lib/academic-sources.orig.ts +28 -0
- package/src/lib/academic-sources.ts +10 -0
- package/src/lib/advanced-math.ts +119 -0
- package/src/lib/adversarial-engine.base.ts +409 -0
- package/src/lib/adversarial-engine.ts +82 -0
- package/src/lib/ai-revision.ts +623 -0
- package/src/lib/app-state.tsx +426 -0
- package/src/lib/artifact-registry.ts +97 -0
- package/src/lib/artifacts.ts +180 -0
- package/src/lib/atlas-dr.ts +167 -0
- package/src/lib/browser-mtls.ts +127 -0
- package/src/lib/browser-queue.ts +221 -0
- package/src/lib/browser-search-scraper.base.ts +382 -0
- package/src/lib/browser-search-scraper.orig.ts +90 -0
- package/src/lib/browser-search-scraper.ts +10 -0
- package/src/lib/calc-interceptor.ts +82 -0
- package/src/lib/citation-lane-tap.ts +78 -0
- package/src/lib/citation-ledger-store.ts +369 -0
- package/src/lib/citation-ledger.ts +203 -0
- package/src/lib/compute-sandbox.ts +215 -0
- package/src/lib/compute.worker.ts +153 -0
- package/src/lib/connectors/gemini.ts +120 -0
- package/src/lib/connectors/jina.ts +233 -0
- package/src/lib/connectors/marketdata.ts +51 -0
- package/src/lib/connectors/prismafetch.base.ts +175 -0
- package/src/lib/connectors/prismafetch.ts +1 -0
- package/src/lib/connectors/serpapi.ts +65 -0
- package/src/lib/connectors/wikidata.ts +44 -0
- package/src/lib/constraints.ts +331 -0
- package/src/lib/continuation-detector.base.ts +153 -0
- package/src/lib/continuation-detector.ts +48 -0
- package/src/lib/contradraft.ts +168 -0
- package/src/lib/cors-proxy.ts +120 -0
- package/src/lib/coverage.ts +81 -0
- package/src/lib/debug/architecture-prescription.ts +556 -0
- package/src/lib/debug/covea-repair.ts +543 -0
- package/src/lib/debug/helios-ground.ts +319 -0
- package/src/lib/debug/intent-decomposer.ts +281 -0
- package/src/lib/debug/intent-lattice.ts +349 -0
- package/src/lib/debug/pipeline-diagnosis.ts +1149 -0
- package/src/lib/debug/pipeline-trace-bus.ts +424 -0
- package/src/lib/debug/prompt-forge.ts +678 -0
- package/src/lib/debug/repair-sites.ts +513 -0
- package/src/lib/debug/research-phase.ts +266 -0
- package/src/lib/debug/retrieval-context.ts +76 -0
- package/src/lib/debug/retrieval-hardener.ts +142 -0
- package/src/lib/debug/scraper-debug-runner.ts +576 -0
- package/src/lib/debug/scraper-forensics.ts +418 -0
- package/src/lib/debug/scraper-lane-roadmap.ts +136 -0
- package/src/lib/debug/self-test.ts +415 -0
- package/src/lib/debug/step-attribution.ts +211 -0
- package/src/lib/debug/template-rubric.ts +301 -0
- package/src/lib/debug/unified-innovation.ts +126 -0
- package/src/lib/debug/veritas-hybrid-scraper.ts +335 -0
- package/src/lib/defense-registry.ts +104 -0
- package/src/lib/defenses.ts +162 -0
- package/src/lib/deterministic-citation-ledger.ts +174 -0
- package/src/lib/elo-registry.base.ts +117 -0
- package/src/lib/elo-registry.ts +1 -0
- package/src/lib/entity-resolver.ts +291 -0
- package/src/lib/failure-modes.ts +267 -0
- package/src/lib/feature-registry.ts +69 -0
- package/src/lib/flaw-registry.ts +143 -0
- package/src/lib/flaws/_template.ts +52 -0
- package/src/lib/flaws/builtins.ts +63 -0
- package/src/lib/flaws/finance.ts +169 -0
- package/src/lib/flaws/fixers.ts +10 -0
- package/src/lib/flaws/index.ts +32 -0
- package/src/lib/flaws/legal.ts +157 -0
- package/src/lib/flaws/medical.ts +188 -0
- package/src/lib/flaws/original-defenses-pack.ts +81 -0
- package/src/lib/flaws/sample-declarative-pack.json +38 -0
- package/src/lib/flaws/selftest.ts +201 -0
- package/src/lib/flaws/software-extended.ts +125 -0
- package/src/lib/flaws/software-rn-webgl.ts +182 -0
- package/src/lib/flaws/statistics-advanced.ts +46 -0
- package/src/lib/flaws/statistics.ts +61 -0
- package/src/lib/gbse/config.ts +20 -0
- package/src/lib/gbse/engine.ts +226 -0
- package/src/lib/gbse/graph.ts +118 -0
- package/src/lib/gbse/graph.worker.ts +21 -0
- package/src/lib/gbse/tests.ts +117 -0
- package/src/lib/gbse/tiers.ts +65 -0
- package/src/lib/gbse/types.ts +94 -0
- package/src/lib/innovation-genome-engine-v2.orig.ts +1001 -0
- package/src/lib/innovation-genome-engine-v2.ts +3 -0
- package/src/lib/innovation-genome-engine.orig.ts +330 -0
- package/src/lib/innovation-genome-engine.ts +3 -0
- package/src/lib/innovation-genome-v10.orig.ts +314 -0
- package/src/lib/innovation-genome-v10.ts +2 -0
- package/src/lib/innovation-genome-v3.orig.ts +2015 -0
- package/src/lib/innovation-genome-v3.ts +2 -0
- package/src/lib/innovation-genome-v4.orig.ts +1959 -0
- package/src/lib/innovation-genome-v4.ts +2 -0
- package/src/lib/innovation-genome-v5.orig.ts +1210 -0
- package/src/lib/innovation-genome-v5.ts +2 -0
- package/src/lib/innovation-genome-v7.orig.ts +2549 -0
- package/src/lib/innovation-genome-v7.ts +2 -0
- package/src/lib/innovation-genome-v8.orig.ts +1485 -0
- package/src/lib/innovation-genome-v8.ts +2 -0
- package/src/lib/innovation-genome-v9.orig.ts +643 -0
- package/src/lib/innovation-genome-v9.ts +2 -0
- package/src/lib/jina.base.ts +293 -0
- package/src/lib/jina.ts +1 -0
- package/src/lib/live-telemetry.ts +61 -0
- package/src/lib/longwriter.ts +84 -0
- package/src/lib/manuscript-grade-v2.ts +298 -0
- package/src/lib/memory-governor.ts +173 -0
- package/src/lib/memory-stress-tests.ts +248 -0
- package/src/lib/model-intelligence.ts +48 -0
- package/src/lib/model-rotator.ts +75 -0
- package/src/lib/models.orig.ts +513 -0
- package/src/lib/models.ts +151 -0
- package/src/lib/n-deep.base.ts +592 -0
- package/src/lib/n-deep.ts +51 -0
- package/src/lib/nih-simulator.ts +56 -0
- package/src/lib/nih-vulnerability-fixes.ts +460 -0
- package/src/lib/omega-templates.base.ts +294 -0
- package/src/lib/omega-templates.ts +225 -0
- package/src/lib/omni-nexus.ts +64 -0
- package/src/lib/oracle-adapters.ts +67 -0
- package/src/lib/oracle-registry.ts +163 -0
- package/src/lib/orchestrator.ts +357 -0
- package/src/lib/output-boundary.ts +235 -0
- package/src/lib/overrides/vite-native-chaos-harness.ts +154 -0
- package/src/lib/overrides/vite-native-contract-plane.ts +245 -0
- package/src/lib/overrides/vite-native-doctor-plane.ts +208 -0
- package/src/lib/overrides/vite-native-knowledge-store.ts +267 -0
- package/src/lib/overrides/vite-native-policy-plane.ts +190 -0
- package/src/lib/overrides/vite-native-replay-plane.ts +197 -0
- package/src/lib/overrides/vite-native-runtime-plane.ts +106 -0
- package/src/lib/overrides/vite-native-scraper.ts +848 -0
- package/src/lib/overrides/vite-native-selftest-functional.ts +217 -0
- package/src/lib/overrides/vite-native-selftest.ts +183 -0
- package/src/lib/overrides/vite-native-snapshot-plane.ts +123 -0
- package/src/lib/philosophy-toolkit.ts +75 -0
- package/src/lib/pipeline.orig.ts +659 -0
- package/src/lib/pipeline.ts +42 -0
- package/src/lib/precache.ts +128 -0
- package/src/lib/py-sandbox.ts +205 -0
- package/src/lib/quality-score.ts +96 -0
- package/src/lib/quant-engine.ts +231 -0
- package/src/lib/quant-lib.ts +80 -0
- package/src/lib/reportos.ts +175 -0
- package/src/lib/research-os.ts +306 -0
- package/src/lib/resource-estimator.ts +114 -0
- package/src/lib/rpm-governor.ts +93 -0
- package/src/lib/runtime-estimator.ts +135 -0
- package/src/lib/sage/empty-space-v6.ts +560 -0
- package/src/lib/sage/empty-space-v7.ts +222 -0
- package/src/lib/sage/empty-space.ts +733 -0
- package/src/lib/sage/engine.ts +786 -0
- package/src/lib/sage/index.ts +17 -0
- package/src/lib/sage/judge.ts +246 -0
- package/src/lib/sage/prng.ts +53 -0
- package/src/lib/sage/reality-grounding.ts +380 -0
- package/src/lib/sage/repetition.ts +151 -0
- package/src/lib/sage/saga-os-v2-engines.ts +1870 -0
- package/src/lib/sage/saga-os-v2.ts +274 -0
- package/src/lib/sage/saga-os-v3-core.ts +1491 -0
- package/src/lib/sage/saga-os-v3-release.ts +739 -0
- package/src/lib/sage/saga-os-v4-aureate.ts +1161 -0
- package/src/lib/sage/saga-os-v4.ts +212 -0
- package/src/lib/sage/saga-os-v5.ts +205 -0
- package/src/lib/sage/saga-os-v6.ts +346 -0
- package/src/lib/sage/saga-os-v7.ts +314 -0
- package/src/lib/sage/saga-os-v8.ts +505 -0
- package/src/lib/sage/saga-os.ts +329 -0
- package/src/lib/sage/taxonomy.ts +403 -0
- package/src/lib/sage/unified-roll.ts +524 -0
- package/src/lib/sage/worked-sketches.ts +44 -0
- package/src/lib/sage.ts +166 -0
- package/src/lib/scraper-debug-bus.ts +53 -0
- package/src/lib/scraper-enhanced.orig.ts +153 -0
- package/src/lib/scraper-enhanced.ts +10 -0
- package/src/lib/scraper-hardener.base.orig.ts +155 -0
- package/src/lib/scraper-hardener.base.ts +317 -0
- package/src/lib/scraper-hardener.ts +1 -0
- package/src/lib/scraper-palisade/palisade-adjudicator.orig.ts +419 -0
- package/src/lib/scraper-palisade/palisade-adjudicator.ts +13 -0
- package/src/lib/scraper-vnext/arbiter-omega.orig.ts +688 -0
- package/src/lib/scraper-vnext/arbiter-omega.ts +13 -0
- package/src/lib/scraper-vnext/canonical-portfolio-augments.ts +479 -0
- package/src/lib/scraper-vnext/canonical-portfolio-orchestrator.orig.ts +1529 -0
- package/src/lib/scraper-vnext/canonical-portfolio-orchestrator.ts +13 -0
- package/src/lib/scraper-vnext/conclave-omega.ts +1830 -0
- package/src/lib/scraper-vnext/content-extractor-v2.ts +226 -0
- package/src/lib/scraper-vnext/diagnostics-suite.ts +36 -0
- package/src/lib/scraper-vnext/epistemic-packer.ts +97 -0
- package/src/lib/scraper-vnext/fusion-v2.ts +65 -0
- package/src/lib/scraper-vnext/hydra-reader.orig.ts +1216 -0
- package/src/lib/scraper-vnext/hydra-reader.ts +13 -0
- package/src/lib/scraper-vnext/native-scraper-browser-vnext.orig.ts +91 -0
- package/src/lib/scraper-vnext/native-scraper-browser-vnext.ts +13 -0
- package/src/lib/scraper-vnext/nexus-consensus.orig.ts +905 -0
- package/src/lib/scraper-vnext/nexus-consensus.ts +13 -0
- package/src/lib/scraper-vnext/portfolio-consensus-adjudicator.ts +804 -0
- package/src/lib/scraper-vnext/portfolio-consensus-memory.ts +377 -0
- package/src/lib/scraper-vnext/portfolio-terminal-governor.ts +548 -0
- package/src/lib/scraper-vnext/query-strategist.orig.ts +224 -0
- package/src/lib/scraper-vnext/query-strategist.ts +423 -0
- package/src/lib/scraper-vnext/retrieval-accelerator.ts +708 -0
- package/src/lib/scraper-vnext/retrieval-audit-augments.ts +477 -0
- package/src/lib/scraper-vnext/retrieval-control-plane.ts +904 -0
- package/src/lib/scraper-vnext/retrieval-policy-augments.ts +358 -0
- package/src/lib/scraper-vnext/safe-fetch-v2.ts +157 -0
- package/src/lib/scraper-vnext/sentinel-omega.ts +56 -0
- package/src/lib/scraper-vnext/sentinel-orchestrator.ts +69 -0
- package/src/lib/scraper-vnext/sibyl-oracle.orig.ts +413 -0
- package/src/lib/scraper-vnext/sibyl-oracle.ts +13 -0
- package/src/lib/scraper-vnext/smart-read-v2.ts +55 -0
- package/src/lib/scraper-vnext/spa-rescue-bridge.ts +608 -0
- package/src/lib/scraper-vnext/strata-engine.orig.ts +2666 -0
- package/src/lib/scraper-vnext/strata-engine.ts +13 -0
- package/src/lib/scraper-vnext/structured-source-adapter.orig.ts +369 -0
- package/src/lib/scraper-vnext/structured-source-adapter.ts +34 -0
- package/src/lib/scraper-vnext/terminal-complete.ts +224 -0
- package/src/lib/scraper-vnext/terminal-final.ts +277 -0
- package/src/lib/scraper-vnext/terminal-saturation.ts +345 -0
- package/src/lib/scraper-vnext/terminal-wire.ts +425 -0
- package/src/lib/scraper-vnext/vanguard-titanium.orig.ts +467 -0
- package/src/lib/scraper-vnext/vanguard-titanium.ts +17 -0
- package/src/lib/search-cache.ts +138 -0
- package/src/lib/sloop-runner.base.ts +223 -0
- package/src/lib/sloop-runner.ts +104 -0
- package/src/lib/sloop.ts +114 -0
- package/src/lib/small-model-adapters.ts +82 -0
- package/src/lib/sscp.ts +86 -0
- package/src/lib/system-map.ts +54 -0
- package/src/lib/uni-node.ts +86 -0
- package/src/lib/universal-rigor-guard.ts +433 -0
- package/src/lib/v15-gate-testbed.ts +274 -0
- package/src/lib/v15-gemini.base.ts +89 -0
- package/src/lib/v15-gemini.ts +1 -0
- package/src/lib/v15-grounding.orig.ts +241 -0
- package/src/lib/v15-grounding.ts +79 -0
- package/src/lib/v15-pipeline.base.ts +769 -0
- package/src/lib/v15-pipeline.orig.ts +1154 -0
- package/src/lib/v15-pipeline.ts +674 -0
- package/src/lib/v15-questions.ts +64 -0
- package/src/lib/v15-rate-limiter.orig.ts +91 -0
- package/src/lib/v15-rate-limiter.ts +48 -0
- package/src/lib/v15-state.base.ts +87 -0
- package/src/lib/v15-state.ts +28 -0
- package/src/lib/visual-table-generator.tsx +207 -0
- package/src/lib/wasm-runtime.ts +133 -0
- package/src/lib/williams-persona-guide.ts +265 -0
- package/src/lib/williams-style.base.ts +464 -0
- package/src/lib/williams-style.ts +59 -0
- package/src/lib/worker-pool.ts +96 -0
- package/src/lib/writing-tiers.ts +125 -0
- package/src/main.orig.tsx +10 -0
- package/src/main.tsx +10 -0
- package/src/utils/cn.orig.ts +6 -0
- package/src/utils/cn.ts +6 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +31 -0
- package/unify.mjs +537 -0
- package/vite.config.ts +18 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* repair-sites.ts — NET-NEW (Type C). See flatten-guide.md.
|
|
3
|
+
* ===========================================================================
|
|
4
|
+
* EXACT CODE COORDINATES FOR EVERY DIAGNOSED DEFECT.
|
|
5
|
+
*
|
|
6
|
+
* Turn-5 ask: "for diagnosis, much more specific about exactly code repair the
|
|
7
|
+
* repo as which file, line, etc."
|
|
8
|
+
*
|
|
9
|
+
* ═══ PROVENANCE DISCIPLINE ═══
|
|
10
|
+
* Every `line` and `anchor` below was obtained by grepping the INSTALLED
|
|
11
|
+
* package in this workspace during turn 5. Each entry ships a `verifyCmd`
|
|
12
|
+
* so you can re-confirm the coordinate yourself in one command — line numbers
|
|
13
|
+
* drift when the package version changes, and the anchor string is the
|
|
14
|
+
* durable identifier, not the number.
|
|
15
|
+
*
|
|
16
|
+
* If a `verifyCmd` returns a different line than `line`, TRUST THE ANCHOR.
|
|
17
|
+
*
|
|
18
|
+
* ═══ REACHABILITY ═══
|
|
19
|
+
* workspace-seam fixable today in src/, package untouched
|
|
20
|
+
* alias-seam reachable because the consumer imports via `@/...`
|
|
21
|
+
* post-pass not interceptable; fix runs AFTER the package returns
|
|
22
|
+
* materialize requires `node materialize.mjs <file>` to become editable
|
|
23
|
+
* ===========================================================================
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export type Reachability = "workspace-seam" | "alias-seam" | "post-pass" | "materialize";
|
|
27
|
+
|
|
28
|
+
export interface RepairRoute {
|
|
29
|
+
action: string;
|
|
30
|
+
/** Precisely what to change, in code terms. */
|
|
31
|
+
change: string;
|
|
32
|
+
/** What must hold after the change for it to count as fixed. */
|
|
33
|
+
verify: string;
|
|
34
|
+
/** What to do if this route's dependency is unavailable. */
|
|
35
|
+
fallback: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface RepairSite {
|
|
39
|
+
/** Detector id this site repairs. */
|
|
40
|
+
detector: string;
|
|
41
|
+
file: string;
|
|
42
|
+
/** Line as verified in this workspace at turn 5. Anchor is authoritative. */
|
|
43
|
+
line: number;
|
|
44
|
+
symbol: string;
|
|
45
|
+
/** Verbatim source substring — the durable identifier. */
|
|
46
|
+
anchor: string;
|
|
47
|
+
/** The actual code at that coordinate, copied verbatim from the package. */
|
|
48
|
+
currentCode: string;
|
|
49
|
+
/** Why this exact line causes the observed defect. */
|
|
50
|
+
mechanism: string;
|
|
51
|
+
reachability: Reachability;
|
|
52
|
+
/** One-shot command to re-confirm the coordinate. */
|
|
53
|
+
verifyCmd: string;
|
|
54
|
+
deterministic: RepairRoute;
|
|
55
|
+
llm: RepairRoute;
|
|
56
|
+
/** Where the durable workspace fix lives (or would live). */
|
|
57
|
+
durableHook: string;
|
|
58
|
+
/** Estimated guard-score lift if repaired. */
|
|
59
|
+
expectedLift: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const REPAIR_SITES: RepairSite[] = [
|
|
63
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
64
|
+
// WORKSPACE CONTAINMENT — no materialize.mjs required
|
|
65
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
66
|
+
{
|
|
67
|
+
detector: "lane-zero-yield",
|
|
68
|
+
file: "src/lib/v15-grounding.ts",
|
|
69
|
+
line: 36,
|
|
70
|
+
symbol: "groundQuestion workspace wrapper → post-return yield assertion",
|
|
71
|
+
anchor: "EVIDENCE_STARVED",
|
|
72
|
+
currentCode:
|
|
73
|
+
"error: `EVIDENCE_STARVED: ${sources.length} atom/proxy source(s), 0 resolvable URL(s)`,",
|
|
74
|
+
mechanism:
|
|
75
|
+
"Alias callers now fail closed when a grounding result contains only atom/proxy records and zero resolvable URLs. This is not the package-internal relative path cure, but it repairs the reachable workspace seam and gives the rest of the app a deterministic no-materialize guard.",
|
|
76
|
+
reachability: "workspace-seam",
|
|
77
|
+
verifyCmd: "grep -n 'EVIDENCE_STARVED' src/lib/v15-grounding.ts",
|
|
78
|
+
deterministic: {
|
|
79
|
+
action: "Fail closed on zero URL-backed yield in the workspace alias seam.",
|
|
80
|
+
change:
|
|
81
|
+
"Return `ok:false`, `error:EVIDENCE_STARVED`, `sources:[]`, and an evidence block instructing the draft to emit an explicit data gap rather than confident prose.",
|
|
82
|
+
verify: "Alias callers of `@/lib/v15-grounding` cannot receive `ok:true` with zero absolute URLs.",
|
|
83
|
+
fallback: "COVEA post-pass strips resulting invalid citations if the package relative path still admits them.",
|
|
84
|
+
},
|
|
85
|
+
llm: { action: "None — deterministic provenance gate.", change: "N/A", verify: "N/A", fallback: "Deterministic only." },
|
|
86
|
+
durableHook: "src/lib/v15-grounding.ts (LIVE)",
|
|
87
|
+
expectedLift: 1.2,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
detector: "placeholder-citation-url",
|
|
91
|
+
file: "src/lib/debug/covea-repair.ts",
|
|
92
|
+
line: 225,
|
|
93
|
+
symbol: "stripInvalidCitationTags → grouped and single tag containment",
|
|
94
|
+
anchor: "function stripInvalidCitationTags",
|
|
95
|
+
currentCode:
|
|
96
|
+
"function stripInvalidCitationTags(text: string, badIds: Set<number>): { text: string; actions: string[] } {",
|
|
97
|
+
mechanism:
|
|
98
|
+
"Post-pass containment removes every citation tag whose ledger entry is missing, untrusted, non-http, CSS-reset content, or zero-overlap with the question. It handles grouped tags like `[S3, S4]` as well as single `[S3]` tags.",
|
|
99
|
+
reachability: "post-pass",
|
|
100
|
+
verifyCmd: "grep -n 'function stripInvalidCitationTags' src/lib/debug/covea-repair.ts",
|
|
101
|
+
deterministic: {
|
|
102
|
+
action: "Strip invalid citation tags after the package returns, including grouped tags.",
|
|
103
|
+
change: "Compute bad ids from `citationAudit.entries` and `auditResults`, then remove only those ids from the draft.",
|
|
104
|
+
verify: "COVEA `deterministicActions` lists every removed [S#]; final draft contains no invalid ids.",
|
|
105
|
+
fallback: "If no audit exists, leave text unchanged and surface unmeasured state in Diagnosis.",
|
|
106
|
+
},
|
|
107
|
+
llm: { action: "Localized recast only after deterministic strip.", change: "Use LLM only to recast an anchor sentence after bad tags are removed.", verify: "Anchor must match exactly once.", fallback: "Deterministic strip remains valid." },
|
|
108
|
+
durableHook: "src/lib/debug/covea-repair.ts (LIVE)",
|
|
109
|
+
expectedLift: 1.1,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
detector: "weak-content-gate",
|
|
113
|
+
file: "src/lib/debug/covea-repair.ts",
|
|
114
|
+
line: 215,
|
|
115
|
+
symbol: "invalidCitationIds → CSS reset / zero-overlap quarantine",
|
|
116
|
+
anchor: "sourceWordOverlap(question, text) === 0",
|
|
117
|
+
currentCode:
|
|
118
|
+
"if (!isRealUrl(entry.url) || isCssResetSnippet(text) || sourceWordOverlap(question, text) === 0) bad.add(id);",
|
|
119
|
+
mechanism:
|
|
120
|
+
"The no-materialize containment path now quarantines irrelevant admitted records such as CSS reset blobs, genome-protocol pages for cannabis-market questions, and other zero-overlap sources before their [S#] tags can survive the final answer.",
|
|
121
|
+
reachability: "post-pass",
|
|
122
|
+
verifyCmd: "grep -n 'sourceWordOverlap(question, text)' src/lib/debug/covea-repair.ts",
|
|
123
|
+
deterministic: {
|
|
124
|
+
action: "Quarantine CSS-reset and zero-overlap citation ids in COVEA.",
|
|
125
|
+
change: "Treat those ids as invalid and run the same grouped-tag strip path.",
|
|
126
|
+
verify: "A CSS-reset snippet or zero-overlap source cannot keep a citation tag in final text.",
|
|
127
|
+
fallback: "Diagnosis still reports weak-content-gate if run telemetry lacks citationAudit.",
|
|
128
|
+
},
|
|
129
|
+
llm: { action: "None for quarantine; optional local sentence recast after strip.", change: "N/A", verify: "N/A", fallback: "Deterministic only." },
|
|
130
|
+
durableHook: "src/lib/debug/covea-repair.ts (LIVE)",
|
|
131
|
+
expectedLift: 0.9,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
detector: "unresolved-placeholder",
|
|
135
|
+
file: "src/lib/debug/covea-repair.ts",
|
|
136
|
+
line: 244,
|
|
137
|
+
symbol: "normalizeBarePlaceholders → explicit open-item conversion",
|
|
138
|
+
anchor: "function normalizeBarePlaceholders",
|
|
139
|
+
currentCode:
|
|
140
|
+
"function normalizeBarePlaceholders(text: string): { text: string; actions: string[] } {",
|
|
141
|
+
mechanism:
|
|
142
|
+
"Bare `[DATA GAP]` / `[ASSUMPTION]` markers are no longer left as fake-shaped quantities. COVEA converts them into explicit open-input or explicit-assumption markers requiring owner/source/formula/sensitivity before 10/10 sign-off.",
|
|
143
|
+
reachability: "post-pass",
|
|
144
|
+
verifyCmd: "grep -n 'function normalizeBarePlaceholders' src/lib/debug/covea-repair.ts",
|
|
145
|
+
deterministic: {
|
|
146
|
+
action: "Convert bare placeholder tokens into explicit open-item markers.",
|
|
147
|
+
change: "Replace `[DATA GAP]`/`[TBD]` with `[OPEN_INPUT: ...]` and `[ASSUMPTION]` with `[EXPLICIT_ASSUMPTION: ...]`.",
|
|
148
|
+
verify: "No bare `[DATA GAP]`, `[TBD]`, or `[ASSUMPTION]` token survives COVEA.",
|
|
149
|
+
fallback: "If the user wants zero unresolved markers, block publication rather than fabricate values.",
|
|
150
|
+
},
|
|
151
|
+
llm: { action: "Classify impact only.", change: "Use model to classify owner/input, never to supply the missing value.", verify: "No invented numeric value.", fallback: "Deterministic marker conversion." },
|
|
152
|
+
durableHook: "src/lib/debug/covea-repair.ts (LIVE)",
|
|
153
|
+
expectedLift: 0.8,
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
157
|
+
// THE PLACEHOLDER-URL BUG — root cause of every `source-N` in your ledger
|
|
158
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
159
|
+
{
|
|
160
|
+
detector: "placeholder-citation-url",
|
|
161
|
+
file: "../v15-grounding.orig",
|
|
162
|
+
line: 113,
|
|
163
|
+
symbol: "groundQuestion → vanguard tier → vanguardSources.map()",
|
|
164
|
+
anchor: 'vanguard-attested',
|
|
165
|
+
currentCode:
|
|
166
|
+
'url: c.atomBindings[0]?.sourceIndex !== undefined ? `source-${c.atomBindings[0].sourceIndex + 1}` : "vanguard-attested",',
|
|
167
|
+
mechanism:
|
|
168
|
+
"This line MANUFACTURES the url field from an array index. `source-3` is not a URL — it is the string 'source-' concatenated with an integer. Every `source-1`/`source-2`/`source-3` entry in your citation ledger was born here. The downstream citation audit then correctly marks them untrusted, but the damage is upstream: a claim was already written against a citation that can never resolve.",
|
|
169
|
+
reachability: "materialize",
|
|
170
|
+
verifyCmd: "grep -n 'vanguard-attested' node_modules/src/lib/v15-grounding.orig.ts",
|
|
171
|
+
deterministic: {
|
|
172
|
+
action: "Resolve the real URL from the vanguard source table, or refuse to emit the claim as a source.",
|
|
173
|
+
change:
|
|
174
|
+
"Use `c.atomBindings[0].sourceIndex` as an index into `vanguard.sources` and emit `vanguard.sources[idx].url`. If the index does not resolve to an absolute http(s) URL, do NOT push the claim into `vanguardSources` — route it to a separate `derivedClaims[]` field that the evidence block may quote but the citation ledger may never cite.",
|
|
175
|
+
verify:
|
|
176
|
+
"After the fix, `citationAudit.entries.every(e => /^https?:\\/\\//.test(e.url))` must be true for every vanguard-sourced entry.",
|
|
177
|
+
fallback:
|
|
178
|
+
"Workspace post-pass (already live): COVEA strips any [S#] whose ledger url fails the http test, and the Scrapers tab lists every placeholder URL by lane.",
|
|
179
|
+
},
|
|
180
|
+
llm: {
|
|
181
|
+
action: "None applicable — this is a pure data-plumbing defect.",
|
|
182
|
+
change:
|
|
183
|
+
"Do not ask a model to 'find the real URL'. That is the exact mechanism by which citation fabrication occurs. The URL either exists in the source table or the claim is not citable.",
|
|
184
|
+
verify: "N/A",
|
|
185
|
+
fallback: "Deterministic route only.",
|
|
186
|
+
},
|
|
187
|
+
durableHook: "src/lib/debug/covea-repair.ts → stripUntrustedCitationTags (containment, not cure)",
|
|
188
|
+
expectedLift: 1.8,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
detector: "placeholder-citation-url",
|
|
192
|
+
file: "../v15-grounding.orig",
|
|
193
|
+
line: 131,
|
|
194
|
+
symbol: "groundQuestion → palisade tier → palisadeSources.map()",
|
|
195
|
+
anchor: 'palisade-attested',
|
|
196
|
+
currentCode:
|
|
197
|
+
'url: c.atomBindings[0]?.sourceIndex !== undefined ? `source-${c.atomBindings[0].sourceIndex + 1}` : "palisade-attested",',
|
|
198
|
+
mechanism:
|
|
199
|
+
"Identical defect to :113, duplicated in the palisade tier. Because the logic is copy-pasted rather than shared, fixing one tier silently leaves the other broken.",
|
|
200
|
+
reachability: "materialize",
|
|
201
|
+
verifyCmd: "grep -n 'palisade-attested' node_modules/src/lib/v15-grounding.orig.ts",
|
|
202
|
+
deterministic: {
|
|
203
|
+
action: "Extract a shared `resolveAtomUrl(claim, sources)` helper used by BOTH tiers.",
|
|
204
|
+
change:
|
|
205
|
+
"Define one helper above line 111 and call it from both :113 and :131. A single implementation makes drift structurally impossible.",
|
|
206
|
+
verify: "grep -c 'source-\\${' on the file must return 0 after the fix.",
|
|
207
|
+
fallback: "Same COVEA containment as :113.",
|
|
208
|
+
},
|
|
209
|
+
llm: { action: "None applicable.", change: "Data-plumbing defect.", verify: "N/A", fallback: "Deterministic only." },
|
|
210
|
+
durableHook: "src/lib/debug/covea-repair.ts",
|
|
211
|
+
expectedLift: 0.6,
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
215
|
+
// THE ZERO-YIELD ACCEPTANCE BUG — lanes 'succeed' with 0 real documents
|
|
216
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
217
|
+
{
|
|
218
|
+
detector: "lane-zero-yield",
|
|
219
|
+
file: "../v15-grounding.orig",
|
|
220
|
+
line: 116,
|
|
221
|
+
symbol: "groundQuestion → vanguard acceptance predicate",
|
|
222
|
+
anchor: "if (vanguard.ok && vanguardSources.length >= 1)",
|
|
223
|
+
currentCode: "if (vanguard.ok && vanguardSources.length >= 1) {",
|
|
224
|
+
mechanism:
|
|
225
|
+
"`vanguardSources` counts CLAIMS (epistemic atoms), not documents. Your log shows `vanguard: 7 claims packed, 0 sources packed, utilization=6.6%` immediately followed by `grounded [...]: +2 source(s)` — the predicate passed on atoms while `tokenBudget.sourcesPacked` was literally 0. The pipeline then drafts confident prose believing it is grounded. This is the single highest-leverage retrieval fix in the codebase.",
|
|
226
|
+
reachability: "materialize",
|
|
227
|
+
verifyCmd: "grep -n 'vanguardSources.length >= 1' node_modules/src/lib/v15-grounding.orig.ts",
|
|
228
|
+
deterministic: {
|
|
229
|
+
action: "Require real document yield, not atom yield, before accepting the tier.",
|
|
230
|
+
change:
|
|
231
|
+
"Change the predicate to `if (vanguard.ok && vanguard.tokenBudget.sourcesPacked >= 1 && vanguardSources.some(s => /^https?:\\/\\//.test(s.url)))`. On failure, fall through to palisade instead of returning.",
|
|
232
|
+
verify:
|
|
233
|
+
"Re-run the same question; the Scrapers tab `zeroYieldLanes` array must be empty, and no section may report `+N source(s)` while its lane reports `0 sources packed`.",
|
|
234
|
+
fallback:
|
|
235
|
+
"Workspace alias-seam: `src/lib/v15-grounding.ts` can wrap the exported `groundQuestion` and assert yield on the RETURN value, marking the section EVIDENCE_STARVED. Note this only intercepts alias callers — the pipeline calls it relatively, so this fallback does not cover the main draft path.",
|
|
236
|
+
},
|
|
237
|
+
llm: {
|
|
238
|
+
action: "On zero yield, re-dispatch query-strategist with a broadened query before giving up.",
|
|
239
|
+
change: "Insert a single broadened retry between the failed predicate and the palisade fallthrough.",
|
|
240
|
+
verify: "Retry must be capped at 1 per section to avoid unbounded retrieval cost.",
|
|
241
|
+
fallback: "Deterministic predicate change above.",
|
|
242
|
+
},
|
|
243
|
+
durableHook: "src/lib/v15-grounding.ts (alias-seam, partial coverage) + Scrapers tab D14 detector (full visibility)",
|
|
244
|
+
expectedLift: 2.2,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
detector: "lane-quarantined",
|
|
248
|
+
file: "../v15-grounding.orig",
|
|
249
|
+
line: 98,
|
|
250
|
+
symbol: "groundQuestion → portfolio delegation",
|
|
251
|
+
anchor: "portfolio: no acceptable result; delegating to vanguard",
|
|
252
|
+
currentCode: 'opts.onDebug?.("portfolio: no acceptable result; delegating to vanguard");',
|
|
253
|
+
mechanism:
|
|
254
|
+
"The portfolio orchestrator narrates its own failure and moves on. There is no aggregate assertion that the delegation CHAIN eventually produced evidence — each hop only checks its own tier. Your log shows this line firing 6 times across sections, ending with sources that were all placeholder URLs.",
|
|
255
|
+
reachability: "materialize",
|
|
256
|
+
verifyCmd: "grep -n 'no acceptable result' node_modules/src/lib/v15-grounding.orig.ts",
|
|
257
|
+
deterministic: {
|
|
258
|
+
action: "Add a terminal assertion after the whole delegation chain.",
|
|
259
|
+
change:
|
|
260
|
+
"At the end of `groundQuestion`, if the accumulated source list contains zero absolute-URL entries, return `{ ok: false, error: 'EVIDENCE_STARVED', sources: [] }` rather than a list of attested atoms.",
|
|
261
|
+
verify: "A starved section must produce an explicit [DATA GAP] with owner, not confident unsourced prose.",
|
|
262
|
+
fallback: "Scrapers tab already surfaces every quarantined lane with its delegation target.",
|
|
263
|
+
},
|
|
264
|
+
llm: { action: "None — orchestration control flow.", change: "N/A", verify: "N/A", fallback: "Deterministic only." },
|
|
265
|
+
durableHook: "src/lib/debug/scraper-forensics.ts → quarantinedLanes (observability today)",
|
|
266
|
+
expectedLift: 0.8,
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
detector: "weak-content-gate",
|
|
270
|
+
file: "../v15-grounding.orig",
|
|
271
|
+
line: 221,
|
|
272
|
+
symbol: "groundQuestion → native-vnext content admission filter",
|
|
273
|
+
anchor: "s.url && s.content.length>=80",
|
|
274
|
+
currentCode: "}).filter((s)=> s.url && s.content.length>=80)",
|
|
275
|
+
mechanism:
|
|
276
|
+
"80 characters is the ONLY relevance bar. This is why your ledger admitted two Wikipedia entries about the ELLIPSIS PUNCTUATION MARK during HDIG — the HDIG hypothesis string was literally '...' and any page over 80 chars qualified. There is no lexical-overlap floor between source content and the dispatched query.",
|
|
277
|
+
reachability: "materialize",
|
|
278
|
+
verifyCmd: "grep -n 'content.length>=80' node_modules/src/lib/v15-grounding.orig.ts",
|
|
279
|
+
deterministic: {
|
|
280
|
+
action: "Add a lexical-overlap floor between source content and dispatched query.",
|
|
281
|
+
change:
|
|
282
|
+
"Compute token-Jaccard between the query and the first 2000 chars of `s.content`; reject below ~0.04 and record the rejection with its score so the drop is auditable rather than silent.",
|
|
283
|
+
verify: "Re-run the same question; no admitted source may have overlap below the floor with its dispatch query.",
|
|
284
|
+
fallback:
|
|
285
|
+
"Guard the HDIG dispatch instead: refuse to search when the extracted hypothesis is under ~12 chars or is pure punctuation. That kills the '...' query at the source and is a smaller change.",
|
|
286
|
+
},
|
|
287
|
+
llm: {
|
|
288
|
+
action: "Score relevance with a cheap model before admission.",
|
|
289
|
+
change: "Batch 10 candidate snippets per call, return keep/drop.",
|
|
290
|
+
verify: "Adds one model call per section — measure against rate budget.",
|
|
291
|
+
fallback: "Deterministic Jaccard floor, which needs no network.",
|
|
292
|
+
},
|
|
293
|
+
durableHook: "src/lib/debug/pipeline-diagnosis.ts → irrelevant-source detector",
|
|
294
|
+
expectedLift: 0.9,
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
298
|
+
// THE FULL-REWRITE REPAIR BUG — why adversarial fixes never land
|
|
299
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
300
|
+
{
|
|
301
|
+
detector: "adversarial-blocking",
|
|
302
|
+
file: "../v15-pipeline.orig",
|
|
303
|
+
line: 1050,
|
|
304
|
+
symbol: "runV15OnQuestion → adversarial monotonic repair → shrink guard",
|
|
305
|
+
anchor: "adversarial repair: generation failed or shrank too much",
|
|
306
|
+
currentCode:
|
|
307
|
+
'onProgress?.("adversarial repair: generation failed or shrank too much — keeping pre-repair text, defects logged");',
|
|
308
|
+
mechanism:
|
|
309
|
+
"The repair prompt asks the model to regenerate the ENTIRE document. One long generation must beat the old score on every axis simultaneously, so a single truncation or one dropped section discards ALL repairs at once. Your log shows exactly this: 4 blocking defects found, whole-document repair attempted, rejected on size, zero defects fixed, guard stayed 4.4.",
|
|
310
|
+
reachability: "post-pass",
|
|
311
|
+
verifyCmd: "grep -n 'shrank too much' node_modules/src/lib/v15-pipeline.orig.ts",
|
|
312
|
+
deterministic: {
|
|
313
|
+
action: "Replace whole-document rewrite with an anchored find/replace edit list.",
|
|
314
|
+
change:
|
|
315
|
+
"Emit `{anchor, replacement}[]`; apply each independently; a failed edit costs ONE defect instead of the entire repair. Cap each replacement at 1.4× its anchor length and require the anchor to appear exactly once.",
|
|
316
|
+
verify: "Post-repair defect count must strictly decrease. Per-edit accept/reject must be individually logged.",
|
|
317
|
+
fallback:
|
|
318
|
+
"ALREADY IMPLEMENTED as a post-pass in `src/lib/debug/covea-repair.ts` — runs after the package returns, ≤1 paragraph per patch, ≤20% total edit budget, ≥60% region retention, citation tags preserved.",
|
|
319
|
+
},
|
|
320
|
+
llm: {
|
|
321
|
+
action: "Feed defects as MANDATORY rather than INFORMATIONAL constraints.",
|
|
322
|
+
change: "Rewrite the injected N-Deep constraint block from advisory phrasing to a hard validity condition.",
|
|
323
|
+
verify: "Measure defect resolution rate before/after; if unchanged, the constraint text is not the bottleneck.",
|
|
324
|
+
fallback: "COVEA post-pass covers this regardless.",
|
|
325
|
+
},
|
|
326
|
+
durableHook: "src/lib/debug/covea-repair.ts → runCoveaRepair (LIVE)",
|
|
327
|
+
expectedLift: 1.6,
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
detector: "missing-references",
|
|
331
|
+
file: "../v15-pipeline.orig",
|
|
332
|
+
line: 514,
|
|
333
|
+
symbol: "runPolishPass → structure/scaffolding fix",
|
|
334
|
+
anchor: "polish pass: fixing structure/scaffolding without changing content",
|
|
335
|
+
currentCode: 'opts.onProgress?.("polish pass: fixing structure/scaffolding without changing content");',
|
|
336
|
+
mechanism:
|
|
337
|
+
"The References section is generated by a MODEL that is asked to list sources. That call is subject to 429/503 (both appear in your logs) and to invention. But the citation ledger already holds title + url + hash for every admitted source — the section is fully derivable with zero model involvement.",
|
|
338
|
+
reachability: "post-pass",
|
|
339
|
+
verifyCmd: "grep -n 'polish pass' node_modules/src/lib/v15-pipeline.orig.ts",
|
|
340
|
+
deterministic: {
|
|
341
|
+
action: "Build References from the citation ledger, not from a model.",
|
|
342
|
+
change:
|
|
343
|
+
"Render `## References` by iterating `citationAudit.entries`, emitting only entries whose url passes the http test. Zero model calls, immune to 503, structurally incapable of inventing a URL.",
|
|
344
|
+
verify: "Every [S#] in the body must appear in References; every References line must carry an absolute URL.",
|
|
345
|
+
fallback: "If the ledger is empty, emit `## References\\n(no admissible sources retrieved)` — honest, not blank.",
|
|
346
|
+
},
|
|
347
|
+
llm: { action: "None needed.", change: "Model involvement is the defect here, not the cure.", verify: "N/A", fallback: "Deterministic only." },
|
|
348
|
+
durableHook: "src/lib/debug/covea-repair.ts → deterministic References synthesis",
|
|
349
|
+
expectedLift: 0.5,
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
detector: "cove-inconsistent",
|
|
353
|
+
file: "../v15-pipeline.orig",
|
|
354
|
+
line: 469,
|
|
355
|
+
symbol: "runCoVeVerification → plan prompt assembly",
|
|
356
|
+
anchor: "opts.draft.slice(0, 6000)",
|
|
357
|
+
currentCode: "const planPrompt = `…DRAFT:\\n${opts.draft.slice(0, 6000)}…`;",
|
|
358
|
+
mechanism:
|
|
359
|
+
"CoVe only ever sees the first 6000 characters of the draft. Your 15,679-char draft had ~62% of its body invisible to verification, and the claim cap is 4. Anything in the back half of the report is unverifiable by construction — not because it passed, but because it was never read.",
|
|
360
|
+
reachability: "post-pass",
|
|
361
|
+
verifyCmd: "grep -n 'opts.draft.slice' node_modules/src/lib/v15-pipeline.orig.ts",
|
|
362
|
+
deterministic: {
|
|
363
|
+
action: "Remove the slice; chunk the draft and verify each chunk.",
|
|
364
|
+
change:
|
|
365
|
+
"Replace the single 6000-char window with N sequential windows of ~6000 chars each, union the returned claims, and lift the 4-claim cap to `min(4 * chunks, 16)`.",
|
|
366
|
+
verify: "Claim coverage must span the whole document — assert that at least one verified claim originates past the 60% mark.",
|
|
367
|
+
fallback:
|
|
368
|
+
"ALREADY MITIGATED post-pass: `covea-repair.ts` receives the FULL draft with no slice and re-anchors every CoVe failure against the complete text.",
|
|
369
|
+
},
|
|
370
|
+
llm: { action: "Increase claim count per window.", change: "Raise the per-call claim ask from 4 to 8.", verify: "Watch token budget.", fallback: "Chunking above." },
|
|
371
|
+
durableHook: "src/lib/debug/covea-repair.ts (full draft, no truncation)",
|
|
372
|
+
expectedLift: 1.4,
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
detector: "depth-repair-abandoned",
|
|
376
|
+
file: "../v15-pipeline.orig",
|
|
377
|
+
line: 988,
|
|
378
|
+
symbol: "N-Deep loop → localized patch acceptance test",
|
|
379
|
+
anchor: "rejected localized patches (no score or severity improvement)",
|
|
380
|
+
currentCode:
|
|
381
|
+
'onProgress?.(`depth ${d}: rejected localized patches (no score or severity improvement) — stopping instead of rescanning an unchanged draft`);',
|
|
382
|
+
mechanism:
|
|
383
|
+
"The loop `break`s on the FIRST rejected pass, abandoning the entire remaining depth budget. Your run had maxDepth=4 but executed depth 1 only, then stopped. The acceptance test is also global (whole-document guard score) rather than per-defect, so a patch that genuinely fixes defect A is discarded because unrelated defect B still drags the aggregate.",
|
|
384
|
+
reachability: "post-pass",
|
|
385
|
+
verifyCmd: "grep -n 'rejected localized patches' node_modules/src/lib/v15-pipeline.orig.ts",
|
|
386
|
+
deterministic: {
|
|
387
|
+
action: "Score patches per-defect, and continue the loop instead of breaking.",
|
|
388
|
+
change:
|
|
389
|
+
"Accept a patch if the specific gate it targets clears, even when the global score is flat. Replace `break` with `continue` and track a per-depth no-progress counter; break only after 2 consecutive no-progress depths.",
|
|
390
|
+
verify: "A run with maxDepth=4 must execute 4 depths or log an explicit reason per skipped depth.",
|
|
391
|
+
fallback: "COVEA post-pass performs per-defect anchored repair with exactly this acceptance semantics.",
|
|
392
|
+
},
|
|
393
|
+
llm: { action: "None — control-flow defect.", change: "N/A", verify: "N/A", fallback: "Deterministic only." },
|
|
394
|
+
durableHook: "src/lib/debug/covea-repair.ts (per-target accept/reject)",
|
|
395
|
+
expectedLift: 1.2,
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
detector: "unresolved-placeholder",
|
|
399
|
+
file: "../v15-pipeline.orig",
|
|
400
|
+
line: 804,
|
|
401
|
+
symbol: "runV15OnQuestion → template directive assembly",
|
|
402
|
+
anchor: "templateId: profile.templateId, onProgress,",
|
|
403
|
+
currentCode: "templateId: profile.templateId, onProgress,",
|
|
404
|
+
mechanism:
|
|
405
|
+
"No section-scoped placeholder policy exists. `[DATA GAP]` inside BLUF or Value-at-Stake is scored as a WARNING by the guard, identical to a placeholder in an appendix. Because the judge panel was fully excluded (429 + JSON parse failure in your log), nothing else caught it and the report shipped with fabricated-shaped `[DATA GAP] USD` figures in the decision section.",
|
|
406
|
+
reachability: "workspace-seam",
|
|
407
|
+
verifyCmd: "grep -n 'templateId: profile.templateId' node_modules/src/lib/v15-pipeline.orig.ts",
|
|
408
|
+
deterministic: {
|
|
409
|
+
action: "Per-section zero-placeholder policy: CRITICAL in decision sections, warning elsewhere.",
|
|
410
|
+
change:
|
|
411
|
+
"In the workspace template rubric, mark BLUF / Recommendation / Value Bridge as zero-placeholder. On violation, rewrite the sentence into an explicit open item — `Not yet sized; requires <input>, owner <role>` — rather than a fake quantity token.",
|
|
412
|
+
verify: "Zero `[DATA GAP]` tokens may survive inside a decision-critical section heading scope.",
|
|
413
|
+
fallback: "COVEA deterministic annotation `[COVEA:PLACEHOLDER_UNRESOLVED]` for reviewer triage.",
|
|
414
|
+
},
|
|
415
|
+
llm: {
|
|
416
|
+
action: "Route the number through the compute sandbox with cited inputs.",
|
|
417
|
+
change: "Force `profile.computeSandbox = true` for numeric questions (already live as G3) and emit a bottom-up estimate with stated assumptions.",
|
|
418
|
+
verify: "Every emitted figure must carry a unit and a compute record.",
|
|
419
|
+
fallback: "Deterministic open-item restatement above.",
|
|
420
|
+
},
|
|
421
|
+
durableHook: "src/lib/debug/template-rubric.ts → SECTION_HINTS zero-placeholder policy (LIVE)",
|
|
422
|
+
expectedLift: 1.0,
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
detector: "judge-unavailable",
|
|
426
|
+
file: "../v15-pipeline.orig",
|
|
427
|
+
line: 1094,
|
|
428
|
+
symbol: "runV15OnQuestion → judge panel invocation (NOT the baseline one at :661)",
|
|
429
|
+
anchor: "const panel = await judgePanelEnhanced({ apiKey, question, answer: currentText",
|
|
430
|
+
currentCode:
|
|
431
|
+
"const panel = await judgePanelEnhanced({ apiKey, question, answer: currentText, judgeModels, templateId: profile.templateId, styleOverride: profile.styleOverride });",
|
|
432
|
+
mechanism:
|
|
433
|
+
"Your run excluded BOTH judges (`gemini-2.5-pro: HTTP 429`, `gemini-3.5-flash: JSON parse failure`) leaving `judgeScore: null`. The pipeline correctly refuses to fabricate 7.5 — that is good behaviour — but it then has NO independent signal at all, so the deterministic guard score is the only gate, and it is not calibrated for sign-off.",
|
|
434
|
+
reachability: "workspace-seam",
|
|
435
|
+
verifyCmd: "grep -n 'judgePanelEnhanced({' node_modules/src/lib/v15-pipeline.orig.ts",
|
|
436
|
+
deterministic: {
|
|
437
|
+
action: "Emit a deterministic rubric floor beside the model score — never instead of it.",
|
|
438
|
+
change:
|
|
439
|
+
"Compute a floor from template-section coverage, citation trust ratio, placeholder density, and truncation state. Report as `deterministicFloor`, clearly labelled as NOT a judge score.",
|
|
440
|
+
verify: "`judgeScore` must remain null on exclusion; the floor must never be written into that field.",
|
|
441
|
+
fallback: "Retry the excluded judge on a supported model with the exact final-text hash.",
|
|
442
|
+
},
|
|
443
|
+
llm: {
|
|
444
|
+
action: "Retry with a different model tier after backoff.",
|
|
445
|
+
change: "Rotate to a non-429 model and re-submit the identical final candidate.",
|
|
446
|
+
verify: "The retried judge must score the same text hash, not a regenerated candidate.",
|
|
447
|
+
fallback: "Deterministic floor above.",
|
|
448
|
+
},
|
|
449
|
+
durableHook: "src/lib/v15-pipeline.ts post-completion (proposed — not yet implemented)",
|
|
450
|
+
expectedLift: 0.7,
|
|
451
|
+
},
|
|
452
|
+
];
|
|
453
|
+
|
|
454
|
+
/** Index by detector id — a detector may map to several sites. */
|
|
455
|
+
export function sitesFor(detector: string): RepairSite[] {
|
|
456
|
+
return REPAIR_SITES.filter((s) => s.detector === detector);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/** All distinct files that need touching, with their reachability. */
|
|
460
|
+
export function repairFileSummary(sites: RepairSite[]): Array<{ file: string; reach: Reachability; count: number }> {
|
|
461
|
+
const m = new Map<string, { file: string; reach: Reachability; count: number }>();
|
|
462
|
+
for (const s of sites) {
|
|
463
|
+
const k = `${s.file}::${s.reachability}`;
|
|
464
|
+
const cur = m.get(k) ?? { file: s.file, reach: s.reachability, count: 0 };
|
|
465
|
+
cur.count++;
|
|
466
|
+
m.set(k, cur);
|
|
467
|
+
}
|
|
468
|
+
return [...m.values()].sort((a, b) => b.count - a.count);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** Machine-readable repair order — paste into an IDE agent or another LLM. */
|
|
472
|
+
export function exportRepairOrder(sites: RepairSite[], ctx: { runId?: string; prompt?: string; template?: string; style?: string; persona?: string; guard?: number | null }): string {
|
|
473
|
+
const byFile = new Map<string, RepairSite[]>();
|
|
474
|
+
for (const s of sites) {
|
|
475
|
+
const arr = byFile.get(s.file) ?? [];
|
|
476
|
+
arr.push(s);
|
|
477
|
+
byFile.set(s.file, arr);
|
|
478
|
+
}
|
|
479
|
+
return JSON.stringify(
|
|
480
|
+
{
|
|
481
|
+
schema: "veritas.repair-order/1",
|
|
482
|
+
generatedAt: new Date().toISOString(),
|
|
483
|
+
context: ctx,
|
|
484
|
+
note: "Line numbers verified at authoring time. If verifyCmd disagrees, TRUST THE ANCHOR STRING.",
|
|
485
|
+
reachabilityLegend: {
|
|
486
|
+
"workspace-seam": "fixable today in src/, package untouched",
|
|
487
|
+
"alias-seam": "reachable because the consumer imports via @/…",
|
|
488
|
+
"post-pass": "not interceptable; fix runs after the package returns",
|
|
489
|
+
materialize: "run `node materialize.mjs <file>` first to make it editable",
|
|
490
|
+
},
|
|
491
|
+
files: [...byFile.entries()].map(([file, edits]) => ({
|
|
492
|
+
file,
|
|
493
|
+
applyVia: edits[0].reachability,
|
|
494
|
+
edits: edits.map((e) => ({
|
|
495
|
+
line: e.line,
|
|
496
|
+
symbol: e.symbol,
|
|
497
|
+
anchor: e.anchor,
|
|
498
|
+
currentCode: e.currentCode,
|
|
499
|
+
mechanism: e.mechanism,
|
|
500
|
+
deterministicChange: e.deterministic.change,
|
|
501
|
+
deterministicVerify: e.deterministic.verify,
|
|
502
|
+
deterministicFallback: e.deterministic.fallback,
|
|
503
|
+
llmChange: e.llm.change,
|
|
504
|
+
durableHook: e.durableHook,
|
|
505
|
+
expectedLift: e.expectedLift,
|
|
506
|
+
verifyCmd: e.verifyCmd,
|
|
507
|
+
})),
|
|
508
|
+
})),
|
|
509
|
+
},
|
|
510
|
+
null,
|
|
511
|
+
2
|
|
512
|
+
);
|
|
513
|
+
}
|