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:
morluto
2026-10-09 20:03:19 +08:00
parent 63bf91405c
commit 475a0f84da
23 changed files with 831 additions and 560 deletions
@@ -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);
});