mirror of
https://github.com/morluto/rea
synced 2026-10-27 06:33:32 -04:00
fix(javascript)!: preserve property paths and uncertain slot presence
Use one explicit object/array slot model and JSON-pointer property identity across mutation analysis, return projection, and semantic graphs. Require observed presence for discriminants and resolve writes only through retained object or array receivers. BREAKING CHANGE: projected return fields require explicit presence and semantic object operations carry full property paths.
This commit is contained in:
@@ -71,6 +71,7 @@ it("parses projected fields into literal, union, or unknown values", () => {
|
||||
projectedExportReturnShapesSchema.safeParse(
|
||||
projectionWithField({
|
||||
path: "/kind",
|
||||
presence: "present",
|
||||
state: "unknown",
|
||||
value: "invented",
|
||||
reason: "Dynamic property",
|
||||
@@ -81,6 +82,7 @@ it("parses projected fields into literal, union, or unknown values", () => {
|
||||
projectedExportReturnShapesSchema.safeParse(
|
||||
projectionWithField({
|
||||
path: "/kind",
|
||||
presence: "present",
|
||||
state: "union",
|
||||
value: ["success", "failure"],
|
||||
reason: null,
|
||||
@@ -88,3 +90,16 @@ it("parses projected fields into literal, union, or unknown values", () => {
|
||||
).success,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects return fields that omit slot presence", () => {
|
||||
expect(
|
||||
projectedExportReturnShapesSchema.safeParse(
|
||||
projectionWithField({
|
||||
path: "/kind",
|
||||
state: "literal",
|
||||
value: "result",
|
||||
reason: null,
|
||||
}),
|
||||
).success,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user