@tangle-network/browser-agent-driver 0.36.3 → 0.38.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.
Files changed (175) hide show
  1. package/README.md +1 -6
  2. package/dist/artifacts/composite-sink.d.ts.map +1 -1
  3. package/dist/artifacts/composite-sink.js.map +1 -1
  4. package/dist/artifacts/filesystem-sink.d.ts.map +1 -1
  5. package/dist/artifacts/filesystem-sink.js.map +1 -1
  6. package/dist/artifacts/webhook-sink.d.ts.map +1 -1
  7. package/dist/brain/action-parse.js.map +1 -1
  8. package/dist/brain/index.d.ts +3 -5
  9. package/dist/brain/index.d.ts.map +1 -1
  10. package/dist/brain/index.js +3 -3
  11. package/dist/brain/index.js.map +1 -1
  12. package/dist/brain/model-client.js.map +1 -1
  13. package/dist/brain/provider-fetch.d.ts +1 -1
  14. package/dist/brain/provider-fetch.d.ts.map +1 -1
  15. package/dist/brain/tasks/goal-verification.d.ts +24 -9
  16. package/dist/brain/tasks/goal-verification.d.ts.map +1 -1
  17. package/dist/brain/tasks/goal-verification.js +107 -41
  18. package/dist/brain/tasks/goal-verification.js.map +1 -1
  19. package/dist/browser-launch.js.map +1 -1
  20. package/dist/captcha.js.map +1 -1
  21. package/dist/cli/benchmark-sync.js.map +1 -1
  22. package/dist/cli/version.js.map +1 -1
  23. package/dist/cli-attach.js.map +1 -1
  24. package/dist/cli-patterns.js.map +1 -1
  25. package/dist/cli-preview.d.ts.map +1 -1
  26. package/dist/cli-preview.js.map +1 -1
  27. package/dist/cli-share.d.ts.map +1 -1
  28. package/dist/cli-ui.d.ts.map +1 -1
  29. package/dist/cli-view-live.js.map +1 -1
  30. package/dist/cli-view.d.ts.map +1 -1
  31. package/dist/cli-view.js.map +1 -1
  32. package/dist/cli.js.map +1 -1
  33. package/dist/context-budget.d.ts.map +1 -1
  34. package/dist/design/audit/attribution/store.js.map +1 -1
  35. package/dist/design/audit/build-result.js.map +1 -1
  36. package/dist/design/audit/ethics/check.js.map +1 -1
  37. package/dist/design/audit/ethics/loader.js.map +1 -1
  38. package/dist/design/audit/evaluate.d.ts.map +1 -1
  39. package/dist/design/audit/evaluate.js.map +1 -1
  40. package/dist/design/audit/measure/a11y.js.map +1 -1
  41. package/dist/design/audit/modality/android.d.ts +1 -1
  42. package/dist/design/audit/modality/android.d.ts.map +1 -1
  43. package/dist/design/audit/modality/html.d.ts +1 -1
  44. package/dist/design/audit/modality/html.d.ts.map +1 -1
  45. package/dist/design/audit/modality/ios.d.ts +1 -1
  46. package/dist/design/audit/modality/ios.d.ts.map +1 -1
  47. package/dist/design/audit/patterns/match.js.map +1 -1
  48. package/dist/design/audit/patterns/mine.js.map +1 -1
  49. package/dist/design/audit/patterns/store.js.map +1 -1
  50. package/dist/design/audit/reference/config.js.map +1 -1
  51. package/dist/design/audit/reference/dna/derive.js.map +1 -1
  52. package/dist/design/audit/reference/dna/descriptor.js.map +1 -1
  53. package/dist/design/audit/reference/dna/scroll-capture.js.map +1 -1
  54. package/dist/design/audit/reference/generate/generator.js.map +1 -1
  55. package/dist/design/audit/reference/generate/prompt.js.map +1 -1
  56. package/dist/design/audit/reference/judge/image-clamp.js.map +1 -1
  57. package/dist/design/audit/reference/judge/quality.js.map +1 -1
  58. package/dist/design/audit/reference/judge/rank.js.map +1 -1
  59. package/dist/design/audit/reference/judge/vision-judge.js.map +1 -1
  60. package/dist/design/audit/reference/reference-context.js.map +1 -1
  61. package/dist/design/audit/reference/retrieval/embedding-openai.js.map +1 -1
  62. package/dist/design/audit/reference/retrieval/matcher.js.map +1 -1
  63. package/dist/design/audit/report.js.map +1 -1
  64. package/dist/design/audit/rubric/anchor-loader.js.map +1 -1
  65. package/dist/design/audit/rubric/loader.js.map +1 -1
  66. package/dist/design/viewports.d.ts +3 -3
  67. package/dist/design/viewports.d.ts.map +1 -1
  68. package/dist/design-audit.d.ts.map +1 -1
  69. package/dist/design-audit.js.map +1 -1
  70. package/dist/discover/index.js.map +1 -1
  71. package/dist/discover/wayback.js.map +1 -1
  72. package/dist/domain-policy.d.ts +0 -2
  73. package/dist/domain-policy.d.ts.map +1 -1
  74. package/dist/domain-policy.js +0 -37
  75. package/dist/domain-policy.js.map +1 -1
  76. package/dist/drivers/cdp-snapshot.d.ts.map +1 -1
  77. package/dist/drivers/cdp-snapshot.js +22 -6
  78. package/dist/drivers/cdp-snapshot.js.map +1 -1
  79. package/dist/drivers/overlay-label.js.map +1 -1
  80. package/dist/drivers/playwright.d.ts +3 -0
  81. package/dist/drivers/playwright.d.ts.map +1 -1
  82. package/dist/drivers/playwright.js +56 -54
  83. package/dist/drivers/playwright.js.map +1 -1
  84. package/dist/drivers/ref-binding.d.ts +18 -0
  85. package/dist/drivers/ref-binding.d.ts.map +1 -0
  86. package/dist/drivers/ref-binding.js +76 -0
  87. package/dist/drivers/ref-binding.js.map +1 -0
  88. package/dist/drivers/snapshot.d.ts +32 -0
  89. package/dist/drivers/snapshot.d.ts.map +1 -1
  90. package/dist/drivers/snapshot.js +41 -1
  91. package/dist/drivers/snapshot.js.map +1 -1
  92. package/dist/drivers/steel.d.ts.map +1 -1
  93. package/dist/drivers/steel.js.map +1 -1
  94. package/dist/extensions/loader.js.map +1 -1
  95. package/dist/ffmpeg-availability.js.map +1 -1
  96. package/dist/index.d.ts +1 -1
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +1 -1
  99. package/dist/index.js.map +1 -1
  100. package/dist/jobs/retry.js.map +1 -1
  101. package/dist/jobs/store.js.map +1 -1
  102. package/dist/memory/analyzer.d.ts.map +1 -1
  103. package/dist/memory/knowledge.d.ts.map +1 -1
  104. package/dist/memory/project-store.d.ts.map +1 -1
  105. package/dist/memory/run-registry.d.ts.map +1 -1
  106. package/dist/memory/selectors.d.ts.map +1 -1
  107. package/dist/memory/store.d.ts.map +1 -1
  108. package/dist/memory/store.js.map +1 -1
  109. package/dist/multi-actor.d.ts.map +1 -1
  110. package/dist/multi-actor.js.map +1 -1
  111. package/dist/personas.d.ts +1 -1
  112. package/dist/personas.d.ts.map +1 -1
  113. package/dist/provider-defaults.js.map +1 -1
  114. package/dist/reports/aggregate.js.map +1 -1
  115. package/dist/reports/narrate.js.map +1 -1
  116. package/dist/reports/templates.js.map +1 -1
  117. package/dist/reports/tools.d.ts +5 -52
  118. package/dist/reports/tools.d.ts.map +1 -1
  119. package/dist/reports/tools.js.map +1 -1
  120. package/dist/run-state.d.ts.map +1 -1
  121. package/dist/runner/completion-policy.d.ts +0 -31
  122. package/dist/runner/completion-policy.d.ts.map +1 -1
  123. package/dist/runner/completion-policy.js +0 -102
  124. package/dist/runner/completion-policy.js.map +1 -1
  125. package/dist/runner/constants.d.ts +1 -1
  126. package/dist/runner/decision-cache.d.ts.map +1 -1
  127. package/dist/runner/decision-cache.js.map +1 -1
  128. package/dist/runner/direct-start.d.ts +0 -1
  129. package/dist/runner/direct-start.d.ts.map +1 -1
  130. package/dist/runner/direct-start.js +0 -25
  131. package/dist/runner/direct-start.js.map +1 -1
  132. package/dist/runner/events.d.ts.map +1 -1
  133. package/dist/runner/events.js.map +1 -1
  134. package/dist/runner/goal-verification.d.ts +19 -7
  135. package/dist/runner/goal-verification.d.ts.map +1 -1
  136. package/dist/runner/goal-verification.js +23 -127
  137. package/dist/runner/goal-verification.js.map +1 -1
  138. package/dist/runner/google-flights-preflight.d.ts +1 -2
  139. package/dist/runner/google-flights-preflight.d.ts.map +1 -1
  140. package/dist/runner/google-flights-preflight.js +0 -27
  141. package/dist/runner/google-flights-preflight.js.map +1 -1
  142. package/dist/runner/index.d.ts +1 -1
  143. package/dist/runner/index.d.ts.map +1 -1
  144. package/dist/runner/index.js +1 -1
  145. package/dist/runner/index.js.map +1 -1
  146. package/dist/runner/interrupt-controller.d.ts.map +1 -1
  147. package/dist/runner/interrupt-controller.js.map +1 -1
  148. package/dist/runner/overlay-narration.d.ts.map +1 -1
  149. package/dist/runner/replay/controller.d.ts.map +1 -1
  150. package/dist/runner/replay/guard.d.ts.map +1 -1
  151. package/dist/runner/replay/guard.js.map +1 -1
  152. package/dist/runner/runner.d.ts.map +1 -1
  153. package/dist/runner/runner.js +10 -169
  154. package/dist/runner/runner.js.map +1 -1
  155. package/dist/runner/selector-guard.js.map +1 -1
  156. package/dist/runner/stream-webhook.d.ts.map +1 -1
  157. package/dist/runner.d.ts +1 -1
  158. package/dist/runner.d.ts.map +1 -1
  159. package/dist/runner.js +1 -1
  160. package/dist/runner.js.map +1 -1
  161. package/dist/skills/domain-loader.js.map +1 -1
  162. package/dist/skills/macro-loader.d.ts +1 -1
  163. package/dist/skills/macro-loader.js.map +1 -1
  164. package/dist/supervisor/critic.js.map +1 -1
  165. package/dist/supervisor/policy.js.map +1 -1
  166. package/dist/telemetry/client.d.ts.map +1 -1
  167. package/dist/telemetry/client.js.map +1 -1
  168. package/dist/telemetry/sink.d.ts.map +1 -1
  169. package/dist/telemetry/sink.js.map +1 -1
  170. package/dist/test-runner.d.ts.map +1 -1
  171. package/dist/test-runner.js.map +1 -1
  172. package/dist/types/test-runner.d.ts +1 -1
  173. package/dist/wallet/automation.d.ts.map +1 -1
  174. package/dist/wallet/automation.js.map +1 -1
  175. package/package.json +37 -35
