Skip to content

epic: selectively port b08x session intelligence, long-context retrieval, RAG chat and source adapters #31

Open

Description

@ClaudiaFang

Epic 狀態(2026-10-28)

Goal

Selectively port the following b08x/code-insights development capabilities into firstsun-dev/code-insights main, without merging the diverged forks wholesale.

Source revision: b08x/development@789723ffb18a40733ee6c2a957a435fd94e0deb8
Target baseline: firstsun-dev/main@3edfec99e6632ef60d6950ce918707bfda516ebf

Implementation PRs (Draft; no merge)

Implementation issues

Scope (independent PRs)

  1. Decision attribution (user | agent | collaborative | unknown) with validated, navigable turn citations.
  2. Long-session semantic chunking, context-aware retrieval and quality/cost regression tests.
  3. Rage-loop/repeated-failure detection end-to-end (detector already present with identical blob SHA; fix wiring/taxonomy rather than re-copying).
  4. Read-only interactive RAG Agent Chat with citations and opt-in permissions.
  5. Claude Desktop and Pi AI session source adapters, tested independently.

Architectural constraints (non-negotiable)

  • Preserve Firstsun-only functionality: multi-home, Personality, Kilo, reports, OpenAPI, Docker/sidecar, provider support, existing filters and pricing.
  • Preserve Node 24 / pnpm 12.14.0 build and CI toolchain.
  • Firstsun DB currently at V14; b08x has independently assigned V12-V18 meanings. Never copy b08x migration numbers or replace Firstsun's migration history. Add forward-only additive migrations starting after V14, with backfill and fresh/production-copy upgrade tests.
  • Preserve current embedding dimensions/model metadata. Do not attach a 1024-dimensional index to a 768-dimensional embedding table.
  • Restrict RAG access by project + home with fail-closed filters; any optional codebase tools must require explicit opt-in.
  • Harden service binding/auth and disable outbound telemetry for isolated tests before enabling a chat interface. Avoid wholesale $HOME RW mounts.
  • Use representative multi-tool session fixtures and benchmark changes against main; avoid noisy auto-reanalysis or migrations that overwrite existing insight history.

Suggested sequence

  • Phase A: decision attribution + stable citation resolver, then end-to-end rage-loop integration.
  • Phase B: long-context retrieval and additive schema/index changes, offline backfill.
  • Phase C: RAG chat atop the retrieval foundation, including privacy and authorization.
  • Phase D: Claude Desktop and Pi parsers (can proceed independently when fixtures exist).

Done when

All five workstreams have independent tested PRs, no existing functionality regresses, database upgrades remain forward-compatible, and human review occurs before merge/deploy.

Refs:

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions