@systemfsoftware/agent 0.0.0-bootstrap.0 → 0.1.0-beta.192
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/LICENSE +21 -0
- package/dist/ActivityStore-CEy3oY41.mjs +90 -0
- package/dist/ActivityStore-CEy3oY41.mjs.map +1 -0
- package/dist/ActivityStore-CPXWRHGz.d.mts +91 -0
- package/dist/Admin-BcQDrWKY.mjs +329 -0
- package/dist/Admin-BcQDrWKY.mjs.map +1 -0
- package/dist/Admin-BfolLkHj.d.mts +5678 -0
- package/dist/Agent-Bn3zMhDH.mjs +60 -0
- package/dist/Agent-Bn3zMhDH.mjs.map +1 -0
- package/dist/Agent-DSVEpq4e.d.mts +219 -0
- package/dist/AgentError-RkUaetX8.d.mts +128 -0
- package/dist/AgentError-yFdnS9bl.mjs +141 -0
- package/dist/AgentError-yFdnS9bl.mjs.map +1 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs +116 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs.map +1 -0
- package/dist/AgentPolicy-D-GmZQex.d.mts +128 -0
- package/dist/AgentRegistration-Dg53p6du.mjs +14 -0
- package/dist/AgentRegistration-Dg53p6du.mjs.map +1 -0
- package/dist/AgentRuntime-CoGy_5dm.d.mts +751 -0
- package/dist/AgentRuntime-CzP4I4RB.mjs +5249 -0
- package/dist/AgentRuntime-CzP4I4RB.mjs.map +1 -0
- package/dist/AgentUpdates-7xT0It_R.d.mts +54 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs +66 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs.map +1 -0
- package/dist/BrowserUse-C9vict2M.d.mts +196 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs +156 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs.map +1 -0
- package/dist/Budget-CXh_ChFJ.d.mts +112 -0
- package/dist/Budget-j1UkthgY.mjs +351 -0
- package/dist/Budget-j1UkthgY.mjs.map +1 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs +281 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs.map +1 -0
- package/dist/CodeExecutor-D5-Rda75.d.mts +198 -0
- package/dist/CodeMode-B7JvfKAD.d.mts +159 -0
- package/dist/CodeMode-BI7WhUkr.mjs +555 -0
- package/dist/CodeMode-BI7WhUkr.mjs.map +1 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs +146 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs.map +1 -0
- package/dist/CommittedActivity-LWOKXqdi.d.mts +62 -0
- package/dist/Compaction-C0hWAmOG.mjs +15 -0
- package/dist/Compaction-C0hWAmOG.mjs.map +1 -0
- package/dist/Compaction-e5cNeFmY.d.mts +5 -0
- package/dist/ContextCompactor-Chm9BLrD.d.mts +165 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs +134 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs.map +1 -0
- package/dist/ContextHistory-C80rW5M7.mjs +76 -0
- package/dist/ContextHistory-C80rW5M7.mjs.map +1 -0
- package/dist/ContextHistory-akQ1Td7a.d.mts +65 -0
- package/dist/ContextTools-917r7gpv.d.mts +186 -0
- package/dist/ContextTools-p8JDPo-W.mjs +88 -0
- package/dist/ContextTools-p8JDPo-W.mjs.map +1 -0
- package/dist/ContextWindow-BJZI4MMt.d.mts +61 -0
- package/dist/ContextWindow-kbFcs1IF.mjs +63 -0
- package/dist/ContextWindow-kbFcs1IF.mjs.map +1 -0
- package/dist/Digest-BDToAbaX.d.mts +25 -0
- package/dist/Digest-CU6IWj-2.mjs +106 -0
- package/dist/Digest-CU6IWj-2.mjs.map +1 -0
- package/dist/DurableAgentRuntime-BHXo8GPJ.mjs +8432 -0
- package/dist/DurableAgentRuntime-BHXo8GPJ.mjs.map +1 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs +98 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs.map +1 -0
- package/dist/DurableFailpoint-Cqi5tyof.d.mts +42 -0
- package/dist/DurableStep-CzVIho7y.mjs +54 -0
- package/dist/DurableStep-CzVIho7y.mjs.map +1 -0
- package/dist/DurableStep-cI_Ho_rU.d.mts +109 -0
- package/dist/EventSource-BwZVkEQi.mjs +66 -0
- package/dist/EventSource-BwZVkEQi.mjs.map +1 -0
- package/dist/EventSource-C0TCBeIf.d.mts +52 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs +304 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs.map +1 -0
- package/dist/FailureDiagnostic-DpzYNI8f.d.mts +232 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs +29 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs.map +1 -0
- package/dist/IdGenerator-BY8NH74o.d.mts +26 -0
- package/dist/Identifiers-LWd4837I.mjs +41 -0
- package/dist/Identifiers-LWd4837I.mjs.map +1 -0
- package/dist/Identifiers-qafW4EP0.d.mts +38 -0
- package/dist/InMemory-BrTm6XEO.mjs +57 -0
- package/dist/InMemory-BrTm6XEO.mjs.map +1 -0
- package/dist/InMemory-C3qXFT5k.d.mts +46 -0
- package/dist/InMemory.d.mts +2 -0
- package/dist/InMemory.mjs +1 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs +237 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs.map +1 -0
- package/dist/InteractiveBrowser-nnML0r7w.d.mts +258 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs +204 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs.map +1 -0
- package/dist/Memory-CT5bDZqi.d.mts +57 -0
- package/dist/Memory-Dl9ecPpm.mjs +204 -0
- package/dist/Memory-Dl9ecPpm.mjs.map +1 -0
- package/dist/MemoryNamespace-BtnlH_E6.d.mts +35 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs +116 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs.map +1 -0
- package/dist/MemoryNotes-4CRzkPBD.d.mts +425 -0
- package/dist/MemoryNotes-i41TsH11.mjs +132 -0
- package/dist/MemoryNotes-i41TsH11.mjs.map +1 -0
- package/dist/MemoryReference-Dd3KSMa7.d.mts +77 -0
- package/dist/MemoryReference-RFU0HQJG.mjs +108 -0
- package/dist/MemoryReference-RFU0HQJG.mjs.map +1 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs +136 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs.map +1 -0
- package/dist/MemoryRevalidation-FsJ8E61W.d.mts +64 -0
- package/dist/MemoryStore-Bg5RunTk.d.mts +187 -0
- package/dist/MemoryStore-E0J99hb2.mjs +245 -0
- package/dist/MemoryStore-E0J99hb2.mjs.map +1 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs +615 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs.map +1 -0
- package/dist/MessageDelivery-Dh6GZBt_.d.mts +1129 -0
- package/dist/Messaging-BqWHYf93.d.mts +216 -0
- package/dist/Messaging-DgSiv4f4.mjs +154 -0
- package/dist/Messaging-DgSiv4f4.mjs.map +1 -0
- package/dist/Messaging-DhM-APnP.d.mts +1074 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs +117 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs.map +1 -0
- package/dist/MessagingHost-CubWeYKN.d.mts +80 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs +72 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs.map +1 -0
- package/dist/OperationAuthorizer-y-F-Ox_Q.d.mts +62 -0
- package/dist/Output-DQ8mWcgf.mjs +7 -0
- package/dist/Output-DQ8mWcgf.mjs.map +1 -0
- package/dist/Output-SbOdlBFL.d.mts +22 -0
- package/dist/PageCapture-BfRURUOA.mjs +275 -0
- package/dist/PageCapture-BfRURUOA.mjs.map +1 -0
- package/dist/PageCapture-C_mE72Sd.d.mts +216 -0
- package/dist/PageScreenshot-BJTASs4o.mjs +53 -0
- package/dist/PageScreenshot-BJTASs4o.mjs.map +1 -0
- package/dist/PageScreenshot-CaoaH7mc.d.mts +48 -0
- package/dist/PersistentHistory-BrtZ0g2j.d.mts +14 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs +147 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs.map +1 -0
- package/dist/PreparedInputAdmission-Ci18uY4s.d.mts +973 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs +95 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs.map +1 -0
- package/dist/ProvisionalText-BcKpPYKQ.d.mts +70 -0
- package/dist/ProvisionalText-DXddTK4c.mjs +47 -0
- package/dist/ProvisionalText-DXddTK4c.mjs.map +1 -0
- package/dist/Receipt-B-FlCaNH.mjs +35 -0
- package/dist/Receipt-B-FlCaNH.mjs.map +1 -0
- package/dist/Receipt-B4feBxMY.d.mts +31 -0
- package/dist/RecordFormat-DoNh-AFe.mjs +79 -0
- package/dist/RecordFormat-DoNh-AFe.mjs.map +1 -0
- package/dist/RecordFormat-ZMus8Dx8.d.mts +52 -0
- package/dist/Records-C645aQks.mjs +1145 -0
- package/dist/Records-C645aQks.mjs.map +1 -0
- package/dist/Records-C9I1nCL9.d.mts +1423 -0
- package/dist/Recovery-zWy_kmZq.mjs +736 -0
- package/dist/Recovery-zWy_kmZq.mjs.map +1 -0
- package/dist/Redaction-C0zLBAn6.d.mts +28 -0
- package/dist/Redaction-CtyCBMEj.mjs +116 -0
- package/dist/Redaction-CtyCBMEj.mjs.map +1 -0
- package/dist/RememberingStore-BO-OnCgP.mjs +23 -0
- package/dist/RememberingStore-BO-OnCgP.mjs.map +1 -0
- package/dist/RememberingStore-DgqXmILx.d.mts +14 -0
- package/dist/RunContinuation-BVAHoYlN.d.mts +127 -0
- package/dist/RunContinuation-Bpfp087i.mjs +1060 -0
- package/dist/RunContinuation-Bpfp087i.mjs.map +1 -0
- package/dist/RunEvent-CwgDzXcH.d.mts +465 -0
- package/dist/RunEvent-DJxENnJi.mjs +345 -0
- package/dist/RunEvent-DJxENnJi.mjs.map +1 -0
- package/dist/RunEventSink-B8uM8bw2.mjs +22 -0
- package/dist/RunEventSink-B8uM8bw2.mjs.map +1 -0
- package/dist/RunEventSink-f-T4jbNB.d.mts +105 -0
- package/dist/RunHooks-Bob22Bcj.d.mts +40 -0
- package/dist/RunHooks-DWuLBVdU.mjs +60 -0
- package/dist/RunHooks-DWuLBVdU.mjs.map +1 -0
- package/dist/RunJournal-C_1eqQdr.mjs +1107 -0
- package/dist/RunJournal-C_1eqQdr.mjs.map +1 -0
- package/dist/RunOptions-BVSa3BO2.d.mts +560 -0
- package/dist/RunOptions-COEUCrx4.mjs +61 -0
- package/dist/RunOptions-COEUCrx4.mjs.map +1 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs +25 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs.map +1 -0
- package/dist/RunPolicyUsage-jvJo0vJp.d.mts +21 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs +304 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs.map +1 -0
- package/dist/Sandbox-37vXP0BV.d.mts +24 -0
- package/dist/Sandbox-Bze6pHYc.mjs +30 -0
- package/dist/Sandbox-Bze6pHYc.mjs.map +1 -0
- package/dist/Schedule-BY0lzbij.mjs +336 -0
- package/dist/Schedule-BY0lzbij.mjs.map +1 -0
- package/dist/ScheduleTransition-CjVP48I8.d.mts +22 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs +180 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs.map +1 -0
- package/dist/Scheduling-BpJN9E1j.mjs +699 -0
- package/dist/Scheduling-BpJN9E1j.mjs.map +1 -0
- package/dist/Scheduling-DYTM29s9.d.mts +57 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs +300 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs.map +1 -0
- package/dist/SemanticMemory-rgWlhW87.d.mts +431 -0
- package/dist/SemanticMemoryIndex-D7yNEWpt.d.mts +826 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs +186 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs.map +1 -0
- package/dist/SemanticMemoryRevalidation-Bm3_pfsI.d.mts +44 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs +179 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs.map +1 -0
- package/dist/Subagent-CSIRUgUo.mjs +1315 -0
- package/dist/Subagent-CSIRUgUo.mjs.map +1 -0
- package/dist/Subagent-CXEI5YZ8.d.mts +2368 -0
- package/dist/SubagentContract-B7vQPueI.d.mts +176 -0
- package/dist/SubagentContract-C-7AxTm_.mjs +187 -0
- package/dist/SubagentContract-C-7AxTm_.mjs.map +1 -0
- package/dist/SubagentHost-BEnICu7g.mjs +70 -0
- package/dist/SubagentHost-BEnICu7g.mjs.map +1 -0
- package/dist/SubagentHost-CKhz1vbH.d.mts +167 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs +465 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs.map +1 -0
- package/dist/SubagentReservations-WrmIVzO5.d.mts +185 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs +921 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs.map +1 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs +17 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs.map +1 -0
- package/dist/Subscription-BhQbmUD-.mjs +340 -0
- package/dist/Subscription-BhQbmUD-.mjs.map +1 -0
- package/dist/Subscription-CC--_OnU.d.mts +815 -0
- package/dist/SubscriptionInput-BEeB0Cj8.d.mts +42 -0
- package/dist/SubscriptionInput-Xcd4JjEs.mjs +53 -0
- package/dist/SubscriptionInput-Xcd4JjEs.mjs.map +1 -0
- package/dist/SubscriptionTransition-CWt9UVH0.d.mts +23 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs +154 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs.map +1 -0
- package/dist/Subscriptions-4K_qu_2f.mjs +638 -0
- package/dist/Subscriptions-4K_qu_2f.mjs.map +1 -0
- package/dist/Subscriptions-BF3aSf8X.d.mts +75 -0
- package/dist/Thread-B8JApGHa.mjs +283 -0
- package/dist/Thread-B8JApGHa.mjs.map +1 -0
- package/dist/Thread-BnAtkJl4.d.mts +116 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs +64 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs.map +1 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs +211 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs.map +1 -0
- package/dist/ThreadContextHistory-lTZ8Ftq1.d.mts +33 -0
- package/dist/ThreadContextHistoryProjection-Cp7_RR6V.d.mts +59 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs +149 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs.map +1 -0
- package/dist/ThreadHistory-BkyGfv5E.d.mts +76 -0
- package/dist/ThreadHistory-Blt_W31N.mjs +69 -0
- package/dist/ThreadHistory-Blt_W31N.mjs.map +1 -0
- package/dist/ThreadImport-C8Tqiezd.mjs +491 -0
- package/dist/ThreadImport-C8Tqiezd.mjs.map +1 -0
- package/dist/ThreadImport-DaSmrlRi.d.mts +843 -0
- package/dist/ThreadInvariants-DyPhMeo-.d.mts +23 -0
- package/dist/ThreadInvariants-fniroLRY.mjs +154 -0
- package/dist/ThreadInvariants-fniroLRY.mjs.map +1 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs +37 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs.map +1 -0
- package/dist/ThreadProjectionMaintenance-DjUy7kCa.d.mts +51 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs +937 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs.map +1 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs +154 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs.map +1 -0
- package/dist/ThreadTransfer-BM02cbOo.d.mts +63 -0
- package/dist/ThreadWork-C-xa2Boi.mjs +484 -0
- package/dist/ThreadWork-C-xa2Boi.mjs.map +1 -0
- package/dist/ToolBroker-DkoVyx6T.mjs +42 -0
- package/dist/ToolBroker-DkoVyx6T.mjs.map +1 -0
- package/dist/ToolBroker-Dy2xM6ht.d.mts +134 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs +211 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs.map +1 -0
- package/dist/ToolDiscovery-VjamzX3q.d.mts +119 -0
- package/dist/ToolExposure-Cn7xETn5.d.mts +6 -0
- package/dist/ToolExposure-D7id9Gt5.d.mts +37 -0
- package/dist/ToolExposure-DCvQWFIa.mjs +9 -0
- package/dist/ToolExposure-DCvQWFIa.mjs.map +1 -0
- package/dist/ToolExposure-DNME8BkG.d.mts +44 -0
- package/dist/ToolExposure-DPnq8Won.mjs +30 -0
- package/dist/ToolExposure-DPnq8Won.mjs.map +1 -0
- package/dist/ToolExposure-DaGaF5tj.mjs +20 -0
- package/dist/ToolExposure-DaGaF5tj.mjs.map +1 -0
- package/dist/ToolExposure.d.mts +4 -0
- package/dist/ToolExposure.mjs +4 -0
- package/dist/ToolReconciler-6bb7xlip.d.mts +81 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs +87 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs.map +1 -0
- package/dist/ToolResult-By5KAje4.d.mts +79 -0
- package/dist/ToolResult-DwZxjlHw.mjs +160 -0
- package/dist/ToolResult-DwZxjlHw.mjs.map +1 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs +46 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs.map +1 -0
- package/dist/ToolResultStorage-Bp5fm0do.d.mts +49 -0
- package/dist/ToolResults-C4-HsMCp.d.mts +33 -0
- package/dist/ToolResults-nCgBlTp2.mjs +45 -0
- package/dist/ToolResults-nCgBlTp2.mjs.map +1 -0
- package/dist/Usage-B0xgME5f.mjs +340 -0
- package/dist/Usage-B0xgME5f.mjs.map +1 -0
- package/dist/Usage-Bc-jXe_9.d.mts +128 -0
- package/dist/WakeScheduler-DVYj66C-.mjs +74 -0
- package/dist/WakeScheduler-DVYj66C-.mjs.map +1 -0
- package/dist/WakeScheduler-SFqj67Sk.d.mts +74 -0
- package/dist/WebCapture-CA4ZarW2.mjs +64 -0
- package/dist/WebCapture-CA4ZarW2.mjs.map +1 -0
- package/dist/WebCapture-pzIeUJ5W.d.mts +49 -0
- package/dist/WebSearch-CD0V--qh.d.mts +18 -0
- package/dist/WebSearch-DnbOzRL_.mjs +30 -0
- package/dist/WebSearch-DnbOzRL_.mjs.map +1 -0
- package/dist/Worker-CQu8Qp1j.mjs +267 -0
- package/dist/Worker-CQu8Qp1j.mjs.map +1 -0
- package/dist/Worker-xxucY_0b.d.mts +468 -0
- package/dist/WorkerAdmission-BhFjx86s.mjs +162 -0
- package/dist/WorkerAdmission-BhFjx86s.mjs.map +1 -0
- package/dist/WorkerAdmission-BnRuXLWF.d.mts +171 -0
- package/dist/WorkerHost-DtYzi54D.d.mts +150 -0
- package/dist/WorkerHost-DuQug9Bq.mjs +73 -0
- package/dist/WorkerHost-DuQug9Bq.mjs.map +1 -0
- package/dist/agent-registration-CNs2twrr.mjs +262 -0
- package/dist/agent-registration-CNs2twrr.mjs.map +1 -0
- package/dist/capabilities/BrowserUse.d.mts +2 -0
- package/dist/capabilities/BrowserUse.mjs +1 -0
- package/dist/capabilities/Budget.d.mts +2 -0
- package/dist/capabilities/Budget.mjs +1 -0
- package/dist/capabilities/CodeMode.d.mts +2 -0
- package/dist/capabilities/CodeMode.mjs +1 -0
- package/dist/capabilities/ContextTools.d.mts +2 -0
- package/dist/capabilities/ContextTools.mjs +1 -0
- package/dist/capabilities/MemoryNotes.d.mts +2 -0
- package/dist/capabilities/MemoryNotes.mjs +1 -0
- package/dist/capabilities/Messaging.d.mts +3 -0
- package/dist/capabilities/Messaging.mjs +4 -0
- package/dist/capabilities/Redaction.d.mts +2 -0
- package/dist/capabilities/Redaction.mjs +1 -0
- package/dist/capabilities/RunHooks.d.mts +2 -0
- package/dist/capabilities/RunHooks.mjs +1 -0
- package/dist/capabilities/SemanticMemory.d.mts +2 -0
- package/dist/capabilities/SemanticMemory.mjs +1 -0
- package/dist/capabilities/Subagent.d.mts +4 -0
- package/dist/capabilities/Subagent.mjs +6 -0
- package/dist/capabilities/SubagentReservations.d.mts +2 -0
- package/dist/capabilities/SubagentReservations.mjs +1 -0
- package/dist/capabilities/ToolDiscovery.d.mts +2 -0
- package/dist/capabilities/ToolDiscovery.mjs +1 -0
- package/dist/capabilities/ToolResults.d.mts +2 -0
- package/dist/capabilities/ToolResults.mjs +1 -0
- package/dist/capabilities/WebCapture.d.mts +2 -0
- package/dist/capabilities/WebCapture.mjs +1 -0
- package/dist/capabilities/WebSearch.d.mts +2 -0
- package/dist/capabilities/WebSearch.mjs +1 -0
- package/dist/compaction-C3hXuO4Z.mjs +539 -0
- package/dist/compaction-C3hXuO4Z.mjs.map +1 -0
- package/dist/completion-B_WDnSg-.d.mts +11 -0
- package/dist/core/Agent.d.mts +2 -0
- package/dist/core/Agent.mjs +1 -0
- package/dist/core/AgentError.d.mts +2 -0
- package/dist/core/AgentError.mjs +1 -0
- package/dist/core/AgentPolicy.d.mts +2 -0
- package/dist/core/AgentPolicy.mjs +1 -0
- package/dist/core/AgentUpdates.d.mts +2 -0
- package/dist/core/AgentUpdates.mjs +1 -0
- package/dist/core/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +1 -0
- package/dist/core/IdGenerator.d.mts +2 -0
- package/dist/core/IdGenerator.mjs +1 -0
- package/dist/core/Identifiers.d.mts +2 -0
- package/dist/core/Identifiers.mjs +1 -0
- package/dist/core/Memory.d.mts +2 -0
- package/dist/core/Memory.mjs +1 -0
- package/dist/core/MemoryNamespace.d.mts +2 -0
- package/dist/core/MemoryNamespace.mjs +1 -0
- package/dist/core/MemoryReference.d.mts +2 -0
- package/dist/core/MemoryReference.mjs +1 -0
- package/dist/core/MemoryRevalidation.d.mts +2 -0
- package/dist/core/MemoryRevalidation.mjs +1 -0
- package/dist/core/MemoryStore.d.mts +2 -0
- package/dist/core/MemoryStore.mjs +1 -0
- package/dist/core/ProvisionalText.d.mts +2 -0
- package/dist/core/ProvisionalText.mjs +1 -0
- package/dist/core/Receipt.d.mts +2 -0
- package/dist/core/Receipt.mjs +1 -0
- package/dist/core/RememberingStore.d.mts +2 -0
- package/dist/core/RememberingStore.mjs +1 -0
- package/dist/core/RunEvent.d.mts +3 -0
- package/dist/core/RunEvent.mjs +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +1 -0
- package/dist/core/SemanticMemoryIndex.d.mts +2 -0
- package/dist/core/SemanticMemoryIndex.mjs +1 -0
- package/dist/core/SemanticMemoryRevalidation.d.mts +2 -0
- package/dist/core/SemanticMemoryRevalidation.mjs +1 -0
- package/dist/core/SubagentContract.d.mts +2 -0
- package/dist/core/SubagentContract.mjs +1 -0
- package/dist/core/Thread.d.mts +2 -0
- package/dist/core/Thread.mjs +1 -0
- package/dist/core/ToolResult.d.mts +2 -0
- package/dist/core/ToolResult.mjs +1 -0
- package/dist/core/ToolResultStorage.d.mts +2 -0
- package/dist/core/ToolResultStorage.mjs +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +3 -0
- package/dist/durable/ActivityStore.d.mts +2 -0
- package/dist/durable/ActivityStore.mjs +1 -0
- package/dist/durable/Admin.d.mts +2 -0
- package/dist/durable/Admin.mjs +1 -0
- package/dist/durable/AgentRegistration.d.mts +3 -0
- package/dist/durable/AgentRegistration.mjs +2 -0
- package/dist/durable/CommittedActivity.d.mts +2 -0
- package/dist/durable/CommittedActivity.mjs +1 -0
- package/dist/durable/Digest.d.mts +2 -0
- package/dist/durable/Digest.mjs +3 -0
- package/dist/durable/DurableAgentRuntime.d.mts +3 -0
- package/dist/durable/DurableAgentRuntime.mjs +4 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
- package/dist/durable/DurableFailpointTestControl.mjs +21 -0
- package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
- package/dist/durable/EventSource.d.mts +2 -0
- package/dist/durable/EventSource.mjs +1 -0
- package/dist/durable/LifecyclePublication.d.mts +2 -0
- package/dist/durable/LifecyclePublication.mjs +1 -0
- package/dist/durable/MessageDelivery.d.mts +2 -0
- package/dist/durable/MessageDelivery.mjs +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +401 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +273 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
- package/dist/durable/OperationAuthorizer.d.mts +2 -0
- package/dist/durable/OperationAuthorizer.mjs +1 -0
- package/dist/durable/PersistentHistory.d.mts +2 -0
- package/dist/durable/PersistentHistory.mjs +1 -0
- package/dist/durable/PreparedInputAdmission.d.mts +2 -0
- package/dist/durable/PreparedInputAdmission.mjs +1 -0
- package/dist/durable/RecordFormat.d.mts +2 -0
- package/dist/durable/RecordFormat.mjs +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +1 -0
- package/dist/durable/Recovery.d.mts +2 -0
- package/dist/durable/Recovery.mjs +1 -0
- package/dist/durable/RunContinuation.d.mts +4 -0
- package/dist/durable/RunContinuation.mjs +4 -0
- package/dist/durable/RunJournal.d.mts +2 -0
- package/dist/durable/RunJournal.mjs +1 -0
- package/dist/durable/RunStorage.d.mts +2 -0
- package/dist/durable/RunStorage.mjs +1 -0
- package/dist/durable/Schedule.d.mts +2 -0
- package/dist/durable/Schedule.mjs +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +16 -0
- package/dist/durable/ScheduleStoreConformance.mjs +421 -0
- package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
- package/dist/durable/ScheduleTransition.d.mts +2 -0
- package/dist/durable/ScheduleTransition.mjs +1 -0
- package/dist/durable/Scheduling.d.mts +2 -0
- package/dist/durable/Scheduling.mjs +1 -0
- package/dist/durable/SettlementPublisher.d.mts +2 -0
- package/dist/durable/SettlementPublisher.mjs +99 -0
- package/dist/durable/SettlementPublisher.mjs.map +1 -0
- package/dist/durable/SqlMemoryStore.d.mts +729 -0
- package/dist/durable/SqlMemoryStore.mjs +626 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageOwner.d.mts +18 -0
- package/dist/durable/SqlStorageOwner.mjs +6 -0
- package/dist/durable/SqlStorageOwner.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +3 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +31 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2090 -0
- package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
- package/dist/durable/SubmissionStatus.d.mts +2 -0
- package/dist/durable/SubmissionStatus.mjs +1 -0
- package/dist/durable/Subscription.d.mts +2 -0
- package/dist/durable/Subscription.mjs +1 -0
- package/dist/durable/SubscriptionInput.d.mts +2 -0
- package/dist/durable/SubscriptionInput.mjs +1 -0
- package/dist/durable/SubscriptionStoreConformance.d.mts +15 -0
- package/dist/durable/SubscriptionStoreConformance.mjs +816 -0
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
- package/dist/durable/SubscriptionTransition.d.mts +2 -0
- package/dist/durable/SubscriptionTransition.mjs +1 -0
- package/dist/durable/Subscriptions.d.mts +2 -0
- package/dist/durable/Subscriptions.mjs +1 -0
- package/dist/durable/ThreadArchiveRange.d.mts +2 -0
- package/dist/durable/ThreadArchiveRange.mjs +1 -0
- package/dist/durable/ThreadContextHistory.d.mts +2 -0
- package/dist/durable/ThreadContextHistory.mjs +1 -0
- package/dist/durable/ThreadContextHistoryProjection.d.mts +2 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs +1 -0
- package/dist/durable/ThreadImport.d.mts +2 -0
- package/dist/durable/ThreadImport.mjs +1 -0
- package/dist/durable/ThreadInvariants.d.mts +2 -0
- package/dist/durable/ThreadInvariants.mjs +1 -0
- package/dist/durable/ThreadProjectionMaintenance.d.mts +2 -0
- package/dist/durable/ThreadProjectionMaintenance.mjs +1 -0
- package/dist/durable/ThreadReader.d.mts +2 -0
- package/dist/durable/ThreadReader.mjs +1 -0
- package/dist/durable/ThreadStore.d.mts +3 -0
- package/dist/durable/ThreadStore.mjs +3 -0
- package/dist/durable/ThreadStoreConformance.d.mts +53 -0
- package/dist/durable/ThreadStoreConformance.mjs +402 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ThreadTransfer.d.mts +2 -0
- package/dist/durable/ThreadTransfer.mjs +1 -0
- package/dist/durable/ThreadWork.d.mts +2 -0
- package/dist/durable/ThreadWork.mjs +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +1 -0
- package/dist/durable/WakeScheduler.d.mts +2 -0
- package/dist/durable/WakeScheduler.mjs +1 -0
- package/dist/durable/WorkerAdmission.d.mts +2 -0
- package/dist/durable/WorkerAdmission.mjs +1 -0
- package/dist/durable/WorkerHost.d.mts +2 -0
- package/dist/durable/WorkerHost.mjs +1 -0
- package/dist/engine/AgentRuntime.d.mts +2 -0
- package/dist/engine/AgentRuntime.mjs +1 -0
- package/dist/engine/Compaction.d.mts +4 -0
- package/dist/engine/Compaction.mjs +2 -0
- package/dist/engine/ContextCompactor.d.mts +2 -0
- package/dist/engine/ContextCompactor.mjs +1 -0
- package/dist/engine/ContextHistory.d.mts +2 -0
- package/dist/engine/ContextHistory.mjs +1 -0
- package/dist/engine/ContextWindow.d.mts +2 -0
- package/dist/engine/ContextWindow.mjs +1 -0
- package/dist/engine/DurableStep.d.mts +2 -0
- package/dist/engine/DurableStep.mjs +3 -0
- package/dist/engine/MessagingHost.d.mts +2 -0
- package/dist/engine/MessagingHost.mjs +1 -0
- package/dist/engine/Output.d.mts +3 -0
- package/dist/engine/Output.mjs +2 -0
- package/dist/engine/RunEventSink.d.mts +2 -0
- package/dist/engine/RunEventSink.mjs +1 -0
- package/dist/engine/RunOptions.d.mts +2 -0
- package/dist/engine/RunOptions.mjs +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +1 -0
- package/dist/engine/ThreadHistory.d.mts +2 -0
- package/dist/engine/ThreadHistory.mjs +1 -0
- package/dist/engine/ToolBroker.d.mts +2 -0
- package/dist/engine/ToolBroker.mjs +1 -0
- package/dist/index.d.mts +90 -0
- package/dist/index.mjs +101 -0
- package/dist/output-contract-CYA4oBhe.mjs +128 -0
- package/dist/output-contract-CYA4oBhe.mjs.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/dist/run-context-reader-CHox63hg.d.mts +17 -0
- package/dist/sandbox/CodeExecutor.d.mts +2 -0
- package/dist/sandbox/CodeExecutor.mjs +1 -0
- package/dist/sandbox/InteractiveBrowser.d.mts +2 -0
- package/dist/sandbox/InteractiveBrowser.mjs +1 -0
- package/dist/sandbox/PageCapture.d.mts +2 -0
- package/dist/sandbox/PageCapture.mjs +1 -0
- package/dist/sandbox/PageScreenshot.d.mts +2 -0
- package/dist/sandbox/PageScreenshot.mjs +1 -0
- package/dist/sandbox/Sandbox.d.mts +2 -0
- package/dist/sandbox/Sandbox.mjs +1 -0
- package/dist/subagent-policy-xRJhrc0a.mjs +133 -0
- package/dist/subagent-policy-xRJhrc0a.mjs.map +1 -0
- package/dist/tool-execution-Cl7v8fXU.mjs +16 -0
- package/dist/tool-execution-Cl7v8fXU.mjs.map +1 -0
- package/dist/tool-operations-CauPonM8.mjs +84 -0
- package/dist/tool-operations-CauPonM8.mjs.map +1 -0
- package/dist/utf8-Bl0ZhhGe.mjs +27 -0
- package/dist/utf8-Bl0ZhhGe.mjs.map +1 -0
- package/package.json +489 -5
- package/src/InMemory.ts +79 -0
- package/src/ToolExposure.ts +2 -0
- package/src/capabilities/BrowserUse.ts +212 -0
- package/src/capabilities/Budget.ts +544 -0
- package/src/capabilities/CodeMode.ts +1129 -0
- package/src/capabilities/ContextTools.ts +131 -0
- package/src/capabilities/MemoryNotes.ts +177 -0
- package/src/capabilities/Messaging.ts +260 -0
- package/src/capabilities/Redaction.ts +163 -0
- package/src/capabilities/RunHooks.ts +116 -0
- package/src/capabilities/SemanticMemory.ts +402 -0
- package/src/capabilities/Subagent.ts +2343 -0
- package/src/capabilities/SubagentReservations.ts +807 -0
- package/src/capabilities/ToolDiscovery.ts +291 -0
- package/src/capabilities/ToolResults.ts +50 -0
- package/src/capabilities/WebCapture.ts +64 -0
- package/src/capabilities/WebSearch.ts +45 -0
- package/src/capabilities/internal/subagent-background.ts +1137 -0
- package/src/capabilities/internal/subagent-contract.ts +92 -0
- package/src/capabilities/internal/subagent-policy.ts +205 -0
- package/src/capabilities/internal/subagent-reporting.ts +152 -0
- package/src/core/Agent.ts +528 -0
- package/src/core/AgentError.ts +189 -0
- package/src/core/AgentPolicy.ts +194 -0
- package/src/core/AgentUpdates.ts +104 -0
- package/src/core/FailureDiagnostic.ts +392 -0
- package/src/core/IdGenerator.ts +42 -0
- package/src/core/Identifiers.ts +64 -0
- package/src/core/Memory.ts +283 -0
- package/src/core/MemoryNamespace.ts +202 -0
- package/src/core/MemoryReference.ts +120 -0
- package/src/core/MemoryRevalidation.ts +151 -0
- package/src/core/MemoryStore.ts +371 -0
- package/src/core/Messaging.ts +72 -0
- package/src/core/ProvisionalText.ts +53 -0
- package/src/core/Receipt.ts +42 -0
- package/src/core/RememberingStore.ts +22 -0
- package/src/core/RunEvent.ts +345 -0
- package/src/core/RunPolicyUsage.ts +19 -0
- package/src/core/SemanticMemoryIndex.ts +259 -0
- package/src/core/SemanticMemoryRevalidation.ts +220 -0
- package/src/core/SubagentContract.ts +263 -0
- package/src/core/Thread.ts +447 -0
- package/src/core/ToolExposure.ts +75 -0
- package/src/core/ToolResult.ts +204 -0
- package/src/core/ToolResultStorage.ts +56 -0
- package/src/core/Usage.ts +562 -0
- package/src/core/Worker.ts +236 -0
- package/src/core/internal/agent-updates.ts +42 -0
- package/src/core/internal/completion.ts +33 -0
- package/src/core/internal/json.ts +17 -0
- package/src/core/internal/memory-document.ts +39 -0
- package/src/core/internal/message-status.ts +60 -0
- package/src/core/internal/strict-schema.ts +14 -0
- package/src/core/internal/tool-execution.ts +33 -0
- package/src/core/internal/utf8.ts +32 -0
- package/src/durable/ActivityStore.ts +131 -0
- package/src/durable/Admin.ts +504 -0
- package/src/durable/AgentRegistration.ts +16 -0
- package/src/durable/CommittedActivity.ts +262 -0
- package/src/durable/Digest.ts +57 -0
- package/src/durable/DurableAgentRuntime.ts +12758 -0
- package/src/durable/DurableFailpoint.ts +108 -0
- package/src/durable/DurableFailpointTestControl.ts +39 -0
- package/src/durable/EventSource.ts +179 -0
- package/src/durable/LifecyclePublication.ts +343 -0
- package/src/durable/MessageDelivery.ts +949 -0
- package/src/durable/MessageDeliveryStoreConformance.ts +407 -0
- package/src/durable/OperationAuthorizer.ts +89 -0
- package/src/durable/PersistentHistory.ts +322 -0
- package/src/durable/PreparedInputAdmission.ts +128 -0
- package/src/durable/RecordFormat.ts +113 -0
- package/src/durable/Records.ts +1396 -0
- package/src/durable/Recovery.ts +1022 -0
- package/src/durable/RunContinuation.ts +1946 -0
- package/src/durable/RunJournal.ts +1926 -0
- package/src/durable/RunStorage.ts +533 -0
- package/src/durable/Schedule.ts +445 -0
- package/src/durable/ScheduleStoreConformance.ts +642 -0
- package/src/durable/ScheduleTransition.ts +267 -0
- package/src/durable/Scheduling.ts +1031 -0
- package/src/durable/SettlementPublisher.ts +172 -0
- package/src/durable/SqlMemoryStore.ts +1042 -0
- package/src/durable/SqlStorageOwner.ts +25 -0
- package/src/durable/SubmissionLedger.ts +1247 -0
- package/src/durable/SubmissionLedgerConformance.ts +4695 -0
- package/src/durable/SubmissionStatus.ts +14 -0
- package/src/durable/Subscription.ts +527 -0
- package/src/durable/SubscriptionInput.ts +145 -0
- package/src/durable/SubscriptionStoreConformance.ts +1275 -0
- package/src/durable/SubscriptionTransition.ts +330 -0
- package/src/durable/Subscriptions.ts +1245 -0
- package/src/durable/ThreadArchiveRange.ts +91 -0
- package/src/durable/ThreadContextHistory.ts +338 -0
- package/src/durable/ThreadContextHistoryProjection.ts +219 -0
- package/src/durable/ThreadImport.ts +1199 -0
- package/src/durable/ThreadInvariants.ts +312 -0
- package/src/durable/ThreadProjectionMaintenance.ts +72 -0
- package/src/durable/ThreadReader.ts +21 -0
- package/src/durable/ThreadStore.ts +1258 -0
- package/src/durable/ThreadStoreConformance.ts +877 -0
- package/src/durable/ThreadTransfer.ts +263 -0
- package/src/durable/ThreadWork.ts +713 -0
- package/src/durable/ToolReconciler.ts +112 -0
- package/src/durable/WakeScheduler.ts +125 -0
- package/src/durable/WorkerAdmission.ts +98 -0
- package/src/durable/WorkerHost.ts +204 -0
- package/src/durable/internal/StorageOwner.ts +181 -0
- package/src/durable/internal/agent-registration.ts +713 -0
- package/src/durable/internal/agent-updates.ts +338 -0
- package/src/durable/internal/canonical-json.ts +110 -0
- package/src/durable/internal/evidence.ts +29 -0
- package/src/durable/internal/foreign-diagnostic.ts +48 -0
- package/src/durable/internal/history-prompt.ts +87 -0
- package/src/durable/internal/initial-context.ts +215 -0
- package/src/durable/internal/journal-metadata.ts +188 -0
- package/src/durable/internal/message-status.ts +18 -0
- package/src/durable/internal/messaging-host.ts +615 -0
- package/src/durable/internal/prompt-footprint.ts +47 -0
- package/src/durable/internal/prompt-history-cache.ts +604 -0
- package/src/durable/internal/record-encoding.ts +258 -0
- package/src/durable/internal/record-ownership.ts +68 -0
- package/src/durable/internal/run-context-reader.ts +51 -0
- package/src/durable/internal/run-context.ts +211 -0
- package/src/durable/internal/schedule-time.ts +304 -0
- package/src/durable/internal/thread-import-reader.ts +85 -0
- package/src/durable/internal/thread-initialization.ts +181 -0
- package/src/durable/internal/thread-transfer-source.ts +7 -0
- package/src/durable/internal/tool-operations.ts +138 -0
- package/src/durable/internal/transfer-dependencies.ts +40 -0
- package/src/durable/internal/usage-totals.ts +36 -0
- package/src/durable/internal/worker-host.ts +4041 -0
- package/src/durable/internal/worker-runtime.ts +10 -0
- package/src/engine/AgentRuntime.ts +100 -0
- package/src/engine/Compaction.ts +11 -0
- package/src/engine/ContextCompactor.ts +302 -0
- package/src/engine/ContextHistory.ts +75 -0
- package/src/engine/ContextWindow.ts +81 -0
- package/src/engine/DurableStep.ts +115 -0
- package/src/engine/MessagingHost.ts +118 -0
- package/src/engine/Output.ts +2 -0
- package/src/engine/RunEventSink.ts +124 -0
- package/src/engine/RunOptions.ts +664 -0
- package/src/engine/SubagentHost.ts +231 -0
- package/src/engine/ThreadHistory.ts +125 -0
- package/src/engine/ToolBroker.ts +159 -0
- package/src/engine/ToolExposure.ts +49 -0
- package/src/engine/internal/agent-runtime.ts +11137 -0
- package/src/engine/internal/bounded-value.ts +312 -0
- package/src/engine/internal/compaction.ts +673 -0
- package/src/engine/internal/error-diagnostic.ts +39 -0
- package/src/engine/internal/image-tokens.ts +61 -0
- package/src/engine/internal/interpreter-options.ts +569 -0
- package/src/engine/internal/output-contract.ts +226 -0
- package/src/engine/internal/primitive-delta.ts +103 -0
- package/src/engine/internal/provider-result-staging.ts +211 -0
- package/src/engine/internal/provisional-text.ts +107 -0
- package/src/engine/internal/tool-derivative.ts +47 -0
- package/src/engine/internal/tool-exposure.ts +228 -0
- package/src/engine/internal/tool-telemetry.ts +488 -0
- package/src/index.ts +100 -0
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +343 -0
- package/src/sandbox/PageCapture.ts +391 -0
- package/src/sandbox/PageScreenshot.ts +83 -0
- package/src/sandbox/Sandbox.ts +29 -0
- package/README.md +0 -3
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
import * as Clock from "effect/Clock";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Result from "effect/Result";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as TestClock from "effect/testing/TestClock";
|
|
6
|
+
import { l as SubmissionId, o as ReceiptId, t as AgentId, u as ThreadId } from "../Identifiers-LWd4837I.mjs";
|
|
7
|
+
import { a as Receipt, i as QueueSequence, r as Principal, t as IdempotencyKey } from "../Receipt-B-FlCaNH.mjs";
|
|
8
|
+
import { b as Digest, v as DefinitionDigests } from "../Records-C645aQks.mjs";
|
|
9
|
+
import { E as SubscriptionStore, O as defaultSubscriptionLimits } from "../Subscription-BhQbmUD-.mjs";
|
|
10
|
+
// src/durable/SubscriptionStoreConformance.ts
|
|
11
|
+
var SubscriptionStoreConformanceViolation = class extends Schema.TaggedError()("SubscriptionStoreConformanceViolation", {
|
|
12
|
+
caseName: Schema.String,
|
|
13
|
+
message: Schema.String
|
|
14
|
+
}) {};
|
|
15
|
+
const subscriptionConformancePartition = {
|
|
16
|
+
tenantId: "subscription-conformance",
|
|
17
|
+
address: "source-address"
|
|
18
|
+
};
|
|
19
|
+
const principal = Schema.decodeSync(Principal)("subscription-conformance-principal");
|
|
20
|
+
const agentId = Schema.decodeSync(AgentId)("subscription-conformance-agent");
|
|
21
|
+
const threadId = Schema.decodeSync(ThreadId)("subscription-conformance-thread");
|
|
22
|
+
const digest = (character) => Schema.decodeSync(Digest)(character.repeat(64));
|
|
23
|
+
const definitions = DefinitionDigests.make({
|
|
24
|
+
agent: digest("a"),
|
|
25
|
+
model: digest("b"),
|
|
26
|
+
tools: digest("c")
|
|
27
|
+
});
|
|
28
|
+
const record = (name, mode = "once", ownerId = "owner") => ({
|
|
29
|
+
schemaVersion: 1,
|
|
30
|
+
key: {
|
|
31
|
+
partition: subscriptionConformancePartition,
|
|
32
|
+
ownerId,
|
|
33
|
+
subscriptionId: name
|
|
34
|
+
},
|
|
35
|
+
creationFingerprint: digest(name.charCodeAt(0) % 2 === 0 ? "d" : "e"),
|
|
36
|
+
createdBy: principal,
|
|
37
|
+
createdAtMillis: 1,
|
|
38
|
+
ordinal: 0,
|
|
39
|
+
configurationRevision: 1,
|
|
40
|
+
configurationFingerprint: digest(name.charCodeAt(0) % 2 === 0 ? "d" : "e"),
|
|
41
|
+
creationConfiguration: {
|
|
42
|
+
source: {
|
|
43
|
+
name: "trusted",
|
|
44
|
+
version: "1"
|
|
45
|
+
},
|
|
46
|
+
matchingKey: "match",
|
|
47
|
+
parameters: { name },
|
|
48
|
+
context: { name },
|
|
49
|
+
mode,
|
|
50
|
+
expiresAtMillis: 1e5,
|
|
51
|
+
destination: {
|
|
52
|
+
_tag: "ExistingThread",
|
|
53
|
+
threadId
|
|
54
|
+
},
|
|
55
|
+
deliveryPrincipal: principal,
|
|
56
|
+
agentId,
|
|
57
|
+
definitions
|
|
58
|
+
},
|
|
59
|
+
configuration: {
|
|
60
|
+
source: {
|
|
61
|
+
name: "trusted",
|
|
62
|
+
version: "1"
|
|
63
|
+
},
|
|
64
|
+
matchingKey: "match",
|
|
65
|
+
parameters: { name },
|
|
66
|
+
context: { name },
|
|
67
|
+
mode,
|
|
68
|
+
expiresAtMillis: 1e5,
|
|
69
|
+
destination: {
|
|
70
|
+
_tag: "ExistingThread",
|
|
71
|
+
threadId
|
|
72
|
+
},
|
|
73
|
+
deliveryPrincipal: principal,
|
|
74
|
+
agentId,
|
|
75
|
+
definitions
|
|
76
|
+
},
|
|
77
|
+
state: "active",
|
|
78
|
+
recovery: null
|
|
79
|
+
});
|
|
80
|
+
const event = (name, payloadDigest = digest("f")) => ({
|
|
81
|
+
schemaVersion: 1,
|
|
82
|
+
partition: subscriptionConformancePartition,
|
|
83
|
+
eventId: name,
|
|
84
|
+
source: {
|
|
85
|
+
name: "trusted",
|
|
86
|
+
version: "1"
|
|
87
|
+
},
|
|
88
|
+
matchingKey: "match",
|
|
89
|
+
payload: { name },
|
|
90
|
+
payloadDigest,
|
|
91
|
+
acceptedAtMillis: 10,
|
|
92
|
+
cutoff: 0,
|
|
93
|
+
cursor: 0,
|
|
94
|
+
routingComplete: false,
|
|
95
|
+
routingFailure: null,
|
|
96
|
+
nextAttemptAtMillis: 10
|
|
97
|
+
});
|
|
98
|
+
const delivery = (subscription, accepted, suffix = "0") => {
|
|
99
|
+
const deliveryId = digest(suffix === "0" ? "1" : "2");
|
|
100
|
+
return {
|
|
101
|
+
schemaVersion: 1,
|
|
102
|
+
key: {
|
|
103
|
+
subscription: subscription.key,
|
|
104
|
+
eventId: accepted.eventId
|
|
105
|
+
},
|
|
106
|
+
deliveryId,
|
|
107
|
+
source: accepted.source,
|
|
108
|
+
subscriptionFingerprint: subscription.configurationFingerprint,
|
|
109
|
+
configurationRevision: subscription.configurationRevision,
|
|
110
|
+
configuration: subscription.configuration,
|
|
111
|
+
eventDigest: accepted.payloadDigest,
|
|
112
|
+
threadId,
|
|
113
|
+
admissionKey: Schema.decodeSync(IdempotencyKey)(`subscription:${deliveryId}`),
|
|
114
|
+
selectedAtMillis: suffix === "0" ? 20 : 21,
|
|
115
|
+
state: "selected",
|
|
116
|
+
envelope: null,
|
|
117
|
+
envelopeDigest: null,
|
|
118
|
+
retry: {
|
|
119
|
+
generation: 0,
|
|
120
|
+
attempts: 0,
|
|
121
|
+
automaticAttempts: 0,
|
|
122
|
+
parked: false,
|
|
123
|
+
nextAttemptAtMillis: 20,
|
|
124
|
+
lastAttemptAtMillis: null,
|
|
125
|
+
lastFailure: null
|
|
126
|
+
},
|
|
127
|
+
receipt: null,
|
|
128
|
+
refusal: null
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
const preparedInput = (selected) => ({
|
|
132
|
+
schemaVersion: 1,
|
|
133
|
+
threadId: selected.threadId,
|
|
134
|
+
deliveryPrincipal: principal,
|
|
135
|
+
agentId,
|
|
136
|
+
definitions,
|
|
137
|
+
input: { event: selected.key.eventId },
|
|
138
|
+
inputDigest: digest("3"),
|
|
139
|
+
admissionKey: selected.admissionKey,
|
|
140
|
+
authorization: {
|
|
141
|
+
policyId: "policy",
|
|
142
|
+
decisionId: "decision"
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const receipt = Receipt.make({
|
|
146
|
+
receiptId: Schema.decodeSync(ReceiptId)("subscription-conformance-receipt"),
|
|
147
|
+
submissionId: Schema.decodeSync(SubmissionId)("subscription-conformance-submission"),
|
|
148
|
+
threadId,
|
|
149
|
+
queueSequence: Schema.decodeSync(QueueSequence)(1)
|
|
150
|
+
});
|
|
151
|
+
const conformanceCase = (name, body) => ({
|
|
152
|
+
name,
|
|
153
|
+
run: body((condition, message) => condition ? Effect.void : Effect.fail(SubscriptionStoreConformanceViolation.make({
|
|
154
|
+
caseName: name,
|
|
155
|
+
message
|
|
156
|
+
})))
|
|
157
|
+
});
|
|
158
|
+
const historicalOccurrenceReplay = conformanceCase("preserves unknown occurrence time on replay and fences known times", (ensure) => Effect.gen(function* () {
|
|
159
|
+
const store = yield* SubscriptionStore;
|
|
160
|
+
const original = yield* store.accept(event("legacy-occurrence"), defaultSubscriptionLimits);
|
|
161
|
+
const replay = yield* store.accept({
|
|
162
|
+
...original,
|
|
163
|
+
occurredAtMillis: 1
|
|
164
|
+
}, defaultSubscriptionLimits);
|
|
165
|
+
yield* ensure(replay.occurredAtMillis === void 0 && replay.acceptedAtMillis === original.acceptedAtMillis && replay.cutoff === original.cutoff, "replay invented historical occurrence or moved acceptance");
|
|
166
|
+
const known = yield* store.accept({
|
|
167
|
+
...event("known-occurrence"),
|
|
168
|
+
occurredAtMillis: 1
|
|
169
|
+
}, defaultSubscriptionLimits);
|
|
170
|
+
const changed = yield* store.accept({
|
|
171
|
+
...known,
|
|
172
|
+
occurredAtMillis: 2
|
|
173
|
+
}, defaultSubscriptionLimits).pipe(Effect.result);
|
|
174
|
+
yield* ensure(Result.isFailure(changed), "known occurrence time changed on replay");
|
|
175
|
+
const omitted = yield* store.accept(event("known-occurrence"), defaultSubscriptionLimits).pipe(Effect.result);
|
|
176
|
+
yield* ensure(Result.isFailure(omitted), "known occurrence time was erased on replay");
|
|
177
|
+
}));
|
|
178
|
+
const cutoffAndIntake = conformanceCase("orders eligibility cutoffs and preserves duplicate intake", (ensure) => Effect.gen(function* () {
|
|
179
|
+
const store = yield* SubscriptionStore;
|
|
180
|
+
const before = yield* store.register(record("before"), defaultSubscriptionLimits);
|
|
181
|
+
const accepted = yield* store.accept(event("cutoff"), defaultSubscriptionLimits);
|
|
182
|
+
const after = yield* store.register(record("after"), defaultSubscriptionLimits);
|
|
183
|
+
yield* ensure(before.ordinal < accepted.cutoff && after.ordinal > accepted.cutoff, "sequence did not order registration and intake");
|
|
184
|
+
const candidates = yield* store.candidates(accepted, 10);
|
|
185
|
+
yield* ensure(candidates.length === 1 && candidates[0].key.subscriptionId === "before", "cutoff admitted a later registration");
|
|
186
|
+
const replayed = yield* store.accept({
|
|
187
|
+
...event("cutoff"),
|
|
188
|
+
acceptedAtMillis: 99
|
|
189
|
+
}, defaultSubscriptionLimits);
|
|
190
|
+
yield* ensure(replayed.cutoff === accepted.cutoff && replayed.acceptedAtMillis === accepted.acceptedAtMillis, "duplicate intake did not return retained progress");
|
|
191
|
+
const conflict = yield* Effect.result(store.accept(event("cutoff", digest("9")), defaultSubscriptionLimits));
|
|
192
|
+
yield* ensure(Result.isFailure(conflict) && conflict.failure._tag === "SubscriptionError" && conflict.failure.reason === "conflict", "conflicting event identity was accepted");
|
|
193
|
+
}));
|
|
194
|
+
const onceAndCapacity = conformanceCase("consumes once atomically and rejects capacity before progress", (ensure) => Effect.gen(function* () {
|
|
195
|
+
const store = yield* SubscriptionStore;
|
|
196
|
+
const once = yield* store.register(record("once"), defaultSubscriptionLimits);
|
|
197
|
+
const first = yield* store.accept(event("first"), defaultSubscriptionLimits);
|
|
198
|
+
const second = yield* store.accept(event("second"), defaultSubscriptionLimits);
|
|
199
|
+
const duplicate = yield* store.select(first, [delivery(once, first), delivery(once, first)], once.ordinal, true, 20, defaultSubscriptionLimits).pipe(Effect.result);
|
|
200
|
+
yield* ensure(Result.isFailure(duplicate) && duplicate.failure._tag === "SubscriptionError" && duplicate.failure.reason === "validation", "duplicate batch keys must not charge capacity twice for one retained delivery");
|
|
201
|
+
yield* ensure((yield* store.get(once.key))?.state === "active" && (yield* store.event(first.eventId))?.cursor === 0, "duplicate batch rejection consumed once or advanced routing");
|
|
202
|
+
yield* store.select(first, [delivery(once, first)], once.ordinal, true, 20, defaultSubscriptionLimits);
|
|
203
|
+
yield* store.select(second, [delivery(once, second)], once.ordinal, true, 20, defaultSubscriptionLimits);
|
|
204
|
+
yield* ensure((yield* store.get(once.key))?.state === "consumed", "once registration remained active");
|
|
205
|
+
yield* ensure((yield* store.delivery({
|
|
206
|
+
subscription: once.key,
|
|
207
|
+
eventId: first.eventId
|
|
208
|
+
})) !== null, "winning delivery was lost");
|
|
209
|
+
yield* ensure((yield* store.delivery({
|
|
210
|
+
subscription: once.key,
|
|
211
|
+
eventId: second.eventId
|
|
212
|
+
})) === null, "second event consumed once registration again");
|
|
213
|
+
const left = yield* store.register(record("left", "continuous", "capacity"), defaultSubscriptionLimits);
|
|
214
|
+
const right = yield* store.register(record("right", "continuous", "capacity"), defaultSubscriptionLimits);
|
|
215
|
+
const bounded = yield* store.accept(event("bounded"), defaultSubscriptionLimits);
|
|
216
|
+
const limits = {
|
|
217
|
+
...defaultSubscriptionLimits,
|
|
218
|
+
maxDeliveries: 2,
|
|
219
|
+
maxDeliveriesPerOwner: 1
|
|
220
|
+
};
|
|
221
|
+
const failure = yield* Effect.result(store.select(bounded, [delivery(left, bounded), delivery(right, bounded, "1")], right.ordinal, true, 20, limits));
|
|
222
|
+
yield* ensure(Result.isFailure(failure) && failure.failure._tag === "SubscriptionError" && failure.failure.reason === "capacity", "delivery quota did not reject batch");
|
|
223
|
+
yield* ensure((yield* store.event(bounded.eventId))?.cursor === 0, "capacity failure advanced event cursor");
|
|
224
|
+
}));
|
|
225
|
+
const preparationLifecycle = conformanceCase("refuses cancelled selection and preserves prepared work", (ensure) => Effect.gen(function* () {
|
|
226
|
+
const store = yield* SubscriptionStore;
|
|
227
|
+
const cancelled = yield* store.register(record("cancelled"), defaultSubscriptionLimits);
|
|
228
|
+
const cancelledEvent = yield* store.accept(event("cancelled-event"), defaultSubscriptionLimits);
|
|
229
|
+
const cancelledDelivery = delivery(cancelled, cancelledEvent);
|
|
230
|
+
yield* store.select(cancelledEvent, [cancelledDelivery], cancelled.ordinal, true, 20, defaultSubscriptionLimits);
|
|
231
|
+
yield* store.cancel(cancelled.key);
|
|
232
|
+
const refused = yield* store.changeDelivery(cancelledDelivery.key, cancelledDelivery.deliveryId, {
|
|
233
|
+
_tag: "Prepare",
|
|
234
|
+
envelope: preparedInput(cancelledDelivery),
|
|
235
|
+
envelopeDigest: digest("4"),
|
|
236
|
+
nowMillis: 30
|
|
237
|
+
});
|
|
238
|
+
yield* ensure(refused.state === "refused" && refused.refusal?.code === "cancelled", "cancelled selection prepared");
|
|
239
|
+
const durable = yield* store.register(record("durable"), defaultSubscriptionLimits);
|
|
240
|
+
const durableEvent = yield* store.accept(event("durable-event"), defaultSubscriptionLimits);
|
|
241
|
+
const selected = delivery(durable, durableEvent);
|
|
242
|
+
yield* store.select(durableEvent, [selected], durable.ordinal, true, 20, defaultSubscriptionLimits);
|
|
243
|
+
const prepared = yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
244
|
+
_tag: "Prepare",
|
|
245
|
+
envelope: preparedInput(selected),
|
|
246
|
+
envelopeDigest: digest("5"),
|
|
247
|
+
nowMillis: 30
|
|
248
|
+
});
|
|
249
|
+
const retry = {
|
|
250
|
+
generation: 0,
|
|
251
|
+
automaticAttempts: 0,
|
|
252
|
+
parked: false,
|
|
253
|
+
attempts: 2,
|
|
254
|
+
nextAttemptAtMillis: 60,
|
|
255
|
+
lastAttemptAtMillis: 35,
|
|
256
|
+
lastFailure: "transport"
|
|
257
|
+
};
|
|
258
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
259
|
+
_tag: "Retry",
|
|
260
|
+
retry,
|
|
261
|
+
nowMillis: 35
|
|
262
|
+
});
|
|
263
|
+
for (const staleRetry of [
|
|
264
|
+
{
|
|
265
|
+
...retry,
|
|
266
|
+
attempts: 1,
|
|
267
|
+
nextAttemptAtMillis: 70
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
...retry,
|
|
271
|
+
nextAttemptAtMillis: 70
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
...retry,
|
|
275
|
+
attempts: 3,
|
|
276
|
+
nextAttemptAtMillis: 50
|
|
277
|
+
}
|
|
278
|
+
]) {
|
|
279
|
+
const retained = yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
280
|
+
_tag: "Retry",
|
|
281
|
+
retry: staleRetry,
|
|
282
|
+
nowMillis: 36
|
|
283
|
+
});
|
|
284
|
+
yield* ensure(retained.retry.attempts === 2 && retained.retry.nextAttemptAtMillis === 60, "stale retry overwrote newer retry state");
|
|
285
|
+
}
|
|
286
|
+
yield* store.cancel(durable.key);
|
|
287
|
+
const completed = yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
288
|
+
_tag: "Complete",
|
|
289
|
+
receipt,
|
|
290
|
+
nowMillis: 40
|
|
291
|
+
});
|
|
292
|
+
yield* ensure(prepared.state === "prepared" && completed.state === "delivered", "prepared work did not survive cancellation");
|
|
293
|
+
const stale = yield* Effect.result(store.changeDelivery(selected.key, digest("8"), {
|
|
294
|
+
_tag: "Complete",
|
|
295
|
+
receipt,
|
|
296
|
+
nowMillis: 41
|
|
297
|
+
}));
|
|
298
|
+
yield* ensure(Result.isFailure(stale) && stale.failure._tag === "SubscriptionError" && stale.failure.code === "stale-delivery", "stale outcome was not fenced");
|
|
299
|
+
}));
|
|
300
|
+
const catchUpAndCursors = conformanceCase("limits catch-up to one watch and persists recovery cursors", (ensure) => Effect.gen(function* () {
|
|
301
|
+
const store = yield* SubscriptionStore;
|
|
302
|
+
const accepted = yield* store.accept(event("observed"), defaultSubscriptionLimits);
|
|
303
|
+
const watch = yield* store.register(record("watch"), defaultSubscriptionLimits);
|
|
304
|
+
const selected = delivery(watch, accepted);
|
|
305
|
+
yield* store.catchUp(accepted, selected, 20, defaultSubscriptionLimits);
|
|
306
|
+
yield* store.catchUp(accepted, {
|
|
307
|
+
...selected,
|
|
308
|
+
selectedAtMillis: 999,
|
|
309
|
+
retry: {
|
|
310
|
+
...selected.retry,
|
|
311
|
+
attempts: 2
|
|
312
|
+
}
|
|
313
|
+
}, 30, defaultSubscriptionLimits);
|
|
314
|
+
yield* ensure((yield* store.get(watch.key))?.state === "consumed", "catch-up did not consume watch");
|
|
315
|
+
yield* store.advanceScanCursors({
|
|
316
|
+
events: "e",
|
|
317
|
+
deliveries: "d",
|
|
318
|
+
recovery: 7
|
|
319
|
+
});
|
|
320
|
+
const cursors = yield* store.readScanCursors;
|
|
321
|
+
yield* ensure(cursors.events === "e" && cursors.deliveries === "d" && cursors.recovery === 7, "scan cursors were not durable");
|
|
322
|
+
yield* ensure((yield* store.nextDeadline) === 0, "nonzero scan cursor did not keep recovery armed");
|
|
323
|
+
}));
|
|
324
|
+
const replayUnderTighterLimits = conformanceCase("preserves retained identities when limits tighten", (ensure) => Effect.gen(function* () {
|
|
325
|
+
const store = yield* SubscriptionStore;
|
|
326
|
+
const created = yield* store.register(record("retained"), defaultSubscriptionLimits);
|
|
327
|
+
const accepted = yield* store.accept(event("retained"), defaultSubscriptionLimits);
|
|
328
|
+
const limits = {
|
|
329
|
+
...defaultSubscriptionLimits,
|
|
330
|
+
maxRegistrations: 1,
|
|
331
|
+
maxEvents: 1,
|
|
332
|
+
maxPayloadBytes: 1,
|
|
333
|
+
maxContextBytes: 1,
|
|
334
|
+
maxLifetimeMillis: 1
|
|
335
|
+
};
|
|
336
|
+
const replayed = yield* store.register(record("retained"), limits);
|
|
337
|
+
const repeated = yield* store.accept(event("retained"), limits);
|
|
338
|
+
yield* ensure(replayed.ordinal === created.ordinal, "registration replay lost identity");
|
|
339
|
+
yield* ensure(repeated.cutoff === accepted.cutoff, "intake replay lost cutoff");
|
|
340
|
+
const newRegistration = yield* Effect.result(store.register(record("new"), limits));
|
|
341
|
+
const newEvent = yield* Effect.result(store.accept(event("new"), limits));
|
|
342
|
+
yield* ensure(Result.isFailure(newRegistration), "new registration ignored tightened limits");
|
|
343
|
+
yield* ensure(Result.isFailure(newEvent), "new intake ignored tightened limits");
|
|
344
|
+
}));
|
|
345
|
+
const revisionsAndRetention = conformanceCase("preserves historical selection, CAS revisions, and unsettled evidence during retention", (ensure) => Effect.gen(function* () {
|
|
346
|
+
const store = yield* SubscriptionStore;
|
|
347
|
+
const now = yield* Clock.currentTimeMillis;
|
|
348
|
+
const policy = {
|
|
349
|
+
replayHorizonMillis: 1e4,
|
|
350
|
+
completedRetentionMillis: 0,
|
|
351
|
+
maxTombstones: 8
|
|
352
|
+
};
|
|
353
|
+
const limits = {
|
|
354
|
+
...defaultSubscriptionLimits,
|
|
355
|
+
retention: policy
|
|
356
|
+
};
|
|
357
|
+
const indefinite = record("revision", "continuous");
|
|
358
|
+
const original = yield* store.register({
|
|
359
|
+
...indefinite,
|
|
360
|
+
configuration: {
|
|
361
|
+
...indefinite.configuration,
|
|
362
|
+
expiresAtMillis: null
|
|
363
|
+
}
|
|
364
|
+
}, limits);
|
|
365
|
+
yield* ensure(original.configuration.expiresAtMillis === null, "UntilCancelled must remain explicit");
|
|
366
|
+
yield* ensure((yield* store.nextDeadline) === null, "UntilCancelled cannot create an expiry wake");
|
|
367
|
+
const accepted = yield* store.accept({
|
|
368
|
+
...event("retained"),
|
|
369
|
+
occurredAtMillis: now,
|
|
370
|
+
acceptedAtMillis: now
|
|
371
|
+
}, limits);
|
|
372
|
+
const selected = {
|
|
373
|
+
...delivery(original, accepted),
|
|
374
|
+
configuration: original.configuration,
|
|
375
|
+
configurationRevision: 1
|
|
376
|
+
};
|
|
377
|
+
yield* store.select(accepted, [selected], original.ordinal, true, now + limits.maxLifetimeMillis + 1, limits);
|
|
378
|
+
yield* ensure((yield* store.delivery(selected.key)) !== null, "UntilCancelled cannot expire at the ordinary maximum lifetime");
|
|
379
|
+
const updated = yield* store.change(original.key, 1, {
|
|
380
|
+
_tag: "Update",
|
|
381
|
+
configuration: {
|
|
382
|
+
...original.configuration,
|
|
383
|
+
context: { edited: true }
|
|
384
|
+
},
|
|
385
|
+
configurationFingerprint: digest("9"),
|
|
386
|
+
recovery: null
|
|
387
|
+
});
|
|
388
|
+
yield* ensure(updated.configurationRevision === 2 && updated.creationConfiguration !== void 0, "Update must preserve creation evidence and advance revision");
|
|
389
|
+
const stale = yield* store.change(original.key, 1, { _tag: "Pause" }).pipe(Effect.result);
|
|
390
|
+
yield* ensure(Result.isFailure(stale), "Stale management must conflict");
|
|
391
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
392
|
+
_tag: "Prepare",
|
|
393
|
+
envelope: preparedInput(selected),
|
|
394
|
+
envelopeDigest: digest("4"),
|
|
395
|
+
nowMillis: now
|
|
396
|
+
});
|
|
397
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
398
|
+
_tag: "Complete",
|
|
399
|
+
receipt,
|
|
400
|
+
nowMillis: now
|
|
401
|
+
});
|
|
402
|
+
yield* store.compact(now, policy, 8);
|
|
403
|
+
yield* ensure((yield* store.delivery(selected.key)) !== null, "Admission is not settlement; delivery evidence must remain");
|
|
404
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
405
|
+
_tag: "ObserveSettlement",
|
|
406
|
+
receipt,
|
|
407
|
+
settled: true,
|
|
408
|
+
nowMillis: now,
|
|
409
|
+
nextAttemptAtMillis: now
|
|
410
|
+
});
|
|
411
|
+
const recovering = yield* store.register(record("recovering-retention", "once"), limits);
|
|
412
|
+
yield* store.deferRecovery(recovering.key, recovering.configurationRevision, {
|
|
413
|
+
attempts: 1,
|
|
414
|
+
nextAttemptAtMillis: null,
|
|
415
|
+
lastFailure: "source-unavailable"
|
|
416
|
+
});
|
|
417
|
+
yield* store.compact(now, policy, 8);
|
|
418
|
+
yield* ensure((yield* store.delivery(selected.key)) !== null, "Permanent recovery evidence must protect retained source facts");
|
|
419
|
+
yield* store.deferRecovery(recovering.key, recovering.configurationRevision, null);
|
|
420
|
+
yield* store.compact(now, policy, 8);
|
|
421
|
+
yield* ensure((yield* store.delivery(selected.key)) === null, "Settled delivery must release retained capacity");
|
|
422
|
+
yield* ensure((yield* store.event(accepted.eventId))?.tombstone === true, "Deduplication tombstone must outlive completed payload");
|
|
423
|
+
const replay = yield* store.accept(accepted, limits);
|
|
424
|
+
yield* ensure(Result.isFailure(yield* store.accept({
|
|
425
|
+
...accepted,
|
|
426
|
+
occurredAtMillis: now + 1
|
|
427
|
+
}, limits).pipe(Effect.result)), "An event identity cannot replace its retained source timestamp");
|
|
428
|
+
yield* ensure(Result.isFailure(yield* store.compact(now, {
|
|
429
|
+
...policy,
|
|
430
|
+
replayHorizonMillis: 1
|
|
431
|
+
}, 8).pipe(Effect.result)), "Compaction cannot change the persisted replay horizon");
|
|
432
|
+
yield* ensure(Result.isFailure(yield* store.accept(event("without-policy"), defaultSubscriptionLimits).pipe(Effect.result)), "Fresh intake cannot disable established retention");
|
|
433
|
+
yield* ensure(replay.cutoff === accepted.cutoff && replay.tombstone === true, "Duplicate intake cannot reopen routing after compaction");
|
|
434
|
+
}));
|
|
435
|
+
const sustainedRetention = conformanceCase("reuses event, delivery and tombstone quotas across replay horizons", (ensure) => Effect.gen(function* () {
|
|
436
|
+
const store = yield* SubscriptionStore;
|
|
437
|
+
const policy = {
|
|
438
|
+
replayHorizonMillis: 100,
|
|
439
|
+
completedRetentionMillis: 0,
|
|
440
|
+
maxTombstones: 8
|
|
441
|
+
};
|
|
442
|
+
const limits = {
|
|
443
|
+
...defaultSubscriptionLimits,
|
|
444
|
+
maxEvents: 4,
|
|
445
|
+
maxDeliveries: 4,
|
|
446
|
+
maxDeliveriesPerOwner: 4,
|
|
447
|
+
retention: policy
|
|
448
|
+
};
|
|
449
|
+
const registration = yield* store.register(record("sustained", "continuous"), limits);
|
|
450
|
+
for (let index = 0; index < 32; index++) {
|
|
451
|
+
const now = yield* Clock.currentTimeMillis;
|
|
452
|
+
const accepted = yield* store.accept({
|
|
453
|
+
...event(`retained-${index}`),
|
|
454
|
+
occurredAtMillis: now,
|
|
455
|
+
acceptedAtMillis: now
|
|
456
|
+
}, limits);
|
|
457
|
+
const deliveryId = yield* Schema.decodeEffect(Digest)(index.toString(16).padStart(64, "0")).pipe(Effect.orDie);
|
|
458
|
+
const selected = {
|
|
459
|
+
...delivery(registration, accepted),
|
|
460
|
+
deliveryId,
|
|
461
|
+
admissionKey: yield* Schema.decodeEffect(IdempotencyKey)(`subscription:${deliveryId}`).pipe(Effect.orDie)
|
|
462
|
+
};
|
|
463
|
+
yield* store.select(accepted, [selected], registration.ordinal, true, now, limits);
|
|
464
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
465
|
+
_tag: "Prepare",
|
|
466
|
+
envelope: preparedInput(selected),
|
|
467
|
+
envelopeDigest: digest("4"),
|
|
468
|
+
nowMillis: now
|
|
469
|
+
});
|
|
470
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
471
|
+
_tag: "Complete",
|
|
472
|
+
receipt,
|
|
473
|
+
nowMillis: now
|
|
474
|
+
});
|
|
475
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
476
|
+
_tag: "ObserveSettlement",
|
|
477
|
+
receipt,
|
|
478
|
+
settled: true,
|
|
479
|
+
nowMillis: now,
|
|
480
|
+
nextAttemptAtMillis: now
|
|
481
|
+
});
|
|
482
|
+
yield* store.compact(now, policy, 8);
|
|
483
|
+
yield* ensure((yield* store.delivery(selected.key)) === null, "Settled delivery must release its quota on every cycle");
|
|
484
|
+
yield* ensure((yield* store.accept(accepted, limits)).tombstone === true, "Duplicate acknowledgement must preserve its tombstone");
|
|
485
|
+
yield* TestClock.adjust(20);
|
|
486
|
+
}
|
|
487
|
+
yield* ensure((yield* store.event("retained-0")) === null, "Expired identity must be reclaimed");
|
|
488
|
+
const expired = yield* store.accept({
|
|
489
|
+
...event("retained-0"),
|
|
490
|
+
occurredAtMillis: 0
|
|
491
|
+
}, limits).pipe(Effect.result);
|
|
492
|
+
yield* ensure(Result.isFailure(expired) && expired.failure._tag === "SubscriptionError" && expired.failure.code === "event-replay-horizon", "Reclaimed identity must not be admitted after its replay horizon");
|
|
493
|
+
}));
|
|
494
|
+
const lifetimeCapacity = conformanceCase("reuses subscription capacity without retention and preserves live host guards and replay", (ensure) => Effect.gen(function* () {
|
|
495
|
+
const store = yield* SubscriptionStore;
|
|
496
|
+
const limits = {
|
|
497
|
+
...defaultSubscriptionLimits,
|
|
498
|
+
maxRegistrations: 1,
|
|
499
|
+
maxRegistrationsPerOwner: 1,
|
|
500
|
+
maxEvents: 1,
|
|
501
|
+
maxDeliveries: 1,
|
|
502
|
+
maxDeliveriesPerOwner: 1
|
|
503
|
+
};
|
|
504
|
+
const retained = [];
|
|
505
|
+
for (let index = 0; index < 4; index++) {
|
|
506
|
+
const registration = yield* store.register(record(`lifetime-${index}`), limits);
|
|
507
|
+
const accepted = yield* store.accept(event(`lifetime-${index}`), limits);
|
|
508
|
+
const deliveryId = yield* Schema.decodeEffect(Digest)(index.toString(16).padStart(64, "0")).pipe(Effect.orDie);
|
|
509
|
+
const selected = {
|
|
510
|
+
...delivery(registration, accepted),
|
|
511
|
+
deliveryId,
|
|
512
|
+
admissionKey: yield* Schema.decodeEffect(IdempotencyKey)(`subscription:${deliveryId}`).pipe(Effect.orDie)
|
|
513
|
+
};
|
|
514
|
+
if (index === 3) {
|
|
515
|
+
yield* store.select(accepted, [], 0, true, 20, limits);
|
|
516
|
+
yield* store.catchUp(accepted, selected, 20, limits);
|
|
517
|
+
} else yield* store.select(accepted, [selected], registration.ordinal, true, 20, limits);
|
|
518
|
+
if (index % 2 === 0) {
|
|
519
|
+
yield* store.changeDelivery(selected.key, deliveryId, {
|
|
520
|
+
_tag: "Prepare",
|
|
521
|
+
envelope: preparedInput(selected),
|
|
522
|
+
envelopeDigest: digest("4"),
|
|
523
|
+
nowMillis: 20
|
|
524
|
+
});
|
|
525
|
+
yield* store.changeDelivery(selected.key, deliveryId, {
|
|
526
|
+
_tag: "Complete",
|
|
527
|
+
receipt,
|
|
528
|
+
nowMillis: 21
|
|
529
|
+
});
|
|
530
|
+
} else yield* store.changeDelivery(selected.key, deliveryId, {
|
|
531
|
+
_tag: "Refuse",
|
|
532
|
+
refusal: {
|
|
533
|
+
phase: "preparation",
|
|
534
|
+
code: "refused"
|
|
535
|
+
},
|
|
536
|
+
nowMillis: 21
|
|
537
|
+
});
|
|
538
|
+
const completed = yield* store.delivery(selected.key);
|
|
539
|
+
if (completed === null) return yield* ensure(false, "completion discarded exact delivery evidence");
|
|
540
|
+
retained.push({
|
|
541
|
+
registration,
|
|
542
|
+
accepted,
|
|
543
|
+
completed
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
for (const { registration, accepted, completed } of retained) {
|
|
547
|
+
const replay = yield* store.register(registration, limits);
|
|
548
|
+
const intakeReplay = yield* store.accept(accepted, limits);
|
|
549
|
+
yield* ensure(replay.state === "consumed" && replay.ordinal === registration.ordinal, "creation replay changed or resurrected a consumed registration");
|
|
550
|
+
yield* ensure(intakeReplay.routingComplete && intakeReplay.cutoff === accepted.cutoff && JSON.stringify(intakeReplay.payload) === JSON.stringify(accepted.payload), "retained event replay lost its payload/cutoff or reopened routing");
|
|
551
|
+
if (completed.state === "delivered") yield* store.changeDelivery(completed.key, completed.deliveryId, {
|
|
552
|
+
_tag: "Complete",
|
|
553
|
+
receipt,
|
|
554
|
+
nowMillis: 99
|
|
555
|
+
});
|
|
556
|
+
yield* ensure(JSON.stringify(yield* store.delivery(completed.key)) === JSON.stringify(completed), "terminal replay changed prepared input, receipt, refusal or completion time");
|
|
557
|
+
}
|
|
558
|
+
const assertHostGuard = Effect.fnUntraced(function* (effect, code) {
|
|
559
|
+
const result = yield* Effect.result(effect);
|
|
560
|
+
yield* ensure(Result.isFailure(result) && result.failure._tag === "SubscriptionError" && result.failure.reason === "capacity" && result.failure.code === code, `host ${code} guard ignored live work`);
|
|
561
|
+
});
|
|
562
|
+
const active = yield* store.register(record("host-active"), limits);
|
|
563
|
+
const activeEvent = yield* store.accept(event("host-active"), limits);
|
|
564
|
+
yield* assertHostGuard(store.register(record("host-excess", "once", "other-owner"), limits), "registrations");
|
|
565
|
+
yield* assertHostGuard(store.accept(event("host-excess"), limits), "events");
|
|
566
|
+
yield* store.select(activeEvent, [delivery(active, activeEvent)], active.ordinal, true, 20, limits);
|
|
567
|
+
const nextRegistration = yield* store.register(record("host-excess", "once", "other-owner"), limits);
|
|
568
|
+
const nextEvent = yield* store.accept(event("host-excess"), limits);
|
|
569
|
+
yield* assertHostGuard(store.select(nextEvent, [delivery(nextRegistration, nextEvent)], nextRegistration.ordinal, true, 20, limits), "deliveries");
|
|
570
|
+
yield* ensure((yield* store.event(nextEvent.eventId))?.cursor === 0 && (yield* store.get(nextRegistration.key))?.state === "active", "host capacity rejection changed routing or registration evidence");
|
|
571
|
+
}));
|
|
572
|
+
const capacityReactivation = conformanceCase("reserves live capacity across expiry, pause and settlement observation", (ensure) => Effect.gen(function* () {
|
|
573
|
+
const store = yield* SubscriptionStore;
|
|
574
|
+
const limits = {
|
|
575
|
+
...defaultSubscriptionLimits,
|
|
576
|
+
maxRegistrations: 32,
|
|
577
|
+
maxRegistrationsPerOwner: 1,
|
|
578
|
+
maxEvents: 32,
|
|
579
|
+
maxDeliveries: 32,
|
|
580
|
+
maxDeliveriesPerOwner: 1
|
|
581
|
+
};
|
|
582
|
+
const expectCapacity = Effect.fnUntraced(function* (effect) {
|
|
583
|
+
const result = yield* Effect.result(effect);
|
|
584
|
+
yield* ensure(Result.isFailure(result) && result.failure._tag === "SubscriptionError" && result.failure.reason === "capacity", "live work did not reserve capacity");
|
|
585
|
+
});
|
|
586
|
+
const expiring = record("expiring");
|
|
587
|
+
yield* store.register({
|
|
588
|
+
...expiring,
|
|
589
|
+
configuration: {
|
|
590
|
+
...expiring.configuration,
|
|
591
|
+
expiresAtMillis: 1
|
|
592
|
+
}
|
|
593
|
+
}, limits);
|
|
594
|
+
yield* TestClock.setTime(2);
|
|
595
|
+
const current = yield* store.register(record("current", "continuous"), limits);
|
|
596
|
+
const paused = yield* store.change(current.key, 1, { _tag: "Pause" }, limits);
|
|
597
|
+
yield* expectCapacity(store.register(record("excess"), limits));
|
|
598
|
+
const revive = {
|
|
599
|
+
_tag: "Update",
|
|
600
|
+
configuration: expiring.configuration,
|
|
601
|
+
configurationFingerprint: expiring.configurationFingerprint,
|
|
602
|
+
recovery: null
|
|
603
|
+
};
|
|
604
|
+
yield* expectCapacity(store.change(expiring.key, 1, revive, limits));
|
|
605
|
+
yield* ensure((yield* store.get(expiring.key))?.configurationRevision === 1, "rejected revival changed registration evidence");
|
|
606
|
+
yield* store.cancel(current.key, paused.configurationRevision);
|
|
607
|
+
const registration = yield* store.change(expiring.key, 1, revive, limits);
|
|
608
|
+
const accepted = yield* store.accept(event("observed"), limits);
|
|
609
|
+
yield* expectCapacity(store.accept(event("unrouted-excess"), {
|
|
610
|
+
...limits,
|
|
611
|
+
maxEvents: 1
|
|
612
|
+
}));
|
|
613
|
+
const selected = {
|
|
614
|
+
...delivery(registration, accepted),
|
|
615
|
+
observeSettlement: true
|
|
616
|
+
};
|
|
617
|
+
yield* store.select(accepted, [selected], registration.ordinal, true, 20, limits);
|
|
618
|
+
const nextRegistration = yield* store.register(record("next"), limits);
|
|
619
|
+
const nextEvent = yield* store.accept(event("next-event"), limits);
|
|
620
|
+
const next = delivery(nextRegistration, nextEvent, "1");
|
|
621
|
+
const selectNext = store.select(nextEvent, [next], nextRegistration.ordinal, true, 20, limits);
|
|
622
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
623
|
+
_tag: "Retry",
|
|
624
|
+
retry: {
|
|
625
|
+
...selected.retry,
|
|
626
|
+
attempts: 1,
|
|
627
|
+
automaticAttempts: 1,
|
|
628
|
+
parked: true
|
|
629
|
+
},
|
|
630
|
+
nowMillis: 20
|
|
631
|
+
});
|
|
632
|
+
yield* expectCapacity(selectNext);
|
|
633
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
634
|
+
_tag: "Prepare",
|
|
635
|
+
envelope: preparedInput(selected),
|
|
636
|
+
envelopeDigest: digest("4"),
|
|
637
|
+
nowMillis: 20
|
|
638
|
+
});
|
|
639
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
640
|
+
_tag: "Complete",
|
|
641
|
+
receipt,
|
|
642
|
+
nowMillis: 21
|
|
643
|
+
});
|
|
644
|
+
yield* expectCapacity(selectNext);
|
|
645
|
+
yield* ensure((yield* store.event(nextEvent.eventId))?.cursor === 0 && (yield* store.get(nextRegistration.key))?.state === "active", "capacity rejection consumed a registration or advanced routing");
|
|
646
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
647
|
+
_tag: "ObserveSettlement",
|
|
648
|
+
receipt,
|
|
649
|
+
settled: true,
|
|
650
|
+
nowMillis: 22,
|
|
651
|
+
nextAttemptAtMillis: 22
|
|
652
|
+
});
|
|
653
|
+
yield* selectNext;
|
|
654
|
+
yield* store.changeDelivery(next.key, next.deliveryId, {
|
|
655
|
+
_tag: "Prepare",
|
|
656
|
+
envelope: preparedInput(next),
|
|
657
|
+
envelopeDigest: digest("4"),
|
|
658
|
+
nowMillis: 22
|
|
659
|
+
});
|
|
660
|
+
yield* store.changeDelivery(next.key, next.deliveryId, {
|
|
661
|
+
_tag: "Complete",
|
|
662
|
+
receipt,
|
|
663
|
+
nowMillis: 23
|
|
664
|
+
});
|
|
665
|
+
const blocker = yield* store.register(record("blocker"), limits);
|
|
666
|
+
const blockerEvent = yield* store.accept(event("blocker"), limits);
|
|
667
|
+
const blockerDelivery = delivery(blocker, blockerEvent);
|
|
668
|
+
yield* store.select(blockerEvent, [blockerDelivery], blocker.ordinal, true, 24, limits);
|
|
669
|
+
yield* expectCapacity(store.changeDelivery(next.key, next.deliveryId, {
|
|
670
|
+
_tag: "ObserveSettlement",
|
|
671
|
+
receipt,
|
|
672
|
+
settled: false,
|
|
673
|
+
nowMillis: 24,
|
|
674
|
+
nextAttemptAtMillis: 25
|
|
675
|
+
}, limits));
|
|
676
|
+
yield* ensure((yield* store.delivery(next.key))?.observeSettlement !== true, "rejected observation reactivation changed delivery evidence");
|
|
677
|
+
}));
|
|
678
|
+
const subscriptionStoreConformanceCases = [
|
|
679
|
+
historicalOccurrenceReplay,
|
|
680
|
+
conformanceCase("fences source recovery across pause, resume and configuration replacement", (ensure) => Effect.gen(function* () {
|
|
681
|
+
const store = yield* SubscriptionStore;
|
|
682
|
+
const initial = yield* store.register({
|
|
683
|
+
...record("recovery-revisions"),
|
|
684
|
+
recovery: {
|
|
685
|
+
attempts: 0,
|
|
686
|
+
nextAttemptAtMillis: 10,
|
|
687
|
+
lastFailure: null
|
|
688
|
+
}
|
|
689
|
+
}, defaultSubscriptionLimits);
|
|
690
|
+
const paused = yield* store.change(initial.key, 1, { _tag: "Pause" });
|
|
691
|
+
yield* store.deferRecovery(initial.key, 1, null);
|
|
692
|
+
yield* ensure((yield* store.get(initial.key))?.recovery?.nextAttemptAtMillis === 10, "late provider completion erased paused recovery");
|
|
693
|
+
const resumed = yield* store.change(initial.key, paused.configurationRevision, { _tag: "Resume" });
|
|
694
|
+
yield* ensure(resumed.recovery?.nextAttemptAtMillis === 10, "resume lost the recovery obligation");
|
|
695
|
+
const updated = yield* store.change(initial.key, resumed.configurationRevision, {
|
|
696
|
+
_tag: "Update",
|
|
697
|
+
configuration: {
|
|
698
|
+
...initial.configuration,
|
|
699
|
+
source: {
|
|
700
|
+
name: "replacement",
|
|
701
|
+
version: "2"
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
configurationFingerprint: digest("9"),
|
|
705
|
+
recovery: {
|
|
706
|
+
attempts: 0,
|
|
707
|
+
nextAttemptAtMillis: 50,
|
|
708
|
+
lastFailure: null
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
yield* store.deferRecovery(initial.key, resumed.configurationRevision, {
|
|
712
|
+
attempts: 9,
|
|
713
|
+
nextAttemptAtMillis: null,
|
|
714
|
+
lastFailure: "obsolete-source"
|
|
715
|
+
});
|
|
716
|
+
const retained = yield* store.get(initial.key);
|
|
717
|
+
yield* ensure(retained?.recovery?.nextAttemptAtMillis === 50 && retained.configurationRevision === updated.configurationRevision, "obsolete provider completion overwrote replacement recovery");
|
|
718
|
+
yield* ensure(retained?.creationFingerprint === initial.creationFingerprint && retained.creationConfiguration.source.name === initial.configuration.source.name, "revision rewrote creation identity");
|
|
719
|
+
})),
|
|
720
|
+
conformanceCase("rearms only one delivery generation and retains late receipt authority", (ensure) => Effect.gen(function* () {
|
|
721
|
+
const store = yield* SubscriptionStore;
|
|
722
|
+
const subscription = yield* store.register(record("retry-generation", "continuous"), defaultSubscriptionLimits);
|
|
723
|
+
const accepted = yield* store.accept(event("retry-generation"), defaultSubscriptionLimits);
|
|
724
|
+
const selected = {
|
|
725
|
+
...delivery(subscription, accepted),
|
|
726
|
+
observeSettlement: true
|
|
727
|
+
};
|
|
728
|
+
yield* store.select(accepted, [selected], subscription.ordinal, true, 20, defaultSubscriptionLimits);
|
|
729
|
+
yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
730
|
+
_tag: "Prepare",
|
|
731
|
+
envelope: preparedInput(selected),
|
|
732
|
+
envelopeDigest: digest("4"),
|
|
733
|
+
nowMillis: 30
|
|
734
|
+
});
|
|
735
|
+
const parked = yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
736
|
+
_tag: "Retry",
|
|
737
|
+
nowMillis: 40,
|
|
738
|
+
retry: {
|
|
739
|
+
...selected.retry,
|
|
740
|
+
attempts: 8,
|
|
741
|
+
automaticAttempts: 8,
|
|
742
|
+
parked: true,
|
|
743
|
+
nextAttemptAtMillis: 50,
|
|
744
|
+
lastAttemptAtMillis: 40,
|
|
745
|
+
lastFailure: "ambiguous"
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
yield* ensure((yield* store.pendingDeliveries(100, "", 10)).length === 0, "parked admission remained due for settlement observation");
|
|
749
|
+
yield* ensure((yield* store.nextDeadline) === null, "parked admission retained a busy-loop deadline");
|
|
750
|
+
const recovered = yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
751
|
+
_tag: "Recover",
|
|
752
|
+
expectedGeneration: parked.retry.generation,
|
|
753
|
+
nowMillis: 50
|
|
754
|
+
});
|
|
755
|
+
const stale = yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
756
|
+
_tag: "Retry",
|
|
757
|
+
nowMillis: 60,
|
|
758
|
+
retry: {
|
|
759
|
+
...parked.retry,
|
|
760
|
+
attempts: 9,
|
|
761
|
+
nextAttemptAtMillis: 70
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
yield* ensure(!stale.retry.parked && stale.retry.generation === recovered.retry.generation, "stale retry undid recovery");
|
|
765
|
+
const completed = yield* store.changeDelivery(selected.key, selected.deliveryId, {
|
|
766
|
+
_tag: "Complete",
|
|
767
|
+
receipt,
|
|
768
|
+
nowMillis: 70
|
|
769
|
+
});
|
|
770
|
+
yield* ensure(completed.receipt?.receiptId === receipt.receiptId && completed.envelopeDigest === digest("4"), "late receipt or immutable envelope was lost");
|
|
771
|
+
})),
|
|
772
|
+
conformanceCase("advances bounded maintenance beyond protected oldest events", (ensure) => Effect.gen(function* () {
|
|
773
|
+
const store = yield* SubscriptionStore;
|
|
774
|
+
const policy = {
|
|
775
|
+
replayHorizonMillis: 1e3,
|
|
776
|
+
completedRetentionMillis: 0,
|
|
777
|
+
maxTombstones: 8
|
|
778
|
+
};
|
|
779
|
+
const limits = {
|
|
780
|
+
...defaultSubscriptionLimits,
|
|
781
|
+
retention: policy
|
|
782
|
+
};
|
|
783
|
+
for (let index = 0; index < 6; index++) {
|
|
784
|
+
const accepted = yield* store.accept({
|
|
785
|
+
...event(`protected-${index}`),
|
|
786
|
+
occurredAtMillis: 0,
|
|
787
|
+
acceptedAtMillis: 0
|
|
788
|
+
}, limits);
|
|
789
|
+
if (index === 5) yield* store.select(accepted, [], 0, true, 0, limits);
|
|
790
|
+
}
|
|
791
|
+
yield* TestClock.setTime(10);
|
|
792
|
+
for (let pass = 0; pass < 8; pass++) yield* store.compact(10, policy, 1);
|
|
793
|
+
yield* ensure((yield* store.event("protected-5"))?.tombstone === true, "protected first pages starved a reclaimable event");
|
|
794
|
+
yield* ensure((yield* store.event("protected-0"))?.tombstone !== true, "unfinished event was reclaimed");
|
|
795
|
+
yield* TestClock.setTime(1001);
|
|
796
|
+
for (let pass = 0; pass < 8; pass++) yield* store.compact(1001, policy, 1);
|
|
797
|
+
yield* ensure((yield* store.event("protected-5")) === null, "idle maintenance did not expire tombstone");
|
|
798
|
+
const rejected = yield* store.accept({
|
|
799
|
+
...event("protected-5"),
|
|
800
|
+
occurredAtMillis: 0
|
|
801
|
+
}, limits).pipe(Effect.result);
|
|
802
|
+
yield* ensure(Result.isFailure(rejected), "retention state became inconsistent");
|
|
803
|
+
})),
|
|
804
|
+
sustainedRetention,
|
|
805
|
+
lifetimeCapacity,
|
|
806
|
+
capacityReactivation,
|
|
807
|
+
revisionsAndRetention,
|
|
808
|
+
cutoffAndIntake,
|
|
809
|
+
onceAndCapacity,
|
|
810
|
+
preparationLifecycle,
|
|
811
|
+
catchUpAndCursors,
|
|
812
|
+
replayUnderTighterLimits
|
|
813
|
+
];
|
|
814
|
+
export { SubscriptionStoreConformanceViolation, subscriptionConformancePartition, subscriptionStoreConformanceCases };
|
|
815
|
+
|
|
816
|
+
//# sourceMappingURL=SubscriptionStoreConformance.mjs.map
|