Expand description
AgentStateDeveloper: code-level context and an audit overlay for agent-authored code.
This is the library entry point. It re-exports everything from
agentstatedeveloper-core
(the engine, schema, stores and index pipeline) and
default_adapters, which returns every built-in language adapter.
let adapters = agentstatedeveloper::default_adapters();
assert!(!adapters.is_empty());The asd command-line tool is in agentstatedeveloper-cli, and the MCP
server is in agentstatedeveloper-mcp.
Modules§
- adapter
- audit
- Audit-log event stream — OSS data format.
- brief
- Plan D t-001 + t-007: shared brief-output projections.
- calibration
- Plan J t-015: confidence-bucket calibration helpers.
- candidates
- Shared candidate-selection logic used by CLI commands and the MCP server.
- community
- Community detection over the call graph (Plan competitive-harvest t-009).
- conclusions_
export - Plan B t-004: shared conclusion-export pipeline used by both the CLI
(
asd conclusions export) and MCP (conclusions_exporttool). - context
- Per-symbol context assembly for
asd context-for(CLI) and themcp__asd__context_forMCP tool. - cross_
service - Cross-service / cross-process edges (Plan competitive-harvest t-002).
- dataflow
- Intra-process data-flow edges (Plan competitive-harvest t-002, slice 4).
- doc_
adapters - Document adapters: produce
SearchDocchunks from non-code files. - edge_
confidence - Confidence for call-graph edges (Plan competitive-harvest t-013).
- effects
- engine
- error
- feedback
- Feedback store — durable (query, symbol, verdict) triples.
- gc
- ASD’s garbage-collection retention policy, shared by
asd gcandasd-serve’s sweep preview so the two can never disagree about what a sweep keeps. - help
- On-demand instruction disclosure (
help) — the asd half of the cross-binary help system shared withctx(CTXone). - index
- index_
pipeline - Shared indexing pipeline used by both the CLI
asd indexcommand and the MCPreindextool. - ledger
- ledger_
integrity - Ledger integrity across the three places an entry lives.
- map
asd mapcore — initial-read project summary.- overview
- Read-only “orient me” reports shared by the CLI and the
asd-mcpserver. - paths
- ASG path convention for ASD data.
- policy
- Policy gate.
- prepare_
change - Plan E t-006: shared helpers for the prepare-change pipeline.
- rebind
- Moving a symbol’s ledger history onto another symbol.
- recipes
- Plan C t-004: change-intent recipes.
- registry
- Shared ASD repo registry —
~/.config/asd/repos.toml. - repair
- ASG state repair — scan for corruption and apply safe auto-corrections.
- schema
- scorecard
- The five-dimension benchmark scorecard — truth, feedback, change, uncertainty, workflow — plus the data-quality and token-economy blocks that qualify them.
- scratch
- Scratchpad store for ephemeral agent working notes.
- search_
fts - FTS5-backed search index for ASD symbols.
- ser_
helpers - Serde skip-predicates for agent-mode token economy.
- sidecar
- On-disk sidecar for the “git roundtrip” promise.
- sidecar_
config - Plan K t-007:
.asd/config.tomlreader for opt-in sidecar sharding. Today a single shape: per-package sharding via[sidecar] shard_by = "package". Default is “class” (one file per conclusion class, current behavior). - symbol
- test_
summary - Compact, failures-only summaries of test-runner output (Plan competitive-harvest t-005). Reads a runner’s verbose output and keeps only what an agent needs to act: the pass/fail counts and each failure with a little context — typically a ~90% token cut versus the raw log.
- thinking
- Plan G t-006: read-side helper for surfacing captured thinking (Hypothesis / MentalModel / FailedAttempt / OpenQuestion) into prepare-change and context-for responses.
- transitive
- Transitive effect propagation.
- trust
- State Trust Score — machine-readable rollup of ASD semantic state quality.
- workflow
- Workflow Recipe Detection + Task Close Evidence Quality.
Structs§
- Annotated
Owner - An owner with the evidence source that identified them.
- Approval
Outcome - Outcome of
LedgerStore::approve_entry. Carries the updated entry and whether it was already approved (caller idempotency hint). - AsgEffect
Store - AsgFeedback
Store - AsgIndex
Store - ASD index reader/writer.
- AsgLedger
Store - AsgScratch
Store ScratchStorebacked by an ASGRepository.- Audit
Event - One audit entry. Flat, JSON-serializable. Shared data format —
event_hash/prev_event_hashare empty strings / None when the OSS binary emits (viaNullSink) and filled in by the Pro sink. - Author
- Cache
Warm Summary - Result of
Engine::warm_caches. - Call
Edge - A directed call edge from one qname to another, produced by a language adapter’s intra-module call-graph extractor.
- Candidate
Aggregates - Holds the six parallel collections built up by the per-candidate
scan plus the top symbol id (driver for downstream BFS) and the
seen_invdedup set (threaded into the subsequent caller-invariant propagation pass so both invariant sources share one namespace). - Clean
Filter - Predicate used by
ScratchStore::clean_entriesto select entries for permanent deletion. - Collect
Result - Result of collecting source files under a path.
- Covering
Test - A test symbol that likely covers a given impl symbol.
- Cross
Service Edge - A matched cross-service edge: an outbound endpoint linked to an inbound endpoint sharing a contract key. Computed on demand, not materialized.
- Data
Flow Edge - A resolved data-flow edge: a value flows from a call site in
fromintoparamof the calleeto. - Data
Quality - Distinguishes intentional clean-room state from unexpected data loss.
- Detected
Data Flow - A data-flow site detected by an adapter, before the pipeline resolves the callee’s parameter name and symbol identity. The adapter knows the callee by qname and the argument’s position; the pipeline maps position → param name using the callee’s signature.
- Detected
Endpoint - An endpoint detected by a language adapter, before the index pipeline
enriches it with this repo’s
repo_idand the owning symbol’ssymbol_id. Adapters work in qnames, so aDetectedEndpointnames its owner by qname. - DocHit
- A ranked document search hit.
- Dynamic
Dispatch Hint - Plan L t-005: one dynamic-dispatch call site detected by an adapter.
patternis a short label (getattr/callback-arg/metaclass);snippetis the source line trimmed for display in CLI warnings. - Edge
Evidence - Accumulated evidence for one directed call edge.
- Effect
- Effect
Decl - Endpoint
Ref - A lightweight reference to one end of a cross-service edge.
- Engine
- The top-level ASD engine. Owns an ASG repository, a policy gate, an audit sink, and optional commercial ratify operations. Cheap to construct; shared across CLI, MCP, and library consumers.
- Evidence
Quality - Per-field evidence quality breakdown for the task closure.
- Feedback
Entry - A single feedback record: a (query, symbol, verdict) triple stored durably.
- Feedback
Impact - Per-result explanation of which feedback verdict affected a search hit.
- Feedback
Metrics - Apply feedback verdicts as score adjustments after candidate selection.
- Feedback
State - Explicit description of feedback availability for the current query.
- File
Policy Gate - File
Recency - Per-file recency metadata derived from a single
git logcall. - FtsFilters
- Filters applied before BM25 ranking.
- FtsHit
- A single ranked result from FTS search.
- Hydrate
Summary - Result of
hydrate_from_dir.missing_schema_versionis true when the sidecar exists but has nometa/schema-versionfile; hydrate still proceeds but callers should surface the mismatch. - Index
Summary - Summary returned by
run_index. - Ledger
Counts - Ledger entry counts in each store, plus the gaps between them.
- Ledger
Entry - Ledger
Restore Report - Outcome of
restore_missing_ledger_entries. - Mismatch
- Null
Sink - Swallows every event. The OSS default — tamper-evident file-backed
audit is a commercial feature (see
agentstatedeveloper-audit-pro). - Ownership
Signal - Ownership signal returned by
discover_symbol_ownership. - Parsed
Symbol - Parsed symbol returned by a language adapter. Carries enough info to
build a full
Symbolnode. - Permissive
Policy Gate - Policy
File - Policy
Rule - Position
- Rebind
- Record that a symbol was renamed/moved so its ledger history follows it.
Written to
/asd/v1/rebinds/<from_symbol_id>at rename time. - Rebind
Outcome - What one rebind moved.
- Recovery
Suggestion - Recovery quality estimate for a single scoped suggestion.
- Repair
Issue - A single integrity issue detected in the ASG.
- Repair
Report - Result returned by
repair_asg. - Resolved
Symbol - Full symbol resolution result from the FTS table.
- Review
Outcome - Outcome of
LedgerStore::reject_entry/withdraw_entry. Same idempotency shape asApprovalOutcome. - Runtime
Evidence - Accumulated runtime-trace evidence for a symbol’s declared effects.
- Scratch
Entry - Ephemeral working note scoped to a symbol and/or named workflow.
- Scratch
Filter - Predicate applied by
ScratchStore::list_entries. AllSomefields must match (AND semantics). - Search
Doc - A searchable chunk from a non-code file (markdown, config, manifest, etc.).
- Search
Docs Db - FTS index for document/resource chunks (separate from symbol FTS).
- Search
FtsDb - Service
Endpoint - A detected service-boundary point owned by a local symbol.
- Service
Manifest - A repo’s exported endpoints — the unit shared for cross-repo matching.
- Situation
- Context passed to every policy evaluation call. Keys are populated by the call site so selectors can key on symbol_id, agent_id, etc.
- Stale
Warning - AcmeFlow refinement (1.0.77): same as
stale_warningbut returns a struct so callers can distinguish a soft “index is old but results came back fine” hint from a hard “FTS is broken / empty” alert. The MCP response includesstale_severityas a machine-readable field so downstream UIs can render appropriately (Craig decision Q7: yes, future-proof rendering). - Symbol
- Symbol
Meta - Lightweight symbol metadata stored in the
asd_symbols_metaSQLite table. - Sync
Summary - Result of
sync_to_dir. Counts what was written; the schema version is always stamped. - Transitive
Effect - Trust
Score - Rolled-up state trust score for the current ASD workspace.
- Trust
Signals - Raw signal values gathered before scoring. Exposed for debugging and for truth-drift history snapshots.
- Uncertainty
Report - Machine-readable uncertainty rollup.
- Unresolved
Call - Plan L t-006: one call site the static walker tried to resolve but
couldn’t. May be stdlib (
print,len), third-party (an unindexed dependency), or genuinely dynamic. Aggregated by the indexer to expose the static-resolution coverage gap so agents don’t assume missing edges are bugs. - Verification
- Workflow
Summary - Rolled-up workflow summary emitted in task-close JSON and persisted to
.asd/workflow-sessions.jsonl. - Workspace
Symbols - Workspace-wide context passed to adapters when resolving call edges across module boundaries.
Enums§
- AsdError
- Author
Kind - Conclusion
Class - The conclusion-class buckets that drive
.asd/conclusions/*.jsonlexport and the Plan B sidecar redesign. Each class corresponds to one JSONL file; LedgerKind variants are bucketed viaconclusion_class(). - Data
Flow Kind - How a value reaches its sink. Currently only argument→parameter; field-access chains are a planned addition.
- Decision
- Direction
- Whether an endpoint exposes/handles a contract (inbound) or consumes/calls it (outbound).
- DocKind
- Broad category for a document chunk.
- Effect
Category - Effect category — either a well-known built-in or a user-defined domain
string (e.g.
"midi.send","audio.graph.connect"). - Evidence
- Feedback
Verdict - Verdict an agent or user assigns to a search result.
- Issue
Severity - Severity level for a
RepairIssue. - Ledger
Kind - Owner
Signal Source - The evidence source that identified an owner.
- RoleTag
- Plan C t-002: first-class role-tag vocabulary. The optional
LedgerEntry.rolefield is free-formString(so unknown tags don’t break old data), but CLI / MCP / API layers validate against this enum at write time and warn on unknown values. - Scratch
Status - Status of a
ScratchEntry. Transitions: Draft → Promoted or Discarded. - Sidecar
State - Observable lifecycle state of the on-disk sidecar.
- Stale
Severity - Symbol
Kind - Transport
- Transport a service endpoint communicates over.
- Uncertainty
Reason - A single, machine-readable uncertainty signal.
- Verification
Source - Verification
Status
Constants§
- AGENT_
DEFAULT_ BUDGET - Default token budget for
--agentmode (8 000 tokens ≈ 32 000 chars). - ASD_
PATH_ PREFIX - ASD_
SCHEMA_ VERSION - CLIFF_
RATIO_ THRESHOLD - Cliff detection threshold (1.0.85, AcmeFlow refinement #2 deep half): when a consecutive score ratio drops below this, the lower score is treated as the start of a new “also-ran” cohort and the floor is raised to exclude it.
- DEFAULT_
FEEDBACK_ HALF_ LIFE_ DAYS - Default half-life for feedback boost decay, in days.
- FILE_
SCORE_ FLOOR_ RATIO - Relative score floor for file inclusion in
likely_edit_files. - HASH_
PREFIX - Prefix for blake3-based event hashes. Versioned so we can change the algorithm later without ambiguity. Shared between OSS readers and Pro writers.
- SOFT_
STALE_ THRESHOLD_ SECS - AcmeFlow refinement: 24h soft-threshold for handlers that
have a “did the query resolve” signal (prepare-change,
context_for). Matches a typical dev day — index built this
morning is fine all afternoon. Other commands (status, search,
investigate) keep the 1h legacy threshold via
stale_warningsince they ARE the index-health signal.
Traits§
- Audit
Sink - Effect
Store - Feedback
Store - Index
Store - Language
Adapter - Language-specific parsing + effect inference. Implementations live in
sibling crates:
agentstatedeveloper-python,-typescript, etc. - Ledger
Store - Policy
Gate - Ratify
Ops - The three ledger review operations. Implemented by
RatifyOpsImplinagentstatedeveloper-ratify(Team tier). Methods take an explicitrepo: &Repositoryso the impl can be a zero-sized struct — no lifetime or clone needed when stored asArc<dyn RatifyOps>inEngine. - Scratch
Store - Scratch-entry CRUD operations.
Functions§
- adapt_
document - Detect the kind for a file path and, if recognised, parse it into chunks.
Returns
Nonewhen the file is not handled by any adapter. - aggregate_
candidate_ data - Main candidate-scan pass. Iterates the ranked candidate list once, populating all six parallel accumulators:
- append_
workflow_ session - Append a compact workflow session record to
.asd/workflow-sessions.jsonl. Silently skips on any I/O error so task-close never fails due to logging. Caps the file at 500 lines (drops the oldest when over limit). - apply_
feedback_ adjustments - apply_
file_ scope_ feedback - Apply file-scoped feedback verdicts to
scored. - architecture_
overview - One-call “orient me” overview: languages, packages, layers, call-graph
communities (clusters), inbound/outbound routes, and hotspots. This is the
JSON body
asd architecture --agentprints. - assemble_
symbol_ context - Assemble the per-symbol context object — the building block both
CLI
asd context-forand MCPcontext_foremit per requested qname. - build_
feedback_ state - Convenience wrapper that fetches feedback entries before calling
build_feedback_state_from_entries. Use the_from_entriesvariant when you already hold alist_all()result. - build_
feedback_ state_ from_ entries - Build a
FeedbackStateforqueryfrom the feedback store. - build_
id_ map id → Symbolmap for the current ref. Fast path via the SQLite symbol cache, authoritative git fallback. Shared by the many commands that need to resolve call-graph node ids back to symbols.- canonical_
symbol_ id - Canonical stable id for a symbol. Survives content edits and path moves; changes only on rename (which triggers a rebind record).
- classify_
file_ role - Plan J t-003: classify a file by its functional ROLE in the
project —
view/viewmodel/test/example/fixture/script/generated/reference/impl. Distinct fromclassify_layer, which buckets by architectural tier (presentation / domain / persistence / etc.). - classify_
layer - Classify a source file into a workflow layer for
asd investigategrouping. - classify_
layer_ sym - Like
classify_layerbut uses the symbol’s qualified name as a secondary hint when the file path alone yields"other". Catches common cases where a class namedFooViewModellives in a file named after the app rather than the ViewModel. - cliff_
cutoff_ index - Compute the precision floor for file scoring. Two-pass:
- collect_
source_ files - compute_
index_ consistency - Plan J t-005: reconcile the two divergent symbol counts that
asd statusandasd healthwere each reporting in isolation. - compute_
trust_ score - Compute a
TrustScorefor the ASD workspace atdb_path. - compute_
uncertainty - Build a structured
UncertaintyReportfrom the signals already computed by the search/investigate/prepare-change pipeline. - confidence_
reason - One-line explanation of why a result has high or low confidence.
- confidence_
scores - Normalize raw scores to [0.1, 1.0] confidence within the result set. The highest-scoring result gets 1.0; the lowest gets 0.1.
- contract_
hash - Stable 16-hex-char hash of a contract key, for use as a filesystem-/path-safe
segment (raw contract keys contain spaces,
/, and:). - dead_
code_ report - Functions/methods with no inbound call edges — a candidate list. Excludes
HTTP route handlers, test functions (unless
include_tests), andmain/dunder methods. This is the JSON bodyasd dead-code --agentprints. - decay_
factor - Pure decay function. Returns a multiplier in
[0.0, 1.0]for an observation ofage_daysagainsthalf_life_days. Uses the classical exponential decay:factor = 0.5 ^ (age / half_life). - decay_
for_ entry - Compute the decay multiplier for an entry whose
created_atis known, given the current time. Used at feedback-boost application time to scaleUsefulverdicts by age. - declared_
effect_ blast_ radius - Per-declarer transitive blast radius, derived entirely from the stored
transitive data written by
propagate_transitive— no call-graph reachability is recomputed here. - default_
adapters - Return one instance of every built-in language adapter.
- derive_
cold_ hints - Heuristically propose a parallel test file path for a given source file.
- detect_
ambiguous_ tokens - Detect query tokens that match too many unrelated files (broad/ambiguous terms).
- detect_
communities - Detect communities over an undirected graph.
nodesshould be passed in a stable (e.g. sorted) order for reproducibility.edgesare unordered pairs; self-loops and edges to unknown nodes are ignored, duplicates collapse. Returns a densenode → community_idmap. - detect_
confidence_ warnings - Distinguish whether low result confidence comes from ambiguous terms or a sparse index. Returns a vec of typed warning objects with kind + message.
- detect_
orphaned_ entries - Walk every ledger entry and tag those whose
symbol_idis no longer present in the qname index as"orphaned"and"orphaned-at:<timestamp>"; clear those tags from entries whose symbol is back. - detect_
possible_ misses - Heuristic possible-miss warnings for a result set.
- detect_
workflow - Detect which workflow recipe was followed and which steps were skipped.
- dirty_
files_ for_ change - Convenience: hoist git_dirty_files() for callers that want to share the same set between finalize_file_scores and a downstream stale_symbols scan. Just re-exports the underlying helper for API discoverability.
- discover_
symbol_ ownership - Discover the likely owner of a symbol from git blame + doc-comment annotations.
- drop_
empty_ recursive - Recursive variant of
drop_empty_top_level. Walks every nested object and drops null/[]/{} children. Arrays’ elements are recursed into (an object inside an array still gets cleaned) but the array itself is preserved at its length — position often matters in arrays. - drop_
empty_ top_ level - Token economy: drop top-level fields whose value is
null,[], or{}. The agent doesn’t need the absence-of-X echo when X has no signal — they can infer “no entries” / “no warning” / “fresh” from absence. - drop_
orphaned_ edge_ refs - Drop orphaned callee and caller refs whose target symbol_id no longer
exists in the live index, in one commit. Returns the total number of
individual refs dropped. Called by [
hydrate_from_dir] after a hydrate pass to clean up any stale edges the sidecar may have carried. - edges_
from_ tree - Flatten the on-disk data-flow registry (
from_symbol_id → [DataFlowEdge]) into a flat list. Malformed entries are skipped. - effect_
detail_ reason - Return a one-line explanation of an effect declaration’s verification state.
- emit_
audit - Fire-and-forget audit emit. Logs sink failures to stderr but never propagates — audit issues must never block the user’s operation.
- endpoints_
from_ tree - Flatten the on-disk endpoint registry tree
(
contract_hash → repo_id → symbol_id → ServiceEndpoint) into a flat list. Malformed entries are skipped. - endpoints_
report - Cross-service endpoints detected in this repo plus the in-repo matched
edges. This is the JSON body
asd endpoints --agentprints. - estimate_
tokens - Estimate token count from a JSON string (rough: 1 token ≈ 4 chars).
- explain_
conflict_ risk - Detect conflict risk for a single file. Returns Some(reason) if the file has unresolved merge markers or git status modifications; None when the file is clean.
- explain_
feedback_ impacts - For each qname in
qnames, determine which feedback verdict (if any) affected it and return a map of qname → FeedbackImpact. - explain_
match - Explain why a symbol was returned for a query.
- extract_
summary - federated_
edges - Federated edges over a set of per-repo manifests:
match_edgeson the union of every manifest’s endpoints. Each edge carriescross_repo(consumer and producer in different repos). Withcross_repo_only, in-repo edges are dropped — the federated view a Team-tier tool wants: “a client in repo A calls a route served by repo B” (Plan Q t-005). - fetch_
all_ test_ file_ paths - Pre-fetch all test-tier file paths in a single DB open.
Pass the result to
test_files_for_sourcefor per-file stem matching, avoiding repeated DB opens when processing many source files in a loop. - file_
score_ floor - finalize_
file_ scores - Sort + cliff-cut + build the
likely_edit_filesJSON array. - find_
candidates - Return the top-
depth(score, qname)pairs for a query. - find_
covering_ tests - Find test symbols in the FTS index that are likely to cover
impl_qname. - find_
indexed_ test_ files - Look up real indexed test files that correspond to
source_file. - format_
age - Format a unix timestamp age as a human-readable string (“3h ago”, “just now”).
- gather_
recency - Run one
git logpass covering up toscan_commitscommits and return a map of relative file path →FileRecency. - git_
dirty_ files - Return source file paths that are modified (dirty) since the last commit.
- glob_
match - Match a file path against a glob pattern.
- http_
contract - Build a normalized HTTP contract key from a method and a path (or full URL).
A client call and a server route for the same endpoint must produce the same
string: the method is upper-cased, any scheme+host is stripped, path
parameters (
{id},:id,<id>,<int:id>) collapse to{}, query and fragment are dropped, and trailing slashes are removed. - hybrid_
boost - Rust-side score boost applied on top of BM25 after FTS returns hits.
- hydrate_
from_ dir - Read a
.asd/v1/sidecar underdirand write its contents back into the ASG repo via the existing stores. - hydrate_
from_ dir_ with_ cache hydrate_from_dir, also writing the ledger entries it loads into the ledger cache, which answerslist_entries.- in_
memory_ score - Score a symbol against query tokens using simple substring matching. Used when the FTS index is not populated.
- in_
memory_ score_ with_ text - Same scoring rules as
in_memory_score, but takes the symbol’s lowercased ledger-summary text directly so bulk callers can supply it from one ledger-tree walk instead of a per-symbollist_entriesread (Plan T scale finding). - in_
memory_ scored_ symbols - Bulk in-memory scorer shared by every fallback-search caller (core
find_candidates, MCPcode_search, CLIasd search): ONE by-qname tree read — deserializing the Symbol values the tree already contains — plus ONE ledger-tree walk, instead of a per-qname symbol fetch and a per-symbol ledger read (~54ms each on a cold FTS cache — ~9 minutes at 10k symbols while holding the engine mutex; Plan T scale finding). - intent_
focus - One-line agent guidance for each intent.
- intent_
layer_ order - Return the preferred layer display order for an intent. The standard order is used for unlisted layers.
- is_
doc_ file - Returns true if this path should be offered to document adapters. Used to quickly gate file walking before reading content.
- is_
stopword - Returns true if the token is a stopword.
- kind_
str - ledger_
counts - Count ledger entries in the cache, ASG and (when
sidecar_rootis given and has one) the sidecar, and the gaps between them. - list_
all_ effect_ decls - List every stored
EffectDeclin the workspace as(symbol_id, decl)pairs by walking the/asd/v1/effectssubtree. Read-only. Used by overview-style consumers (e.g.asd-serve’s/api/v1/effects/overview) that need the whole distribution rather than one symbol’s decl — the per-symbol path staysEffectStore::get_effects. - load_
exclude_ sets - Plan J t-011: load named exclude sets from
.asd/scopes.toml. - load_
layer_ overrides - Load user-defined layer overrides from
.asd/layers.tomlnext todb_path. - load_
scope_ aliases - Load named scope aliases from
.asd/scopes.tomlin the current directory. - mark_
fresh_ reset - Write the
meta/fresh-resetsentinel so agents know a deliberate reset occurred. Call this whenasd init --resetor an equivalent wipe operation runs. - match_
edges - Pair outbound endpoints with inbound endpoints sharing a contract key,
producing cross-service edges. Endpoints may come from any repo (local +
imported manifests). Edge confidence is the weaker of the two detections;
cross_repois set when the ends live in different repos. - matches_
any_ path_ glob - Return true if
filematches any of the given glob patterns. - missing_
ledger_ entries - Cached ledger entries whose
entry_idappears nowhere in the ASG ledger tree. Matching by id rather than path means an entry moved byledger rebind(whose cache row follows it to the new symbol) is never mistaken for a lost one. - normalize_
repo_ id - Normalize a git remote URL into a stable
repo_id. SCP-form and HTTPS-form URLs for the same repo collapse to one id: - outdated_
hooks - A warning when the project under
rootruns git hooks from before Plan B, which reload the whole ledger from.asd/v1/withasd hydrateon every checkout and merge. On a store that holds more than the sidecar — anything since the lastasd sync— that rewrote every entry each time, and before v1.4.7 it re-filed moved entries under their old symbols.asd initinstalls the current hooks, which import committed conclusions instead. - parse_
intent - Parse and validate an intent string. Returns a static str or
Noneif the value is unrecognised. - parse_
params - Extract positional parameter names from a function signature, e.g.
"def get_user(id, name=None, *args)"→["id", "name"]. Skips*args/**kwargsand theself/clsreceiver. Language-agnostic enough for the commonname(params)shape. - parse_
query - Parse a query string into
(positive_tokens, exclusion_terms). - propagate_
caller_ invariants - Plan J t-001 caller-invariant propagation.
- propagate_
transitive - Compute transitive effects for each symbol in
symbol_idsand write them back viaeffects.put_effects(...). Returns the count of symbols whoseEffectDecl.transitiveactually changed. - propose_
test_ path - propose_
test_ stub - Plan J t-007: language-aware test stub body for an agent that
needs to write a new test against
source_fileexercisingsymbol_name. Returns the recommended skeleton — function declaration, arrange/act/assert comments, and aNotImplementedError-equivalent marker so the test FAILS until the agent fills it in (failing-first matches the missing-test recipe item which says “fails before the edit, passes after”). - prune_
sidecar - Remove orphaned
.asd/v1/sidecar files — files whose keys no longer exist in the live ASG index. Returns the number of files/dirs removed. - pubsub_
contract - Build a normalized pub-sub contract key from a topic / queue / event name.
- query_
tokens - Tokenise a free-form query into lowercase, stopword-filtered terms.
- read_
jsonl - Read back events from a JSONL file. Shared by OSS read-only
consumers (
asd audit tail) and the Proverify_chaincode path. - rebind_
ledger - Move the ledger entries filed under each
fromsymbol id onto its target symbol, in one commit. - repair_
asg - Scan the ASG for integrity issues and, when
dry_runis false, apply all auto-fixable corrections. - repair_
asg_ with_ cache repair_asg, also pointing the ledger cache at the copy kept of each duplicated entry — the cache answerslist_entries, and a row left on a removed copy would hide the entry from its symbol.- resolve_
edge - Resolve a detected data-flow site into a
DataFlowEdge, given a way to look up a qname’s symbol_id and a callee’s parameter list. ReturnsNonewhen the caller or callee can’t be resolved, or the arg position has no corresponding parameter. - resolve_
exclude_ set - Resolve a
--exclude-setname to negative path globs. Unknown names return an empty list rather than treating the name as a glob (avoids silently turning a typo into a path filter). - resolve_
repo_ id - Resolve this repo’s id: an explicit override wins; otherwise the normalized
origingit remote; otherwise the working-directory name as a last resort. - resolve_
scope - Resolve a
--scopename to path globs. Falls back to treating the scope name itself as a path glob if not in the map. - restore_
missing_ ledger_ entries - Write every cache-only ledger entry back into ASG, with its reverse-index record, exactly as the cache holds it. Each restore is its own commit so the audit trail says what was recovered and from where.
- result_
bucket - Classify a result into a semantic bucket.
- run_
index - Run the full index pipeline over
path. - scan_
asg - Read-only integrity scan. Returns every detected
RepairIssuewithout modifying any ASG state. - scan_
sidecar - Scan
.asd/conclusions/for files and directories that don’t match the Plan K sidecar inclusion rule: - score_
evidence_ quality - Score task-closure evidence quality from available signals.
- sidecar_
lifecycle_ state - Inspect the on-disk sidecar under
dirand return its lifecycle state. - stale_
warning - Return a stale-index warning string if the index is older than
threshold_secs(default: 3600 = 1 hour), orNoneif fresh. - stale_
warning_ classified - suggest_
better_ queries - Suggest more specific queries when the current query is too broad.
- suggest_
scoped_ queries - Suggest refined, scoped queries when the current query contains ambiguous terms.
- symbol_
fingerprint - Content-addressed fingerprint of a symbol’s body. Changes on every edit.
- symbol_
tier - Classify a source file into a symbol tier.
- sync_
to_ dir - Mirror live ASG state into the
.asd/v1/sidecar underdir. - test_
files_ for_ source - Filter
all_test_files(fromfetch_all_test_file_paths) for those whose stem matchessource_file’s stem. Same logic asfind_indexed_test_filesbut avoids the per-call DB open. - trim_
for_ agent - Trim a JSON value for LLM consumption.
Type Aliases§
- File
Score Tuple - Per-row file score tuple shape used by the prepare-change pipeline. (score, file, layer, last_touched_days, hot, top_symbol, why)
- Result
- Symbol
Tier - Symbol tier — controls default inclusion and scoring penalty.