@principles/core 1.278.9 → 1.278.10
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/runtime-v2/internalization/__tests__/prompt-serializer.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/prompt-serializer.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/prompt-serializer.test.js +91 -0
- package/dist/runtime-v2/internalization/__tests__/prompt-serializer.test.js.map +1 -0
- package/dist/runtime-v2/internalization/prompt-serializer.d.ts +27 -1
- package/dist/runtime-v2/internalization/prompt-serializer.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/prompt-serializer.js +45 -11
- package/dist/runtime-v2/internalization/prompt-serializer.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-serializer.test.d.ts","sourceRoot":"","sources":["../../../../src/runtime-v2/internalization/__tests__/prompt-serializer.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { serializePromptInput } from '../prompt-serializer.js';
|
|
3
|
+
/**
|
|
4
|
+
* EP002-R2 finding: the artificer/evaluator prompt inputs legitimately contain
|
|
5
|
+
* the SAME object under two paths (e.g. intentContract both at top level and
|
|
6
|
+
* nested in scribeArtifact). The WeakSet-based serializer misclassified that
|
|
7
|
+
* DAG re-visit as a cycle and emitted '[Circular]' — the LLM received a
|
|
8
|
+
* placeholder where the contract content should have been (the evaluator
|
|
9
|
+
* flagged this as "Input intentContract serialized as '[Circular]'").
|
|
10
|
+
*
|
|
11
|
+
* Contract under test:
|
|
12
|
+
* - DAG (object reachable twice via separate paths) → serialized in full BOTH times;
|
|
13
|
+
* - true cycle (object is its own ancestor, direct or indirect) → '[Circular]' placeholder, no crash;
|
|
14
|
+
* - native JSON.stringify value semantics preserved for non-plain values
|
|
15
|
+
* (Date/toJSON()/Map/Set) — the review regression guard: a manual walker
|
|
16
|
+
* re-enumerated Date instances into '{}';
|
|
17
|
+
* - bigint mapping + bounded output preserved.
|
|
18
|
+
*/
|
|
19
|
+
describe('serializePromptInput — DAG vs cycle', () => {
|
|
20
|
+
it('serializes an object referenced twice (DAG) in full both times — not "[Circular]"', () => {
|
|
21
|
+
const intentContract = { ownerIntent: 'stop guessing config contracts' };
|
|
22
|
+
const input = { intentContract, scribeArtifact: { intentContract } };
|
|
23
|
+
const out = JSON.parse(serializePromptInput(input));
|
|
24
|
+
expect(out.intentContract.ownerIntent).toBe('stop guessing config contracts');
|
|
25
|
+
expect(out.scribeArtifact.intentContract.ownerIntent).toBe('stop guessing config contracts');
|
|
26
|
+
});
|
|
27
|
+
it('serializes sibling references to the same leaf object without placeholders', () => {
|
|
28
|
+
const shared = { tokenId: 'tok-1' };
|
|
29
|
+
const input = { a: shared, b: shared, list: [shared, shared] };
|
|
30
|
+
const out = JSON.parse(serializePromptInput(input));
|
|
31
|
+
expect(out.a.tokenId).toBe('tok-1');
|
|
32
|
+
expect(out.b.tokenId).toBe('tok-1');
|
|
33
|
+
expect(out.list[0]?.tokenId).toBe('tok-1');
|
|
34
|
+
expect(out.list[1]?.tokenId).toBe('tok-1');
|
|
35
|
+
});
|
|
36
|
+
it('replaces a TRUE cycle with "[Circular]" (bounded output, no crash)', () => {
|
|
37
|
+
const a = { name: 'a' };
|
|
38
|
+
a.self = a;
|
|
39
|
+
const out = JSON.parse(serializePromptInput(a));
|
|
40
|
+
expect(out.name).toBe('a');
|
|
41
|
+
expect(out.self).toBe('[Circular]');
|
|
42
|
+
});
|
|
43
|
+
it('replaces an indirect cycle at the repeating depth only', () => {
|
|
44
|
+
const leaf = { v: 1 };
|
|
45
|
+
const mid = { leaf };
|
|
46
|
+
const root = { mid, alias: mid };
|
|
47
|
+
// root → mid → leaf is a DAG (alias re-visits mid AFTER its subtree completed)
|
|
48
|
+
const out = JSON.parse(serializePromptInput(root));
|
|
49
|
+
expect(out.mid.leaf.v).toBe(1);
|
|
50
|
+
expect(out.alias.leaf.v).toBe(1);
|
|
51
|
+
});
|
|
52
|
+
it('bounds a TRUE indirect cycle A → B → A at the back-edge only', () => {
|
|
53
|
+
const a = { name: 'A' };
|
|
54
|
+
const b = { parent: a };
|
|
55
|
+
a.child = b;
|
|
56
|
+
const out = JSON.parse(serializePromptInput(a));
|
|
57
|
+
expect(out.name).toBe('A');
|
|
58
|
+
expect(out.child.parent).toBe('[Circular]');
|
|
59
|
+
});
|
|
60
|
+
it('preserves native Date serialization (toJSON) instead of collapsing it to {}', () => {
|
|
61
|
+
const date = new Date('2026-01-01T00:00:00.000Z');
|
|
62
|
+
const out = JSON.parse(serializePromptInput({ at: date }));
|
|
63
|
+
expect(out.at).toBe(date.toISOString());
|
|
64
|
+
});
|
|
65
|
+
it('applies a custom toJSON() exactly like native JSON.stringify', () => {
|
|
66
|
+
const value = { artifact: { toJSON: () => ({ canonical: true }) } };
|
|
67
|
+
expect(serializePromptInput(value)).toBe(JSON.stringify(value));
|
|
68
|
+
const out = JSON.parse(serializePromptInput(value));
|
|
69
|
+
expect(out.artifact.canonical).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
it('keeps native semantics for non-plain objects (Map/Set) — native parity, not re-enumeration', () => {
|
|
72
|
+
const value = { tags: new Set(['x']), lookup: new Map([['k', 1]]) };
|
|
73
|
+
// Native JSON.stringify renders Map/Set as {}; the wrapper preserves that
|
|
74
|
+
// contract instead of inventing its own representation.
|
|
75
|
+
expect(serializePromptInput(value)).toBe(JSON.stringify(value));
|
|
76
|
+
});
|
|
77
|
+
it('maps bigint values with the n suffix', () => {
|
|
78
|
+
const out = JSON.parse(serializePromptInput({ count: 5n }));
|
|
79
|
+
expect(out.count).toBe('5n');
|
|
80
|
+
});
|
|
81
|
+
it('maps bigint nested in arrays with the n suffix', () => {
|
|
82
|
+
const out = JSON.parse(serializePromptInput([1n, { count: 2n }]));
|
|
83
|
+
expect(out).toEqual(['1n', { count: '2n' }]);
|
|
84
|
+
});
|
|
85
|
+
it('returns "null" for an undefined root and still caps oversized output', () => {
|
|
86
|
+
expect(serializePromptInput(undefined)).toBe('null');
|
|
87
|
+
const big = { blob: 'x'.repeat(60_000) };
|
|
88
|
+
expect(() => serializePromptInput(big)).toThrow(RangeError);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=prompt-serializer.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-serializer.test.js","sourceRoot":"","sources":["../../../../src/runtime-v2/internalization/__tests__/prompt-serializer.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;;;;;;;;;;;;;GAeG;AACH,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,EAAE,CAAC,mFAAmF,EAAE,GAAG,EAAE;QAC3F,MAAM,cAAc,GAAG,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;QACzE,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,cAAc,EAAE,EAAE,CAAC;QACrE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAC9E,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;QACpF,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,EAAE,CAAC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,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAc,CAAC;QAC/E,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sEAAsE,EAAE,GAAG,EAAE;QAC9E,MAAM,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Serialize untrusted prompt context without circular-reference crashes or
|
|
3
|
+
* unbounded output.
|
|
4
|
+
*
|
|
5
|
+
* Contract: NATIVE JSON.stringify value semantics — property enumeration,
|
|
6
|
+
* toJSON() (Date → ISO string, custom canonicalizers), arrays, primitives —
|
|
7
|
+
* stay with the engine. This wrapper only:
|
|
8
|
+
* (a) maps bigint to an "Nn" string (native stringify throws on bigint),
|
|
9
|
+
* (b) replaces true ancestor-path cycles with '[Circular]',
|
|
10
|
+
* (c) enforces the output-size cap on the FINAL serialized string.
|
|
11
|
+
*
|
|
12
|
+
* DAG-aware (EP002-R2): a WeakSet of every visited object misclassifies a
|
|
13
|
+
* repeated reference (the same contract reachable via two separate paths —
|
|
14
|
+
* e.g. `intentContract` and `scribeArtifact.intentContract`) as a cycle and
|
|
15
|
+
* would emit '[Circular]' where the LLM needs the content. Cycle detection
|
|
16
|
+
* therefore tracks the CURRENT ancestor path only: an object re-entered while
|
|
17
|
+
* still on the path is a true cycle (replaced, bounded); an object reached
|
|
18
|
+
* again after its subtree completed serializes in full.
|
|
19
|
+
*
|
|
20
|
+
* Implemented as a JSON.stringify replacer instead of a manual walker so
|
|
21
|
+
* non-plain objects keep native semantics: the engine applies toJSON() BEFORE
|
|
22
|
+
* calling the replacer, so a Date arrives already converted and is never
|
|
23
|
+
* re-enumerated into '{}'. The replacer runs pre-order over the serialization
|
|
24
|
+
* tree with `this` = the object whose property is being emitted; unwinding the
|
|
25
|
+
* ancestor stack to `this` on every call pops the previous sibling's completed
|
|
26
|
+
* subtree — exactly the exit signal a flat WeakSet lacks.
|
|
27
|
+
*/
|
|
2
28
|
export declare function serializePromptInput(value: unknown): string;
|
|
3
29
|
//# sourceMappingURL=prompt-serializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-serializer.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/prompt-serializer.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"prompt-serializer.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/prompt-serializer.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAuB3D"}
|
|
@@ -1,17 +1,51 @@
|
|
|
1
1
|
const MAX_PROMPT_CHARS = 50_000;
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Serialize untrusted prompt context without circular-reference crashes or
|
|
4
|
+
* unbounded output.
|
|
5
|
+
*
|
|
6
|
+
* Contract: NATIVE JSON.stringify value semantics — property enumeration,
|
|
7
|
+
* toJSON() (Date → ISO string, custom canonicalizers), arrays, primitives —
|
|
8
|
+
* stay with the engine. This wrapper only:
|
|
9
|
+
* (a) maps bigint to an "Nn" string (native stringify throws on bigint),
|
|
10
|
+
* (b) replaces true ancestor-path cycles with '[Circular]',
|
|
11
|
+
* (c) enforces the output-size cap on the FINAL serialized string.
|
|
12
|
+
*
|
|
13
|
+
* DAG-aware (EP002-R2): a WeakSet of every visited object misclassifies a
|
|
14
|
+
* repeated reference (the same contract reachable via two separate paths —
|
|
15
|
+
* e.g. `intentContract` and `scribeArtifact.intentContract`) as a cycle and
|
|
16
|
+
* would emit '[Circular]' where the LLM needs the content. Cycle detection
|
|
17
|
+
* therefore tracks the CURRENT ancestor path only: an object re-entered while
|
|
18
|
+
* still on the path is a true cycle (replaced, bounded); an object reached
|
|
19
|
+
* again after its subtree completed serializes in full.
|
|
20
|
+
*
|
|
21
|
+
* Implemented as a JSON.stringify replacer instead of a manual walker so
|
|
22
|
+
* non-plain objects keep native semantics: the engine applies toJSON() BEFORE
|
|
23
|
+
* calling the replacer, so a Date arrives already converted and is never
|
|
24
|
+
* re-enumerated into '{}'. The replacer runs pre-order over the serialization
|
|
25
|
+
* tree with `this` = the object whose property is being emitted; unwinding the
|
|
26
|
+
* ancestor stack to `this` on every call pops the previous sibling's completed
|
|
27
|
+
* subtree — exactly the exit signal a flat WeakSet lacks.
|
|
28
|
+
*/
|
|
3
29
|
export function serializePromptInput(value) {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
30
|
+
const ancestors = [];
|
|
31
|
+
const onPath = new Set();
|
|
32
|
+
const replacer = function (key, node) {
|
|
33
|
+
if (typeof node === 'bigint')
|
|
34
|
+
return `${node}n`;
|
|
35
|
+
if (typeof node !== 'object' || node === null)
|
|
36
|
+
return node;
|
|
37
|
+
while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) {
|
|
38
|
+
const exited = ancestors.pop();
|
|
39
|
+
if (exited !== undefined)
|
|
40
|
+
onPath.delete(exited);
|
|
41
|
+
}
|
|
42
|
+
if (onPath.has(node))
|
|
11
43
|
return '[Circular]';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
44
|
+
ancestors.push(node);
|
|
45
|
+
onPath.add(node);
|
|
46
|
+
return node;
|
|
47
|
+
};
|
|
48
|
+
const serialized = JSON.stringify(value, replacer);
|
|
15
49
|
if (serialized === undefined)
|
|
16
50
|
return 'null';
|
|
17
51
|
if (serialized.length > MAX_PROMPT_CHARS) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-serializer.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/prompt-serializer.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC
|
|
1
|
+
{"version":3,"file":"prompt-serializer.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/prompt-serializer.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IAEjC,MAAM,QAAQ,GAAG,UAAwB,GAAW,EAAE,IAAa;QACjE,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,OAAO,GAAG,IAAI,GAAG,CAAC;QAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC3D,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACxE,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;YAC/B,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,YAAY,CAAC;QAC1C,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACnD,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAC5C,IAAI,UAAU,CAAC,MAAM,GAAG,gBAAgB,EAAE,CAAC;QACzC,MAAM,IAAI,UAAU,CAAC,wBAAwB,gBAAgB,aAAa,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principles/core",
|
|
3
|
-
"version": "1.278.
|
|
3
|
+
"version": "1.278.10",
|
|
4
4
|
"description": "Pure-logic core of Principles Disciple, an AI Agent Governance System - pain signal capture and principle proposal (no I/O)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|