@@ -18,7 +18,6 @@ import { AppKnowledge } from '../memory/knowledge.js';
18
18
  import { SelectorCache } from '../memory/selectors.js';
19
19
  import { detectSupervisorSignal, formatSupervisorSignal } from '../supervisor/policy.js';
20
20
  import { requestSupervisorDirective } from '../supervisor/critic.js';
21
- import { shouldAcceptFirstPartyBoundaryCompletion } from '../domain-policy.js';
22
21
  import { deriveWasteMetrics } from '../run-metrics.js';
23
22
  import { RunState, DEFAULT_TOKEN_BUDGET } from '../run-state.js';
24
23
  import { ContextBudget } from '../context-budget.js';
@@ -26,7 +25,7 @@ import { runOverridePipeline } from '../override-pipeline.js';
26
25
  import { withRetry, findElementForRef, safeHostname, pushGoalVerificationEvidence, capFeedbackText, sanitizeRunScript, shouldRejectSurrender } from './utils.js';
27
26
  import { runExtractWithIndex, formatExtractWithIndexResult } from '../drivers/extract-with-index.js';
28
27
  import { buildSearchResultsGuidance, buildVisibleLinkRecommendation, getVisibleLinkRecommendation } from './search-guidance.js';
29
- import { buildGoalVerificationClaim, collectSearchWorkflowEvidence, shouldAcceptSearchWorkflowCompletion, shouldAcceptScriptBackedCompletion, detectCompletionContentTypeMismatch } from './goal-verification.js';
28
+ import { collectPageEvidence, detectCompletionContentTypeMismatch } from './goal-verification.js';
30
29
  import { detectAiTanglePartnerTemplateVisibleState, detectAiTangleVerifiedOutputState, shouldEscalateVision } from './page-analysis.js';
