@e4779/pi-fabric 0.117.2-fork.31 → 0.131.0-fork.32
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/README.md +12 -5
- package/THIRD_PARTY_NOTICES.md +6 -14
- package/dist/activity/store.d.ts +2 -1
- package/dist/activity/store.d.ts.map +1 -1
- package/dist/actors/binding-store.d.ts +13 -0
- package/dist/actors/binding-store.d.ts.map +1 -1
- package/dist/actors/directory.d.ts.map +1 -1
- package/dist/actors/global-registry.d.ts +8 -0
- package/dist/actors/global-registry.d.ts.map +1 -1
- package/dist/actors/host-event-payload.d.ts +14 -0
- package/dist/actors/host-event-payload.d.ts.map +1 -1
- package/dist/actors/manager.d.ts +4 -3
- package/dist/actors/manager.d.ts.map +1 -1
- package/dist/actors/mesh-monitor.d.ts +2 -0
- package/dist/actors/mesh-monitor.d.ts.map +1 -1
- package/dist/actors/name-policy.d.ts +3 -0
- package/dist/actors/name-policy.d.ts.map +1 -0
- package/dist/actors/registry-store.d.ts +14 -5
- package/dist/actors/registry-store.d.ts.map +1 -1
- package/dist/actors/store-read.d.ts +16 -0
- package/dist/actors/store-read.d.ts.map +1 -0
- package/dist/agents/agent-files.d.ts +80 -0
- package/dist/agents/agent-files.d.ts.map +1 -0
- package/dist/agents/agent-files.js +327 -0
- package/dist/agents/agent-files.js.map +7 -0
- package/dist/agents/child-skills.d.ts +60 -0
- package/dist/agents/child-skills.d.ts.map +1 -0
- package/dist/agents/child-skills.js +94 -0
- package/dist/agents/child-skills.js.map +7 -0
- package/dist/agents/clone-first-worktree.d.ts +6 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -1
- package/dist/agents/cow-clone.d.ts.map +1 -1
- package/dist/agents/handoff.d.ts +12 -2
- package/dist/agents/handoff.d.ts.map +1 -1
- package/dist/agents/herdr-status.d.ts +26 -0
- package/dist/agents/herdr-status.d.ts.map +1 -0
- package/dist/agents/herdr-status.js +161 -0
- package/dist/agents/herdr-status.js.map +7 -0
- package/dist/agents/hosted-run.d.ts +20 -4
- package/dist/agents/hosted-run.d.ts.map +1 -1
- package/dist/agents/manager.d.ts +18 -2
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/model-pin-guard.d.ts +27 -0
- package/dist/agents/model-pin-guard.d.ts.map +1 -0
- package/dist/agents/model-pin-guard.js +86 -0
- package/dist/agents/model-pin-guard.js.map +7 -0
- package/dist/agents/model-pin.d.ts +25 -0
- package/dist/agents/model-pin.d.ts.map +1 -0
- package/dist/agents/provider-bridge.d.ts +7 -6
- package/dist/agents/provider-bridge.d.ts.map +1 -1
- package/dist/agents/provider-bridge.js +33 -5
- package/dist/agents/provider-bridge.js.map +3 -3
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/result.d.ts.map +1 -1
- package/dist/agents/result.js +1 -1
- package/dist/agents/runner-notice.d.ts.map +1 -1
- package/dist/agents/runner-protocol.d.ts +8 -0
- package/dist/agents/runner-protocol.d.ts.map +1 -1
- package/dist/agents/service-schema.d.ts.map +1 -1
- package/dist/agents/transports/herdr-socket.d.ts +12 -0
- package/dist/agents/transports/herdr-socket.d.ts.map +1 -0
- package/dist/agents/transports/herdr-transport.d.ts.map +1 -1
- package/dist/agents/types.d.ts +51 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/worker-recovery.d.ts +75 -0
- package/dist/agents/worker-recovery.d.ts.map +1 -0
- package/dist/agents/worktree-manager.d.ts.map +1 -1
- package/dist/agents.js +12 -11
- package/dist/agents.js.map +2 -2
- package/dist/audit/details.d.ts +36 -1
- package/dist/audit/details.d.ts.map +1 -1
- package/dist/audit/projection.d.ts.map +1 -1
- package/dist/audit/trace-schema.d.ts +50 -0
- package/dist/audit/trace-schema.d.ts.map +1 -0
- package/dist/audit/trace.d.ts +2 -48
- package/dist/audit/trace.d.ts.map +1 -1
- package/dist/chunks/chunk-2RWNVCFD.js +483 -0
- package/dist/chunks/chunk-2RWNVCFD.js.map +7 -0
- package/dist/chunks/chunk-2SCMGO2Z.js +16 -0
- package/dist/chunks/chunk-2SCMGO2Z.js.map +7 -0
- package/dist/chunks/chunk-35EEGOH3.js +324 -0
- package/dist/chunks/chunk-35EEGOH3.js.map +7 -0
- package/dist/chunks/{chunk-3FJUP3GV.js → chunk-36XQFTEN.js} +2 -2
- package/dist/chunks/{chunk-UTOBAZ5T.js → chunk-37NIOSVU.js} +1 -1
- package/dist/chunks/chunk-37NIOSVU.js.map +7 -0
- package/dist/chunks/chunk-3IJEQBFS.js +25 -0
- package/dist/chunks/chunk-3IJEQBFS.js.map +7 -0
- package/dist/chunks/{chunk-EHQQ4KCX.js → chunk-3MOY6WIB.js} +84 -19
- package/dist/chunks/chunk-3MOY6WIB.js.map +7 -0
- package/dist/chunks/chunk-3PKZSIRA.js +1312 -0
- package/dist/chunks/chunk-3PKZSIRA.js.map +7 -0
- package/dist/chunks/chunk-3VK6UGAN.js +64 -0
- package/dist/chunks/chunk-3VK6UGAN.js.map +7 -0
- package/dist/chunks/{chunk-ROTCDDOV.js → chunk-3XT5WHSG.js} +59 -119
- package/dist/chunks/chunk-3XT5WHSG.js.map +7 -0
- package/dist/chunks/{chunk-FIDUHKMM.js → chunk-4BYS4ZLY.js} +16 -16
- package/dist/chunks/chunk-4BYS4ZLY.js.map +7 -0
- package/dist/chunks/{chunk-K7J2ABAZ.js → chunk-4KX6BIPL.js} +91 -31
- package/dist/chunks/chunk-4KX6BIPL.js.map +7 -0
- package/dist/chunks/{chunk-UOM37PE4.js → chunk-4PBW54I2.js} +162 -92
- package/dist/chunks/chunk-4PBW54I2.js.map +7 -0
- package/dist/chunks/{chunk-ZEXCKK4K.js → chunk-4WKD3YM3.js} +3 -3
- package/dist/chunks/{chunk-PK4NIJEV.js → chunk-4XMXFHAR.js} +62 -3
- package/dist/chunks/chunk-4XMXFHAR.js.map +7 -0
- package/dist/chunks/{chunk-4EW7GVUR.js → chunk-56NMRVTV.js} +589 -377
- package/dist/chunks/chunk-56NMRVTV.js.map +7 -0
- package/dist/chunks/{chunk-GIK2WNAK.js → chunk-5BOTHX47.js} +109 -20
- package/dist/chunks/chunk-5BOTHX47.js.map +7 -0
- package/dist/chunks/chunk-5QJFDKPN.js +179 -0
- package/dist/chunks/chunk-5QJFDKPN.js.map +7 -0
- package/dist/chunks/{chunk-P7CBPPHY.js → chunk-6GWDGTHC.js} +5 -5
- package/dist/chunks/{chunk-P7CBPPHY.js.map → chunk-6GWDGTHC.js.map} +1 -1
- package/dist/chunks/chunk-6HO2IUQ5.js +104 -0
- package/dist/chunks/chunk-6HO2IUQ5.js.map +7 -0
- package/dist/chunks/chunk-6OGYPHNQ.js +62 -0
- package/dist/chunks/chunk-6OGYPHNQ.js.map +7 -0
- package/dist/chunks/{chunk-GO32KSEZ.js → chunk-7CIES6X2.js} +84 -9
- package/dist/chunks/chunk-7CIES6X2.js.map +7 -0
- package/dist/chunks/{chunk-G4TLWHRS.js → chunk-7N7IC3Z2.js} +4 -3
- package/dist/chunks/{chunk-G4TLWHRS.js.map → chunk-7N7IC3Z2.js.map} +2 -2
- package/dist/chunks/{chunk-5XBYFSI5.js → chunk-7YNE4NB2.js} +2 -2
- package/dist/chunks/{chunk-NTC2MCB6.js → chunk-B5L3X3ID.js} +1 -1
- package/dist/chunks/{chunk-NTC2MCB6.js.map → chunk-B5L3X3ID.js.map} +1 -1
- package/dist/chunks/chunk-BIBRWZWQ.js +325 -0
- package/dist/chunks/chunk-BIBRWZWQ.js.map +7 -0
- package/dist/chunks/{chunk-K6QXUGS5.js → chunk-BMAEZNZ5.js} +2 -1
- package/dist/chunks/{chunk-FSB2VIRZ.js → chunk-CBIV747V.js} +14 -3
- package/dist/chunks/chunk-CBIV747V.js.map +7 -0
- package/dist/chunks/{chunk-CCHZXF6K.js → chunk-CXYJJ3HZ.js} +3 -3
- package/dist/chunks/{chunk-R2XQ6AHT.js → chunk-DGERP4VL.js} +22 -10
- package/dist/chunks/chunk-DGERP4VL.js.map +7 -0
- package/dist/chunks/chunk-F2LGSRIN.js +38 -0
- package/dist/chunks/chunk-F2LGSRIN.js.map +7 -0
- package/dist/chunks/chunk-F6A6MQ6G.js +609 -0
- package/dist/chunks/chunk-F6A6MQ6G.js.map +7 -0
- package/dist/chunks/{chunk-IR3PIHJM.js → chunk-FK73YJKV.js} +67 -2
- package/dist/chunks/chunk-FK73YJKV.js.map +7 -0
- package/dist/chunks/{chunk-VYQV5JRT.js → chunk-GJVKEHDL.js} +2 -2
- package/dist/chunks/chunk-GJVKEHDL.js.map +7 -0
- package/dist/chunks/{chunk-TIIIHPHF.js → chunk-GS67KDMV.js} +2 -2
- package/dist/chunks/{chunk-D5NYNIST.js → chunk-H57KPL3V.js} +5 -5
- package/dist/chunks/{chunk-KVYNGDGC.js → chunk-HFDJWLMS.js} +6 -6
- package/dist/chunks/{chunk-KVYNGDGC.js.map → chunk-HFDJWLMS.js.map} +1 -1
- package/dist/chunks/{chunk-INRXG4J5.js → chunk-HGD75NZY.js} +2 -2
- package/dist/chunks/{chunk-CRRUW26I.js → chunk-HRDMBGMY.js} +12 -12
- package/dist/chunks/{chunk-CRRUW26I.js.map → chunk-HRDMBGMY.js.map} +2 -2
- package/dist/chunks/{chunk-MLLYR3Y6.js → chunk-HSEZPCL5.js} +19 -78
- package/dist/chunks/chunk-HSEZPCL5.js.map +7 -0
- package/dist/chunks/{chunk-LNASO4VT.js → chunk-IOGDTIGN.js} +44 -19
- package/dist/chunks/chunk-IOGDTIGN.js.map +7 -0
- package/dist/chunks/chunk-JMUUNW2H.js +65 -0
- package/dist/chunks/chunk-JMUUNW2H.js.map +7 -0
- package/dist/chunks/{chunk-UXIBKMUM.js → chunk-KIFOEBYJ.js} +4 -4
- package/dist/chunks/{chunk-SPCJXN4K.js → chunk-LKYLD5SN.js} +298 -65
- package/dist/chunks/chunk-LKYLD5SN.js.map +7 -0
- package/dist/chunks/{chunk-FUY6XVRX.js → chunk-MPMEK3IQ.js} +2 -2
- package/dist/chunks/{chunk-HP5P7NBO.js → chunk-MSDL7U6Q.js} +4 -4
- package/dist/chunks/chunk-N7ZAK2PB.js +132 -0
- package/dist/chunks/chunk-N7ZAK2PB.js.map +7 -0
- package/dist/chunks/{chunk-VSDUSNIA.js → chunk-NBIYYMKS.js} +8 -2
- package/dist/chunks/chunk-NBIYYMKS.js.map +7 -0
- package/dist/chunks/chunk-NENQZCGW.js +45 -0
- package/dist/chunks/chunk-NENQZCGW.js.map +7 -0
- package/dist/chunks/chunk-NJHJKINP.js +47 -0
- package/dist/chunks/chunk-NJHJKINP.js.map +7 -0
- package/dist/chunks/{chunk-U366I5K2.js → chunk-NQ7IWEIF.js} +18 -6
- package/dist/chunks/chunk-NQ7IWEIF.js.map +7 -0
- package/dist/chunks/{chunk-ZQMBS5SH.js → chunk-OJ4HAALD.js} +15 -12
- package/dist/chunks/chunk-OJ4HAALD.js.map +7 -0
- package/dist/chunks/chunk-OZCJU3PZ.js +33 -0
- package/dist/chunks/chunk-OZCJU3PZ.js.map +7 -0
- package/dist/chunks/chunk-P3DCXKL3.js +40 -0
- package/dist/chunks/chunk-P3DCXKL3.js.map +7 -0
- package/dist/chunks/chunk-P7YSPKTM.js +294 -0
- package/dist/chunks/chunk-P7YSPKTM.js.map +7 -0
- package/dist/chunks/chunk-PQVUMJ5J.js +223 -0
- package/dist/chunks/chunk-PQVUMJ5J.js.map +7 -0
- package/dist/chunks/chunk-PUBHBEYO.js +84 -0
- package/dist/chunks/chunk-PUBHBEYO.js.map +7 -0
- package/dist/chunks/{chunk-P4KH4S4S.js → chunk-QGTD3LAZ.js} +5 -20
- package/dist/chunks/chunk-QGTD3LAZ.js.map +7 -0
- package/dist/chunks/{chunk-TIJ3YQXX.js → chunk-QOEOKW2X.js} +2 -2
- package/dist/chunks/{chunk-TIJ3YQXX.js.map → chunk-QOEOKW2X.js.map} +1 -1
- package/dist/chunks/{chunk-QT4W5YVB.js → chunk-RAA3FAYZ.js} +2 -2
- package/dist/chunks/{chunk-WJJXODAB.js → chunk-RLKRZXSX.js} +8 -1
- package/dist/chunks/{chunk-WJJXODAB.js.map → chunk-RLKRZXSX.js.map} +2 -2
- package/dist/chunks/chunk-RWKQ5SRW.js +129 -0
- package/dist/chunks/chunk-RWKQ5SRW.js.map +7 -0
- package/dist/chunks/chunk-SW25R47N.js +71 -0
- package/dist/chunks/chunk-SW25R47N.js.map +7 -0
- package/dist/chunks/{chunk-EFETPXU2.js → chunk-TJZYM2SP.js} +118 -237
- package/dist/chunks/chunk-TJZYM2SP.js.map +7 -0
- package/dist/chunks/{chunk-53N2I4QA.js → chunk-TXCNZCZP.js} +2 -2
- package/dist/chunks/chunk-UD7LFV43.js +28 -0
- package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
- package/dist/chunks/{chunk-ASSLHWZS.js → chunk-UFMYN5TA.js} +2 -2
- package/dist/chunks/{chunk-7QKKLBHJ.js → chunk-UPMWLOKL.js} +10 -1
- package/dist/chunks/{chunk-7QKKLBHJ.js.map → chunk-UPMWLOKL.js.map} +2 -2
- package/dist/chunks/chunk-V4OW2ULC.js +422 -0
- package/dist/chunks/chunk-V4OW2ULC.js.map +7 -0
- package/dist/chunks/{chunk-FE6NOAO7.js → chunk-VNWQIGQL.js} +1820 -649
- package/dist/chunks/chunk-VNWQIGQL.js.map +7 -0
- package/dist/chunks/{chunk-PYFJW3HC.js → chunk-W5FEHVZA.js} +2 -16
- package/dist/chunks/{chunk-PYFJW3HC.js.map → chunk-W5FEHVZA.js.map} +3 -3
- package/dist/chunks/{chunk-XCEEQ5AB.js → chunk-WGMCNCP6.js} +1567 -1564
- package/dist/chunks/chunk-WGMCNCP6.js.map +7 -0
- package/dist/chunks/chunk-WKFRGICG.js +101 -0
- package/dist/chunks/chunk-WKFRGICG.js.map +7 -0
- package/dist/chunks/{chunk-3UGN25XS.js → chunk-WWTGWGH7.js} +80 -1662
- package/dist/chunks/chunk-WWTGWGH7.js.map +7 -0
- package/dist/chunks/{chunk-5UBRGTVN.js → chunk-X7QETPBC.js} +31 -15
- package/dist/chunks/chunk-X7QETPBC.js.map +7 -0
- package/dist/chunks/{chunk-LEU5CDSL.js → chunk-XFOSUGLU.js} +5 -5
- package/dist/chunks/{chunk-MZUC6LLH.js → chunk-XMYG2TKR.js} +4 -4
- package/dist/chunks/{chunk-MZUC6LLH.js.map → chunk-XMYG2TKR.js.map} +1 -1
- package/dist/chunks/chunk-YC65P7ZO.js +57 -0
- package/dist/chunks/chunk-YC65P7ZO.js.map +7 -0
- package/dist/chunks/{chunk-EKODKR6Y.js → chunk-YHFWMAQ5.js} +1 -24
- package/dist/chunks/chunk-YHFWMAQ5.js.map +7 -0
- package/dist/chunks/{chunk-C7Z6F3SO.js → chunk-ZFWICFNJ.js} +27 -20
- package/dist/chunks/{chunk-C7Z6F3SO.js.map → chunk-ZFWICFNJ.js.map} +2 -2
- package/dist/cli/decisions.d.ts.map +1 -1
- package/dist/cli/decisions.js +15 -3
- package/dist/cli/decisions.js.map +2 -2
- package/dist/cli/mesh.js +4 -3
- package/dist/cli/mesh.js.map +1 -1
- package/dist/commands/fabric-handler.d.ts +7 -0
- package/dist/commands/fabric-handler.d.ts.map +1 -0
- package/dist/commands/fabric-handler.js +916 -0
- package/dist/commands/fabric-handler.js.map +7 -0
- package/dist/commands/fabric.d.ts +11 -1
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/claim-events.d.ts +61 -0
- package/dist/compaction/claim-events.d.ts.map +1 -0
- package/dist/compaction/claim-events.js +210 -0
- package/dist/compaction/claim-events.js.map +7 -0
- package/dist/compaction/claim.d.ts +51 -0
- package/dist/compaction/claim.d.ts.map +1 -0
- package/dist/compaction/hook.d.ts +28 -2
- package/dist/compaction/hook.d.ts.map +1 -1
- package/dist/compaction/hook.js +12 -7
- package/dist/compaction/owner.js +9 -8
- package/dist/compaction/trace-events.d.ts +1 -1
- package/dist/compaction/trace-events.d.ts.map +1 -1
- package/dist/components/configuration.js +6 -6
- package/dist/components/effect-scope.d.ts.map +1 -1
- package/dist/config.d.ts +39 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-arguments.d.ts.map +1 -1
- package/dist/core/action-policy-hooks.d.ts +69 -0
- package/dist/core/action-policy-hooks.d.ts.map +1 -0
- package/dist/core/action-registry.d.ts +31 -10
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +12 -9
- package/dist/core/approval-controller.d.ts +23 -3
- package/dist/core/approval-controller.d.ts.map +1 -1
- package/dist/core/atomic-write.d.ts +164 -0
- package/dist/core/atomic-write.d.ts.map +1 -1
- package/dist/core/child-tool-allowlist.d.ts +17 -1
- package/dist/core/child-tool-allowlist.d.ts.map +1 -1
- package/dist/core/compact-controller.d.ts +34 -0
- package/dist/core/compact-controller.d.ts.map +1 -1
- package/dist/core/core-override-guidance.d.ts +3 -1
- package/dist/core/core-override-guidance.d.ts.map +1 -1
- package/dist/core/file-lock.d.ts.map +1 -1
- package/dist/core/foreground-tools.d.ts +4 -1
- package/dist/core/foreground-tools.d.ts.map +1 -1
- package/dist/core/host-policy.d.ts +43 -0
- package/dist/core/host-policy.d.ts.map +1 -0
- package/dist/core/host-sdk-runtime.d.ts.map +1 -1
- package/dist/core/host-sdk.d.ts.map +1 -1
- package/dist/core/host-sdk.js +1 -1
- package/dist/core/managed-host-guidance.d.ts +5 -0
- package/dist/core/managed-host-guidance.d.ts.map +1 -0
- package/dist/core/model-aliases.d.ts +22 -0
- package/dist/core/model-aliases.d.ts.map +1 -0
- package/dist/core/model-resolution.d.ts +41 -20
- package/dist/core/model-resolution.d.ts.map +1 -1
- package/dist/core/native-tool-result.d.ts +1 -0
- package/dist/core/native-tool-result.d.ts.map +1 -1
- package/dist/core/program-tasks.d.ts +52 -0
- package/dist/core/program-tasks.d.ts.map +1 -0
- package/dist/core/prompt-guidance.d.ts +5 -0
- package/dist/core/prompt-guidance.d.ts.map +1 -0
- package/dist/core/prompt-guidance.js +159 -0
- package/dist/core/prompt-guidance.js.map +7 -0
- package/dist/core/provider-operations.d.ts.map +1 -1
- package/dist/core/provider-operations.js +60 -108
- package/dist/core/provider-operations.js.map +3 -3
- package/dist/core/shell-inbox.d.ts.map +1 -1
- package/dist/core/shell-jobs.d.ts +7 -5
- package/dist/core/shell-jobs.d.ts.map +1 -1
- package/dist/core/shell-timing.d.ts.map +1 -1
- package/dist/core/skill-prompt.d.ts +1 -1
- package/dist/core/skill-prompt.d.ts.map +1 -1
- package/dist/core/skill-references.d.ts +1 -1
- package/dist/core/skill-references.d.ts.map +1 -1
- package/dist/core/system-guidance.d.ts.map +1 -1
- package/dist/core/tool-result-proxy.d.ts.map +1 -1
- package/dist/decisions/command.d.ts +2 -1
- package/dist/decisions/command.d.ts.map +1 -1
- package/dist/decisions/command.js +40 -12
- package/dist/decisions/command.js.map +2 -2
- package/dist/decisions/events.d.ts +12 -0
- package/dist/decisions/events.d.ts.map +1 -0
- package/dist/decisions/events.js +130 -0
- package/dist/decisions/events.js.map +7 -0
- package/dist/decisions/host.d.ts +31 -3
- package/dist/decisions/host.d.ts.map +1 -1
- package/dist/decisions/render.d.ts +44 -0
- package/dist/decisions/render.d.ts.map +1 -0
- package/dist/decisions/store.d.ts +8 -0
- package/dist/decisions/store.d.ts.map +1 -1
- package/dist/durable/agent.d.ts +8 -0
- package/dist/durable/agent.d.ts.map +1 -1
- package/dist/durable/extension-load-error.d.ts +8 -0
- package/dist/durable/extension-load-error.d.ts.map +1 -0
- package/dist/durable/session.d.ts +1 -0
- package/dist/durable/session.d.ts.map +1 -1
- package/dist/durable/worker-host.d.ts +10 -1
- package/dist/durable/worker-host.d.ts.map +1 -1
- package/dist/durable/worker-host.js +10 -1181
- package/dist/durable/worker-host.js.map +4 -4
- package/dist/durable/worker-options.d.ts +3 -0
- package/dist/durable/worker-options.d.ts.map +1 -1
- package/dist/durable/worker-role-seed.d.ts +82 -0
- package/dist/durable/worker-role-seed.d.ts.map +1 -0
- package/dist/durable/worker.js +43 -4
- package/dist/durable/worker.js.map +2 -2
- package/dist/durable-controls.d.ts.map +1 -1
- package/dist/durable-extension-wasm.d.ts +8 -0
- package/dist/durable-extension-wasm.d.ts.map +1 -0
- package/dist/durable-extension-wasm.js +32 -0
- package/dist/durable-extension-wasm.js.map +7 -0
- package/dist/durable-extension.d.ts +94 -0
- package/dist/durable-extension.d.ts.map +1 -0
- package/dist/durable-extension.js +649 -0
- package/dist/durable-extension.js.map +7 -0
- package/dist/durable-host.d.ts +8 -0
- package/dist/durable-host.d.ts.map +1 -0
- package/dist/durable-host.js +20 -0
- package/dist/durable-host.js.map +7 -0
- package/dist/durable-journal.d.ts +94 -0
- package/dist/durable-journal.d.ts.map +1 -0
- package/dist/durable.d.ts.map +1 -1
- package/dist/durable.js +10 -8
- package/dist/durable.js.map +2 -2
- package/dist/entropy/index.js +12 -10
- package/dist/entropy/pool-store.d.ts.map +1 -1
- package/dist/execution-service.d.ts +14 -0
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/extension-bootstrap.d.ts.map +1 -1
- package/dist/extension-bootstrap.js +28 -27
- package/dist/extension-bootstrap.js.map +2 -2
- package/dist/extension-copy.d.ts +21 -0
- package/dist/extension-copy.d.ts.map +1 -0
- package/dist/extension-copy.js +90 -0
- package/dist/extension-copy.js.map +7 -0
- package/dist/extension.d.ts +1 -1
- package/dist/extension.d.ts.map +1 -1
- package/dist/fabric-exec-arguments.d.ts.map +1 -1
- package/dist/fabric-exec-tool.d.ts +2 -1
- package/dist/fabric-exec-tool.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts +19 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +2125 -786
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/fabric-state.d.ts +44 -1
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -53
- package/dist/index.js.map +2 -2
- package/dist/jev/client.js +2 -2
- package/dist/jev/manager.d.ts +3 -0
- package/dist/jev/manager.d.ts.map +1 -1
- package/dist/jev/observation.d.ts +1 -1
- package/dist/jev/observation.js +6 -6
- package/dist/jev-fabric/bridge.d.ts.map +1 -1
- package/dist/jev.js +11 -12
- package/dist/managed-host.d.ts +13 -0
- package/dist/managed-host.d.ts.map +1 -1
- package/dist/memory/digest.js +2 -2
- package/dist/memory/discovery.js +6 -7
- package/dist/memory/file-worker.js +10 -11
- package/dist/memory/file-worker.js.map +1 -1
- package/dist/memory/normalize.js +5 -6
- package/dist/memory/search.js +7 -8
- package/dist/memory/worker-provider.js +11 -12
- package/dist/memory.js +11 -12
- package/dist/memory.js.map +1 -1
- package/dist/mesh/grants.d.ts +3 -3
- package/dist/mesh/grants.d.ts.map +1 -1
- package/dist/mesh/store.d.ts +8 -0
- package/dist/mesh/store.d.ts.map +1 -1
- package/dist/native-codemode.d.ts.map +1 -1
- package/dist/native-tool-catalog.d.ts.map +1 -1
- package/dist/native-tool-catalog.js +12 -3
- package/dist/native-tool-catalog.js.map +2 -2
- package/dist/programs/host.d.ts +18 -6
- package/dist/programs/host.d.ts.map +1 -1
- package/dist/programs/host.js +71 -47
- package/dist/programs/host.js.map +2 -2
- package/dist/programs/source.d.ts +11 -0
- package/dist/programs/source.d.ts.map +1 -1
- package/dist/programs/store.d.ts.map +1 -1
- package/dist/protocol.d.ts +504 -8
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +41 -11
- package/dist/provider-globals.d.ts +13 -0
- package/dist/provider-globals.d.ts.map +1 -0
- package/dist/providers/agents-actions.d.ts.map +1 -1
- package/dist/providers/agents-provider.d.ts +3 -0
- package/dist/providers/agents-provider.d.ts.map +1 -1
- package/dist/providers/captured-tools-provider.d.ts +5 -0
- package/dist/providers/captured-tools-provider.d.ts.map +1 -1
- package/dist/providers/compact-provider.d.ts +4 -1
- package/dist/providers/compact-provider.d.ts.map +1 -1
- package/dist/providers/components-provider.d.ts.map +1 -1
- package/dist/providers/decisions-provider.d.ts +9 -1
- package/dist/providers/decisions-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.d.ts +1 -1
- package/dist/providers/jev-provider.js +11 -12
- package/dist/providers/memory-provider.js +10 -11
- package/dist/providers/pi-tools-provider.d.ts +14 -0
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/providers/programs-provider.d.ts.map +1 -1
- package/dist/providers/sessions-provider.d.ts +7 -0
- package/dist/providers/sessions-provider.d.ts.map +1 -1
- package/dist/repeat-guard.d.ts +7 -6
- package/dist/repeat-guard.d.ts.map +1 -1
- package/dist/residency/actor-client.js +3 -3
- package/dist/residency/client.d.ts +15 -0
- package/dist/residency/client.d.ts.map +1 -1
- package/dist/residency/host.d.ts.map +1 -1
- package/dist/residency/host.js +34 -23
- package/dist/residency/launcher.js +1 -1
- package/dist/residency/pi-entry.js +34 -23
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/residency/protocol.d.ts +2 -0
- package/dist/residency/protocol.d.ts.map +1 -1
- package/dist/runners.js +11 -1
- package/dist/runners.js.map +2 -2
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/cpython-child-source.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.d.ts.map +1 -1
- package/dist/runtime/cpython-runtime.js +51 -21
- package/dist/runtime/cpython-runtime.js.map +2 -2
- package/dist/runtime/deadline-pause.d.ts +2 -0
- package/dist/runtime/deadline-pause.d.ts.map +1 -1
- package/dist/runtime/dynamic-guest-types.d.ts.map +1 -1
- package/dist/runtime/dynamic-guest-types.js +2 -1
- package/dist/runtime/exec-journal.d.ts +73 -0
- package/dist/runtime/exec-journal.d.ts.map +1 -0
- package/dist/runtime/exec-journal.js +335 -0
- package/dist/runtime/exec-journal.js.map +7 -0
- package/dist/runtime/guest-types.d.ts +3 -2
- package/dist/runtime/guest-types.d.ts.map +1 -1
- package/dist/runtime/guest-types.js +1 -1
- package/dist/runtime/journal-shim.d.ts +3 -0
- package/dist/runtime/journal-shim.d.ts.map +1 -0
- package/dist/runtime/kernel.d.ts +95 -1
- package/dist/runtime/kernel.d.ts.map +1 -1
- package/dist/runtime/monty-bridge.d.ts +6 -2
- package/dist/runtime/monty-bridge.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.js +27 -15
- package/dist/runtime/monty-runtime.js.map +2 -2
- package/dist/runtime/native-codemode-guest.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.js +7 -5
- package/dist/runtime/quickjs-runtime.d.ts +7 -1
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.js +5 -4
- package/dist/runtime/sha256.d.ts +4 -0
- package/dist/runtime/sha256.d.ts.map +1 -0
- package/dist/runtime/transpile.d.ts +8 -0
- package/dist/runtime/transpile.d.ts.map +1 -0
- package/dist/runtime/type-checker.d.ts +1 -7
- package/dist/runtime/type-checker.d.ts.map +1 -1
- package/dist/runtime/type-checker.js +4 -2
- package/dist/runtime/typescript-kernel.js +13 -10
- package/dist/runtime/typescript-kernel.js.map +1 -1
- package/dist/runtime-state-builtins.d.ts.map +1 -1
- package/dist/speculation/scanner.js +1 -1
- package/dist/speculation/store.d.ts +7 -16
- package/dist/speculation/store.d.ts.map +1 -1
- package/dist/speculation/types.d.ts +1 -0
- package/dist/speculation/types.d.ts.map +1 -1
- package/dist/storage/retention.d.ts.map +1 -1
- package/dist/topology/participant-directory.d.ts +26 -1
- package/dist/topology/participant-directory.d.ts.map +1 -1
- package/dist/topology/peer-presence.d.ts.map +1 -1
- package/dist/topology/peer-settle.js +11 -0
- package/dist/topology/peer-settle.js.map +7 -0
- package/dist/topology/session-label-settings.d.ts +13 -0
- package/dist/topology/session-label-settings.d.ts.map +1 -0
- package/dist/topology/session-label.d.ts +60 -0
- package/dist/topology/session-label.d.ts.map +1 -0
- package/dist/topology/types.d.ts +27 -0
- package/dist/topology/types.d.ts.map +1 -1
- package/dist/type-error-guidance.js +1 -1
- package/dist/ui/controller.d.ts +1 -0
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +3 -2
- package/dist/ui/conversation-commands.d.ts +1 -1
- package/dist/ui/conversation-commands.d.ts.map +1 -1
- package/dist/ui/conversation-native-reader.js +2 -2
- package/dist/ui/conversation-selection.d.ts +4 -1
- package/dist/ui/conversation-selection.d.ts.map +1 -1
- package/dist/ui/conversation-targets.d.ts.map +1 -1
- package/dist/ui/conversation-targets.js +2 -2
- package/dist/ui/conversation.d.ts +25 -24
- package/dist/ui/conversation.d.ts.map +1 -1
- package/dist/ui/conversation.js +170 -339
- package/dist/ui/conversation.js.map +2 -2
- package/dist/ui/core-tool-render.d.ts +1 -0
- package/dist/ui/core-tool-render.d.ts.map +1 -1
- package/dist/ui/dashboard.d.ts.map +1 -1
- package/dist/ui/dashboard.js +17 -13
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/fabric-render.d.ts +6 -0
- package/dist/ui/fabric-render.d.ts.map +1 -1
- package/dist/ui/footer-dock.d.ts +48 -0
- package/dist/ui/footer-dock.d.ts.map +1 -0
- package/dist/ui/format.d.ts +7 -0
- package/dist/ui/format.d.ts.map +1 -1
- package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -1
- package/dist/ui/settings-sections-presentation.d.ts.map +1 -1
- package/dist/ui/settings-values.d.ts +1 -0
- package/dist/ui/settings-values.d.ts.map +1 -1
- package/dist/ui/settings.js +59 -18
- package/dist/ui/settings.js.map +2 -2
- package/dist/ui/shell-hang-keys.d.ts +8 -1
- package/dist/ui/shell-hang-keys.d.ts.map +1 -1
- package/dist/ui/shell-tasks.d.ts +2 -2
- package/dist/ui/shell-tasks.d.ts.map +1 -1
- package/dist/ui/shell-tasks.js +27 -94
- package/dist/ui/shell-tasks.js.map +2 -2
- package/dist/ui/snapshot.d.ts.map +1 -1
- package/dist/ui/terminal-title.d.ts +41 -0
- package/dist/ui/terminal-title.d.ts.map +1 -0
- package/dist/ui/types.d.ts +4 -0
- package/dist/ui/types.d.ts.map +1 -1
- package/dist/ui/widget-keys.d.ts +5 -0
- package/dist/ui/widget-keys.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +34 -16
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/ui/word-diff/line-emphasis.js +1603 -0
- package/dist/ui/word-diff/line-emphasis.js.map +7 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/verified/authority.d.ts +2 -2
- package/dist/verified/authority.d.ts.map +1 -1
- package/dist/verified/budget.d.ts +4 -0
- package/dist/verified/budget.d.ts.map +1 -0
- package/dist/verified/generated/actor-name.d.ts +4 -0
- package/dist/verified/generated/actor-name.js +17 -0
- package/dist/verified/generated/authority.d.ts +4 -0
- package/dist/verified/generated/authority.js +28 -0
- package/dist/verified/generated/budget.d.ts +4 -0
- package/dist/verified/generated/budget.js +17 -0
- package/dist/verified/generated/compaction.d.ts +4 -0
- package/dist/verified/generated/compaction.js +19 -0
- package/dist/verified/generated/grants.d.ts +4 -0
- package/dist/verified/generated/grants.js +17 -0
- package/dist/verified/generated/lifecycle.d.ts +4 -0
- package/dist/verified/generated/lifecycle.js +50 -0
- package/dist/verified/generated/manifest.json +137 -48
- package/dist/verified/generated/policy.d.ts +17 -0
- package/dist/verified/generated/policy.js +211 -0
- package/dist/verified/generated/provider.d.ts +4 -0
- package/dist/verified/generated/provider.js +18 -0
- package/dist/verified/generated/resources.d.ts +6 -0
- package/dist/verified/generated/resources.js +73 -0
- package/dist/verified/generated/speculation.d.ts +6 -0
- package/dist/verified/generated/speculation.js +48 -0
- package/dist/verified/generated/storage.d.ts +4 -0
- package/dist/verified/generated/storage.js +18 -0
- package/dist/verified/grants.d.ts +22 -0
- package/dist/verified/grants.d.ts.map +1 -0
- package/dist/verified/lifecycle.d.ts +31 -0
- package/dist/verified/lifecycle.d.ts.map +1 -0
- package/dist/verified/machine.d.ts +18 -0
- package/dist/verified/machine.d.ts.map +1 -0
- package/dist/verified/memory.d.ts +1 -1
- package/dist/verified/memory.d.ts.map +1 -1
- package/dist/verified/nat.d.ts +1 -1
- package/dist/verified/nat.d.ts.map +1 -1
- package/dist/verified/policy.d.ts +17 -5
- package/dist/verified/policy.d.ts.map +1 -1
- package/dist/verified/provider.d.ts +22 -0
- package/dist/verified/provider.d.ts.map +1 -0
- package/dist/verified/resources.d.ts +21 -7
- package/dist/verified/resources.d.ts.map +1 -1
- package/dist/verified/speculation.d.ts +36 -0
- package/dist/verified/speculation.d.ts.map +1 -0
- package/dist/verified/storage.d.ts.map +1 -1
- package/dist/worker/missing-install.d.ts +8 -0
- package/dist/worker/missing-install.d.ts.map +1 -0
- package/dist/worker/options.d.ts.map +1 -1
- package/dist/worker/options.js +25 -0
- package/dist/worker/options.js.map +2 -2
- package/dist/worker/prompt-lifecycle.d.ts +16 -0
- package/dist/worker/prompt-lifecycle.d.ts.map +1 -0
- package/dist/worker/prompt-lifecycle.js +90 -0
- package/dist/worker/prompt-lifecycle.js.map +7 -0
- package/dist/worker/questions.d.ts +15 -3
- package/dist/worker/questions.d.ts.map +1 -1
- package/dist/worker/questions.js +53 -8
- package/dist/worker/questions.js.map +2 -2
- package/dist/worker/recovery-watchdog.d.ts +22 -0
- package/dist/worker/recovery-watchdog.d.ts.map +1 -1
- package/dist/worker/recovery-watchdog.js +116 -1
- package/dist/worker/recovery-watchdog.js.map +2 -2
- package/dist/worker/result.js +1 -1
- package/dist/worker/result.js.map +2 -2
- package/dist/worker.js +131 -21
- package/dist/worker.js.map +2 -2
- package/docs/actor-name-policy-handoff.md +5 -0
- package/docs/agents.md +164 -17
- package/docs/architecture.md +5 -1
- package/docs/audit-trace.md +2 -1
- package/docs/background-tasks.md +102 -16
- package/docs/codemode-parity.md +2 -2
- package/docs/compaction.md +21 -5
- package/docs/components.md +1 -1
- package/docs/configuration.md +111 -66
- package/docs/decisions.md +92 -10
- package/docs/durable-extension.md +121 -0
- package/docs/durable-pi.md +306 -6
- package/docs/extractive-history.md +3 -1
- package/docs/interface.md +20 -17
- package/docs/jev.md +1 -1
- package/docs/kernels.md +1 -1
- package/{node_modules/pi-coralbricks-provider/LICENSE → docs/licenses/gdp-wired-mit.txt} +1 -1
- package/docs/managed-host-migration.md +50 -0
- package/docs/programmatic-compaction.md +216 -6
- package/docs/programs.md +23 -1
- package/docs/prompt-cache.md +4 -2
- package/docs/provider-capabilities.md +15 -14
- package/docs/providers.md +99 -3
- package/docs/shell-composition.md +15 -0
- package/docs/short-lock-protocol.md +90 -0
- package/docs/skills.md +5 -1
- package/docs/speculation.md +6 -0
- package/docs/verified-kernels.md +309 -220
- package/package.json +45 -24
- package/proofs/actor-name.ts +27 -0
- package/proofs/authority.ts +62 -0
- package/proofs/budget.ts +24 -0
- package/proofs/compaction.ts +51 -0
- package/proofs/grants.ts +39 -0
- package/proofs/index.ts +40 -0
- package/proofs/kernel.ts +44 -0
- package/proofs/lifecycle.ts +128 -0
- package/proofs/policy.ts +195 -0
- package/proofs/provider.ts +52 -0
- package/proofs/resources.ts +160 -0
- package/proofs/speculation.ts +69 -0
- package/proofs/storage.ts +66 -0
- package/scripts/verified-kernels.ts +141 -0
- package/skillsets/python/fabric-council/SKILL.md +92 -20
- package/skillsets/python/fabric-exec/SKILL.md +2 -2
- package/skillsets/python/fabric-exec/references/agents.md +10 -4
- package/skillsets/python/fabric-fusion/SKILL.md +1 -1
- package/skillsets/python/fabric-guide/SKILL.md +1 -1
- package/skillsets/typescript/fabric-council/SKILL.md +109 -22
- package/skillsets/typescript/fabric-exec/SKILL.md +7 -7
- package/skillsets/typescript/fabric-exec/references/agents.md +12 -3
- package/skillsets/typescript/fabric-fusion/SKILL.md +1 -1
- package/skillsets/typescript/fabric-guide/SKILL.md +1 -1
- package/LAWS.bend +0 -502
- package/PROOF.bend +0 -452
- package/dist/chunks/chunk-3UGN25XS.js.map +0 -7
- package/dist/chunks/chunk-4EW7GVUR.js.map +0 -7
- package/dist/chunks/chunk-5UBRGTVN.js.map +0 -7
- package/dist/chunks/chunk-BN7F52EG.js +0 -525
- package/dist/chunks/chunk-BN7F52EG.js.map +0 -7
- package/dist/chunks/chunk-DK35W6U7.js +0 -259
- package/dist/chunks/chunk-DK35W6U7.js.map +0 -7
- package/dist/chunks/chunk-EFETPXU2.js.map +0 -7
- package/dist/chunks/chunk-EHQQ4KCX.js.map +0 -7
- package/dist/chunks/chunk-EKODKR6Y.js.map +0 -7
- package/dist/chunks/chunk-FE6NOAO7.js.map +0 -7
- package/dist/chunks/chunk-FIDUHKMM.js.map +0 -7
- package/dist/chunks/chunk-FSB2VIRZ.js.map +0 -7
- package/dist/chunks/chunk-GIK2WNAK.js.map +0 -7
- package/dist/chunks/chunk-GO32KSEZ.js.map +0 -7
- package/dist/chunks/chunk-IR3PIHJM.js.map +0 -7
- package/dist/chunks/chunk-ITVLKXCI.js +0 -266
- package/dist/chunks/chunk-ITVLKXCI.js.map +0 -7
- package/dist/chunks/chunk-K7J2ABAZ.js.map +0 -7
- package/dist/chunks/chunk-KJZAOENY.js +0 -212
- package/dist/chunks/chunk-KJZAOENY.js.map +0 -7
- package/dist/chunks/chunk-LNASO4VT.js.map +0 -7
- package/dist/chunks/chunk-MLLYR3Y6.js.map +0 -7
- package/dist/chunks/chunk-P4KH4S4S.js.map +0 -7
- package/dist/chunks/chunk-PK4NIJEV.js.map +0 -7
- package/dist/chunks/chunk-Q2JQ3RYZ.js +0 -99
- package/dist/chunks/chunk-Q2JQ3RYZ.js.map +0 -7
- package/dist/chunks/chunk-R2XQ6AHT.js.map +0 -7
- package/dist/chunks/chunk-ROTCDDOV.js.map +0 -7
- package/dist/chunks/chunk-SPCJXN4K.js.map +0 -7
- package/dist/chunks/chunk-U366I5K2.js.map +0 -7
- package/dist/chunks/chunk-UKMQK5VP.js +0 -231
- package/dist/chunks/chunk-UKMQK5VP.js.map +0 -7
- package/dist/chunks/chunk-UOM37PE4.js.map +0 -7
- package/dist/chunks/chunk-UTOBAZ5T.js.map +0 -7
- package/dist/chunks/chunk-VSDUSNIA.js.map +0 -7
- package/dist/chunks/chunk-VTK2FEH7.js +0 -229
- package/dist/chunks/chunk-VTK2FEH7.js.map +0 -7
- package/dist/chunks/chunk-VYQV5JRT.js.map +0 -7
- package/dist/chunks/chunk-XCEEQ5AB.js.map +0 -7
- package/dist/chunks/chunk-ZLNJDTCN.js +0 -226
- package/dist/chunks/chunk-ZLNJDTCN.js.map +0 -7
- package/dist/chunks/chunk-ZQMBS5SH.js.map +0 -7
- package/dist/ui/conversation-shortcut.d.ts +0 -3
- package/dist/ui/conversation-shortcut.d.ts.map +0 -1
- package/dist/ui/widget-activity.d.ts +0 -21
- package/dist/ui/widget-activity.d.ts.map +0 -1
- package/dist/verified/generated/authority-kernel.d.ts +0 -10
- package/dist/verified/generated/authority-kernel.js +0 -127
- package/dist/verified/generated/kernel.d.ts +0 -31
- package/dist/verified/generated/kernel.js +0 -389
- package/dist/verified/generated/lifecycle-kernel.d.ts +0 -7
- package/dist/verified/generated/lifecycle-kernel.js +0 -164
- package/dist/verified/generated/provider-kernel.d.ts +0 -9
- package/dist/verified/generated/provider-kernel.js +0 -87
- package/dist/verified/generated/storage-kernel.d.ts +0 -11
- package/dist/verified/generated/storage-kernel.js +0 -107
- package/docs/licenses/bend-apache-2.0.txt +0 -202
- package/node_modules/pi-coralbricks-provider/README.md +0 -306
- package/node_modules/pi-coralbricks-provider/auth.ts +0 -30
- package/node_modules/pi-coralbricks-provider/custom-models.json +0 -1
- package/node_modules/pi-coralbricks-provider/deprecated-models.json +0 -1
- package/node_modules/pi-coralbricks-provider/guard.ts +0 -155
- package/node_modules/pi-coralbricks-provider/index.ts +0 -662
- package/node_modules/pi-coralbricks-provider/models.json +0 -88
- package/node_modules/pi-coralbricks-provider/package.json +0 -74
- package/node_modules/pi-coralbricks-provider/park.ts +0 -122
- package/node_modules/pi-coralbricks-provider/patch.json +0 -34
- package/node_modules/pi-coralbricks-provider/scripts/update-models.js +0 -658
- package/node_modules/pi-coralbricks-provider/settings.ts +0 -143
- package/node_modules/pi-coralbricks-provider/sync-policy.ts +0 -309
- package/proofs/abi.json +0 -308
- package/proofs/authority-abi.json +0 -7
- package/proofs/authority-kernel.bend +0 -23
- package/proofs/authority-proof.bend +0 -74
- package/proofs/authority-spec.bend +0 -30
- package/proofs/authority-state.bend +0 -43
- package/proofs/authority-types.d.ts +0 -3
- package/proofs/kernel.bend +0 -139
- package/proofs/lifecycle-abi.json +0 -3
- package/proofs/lifecycle-kernel.bend +0 -11
- package/proofs/lifecycle-proof.bend +0 -249
- package/proofs/lifecycle-spec.bend +0 -261
- package/proofs/lifecycle-types.d.ts +0 -4
- package/proofs/lifecycle.bend +0 -119
- package/proofs/provider-abi.json +0 -4
- package/proofs/provider-kernel.bend +0 -14
- package/proofs/provider-plans.bend +0 -28
- package/proofs/provider-spec.bend +0 -14
- package/proofs/provider-types.d.ts +0 -5
- package/proofs/resource-proof.bend +0 -633
- package/proofs/resource-spec.bend +0 -133
- package/proofs/resources.bend +0 -160
- package/proofs/state-kernel.bend +0 -17
- package/proofs/state-plans.bend +0 -40
- package/proofs/state-proof.bend +0 -42
- package/proofs/state-spec.bend +0 -26
- package/proofs/storage-abi.json +0 -3
- package/proofs/storage-kernel.bend +0 -11
- package/proofs/storage-plans.bend +0 -100
- package/proofs/storage-proof.bend +0 -176
- package/proofs/storage-spec.bend +0 -70
- package/proofs/storage-types.d.ts +0 -8
- package/proofs/types.d.ts +0 -7
- package/scripts/test-verified-kernels.mjs +0 -107
- package/scripts/verified-kernels.mjs +0 -176
- /package/dist/chunks/{chunk-3FJUP3GV.js.map → chunk-36XQFTEN.js.map} +0 -0
- /package/dist/chunks/{chunk-ZEXCKK4K.js.map → chunk-4WKD3YM3.js.map} +0 -0
- /package/dist/chunks/{chunk-5XBYFSI5.js.map → chunk-7YNE4NB2.js.map} +0 -0
- /package/dist/chunks/{chunk-K6QXUGS5.js.map → chunk-BMAEZNZ5.js.map} +0 -0
- /package/dist/chunks/{chunk-CCHZXF6K.js.map → chunk-CXYJJ3HZ.js.map} +0 -0
- /package/dist/chunks/{chunk-TIIIHPHF.js.map → chunk-GS67KDMV.js.map} +0 -0
- /package/dist/chunks/{chunk-D5NYNIST.js.map → chunk-H57KPL3V.js.map} +0 -0
- /package/dist/chunks/{chunk-INRXG4J5.js.map → chunk-HGD75NZY.js.map} +0 -0
- /package/dist/chunks/{chunk-UXIBKMUM.js.map → chunk-KIFOEBYJ.js.map} +0 -0
- /package/dist/chunks/{chunk-FUY6XVRX.js.map → chunk-MPMEK3IQ.js.map} +0 -0
- /package/dist/chunks/{chunk-HP5P7NBO.js.map → chunk-MSDL7U6Q.js.map} +0 -0
- /package/dist/chunks/{chunk-QT4W5YVB.js.map → chunk-RAA3FAYZ.js.map} +0 -0
- /package/dist/chunks/{chunk-53N2I4QA.js.map → chunk-TXCNZCZP.js.map} +0 -0
- /package/dist/chunks/{chunk-ASSLHWZS.js.map → chunk-UFMYN5TA.js.map} +0 -0
- /package/dist/chunks/{chunk-LEU5CDSL.js.map → chunk-XFOSUGLU.js.map} +0 -0
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import Base
|
|
2
|
-
import ./storage-plans.bend as C
|
|
3
|
-
import ./storage-spec.bend as S
|
|
4
|
-
import ./storage-kernel.bend as K
|
|
5
|
-
import ./resource-proof.bend as P
|
|
6
|
-
|
|
7
|
-
# Proof-only helpers, never linked into the executable artifact.
|
|
8
|
-
def revisionEq(+ah: Nat, +al: Nat, +bh: Nat, +bl: Nat, hp: {ah == bh : Nat}, lp: {al == bl : Nat}) -> {C.Revision{ah, al} == C.Revision{bh, bl} : C.Revision}:
|
|
9
|
-
%hp : {C.Revision{ah, al} == C.Revision{_, bl} : C.Revision}
|
|
10
|
-
%lp : {C.Revision{ah, al} == C.Revision{ah, _} : C.Revision}
|
|
11
|
-
{==}
|
|
12
|
-
|
|
13
|
-
def revisionExact(+left: C.Revision, +right: C.Revision, p: {C.equal(left, right) == True{} : Bool}) -> {left == right : C.Revision}:
|
|
14
|
-
match left right:
|
|
15
|
-
case C.Revision{ah, al} C.Revision{bh, bl}:
|
|
16
|
-
P.andUse({C.Revision{ah, al} == C.Revision{bh, bl} : C.Revision}, Nat.is_eq(ah, bh), Nat.is_eq(al, bl), p, hp => lp => revisionEq(ah, al, bh, bl, P.natExact(ah, bh, hp), P.natExact(al, bl, lp)))
|
|
17
|
-
|
|
18
|
-
def revisionRefl(+revision: C.Revision) -> {C.equal(revision, revision) == True{} : Bool}:
|
|
19
|
-
match revision:
|
|
20
|
-
case C.Revision{high, low}:
|
|
21
|
-
P.andMake(Nat.is_eq(high, high), Nat.is_eq(low, low), P.natRefl(high), P.natRefl(low))
|
|
22
|
-
|
|
23
|
-
def casSound(+expected: C.Expectation, +actual: C.Revision, p: {C.matches(expected, actual) == True{} : Bool}) -> S.CAS(expected, actual):
|
|
24
|
-
match expected:
|
|
25
|
-
case C.Any{}:
|
|
26
|
-
Unit{}
|
|
27
|
-
case C.At{version}:
|
|
28
|
-
revisionExact(version, actual, p)
|
|
29
|
-
|
|
30
|
-
def casComplete(+expected: C.Expectation, +actual: C.Revision, p: S.CAS(expected, actual)) -> {C.matches(expected, actual) == True{} : Bool}:
|
|
31
|
-
match expected:
|
|
32
|
-
case C.Any{}:
|
|
33
|
-
{==}
|
|
34
|
-
case C.At{version}:
|
|
35
|
-
%p : {C.equal(version, _) == True{} : Bool}
|
|
36
|
-
revisionRefl(version)
|
|
37
|
-
|
|
38
|
-
def roomSound(+version: C.Revision, p: {C.room(version) == True{} : Bool}) -> S.Room(version):
|
|
39
|
-
match version:
|
|
40
|
-
case C.Revision{high, low}:
|
|
41
|
-
P.andUse(S.Room(version), Nat.is_le(high, 2097151n) && Nat.is_le(low, 4294967295n), Nat.is_lt(high, 2097151n) || Nat.is_lt(low, 4294967295n), p, bounds => spare =>
|
|
42
|
-
P.andUse(S.Room(version), Nat.is_le(high, 2097151n), Nat.is_le(low, 4294967295n), bounds, hp => lp =>
|
|
43
|
-
(hp, (lp, P.orCases(Nat.is_lt(high, 2097151n), Nat.is_lt(low, 4294967295n), spare)))))
|
|
44
|
-
|
|
45
|
-
def roomComplete(+version: C.Revision, p: S.Room(version)) -> {C.room(version) == True{} : Bool}:
|
|
46
|
-
match version:
|
|
47
|
-
case C.Revision{high, low}:
|
|
48
|
-
(hp, rest) = p
|
|
49
|
-
(lp, spare) = rest
|
|
50
|
-
P.andMake(Nat.is_le(high, 2097151n) && Nat.is_le(low, 4294967295n), Nat.is_lt(high, 2097151n) || Nat.is_lt(low, 4294967295n), P.andMake(Nat.is_le(high, 2097151n), Nat.is_le(low, 4294967295n), hp, lp), P.orEvidence(Nat.is_lt(high, 2097151n), Nat.is_lt(low, 4294967295n), spare))
|
|
51
|
-
|
|
52
|
-
def carrySafe(+high: Nat, +low: Nat, +full: Bool, p: {Nat.is_eq(low, 4294967295n) == full : Bool}) -> S.Successor(C.Revision{high, low}, C.carry(full, high, low)):
|
|
53
|
-
match full:
|
|
54
|
-
case False{}:
|
|
55
|
-
Inl{(p, {==})}
|
|
56
|
-
case True{}:
|
|
57
|
-
Inr{(P.natExact(low, 4294967295n, p), {==})}
|
|
58
|
-
|
|
59
|
-
def successor(+version: C.Revision) -> S.Successor(version, C.next(version)):
|
|
60
|
-
match version:
|
|
61
|
-
case C.Revision{high, low}:
|
|
62
|
-
carrySafe(high, low, Nat.is_eq(low, 4294967295n), {==})
|
|
63
|
-
|
|
64
|
-
def baseRoomSound(+present: Bool, +version: C.Revision, +highWater: C.Revision, p: {C.room(C.base(present, version, highWater)) == True{} : Bool}) -> S.Room(S.Base(present, version, highWater)):
|
|
65
|
-
match present:
|
|
66
|
-
case False{}:
|
|
67
|
-
roomSound(highWater, p)
|
|
68
|
-
case True{}:
|
|
69
|
-
roomSound(version, p)
|
|
70
|
-
|
|
71
|
-
def baseRoomComplete(+present: Bool, +version: C.Revision, +highWater: C.Revision, p: S.Room(S.Base(present, version, highWater))) -> {C.room(C.base(present, version, highWater)) == True{} : Bool}:
|
|
72
|
-
match present:
|
|
73
|
-
case False{}:
|
|
74
|
-
roomComplete(highWater, p)
|
|
75
|
-
case True{}:
|
|
76
|
-
roomComplete(version, p)
|
|
77
|
-
|
|
78
|
-
def baseSuccessor(+present: Bool, +version: C.Revision, +highWater: C.Revision) -> S.Successor(S.Base(present, version, highWater), C.next(C.base(present, version, highWater))):
|
|
79
|
-
match present:
|
|
80
|
-
case False{}:
|
|
81
|
-
successor(highWater)
|
|
82
|
-
case True{}:
|
|
83
|
-
successor(version)
|
|
84
|
-
|
|
85
|
-
def putSelected(+key: +List<Nat>, +expected: C.Expectation, +value: +List<Nat>, +identity: +List<Nat>, +present: Bool, +version: C.Revision, +highWater: C.Revision, +room: Bool, cp: S.CAS(expected, version), rp: {C.canGrow(C.base(present, version, highWater), highWater) == room : Bool}) -> S.Safe(C.Request{key, expected, C.Put{value, identity}}, C.Slot{present, version, highWater}, C.grow(room, key, C.Put{value, identity}, C.base(present, version, highWater), highWater)):
|
|
86
|
-
match room:
|
|
87
|
-
case False{}:
|
|
88
|
-
Unit{}
|
|
89
|
-
case True{}:
|
|
90
|
-
P.andUse(S.Safe(C.Request{key, expected, C.Put{value, identity}}, C.Slot{present, version, highWater}, C.grow(True{}, key, C.Put{value, identity}, C.base(present, version, highWater), highWater)), C.room(C.base(present, version, highWater)), C.room(highWater), rp, bp => hp =>
|
|
91
|
-
(cp, (baseRoomSound(present, version, highWater, bp), (roomSound(highWater, hp), ({==}, (({==}, {==}), (baseSuccessor(present, version, highWater), successor(highWater))))))))
|
|
92
|
-
|
|
93
|
-
def deleteSelected(+key: +List<Nat>, +expected: C.Expectation, +version: C.Revision, +highWater: C.Revision, +room: Bool, cp: S.CAS(expected, version), rp: {C.canGrow(version, highWater) == room : Bool}) -> S.Safe(C.Request{key, expected, C.Delete{}}, C.Slot{True{}, version, highWater}, C.grow(room, key, C.Delete{}, version, highWater)):
|
|
94
|
-
match room:
|
|
95
|
-
case False{}:
|
|
96
|
-
Unit{}
|
|
97
|
-
case True{}:
|
|
98
|
-
P.andUse(S.Safe(C.Request{key, expected, C.Delete{}}, C.Slot{True{}, version, highWater}, C.grow(True{}, key, C.Delete{}, version, highWater)), C.room(version), C.room(highWater), rp, bp => hp =>
|
|
99
|
-
(cp, (roomSound(version, bp), (roomSound(highWater, hp), ({==}, (Unit{}, ({==}, (successor(version), successor(highWater)))))))))
|
|
100
|
-
|
|
101
|
-
def applySafe(+key: +List<Nat>, +expected: C.Expectation, +change: C.Change, +present: Bool, +version: C.Revision, +highWater: C.Revision, cp: S.CAS(expected, version)) -> S.Safe(C.Request{key, expected, change}, C.Slot{present, version, highWater}, C.apply(key, change, present, version, highWater)):
|
|
102
|
-
match change present:
|
|
103
|
-
case C.Delete{} False{}:
|
|
104
|
-
(cp, (Unit{}, {==}))
|
|
105
|
-
case C.Delete{} True{}:
|
|
106
|
-
deleteSelected(key, expected, version, highWater, C.canGrow(version, highWater), cp, {==})
|
|
107
|
-
case C.Put{value, identity} _:
|
|
108
|
-
putSelected(key, expected, value, identity, present, version, highWater, C.canGrow(C.base(present, version, highWater), highWater), cp, {==})
|
|
109
|
-
|
|
110
|
-
def admittedSafe(+key: +List<Nat>, +expected: C.Expectation, +change: C.Change, +present: Bool, +version: C.Revision, +highWater: C.Revision, +ok: Bool, p: {C.matches(expected, version) == ok : Bool}) -> S.Safe(C.Request{key, expected, change}, C.Slot{present, version, highWater}, C.admit(ok, key, change, present, version, highWater)):
|
|
111
|
-
match ok:
|
|
112
|
-
case False{}:
|
|
113
|
-
Unit{}
|
|
114
|
-
case True{}:
|
|
115
|
-
applySafe(key, expected, change, present, version, highWater, casSound(expected, version, p))
|
|
116
|
-
|
|
117
|
-
# Closed universal safety for the actual exported production reducer.
|
|
118
|
-
def storage_safe(+request: C.Request, +slot: C.Slot) -> S.Safe(request, slot, K.storageTransition(request, slot)):
|
|
119
|
-
match request slot:
|
|
120
|
-
case C.Request{key, expected, change} C.Slot{present, version, highWater}:
|
|
121
|
-
admittedSafe(key, expected, change, present, version, highWater, C.matches(expected, version), {==})
|
|
122
|
-
|
|
123
|
-
# Independent positive witnesses make an always-deny reducer fail the laws.
|
|
124
|
-
def storage_put_complete(+key: +List<Nat>, +expected: C.Expectation, +value: +List<Nat>, +identity: +List<Nat>, +present: Bool, +version: C.Revision, +highWater: C.Revision, cp: S.CAS(expected, version), rp: S.Room(S.Base(present, version, highWater)), hp: S.Room(highWater)) -> S.PutAccepted(key, value, identity, S.Base(present, version, highWater), highWater, K.storageTransition(C.Request{key, expected, C.Put{value, identity}}, C.Slot{present, version, highWater})):
|
|
125
|
-
%Equal.sym(Bool, C.matches(expected, version), True{}, casComplete(expected, version, cp)) : S.PutAccepted(key, value, identity, S.Base(present, version, highWater), highWater, C.admit(_, key, C.Put{value, identity}, present, version, highWater))
|
|
126
|
-
%Equal.sym(Bool, C.canGrow(C.base(present, version, highWater), highWater), True{}, P.andMake(C.room(C.base(present, version, highWater)), C.room(highWater), baseRoomComplete(present, version, highWater, rp), roomComplete(highWater, hp))) : S.PutAccepted(key, value, identity, S.Base(present, version, highWater), highWater, C.grow(_, key, C.Put{value, identity}, C.base(present, version, highWater), highWater))
|
|
127
|
-
(C.next(C.base(present, version, highWater)), (C.next(highWater), ((baseSuccessor(present, version, highWater), successor(highWater)), {==})))
|
|
128
|
-
|
|
129
|
-
def storage_delete_complete(+key: +List<Nat>, +expected: C.Expectation, +version: C.Revision, +highWater: C.Revision, cp: S.CAS(expected, version), rp: S.Room(version), hp: S.Room(highWater)) -> S.DeleteAccepted(key, version, highWater, K.storageTransition(C.Request{key, expected, C.Delete{}}, C.Slot{True{}, version, highWater})):
|
|
130
|
-
%Equal.sym(Bool, C.matches(expected, version), True{}, casComplete(expected, version, cp)) : S.DeleteAccepted(key, version, highWater, C.admit(_, key, C.Delete{}, True{}, version, highWater))
|
|
131
|
-
%Equal.sym(Bool, C.canGrow(version, highWater), True{}, P.andMake(C.room(version), C.room(highWater), roomComplete(version, rp), roomComplete(highWater, hp))) : S.DeleteAccepted(key, version, highWater, C.grow(_, key, C.Delete{}, version, highWater))
|
|
132
|
-
(C.next(version), (C.next(highWater), ((successor(version), successor(highWater)), {==})))
|
|
133
|
-
|
|
134
|
-
def storage_absent_delete_complete(+key: +List<Nat>, +expected: C.Expectation, +version: C.Revision, +highWater: C.Revision, cp: S.CAS(expected, version)) -> {K.storageTransition(C.Request{key, expected, C.Delete{}}, C.Slot{False{}, version, highWater}) == C.Unchanged{} : C.Plan}:
|
|
135
|
-
%Equal.sym(Bool, C.matches(expected, version), True{}, casComplete(expected, version, cp)) : {C.admit(_, key, C.Delete{}, False{}, version, highWater) == C.Unchanged{} : C.Plan}
|
|
136
|
-
{==}
|
|
137
|
-
|
|
138
|
-
def staleSelected(+key: +List<Nat>, +expected: C.Revision, +change: C.Change, +present: Bool, +version: C.Revision, +highWater: C.Revision, +ok: Bool, p: {C.equal(expected, version) == ok : Bool}, different: {expected != version : C.Revision}) -> {C.admit(ok, key, change, present, version, highWater) == C.Conflict{} : C.Plan}:
|
|
139
|
-
match ok:
|
|
140
|
-
case False{}:
|
|
141
|
-
{==}
|
|
142
|
-
case True{}:
|
|
143
|
-
Empty.absurd({C.apply(key, change, present, version, highWater) == C.Conflict{} : C.Plan}, different(revisionExact(expected, version, p)))
|
|
144
|
-
|
|
145
|
-
def storage_stale_refused(+key: +List<Nat>, +expected: C.Revision, +change: C.Change, +present: Bool, +version: C.Revision, +highWater: C.Revision, different: {expected != version : C.Revision}) -> {K.storageTransition(C.Request{key, C.At{expected}, change}, C.Slot{present, version, highWater}) == C.Conflict{} : C.Plan}:
|
|
146
|
-
staleSelected(key, expected, change, present, version, highWater, C.equal(expected, version), {==}, different)
|
|
147
|
-
|
|
148
|
-
# Either key or global clock exhaustion independently forbids mutation.
|
|
149
|
-
def noGrowth(+version: C.Revision, +highWater: C.Revision, +room: Bool, p: {C.canGrow(version, highWater) == room : Bool}, full: (S.Room(version) & S.Room(highWater)) -> Empty) -> {room == False{} : Bool}:
|
|
150
|
-
match room:
|
|
151
|
-
case False{}:
|
|
152
|
-
{==}
|
|
153
|
-
case True{}:
|
|
154
|
-
P.andUse({True{} == False{} : Bool}, C.room(version), C.room(highWater), p, bp => hp =>
|
|
155
|
-
Empty.absurd({True{} == False{} : Bool}, full((roomSound(version, bp), roomSound(highWater, hp)))))
|
|
156
|
-
|
|
157
|
-
def noBaseGrowth(+present: Bool, +version: C.Revision, +highWater: C.Revision, full: (S.Room(S.Base(present, version, highWater)) & S.Room(highWater)) -> Empty) -> {C.canGrow(C.base(present, version, highWater), highWater) == False{} : Bool}:
|
|
158
|
-
match present:
|
|
159
|
-
case False{}:
|
|
160
|
-
noGrowth(highWater, highWater, C.canGrow(highWater, highWater), {==}, full)
|
|
161
|
-
case True{}:
|
|
162
|
-
noGrowth(version, highWater, C.canGrow(version, highWater), {==}, full)
|
|
163
|
-
|
|
164
|
-
def storage_put_overflow(+key: +List<Nat>, +expected: C.Expectation, +value: +List<Nat>, +identity: +List<Nat>, +present: Bool, +version: C.Revision, +highWater: C.Revision, cp: S.CAS(expected, version), full: (S.Room(S.Base(present, version, highWater)) & S.Room(highWater)) -> Empty) -> {K.storageTransition(C.Request{key, expected, C.Put{value, identity}}, C.Slot{present, version, highWater}) == C.Exhausted{} : C.Plan}:
|
|
165
|
-
%Equal.sym(Bool, C.matches(expected, version), True{}, casComplete(expected, version, cp)) : {C.admit(_, key, C.Put{value, identity}, present, version, highWater) == C.Exhausted{} : C.Plan}
|
|
166
|
-
%Equal.sym(Bool, C.canGrow(C.base(present, version, highWater), highWater), False{}, noBaseGrowth(present, version, highWater, full)) : {C.grow(_, key, C.Put{value, identity}, C.base(present, version, highWater), highWater) == C.Exhausted{} : C.Plan}
|
|
167
|
-
{==}
|
|
168
|
-
|
|
169
|
-
def storage_delete_overflow(+key: +List<Nat>, +expected: C.Expectation, +version: C.Revision, +highWater: C.Revision, cp: S.CAS(expected, version), full: (S.Room(version) & S.Room(highWater)) -> Empty) -> {K.storageTransition(C.Request{key, expected, C.Delete{}}, C.Slot{True{}, version, highWater}) == C.Exhausted{} : C.Plan}:
|
|
170
|
-
%Equal.sym(Bool, C.matches(expected, version), True{}, casComplete(expected, version, cp)) : {C.admit(_, key, C.Delete{}, True{}, version, highWater) == C.Exhausted{} : C.Plan}
|
|
171
|
-
%Equal.sym(Bool, C.canGrow(version, highWater), False{}, noGrowth(version, highWater, C.canGrow(version, highWater), {==}, full)) : {C.grow(_, key, C.Delete{}, version, highWater) == C.Exhausted{} : C.Plan}
|
|
172
|
-
{==}
|
|
173
|
-
|
|
174
|
-
# Negative probes: wrapper -> Conflict; CAS -> True; ignore high CAS limb;
|
|
175
|
-
# reuse old key version or clock; absent base -> version (ABA); wrong carry/low
|
|
176
|
-
# increment; swap key/value/identity; bypass canGrow; refuse absent no-op.
|
package/proofs/storage-spec.bend
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import Base
|
|
2
|
-
import ./storage-plans.bend as C
|
|
3
|
-
|
|
4
|
-
# Independent propositions: no implementation predicate/transition calls.
|
|
5
|
-
# Revision denotes high * 2^32 + low. The host supplies canonical safe snapshots
|
|
6
|
-
# and a persisted highWater covering every previously issued revision. Legacy
|
|
7
|
-
# migration can seed only retained history; already lost history is unknowable.
|
|
8
|
-
# The host must preserve the clock across eviction. OS locks, rename/crash
|
|
9
|
-
# durability, authority and multi-write transactions are NOT proved here.
|
|
10
|
-
def CAS(expected: C.Expectation, actual: C.Revision) -> Type:
|
|
11
|
-
match expected:
|
|
12
|
-
case C.Any{}:
|
|
13
|
-
Unit
|
|
14
|
-
case C.At{version}:
|
|
15
|
-
{version == actual : C.Revision}
|
|
16
|
-
|
|
17
|
-
def Room(version: C.Revision) -> Type:
|
|
18
|
-
match version:
|
|
19
|
-
case C.Revision{high, low}:
|
|
20
|
-
{Nat.is_le(high, 2097151n) == True{} : Bool} & ({Nat.is_le(low, 4294967295n) == True{} : Bool} & ({Nat.is_lt(high, 2097151n) == True{} : Bool} | {Nat.is_lt(low, 4294967295n) == True{} : Bool}))
|
|
21
|
-
|
|
22
|
-
def Successor(+before: C.Revision, after: C.Revision) -> Type:
|
|
23
|
-
match before:
|
|
24
|
-
case C.Revision{high, low}:
|
|
25
|
-
({Nat.is_eq(low, 4294967295n) == False{} : Bool} & {after == C.Revision{high, 1n+low} : C.Revision}) | ({low == 4294967295n : Nat} & {after == C.Revision{1n+high, 0n} : C.Revision})
|
|
26
|
-
|
|
27
|
-
# Allocation base is specified independently from the implementation selector.
|
|
28
|
-
def Base(present: Bool, version: C.Revision, highWater: C.Revision) -> C.Revision:
|
|
29
|
-
match present:
|
|
30
|
-
case False{}:
|
|
31
|
-
highWater
|
|
32
|
-
case True{}:
|
|
33
|
-
version
|
|
34
|
-
|
|
35
|
-
def PutPayload(change: C.Change, value: +List<Nat>, identity: +List<Nat>) -> Type:
|
|
36
|
-
match change:
|
|
37
|
-
case C.Delete{}:
|
|
38
|
-
Empty
|
|
39
|
-
case C.Put{v, i}:
|
|
40
|
-
{value == v : +List<Nat>} & {identity == i : +List<Nat>}
|
|
41
|
-
|
|
42
|
-
def IsDelete(change: C.Change) -> Type:
|
|
43
|
-
match change:
|
|
44
|
-
case C.Delete{}:
|
|
45
|
-
Unit
|
|
46
|
-
case C.Put{v, i}:
|
|
47
|
-
Empty
|
|
48
|
-
|
|
49
|
-
def Safe(request: C.Request, slot: C.Slot, plan: C.Plan) -> Type:
|
|
50
|
-
match request slot:
|
|
51
|
-
case C.Request{key, expected, change} C.Slot{present, version, highWater}:
|
|
52
|
-
match plan:
|
|
53
|
-
case C.Conflict{}:
|
|
54
|
-
Unit
|
|
55
|
-
case C.Exhausted{}:
|
|
56
|
-
Unit
|
|
57
|
-
case C.Unchanged{}:
|
|
58
|
-
CAS(expected, version) & (IsDelete(change) & {present == False{} : Bool})
|
|
59
|
-
case C.PutNext{k, v, i, next, clock}:
|
|
60
|
-
CAS(expected, version) & (Room(Base(present, version, highWater)) & (Room(highWater) & ({k == key : +List<Nat>} & (PutPayload(change, v, i) & (Successor(Base(present, version, highWater), next) & Successor(highWater, clock))))))
|
|
61
|
-
case C.DeleteNext{k, next, clock}:
|
|
62
|
-
CAS(expected, version) & (Room(version) & (Room(highWater) & ({k == key : +List<Nat>} & (IsDelete(change) & ({present == True{} : Bool} & (Successor(version, next) & Successor(highWater, clock)))))))
|
|
63
|
-
|
|
64
|
-
# Positive witnesses require actual key and clock successors, not a hypothetical
|
|
65
|
-
# successful branch. Neither predicate mentions implementation successor code.
|
|
66
|
-
def PutAccepted(+key: +List<Nat>, +value: +List<Nat>, +identity: +List<Nat>, +before: C.Revision, +highWater: C.Revision, +plan: C.Plan) -> Type:
|
|
67
|
-
&after: C.Revision -> &clock: C.Revision -> (Successor(before, after) & Successor(highWater, clock)) & {plan == C.PutNext{key, value, identity, after, clock} : C.Plan}
|
|
68
|
-
|
|
69
|
-
def DeleteAccepted(+key: +List<Nat>, +before: C.Revision, +highWater: C.Revision, +plan: C.Plan) -> Type:
|
|
70
|
-
&after: C.Revision -> &clock: C.Revision -> (Successor(before, after) & Successor(highWater, clock)) & {plan == C.DeleteNext{key, after, clock} : C.Plan}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type StorageText = { $: "Nil" } | { $: "Con"; head: number; tail: StorageText };
|
|
2
|
-
/** Canonical radix-2^32 limbs: high <= 2^21-1, low <= 2^32-1. */
|
|
3
|
-
export interface StorageRevision { $: "Revision"; high: number; low: number }
|
|
4
|
-
export type StorageExpectation = { $: "Any" } | { $: "At"; version: StorageRevision };
|
|
5
|
-
export type StorageChange = { $: "Put"; value: StorageText; identity: StorageText } | { $: "Delete" };
|
|
6
|
-
export interface StorageRequest { $: "Request"; key: StorageText; expected: StorageExpectation; change: StorageChange }
|
|
7
|
-
export interface StorageSlot { $: "Slot"; present: boolean; version: StorageRevision; highWater: StorageRevision }
|
|
8
|
-
export type StoragePlan = { $: "Conflict" } | { $: "Exhausted" } | { $: "Unchanged" } | { $: "PutNext"; key: StorageText; value: StorageText; identity: StorageText; version: StorageRevision; highWater: StorageRevision } | { $: "DeleteNext"; key: StorageText; version: StorageRevision; highWater: StorageRevision };
|
package/proofs/types.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type BendList<T> = { $: "Nil" } | { $: "Con"; head: T; tail: BendList<T> };
|
|
2
|
-
export type ResourceName = BendList<number>;
|
|
3
|
-
export type ResourceScope = { $: "Unknown" } | { $: "Exact"; names: BendList<ResourceName> };
|
|
4
|
-
export type ResourceEffect = { $: "Quiet" } | { $: "Effect"; ordered: boolean; scope: ResourceScope };
|
|
5
|
-
export interface Span { $: "Span"; first: number; last: number; paired: boolean }
|
|
6
|
-
export interface Cut { $: "Cut"; eligible: boolean; afterPrevious: boolean; retained: number; budget: number; boundary: number; spans: BendList<Span> }
|
|
7
|
-
export interface Chunk { $: "Chunk"; start: number; end: number; total: number; expectedStart: number; expectedTotal: number; length: number; complete: boolean }
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { execFileSync, spawnSync } from "node:child_process";
|
|
3
|
-
import { mkdtempSync, mkdirSync, readFileSync, writeFileSync, rmSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
-
|
|
8
|
-
const root = fileURLToPath(new URL("../", import.meta.url));
|
|
9
|
-
const env = { ...process.env, BEND_NO_TELEMETRY: "1" };
|
|
10
|
-
const bend = process.env.BEND_BIN || "bend";
|
|
11
|
-
if (execFileSync(bend, ["version"], { encoding: "utf8", env }).trim() !== "bend 2.0.37") throw new Error("Bend 2.0.37 required");
|
|
12
|
-
const inputs = JSON.parse(readFileSync(join(root, "src/verified/generated/manifest.json"), "utf8")).inputs;
|
|
13
|
-
const originals = Object.fromEntries(Object.keys(inputs).filter((path) => path.endsWith(".bend")).map((path) => [path, readFileSync(join(root, path), "utf8")]));
|
|
14
|
-
const mutations = [
|
|
15
|
-
["storage CAS bypass", "proofs/storage-plans.bend", "equal(version, actual)", "True{}"],
|
|
16
|
-
["storage deny all", "proofs/storage-kernel.bend", "C.reduce(request, slot)", "C.Conflict{}"],
|
|
17
|
-
["storage wrong key", "proofs/storage-plans.bend", "PutNext{key, value, identity, next(version), next(highWater)}", "PutNext{Nil{}, value, identity, next(version), next(highWater)}"],
|
|
18
|
-
["storage wrong payload", "proofs/storage-plans.bend", "PutNext{key, value, identity, next(version), next(highWater)}", "PutNext{key, Nil{}, identity, next(version), next(highWater)}"],
|
|
19
|
-
["storage wrong identity", "proofs/storage-plans.bend", "PutNext{key, value, identity, next(version), next(highWater)}", "PutNext{key, value, Nil{}, next(version), next(highWater)}"],
|
|
20
|
-
["storage put revision reuse", "proofs/storage-plans.bend", "PutNext{key, value, identity, next(version), next(highWater)}", "PutNext{key, value, identity, version, next(highWater)}"],
|
|
21
|
-
["storage delete revision reuse", "proofs/storage-plans.bend", "DeleteNext{key, next(version), next(highWater)}", "DeleteNext{key, version, next(highWater)}"],
|
|
22
|
-
["storage clock reuse", "proofs/storage-plans.bend", "PutNext{key, value, identity, next(version), next(highWater)}", "PutNext{key, value, identity, next(version), highWater}"],
|
|
23
|
-
["storage ignores eviction clock", "proofs/storage-plans.bend", "case False{}:\n highWater", "case False{}:\n version"],
|
|
24
|
-
["storage ignores clock exhaustion", "proofs/storage-plans.bend", "room(version) && room(highWater)", "room(version)"],
|
|
25
|
-
["storage overflow bypass", "proofs/storage-plans.bend", "room(version) && room(highWater)", "True{}"],
|
|
26
|
-
["storage lost carry", "proofs/storage-plans.bend", "Revision{1n+high, 0n}", "Revision{high, 0n}"],
|
|
27
|
-
["storage reset low limb", "proofs/storage-plans.bend", "Revision{high, 1n+low}", "Revision{high, 0n}"],
|
|
28
|
-
["storage missing-delete refusal", "proofs/storage-plans.bend", "case Delete{} False{}:\n Unchanged{}", "case Delete{} False{}:\n Conflict{}"],
|
|
29
|
-
|
|
30
|
-
["lifecycle staged admission denied", "proofs/lifecycle.bend", "case _:\n cleanup || Bool.not(revoked)", "case Staged{}:\n False{}\n case _:\n cleanup || Bool.not(revoked)"],
|
|
31
|
-
["lifecycle retiring admission denied", "proofs/lifecycle.bend", "case _:\n cleanup || Bool.not(revoked)", "case Retiring{}:\n cleanup\n case _:\n cleanup || Bool.not(revoked)"],
|
|
32
|
-
["lifecycle failed cleanup denied", "proofs/lifecycle.bend", "case Failed{}:\n cleanup", "case Failed{}:\n False{}"],
|
|
33
|
-
["lifecycle activation loses work", "proofs/lifecycle.bend", "Life{Active{}, owner, holds, calls, revoked}, Granted{}", "Life{Active{}, owner, holds, 0n, revoked}, Granted{}"],
|
|
34
|
-
["lifecycle quarantine loses work", "proofs/lifecycle.bend", "Life{Failed{}, False{}, holds, calls, True{}}, Granted{}", "Life{Failed{}, False{}, holds, 0n, True{}}, Granted{}"],
|
|
35
|
-
["lifecycle completes failed close", "proofs/lifecycle.bend", "case Complete{} _:\n Outcome{life, Denied{}}", "case Complete{} _:\n Outcome{life, Granted{}}"],
|
|
36
|
-
|
|
37
|
-
["authority widening", "proofs/authority-state.bend", "select(R.covered(candidate, grants, True{}), candidate)", "select(True{}, candidate)"],
|
|
38
|
-
["authority deny all", "proofs/authority-state.bend", "select(R.covered(candidate, grants, True{}), candidate)", "Released{}"],
|
|
39
|
-
["authority subset direction", "proofs/authority-state.bend", "R.covered(candidate, grants, True{})", "R.covered(grants, candidate, True{})"],
|
|
40
|
-
["authority release reuse", "proofs/authority-state.bend", "def release(authority: Authority) -> Authority:\n Released{}", "def release(authority: Authority) -> Authority:\n authority"],
|
|
41
|
-
["authority wrapper widening", "proofs/authority-kernel.bend", "A.derive(parent, candidate)", "A.issue(candidate)"],
|
|
42
|
-
["authority wrapper release reuse", "proofs/authority-kernel.bend", "A.release(authority)", "authority"],
|
|
43
|
-
["lifecycle uncounted work", "proofs/lifecycle.bend", "Life{phase, owner, holds, 1n+calls, revoked}, Granted{}", "Life{phase, owner, holds, calls, revoked}, Granted{}"],
|
|
44
|
-
["lifecycle close under lease", "proofs/lifecycle.bend", "case Shut{} Life{Retiring{}, False{}, 0n, 0n, revoked}:", "case Shut{} Life{Retiring{}, False{}, holds, 0n, revoked}:"],
|
|
45
|
-
["lifecycle close under work", "proofs/lifecycle.bend", "case Shut{} Life{Retiring{}, False{}, 0n, 0n, revoked}:", "case Shut{} Life{Retiring{}, False{}, 0n, calls, revoked}:"],
|
|
46
|
-
["lifecycle revocation drops work", "proofs/lifecycle.bend", "Life{retiring(phase), False{}, holds, calls, True{}}", "Life{retiring(phase), False{}, holds, 0n, True{}}"],
|
|
47
|
-
["lifecycle owner release drops holds", "proofs/lifecycle.bend", "Life{phase, False{}, holds, calls, revoked}, Granted{}", "Life{phase, False{}, 0n, calls, revoked}, Granted{}"],
|
|
48
|
-
["lifecycle close not reserved", "proofs/lifecycle.bend", "Life{Closing{}, False{}, 0n, 0n, revoked}, StartClose{}", "Life{Retiring{}, False{}, 0n, 0n, revoked}, StartClose{}"],
|
|
49
|
-
["lifecycle revoked admission", "proofs/lifecycle.bend", "cleanup || Bool.not(revoked)", "True{}"],
|
|
50
|
-
["lifecycle wrapper bypass", "proofs/lifecycle-kernel.bend", "L.bindingStep(life, event)", "L.Outcome{life, L.Granted{}}"],
|
|
51
|
-
|
|
52
|
-
["state authority bypass", "proofs/state-plans.bend", "R.nameEqual(granted, key, True{})", "True{}"],
|
|
53
|
-
["state stale revision bypass", "proofs/state-plans.bend", "&& R.nameEqual(expected, observed, True{})", "&& True{}"],
|
|
54
|
-
["state cancellation bypass", "proofs/state-plans.bend", "Bool.not(stopped)", "True{}"],
|
|
55
|
-
["state revocation bypass", "proofs/state-plans.bend", "active && (", "True{} && ("],
|
|
56
|
-
["state payload substitution", "proofs/state-plans.bend", "Write{key, expected, value}", "Write{key, expected, Nil{}}"],
|
|
57
|
-
["state target substitution", "proofs/state-plans.bend", "Write{key, expected, value}", "Write{expected, expected, value}"],
|
|
58
|
-
["state deny all", "proofs/state-plans.bend", "Write{key, expected, value}", "Denied{}"],
|
|
59
|
-
["state wrapper ignores cancellation", "proofs/state-kernel.bend", "C.writePlan(grant, key, expected, observed, value, stopped)", "C.writePlan(grant, key, expected, observed, value, False{})"],
|
|
60
|
-
|
|
61
|
-
["provider ticket reuse", "proofs/provider-plans.bend", "Outcome{Ticket{S.revoke(grant), expected, payload}", "Outcome{Ticket{grant, expected, payload}"],
|
|
62
|
-
["provider descriptor bypass", "proofs/provider-plans.bend", "S.writePlan(grant, key, expected, observed, payload, stopped)", "S.writePlan(grant, key, expected, expected, payload, stopped)"],
|
|
63
|
-
["provider identity substitution", "proofs/provider-plans.bend", "S.writePlan(grant, key, expected, observed, payload, stopped)", "S.writePlan(grant, Nil{}, expected, observed, payload, stopped)"],
|
|
64
|
-
["provider payload substitution", "proofs/provider-plans.bend", "S.writePlan(grant, key, expected, observed, payload, stopped)", "S.writePlan(grant, key, expected, observed, Nil{}, stopped)"],
|
|
65
|
-
["provider deny all", "proofs/provider-plans.bend", "S.writePlan(grant, key, expected, observed, payload, stopped)", "S.Denied{}"],
|
|
66
|
-
["provider wrapper cancellation bypass", "proofs/provider-kernel.bend", "P.take(ticket, key, observed, stopped)", "P.take(ticket, key, observed, False{})"],
|
|
67
|
-
["provider wrapper revocation bypass", "proofs/provider-kernel.bend", "P.revoke(ticket)", "ticket"],
|
|
68
|
-
["provider consumed payload corruption", "proofs/provider-plans.bend", "Outcome{Ticket{S.revoke(grant), expected, payload}", "Outcome{Ticket{S.revoke(grant), expected, Nil{}}"],
|
|
69
|
-
|
|
70
|
-
["deny valid sources", "proofs/resources.bend", "select(nonempty(names) && identitiesValid(names, True{}), names)", "Unknown{}"],
|
|
71
|
-
["lost original resource", "proofs/resources.bend", "covered(original, candidate, True{}) && covered(candidate, original, True{})", "True{} && covered(candidate, original, True{})"],
|
|
72
|
-
["injected resource", "proofs/resources.bend", "covered(original, candidate, True{}) && covered(candidate, original, True{})", "covered(original, candidate, True{}) && True{}"],
|
|
73
|
-
["truncated identity", "proofs/resources.bend", "case Nil{} Con{h, t}:\n False{}", "case Nil{} Con{h, t}:\n equal"],
|
|
74
|
-
["oversized candidate", "proofs/resources.bend", "bounded(candidate, 64n)", "bounded(candidate, 65n)"],
|
|
75
|
-
["overlong identity", "proofs/resources.bend", "nameBounded(name, 256n)", "nameBounded(name, 257n)"],
|
|
76
|
-
["forgotten unknown", "proofs/resources.bend", "case Unknown{}:\n Unknown{}", "case Unknown{}:\n Exact{Nil{}}"],
|
|
77
|
-
["dropped effect group", "proofs/resources.bend", "groups(t, ys, found || against(ys, h, False{}))", "groups(t, ys, found)"],
|
|
78
|
-
["deny every exact footprint", "proofs/resources.bend", "case True{}:\n Exact{candidate}", "case True{}:\n Unknown{}"],
|
|
79
|
-
["invalid source admitted", "proofs/resources.bend", "select(nonempty(names) && identitiesValid(names, True{}), names)", "select(True{}, names)"],
|
|
80
|
-
["open law", "PROOF.bend", "def Laws.canonical_identity(plan, changed, accepted):\n {==}", ""],
|
|
81
|
-
["footprint overflow", "proofs/kernel.bend", "all(footprintConditions(count, limit, valid))", "True{}"],
|
|
82
|
-
["stale lifecycle publication", "proofs/kernel.bend", "[Bool.not(retired), epoch, owner, Bool.not(closed)]", "[Bool.not(retired), True{}, owner, Bool.not(closed)]"],
|
|
83
|
-
["crossing tool pair", "proofs/kernel.bend", "Bool.not(paired) || Nat.is_le(boundary, first) || Nat.is_lt(last, boundary)", "True{}"],
|
|
84
|
-
["false chunk completion", "proofs/kernel.bend", "Bool.not(Bool.xor(complete, Nat.is_eq(end, total)))", "True{}"],
|
|
85
|
-
["canonical mutation", "proofs/kernel.bend", "all(normalizationConditions(canonical, plan, changed, accepted))", "True{}"],
|
|
86
|
-
["uncommitted visibility", "proofs/kernel.bend", "committed || (pending && marker)", "committed || pending"],
|
|
87
|
-
["invalid head version", "proofs/kernel.bend", "all([sequence, version, committed || (pending && marker)])", "all([sequence, True{}, committed || (pending && marker)])"],
|
|
88
|
-
["reusable certificate", "proofs/kernel.bend", "(active, False{})", "(active, True{})"],
|
|
89
|
-
];
|
|
90
|
-
const temp = mkdtempSync(join(tmpdir(), "fabric-bend-negative-"));
|
|
91
|
-
try {
|
|
92
|
-
mkdirSync(join(temp, "proofs"));
|
|
93
|
-
for (const [name, path, before, after] of mutations) {
|
|
94
|
-
if (!originals[path].includes(before)) throw new Error(`Mutation anchor disappeared: ${name}`);
|
|
95
|
-
for (const [file, source] of Object.entries(originals)) {
|
|
96
|
-
writeFileSync(join(temp, file), file === path ? source.replace(before, after) : source);
|
|
97
|
-
}
|
|
98
|
-
const result = spawnSync(bend, [join(temp, "PROOF.bend"), "--check-only"], { encoding: "utf8", env, timeout: 30_000 });
|
|
99
|
-
const output = (result.stdout ?? "") + (result.stderr ?? "");
|
|
100
|
-
if (result.error || result.signal || result.status !== 1 || !/Error:/.test(output) || /unknown:|a declared constructor|syntax/i.test(output)) {
|
|
101
|
-
throw new Error(`Expected a proof rejection for ${name}, got ${result.status}: ${result.error ?? output}`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
console.log(`${mutations.length} negative proof probes rejected invalid kernels/open laws without changing the specification.`);
|
|
105
|
-
} finally {
|
|
106
|
-
rmSync(temp, { recursive: true, force: true });
|
|
107
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
import { execFileSync } from "node:child_process";
|
|
4
|
-
import { mkdtempSync, readFileSync, writeFileSync, mkdirSync, rmSync, existsSync } from "node:fs";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
import { dirname, join, relative, resolve } from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { build, transform } from "esbuild";
|
|
9
|
-
import ts from "typescript";
|
|
10
|
-
|
|
11
|
-
const root = fileURLToPath(new URL("../", import.meta.url));
|
|
12
|
-
const version = "2.0.37";
|
|
13
|
-
const targets = [
|
|
14
|
-
{ stem: "storage-kernel", source: "proofs/storage-kernel.bend", abi: "proofs/storage-abi.json", types: "proofs/storage-types.d.ts" },
|
|
15
|
-
{ stem: "authority-kernel", source: "proofs/authority-kernel.bend", abi: "proofs/authority-abi.json", types: "proofs/authority-types.d.ts" },
|
|
16
|
-
{ stem: "lifecycle-kernel", source: "proofs/lifecycle-kernel.bend", abi: "proofs/lifecycle-abi.json", types: "proofs/lifecycle-types.d.ts" },
|
|
17
|
-
{ stem: "kernel", source: "proofs/kernel.bend", abi: "proofs/abi.json", types: "proofs/types.d.ts" },
|
|
18
|
-
{ stem: "provider-kernel", source: "proofs/provider-kernel.bend", abi: "proofs/provider-abi.json", types: "proofs/provider-types.d.ts" },
|
|
19
|
-
];
|
|
20
|
-
const sources = ["LAWS.bend", "PROOF.bend", "proofs/kernel.bend", "proofs/resources.bend", "proofs/resource-spec.bend", "proofs/resource-proof.bend", "proofs/abi.json", "proofs/types.d.ts", "scripts/verified-kernels.mjs", "proofs/state-plans.bend", "proofs/state-spec.bend", "proofs/state-proof.bend", "proofs/state-kernel.bend", "proofs/provider-plans.bend", "proofs/provider-spec.bend", "proofs/provider-kernel.bend", "proofs/provider-abi.json", "proofs/provider-types.d.ts"];
|
|
21
|
-
sources.push("proofs/lifecycle.bend", "proofs/lifecycle-kernel.bend", "proofs/lifecycle-spec.bend", "proofs/lifecycle-proof.bend", "proofs/lifecycle-abi.json", "proofs/lifecycle-types.d.ts");
|
|
22
|
-
sources.push("proofs/authority-state.bend", "proofs/authority-spec.bend", "proofs/authority-proof.bend", "proofs/authority-kernel.bend", "proofs/authority-abi.json", "proofs/authority-types.d.ts");
|
|
23
|
-
sources.push("proofs/storage-plans.bend", "proofs/storage-spec.bend", "proofs/storage-proof.bend", "proofs/storage-kernel.bend", "proofs/storage-abi.json", "proofs/storage-types.d.ts");
|
|
24
|
-
const artifactPaths = targets.flatMap(({ stem }) => [`src/verified/generated/${stem}.js`, `src/verified/generated/${stem}.d.ts`]);
|
|
25
|
-
const receipt = "src/verified/generated/manifest.json";
|
|
26
|
-
const read = (path) => readFileSync(resolve(root, path), "utf8");
|
|
27
|
-
const hash = (text) => createHash("sha256").update(text).digest("hex");
|
|
28
|
-
const inputs = () => Object.fromEntries(sources.map((path) => [path, hash(read(path))]));
|
|
29
|
-
const args = process.argv.slice(2);
|
|
30
|
-
if (args.length !== 1 || !["--write", "--check", "--artifact"].includes(args[0])) {
|
|
31
|
-
throw new Error("Usage: node scripts/verified-kernels.mjs --write|--check|--artifact");
|
|
32
|
-
}
|
|
33
|
-
const mode = args[0];
|
|
34
|
-
if (mode === "--artifact") {
|
|
35
|
-
const stored = JSON.parse(read(receipt));
|
|
36
|
-
if (stored.version !== 2 || stored.bend !== version ||
|
|
37
|
-
JSON.stringify(stored.inputs) !== JSON.stringify(inputs()) ||
|
|
38
|
-
JSON.stringify(stored.outputs) !== JSON.stringify(Object.fromEntries(artifactPaths.map(path => [path, hash(read(path))])))) {
|
|
39
|
-
throw new Error("Verified kernel artifact is stale. Run bun run proof:generate with the pinned Bend compiler.");
|
|
40
|
-
}
|
|
41
|
-
console.log("Verified kernel artifact matches its proof sources and bridge.");
|
|
42
|
-
} else {
|
|
43
|
-
const env = { ...process.env, BEND_NO_TELEMETRY: "1" };
|
|
44
|
-
const bend = (...args) => execFileSync(process.env.BEND_BIN || "bend", args, {
|
|
45
|
-
cwd: root, env, encoding: "utf8", maxBuffer: 16 * 1024 * 1024, timeout: 120_000,
|
|
46
|
-
});
|
|
47
|
-
if (bend("version").trim() !== `bend ${version}`) throw new Error(`Bend ${version} is required`);
|
|
48
|
-
for (const path of sources.filter((path) => path.endsWith(".bend"))) {
|
|
49
|
-
if (/@unsafe|\?\w|^\s*import\s+["']|^\s*import\s+0x/m.test(read(path))) {
|
|
50
|
-
throw new Error(`Unsafe code, holes, foreign effects, and remote imports are forbidden in ${path}`);
|
|
51
|
-
}
|
|
52
|
-
for (const match of read(path).matchAll(/^import\s+(\S+)/gm)) {
|
|
53
|
-
if (match[1] === "Base") continue;
|
|
54
|
-
const imported = relative(root, resolve(root, dirname(path), match[1])).replaceAll("\\", "/");
|
|
55
|
-
if (!sources.includes(imported) || !imported.endsWith(".bend")) {
|
|
56
|
-
throw new Error(`Untracked proof dependency in ${path}: ${match[1]}`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
const checked = bend("PROOF.bend", "--check-only");
|
|
61
|
-
if (!checked.includes("ALL PROOFS CHECK")) throw new Error(`Bend did not confirm closed proofs: ${checked}`);
|
|
62
|
-
const temp = mkdtempSync(join(tmpdir(), "fabric-bend-"));
|
|
63
|
-
try {
|
|
64
|
-
const files = new Map();
|
|
65
|
-
let exportsCount = 0;
|
|
66
|
-
for (const target of targets) {
|
|
67
|
-
const emitted = join(temp, `${target.stem}.mjs`);
|
|
68
|
-
bend(target.source, "-o", emitted);
|
|
69
|
-
const js = readFileSync(emitted, "utf8");
|
|
70
|
-
const ast = ts.createSourceFile("kernel.js", js, ts.ScriptTarget.Latest, true, ts.ScriptKind.JS);
|
|
71
|
-
const statements = [...ast.statements];
|
|
72
|
-
const table = statements.at(-1);
|
|
73
|
-
if (!table || !ts.isExportAssignment(table) || !ts.isObjectLiteralExpression(table.expression) ||
|
|
74
|
-
statements.some((statement) => ts.isExpressionStatement(statement))) {
|
|
75
|
-
throw new Error("Unrecognized Bend module footer; review the compiler bridge before upgrading");
|
|
76
|
-
}
|
|
77
|
-
const defs = new Map(statements.filter(ts.isFunctionDeclaration).map((node) => [node.name?.text, node]));
|
|
78
|
-
const entries = new Map(table.expression.properties.filter(ts.isPropertyAssignment)
|
|
79
|
-
.map((property) => [property.name.getText(ast).replace(/^"|"$/g, ""), property.initializer]));
|
|
80
|
-
// Bend host tags carry the declaring module ("lifecycle.Life"); root and
|
|
81
|
-
// Base constructors stay bare. The host ABI keeps bare tags, so every
|
|
82
|
-
// namespaced tag must name exactly one constructor in this kernel.
|
|
83
|
-
const literals = new Set();
|
|
84
|
-
const collect = (node) => { if (ts.isStringLiteral(node)) literals.add(node.text); ts.forEachChild(node, collect); };
|
|
85
|
-
collect(ast);
|
|
86
|
-
const tags = new Map();
|
|
87
|
-
for (const literal of literals) {
|
|
88
|
-
const bare = /^[a-z][a-z0-9-]*\.([A-Z][A-Za-z0-9]*)$/.exec(literal)?.[1];
|
|
89
|
-
if (!bare) continue;
|
|
90
|
-
if (tags.has(bare) || literals.has(bare)) throw new Error(`Ambiguous host tag ${bare} in ${target.source}`);
|
|
91
|
-
tags.set(bare, literal);
|
|
92
|
-
}
|
|
93
|
-
const abi = JSON.parse(read(target.abi));
|
|
94
|
-
const exports = Object.entries(abi).map(([name, signature]) => {
|
|
95
|
-
const symbol = `$${name}$`;
|
|
96
|
-
const arity = signature.length - 1;
|
|
97
|
-
const entry = entries.get(name);
|
|
98
|
-
if (!/^[a-zA-Z][a-zA-Z0-9]*$/.test(name) || defs.get(symbol)?.parameters.length !== arity ||
|
|
99
|
-
!entry || !ts.isCallExpression(entry) || entry.expression.getText(ast) !== "run_lib" ||
|
|
100
|
-
entry.arguments[1]?.getText(ast) !== String(arity) || !ts.isArrowFunction(entry.arguments[0]) ||
|
|
101
|
-
entry.arguments[0].parameters.length !== arity || !entry.arguments[0].getText(ast).includes(`${symbol}(`)) {
|
|
102
|
-
throw new Error(`Missing or incompatible compiled definition: ${name}`);
|
|
103
|
-
}
|
|
104
|
-
const params = Array.from({ length: arity }, (_, index) => `a${index}`);
|
|
105
|
-
return `const $lib$${name} = /* @__PURE__ */ ${entry.getText(ast)};\n` +
|
|
106
|
-
`export const ${name} = (${params.join(", ")}) => $retag$($lib$${name}(${params.map((param) => `$retag$(${param}, $tag$)`).join(", ")}), $untag$);`;
|
|
107
|
-
});
|
|
108
|
-
// Keep only the ABI entries of Bend's own module table, which marshal host
|
|
109
|
-
// naturals and drain the trampoline, and rename constructor tags at the
|
|
110
|
-
// boundary. No algorithm is translated.
|
|
111
|
-
const bridge = [
|
|
112
|
-
`const $tag$ = new Map(${JSON.stringify([...tags])});`,
|
|
113
|
-
`const $untag$ = new Map(${JSON.stringify([...tags].map(([bare, full]) => [full, bare]))});`,
|
|
114
|
-
`function $retag$(value, names) {
|
|
115
|
-
const top = [value];
|
|
116
|
-
for (const stack = [[top, 0]]; stack.length > 0;) {
|
|
117
|
-
const [parent, key] = stack.pop();
|
|
118
|
-
const node = parent[key];
|
|
119
|
-
if (node === null || typeof node !== "object") continue;
|
|
120
|
-
const copy = Array.isArray(node) ? [...node] : { ...node };
|
|
121
|
-
if (typeof copy.$ === "string") copy.$ = names.get(copy.$) ?? copy.$;
|
|
122
|
-
parent[key] = copy;
|
|
123
|
-
for (const field of Object.keys(copy)) stack.push([copy, field]);
|
|
124
|
-
}
|
|
125
|
-
return top[0];
|
|
126
|
-
}`,
|
|
127
|
-
];
|
|
128
|
-
const library = js.slice(0, table.getFullStart()) + "\n" + bridge.join("\n") + "\n" + exports.join("\n");
|
|
129
|
-
const result = await build({
|
|
130
|
-
stdin: { contents: library, sourcefile: "bend-kernel.js", resolveDir: root },
|
|
131
|
-
bundle: true, write: false, format: "esm", platform: "node", packages: "external", external: ["bun:ffi"], target: "es2022",
|
|
132
|
-
minifySyntax: true,
|
|
133
|
-
legalComments: "none", treeShaking: true,
|
|
134
|
-
banner: { js: `// Generated by Bend ${version}; do not edit. See LAWS.bend and PROOF.bend.\n// Includes adapted Bend runtime/Base code, Copyright 2026 HigherOrderCO, Apache-2.0.\n// ABI exports selected and tags adapted by Pi Fabric; see THIRD_PARTY_NOTICES.md.` },
|
|
135
|
-
});
|
|
136
|
-
const pure = result.outputFiles[0].text;
|
|
137
|
-
const generatedAst = ts.createSourceFile("generated.js", pure, ts.ScriptTarget.Latest, true, ts.ScriptKind.JS);
|
|
138
|
-
if (generatedAst.statements.some((s) => ts.isImportDeclaration(s)) || /\b(?:process|globalThis|io_exit|io_push|require|__require)\b/.test(pure)) {
|
|
139
|
-
throw new Error("Effectful runtime escaped into the pure generated library");
|
|
140
|
-
}
|
|
141
|
-
// Check unmangled names before compacting compiler locals. ABI exports stay stable.
|
|
142
|
-
const generated = (await transform(pure, {
|
|
143
|
-
format: "esm", target: "es2022", minifyIdentifiers: true, minifySyntax: true, legalComments: "none",
|
|
144
|
-
banner: `// Generated by Bend ${version}; do not edit. See LAWS.bend and PROOF.bend.\n// Includes adapted Bend runtime/Base code, Copyright 2026 HigherOrderCO, Apache-2.0.\n// ABI exports selected and tags adapted by Pi Fabric; see THIRD_PARTY_NOTICES.md.`,
|
|
145
|
-
})).code;
|
|
146
|
-
const types = `// Generated ABI declarations; see ${target.abi}.\n` + read(target.types) + "\n" +
|
|
147
|
-
Object.entries(abi).map(([name, signature]) => {
|
|
148
|
-
const args = signature.slice(0, -1).map(([name, type]) => `${name}: ${type}`).join(", ");
|
|
149
|
-
return `export declare function ${name}(${args}): ${signature.at(-1)};`;
|
|
150
|
-
}).join("\n") + "\n";
|
|
151
|
-
exportsCount += Object.keys(abi).length;
|
|
152
|
-
files.set(`src/verified/generated/${target.stem}.js`, generated);
|
|
153
|
-
files.set(`src/verified/generated/${target.stem}.d.ts`, types);
|
|
154
|
-
}
|
|
155
|
-
// Remove only previously generated outputs retired by this manifest.
|
|
156
|
-
if (mode === "--write" && existsSync(resolve(root, receipt))) {
|
|
157
|
-
const previous = JSON.parse(read(receipt));
|
|
158
|
-
for (const path of Object.keys(previous.outputs ?? {})) {
|
|
159
|
-
if (/^src\/verified\/generated\/[a-z-]+\.(?:js|d\.ts)$/.test(path) && !files.has(path)) rmSync(resolve(root, path), { force: true });
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
const outputs = Object.fromEntries([...files].map(([path, contents]) => [path, hash(contents)]));
|
|
163
|
-
files.set(receipt, JSON.stringify({ version: 2, bend: version, inputs: inputs(), outputs }, null, 2) + "\n");
|
|
164
|
-
for (const [path, contents] of files) {
|
|
165
|
-
if (mode === "--write") {
|
|
166
|
-
mkdirSync(resolve(root, "src/verified/generated"), { recursive: true });
|
|
167
|
-
writeFileSync(resolve(root, path), contents);
|
|
168
|
-
} else if (read(path) !== contents) {
|
|
169
|
-
throw new Error(`${path} differs from freshly proved/generated output; run bun run proof:generate`);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
console.log(`Bend ${version}: all laws checked; ${exportsCount} executable kernels ${mode === "--write" ? "generated" : "reproduced"} in ${targets.length} separately loadable artifacts.`);
|
|
173
|
-
} finally {
|
|
174
|
-
rmSync(temp, { recursive: true, force: true });
|
|
175
|
-
}
|
|
176
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|