[P1] H01: Assemble bounded authorized context and propagate answer provenance #26

Open
opened 2026-10-21 20:29:29 +02:00 by amiryahaya · 0 comments
Owner

Backlog ID: H01 | Priority: P1 | Phase: M5 — Local inference and complete chat

Outcome and scope

Build each generation request from the current question, selected reauthorized recent turns and canonical authorized chunks within the permitted model token budget.

Dependencies and gates

Engineering prerequisites: #13 (C01), #23 (R02), #15 (E01), #22 (I05)

Synthetic-data development may proceed. Production use remains subject to the decision gates in the SRS.

Starting points

crates/conversations/src/context/; crates/retrieval/src/citations/; crates/domain/

These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion.

Acceptance criteria

  • Reauthorize prior source dependencies before reuse; inaccessible history cannot broaden current access.
  • Prompt structure separates trusted instructions, user question and untrusted document data; retrieved text cannot grant tools or privileges.
  • Citations bind real version/chunk/source spans; unknown or unsupported references are rejected and unsupported answer text is distinguished.
  • Derived answer/title/history markings join the highest applicable classification and union required caveats; the model cannot lower markings.
  • Context selection/token limits are deterministic and account for question, instructions, history, retrieved chunks and output budget.

Verification

Tests exercise revoked earlier history, mixed levels/compartments, exact context limits, fabricated citation IDs, prompt injection and insufficient authorized evidence.

Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence.

Requirements and design

FR-RAG-004–008; FR-UX-004, 007; FR-PRIV-001; architecture §9.2

Sources: SRS, system design. Local planning context: docs/implementation-plan.md and docs/development-backlog.md (not published by this task).

Security impact: Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue.

Parent roadmap: #1

**Backlog ID:** H01 | **Priority:** P1 | **Phase:** M5 — Local inference and complete chat ## Outcome and scope Build each generation request from the current question, selected reauthorized recent turns and canonical authorized chunks within the permitted model token budget. ## Dependencies and gates **Engineering prerequisites:** #13 (C01), #23 (R02), #15 (E01), #22 (I05) Synthetic-data development may proceed. Production use remains subject to the decision gates in the SRS. ## Starting points crates/conversations/src/context/; crates/retrieval/src/citations/; crates/domain/ These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion. ## Acceptance criteria - [ ] Reauthorize prior source dependencies before reuse; inaccessible history cannot broaden current access. - [ ] Prompt structure separates trusted instructions, user question and untrusted document data; retrieved text cannot grant tools or privileges. - [ ] Citations bind real version/chunk/source spans; unknown or unsupported references are rejected and unsupported answer text is distinguished. - [ ] Derived answer/title/history markings join the highest applicable classification and union required caveats; the model cannot lower markings. - [ ] Context selection/token limits are deterministic and account for question, instructions, history, retrieved chunks and output budget. ## Verification Tests exercise revoked earlier history, mixed levels/compartments, exact context limits, fabricated citation IDs, prompt injection and insufficient authorized evidence. Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence. ## Requirements and design FR-RAG-004–008; FR-UX-004, 007; FR-PRIV-001; architecture §9.2 Sources: [SRS](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/SRS.md), [system design](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/architecture.md). Local planning context: `docs/implementation-plan.md` and `docs/development-backlog.md` (not published by this task). **Security impact:** Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue. **Parent roadmap:** #1
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
primatekuntech/rag-rust#26
No description provided.