@mcoda/codali 0.1.135-codali.41 → 0.1.135-codali.47

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/README.md +8 -0
  3. package/config/deterministic/node-worker.mjs +15 -2
  4. package/config/skills/code-implementation/SKILL.md +1 -1
  5. package/config/skills/planning/SKILL.md +1 -1
  6. package/config/skills/testing-and-verification/SKILL.md +5 -5
  7. package/config/skills/ui-ux-design/SKILL.md +1 -1
  8. package/config/skills/webapp-testing/SKILL.md +4 -0
  9. package/config/skills/webapp-testing/journey-driver.mjs +186 -0
  10. package/dist/cli/TerminalCommand.js +2 -2
  11. package/dist/cli/tui/TerminalPresentation.js +1 -1
  12. package/dist/config/OrchestrationConfig.d.ts +1 -0
  13. package/dist/config/OrchestrationConfig.d.ts.map +1 -1
  14. package/dist/config/OrchestrationConfig.js +3 -1
  15. package/dist/docdex/DocdexClient.d.ts +11 -0
  16. package/dist/docdex/DocdexClient.d.ts.map +1 -1
  17. package/dist/docdex/DocdexClient.js +55 -1
  18. package/dist/eval/fixtures/ContractReviewProvider.d.ts +5 -0
  19. package/dist/eval/fixtures/ContractReviewProvider.d.ts.map +1 -1
  20. package/dist/eval/fixtures/ContractReviewProvider.js +63 -0
  21. package/dist/eval/fixtures/MixedMediaRecoveryJourney.js +2 -2
  22. package/dist/eval/fixtures/TerminalRecoveryJourney.js +2 -2
  23. package/dist/permissions/PermissionGate.d.ts +7 -0
  24. package/dist/permissions/PermissionGate.d.ts.map +1 -1
  25. package/dist/permissions/PermissionGate.js +27 -1
  26. package/dist/providers/ClaudeCliProvider.d.ts.map +1 -1
  27. package/dist/providers/ClaudeCliProvider.js +1 -0
  28. package/dist/providers/CodexCliProvider.d.ts.map +1 -1
  29. package/dist/providers/CodexCliProvider.js +1 -0
  30. package/dist/providers/ConfiguredProvider.d.ts +2 -0
  31. package/dist/providers/ConfiguredProvider.d.ts.map +1 -1
  32. package/dist/providers/ConfiguredProvider.js +29 -0
  33. package/dist/providers/ModelServiceError.d.ts +16 -2
  34. package/dist/providers/ModelServiceError.d.ts.map +1 -1
  35. package/dist/providers/ModelServiceError.js +18 -1
  36. package/dist/providers/OllamaRemoteProvider.d.ts.map +1 -1
  37. package/dist/providers/OllamaRemoteProvider.js +1 -0
  38. package/dist/providers/OpenAiCompatibleProvider.d.ts.map +1 -1
  39. package/dist/providers/OpenAiCompatibleProvider.js +4 -0
  40. package/dist/providers/ProviderTypes.d.ts +4 -0
  41. package/dist/providers/ProviderTypes.d.ts.map +1 -1
  42. package/dist/runtime/AnswerEdits.d.ts +39 -0
  43. package/dist/runtime/AnswerEdits.d.ts.map +1 -0
  44. package/dist/runtime/AnswerEdits.js +134 -0
  45. package/dist/runtime/AnswerVerification.d.ts.map +1 -1
  46. package/dist/runtime/AnswerVerification.js +4 -2
  47. package/dist/runtime/AuditGuards.d.ts +41 -0
  48. package/dist/runtime/AuditGuards.d.ts.map +1 -0
  49. package/dist/runtime/AuditGuards.js +81 -0
  50. package/dist/runtime/CompletionReport.d.ts +4 -2
  51. package/dist/runtime/CompletionReport.d.ts.map +1 -1
  52. package/dist/runtime/CompletionReport.js +8 -3
  53. package/dist/runtime/ContextCompression.d.ts +5 -0
  54. package/dist/runtime/ContextCompression.d.ts.map +1 -1
  55. package/dist/runtime/ContextCompression.js +16 -4
  56. package/dist/runtime/DeliveryDocs.d.ts +21 -0
  57. package/dist/runtime/DeliveryDocs.d.ts.map +1 -0
  58. package/dist/runtime/DeliveryDocs.js +148 -0
  59. package/dist/runtime/FigureCheck.d.ts +61 -2
  60. package/dist/runtime/FigureCheck.d.ts.map +1 -1
  61. package/dist/runtime/FigureCheck.js +210 -14
  62. package/dist/runtime/GatewayRequest.d.ts +13 -0
  63. package/dist/runtime/GatewayRequest.d.ts.map +1 -1
  64. package/dist/runtime/GatewayRequest.js +54 -1
  65. package/dist/runtime/InspectionConvergence.d.ts +4 -0
  66. package/dist/runtime/InspectionConvergence.d.ts.map +1 -1
  67. package/dist/runtime/InspectionConvergence.js +24 -1
  68. package/dist/runtime/InteractionContract.d.ts +15 -0
  69. package/dist/runtime/InteractionContract.d.ts.map +1 -1
  70. package/dist/runtime/InteractionContract.js +33 -0
  71. package/dist/runtime/InteractionRouter.d.ts +3 -3
  72. package/dist/runtime/InteractionRouter.d.ts.map +1 -1
  73. package/dist/runtime/InteractionRouter.js +1 -1
  74. package/dist/runtime/NumericProvenance.d.ts +102 -0
  75. package/dist/runtime/NumericProvenance.d.ts.map +1 -0
  76. package/dist/runtime/NumericProvenance.js +411 -0
  77. package/dist/runtime/OutageWait.d.ts +46 -5
  78. package/dist/runtime/OutageWait.d.ts.map +1 -1
  79. package/dist/runtime/OutageWait.js +81 -8
  80. package/dist/runtime/ResearchEvidence.d.ts +14 -0
  81. package/dist/runtime/ResearchEvidence.d.ts.map +1 -1
  82. package/dist/runtime/ResearchEvidence.js +139 -3
  83. package/dist/runtime/ReviewCoordinator.d.ts +22 -0
  84. package/dist/runtime/ReviewCoordinator.d.ts.map +1 -1
  85. package/dist/runtime/ReviewCoordinator.js +203 -25
  86. package/dist/runtime/ReviewSource.d.ts +5 -0
  87. package/dist/runtime/ReviewSource.d.ts.map +1 -1
  88. package/dist/runtime/ReviewSource.js +6 -1
  89. package/dist/runtime/SessionController.d.ts +85 -10
  90. package/dist/runtime/SessionController.d.ts.map +1 -1
  91. package/dist/runtime/SessionController.js +996 -176
  92. package/dist/runtime/StructuralEvidence.d.ts +10 -0
  93. package/dist/runtime/StructuralEvidence.d.ts.map +1 -1
  94. package/dist/runtime/StructuralEvidence.js +10 -0
  95. package/dist/runtime/TaskReview.d.ts +10 -0
  96. package/dist/runtime/TaskReview.d.ts.map +1 -1
  97. package/dist/runtime/TaskReview.js +31 -3
  98. package/dist/runtime/VerificationCommand.d.ts +8 -0
  99. package/dist/runtime/VerificationCommand.d.ts.map +1 -1
  100. package/dist/runtime/VerificationCommand.js +114 -0
  101. package/dist/runtime/WorkingStyle.d.ts +20 -0
  102. package/dist/runtime/WorkingStyle.d.ts.map +1 -0
  103. package/dist/runtime/WorkingStyle.js +71 -0
  104. package/dist/tools/ToolRegistry.d.ts.map +1 -1
  105. package/dist/tools/ToolRegistry.js +30 -4
  106. package/dist/tools/ToolTypes.d.ts +3 -0
  107. package/dist/tools/ToolTypes.d.ts.map +1 -1
  108. package/dist/tools/browser/BrowserTool.d.ts +23 -1
  109. package/dist/tools/browser/BrowserTool.d.ts.map +1 -1
  110. package/dist/tools/browser/BrowserTool.js +83 -4
  111. package/dist/tools/browser/BrowserWorker.js +142 -2
  112. package/dist/tools/browser/HttpFallback.d.ts +39 -0
  113. package/dist/tools/browser/HttpFallback.d.ts.map +1 -0
  114. package/dist/tools/browser/HttpFallback.js +240 -0
  115. package/dist/tools/calculation/CalculatorTool.d.ts +16 -1
  116. package/dist/tools/calculation/CalculatorTool.d.ts.map +1 -1
  117. package/dist/tools/calculation/CalculatorTool.js +321 -26
  118. package/dist/tools/deterministic/DeterministicTools.js +1 -1
  119. package/dist/tools/deterministic/node-worker.cjs +10 -10
  120. package/dist/tools/shell/AsyncProcess.d.ts +2 -0
  121. package/dist/tools/shell/AsyncProcess.d.ts.map +1 -1
  122. package/dist/tools/shell/AsyncProcess.js +38 -5
  123. package/dist/tools/shell/IsolatedExecutor.d.ts +29 -1
  124. package/dist/tools/shell/IsolatedExecutor.d.ts.map +1 -1
  125. package/dist/tools/shell/IsolatedExecutor.js +179 -9
  126. package/dist/tools/shell/ShellTool.d.ts +2 -0
  127. package/dist/tools/shell/ShellTool.d.ts.map +1 -1
  128. package/dist/tools/shell/ShellTool.js +33 -3
  129. package/dist/tools/verification/CodeRunTool.d.ts +19 -0
  130. package/dist/tools/verification/CodeRunTool.d.ts.map +1 -0
  131. package/dist/tools/verification/CodeRunTool.js +104 -0
  132. package/dist/tools/verification/JavaScriptVerificationTool.d.ts.map +1 -1
  133. package/dist/tools/verification/JavaScriptVerificationTool.js +21 -10
  134. package/dist/tools/verification/VitestTool.d.ts +27 -0
  135. package/dist/tools/verification/VitestTool.d.ts.map +1 -1
  136. package/dist/tools/verification/VitestTool.js +232 -18
  137. package/package.json +3 -3
