Skip to content

Commit a4318ed

Browse files
committed
test(souls): pin finite trace limits, null trace members and the README's systemBlocks line
Signed-off-by: jddunn <[email protected]>
1 parent 2859e49 commit a4318ed

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/api/__tests__/soul-identity.gmi.e2e.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,5 +470,6 @@ describe('what the docs say about the limits closing the prompt', () => {
470470
expect(doc('docs/SOUL_FILES.md')).toContain(exception);
471471
expect(doc('docs/safety/GUARDRAILS_USAGE.md')).toContain(exception);
472472
expect(doc('README.md')).not.toContain('Identity, voice, hard limits, and HEXACO scores');
473+
expect(doc('README.md')).toContain("With `systemBlocks`, the soul's prose and style are left out and its hard limits still close the prompt.");
473474
});
474475
});

‎src/cognition/substrate/personas/__tests__/SoulLoader.identity.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,16 @@ describe('validateSoulFrontmatter', () => {
106106
it.each([
107107
['maxEntries', 'many'],
108108
['maxMessageLength', '300'],
109-
])('refuses reasoningTrace.%s that is not a number, naming the field', (member, value) => {
109+
['maxEntries', Number.NaN],
110+
['maxMessageLength', Number.POSITIVE_INFINITY],
111+
])('refuses reasoningTrace.%s that is not a finite number (%s), naming the field', (member, value) => {
110112
expect(() => validateSoulFrontmatter({ reasoningTrace: { [member]: value } }, '/souls/aria')).toThrow(
111-
new SoulLoadError('/souls/aria', `front matter field 'reasoningTrace.${member}' must be a number`),
113+
new SoulLoadError('/souls/aria', `front matter field 'reasoningTrace.${member}' must be a finite number`),
112114
);
113115
});
116+
it('reads a reasoningTrace member set to null (an empty YAML value) as unset', () => {
117+
expect(validateSoulFrontmatter({ reasoningTrace: { maxEntries: null, maxMessageLength: 40 } }).reasoningTrace).toEqual({ maxMessageLength: 40 });
118+
});
114119
it('is what parseSoul runs, with the inline source', () => {
115120
expect(() => parseSoul("---\nhardLimits: never\n---\nYou are Aria.")).toThrow("The soul failed to load (inline soul): front matter field 'hardLimits' must be a list of strings");
116121
});

0 commit comments

Comments
 (0)