Skip to main content

FrontierGraph

Struct FrontierGraph 

Source
pub struct FrontierGraph { /* private fields */ }
Expand description

The typed claim-level graph for one frontier (or one merged multi-frontier Project).

Implementations§

Source§

impl FrontierGraph

Source

pub const DEPENDENCY_KINDS: [EdgeKind; 4]

The default dependency edge kinds for a blast-radius query: the relations where the source rests on the target, so removing the target weakens the source. Lineage kinds (Improves/Generalizes/…) are excluded — they are not load-bearing dependency.

Source

pub const REQUIRED_PREMISE_KINDS: [EdgeKind; 3]

The REQUIRED-premise kinds: a claim’s support is bottlenecked by these (if the premise fails, the claim weakens — the calculus’s “weakest premise” reading). Supports is corroboration (an alternative, not a requirement), so it is NOT a bottleneck and is excluded from the graded min-propagation: losing one corroboration does not weaken a claim that still has another.

Source

pub fn from_project(project: &Project) -> Self

Build the typed graph from a project’s findings and links. Every finding becomes a node; every link whose type maps to a known EdgeKind becomes a typed edge.

Source

pub fn from_edges<I>(raw: I) -> Self
where I: IntoIterator<Item = (String, String, EdgeKind)>,

Build a typed graph directly from an (source, target, kind) edge list, for a premise graph that is NOT a findings frontier — e.g. a Mathlib declaration-dependency graph (from --uses--> to, mapped to DependsOn). Every endpoint becomes a minimal node (label = id, neutral Open state, confidence 1.0). The κ-from-events graded cascade (blast_radius_graded) is NOT meaningful here (no verifier status and no events); use the structural blast_radius — over a CONJUNCTIVE premise graph (every used premise is required) that is also exact, since every transitive dependent is genuinely impacted with no alternative route.

Source

pub fn in_degree_ranked(&self, kinds: &[EdgeKind]) -> Vec<(String, usize)>

In-degree of every node (count of edges of kinds whose target is the node), sorted descending — the most-depended-on premises first. The highest-in-degree node is the highest-leverage retraction target.

Source

pub fn node_count(&self) -> usize

Number of claim nodes.

Source

pub fn edge_count(&self) -> usize

Number of typed edges.

Source

pub fn contains(&self, id: &str) -> bool

True iff the node exists in the graph.

Source

pub fn edges_of_kind(&self, kind: EdgeKind) -> impl Iterator<Item = &Edge>

All edges of a given kind.

Source

pub fn all_edges(&self) -> &[Edge]

All typed edges, in build order. The read accessor the boundary query and the path-finder traverse over (they live in sibling modules and cannot see the private field).

Source

pub fn node(&self, id: &str) -> Option<&Node>

One node by id, if present.

Source

pub fn nodes(&self) -> impl Iterator<Item = &Node>

Every node, in stable id order.

Source

pub fn edge_kind_counts(&self) -> BTreeMap<&'static str, usize>

Per-edge-kind counts, for summaries.

Source

pub fn contradiction_pairs(&self) -> Vec<(String, String)>

Unordered, deduplicated contradiction pairs. Because contradicts is conceptually symmetric but stored as a directed link, an A→B and a B→A contradiction collapse to one pair. Endpoints are sorted so the pair is stable.

Source

pub fn closure_of_kind(&self, start: &str, kind: EdgeKind) -> BTreeSet<String>

The transitive closure reachable from start following only edges of one kind (e.g. the full improves or supersedes lineage downstream of a result). Excludes start itself.

Source

pub fn explore(&self, start: &str, max_hops: usize) -> Exploration

Breadth-first exploration outward from start, treating edges as undirected for reach, up to max_hops. Returns each reached node’s hop distance and the edges wholly inside the explored subgraph. This is the engine for multi-hop “deep” queries — the counterpart to single-hop neighbor lookups.

Source

pub fn label_of(&self, id: &str) -> Option<&str>

Look up a node’s label (assertion snippet), if present.

Source

pub fn support_dominators(&self, z: &str, kinds: &[EdgeKind]) -> Vec<Dominator>

The support-graph dominators of a claim (GPT §11): the load-bearing dependencies its support funnels through. A node d (≠ z) is a dominator with weight = how many of z’s support-reachable nodes vanish if d is removed (including d itself). A dominator whose weight equals the full support size is a single point of failure — every support path out of z runs through it. Sorted by weight descending, then id. Pure; recomputed on read.

Source

pub fn find_node(&self, query: &str) -> Option<String>

Resolve a query to a node id: an exact id; else an id prefix (ids are addressed by prefix, like deep_trace — a substring match would let a bare number like “617” spuriously hit the hex tail of a content-addressed id); else the first finding (in id order) whose assertion contains the query, case-insensitively, so a problem number or snippet resolves.

Source

pub fn blast_radius( &self, start: &str, kinds: &[EdgeKind], direction: BlastDirection, ) -> BlastRadius

The dependency-impact neighborhood of start (memo §7.3): upstream (what it rests on), downstream (what rests on it — the blast radius if it moved), and the single points of failure on its support. An empty kinds defaults to Self::DEPENDENCY_KINDS. Pure; recomputed on read.

Source

pub fn blast_radius_graded( &self, project: &Project, start: &str, kinds: &[EdgeKind], direction: BlastDirection, ) -> GradedBlast

The calculus reading of the blast radius (the licensed propagation, project_true_math_atlas roadmap #4): the center’s canonical graded status, and for each structural downstream dependent the drop in its support kappa when the center’s support is retracted, min-propagated along the dependency edges (the Bottleneck semiring — a chain is as strong as its weakest premise). Needs project for the per-finding provenance (events). Dependents whose kappa does not drop are pruned: they have alternative support, so structural reachability overcounted them.

Source

pub fn to_json(&self) -> Value

Serialize to a stable claim-level JSON view. This is a focused vela.frontier_graph.claims.v0.1 artifact — deliberately distinct from the broad provenance vela.frontier_graph.v0.1 export so the two are never confused. Always marked derived.

Trait Implementations§

Source§

impl Clone for FrontierGraph

Source§

fn clone(&self) -> FrontierGraph

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FrontierGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FrontierGraph

Source§

fn default() -> FrontierGraph

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V