31
30
  import { buildOverrideProducers, buildScoutLinkRecommendationText, buildBranchLinkRecommendationText } from './overrides.js';
32
31
  import { buildSearchResultsScoutFeedbackImpl, buildVisibleLinkScoutRecommendationImpl, buildBranchLinkRecommendationImpl, } from './scout-feedback.js';
@@ -43,13 +42,13 @@ import { DecisionCache } from './decision-cache.js';
43
42
  import { VerdictTracker, extractCurrentMarker, buildProgressLabel, } from './overlay-narration.js';
44
43
  import { applyDemoOverride } from './demo-overrides.js';
45
44
  import { matchDeterministicPattern } from './deterministic-patterns.js';
46
- import { deriveDirectStartUrl, shouldAcceptRolledBookingCompletion } from './direct-start.js';
47
- import { prepareGoogleFlightsSearch, shouldAcceptRolledGoogleFlightsCompletion } from './google-flights-preflight.js';
45
+ import { deriveDirectStartUrl } from './direct-start.js';
46
+ import { prepareGoogleFlightsSearch } from './google-flights-preflight.js';
48
47
  import { containsSelfContradictingCompletion } from './completion-language.js';
49
48
  import { detectBatchFillOpportunity } from './batch-fill.js';
50
49
  import { DEFAULT_MAX_TURNS, DEFAULT_RETRIES, DEFAULT_RETRY_DELAY_MS, DEFAULT_SUPERVISOR, EXTENSION_TURNS_GRANTED, } from './constants.js';
