feat(observer): emit chain_ref in primary_rationale
This commit is contained in:
@@ -106,6 +106,25 @@ describe('parseTranscript', () => {
|
||||
expect(parseTranscript(t).primary_rationale.node_chosen).toBe('direct');
|
||||
});
|
||||
|
||||
it('attaches chain_ref for a node that belongs to a chain', () => {
|
||||
const t = jsonl([
|
||||
userPrompt('go', '2026-05-19T10:00:00Z'),
|
||||
assistantTurn(
|
||||
[{ type: 'tool_use', id: 't1', name: 'Skill', input: { skill: 'billing-audit' } }],
|
||||
'2026-05-19T10:01:00Z'
|
||||
),
|
||||
]);
|
||||
expect(parseTranscript(t).primary_rationale.chain_ref).toEqual(['L13']);
|
||||
});
|
||||
|
||||
it('sets chain_ref null for a direct episode', () => {
|
||||
const t = jsonl([
|
||||
userPrompt('go', '2026-05-19T10:00:00Z'),
|
||||
assistantTurn([{ type: 'tool_use', id: 't1', name: 'Read', input: {} }], '2026-05-19T10:01:00Z'),
|
||||
]);
|
||||
expect(parseTranscript(t).primary_rationale.chain_ref).toBeNull();
|
||||
});
|
||||
|
||||
it('hard_floor invoked when a superpowers skill is used', () => {
|
||||
const t = jsonl([
|
||||
userPrompt('go', '2026-05-19T10:00:00Z'),
|
||||
|
||||
Reference in New Issue
Block a user