FN-5663: add goal-citation audit trail to agent reasoning
Record goal citation evidence so agent reasoning can be traced end-to-end. - add core goal citation types, extraction helper, persistence schema, and store APIs for citation create/list workflows - add CLI support and tests for goal citation flows, including command wiring and regression coverage - update docs and add a published changeset for @runfusion/fusion describing the new audit-trail capability Files changed: .changeset/fn-5663-goal-citation-audit-trail.md | 10 + docs/agents.md | 15 ++ docs/cli-reference.md | 6 +- packages/cli/src/__tests__/bin.test.ts | 2 + .../cli/src/__tests__/goals-citations-cli.test.ts | 82 ++++++++ packages/cli/src/bin.ts | 19 +- packages/cli/src/commands/goals.ts | 43 +++++ packages/core/src/__tests__/db-migrate.test.ts | 10 +- packages/core/src/__tests__/db.test.ts | 34 ++-- .../src/__tests__/goal-citation-extractor.test.ts | 56 ++++++ .../src/__tests__/goal-citations-store.test.ts | 175 +++++++++++++++++ packages/core/src/__tests__/goals-schema.test.ts | 2 +- packages/core/src/__tests__/insight-store.test.ts | 10 +- packages/core/src/__tests__/mission-store.test.ts | 2 +- packages/core/src/__tests__/run-audit.test.ts | 2 +- packages/core/src/__tests__/secrets-schema.test.ts | 6 +- .../core/src/__tests__/store-merge-queue.test.ts | 2 +- packages/core/src/__tests__/task-documents.test.ts | 2 +- packages/core/src/db.ts | 51 ++++- packages/core/src/goal-citation-extractor.ts | 56 ++++++ packages/core/src/index.ts | 13 ++ packages/core/src/store.ts | 210 ++++++++++++++++++++- packages/core/src/types.ts | 51 ++++- .../src/store/__tests__/roadmap-store.test.ts | 4 +- 24 files changed, 817 insertions(+), 46 deletions(-) Fusion-Task-Id: FN-5663 Fusion-Task-Lineage: 720f2c4b-4363-464a-a76f-472ec6aca136
This commit is contained in:
10
.changeset/fn-5663-goal-citation-audit-trail.md
Normal file
10
.changeset/fn-5663-goal-citation-audit-trail.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
"@runfusion/fusion": minor
|
||||
---
|
||||
|
||||
Add a goal-citation audit trail to support Slice 2 anchoring success-signal measurement.
|
||||
|
||||
- Introduce a persisted `goal_citations` table (schema v93) with deduplication on `(goalId, surface, sourceRef)`.
|
||||
- Record citations from `agent_log` and `task_document` write seams.
|
||||
- Extract goal IDs using `GOAL_ID_PATTERN` (`/\bG-[0-9A-Z]+(?:-[0-9A-Z]+)*\b/g`) and store bounded snippets (max 200 chars).
|
||||
- Add `fn goals citations` with filters: `--goal`, `--agent`, `--surface`, `--since`, `--until`, `--limit`, and `--json`.
|
||||
Reference in New Issue
Block a user