@@ -3,12 +3,53 @@ export declare const PREFLIGHT_RECOVERY_WAITS_MS: number[];
3
3
  /** The outage waits that fit the host's total (CODALI_MODEL_OUTAGE_WAIT_MS, in
4
4
  * milliseconds); all of them when it is unset. */
5
5
  export declare const outageWaitsMs: (budget?: string | undefined) => number[];
6
- /** The longest a turn waits out one model-service outage. The ladder alone
7
- * (about four minutes) lost a three-hour build to a nine-minute relay outage. */
6
+ /** The longest one model-service outage is waited out when the turn itself has
7
+ * no time limit (an interactive session, an open-ended build). Outages happen
8
+ * in real use: a node restarts, a host runs out of memory, a gateway queue
9
+ * backs up. The 30 minutes allowed before (and half the turn's remaining
10
+ * time) ended long builds on outages they could have outlasted. Six hours by
11
+ * default; CODALI_MODEL_OUTAGE_WAIT_MS raises or lowers it. */
8
12
  export declare const MODEL_OUTAGE_WAIT_MS: number;
13
+ /** Time kept back before a turn's limit, so the turn can still hand over what
14
+ * it has (a draft, a status report) when the service is still down then. */
15
+ export declare const OUTAGE_DELIVERY_RESERVE_MS = 90000;
9
16
  /** The wait before outage retry `attempt` (0-based): the ladder, then a minute
10
- * per retry, while the total stays within the host's budget
11
- * (CODALI_MODEL_OUTAGE_WAIT_MS), MODEL_OUTAGE_WAIT_MS and half the time the
12
- * turn has left. Undefined once the outage has used that allowance. */
17
+ * per retry. The total stays within the host's budget (CODALI_MODEL_OUTAGE_WAIT_MS,
18
+ * default MODEL_OUTAGE_WAIT_MS) and within the turn's remaining time less
19
+ * OUTAGE_DELIVERY_RESERVE_MS. Undefined once the outage has used that allowance. */
13
20
  export declare const outageWaitMs: (attempt: number, remainingMs?: number, budget?: string | undefined) => number | undefined;