51
50
  import { DEFI_BRAIN_CONTEXT } from './prompt-snippets.js';
52
- import { hasPlaceholderPattern, isMeaningfulRunScriptOutput, synthesizeFinalTurnCompletion, evidenceCorroboratesResult, goalLiteralsCorroborated } from './completion-policy.js';
51
+ import { hasPlaceholderPattern, isMeaningfulRunScriptOutput, synthesizeFinalTurnCompletion } from './completion-policy.js';
53
52
  import { validateObservedSelector } from './selector-guard.js';
54
53
  import { selectMicroPlanFollowUps } from './micro-plan.js';
55
54
  import { decideMaxTurnsExtension } from './max-turns-extension.js';
@@ -1557,83 +1556,19 @@ export class BrowserAgent {
1557
1556
  // Step 1: Goal verification — did the agent actually achieve the goal?
1558
1557
  const shouldVerifyGoal = this.config.goalVerification !== false;
1559
1558
  let goalResult;
1560
- const persistentSearchEvidence = collectSearchWorkflowEvidence(scenario.goal, action.result || '', turns);
1561
1559
  const verificationEvidence = [
1562
1560
  ...runState.goalVerificationEvidence,
1563
1561
  ...runState.extractedEvidence,
1564
- ...persistentSearchEvidence,
1565
1562
  ];
1566
1563
  if (shouldVerifyGoal) {
1567
- // Fast-path: skip LLM verification when agent provides strong
1568
- // evidence and had no recent errors. The detailed result text
1569
- // (>50 chars) combined with script-extracted evidence means the
1570
- // verifier almost always agrees — save the round-trip.
1571
- //
1572
- // Content-aware gate: self-contradicting completion text forces
1573
- // LLM verification instead of using the fast path.
1564
+ // Every completion is judged from page evidence: the final page,
1565
+ // earlier observations, and values the driver read. The agent's
1566
+ // result text is passed as a claim to check, never as evidence;
1567
+ // there is no accept path that skips the page.
1574
1568
  const agentResult = action.result || '';
1575
- const recentErrors = turns.slice(-2).filter(t => t.error).length;
1576
- const hasScriptEvidence = verificationEvidence.some(e => e.startsWith('SCRIPT RESULT:'));
1577
- // Detect when the agent's own text admits failure despite
1578
- // claiming success.
1579
1569
  const selfContradicting = containsSelfContradictingCompletion(agentResult);
1580
- const fastPathEligible = agentResult.length > 50 &&
1581
- recentErrors === 0 &&
1582
- hasScriptEvidence &&
1583
- !selfContradicting;
1584
- // Deterministic corroboration: the claimed JSON echoes SCRIPT
1585
- // RESULT values field-for-field, OR every quoted literal in the
1586
- // goal appears verbatim in the final observation/evidence —
1587
- // hallucination is impossible by construction, so skip the
1588
- // verifier LLM entirely (the wave-1 over-conservatism case:
1589
- // correct JSON re-prompted 3x).
1590
- const corroborated = !selfContradicting
1591
- && (evidenceCorroboratesResult(agentResult, runState.goalVerificationEvidence)
1592
- || goalLiteralsCorroborated(scenario.goal, state.snapshot, runState.goalVerificationEvidence, turns.map((t) => t.state.snapshot),
1593
- // Form-control state evidence: payloads of actions that
1594
- // executed without error (driver-confirmed fills/selects).
1595
- turns
1596
- .filter((t) => !t.error)
1597
- .flatMap((t) => [JSON.stringify(t.action), ...(t.executedActions ?? []).map((a) => JSON.stringify(a))])));
1598
- let verificationPath;
1599
- if (corroborated) {
1600
- verificationPath = 'corroborated';
1601
- goalResult = {
1602
- achieved: true,
1603
- confidence: 0.9,
1604
- evidence: ['Evidence-corroborated: every claimed result field matches a SCRIPT RESULT value exactly.'],
1605
- missing: [],
1606
- };
1607
- if (this.config.debug) {
1608
- console.log('[Runner] Goal verification: accepted via script-evidence corroboration (no LLM call)');
1609
- }
1610
- }
1611
- else if (fastPathEligible) {
1612
- verificationPath = 'fast-path';
1613
- goalResult = {
1614
- achieved: true,
1615
- confidence: 0.9,
1616
- evidence: ['Fast-path: agent provided detailed result with script-backed evidence, no recent errors, and no self-contradicting language.'],
1617
- missing: [],
1618
- };
1619
- if (this.config.debug) {
1620
- console.log('[Runner] Goal verification fast-path: skipped LLM call (strong evidence + no errors + no self-contradiction)');
1621
- }
1622
- }
1623
- else if (selfContradicting) {
1624
- // Force LLM verification — the agent claims success but its
1625
- // own text suggests failure. The LLM verifier reads the actual
1626
- // content and makes the right call.
1627
- verificationPath = hasScriptEvidence ? 'llm-slim' : 'llm';
1628
- if (this.config.debug) {
1629
- console.log('[Runner] Fast-path blocked: agent result contains self-contradicting language, forcing LLM verification');
1630
- }
1631
- goalResult = await this.brain.verifyGoalCompletion(state, scenario.goal, buildGoalVerificationClaim(agentResult, verificationEvidence), { skipPageState: hasScriptEvidence });
1632
- }
1633
- else {
1634
- verificationPath = hasScriptEvidence ? 'llm-slim' : 'llm';
1635
- goalResult = await this.brain.verifyGoalCompletion(state, scenario.goal, buildGoalVerificationClaim(agentResult, verificationEvidence), { skipPageState: hasScriptEvidence });
1636
- }
1570
+ const verificationPath = 'llm';
1571
+ goalResult = await this.brain.verifyGoalCompletion(state, scenario.goal, agentResult, collectPageEvidence(turns, state, verificationEvidence));
1637
1572
  // Record the verifier call's own token usage into run metrics —
1638
1573
  // previously invisible in cost accounting (report.json totals and
1639
1574
  // events.jsonl). Deterministic paths carry no usage fields.
@@ -1666,76 +1601,6 @@ export class BrowserAgent {
1666
1601
  ],
1667
1602
  };
1668
1603
  }
