pub struct AnalysisSession { /* private fields */ }Expand description
Memoized facade over chart analysis and schema lowering.
The session keeps chart loading and analysis results available for later queries without forcing callers to re-run discovery, values composition, contract extraction, and chart-local schema collection manually.
Implementations§
Source§impl AnalysisSession
impl AnalysisSession
Sourcepub fn new(opts: GenerateOptions) -> Self
pub fn new(opts: GenerateOptions) -> Self
Creates a memoized session with an internal diagnostic sink.
Sourcepub fn with_diagnostics(
opts: GenerateOptions,
diagnostics: DiagnosticSink,
) -> Self
pub fn with_diagnostics( opts: GenerateOptions, diagnostics: DiagnosticSink, ) -> Self
Creates a memoized session that emits diagnostics into diagnostics.
Sourcepub fn analysis(&self) -> EngineResult<Analysis>
pub fn analysis(&self) -> EngineResult<Analysis>
Return the memoized chart analysis artifact.
§Errors
Returns an error when chart discovery, source loading, parsing, or structural analysis fails.
Sourcepub fn contract_schema_signals(&self) -> EngineResult<ContractSchemaSignals>
pub fn contract_schema_signals(&self) -> EngineResult<ContractSchemaSignals>
Return typed schema-lowering evidence derived from the guarded contract.
§Errors
Returns an error when preparing or finalizing chart analysis fails.
Sourcepub fn contract_document(&self) -> EngineResult<ContractDocument>
pub fn contract_document(&self) -> EngineResult<ContractDocument>
Return the stable versioned contract export document.
§Errors
Returns an error when preparing or finalizing chart analysis fails.
Sourcepub fn resolved_contract(&self) -> EngineResult<ResolvedContract>
pub fn resolved_contract(&self) -> EngineResult<ResolvedContract>
Return the provider-resolved contract schema prior to optional required-inference and final output-pipeline transforms.
This query exposes the stage boundary the architecture document calls
resolved_contract(policy): structural contract facts have already
been resolved against providers, but the later heuristic
--infer-required mutation has not yet run.
§Errors
Returns an error when chart analysis, values composition, or provider schema resolution fails.
Sourcepub fn generated_schema(&self) -> EngineResult<GeneratedSchema>
pub fn generated_schema(&self) -> EngineResult<GeneratedSchema>
Return the memoized generated values schema: the resolved contract
schema plus the optional --infer-required post-pass.
§Errors
Returns an error when resolving the contract or preparing chart values fails.
Sourcepub fn emit(
&self,
policy_inputs: PolicyInputs,
output_options: OutputPipelineOptions,
) -> EngineResult<Value>
pub fn emit( &self, policy_inputs: PolicyInputs, output_options: OutputPipelineOptions, ) -> EngineResult<Value>
Emit the final JSON Schema document through the output pipeline.
This is the session-level counterpart to the CLI’s final output stage: it starts from the memoized generated schema, applies override/policy inputs, mirrors global schema into subcharts, resolves reference mode, and returns the final document callers would write to disk.
§Errors
Returns an error when generated-schema preparation, override merging, or reference processing fails.
Sourcepub fn emit_with_policy_paths(
&self,
override_paths: &[PathBuf],
policy_input_options: PolicyInputOptions,
output_options: OutputPipelineOptions,
) -> EngineResult<Value>
pub fn emit_with_policy_paths( &self, override_paths: &[PathBuf], policy_input_options: PolicyInputOptions, output_options: OutputPipelineOptions, ) -> EngineResult<Value>
Load policy inputs from override paths, then emit the final document.
§Errors
Returns an error when an override cannot be loaded or prepared, or when final output transforms fail.
Sourcepub fn explain(&self, path: &str) -> EngineResult<ValuePathExplanation>
pub fn explain(&self, path: &str) -> EngineResult<ValuePathExplanation>
Explain one values path using the current contract and chart evidence.
§Errors
Returns an error when chart analysis or contract finalization fails.