21
+ /** Compute the next delay from actual elapsed outage time. A server-directed
22
+ * delay must fit in full, including the time reserved for the final response. */
23
+ export declare const outageRetryDelayMs: (attempt: number, remainingMs: number, elapsedMs: number, retryAfterSeconds: number, injected: boolean, budget?: string | undefined) => number | undefined;
24
+ /** Whether an error says the model service could not be reached at all (as
25
+ * opposed to a refusal it gave). A dropped stream ("terminated"), a failed
26
+ * connection ("fetch failed") and their low-level codes all count; so does a
27
+ * timed-out catalog request, which only means the gateway did not answer. */
28
+ export declare const transportOutage: (error: unknown) => boolean;
29
+ /** How long one model request may stay unanswered before it is abandoned and
30
+ * retried. A request whose connection was lost, or that a scheduler dropped,
31
+ * never returns: a 12-hour build sat on one such review call for 158 minutes
32
+ * and ended unfinished although its work was done.
33
+ *
34
+ * The base allowance is the larger of ten minutes and four times the slowest
35
+ * request this turn has completed, but no more than the request could need at
36
+ * its ceiling on a slow server: two minutes to be scheduled, the prompt read at
37
+ * 1,000 tokens a second and the full output at 25. It doubles with every stall
38
+ * of the same request, without an upper bound short of an hour, so a model
39
+ * slower than those rates is waited for longer each time instead of being cut
40
+ * off at the same point for ever. */
41
+ export declare const modelStallAllowanceMs: (inputTokens: number, maxOutputTokens: number, longestModelMs: number, stalledAttempts?: number) => number;
42
+ /** How long a request that is streaming its generation may go without
43
+ * producing anything more before it counts as stalled. Wall-clock time alone
44
+ * cannot tell a live long generation from a lost request, so the full
45
+ * allowance above stays in force until the first generated chunk. Once output
46
+ * arrives the timer is reset by every chunk, and only a stream that stops for
47
+ * this long is abandoned: two minutes, or three times the slowest answered
48
+ * request when longer, never more than the full allowance. A lost request
49
+ * that was streaming is then given up in minutes instead of after the full
50
+ * allowance (ten minutes or more), while a live generation is never cut
51
+ * however long it runs. */
52
+ export declare const modelStreamGapAllowanceMs: (fullAllowanceMs: number, longestModelMs: number) => number;
53
+ /** The shortest silence after which a streaming request counts as stalled. */
54
+ export declare const STREAM_STALL_GAP_MS = 120000;
14
55
  //# sourceMappingURL=OutageWait.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OutageWait.d.ts","sourceRoot":"","sources":["../../src/runtime/OutageWait.ts"],"names":[],"mappings":"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;;;;;;2BAS2B;AAC3B,eAAO,MAAM,yBAAyB,GAAI,iBAAiB,MAAM,EAAE,gBAAgB,MAAM,KAAG,MACd,CAAC;AAC/E,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,SAAU,CAAC"}
