pi-fabric 0.93.1 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LAWS.bend +502 -0
- package/PROOF.bend +452 -0
- package/README.md +3 -0
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/agents.js +6 -5
- package/dist/agents.js.map +1 -1
- package/dist/chunks/{chunk-3TXOQ5MG.js → chunk-3CJETB4S.js} +828 -204
- package/dist/chunks/chunk-3CJETB4S.js.map +7 -0
- package/dist/chunks/{chunk-SUJ5KLCS.js → chunk-3DUX4PXZ.js} +273 -61
- package/dist/chunks/chunk-3DUX4PXZ.js.map +7 -0
- package/dist/chunks/{chunk-IUCVOZRX.js → chunk-3SIXBW6A.js} +2 -2
- package/dist/chunks/chunk-4E63LJDD.js +468 -0
- package/dist/chunks/chunk-4E63LJDD.js.map +7 -0
- package/dist/chunks/{chunk-2X3363IK.js → chunk-754HA6KO.js} +2 -2
- package/dist/chunks/{chunk-ZDNGXLEC.js → chunk-B4HECUJI.js} +2 -2
- package/dist/chunks/{chunk-YDZOEKI6.js → chunk-CRU563MT.js} +2 -2
- package/dist/chunks/{chunk-H6DDV6E2.js → chunk-CSJSHBAT.js} +5 -5
- package/dist/chunks/{chunk-MW5VI7IW.js → chunk-D4B4CCTA.js} +2 -2
- package/dist/chunks/{chunk-EDL4JDW7.js → chunk-EBWMC3OO.js} +2 -2
- package/dist/chunks/{chunk-4NUTVNS2.js → chunk-EY57KW52.js} +5 -6
- package/dist/chunks/{chunk-7A6NVHB5.js → chunk-FJSHRHOR.js} +7 -4
- package/dist/chunks/chunk-FJSHRHOR.js.map +7 -0
- package/dist/chunks/{chunk-PSNXUZMY.js → chunk-G2F2RDZI.js} +5 -47
- package/dist/chunks/chunk-G2F2RDZI.js.map +7 -0
- package/dist/chunks/{chunk-3WIGAX56.js → chunk-JCV54SSP.js} +2 -2
- package/dist/chunks/chunk-KS44WKJJ.js +51 -0
- package/dist/chunks/chunk-KS44WKJJ.js.map +7 -0
- package/dist/chunks/{chunk-UQ7GWC27.js → chunk-LNLQ2LX3.js} +10 -1
- package/dist/chunks/chunk-LNLQ2LX3.js.map +7 -0
- package/dist/chunks/{chunk-G4LADAYY.js → chunk-OINADFEF.js} +8 -3
- package/dist/chunks/chunk-OINADFEF.js.map +7 -0
- package/dist/chunks/{chunk-UQ4LTUH4.js → chunk-OUAC6O5C.js} +36 -9
- package/dist/chunks/chunk-OUAC6O5C.js.map +7 -0
- package/dist/chunks/{chunk-L2U4B5P2.js → chunk-PVSADHF4.js} +8 -8
- package/dist/chunks/{chunk-SRZPJBNP.js → chunk-Q5BMTL6A.js} +32 -5
- package/dist/chunks/chunk-Q5BMTL6A.js.map +7 -0
- package/dist/chunks/{chunk-RTXZHKMS.js → chunk-QNMQJNXE.js} +7 -3
- package/dist/chunks/chunk-QNMQJNXE.js.map +7 -0
- package/dist/chunks/{chunk-U5FYOMG5.js → chunk-UBPFGMDQ.js} +6 -2
- package/dist/chunks/chunk-UBPFGMDQ.js.map +7 -0
- package/dist/chunks/{chunk-7VAZ4N43.js → chunk-V3PIO7QL.js} +2 -2
- package/dist/chunks/{chunk-MGDLRV2R.js → chunk-VQGO4P7C.js} +2 -2
- package/dist/chunks/{chunk-XT4346N7.js → chunk-WXSELMFV.js} +9 -3
- package/dist/chunks/chunk-WXSELMFV.js.map +7 -0
- package/dist/chunks/{chunk-D5WKZONW.js → chunk-X3IRR7CV.js} +2 -2
- package/dist/chunks/{chunk-IJL3QK3J.js → chunk-Y57UHPIK.js} +1 -1
- package/dist/chunks/{chunk-IJL3QK3J.js.map → chunk-Y57UHPIK.js.map} +1 -1
- package/dist/chunks/{chunk-RKRVOBVO.js → chunk-YYL3APFD.js} +2 -2
- package/dist/compaction/bounds.d.ts.map +1 -1
- package/dist/compaction/hook.d.ts +2 -0
- package/dist/compaction/hook.d.ts.map +1 -1
- package/dist/compaction/hook.js +6 -5
- package/dist/components/configuration.js +3 -3
- package/dist/components/effect-policy.d.ts +2 -0
- package/dist/components/effect-policy.d.ts.map +1 -1
- package/dist/components/effect-scope.d.ts.map +1 -1
- package/dist/components/supervisor.d.ts +1 -1
- package/dist/components/supervisor.d.ts.map +1 -1
- package/dist/core/action-registry.d.ts +14 -2
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +7 -5
- package/dist/core/provider-bindings.d.ts +8 -2
- package/dist/core/provider-bindings.d.ts.map +1 -1
- package/dist/core/provider-operations.d.ts +28 -0
- package/dist/core/provider-operations.d.ts.map +1 -0
- package/dist/core/provider-operations.js +201 -0
- package/dist/core/provider-operations.js.map +7 -0
- package/dist/entropy/index.js +8 -7
- package/dist/entropy/normal-form.d.ts.map +1 -1
- package/dist/execution-service.d.ts +1 -1
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +99 -145
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/index.js +21 -25
- package/dist/index.js.map +2 -2
- package/dist/jev/observation.js +5 -3
- package/dist/jev.js +9 -7
- package/dist/memory/digest.d.ts.map +1 -1
- package/dist/memory/digest.js +2 -1
- package/dist/memory/discovery.js +6 -5
- package/dist/memory/expand-service.d.ts.map +1 -1
- package/dist/memory/file-worker.js +9 -8
- package/dist/memory/file-worker.js.map +1 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/normalize.d.ts.map +1 -1
- package/dist/memory/normalize.js +5 -4
- package/dist/memory/search.js +7 -6
- package/dist/memory/worker-provider.js +10 -9
- package/dist/memory.js +9 -8
- package/dist/memory.js.map +1 -1
- package/dist/mesh/store.d.ts.map +1 -1
- package/dist/prewalk/handoff.d.ts +1 -1
- package/dist/prewalk/handoff.d.ts.map +1 -1
- package/dist/protocol.d.ts +2 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +1 -1
- package/dist/providers/jev-provider.js +9 -7
- package/dist/providers/memory-provider.js +9 -8
- package/dist/residency/host.js +10 -9
- package/dist/residency/pi-entry.js +10 -9
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/runtime/monty-runtime.js +2 -2
- package/dist/runtime/typescript-kernel.js +3 -3
- package/dist/schema/controller.d.ts.map +1 -1
- package/dist/state/store.d.ts.map +1 -1
- package/dist/ui/conversation.js +1 -1
- package/dist/ui/dashboard.js +5 -5
- package/dist/ui/highlight.d.ts.map +1 -1
- package/dist/ui/languages/bend.d.ts +4 -0
- package/dist/ui/languages/bend.d.ts.map +1 -0
- package/dist/ui/languages/bend.js +73 -0
- package/dist/ui/languages/bend.js.map +7 -0
- package/dist/ui/settings.js +2 -2
- package/dist/ui/shiki-catalog.d.ts +2 -1
- package/dist/ui/shiki-catalog.d.ts.map +1 -1
- package/dist/verified/authority.d.ts +17 -0
- package/dist/verified/authority.d.ts.map +1 -0
- package/dist/verified/generated/authority-kernel.d.ts +10 -0
- package/dist/verified/generated/authority-kernel.js +116 -0
- package/dist/verified/generated/kernel.d.ts +31 -0
- package/dist/verified/generated/kernel.js +351 -0
- package/dist/verified/generated/lifecycle-kernel.d.ts +7 -0
- package/dist/verified/generated/lifecycle-kernel.js +155 -0
- package/dist/verified/generated/manifest.json +54 -0
- package/dist/verified/generated/provider-kernel.d.ts +9 -0
- package/dist/verified/generated/provider-kernel.js +80 -0
- package/dist/verified/generated/storage-kernel.d.ts +11 -0
- package/dist/verified/generated/storage-kernel.js +98 -0
- package/dist/verified/memory.d.ts +11 -0
- package/dist/verified/memory.d.ts.map +1 -0
- package/dist/verified/nat.d.ts +2 -0
- package/dist/verified/nat.d.ts.map +1 -0
- package/dist/verified/policy.d.ts +37 -0
- package/dist/verified/policy.d.ts.map +1 -0
- package/dist/verified/resources.d.ts +14 -0
- package/dist/verified/resources.d.ts.map +1 -0
- package/dist/verified/storage.d.ts +32 -0
- package/dist/verified/storage.d.ts.map +1 -0
- package/docs/agents.md +14 -14
- package/docs/architecture.md +1 -1
- package/docs/compaction.md +2 -2
- package/docs/components.md +1 -1
- package/docs/configuration.md +5 -5
- package/docs/foreman.md +4 -4
- package/docs/harnesses.md +3 -3
- package/docs/jev.md +10 -10
- package/docs/kernels.md +2 -2
- package/docs/licenses/bend-apache-2.0.txt +202 -0
- package/docs/memory-recall.md +1 -1
- package/docs/programmatic-compaction.md +2 -2
- package/docs/provider-capabilities.md +197 -0
- package/docs/shell-middleware.md +1 -1
- package/docs/verified-kernels.md +278 -0
- package/package.json +14 -4
- package/proofs/abi.json +308 -0
- package/proofs/authority-abi.json +7 -0
- package/proofs/authority-kernel.bend +23 -0
- package/proofs/authority-proof.bend +74 -0
- package/proofs/authority-spec.bend +30 -0
- package/proofs/authority-state.bend +43 -0
- package/proofs/authority-types.d.ts +3 -0
- package/proofs/kernel.bend +139 -0
- package/proofs/lifecycle-abi.json +3 -0
- package/proofs/lifecycle-kernel.bend +11 -0
- package/proofs/lifecycle-proof.bend +249 -0
- package/proofs/lifecycle-spec.bend +261 -0
- package/proofs/lifecycle-types.d.ts +4 -0
- package/proofs/lifecycle.bend +119 -0
- package/proofs/provider-abi.json +4 -0
- package/proofs/provider-kernel.bend +14 -0
- package/proofs/provider-plans.bend +28 -0
- package/proofs/provider-spec.bend +14 -0
- package/proofs/provider-types.d.ts +5 -0
- package/proofs/resource-proof.bend +633 -0
- package/proofs/resource-spec.bend +133 -0
- package/proofs/resources.bend +160 -0
- package/proofs/state-kernel.bend +17 -0
- package/proofs/state-plans.bend +40 -0
- package/proofs/state-proof.bend +42 -0
- package/proofs/state-spec.bend +26 -0
- package/proofs/storage-abi.json +3 -0
- package/proofs/storage-kernel.bend +11 -0
- package/proofs/storage-plans.bend +100 -0
- package/proofs/storage-proof.bend +176 -0
- package/proofs/storage-spec.bend +70 -0
- package/proofs/storage-types.d.ts +8 -0
- package/proofs/types.d.ts +7 -0
- package/scripts/test-verified-kernels.mjs +107 -0
- package/scripts/verified-kernels.mjs +136 -0
- package/dist/chunks/chunk-3TXOQ5MG.js.map +0 -7
- package/dist/chunks/chunk-7A6NVHB5.js.map +0 -7
- package/dist/chunks/chunk-G4LADAYY.js.map +0 -7
- package/dist/chunks/chunk-PSNXUZMY.js.map +0 -7
- package/dist/chunks/chunk-RTXZHKMS.js.map +0 -7
- package/dist/chunks/chunk-SRZPJBNP.js.map +0 -7
- package/dist/chunks/chunk-SUJ5KLCS.js.map +0 -7
- package/dist/chunks/chunk-U5FYOMG5.js.map +0 -7
- package/dist/chunks/chunk-UQ4LTUH4.js.map +0 -7
- package/dist/chunks/chunk-UQ7GWC27.js.map +0 -7
- package/dist/chunks/chunk-XT4346N7.js.map +0 -7
- /package/dist/chunks/{chunk-IUCVOZRX.js.map → chunk-3SIXBW6A.js.map} +0 -0
- /package/dist/chunks/{chunk-2X3363IK.js.map → chunk-754HA6KO.js.map} +0 -0
- /package/dist/chunks/{chunk-ZDNGXLEC.js.map → chunk-B4HECUJI.js.map} +0 -0
- /package/dist/chunks/{chunk-YDZOEKI6.js.map → chunk-CRU563MT.js.map} +0 -0
- /package/dist/chunks/{chunk-H6DDV6E2.js.map → chunk-CSJSHBAT.js.map} +0 -0
- /package/dist/chunks/{chunk-MW5VI7IW.js.map → chunk-D4B4CCTA.js.map} +0 -0
- /package/dist/chunks/{chunk-EDL4JDW7.js.map → chunk-EBWMC3OO.js.map} +0 -0
- /package/dist/chunks/{chunk-4NUTVNS2.js.map → chunk-EY57KW52.js.map} +0 -0
- /package/dist/chunks/{chunk-3WIGAX56.js.map → chunk-JCV54SSP.js.map} +0 -0
- /package/dist/chunks/{chunk-L2U4B5P2.js.map → chunk-PVSADHF4.js.map} +0 -0
- /package/dist/chunks/{chunk-7VAZ4N43.js.map → chunk-V3PIO7QL.js.map} +0 -0
- /package/dist/chunks/{chunk-MGDLRV2R.js.map → chunk-VQGO4P7C.js.map} +0 -0
- /package/dist/chunks/{chunk-D5WKZONW.js.map → chunk-X3IRR7CV.js.map} +0 -0
- /package/dist/chunks/{chunk-RKRVOBVO.js.map → chunk-YYL3APFD.js.map} +0 -0
package/LAWS.bend
ADDED
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import ./proofs/resources.bend as R
|
|
2
|
+
import ./proofs/resource-spec.bend as RS
|
|
3
|
+
import Base
|
|
4
|
+
import ./proofs/kernel.bend as K
|
|
5
|
+
import ./proofs/state-plans.bend as SP
|
|
6
|
+
import ./proofs/state-spec.bend as SS
|
|
7
|
+
import ./proofs/state-kernel.bend as SK
|
|
8
|
+
|
|
9
|
+
import ./proofs/provider-plans.bend as DP
|
|
10
|
+
import ./proofs/provider-spec.bend as DS
|
|
11
|
+
import ./proofs/provider-kernel.bend as DK
|
|
12
|
+
|
|
13
|
+
import ./proofs/authority-kernel.bend as AK
|
|
14
|
+
import ./proofs/authority-state.bend as A
|
|
15
|
+
import ./proofs/authority-spec.bend as AS
|
|
16
|
+
|
|
17
|
+
law authority_issue_exact:
|
|
18
|
+
for +grants: +List<+List<Nat>>
|
|
19
|
+
{AK.authorityIssue(grants) == A.Active{grants} : A.Authority}
|
|
20
|
+
|
|
21
|
+
law authority_issue_live:
|
|
22
|
+
for +grants: +List<+List<Nat>>
|
|
23
|
+
{AK.authorityLive(AK.authorityIssue(grants)) == True{} : Bool}
|
|
24
|
+
|
|
25
|
+
law authority_use_safe:
|
|
26
|
+
for +authority: A.Authority
|
|
27
|
+
for +grant: +List<Nat>
|
|
28
|
+
for allowed: {AK.authorityAllows(authority, grant) == True{} : Bool}
|
|
29
|
+
AS.CanUse(authority, grant)
|
|
30
|
+
|
|
31
|
+
law authority_use_complete:
|
|
32
|
+
for +authority: A.Authority
|
|
33
|
+
for +grant: +List<Nat>
|
|
34
|
+
for member: AS.CanUse(authority, grant)
|
|
35
|
+
{AK.authorityAllows(authority, grant) == True{} : Bool}
|
|
36
|
+
|
|
37
|
+
law authority_derive_safe:
|
|
38
|
+
for +parent: A.Authority
|
|
39
|
+
for +candidate: +List<+List<Nat>>
|
|
40
|
+
AS.DerivationSafe(parent, candidate, AK.authorityDerive(parent, candidate))
|
|
41
|
+
|
|
42
|
+
law authority_derive_complete:
|
|
43
|
+
for +parent: A.Authority
|
|
44
|
+
for +candidate: +List<+List<Nat>>
|
|
45
|
+
for subset: AS.CanDerive(parent, candidate)
|
|
46
|
+
AS.DerivationAccepted(candidate, AK.authorityDerive(parent, candidate))
|
|
47
|
+
|
|
48
|
+
law authority_child_use_safe:
|
|
49
|
+
for +parent: A.Authority
|
|
50
|
+
for +candidate: +List<+List<Nat>>
|
|
51
|
+
for +grant: +List<Nat>
|
|
52
|
+
for used: {AK.authorityAllows(AK.authorityDerive(parent, candidate), grant) == True{} : Bool}
|
|
53
|
+
AS.CanUse(parent, grant)
|
|
54
|
+
|
|
55
|
+
law authority_released_refused:
|
|
56
|
+
for +authority: A.Authority
|
|
57
|
+
for +grant: +List<Nat>
|
|
58
|
+
{AK.authorityAllows(AK.authorityRelease(authority), grant) == False{} : Bool}
|
|
59
|
+
|
|
60
|
+
law authority_released_cannot_derive:
|
|
61
|
+
for +authority: A.Authority
|
|
62
|
+
for +candidate: +List<+List<Nat>>
|
|
63
|
+
{AK.authorityDerive(AK.authorityRelease(authority), candidate) == A.Released{} : A.Authority}
|
|
64
|
+
|
|
65
|
+
law authority_released_not_live:
|
|
66
|
+
for +authority: A.Authority
|
|
67
|
+
{AK.authorityLive(AK.authorityRelease(authority)) == False{} : Bool}
|
|
68
|
+
|
|
69
|
+
law provider_plan_safe:
|
|
70
|
+
for +ticket: DP.Ticket
|
|
71
|
+
for +key: +List<Nat>
|
|
72
|
+
for +observed: +List<Nat>
|
|
73
|
+
for +stopped: Bool
|
|
74
|
+
DS.Safe(ticket, key, observed, stopped, DP.plan(DK.providerTake(ticket, key, observed, stopped)))
|
|
75
|
+
|
|
76
|
+
law provider_ticket_consumed:
|
|
77
|
+
for +ticket: DP.Ticket
|
|
78
|
+
for +key: +List<Nat>
|
|
79
|
+
for +observed: +List<Nat>
|
|
80
|
+
for +stopped: Bool
|
|
81
|
+
DS.Consumed(ticket, DP.next(DK.providerTake(ticket, key, observed, stopped)))
|
|
82
|
+
|
|
83
|
+
law provider_replay_refused:
|
|
84
|
+
for +ticket: DP.Ticket
|
|
85
|
+
for +key: +List<Nat>
|
|
86
|
+
for +observed: +List<Nat>
|
|
87
|
+
for +stopped: Bool
|
|
88
|
+
for +again: +List<Nat>
|
|
89
|
+
for +revision: +List<Nat>
|
|
90
|
+
{DP.plan(DK.providerTake(DP.next(DK.providerTake(ticket, key, observed, stopped)), again, revision, False{})) == SP.Denied{} : SP.Plan}
|
|
91
|
+
|
|
92
|
+
law provider_revocation_consumes:
|
|
93
|
+
for +ticket: DP.Ticket
|
|
94
|
+
DS.Consumed(ticket, DK.providerRevoke(ticket))
|
|
95
|
+
|
|
96
|
+
law provider_revoked_refused:
|
|
97
|
+
for +ticket: DP.Ticket
|
|
98
|
+
for +key: +List<Nat>
|
|
99
|
+
for +observed: +List<Nat>
|
|
100
|
+
for +stopped: Bool
|
|
101
|
+
{DP.plan(DK.providerTake(DK.providerRevoke(ticket), key, observed, stopped)) == SP.Denied{} : SP.Plan}
|
|
102
|
+
|
|
103
|
+
law provider_canceled_refused:
|
|
104
|
+
for +ticket: DP.Ticket
|
|
105
|
+
for +key: +List<Nat>
|
|
106
|
+
for +observed: +List<Nat>
|
|
107
|
+
{DP.plan(DK.providerTake(ticket, key, observed, True{})) == SP.Denied{} : SP.Plan}
|
|
108
|
+
|
|
109
|
+
law provider_admission_complete:
|
|
110
|
+
for +key: +List<Nat>
|
|
111
|
+
for +revision: +List<Nat>
|
|
112
|
+
for +payload: +List<Nat>
|
|
113
|
+
{DP.plan(DK.providerTake(DP.Ticket{SP.Grant{True{}, key}, revision, payload}, key, revision, False{})) == SP.Write{key, revision, payload} : SP.Plan}
|
|
114
|
+
|
|
115
|
+
law state_read_safe:
|
|
116
|
+
for +grant: SP.Grant
|
|
117
|
+
for +key: +List<Nat>
|
|
118
|
+
for +stopped: Bool
|
|
119
|
+
SS.ReadSafe(grant, key, stopped, SK.stateRead(grant, key, stopped))
|
|
120
|
+
|
|
121
|
+
law state_write_safe:
|
|
122
|
+
for +grant: SP.Grant
|
|
123
|
+
for +key: +List<Nat>
|
|
124
|
+
for +expected: +List<Nat>
|
|
125
|
+
for +observed: +List<Nat>
|
|
126
|
+
for +value: +List<Nat>
|
|
127
|
+
for +stopped: Bool
|
|
128
|
+
SS.WriteSafe(grant, key, expected, observed, value, stopped, SK.stateWrite(grant, key, expected, observed, value, stopped))
|
|
129
|
+
|
|
130
|
+
law state_read_complete:
|
|
131
|
+
for +key: +List<Nat>
|
|
132
|
+
{SK.stateRead(SP.Grant{True{}, key}, key, False{}) == SP.Read{key} : SP.Plan}
|
|
133
|
+
|
|
134
|
+
law state_write_complete:
|
|
135
|
+
for +key: +List<Nat>
|
|
136
|
+
for +revision: +List<Nat>
|
|
137
|
+
for +value: +List<Nat>
|
|
138
|
+
{SK.stateWrite(SP.Grant{True{}, key}, key, revision, revision, value, False{}) == SP.Write{key, revision, value} : SP.Plan}
|
|
139
|
+
|
|
140
|
+
law state_stale_refused:
|
|
141
|
+
for +grant: SP.Grant
|
|
142
|
+
for +key: +List<Nat>
|
|
143
|
+
for +expected: +List<Nat>
|
|
144
|
+
for +observed: +List<Nat>
|
|
145
|
+
for +value: +List<Nat>
|
|
146
|
+
for +stopped: Bool
|
|
147
|
+
for different: {expected != observed : +List<Nat>}
|
|
148
|
+
{SK.stateWrite(grant, key, expected, observed, value, stopped) == SP.Denied{} : SP.Plan}
|
|
149
|
+
|
|
150
|
+
law state_revoked_read:
|
|
151
|
+
for +grant: SP.Grant
|
|
152
|
+
for +key: +List<Nat>
|
|
153
|
+
for +stopped: Bool
|
|
154
|
+
{SK.stateRead(SK.stateRevoke(grant), key, stopped) == SP.Denied{} : SP.Plan}
|
|
155
|
+
|
|
156
|
+
law state_revoked_write:
|
|
157
|
+
for +grant: SP.Grant
|
|
158
|
+
for +key: +List<Nat>
|
|
159
|
+
for +expected: +List<Nat>
|
|
160
|
+
for +observed: +List<Nat>
|
|
161
|
+
for +value: +List<Nat>
|
|
162
|
+
for +stopped: Bool
|
|
163
|
+
{SK.stateWrite(SK.stateRevoke(grant), key, expected, observed, value, stopped) == SP.Denied{} : SP.Plan}
|
|
164
|
+
|
|
165
|
+
law state_canceled_read:
|
|
166
|
+
for +grant: SP.Grant
|
|
167
|
+
for +key: +List<Nat>
|
|
168
|
+
{SK.stateRead(grant, key, True{}) == SP.Denied{} : SP.Plan}
|
|
169
|
+
|
|
170
|
+
law state_canceled_write:
|
|
171
|
+
for +grant: SP.Grant
|
|
172
|
+
for +key: +List<Nat>
|
|
173
|
+
for +expected: +List<Nat>
|
|
174
|
+
for +observed: +List<Nat>
|
|
175
|
+
for +value: +List<Nat>
|
|
176
|
+
{SK.stateWrite(grant, key, expected, observed, value, True{}) == SP.Denied{} : SP.Plan}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
# Specification boundary: review changes here independently from implementation.
|
|
180
|
+
# Predicates below spell out requirements rather than importing the kernel's
|
|
181
|
+
# condition builders. Host observations, validators, hashing, CAS, and compiler
|
|
182
|
+
# correctness remain explicit assumptions, not propositions proved here.
|
|
183
|
+
|
|
184
|
+
def AllTrue(xs: +List<Bool>) -> Type:
|
|
185
|
+
match xs:
|
|
186
|
+
case Nil{}:
|
|
187
|
+
Unit
|
|
188
|
+
case Con{h, t}:
|
|
189
|
+
{h == True{} : Bool} & AllTrue(t)
|
|
190
|
+
|
|
191
|
+
def SpanAllowed(+boundary: Nat, span: K.Span) -> Bool:
|
|
192
|
+
match span:
|
|
193
|
+
case K.Span{first, last, paired}:
|
|
194
|
+
Bool.not(paired) || Nat.is_le(boundary, first) || Nat.is_lt(last, boundary)
|
|
195
|
+
|
|
196
|
+
def SpanRequirements(spans: +List<K.Span>, +boundary: Nat) -> +List<Bool>:
|
|
197
|
+
match spans:
|
|
198
|
+
case Nil{}:
|
|
199
|
+
Nil{}
|
|
200
|
+
case Con{h, t}:
|
|
201
|
+
SpanAllowed(boundary, h) <> SpanRequirements(t, boundary)
|
|
202
|
+
|
|
203
|
+
def CutValid(cut: K.Cut) -> Type:
|
|
204
|
+
match cut:
|
|
205
|
+
case K.Cut{eligible, afterPrevious, retained, budget, boundary, spans}:
|
|
206
|
+
{eligible == True{} : Bool} & ({afterPrevious == True{} : Bool} & ({Nat.is_le(retained, budget) == True{} : Bool} & AllTrue(SpanRequirements(spans, boundary))))
|
|
207
|
+
|
|
208
|
+
def ChunkRequirements(chunk: K.Chunk) -> +List<Bool>:
|
|
209
|
+
match chunk:
|
|
210
|
+
case K.Chunk{+start, +end, +total, expectedStart, expectedTotal, length, +complete}:
|
|
211
|
+
[Nat.is_eq(start, expectedStart), Nat.is_eq(total, expectedTotal), Nat.is_le(start, end), Nat.is_le(end, total), Nat.is_eq(length, Nat.sub(end, start)), Bool.not(Bool.xor(complete, Nat.is_eq(end, total))), complete || Nat.is_lt(start, end)]
|
|
212
|
+
|
|
213
|
+
law all_sound:
|
|
214
|
+
for +xs: +List<Bool>
|
|
215
|
+
for p: {K.all(xs) == True{} : Bool}
|
|
216
|
+
AllTrue(xs)
|
|
217
|
+
|
|
218
|
+
law all_complete:
|
|
219
|
+
for +xs: +List<Bool>
|
|
220
|
+
for p: AllTrue(xs)
|
|
221
|
+
{K.all(xs) == True{} : Bool}
|
|
222
|
+
|
|
223
|
+
law footprint_sound:
|
|
224
|
+
for +count: Nat
|
|
225
|
+
for +limit: Nat
|
|
226
|
+
for +valid: Bool
|
|
227
|
+
for p: {K.footprintFits(count, limit, valid) == True{} : Bool}
|
|
228
|
+
AllTrue([valid, Nat.is_le(count, limit)])
|
|
229
|
+
|
|
230
|
+
law unknown_conflict_symmetric:
|
|
231
|
+
for +lu: Bool
|
|
232
|
+
for +luo: Bool
|
|
233
|
+
for +lo: Bool
|
|
234
|
+
for +ru: Bool
|
|
235
|
+
for +ruo: Bool
|
|
236
|
+
for +ro: Bool
|
|
237
|
+
{K.unknownConflict(lu, luo, lo, ru, ruo, ro) == K.unknownConflict(ru, ruo, ro, lu, luo, lo) : Bool}
|
|
238
|
+
|
|
239
|
+
law transition_sound:
|
|
240
|
+
for +retired: Bool
|
|
241
|
+
for +epoch: Bool
|
|
242
|
+
for +owner: Bool
|
|
243
|
+
for +closed: Bool
|
|
244
|
+
for p: {K.transitionCurrent(retired, epoch, owner, closed) == True{} : Bool}
|
|
245
|
+
AllTrue([Bool.not(retired), epoch, owner, Bool.not(closed)])
|
|
246
|
+
|
|
247
|
+
law close_sound:
|
|
248
|
+
for +retiring: Bool
|
|
249
|
+
for +owner: Bool
|
|
250
|
+
for +retained: Bool
|
|
251
|
+
for +inflight: Bool
|
|
252
|
+
for p: {K.canClose(retiring, owner, retained, inflight) == True{} : Bool}
|
|
253
|
+
AllTrue([retiring, Bool.not(owner), Bool.not(retained), Bool.not(inflight)])
|
|
254
|
+
|
|
255
|
+
law cleanup_failure_quarantines:
|
|
256
|
+
for diverted: Bool
|
|
257
|
+
{K.cleanupState(True{}, diverted) == 2 : U32}
|
|
258
|
+
|
|
259
|
+
law span_sound:
|
|
260
|
+
for +boundary: Nat
|
|
261
|
+
for +span: K.Span
|
|
262
|
+
for p: {K.spanSafe(boundary, span) == True{} : Bool}
|
|
263
|
+
{SpanAllowed(boundary, span) == True{} : Bool}
|
|
264
|
+
|
|
265
|
+
law spans_sound:
|
|
266
|
+
for +spans: +List<K.Span>
|
|
267
|
+
for +boundary: Nat
|
|
268
|
+
for p: {K.spansSafe(spans, boundary) == True{} : Bool}
|
|
269
|
+
AllTrue(SpanRequirements(spans, boundary))
|
|
270
|
+
|
|
271
|
+
law cut_sound:
|
|
272
|
+
for +cut: K.Cut
|
|
273
|
+
for p: {K.cutAccepted(cut) == True{} : Bool}
|
|
274
|
+
CutValid(cut)
|
|
275
|
+
|
|
276
|
+
law pointer_sound:
|
|
277
|
+
for +source: Bool
|
|
278
|
+
for +lineage: Bool
|
|
279
|
+
for p: {K.pointerCurrent(source, lineage) == True{} : Bool}
|
|
280
|
+
AllTrue([source, lineage])
|
|
281
|
+
|
|
282
|
+
law chunk_sound:
|
|
283
|
+
for +chunk: K.Chunk
|
|
284
|
+
for p: {K.chunkAccepted(chunk) == True{} : Bool}
|
|
285
|
+
AllTrue(ChunkRequirements(chunk))
|
|
286
|
+
|
|
287
|
+
law coverage_sound:
|
|
288
|
+
for +complete: Bool
|
|
289
|
+
for +truncated: Bool
|
|
290
|
+
for p: {K.coverageComplete(complete, truncated) == True{} : Bool}
|
|
291
|
+
AllTrue([complete, Bool.not(truncated)])
|
|
292
|
+
|
|
293
|
+
law normalization_sound:
|
|
294
|
+
for +canonical: Bool
|
|
295
|
+
for +plan: Bool
|
|
296
|
+
for +changed: Bool
|
|
297
|
+
for +accepted: Bool
|
|
298
|
+
for p: {K.useNormalized(canonical, plan, changed, accepted) == True{} : Bool}
|
|
299
|
+
AllTrue([Bool.not(canonical), plan, changed, accepted])
|
|
300
|
+
|
|
301
|
+
law canonical_identity:
|
|
302
|
+
for plan: Bool
|
|
303
|
+
for changed: Bool
|
|
304
|
+
for accepted: Bool
|
|
305
|
+
{K.useNormalized(True{}, plan, changed, accepted) == False{} : Bool}
|
|
306
|
+
|
|
307
|
+
law pending_without_marker_hidden:
|
|
308
|
+
for sequence: Bool
|
|
309
|
+
for version: Bool
|
|
310
|
+
{K.headReadable(sequence, version, False{}, True{}, False{}) == False{} : Bool}
|
|
311
|
+
|
|
312
|
+
law committed_head_visible:
|
|
313
|
+
for pending: Bool
|
|
314
|
+
for marker: Bool
|
|
315
|
+
{K.headReadable(True{}, True{}, True{}, pending, marker) == True{} : Bool}
|
|
316
|
+
|
|
317
|
+
law certificate_sound:
|
|
318
|
+
for +conditions: +List<Bool>
|
|
319
|
+
for p: {K.certificateAccepted(conditions) == True{} : Bool}
|
|
320
|
+
AllTrue(conditions)
|
|
321
|
+
|
|
322
|
+
law consume_once:
|
|
323
|
+
{K.consume(False{}) == (False{}, False{}) : Bool & Bool}
|
|
324
|
+
|
|
325
|
+
law consume_retires:
|
|
326
|
+
for active: Bool
|
|
327
|
+
{K.consume(active) == (active, False{}) : Bool & Bool}
|
|
328
|
+
|
|
329
|
+
law unknown_conflict_exact:
|
|
330
|
+
for +lu: Bool
|
|
331
|
+
for +luo: Bool
|
|
332
|
+
for +lo: Bool
|
|
333
|
+
for +ru: Bool
|
|
334
|
+
for +ruo: Bool
|
|
335
|
+
for +ro: Bool
|
|
336
|
+
{K.unknownConflict(lu, luo, lo, ru, ruo, ro) == ((lu && (luo || ro)) || (ru && (ruo || lo))) : Bool}
|
|
337
|
+
|
|
338
|
+
law active_lineage_only:
|
|
339
|
+
for member: Bool
|
|
340
|
+
{K.lineageSelected(False{}, member) == member : Bool}
|
|
341
|
+
|
|
342
|
+
law explicit_all_lineages:
|
|
343
|
+
for member: Bool
|
|
344
|
+
{K.lineageSelected(True{}, member) == True{} : Bool}
|
|
345
|
+
|
|
346
|
+
law known_conflict_exact:
|
|
347
|
+
for +shared: Bool
|
|
348
|
+
for +left: Bool
|
|
349
|
+
for +right: Bool
|
|
350
|
+
{K.knownConflict(shared, left, right) == (shared && (left || right)) : Bool}
|
|
351
|
+
|
|
352
|
+
law summary_bounds:
|
|
353
|
+
for +bytes: Nat
|
|
354
|
+
for +byteLimit: Nat
|
|
355
|
+
for +projected: Nat
|
|
356
|
+
for +target: Nat
|
|
357
|
+
for p: {K.summaryWithin(bytes, byteLimit, projected, target) == True{} : Bool}
|
|
358
|
+
AllTrue([Nat.is_le(bytes, byteLimit), Nat.is_le(projected, target)])
|
|
359
|
+
|
|
360
|
+
law sample_accounting:
|
|
361
|
+
for +total: Nat
|
|
362
|
+
for +retained: Nat
|
|
363
|
+
for +omitted: Nat
|
|
364
|
+
for +limit: Nat
|
|
365
|
+
for p: {K.sampleWithin(total, retained, omitted, limit) == True{} : Bool}
|
|
366
|
+
AllTrue([Nat.is_eq(total, Nat.add(retained, omitted)), Nat.is_le(retained, limit)])
|
|
367
|
+
|
|
368
|
+
law head_sound:
|
|
369
|
+
for +sequence: Bool
|
|
370
|
+
for +version: Bool
|
|
371
|
+
for +committed: Bool
|
|
372
|
+
for +pending: Bool
|
|
373
|
+
for +marker: Bool
|
|
374
|
+
for p: {K.headReadable(sequence, version, committed, pending, marker) == True{} : Bool}
|
|
375
|
+
AllTrue([sequence, version, committed || (pending && marker)])
|
|
376
|
+
|
|
377
|
+
# Positive obligations prevent replacing these acceptance decisions with deny-all.
|
|
378
|
+
law footprint_complete:
|
|
379
|
+
for +count: Nat
|
|
380
|
+
for +limit: Nat
|
|
381
|
+
for +valid: Bool
|
|
382
|
+
for p: AllTrue([valid, Nat.is_le(count, limit)])
|
|
383
|
+
{K.footprintFits(count, limit, valid) == True{} : Bool}
|
|
384
|
+
|
|
385
|
+
law transition_complete:
|
|
386
|
+
for +retired: Bool
|
|
387
|
+
for +epoch: Bool
|
|
388
|
+
for +owner: Bool
|
|
389
|
+
for +closed: Bool
|
|
390
|
+
for p: AllTrue([Bool.not(retired), epoch, owner, Bool.not(closed)])
|
|
391
|
+
{K.transitionCurrent(retired, epoch, owner, closed) == True{} : Bool}
|
|
392
|
+
|
|
393
|
+
law close_complete:
|
|
394
|
+
for +retiring: Bool
|
|
395
|
+
for +owner: Bool
|
|
396
|
+
for +retained: Bool
|
|
397
|
+
for +inflight: Bool
|
|
398
|
+
for p: AllTrue([retiring, Bool.not(owner), Bool.not(retained), Bool.not(inflight)])
|
|
399
|
+
{K.canClose(retiring, owner, retained, inflight) == True{} : Bool}
|
|
400
|
+
|
|
401
|
+
law normalization_complete:
|
|
402
|
+
for +canonical: Bool
|
|
403
|
+
for +plan: Bool
|
|
404
|
+
for +changed: Bool
|
|
405
|
+
for +accepted: Bool
|
|
406
|
+
for p: AllTrue([Bool.not(canonical), plan, changed, accepted])
|
|
407
|
+
{K.useNormalized(canonical, plan, changed, accepted) == True{} : Bool}
|
|
408
|
+
|
|
409
|
+
law chunk_complete:
|
|
410
|
+
for +chunk: K.Chunk
|
|
411
|
+
for p: AllTrue(ChunkRequirements(chunk))
|
|
412
|
+
{K.chunkAccepted(chunk) == True{} : Bool}
|
|
413
|
+
|
|
414
|
+
law certificate_complete:
|
|
415
|
+
for +conditions: +List<Bool>
|
|
416
|
+
for p: AllTrue(conditions)
|
|
417
|
+
{K.certificateAccepted(conditions) == True{} : Bool}
|
|
418
|
+
|
|
419
|
+
# Full declarations enter this checker. Candidate production has no authority.
|
|
420
|
+
law resource_refinement:
|
|
421
|
+
for +original: R.Scope
|
|
422
|
+
for +candidate: +List<+List<Nat>>
|
|
423
|
+
RS.Refines(original, K.resourceNormalize(original, candidate))
|
|
424
|
+
|
|
425
|
+
law resource_output_valid:
|
|
426
|
+
for +original: R.Scope
|
|
427
|
+
for +candidate: +List<+List<Nat>>
|
|
428
|
+
RS.OutputValid(K.resourceNormalize(original, candidate))
|
|
429
|
+
|
|
430
|
+
law resource_conflict_exact:
|
|
431
|
+
for +left: R.Scope
|
|
432
|
+
for +right: R.Scope
|
|
433
|
+
for +lo: Bool
|
|
434
|
+
for +ro: Bool
|
|
435
|
+
for p: {K.resourceConflict(left, right, lo, ro) == True{} : Bool}
|
|
436
|
+
RS.Conflicts(left, right, lo, ro)
|
|
437
|
+
|
|
438
|
+
law resource_conflict_complete:
|
|
439
|
+
for +left: R.Scope
|
|
440
|
+
for +right: R.Scope
|
|
441
|
+
for +lo: Bool
|
|
442
|
+
for +ro: Bool
|
|
443
|
+
for p: RS.Conflicts(left, right, lo, ro)
|
|
444
|
+
{K.resourceConflict(left, right, lo, ro) == True{} : Bool}
|
|
445
|
+
|
|
446
|
+
law resource_conflict_preserved:
|
|
447
|
+
for +left: R.Scope
|
|
448
|
+
for +right: R.Scope
|
|
449
|
+
for +lp: +List<+List<Nat>>
|
|
450
|
+
for +rp: +List<+List<Nat>>
|
|
451
|
+
for +lo: Bool
|
|
452
|
+
for +ro: Bool
|
|
453
|
+
for p: {K.resourceConflict(left, right, lo, ro) == True{} : Bool}
|
|
454
|
+
{K.resourceConflict(K.resourceNormalize(left, lp), K.resourceNormalize(right, rp), lo, ro) == True{} : Bool}
|
|
455
|
+
|
|
456
|
+
law resource_precision:
|
|
457
|
+
for +original: +List<+List<Nat>>
|
|
458
|
+
for +candidate: +List<+List<Nat>>
|
|
459
|
+
for quality: RS.Quality(candidate)
|
|
460
|
+
for forward: RS.Subset(original, candidate)
|
|
461
|
+
for backward: RS.Subset(candidate, original)
|
|
462
|
+
{K.resourceNormalize(R.Exact{original}, candidate) == R.Exact{candidate} : R.Scope}
|
|
463
|
+
|
|
464
|
+
law resource_identity:
|
|
465
|
+
for +names: +List<+List<Nat>>
|
|
466
|
+
for quality: RS.Quality(names)
|
|
467
|
+
{K.resourceNormalize(R.Exact{names}, names) == R.Exact{names} : R.Scope}
|
|
468
|
+
|
|
469
|
+
law resource_recheck_idempotent:
|
|
470
|
+
for +original: R.Scope
|
|
471
|
+
for +candidate: +List<+List<Nat>>
|
|
472
|
+
{K.resourceNormalize(K.resourceNormalize(original, candidate), candidate) == K.resourceNormalize(original, candidate) : R.Scope}
|
|
473
|
+
|
|
474
|
+
law resource_groups_exact:
|
|
475
|
+
for +left: +List<R.Effect>
|
|
476
|
+
for +right: +List<R.Effect>
|
|
477
|
+
{K.resourceGroups(left, right) == RS.Groups(left, right) : Bool}
|
|
478
|
+
|
|
479
|
+
law resource_source_refinement:
|
|
480
|
+
for +names: +List<+List<Nat>>
|
|
481
|
+
RS.Refines(R.Exact{names}, K.resourceSource(names))
|
|
482
|
+
|
|
483
|
+
law resource_source_valid:
|
|
484
|
+
for +names: +List<+List<Nat>>
|
|
485
|
+
RS.SourceValid(K.resourceSource(names))
|
|
486
|
+
|
|
487
|
+
law resource_pair_sound:
|
|
488
|
+
for +left: R.Effect
|
|
489
|
+
for +right: R.Effect
|
|
490
|
+
for p: {R.pairConflict(left, right) == True{} : Bool}
|
|
491
|
+
RS.EffectConflicts(left, right)
|
|
492
|
+
|
|
493
|
+
law resource_pair_complete:
|
|
494
|
+
for +left: R.Effect
|
|
495
|
+
for +right: R.Effect
|
|
496
|
+
for p: RS.EffectConflicts(left, right)
|
|
497
|
+
{R.pairConflict(left, right) == True{} : Bool}
|
|
498
|
+
|
|
499
|
+
law resource_source_complete:
|
|
500
|
+
for +names: +List<+List<Nat>>
|
|
501
|
+
for p: RS.SourceValid(R.Exact{names})
|
|
502
|
+
{K.resourceSource(names) == R.Exact{names} : R.Scope}
|