Skip to main content

ContextCompiler

Struct ContextCompiler 

Source
pub struct ContextCompiler<'a> {
    pub store: &'a Store,
    pub view: TrustedGraphView<'a>,
    pub settings: ContextSettings,
    pub stale_paths: Vec<String>,
    /* private fields */
}

Fields§

§store: &'a Store§view: TrustedGraphView<'a>

Trusted view: the only way this compiler may query the reality graph. STALE facts are excluded and surfaced as warnings; INFERRED facts below the confidence floor are excluded unless explicitly allowed.

§settings: ContextSettings§stale_paths: Vec<String>

Repository-relative paths whose content hash no longer matches the indexed snapshot (mirrored from the view for cache-key hashing).

Implementations§

Source§

impl<'a> ContextCompiler<'a>

Source

pub fn new( store: &'a Store, graph: &'a RealityGraph, settings: ContextSettings, stale_paths: Vec<String>, ) -> Self

Source

pub fn evidence_map(&self) -> Ref<'_, HashMap<String, Evidence>>

One-query evidence index (id -> Evidence), built lazily. Returns a borrow so callers never copy the full map (hundreds of thousands of rows on large repos).

Source

pub fn revision(&self) -> String

Source

pub fn is_stale_path(&self, path: &str) -> bool

Source

pub fn evidence_summary(&self, entity_ids: &[String]) -> BTreeMap<String, usize>

Provenance accounting for a set of entity ids.

Source

pub fn apply_budget(&mut self, pack: &mut ContextPack, budget: usize)

Apply the token budget to a pack (P0 rendering contract): the pack builder has already dropped lowest-priority sections; this records honest accounting. Critical content is never hard-truncated — if the minimum safe pack still exceeds the budget, the pack stays complete and exceeded_soft_budget is set instead of silently cutting facts.

Source

pub fn system_overview(&self) -> ContextPack

Source

pub fn system_atlas(&self, budget: Option<usize>) -> ContextPack

Full System Atlas (Wave 2): the startup architecture artifact. Cached under the model epoch + stale set like task packs — a stale atlas is never served. The pack render guarantees fit: dropped and line-truncated sections are recorded, never silent.

Source

pub fn system_atlas_scoped( &self, budget: Option<usize>, scope: AtlasScope, full: bool, ) -> ContextPack

[system_atlas] with an explicit scope. The scope is part of the cache key: production and full compilations never share entries.

Source

pub fn task_context( &self, goal: &str, files: &[String], symbols: &[String], token_budget: Option<usize>, ) -> ContextPack

Source

pub fn task_context_with_rankers( &self, goal: &str, files: &[String], symbols: &[String], token_budget: Option<usize>, scorer: Option<&dyn SemanticScorer>, reranker: Option<&dyn Reranker>, ) -> ContextPack

task_context with optional semantic scorer and reranker (SCC-071).

Source

pub fn component_context_full(&self, id: &str) -> ContextPack

Source

pub fn component_context(&self, id: &str) -> ContextPack

Source

pub fn flow_context_full(&self, id: &str) -> ContextPack

Source

pub fn flow_context(&self, id: &str) -> ContextPack

Source

pub fn impact_context( &self, files: &[String], symbols: &[String], diff_base: Option<&str>, ) -> ContextPack

Source

pub fn impact_context_full( &self, files: &[String], symbols: &[String], diff_base: Option<&str>, ) -> ContextPack

Source

pub fn verify_context_full(&self) -> ContextPack

Source

pub fn verify_context(&self) -> ContextPack

Auto Trait Implementations§

§

impl<'a> !Freeze for ContextCompiler<'a>

§

impl<'a> !RefUnwindSafe for ContextCompiler<'a>

§

impl<'a> !Send for ContextCompiler<'a>

§

impl<'a> !Sync for ContextCompiler<'a>

§

impl<'a> !UnwindSafe for ContextCompiler<'a>

§

impl<'a> Unpin for ContextCompiler<'a>

§

impl<'a> UnsafeUnpin for ContextCompiler<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.