@@ -10,16 +10,23 @@ export const outageWaitsMs = (budget = process.env.CODALI_MODEL_OUTAGE_WAIT_MS)
10
10
  let waited = 0;
11
11
  return PREFLIGHT_RECOVERY_WAITS_MS.filter(wait => (waited += wait) <= total);
12
12
  };
13
- /** The longest a turn waits out one model-service outage. The ladder alone
14
- * (about four minutes) lost a three-hour build to a nine-minute relay outage. */
15
- export const MODEL_OUTAGE_WAIT_MS = 30 * 60000;
13
+ /** The longest one model-service outage is waited out when the turn itself has
14
+ * no time limit (an interactive session, an open-ended build). Outages happen
15
+ * in real use: a node restarts, a host runs out of memory, a gateway queue
16
+ * backs up. The 30 minutes allowed before (and half the turn's remaining
17
+ * time) ended long builds on outages they could have outlasted. Six hours by
18
+ * default; CODALI_MODEL_OUTAGE_WAIT_MS raises or lowers it. */
19
+ export const MODEL_OUTAGE_WAIT_MS = 6 * 3600000;
20
+ /** Time kept back before a turn's limit, so the turn can still hand over what
21
+ * it has (a draft, a status report) when the service is still down then. */
22
+ export const OUTAGE_DELIVERY_RESERVE_MS = 90000;
16
23
  /** The wait before outage retry `attempt` (0-based): the ladder, then a minute
17
- * per retry, while the total stays within the host's budget
18
- * (CODALI_MODEL_OUTAGE_WAIT_MS), MODEL_OUTAGE_WAIT_MS and half the time the
19
- * turn has left. Undefined once the outage has used that allowance. */
24
+ * per retry. The total stays within the host's budget (CODALI_MODEL_OUTAGE_WAIT_MS,
25
+ * default MODEL_OUTAGE_WAIT_MS) and within the turn's remaining time less
26
+ * OUTAGE_DELIVERY_RESERVE_MS. Undefined once the outage has used that allowance. */
20
27
  export const outageWaitMs = (attempt, remainingMs = Infinity, budget = process.env.CODALI_MODEL_OUTAGE_WAIT_MS) => {
21
- const parsed = budget === undefined || budget.trim() === "" ? Infinity : Number(budget);
22
- const cap = Math.min(parsed >= 0 ? parsed : Infinity, MODEL_OUTAGE_WAIT_MS, remainingMs * 0.5);
28
+ const parsed = budget === undefined || budget.trim() === "" ? MODEL_OUTAGE_WAIT_MS : Number(budget);
29
+ const cap = Math.min(parsed >= 0 ? parsed : MODEL_OUTAGE_WAIT_MS, remainingMs - OUTAGE_DELIVERY_RESERVE_MS);
23
30
  let waited = 0;
24
31
  for (let index = 0; index <= attempt; index++) {
25
32
  const wait = PREFLIGHT_RECOVERY_WAITS_MS[index] ?? 60000;
@@ -31,3 +38,69 @@ export const outageWaitMs = (attempt, remainingMs = Infinity, budget = process.e
31
38
  }
32
39
  return undefined;
33
40
  };
41
+ /** Compute the next delay from actual elapsed outage time. A server-directed
42
+ * delay must fit in full, including the time reserved for the final response. */
43
+ export const outageRetryDelayMs = (attempt, remainingMs, elapsedMs, retryAfterSeconds, injected, budget = process.env.CODALI_MODEL_OUTAGE_WAIT_MS) => {
44
+ const parsed = budget?.trim() ? Number(budget) : MODEL_OUTAGE_WAIT_MS;
45
+ const allowance = Number.isFinite(parsed) && parsed >= 0 ? parsed : MODEL_OUTAGE_WAIT_MS;
46
+ const step = injected ? [500, 2000][attempt] : PREFLIGHT_RECOVERY_WAITS_MS[attempt] ?? 60000;
47
+ if (step === undefined)
48
+ return undefined;
49
+ const wait = Math.max(step, retryAfterSeconds * 1000);
50
+ // Interactive turns default to 90 seconds. Preserve a quick retry on those
51
+ // turns while leaving the full delivery reserve on long-running requests.
52
+ const reserveMs = Math.min(OUTAGE_DELIVERY_RESERVE_MS, remainingMs / 2);
53
+ const available = Math.min(allowance - elapsedMs, remainingMs - reserveMs);
54
+ if (injected && retryAfterSeconds > 2)
55
+ return undefined;
56
+ return wait <= available ? wait : undefined;
57
+ };
58
+ const NETWORK_CODES = new Set(["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT", "ENOTFOUND", "EAI_AGAIN", "EHOSTUNREACH", "ENETUNREACH", "ENETDOWN", "ECONNABORTED",
59
+ "UND_ERR_SOCKET", "UND_ERR_CONNECT_TIMEOUT", "UND_ERR_HEADERS_TIMEOUT", "UND_ERR_BODY_TIMEOUT", "UND_ERR_CLOSED"]);
60
+ /** Whether an error says the model service could not be reached at all (as
61
+ * opposed to a refusal it gave). A dropped stream ("terminated"), a failed
62
+ * connection ("fetch failed") and their low-level codes all count; so does a
63
+ * timed-out catalog request, which only means the gateway did not answer. */
64
+ export const transportOutage = (error) => {
65
+ let current = error;
66
+ for (let depth = 0; current && typeof current === "object" && depth < 4; current = current.cause, depth++) {
67
+ const code = current.code;
68
+ if (typeof code === "string" && NETWORK_CODES.has(code))
69
+ return true;
70
+ if (current instanceof TypeError && /^(?:fetch failed|terminated|network error)$/i.test(String(current.message)))
71
+ return true;
72
+ if (current instanceof Error && current.message === "Service request timed out")
73
+ return true;
74
+ }
75
+ return false;
76
+ };
77
+ /** How long one model request may stay unanswered before it is abandoned and
78
+ * retried. A request whose connection was lost, or that a scheduler dropped,
79
+ * never returns: a 12-hour build sat on one such review call for 158 minutes
80
+ * and ended unfinished although its work was done.
81
+ *
82
+ * The base allowance is the larger of ten minutes and four times the slowest
83
+ * request this turn has completed, but no more than the request could need at
84
+ * its ceiling on a slow server: two minutes to be scheduled, the prompt read at
85
+ * 1,000 tokens a second and the full output at 25. It doubles with every stall
86
+ * of the same request, without an upper bound short of an hour, so a model
87
+ * slower than those rates is waited for longer each time instead of being cut
88
+ * off at the same point for ever. */
89
+ export const modelStallAllowanceMs = (inputTokens, maxOutputTokens, longestModelMs, stalledAttempts = 0) => {
90
+ const ceiling = 120000 + Math.max(0, inputTokens) + Math.max(0, maxOutputTokens) * 40;
91
+ const base = Math.max(60000, Math.min(Math.max(600000, longestModelMs * 4), ceiling));
92
+ return Math.min(base * 2 ** Math.min(Math.max(0, stalledAttempts), 6), Math.max(base, 3600000));
93
+ };
94
+ /** How long a request that is streaming its generation may go without
95
+ * producing anything more before it counts as stalled. Wall-clock time alone
96
+ * cannot tell a live long generation from a lost request, so the full
97
+ * allowance above stays in force until the first generated chunk. Once output
98
+ * arrives the timer is reset by every chunk, and only a stream that stops for
99
+ * this long is abandoned: two minutes, or three times the slowest answered
100
+ * request when longer, never more than the full allowance. A lost request
101
+ * that was streaming is then given up in minutes instead of after the full
102
+ * allowance (ten minutes or more), while a live generation is never cut
103
+ * however long it runs. */
104
+ export const modelStreamGapAllowanceMs = (fullAllowanceMs, longestModelMs) => Math.min(fullAllowanceMs, Math.max(STREAM_STALL_GAP_MS, longestModelMs * 3));
105
+ /** The shortest silence after which a streaming request counts as stalled. */
106
+ export const STREAM_STALL_GAP_MS = 120000;
@@ -22,4 +22,18 @@ export declare function draftAnchors(draft: string): string[];
22
22
  * the audit saw 9 of 67 passages, missed the one with "Civil penalty: 30,000
23
23
  * penalty units", and relabelled that verbatim quote as unverified. */
24
24
  export declare function selectResearchEvidence(packets: ResearchPacket[], request: string, draft: string, maxChars?: number): ResearchPacket[];
25
+ /** What an investigation found, as a report, for when its answer could not be
26
+ * written: the model service was down or the final request would have run past
27
+ * the time limit. In cycle 6 a 41-minute investigation delivered nothing
28
+ * because that request hit three gateway timeouts in its last three minutes.
29
+ * Built without a model, so it is ready at once. It says plainly that it is
30
+ * evidence and not an answer, and quotes at most 25 words from any one source:
31
+ * the sentence that shares most with the request, figures and dates first. */
32
+ export declare function evidenceReport(packets: ResearchPacket[], request: string, reason: string, maxSources?: number): string | undefined;
33
+ /** The points a research draft itself leaves open: the sentences or list items
34
+ * in which it says something was not found, not verified or only alleged.
35
+ * A draft that says so with time left has not finished its research; in cycle
36
+ * 6 one called a core fact "alleged" and stopped with a quarter of its time
37
+ * unused. Decided from the draft's own words, not from the question. */
38
+ export declare function openResearchPoints(draft: string, limit?: number): string[];
25
39
  //# sourceMappingURL=ResearchEvidence.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResearchEvidence.d.ts","sourceRoot":"","sources":["../../src/runtime/ResearchEvidence.ts"],"names":[],"mappings":"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,CAAC,EAAE,MAAM,CAAC;CAAE;AAE1F;8EAC8E;AAC9E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAmBvG;AASD;qEACqE;AACrE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAUpD;AAED;;;;uEAIuE;AACvE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAQ,GAAG,cAAc,EAAE,CAqEpI;AAED;;;;;;8EAM8E;AAC9E,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,SAAK,GAAG,MAAM,GAAG,SAAS,CAuB9H;AAgBD;;;;wEAIwE;AACxE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,MAAM,EAAE,CAwBrE"}
@@ -26,6 +26,16 @@ export function researchPacket(tool, input, output) {
26
26
  catch { /* Docdex may return source-labelled text instead of JSON. */ }
27
27
  return output.trim() ? { source: tool, passage: output.slice(0, 4000), tool, query } : undefined;
28
28
  }
29
+ /** A page's identity across link spellings (scheme, www., trailing slash, fragment). */
30
+ const sourceKey = (value) => {
31
+ try {
32
+ const url = new URL(value);
33
+ return `${url.host.toLowerCase().replace(/^www\./u, "")}${url.pathname.replace(/\/+$/u, "")}${url.search}`;
34
+ }
35
+ catch {
36
+ return value.trim().toLowerCase();
37
+ }
38
+ };
29
39
  const squash = (text) => text.toLowerCase().replace(/[‘’]/gu, "'").replace(/[“”]/gu, '"').replace(/[‐-―−]/gu, "-").replace(/\s+/gu, " ");
30
40
  /** Exact quotes and specific figures/identifiers in a draft: the claims an
31
41
  * audit must be able to check against the passage they came from. */
@@ -55,10 +65,50 @@ export function selectResearchEvidence(packets, request, draft, maxChars = 48000
55
65
  const overlap = [...terms].filter(term => words.has(term)).length;
56
66
  return { packet, index, score: overlap / Math.sqrt(Math.max(1, terms.size)) + (packet.query ? 1 : 0) };
57
67
  }).sort((a, b) => b.score - a.score || a.index - b.index);
