@ours.network/notifications 0.1.1 → 0.3.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/README.md +122 -225
- package/dist/chat-target.d.ts +9 -0
- package/dist/chat-target.js +12 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +13 -445
- package/dist/presence.d.ts +12 -0
- package/dist/presence.js +55 -145
- package/dist/server.d.ts +26 -0
- package/dist/server.js +145 -0
- package/dist/store.d.ts +63 -0
- package/dist/store.js +181 -0
- package/dist/validation.d.ts +9 -0
- package/dist/validation.js +60 -0
- package/package.json +14 -24
- package/dist/config.js +0 -104
- package/dist/daemon.js +0 -353
- package/dist/http.js +0 -31
- package/dist/log-store.js +0 -48
- package/dist/provision.js +0 -29
- package/dist/push.js +0 -6
- package/dist/web-push-sender.js +0 -41
- package/mufl_code/20E39399689579D5AFA5132C59DEDDD328C3BCA1A74D546F2193B36585DDD283.muflo +0 -0
- package/mufl_code/config.mufl +0 -21
- package/mufl_code/core/.github/FUNDING.yml +0 -3
- package/mufl_code/core/.github/workflows/docs.yml +0 -39
- package/mufl_code/core/.github/workflows/tests.yml +0 -66
- package/mufl_code/core/COMMERCIAL-LICENCE.md +0 -25
- package/mufl_code/core/COMPATIBILITY.md +0 -221
- package/mufl_code/core/CONTRIBUTING.md +0 -37
- package/mufl_code/core/LICENSE +0 -98
- package/mufl_code/core/NOTIFICATIONS_CONTRACT.md +0 -290
- package/mufl_code/core/README.md +0 -91
- package/mufl_code/core/SECURITY.md +0 -40
- package/mufl_code/core/TRADEMARKS.md +0 -24
- package/mufl_code/core/a2a_capabilities.mm +0 -449
- package/mufl_code/core/a2a_cluster.mm +0 -601
- package/mufl_code/core/a2a_control.mm +0 -90
- package/mufl_code/core/a2a_messaging.mm +0 -4817
- package/mufl_code/core/a2a_monitoring.mm +0 -94
- package/mufl_code/core/a2a_notification_integration.mm +0 -144
- package/mufl_code/core/a2a_notifications.mm +0 -1127
- package/mufl_code/core/a2a_protocol.mm +0 -246
- package/mufl_code/core/a2a_versions.mm +0 -801
- package/mufl_code/core/config.mufl +0 -29
- package/mufl_code/core/docs/.vitepress/config.mts +0 -58
- package/mufl_code/core/docs/citations.json +0 -688
- package/mufl_code/core/docs/guide/01-vendor-the-core.md +0 -50
- package/mufl_code/core/docs/guide/02-configure-and-compile.md +0 -100
- package/mufl_code/core/docs/guide/03-wire-the-host.md +0 -154
- package/mufl_code/core/docs/guide/04-connect-and-message.md +0 -156
- package/mufl_code/core/docs/guide/05-test-your-app.md +0 -75
- package/mufl_code/core/docs/guide/index.md +0 -63
- package/mufl_code/core/docs/how-it-works/capabilities-and-control.md +0 -77
- package/mufl_code/core/docs/how-it-works/cluster.md +0 -65
- package/mufl_code/core/docs/how-it-works/identity.md +0 -56
- package/mufl_code/core/docs/how-it-works/invites-and-contacts.md +0 -76
- package/mufl_code/core/docs/how-it-works/messaging.md +0 -55
- package/mufl_code/core/docs/how-it-works/monitoring-and-config.md +0 -72
- package/mufl_code/core/docs/how-it-works/overview.md +0 -45
- package/mufl_code/core/docs/how-it-works/versioning.md +0 -116
- package/mufl_code/core/docs/index.md +0 -27
- package/mufl_code/core/docs/package-lock.json +0 -3467
- package/mufl_code/core/docs/package.json +0 -15
- package/mufl_code/core/docs/reference/contributing.md +0 -26
- package/mufl_code/core/docs/reference/glossary.md +0 -108
- package/mufl_code/core/docs/reference/implementations.md +0 -23
- package/mufl_code/core/docs/reference/modules.md +0 -19
- package/mufl_code/core/docs/scripts/check-citations.mjs +0 -36
- package/mufl_code/core/docs/scripts/check-denylist.mjs +0 -30
- package/mufl_code/core/docs/scripts/gen-llms.mjs +0 -32
- package/mufl_code/core/docs/workflows/cluster.md +0 -89
- package/mufl_code/core/docs/workflows/contact-exchange.md +0 -60
- package/mufl_code/core/docs/workflows/contact-restore.md +0 -60
- package/mufl_code/core/docs/workflows/control-verbs.md +0 -70
- package/mufl_code/core/docs/workflows/index.md +0 -57
- package/mufl_code/core/docs/workflows/introductions.md +0 -60
- package/mufl_code/core/docs/workflows/messaging.md +0 -75
- package/mufl_code/core/docs/workflows/monitoring.md +0 -84
- package/mufl_code/core/docs/workflows/notifications.md +0 -109
- package/mufl_code/core/release-notes/0.1.md +0 -60
- package/mufl_code/core/release-notes/0.3.md +0 -22
- package/mufl_code/core/release-notes/0.4.md +0 -97
- package/mufl_code/core/tests/README.md +0 -83
- package/mufl_code/core/tests/compat/README.md +0 -82
- package/mufl_code/core/tests/compat/compat.mjs +0 -245
- package/mufl_code/core/tests/compat/compat_peer.mjs +0 -146
- package/mufl_code/core/tests/compat/run_compat.sh +0 -96
- package/mufl_code/core/tests/corpus.mjs +0 -139
- package/mufl_code/core/tests/corpus_actor.mu +0 -242
- package/mufl_code/core/tests/fatcompile_actor.mu +0 -52
- package/mufl_code/core/tests/mig.mjs +0 -805
- package/mufl_code/core/tests/mig_actor.mu +0 -518
- package/mufl_code/core/tests/migapp.mjs +0 -431
- package/mufl_code/core/tests/migapp_actor.mu +0 -294
- package/mufl_code/core/tests/mufl_semantics/run.sh +0 -69
- package/mufl_code/core/tests/mufl_semantics/t11_three_version.mufl +0 -47
- package/mufl_code/core/tests/mufl_semantics/t2_extra_fields.mufl +0 -11
- package/mufl_code/core/tests/mufl_semantics/t7_runtime.mufl +0 -30
- package/mufl_code/core/tests/mufl_semantics/t9_passthrough.mufl +0 -19
- package/mufl_code/core/tests/mufl_semantics/t_str_order.mufl +0 -19
- package/mufl_code/core/tests/notif.mjs +0 -755
- package/mufl_code/core/tests/notif_actor.mu +0 -450
- package/mufl_code/core/tests/protocol_container.mm +0 -18
- package/mufl_code/core/tests/run.sh +0 -65
- package/mufl_code/core/tests/run_corpus.sh +0 -51
- package/mufl_code/core/tests/run_fatcompile.sh +0 -40
- package/mufl_code/core/tests/run_mig.sh +0 -51
- package/mufl_code/core/tests/run_migapp.sh +0 -51
- package/mufl_code/core/tests/run_notif.sh +0 -57
- package/mufl_code/core/tests/test.mjs +0 -750
- package/mufl_code/core/tests/test_actor.mu +0 -564
- package/mufl_code/core/tests/test_common.mjs +0 -93
- package/mufl_code/core/version.mm +0 -24
- package/mufl_code/packet.mu +0 -170
- package/mufl_code/protocol_container.mm +0 -18
- package/scripts/gen-vapid.mjs +0 -16
|
@@ -1,450 +0,0 @@
|
|
|
1
|
-
// Notifications test actor for the a2a_notifications N-series (tests/notif.mjs).
|
|
2
|
-
//
|
|
3
|
-
// SPLIT from test_actor.mu deliberately: the compiler bounds meta-stage
|
|
4
|
-
// type-level reduction PER COMPILED UNIT (adapt src/eval/meta_reduction_fuel.h,
|
|
5
|
-
// 1M steps — a consensus-deterministic compile-time DoS guard). test_actor loads
|
|
6
|
-
// BOTH heavy libraries a2a_messaging (139KB) AND a2a_notifications (57KB) and,
|
|
7
|
-
// after the 0.9.0 migration surface landed in a2a_messaging, tips OVER the
|
|
8
|
-
// per-unit ceiling. a2a_messaging has ZERO references to a2a_notifications (the
|
|
9
|
-
// dep is one-way: notifications -> messaging), so the fix is to move the
|
|
10
|
-
// notifications tests into THEIR OWN unit and drop a2a_notifications from
|
|
11
|
-
// test_actor. This unit loads BOTH libraries (a2a_notifications needs
|
|
12
|
-
// a2a_messaging's contact machinery) but exercises ONLY the N-series
|
|
13
|
-
// notification transactions, so it too fits under the per-unit budget.
|
|
14
|
-
//
|
|
15
|
-
// It carries the SHARED host wiring the notify flows need (a2a_messaging::init
|
|
16
|
-
// storage hooks for the invite/contact machinery the N-series set-up uses; a
|
|
17
|
-
// tiny inbox; the identity helpers) PLUS everything notification-specific: the
|
|
18
|
-
// a2a_notifications::init block, the notify hook logs, and the notify qa probes.
|
|
19
|
-
// The COMBINED core+notify export_state/import_state round-trip lives HERE (this
|
|
20
|
-
// is the only unit that loads both libraries) — see qa export_state/import_state.
|
|
21
|
-
|
|
22
|
-
application actor loads libraries
|
|
23
|
-
identity_proof_document,
|
|
24
|
-
attestation_document,
|
|
25
|
-
native_attestation_document,
|
|
26
|
-
transaction_message_decoder,
|
|
27
|
-
address_document,
|
|
28
|
-
address_document_types,
|
|
29
|
-
key_utils,
|
|
30
|
-
key_storage,
|
|
31
|
-
continuation,
|
|
32
|
-
encrypted_channel,
|
|
33
|
-
a2a_versions,
|
|
34
|
-
a2a_capabilities,
|
|
35
|
-
a2a_protocol,
|
|
36
|
-
a2a_messaging,
|
|
37
|
-
a2a_notifications,
|
|
38
|
-
a2a_notification_integration,
|
|
39
|
-
current_transaction_info,
|
|
40
|
-
protocol_container,
|
|
41
|
-
version
|
|
42
|
-
uses transactions
|
|
43
|
-
{
|
|
44
|
-
hidden
|
|
45
|
-
{
|
|
46
|
-
// Minimal inbox (the app owns message storage; the core calls the hook).
|
|
47
|
-
metadef msg_t: ($sender -> global_id, $text -> str, $wire_id -> str, $reply_wire -> str).
|
|
48
|
-
inbox is msg_t[] = [].
|
|
49
|
-
|
|
50
|
-
// Minimal file store (the app owns file storage; the core calls the hook).
|
|
51
|
-
metadef file_t: ($sender -> global_id, $filename -> str, $mime -> str, $wire_id -> str, $reply_wire -> str).
|
|
52
|
-
files is file_t[] = [].
|
|
53
|
-
|
|
54
|
-
// Wire the deserialization primitive into the libraries that need it.
|
|
55
|
-
_read_or_abort = grab( _read_or_abort ).
|
|
56
|
-
key_storage::init ($_read_or_abort -> _read_or_abort).
|
|
57
|
-
encrypted_channel::init ($_read_or_abort -> _read_or_abort).
|
|
58
|
-
|
|
59
|
-
// Host-protocol action helpers (the driver resolves on kind "data").
|
|
60
|
-
fn _save_state (_) = (transaction::action::return_data ($kind -> $save_state)).
|
|
61
|
-
fn _return_data (payload: any) = (transaction::action::return_data ($kind -> $data, $payload -> payload)).
|
|
62
|
-
fn _notify_agent (payload: any) = (transaction::action::return_data ($kind -> $notify_agent, $payload -> payload)).
|
|
63
|
-
|
|
64
|
-
// Receipt consumer log (core 0.7.0) — unused by the N-series but the
|
|
65
|
-
// a2a_messaging::init hook requires it.
|
|
66
|
-
receipts_log is any[] = [].
|
|
67
|
-
|
|
68
|
-
// Storage hooks: deposit inbound messages; send/remove are no-ops.
|
|
69
|
-
a2a_messaging::init (
|
|
70
|
-
$_read_or_abort -> _read_or_abort,
|
|
71
|
-
$on_message_received -> fn (arg: any) -> transaction::action::type[]
|
|
72
|
-
{
|
|
73
|
-
sid = (arg $sender_id) safe global_id.
|
|
74
|
-
txt = (arg $text) safe str.
|
|
75
|
-
wid is str = "".
|
|
76
|
-
if (arg $wire_id) != NIL { wid -> (arg $wire_id) safe str. }
|
|
77
|
-
rw is str = "".
|
|
78
|
-
if (arg $reply_to) != NIL { rw -> ((arg $reply_to) $wire_id) safe str. }
|
|
79
|
-
inbox (_count inbox|) -> ($sender -> sid, $text -> txt, $wire_id -> wid, $reply_wire -> rw).
|
|
80
|
-
return [ _notify_agent ($event -> $message_received), _save_state NIL ].
|
|
81
|
-
},
|
|
82
|
-
$on_message_sent -> fn (_: any) -> transaction::action::type[] { return []. },
|
|
83
|
-
$on_contact_removed -> fn (_: any) -> transaction::action::type[] { return []. },
|
|
84
|
-
$on_file_received -> fn (arg: any) -> transaction::action::type[]
|
|
85
|
-
{
|
|
86
|
-
sid = (arg $sender_id) safe global_id.
|
|
87
|
-
fname = (arg $filename) safe str.
|
|
88
|
-
mt = (arg $mime) safe str.
|
|
89
|
-
wid is str = "".
|
|
90
|
-
if (arg $wire_id) != NIL { wid -> (arg $wire_id) safe str. }
|
|
91
|
-
rw is str = "".
|
|
92
|
-
if (arg $reply_to) != NIL { rw -> ((arg $reply_to) $wire_id) safe str. }
|
|
93
|
-
files (_count files|) -> ($sender -> sid, $filename -> fname, $mime -> mt, $wire_id -> wid, $reply_wire -> rw).
|
|
94
|
-
return [ _notify_agent ($event -> $file_received), _save_state NIL ].
|
|
95
|
-
},
|
|
96
|
-
$on_file_sent -> fn (_: any) -> transaction::action::type[] { return []. },
|
|
97
|
-
$on_receipt_received -> fn (arg: any) -> transaction::action::type[]
|
|
98
|
-
{
|
|
99
|
-
receipts_log (_count receipts_log|) -> arg.
|
|
100
|
-
return [ _notify_agent ($event -> $receipt_received), _save_state NIL ].
|
|
101
|
-
}
|
|
102
|
-
).
|
|
103
|
-
|
|
104
|
-
// Notification hook logs (the app owns notification storage; the core
|
|
105
|
-
// calls the hooks). Plain observable lists the qa probes expose.
|
|
106
|
-
notif_log is any[] = [].
|
|
107
|
-
marks_log is any[] = [].
|
|
108
|
-
unregs_log is any[] = [].
|
|
109
|
-
regconfirm_log is any[] = [].
|
|
110
|
-
|
|
111
|
-
// The integration supplies ordinary client defaults; this dual-role
|
|
112
|
-
// test actor then overrides them with observable service/client hooks.
|
|
113
|
-
a2a_notification_integration::init ($_read_or_abort -> _read_or_abort).
|
|
114
|
-
a2a_notifications::init (
|
|
115
|
-
$_read_or_abort -> _read_or_abort,
|
|
116
|
-
$on_notification_posted -> fn (arg: any) -> transaction::action::type[]
|
|
117
|
-
{
|
|
118
|
-
notif_log (_count notif_log|) -> arg.
|
|
119
|
-
return [ _notify_agent ($event -> $notification_posted), _save_state NIL ].
|
|
120
|
-
},
|
|
121
|
-
$on_notifications_marked_read -> fn (arg: any) -> transaction::action::type[]
|
|
122
|
-
{
|
|
123
|
-
marks_log (_count marks_log|) -> arg.
|
|
124
|
-
return [ _save_state NIL ].
|
|
125
|
-
},
|
|
126
|
-
$on_unregistered -> fn (arg: any) -> transaction::action::type[]
|
|
127
|
-
{
|
|
128
|
-
unregs_log (_count unregs_log|) -> arg.
|
|
129
|
-
return [ _save_state NIL ].
|
|
130
|
-
},
|
|
131
|
-
$on_notify_registration -> fn (arg: any) -> transaction::action::type[]
|
|
132
|
-
{
|
|
133
|
-
regconfirm_log (_count regconfirm_log|) -> arg.
|
|
134
|
-
return [ _save_state NIL ].
|
|
135
|
-
}
|
|
136
|
-
).
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// ---- minimal host surface used by the driver ----
|
|
140
|
-
// The core's send_message delivers to the legacy ::actor::receive_message name;
|
|
141
|
-
// this shim routes it into the core receive handler (→ on_message_received hook).
|
|
142
|
-
trn receive_message args: any { return a2a_messaging::handle_receive_message args. }
|
|
143
|
-
trn readonly list_incoming_messages _ { return ($inbox -> inbox). }
|
|
144
|
-
trn readonly list_incoming_files _ { return ($files -> files). }
|
|
145
|
-
|
|
146
|
-
// export/import wrappers: this UNIT loads BOTH libraries, so the COMBINED
|
|
147
|
-
// core+notify round-trip lives here (test_actor keeps only the core half).
|
|
148
|
-
// The "both halves coexist in one blob and both restore" coverage (N7/N16)
|
|
149
|
-
// is asserted against these.
|
|
150
|
-
trn readonly export_state _ {
|
|
151
|
-
return (
|
|
152
|
-
$core -> (a2a_messaging::export_core_state NIL),
|
|
153
|
-
$notify -> (a2a_notifications::export_notify_state NIL),
|
|
154
|
-
$notify_integration -> (a2a_notification_integration::export_state NIL)
|
|
155
|
-
).
|
|
156
|
-
}
|
|
157
|
-
trn import_state data: any
|
|
158
|
-
{
|
|
159
|
-
current_transaction_info::validate_origin_or_abort (transaction::envelope::origin::user,).
|
|
160
|
-
a2a_messaging::import_core_state (data $core).
|
|
161
|
-
if (data $notify) != NIL { a2a_notifications::import_notify_state (data $notify). }
|
|
162
|
-
if (data $notify_integration) != NIL { a2a_notification_integration::import_state (data $notify_integration). }
|
|
163
|
-
return transaction::success [ _return_data ($imported -> TRUE), _save_state NIL ].
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Inject a learned capability set for a contact — drives the V5 CAP-1 gate
|
|
167
|
-
// test (positive-evidence denial vs unknown/empty pass-through).
|
|
168
|
-
trn qa_set_contact_caps _:($cid -> cid: global_id, $caps -> caps: str[])
|
|
169
|
-
{
|
|
170
|
-
current_transaction_info::validate_origin_or_abort (transaction::envelope::origin::user,).
|
|
171
|
-
a2a_messaging::contact_caps cid -> caps.
|
|
172
|
-
return transaction::success [ _return_data ($set -> TRUE), _save_state NIL ].
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// ================= NOTIFICATION TEST PROBES =================
|
|
176
|
-
|
|
177
|
-
// Deployed-peer compatibility shim: old senders still address ::actor::*;
|
|
178
|
-
// state and validation are owned by the integration library.
|
|
179
|
-
trn receive_notify_address args: any { return a2a_notification_integration::handle_receive_notify_address args. }
|
|
180
|
-
trn readonly qa_notify_addr_store _
|
|
181
|
-
{
|
|
182
|
-
return ($store -> a2a_notification_integration::received_notify_addresses).
|
|
183
|
-
}
|
|
184
|
-
// Send either the new library-routed handout or the deployed ::actor::*
|
|
185
|
-
// shape. Nullable address deletes the receiver's stored handout.
|
|
186
|
-
trn qa_send_notify_address _:($target -> tgt: global_id, $address -> blob: bin+, $legacy -> legacy: bool)
|
|
187
|
-
{
|
|
188
|
-
current_transaction_info::validate_origin_or_abort (transaction::envelope::origin::user,).
|
|
189
|
-
return encrypted_channel::execute_transaction tgt (fn (_) -> transaction::results::type {
|
|
190
|
-
tx_name is str = "::a2a_notification_integration::receive_notify_address".
|
|
191
|
-
if legacy { tx_name -> "::actor::receive_notify_address". }
|
|
192
|
-
return transaction::success [
|
|
193
|
-
encrypted_channel::send_encrypted_tx tgt (
|
|
194
|
-
$name -> tx_name,
|
|
195
|
-
$targ -> ($address -> blob)
|
|
196
|
-
),
|
|
197
|
-
_return_data ($sent_to -> tgt)
|
|
198
|
-
].
|
|
199
|
-
}).
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// Notification state + hook logs — for receiver-side assertions (N-series).
|
|
203
|
-
trn readonly qa_notify_state _
|
|
204
|
-
{
|
|
205
|
-
return (
|
|
206
|
-
$registrations -> a2a_notifications::notify_registrations,
|
|
207
|
-
$token_index -> a2a_notifications::notify_token_index,
|
|
208
|
-
$my_regs -> a2a_notifications::my_notify_registrations,
|
|
209
|
-
$pending -> a2a_notifications::pending_notify_registers,
|
|
210
|
-
$vapid_pub -> a2a_notifications::vapid_public_key,
|
|
211
|
-
$notif_log -> notif_log,
|
|
212
|
-
$marks_log -> marks_log,
|
|
213
|
-
$unregs_log -> unregs_log,
|
|
214
|
-
$regconfirm_log -> regconfirm_log
|
|
215
|
-
).
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// v2: per-sender token maps + contact-token mirror (N9-series probes).
|
|
219
|
-
trn readonly qa_notify_state_v2 _
|
|
220
|
-
{
|
|
221
|
-
return (
|
|
222
|
-
$sender_tokens -> a2a_notifications::notify_sender_tokens,
|
|
223
|
-
$sender_muted -> a2a_notifications::notify_sender_muted,
|
|
224
|
-
$contact_tokens -> a2a_notifications::my_notify_contact_tokens
|
|
225
|
-
).
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// Extract the scoped token_id for a specific (recipient, sender) pair from
|
|
229
|
-
// notify_sender_tokens. Used in N10 to prove handle_issue_tokens indexes scoped
|
|
230
|
-
// tokens into notify_token_index (revocation mechanism): the returned token_id
|
|
231
|
-
// must appear as a key in notify_token_index; if the indexing line were removed
|
|
232
|
-
// from handle_issue_tokens the token would exist in sender_tokens but be absent
|
|
233
|
-
// from the index and the N10 assertion would fail.
|
|
234
|
-
trn readonly qa_scoped_token_id _:($recipient -> r: global_id, $sender -> s: global_id)
|
|
235
|
-
{
|
|
236
|
-
outer = a2a_notifications::notify_sender_tokens r.
|
|
237
|
-
abort "No sender tokens for recipient." when outer == NIL.
|
|
238
|
-
inner_map = outer?.
|
|
239
|
-
tok = inner_map s.
|
|
240
|
-
abort "No token for this sender." when tok == NIL.
|
|
241
|
-
return ($token_id -> (tok? $c $token_id)).
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// Send a raw issue_tokens directly to a service (bypasses client-side paging —
|
|
245
|
-
// used to probe the batch-cap gate and the registered-recipient gate).
|
|
246
|
-
trn qa_issue_tokens_direct _:($service -> svc: global_id, $senders -> senders: any)
|
|
247
|
-
{
|
|
248
|
-
return encrypted_channel::execute_transaction svc (fn (_) -> transaction::results::type {
|
|
249
|
-
return transaction::success [
|
|
250
|
-
encrypted_channel::send_encrypted_tx svc (
|
|
251
|
-
$name -> "::a2a_notifications::issue_tokens",
|
|
252
|
-
$targ -> ($senders -> senders)
|
|
253
|
-
),
|
|
254
|
-
_return_data ($sent_to -> svc)
|
|
255
|
-
].
|
|
256
|
-
}).
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// Import a v1-era notify record (fields $notify_sender_tokens/$notify_sender_muted/
|
|
260
|
-
// $my_notify_contact_tokens absent) and return the post-import map state.
|
|
261
|
-
// Used for the v1-era import fixture: verifies import_notify_state handles missing v2 fields
|
|
262
|
-
// by leaving the defaults (empty maps) in place.
|
|
263
|
-
trn qa_import_v1_notify_state _:($vapid -> vapid: str)
|
|
264
|
-
{
|
|
265
|
-
current_transaction_info::validate_origin_or_abort (transaction::envelope::origin::user,).
|
|
266
|
-
a2a_notifications::import_notify_state (
|
|
267
|
-
$my_notify_registrations -> (,),
|
|
268
|
-
$notify_registrations -> (,),
|
|
269
|
-
$notify_token_index -> (,),
|
|
270
|
-
$vapid_public_key -> vapid
|
|
271
|
-
// $notify_sender_tokens, $notify_sender_muted, $my_notify_contact_tokens
|
|
272
|
-
// intentionally absent — simulates a v1-era export record shape.
|
|
273
|
-
).
|
|
274
|
-
return transaction::success [
|
|
275
|
-
_return_data (
|
|
276
|
-
$sender_tokens -> a2a_notifications::notify_sender_tokens,
|
|
277
|
-
$sender_muted -> a2a_notifications::notify_sender_muted,
|
|
278
|
-
$contact_tokens -> a2a_notifications::my_notify_contact_tokens
|
|
279
|
-
),
|
|
280
|
-
_save_state NIL
|
|
281
|
-
].
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// ---- adversarial notification senders (N3/N8) ----
|
|
285
|
-
// Emit the SAME bare send send_notification emits, with a corrupted artifact.
|
|
286
|
-
// modes: flip_recipient (different $recipient_cid, old $s — dies on the index
|
|
287
|
-
// match), fake_token_id (dies on the index lookup), foreign_service (dies on
|
|
288
|
-
// the minted-by-me check), flip_scope ($scope flipped, id/recipient intact —
|
|
289
|
-
// dies ONLY on the _value_id byte-equality), oversize (valid token, 4096-char
|
|
290
|
-
// payload — dies on the service-side cap).
|
|
291
|
-
trn qa_post_tampered _:($address -> blob: bin, $mode -> mode: str)
|
|
292
|
-
{
|
|
293
|
-
addr = (_read_or_abort blob) safe a2a_notifications::notify_address_t.
|
|
294
|
-
token is a2a_notifications::notify_token_t = addr $token.
|
|
295
|
-
old = token $c.
|
|
296
|
-
payload is str = "tampered".
|
|
297
|
-
if mode == "flip_recipient"
|
|
298
|
-
{
|
|
299
|
-
core is a2a_notifications::notify_token_core_t = (
|
|
300
|
-
$version -> (old $version), $service_cid -> (old $service_cid),
|
|
301
|
-
$recipient_cid -> _get_container_id(),
|
|
302
|
-
$token_id -> (old $token_id), $scope -> (old $scope), $iat -> (old $iat)
|
|
303
|
-
).
|
|
304
|
-
token -> ($c -> core, $s -> (token $s)).
|
|
305
|
-
}
|
|
306
|
-
if mode == "fake_token_id"
|
|
307
|
-
{
|
|
308
|
-
core is a2a_notifications::notify_token_core_t = (
|
|
309
|
-
$version -> (old $version), $service_cid -> (old $service_cid),
|
|
310
|
-
$recipient_cid -> (old $recipient_cid),
|
|
311
|
-
$token_id -> _new_id "qa fake token id", $scope -> (old $scope), $iat -> (old $iat)
|
|
312
|
-
).
|
|
313
|
-
token -> ($c -> core, $s -> (token $s)).
|
|
314
|
-
}
|
|
315
|
-
if mode == "foreign_service"
|
|
316
|
-
{
|
|
317
|
-
core is a2a_notifications::notify_token_core_t = (
|
|
318
|
-
$version -> (old $version), $service_cid -> _get_container_id(),
|
|
319
|
-
$recipient_cid -> (old $recipient_cid),
|
|
320
|
-
$token_id -> (old $token_id), $scope -> (old $scope), $iat -> (old $iat)
|
|
321
|
-
).
|
|
322
|
-
token -> ($c -> core, $s -> (token $s)).
|
|
323
|
-
}
|
|
324
|
-
if mode == "flip_scope"
|
|
325
|
-
{
|
|
326
|
-
core is a2a_notifications::notify_token_core_t = (
|
|
327
|
-
$version -> (old $version), $service_cid -> (old $service_cid),
|
|
328
|
-
$recipient_cid -> (old $recipient_cid),
|
|
329
|
-
$token_id -> (old $token_id), $scope -> "evil", $iat -> (old $iat)
|
|
330
|
-
).
|
|
331
|
-
token -> ($c -> core, $s -> (token $s)).
|
|
332
|
-
}
|
|
333
|
-
if mode == "oversize"
|
|
334
|
-
{
|
|
335
|
-
big is str = "x".
|
|
336
|
-
big -> big + big. big -> big + big. big -> big + big. big -> big + big.
|
|
337
|
-
big -> big + big. big -> big + big. big -> big + big. big -> big + big.
|
|
338
|
-
big -> big + big. big -> big + big. big -> big + big. big -> big + big.
|
|
339
|
-
payload -> big. // 4096 chars > payload_max_bytes
|
|
340
|
-
}
|
|
341
|
-
return transaction::success [
|
|
342
|
-
transaction::action::send (addr $service_cid) (
|
|
343
|
-
$name -> "::a2a_notifications::post_notification",
|
|
344
|
-
$targ -> ($token -> token, $payload -> payload, $wire_id -> "qa-tamper")
|
|
345
|
-
),
|
|
346
|
-
_return_data ($sent -> TRUE)
|
|
347
|
-
].
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// ---- N17+ probes (per-contact validation) ----
|
|
351
|
-
|
|
352
|
-
// Export a notify_address_t blob using a scoped (per-sender) token from
|
|
353
|
-
// my_notify_contact_tokens[service][sender]. Lets a sender post via the
|
|
354
|
-
// UNCHANGED send_notification trn using a scoped-token handout (N17).
|
|
355
|
-
trn readonly qa_export_contact_notify_address _:($service -> svc: global_id, $sender -> s: global_id)
|
|
356
|
-
{
|
|
357
|
-
outer = a2a_notifications::my_notify_contact_tokens svc.
|
|
358
|
-
abort "No contact tokens for this service." when outer == NIL.
|
|
359
|
-
inner_map = outer?.
|
|
360
|
-
tok = inner_map s.
|
|
361
|
-
abort "No token for this sender." when tok == NIL.
|
|
362
|
-
addr is a2a_notifications::notify_address_t = (
|
|
363
|
-
$version -> 1,
|
|
364
|
-
$service_cid -> svc,
|
|
365
|
-
$service_name -> "",
|
|
366
|
-
$token -> tok?
|
|
367
|
-
).
|
|
368
|
-
return ($blob -> (_write addr)).
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Set mute: write FALSE (= muted per §4.1) into notify_sender_muted[recipient][sender].
|
|
372
|
-
// Stand-in for set_sender_muted until that service inbound lands (a later task).
|
|
373
|
-
trn qa_notify_set_muted _:($recipient -> r: global_id, $sender -> s: global_id)
|
|
374
|
-
{
|
|
375
|
-
current_transaction_info::validate_origin_or_abort (transaction::envelope::origin::user,).
|
|
376
|
-
inner is (global_id ->> bool) = (,).
|
|
377
|
-
if (a2a_notifications::notify_sender_muted r) != NIL { inner -> (a2a_notifications::notify_sender_muted r)?. }
|
|
378
|
-
inner s -> FALSE.
|
|
379
|
-
a2a_notifications::notify_sender_muted r -> inner.
|
|
380
|
-
return transaction::success [ _return_data ($muted -> TRUE), _save_state NIL ].
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
// Clear mute: delete the entry — absent = enabled per §7.
|
|
384
|
-
trn qa_notify_clear_muted _:($recipient -> r: global_id, $sender -> s: global_id)
|
|
385
|
-
{
|
|
386
|
-
current_transaction_info::validate_origin_or_abort (transaction::envelope::origin::user,).
|
|
387
|
-
if (a2a_notifications::notify_sender_muted r) != NIL
|
|
388
|
-
{
|
|
389
|
-
inner is (global_id ->> bool) = (a2a_notifications::notify_sender_muted r)?.
|
|
390
|
-
if (inner s) != NIL { delete inner s. a2a_notifications::notify_sender_muted r -> inner. }
|
|
391
|
-
}
|
|
392
|
-
return transaction::success [ _return_data ($cleared -> TRUE), _save_state NIL ].
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// Clear sender slot: delete notify_sender_tokens[recipient][sender].
|
|
396
|
-
// Used in N21 to create the absent-slot abort condition.
|
|
397
|
-
trn qa_notify_clear_sender_slot _:($recipient -> r: global_id, $sender -> s: global_id)
|
|
398
|
-
{
|
|
399
|
-
current_transaction_info::validate_origin_or_abort (transaction::envelope::origin::user,).
|
|
400
|
-
if (a2a_notifications::notify_sender_tokens r) != NIL
|
|
401
|
-
{
|
|
402
|
-
inner is (global_id ->> a2a_notifications::notify_token_t) = (a2a_notifications::notify_sender_tokens r)?.
|
|
403
|
-
if (inner s) != NIL { delete inner s. a2a_notifications::notify_sender_tokens r -> inner. }
|
|
404
|
-
}
|
|
405
|
-
return transaction::success [ _return_data ($cleared -> TRUE), _save_state NIL ].
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// Return exactly the $sender_muted map the LAST on_notify_registration hook
|
|
409
|
-
// call carried (the engine-mirror feed). Precise probe — avoids grepping
|
|
410
|
-
// the whole regconfirm_log dump.
|
|
411
|
-
trn readonly qa_last_confirm_muted _
|
|
412
|
-
{
|
|
413
|
-
found is any = NIL.
|
|
414
|
-
sc regconfirm_log -- ( -> entry) { found -> entry. }
|
|
415
|
-
abort "No confirms logged." when found == NIL.
|
|
416
|
-
return ($sender_muted -> (found $sender_muted)).
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
// Send set_sender_muted directly to the service without going through the
|
|
420
|
-
// client-side wrapper (bypasses the client's registration check). Used in N26
|
|
421
|
-
// to probe the service-side registered-recipient gate.
|
|
422
|
-
trn qa_set_sender_muted_direct _:($service -> svc: global_id, $sender -> s: global_id, $muted -> m: bool)
|
|
423
|
-
{
|
|
424
|
-
current_transaction_info::validate_origin_or_abort (transaction::envelope::origin::user,).
|
|
425
|
-
return encrypted_channel::execute_transaction svc (fn (_) -> transaction::results::type {
|
|
426
|
-
return transaction::success [
|
|
427
|
-
encrypted_channel::send_encrypted_tx svc (
|
|
428
|
-
$name -> "::a2a_notifications::set_sender_muted",
|
|
429
|
-
$targ -> ($sender -> s, $muted -> m)
|
|
430
|
-
),
|
|
431
|
-
_return_data ($sent_to -> svc)
|
|
432
|
-
].
|
|
433
|
-
}).
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
// E9: a well-formed confirm_registration over a REAL channel, from a contact
|
|
437
|
-
// that is neither a pending nor a registered service of the target.
|
|
438
|
-
trn qa_send_fake_confirm _:($target -> target: global_id)
|
|
439
|
-
{
|
|
440
|
-
return encrypted_channel::execute_transaction target (fn (_) -> transaction::results::type {
|
|
441
|
-
return transaction::success [
|
|
442
|
-
encrypted_channel::send_encrypted_tx target (
|
|
443
|
-
$name -> "::a2a_notifications::confirm_registration",
|
|
444
|
-
$targ -> ($vapid_pub -> "EVIL_VAPID", $bindings -> NIL, $sender_tokens -> (,), $sender_muted -> (,))
|
|
445
|
-
),
|
|
446
|
-
_return_data ($sent -> TRUE)
|
|
447
|
-
].
|
|
448
|
-
}).
|
|
449
|
-
}
|
|
450
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Minimal protocol_container library — provides ::protocol_container::init_my_ipd,
|
|
2
|
-
// which the ADAPT wrapper runs on every packet during broker registration
|
|
3
|
-
// (possession-proof / identity-proof-document setup, adapt #77). Mirrors the
|
|
4
|
-
// toolkit's per-unit protocol_container stub; deps resolve from the stdlib.
|
|
5
|
-
library protocol_container loads libraries
|
|
6
|
-
identity_proof_document,
|
|
7
|
-
identity_proof_document_types,
|
|
8
|
-
native_attestation_document,
|
|
9
|
-
browser_attestation_document,
|
|
10
|
-
current_transaction_info
|
|
11
|
-
uses transactions
|
|
12
|
-
{
|
|
13
|
-
trn init_my_ipd _ {
|
|
14
|
-
current_transaction_info::validate_origin (::transaction::envelope::origin::user,).
|
|
15
|
-
identity_proof_document_types::set_my_ipd(identity_proof_document::create()).
|
|
16
|
-
return ::transaction::success [].
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Loopback test runner for the core-3.0 ephemeral-invite suite.
|
|
3
|
-
#
|
|
4
|
-
# The core repo is pure mufl libraries; running a behavioural test needs (a) the
|
|
5
|
-
# ADAPT toolkit compiler + stdlib, and (b) the @adapt-toolkit Node SDK + a dev
|
|
6
|
-
# broker to actually execute packets. Both are external to this repo. This script
|
|
7
|
-
# builds a throwaway harness dir, compiles the self-contained test actor against
|
|
8
|
-
# THIS repo's core, boots a local broker, and runs the driver.
|
|
9
|
-
#
|
|
10
|
-
# Override any path via env:
|
|
11
|
-
# ADAPT_TOOLKIT toolkit root (has build.linux.release/mufl-compile, mufl_stdlib, meta, transactions)
|
|
12
|
-
# OURS_SDK_NODE_MODULES a node_modules dir containing @adapt-toolkit (e.g. an ours-mcp checkout's)
|
|
13
|
-
# DEV_BROKER path to dev-broker.mjs (ships in ours-mcp/scripts)
|
|
14
|
-
# PORT broker port (default 9799)
|
|
15
|
-
set -u
|
|
16
|
-
HERE=$(cd "$(dirname "$0")" && pwd)
|
|
17
|
-
CORE_DIR=$(cd "$HERE/.." && pwd)
|
|
18
|
-
AT=${ADAPT_TOOLKIT:-/home/shakhvit/work/adapt/adapt-toolkit}
|
|
19
|
-
STDLIB=${MUFL_STDLIB_OVERRIDE:-$AT/mufl_stdlib} # Phase-B: point at the adapt worktree stdlib to pick up e2e.mm staged API
|
|
20
|
-
SDK_NM=${OURS_SDK_NODE_MODULES:-/home/shakhvit/work/adapt/ours/ours-mcp/node_modules}
|
|
21
|
-
DEV_BROKER=${DEV_BROKER:-/home/shakhvit/work/adapt/ours/ours-mcp/scripts/dev-broker.mjs}
|
|
22
|
-
PORT=${PORT:-9799}
|
|
23
|
-
COMPILE="$AT/build.linux.release/mufl-compile"
|
|
24
|
-
|
|
25
|
-
for p in "$COMPILE" "$STDLIB" "$SDK_NM/@adapt-toolkit" "$DEV_BROKER"; do
|
|
26
|
-
[ -e "$p" ] || { echo "MISSING: $p (set ADAPT_TOOLKIT / OURS_SDK_NODE_MODULES / DEV_BROKER)"; exit 2; }
|
|
27
|
-
done
|
|
28
|
-
|
|
29
|
-
BUILD=$(mktemp -d)
|
|
30
|
-
trap 'rm -rf "$BUILD"' EXIT
|
|
31
|
-
mkdir -p "$BUILD/core"
|
|
32
|
-
cp "$CORE_DIR"/*.mm "$CORE_DIR"/config.mufl "$BUILD/core/"
|
|
33
|
-
# test.mjs imports ./test_common.mjs, so copy it alongside into the build dir.
|
|
34
|
-
cp "$HERE/test_actor.mu" "$HERE/test.mjs" "$HERE/test_common.mjs" "$HERE/protocol_container.mm" "$BUILD/"
|
|
35
|
-
ln -sfn "$SDK_NM" "$BUILD/node_modules"
|
|
36
|
-
# Top-level compile config: merge the stdlib with this repo's core (the core/ subdir),
|
|
37
|
-
# plus the local protocol_container stub the ADAPT wrapper needs at packet boot
|
|
38
|
-
# (::protocol_container::init_my_ipd — same stub every consumer carries, e.g. ours-mcp).
|
|
39
|
-
cat > "$BUILD/config.mufl" <<'CFG'
|
|
40
|
-
config script
|
|
41
|
-
{
|
|
42
|
-
stdlib_config = (config_load #$MUFL_STDLIB_PATH).
|
|
43
|
-
core_config = (config_load #"core").
|
|
44
|
-
(
|
|
45
|
-
$imports -> ( $libraries -> (stdlib_config $exports $libraries)'(core_config $exports $libraries)'($protocol_container -> #"protocol_container.mm"), ),
|
|
46
|
-
$exports -> ( $libraries -> (,), $applications -> (,) )
|
|
47
|
-
).
|
|
48
|
-
}
|
|
49
|
-
CFG
|
|
50
|
-
|
|
51
|
-
cd "$BUILD"
|
|
52
|
-
echo "compiling test actor against $CORE_DIR core…"
|
|
53
|
-
MUFL_STDLIB_PATH="$STDLIB" "$COMPILE" -mp "$AT/meta" -mp "$AT/transactions" test_actor.mu 2>&1 \
|
|
54
|
-
| grep -vE "Unused symbol|browser_attestation|identity_proof_document_impl" | tail -4
|
|
55
|
-
ls ./*.muflo >/dev/null 2>&1 || { echo "COMPILE FAILED"; exit 1; }
|
|
56
|
-
|
|
57
|
-
node "$DEV_BROKER" --host 127.0.0.1 --port "$PORT" --test_mode >broker.log 2>&1 &
|
|
58
|
-
BPID=$!
|
|
59
|
-
sleep 2.5
|
|
60
|
-
kill -0 "$BPID" 2>/dev/null || { echo "BROKER FAILED TO START:"; cat broker.log; exit 3; }
|
|
61
|
-
|
|
62
|
-
BROKER_URL="ws://127.0.0.1:$PORT" node test.mjs 2> >(grep -E 'inbound rejected|DRIVER ERR' >&2)
|
|
63
|
-
RC=$?
|
|
64
|
-
kill "$BPID" 2>/dev/null
|
|
65
|
-
exit $RC
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Fast golden-wire corpus gate: compile the test actor against THIS core, boot a
|
|
3
|
-
# local broker, run ONLY tests/corpus.mjs (single packet, no peer traffic).
|
|
4
|
-
# Same env knobs as run.sh: ADAPT_TOOLKIT / OURS_SDK_NODE_MODULES / DEV_BROKER / PORT.
|
|
5
|
-
set -u
|
|
6
|
-
HERE=$(cd "$(dirname "$0")" && pwd)
|
|
7
|
-
CORE_DIR=$(cd "$HERE/.." && pwd)
|
|
8
|
-
AT=${ADAPT_TOOLKIT:-/home/shakhvit/work/adapt/adapt-toolkit}
|
|
9
|
-
STDLIB=${MUFL_STDLIB_OVERRIDE:-$AT/mufl_stdlib} # Phase-B: point at the adapt worktree stdlib to pick up e2e.mm staged API
|
|
10
|
-
SDK_NM=${OURS_SDK_NODE_MODULES:-/home/shakhvit/work/adapt/ours/ours-mcp/node_modules}
|
|
11
|
-
DEV_BROKER=${DEV_BROKER:-/home/shakhvit/work/adapt/ours/ours-mcp/scripts/dev-broker.mjs}
|
|
12
|
-
PORT=${PORT:-9798}
|
|
13
|
-
COMPILE="$AT/build.linux.release/mufl-compile"
|
|
14
|
-
|
|
15
|
-
for p in "$COMPILE" "$STDLIB" "$SDK_NM/@adapt-toolkit" "$DEV_BROKER"; do
|
|
16
|
-
[ -e "$p" ] || { echo "MISSING: $p (set ADAPT_TOOLKIT / OURS_SDK_NODE_MODULES / DEV_BROKER)"; exit 2; }
|
|
17
|
-
done
|
|
18
|
-
|
|
19
|
-
BUILD=$(mktemp -d)
|
|
20
|
-
trap 'rm -rf "$BUILD"' EXIT
|
|
21
|
-
mkdir -p "$BUILD/core"
|
|
22
|
-
cp "$CORE_DIR"/*.mm "$CORE_DIR"/config.mufl "$BUILD/core/"
|
|
23
|
-
cp "$HERE/corpus_actor.mu" "$HERE/corpus.mjs" "$HERE/protocol_container.mm" "$BUILD/"
|
|
24
|
-
ln -sfn "$SDK_NM" "$BUILD/node_modules"
|
|
25
|
-
cat > "$BUILD/config.mufl" <<'CFG'
|
|
26
|
-
config script
|
|
27
|
-
{
|
|
28
|
-
stdlib_config = (config_load #$MUFL_STDLIB_PATH).
|
|
29
|
-
core_config = (config_load #"core").
|
|
30
|
-
(
|
|
31
|
-
$imports -> ( $libraries -> (stdlib_config $exports $libraries)'(core_config $exports $libraries)'($protocol_container -> #"protocol_container.mm"), ),
|
|
32
|
-
$exports -> ( $libraries -> (,), $applications -> (,) )
|
|
33
|
-
).
|
|
34
|
-
}
|
|
35
|
-
CFG
|
|
36
|
-
|
|
37
|
-
cd "$BUILD"
|
|
38
|
-
echo "compiling test actor against $CORE_DIR core…"
|
|
39
|
-
MUFL_STDLIB_PATH="$STDLIB" "$COMPILE" -mp "$AT/meta" -mp "$AT/transactions" corpus_actor.mu 2>&1 \
|
|
40
|
-
| grep -vE "Unused symbol|browser_attestation|identity_proof_document_impl" | tail -4
|
|
41
|
-
ls ./*.muflo >/dev/null 2>&1 || { echo "COMPILE FAILED"; exit 1; }
|
|
42
|
-
|
|
43
|
-
node "$DEV_BROKER" --host 127.0.0.1 --port "$PORT" --test_mode >broker.log 2>&1 &
|
|
44
|
-
BPID=$!
|
|
45
|
-
sleep 2.5
|
|
46
|
-
kill -0 "$BPID" 2>/dev/null || { echo "BROKER FAILED TO START:"; cat broker.log; exit 3; }
|
|
47
|
-
|
|
48
|
-
BROKER_URL="ws://127.0.0.1:$PORT" node corpus.mjs 2> >(grep -E 'DRIVER ERR' >&2)
|
|
49
|
-
RC=$?
|
|
50
|
-
kill "$BPID" 2>/dev/null
|
|
51
|
-
exit $RC
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# COMPILE-ONLY regression guard (no broker, no driver): compile fatcompile_actor.mu — which loads
|
|
3
|
-
# the heavy daemon-side libs TOGETHER (a2a_messaging migration surface + a2a_cluster) through the
|
|
4
|
-
# __t_wrapper meta path — against THIS core. Producing a .muflo IS the pass. Guards against a
|
|
5
|
-
# migration-core change re-inflating per-unit meta-stage reduction past the 1M-step ceiling for a
|
|
6
|
-
# multi-heavy-lib packet (the class of failure that broke the ours-mcp daemon build @ 7a14d65 via
|
|
7
|
-
# the dead 5th transaction::type union variant). NOTE: the FULL daemon actor.mu (messaging+cluster+
|
|
8
|
-
# its app trns) is the authoritative check and lives in the daemon repo's CI; this is the in-core
|
|
9
|
-
# early-warning for the heavy-lib combo. Same env knobs as run_mig.sh.
|
|
10
|
-
set -u
|
|
11
|
-
HERE=$(cd "$(dirname "$0")" && pwd)
|
|
12
|
-
CORE_DIR=$(cd "$HERE/.." && pwd)
|
|
13
|
-
AT=${ADAPT_TOOLKIT:-/home/shakhvit/work/adapt/adapt-toolkit}
|
|
14
|
-
STDLIB=${MUFL_STDLIB_OVERRIDE:-$AT/mufl_stdlib}
|
|
15
|
-
COMPILE="$AT/build.linux.release/mufl-compile"
|
|
16
|
-
for p in "$COMPILE" "$STDLIB"; do
|
|
17
|
-
[ -e "$p" ] || { echo "MISSING: $p (set ADAPT_TOOLKIT)"; exit 2; }
|
|
18
|
-
done
|
|
19
|
-
BUILD=$(mktemp -d)
|
|
20
|
-
trap 'rm -rf "$BUILD"' EXIT
|
|
21
|
-
mkdir -p "$BUILD/core"
|
|
22
|
-
cp "$CORE_DIR"/*.mm "$CORE_DIR"/config.mufl "$BUILD/core/"
|
|
23
|
-
cp "$HERE/fatcompile_actor.mu" "$HERE/protocol_container.mm" "$BUILD/"
|
|
24
|
-
cat > "$BUILD/config.mufl" <<'CFG'
|
|
25
|
-
config script
|
|
26
|
-
{
|
|
27
|
-
stdlib_config = (config_load #$MUFL_STDLIB_PATH).
|
|
28
|
-
core_config = (config_load #"core").
|
|
29
|
-
(
|
|
30
|
-
$imports -> ( $libraries -> (stdlib_config $exports $libraries)'(core_config $exports $libraries)'($protocol_container -> #"protocol_container.mm"), ),
|
|
31
|
-
$exports -> ( $libraries -> (,), $applications -> (,) )
|
|
32
|
-
).
|
|
33
|
-
}
|
|
34
|
-
CFG
|
|
35
|
-
cd "$BUILD"
|
|
36
|
-
echo "compiling fatcompile_actor (a2a_messaging + a2a_cluster) against $CORE_DIR core…"
|
|
37
|
-
MUFL_STDLIB_PATH="$STDLIB" "$COMPILE" -mp "$AT/meta" -mp "$AT/transactions" fatcompile_actor.mu 2>&1 \
|
|
38
|
-
| grep -vE "Unused symbol|browser_attestation|identity_proof_document_impl" | tail -6
|
|
39
|
-
if ls ./*.muflo >/dev/null 2>&1; then echo "FATCOMPILE: OK (heavy-lib combo compiles under the meta-fuel ceiling)"; exit 0
|
|
40
|
-
else echo "FATCOMPILE: FAILED (meta-fuel ceiling — a migration-core change re-inflated the daemon build path)"; exit 1; fi
|