Skip to content

Semantic Models and Summaries

Bifrost inspects available source code directly. Real programs also depend on standard libraries, frameworks, generated APIs, and binary artifacts whose bodies may be unavailable. Semantic-model packs add structured declarations and procedure behavior at that boundary.

Model evidence retains its origin. Source-derived proof comes from analysis of the source itself.

LayerPurposeTypical contents
Artifact identitySay exactly which dependency the model applies toecosystem coordinates, version/range, digests, language and compatibility profiles
Declaration modelName external types, fields, callables, and signaturesstructured owner/member identity, kind, receiver shape, formals, returns
Procedure summaryDescribe behavior across a procedure boundaryreceiver/parameter/return transfers, heap locations, exceptional returns, effects
Provenance and coverageExplain who asserted the model and what it coverspack, model and summary IDs, origin, completeness, unresolved or conflicting rows
ActivationBind an exact model set to one workspace analysisselected manifests, source kinds, configuration and active-set digest

Artifact validity, applicability, declaration binding, and behavioral completeness are recorded independently.

A usable procedure summary must bind to a callable identity; display names are presentation data. Depending on the language, that identity can include an owner, namespace or module route, declaration kind, receiver presence, arity and formal positions, signature information, and source or dependency artifact identity.

Binding requires:

  • a callable identity complete enough to distinguish the intended library method from a common name such as exec;
  • owner and signature context sufficient to select one overload;
  • call binding that maps argument zero to a formal parameter before applying the summary; and
  • dependency-artifact identity within the model’s stated validity contract.

If the required identity is absent, ambiguous, conflicting, or only partially modeled, Bifrost preserves that boundary in the result.

Workspace source bodies are analyzed directly. An external summary can stand in for a missing body only after compatibility, declaration binding, and the requested proof/completeness policy are checked.

Source and model evidence also make different claims:

  • source-backed evidence can prove what the analyzed body contains;
  • an authored external model remains an authored claim, even when the pack declares that claim complete; and
  • a generated model remains tied to its producer and exact generation inputs.

Some reviewed external summaries may close a modeled call boundary under an explicit policy. That closure applies only to the modeled call boundary.

A reusable procedure summary is keyed by the semantic artifact, declaration locator, schema and semantics versions, context and behavior keys, origin, and the exact dependency closure it used. Recursive strongly connected components are validated and published as a unit. A partial component remains visibly incomplete in any cached form.

Domain-specific summaries extend that carrier identity with their own inputs:

  • taint summaries add the taint universe, propagation semantics, event matching, and entry facts;
  • typestate summaries add the compiled protocol, binding plan, and entry states; and
  • type-flow and policy-level retained results add their exact request and projection identities.

Reuse requires semantic equivalence across every part of that identity.

Packs can come from installed, generated, pre-shipped, workspace-produced, embedded, or explicitly ephemeral sources. Catalog ingestion validates the pack before activation. The active set has its own digest, so changing one selected pack changes the analysis identity.

Generated dependency packs use the separate semantic-model object catalog. Its key includes exact inputs and producer identity. A producer change that can alter generated bytes or meaning must rotate the production-cache version; otherwise stale output could appear valid even though the generator changed.

Hosts supply or resolve an activation request for semantic packs. The ordinary analysis path loads that exact set, and the host retains activation diagnostics.

Bifrost can import and export supported Code Semantic Model Interchange (CSMI) profiles. CSMI is the analyzer-neutral interchange specification targeted by the semantic-model roadmap. Producer-specific generation and consumer-specific interpretation sit around the neutral pack format. A schema-valid pack can still be semantically invalid, inapplicable to the current artifact, or unsupported by a consumer profile.

An interoperability test needs the exact artifact emitted by an independent producer and the analysis difference with that pack disabled and enabled. A hand-authored approximation cannot establish producer interoperability.

Model coverage varies by pack. Coverage may close one procedure and leave the surrounding library catalog partial. Dynamic dispatch, reflection, callbacks, generated interfaces, native boundaries, and framework conventions remain visible boundaries after an exact call-summary binding.

Automatic dependency discovery and activation is a continuing direction. Its workflow keeps these steps independently diagnosable:

  1. discover a dependency artifact;
  2. acquire candidate packs;
  3. validate and establish applicability;
  4. activate an exact set;
  5. bind declarations and procedure ports;
  6. solve with the resulting evidence; and
  7. report every boundary that remains.

Authoring and host integration details are in Semantic-Model Packs. Dataflow Engine and Evidence and Result Contract describe how model evidence affects flow results.