68
+ // The pages the draft cites come first: for each, its passages that share
69
+ // most with the lines citing it. In cycle 7 the audit was not shown the
70
+ // passage behind a cited claim with no figure in it ("a further three
71
+ // months") and rewrote the claim as unsupported.
72
+ const anchored = [];
73
+ let anchorChars = 0;
74
+ const citing = new Map();
75
+ for (const line of draft.split(/\n+/u)) {
76
+ for (const url of line.match(/https?:\/\/[^\s<>()\[\]"'`\\]+/gu) ?? []) {
77
+ const key = sourceKey(url.replace(/[.,;:!?*]+$/u, ""));
78
+ const words = citing.get(key) ?? new Set();
79
+ for (const word of line.toLowerCase().match(/[\p{L}\p{N}_]{4,}/gu) ?? [])
80
+ words.add(word);
81
+ citing.set(key, words);
82
+ }
83
+ }
84
+ if (citing.size) {
85
+ const cited = ranked.map(value => {
86
+ const words = citing.get(sourceKey(value.packet.source));
87
+ if (!words)
88
+ return undefined;
89
+ const terms = new Set(value.packet.passage.toLowerCase().match(/[\p{L}\p{N}_]{4,}/gu) ?? []);
90
+ return { value, key: sourceKey(value.packet.source), overlap: [...words].filter(word => terms.has(word)).length };
91
+ }).filter(item => item !== undefined).sort((a, b) => b.overlap - a.overlap || a.value.index - b.value.index);
92
+ // Best passage of every cited page first, then further passages of them.
93
+ const firsts = new Set();
94
+ const order = [...cited.filter(item => !firsts.has(item.key) && firsts.add(item.key)), ...cited];
95
+ for (const { value } of order) {
96
+ if (anchored.includes(value))
97
+ continue;
98
+ const size = JSON.stringify(value.packet).length + 1;
99
+ if (anchorChars + size > maxChars * 0.35)
100
+ continue;
101
+ anchorChars += size;
102
+ anchored.push(value);
103
+ }
104
+ }
58
105
  // Greedy cover of the draft's anchors, within part of the budget.
59
- const anchors = draftAnchors(draft), uncovered = new Set(anchors), anchored = [];
106
+ const anchors = draftAnchors(draft), uncovered = new Set(anchors);
60
107
  const passages = new Map(ranked.map(value => [value.index, squash(value.packet.passage)]));
61
- let anchorChars = 0;
108
+ for (const value of anchored)
109
+ for (const anchor of [...uncovered])
110
+ if (passages.get(value.index).includes(anchor))
111
+ uncovered.delete(anchor);
62
112
  while (uncovered.size) {
63
113
  let best, bestHits = 0;
64
114
  for (const value of ranked) {
@@ -74,7 +124,7 @@ export function selectResearchEvidence(packets, request, draft, maxChars = 48000
74
124
  if (!best)
75
125
  break;
76
126
  const size = JSON.stringify(best.packet).length + 1;
77
- if (anchorChars + size > maxChars * 0.6)
127
+ if (anchorChars + size > maxChars * 0.7)
78
128
  break;
79
129
  anchorChars += size;
80
130
  anchored.push(best);
@@ -99,3 +149,89 @@ export function selectResearchEvidence(packets, request, draft, maxChars = 48000
99
149
  }
100
150
  return selected;
101
151
  }
152
+ /** What an investigation found, as a report, for when its answer could not be
153
+ * written: the model service was down or the final request would have run past
154
+ * the time limit. In cycle 6 a 41-minute investigation delivered nothing
155
+ * because that request hit three gateway timeouts in its last three minutes.
156
+ * Built without a model, so it is ready at once. It says plainly that it is
157
+ * evidence and not an answer, and quotes at most 25 words from any one source:
158
+ * the sentence that shares most with the request, figures and dates first. */
159
+ export function evidenceReport(packets, request, reason, maxSources = 30) {
160
+ // A search result packet carries several pages as JSON (possibly cut short); read each as its own source.
161
+ const pages = packets.flatMap(packet => /^https?:/.test(packet.source) ? [{ source: packet.source, passage: packet.passage }]
162
+ : [...packet.passage.matchAll(/"url"\s*:\s*"(https?:[^"\s]{1,1000})"\s*,\s*"content"\s*:\s*"((?:[^"\\]|\\.){0,3000})/gu)]
163
+ .map(match => ({ source: match[1], passage: match[2].replace(/\\[nrt]/gu, " ").replace(/\\(["\\/])/gu, "$1") })))
164
+ .filter(page => page.passage.trim().length >= 40);
165
+ if (!pages.length)
166
+ return undefined;
167
+ const terms = new Set(request.toLowerCase().match(/[\p{L}\p{N}_]{4,}/gu) ?? []);
168
+ const best = new Map();
169
+ for (const packet of pages) {
170
+ for (const sentence of packet.passage.replace(/\s+/gu, " ").split(/(?<=[.!?])\s+|\s+[-•|]\s+/u)) {
171
+ const words = sentence.trim().split(" ").filter(Boolean);
172
+ if (words.length < 5)
173
+ continue;
174
+ const overlap = new Set(words.map(word => word.toLowerCase().replace(/[^\p{L}\p{N}_]/gu, "")).filter(word => terms.has(word))).size;
175
+ const score = overlap * 2 + Math.min(4, words.filter(word => /\d/.test(word)).length);
176
+ const current = best.get(packet.source);
177
+ if (!current || score > current.score)
178
+ best.set(packet.source, { score, excerpt: words.slice(0, 25).join(" ") + (words.length > 25 ? " …" : "") });
179
+ }
180
+ }
181
+ const ranked = [...best.entries()].sort((a, b) => b[1].score - a[1].score).slice(0, maxSources);
182
+ if (!ranked.length)
183
+ return undefined;
184
+ return [`I could not finish writing the answer: ${reason}. What follows is the evidence gathered, not an answer: the pages that were read, each with the one short excerpt closest to the question. Nothing here has been checked against the question as a whole, and points it does not cover remain unanswered.`,
185
+ "", ...ranked.map(([source, { excerpt }], index) => `${index + 1}. ${source}\n "${excerpt}"`)].join("\n");
186
+ }
187
+ const OPEN_POINT = /\b(?:unverified|not (?:been )?(?:independently )?verified|unconfirmed|(?:could not|couldn't|can ?not|cannot|was unable to|were unable to|unable to|failed to|did not manage to) (?:be )?(?:independently )?(?:verif(?:y|ied)|confirm(?:ed)?|find|found|locate[d]?|access(?:ed)?|retrieved?|determined?|establish(?:ed)?|open(?:ed)?)|no (?:primary|official|direct|reliable|authoritative) (?:source|page|document|record|figure|confirmation)s? (?:was|were|has been|have been|could be) (?:found|located|retrieved|identified)|(?:was|were) not found (?:during|in) (?:this|the|my) (?:research|search|investigation|review)|remains? (?:unclear|unconfirmed|to be (?:confirmed|verified|determined))|to be (?:confirmed|determined|verified)|tbd)\b/iu;
188
+ /** A whole table cell that says the row's fact was not settled by the research. */
189
+ const GAP_CELL = /^(?:(?:still |yet )?not (?:yet )?(?:been )?(?:established|found|located|confirmed|verified|determined|identified|retrieved)(?: (?:yet|in (?:this|the) (?:research|search)|from (?:a |any )?(?:primary|official) sources?))?|unverified|unconfirmed|no (?:primary |official )?(?:source|data|figure|record)s? found|to be (?:confirmed|determined|verified)|tbd|\?+)[.!]?$/iu;
190
+ /** The row of a markdown table one of whose cells is a gap marker, as "cell — cell". */
191
+ function tableGapRow(block) {
192
+ const row = block.trim();
193
+ if (!row.startsWith("|") || /^\|[\s:|-]+\|?$/u.test(row))
194
+ return undefined;
195
+ const cells = row.replace(/^\||\|$/gu, "").split("|").map(cell => cell.replace(/\*\*|__|`/gu, "").replace(/\s+/gu, " ").trim());
196
+ if (cells.length < 2 || !cells.slice(1).some(cell => GAP_CELL.test(cell)))
197
+ return undefined;
198
+ return cells.filter(cell => cell && !/^[-–—/]+$/u.test(cell)).join(" — ").slice(0, 240);
199
+ }
200
+ /** The points a research draft itself leaves open: the sentences or list items
201
+ * in which it says something was not found, not verified or only alleged.
202
+ * A draft that says so with time left has not finished its research; in cycle
203
+ * 6 one called a core fact "alleged" and stopped with a quarter of its time
204
+ * unused. Decided from the draft's own words, not from the question. */
205
+ export function openResearchPoints(draft, limit = 8) {
206
+ const points = [], seen = new Set();
207
+ for (const block of draft.split(/\n+/u)) {
208
+ const line = block.replace(/^[\s>#*|-]+|[\s*|]+$/gu, "").replace(/\*\*/gu, "");
209
+ // A table of findings marks its gaps with a bare status cell ("Not
210
+ // established") rather than a sentence. In cycle 7 a draft with half its
211
+ // rows in that state was read as having no open points.
212
+ const gapRow = tableGapRow(block);
213
+ if (gapRow) {
214
+ const key = gapRow.toLowerCase().slice(0, 80);
215
+ if (!seen.has(key)) {
216
+ seen.add(key);
217
+ points.push(gapRow);
218
+ }
219
+ if (points.length >= limit)
220
+ return points;
221
+ continue;
222
+ }
223
+ if (line.length < 12 || !OPEN_POINT.test(line))
224
+ continue;
225
+ // Only the sentences that carry the admission, not the settled ones beside them.
226
+ for (const sentence of line.split(/(?<=[.!?])\s+(?=[\p{Lu}\d"“(])/u).filter(part => OPEN_POINT.test(part))) {
227
+ const point = sentence.replace(/\s+/gu, " ").trim().slice(0, 240), key = point.toLowerCase().slice(0, 80);
228
+ if (seen.has(key))
229
+ continue;
230
+ seen.add(key);
231
+ points.push(point);
232
+ if (points.length >= limit)
233
+ return points;
234
+ }
235
+ }
236
+ return points;
237
+ }
@@ -10,6 +10,17 @@ export interface TaskReviewAssessment {
10
10
  workspaceSnapshotHash: string;
11
11
  }
12
12
  export declare function reviewWorkspaceHash(hashes: Readonly<Record<string, string>>): string;
13
+ /** Checks of one requirement area are reviewed together, and one call reviews
14
+ * at most this many. A single call over 52 checks passed a build that omitted
15
+ * two of them; smaller portions keep each clause in view. */
16
+ export declare const REVIEW_CHECKS_PER_CALL = 8;
17
+ export declare const MAX_REVIEW_BATCHES = 64;
18
+ /** Content words of a text: identifiers are split at camelCase and
19
+ * snake_case, words are stemmed to five letters, numbers of three or more
20
+ * digits (a status code, a port, a limit) are kept, common words dropped. */
21
+ export declare const contentWords: (text: string) => Set<string>;
22
+ /** Whether a cited quotation is about the check at all: it shares a content word with it. */
23
+ export declare const sharesContent: (quote: string, reference: string) => boolean;
13
24
  /** Review one scope without loading every sibling's source into the prompt.
14
25
  * Assessments are created only by the controller after separate successful
15
26
  * reviews; the caller must fence the complete snapshot before accepting them. */
@@ -30,6 +41,17 @@ export declare function reviewTaskScope(options: {
30
41
  summary: string;
31
42
  assessments?: readonly TaskReviewAssessment[];
32
43
  authoritativeInputs?: readonly ReviewContractSource[];
44
+ /** Statements from delivered documents; whole-goal review checks each one. */
45
+ deliveredClaims?: readonly {
46
+ path: string;
47
+ text: string;
48
+ }[];
49
+ /** At most this many review portions (calls before paging and repair); the
50
+ * caller lowers it as the deadline nears. Checks that do not fit are
51
+ * returned as unreviewed, highest priority reviewed first. */
52
+ maxPortions?: number;
53
+ /** Called once per review portion, so a caller can share one budget across reviews. */
54
+ onPortion?: () => void;
33
55
  readSource: (file: string, maxChars: number) => Promise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