The source-code corpus: ingest this repository's code, documents, and history into corpus_sourcecode as artifacts, relations, versions and classifications, then audit, census, and query them. Not the wiki (that is application-wiki, database org_knowledge); not the control plane (that is operations-control-plane)
| Tier | tools |
| Role | unclassified (baselined) |
| Path | crates/tools/corpus |
| Edition | 2021 |
| Targets | tools-corpus, governance_scan, tools_corpus, ac6_postcondition_live, capability_search_live, complexity_cli, complexity_fixtures, complexity_git_reads, complexity_store_live, harness_inventory_render, inventory_check_live, lexicon_add_live, lexicon_export_live, oracle_store_live, product_dimension_live, reading_adjudicate_live, reading_stage_live, shard_contract_live |
| Public items | 637 across 58 modules |
| Tests | 798 |
What it is for
The source-code corpus: ingest THIS repository's code, documents and history into corpus_sourcecode as artifacts, relations, versions and classifications, then audit, census and query them.
Split out of tools-org-knowledge in sprint 4.21 (operator ruling): that crate is the WIKI — external research (YouTube, articles, podcasts) consolidated into a knowledge index, database org_knowledge. None of what lives here was ever wiki work.
walk: repo-wide git-tracked file walker shared by the ingest subcommands (distinct from the wiki's own docs/**/*.md-only walker).
// primitives-extension: tools-fleet-db — the CREATE ROLE flag shape below mirrors crates/tools/fleet-db/src/bin/cutover.rs:160-172 (NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS), duplicated here rather than lifted into tools_fleet_db::topology, to avoid touching a production fleet-migration tool from a corpus-provisioning task. Candidate for extraction if a third consumer appears (TECH-DEBT, P2, filed same commit). Role naming (the validated, truncation-safe part) is reused directly via tools_fleet_db::topology::derive_roles — only the SQL-shape constant is duplicated, not the security-relevant logic.
Capabilities
crate root
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
async fn ensure_roles_and_database(pool : & PgPool, db_name : & str,) -> Result <ProvisionReport, ProvisionError> |
pub const CORPUS_DB_NAME: & str |
async fn assert_governed_tables_owned(pool : & PgPool,) -> Result <(), application_core::MigrationError> |
fn corpus_db_url(base_url : & str, db_name : & str) -> Result <String, url::ParseError> |
pub const MAINTENANCE_DATABASES: & str; 3 |
fn resolve_provision_target(admin_url : & str, requested : Option <& str>,) -> Result <ProvisionTarget, TargetError> |
async fn provision(admin_pool : & PgPool, admin_url : & str, db_name : & str,) -> Result <ProvisionOutcome, ProvisionCliError> |
fn live_pg_admin_url(what_is_untested : & str) -> Option <String> |
MigrationReport
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub struct MigrationReport |
async fn apply_corpus_migrations(pool : & PgPool,) -> Result <MigrationReport, application_core::MigrationError> |
ProvisionCliError
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub enum ProvisionCliError |
async fn grant_app_privileges(pool : & PgPool) -> Result <(), ProvisionCliError> |
ProvisionError
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub enum ProvisionError |
ProvisionOutcome
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub struct ProvisionOutcome |
ProvisionReport
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub struct ProvisionReport |
ProvisionTarget
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub struct ProvisionTarget |
RolePlan
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub struct RolePlan |
fn plan_roles(db_name : & str) -> Result <RolePlan, RoleError> |
TargetError
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub enum TargetError |
TargetSource
The source-code corpus: ingest THIS repository's code, documents and
| Item |
|---|
pub enum TargetSource |
TargetSource :: fn describe(self) -> & 'static str |
audit (other)
US-3.96.8: corpus audit -- run the structure measurements as QUERIES,
| Item |
|---|
fn docs_topdir_counts(docs_relative_paths : & String) -> BTreeMap <String, usize> |
fn naming_regime(crate_name : & str, tiers : & String) -> & 'static str |
fn parse_tier_registry(layers_toml : & str) -> Vec <String> |
async fn run_audit(pool : & PgPool, repo_root : & Path, run_id : & str,) -> Result <AuditReport, AuditError> |
AuditError
US-3.96.8: corpus audit -- run the structure measurements as QUERIES,
| Item |
|---|
pub enum AuditError |
AuditReport
US-3.96.8: corpus audit -- run the structure measurements as QUERIES,
| Item |
|---|
pub struct AuditReport |
capability_guard (other)
Sprint 4.21 Task 10: the pre-commit capability rule.
| Item |
|---|
pub const OWNER_PATHS: & & str |
AddedItem
Sprint 4.21 Task 10: the pre-commit capability rule.
| Item |
|---|
pub struct AddedItem |
fn added_pub_items(diff : & str) -> Vec <AddedItem> |
claim_verify (other)
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
fn status_line_is_done(line : & str) -> bool |
fn extract_refs(line : & str, title_line : & str, members : & BTreeMap <String, String>,) -> Vec <String> |
fn members_from_manifests(manifests : & (String, String)) -> BTreeMap <String, String> |
fn registered_from_layers_toml(text : & str) -> BTreeSet <String> |
fn crate_has_tests(files : & String, read : impl Fn(& str) -> Option <String>) -> bool |
fn failing_crates_from_cargo_output(out : & str) -> BTreeSet <String> |
fn stub_members(stub_dirs : & BTreeSet <String>, member_dirs : & BTreeMap <String, String>,) -> BTreeSet <String> |
Claim
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub struct Claim |
fn extract_claims(rel_path : & str, text : & str, members : & BTreeMap <String, String>,) -> Vec <Claim> |
ClaimKind
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub enum ClaimKind |
ClaimKind :: fn as_str(self) -> & 'static str |
Evidence
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub struct Evidence<'a> |
SuiteState
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub enum SuiteState |
Verdict
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub enum Verdict |
Verdict :: fn as_str(self) -> & 'static str |
fn verdict(refs : & String, ev : & Evidence <'_>) ->(Verdict, String) |
fn worksheet_rank(v : Verdict) -> u8 |
VerdictCounts
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub struct VerdictCounts |
VerdictCounts :: fn add(& mut self, v : Verdict) |
VerdictCounts :: fn total(& self) -> usize |
VerdictCounts :: fn honesty_ratio(& self) -> f64 |
Cli
tools-corpus command surface (sprint 4.21 stage 3).
| Item |
|---|
pub struct Cli |
Command
tools-corpus command surface (sprint 4.21 stage 3).
| Item |
|---|
pub enum Command |
CorpusCmd
tools-corpus command surface (sprint 4.21 stage 3).
| Item |
|---|
pub enum CorpusCmd |
ExecutionCmd
tools-corpus command surface (sprint 4.21 stage 3).
| Item |
|---|
pub enum ExecutionCmd |
LexiconCmd
tools-corpus command surface (sprint 4.21 stage 3).
| Item |
|---|
pub enum LexiconCmd |
ReadingCmd
tools-corpus command surface (sprint 4.21 stage 3).
| Item |
|---|
pub enum ReadingCmd |
StoryCmd
tools-corpus command surface (sprint 4.21 stage 3).
| Item |
|---|
pub enum StoryCmd |
WorkItemCmd
tools-corpus command surface (sprint 4.21 stage 3).
| Item |
|---|
pub enum WorkItemCmd |
code (other)
US-3.96.3: symbol-boundary chunking for Rust source, per sprint 3.96's
| Item |
|---|
fn crate_and_module(repo_path : & str, dir_to_name : & std::collections::BTreeMap <String, String>,) -> Option <(String, String)> |
fn workspace_dir_to_name(repo_root : & std::path::Path,) -> std::collections::BTreeMap <String, String> |
CodeChunk
US-3.96.3: symbol-boundary chunking for Rust source, per sprint 3.96's
| Item |
|---|
pub struct CodeChunk |
fn chunk_rust_source(text : & str) -> Vec <CodeChunk> |
complexity (other)
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub const BODY_SHAPE_VERSION: u32 |
pub const FN_METRICS: & & str |
pub const MODULE_METRICS: & & str |
fn check_metric_producers(thresholds : & Threshold) -> Vec <Finding> |
fn measure_crate(files : & (String, String)) ->(CrateGraph, Vec <Finding>) |
fn measure_file(path : & str, text : & str) ->(Vec <FnMetrics>, Vec <Finding>) |
BindingCollector
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
BindingCollector :: fn visit_pat_ident(& mut self, node : & 'ast syn::PatIdent) |
BodyVisitor
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
BodyVisitor :: fn visit_expr(& mut self, node : & 'ast syn::Expr) |
BodyVisitor :: fn visit_expr_if(& mut self, node : & 'ast syn::ExprIf) |
BodyVisitor :: fn visit_expr_match(& mut self, node : & 'ast syn::ExprMatch) |
BodyVisitor :: fn visit_expr_loop(& mut self, node : & 'ast syn::ExprLoop) |
BodyVisitor :: fn visit_expr_while(& mut self, node : & 'ast syn::ExprWhile) |
BodyVisitor :: fn visit_expr_for_loop(& mut self, node : & 'ast syn::ExprForLoop) |
BodyVisitor :: fn visit_expr_closure(& mut self, node : & 'ast syn::ExprClosure) |
BodyVisitor :: fn visit_local(& mut self, node : & 'ast syn::Local) |
BodyVisitor :: fn visit_expr_binary(& mut self, node : & 'ast syn::ExprBinary) |
BodyVisitor :: fn visit_expr_break(& mut self, node : & 'ast syn::ExprBreak) |
BodyVisitor :: fn visit_expr_continue(& mut self, node : & 'ast syn::ExprContinue) |
BodyVisitor :: fn visit_expr_method_call(& mut self, node : & 'ast syn::ExprMethodCall) |
BodyVisitor :: fn visit_expr_macro(& mut self, _node : & 'ast syn::ExprMacro) |
BodyVisitor :: fn visit_item(& mut self, node : & 'ast syn::Item) |
Config
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub const CONFIG_KEYS: & & str |
pub const CONFIG_TEXT_KEYS: & & str |
pub const CONFIG_PATH: & str |
pub struct Config |
fn parse_config(text : & str) ->(Option <Config>, Vec <Finding>) |
fn calibration_expired(config : & Config, commits_measured : i64, today : & str) -> bool |
CrateGraph
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub struct CrateGraph |
CrateUseEdge
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub struct CrateUseEdge |
Finding
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub struct Finding |
FnMetrics
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub struct FnMetrics |
ModuleMetrics
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub struct ModuleMetrics |
Renamer
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
Renamer :: fn visit_pat_ident_mut(& mut self, node : & mut syn::PatIdent) |
Renamer :: fn visit_field_pat_mut(& mut self, node : & mut syn::FieldPat) |
Renamer :: fn visit_field_value_mut(& mut self, node : & mut syn::FieldValue) |
Renamer :: fn visit_expr_path_mut(& mut self, node : & mut syn::ExprPath) |
Renamer :: fn visit_lit_mut(& mut self, node : & mut syn::Lit) |
Scope
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub enum Scope |
Selector
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub enum Selector |
Threshold
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub const THRESHOLDS_PATH: & str |
pub struct Threshold |
fn parse_thresholds(text : & str) ->(Vec <Threshold>, Vec <Finding>) |
complexity_calibrate (other)
Calibration: what the ratified thresholds should be, computed from what
| Item |
|---|
fn peaks(rows : & (String, u32)) -> BTreeMap <String, u32> |
fn percentile(sorted_ascending : & u32, k : u32) -> u32 |
fn count_at_or_above(peaks : & BTreeMap <String, u32>, threshold : u32) -> usize |
Distribution
Calibration: what the ratified thresholds should be, computed from what
| Item |
|---|
pub struct Distribution |
fn distribution(peaks : & BTreeMap <String, u32>) -> Distribution |
Proposal
Calibration: what the ratified thresholds should be, computed from what
| Item |
|---|
pub struct Proposal |
fn propose(metric : & str, peaks : & BTreeMap <String, u32>) -> Proposal |
fn verify_seed(metric : & str, ratified_fail : Option <i64>, proposal : & Proposal,) -> Option <crate::complexity::Finding> |
complexity_callers (other)
Who calls this function. Sprint 3.124 WU-B, part of AC6.
| Item |
|---|
fn call_sites_in_file(path : & str, text : & str, name : & str, skip_line : usize) -> Vec <CallSite> |
fn scope_description(files_searched : usize) -> String |
CallFinder
Who calls this function. Sprint 3.124 WU-B, part of AC6.
| Item |
|---|
CallFinder :: fn visit_item_fn(& mut self, node : & 'ast syn::ItemFn) |
CallFinder :: fn visit_impl_item_fn(& mut self, node : & 'ast syn::ImplItemFn) |
CallFinder :: fn visit_trait_item_fn(& mut self, node : & 'ast syn::TraitItemFn) |
CallFinder :: fn visit_expr_call(& mut self, node : & 'ast syn::ExprCall) |
CallFinder :: fn visit_expr_method_call(& mut self, node : & 'ast syn::ExprMethodCall) |
complexity_churn (other)
How often each file changed, read out of git. Sprint 3.124, AC3.
| Item |
|---|
fn history_incomplete(oldest_seen_days_ago : Option <u32>, window_days : u32,) -> Option <crate::complexity::Finding> |
Churn
How often each file changed, read out of git. Sprint 3.124, AC3.
| Item |
|---|
pub type Churn: BTreeMap <String, u32> |
fn parse_numstat(output : & str) -> Churn |
fn churn_rows_missing(paths_measured : & BTreeSet <String>, churn : & Churn) -> Vec <String> |
complexity_ratchet (other)
The ratchet: what changed between two commits, and which changes are a
| Item |
|---|
pub const TABLE_SHAPE_EXEMPT_METRICS: & & str |
fn table_shape_exempts(metric : & str) -> bool |
fn count_invariant(old : & FnMetrics, new : & FnMetrics, threshold : u32, value_of : fn(& FnMetrics) -> u32, metric : & str,) -> Option <Finding> |
Churn
How often each file changed, read out of git. Sprint 3.124, AC3.
| Item |
|---|
pub struct Churn |
Churn :: fn percent(& self) -> f64 |
fn churn(transitions : & Transition) -> Churn |
Transition
The ratchet: what changed between two commits, and which changes are a
| Item |
|---|
pub enum Transition |
fn classify(old : & FnMetrics, new : & FnMetrics, threshold : u32, value_of : fn(& FnMetrics) -> u32, metric : & str,) -> Vec <Transition> |
fn verdict(transitions : & Transition, metric : & str) ->(Vec <Finding>, Vec <Finding>) |
complexity_report (other)
What a reader sees. Sprint 3.124 WU-B, AC7 and AC13.5.
| Item |
|---|
fn source_link(path : & str, line : usize) -> String |
fn drift(committed : & str, rendered : & str) -> Option <Finding> |
Calibration
What a reader sees. Sprint 3.124 WU-B, AC7 and AC13.5.
| Item |
|---|
pub enum Calibration |
fn commit_message(refusals : & Finding, touched : & Finding, aggregate : & str, calibration : Calibration,) -> String |
Cycle
What a reader sees. Sprint 3.124 WU-B, AC7 and AC13.5.
| Item |
|---|
pub struct Cycle |
DuplicateGroup
What a reader sees. Sprint 3.124 WU-B, AC7 and AC13.5.
| Item |
|---|
pub struct DuplicateGroup |
HotspotRow
What a reader sees. Sprint 3.124 WU-B, AC7 and AC13.5.
| Item |
|---|
pub struct HotspotRow |
ReportData
What a reader sees. Sprint 3.124 WU-B, AC7 and AC13.5.
| Item |
|---|
pub struct ReportData |
fn render(data : & ReportData) -> String |
TierTotals
What a reader sees. Sprint 3.124 WU-B, AC7 and AC13.5.
| Item |
|---|
pub struct TierTotals |
verb:default
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
fn default_git_bin() -> PathBuf |
verb:disagrees
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
fn disagrees(stored : f64, expected : f64) -> bool |
verb:duplicate
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
async fn duplicate_groups(pool : & PgPool, repo_commit : & str,) -> anyhow::Result <Vec <crate::complexity_report::DuplicateGroup>> |
verb:group
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
fn group_by_shape(rows : Vec <(String, String, i32, String)>, out : & mut Vec <crate::complexity_report::DuplicateGroup>,) |
verb:hotspot
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
fn hotspot_score(cognitive : i32, file_churn : i32) -> f64 |
verb:load
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
async fn load_window(pool : & PgPool, window_days : u32,) -> anyhow::Result <Vec <(String, String, i32)>> |
verb:measured
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
async fn measured_commit_count(pool : & PgPool) -> anyhow::Result <i64> |
verb:oldest
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
fn oldest_commit_days_ago(ct_output : & str, now : i64) -> Option <u32> |
verb:path
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
fn path_of(fn_key : & str) -> String |
verb:tier
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
async fn tier_totals(pool : & PgPool, repo_commit : & str, cognitive_warn : i32, cognitive_fail : i32,) -> anyhow::Result <BTreeMap <String, crate::complexity_report::TierTotals>> |
fn tier_of(path : & str) -> String |
verb:top
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
async fn top_hotspots(pool : & PgPool, repo_commit : & str, n : i64,) -> anyhow::Result <Vec <crate::complexity_report::HotspotRow>> |
verb:verify
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
async fn verify_hotspot(pool : & PgPool, repo_commit : & str) -> anyhow::Result <Vec <Finding>> |
GitLimits
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
pub struct GitLimits |
GitLimits :: fn default() -> Self |
async fn collect_churn(git_bin : & Path, repo_root : & Path, window_days : u32, limits : GitLimits,) -> anyhow::Result <(Churn, Option <u32>)> |
async fn staged_rust_files(git_bin : & Path, repo_root : & Path, limits : GitLimits,) -> anyhow::Result <Vec <String>> |
async fn changed_rust_files_between(git_bin : & Path, repo_root : & Path, base : & str, head : & str, limits : GitLimits,) -> anyhow::Result <Vec <String>> |
async fn file_at_rev(git_bin : & Path, repo_root : & Path, rev : & str, path : & str, limits : GitLimits,) -> anyhow::Result <Option <String>> |
async fn head_commit(git_bin : & Path, repo_root : & Path, limits : GitLimits,) -> anyhow::Result <String> |
async fn dirty_rust_files(git_bin : & Path, repo_root : & Path, limits : GitLimits,) -> anyhow::Result <Vec <String>> |
async fn tracked_rust_files(git_bin : & Path, repo_root : & Path, limits : GitLimits,) -> anyhow::Result <Vec <String>> |
StoreOutcome
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
pub struct StoreOutcome |
async fn write_commit(pool : & PgPool, repo_commit : & str, metrics : & FnMetrics, churn : & Churn, window_days : u32,) -> anyhow::Result <StoreOutcome> |
conformance (other)
Conformance inventory (sprint 4.7, US-4.7.1): where the code contradicts
| Item |
|---|
fn parse_tier_seed(text : & str) -> Vec <(String, String)> |
Divergence
Conformance inventory (sprint 4.7, US-4.7.1): where the code contradicts
| Item |
|---|
pub struct Divergence |
fn retired_name_hits(crate_names : & (String, i64), retired_terms : & String,) -> Vec <Divergence> |
fn tier_definition_drift(seed : & (String, String), citer_text : & str) -> Vec <Divergence> |
fn to_ratification_table(rows : & Divergence) -> String |
crate_path (other)
Where a crate's directory SHOULD be, given its package name.
| Item |
|---|
fn conforming_path(package : & str, registered_tier : & str) -> Option <String> |
fn unregistered <'a>(crates : & 'a BTreeMap <String, String>, registry : & BTreeMap <String, String>,) -> Vec <(& 'a str, & 'a str)> |
fn normalize(path : & str) -> String |
fn relative(from_dir : & str, to_dir : & str) -> String |
fn map_through_moves(path : & str, moves : & BTreeMap <String, String>) -> String |
fn rewritten_dep_path(manifest_dir : & str, dep_path : & str, moves : & BTreeMap <String, String>,) -> String |
PathMove
Where a crate's directory SHOULD be, given its package name.
| Item |
|---|
pub struct PathMove |
fn plan(crates : & BTreeMap <String, String>, registry : & BTreeMap <String, String>,) -> Vec <PathMove> |
crate_register (other)
Sprint 3.114 Story 1: registering a crate, as state rather than as four
| Item |
|---|
pub const LAYER_REGISTRY: & str |
fn assess(crate_name : & str, facts : & RegistrationFacts) -> Verdict |
CrateEntry
Sprint 3.114 Story 1: registering a crate, as state rather than as four
| Item |
|---|
pub struct CrateEntry |
fn added_crates(staged_diff : & str) -> Vec <CrateEntry> |
PassState
Sprint 3.114 Story 1: registering a crate, as state rather than as four
| Item |
|---|
pub enum PassState |
PassState :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result |
RegistrationFacts
Sprint 3.114 Story 1: registering a crate, as state rather than as four
| Item |
|---|
pub struct RegistrationFacts |
RegistrationPass
Sprint 3.114 Story 1: registering a crate, as state rather than as four
| Item |
|---|
pub enum RegistrationPass |
RegistrationPass :: fn all() -> RegistrationPass; 4 |
RegistrationPass :: fn remedy(self) -> & 'static str |
RegistrationPass :: fn label(self) -> & 'static str |
RegistrationPass :: fn number(self) -> u8 |
Verdict
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub struct Verdict |
Verdict :: fn states(& self) -> (RegistrationPass, PassState); 4 |
fn render(verdict : & Verdict) -> String |
fn refusal(verdict : & Verdict) -> String |
crate_size (other)
How big a crate actually is, and how much of it is real.
| Item |
|---|
fn count_test_functions(text : & str) -> usize |
CrateSize
How big a crate actually is, and how much of it is real.
| Item |
|---|
pub struct CrateSize |
fn measure(files : & (String, String)) -> CrateSize |
UnclassifiedCrate
SQL decision functions -- the "Postgres SQL/plpgsql functions first,
| Item |
|---|
pub struct UnclassifiedCrate |
async fn unclassified_crates(pool : & PgPool, vocab_version : & str,) -> Result <Vec <UnclassifiedCrate>, sqlx::Error> |
diagrams_cmd (other)
corpus diagrams-render — every mermaid block in the corpus, rendered
| Item |
|---|
async fn run_diagrams_render(only_doc : Option <& str>, json : bool) -> ExitCode |
RenderTally
corpus diagrams-render — every mermaid block in the corpus, rendered
| Item |
|---|
pub struct RenderTally |
doc_audit (other)
Documentation-organization audit (sprint 4.8): the gather + compose
| Item |
|---|
fn partition(rows : & DocRow, boundary : & str) -> Vec <PartitionRow> |
fn dir_census(rows : & DocRow, declared : & String) -> Vec <CensusRow> |
fn scan_links(doc_path : & str, text : & str) -> Vec <String> |
fn pattern_matches(pattern : & str, name : & str) -> bool |
fn classify_placement(paths : & String, rules : & KindRule) -> Vec <PlacementRow> |
fn heading_skeleton(text : & str) -> Vec <String> |
fn majority_skeleton(skeletons : & Vec <String>) ->(Vec <String>, usize, usize) |
fn section_anchors(text : & str) -> Vec <(String, String, usize)> |
fn fold_git_log(log : & str) -> BTreeMap <String,(String, String)> |
fn compose_packages(tables_json : & str, purpose_map : & str, e1_models : & String, q23_model : & str,) -> serde_json::Value |
CensusRow
Documentation-organization audit (sprint 4.8): the gather + compose
| Item |
|---|
pub struct CensusRow |
CiterReport
Documentation-organization audit (sprint 4.8): the gather + compose
| Item |
|---|
pub struct CiterReport |
fn citer_graph(docs : & String, stored : & (String, String), scanned : & (String, String),) -> CiterReport |
DocRow
Documentation-organization audit (sprint 4.8): the gather + compose
| Item |
|---|
pub struct DocRow |
KindRule
Documentation-organization audit (sprint 4.8): the gather + compose
| Item |
|---|
pub struct KindRule |
fn parse_kind_grammar(map_text : & str) -> Vec <KindRule> |
PartitionRow
Documentation-organization audit (sprint 4.8): the gather + compose
| Item |
|---|
pub struct PartitionRow |
PlacementRow
Documentation-organization audit (sprint 4.8): the gather + compose
| Item |
|---|
pub struct PlacementRow |
WordStockHit
Documentation-organization audit (sprint 4.8): the gather + compose
| Item |
|---|
pub struct WordStockHit |
fn word_stock(file : & str, text : & str, terms : & (String, String)) -> Vec <WordStockHit> |
docs (other)
US-3.96.2/3.96.3: ingest every git-tracked doc (and doc-adjacent
| Item |
|---|
pub const CORPUS_LABEL: & str |
async fn run_corpus_docs_ingest <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, repo_root : & Path,) -> Result <DocsIngestReport, DocsIngestError> |
async fn run_corpus_docs_ingest_full <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, repo_root : & Path,) -> Result <DocsIngestReport, DocsIngestError> |
async fn run_corpus_code_ingest <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, repo_root : & Path,) -> Result <DocsIngestReport, DocsIngestError> |
async fn run_corpus_code_ingest_full <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, repo_root : & Path,) -> Result <DocsIngestReport, DocsIngestError> |
DocsIngestError
US-3.96.2/3.96.3: ingest every git-tracked doc (and doc-adjacent
| Item |
|---|
pub enum DocsIngestError |
DocsIngestReport
US-3.96.2/3.96.3: ingest every git-tracked doc (and doc-adjacent
| Item |
|---|
pub struct DocsIngestReport |
verb:amend
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn amend_line(v1_path : & str) -> String |
verb:classify
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn classify_era(hits : usize, created_date : & str, superseded : bool) -> & 'static str |
verb:constants
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
pub const RETIRED_STEMS: & & str |
pub const DOC_EXTS: & & str |
pub const AMEND_PREFIX: & str |
pub const STAMP_PREFIX: & str |
verb:diff
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn diff_is_substantive(patch : & str) -> bool |
verb:is
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn is_doc_file(path : & str) -> bool |
fn is_stamp_line(line : & str) -> bool |
verb:render
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn render_story(sections : & String, sprint_id : & str, title : & str, series : & str) -> String |
verb:retired
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn retired_hits(text : & str) -> usize |
verb:series
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn series_of(name : & str) -> Option <String> |
verb:slug
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn slug(title : & str) -> String |
verb:stamp
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn stamp_line(created : & str, last_substantive : & str) -> String |
verb:upsert
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn upsert_amend_marker(text : & str, v1_path : & str) ->(String, bool) |
fn upsert_stamp(text : & str, created : & str, last_substantive : & str) ->(String, bool) |
FamilyVerdict
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
pub struct FamilyVerdict |
fn family_for(path : & str) -> FamilyVerdict |
Obligation
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
pub struct Obligation |
fn extract_obligations(text : & str) -> Vec <Obligation> |
docs_reorg (other)
Phase-0 docs reorganization exporter (sprint 4.13, doctrine v1.2.0;
| Item |
|---|
pub const DIR_MOVES: & (& str, & str) |
pub const SUPERSEDED_POSITIONS: & (& str, & str) |
pub const ROOT_MOVES: & (& str, & str) |
pub const ROOT_RESTORED: & & str |
pub const ROOT_CANON: & & str |
fn rewrite_abs_paths(text : & str, file_moves : & BTreeMap <String, String>) -> String |
fn relink(old_path : & str, new_path : & str, target : & str, moves : & BTreeMap <String, String>,) -> Option <String> |
fn rewrite_relative_links(text : & str, old_path : & str, new_path : & str, moves : & BTreeMap <String, String>,) -> String |
MoveVerdict
Phase-0 docs reorganization exporter (sprint 4.13, doctrine v1.2.0;
| Item |
|---|
pub enum MoveVerdict |
fn resolve_target(current : & str, era : & str) -> MoveVerdict |
edges (other)
US-3.96.4: asserted edges (ADR 0040's "graph of memory", stored half).
| Item |
|---|
fn parse_capability_index_crates(tsv : & str) -> BTreeSet <String> |
async fn assert_edges(pool : & PgPool, repo_root : & std::path::Path,) -> Result <EdgesAssertReport, EdgesAssertError> |
async fn assert_edges_from_candidates(pool : & PgPool, candidates : Vec <CandidateEdge>,) -> Result <EdgesAssertReport, EdgesAssertError> |
CandidateEdge
US-3.96.4: asserted edges (ADR 0040's "graph of memory", stored half).
| Item |
|---|
pub struct CandidateEdge |
fn extract_markdown_links(repo_path : & str, text : & str) -> Vec <CandidateEdge> |
fn extract_code_doc_citations(repo_path : & str, text : & str) -> Vec <CandidateEdge> |
fn extract_crate_refs(repo_path : & str, text : & str, crate_names : & BTreeSet <String>,) -> Vec <CandidateEdge> |
EdgeKind
US-3.96.4: asserted edges (ADR 0040's "graph of memory", stored half).
| Item |
|---|
pub enum EdgeKind |
EdgeKind :: fn as_str(self) -> & 'static str |
EdgesAssertError
US-3.96.4: asserted edges (ADR 0040's "graph of memory", stored half).
| Item |
|---|
pub enum EdgesAssertError |
EdgesAssertReport
US-3.96.4: asserted edges (ADR 0040's "graph of memory", stored half).
| Item |
|---|
pub struct EdgesAssertReport |
governance (other)
Loading the governance artefacts from the files that still own them.
| Item |
|---|
fn hook_mentions_gate(hook_sources : & String, gate_name : & str) -> bool |
ClaimKind
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub enum ClaimKind |
ClaimKind :: fn implies_mechanism(self) -> bool |
ClaimKind :: fn as_str(self) -> & 'static str |
fn classify_claim(claim : & str) -> ClaimKind |
GateDecl
Loading the governance artefacts from the files that still own them.
| Item |
|---|
pub struct GateDecl |
fn parse_gate_headings(text : & str, source : & str) -> Vec <GateDecl> |
fn parse_gate_heading(line : & str, source : & str) -> Option <GateDecl> |
harness_event (other)
US-3.96.9: session telemetry as evidence (harness execution graph) --
| Item |
|---|
pub const TOOL_INPUT_CAP_BYTES: usize |
pub const STDIN_PAYLOAD_CAP_BYTES: u64 |
fn resolve_run_id(explicit : Option <& str>, event : & HookEvent,) -> Result <String, HarnessEventError> |
fn cap_tool_input(value : & Value) ->(Value, bool, Option <i64>) |
fn parse_hook_event(raw : & str) -> Result <HookEvent, HarnessEventError> |
async fn insert_hook_event(pool : & PgPool, run_id : & str, event_kind : & str, event : & HookEvent,) -> Result <Uuid, HarnessEventError> |
HarnessEventError
US-3.96.9: session telemetry as evidence (harness execution graph) --
| Item |
|---|
pub enum HarnessEventError |
fn refuse_if_raw_api_bodies_enabled() -> Result <(), HarnessEventError> |
fn read_stdin_payload() -> Result <String, HarnessEventError> |
async fn bind_execution_run(pool : & PgPool, run_id : & str,) -> Result <Option <Uuid>, HarnessEventError> |
HookEvent
US-3.96.9: session telemetry as evidence (harness execution graph) --
| Item |
|---|
pub struct HookEvent |
verb:check
The harness-plane inventory: parse the ratified seed, verify it against
| Item |
|---|
fn check(rows : & Row, facts : & Facts, harness_named : & BTreeSet <String>) -> Vec <Finding> |
verb:constants
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
pub const CLASS_PLANE_UNRATIFIED: & str |
pub const CLASS_CRATE_UNREGISTERED: & str |
pub const CLASS_CRATE_NOT_A_MEMBER: & str |
pub const CLASS_UNCLASSIFIED_HARNESS: & str |
pub const CLASS_STEP_TARGET_MISSING: & str |
pub const CLASS_DUPLICATE_CRATE: & str |
pub const CLASS_DIAGRAM_SYNTAX_INVALID: & str |
pub const CLASS_REPORT_DRIFT: & str |
pub const CLASS_POINTER_MISSING: & str |
pub const REPORT_PATH: & str |
pub const SEED_PATH: & str |
pub const ENTRY_COMMAND_MARKER: & str |
verb:parse
The harness-plane inventory: parse the ratified seed, verify it against
| Item |
|---|
fn parse_registry(text : & str) ->(Vec <Row>, Vec <Finding>) |
verb:render
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn render(rows : & Row, facts : & Facts) -> String |
verb:step
The harness-plane inventory: parse the ratified seed, verify it against
| Item |
|---|
fn step_claim(step : & str, tier_prefixes : & BTreeSet <String>, facts : & Facts, claimed : Option <& str>,) -> StepClaim |
Facts
The harness-plane inventory: parse the ratified seed, verify it against
| Item |
|---|
pub struct Facts |
Facts :: fn target_name_count(& self, name : & str) -> usize |
Facts :: fn tier_prefixes(& self) -> BTreeSet <String> |
Finding
Structural complexity, measured. Sprint 3.124, WU-A.
| Item |
|---|
pub struct Finding |
fn check_drift(rendered : & str, on_disk : Option <& str>) -> Vec <Finding> |
fn validate_mermaid(rendered : & str) -> Vec <Finding> |
Pointers
The harness-plane inventory: parse the ratified seed, verify it against
| Item |
|---|
pub struct Pointers |
fn check_pointers(p : & Pointers) -> Vec <Finding> |
Row
The harness-plane inventory: parse the ratified seed, verify it against
| Item |
|---|
pub struct Row |
pub const CLASS_MALFORMED_ROW: & str |
StepClaim
The harness-plane inventory: parse the ratified seed, verify it against
| Item |
|---|
pub enum StepClaim |
history (other)
US-3.96.10: bounded git-history backfill into corpus_doc_version.
| Item |
|---|
pub const DEFAULT_SAFETY_CAP: usize |
fn validate_scope(scope : & HistoryScope) -> Result <(), ScopeError> |
async fn run_history_backfill(pool : & PgPool, repo_root : & Path, scope : & HistoryScope,) -> Result <HistoryReport, HistoryError> |
HistoryError
US-3.96.10: bounded git-history backfill into corpus_doc_version.
| Item |
|---|
pub enum HistoryError |
fn check_safety_cap(estimated : usize, cap : usize, force : bool) -> Result <(), HistoryError> |
HistoryReport
US-3.96.10: bounded git-history backfill into corpus_doc_version.
| Item |
|---|
pub struct HistoryReport |
HistoryScope
US-3.96.10: bounded git-history backfill into corpus_doc_version.
| Item |
|---|
pub struct HistoryScope |
ScopeError
US-3.96.10: bounded git-history backfill into corpus_doc_version.
| Item |
|---|
pub enum ScopeError |
ingest_run (other)
Every ingest attempt is recorded, including the ones that fail
| Item |
|---|
fn run_id(mode : & str, attempt : u32) -> String |
IngestAttempt
Every ingest attempt is recorded, including the ones that fail
| Item |
|---|
pub struct IngestAttempt |
IngestAttempt :: fn succeeded(& self) -> bool |
IngestAttempt :: fn metrics(& self) -> Vec <(String, f64)> |
IngestAttempt :: fn provenance(& self) -> String |
async fn record(pool : & sqlx::PgPool, attempt : & IngestAttempt) -> Result <usize, sqlx::Error> |
verb:abbreviated
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn abbreviated_identifiers(pool : & PgPool,) -> Result <Vec <AbbreviatedIdentifier>, ExportRefusal> |
verb:add
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn add_term(pool : & PgPool, row : & lexicon_export::SeedRow, admission : & Admission, lexicon_version_for_requests : & str, by : & str, take_over : bool,) -> Result <ImportReport, ExportRefusal> |
verb:admit
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn admit_senses(pool : & PgPool, term : & str, sites : & SenseSite, decided_by : & str, shard_hash : & str, run_id : Option <uuid::Uuid>,) -> Result <usize, ExportRefusal> |
verb:check
The harness-plane inventory: parse the ratified seed, verify it against
| Item |
|---|
fn check(root : & Path, renderings : & Rendering) -> Result <Vec <LineDiff>, ExportRefusal> |
verb:constants
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
pub const RENDERER_VERSION: & str |
verb:header
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
fn header_of(file : & str) -> String |
verb:import
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn import_seed(pool : & PgPool, root : & Path, path : & str, admission : & Admission, lexicon_version_for_requests : & str, take_over : bool,) -> Result <ImportReport, ExportRefusal> |
verb:load
Where the numbers land, and the only place in this feature that talks to
| Item |
|---|
async fn load_registry_files(pool : & PgPool) -> Result <Vec <RegistryFile>, ExportRefusal> |
verb:publish
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn publish(pool : & PgPool, root : & Path, version : & str, renderings : & Rendering,) -> Result <(), ExportRefusal> |
verb:register
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn register(pool : & PgPool, version : & str, renderings : & Rendering, terms : & TermRow,) -> Result <(), ExportRefusal> |
verb:render
Phase-0 consolidation census (sprint 4.13, DOCUMENTATION-DOCTRINE.md v1.0.0):
| Item |
|---|
fn render_all(files : & RegistryFile, terms : & TermRow, labels : & LabelRow, broader : & BroaderRow,) -> Result <Vec <Rendering>, ExportRefusal> |
verb:rule
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn rule_batch(pool : & PgPool, batch : & str, ruled_by : & str,) -> Result <BatchRuling, ExportRefusal> |
verb:undecided
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn undecided_sites(pool : & PgPool, term : & str, cap : i64,) -> Result <Vec <SenseSite>, ExportRefusal> |
verb:ungoverned
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
async fn ungoverned_nouns(pool : & PgPool, min_count : usize,) -> Result <Vec <UngovernedNoun>, ExportRefusal> |
async fn ungoverned_identifiers(pool : & PgPool, ignore : & & str,) -> Result <Vec <UngovernedIdentifier>, ExportRefusal> |
AbbreviatedIdentifier
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct AbbreviatedIdentifier |
Admission
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub enum Admission |
BatchRuling
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct BatchRuling |
ExportRefusal
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub enum ExportRefusal |
ExportRefusal :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
async fn load_terms(pool : & PgPool) -> Result <Vec <TermRow>, ExportRefusal> |
async fn load_labels(pool : & PgPool) -> Result <Vec <LabelRow>, ExportRefusal> |
async fn load_broader(pool : & PgPool) -> Result <Vec <BroaderRow>, ExportRefusal> |
fn resolve_under_root(root : & Path, path : & str) -> Result <PathBuf, ExportRefusal> |
async fn adopt_file(pool : & PgPool, root : & Path, path : & str, slice : & str, ordinal : i32,) -> Result <String, ExportRefusal> |
async fn collect_sense_sites(pool : & PgPool, term : & str) -> Result <usize, ExportRefusal> |
async fn emit_sense_shard(pool : & PgPool, term : & str, cap : i64,) -> Result <(String, String), ExportRefusal> |
async fn retire_term(pool : & PgPool, term : & str, prefer : & str, ruled_by : & str, lexicon_version : & str,) -> Result <(), ExportRefusal> |
ImportReport
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct ImportReport |
Origin
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub enum Origin |
Origin :: fn authority_key(& self) -> String |
Origin :: fn provenance_prefix(& self) -> String |
Origin :: fn evidence_key(& self) ->(& 'static str, String) |
RegistryFile
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct RegistryFile |
Rendering
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct Rendering |
fn version_of(renderings : & Rendering) -> String |
async fn backfill_rendering(pool : & PgPool, root : & Path, path : & str, slice : & str,) -> Result <usize, ExportRefusal> |
SenseSite
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct SenseSite |
Unattested
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct Unattested |
async fn unattested_terms(pool : & PgPool) -> Result <Vec <Unattested>, ExportRefusal> |
UngovernedIdentifier
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct UngovernedIdentifier |
UngovernedNoun
Sprint 4.47 U1c task a3: the one impurity the renderer needs.
| Item |
|---|
pub struct UngovernedNoun |
mirror (other)
US-3.98 Task 2: mirror-first. Populates repo_artifact/artifact_relation
| Item |
|---|
async fn run_mirror_crates(pool : & PgPool, workspace_root : & Path,) -> Result <MirrorReport, MirrorError> |
async fn run_mirror_doc_links(pool : & PgPool, links : & (String, String),) -> Result <MirrorReport, MirrorError> |
async fn run_mirror_code_citations(pool : & PgPool, cites : & (String, String),) -> Result <MirrorReport, MirrorError> |
async fn run_mirror_doc_sections(pool : & PgPool, docs : & (String, Vec <(String, String)>),) -> Result <MirrorReport, MirrorError> |
MirrorError
US-3.98 Task 2: mirror-first. Populates repo_artifact/artifact_relation
| Item |
|---|
pub enum MirrorError |
MirrorReport
US-3.98 Task 2: mirror-first. Populates repo_artifact/artifact_relation
| Item |
|---|
pub struct MirrorReport |
ontology (other)
US-3.96.6: ontology + measurement -- the eight-class architectural
| Item |
|---|
pub const VOCABULARY_VERSION: & str |
pub const UNCLASSIFIED: & str |
fn parse_vocabulary(tsv : & str) -> BTreeMap <String, BTreeSet <String>> |
async fn run_ontology_ingest(pool : & PgPool, repo_root : & Path, run_id : & str,) -> Result <OntologyIngestReport, OntologyIngestError> |
ClassificationOverride
US-3.96.6: ontology + measurement -- the eight-class architectural
| Item |
|---|
pub struct ClassificationOverride |
fn parse_classifications(tsv : & str, file_path : & str) -> Vec <ClassificationOverride> |
OntologyIngestError
US-3.96.6: ontology + measurement -- the eight-class architectural
| Item |
|---|
pub enum OntologyIngestError |
OntologyIngestReport
US-3.96.6: ontology + measurement -- the eight-class architectural
| Item |
|---|
pub struct OntologyIngestReport |
Verdict
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub enum Verdict |
Verdict :: fn admits_transformation(self) -> bool |
Verdict :: fn admits(graded : Option <Self>) -> bool |
Verdict :: fn reason(self) -> String |
Verdict :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result |
fn verdict(mutants_total : u32, killed : u32, survived : u32, uncompilable : u32) -> Verdict |
oracle_store (other)
Where a grade lands, and the query sprints 3.126 and 3.127 refuse to
| Item |
|---|
async fn grade(pool : & PgPool, repo_commit : & str, fn_key : & str,) -> anyhow::Result <Option <Verdict>> |
async fn admits_transformation(pool : & PgPool, repo_commit : & str, fn_key : & str,) -> anyhow::Result <bool> |
async fn lacking_passing_grade(pool : & PgPool, repo_commit : & str, fn_keys : & String,) -> anyhow::Result <Vec <String>> |
fn missing_from(requested : & String, passing : & (String,)) -> Vec <String> |
async fn graded_count(pool : & PgPool, repo_commit : & str) -> anyhow::Result <i64> |
Counts
Where a grade lands, and the query sprints 3.126 and 3.127 refuse to
| Item |
|---|
pub struct Counts |
Counts :: fn verdict(& self) -> Verdict |
async fn record(pool : & PgPool, repo_commit : & str, fn_key : & str, counts : & Counts,) -> anyhow::Result <()> |
pilot (other)
S7 pilot: does splitting the shard beat handing a model the whole crate?
| Item |
|---|
fn arm_cost(payloads : & Payload) -> ArmCost |
fn normalise_symbol(s : & str) -> String |
fn score_cell(crate_name : & str, arm : & str, model : & str, surface : & String, answers : & (ManifestRow, Answer),) -> CellScore |
Answer
S7 pilot: does splitting the shard beat handing a model the whole crate?
| Item |
|---|
pub const ANSWER_SCHEMA: & str |
pub struct Answer |
fn unwrap_answers(root : & serde_json::Value,) ->(std::collections::BTreeMap <String, Answer>, usize) |
ArmCost
S7 pilot: does splitting the shard beat handing a model the whole crate?
| Item |
|---|
pub struct ArmCost |
CellScore
S7 pilot: does splitting the shard beat handing a model the whole crate?
| Item |
|---|
pub struct CellScore |
Claim
Sprint 4.19: the done-claims audit. Prior iterations trusted a model's
| Item |
|---|
pub struct Claim |
Coverage
S7 pilot: does splitting the shard beat handing a model the whole crate?
| Item |
|---|
pub struct Coverage |
Coverage :: fn rate(& self) -> f64 |
fn coverage(surface : & String, claimed : & Vec <String>) -> Coverage |
ManifestRow
S7 pilot: does splitting the shard beat handing a model the whole crate?
| Item |
|---|
pub struct ManifestRow |
fn emit_crate(crate_name : & str, crate_dir : & std::path::Path, lexicon_tsv : & str, lexicon_version : & str, out : & std::path::Path,) -> anyhow::Result <Vec <ManifestRow>> |
Payload
S7 pilot: does splitting the shard beat handing a model the whole crate?
| Item |
|---|
pub struct Payload |
fn arm_a(crate_name : & str, api : & CrateApi) -> Payload |
fn arm_b(crate_name : & str, api : & CrateApi) -> Vec <Payload> |
product_dimension (other)
Sprint 4.65: the product dimension. No new tables -- product is a
| Item |
|---|
async fn plan_bulk_assign(pool : & PgPool, path_prefix : & str, product_slug : & str,) -> Result <Vec <BulkMatch>, ProductError> |
async fn apply_bulk_assign(pool : & PgPool, path_prefix : & str, product_slug : & str,) -> Result <Vec <BulkMatch>, ProductError> |
async fn products_of_work_item(pool : & PgPool, work_item_id : Uuid,) -> Result <Vec <String>, sqlx::Error> |
fn escape_like_prefix(prefix : & str) -> String |
BulkMatch
Sprint 4.65: the product dimension. No new tables -- product is a
| Item |
|---|
pub struct BulkMatch |
MatchDisposition
Sprint 4.65: the product dimension. No new tables -- product is a
| Item |
|---|
pub enum MatchDisposition |
fn categorize_match(existing_products : & String, target : & str) -> MatchDisposition |
ProductError
Sprint 4.65: the product dimension. No new tables -- product is a
| Item |
|---|
pub enum ProductError |
ProductError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
ProductError :: fn from(e : sqlx::Error) -> Self |
async fn create_product(pool : & PgPool, external_key : & str, name : & str,) -> Result <Uuid, ProductError> |
async fn assign_single(pool : & PgPool, external_key : & str, product_slug : & str,) -> Result <(), ProductError> |
async fn incorporate(pool : & PgPool, product_slug : & str, incorporates_slug : & str,) -> Result <(), ProductError> |
async fn product_sequence(pool : & PgPool, product_slug : & str,) -> Result <Vec <(Uuid, i64)>, ProductError> |
reading_cmd (other)
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
fn usage_of(meta : & serde_json::Value) -> Option <i64>; 4 |
async fn stage_turn(corpus : & PgPool, turn : & StagedTurn) -> Result <Staged, ReadingError> |
fn model_of(meta : & serde_json::Value) -> String |
async fn stage(corpus : & PgPool, limit : Option <i64>) -> Result <StageReport, ReadingError> |
async fn census(corpus : & PgPool, rule_version : & str,) -> Result <(String, CensusCounts), ReadingError> |
async fn check(corpus : & PgPool) -> Result <CheckReport, ReadingError> |
fn observed_model(envelope : & str) -> Option <String> |
async fn adjudicate(corpus : & PgPool, opts : & AdjudicateOpts, answer : & dyn Fn(& str) -> Result <String, String>,) -> Result <AdjudicateReport, ReadingError> |
AdjudicateOpts
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
pub struct AdjudicateOpts |
AdjudicateReport
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
pub struct AdjudicateReport |
CensusCounts
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
pub struct CensusCounts |
CheckReport
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
pub struct CheckReport |
ReadingError
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
async fn relabel_readings(corpus : & PgPool) -> Result <u64, ReadingError> |
pub enum ReadingError |
async fn report(corpus : & PgPool, series : & str,) -> Result <Vec <operations_control_plane::reading::TermRank>, ReadingError> |
StageReport
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
pub struct StageReport |
Staged
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
pub enum Staged |
StagedTurn
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
pub struct StagedTurn |
Unmeasured
corpus lexicon reading … (story 4.74, work item 2): the I/O around a
| Item |
|---|
pub struct Unmeasured |
async fn unmeasured(corpus : & PgPool) -> Result <Vec <Unmeasured>, ReadingError> |
readme (other)
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub const RENDERER_SCHEMA: & str |
pub const GRAPH_NODE_CEILING: usize |
pub const TIER_CRATE_GRAPH_CEILING: usize |
pub const DRAFTS_DIR: & str |
fn is_draft_path(crate_path : & str) -> bool |
pub const ROOT_README_NAME: & str |
fn attribute_generated(path : & str, md : & str, lexicon_tsv : & str) -> String |
CrateFilter
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct CrateFilter |
CrateFilter :: fn everything() -> Self |
CrateFilter :: fn resolve(requested : & String, registered : & BTreeSet <String>,) -> Result <Self, UnknownCrate> |
CrateFilter :: fn resolve_with_root(requested : & String, include_root : bool, registered : & BTreeSet <String>,) -> Result <Self, UnknownCrate> |
CrateFilter :: fn is_scoped(& self) -> bool |
CrateFilter :: fn selects(& self, crate_name : & str) -> bool |
CrateFilter :: fn names(& self) -> impl Iterator <Item = & str> |
fn write_if_selected(filter : & CrateFilter, crate_name : & str, path : & std::path::Path, rendered : & str, write : bool,) -> std::io::Result <bool> |
CrateSummary
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct CrateSummary |
Dep
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct Dep |
Derived
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct Derived |
fn render(d : & Derived) -> String |
fn derive(package : & cargo_metadata::Package, crate_dir : & std::path::Path, tier : & str, role : & str, lexicon_tsv : & str, reverse_deps : & String, siblings : & String, aliases : & String, is_workspace_member : & dyn Fn(& str) -> bool, dep_tier : & dyn Fn(& str) -> Option <String>, consumer_hits : & dyn Fn(& str) -> usize,) -> Derived |
Target
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct Target |
Test
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct Test |
TierSummary
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct TierSummary |
UnknownCrate
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct UnknownCrate |
UnknownCrate :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
WorkspaceDocumentation
The README renderer: a crate's documentation as a projection.
| Item |
|---|
pub struct WorkspaceDocumentation |
fn render_root(w : & WorkspaceDocumentation) -> String |
recall (other)
US-3.96.5: derived edges + recall query -- ADR 0040's derived half, the
| Item |
|---|
async fn recall <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, query : & str, hops : usize, limit : usize,) -> Result <Vec <RecallHit>, RecallError> |
RecallError
US-3.96.5: derived edges + recall query -- ADR 0040's derived half, the
| Item |
|---|
pub enum RecallError |
RecallHit
US-3.96.5: derived edges + recall query -- ADR 0040's derived half, the
| Item |
|---|
pub struct RecallHit |
session_scope (other)
Session ownership from the harness event stream — the corpus half of the B-064 fix.
| Item |
|---|
async fn session_owned_paths(pool : & PgPool, agent_id : & str,) -> Result <Vec <String>, sqlx::Error> |
fn to_repo_relative(abs : & str, repo_root : & str) -> Option <String> |
fn unowned_staged(owned : & BTreeSet <String>, staged : & String) -> Vec <String> |
async fn work_item_touched_paths(pool : & PgPool, work_item_id : Uuid,) -> Result <Vec <String>, sqlx::Error> |
fn partition_resolved <'a>(touched : & 'a BTreeSet <String>, resolved : & HashMap <String, Uuid>,) ->(Vec <(& 'a str, Uuid)>, Vec <& 'a str>) |
staleness (other)
Is the corpus behind the working tree? (sprint 4.21)
| Item |
|---|
fn nearest_recorded(candidates : & (String, Option <u64>)) -> Option <String> |
pub const METRIC: & str |
pub const RUN_ID: & str |
async fn head_is_recorded(pool : & sqlx::PgPool, head : & str) -> Result <bool, sqlx::Error> |
async fn recorded_commit_candidates(pool : & sqlx::PgPool) -> Result <Vec <String>, sqlx::Error> |
async fn newest_recorded_commit(pool : & sqlx::PgPool) -> Result <Option <String>, sqlx::Error> |
Staleness
Is the corpus behind the working tree? (sprint 4.21)
| Item |
|---|
pub enum Staleness |
Staleness :: fn is_current(& self) -> bool |
Staleness :: fn behind_commits(& self) -> Option <u64> |
Staleness :: fn summary(& self) -> String |
fn verdict(head : & str, recorded : Option <& str>, distance : Option <u64>) -> Staleness |
fn verdict_with_tree(head : & str, recorded : Option <& str>, distance : Option <u64>, same_tree : bool,) -> Staleness |
async fn record(pool : & sqlx::PgPool, verdict : & Staleness) -> Result <bool, sqlx::Error> |
ArgRefusal
Authoring one row of a sprint from arguments, with no document.
| Item |
|---|
pub struct ArgRefusal |
ArgRefusal :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
fn need_kind(given : & str) -> Result <NeedKind, ArgRefusal> |
fn need_path(given : & str) -> Result <NeedPath, ArgRefusal> |
fn priority(given : & str) -> Result <Priority, ArgRefusal> |
fn disposition(given : & str) -> Result <Disposition, ArgRefusal> |
story_compile_cmd (other)
corpus compile-sprint (sprint 4.39 AC3/AC7): compile a hand-written
| Item |
|---|
async fn run_compile_story(doc : & Path, apply : bool, amend : bool, json : bool) -> ExitCode |
story_render_cmd (other)
corpus sprint-render — the two projections of one sprint.
| Item |
|---|
async fn run_story_render(sprint_id : & str, html : Option <& Path>, md : Option <& Path>, json : bool,) -> ExitCode |
study (other)
Study instruments: sampling, agreement, and open-set variance.
| Item |
|---|
fn jaccard(a : & String, b : & String) -> f64 |
Agreement
Study instruments: sampling, agreement, and open-set variance.
| Item |
|---|
pub struct Agreement |
fn agreement(votes : & Vote) -> Agreement |
Consensus
Study instruments: sampling, agreement, and open-set variance.
| Item |
|---|
pub struct Consensus |
fn consensus(votes : & Vote) -> Vec <Consensus> |
OpenSetAgreement
Study instruments: sampling, agreement, and open-set variance.
| Item |
|---|
pub struct OpenSetAgreement |
fn mean_pairwise_jaccard(derivations : & Vec <String>) -> OpenSetAgreement |
SampleUnit
Study instruments: sampling, agreement, and open-set variance.
| Item |
|---|
pub struct SampleUnit |
fn stratified_sample(population : & SampleUnit, target : usize) -> Vec <String> |
Vote
Study instruments: sampling, agreement, and open-set variance.
| Item |
|---|
pub struct Vote |
fn fleiss_kappa(votes : & Vote) -> Option <f64> |
symbol_ingest (other)
Sprint 4.21 AC3 (amended at pickup): the symbol table is loaded FROM the
| Item |
|---|
fn parse_capability_index(tsv : & str) -> Result <Vec <SymbolRow>, String> |
taxonomy (other)
Where does a crate belong? (sprint 4.21)
| Item |
|---|
fn parse_layer_registry(layers_toml : & str) -> BTreeMap <String, String> |
fn parse_baseline(text : & str) -> BTreeSet <String> |
fn stem(crate_name : & str, layer : & str) -> String |
pub const MIN_GROUP: usize |
fn shared_dependencies(members : & String, deps : & BTreeMap <String, BTreeSet <String>>,) -> BTreeSet <String> |
GroupProposal
Where does a crate belong? (sprint 4.21)
| Item |
|---|
pub struct GroupProposal |
fn propose_groups(registered : & BTreeMap <String, String>, layer : & str, deps : & BTreeMap <String, BTreeSet <String>>,) -> Vec <GroupProposal> |
Unclassified
Where does a crate belong? (sprint 4.21)
| Item |
|---|
pub struct Unclassified |
fn coverage_gaps(registered : & BTreeMap <String, String>, classified : & BTreeSet <String>, baseline : & BTreeSet <String>,) -> Vec <Unclassified> |
term_census (other)
Term census (sprint 4.6, US-4.6.1/2/4): mechanical inventory of process
| Item |
|---|
fn extract_backticked(doc_path : & str, text : & str) -> Vec <(String, String)> |
fn normalize_phrase(raw : & str) -> String |
fn is_candidate_phrase(phrase : & str) -> bool |
fn extract_prose_nouns(doc_path : & str, text : & str) -> Vec <(String, String)> |
fn names_term(candidate : & str, term : & str) -> bool |
CensusEntry
Term census (sprint 4.6, US-4.6.1/2/4): mechanical inventory of process
| Item |
|---|
pub struct CensusEntry |
fn assemble(pairs : Vec <(String, String)>, ratified : & String, banned : & String, excluded : & String, site_cap : usize,) -> Vec <CensusEntry> |
fn to_tsv(entries : & CensusEntry) -> String |
fn to_report(entries : & CensusEntry, date : & str, lexicon_terms : & String) -> String |
fn rival_packages(entries : & CensusEntry, top_n : usize) -> serde_json::Value |
RegistryStatus
Term census (sprint 4.6, US-4.6.1/2/4): mechanical inventory of process
| Item |
|---|
pub enum RegistryStatus |
test_ingest (other)
Every #test in the tree, as rows.
| Item |
|---|
fn crate_dir_of(repo_relative : & str) -> Option <String> |
fn test_path(repo_relative : & str, crate_dir : & str, name : & str) -> String |
fn walkable(path : & Path) -> bool |
fn scan(root : & Path) -> std::io::Result <(Vec <Registered>, Report)> |
Kind
Every #test in the tree, as rows.
| Item |
|---|
pub enum Kind |
Kind :: fn as_str(self) -> & 'static str |
fn kind_of(repo_relative : & str) -> Kind |
Registered
Every #test in the tree, as rows.
| Item |
|---|
pub struct Registered |
Report
Every #test in the tree, as rows.
| Item |
|---|
pub struct Report |
vocabulary_panel::agreement (other)
Panel agreement metrics: full-agreement rate, mean modal agreement, Fleiss' kappa.
| Item |
|---|
fn cell_metrics(votes : & Vote) -> Result <BTreeMap <String, CellMetrics>, AgreementError> |
AgreementError
Panel agreement metrics: full-agreement rate, mean modal agreement, Fleiss' kappa.
| Item |
|---|
pub enum AgreementError |
CellMetrics
Panel agreement metrics: full-agreement rate, mean modal agreement, Fleiss' kappa.
| Item |
|---|
pub struct CellMetrics |
Kappa
Panel agreement metrics: full-agreement rate, mean modal agreement, Fleiss' kappa.
| Item |
|---|
pub enum Kappa |
Vote
Study instruments: sampling, agreement, and open-set variance.
| Item |
|---|
pub struct Vote |
fn parse_votes_tsv(text : & str) -> Result <Vec <Vote>, AgreementError> |
vocabulary_panel::derive (other)
The roles a tier already implies, derived rather than voted on.
| Item |
|---|
pub const SAMPLES_TO_RATIFY: usize |
fn exception_rate_bound(clean : usize) -> f64 |
fn parse_crate_layers(toml : & str) -> BTreeMap <String, String> |
fn derive_roles(crate_layers : & BTreeMap <String, String>, rules : & Rule,) ->(BTreeMap <String,(String, Rule)>, DeriveReport) |
fn registry_hash(toml : & str) -> String |
DeriveReport
The roles a tier already implies, derived rather than voted on.
| Item |
|---|
pub struct DeriveReport |
Rule
The roles a tier already implies, derived rather than voted on.
| Item |
|---|
pub struct Rule |
fn parse_rules(tsv : & str, allowed_roles : & String) -> Result <Vec <Rule>, RuleError> |
fn provenance(rule : & Rule, registry_hash : & str) -> String |
async fn write_derived(pool : & sqlx::PgPool, derived : & BTreeMap <String,(String, Rule)>, registry_hash : & str,) -> Result <usize, sqlx::Error> |
RuleError
The roles a tier already implies, derived rather than voted on.
| Item |
|---|
pub enum RuleError |
RuleStatus
The roles a tier already implies, derived rather than voted on.
| Item |
|---|
pub enum RuleStatus |
RuleStatus :: fn as_str(self) -> & 'static str |
vocabulary_panel::facts (other)
Where a panelist's facts come from: the workspace manifests, not the source tree.
| Item |
|---|
pub const TOP_DEPS: usize |
pub const LISTED: usize |
fn surface_from_capability_index(tsv : & str) -> BTreeMap <String,(Vec <String>, usize)> |
fn invert_dependencies(outbound : & BTreeMap <String, Vec <String>>,) -> BTreeMap <String, Vec <String>> |
fn description_from_lib_doc(source : & str) -> String |
fn workspace_structure(workspace_root : & Path,) -> Result <BTreeMap <String, CrateStructure>, FactsError> |
CrateStructure
Where a panelist's facts come from: the workspace manifests, not the source tree.
| Item |
|---|
pub struct CrateStructure |
FactsError
Where a panelist's facts come from: the workspace manifests, not the source tree.
| Item |
|---|
pub enum FactsError |
FactsError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
FactsError :: fn from(e : cargo_metadata::Error) -> Self |
fn workspace_dependency_map(workspace_root : & Path,) -> Result <BTreeMap <String, Vec <String>>, FactsError> |
fn workspace_facts(workspace_root : & Path) -> Result <Vec <CrateFacts>, FactsError> |
vocabulary_panel::run (other)
The run: draw a sample, and later score the votes that came back.
| Item |
|---|
pub const VOTE_HEADER: & str |
fn render_payloads(sample : & CrateFacts) ->(String, String) |
fn run_sample(workspace_root : & Path, size : usize, out_dir : & Path, stamp : & str, only : Option <& String>,) -> Result <SampleReport, RunError> |
fn score(vote_text : & str, threshold : f64, no_confidence : bool) -> Result <Scored, RunError> |
async fn run_score(pool : Option <& sqlx::PgPool>, vote_path : Option <& PathBuf>, threshold : f64, no_confidence : bool, run_id : Option <& str>, store_cell : Option <& str>, allowed_roles : & String,) -> Result <ScoreReport, RunError> |
CellSummary
The run: draw a sample, and later score the votes that came back.
| Item |
|---|
pub struct CellSummary |
RunError
The run: draw a sample, and later score the votes that came back.
| Item |
|---|
pub enum RunError |
RunError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
SampleReport
The run: draw a sample, and later score the votes that came back.
| Item |
|---|
pub struct SampleReport |
ScoreReport
The run: draw a sample, and later score the votes that came back.
| Item |
|---|
pub struct ScoreReport |
Scored
The run: draw a sample, and later score the votes that came back.
| Item |
|---|
pub struct Scored |
CrateFacts
The sample, and the facts a panelist is allowed to see.
| Item |
|---|
pub struct CrateFacts |
CrateFacts :: fn stratum(& self) -> String |
fn stratified_sample(crates : & CrateFacts, n : usize) -> Vec <CrateFacts> |
fn select_named <'a>(crates : & 'a CrateFacts, names : & String,) ->(Vec <CrateFacts>, Vec <String>) |
fn payload_prose(facts : & CrateFacts) -> String |
fn payload_typed(facts : & CrateFacts) -> String |
fn payload_structural(facts : & CrateFacts, structure : & super::facts::CrateStructure) -> String |
vocabulary_panel::store (other)
What a run leaves behind: metric rows and consensus classifications.
| Item |
|---|
pub const VOCABULARY_VERSION: & str |
pub const PROVENANCE_CLASS: & str |
async fn write_run(pool : & sqlx::PgPool, run_id : & str, provenance : & str, metrics : & MetricRow, consensus : & ConsensusRow, allowed_roles : & String,) -> Result <(), StoreError> |
ConsensusRow
What a run leaves behind: metric rows and consensus classifications.
| Item |
|---|
pub struct ConsensusRow |
fn consensus_rows(votes : & Vote) -> Vec <ConsensusRow> |
MetricRow
What a run leaves behind: metric rows and consensus classifications.
| Item |
|---|
pub struct MetricRow |
fn metric_rows(cells : & BTreeMap <String, CellMetrics>, abstentions : & BTreeMap <String, AbstentionCounts>, confidence_threshold : f64,) -> Vec <MetricRow> |
StoreError
What a run leaves behind: metric rows and consensus classifications.
| Item |
|---|
pub enum StoreError |
StoreError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
StoreError :: fn from(e : sqlx::Error) -> Self |
vocabulary_panel::votes (other)
The vote record, and the reason it gained a fifth column.
| Item |
|---|
pub const UNCLASSIFIED: & str |
fn parse(text : & str, mode : ConfidenceMode) -> Result <Vec <RawVote>, VoteError> |
fn coerce(votes : & RawVote, threshold : f64,) ->(Vec <Vote>, std::collections::BTreeMap <String, AbstentionCounts>,) |
AbstentionCounts
The vote record, and the reason it gained a fifth column.
| Item |
|---|
pub struct AbstentionCounts |
ConfidenceMode
The vote record, and the reason it gained a fifth column.
| Item |
|---|
pub enum ConfidenceMode |
RawVote
The vote record, and the reason it gained a fifth column.
| Item |
|---|
pub struct RawVote |
VoteError
The vote record, and the reason it gained a fifth column.
| Item |
|---|
pub enum VoteError |
walk (other)
Repo-wide git-tracked file walker for corpus ingest (US-3.96.2/3.96.3).
| Item |
|---|
pub const MAX_FILE_COUNT: usize |
fn parse_ls_files(stdout : & str) -> Vec <String> |
fn walk_git_tracked(repo_root : & Path) -> Result <CorpusWalkOutcome, CorpusWalkError> |
CorpusFile
Repo-wide git-tracked file walker for corpus ingest (US-3.96.2/3.96.3).
| Item |
|---|
pub struct CorpusFile |
CorpusKind
Repo-wide git-tracked file walker for corpus ingest (US-3.96.2/3.96.3).
| Item |
|---|
pub enum CorpusKind |
CorpusKind :: fn as_str(self) -> & 'static str |
fn classify(repo_path : & str) -> Option <CorpusKind> |
CorpusWalkError
Repo-wide git-tracked file walker for corpus ingest (US-3.96.2/3.96.3).
| Item |
|---|
pub enum CorpusWalkError |
CorpusWalkOutcome
Repo-wide git-tracked file walker for corpus ingest (US-3.96.2/3.96.3).
| Item |
|---|
pub struct CorpusWalkOutcome |
SkippedEntry
Repo-wide git-tracked file walker for corpus ingest (US-3.96.2/3.96.3).
| Item |
|---|
pub struct SkippedEntry |
work_item (other)
Part D work-item scoping + context compiler (sprint 4.4; spec:
| Item |
|---|
fn radius(edges : & (Uuid, Uuid), seeds : & BTreeSet <Uuid>, depth_cap : u32,) -> BTreeMap <Uuid, u32> |
fn apply_budget(work_item_id : Uuid, ranked : Vec <Candidate>, budget_bytes : u64,) -> Result <ContextManifest, String> |
fn splice(manifest : ContextManifest, contents : & BTreeMap <String, String>, per_file_cap : u64,) -> Result <SplicedShard, String> |
fn split_sections(text : & str, anchors : & (String, String, usize)) -> Vec <(String, String)> |
fn may_start(unread_required : usize) -> Result <(), String> |
Candidate
Part D work-item scoping + context compiler (sprint 4.4; spec:
| Item |
|---|
pub struct Candidate |
fn rank(required : Vec <Candidate>, scope : Vec <Candidate>, adjacent : Vec <Candidate>,) -> Vec <Candidate> |
ContentBlock
Part D work-item scoping + context compiler (sprint 4.4; spec:
| Item |
|---|
pub struct ContentBlock |
ContextManifest
Part D work-item scoping + context compiler (sprint 4.4; spec:
| Item |
|---|
pub struct ContextManifest |
Omission
Part D work-item scoping + context compiler (sprint 4.4; spec:
| Item |
|---|
pub struct Omission |
SplicedShard
Part D work-item scoping + context compiler (sprint 4.4; spec:
| Item |
|---|
pub struct SplicedShard |
Tier
Part D work-item scoping + context compiler (sprint 4.4; spec:
| Item |
|---|
pub enum Tier |
How to use it
From `examples/governance_scan.rs`:
use tools_corpus::governance::{hook_mentions_gate, parse_gate_headings, ClaimKind};
fn main() {
let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.ancestors()
.nth(3)
.expect("crates/tools/corpus is three below the root")
.to_path_buf();
let hooks: Vec<String> = std::fs::read_dir(root.join(".githooks"))
.map(|d| {
d.filter_map(Result::ok)
.filter_map(|e| std::fs::read_to_string(e.path()).ok())
.collect()
})
.unwrap_or_default();
From this crate's own rustdoc:
So this checks the resulting STATE rather than the textual location of SQL,
and 0075 -- a forward repair for tables created back in 0001/0052/0056 --
satisfies it without touching history.
SCOPED, deliberately. The expected set is derived from the migration
registries, not from "every table in the database": `corpus_sourcecode` also
hosts other modules' tables, and a gate that does not know its own scope
would refuse a provision over rows it has no claim on.
The tradeoff, stated: a run that stops before 0075 leaves an unowned table
behind. That run has not succeeded, and the schema is not ready. Requiring
every intermediate historical state to satisfy a rule invented later would
make forward-only migration impossible.
# Errors
[`application_core::MigrationError`] on query failure, or a refusal naming
every table left unowned.
Swap `base_url`'s path (dbname) for `db_name`, keeping scheme/auth/host/
port/query -- the connection used to create `corpus_sourcecode` cannot
itself be a connection TO `corpus_sourcecode` (it doesn't exist yet), so
provisioning needs this second URL once the database exists.
# Errors
[`url::ParseError`] if `base_url` is not a valid URL.
Databases an admin connects TO in order to create others; naming one in
`CORPUS_SOURCECODE_DB` states where the admin session lands, not what to
provision.
Where the provisioning target came from, so the output can say so
instead of leaving a default to be assumed (B-110).
`--db` on the command line.
The path of `CORPUS_SOURCECODE_DB`.
Neither named one: [`CORPUS_DB_NAME`].
The database `corpus provision` will operate on, and why that one.
Decide the target database: honoured or refused, never substituted
(B-110). The URL's path names the target unless it is empty or one of the
[`MAINTENANCE_DATABASES`]; `requested` (`--db`) wins when the URL is
silent and is refused when the two disagree. Pure: no connection is made.
# Errors
[`TargetError::Url`] for a malformed URL; [`TargetError::Conflict`] when
the URL path and `requested` name different databases;
[`TargetError::Maintenance`] when `requested` names a maintenance database.
What a full `corpus provision` run did, end to end.
End to end: ADR-0025 roles + database (via `admin_pool`, a cluster-admin
connection -- e.g. a local superuser, same assumption as
[`ensure_roles_and_database`]'s own live-pg test), then reconnect to the
now-existing database (`db_name`, derived from `admin_url` by
[`corpus_db_url`]) and apply its schema. Idempotent: a second call is a
no-op on every field (US-3.96.1's own acceptance criterion). The CLI
passes the name [`resolve_provision_target`] decided (B-110); this
function operates on exactly `db_name` and nothing else.
# Errors
[`ProvisionCliError`] -- any step failing aborts loudly; nothing partial.
Give `corpus_sourcecode_app` the privileges the tools actually need, and
keep giving them as new tables arrive (B-096).
THE BUG THIS CLOSES. `ensure_roles_and_database` created the roles and the
database and granted nothing; no `GRANT` existed anywhere in either
migration directory. So the app role's real privilege set lived only in
whichever database somebody had once fixed by hand, and a freshly
provisioned one did not work. It was filed 2026-09-08 and hit again on
2026-09-09 the moment work item 5 added `gate`/`gate_guard`: `gate-run`
failed with `permission denied for table gate_guard` against a database that
was otherwise fully migrated.
WHY BLANKET RATHER THAN PER-TABLE. Per-table grants are more precise and are
wrong here: they have to be remembered in every migration that adds a table,
and the failure mode of forgetting is exactly what B-096 is. This runs after
migrations, covers what they just created, and `ALTER DEFAULT PRIVILEGES`
covers what later ones create. The role remains `NOSUPERUSER NOCREATEDB
NOCREATEROLE NOREPLICATION NOBYPASSRLS` and gets no DDL: it may read and
write rows, never change the shape of the database.
Idempotent -- `GRANT` is, and repeated runs are a no-op.
# Errors
[`ProvisionCliError::Db`] if any grant fails.
The one place this crate names its live-Postgres test connection.
Returns `None` — with a loud skip line naming what went untested — when
`CORPUS_TEST_DB` is unset. Callers `return` on `None` rather than carrying
`#[ignore]`, because `cargo-mutants` runs `cargo test` WITHOUT `--ignored`:
an `#[ignore]`d test is invisible to the mutation gate, so the code it
covers reads as untested and its mutants read as unkillable. That is not
hypothetical here — `hotspot_score` had `*` mutated to `+` and `1 + churn`
to `1 - churn` with nothing noticing, because its only exercise was an
`#[ignore]`d live test.
It is a function and not five copies of a `std::env::var` call because
five copies is how six of them ended up reading `KNOWLEDGE_TEST_DB` — the
knowledge-index database — while writing source-code-corpus tables.
The connection needs cluster-admin rights: callers create and drop
pid-scoped scratch databases through it. Connecting to any database as a
superuser suffices; `CREATE DATABASE` is not scoped to the one you are in.
Deliberately NOT `#[cfg(test)]`, though it exists only for tests: a
`#[cfg(test)]` item in a library is not compiled into the library a
dependent crate links, so `main.rs`'s own tests could not call it and
would need a second `std::env::var` naming the same variable — which is
the defect this function was written to end. Reading one environment
variable costs a production binary nothing.
Apply migration SQL from a test that shares a database with other tests.
`CREATE TABLE IF NOT EXISTS` is not atomic against itself: two sessions both
pass the existence check and the loser fails 23505 on
`pg_type_typname_nsp_index`. Several live-pg tests open by applying the same
corpus migrations to the shared `CORPUS_TEST_DB`, and `cargo test` runs them
in parallel, so they raced -- failing on a fresh database and passing
forever after, which is the shape that gets called flaky and ignored.
The mutex is Postgres' own advisory lock, not a process-local one, because
each integration test is a separate binary. It is held on its own connection
for the length of the apply and released explicitly.
The single key every test's migration apply serializes on. Arbitrary but
fixed, and unused by production code.
Hold [`MIGRATION_LOCK`] until the returned pool is passed to
[`release_migration_lock`].
The lock lives on a pool of its own with exactly one connection, because an
advisory lock is SESSION-scoped: taken on one connection of a multi-
connection pool and released on another, it is not released at all.
Six live-pg tests share one database (`CORPUS_TEST_DB`) and each opens
by applying the corpus migrations. `cargo test` runs them in parallel,
and two concurrent `CREATE TABLE IF NOT EXISTS` genuinely race in
Postgres: both pass the existence check, the loser fails 23505 on
`pg_type_typname_nsp_index`. Measured 2026-08-30: four of them failed on
the first run against a fresh database, and passed on every run after,
which is the shape that gets called flaky and ignored.
From this crate's own rustdoc:
The skip helper must not skip when the database IS configured.
`live_pg_admin_url -> None` is the highest-leverage single mutation in
this crate: every live test takes its early return, announces itself as
skipped, and passes. Twelve tests and the whole storage layer go dark
while the suite reports green — which is the exact condition, dressed
differently, that `#[ignore]` used to produce here.
This is the one place a second `std::env::var` on that name is correct:
a test of the helper's contract has to know the answer independently,
or it is asking the subject to grade itself.
Live-pg, cluster-admin required (not the usual per-test-db pattern —
this test creates and drops roles/databases at the cluster level, under
a pid-scoped name it drops on both sides):
Module structure
tools_corpus
auditcapability_guardclaim_verifyclicodecomplexitycomplexity_calibratecomplexity_callerscomplexity_churncomplexity_ratchetcomplexity_reportcomplexity_storeconformancecrate_pathcrate_registercrate_sizedecisionsdiagrams_cmddoc_auditdocsdocs_censusdocs_reorgedgesgovernanceharness_eventharness_inventoryhistoryingest_runlexicon_storemirrorontologyoracleoracle_storepilotproduct_dimensionreading_cmdreadmerecallsession_scopestalenessstory_authorstory_compile_cmdstory_render_cmdstudysymbol_ingesttaxonomyterm_censustest_ingestvocabulary_panelvocabulary_panel::agreementvocabulary_panel::derivevocabulary_panel::factsvocabulary_panel::runvocabulary_panel::samplevocabulary_panel::storevocabulary_panel::voteswalkwork_item
_58 modules: past 25 the diagram stops being readable, so the tree above is the complete picture._
Public surface
`crate root`
| Item | What it is |
|---|---|
pub struct ProvisionReport | What ensure_roles_and_database actually did — distinguishes a fresh provision from an idempotent no-op, per US-3.96.1's acceptance criterion (second run: no-op, exit 0). |
async fn ensure_roles_and_database(pool : & PgPool, db_name : & str,) -> Result <ProvisionReport, ProvisionError> | Idempotently create the ADR-0025 role pair and the database itself |
pub enum ProvisionError | — |
pub struct RolePlan | The two ADR-0025 roles this corpus needs, plus the CREATE ROLE statements for them |
fn plan_roles(db_name : & str) -> Result <RolePlan, RoleError> | Derive the ADR-0025 role plan for a corpus database name |
pub const CORPUS_DB_NAME: & str | The default corpus (ADR 0041): database-per-corpus means another corpus is another database name |
pub struct MigrationReport | Files newly applied per migration set, distinguished so a caller can tell "nothing to do" (US-3.96.1's second-run no-op) from "just bootstrapped". |
async fn apply_corpus_migrations(pool : & PgPool,) -> Result <MigrationReport, application_core::MigrationError> | Apply infrastructure-knowledge-index's schema, then this sprint's own five tables, into pool -- which must already be the corpus_sourcecode connection (roles/database created first via ensure_roles_and_database) |
async fn assert_governed_tables_owned(pool : & PgPool,) -> Result <(), application_core::MigrationError> | Every table these migration sets create is owned by a concept (sprint 4.21 AC6), checked once the run is complete |
fn corpus_db_url(base_url : & str, db_name : & str) -> Result <String, url::ParseError> | Swap base_url's path (dbname) for db_name, keeping scheme/auth/host/ port/query -- the connection used to create corpus_sourcecode cannot itself be a connection TO corpus_sourcecode (it doesn't exist yet), so provisioning needs this second URL once the database exists |
pub const MAINTENANCE_DATABASES: & str; 3 | Databases an admin connects TO in order to create others; naming one in CORPUS_SOURCECODE_DB states where the admin session lands, not what to provision. |
pub enum TargetSource | Where the provisioning target came from, so the output can say so instead of leaving a default to be assumed (B-110). |
TargetSource :: fn describe(self) -> & 'static str | — |
pub struct ProvisionTarget | The database corpus provision will operate on, and why that one. |
pub enum TargetError | — |
fn resolve_provision_target(admin_url : & str, requested : Option <& str>,) -> Result <ProvisionTarget, TargetError> | Decide the target database: honoured or refused, never substituted (B-110) |
pub struct ProvisionOutcome | What a full corpus provision run did, end to end. |
pub enum ProvisionCliError | — |
async fn provision(admin_pool : & PgPool, admin_url : & str, db_name : & str,) -> Result <ProvisionOutcome, ProvisionCliError> | End to end: ADR-0025 roles + database (via admin_pool, a cluster-admin connection -- e.g |
async fn grant_app_privileges(pool : & PgPool) -> Result <(), ProvisionCliError> | Give corpus_sourcecode_app the privileges the tools actually need, and keep giving them as new tables arrive (B-096) |
fn live_pg_admin_url(what_is_untested : & str) -> Option <String> | — |
`audit`
| Item | What it is |
|---|---|
pub enum AuditError | — |
pub struct AuditReport | What one corpus audit run wrote, as the exact (metric, value) pairs inserted into run_measurement. |
fn docs_topdir_counts(docs_relative_paths : & String) -> BTreeMap <String, usize> | Group docs/-relative tracked paths by their top-level directory segment (docs/architecture/API.md -> "architecture"); a file directly under docs/ with no subdirectory groups under "_root" |
fn naming_regime(crate_name : & str, tiers : & String) -> & 'static str | v2 migration: every crate is expected to carry a ratified tier prefix (<tier>-<name>), so the regime metric now measures RENAME COMPLETENESS — "tier_prefix" when the name starts with a tier from the layers.toml registry, "unregistered" otherwise |
fn parse_tier_registry(layers_toml : & str) -> Vec <String> | The tier registry: unique layer values of docs/architecture/layers.toml crate = "layer" rows (comments and section headers skipped) |
async fn run_audit(pool : & PgPool, repo_root : & Path, run_id : & str,) -> Result <AuditReport, AuditError> | Run one corpus audit pass end to end: compute all six metric groups (the original five plus table row counts, added 2026-08-13), write them into run_measurement under run_id in ONE transaction (Gate 1.5.6 §4: a failure partway through must never leave a PARTIAL set of this run's metrics committed -- a later reader querying run_measurement by run_id would otherwise see an incomplete, silently-truncated row set with no signal that it's incomplete), and return the exact rows written |
`capability_guard`
| Item | What it is |
|---|---|
pub struct AddedItem | One added pub item from a staged diff. |
pub const OWNER_PATHS: & & str | The self-block class (OWNER_PATHS precedent): the crates that DEFINE the search and its tables must be able to edit themselves. |
fn added_pub_items(diff : & str) -> Vec <AddedItem> | Parse git diff --cached -U0 output: every ADDED line declaring a `pub fn\ |
`claim_verify`
| Item | What it is |
|---|---|
pub struct Claim | One completion claim found in a document. |
pub enum ClaimKind | — |
ClaimKind :: fn as_str(self) -> & 'static str | — |
pub enum SuiteState | Behavior-tier state for the run: either the workspace suite ran (with the suites that failed, minus operator-attributed flakes handled by the caller), or it was skipped — skipped NEVER upgrades a verdict. |
pub struct Evidence<'a> | Everything the verdict function may consult for one claim |
pub enum Verdict | — |
Verdict :: fn as_str(self) -> & 'static str | — |
fn verdict(refs : & String, ev : & Evidence <'_>) ->(Verdict, String) | The pure verdict function (AC3) |
fn status_line_is_done(line : & str) -> bool | Is a Status:-shaped line claiming completion? Word-boundary-ish match over a closed done-vocabulary; open-shaped statuses (GATE 1, draft, in-progress, blocked) are not claims. |
fn extract_refs(line : & str, title_line : & str, members : & BTreeMap <String, String>,) -> Vec <String> | Extract member-name references from a claim line (+ the document title line as fallback context): backticked or bare tokens that exactly match a workspace member name |
fn extract_claims(rel_path : & str, text : & str, members : & BTreeMap <String, String>,) -> Vec <Claim> | Extract all completion claims from one document. |
fn members_from_manifests(manifests : & (String, String)) -> BTreeMap <String, String> | Parse workspace members (name -> dir) from manifest texts: (dir, cargo_toml_text) pairs gathered by the caller's walk. |
fn registered_from_layers_toml(text : & str) -> BTreeSet <String> | Keys of crate_layer in the layer registry — the registered set. |
fn crate_has_tests(files : & String, read : impl Fn(& str) -> Option <String>) -> bool | Does a crate dir carry any test at all (unit attr or tests/ file)? Caller hands the crate's file list + a reader; pure over those inputs. |
pub struct VerdictCounts | Group verdict counts for the worksheet/telemetry. |
VerdictCounts :: fn add(& mut self, v : Verdict) | — |
VerdictCounts :: fn total(& self) -> usize | — |
VerdictCounts :: fn honesty_ratio(& self) -> f64 | The headline: of claims that named a verifiable artifact, what share is proven done? (UNVERIFIABLE mass excluded from the denominator — those claims predate the evidence discipline entirely.) |
fn failing_crates_from_cargo_output(out : & str) -> BTreeSet <String> | Parse cargo test --no-fail-fast stdout for failing crate suites: lines like error: test failed, to rerun pass -p <name> ... |
fn worksheet_rank(v : Verdict) -> u8 | Sort key for the worksheet: worst first. |
fn stub_members(stub_dirs : & BTreeSet <String>, member_dirs : & BTreeMap <String, String>,) -> BTreeSet <String> | Resolve stub-scan's crate-dir keys to member names. |
`cli`
| Item | What it is |
|---|---|
pub struct Cli | The source-code corpus: ingest, audit, and query THIS repository. |
pub enum Command | Top-level namespace |
pub enum CorpusCmd | corpus .... |
pub enum StoryCmd | corpus story ... — one row of a sprint, authored from arguments |
pub enum LexiconCmd | corpus lexicon ... actions (sprint 4.47 U1c). |
pub enum ReadingCmd | corpus lexicon reading ... (story 4.74) |
pub enum ExecutionCmd | corpus execution ... actions (sprint 4.20, the execution spine). |
pub enum WorkItemCmd | corpus work-item ... actions (sprint 4.4, Part D). |
`code`
| Item | What it is |
|---|---|
pub struct CodeChunk | One chunk of Rust source, symbol-anchored or window-fallback. |
fn chunk_rust_source(text : & str) -> Vec <CodeChunk> | Chunk one Rust source file |
fn crate_and_module(repo_path : & str, dir_to_name : & std::collections::BTreeMap <String, String>,) -> Option <(String, String)> | Best-effort crate name + module path from a repo-relative source path, via the .../<crate-dir>/src/<module/path>.rs convention every crate in this workspace follows (verified against cargo metadata would be exact, but this stays a pure, I/O-free function -- good enough for search metadata, not an identity invariant) |
fn workspace_dir_to_name(repo_root : & std::path::Path,) -> std::collections::BTreeMap <String, String> | The measured member-dir -> manifest-name map for crate_and_module: root Cargo.toml member paths joined with each member's package name |
`complexity`
| Item | What it is |
|---|---|
pub const BODY_SHAPE_VERSION: u32 | The normalization contract version behind FnMetrics::body_shape_hash |
pub const FN_METRICS: & & str | Metrics this module produces per function, by seed name |
pub const MODULE_METRICS: & & str | Metrics this module produces per module. |
pub const CONFIG_KEYS: & & str | Keys complexity-config.tsv must carry, and nothing else. |
pub const CONFIG_TEXT_KEYS: & & str | Keys whose value is not a number. |
pub const THRESHOLDS_PATH: & str | The ratified threshold seed, repo-root relative. |
pub const CONFIG_PATH: & str | The ratified run-parameter seed, repo-root relative. |
pub struct Finding | A defect in a seed, in the source, or between them |
pub enum Scope | Which producer a threshold row is measured by. |
pub enum Selector | One typed excludes selector |
pub struct Threshold | One ratified row of docs/reference/complexity-thresholds.tsv. |
pub struct Config | docs/reference/complexity-config.tsv, parsed and complete. |
fn parse_thresholds(text : & str) ->(Vec <Threshold>, Vec <Finding>) | Parse the threshold seed |
fn parse_config(text : & str) ->(Option <Config>, Vec <Finding>) | Parse the config seed |
fn calibration_expired(config : & Config, commits_measured : i64, today : & str) -> bool | Has the warn-only period ended? (AC13.1) Whichever deadline arrives first ends it |
fn check_metric_producers(thresholds : & Threshold) -> Vec <Finding> | Every threshold metric must have exactly one producer at its declared scope |
pub struct FnMetrics | Everything counted about one lexically present function |
pub struct ModuleMetrics | Everything counted about one module's position in its crate's graph. |
pub struct CrateUseEdge | One use of another crate, recorded and not adjudicated |
pub struct CrateGraph | The graph facts for one crate. |
fn measure_crate(files : & (String, String)) ->(CrateGraph, Vec <Finding>) | Measure one crate's module graph from its files |
fn measure_file(path : & str, text : & str) ->(Vec <FnMetrics>, Vec <Finding>) | Measure every function in one file's text |
BindingCollector :: fn visit_pat_ident(& mut self, node : & 'ast syn::PatIdent) | — |
Renamer :: fn visit_pat_ident_mut(& mut self, node : & mut syn::PatIdent) | — |
Renamer :: fn visit_field_pat_mut(& mut self, node : & mut syn::FieldPat) | — |
Renamer :: fn visit_field_value_mut(& mut self, node : & mut syn::FieldValue) | — |
Renamer :: fn visit_expr_path_mut(& mut self, node : & mut syn::ExprPath) | — |
Renamer :: fn visit_lit_mut(& mut self, node : & mut syn::Lit) | — |
BodyVisitor :: fn visit_expr(& mut self, node : & 'ast syn::Expr) | — |
BodyVisitor :: fn visit_expr_if(& mut self, node : & 'ast syn::ExprIf) | — |
BodyVisitor :: fn visit_expr_match(& mut self, node : & 'ast syn::ExprMatch) | — |
BodyVisitor :: fn visit_expr_loop(& mut self, node : & 'ast syn::ExprLoop) | — |
BodyVisitor :: fn visit_expr_while(& mut self, node : & 'ast syn::ExprWhile) | — |
BodyVisitor :: fn visit_expr_for_loop(& mut self, node : & 'ast syn::ExprForLoop) | — |
BodyVisitor :: fn visit_expr_closure(& mut self, node : & 'ast syn::ExprClosure) | — |
BodyVisitor :: fn visit_local(& mut self, node : & 'ast syn::Local) | — |
BodyVisitor :: fn visit_expr_binary(& mut self, node : & 'ast syn::ExprBinary) | — |
BodyVisitor :: fn visit_expr_break(& mut self, node : & 'ast syn::ExprBreak) | — |
BodyVisitor :: fn visit_expr_continue(& mut self, node : & 'ast syn::ExprContinue) | — |
BodyVisitor :: fn visit_expr_method_call(& mut self, node : & 'ast syn::ExprMethodCall) | — |
BodyVisitor :: fn visit_expr_macro(& mut self, _node : & 'ast syn::ExprMacro) | — |
BodyVisitor :: fn visit_item(& mut self, node : & 'ast syn::Item) | — |
`complexity_calibrate`
| Item | What it is |
|---|---|
pub struct Distribution | The shape of one metric across the calibration window |
pub struct Proposal | A proposed threshold and the evidence behind it. |
fn peaks(rows : & (String, u32)) -> BTreeMap <String, u32> | Collapse (fn_key, value) rows spanning many commits into one peak per function. |
fn percentile(sorted_ascending : & u32, k : u32) -> u32 | Nearest-rank percentile over sorted-ascending values |
fn distribution(peaks : & BTreeMap <String, u32>) -> Distribution | Describe a set of per-function peaks. |
fn propose(metric : & str, peaks : & BTreeMap <String, u32>) -> Proposal | Propose a fail threshold for one metric, with its evidence. |
fn count_at_or_above(peaks : & BTreeMap <String, u32>, threshold : u32) -> usize | How many functions are at or above a threshold |
fn verify_seed(metric : & str, ratified_fail : Option <i64>, proposal : & Proposal,) -> Option <crate::complexity::Finding> | Does the seed's ratified number equal what the data proposes? This is what stops a threshold being typed rather than earned |
`complexity_callers`
| Item | What it is |
|---|---|
fn call_sites_in_file(path : & str, text : & str, name : & str, skip_line : usize) -> Vec <CallSite> | Every syntactic call to name in one file, with the function it sits in |
CallFinder :: fn visit_item_fn(& mut self, node : & 'ast syn::ItemFn) | — |
CallFinder :: fn visit_impl_item_fn(& mut self, node : & 'ast syn::ImplItemFn) | — |
CallFinder :: fn visit_trait_item_fn(& mut self, node : & 'ast syn::TraitItemFn) | — |
CallFinder :: fn visit_expr_call(& mut self, node : & 'ast syn::ExprCall) | — |
CallFinder :: fn visit_expr_method_call(& mut self, node : & 'ast syn::ExprMethodCall) | — |
fn scope_description(files_searched : usize) -> String | The caller_scope sentence a shard carries, naming the method and its two failure directions so an empty list is readable. |
`complexity_churn`
| Item | What it is |
|---|---|
pub type Churn: BTreeMap <String, u32> | A file's churn over the window: how many distinct commits touched it. |
fn parse_numstat(output : & str) -> Churn | Parse git log --no-merges --since=<...> --format=%H --numstat |
fn history_incomplete(oldest_seen_days_ago : Option <u32>, window_days : u32,) -> Option <crate::complexity::Finding> | Is the history deep enough to answer the question that was asked? A shallow CI checkout turns a 90-day window into a one-commit window WITHOUT ERRORING, and the resulting number looks exactly like a real one |
fn churn_rows_missing(paths_measured : & BTreeSet <String>, churn : & Churn) -> Vec <String> | Functions whose file has no churn row |
`complexity_ratchet`
| Item | What it is |
|---|---|
pub enum Transition | How one at-or-above-threshold function changed between two commits. |
pub struct Churn | Identity churn for one commit, so an anomalous rate is visible rather than silently corrupting the ratchet (AC13.6) |
Churn :: fn percent(& self) -> f64 | Share of tracked identities that changed key, as a percentage. |
pub const TABLE_SHAPE_EXEMPT_METRICS: & & str | The axes a table inflates by construction (B-080, operator decision 2026-09-05) |
fn table_shape_exempts(metric : & str) -> bool | Does the table-shape exemption (B-080) apply to this metric? |
fn classify(old : & FnMetrics, new : & FnMetrics, threshold : u32, value_of : fn(& FnMetrics) -> u32, metric : & str,) -> Vec <Transition> | Classify every at-or-above-threshold function across two commits |
fn verdict(transitions : & Transition, metric : & str) ->(Vec <Finding>, Vec <Finding>) | The refusals and the remarks, in that order |
fn count_invariant(old : & FnMetrics, new : & FnMetrics, threshold : u32, value_of : fn(& FnMetrics) -> u32, metric : & str,) -> Option <Finding> | AC13.4 |
fn churn(transitions : & Transition) -> Churn | Identity churn over the same two commits (AC13.6). |
`complexity_report`
| Item | What it is |
|---|---|
pub struct HotspotRow | One row of the top-N table. |
pub struct DuplicateGroup | A set of functions sharing a normalized shape across at least two crates. |
pub struct Cycle | A module cycle. |
pub struct TierTotals | Per-tier totals |
pub struct ReportData | Everything the report renders from. |
fn source_link(path : & str, line : usize) -> String | A markdown link to a line of source. |
fn render(data : & ReportData) -> String | Render the report |
fn drift(committed : & str, rendered : & str) -> Option <Finding> | Has the committed report drifted from what the data would render? Byte equality, not similarity: a generated file that is "nearly" what the generator produces is a file somebody edited. |
pub enum Calibration | How the warn-only period ends, for the countdown line (AC13.1). |
fn commit_message(refusals : & Finding, touched : & Finding, aggregate : & str, calibration : Calibration,) -> String | The pre-commit message |
`complexity_store`
| Item | What it is |
|---|---|
pub struct GitLimits | Caps for the one git call this feature makes |
GitLimits :: fn default() -> Self | — |
pub struct StoreOutcome | What one --write did, and everything it noticed. |
async fn collect_churn(git_bin : & Path, repo_root : & Path, window_days : u32, limits : GitLimits,) -> anyhow::Result <(Churn, Option <u32>)> | Read per-file churn and the depth of available history out of git |
async fn staged_rust_files(git_bin : & Path, repo_root : & Path, limits : GitLimits,) -> anyhow::Result <Vec <String>> | The .rs files staged for commit: added, copied or modified |
async fn changed_rust_files_between(git_bin : & Path, repo_root : & Path, base : & str, head : & str, limits : GitLimits,) -> anyhow::Result <Vec <String>> | The .rs files that differ between two versions |
async fn file_at_rev(git_bin : & Path, repo_root : & Path, rev : & str, path : & str, limits : GitLimits,) -> anyhow::Result <Option <String>> | One file's content at a version, or None when it did not exist there |
async fn head_commit(git_bin : & Path, repo_root : & Path, limits : GitLimits,) -> anyhow::Result <String> | The commit being measured |
async fn dirty_rust_files(git_bin : & Path, repo_root : & Path, limits : GitLimits,) -> anyhow::Result <Vec <String>> | Tracked .rs files with uncommitted modifications |
async fn tracked_rust_files(git_bin : & Path, repo_root : & Path, limits : GitLimits,) -> anyhow::Result <Vec <String>> | Every git-TRACKED .rs file |
async fn load_window(pool : & PgPool, window_days : u32,) -> anyhow::Result <Vec <(String, String, i32)>> | Every stored (fn_key, metric, value) inside the calibration window |
async fn top_hotspots(pool : & PgPool, repo_commit : & str, n : i64,) -> anyhow::Result <Vec <crate::complexity_report::HotspotRow>> | The top n rows of the hotspot view for one commit, ranked |
async fn duplicate_groups(pool : & PgPool, repo_commit : & str,) -> anyhow::Result <Vec <crate::complexity_report::DuplicateGroup>> | Duplicate-body groups spanning at least two crates, for one commit |
fn group_by_shape(rows : Vec <(String, String, i32, String)>, out : & mut Vec <crate::complexity_report::DuplicateGroup>,) | Fold hash-ordered rows into groups |
async fn measured_commit_count(pool : & PgPool) -> anyhow::Result <i64> | How many distinct commits have been measured |
async fn tier_totals(pool : & PgPool, repo_commit : & str, cognitive_warn : i32, cognitive_fail : i32,) -> anyhow::Result <BTreeMap <String, crate::complexity_report::TierTotals>> | Per-tier totals for one commit |
fn tier_of(path : & str) -> String | The tier a repo path sits in, by directory: crates/<tier>/<name>/... |
fn oldest_commit_days_ago(ct_output : & str, now : i64) -> Option <u32> | How many days ago the oldest line of git log --format=%ct is |
async fn write_commit(pool : & PgPool, repo_commit : & str, metrics : & FnMetrics, churn : & Churn, window_days : u32,) -> anyhow::Result <StoreOutcome> | Write one commit's measurements |
fn path_of(fn_key : & str) -> String | The file a fn_key belongs to |
async fn verify_hotspot(pool : & PgPool, repo_commit : & str) -> anyhow::Result <Vec <Finding>> | AC3's two-way assertion: the same fact computed in SQL and in Rust must agree |
fn hotspot_score(cognitive : i32, file_churn : i32) -> f64 | The hotspot formula, in Rust |
fn disagrees(stored : f64, expected : f64) -> bool | Do two computations of the same score disagree? Extracted for the same reason: > became >=, < and == under mutation and nothing failed, so the check that SQL and Rust agree could itself have been inverted without a test objecting. |
fn default_git_bin() -> PathBuf | Where git is |
`conformance`
| Item | What it is |
|---|---|
pub struct Divergence | One divergence row, ranked by blast radius before presentation. |
fn retired_name_hits(crate_names : & (String, i64), retired_terms : & String,) -> Vec <Divergence> | Crate names carrying a retired term |
fn parse_tier_seed(text : & str) -> Vec <(String, String)> | Parse the tier-vocabulary seed (docs/reference/tier-vocabulary.tsv): term \t definition \t examples, comments/blank lines skipped. |
fn tier_definition_drift(seed : & (String, String), citer_text : & str) -> Vec <Divergence> | Definition-seed check (sprint 4.8 side-loop, ratification rows R1/R2a/ R3/R4/R6; mechanization (b)): diff the diffed citer's tier bullets against the seed, byte-level after whitespace normalization |
fn to_ratification_table(rows : & Divergence) -> String | Render the inventory for ratification: ranked rows + the impact preview, ending at the operator's signature, never an action. |
`crate_path`
| Item | What it is |
|---|---|
pub struct PathMove | One crate that is not where its name says it is. |
fn conforming_path(package : & str, registered_tier : & str) -> Option <String> | The directory a package belongs in, given its registered tier |
fn plan(crates : & BTreeMap <String, String>, registry : & BTreeMap <String, String>,) -> Vec <PathMove> | Every crate whose current directory disagrees with its registered tier |
fn unregistered <'a>(crates : & 'a BTreeMap <String, String>, registry : & BTreeMap <String, String>,) -> Vec <(& 'a str, & 'a str)> | Every workspace crate with no tier in the registry, as (package, directory) in name order |
fn normalize(path : & str) -> String | Normalize a slash-separated relative path: resolve . and .., drop empty segments |
fn relative(from_dir : & str, to_dir : & str) -> String | The relative path from one directory to another, both repo-relative and normalized |
fn map_through_moves(path : & str, moves : & BTreeMap <String, String>) -> String | Map any repo-relative path through a set of directory moves |
fn rewritten_dep_path(manifest_dir : & str, dep_path : & str, moves : & BTreeMap <String, String>,) -> String | Rewrite one path = "..." dependency for a world where directories moved |
`crate_register`
| Item | What it is |
|---|---|
pub struct CrateEntry | One crate as the layer registry names it. |
pub enum RegistrationPass | The four passes, in the order their interlocks force. |
pub enum PassState | What is known about one pass |
pub struct RegistrationFacts | The facts one crate's verdict is computed from |
pub struct Verdict | One crate's four states plus the single pass that blocks. |
pub const LAYER_REGISTRY: & str | The registry the added-crate detection reads. |
RegistrationPass :: fn all() -> RegistrationPass; 4 | The four, in the order their interlocks force. |
RegistrationPass :: fn remedy(self) -> & 'static str | What satisfies this pass |
RegistrationPass :: fn label(self) -> & 'static str | — |
RegistrationPass :: fn number(self) -> u8 | — |
PassState :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result | — |
Verdict :: fn states(& self) -> (RegistrationPass, PassState); 4 | The four states in pass order, for rendering. |
fn added_crates(staged_diff : & str) -> Vec <CrateEntry> | Crates ADDED to crate_layer by a staged diff |
fn assess(crate_name : & str, facts : & RegistrationFacts) -> Verdict | One crate's verdict from its facts |
fn render(verdict : & Verdict) -> String | The four-line state vector, one crate |
fn refusal(verdict : & Verdict) -> String | The BLOCK text: the whole vector, what is outstanding, what satisfies it, and the statement that nothing further ran |
`crate_size`
| Item | What it is |
|---|---|
pub struct CrateSize | Size and substance evidence for one crate |
fn count_test_functions(text : & str) -> usize | Count test attributes |
fn measure(files : & (String, String)) -> CrateSize | Measure a crate from its source files. |
`decisions`
| Item | What it is |
|---|---|
pub struct UnclassifiedCrate | One repo_artifact(artifact_kind='crate') row with no crate_classification row for the given vocab_version. |
async fn unclassified_crates(pool : & PgPool, vocab_version : & str,) -> Result <Vec <UnclassifiedCrate>, sqlx::Error> | Call unclassified_crates(vocab_version) (migration 0005) |
`diagrams_cmd`
| Item | What it is |
|---|---|
pub struct RenderTally | What one run did, per outcome |
async fn run_diagrams_render(only_doc : Option <& str>, json : bool) -> ExitCode | Render every unstored mermaid block in the corpus, or in only_doc. |
`doc_audit`
| Item | What it is |
|---|---|
pub struct DocRow | One markdown artifact with its git dates (YYYY-MM-DD) and size. |
pub struct PartitionRow | T2 row: one directory's NEW/OLD split. |
fn partition(rows : & DocRow, boundary : & str) -> Vec <PartitionRow> | T2: partition per directory by first-seen date |
pub struct CensusRow | T3 row: docs/ directory census with layout-manifest status. |
fn dir_census(rows : & DocRow, declared : & String) -> Vec <CensusRow> | T3: census of the immediate children of docs/ (files at docs/ root are the "docs" row itself) |
fn scan_links(doc_path : & str, text : & str) -> Vec <String> | Extract relative markdown-link targets from one document, resolved against the doc's directory, normalized (.. collapsed) |
pub struct CiterReport | T4: the citer graph with edge provenance kept separate (consensus redline: the scan fallback must be observable, or it is silently skippable) |
fn citer_graph(docs : & String, stored : & (String, String), scanned : & (String, String),) -> CiterReport | — |
pub struct KindRule | Sprint 4.10 T1 — one kind-grammar rule parsed from the PROCESS.md §1.1 artifact map's Path column: the directory it governs and a filename matcher compiled from the map's own pattern language (NN = a dotted number, <x> = one path-free token, {a,b} = alternatives, * = any). |
fn parse_kind_grammar(map_text : & str) -> Vec <KindRule> | Parse the artifact-map table text into kind rules |
fn pattern_matches(pattern : & str, name : & str) -> bool | Does a filename match one map pattern? NN = digits with optional dotted parts, <x> = one or more non-slash chars, * = any run (possibly empty), literals otherwise |
pub struct PlacementRow | T1 output row: one file's placement verdict. |
fn classify_placement(paths : & String, rules : & KindRule) -> Vec <PlacementRow> | — |
fn heading_skeleton(text : & str) -> Vec <String> | T2 — a document's heading skeleton: its level-2 headings, normalized (lowercased, leading numbering stripped) |
fn majority_skeleton(skeletons : & Vec <String>) ->(Vec <String>, usize, usize) | T2 — the majority skeleton (Gate 1.5 adopted definition): the most frequent normalized ordered heading sequence; deterministic tie-break = lexicographic on the joined sequence |
fn section_anchors(text : & str) -> Vec <(String, String, usize)> | T4 (4.10) — a document's section anchors: (slug, heading, start_line) for every level-1/2 heading, slugged deterministically (lowercase, non-alphanumeric runs → -), duplicates within the doc disambiguated -2, -3… (Gate 1.5 adopted identity rule) |
pub struct WordStockHit | T3 — word-stock hit: one banned/retired term on one prose line. |
fn word_stock(file : & str, text : & str, terms : & (String, String)) -> Vec <WordStockHit> | Sweep one document's prose for whole-word occurrences of terms |
fn fold_git_log(log : & str) -> BTreeMap <String,(String, String)> | Fold one `git log --date=short --format=\ |
fn compose_packages(tables_json : & str, purpose_map : & str, e1_models : & String, q23_model : & str,) -> serde_json::Value | Compose the three Judgment packages (tools-packet-compile packets.json shape) |
`docs`
| Item | What it is |
|---|---|
pub const CORPUS_LABEL: & str | The knowledge_doc.corpus label this ingest pass writes under -- distinct from org-docs (the pre-existing ingest command's corpus), since these are different indexing passes over different scopes. |
pub enum DocsIngestError | — |
pub struct DocsIngestReport | What one corpus ingest --docs run did. |
async fn run_corpus_docs_ingest <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, repo_root : & Path,) -> Result <DocsIngestReport, DocsIngestError> | Run one corpus ingest --docs pass: every git-tracked .md (chunks + embeddings via infrastructure-knowledge-index) and every tracked docs/reference/*.{tsv,toml} (corpus_doc only, no embedding -- reference data isn't prose) becomes a corpus_doc + corpus_doc_version row |
async fn run_corpus_docs_ingest_full <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, repo_root : & Path,) -> Result <DocsIngestReport, DocsIngestError> | Same as run_corpus_docs_ingest with full=true (model-migration path): re-embeds every doc, bypassing hash-skip and the mixed-model refusal |
async fn run_corpus_code_ingest <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, repo_root : & Path,) -> Result <DocsIngestReport, DocsIngestError> | Run one corpus ingest --code pass (US-3.96.3): every tracked .rs not excluded by the walker (target/) or the GENERATED marker becomes a corpus_doc(kind='code'), chunked at symbol boundaries (crate::code::chunk_rust_source) |
async fn run_corpus_code_ingest_full <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, repo_root : & Path,) -> Result <DocsIngestReport, DocsIngestError> | Same as run_corpus_code_ingest with full=true |
`docs_census`
| Item | What it is |
|---|---|
pub struct FamilyVerdict | One census verdict: the doctrine family a path maps to, the proposed target directory under docs/, and whether the mapping is mechanical or needs the operator's ruling. |
fn family_for(path : & str) -> FamilyVerdict | The doctrine's family map |
fn series_of(name : & str) -> Option <String> | Number-series membership from a filename: sprint-<N...> prefixes group by their first number group's integer part ("sprint-4.x"), SPRINT-NN report names group as "SPRINT-NN reports", B-NNN as "bugs" |
pub const RETIRED_STEMS: & & str | Retired-vocabulary stems counted for era classification (lexicon retirements of 2026-08-17 plus the earlier R2a set) |
fn retired_hits(text : & str) -> usize | Count retired-stem hits in prose: fenced code and NAMING-ALLOW attributed lines (the line itself and the one after) are excluded, mirroring the D12 discipline. |
fn classify_era(hits : usize, created_date : & str, superseded : bool) -> & 'static str | The era rule (doctrine v1.2.0): superseded documents are pre-paradigm; zero retired hits is current; a file CREATED before the rename promotion (2026-08-16) that still speaks retired words is pre-paradigm — the campaign's mechanical touches do not make old content current, so last-commit dates are useless here and creation date is the signal; a campaign-era file speaking retired words goes to the operator worksheet, never guessed. |
pub const DOC_EXTS: & & str | The registered document-file extension set (fix-the-tool ruling, 2026-08-17): the census sees every file with one of these extensions; anything else in docs/ is counted per-extension in the report — excluded by rule, never silently unseen. |
fn is_doc_file(path : & str) -> bool | True when the path carries a registered document extension. |
fn render_story(sections : & String, sprint_id : & str, title : & str, series : & str) -> String | sprint-new (rule-14, operator: story generation was still hand-authored): render a template-conformant story skeleton FROM the registry rows — never hardcoded sections |
fn slug(title : & str) -> String | Lowercase-kebab slug for filenames; explicit charset, no surprises. |
pub const AMEND_PREFIX: & str | Record-integrity amendment marker (doctrine v1.2.0: live record copies may be linguistically amended; the marker carries provenance in the document itself). |
fn amend_line(v1_path : & str) -> String | Render the amendment marker for a file's v1 origin. |
fn upsert_amend_marker(text : & str, v1_path : & str) ->(String, bool) | Insert the marker directly after the H1 (below the date stamp when one exists) |
pub const STAMP_PREFIX: & str | The generator-owned date stamp (doctrine AC10, operator: "it needs to be mechanical") |
fn stamp_line(created : & str, last_substantive : & str) -> String | Render the stamp line. |
fn is_stamp_line(line : & str) -> bool | True for the stamp line itself — excluded from the substantive-diff classifier so the timestamp can never feed itself. |
fn diff_is_substantive(patch : & str) -> bool | The ratified mechanical definition of "substantive": a diff hunk line (+/-, not the +++/--- headers) whose content is non-whitespace and is not the stamp line. |
fn upsert_stamp(text : & str, created : & str, last_substantive : & str) ->(String, bool) | Insert or replace the stamp directly after the first H1 line |
pub struct Obligation | One open obligation extracted from a document (Phase-0 obligation sweep, doctrine v1.2.0: era and work status are independent axes — archiving the paper must not bury the promise). |
fn extract_obligations(text : & str) -> Vec <Obligation> | Mechanical open-work extraction, all eras: unchecked task rows, open Status lines, PARTIAL/UNVERIFIED contract stamps, stub markers, TODO/pending/deferred markers |
`docs_reorg`
| Item | What it is |
|---|---|
pub const DIR_MOVES: & (& str, & str) | Directory-prefix move map — the ratified target structure |
pub const SUPERSEDED_POSITIONS: & (& str, & str) | The superseded five-family prefixes, retained ONLY to generate synthetic resolution keys for links written during that interlude. |
pub const ROOT_MOVES: & (& str, & str) | Root-file moves ruled explicitly (worksheet ratification + doctrine map) |
pub const ROOT_RESTORED: & & str | Restored root files keep their homes on later runs. |
pub const ROOT_CANON: & & str | — |
pub enum MoveVerdict | A move verdict for one file. |
fn resolve_target(current : & str, era : & str) -> MoveVerdict | Resolve one file's target |
fn rewrite_abs_paths(text : & str, file_moves : & BTreeMap <String, String>) -> String | Rewrite absolute docs/ path references in a text body per the move set (file-level map first — exact paths win — then directory prefixes) |
fn relink(old_path : & str, new_path : & str, target : & str, moves : & BTreeMap <String, String>,) -> Option <String> | Recompute one relative link for a file that moved |
fn rewrite_relative_links(text : & str, old_path : & str, new_path : & str, moves : & BTreeMap <String, String>,) -> String | Rewrite every markdown relative link in a MOVED file's body via relink |
`edges`
| Item | What it is |
|---|---|
pub enum EdgeKind | The doc_edge.edge_kind value for each asserted-edge flavor this story extracts. |
EdgeKind :: fn as_str(self) -> & 'static str | — |
pub struct CandidateEdge | One asserted edge as extracted from a file's text -- not yet resolved against the DB's known corpus_doc/crate universe |
fn extract_markdown_links(repo_path : & str, text : & str) -> Vec <CandidateEdge> | Scan one tracked .md file's text for text (and alt, same shape) links |
fn extract_code_doc_citations(repo_path : & str, text : & str) -> Vec <CandidateEdge> | Scan one tracked .rs file's //-style comment lines for a .md-suffixed path token (US-3.96.4's "code -> doc citations (path-shaped comments)") |
fn extract_crate_refs(repo_path : & str, text : & str, crate_names : & BTreeSet <String>,) -> Vec <CandidateEdge> | Scan one tracked doc's full text for whole-word mentions of any name in crate_names (from docs/reference/capability-index.tsv) |
fn parse_capability_index_crates(tsv : & str) -> BTreeSet <String> | Parse the crate column (index 2) out of the generated capability-index TSV (# name kind crate layer path visibility, #-prefixed lines are comments) |
pub struct EdgesAssertReport | What one corpus edges --assert run did. |
pub enum EdgesAssertError | — |
async fn assert_edges(pool : & PgPool, repo_root : & std::path::Path,) -> Result <EdgesAssertReport, EdgesAssertError> | Run one corpus edges --assert pass end to end: walk the tracked tree, extract every candidate edge, resolve each against corpus_doc (and the capability-index crate list), and assert the result into doc_edge under one transaction |
async fn assert_edges_from_candidates(pool : & PgPool, candidates : Vec <CandidateEdge>,) -> Result <EdgesAssertReport, EdgesAssertError> | The DB-facing half of assert_edges, split out so it's testable against a scratch corpus_doc set without touching real repo content (extraction from real files is exercised separately, purely, by extract_markdown_links/extract_code_doc_citations/ extract_crate_refs's own unit tests) |
`governance`
| Item | What it is |
|---|---|
pub enum ClaimKind | How a gate heading describes its own enforcement |
ClaimKind :: fn implies_mechanism(self) -> bool | Whether this kind of claim asserts that something MECHANICAL enforces the gate |
ClaimKind :: fn as_str(self) -> & 'static str | — |
pub struct GateDecl | One gate as its heading declares it. |
fn parse_gate_headings(text : & str, source : & str) -> Vec <GateDecl> | Parse every gate heading in one document |
fn parse_gate_heading(line : & str, source : & str) -> Option <GateDecl> | One heading, or None if the line is not one. |
fn classify_claim(claim : & str) -> ClaimKind | What kind of claim a heading's parenthetical makes. |
fn hook_mentions_gate(hook_sources : & String, gate_name : & str) -> bool | Does anything in the hook scripts actually mention this gate? Weak evidence deliberately, and named that way |
`harness_event`
| Item | What it is |
|---|---|
pub const TOOL_INPUT_CAP_BYTES: usize | Gate 1.5.6 §5: tool_input capped at 64 KiB/row -- truncate + flag, never reject the row for it. |
pub const STDIN_PAYLOAD_CAP_BYTES: u64 | Gate 1.5.6 §1: "max-byte cap on every external stream" -- the whole stdin payload (not just tool_input), so a misbehaving/hostile hook process can't buffer unbounded memory before tool_input's own cap ever applies |
pub enum HarnessEventError | — |
fn resolve_run_id(explicit : Option <& str>, event : & HookEvent,) -> Result <String, HarnessEventError> | Resolve the run id for one ingested event (sprint 4.20): an explicit --run-id wins, otherwise the payload's own session_id |
fn refuse_if_raw_api_bodies_enabled() -> Result <(), HarnessEventError> | Gate 1.5.6 §5's loud-abort guard: never a silent skip |
fn cap_tool_input(value : & Value) ->(Value, bool, Option <i64>) | Cap a tool_input JSON value at TOOL_INPUT_CAP_BYTES: if its serialized form fits, return it unchanged (truncated = false, original_bytes = None); otherwise wrap a byte-truncated string representation (truncated = true, original_bytes = Some(<full size>)) -- the row is still written, never rejected for size |
pub struct HookEvent | One hook-sourced harness_event row, extracted best-effort from a generic JSON payload -- see the module doc comment for which fields are VERIFIED vs |
fn parse_hook_event(raw : & str) -> Result <HookEvent, HarnessEventError> | Parse one hook payload (already-read JSON text) into a HookEvent |
fn read_stdin_payload() -> Result <String, HarnessEventError> | Read exactly one JSON payload from stdin (Gate 1.5.6 §5: stdin only, never a network listener), capped at STDIN_PAYLOAD_CAP_BYTES (Gate 1.5.6 §1) |
async fn bind_execution_run(pool : & PgPool, run_id : & str,) -> Result <Option <Uuid>, HarnessEventError> | Bind a hook event to the execution it belongs to, when that is MECHANICALLY knowable (sprint 4.20) |
async fn insert_hook_event(pool : & PgPool, run_id : & str, event_kind : & str, event : & HookEvent,) -> Result <Uuid, HarnessEventError> | Insert one hook-sourced harness_event row (provenance_class stays its schema default, 'mechanical' -- a hook payload is an observation of what the harness invoked, never a model assertion) |
`harness_inventory`
| Item | What it is |
|---|---|
pub struct Row | One ratified row of docs/reference/harness-plane-registry.tsv. |
pub struct Finding | A defect in the seed, in the repository, or between them. |
pub struct Facts | What the repository says, gathered by main.rs and handed in. |
Facts :: fn target_name_count(& self, name : & str) -> usize | How many workspace packages define a target of this name |
Facts :: fn tier_prefixes(& self) -> BTreeSet <String> | The registered tier prefixes (tools-, operations-, ...) |
pub struct Pointers | The pointer texts AC10 requires to cite the generated report. |
pub const CLASS_PLANE_UNRATIFIED: & str | — |
pub const CLASS_CRATE_UNREGISTERED: & str | — |
pub const CLASS_CRATE_NOT_A_MEMBER: & str | — |
pub const CLASS_UNCLASSIFIED_HARNESS: & str | — |
pub const CLASS_STEP_TARGET_MISSING: & str | — |
pub const CLASS_DUPLICATE_CRATE: & str | — |
pub const CLASS_MALFORMED_ROW: & str | — |
pub const CLASS_DIAGRAM_SYNTAX_INVALID: & str | — |
pub const CLASS_REPORT_DRIFT: & str | — |
pub const CLASS_POINTER_MISSING: & str | — |
pub const REPORT_PATH: & str | The report this module writes, and the command that writes it |
pub const SEED_PATH: & str | — |
pub const ENTRY_COMMAND_MARKER: & str | The seed's own marker for "this entry point is a command, not an API" |
fn parse_registry(text : & str) ->(Vec <Row>, Vec <Finding>) | Parse the seed |
pub enum StepClaim | What a step claims to invoke |
fn step_claim(step : & str, tier_prefixes : & BTreeSet <String>, facts : & Facts, claimed : Option <& str>,) -> StepClaim | Read a step's claim about what it invokes |
fn check(rows : & Row, facts : & Facts, harness_named : & BTreeSet <String>) -> Vec <Finding> | AC1-AC4, AC9: the seed against the repository. |
fn check_pointers(p : & Pointers) -> Vec <Finding> | AC10: the generated report must be cited where a reader will meet it. |
fn check_drift(rendered : & str, on_disk : Option <& str>) -> Vec <Finding> | AC6: what is on disk against what --write would emit. |
fn render(rows : & Row, facts : & Facts) -> String | AC5: the report |
fn validate_mermaid(rendered : & str) -> Vec <Finding> | AC7, first half: every emitted mermaid block is structurally valid, checked in-process |
`history`
| Item | What it is |
|---|---|
pub const DEFAULT_SAFETY_CAP: usize | Hard cap on total (doc, commit) pairs a run will write without --force -- Gate 1.5.6 §1, no accidental full-history sweep. |
pub struct HistoryScope | What to backfill and how far |
pub enum ScopeError | — |
fn validate_scope(scope : & HistoryScope) -> Result <(), ScopeError> | Pure: at least one bound must be present |
pub enum HistoryError | — |
fn check_safety_cap(estimated : usize, cap : usize, force : bool) -> Result <(), HistoryError> | Pure: the estimate-vs-cap decision, separated from the estimate itself so it's testable without git or a database |
pub struct HistoryReport | What one backfill run did. |
async fn run_history_backfill(pool : & PgPool, repo_root : & Path, scope : & HistoryScope,) -> Result <HistoryReport, HistoryError> | Run one bounded backfill pass |
`ingest_run`
| Item | What it is |
|---|---|
pub struct IngestAttempt | What one ingest attempt did. |
IngestAttempt :: fn succeeded(& self) -> bool | Whether this attempt completed without an aborting failure. |
IngestAttempt :: fn metrics(& self) -> Vec <(String, f64)> | The metric rows this attempt writes |
IngestAttempt :: fn provenance(& self) -> String | One line carrying the outcome and, when it failed, the reason — this is what lands in provenance, so the row explains itself. |
fn run_id(mode : & str, attempt : u32) -> String | The run id ingest attempts are recorded under, per attempt, so retries accumulate rather than overwrite. |
async fn record(pool : & sqlx::PgPool, attempt : & IngestAttempt) -> Result <usize, sqlx::Error> | Record one attempt |
`lexicon_store`
| Item | What it is |
|---|---|
pub const RENDERER_VERSION: & str | The renderer's own version, recorded with every export: two runs of different renderers over identical rows may produce different bytes, and the manifest has to say which one wrote them. |
pub struct RegistryFile | One registry file: where it goes, what slice of the vocabulary it carries, its header prose, and its place in the hashed order. |
pub struct Rendering | A rendered file, before anything has been written. |
pub enum ExportRefusal | Why an export refused |
ExportRefusal :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
async fn load_registry_files(pool : & PgPool) -> Result <Vec <RegistryFile>, ExportRefusal> | The files to render, in the order their bytes are hashed |
async fn load_terms(pool : & PgPool) -> Result <Vec <TermRow>, ExportRefusal> | Every concept, with its successor resolved to that successor's own label -- the files name terms, not identities |
async fn load_labels(pool : & PgPool) -> Result <Vec <LabelRow>, ExportRefusal> | # Errors The database. |
async fn load_broader(pool : & PgPool) -> Result <Vec <BroaderRow>, ExportRefusal> | # Errors The database. |
fn render_all(files : & RegistryFile, terms : & TermRow, labels : & LabelRow, broader : & BroaderRow,) -> Result <Vec <Rendering>, ExportRefusal> | Render every registry file from the rows, in hash order |
fn version_of(renderings : & Rendering) -> String | The version these bytes name |
fn resolve_under_root(root : & Path, path : & str) -> Result <PathBuf, ExportRefusal> | Resolve a registry path under the repository root, refusing anything that could write outside it |
fn check(root : & Path, renderings : & Rendering) -> Result <Vec <LineDiff>, ExportRefusal> | What --check found: nothing, or the lines that differ |
async fn register(pool : & PgPool, version : & str, renderings : & Rendering, terms : & TermRow,) -> Result <(), ExportRefusal> | Register the snapshot: the registry row, one governed_term per concept, and the manifest — all in one transaction, before any file is touched |
async fn publish(pool : & PgPool, root : & Path, version : & str, renderings : & Rendering,) -> Result <(), ExportRefusal> | Write the renderings into the worktree by staged rename, then record the version as published |
pub enum Admission | How an imported term arrives. |
pub struct ImportReport | What an import did. |
pub enum Origin | How one seed row is admitted: the term's status and provenance, and the request's status and attribution |
Origin :: fn authority_key(& self) -> String | The string the authority row holds and the guard compares. |
Origin :: fn provenance_prefix(& self) -> String | The prefix term.provenance carries, before the batch. |
Origin :: fn evidence_key(& self) ->(& 'static str, String) | What the ratification request records as the evidence of its origin. |
async fn import_seed(pool : & PgPool, root : & Path, path : & str, admission : & Admission, lexicon_version_for_requests : & str, take_over : bool,) -> Result <ImportReport, ExportRefusal> | Import a term seed file into the authoring plane |
async fn add_term(pool : & PgPool, row : & lexicon_export::SeedRow, admission : & Admission, lexicon_version_for_requests : & str, by : & str, take_over : bool,) -> Result <ImportReport, ExportRefusal> | Add ONE term to the authoring plane from its fields, with no file |
async fn backfill_rendering(pool : & PgPool, root : & Path, path : & str, slice : & str,) -> Result <usize, ExportRefusal> | Import an EXISTING registry rendering into the authoring plane, so the rows say what the file already says and the round trip can be empty |
fn header_of(file : & str) -> String | The leading comment block of a registry file: the prose an operator wrote above the rows |
async fn adopt_file(pool : & PgPool, root : & Path, path : & str, slice : & str, ordinal : i32,) -> Result <String, ExportRefusal> | Register an existing registry file: its header is read from the file itself, its slice and its place in the hash order are given |
pub struct UngovernedNoun | One word the prose uses that the vocabulary does not govern, with how often and where it was first seen |
async fn ungoverned_nouns(pool : & PgPool, min_count : usize,) -> Result <Vec <UngovernedNoun>, ExportRefusal> | Run the prose census over the corpus's own documents and report the phrases no ratified term names |
pub struct Unattested | A ratified term the tree never uses |
async fn unattested_terms(pool : & PgPool) -> Result <Vec <Unattested>, ExportRefusal> | Ratified terms with no occurrence anywhere in the ingested corpus -- neither in a document nor in code |
pub struct SenseSite | One line where a governed word appears, and what sense it was ruled to carry there. |
async fn collect_sense_sites(pool : & PgPool, term : & str) -> Result <usize, ExportRefusal> | Collect every occurrence of a term from the CORPUS and record it as an undecided site |
async fn emit_sense_shard(pool : & PgPool, term : & str, cap : i64,) -> Result <(String, String), ExportRefusal> | Emit the undecided sites as a SHARD: registered in shard_provenance, stored in shard_payload under the hash of its own bytes, and traced to the corpus_doc_version every line came from through shard_source |
async fn undecided_sites(pool : & PgPool, term : & str, cap : i64,) -> Result <Vec <SenseSite>, ExportRefusal> | The undecided sites for a term, in a deterministic order, capped |
async fn admit_senses(pool : & PgPool, term : & str, sites : & SenseSite, decided_by : & str, shard_hash : & str, run_id : Option <uuid::Uuid>,) -> Result <usize, ExportRefusal> | Admit classified sites |
pub struct AbbreviatedIdentifier | An abbreviated identifier in a live document, and how often it appears. |
async fn abbreviated_identifiers(pool : & PgPool,) -> Result <Vec <AbbreviatedIdentifier>, ExportRefusal> | Identifiers written as a letter abbreviation rather than the spelled kind (operator ruling, 2026-09-05: "we should spell them out") |
pub struct UngovernedIdentifier | A schema identifier that is not a ratified term. |
async fn ungoverned_identifiers(pool : & PgPool, ignore : & & str,) -> Result <Vec <UngovernedIdentifier>, ExportRefusal> | Every table and column name in the live schema whose words the vocabulary does not govern (sprint 4.47 U1d, the schema half) |
pub struct BatchRuling | What a ruling did. |
async fn retire_term(pool : & PgPool, term : & str, prefer : & str, ruled_by : & str, lexicon_version : & str,) -> Result <(), ExportRefusal> | Retire a term: record the ruling that retires it, and the successor to write instead |
async fn rule_batch(pool : & PgPool, batch : & str, ruled_by : & str,) -> Result <BatchRuling, ExportRefusal> | Rule one batch, whole |
`mirror`
| Item | What it is |
|---|---|
pub enum MirrorError | — |
pub struct MirrorReport | What one mirror run observed. |
async fn run_mirror_crates(pool : & PgPool, workspace_root : & Path,) -> Result <MirrorReport, MirrorError> | Mirror every workspace crate (as repo_artifact(artifact_kind='crate')) and every workspace-internal, non-optional, Normal-kind dependency edge between them (as artifact_relation(relation_kind='depends-on')) into the corpus DB |
async fn run_mirror_doc_links(pool : & PgPool, links : & (String, String),) -> Result <MirrorReport, MirrorError> | Mirror markdown documents and their link edges (sprint 4.8 follow-up: the doc-audit found artifact_relation held zero doc-to-doc edges against 674 scanned ones) |
async fn run_mirror_code_citations(pool : & PgPool, cites : & (String, String),) -> Result <MirrorReport, MirrorError> | Mirror code-citation edges (sprint 4.10 Phase C, Q3-refutation lesson: two ratified doc moves were refuted only mid-execution by code consumers the doc graph could not see) |
async fn run_mirror_doc_sections(pool : & PgPool, docs : & (String, Vec <(String, String)>),) -> Result <MirrorReport, MirrorError> | Mirror document sections (sprint 4.10 AC4): each section becomes repo_artifact(artifact_kind='doc_section', external_key='<path>#<slug>') with a contains relation from its parent doc artifact |
`ontology`
| Item | What it is |
|---|---|
pub const VOCABULARY_VERSION: & str | The vocabulary version this ingest pass classifies against |
pub const UNCLASSIFIED: & str | The stored value for a crate with no operator override -- a legal answer, never an error (§7). |
pub struct ClassificationOverride | One crate -> role operator override, as written in crate-classifications.tsv. |
fn parse_vocabulary(tsv : & str) -> BTreeMap <String, BTreeSet <String>> | Parse vocabulary_version\trole rows (#-prefixed and blank lines skipped) into vocabulary_version -> allowed roles |
fn parse_classifications(tsv : & str, file_path : & str) -> Vec <ClassificationOverride> | Parse crate\tarchitectural_role rows (#-prefixed and blank lines skipped) into per-crate overrides; provenance is <file_path>:<line>, 1-indexed |
pub struct OntologyIngestReport | What one corpus ingest --ontology run did. |
pub enum OntologyIngestError | — |
async fn run_ontology_ingest(pool : & PgPool, repo_root : & Path, run_id : & str,) -> Result <OntologyIngestReport, OntologyIngestError> | Run one corpus ingest --ontology pass: every crate in the capability-index gets a crate_classification row -- an operator override if crate-classifications.tsv names one (validated against the vocabulary), unclassified otherwise |
`oracle`
| Item | What it is |
|---|---|
pub enum Verdict | What one graded function's counts amount to |
Verdict :: fn admits_transformation(self) -> bool | Whether this verdict admits a transformation |
Verdict :: fn admits(graded : Option <Self>) -> bool | Whether an OPTIONAL verdict admits a transformation, where None is "never graded" |
Verdict :: fn reason(self) -> String | The sentence a reader needs, in the shape AC4 asks for: what is missing, never how close it came. |
Verdict :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result | — |
fn verdict(mutants_total : u32, killed : u32, survived : u32, uncompilable : u32) -> Verdict | Grade one function from its four cargo-mutants counts |
`oracle_store`
| Item | What it is |
|---|---|
pub struct Counts | One mutation run's four counts, plus what produced them |
Counts :: fn verdict(& self) -> Verdict | This run's verdict, without a database round trip. |
async fn record(pool : & PgPool, repo_commit : & str, fn_key : & str, counts : & Counts,) -> anyhow::Result <()> | Store one function's grade, replacing any earlier grade at the same commit |
async fn grade(pool : & PgPool, repo_commit : & str, fn_key : & str,) -> anyhow::Result <Option <Verdict>> | One function's stored verdict, or None when it has never been graded at this commit |
async fn admits_transformation(pool : & PgPool, repo_commit : & str, fn_key : & str,) -> anyhow::Result <bool> | The interlock |
async fn lacking_passing_grade(pool : & PgPool, repo_commit : & str, fn_keys : & String,) -> anyhow::Result <Vec <String>> | Which of these functions lack a passing grade, named and sorted |
fn missing_from(requested : & String, passing : & (String,)) -> Vec <String> | The set difference, extracted from lacking_passing_grade so it can be graded without a database |
async fn graded_count(pool : & PgPool, repo_commit : & str) -> anyhow::Result <i64> | How many functions carry a grade at this commit, passing or not |
`pilot`
| Item | What it is |
|---|---|
pub struct Payload | One unit of work handed to one panelist. |
pub const ANSWER_SCHEMA: & str | The answer schema both arms fill |
fn arm_a(crate_name : & str, api : & CrateApi) -> Payload | Render one crate as arm A sees it: everything at once. |
fn arm_b(crate_name : & str, api : & CrateApi) -> Vec <Payload> | Render one crate as arm B sees it: one payload per type-cohesive group. |
pub struct ArmCost | What the two arms cost before a model is involved: the arithmetic that decides whether the comparison is even affordable. |
fn arm_cost(payloads : & Payload) -> ArmCost | — |
pub struct Coverage | Capability coverage: the share of the public surface some capability claims |
Coverage :: fn rate(& self) -> f64 | — |
fn normalise_symbol(s : & str) -> String | Reduce a claimed or real symbol to one comparable key |
fn coverage(surface : & String, claimed : & Vec <String>) -> Coverage | Score claimed surfaces against the real one |
pub struct ManifestRow | A payload manifest row: everything the orchestrator needs to hand one payload to one panelist, and everything the scorer needs to join the answer back |
fn emit_crate(crate_name : & str, crate_dir : & std::path::Path, lexicon_tsv : & str, lexicon_version : & str, out : & std::path::Path,) -> anyhow::Result <Vec <ManifestRow>> | Emit every payload for one crate into out/<crate>/, returning manifest rows |
pub struct Answer | One panelist's parsed answer for one payload. |
pub struct Claim | — |
fn unwrap_answers(root : & serde_json::Value,) ->(std::collections::BTreeMap <String, Answer>, usize) | Pull the answer map out of whatever envelope it arrived in |
pub struct CellScore | Scored result for one (crate, arm, model) cell. |
fn score_cell(crate_name : & str, arm : & str, model : & str, surface : & String, answers : & (ManifestRow, Answer),) -> CellScore | Score every answer for one crate under one (arm, model): pool the claims, run coverage once against the real surface. |
`product_dimension`
| Item | What it is |
|---|---|
pub enum ProductError | Refusal reasons a caller reports verbatim -- never a raw sqlx::Error leaking a query shape to a CLI user. |
ProductError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
ProductError :: fn from(e : sqlx::Error) -> Self | — |
pub struct BulkMatch | One product-assign bulk match, with the disposition it would get (or got, if applied) -- the plan and the apply pass share this shape so dry-run output and the write are provably the same computation. |
async fn create_product(pool : & PgPool, external_key : & str, name : & str,) -> Result <Uuid, ProductError> | product-new: create a product-kind repo_artifact row |
async fn assign_single(pool : & PgPool, external_key : & str, product_slug : & str,) -> Result <(), ProductError> | product-assign single mode: one artifact, one product. |
async fn incorporate(pool : & PgPool, product_slug : & str, incorporates_slug : & str,) -> Result <(), ProductError> | product-incorporate: record that one product's scope includes another's (e.g |
async fn plan_bulk_assign(pool : & PgPool, path_prefix : & str, product_slug : & str,) -> Result <Vec <BulkMatch>, ProductError> | product-assign bulk mode, dry-run: match repo_path against the (already-escaped) prefix and categorize every match |
async fn apply_bulk_assign(pool : & PgPool, path_prefix : & str, product_slug : & str,) -> Result <Vec <BulkMatch>, ProductError> | product-assign bulk mode, --apply: plan, then write a belongs_to_product edge for every match (idempotent — an AlreadyTarget match's write is a no-op via the unique constraint). |
async fn product_sequence(pool : & PgPool, product_slug : & str,) -> Result <Vec <(Uuid, i64)>, ProductError> | One row of the product_member_sequence view: which artifact, and its dense per-product sequence number |
async fn products_of_work_item(pool : & PgPool, work_item_id : Uuid,) -> Result <Vec <String>, sqlx::Error> | A work_item/story's product(s), resolved transitively through work_item_scope (the artifact(s) it already reads/writes) -> belongs_to_product -> product -- never a direct column on work_item/story (acceptance-criterion 4.65.3) |
fn escape_like_prefix(prefix : & str) -> String | Escape %, _, and the backslash escape character itself so a caller-supplied path prefix is matched LITERALLY by LIKE <escaped>% ESCAPE '\' -- a real _ or % in a repo_path must never be read as a wildcard (Gate 1.5, 2026-09-07). |
pub enum MatchDisposition | How a bulk product-assign match relates to the target product, given the products it already carries |
fn categorize_match(existing_products : & String, target : & str) -> MatchDisposition | Pure classification: no DB access, so a bulk preview and its --apply pass compute the identical disposition from the identical inputs. |
`reading_cmd`
| Item | What it is |
|---|---|
pub struct StagedTurn | One staged turn, as read from the wiki rows. |
fn usage_of(meta : & serde_json::Value) -> Option <i64>; 4 | The four token counts out of a turn's meta, in column order (tokens_in, tokens_out, cache_read, cache_write). |
pub struct StageReport | What stage did. |
pub enum Staged | What staging one turn did. |
async fn stage_turn(corpus : & PgPool, turn : & StagedTurn) -> Result <Staged, ReadingError> | Upsert one turn |
async fn relabel_readings(corpus : & PgPool) -> Result <u64, ReadingError> | Readings that stand on a turn whose model became known take that model |
pub enum ReadingError | Errors, each naming the step. |
fn model_of(meta : & serde_json::Value) -> String | The model a turn's meta names, or unknown — never guessed (acceptance-criterion 4.74.2; the ingester carries it from task 7a on). |
async fn stage(corpus : & PgPool, limit : Option <i64>) -> Result <StageReport, ReadingError> | Stage the screened turns |
pub struct CensusCounts | What the census returned, read back from the rows. |
async fn census(corpus : & PgPool, rule_version : & str,) -> Result <(String, CensusCounts), ReadingError> | Run the census in the database for the current lexicon version |
pub struct Unmeasured | A term with no reading for a model that ran in the last 30 days. |
pub struct CheckReport | What the check found: the unmeasured pairs, and the routing labels it could not resolve to a model (reported, never guessed — ruling 2026-09-10). |
async fn check(corpus : & PgPool) -> Result <CheckReport, ReadingError> | acceptance-criterion 4.74.1: every ratified term × every model that ran in the last 30 days, minus the pairs that have a reading |
async fn unmeasured(corpus : & PgPool) -> Result <Vec <Unmeasured>, ReadingError> | The unmeasured pairs alone — the older name, kept for callers that only want the list |
async fn report(corpus : & PgPool, series : & str,) -> Result <Vec <operations_control_plane::reading::TermRank>, ReadingError> | acceptance-criterion 4.74.6: rank from the rows, record the ranking in the series, print nothing that was not read |
pub struct AdjudicateOpts | What adjudicate was asked to do (round 2, 2026-09-10: indeterminate term_reading → hashed shard → execution_run → verdict on the same row). |
pub struct AdjudicateReport | What one invocation did, read back from what it wrote. |
fn observed_model(envelope : & str) -> Option <String> | The model the worker envelope says answered: the model the usage walker finds, else the sole modelUsage key — the CLI's envelope names the model there, not at the top level |
async fn adjudicate(corpus : & PgPool, opts : & AdjudicateOpts, answer : & dyn Fn(& str) -> Result <String, String>,) -> Result <AdjudicateReport, ReadingError> | Adjudicate indeterminate readings: per term, per batch, one shard, one prompt, one run, one call through answer (the worker, or a test's closure), the verdicts on the rows they are about |
`readme`
| Item | What it is |
|---|---|
pub const RENDERER_SCHEMA: & str | Bumped when the rendered shape changes |
pub const GRAPH_NODE_CEILING: usize | Above this many nodes a graph stops being read and starts being decoration, so it condenses to counts |
pub struct Dep | One dependency edge, with the category kept distinct |
pub struct Target | One Cargo target: what the crate actually builds. |
pub struct Test | One test, by name |
pub struct Derived | Mechanically derived facts, recomputed at every render |
fn render(d : & Derived) -> String | Render the whole README |
fn derive(package : & cargo_metadata::Package, crate_dir : & std::path::Path, tier : & str, role : & str, lexicon_tsv : & str, reverse_deps : & String, siblings : & String, aliases : & String, is_workspace_member : & dyn Fn(& str) -> bool, dep_tier : & dyn Fn(& str) -> Option <String>, consumer_hits : & dyn Fn(& str) -> usize,) -> Derived | Build the derived half for one crate: everything recomputable, nothing stored |
pub struct TierSummary | One tier, aggregated from its crates' own records. |
pub struct CrateSummary | One crate as the root sees it: enough to locate and size it, and a link to the crate README that holds the rest. |
pub struct WorkspaceDocumentation | Everything the root README renders, aggregated from the per-crate records. |
pub const TIER_CRATE_GRAPH_CEILING: usize | A tier graph is always drawn: eleven nodes is legible and it is the root's whole point |
fn render_root(w : & WorkspaceDocumentation) -> String | Render the repository root README. |
pub const DRAFTS_DIR: & str | The staging area tools-script-scan --convert writes model-drafted Rust ports into |
fn is_draft_path(crate_path : & str) -> bool | Whether a crate path is a draft, and so gets no README |
pub const ROOT_README_NAME: & str | The repository root README's name in a scope decision |
pub struct UnknownCrate | A --crate name that is not in the tier registry |
UnknownCrate :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
pub struct CrateFilter | Which crates a README run writes |
CrateFilter :: fn everything() -> Self | Every crate, and the root: the unscoped run. |
CrateFilter :: fn resolve(requested : & String, registered : & BTreeSet <String>,) -> Result <Self, UnknownCrate> | Resolve requested names against the tier registry |
CrateFilter :: fn resolve_with_root(requested : & String, include_root : bool, registered : & BTreeSet <String>,) -> Result <Self, UnknownCrate> | Resolve requested names, optionally scoping the repository root README in alongside them |
CrateFilter :: fn is_scoped(& self) -> bool | Whether a scope was asked for at all. |
CrateFilter :: fn selects(& self, crate_name : & str) -> bool | The one scope decision |
CrateFilter :: fn names(& self) -> impl Iterator <Item = & str> | The requested names, so a caller can report one that matched no member. |
fn write_if_selected(filter : & CrateFilter, crate_name : & str, path : & std::path::Path, rendered : & str, write : bool,) -> std::io::Result <bool> | Write rendered to path when the filter selects crate_name |
fn attribute_generated(path : & str, md : & str, lexicon_tsv : & str) -> String | Attribute governed vocabulary the generated file is obliged to quote |
`recall`
| Item | What it is |
|---|---|
pub struct RecallHit | One recall result: a doc reached either directly (a vector-search seed, hop == 0, score set) or through the graph (hop >= 1, score None -- the graph walk carries no similarity score of its own) |
pub enum RecallError | — |
async fn recall <E : KnowledgeEmbedder + ? Sized>(pool : & PgPool, embedder : & E, tenant : Uuid, query : & str, hops : usize, limit : usize,) -> Result <Vec <RecallHit>, RecallError> | Run one recall: vector-search seeds (top limit), then breadth-first out to hops levels over asserted doc_edge (bidirectional) + the query-time shared-symbol join |
`session_scope`
| Item | What it is |
|---|---|
async fn session_owned_paths(pool : & PgPool, agent_id : & str,) -> Result <Vec <String>, sqlx::Error> | The absolute file paths a session wrote, distinct, from harness_event |
fn to_repo_relative(abs : & str, repo_root : & str) -> Option <String> | Convert an absolute path to one relative to repo_root, or None if it is outside the repository (a session may edit files elsewhere; those are never staged here, so they are not ownership over any repo path) |
fn unowned_staged(owned : & BTreeSet <String>, staged : & String) -> Vec <String> | The rule |
async fn work_item_touched_paths(pool : & PgPool, work_item_id : Uuid,) -> Result <Vec <String>, sqlx::Error> | The absolute file paths a work item's OWN executions wrote, distinct, from harness_event — B-107's derivation source |
fn partition_resolved <'a>(touched : & 'a BTreeSet <String>, resolved : & HashMap <String, Uuid>,) ->(Vec <(& 'a str, Uuid)>, Vec <& 'a str>) | Splits touched repo-relative paths into those a repo_artifact lookup already resolved (resolved, path -> artifact id) and those it didn't — pure, so the split is tested without a database; work_item_touched_paths's caller does the actual per-path repo_artifact lookup (unmirrored paths are common and not an error: a file touched before corpus mirror ran for it simply can't resolve yet). |
`staleness`
| Item | What it is |
|---|---|
pub enum Staleness | How the corpus stands against the working tree. |
Staleness :: fn is_current(& self) -> bool | Whether the corpus can be trusted to describe the current tree. |
Staleness :: fn behind_commits(& self) -> Option <u64> | The number a gate would threshold on |
Staleness :: fn summary(& self) -> String | One line for a human or a hook. |
fn verdict(head : & str, recorded : Option <& str>, distance : Option <u64>) -> Staleness | Decide the verdict from the three facts a caller can gather: the tree's HEAD, the newest commit the corpus recorded, and the ancestor distance git reports between them |
fn verdict_with_tree(head : & str, recorded : Option <& str>, distance : Option <u64>, same_tree : bool,) -> Staleness | verdict with one more fact: whether HEAD's tree equals the recorded commit's tree |
fn nearest_recorded(candidates : & (String, Option <u64>)) -> Option <String> | Pick the recorded commit to measure against: the candidate NEAREST HEAD by ancestry (smallest rev-list --count <c>..HEAD), never the most recently inserted row — a history backfill inserts old commits last (B-085) |
pub const METRIC: & str | The metric name this verdict is recorded under, so a gate and a report read the same series. |
pub const RUN_ID: & str | The run id the staleness series is recorded under |
async fn record(pool : & sqlx::PgPool, verdict : & Staleness) -> Result <bool, sqlx::Error> | Record the verdict as a measurement |
async fn head_is_recorded(pool : & sqlx::PgPool, head : & str) -> Result <bool, sqlx::Error> | Whether any ingested document is stamped with head itself — the fast path: some row was written while HEAD was checked out, so the recorded commit is HEAD and no ancestry scoring is needed |
async fn recorded_commit_candidates(pool : & sqlx::PgPool) -> Result <Vec <String>, sqlx::Error> | EVERY distinct commit ingested documents were stamped with, most recently recorded first |
async fn newest_recorded_commit(pool : & sqlx::PgPool) -> Result <Option <String>, sqlx::Error> | The newest commit any ingested document was stamped with — by insertion time, which a history backfill can move backwards (B-085) |
`story_author`
| Item | What it is |
|---|---|
pub struct ArgRefusal | Why an argument could not be turned into a row. |
ArgRefusal :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
fn need_kind(given : & str) -> Result <NeedKind, ArgRefusal> | need or want, never inferred |
fn need_path(given : & str) -> Result <NeedPath, ArgRefusal> | How the need reached us |
fn priority(given : & str) -> Result <Priority, ArgRefusal> | MoSCoW rank |
fn disposition(given : & str) -> Result <Disposition, ArgRefusal> | What a finding decided |
`story_compile_cmd`
| Item | What it is |
|---|---|
async fn run_compile_story(doc : & Path, apply : bool, amend : bool, json : bool) -> ExitCode | Compile the doc at doc (repo-relative or absolute-inside-repo) |
`story_render_cmd`
| Item | What it is |
|---|---|
async fn run_story_render(sprint_id : & str, html : Option <& Path>, md : Option <& Path>, json : bool,) -> ExitCode | Render the story for sprint_id |
`study`
| Item | What it is |
|---|---|
pub struct Vote | One panelist's answer for one unit. |
pub struct Agreement | Agreement over a closed category set. |
fn fleiss_kappa(votes : & Vote) -> Option <f64> | Fleiss' κ over units × categories |
fn agreement(votes : & Vote) -> Agreement | Full agreement, modal agreement and κ in one pass. |
pub struct Consensus | The consensus answer for one unit: its modal category and the share holding it, which S1 stored as crate_classification.confidence. |
fn consensus(votes : & Vote) -> Vec <Consensus> | Modal category per unit, with the tie flagged rather than broken. |
fn jaccard(a : & String, b : & String) -> f64 | Jaccard similarity of two sets: `\ |
pub struct OpenSetAgreement | Open-set agreement across panelists, with the confound S5 named. |
fn mean_pairwise_jaccard(derivations : & Vec <String>) -> OpenSetAgreement | Mean Jaccard over every unordered pair of derivations for one unit. |
pub struct SampleUnit | One unit available for sampling, with the facts its strata are cut on. |
fn stratified_sample(population : & SampleUnit, target : usize) -> Vec <String> | Deterministic stratified sample |
`symbol_ingest`
| Item | What it is |
|---|---|
fn parse_capability_index(tsv : & str) -> Result <Vec <SymbolRow>, String> | Parse docs/reference/capability-index.tsv (# comments and blank lines skipped) into typed rows |
`taxonomy`
| Item | What it is |
|---|---|
pub struct Unclassified | One crate with no classification row at the current vocabulary. |
pub struct GroupProposal | A proposed group for a crate, with the evidence that produced it. |
fn parse_layer_registry(layers_toml : & str) -> BTreeMap <String, String> | Parse docs/architecture/layers.toml into crate -> layer, reading ONLY the crate_layer section |
fn parse_baseline(text : & str) -> BTreeSet <String> | Parse a shrink-only baseline: one crate name per line, # comments and blanks ignored |
fn coverage_gaps(registered : & BTreeMap <String, String>, classified : & BTreeSet <String>, baseline : & BTreeSet <String>,) -> Vec <Unclassified> | Which registered crates have no classification, and which of those are new (absent from the baseline) |
fn stem(crate_name : & str, layer : & str) -> String | The name stem: the crate name with its layer prefix removed, then split at the first hyphen |
pub const MIN_GROUP: usize | Minimum crates sharing a stem before it is proposed as a group |
fn propose_groups(registered : & BTreeMap <String, String>, layer : & str, deps : & BTreeMap <String, BTreeSet <String>>,) -> Vec <GroupProposal> | Propose groups for one layer's crates |
fn shared_dependencies(members : & String, deps : & BTreeMap <String, BTreeSet <String>>,) -> BTreeSet <String> | Dependencies every member of members has in common — the corroborating signal |
`term_census`
| Item | What it is |
|---|---|
pub enum RegistryStatus | Where a term stands against the registry (lexicon + seed TSVs + ratified tier terms) |
pub struct CensusEntry | — |
fn extract_backticked(doc_path : & str, text : & str) -> Vec <(String, String)> | Extract backticked terms from one document's text: like_this or like-this or two words — lowercased, deduped per line kept verbatim as a site |
fn normalize_phrase(raw : & str) -> String | Strip a leading article and normalize spacing and case |
fn is_candidate_phrase(phrase : & str) -> bool | Whether a normalized phrase can be a governed term at all: one to four words, letters and hyphens only, and not made entirely of ordinary words. |
fn extract_prose_nouns(doc_path : & str, text : & str) -> Vec <(String, String)> | Extract candidate terms from PROSE, which is where this workspace's process vocabulary actually lives (sprint 4.47 amendment 13: sprint, unit, oracle, guard, seat and round are written in plain sentences, so a backtick census cannot see any of them) |
fn names_term(candidate : & str, term : & str) -> bool | Whether a candidate phrase names a governed term |
fn assemble(pairs : Vec <(String, String)>, ratified : & String, banned : & String, excluded : & String, site_cap : usize,) -> Vec <CensusEntry> | Fold extracted (term, site) pairs into census entries, joined against the registry |
fn to_tsv(entries : & CensusEntry) -> String | Render the census as the TSV artifact (term · status · count · first site). |
fn to_report(entries : & CensusEntry, date : & str, lexicon_terms : & String) -> String | Render the census as a readable reference document |
fn rival_packages(entries : & CensusEntry, top_n : usize) -> serde_json::Value | Emit rival-finding Judgment packages (tools-packet-compile's packets.json shape, composed as JSON here to avoid a dependency cycle) for the top-N unregistered terms by usage count |
`test_ingest`
| Item | What it is |
|---|---|
pub enum Kind | What kind of test this is, decided by where it lives |
Kind :: fn as_str(self) -> & 'static str | — |
fn kind_of(repo_relative : & str) -> Kind | Classify by path, then by filename convention |
fn crate_dir_of(repo_relative : & str) -> Option <String> | The crate a source file belongs to: the directory holding its Cargo.toml, named by the package rather than the folder |
fn test_path(repo_relative : & str, crate_dir : & str, name : & str) -> String | The test's selector: its module path within the crate plus its name |
fn walkable(path : & Path) -> bool | Should this path be walked at all? Generated and vendored trees hold tests that are not this repository's to register, and a row for one would make an inventory claim about code nobody here wrote. |
pub struct Registered | One row ready to be written. |
pub struct Report | What an ingest did. |
fn scan(root : & Path) -> std::io::Result <(Vec <Registered>, Report)> | Every test under root, classified, without touching a database |
`vocabulary_panel::agreement`
| Item | What it is |
|---|---|
pub struct Vote | One panelist's classification of one crate, within one cell of the study design. |
pub enum Kappa | Fleiss' kappa is undefined when expected agreement is 1 -- every rater used a single category across every item |
pub struct CellMetrics | — |
pub enum AgreementError | — |
fn parse_votes_tsv(text : & str) -> Result <Vec <Vote>, AgreementError> | Parse a published four-column vote TSV -- the S1/S1b shape, which predates the confidence column |
fn cell_metrics(votes : & Vote) -> Result <BTreeMap <String, CellMetrics>, AgreementError> | Metrics per cell, keyed by cell name. |
`vocabulary_panel::derive`
| Item | What it is |
|---|---|
pub enum RuleStatus | Whether a rule has been demonstrated or only proposed |
RuleStatus :: fn as_str(self) -> & 'static str | — |
pub const SAMPLES_TO_RATIFY: usize | Samples required before a nominated rule may be ratified: 1 - 0.05^(1/29) < 0.10. |
fn exception_rate_bound(clean : usize) -> f64 | The 95% upper bound on a tier's exception rate given clean crates and no counterexample |
pub struct Rule | One derivation rule: every crate registered in tier holds role. |
pub enum RuleError | — |
pub struct DeriveReport | Why a crate did not get a derived role |
fn parse_rules(tsv : & str, allowed_roles : & String) -> Result <Vec <Rule>, RuleError> | Parse the rule TSV |
fn parse_crate_layers(toml : & str) -> BTreeMap <String, String> | crate_layer from layers.toml: crate name -> tier |
fn derive_roles(crate_layers : & BTreeMap <String, String>, rules : & Rule,) ->(BTreeMap <String,(String, Rule)>, DeriveReport) | The derived role for each crate the rules cover |
fn provenance(rule : & Rule, registry_hash : & str) -> String | The provenance string a derived row carries: the rule that produced it, and a hash of the registry that rule read |
fn registry_hash(toml : & str) -> String | Short content hash of the registry, so provenance names the input state. |
async fn write_derived(pool : & sqlx::PgPool, derived : & BTreeMap <String,(String, Rule)>, registry_hash : & str,) -> Result <usize, sqlx::Error> | Write the derived plane |
`vocabulary_panel::facts`
| Item | What it is |
|---|---|
pub const TOP_DEPS: usize | How many dependencies a payload carries |
pub enum FactsError | — |
FactsError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
FactsError :: fn from(e : cargo_metadata::Error) -> Self | — |
pub struct CrateStructure | What a crate looks like from outside: what it offers, and who is holding on to it |
pub const LISTED: usize | How many names a structural payload lists before falling back to the count |
fn surface_from_capability_index(tsv : & str) -> BTreeMap <String,(Vec <String>, usize)> | Public items per crate, from the generated capability index |
fn invert_dependencies(outbound : & BTreeMap <String, Vec <String>>,) -> BTreeMap <String, Vec <String>> | Invert a dependency map into inbound edges. |
fn description_from_lib_doc(source : & str) -> String | The first //! block of a lib.rs, joined into one line |
fn workspace_dependency_map(workspace_root : & Path,) -> Result <BTreeMap <String, Vec <String>>, FactsError> | Every workspace crate's full internal dependency list, untruncated. |
fn workspace_structure(workspace_root : & Path,) -> Result <BTreeMap <String, CrateStructure>, FactsError> | Structure for every workspace crate: inbound dependents (from the manifests, inverted) and public surface (from the generated capability index) |
fn workspace_facts(workspace_root : & Path) -> Result <Vec <CrateFacts>, FactsError> | Every workspace crate, as the facts a panelist may see |
`vocabulary_panel::run`
| Item | What it is |
|---|---|
pub enum RunError | — |
RunError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
pub struct SampleReport | — |
pub const VOTE_HEADER: & str | The header every vote file must carry |
fn render_payloads(sample : & CrateFacts) ->(String, String) | Render the prose-arm and typed-arm payloads for a sample. |
fn run_sample(workspace_root : & Path, size : usize, out_dir : & Path, stamp : & str, only : Option <& String>,) -> Result <SampleReport, RunError> | Draw the sample and write three files: the two payloads and the crate list. |
pub struct ScoreReport | — |
pub struct CellSummary | — |
pub struct Scored | Everything one scoring pass produces, before anything is stored. |
fn score(vote_text : & str, threshold : f64, no_confidence : bool) -> Result <Scored, RunError> | Score a completed vote file |
async fn run_score(pool : Option <& sqlx::PgPool>, vote_path : Option <& PathBuf>, threshold : f64, no_confidence : bool, run_id : Option <& str>, store_cell : Option <& str>, allowed_roles : & String,) -> Result <ScoreReport, RunError> | Score, then optionally store |
`vocabulary_panel::sample`
| Item | What it is |
|---|---|
pub struct CrateFacts | — |
CrateFacts :: fn stratum(& self) -> String | The stratum a crate belongs to: its layer directory |
fn stratified_sample(crates : & CrateFacts, n : usize) -> Vec <CrateFacts> | Deterministic stratified every-kth sample |
fn select_named <'a>(crates : & 'a CrateFacts, names : & String,) ->(Vec <CrateFacts>, Vec <String>) | The named crates, in the order the names were given, and the names that matched nothing |
fn payload_prose(facts : & CrateFacts) -> String | The prose-arm payload: one paragraph per crate. |
fn payload_typed(facts : & CrateFacts) -> String | The typed-arm payload: named fields, one per line. |
fn payload_structural(facts : & CrateFacts, structure : & super::facts::CrateStructure) -> String | The structural payload: the same four facts, plus what the crate exposes and who depends on it |
`vocabulary_panel::store`
| Item | What it is |
|---|---|
pub struct MetricRow | One run_measurement row: (metric, value, unit). |
pub const VOCABULARY_VERSION: & str | The vocabulary a panel run classifies against |
pub const PROVENANCE_CLASS: & str | A model run never writes any other provenance class |
pub enum StoreError | — |
StoreError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
StoreError :: fn from(e : sqlx::Error) -> Self | — |
pub struct ConsensusRow | One crate_classification row at provenance_class = 'model', scoped to the cell whose panel produced it |
fn metric_rows(cells : & BTreeMap <String, CellMetrics>, abstentions : & BTreeMap <String, AbstentionCounts>, confidence_threshold : f64,) -> Vec <MetricRow> | Build the metric rows for a completed run |
fn consensus_rows(votes : & Vote) -> Vec <ConsensusRow> | Consensus per (cell, crate): the modal role, and the share that chose it |
async fn write_run(pool : & sqlx::PgPool, run_id : & str, provenance : & str, metrics : & MetricRow, consensus : & ConsensusRow, allowed_roles : & String,) -> Result <(), StoreError> | Write a completed run: the metric rows and the consensus classifications, in one transaction |
`vocabulary_panel::votes`
| Item | What it is |
|---|---|
pub const UNCLASSIFIED: & str | The role a vote carries when the evidence did not decide it |
pub enum ConfidenceMode | Whether this file is expected to carry the confidence column |
pub struct RawVote | — |
pub enum VoteError | — |
pub struct AbstentionCounts | Per-cell tally of how a run's abstentions arose. |
fn parse(text : & str, mode : ConfidenceMode) -> Result <Vec <RawVote>, VoteError> | — |
fn coerce(votes : & RawVote, threshold : f64,) ->(Vec <Vote>, std::collections::BTreeMap <String, AbstentionCounts>,) | Apply the run's confidence threshold |
`walk`
| Item | What it is |
|---|---|
pub const MAX_FILE_COUNT: usize | Whole-run cap on git ls-files output (Gate 1.5.6 §1): a repo with more tracked files than this aborts loudly rather than silently truncating. |
pub enum CorpusKind | What a git-tracked file counts as for corpus ingest. |
CorpusKind :: fn as_str(self) -> & 'static str | — |
pub struct CorpusFile | One tracked file selected for corpus ingest. |
pub struct SkippedEntry | A tracked path the walk would not process, with the reason. |
pub struct CorpusWalkOutcome | — |
pub enum CorpusWalkError | — |
fn classify(repo_path : & str) -> Option <CorpusKind> | Pure classifier: which corpus kind (if any) a repo-relative tracked path counts as |
fn parse_ls_files(stdout : & str) -> Vec <String> | Pure parse of git ls-files' newline-separated stdout into repo-relative paths (trailing empty line dropped). |
fn walk_git_tracked(repo_root : & Path) -> Result <CorpusWalkOutcome, CorpusWalkError> | Walk every git-tracked file under repo_root, classify it, and apply the Gate 1.5.6 caps |
`work_item`
| Item | What it is |
|---|---|
pub enum Tier | Ranking tiers, in authority order |
pub struct Candidate | — |
pub struct Omission | — |
pub struct ContextManifest | The compiler's output: what the worker receives, and — just as load bearing for review — what it does not and why. |
fn radius(edges : & (Uuid, Uuid), seeds : & BTreeSet <Uuid>, depth_cap : u32,) -> BTreeMap <Uuid, u32> | Pure BFS mirror of the SQL work_item_radius function (AC2: the two must agree) |
fn rank(required : Vec <Candidate>, scope : Vec <Candidate>, adjacent : Vec <Candidate>,) -> Vec <Candidate> | Rank candidates into tiers |
fn apply_budget(work_item_id : Uuid, ranked : Vec <Candidate>, budget_bytes : u64,) -> Result <ContextManifest, String> | Apply the byte budget |
pub struct ContentBlock | One spliced content block: the file's bytes riding with the manifest (sprint 4.9 AC1 — closes the US-4.7.4 content-splicing gap). |
pub struct SplicedShard | The worker-ready shard: manifest + real content. |
fn splice(manifest : ContextManifest, contents : & BTreeMap <String, String>, per_file_cap : u64,) -> Result <SplicedShard, String> | Splice file contents into a compiled manifest |
fn split_sections(text : & str, anchors : & (String, String, usize)) -> Vec <(String, String)> | Split a document into (anchor, section_text) pairs by level-1/2 headings (sprint 4.10 AC5): each section runs from its heading line to the next heading |
fn may_start(unread_required : usize) -> Result <(), String> | Service-side transition guard (AC5, fail-open discipline: callers LOG a refusal, nothing hooks a hard block): ready -> in_progress requires every required-context row read. |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
{execution,lexicon,metering,session_usage,story} | operations_control_plane::{execution,lexicon,metering,session_usage,story} |
Boundary
Reaches into application, foundation, infrastructure, operations.
Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | tools |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/tools/corpus |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_tools["tools"] --> n_application["application"] n_tools["tools"] --> n_foundation["foundation"] n_tools["tools"] --> n_infrastructure["infrastructure"] n_tools["tools"] --> n_operations["operations"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `application-core` | application | no | always |
| `application-ledger` | application | no | always |
| `foundation-audit-log` | foundation | no | always |
| `foundation-bounded-io` | foundation | no | always |
| `foundation-fs-metadata` | foundation | no | always |
| `foundation-lexicon` | foundation | no | always |
| `foundation-money` | foundation | no | always |
| `infrastructure-dlp-detect` | infrastructure | no | always |
| `infrastructure-doc-ingest` | infrastructure | no | always |
| `infrastructure-embeddings` | infrastructure | no | always |
| `infrastructure-knowledge-index` | infrastructure | no | always |
| `operations-control-plane` | operations | no | always |
| `operations-decision-ledger` | operations | no | always |
| `tools-artifact-scaffold` | tools | no | always |
| `tools-doc-truth` | tools | no | always |
| `tools-fleet-db` | tools | no | always |
| `tools-gen-ai-context` | tools | no | always |
| `tools-mermaid-render` | tools | no | always |
| `tools-packet-compile` | tools | no | always |
| `tools-stub-scan` | tools | no | always |
| `tools-test-assert-ratchet` | tools | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
anyhow | ^1 | — | no | always |
async-trait | ^0.1 | — | no | always |
cargo_metadata | ^0.18 | — | no | always |
chrono | ^0.4 | serde | no | always |
clap | ^4 | derive | no | always |
dirs | ^5 | — | no | always |
proc-macro2 | ^1 | span-locations | no | always |
quote | ^1 | — | no | always |
serde | ^1 | derive, derive | no | always |
serde_json | ^1 | — | no | always |
serde_yaml | ^0.9 | — | no | always |
sha2 | ^0.10 | — | no | always |
sqlx | ^0.8 | runtime-tokio, postgres, chrono, uuid, json | no | always |
syn | ^2 | full, parsing, printing, clone-impls, visit, visit-mut, … (7 total) | no | always |
thiserror | ^2 | — | no | always |
tokio | ^1 | full, macros, rt-multi-thread, fs, time | no | always |
url | ^2 | — | no | always |
uuid | ^1 | v4, v7, serde, js, v4, serde | no | always |
Development, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-test-support` | foundation | no | always |
| `infrastructure-agent` | infrastructure | no | always |
| `tools-cli-conformance` | tools | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tempfile | ^3 | — | no | always |
tokio | ^1 | full, macros, rt-multi-thread, fs | no | always |
Build. None.
Depended on by. 1 workspace crate.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR consumers["1 consumer crates"] -->|uses| SELF SELF["tools-corpus"] SELF -->|runtime| runtime_deps["21 workspace crates"] SELF -->|development| development_deps["3 workspace crates"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| bin | tools-corpus | `src/main.rs` |
| example | governance_scan | `examples/governance_scan.rs` |
| lib | tools_corpus | `src/lib.rs` |
| test | ac6_postcondition_live | `tests/ac6_postcondition_live.rs` |
| test | capability_search_live | `tests/capability_search_live.rs` |
| test | complexity_cli | `tests/complexity_cli.rs` |
| test | complexity_fixtures | `tests/complexity_fixtures.rs` |
| test | complexity_git_reads | `tests/complexity_git_reads.rs` |
| test | complexity_store_live | `tests/complexity_store_live.rs` |
| test | harness_inventory_render | `tests/harness_inventory_render.rs` |
| test | inventory_check_live | `tests/inventory_check_live.rs` |
| test | lexicon_add_live | `tests/lexicon_add_live.rs` |
| test | lexicon_export_live | `tests/lexicon_export_live.rs` |
| test | oracle_store_live | `tests/oracle_store_live.rs` |
| test | product_dimension_live | `tests/product_dimension_live.rs` |
| test | reading_adjudicate_live | `tests/reading_adjudicate_live.rs` |
| test | reading_stage_live | `tests/reading_stage_live.rs` |
| test | shard_contract_live | `tests/shard_contract_live.rs` |
Error model
| Error type | Named by |
|---|---|
AgreementError | cell_metrics, parse_votes_tsv |
AuditError | run_audit |
CorpusWalkError | walk_git_tracked |
DocsIngestError | run_corpus_code_ingest, run_corpus_code_ingest_full, run_corpus_docs_ingest, run_corpus_docs_ingest_full |
EdgesAssertError | assert_edges, assert_edges_from_candidates |
FactsError | workspace_dependency_map, workspace_facts, workspace_structure |
HarnessEventError | bind_execution_run, insert_hook_event, parse_hook_event, read_stdin_payload, refuse_if_raw_api_bodies_enabled, resolve_run_id |
HistoryError | check_safety_cap, run_history_backfill |
MirrorError | run_mirror_code_citations, run_mirror_crates, run_mirror_doc_links, run_mirror_doc_sections |
OntologyIngestError | run_ontology_ingest |
ProductError | apply_bulk_assign, assign_single, create_product, incorporate, plan_bulk_assign, product_sequence |
ProvisionCliError | grant_app_privileges, provision |
ProvisionError | ensure_roles_and_database |
ReadingError | adjudicate, census, check, relabel_readings, report, stage, … (8 total) |
RecallError | recall |
RuleError | parse_rules |
RunError | run_sample, run_score, score |
ScopeError | validate_scope |
StoreError | write_run |
TargetError | resolve_provision_target |
VoteError | parse |
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | yes |
| database access | yes |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | yes |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
| Variable | Read in |
|---|---|
CARGO_MANIFEST_DIR | src/complexity.rs |
CLAUDE_CODE_SESSION_ID | src/main.rs |
CORPUS_SOURCECODE_APP_DB | src/diagrams_cmd.rs |
CORPUS_SOURCECODE_DB | src/main.rs |
CORPUS_TEST_DB | src/audit.rs |
DATABASE_URL | src/main.rs |
HOME | src/diagrams_cmd.rs |
ORG_KNOWLEDGE_DB | src/reading_cmd.rs |
OTEL_LOG_RAW_API_BODIES | src/harness_event.rs |
TEST_DATABASE_URL | src/recall.rs |
Related capabilities
1 workspace crate depends on this one: tools-pipeline-report.
Verification
| Kind | Count |
|---|---|
| Unit tests | 720 |
| Integration tests | 78 |
| Examples | 1 |
| Doctests | 3 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 20 | 0 | 0 |
audit | 6 | 0 | 0 |
capability_guard | 3 | 0 | 0 |
claim_verify | 16 | 2 | 0 |
cli | 8 | 0 | 0 |
code | 4 | 0 | 0 |
complexity | 22 | 0 | 0 |
complexity_calibrate | 8 | 0 | 0 |
complexity_callers | 2 | 0 | 0 |
complexity_churn | 4 | 0 | 0 |
complexity_ratchet | 8 | 0 | 1 |
complexity_report | 10 | 0 | 1 |
complexity_store | 23 | 0 | 0 |
conformance | 5 | 0 | 0 |
crate_path | 8 | 0 | 0 |
crate_register | 10 | 0 | 1 |
crate_size | 3 | 0 | 0 |
decisions | 2 | 0 | 0 |
diagrams_cmd | 2 | 0 | 0 |
doc_audit | 20 | 0 | 0 |
docs | 7 | 0 | 0 |
docs_census | 20 | 0 | 1 |
docs_reorg | 10 | 0 | 0 |
edges | 10 | 0 | 0 |
governance | 6 | 4 | 0 |
harness_event | 11 | 0 | 1 |
harness_inventory | 25 | 0 | 1 |
history | 8 | 0 | 0 |
ingest_run | 3 | 0 | 2 |
lexicon_store | 38 | 0 | 0 |
mirror | 6 | 0 | 0 |
ontology | 8 | 0 | 0 |
oracle | 2 | 0 | 0 |
oracle_store | 7 | 0 | 2 |
pilot | 16 | 1 | 0 |
product_dimension | 12 | 0 | 0 |
reading_cmd | 20 | 0 | 2 |
readme | 20 | 0 | 2 |
recall | 3 | 0 | 0 |
session_scope | 5 | 0 | 0 |
staleness | 10 | 0 | 1 |
story_author | 5 | 0 | 0 |
story_compile_cmd | 1 | 0 | 0 |
story_render_cmd | 1 | 0 | 0 |
study | 11 | 0 | 0 |
symbol_ingest | 1 | 0 | 0 |
taxonomy | 9 | 0 | 0 |
term_census | 11 | 0 | 0 |
test_ingest | 8 | 2 | 1 |
vocabulary_panel::agreement | 6 | 0 | 0 |
vocabulary_panel::derive | 12 | 0 | 0 |
vocabulary_panel::facts | 10 | 0 | 0 |
vocabulary_panel::run | 10 | 0 | 0 |
vocabulary_panel::sample | 6 | 0 | 0 |
vocabulary_panel::store | 8 | 0 | 0 |
vocabulary_panel::votes | 7 | 1 | 1 |
walk | 9 | 0 | 1 |
work_item | 12 | 0 | 0 |
What the tests establish, by name:
a_fresh_provision_through_the_real_runner_passes—tests/ac6_postcondition_live.rsa_second_run_is_a_no_op_and_still_checked—tests/ac6_postcondition_live.rsan_applied_migration_whose_bytes_changed_is_refused—tests/ac6_postcondition_live.rsan_unowned_table_outside_the_baseline_is_refused_and_named—tests/ac6_postcondition_live.rsthe_check_ignores_tables_no_migration_set_creates—tests/ac6_postcondition_live.rsthe_declared_debt_is_tolerated_and_may_shrink—tests/ac6_postcondition_live.rsthe_equivalence_and_the_input_caps_in_order—tests/capability_search_live.rscalibrate_proposes_from_what_was_measured—tests/complexity_cli.rscheck_json_is_json_and_carries_the_same_verdict—tests/complexity_cli.rscheck_refuses_when_the_store_is_empty_rather_than_passing_vacuously—tests/complexity_cli.rscheck_says_warn_only_has_expired_once_the_deadline_passes—tests/complexity_cli.rsshards_writes_a_shard_for_what_was_ranked—tests/complexity_cli.rsthe_no_changes_line_is_for_humans_and_json_gets_none_of_it—tests/complexity_cli.rsa_re_export_is_an_edge_like_any_other_import—tests/complexity_fixtures.rsevery_adversarial_construct_is_treated_as_its_row_claims—tests/complexity_fixtures.rsevery_construct_class_on_the_roster_has_a_case—tests/complexity_fixtures.rsmeasuring_the_same_source_twice_gives_the_same_answer—tests/complexity_fixtures.rsone_unparseable_file_does_not_cost_the_crate_its_other_modules—tests/complexity_fixtures.rsa_file_absent_at_a_revision_is_none_and_not_an_error—tests/complexity_git_reads.rsa_renamed_file_is_staged_because_the_filter_carries_r—tests/complexity_git_reads.rschanged_rust_files_between_two_revisions_is_the_ci_form—tests/complexity_git_reads.rscollect_churn_counts_commits_per_file_and_not_an_empty_map—tests/complexity_git_reads.rsdirty_rust_files_reports_uncommitted_rust_and_ignores_everything_else—tests/complexity_git_reads.rsfile_at_rev_reads_the_index_and_head_separately—tests/complexity_git_reads.rshead_commit_is_a_full_sha_and_not_a_placeholder—tests/complexity_git_reads.rsstaged_rust_files_sees_what_is_staged_and_not_what_is_merely_written—tests/complexity_git_reads.rstracked_rust_files_lists_the_rust_files_and_only_those—tests/complexity_git_reads.rsa_commit_is_written_whole_and_rewriting_it_updates_rather_than_duplicates—tests/complexity_store_live.rsa_failed_write_leaves_the_commit_entirely_unstored—tests/complexity_store_live.rsa_function_whose_file_has_no_churn_row_is_still_in_the_view_and_is_named—tests/complexity_store_live.rs- _… 768 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 537 | 637 |
Public modules with a //! block | 58 | 58 |
pie showData
title Public items with rustdoc
"Documented" : 537
"No rustdoc detected" : 100
Metrics
| Metric | Value |
|---|---|
| Rust source files | 62 |
| Source lines | 53263 |
| Code lines | 41274 |
| Public API items | 637 |
| Public modules | 58 |
| Tests | 798 |
| Examples | 1 |
| Cargo features | 0 |
| Direct runtime dependencies | 39 |
| Workspace reverse dependencies | 1 |
pie showData
title Public API by kind
"constant" : 58
"enum" : 56
"function" : 314
"method" : 79
"struct" : 129
"type alias" : 1
pie showData
title Rust source composition
"Code" : 41274
"Blank or comment" : 11989
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.