mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-13 03:48:06 +01:00
test: plan-design SDK fixture pins its harness prompt once, by ordered properties (W7e plan-design-sdk-fixture.test.ts:91-120; t01 F13)
The prompt was pinned three ways (sha256, ~20 sentences, an order check). Kept: the skill and lazy-section paths, the plan path, the ordered read -> review -> edit -> Write -> read-back -> summary steps, and the no-browsing rule (case-insensitive). Dropped the hash and sentence pins. Negative control: removing the read-back step turns it red.
This commit is contained in:
1 parent
c2d3182f24
commit
e28ef17040
1 file changed
+6
-25
@@ -87,37 +87,18 @@ async function exercise(mode: 'success' | 'max-turns' | 'first-timeout' | 'secon
|
||||
expect(opts.publicStreamDiagnostics).toBe(true);
|
||||
expect(opts.signal).toBeInstanceOf(AbortSignal); sdkSignal = opts.signal;
|
||||
expect(opts.signal.aborted).toBe(false);
|
||||
// Bind the complete actual compact-delivery prompt, not selected snippets.
|
||||
expect(new Bun.CryptoHasher('sha256').update(opts.prompt).digest('hex'))
|
||||
.toBe('021c9f2b0522fc55bc265a976356678a048f3c17d27b63669674c805a485b28e');
|
||||
expect(opts.testName).toBe(id); expect(opts.maxTurns).toBe(15); expect(opts.timeout).toBe(CAPTURE_MS);
|
||||
for (const key of ['model', 'tools', 'allowedTools', 'appendSystemPrompt', 'env']) expect(opts).not.toHaveProperty(key);
|
||||
expect(opts.prompt).toContain('Review the plan in ./plan.md');
|
||||
expect(opts.prompt).toContain('Review all 7 design passes');
|
||||
expect(opts.prompt).toContain('0-10 and explain what would make it a 10');
|
||||
expect(opts.prompt).toContain('preserve the unresolved-decisions pass');
|
||||
expect(opts.prompt).toContain('interaction state table, empty states, responsive behavior');
|
||||
expect(opts.prompt).toContain('full required review report');
|
||||
expect(opts.prompt).toContain('Write before publishing a completed walkthrough');
|
||||
expect(opts.prompt).toContain('Read plan.md back to verify the saved changes');
|
||||
expect(opts.prompt).toContain('Then return a brief, concrete summary');
|
||||
expect(opts.prompt).toContain('natively Read plan-design-review/SKILL.md');
|
||||
expect(opts.prompt).toContain('plan-design-review/sections/review-sections.md (the one lazy section this review requires)');
|
||||
expect(opts.prompt).toContain('including the report, to about 10,000 characters; this is a drafting target, not a check, so do not count characters or trim after saving');
|
||||
expect(opts.prompt).toContain('in at most ten lines');
|
||||
expect(opts.prompt).toContain('execute every required pass and lazy-section Read');
|
||||
expect(opts.prompt).toContain('Retain all required report fields, design decisions, diagrams, ratings, and explanations');
|
||||
expect(opts.prompt).toContain('use the canonical tables and decision IDs');
|
||||
expect(opts.prompt).toContain('Specify each design requirement once');
|
||||
expect(opts.prompt).toContain('instead of repeating that specification');
|
||||
expect(opts.prompt).toContain('concise score rationales and 10/10 explanations');
|
||||
// The harness prompt's properties, in order; its wording is free.
|
||||
expect(opts.prompt).toContain('plan-design-review/SKILL.md');
|
||||
expect(opts.prompt).toContain('plan-design-review/sections/review-sections.md');
|
||||
expect(opts.prompt).toContain('./plan.md');
|
||||
const ordered = ['Read every lazy section', 'Review all 7 design passes',
|
||||
'EDIT plan.md', 'Keep the saved review compact',
|
||||
'Persist that complete plan and review with Write', 'Read plan.md back',
|
||||
'EDIT plan.md', 'Persist that complete plan and review with Write', 'Read plan.md back',
|
||||
'Then return a brief, concrete summary'].map(text => opts.prompt.indexOf(text));
|
||||
expect(ordered.every(index => index >= 0)).toBe(true);
|
||||
expect(ordered).toEqual([...ordered].sort((a, b) => a - b));
|
||||
expect(opts.prompt).toContain('Do NOT try to browse any URLs');
|
||||
expect(opts.prompt).toMatch(/do not try to browse any URLs/i);
|
||||
inputVerified = true; launched = true;
|
||||
if (mode === 'attempt-deadline') return await new Promise((_resolve, reject) => {
|
||||
opts.signal.addEventListener('abort', () => reject(opts.signal.reason), { once: true });
|
||||
|
||||
Reference in new issue
Block a user