pablof7z / pablof7z/proactive-context
feat: pc oracle — full-wiki large-context Q&A, recompile, and gap detection
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Motivation
The inject path answers per-prompt questions via top-K embedding lookup — good for latency, but structurally blind to cross-cutting concerns, global contradictions, and missing coverage. A complementary oracle subcommand dumps the full wiki into a single large-context model call, enabling questions and operations that require seeing everything at once.
The full wiki is ~132 guides × ~60 lines median ≈ 80–120K tokens. That fits comfortably in Claude Opus (200K), Gemini 2.0 Flash (1M), etc. No routing, no embeddings — raw context.
Modes
pc oracle <question>
Concatenate all wiki guides → send with question → stream answer.
pc oracle "What did I decide about the capture routing bottleneck?"
pc oracle "What's still marked as an open question across the wiki?"
pc oracle "Why did we reject a parallel second citation log?"
No embedding lookup, no routing. The model sees everything. For whole-system questions this is strictly better than inject's top-K.
pc oracle --interactive
REPL mode. Load the full wiki once as persistent context; query across turns without re-paying the context fill on every message.
pc oracle --recompile
Global-consistency maintenance pass. Send all guides in one call with a prompt like: "Read the full wiki. Identify contradictions, near-duplicates, and gaps. Output a revised guide set."
Why this beats the current wiki-doctor: the wiki-doctor detects near-duplicates via pairwise embedding cosine similarity — it can't see guide A saying X and guide B saying Y. A single large-context call sees both simultaneously.
Citation stability: restrict recompilation to citation-free guides (the definitional/structural layer, currently ~10% complete), or treat a recompile as a new version that re-anchors citations. See capture-destination-event-sourced-projections.md for why prose-keyed citation scrambling is the hard part.
pc oracle --gaps
Gap detection: "What topics does a developer need to understand this codebase that are NOT covered or underdefined here?" Structured audit version of the one-shot rebuild eval (wiki-dump-is-the-eval.md).
Future layer: --ground-truth flag
Once _citations.log gets author tags (planned in the event-sourced claim log redesign — see capture-destination-event-sourced-projections.md), add:
pc oracle --ground-truth <question>
This replaces the synthesized wiki with only user-origin citation entries — the purest "everything the user has ever said" corpus. SELECT text FROM citations WHERE author='user' is the query; the oracle is the consumer.
Implementation sketch
- Walk
wiki_dir(), concatenate all*.mdfiles - Prompt:
[WIKI CONTEXT]\n{all_guides}\n[QUESTION]\n{question} - Send via existing provider abstraction (
openrouter.rs/provider.rs), stream to stdout - Model selection: expose
--modelflag; default to a large-context model from config (suggest a separateoracle_modelconfig key distinct fromcapture_model) - Interactive mode: loop over stdin lines, keeping messages history in memory
Relationship to existing commands
| Command | Mechanism | Best for |
|---|---|---|
pc query |
Embedding lookup, top-K | Fast symbol/concept lookup |
pc inject |
Route + compile, top-K guides | Pre-prompt context injection |
pc oracle |
Full-wiki context dump | Whole-system Q&A, consistency, gaps |
The inject and oracle paths are complementary, not competing. Inject is latency-sensitive (hot path); oracle is for deliberate, interactive use.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing CLI commands and provider abstraction in openrouter.rs and provider.rs, then inspect wiki_dir() and the cited wiki documents. Define how full-wiki loading, model selection, streaming, interactive history, recompilation, and gap detection fit together. Done means the oracle modes and --model configuration work without changing the existing query or inject paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100