1669
- if (!goalResult.achieved
1670
- && !selfContradicting
1671
- && shouldAcceptFirstPartyBoundaryCompletion(scenario.goal, state.url, goalResult, action.result || '')) {
1672
- goalResult = {
1673
- ...goalResult,
1674
- achieved: true,
1675
- confidence: Math.max(goalResult.confidence, 0.8),
1676
- evidence: [
1677
- ...goalResult.evidence,
1678
- 'Accepted under first-party sibling subdomain policy after substantive result evidence was captured.',
1679
- ],
1680
- missing: [],
1681
- };
1682
- }
1683
- if (!goalResult.achieved
1684
- && !selfContradicting
1685
- && shouldAcceptSearchWorkflowCompletion(scenario.goal, goalResult, action.result || '', verificationEvidence)) {
1686
- goalResult = {
1687
- ...goalResult,
1688
- achieved: true,
1689
- confidence: Math.max(goalResult.confidence, 0.82),
1690
- evidence: [
1691
- ...goalResult.evidence,
1692
- 'Accepted under persisted search-workflow evidence captured from an earlier turn before the agent navigated away.',
1693
- ],
1694
- missing: [],
1695
- };
1696
- }
1697
- if (!goalResult.achieved
1698
- && !selfContradicting
1699
- && shouldAcceptScriptBackedCompletion(scenario.goal, state, goalResult, action.result || '', verificationEvidence)) {
1700
- goalResult = {
1701
- ...goalResult,
1702
- achieved: true,
1703
- confidence: Math.max(goalResult.confidence, 0.8),
1704
- evidence: [
1705
- ...goalResult.evidence,
1706
- 'Accepted under script-backed extraction policy after supplemental tool evidence matched the claimed result.',
1707
- ],
1708
- missing: [],
1709
- };
1710
- }
1711
- if (!goalResult.achieved
1712
- && !selfContradicting
1713
- && shouldAcceptRolledBookingCompletion(directStart, goalResult, action.result || '', state)) {
1714
- goalResult = {
1715
- ...goalResult,
1716
- achieved: true,
1717
- confidence: Math.max(goalResult.confidence, 0.82),
1718
- evidence: [
1719
- ...goalResult.evidence,
1720
- 'Accepted under Booking direct-start date-roll policy: the stale benchmark dates were mapped to equivalent live bookable dates and the completion included concrete Booking evidence.',
1721
- ],
1722
- missing: [],
1723
- };
1724
- }
1725
- if (!goalResult.achieved
1726
- && !selfContradicting
1727
- && shouldAcceptRolledGoogleFlightsCompletion(googleFlightsPreflight, goalResult, action.result || '', state)) {
1728
- goalResult = {
1729
- ...goalResult,
1730
- achieved: true,
1731
- confidence: Math.max(goalResult.confidence, 0.82),
1732
- evidence: [
1733
- ...goalResult.evidence,
1734
- 'Accepted under Google Flights preflight date-roll policy: stale benchmark flight dates were mapped to equivalent live Google Flights dates and the completion included concrete flight-result evidence.',
1735
- ],
1736
- missing: [],
1737
- };
1738
- }
1739
1604
  const contentTypeMismatch = detectCompletionContentTypeMismatch(scenario.goal, state, action.result || '', verificationEvidence);
