agentfootprint 12.2.0 → 13.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/CAPABILITIES.md +1 -0
- package/dist/adapters/code/output.js +8 -29
- package/dist/adapters/code/output.js.map +1 -1
- package/dist/adapters/observability/audit.js +151 -159
- package/dist/adapters/observability/audit.js.map +1 -1
- package/dist/adapters/observability/auditBounding.js +411 -0
- package/dist/adapters/observability/auditBounding.js.map +1 -0
- package/dist/adapters/observability/auditKeptByContract.js +107 -0
- package/dist/adapters/observability/auditKeptByContract.js.map +1 -0
- package/dist/adapters/observability/auditShapes.js +1731 -0
- package/dist/adapters/observability/auditShapes.js.map +1 -0
- package/dist/answer-account/account.js +92 -15
- package/dist/answer-account/account.js.map +1 -1
- package/dist/answer-account/facts/calls.js +7 -9
- package/dist/answer-account/facts/calls.js.map +1 -1
- package/dist/answer-account/facts/checked.js +2 -2
- package/dist/answer-account/facts/checked.js.map +1 -1
- package/dist/answer-account/facts/common.js +40 -7
- package/dist/answer-account/facts/common.js.map +1 -1
- package/dist/answer-account/facts/found.js +1 -1
- package/dist/answer-account/facts/found.js.map +1 -1
- package/dist/answer-account/facts/howSure.js +21 -3
- package/dist/answer-account/facts/howSure.js.map +1 -1
- package/dist/answer-account/facts/inView.js +3 -4
- package/dist/answer-account/facts/inView.js.map +1 -1
- package/dist/answer-account/facts/pausedLeg.js +1 -1
- package/dist/answer-account/facts/pausedLeg.js.map +1 -1
- package/dist/answer-account/facts/scripts.js +222 -0
- package/dist/answer-account/facts/scripts.js.map +1 -0
- package/dist/answer-account/facts/understood.js +5 -5
- package/dist/answer-account/facts/understood.js.map +1 -1
- package/dist/answer-account/pointerKey.js +1 -1
- package/dist/answer-account/shown.js +25 -7
- package/dist/answer-account/shown.js.map +1 -1
- package/dist/answer-account/signals.js +1 -1
- package/dist/answer-account/signals.js.map +1 -1
- package/dist/answer-account/size.js +152 -0
- package/dist/answer-account/size.js.map +1 -0
- package/dist/answer-account/templates.js +39 -1
- package/dist/answer-account/templates.js.map +1 -1
- package/dist/core/Agent.js +25 -1
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +85 -1
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/arguments/ask.js +85 -2
- package/dist/core/agent/arguments/ask.js.map +1 -1
- package/dist/core/agent/arguments/partialWindow.js +120 -0
- package/dist/core/agent/arguments/partialWindow.js.map +1 -0
- package/dist/core/agent/assessment/assess.js +37 -0
- package/dist/core/agent/assessment/assess.js.map +1 -1
- package/dist/core/agent/assessment/compose.js +5 -1
- package/dist/core/agent/assessment/compose.js.map +1 -1
- package/dist/core/agent/assessment/reasons.js +7 -0
- package/dist/core/agent/assessment/reasons.js.map +1 -1
- package/dist/core/agent/assessment/witness.js +37 -4
- package/dist/core/agent/assessment/witness.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/evidence/codeRegions.js +279 -0
- package/dist/core/agent/evidence/codeRegions.js.map +1 -0
- package/dist/core/agent/evidence/gate.js +13 -2
- package/dist/core/agent/evidence/gate.js.map +1 -1
- package/dist/core/agent/evidence/recovery.js +11 -2
- package/dist/core/agent/evidence/recovery.js.map +1 -1
- package/dist/core/agent/findings/types.js.map +1 -1
- package/dist/core/agent/scripts/attachment.js +375 -0
- package/dist/core/agent/scripts/attachment.js.map +1 -0
- package/dist/core/agent/scripts/inert.js +88 -0
- package/dist/core/agent/scripts/inert.js.map +1 -0
- package/dist/core/agent/scripts/judge.js +41 -0
- package/dist/core/agent/scripts/judge.js.map +1 -0
- package/dist/core/agent/scripts/label.js +143 -0
- package/dist/core/agent/scripts/label.js.map +1 -0
- package/dist/core/agent/scripts/match.js +233 -0
- package/dist/core/agent/scripts/match.js.map +1 -0
- package/dist/core/agent/scripts/recovery.js +81 -0
- package/dist/core/agent/scripts/recovery.js.map +1 -0
- package/dist/core/agent/scripts/rows.js +221 -0
- package/dist/core/agent/scripts/rows.js.map +1 -0
- package/dist/core/agent/scripts/types.js +22 -0
- package/dist/core/agent/scripts/types.js.map +1 -0
- package/dist/core/agent/scripts/wrapper.js +63 -0
- package/dist/core/agent/scripts/wrapper.js.map +1 -0
- package/dist/core/agent/stages/argumentAsk.js +161 -19
- package/dist/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/core/agent/stages/evidenceRecheck.js +4 -1
- package/dist/core/agent/stages/evidenceRecheck.js.map +1 -1
- package/dist/core/agent/stages/prepareFinal.js +65 -10
- package/dist/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/core/agent/stages/route.js +53 -3
- package/dist/core/agent/stages/route.js.map +1 -1
- package/dist/core/agent/stages/seed.js +14 -1
- package/dist/core/agent/stages/seed.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +339 -18
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/codeRunnerTool.js +32 -3
- package/dist/core/codeRunnerTool.js.map +1 -1
- package/dist/core/runCheckpoint.js +19 -6
- package/dist/core/runCheckpoint.js.map +1 -1
- package/dist/esm/adapters/code/output.d.ts +1 -4
- package/dist/esm/adapters/code/output.js +3 -24
- package/dist/esm/adapters/code/output.js.map +1 -1
- package/dist/esm/adapters/observability/audit.d.ts +79 -12
- package/dist/esm/adapters/observability/audit.js +132 -142
- package/dist/esm/adapters/observability/audit.js.map +1 -1
- package/dist/esm/adapters/observability/auditBounding.d.ts +215 -0
- package/dist/esm/adapters/observability/auditBounding.js +390 -0
- package/dist/esm/adapters/observability/auditBounding.js.map +1 -0
- package/dist/esm/adapters/observability/auditKeptByContract.d.ts +65 -0
- package/dist/esm/adapters/observability/auditKeptByContract.js +103 -0
- package/dist/esm/adapters/observability/auditKeptByContract.js.map +1 -0
- package/dist/esm/adapters/observability/auditShapes.d.ts +78 -0
- package/dist/esm/adapters/observability/auditShapes.js +1726 -0
- package/dist/esm/adapters/observability/auditShapes.js.map +1 -0
- package/dist/esm/answer-account/account.js +91 -14
- package/dist/esm/answer-account/account.js.map +1 -1
- package/dist/esm/answer-account/facts/calls.d.ts +0 -2
- package/dist/esm/answer-account/facts/calls.js +1 -3
- package/dist/esm/answer-account/facts/calls.js.map +1 -1
- package/dist/esm/answer-account/facts/checked.js +2 -2
- package/dist/esm/answer-account/facts/checked.js.map +1 -1
- package/dist/esm/answer-account/facts/common.d.ts +16 -4
- package/dist/esm/answer-account/facts/common.js +38 -6
- package/dist/esm/answer-account/facts/common.js.map +1 -1
- package/dist/esm/answer-account/facts/found.js +2 -2
- package/dist/esm/answer-account/facts/found.js.map +1 -1
- package/dist/esm/answer-account/facts/howSure.d.ts +1 -1
- package/dist/esm/answer-account/facts/howSure.js +22 -4
- package/dist/esm/answer-account/facts/howSure.js.map +1 -1
- package/dist/esm/answer-account/facts/inView.js +1 -2
- package/dist/esm/answer-account/facts/inView.js.map +1 -1
- package/dist/esm/answer-account/facts/pausedLeg.js +2 -2
- package/dist/esm/answer-account/facts/pausedLeg.js.map +1 -1
- package/dist/esm/answer-account/facts/scripts.d.ts +34 -0
- package/dist/esm/answer-account/facts/scripts.js +218 -0
- package/dist/esm/answer-account/facts/scripts.js.map +1 -0
- package/dist/esm/answer-account/facts/understood.js +2 -2
- package/dist/esm/answer-account/facts/understood.js.map +1 -1
- package/dist/esm/answer-account/pointerKey.d.ts +1 -1
- package/dist/esm/answer-account/pointerKey.js +1 -1
- package/dist/esm/answer-account/shown.d.ts +9 -2
- package/dist/esm/answer-account/shown.js +25 -7
- package/dist/esm/answer-account/shown.js.map +1 -1
- package/dist/esm/answer-account/signals.js +2 -2
- package/dist/esm/answer-account/signals.js.map +1 -1
- package/dist/esm/answer-account/size.d.ts +59 -0
- package/dist/esm/answer-account/size.js +147 -0
- package/dist/esm/answer-account/size.js.map +1 -0
- package/dist/esm/answer-account/templates.d.ts +29 -1
- package/dist/esm/answer-account/templates.js +39 -1
- package/dist/esm/answer-account/templates.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +8 -1
- package/dist/esm/core/Agent.js +25 -1
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +52 -0
- package/dist/esm/core/agent/AgentBuilder.js +85 -1
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/arguments/ask.d.ts +11 -0
- package/dist/esm/core/agent/arguments/ask.js +83 -1
- package/dist/esm/core/agent/arguments/ask.js.map +1 -1
- package/dist/esm/core/agent/arguments/partialWindow.d.ts +42 -0
- package/dist/esm/core/agent/arguments/partialWindow.js +111 -0
- package/dist/esm/core/agent/arguments/partialWindow.js.map +1 -0
- package/dist/esm/core/agent/assessment/assess.js +37 -0
- package/dist/esm/core/agent/assessment/assess.js.map +1 -1
- package/dist/esm/core/agent/assessment/compose.d.ts +3 -1
- package/dist/esm/core/agent/assessment/compose.js +5 -1
- package/dist/esm/core/agent/assessment/compose.js.map +1 -1
- package/dist/esm/core/agent/assessment/reasons.js +7 -0
- package/dist/esm/core/agent/assessment/reasons.js.map +1 -1
- package/dist/esm/core/agent/assessment/types.d.ts +12 -2
- package/dist/esm/core/agent/assessment/witness.d.ts +44 -4
- package/dist/esm/core/agent/assessment/witness.js +35 -3
- package/dist/esm/core/agent/assessment/witness.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.d.ts +9 -0
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/evidence/codeRegions.d.ts +130 -0
- package/dist/esm/core/agent/evidence/codeRegions.js +275 -0
- package/dist/esm/core/agent/evidence/codeRegions.js.map +1 -0
- package/dist/esm/core/agent/evidence/gate.d.ts +3 -0
- package/dist/esm/core/agent/evidence/gate.js +12 -2
- package/dist/esm/core/agent/evidence/gate.js.map +1 -1
- package/dist/esm/core/agent/evidence/recovery.d.ts +5 -1
- package/dist/esm/core/agent/evidence/recovery.js +11 -2
- package/dist/esm/core/agent/evidence/recovery.js.map +1 -1
- package/dist/esm/core/agent/evidence/types.d.ts +35 -0
- package/dist/esm/core/agent/findings/types.d.ts +3 -2
- package/dist/esm/core/agent/findings/types.js.map +1 -1
- package/dist/esm/core/agent/scripts/attachment.d.ts +179 -0
- package/dist/esm/core/agent/scripts/attachment.js +361 -0
- package/dist/esm/core/agent/scripts/attachment.js.map +1 -0
- package/dist/esm/core/agent/scripts/inert.d.ts +38 -0
- package/dist/esm/core/agent/scripts/inert.js +84 -0
- package/dist/esm/core/agent/scripts/inert.js.map +1 -0
- package/dist/esm/core/agent/scripts/judge.d.ts +36 -0
- package/dist/esm/core/agent/scripts/judge.js +37 -0
- package/dist/esm/core/agent/scripts/judge.js.map +1 -0
- package/dist/esm/core/agent/scripts/label.d.ts +103 -0
- package/dist/esm/core/agent/scripts/label.js +136 -0
- package/dist/esm/core/agent/scripts/label.js.map +1 -0
- package/dist/esm/core/agent/scripts/match.d.ts +99 -0
- package/dist/esm/core/agent/scripts/match.js +226 -0
- package/dist/esm/core/agent/scripts/match.js.map +1 -0
- package/dist/esm/core/agent/scripts/recovery.d.ts +54 -0
- package/dist/esm/core/agent/scripts/recovery.js +77 -0
- package/dist/esm/core/agent/scripts/recovery.js.map +1 -0
- package/dist/esm/core/agent/scripts/rows.d.ts +143 -0
- package/dist/esm/core/agent/scripts/rows.js +211 -0
- package/dist/esm/core/agent/scripts/rows.js.map +1 -0
- package/dist/esm/core/agent/scripts/types.d.ts +91 -0
- package/dist/esm/core/agent/scripts/types.js +21 -0
- package/dist/esm/core/agent/scripts/types.js.map +1 -0
- package/dist/esm/core/agent/scripts/wrapper.d.ts +36 -0
- package/dist/esm/core/agent/scripts/wrapper.js +58 -0
- package/dist/esm/core/agent/scripts/wrapper.js.map +1 -0
- package/dist/esm/core/agent/stages/argumentAsk.d.ts +4 -1
- package/dist/esm/core/agent/stages/argumentAsk.js +164 -22
- package/dist/esm/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/esm/core/agent/stages/evidenceRecheck.js +4 -1
- package/dist/esm/core/agent/stages/evidenceRecheck.js.map +1 -1
- package/dist/esm/core/agent/stages/prepareFinal.d.ts +11 -0
- package/dist/esm/core/agent/stages/prepareFinal.js +65 -10
- package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/esm/core/agent/stages/route.js +53 -3
- package/dist/esm/core/agent/stages/route.js.map +1 -1
- package/dist/esm/core/agent/stages/seed.js +14 -1
- package/dist/esm/core/agent/stages/seed.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +14 -0
- package/dist/esm/core/agent/stages/toolCalls.js +337 -16
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +41 -0
- package/dist/esm/core/codeRunnerTool.d.ts +23 -0
- package/dist/esm/core/codeRunnerTool.js +31 -2
- package/dist/esm/core/codeRunnerTool.js.map +1 -1
- package/dist/esm/core/runCheckpoint.js +16 -3
- package/dist/esm/core/runCheckpoint.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +46 -1
- package/dist/esm/hosting/answerAccounts.js +4 -2
- package/dist/esm/hosting/answerAccounts.js.map +1 -1
- package/dist/esm/hosting/artifactWire.d.ts +3 -2
- package/dist/esm/hosting/artifactWire.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/boundedJson.d.ts +24 -0
- package/dist/esm/lib/boundedJson.js +45 -2
- package/dist/esm/lib/boundedJson.js.map +1 -1
- package/dist/esm/lib/scriptRecord.d.ts +139 -0
- package/dist/esm/lib/scriptRecord.js +18 -0
- package/dist/esm/lib/scriptRecord.js.map +1 -0
- package/dist/esm/lib/utf8.d.ts +36 -0
- package/dist/esm/lib/utf8.js +70 -0
- package/dist/esm/lib/utf8.js.map +1 -0
- package/dist/esm/mcp/toolExtras.d.ts +9 -0
- package/dist/esm/mcp/toolExtras.js +6 -0
- package/dist/esm/mcp/toolExtras.js.map +1 -1
- package/dist/esm/redaction/conversation.js +10 -0
- package/dist/esm/redaction/conversation.js.map +1 -1
- package/dist/esm/redaction/knownStrings.js +34 -0
- package/dist/esm/redaction/knownStrings.js.map +1 -1
- package/dist/esm/semantics/coverage/answer.d.ts +12 -1
- package/dist/esm/semantics/coverage/answer.js +26 -3
- package/dist/esm/semantics/coverage/answer.js.map +1 -1
- package/dist/esm/tools/script.d.ts +85 -0
- package/dist/esm/tools/script.js +157 -0
- package/dist/esm/tools/script.js.map +1 -0
- package/dist/esm/tools/tools.d.ts +30 -0
- package/dist/esm/tools/tools.js +4 -0
- package/dist/esm/tools/tools.js.map +1 -1
- package/dist/hosting/answerAccounts.js +4 -2
- package/dist/hosting/answerAccounts.js.map +1 -1
- package/dist/hosting/artifactWire.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/boundedJson.js +48 -3
- package/dist/lib/boundedJson.js.map +1 -1
- package/dist/lib/scriptRecord.js +19 -0
- package/dist/lib/scriptRecord.js.map +1 -0
- package/dist/lib/utf8.js +77 -0
- package/dist/lib/utf8.js.map +1 -0
- package/dist/mcp/toolExtras.js +6 -0
- package/dist/mcp/toolExtras.js.map +1 -1
- package/dist/redaction/conversation.js +10 -0
- package/dist/redaction/conversation.js.map +1 -1
- package/dist/redaction/knownStrings.js +34 -0
- package/dist/redaction/knownStrings.js.map +1 -1
- package/dist/semantics/coverage/answer.js +26 -3
- package/dist/semantics/coverage/answer.js.map +1 -1
- package/dist/tools/script.js +163 -0
- package/dist/tools/script.js.map +1 -0
- package/dist/tools/tools.js +4 -0
- package/dist/tools/tools.js.map +1 -1
- package/dist/types/adapters/code/output.d.ts +1 -4
- package/dist/types/adapters/code/output.d.ts.map +1 -1
- package/dist/types/adapters/observability/audit.d.ts +79 -12
- package/dist/types/adapters/observability/audit.d.ts.map +1 -1
- package/dist/types/adapters/observability/auditBounding.d.ts +216 -0
- package/dist/types/adapters/observability/auditBounding.d.ts.map +1 -0
- package/dist/types/adapters/observability/auditKeptByContract.d.ts +66 -0
- package/dist/types/adapters/observability/auditKeptByContract.d.ts.map +1 -0
- package/dist/types/adapters/observability/auditShapes.d.ts +79 -0
- package/dist/types/adapters/observability/auditShapes.d.ts.map +1 -0
- package/dist/types/answer-account/account.d.ts.map +1 -1
- package/dist/types/answer-account/facts/calls.d.ts +0 -2
- package/dist/types/answer-account/facts/calls.d.ts.map +1 -1
- package/dist/types/answer-account/facts/checked.d.ts.map +1 -1
- package/dist/types/answer-account/facts/common.d.ts +16 -4
- package/dist/types/answer-account/facts/common.d.ts.map +1 -1
- package/dist/types/answer-account/facts/found.d.ts.map +1 -1
- package/dist/types/answer-account/facts/howSure.d.ts +1 -1
- package/dist/types/answer-account/facts/howSure.d.ts.map +1 -1
- package/dist/types/answer-account/facts/inView.d.ts.map +1 -1
- package/dist/types/answer-account/facts/pausedLeg.d.ts.map +1 -1
- package/dist/types/answer-account/facts/scripts.d.ts +35 -0
- package/dist/types/answer-account/facts/scripts.d.ts.map +1 -0
- package/dist/types/answer-account/facts/understood.d.ts.map +1 -1
- package/dist/types/answer-account/pointerKey.d.ts +1 -1
- package/dist/types/answer-account/shown.d.ts +9 -2
- package/dist/types/answer-account/shown.d.ts.map +1 -1
- package/dist/types/answer-account/signals.d.ts.map +1 -1
- package/dist/types/answer-account/size.d.ts +60 -0
- package/dist/types/answer-account/size.d.ts.map +1 -0
- package/dist/types/answer-account/templates.d.ts +29 -1
- package/dist/types/answer-account/templates.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +8 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +52 -0
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/ask.d.ts +11 -0
- package/dist/types/core/agent/arguments/ask.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/partialWindow.d.ts +43 -0
- package/dist/types/core/agent/arguments/partialWindow.d.ts.map +1 -0
- package/dist/types/core/agent/assessment/assess.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/compose.d.ts +3 -1
- package/dist/types/core/agent/assessment/compose.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/reasons.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/types.d.ts +12 -2
- package/dist/types/core/agent/assessment/types.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/witness.d.ts +44 -4
- package/dist/types/core/agent/assessment/witness.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts +9 -0
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/codeRegions.d.ts +131 -0
- package/dist/types/core/agent/evidence/codeRegions.d.ts.map +1 -0
- package/dist/types/core/agent/evidence/gate.d.ts +3 -0
- package/dist/types/core/agent/evidence/gate.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/recovery.d.ts +5 -1
- package/dist/types/core/agent/evidence/recovery.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/types.d.ts +35 -0
- package/dist/types/core/agent/evidence/types.d.ts.map +1 -1
- package/dist/types/core/agent/findings/types.d.ts +3 -2
- package/dist/types/core/agent/findings/types.d.ts.map +1 -1
- package/dist/types/core/agent/scripts/attachment.d.ts +180 -0
- package/dist/types/core/agent/scripts/attachment.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/inert.d.ts +39 -0
- package/dist/types/core/agent/scripts/inert.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/judge.d.ts +37 -0
- package/dist/types/core/agent/scripts/judge.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/label.d.ts +104 -0
- package/dist/types/core/agent/scripts/label.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/match.d.ts +100 -0
- package/dist/types/core/agent/scripts/match.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/recovery.d.ts +55 -0
- package/dist/types/core/agent/scripts/recovery.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/rows.d.ts +144 -0
- package/dist/types/core/agent/scripts/rows.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/types.d.ts +92 -0
- package/dist/types/core/agent/scripts/types.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/wrapper.d.ts +37 -0
- package/dist/types/core/agent/scripts/wrapper.d.ts.map +1 -0
- package/dist/types/core/agent/stages/argumentAsk.d.ts +4 -1
- package/dist/types/core/agent/stages/argumentAsk.d.ts.map +1 -1
- package/dist/types/core/agent/stages/evidenceRecheck.d.ts.map +1 -1
- package/dist/types/core/agent/stages/prepareFinal.d.ts +11 -0
- package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
- package/dist/types/core/agent/stages/route.d.ts.map +1 -1
- package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +14 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +41 -0
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/codeRunnerTool.d.ts +23 -0
- package/dist/types/core/codeRunnerTool.d.ts.map +1 -1
- package/dist/types/core/runCheckpoint.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +46 -1
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/hosting/answerAccounts.d.ts.map +1 -1
- package/dist/types/hosting/artifactWire.d.ts +3 -2
- package/dist/types/hosting/artifactWire.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/boundedJson.d.ts +24 -0
- package/dist/types/lib/boundedJson.d.ts.map +1 -1
- package/dist/types/lib/scriptRecord.d.ts +140 -0
- package/dist/types/lib/scriptRecord.d.ts.map +1 -0
- package/dist/types/lib/utf8.d.ts +37 -0
- package/dist/types/lib/utf8.d.ts.map +1 -0
- package/dist/types/mcp/toolExtras.d.ts +9 -0
- package/dist/types/mcp/toolExtras.d.ts.map +1 -1
- package/dist/types/redaction/conversation.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings.d.ts.map +1 -1
- package/dist/types/semantics/coverage/answer.d.ts +12 -1
- package/dist/types/semantics/coverage/answer.d.ts.map +1 -1
- package/dist/types/tools/script.d.ts +86 -0
- package/dist/types/tools/script.d.ts.map +1 -0
- package/dist/types/tools/tools.d.ts +30 -0
- package/dist/types/tools/tools.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* codeRegions — the fenced code blocks of an answer, read by one linear pass,
|
|
3
|
+
* closed where a CommonMark renderer closes them.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: pure leaf. Imports nothing — it does not know the gate exists. The
|
|
6
|
+
* one reader of "which bytes of this answer sit inside a fenced
|
|
7
|
+
* block", asked by the script match (`../scripts/match.ts`) under
|
|
8
|
+
* `.namesAndNumbersFromEvidence({ code: 'match' })`. Under the
|
|
9
|
+
* default `code: 'check'` it is never called.
|
|
10
|
+
* Role: core/ layer (the evidence gate's folder), no state, no events.
|
|
11
|
+
*
|
|
12
|
+
* ## Why it must agree with the renderer
|
|
13
|
+
*
|
|
14
|
+
* A region that matches a submission is exempt from the evidence check. If
|
|
15
|
+
* this reader saw a block where a renderer shows prose, a model could submit a
|
|
16
|
+
* program holding a sentence, show it fenced so that the sentence renders
|
|
17
|
+
* outside the block, and the sentence would never be checked. So the reader
|
|
18
|
+
* closes a block exactly where CommonMark closes it. Where a renderer could
|
|
19
|
+
* pair fences another way, it stops reading blocks altogether.
|
|
20
|
+
*
|
|
21
|
+
* ## The grammar (design: docs/design/2026-10-script-artifact.md § 5.1–5.2, aligned with CommonMark)
|
|
22
|
+
*
|
|
23
|
+
* The answer is read line by line. A line ends at an LF, a CR or a CRLF, as
|
|
24
|
+
* CommonMark ends it.
|
|
25
|
+
*
|
|
26
|
+
* - An OPENING fence starts at column 0 with three or more backticks, or three
|
|
27
|
+
* or more tildes, then an optional info string, and ENDS IN A LINE ENDING.
|
|
28
|
+
* A backtick fence's info string may not contain a backtick.
|
|
29
|
+
* - The CLOSING fence uses the same character and is at least as long. As in
|
|
30
|
+
* CommonMark, it may be indented by up to three spaces and is followed only
|
|
31
|
+
* by spaces.
|
|
32
|
+
* - The CONTENT is exactly the bytes between the opening line's line ending
|
|
33
|
+
* and the ONE line ending before the closing line: every space, tab, CR and
|
|
34
|
+
* code point as written. Before the closing line, an LF is the wrapper's (a
|
|
35
|
+
* CR before it is content), and so is a lone CR. A closing fence on the line
|
|
36
|
+
* right after the opening one gives an empty block (content `''`).
|
|
37
|
+
* - A fence that never closes is NOT a region: the text from it to the end is
|
|
38
|
+
* prose.
|
|
39
|
+
* - At most {@link MAX_CODE_REGIONS} regions are read; the rest are prose and
|
|
40
|
+
* counted in `dropped`.
|
|
41
|
+
*
|
|
42
|
+
* ## Where reading stops (`stoppedAt`)
|
|
43
|
+
*
|
|
44
|
+
* The reader models CommonMark's top level only. It does not model list
|
|
45
|
+
* items, block quotes, HTML blocks or the extensions renderers add. At the
|
|
46
|
+
* first line where a renderer could pair fences another way, reading STOPS.
|
|
47
|
+
* No region is read from there on: everything after that point is prose and
|
|
48
|
+
* checked.
|
|
49
|
+
*
|
|
50
|
+
* Outside a block, reading stops at:
|
|
51
|
+
* - a fence indented by one to three spaces. It is either a list item's fence,
|
|
52
|
+
* which the item scopes, or an indented fence, whose content a renderer
|
|
53
|
+
* strips (and "as written" and "with the indentation removed" are two
|
|
54
|
+
* different programs);
|
|
55
|
+
* - a line that may start an HTML block (up to three spaces, `<`, then a
|
|
56
|
+
* letter, `/`, `!` or `?`). Inside an HTML block, a fence is not a fence;
|
|
57
|
+
* - a line opening display math (`$$`), the block extension chat renderers
|
|
58
|
+
* commonly add. Inside display math, a fence is not a fence;
|
|
59
|
+
* - a byte-order mark at the very start, which some renderers drop and some
|
|
60
|
+
* keep.
|
|
61
|
+
*
|
|
62
|
+
* Inside a block, reading stops at:
|
|
63
|
+
* - a closing run followed by a TAB. CommonMark 0.30 closes the block there
|
|
64
|
+
* and 0.29 does not, so the block is read (it is code either way) and
|
|
65
|
+
* reading stops after it;
|
|
66
|
+
* - a run of the block's own fence character, anywhere in its content, as long
|
|
67
|
+
* as its opening fence. A renderer laxer than CommonMark could close the
|
|
68
|
+
* block there, so the block is prose and reading stops at its opening line.
|
|
69
|
+
* The library's own wrapper never writes such a block
|
|
70
|
+
* (`../scripts/wrapper.ts` · `fenceFor`: the longest run + 1).
|
|
71
|
+
*
|
|
72
|
+
* Nothing here normalizes anything: no trimming, no line-ending rewrite, no
|
|
73
|
+
* Unicode normalization. A region is the program a reader would copy.
|
|
74
|
+
*
|
|
75
|
+
* ## Linear by construction
|
|
76
|
+
*
|
|
77
|
+
* The text is model output, so the pass is linear in it (the
|
|
78
|
+
* `lib/linearText.ts` law, pinned by `test/security/linear-scanners.test.ts`).
|
|
79
|
+
* Each line is read ONCE, character by character, from where the last one
|
|
80
|
+
* ended: its indentation, its fence run, the rest of it and its line ending.
|
|
81
|
+
* No regular expression runs over the answer.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const { regions } = codeRegionsOf('Total:\n```python\nprint(1)\n```\nDone.');
|
|
86
|
+
* regions[0].content; // 'print(1)'
|
|
87
|
+
* regions[0].block; // 1
|
|
88
|
+
* codeRegionsOf('```\na\n ```\nRevenue was 4321.').regions[0].content; // 'a'
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
/** Regions read per answer; the rest are prose and counted (`dropped`). Design § 4.4. */
|
|
92
|
+
export declare const MAX_CODE_REGIONS = 32;
|
|
93
|
+
/** One fenced block, as the answer wrote it. */
|
|
94
|
+
export interface CodeRegion {
|
|
95
|
+
/** 1-based position among the regions READ, in answer order. */
|
|
96
|
+
readonly block: number;
|
|
97
|
+
/** Index of the opening fence line's first character. */
|
|
98
|
+
readonly start: number;
|
|
99
|
+
/** Index just past the closing fence line (past its line ending when it has one). */
|
|
100
|
+
readonly end: number;
|
|
101
|
+
/** The bytes between the wrapper's two line endings — the program as written. */
|
|
102
|
+
readonly content: string;
|
|
103
|
+
/** The opening line's info string, as written (spaces excluded at the ends). */
|
|
104
|
+
readonly info: string;
|
|
105
|
+
}
|
|
106
|
+
/** Every region of one answer, and how many more there were. */
|
|
107
|
+
export interface CodeRegions {
|
|
108
|
+
readonly regions: readonly CodeRegion[];
|
|
109
|
+
/** Regions past {@link MAX_CODE_REGIONS}: read as prose, never matched. */
|
|
110
|
+
readonly dropped: number;
|
|
111
|
+
/**
|
|
112
|
+
* Where reading stopped, when it did: the index of the first character no
|
|
113
|
+
* region is read from. Everything from here on is prose. Absent when the
|
|
114
|
+
* whole answer was read.
|
|
115
|
+
*/
|
|
116
|
+
readonly stoppedAt?: number;
|
|
117
|
+
/**
|
|
118
|
+
* The opening run of a fence still open at the END (`'```'`, `'~~~~'`) —
|
|
119
|
+
* the block a renderer is still inside there. The fence is prose for the
|
|
120
|
+
* match; a writer that appends after this text closes it first
|
|
121
|
+
* (`../scripts/attachment.ts` · `attachmentBoundary`). Never set with
|
|
122
|
+
* `stoppedAt`: after a stop the reader does not know what is open.
|
|
123
|
+
*/
|
|
124
|
+
readonly openFence?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The fenced code regions of `text`, in order, how many past the cap, and where
|
|
128
|
+
* reading stopped. Pure and linear; `max` defaults to {@link MAX_CODE_REGIONS}.
|
|
129
|
+
*/
|
|
130
|
+
export declare function codeRegionsOf(text: string, max?: number): CodeRegions;
|
|
131
|
+
//# sourceMappingURL=codeRegions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeRegions.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/codeRegions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,gDAAgD;AAChD,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,gEAAgE;AAChE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAoID;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAyB,GAAG,WAAW,CA2EvF"}
|
|
@@ -66,6 +66,9 @@ import type { FigureCheck } from './figures.js';
|
|
|
66
66
|
import type { EvidencePosture, EvidenceVerdict, NamesAndNumbersOptions, ResolvedEvidenceGate, UnsupportedValue } from './types.js';
|
|
67
67
|
export { EVIDENCE_CHECK_FRAME_PREFIX };
|
|
68
68
|
export { MAX_REPORTED_VALUES };
|
|
69
|
+
/** Clip a value for display without letting it pretend to be complete — the
|
|
70
|
+
* spelling every verdict reports a value under (`UnsupportedValue.value`). */
|
|
71
|
+
export declare function clip(v: string): string;
|
|
69
72
|
/**
|
|
70
73
|
* Validate the caller's options once, at build time, into the config the chart
|
|
71
74
|
* carries. Refusals name the option and the fix — nothing here is discovered
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;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|
17
17
|
}, extra?: EvidenceRecoveryInstruction, staged?: StagedRefsMatch,
|
|
18
18
|
/** The figures dial's late line (`figures.ts` · `figuresConclusionLine`,
|
|
19
19
|
* composed by Route, which loaded the module): rides the request LAST. */
|
|
20
|
-
conclusion?: string
|
|
20
|
+
conclusion?: string,
|
|
21
|
+
/** Under `code: 'match'`: the script clause (`scripts/recovery.ts` ·
|
|
22
|
+
* `scriptRecoveryClause`, composed by Route) — after "Recovery action:
|
|
23
|
+
* replace the rejected draft". Absent or `''` → the bytes it always was. */
|
|
24
|
+
scriptClause?: string): PendingEvidenceRecovery;
|
|
21
25
|
/** The late line, on the iteration its instruction is served — `callLLM` and `servedView` alike. */
|
|
22
26
|
export declare function evidenceConclusionLine(pending: PendingEvidenceRecovery | undefined, used: boolean | undefined, iteration: number): string | undefined;
|
|
23
27
|
/** Shared by live request assembly and servedAt's independent reconstruction. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recovery.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/recovery.ts"],"names":[],"mappings":"AAAA;4EAC4E;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAEV,2BAA2B,EAC3B,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,oCAAoC,OAAO,CAAC;AACzD,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,UAAY,CAAC;AAErD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEhE;AAoBD,uFAAuF;AACvF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE;IACL,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;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AM,GAAG,SAAS,CAIpB;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,uBAAuB,GAAG,SAAS,EAC5C,IAAI,EAAE,OAAO,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAChB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,GAAG,SAAS,CAIxF"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Emits: N/A.
|
|
8
8
|
*/
|
|
9
9
|
import type { AnswerGroundingReading } from '../../../integrity/prior-turn-evidence/check.js';
|
|
10
|
+
import type { ScriptsVerdict } from '../scripts/types.js';
|
|
10
11
|
/**
|
|
11
12
|
* How hard the check pushes back. **Same three words as the skill-graph
|
|
12
13
|
* routing dial, deliberately** — one posture vocabulary across the library —
|
|
@@ -160,6 +161,25 @@ export interface NamesAndNumbersOptions {
|
|
|
160
161
|
* The library's internal framing and validation remain in force. The text
|
|
161
162
|
* is request-only and never becomes evidence, user history or an exemption. */
|
|
162
163
|
readonly recoveryInstruction?: EvidenceRecoveryInstruction;
|
|
164
|
+
/**
|
|
165
|
+
* How a fenced code block in a PROSE answer is read. Default `'check'` —
|
|
166
|
+
* today's behaviour, byte for byte: the whole answer is prose.
|
|
167
|
+
*
|
|
168
|
+
* `'match'` — each fenced block (```` ``` ```` or `~~~`, at column 0, closed)
|
|
169
|
+
* is compared, byte for byte after removing only the Markdown wrapper,
|
|
170
|
+
* against the programs this TURN's calls of a declared code-running tool
|
|
171
|
+
* (`Tool.script`, which `codeRunnerTool` declares) submitted to the tool. A
|
|
172
|
+
* block that matches one is script content: it yields no value to ground
|
|
173
|
+
* and is labelled with that call's recorded outcome (`completed, exit 0`,
|
|
174
|
+
* `outcome unknown`, …). A block that matches none stays prose, checked as
|
|
175
|
+
* today, and is labelled `unmatched`. Code is never evidence: a value in the
|
|
176
|
+
* prose that also sits in the script still needs a tool result.
|
|
177
|
+
*
|
|
178
|
+
* Inline spans, unclosed fences and indented code are prose. A typed answer
|
|
179
|
+
* is not scanned. There is no `'skip'`: exempting every fence would be an
|
|
180
|
+
* exemption by formatting. See `core/agent/scripts/README.md`.
|
|
181
|
+
*/
|
|
182
|
+
readonly code?: 'check' | 'match';
|
|
163
183
|
}
|
|
164
184
|
/**
|
|
165
185
|
* One value a tool result DID carry (9.110.0): the candidate as normalized
|
|
@@ -192,6 +212,12 @@ export interface UnsupportedValue {
|
|
|
192
212
|
/** Which rule made it a candidate: `'identifier'`, `'number'`, or the name
|
|
193
213
|
* of a declared {@link EvidenceShape}. */
|
|
194
214
|
readonly shape: string;
|
|
215
|
+
/**
|
|
216
|
+
* Under `code: 'match'` only: `'code'` when every occurrence of the value is
|
|
217
|
+
* inside a fenced block that matched no submission (checked as prose all the
|
|
218
|
+
* same), `'prose'` otherwise. Absent under `'check'`.
|
|
219
|
+
*/
|
|
220
|
+
readonly region?: 'prose' | 'code';
|
|
195
221
|
}
|
|
196
222
|
/**
|
|
197
223
|
* What the builder resolved once and the chart carries for the whole run.
|
|
@@ -217,6 +243,8 @@ export interface ResolvedEvidenceGate {
|
|
|
217
243
|
/** Present only when true: an absent dial preserves resolved default bytes. */
|
|
218
244
|
readonly decimalRounding?: true;
|
|
219
245
|
readonly recoveryInstruction?: EvidenceRecoveryInstruction;
|
|
246
|
+
/** Present only for `code: 'match'`: an absent field is `'check'`, byte for byte. */
|
|
247
|
+
readonly code?: 'match';
|
|
220
248
|
/**
|
|
221
249
|
* Set by the agent, never by `resolveEvidenceGate`: a posture that can
|
|
222
250
|
* revise under an ENFORCING answer validation. The revision and every later
|
|
@@ -300,5 +328,12 @@ export interface EvidenceVerdict {
|
|
|
300
328
|
* no posture changes because of it.
|
|
301
329
|
*/
|
|
302
330
|
readonly grounding: AnswerGroundingReading;
|
|
331
|
+
/**
|
|
332
|
+
* Under `code: 'match'` on a prose answer: the verdict on each fenced block
|
|
333
|
+
* (matched → its call's label, or `unmatched` with a reason), the script
|
|
334
|
+
* rows of earlier turns counted, and blocks past the cap counted. Never the
|
|
335
|
+
* code. Absent under `'check'` and on a typed answer.
|
|
336
|
+
*/
|
|
337
|
+
readonly scripts?: ScriptsVerdict;
|
|
303
338
|
}
|
|
304
339
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/evidence/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,aAAa;IAC5B;sDACkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;wEACwE;AACxE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD,QAAQ,C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E,OAAO,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC;IAChC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;IAC3D,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC;CACvC;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC/C;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC9C;;;;;;;OAOG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,EAAE,sBAAsB,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;CACnC"}
|
|
@@ -33,7 +33,8 @@ import type { Assertion } from '../../../integrity/assertion/types.js';
|
|
|
33
33
|
import type { ArgumentRow } from '../arguments/rows.js';
|
|
34
34
|
import type { DeclaredSource } from '../arguments/sources.js';
|
|
35
35
|
import type { PeriodRow } from '../../../semantics/coverage/period.js';
|
|
36
|
-
import type { GroundedRow, StepsUnfinishedRow } from '../assessment/witness.js';
|
|
36
|
+
import type { GroundedRow, ScriptShownRow, StepsUnfinishedRow } from '../assessment/witness.js';
|
|
37
|
+
import type { ScriptRow } from '../scripts/types.js';
|
|
37
38
|
import type { CallRow, CallWindowRow, ClockOnResumeRow, ClockRow, TimeAnswerRow, SourceClockRow, TimeDerivedRow, TimeReadingRow } from '../../../time/rows.js';
|
|
38
39
|
import type { CoverageItem } from '../../../semantics/coverage/types.js';
|
|
39
40
|
import type { ClaimVerificationRow } from './verificationTypes.js';
|
|
@@ -435,7 +436,7 @@ export type NegativeProseFinding = import('../../../integrity/negative-claim/typ
|
|
|
435
436
|
readonly iteration: number;
|
|
436
437
|
readonly turn?: number;
|
|
437
438
|
};
|
|
438
|
-
export type FindingsRow = import('./refusal.js').ReferenceRefusalRow | NegativeProseFinding | BasisRow | StandingRow | ConflictRow | JudgmentRow | JudgmentErrorRow | ContingentRow | UnsettledByAbsenceRow | ClaimVerificationRow | ArgumentRow | PeriodRow | GroundedRow | StepsUnfinishedRow | ClockRow | ClockOnResumeRow | CallRow | TimeReadingRow | CallWindowRow | TimeAnswerRow | TimeDerivedRow | SourceClockRow;
|
|
439
|
+
export type FindingsRow = import('./refusal.js').ReferenceRefusalRow | NegativeProseFinding | BasisRow | StandingRow | ConflictRow | JudgmentRow | JudgmentErrorRow | ContingentRow | UnsettledByAbsenceRow | ClaimVerificationRow | ArgumentRow | PeriodRow | GroundedRow | StepsUnfinishedRow | ScriptRow | ScriptShownRow | ClockRow | ClockOnResumeRow | CallRow | TimeReadingRow | CallWindowRow | TimeAnswerRow | TimeDerivedRow | SourceClockRow;
|
|
439
440
|
/** The committed key: flat, append-only, a fresh array on every write. */
|
|
440
441
|
export type FindingsLedger = readonly FindingsRow[];
|
|
441
442
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/findings/types.ts"],"names":[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,UAAU,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC9C,2FAA2F;IAC3F,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;8EAC8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG,OAAO,4CAA4C,EAAE,QAAQ,GAAG;IACjG,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,WAAW,GACnB,OAAO,cAAc,EAAE,mBAAmB,GAC1C,oBAAoB,GACpB,QAAQ,GACR,WAAW,GACX,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,aAAa,GACb,qBAAqB,GAGrB,oBAAoB,GAIpB,WAAW,GAGX,SAAS,GAKT,WAAW,GACX,kBAAkB,GAMlB,SAAS,GACT,cAAc,GAWd,QAAQ,GACR,gBAAgB,GAChB,OAAO,GACP,cAAc,GACd,aAAa,GACb,aAAa,GACb,cAAc,GACd,cAAc,CAAC;AAEnB,0EAA0E;AAC1E,MAAM,MAAM,cAAc,GAAG,SAAS,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scripts/attachment — `.scriptTravelsWithTheAnswer()`: the recorded program
|
|
3
|
+
* itself, under the answer, labelled from the execution record.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: composed by the FRAMEWORK, never requested from the model (the
|
|
6
|
+
* `.limitsTravelWithTheAnswer()` precedent, `semantics/coverage/
|
|
7
|
+
* answer.ts`). Pure: rows in, data and text out.
|
|
8
|
+
* Role: core/ layer. Read by the final branch (`stages/prepareFinal.ts`):
|
|
9
|
+
* the data rides `turn_end.scripts` on every answer under the arm;
|
|
10
|
+
* the text is appended to a PROSE answer through the one composer
|
|
11
|
+
* (`composeAnswerWithCoverage`), after the standing line and the
|
|
12
|
+
* limits block. A typed answer gets the data only — its bytes are
|
|
13
|
+
* never edited.
|
|
14
|
+
* Emits: N/A.
|
|
15
|
+
*
|
|
16
|
+
* ## Why the library attaches it
|
|
17
|
+
*
|
|
18
|
+
* An app's rule "always show the script" is a rule the model can break, and
|
|
19
|
+
* the cheapest revision that passes a names-and-numbers check is to delete
|
|
20
|
+
* the script. The attachment needs no cooperation from the model: the program
|
|
21
|
+
* comes from the record (the row's `text` — what was SUBMITTED to the tool),
|
|
22
|
+
* so there is nothing to retype and nothing to check. When the model also
|
|
23
|
+
* showed a matched copy, the attachment is still appended: the model's copy
|
|
24
|
+
* never decides whether the authoritative one is delivered.
|
|
25
|
+
*
|
|
26
|
+
* ## What is attached (design § 4.1, § 4.4)
|
|
27
|
+
*
|
|
28
|
+
* - `which: 'last'` (default): the last call of the turn that REACHED the tool
|
|
29
|
+
* (its label is not `submitted`); `'all'`: every such call, at most
|
|
30
|
+
* {@link MAX_ATTACHED_SCRIPTS}, the rest counted in `omitted`.
|
|
31
|
+
* - `maxBytes` (default 4,000 UTF-8 bytes) bounds each program shown, cut at a
|
|
32
|
+
* code-point boundary; a cut says so — `[incomplete: showing N of M bytes —
|
|
33
|
+
* not the whole program]` and `truncated.shownBytes` — and is never
|
|
34
|
+
* advertised as a complete, reproducible program.
|
|
35
|
+
* - A program over `MAX_SCRIPT_BYTES` has no text on its row: it is counted in
|
|
36
|
+
* `omitted` and the text says "one script of N bytes is over the bound and
|
|
37
|
+
* is not shown". Calls past `MAX_SCRIPT_ROWS` have no row: counted too.
|
|
38
|
+
*
|
|
39
|
+
* Every line is library-authored and past tense, names the CALL (never a
|
|
40
|
+
* destination), and uses the label's words (`label.ts` · `labelWords`).
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const data = scriptsOfAnswer(scriptRowsOfTurn(ledger, turn).current, { which: 'last', maxBytes: 4000 });
|
|
45
|
+
* scriptsBlock(data);
|
|
46
|
+
* // Script submitted to run_code on call c1 — completed, exit 0. Attached by the library from the run record:
|
|
47
|
+
* //
|
|
48
|
+
* // ```python
|
|
49
|
+
* // print(41 + 1)
|
|
50
|
+
* // ```
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
import type { ResolvedScriptTravel, ScriptLabel, ScriptRow, ScriptTravelOptions, ShownScript, TurnEndScripts } from './types.js';
|
|
54
|
+
/** Scripts attached under `which: 'all'`; the rest are counted (`omitted`). Design § 4.1. */
|
|
55
|
+
export declare const MAX_ATTACHED_SCRIPTS = 8;
|
|
56
|
+
/** Default UTF-8 bytes of each program shown. Design § 4.1. */
|
|
57
|
+
export declare const DEFAULT_ATTACHED_BYTES = 4000;
|
|
58
|
+
/**
|
|
59
|
+
* Check `.scriptTravelsWithTheAnswer()`'s options once, at the call site, into
|
|
60
|
+
* the arm the chart carries. Refusals name the option and the fix.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveScriptTravel(opts?: ScriptTravelOptions): ResolvedScriptTravel;
|
|
63
|
+
/**
|
|
64
|
+
* What travels with this turn's answer — the data form (`turn_end.scripts`).
|
|
65
|
+
* `rows` is this turn's reading (`rows.ts` · `scriptRowsOfTurn`); fresh plain
|
|
66
|
+
* objects, never a reference into the ledger.
|
|
67
|
+
*/
|
|
68
|
+
export declare function scriptsOfAnswer(rows: readonly ScriptRow[], travel: ResolvedScriptTravel, scriptsDropped?: number): TurnEndScripts & {
|
|
69
|
+
readonly overSize: readonly ScriptRow[];
|
|
70
|
+
};
|
|
71
|
+
/** The label line of one attached script — library words, past tense, the call named. */
|
|
72
|
+
export declare function scriptLabelLine(script: ShownScript): string;
|
|
73
|
+
/** The line that stands for a script whose program is kept out of the text (`withheldFromText`). */
|
|
74
|
+
export declare function scriptWithheldLine(script: ShownScript): string;
|
|
75
|
+
/** One attached script as text: its label line, then the program in the library's fence. */
|
|
76
|
+
export declare function shownScriptBlock(script: ShownScript): string;
|
|
77
|
+
/**
|
|
78
|
+
* What the text BEFORE the attachment leaves open, as a CommonMark renderer
|
|
79
|
+
* reads it — the rendering boundary (finding: a model answer that ends inside
|
|
80
|
+
* an unfinished fence would take the library's programs in, and a fence line
|
|
81
|
+
* inside a program would then close it, leaving the rest as prose).
|
|
82
|
+
*
|
|
83
|
+
* - `clean`: nothing the attachment could fall into.
|
|
84
|
+
* - `closed`: a fence is still open; the attachment begins by closing it
|
|
85
|
+
* (`fence`, the same character and length).
|
|
86
|
+
* - `unsettled`: the reader stopped (an indented fence, raw HTML, display
|
|
87
|
+
* math — `../evidence/codeRegions.ts`), so nothing says what a program would
|
|
88
|
+
* render inside. The programs stay out of the text; the data keeps them.
|
|
89
|
+
*
|
|
90
|
+
* `before` is exactly the text the attachment follows — the composer's
|
|
91
|
+
* (`semantics/coverage/answer.ts` · `composeAnswerWithCoverage`). Read with a
|
|
92
|
+
* line ending after it, as it is composed: an opening fence on its last line
|
|
93
|
+
* opens there.
|
|
94
|
+
*/
|
|
95
|
+
export type AttachmentBoundary = {
|
|
96
|
+
readonly kind: 'clean';
|
|
97
|
+
} | {
|
|
98
|
+
readonly kind: 'closed';
|
|
99
|
+
readonly fence: string;
|
|
100
|
+
} | {
|
|
101
|
+
readonly kind: 'unsettled';
|
|
102
|
+
};
|
|
103
|
+
/** The boundary after `before` (see {@link AttachmentBoundary}). */
|
|
104
|
+
export declare function attachmentBoundary(before: string): AttachmentBoundary;
|
|
105
|
+
export type RecordedBoundary = {
|
|
106
|
+
readonly kind: 'clean';
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: 'closed';
|
|
109
|
+
readonly char: 'backtick' | 'tilde';
|
|
110
|
+
readonly length: number;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: 'unsettled';
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* The boundary to rebuild a recorded text behind — `undefined` when its fence
|
|
116
|
+
* is longer than `within`, the text it would have to be found in: the one
|
|
117
|
+
* repetition a reader makes is bounded by what it reads.
|
|
118
|
+
*/
|
|
119
|
+
export declare function rebuildBoundary(recorded: RecordedBoundary, within: number): AttachmentBoundary | undefined;
|
|
120
|
+
/** The label an attached script can carry: a call that never reached the tool is never attached (`reached`). */
|
|
121
|
+
export type AttachedLabel = Exclude<ScriptLabel, 'submitted'>;
|
|
122
|
+
/** An attached script as a reader gets it back: its label, by type, one an attached script can carry. */
|
|
123
|
+
export type RecordedScript = ShownScript & {
|
|
124
|
+
readonly label: AttachedLabel;
|
|
125
|
+
};
|
|
126
|
+
/** One attached script read back, at its position in the record's `shown`. */
|
|
127
|
+
export interface RecordedShown {
|
|
128
|
+
readonly index: number;
|
|
129
|
+
readonly script: RecordedScript;
|
|
130
|
+
}
|
|
131
|
+
/** A saved `turn_end.scripts`, read back. */
|
|
132
|
+
export interface RecordedScripts {
|
|
133
|
+
/** The entries a writer of this library files, at their record position. */
|
|
134
|
+
readonly shown: readonly RecordedShown[];
|
|
135
|
+
/**
|
|
136
|
+
* What no writer files, counted once each: an entry that does not read
|
|
137
|
+
* back, every entry past `MAX_ATTACHED_SCRIPTS` (the writer attaches no
|
|
138
|
+
* more), an `omitted` that is not a whole number, a boundary
|
|
139
|
+
* ({@link RecordedBoundary}) that is not one a writer states, or a
|
|
140
|
+
* `scripts` value that is not `{ shown: [...] }`. Zero means every field
|
|
141
|
+
* was read back — only then can the attached text be rebuilt.
|
|
142
|
+
*/
|
|
143
|
+
readonly unread: number;
|
|
144
|
+
/** `omitted`, when the record's is a whole number. */
|
|
145
|
+
readonly omitted?: number;
|
|
146
|
+
/** The rendering boundary, when the record's is one a writer states. */
|
|
147
|
+
readonly boundary?: RecordedBoundary;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* A saved `turn_end.scripts` — THE reader of the shape for a reader of a
|
|
151
|
+
* record. `undefined` when the event carries no scripts arm. `within` is the
|
|
152
|
+
* length of the answer the block was appended to (a fence longer than it is
|
|
153
|
+
* refused). Bounded by the writer's cap: no reader iterates more entries
|
|
154
|
+
* than a writer attaches.
|
|
155
|
+
*/
|
|
156
|
+
export declare function recordedScripts(value: unknown, within?: number): RecordedScripts | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* The text form: one block per attached script, then one line per omission —
|
|
159
|
+
* `''` when nothing travels (the composer then appends nothing). Every cut and
|
|
160
|
+
* every omission is stated. Behind a `closed` boundary the block opens with
|
|
161
|
+
* the closing fence; behind an `unsettled` one each script is its label line
|
|
162
|
+
* alone (`scriptWithheldLine`) — the programs ride the data only.
|
|
163
|
+
*/
|
|
164
|
+
export declare function scriptsBlock(scripts: TurnEndScripts & {
|
|
165
|
+
readonly overSize?: readonly ScriptRow[];
|
|
166
|
+
}, boundary?: AttachmentBoundary): string;
|
|
167
|
+
/**
|
|
168
|
+
* The text form behind the boundary the text before it leaves — `''` when
|
|
169
|
+
* nothing travels (no boundary is then taken). The second value is the
|
|
170
|
+
* boundary the text was written behind: what `turn_end.scripts` records.
|
|
171
|
+
*/
|
|
172
|
+
export declare function scriptsBlockAfter(scripts: TurnEndScripts & {
|
|
173
|
+
readonly overSize?: readonly ScriptRow[];
|
|
174
|
+
}, before: string): {
|
|
175
|
+
readonly text: string;
|
|
176
|
+
readonly boundary: AttachmentBoundary;
|
|
177
|
+
};
|
|
178
|
+
/** The data form as detached plain data — what `turn_end.scripts` carries. */
|
|
179
|
+
export declare function turnEndScriptsOf(scripts: TurnEndScripts, boundary?: AttachmentBoundary): TurnEndScripts;
|
|
180
|
+
//# sourceMappingURL=attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/scripts/attachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,kBAA0B,GACnC,MAAM,CAuBR;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,GAAG;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;CAAE,EACtE,MAAM,EAAE,MAAM,GACb;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAA;CAAE,CAIlE;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,cAAc,EACvB,QAAQ,GAAE,kBAA0B,GACnC,cAAc,CAehB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scripts/inert — a dynamic value (a tool's name, a provider's call id) written
|
|
3
|
+
* into a library line as an inline code span that cannot leave its line.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: pure leaf.
|
|
6
|
+
* Role: core/ layer leaf, asked by the attachment's lines (`attachment.ts`)
|
|
7
|
+
* for every name and id they print.
|
|
8
|
+
* Emits: N/A.
|
|
9
|
+
*
|
|
10
|
+
* THE RULE. A provider may hand the library any string as a call id: line
|
|
11
|
+
* breaks, a sentence, a fence. Interpolated as it is, a blank line in an id ends
|
|
12
|
+
* the library's label paragraph, and the rest of the id renders as a paragraph
|
|
13
|
+
* of its own — text nobody checked, under the answer, in the library's voice.
|
|
14
|
+
* So a value is written as inline code:
|
|
15
|
+
*
|
|
16
|
+
* - every character that can end a line, turn the line's direction or hide
|
|
17
|
+
* (C0 and C1 controls, DEL, U+2028 and U+2029, format characters such as a
|
|
18
|
+
* bidi override or a zero-width joiner, a lone surrogate) is written as
|
|
19
|
+
* `\u{…}`, its code point in hex;
|
|
20
|
+
* - at most {@link MAX_INERT_POINTS} code points are written, then `…`;
|
|
21
|
+
* - the delimiter is one backtick longer than the longest run inside, with a
|
|
22
|
+
* space at either end when the value begins or ends with a backtick or a
|
|
23
|
+
* space (CommonMark's code-span rule), so nothing inside can close it.
|
|
24
|
+
*
|
|
25
|
+
* Inside a code span nothing is Markdown: no emphasis, no link, no HTML, no
|
|
26
|
+
* line ending. The value is shown, never interpreted.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* inertCode('c1'); // '`c1`'
|
|
31
|
+
* inertCode('c1\n\nRevenue was 98765.'); // '`c1\u{a}\u{a}Revenue was 98765.`'
|
|
32
|
+
* inertCode('a`b'); // '``a`b``'
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
/** Code points of a value written; the rest is `…`. */
|
|
36
|
+
export declare const MAX_INERT_POINTS = 64;
|
|
37
|
+
/** `value` as an inline code span that stays on its line. */
|
|
38
|
+
export declare function inertCode(value: string): string;
|
|
39
|
+
//# sourceMappingURL=inert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inert.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/scripts/inert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,KAAK,CAAC;AA2BnC,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiB/C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scripts/judge — the evidence gate's ONE judge, with the script match in
|
|
3
|
+
* front of it.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: Decorator over the judge closure `stages/route.ts` ·
|
|
6
|
+
* `judgeEvidence` builds (the gate bound to this run's evidence).
|
|
7
|
+
* Role: core/ layer. Built only under `.namesAndNumbersFromEvidence({
|
|
8
|
+
* code: 'match' })`, on a prose answer (a typed answer is read as
|
|
9
|
+
* today — design § 12). The same decorated closure judges the draft
|
|
10
|
+
* and, for `.answerValidation()`, the delivered candidate.
|
|
11
|
+
* Emits: N/A — the Route decider emits `evidence_checked`, now carrying
|
|
12
|
+
* `scripts` and each unsupported value's `region`.
|
|
13
|
+
*
|
|
14
|
+
* What it adds, and nothing else: the matched blocks are cut out of the text
|
|
15
|
+
* the gate reads (`match.ts`), the verdict carries `scripts`, and each
|
|
16
|
+
* unsupported value says where it sat — `'code'` when every occurrence of it
|
|
17
|
+
* is inside an unmatched block, `'prose'` otherwise. The corpus and the
|
|
18
|
+
* exempt corpus are untouched: a matched script grounds nothing.
|
|
19
|
+
*/
|
|
20
|
+
import type { EvidenceVerdict } from '../evidence/types.js';
|
|
21
|
+
import type { TurnScripts } from './rows.js';
|
|
22
|
+
/** The gate's judge with the script match in front of it. */
|
|
23
|
+
export declare function scriptJudge(input: {
|
|
24
|
+
/** The gate's judge — `checkAnswer` bound to this run's evidence. */
|
|
25
|
+
readonly judgeProse: (text: string) => EvidenceVerdict;
|
|
26
|
+
/**
|
|
27
|
+
* The values the gate's extractor reads in a text, spelled as a verdict
|
|
28
|
+
* reports them (normalized, clipped) — asked of the answer with every block
|
|
29
|
+
* cut out, to place each unsupported value.
|
|
30
|
+
*/
|
|
31
|
+
readonly valuesIn: (text: string) => ReadonlySet<string>;
|
|
32
|
+
/** This turn's script rows (`rows.ts` · `scriptRowsOfTurn`). */
|
|
33
|
+
readonly turn: TurnScripts;
|
|
34
|
+
/** `AgentState.scriptsDropped`, when calls past the per-turn cap were dropped. */
|
|
35
|
+
readonly scriptsDropped?: number;
|
|
36
|
+
}): (text: string) => EvidenceVerdict;
|
|
37
|
+
//# sourceMappingURL=judge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/scripts/judge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,qEAAqE;IACrE,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,eAAe,CAAC;IACvD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC;IACzD,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,eAAe,CAepC"}
|