You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The useful PageIndex lesson for Pituitary is not "vectorless RAG" as a replacement for Stroma. It is the retrieval workflow: inspect document structure, select likely sections, expand local/parent context, then run product-specific reasoning.
That belongs in Pituitary because section-selection prompts, status handling, historical-vs-active preference, and governance confidence are product semantics.
Current adjacent work:
Pituitary already uses Stroma hierarchical chunking for docs through LateChunkPolicy.
The 2026-05-07 complexity baseline identifies internal/analysis/doc_drift.go, internal/analysis/compliance.go, internal/index/rebuild.go, and cmd/run_command.go as high-leverage complexity hotspots. PageIndex work should reduce pressure on those areas instead of adding another cross-cutting path directly into them.
Proposed Capability
Add an outline-guided retrieval path for governance analysis commands such as review-spec, check-doc-drift, and check-compliance.
A first implementation can be simple:
Search candidate records/chunks through the existing Stroma-backed retrieval path.
Read the candidate record outline/tree once Stroma exposes it, or use current section lineage where available.
Select relevant sections deterministically first, with optional model-assisted selection only when the analysis runtime is configured.
Expand selected chunks with ExpandContext, including parent context when available.
Pass bounded, provenance-rich contexts into the governance analyzer.
Complexity Reduction Constraint
This issue should introduce a small shared retrieval/context layer rather than wiring outline selection separately into each analysis command.
The implementation should make the PageIndex-inspired workflow explicit as a reusable phase boundary:
candidate record/chunk search;
outline/tree projection;
deterministic or bounded model-assisted section selection;
context expansion;
provenance-rich context payload assembly.
check-doc-drift, check-compliance, and review-spec should consume that layer through a narrow API. Avoid expanding the existing analysis monoliths with more embedded search/outline/expansion branching. If the first implementation touches only one command, the new code should still be shaped so the next command can reuse it without copying retrieval logic.
Non-Goals
No PageIndex dependency.
No generic chat workflow.
No MCTS/value-search implementation in this issue.
A reusable retrieval/context abstraction exists below command and MCP transport layers, with tests at that boundary.
The PR compares complexity against the 2026-05-07 baseline and explicitly states whether PageIndex work reduced, preserved, or increased complexity in the touched hotspots.
Context
The useful PageIndex lesson for Pituitary is not "vectorless RAG" as a replacement for Stroma. It is the retrieval workflow: inspect document structure, select likely sections, expand local/parent context, then run product-specific reasoning.
That belongs in Pituitary because section-selection prompts, status handling, historical-vs-active preference, and governance confidence are product semantics.
Current adjacent work:
LateChunkPolicy.ExpandContext(IncludeParent)is already called out as the likely measurement surface in Arm B retrieval benchmark: LLM-graded RAG with ExpandContext(IncludeParent) on/off #361.internal/analysis/doc_drift.go,internal/analysis/compliance.go,internal/index/rebuild.go, andcmd/run_command.goas high-leverage complexity hotspots. PageIndex work should reduce pressure on those areas instead of adding another cross-cutting path directly into them.Proposed Capability
Add an outline-guided retrieval path for governance analysis commands such as
review-spec,check-doc-drift, andcheck-compliance.A first implementation can be simple:
ExpandContext, including parent context when available.Complexity Reduction Constraint
This issue should introduce a small shared retrieval/context layer rather than wiring outline selection separately into each analysis command.
The implementation should make the PageIndex-inspired workflow explicit as a reusable phase boundary:
check-doc-drift,check-compliance, andreview-specshould consume that layer through a narrow API. Avoid expanding the existing analysis monoliths with more embedded search/outline/expansion branching. If the first implementation touches only one command, the new code should still be shaped so the next command can reuse it without copying retrieval logic.Non-Goals
Acceptance Criteria