1740
1605
  if (contentTypeMismatch) {
1741
1606
  runState.verificationRejectionCount++;
@@ -1747,30 +1612,6 @@ export class BrowserAgent {
1747
1612
  this.onTurn?.(turn);
1748
1613
  continue;
1749
1614
  }
1750
- if (!goalResult.achieved) {
1751
- // Progressive acceptance: after prior rejections, accept near-misses
1752
- // rather than burning turns in verification loops.
1753
- // Tier A: 1+ rejection + confidence ≥0.55 + supplemental evidence → accept
1754
- // Tier B: 2+ rejections + confidence ≥0.50 → accept (agent has tried hard enough)
1755
- // Tier C: 3+ rejections + confidence ≥0.40 → accept (prevent total turn exhaustion)
1756
- const hasSupplementalEvidence = verificationEvidence.length > 0;
1757
- const priorRejections = runState.verificationRejectionCount;
1758
- const shouldAccept = !selfContradicting && ((priorRejections >= 1 && goalResult.confidence >= 0.55 && hasSupplementalEvidence) ||
1759
- (priorRejections >= 2 && goalResult.confidence >= 0.50) ||
1760
- (priorRejections >= 3 && goalResult.confidence >= 0.40));
1761
- if (shouldAccept) {
1762
- goalResult = {
1763
- ...goalResult,
1764
- achieved: true,
1765
- confidence: goalResult.confidence,
1766
- evidence: [
1767
- ...goalResult.evidence,
1768
- `Accepted under progressive threshold after ${priorRejections} prior rejection(s)${hasSupplementalEvidence ? ' with supplemental evidence' : ''}.`,
1769
- ],
1770
- missing: [],
1771
- };
1772
- }
1773
- }
1774
1615
  if (!goalResult.achieved) {
1775
1616
  runState.verificationRejectionCount++;
1776
1617
  turn.verificationFailure = goalResult.missing.join('; ') || 'Goal verification failed';