Skip to content

feat(analysis): decision provenance and citation foundations (#32) - #37

Draft
ClaudiaFang wants to merge 5 commits into
mainfrom
feat/code-insights-decision-attribution
Draft

ClaudiaFang wants to merge 5 commits into
mainfrom
feat/code-insights-decision-attribution

Conversation

@ClaudiaFang

@ClaudiaFang ClaudiaFang commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

First implementation slice for #32 (part of #31): selectively port evidence-grounded Decision Attribution from b08x into Firstsun's analysis pipeline, without replacing Firstsun schema or UI.

  • Analysis prompt and JSON Schema now include decided_by (user | agent | collaborative | unknown) plus optional intent and branch_point.
  • Existing User#N / Assistant#N evidence remains; prompt now specifies role-specific zero-based ordinals.
  • Persist provenance in insights.metadata with conservative unknown fallback for absent/invalid actor values, not collaborative.
  • Expose attribution + decision context in shared Decision UI.
  • Bump extraction version to 3.1.0 so the new analytical output is identifiable.
  • Add unit tests for agency persistence, legacy fallback and prompt instructions.

No SQLite migration in this slice. Firstsun V1-V14, Multi-home/Personality/Kilo, Docker and Node24/pnpm12 configuration are untouched.

Remaining for #32 (this PR is DRAFT)

  • Backend TurnRef -> message ID resolver rejects malformed or out-of-range references; literal quote grounding still requires manual/fixture verification.
  • Click-through session evidence uses backend role-ordinal resolution, fetches a bounded page and highlights the message.
  • End-to-end fixtures for multi-home, tool-result rows, compactions, duplicate timestamps and actor classification quality.
  • CI/build/test passed: https://github.com/firstsun-dev/code-insights/actions/runs/40623946029
  • Final technical/code review; no merge or production deploy until approval.

Source

Refs #31; Partially implements #32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant