Expand description
Tier 1 AI synthesis — selective invocation, confidence gating, and decision recording (§17.2, §17.3, §17.4).
The synthesis layer augments the rule-based Tier 2 backends with AI
generation at capability-gap points (§17.6) and target-flagged
constructs (TargetProfile::ai_hints). It is the infrastructure half
of “AI-first with deterministic fallback”:
- Walk the AIR module and identify nodes that warrant AI synthesis.
Trivial constructs (literals, arithmetic, direct calls, …) are
classified as
Nonebycrate::profile::classify_nodeand bypass AI entirely — per §17.2 (Q3 amended, 2026-04-20). - For each flagged node, call the provider’s
generatemode. Confidence gates acceptance (default0.75); pinned cache replays (§17.8) bypass the threshold. - Run the deterministic verifier (§17.3) on accepted output. Verification lives in this crate — it never goes through the AI provider.
- Record the accepted choice as a build-scope decision (§17.4)
routed to
.bock/decisions/build/. - On rejection, provider error, or verification failure, fall through to Tier 2 rule-based generation (preserved guarantee).
Structs§
- AiSynthesis
Driver - Machinery driving a single-module AI synthesis pass.
- Synthesis
Config - Runtime knobs for a single AI-augmented module compilation.
- Synthesis
Stats - Aggregate counters across a synthesis pass.
Enums§
- Synthesis
Outcome - Result of synthesizing a single flagged node.
Functions§
- cache_
at - Convenience for callers that want to build a cache rooted at the
project directory without importing
bock_ai::AiCache. - needs_
ai_ synthesis - Returns
trueonly when the node is flagged bytarget.ai_hintsand matches a non-trivialcrate::profile::NodeKindHint. Trivial constructs (literals, arithmetic, direct calls, variable bindings) always returnfalse— the Q3 guarantee from the 2026-04-20 spec amendment. - synthesize_
and_ flush - Drives synthesis once per module and flushes the manifest writer.
- verify_
generated - Deterministic, provider-free verification of generated target code.