@githolon/dsl 0.43.0 → 0.44.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/package.json +1 -1
- package/src/codegen_dart.ts +2 -0
- package/src/flow_gate.ts +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@githolon/dsl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Nomos 2 domain-authoring DSL: aggregates + directives in TS, executed and encoded to the Rust kernel's wire shapes.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/codegen_dart.ts
CHANGED
|
@@ -1475,6 +1475,8 @@ function emitUnionClasses(d: ValueObjectDescriptor): string {
|
|
|
1475
1475
|
`/// Union \`${d.name}\` — a sum type stored as ONE json leaf (wholesale-replace; the`,
|
|
1476
1476
|
`/// \`type\` discriminator names the arm). Adding an arm is ADDITIVE (older clients decode`,
|
|
1477
1477
|
`/// it as [${d.name}Unknown]); removing/renaming an arm is a retype (#58 dispositions).`,
|
|
1478
|
+
`/// \`.encrypted()\` on a field of this type seals the WHOLE leaf — discriminator included;`,
|
|
1479
|
+
`/// per-arm sensitivity cannot be split (model differently-classified arms as separate fields).`,
|
|
1478
1480
|
`sealed class ${d.name} {`,
|
|
1479
1481
|
` const ${d.name}();`,
|
|
1480
1482
|
` Map<String, Object?> toJson();`,
|
package/src/flow_gate.ts
CHANGED
|
@@ -173,8 +173,19 @@ export function assertFlowGate(m: CanonicalManifest, mod?: FlowModule): void {
|
|
|
173
173
|
let refs: readonly { readonly aggregate: string }[];
|
|
174
174
|
try {
|
|
175
175
|
refs = wi.reads({ intent: new Proxy({}, { get: () => "" }) as Record<string, unknown>, principal: "" }) ?? [];
|
|
176
|
-
} catch {
|
|
177
|
-
|
|
176
|
+
} catch (e) {
|
|
177
|
+
// THE 4b PROBE HOLE, CLOSED (classified_first_class.md §2.1): a read-set that cannot be
|
|
178
|
+
// resolved on the probe used to be SKIPPED — "conservative on availability" was a hole on
|
|
179
|
+
// SAFETY (an invariant could escape rule 4 by accident of a throwing reads()). On a domain
|
|
180
|
+
// that HAS private types, an unresolvable read-set now REFUSES: make reads() total over a
|
|
181
|
+
// probe intent (every field reads as ""), or declare declassify if the read-set is
|
|
182
|
+
// genuinely intent-dependent and touches private state.
|
|
183
|
+
throw new FlowGateError(
|
|
184
|
+
`[nomosFlowGate rule 4b — unresolvable read-set] workspaceInvariant '${wi.id}' on '${wi.on}': its ` +
|
|
185
|
+
`.reads() threw on the compile probe (${String((e as Error)?.message ?? e).slice(0, 120)}) so the gate ` +
|
|
186
|
+
`cannot prove the refusal is secret-free while this domain declares private types. Make .reads() total ` +
|
|
187
|
+
`over a probe intent (every intent field reads as ""), or acknowledge with .declassify("<why>").`,
|
|
188
|
+
);
|
|
178
189
|
}
|
|
179
190
|
for (const r of refs) {
|
|
180
191
|
const short = r.aggregate.includes(".") ? r.aggregate.slice(r.aggregate.lastIndexOf(".") + 1) : r.aggregate;
|