@substrat-run/contract-tests 0.122.1 → 0.124.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/dist/emitted-suite.d.ts +3 -0
- package/dist/emitted-suite.d.ts.map +1 -0
- package/dist/emitted-suite.js +102 -0
- package/dist/emitted-suite.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/module-log-suite.d.ts +6 -0
- package/dist/module-log-suite.d.ts.map +1 -0
- package/dist/module-log-suite.js +80 -0
- package/dist/module-log-suite.js.map +1 -0
- package/dist/modules.d.ts +395 -0
- package/dist/modules.d.ts.map +1 -1
- package/dist/modules.js +192 -2
- package/dist/modules.js.map +1 -1
- package/dist/schedule-suite.d.ts.map +1 -1
- package/dist/schedule-suite.js +131 -6
- package/dist/schedule-suite.js.map +1 -1
- package/dist/scope-host-suite.d.ts.map +1 -1
- package/dist/scope-host-suite.js +103 -4
- package/dist/scope-host-suite.js.map +1 -1
- package/dist/sql-limits-suite.d.ts.map +1 -1
- package/dist/sql-limits-suite.js +29 -2
- package/dist/sql-limits-suite.js.map +1 -1
- package/dist/system-switch-suite.d.ts.map +1 -1
- package/dist/system-switch-suite.js +226 -20
- package/dist/system-switch-suite.js.map +1 -1
- package/package.json +3 -3
package/dist/modules.d.ts
CHANGED
|
@@ -1907,6 +1907,141 @@ export declare const contractTestBareOps: Record<string, OperationHandler<never,
|
|
|
1907
1907
|
export declare const testMod: ModuleRegistration;
|
|
1908
1908
|
export declare const atomicMod: ModuleRegistration;
|
|
1909
1909
|
export declare const scheduleMod: ModuleRegistration;
|
|
1910
|
+
/**
|
|
1911
|
+
* #1525: the failure twin of `scheduleMod` itself — a SEPARATE module so registering
|
|
1912
|
+
* it never changes `scheduleMod`'s own schedule count, which `system-switch-suite.ts`
|
|
1913
|
+
* (its `SCHEDULES` constant) and every `scheduleContractSuite` test above this fixture
|
|
1914
|
+
* already pin exactly. Its one schedule declares the permission it is GIVEN
|
|
1915
|
+
* (`sched-denied:tick`) but the handler checks a DIFFERENT one (`sched-denied:admin`),
|
|
1916
|
+
* so provisioning never grants what the handler needs: due, invoked, and denied, every
|
|
1917
|
+
* pass, forever. `entitlementKey` reuses `scheduleMod`'s own SKU so no suite needs a
|
|
1918
|
+
* second `grantEntitlement` call to use it.
|
|
1919
|
+
*/
|
|
1920
|
+
export declare const deniedScheduleModManifest: {
|
|
1921
|
+
id: string & z.$brand<"ModuleId">;
|
|
1922
|
+
version: string;
|
|
1923
|
+
kernelContract: string;
|
|
1924
|
+
permissions: {
|
|
1925
|
+
key: string & z.$brand<"PermissionKey">;
|
|
1926
|
+
description: string;
|
|
1927
|
+
}[];
|
|
1928
|
+
events: {
|
|
1929
|
+
emits: {
|
|
1930
|
+
type: string;
|
|
1931
|
+
schemaVersion: number;
|
|
1932
|
+
}[];
|
|
1933
|
+
consumes: {
|
|
1934
|
+
type: string;
|
|
1935
|
+
schemaVersion: number;
|
|
1936
|
+
from?: string | undefined;
|
|
1937
|
+
}[];
|
|
1938
|
+
exports?: {
|
|
1939
|
+
type: string;
|
|
1940
|
+
schemaVersion: number;
|
|
1941
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
1942
|
+
}[] | undefined;
|
|
1943
|
+
};
|
|
1944
|
+
migrations: {
|
|
1945
|
+
journalDir: string;
|
|
1946
|
+
compatibleFrom: string;
|
|
1947
|
+
};
|
|
1948
|
+
attachmentTargets: {
|
|
1949
|
+
entityType: string;
|
|
1950
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
1951
|
+
writePermission?: (string & z.$brand<"PermissionKey">) | undefined;
|
|
1952
|
+
}[];
|
|
1953
|
+
liveTargets?: {
|
|
1954
|
+
entityType: string;
|
|
1955
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
1956
|
+
}[] | undefined;
|
|
1957
|
+
entityRelations?: {
|
|
1958
|
+
entityType: string;
|
|
1959
|
+
parentType: string;
|
|
1960
|
+
}[] | undefined;
|
|
1961
|
+
guards?: {
|
|
1962
|
+
before: string;
|
|
1963
|
+
predicate: string;
|
|
1964
|
+
config: Record<string, unknown>;
|
|
1965
|
+
}[] | undefined;
|
|
1966
|
+
schedules?: {
|
|
1967
|
+
operation: string;
|
|
1968
|
+
cadence: {
|
|
1969
|
+
everyMinutes: number;
|
|
1970
|
+
};
|
|
1971
|
+
input?: Record<string, unknown> | undefined;
|
|
1972
|
+
permissions: (string & z.$brand<"PermissionKey">)[];
|
|
1973
|
+
}[] | undefined;
|
|
1974
|
+
peers?: {
|
|
1975
|
+
vertical: string;
|
|
1976
|
+
operations: string[];
|
|
1977
|
+
permissions: (string & z.$brand<"PermissionKey">)[];
|
|
1978
|
+
}[] | undefined;
|
|
1979
|
+
freshness?: {
|
|
1980
|
+
eventType: string;
|
|
1981
|
+
within: {
|
|
1982
|
+
hours: number;
|
|
1983
|
+
};
|
|
1984
|
+
}[] | undefined;
|
|
1985
|
+
withdraws?: string[] | undefined;
|
|
1986
|
+
entitlementKey: string;
|
|
1987
|
+
envSpec?: {
|
|
1988
|
+
key: string;
|
|
1989
|
+
label?: string | undefined;
|
|
1990
|
+
description: string;
|
|
1991
|
+
placeholder?: string | undefined;
|
|
1992
|
+
required: boolean;
|
|
1993
|
+
secret: boolean;
|
|
1994
|
+
default?: string | undefined;
|
|
1995
|
+
group?: string | undefined;
|
|
1996
|
+
}[] | undefined;
|
|
1997
|
+
ownerGrants?: (string & z.$brand<"PermissionKey">)[] | undefined;
|
|
1998
|
+
entitlements?: string[] | undefined;
|
|
1999
|
+
provides?: string[] | undefined;
|
|
2000
|
+
requires?: string[] | undefined;
|
|
2001
|
+
api?: string | undefined;
|
|
2002
|
+
searchables?: {
|
|
2003
|
+
entityType: string;
|
|
2004
|
+
fields: string[];
|
|
2005
|
+
table?: string | undefined;
|
|
2006
|
+
idColumn?: string | undefined;
|
|
2007
|
+
tokenizer?: "prefix" | "substring" | undefined;
|
|
2008
|
+
}[] | undefined;
|
|
2009
|
+
lists?: {
|
|
2010
|
+
entityType: string;
|
|
2011
|
+
sortable: string[];
|
|
2012
|
+
filterable?: string[] | undefined;
|
|
2013
|
+
table?: string | undefined;
|
|
2014
|
+
idColumn?: string | undefined;
|
|
2015
|
+
}[] | undefined;
|
|
2016
|
+
ui?: {
|
|
2017
|
+
routes?: {
|
|
2018
|
+
path: string;
|
|
2019
|
+
screen: string;
|
|
2020
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
2021
|
+
}[] | undefined;
|
|
2022
|
+
nav?: {
|
|
2023
|
+
label: string;
|
|
2024
|
+
icon?: string | undefined;
|
|
2025
|
+
to: string;
|
|
2026
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
2027
|
+
}[] | undefined;
|
|
2028
|
+
entityViews?: {
|
|
2029
|
+
entityType: string;
|
|
2030
|
+
view: string;
|
|
2031
|
+
}[] | undefined;
|
|
2032
|
+
widgets?: {
|
|
2033
|
+
slot: string;
|
|
2034
|
+
component: string;
|
|
2035
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
2036
|
+
}[] | undefined;
|
|
2037
|
+
settingsPanels?: {
|
|
2038
|
+
label: string;
|
|
2039
|
+
component: string;
|
|
2040
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
2041
|
+
}[] | undefined;
|
|
2042
|
+
} | undefined;
|
|
2043
|
+
};
|
|
2044
|
+
export declare const deniedScheduleMod: ModuleRegistration;
|
|
1910
2045
|
export declare const flowMod: ModuleRegistration;
|
|
1911
2046
|
export declare const guardedMod: ModuleRegistration;
|
|
1912
2047
|
export declare const gateMod: ModuleRegistration;
|
|
@@ -2970,6 +3105,266 @@ export declare const peerModManifest: {
|
|
|
2970
3105
|
} | undefined;
|
|
2971
3106
|
};
|
|
2972
3107
|
export declare const peerMod: ModuleRegistration;
|
|
3108
|
+
export declare const emittedModManifest: {
|
|
3109
|
+
id: string & z.$brand<"ModuleId">;
|
|
3110
|
+
version: string;
|
|
3111
|
+
kernelContract: string;
|
|
3112
|
+
permissions: {
|
|
3113
|
+
key: string & z.$brand<"PermissionKey">;
|
|
3114
|
+
description: string;
|
|
3115
|
+
}[];
|
|
3116
|
+
events: {
|
|
3117
|
+
emits: {
|
|
3118
|
+
type: string;
|
|
3119
|
+
schemaVersion: number;
|
|
3120
|
+
}[];
|
|
3121
|
+
consumes: {
|
|
3122
|
+
type: string;
|
|
3123
|
+
schemaVersion: number;
|
|
3124
|
+
from?: string | undefined;
|
|
3125
|
+
}[];
|
|
3126
|
+
exports?: {
|
|
3127
|
+
type: string;
|
|
3128
|
+
schemaVersion: number;
|
|
3129
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
3130
|
+
}[] | undefined;
|
|
3131
|
+
};
|
|
3132
|
+
migrations: {
|
|
3133
|
+
journalDir: string;
|
|
3134
|
+
compatibleFrom: string;
|
|
3135
|
+
};
|
|
3136
|
+
attachmentTargets: {
|
|
3137
|
+
entityType: string;
|
|
3138
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
3139
|
+
writePermission?: (string & z.$brand<"PermissionKey">) | undefined;
|
|
3140
|
+
}[];
|
|
3141
|
+
liveTargets?: {
|
|
3142
|
+
entityType: string;
|
|
3143
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
3144
|
+
}[] | undefined;
|
|
3145
|
+
entityRelations?: {
|
|
3146
|
+
entityType: string;
|
|
3147
|
+
parentType: string;
|
|
3148
|
+
}[] | undefined;
|
|
3149
|
+
guards?: {
|
|
3150
|
+
before: string;
|
|
3151
|
+
predicate: string;
|
|
3152
|
+
config: Record<string, unknown>;
|
|
3153
|
+
}[] | undefined;
|
|
3154
|
+
schedules?: {
|
|
3155
|
+
operation: string;
|
|
3156
|
+
cadence: {
|
|
3157
|
+
everyMinutes: number;
|
|
3158
|
+
};
|
|
3159
|
+
input?: Record<string, unknown> | undefined;
|
|
3160
|
+
permissions: (string & z.$brand<"PermissionKey">)[];
|
|
3161
|
+
}[] | undefined;
|
|
3162
|
+
peers?: {
|
|
3163
|
+
vertical: string;
|
|
3164
|
+
operations: string[];
|
|
3165
|
+
permissions: (string & z.$brand<"PermissionKey">)[];
|
|
3166
|
+
}[] | undefined;
|
|
3167
|
+
freshness?: {
|
|
3168
|
+
eventType: string;
|
|
3169
|
+
within: {
|
|
3170
|
+
hours: number;
|
|
3171
|
+
};
|
|
3172
|
+
}[] | undefined;
|
|
3173
|
+
withdraws?: string[] | undefined;
|
|
3174
|
+
entitlementKey: string;
|
|
3175
|
+
envSpec?: {
|
|
3176
|
+
key: string;
|
|
3177
|
+
label?: string | undefined;
|
|
3178
|
+
description: string;
|
|
3179
|
+
placeholder?: string | undefined;
|
|
3180
|
+
required: boolean;
|
|
3181
|
+
secret: boolean;
|
|
3182
|
+
default?: string | undefined;
|
|
3183
|
+
group?: string | undefined;
|
|
3184
|
+
}[] | undefined;
|
|
3185
|
+
ownerGrants?: (string & z.$brand<"PermissionKey">)[] | undefined;
|
|
3186
|
+
entitlements?: string[] | undefined;
|
|
3187
|
+
provides?: string[] | undefined;
|
|
3188
|
+
requires?: string[] | undefined;
|
|
3189
|
+
api?: string | undefined;
|
|
3190
|
+
searchables?: {
|
|
3191
|
+
entityType: string;
|
|
3192
|
+
fields: string[];
|
|
3193
|
+
table?: string | undefined;
|
|
3194
|
+
idColumn?: string | undefined;
|
|
3195
|
+
tokenizer?: "prefix" | "substring" | undefined;
|
|
3196
|
+
}[] | undefined;
|
|
3197
|
+
lists?: {
|
|
3198
|
+
entityType: string;
|
|
3199
|
+
sortable: string[];
|
|
3200
|
+
filterable?: string[] | undefined;
|
|
3201
|
+
table?: string | undefined;
|
|
3202
|
+
idColumn?: string | undefined;
|
|
3203
|
+
}[] | undefined;
|
|
3204
|
+
ui?: {
|
|
3205
|
+
routes?: {
|
|
3206
|
+
path: string;
|
|
3207
|
+
screen: string;
|
|
3208
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
3209
|
+
}[] | undefined;
|
|
3210
|
+
nav?: {
|
|
3211
|
+
label: string;
|
|
3212
|
+
icon?: string | undefined;
|
|
3213
|
+
to: string;
|
|
3214
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
3215
|
+
}[] | undefined;
|
|
3216
|
+
entityViews?: {
|
|
3217
|
+
entityType: string;
|
|
3218
|
+
view: string;
|
|
3219
|
+
}[] | undefined;
|
|
3220
|
+
widgets?: {
|
|
3221
|
+
slot: string;
|
|
3222
|
+
component: string;
|
|
3223
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
3224
|
+
}[] | undefined;
|
|
3225
|
+
settingsPanels?: {
|
|
3226
|
+
label: string;
|
|
3227
|
+
component: string;
|
|
3228
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
3229
|
+
}[] | undefined;
|
|
3230
|
+
} | undefined;
|
|
3231
|
+
};
|
|
3232
|
+
/**
|
|
3233
|
+
* The module the #1746 suite drives. Its consumer answers every `emitted.touched` with an
|
|
3234
|
+
* `emitted.echoed` in the same invocation, which is what lets the suite show the report
|
|
3235
|
+
* names the operation's own events and none of its consumers'.
|
|
3236
|
+
*/
|
|
3237
|
+
export declare const emittedMod: ModuleRegistration;
|
|
3238
|
+
export declare const loggedModManifest: {
|
|
3239
|
+
id: string & z.$brand<"ModuleId">;
|
|
3240
|
+
version: string;
|
|
3241
|
+
kernelContract: string;
|
|
3242
|
+
permissions: {
|
|
3243
|
+
key: string & z.$brand<"PermissionKey">;
|
|
3244
|
+
description: string;
|
|
3245
|
+
}[];
|
|
3246
|
+
events: {
|
|
3247
|
+
emits: {
|
|
3248
|
+
type: string;
|
|
3249
|
+
schemaVersion: number;
|
|
3250
|
+
}[];
|
|
3251
|
+
consumes: {
|
|
3252
|
+
type: string;
|
|
3253
|
+
schemaVersion: number;
|
|
3254
|
+
from?: string | undefined;
|
|
3255
|
+
}[];
|
|
3256
|
+
exports?: {
|
|
3257
|
+
type: string;
|
|
3258
|
+
schemaVersion: number;
|
|
3259
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
3260
|
+
}[] | undefined;
|
|
3261
|
+
};
|
|
3262
|
+
migrations: {
|
|
3263
|
+
journalDir: string;
|
|
3264
|
+
compatibleFrom: string;
|
|
3265
|
+
};
|
|
3266
|
+
attachmentTargets: {
|
|
3267
|
+
entityType: string;
|
|
3268
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
3269
|
+
writePermission?: (string & z.$brand<"PermissionKey">) | undefined;
|
|
3270
|
+
}[];
|
|
3271
|
+
liveTargets?: {
|
|
3272
|
+
entityType: string;
|
|
3273
|
+
readPermission: string & z.$brand<"PermissionKey">;
|
|
3274
|
+
}[] | undefined;
|
|
3275
|
+
entityRelations?: {
|
|
3276
|
+
entityType: string;
|
|
3277
|
+
parentType: string;
|
|
3278
|
+
}[] | undefined;
|
|
3279
|
+
guards?: {
|
|
3280
|
+
before: string;
|
|
3281
|
+
predicate: string;
|
|
3282
|
+
config: Record<string, unknown>;
|
|
3283
|
+
}[] | undefined;
|
|
3284
|
+
schedules?: {
|
|
3285
|
+
operation: string;
|
|
3286
|
+
cadence: {
|
|
3287
|
+
everyMinutes: number;
|
|
3288
|
+
};
|
|
3289
|
+
input?: Record<string, unknown> | undefined;
|
|
3290
|
+
permissions: (string & z.$brand<"PermissionKey">)[];
|
|
3291
|
+
}[] | undefined;
|
|
3292
|
+
peers?: {
|
|
3293
|
+
vertical: string;
|
|
3294
|
+
operations: string[];
|
|
3295
|
+
permissions: (string & z.$brand<"PermissionKey">)[];
|
|
3296
|
+
}[] | undefined;
|
|
3297
|
+
freshness?: {
|
|
3298
|
+
eventType: string;
|
|
3299
|
+
within: {
|
|
3300
|
+
hours: number;
|
|
3301
|
+
};
|
|
3302
|
+
}[] | undefined;
|
|
3303
|
+
withdraws?: string[] | undefined;
|
|
3304
|
+
entitlementKey: string;
|
|
3305
|
+
envSpec?: {
|
|
3306
|
+
key: string;
|
|
3307
|
+
label?: string | undefined;
|
|
3308
|
+
description: string;
|
|
3309
|
+
placeholder?: string | undefined;
|
|
3310
|
+
required: boolean;
|
|
3311
|
+
secret: boolean;
|
|
3312
|
+
default?: string | undefined;
|
|
3313
|
+
group?: string | undefined;
|
|
3314
|
+
}[] | undefined;
|
|
3315
|
+
ownerGrants?: (string & z.$brand<"PermissionKey">)[] | undefined;
|
|
3316
|
+
entitlements?: string[] | undefined;
|
|
3317
|
+
provides?: string[] | undefined;
|
|
3318
|
+
requires?: string[] | undefined;
|
|
3319
|
+
api?: string | undefined;
|
|
3320
|
+
searchables?: {
|
|
3321
|
+
entityType: string;
|
|
3322
|
+
fields: string[];
|
|
3323
|
+
table?: string | undefined;
|
|
3324
|
+
idColumn?: string | undefined;
|
|
3325
|
+
tokenizer?: "prefix" | "substring" | undefined;
|
|
3326
|
+
}[] | undefined;
|
|
3327
|
+
lists?: {
|
|
3328
|
+
entityType: string;
|
|
3329
|
+
sortable: string[];
|
|
3330
|
+
filterable?: string[] | undefined;
|
|
3331
|
+
table?: string | undefined;
|
|
3332
|
+
idColumn?: string | undefined;
|
|
3333
|
+
}[] | undefined;
|
|
3334
|
+
ui?: {
|
|
3335
|
+
routes?: {
|
|
3336
|
+
path: string;
|
|
3337
|
+
screen: string;
|
|
3338
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
3339
|
+
}[] | undefined;
|
|
3340
|
+
nav?: {
|
|
3341
|
+
label: string;
|
|
3342
|
+
icon?: string | undefined;
|
|
3343
|
+
to: string;
|
|
3344
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
3345
|
+
}[] | undefined;
|
|
3346
|
+
entityViews?: {
|
|
3347
|
+
entityType: string;
|
|
3348
|
+
view: string;
|
|
3349
|
+
}[] | undefined;
|
|
3350
|
+
widgets?: {
|
|
3351
|
+
slot: string;
|
|
3352
|
+
component: string;
|
|
3353
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
3354
|
+
}[] | undefined;
|
|
3355
|
+
settingsPanels?: {
|
|
3356
|
+
label: string;
|
|
3357
|
+
component: string;
|
|
3358
|
+
permission: string & z.$brand<"PermissionKey">;
|
|
3359
|
+
}[] | undefined;
|
|
3360
|
+
} | undefined;
|
|
3361
|
+
};
|
|
3362
|
+
/**
|
|
3363
|
+
* The module the `ctx.log` suite drives. `logged/act` logs, emits, and its consumer logs
|
|
3364
|
+
* again in the same invocation; `logged/fail` logs and then throws, so the suite can show
|
|
3365
|
+
* the line survives the rollback.
|
|
3366
|
+
*/
|
|
3367
|
+
export declare const loggedMod: ModuleRegistration;
|
|
2973
3368
|
export declare const contractTestModules: ModuleRegistration[];
|
|
2974
3369
|
/**
|
|
2975
3370
|
* A module for the live-read fan-out, with two entity types that differ in exactly
|
package/dist/modules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EASL,CAAC,EAIF,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAML,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAI9B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU1B,CAAC;AAMH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC9B,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU/B,CAAC;AAEH,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,EAAE,kBASvB,CAAC"}
|
package/dist/modules.js
CHANGED
|
@@ -369,6 +369,21 @@ export const contractTestBareOps = {
|
|
|
369
369
|
payload: input.omit ? undefined : { code: input.code },
|
|
370
370
|
});
|
|
371
371
|
}),
|
|
372
|
+
/**
|
|
373
|
+
* One event of a chosen PII class carrying an `email` (#1762), so the suite can put
|
|
374
|
+
* the same payload field under every class and assert a payload facet groups only
|
|
375
|
+
* the `'none'` ones. A classified event needs a data subject, so one is minted.
|
|
376
|
+
*/
|
|
377
|
+
'test/emit-classified': ((ctx, input) => {
|
|
378
|
+
ctx.emit({
|
|
379
|
+
type: 'test.classified',
|
|
380
|
+
schemaVersion: 1,
|
|
381
|
+
entity: { entityType: 'test-thing', entityId: 'classified' },
|
|
382
|
+
piiClass: input.pii,
|
|
383
|
+
...(input.pii === 'none' ? {} : { subjectId: dataSubjectId.parse(input.subject ?? ulid()) }),
|
|
384
|
+
payload: { email: input.email },
|
|
385
|
+
});
|
|
386
|
+
}),
|
|
372
387
|
'test/emit-unclassified-pii': ((ctx) => {
|
|
373
388
|
// piiClass 'direct' without subjectId — must be rejected at emit (§6.1)
|
|
374
389
|
ctx.emit({
|
|
@@ -965,12 +980,55 @@ export const scheduleMod = {
|
|
|
965
980
|
assertAllowed(await ctx.check('sched:admin'));
|
|
966
981
|
}),
|
|
967
982
|
'sched/count': ((ctx) => ctx.sql.query('SELECT COUNT(*) AS n FROM sched_ticks')[0].n),
|
|
968
|
-
|
|
983
|
+
// #1525: `invocation_id` selected alongside — a schedule contract assertion joins
|
|
984
|
+
// this to the same column on `sched/schedule-state` to prove they carry ONE id.
|
|
985
|
+
'sched/read-outbox': ((ctx) => ctx.sql.query('SELECT type, actor, operation, invocation_id FROM _substrat_outbox ORDER BY id')),
|
|
969
986
|
// #1288: `kind` is selected, and the order leads with it — two rows may now share
|
|
970
987
|
// a `schedule_op`, so ordering by that alone leaves the pair's order to the query
|
|
971
988
|
// planner and an assertion on the array would be flaky rather than wrong.
|
|
972
|
-
|
|
989
|
+
// #1525: `invocation_id` selected alongside — null for a 'freshness' row (nothing
|
|
990
|
+
// ran) and for a legacy row predating the column; a fired 'schedule' row carries
|
|
991
|
+
// the id its own invoke ran under.
|
|
992
|
+
'sched/schedule-state': ((ctx) => ctx.sql.query(`SELECT kind, schedule_op, last_status, invocation_id FROM _substrat_schedule_state
|
|
973
993
|
ORDER BY kind, schedule_op`)),
|
|
994
|
+
// #1525: a denied schedule's own denial row, joined by eye against the same column
|
|
995
|
+
// on `sched/schedule-state` — proving a FAILED run carries the identical id, not
|
|
996
|
+
// just a fired one.
|
|
997
|
+
'sched/read-denials': readDenialsOp,
|
|
998
|
+
},
|
|
999
|
+
};
|
|
1000
|
+
/**
|
|
1001
|
+
* #1525: the failure twin of `scheduleMod` itself — a SEPARATE module so registering
|
|
1002
|
+
* it never changes `scheduleMod`'s own schedule count, which `system-switch-suite.ts`
|
|
1003
|
+
* (its `SCHEDULES` constant) and every `scheduleContractSuite` test above this fixture
|
|
1004
|
+
* already pin exactly. Its one schedule declares the permission it is GIVEN
|
|
1005
|
+
* (`sched-denied:tick`) but the handler checks a DIFFERENT one (`sched-denied:admin`),
|
|
1006
|
+
* so provisioning never grants what the handler needs: due, invoked, and denied, every
|
|
1007
|
+
* pass, forever. `entitlementKey` reuses `scheduleMod`'s own SKU so no suite needs a
|
|
1008
|
+
* second `grantEntitlement` call to use it.
|
|
1009
|
+
*/
|
|
1010
|
+
export const deniedScheduleModManifest = moduleManifest.parse({
|
|
1011
|
+
id: '@test/sched-denied',
|
|
1012
|
+
version: '1.0.0',
|
|
1013
|
+
kernelContract: '^0.0.1',
|
|
1014
|
+
permissions: [
|
|
1015
|
+
{ key: 'sched-denied:tick', description: 'the only permission this module ever grants' },
|
|
1016
|
+
{ key: 'sched-denied:admin', description: 'required by the handler; no schedule declares it' },
|
|
1017
|
+
],
|
|
1018
|
+
events: { emits: [], consumes: [] },
|
|
1019
|
+
migrations: { journalDir: './migrations', compatibleFrom: '1.0.0' },
|
|
1020
|
+
attachmentTargets: [],
|
|
1021
|
+
entitlementKey: 'sched',
|
|
1022
|
+
schedules: [
|
|
1023
|
+
{ operation: 'sched-denied/tick', cadence: { everyMinutes: 60 }, permissions: ['sched-denied:tick'] },
|
|
1024
|
+
],
|
|
1025
|
+
});
|
|
1026
|
+
export const deniedScheduleMod = {
|
|
1027
|
+
manifest: deniedScheduleModManifest,
|
|
1028
|
+
operations: {
|
|
1029
|
+
'sched-denied/tick': (async (ctx) => {
|
|
1030
|
+
assertAllowed(await ctx.check('sched-denied:admin'));
|
|
1031
|
+
}),
|
|
974
1032
|
},
|
|
975
1033
|
};
|
|
976
1034
|
export const flowMod = {
|
|
@@ -1953,6 +2011,125 @@ export const peerMod = {
|
|
|
1953
2011
|
'peer/tuples': ((ctx) => ctx.sql.query("SELECT subject, relation, object, revoked_at FROM _substrat_tuples WHERE substr(subject, 1, 9) = 'vertical:' ORDER BY subject, relation")),
|
|
1954
2012
|
},
|
|
1955
2013
|
};
|
|
2014
|
+
// -- #1746: what an invocation emitted ----------------------------------------
|
|
2015
|
+
export const emittedModManifest = moduleManifest.parse({
|
|
2016
|
+
id: '@test/emitted',
|
|
2017
|
+
version: '1.0.0',
|
|
2018
|
+
kernelContract: '^0.0.1',
|
|
2019
|
+
permissions: [{ key: 'emitted:use', description: 'the emitted-report fixture permission' }],
|
|
2020
|
+
events: {
|
|
2021
|
+
emits: [
|
|
2022
|
+
{ type: 'emitted.touched', schemaVersion: 1 },
|
|
2023
|
+
{ type: 'emitted.echoed', schemaVersion: 1 },
|
|
2024
|
+
],
|
|
2025
|
+
consumes: [{ type: 'emitted.touched', schemaVersion: 1 }],
|
|
2026
|
+
},
|
|
2027
|
+
migrations: { journalDir: './migrations', compatibleFrom: '1.0.0' },
|
|
2028
|
+
attachmentTargets: [],
|
|
2029
|
+
entitlementKey: 'emitted',
|
|
2030
|
+
});
|
|
2031
|
+
/** One `emitted.touched` per id, in order — the rows `onEmitted` should name. */
|
|
2032
|
+
const touchAll = (ctx, ids) => {
|
|
2033
|
+
for (const id of ids) {
|
|
2034
|
+
ctx.emit({
|
|
2035
|
+
type: 'emitted.touched',
|
|
2036
|
+
schemaVersion: 1,
|
|
2037
|
+
entity: { entityType: 'emitted-thing', entityId: id },
|
|
2038
|
+
piiClass: 'none',
|
|
2039
|
+
payload: {},
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
};
|
|
2043
|
+
/**
|
|
2044
|
+
* The module the #1746 suite drives. Its consumer answers every `emitted.touched` with an
|
|
2045
|
+
* `emitted.echoed` in the same invocation, which is what lets the suite show the report
|
|
2046
|
+
* names the operation's own events and none of its consumers'.
|
|
2047
|
+
*/
|
|
2048
|
+
export const emittedMod = {
|
|
2049
|
+
manifest: emittedModManifest,
|
|
2050
|
+
operations: {
|
|
2051
|
+
'emitted/touch': ((ctx, input) => {
|
|
2052
|
+
touchAll(ctx, input.ids);
|
|
2053
|
+
return { touched: input.ids.length };
|
|
2054
|
+
}),
|
|
2055
|
+
'emitted/read': (() => ({ ok: true })),
|
|
2056
|
+
'emitted/fail': ((ctx, input) => {
|
|
2057
|
+
touchAll(ctx, input.ids);
|
|
2058
|
+
throw new Error('emitted/fail: refused after emitting');
|
|
2059
|
+
}),
|
|
2060
|
+
// A sub-transaction that rolled back takes its emit with it; the outer one commits.
|
|
2061
|
+
'emitted/partial': (async (ctx, input) => {
|
|
2062
|
+
touchAll(ctx, [input.kept]);
|
|
2063
|
+
try {
|
|
2064
|
+
await ctx.atomic(() => {
|
|
2065
|
+
touchAll(ctx, [input.dropped]);
|
|
2066
|
+
throw new Error('rolled back');
|
|
2067
|
+
});
|
|
2068
|
+
}
|
|
2069
|
+
catch {
|
|
2070
|
+
// The point of the fixture: the dropped emit is gone, the kept one stays.
|
|
2071
|
+
}
|
|
2072
|
+
return { ok: true };
|
|
2073
|
+
}),
|
|
2074
|
+
},
|
|
2075
|
+
consumers: {
|
|
2076
|
+
'emitted.touched': ((ctx, event) => {
|
|
2077
|
+
ctx.emit({
|
|
2078
|
+
type: 'emitted.echoed',
|
|
2079
|
+
schemaVersion: 1,
|
|
2080
|
+
entity: event.entity,
|
|
2081
|
+
piiClass: 'none',
|
|
2082
|
+
payload: {},
|
|
2083
|
+
});
|
|
2084
|
+
}),
|
|
2085
|
+
},
|
|
2086
|
+
};
|
|
2087
|
+
// -- #1746/#1747: ctx.log ------------------------------------------------------
|
|
2088
|
+
export const loggedModManifest = moduleManifest.parse({
|
|
2089
|
+
id: '@test/logged',
|
|
2090
|
+
version: '1.0.0',
|
|
2091
|
+
kernelContract: '^0.0.1',
|
|
2092
|
+
permissions: [{ key: 'logged:use', description: 'the ctx.log fixture permission' }],
|
|
2093
|
+
events: {
|
|
2094
|
+
emits: [{ type: 'logged.acted', schemaVersion: 1 }],
|
|
2095
|
+
consumes: [{ type: 'logged.acted', schemaVersion: 1 }],
|
|
2096
|
+
},
|
|
2097
|
+
migrations: { journalDir: './migrations', compatibleFrom: '1.0.0' },
|
|
2098
|
+
attachmentTargets: [],
|
|
2099
|
+
entitlementKey: 'logged',
|
|
2100
|
+
});
|
|
2101
|
+
/**
|
|
2102
|
+
* The module the `ctx.log` suite drives. `logged/act` logs, emits, and its consumer logs
|
|
2103
|
+
* again in the same invocation; `logged/fail` logs and then throws, so the suite can show
|
|
2104
|
+
* the line survives the rollback.
|
|
2105
|
+
*/
|
|
2106
|
+
export const loggedMod = {
|
|
2107
|
+
manifest: loggedModManifest,
|
|
2108
|
+
operations: {
|
|
2109
|
+
'logged/act': ((ctx, input) => {
|
|
2110
|
+
// `tenantId` and `operation` in the fields are the caller's own values: they stay
|
|
2111
|
+
// fields and never replace what the host stamps.
|
|
2112
|
+
ctx.log.info('reply to {ticketId} sent', { ticketId: input.ticketId, tenantId: 'forged', operation: 'forged' });
|
|
2113
|
+
ctx.emit({
|
|
2114
|
+
type: 'logged.acted',
|
|
2115
|
+
schemaVersion: 1,
|
|
2116
|
+
entity: { entityType: 'logged-thing', entityId: input.ticketId },
|
|
2117
|
+
piiClass: 'none',
|
|
2118
|
+
payload: {},
|
|
2119
|
+
});
|
|
2120
|
+
return { ok: true };
|
|
2121
|
+
}),
|
|
2122
|
+
'logged/fail': ((ctx, input) => {
|
|
2123
|
+
ctx.log.error('could not reach {ticketId}', { ticketId: input.ticketId });
|
|
2124
|
+
throw new Error('logged/fail: refused after logging');
|
|
2125
|
+
}),
|
|
2126
|
+
},
|
|
2127
|
+
consumers: {
|
|
2128
|
+
'logged.acted': ((ctx, event) => {
|
|
2129
|
+
ctx.log.warn('saw {type}', { type: event.type });
|
|
2130
|
+
}),
|
|
2131
|
+
},
|
|
2132
|
+
};
|
|
1956
2133
|
export const contractTestModules = [
|
|
1957
2134
|
...contractTestInitialModules,
|
|
1958
2135
|
lateMod,
|
|
@@ -1964,6 +2141,13 @@ export const contractTestModules = [
|
|
|
1964
2141
|
impersonationEchoMod,
|
|
1965
2142
|
connectorMod,
|
|
1966
2143
|
scheduleMod,
|
|
2144
|
+
// #1525: the failed-schedule fixture. A Durable Object bakes its operations in at
|
|
2145
|
+
// define time (this array), so registering it on a coordinator mid-test is not
|
|
2146
|
+
// enough for the CLOUDFLARE adapter to know the operation exists — it has to be
|
|
2147
|
+
// here too, or `stub.invoke('sched-denied/tick', …)` throws `not_found` before
|
|
2148
|
+
// `ctx.check` ever runs, which still counts as a failed schedule but records no
|
|
2149
|
+
// denial. Inert for every other suite — nothing else invokes `sched-denied/tick`.
|
|
2150
|
+
deniedScheduleMod,
|
|
1967
2151
|
// #1577: the operation a resumable run's steps write through. Inert for every
|
|
1968
2152
|
// other suite — nothing else reads `job_items`.
|
|
1969
2153
|
jobsMod,
|
|
@@ -1978,6 +2162,12 @@ export const contractTestModules = [
|
|
|
1978
2162
|
capMod,
|
|
1979
2163
|
// #1706: the peer suite's target. Inert for every other suite beyond the peers' seats.
|
|
1980
2164
|
peerMod,
|
|
2165
|
+
// #1746: the emitted-report suite's module. Its consumer reacts only to its own
|
|
2166
|
+
// `emitted.touched`, so it is inert for every other suite.
|
|
2167
|
+
emittedMod,
|
|
2168
|
+
// #1746/#1747: the ctx.log suite's module. Its consumer reacts only to its own
|
|
2169
|
+
// `logged.acted`, so it is inert for every other suite.
|
|
2170
|
+
loggedMod,
|
|
1981
2171
|
];
|
|
1982
2172
|
// -- live reads (#938) -------------------------------------------------------
|
|
1983
2173
|
/**
|