Conformance checker for the workspace's browser extensions (sprint 4.45): the Gate 1.5.6 input guard, the parse-cleanliness probe, and `check` — loads docs/reference/extension-standard.tsv through closed enums, reads the manifest and extension.toml, and answers every applicable row; kinds without an evaluator answer unsupported, which fails the gate.
| Tier | tools |
| Role | tooling |
| Path | crates/tools/extension-conformance |
| Edition | 2021 |
| Targets | tools-extension-conformance, tools_extension_conformance, cli_test |
| Public items | 118 across 11 modules |
| Tests | 169 |
What it is for
Conformance checker for the workspace's browser extensions (sprint 4.45): the standard is a table, this reads it. Sprint doc: docs/userstories/sprint-4.45-the-extension-standard-is-a-table-and-the-checker-reads-it.md; seed: the sprint 4.44 audit (B-066..B-071). Dependencies: tree-sitter and tree-sitter-javascript (the syntax frontend, approved 2026-09-04), clap, serde, toml, tools-doc-truth (the cadence reader); clap's usage errors exit 2.
The two extensions under extensions/ are instances of the standard in docs/reference/extension-standard.tsv (two classes, site-bound and general-automation; each declares its class in extension.toml). Each row is a rule instance: a predicate kind with parameters, evaluated over the manifest, the descriptor, the README and the authored sources. A construct outside a kind's analysis subset is reported as unsupported, never passed, and unsupported fails the gate like failed (decision 2). This README is generated from this block; the per-kind readings, with what each passes unseen, are stated in the module headers named below.
# Commands
parse-probe <dir> --json— admit a directory, parse every authored.jswith
tree-sitter-javascript, report per-file ERROR/MISSING counts and the vendored and symlinked paths not read. Exit 0 clean · 1 any unclean file · 2 refused by the guard or no repository root · 3 a read or parse failed after admission.
check <dir> --json --today YYYY-MM-DD— guard, read the manifest, the
descriptor and the README (the README under the descriptor cap, after admission), load the table, evaluate every row that applies to the class, print one line per rule (rule status location detail). Exit 0 when no row is failed or unsupported (warn, finding, exempt do not fail) · 1 otherwise · 2 refused · 3 read failed. --json emits schema extension-conformance.check/1, which operations-test-results-ingest from-conformance - records as one ledger run.
check --staged --json --today …— the extensions the staged paths touch,
each evaluated whole against the index (decision 5; module staged): the snapshot being committed, not the working tree. --json emits extension-conformance.check-staged/1 with one check/1 report per evaluated extension; a selected directory with no file left under it in the index is listed under removed and evaluated by nothing. The pre-commit stage in .githooks/pre-commit runs it when a path under extensions/ is staged (AC 6). This is the crate's one subprocess: git by name with fixed argument vectors, output capped.
template <site-bound|general-automation> <name>— scaffoldextensions/<name>
from the class's embedded template (module template); an existing directory is refused. The committed extensions/TEMPLATE-* directories are this rendering, and a test holds them equal to the embedded sources (AC 7: a scaffold passes check with nothing failing or unsupported).
# The guard (Gate 1.5.6)
guard: fs::canonicalize + repo-root prefix check on the directory; per-file byte cap and running file count checked from metadata during the walk, refusing at the first offender; symlinks neither followed nor admitted, named in the report. Exactly one file is read before admission — the extension's extension.toml — after its own canonicalize + prefix check and a 64 KiB cap from metadata. No .js body is read by the guard; the tests make fixture files unreadable so a body read would surface as an Io error. probe and check read each admitted file under the same byte cap (a file that grew past it between guard and read is refused at read time). Hard links are not detected. No network, no database; no subprocess but git in --staged mode (above).
Vendored files — node_modules/, wasm/, *.min.js by default, plus vendored files = ... in extension.toml — are excluded from the walk and named as skipped. Entry grammar: name/ (one path component) matches a directory of that name at any depth; *.suffix matches files by name suffix at any depth; anything else is one file by exact relative path. Refused at load: a directory entry with more than one component, a wildcard anywhere but first, with nothing after it, or with a trailing /, a .. or . component, a repeated separator, an absolute path, an empty entry. layout development uses the same grammar.
# The rows and their readers
rules— loads the table intoRulerows through closed enums for class,
predicate kind, decidable and severity; a row outside any enum, a missing column, a duplicate id or an empty table is a load error. A table defect at evaluation (a query that does not compile, an unknown scope token, a missing parameter) is failed at the table path with severity and exemptions not applied.
descriptor—extension.toml:extension class(required, closed), `adr
host_permissions (four digits; E2 matches <id>-*.md under docs/architecture/adr), layout development (E8 excludes the files it names, a directory entry at any depth), [exempt] rows (rule, non-empty reason, ISO since`; anything else refuses the descriptor; an exemption naming a rule that produced no verdict is a failed verdict).
manifest— MV3 only: permissions, host permissions, content scripts, web
accessible resources, the extension-pages CSP, the background service worker; page_loadable (a resource a page can fetch, or a "world": "MAIN" script) and MatchPattern with Chrome's grammar (ws compares as http, wss as https).
evaluate—manifest_subset(E1, E11: every string literal spelling an
http(s)/ws(s) URL falls inside a host permission; a template URL with a substitution is unsupported; a URL built by concatenation is not visible), manifest_key (E2, E12), owner (J2), single_file_query (E9: the table's tree-sitter query, compiled once, scoped by manifest section, a hit when the named capture mentions a top-level declaration), cross_file_producer (E4, reader in messages), call_site_guard (E5, reader in guards), dominance_gate (E3, E7, E8, E10, readers in dominance, selected by site=), doc_code_agreement (E6: the README's cadence claims against the background worker, decided by tools_doc_truth::cadence, registered there as D15), pair_emission (J1: the flows of every file, reader in flows, paired by side-effect class and cut into tools_packet_compile::flow_pair::FlowPairShard packets carried on the verdict — digests, enums and counts, validated before they are carried; the commit they pin is read from .git by head_commit, no subprocess). Every kind has an evaluator. A failed verdict's detail also lists the rule's sites outside the reading.
query— a table-held tree-sitter query over one file;top_level_names,
top_level_unread.
# Where it sits
Tier tools. Invoked by the operator (cargo run -q -p tools-extension-conformance -- check extensions/<x>) and, at pre-commit, by the stage in .githooks/pre-commit for staged extensions/ paths. The tree-sitter loading is marked as a candidate for a foundation- crate the day a second consumer wants it.
Capabilities
crate root
Conformance checker for the workspace's browser extensions (sprint 4.45): the
| Item |
|---|
pub const DEFAULT_MAX_FILE_BYTES: u64 |
pub const DEFAULT_MAX_FILES: usize |
pub const DESCRIPTOR_MAX_BYTES: u64 |
pub const EXTENSION_TOML: & str |
fn find_repo_root(start : & Path) -> Option <PathBuf> |
fn guard(repo_root : & Path, dir : & Path, limits : Limits) -> Result <Admitted, GuardError> |
fn probe(repo_root : & Path, admitted : & Admitted, limits : Limits,) -> Result <Vec <ParseReport>, GuardError> |
pub const GIT_POINTER_MAX_BYTES: u64 |
pub const PACKED_REFS_MAX_BYTES: u64 |
fn head_commit(repo_root : & Path) -> Option <String> |
Admitted
Conformance checker for the workspace's browser extensions (sprint 4.45): the
| Item |
|---|
pub struct Admitted |
GuardError
Conformance checker for the workspace's browser extensions (sprint 4.45): the
| Item |
|---|
pub enum GuardError |
fn read_capped(path : & Path, rel : & Path, cap : u64) -> Result <String, GuardError> |
fn read_extension_doc(root : & Path, rel : & Path) -> Result <Option <String>, GuardError> |
Limits
Conformance checker for the workspace's browser extensions (sprint 4.45): the
| Item |
|---|
pub struct Limits |
Limits :: fn default() -> Self |
ParseReport
Conformance checker for the workspace's browser extensions (sprint 4.45): the
| Item |
|---|
pub struct ParseReport |
fn probe_source(file : & Path, source : & str) -> ParseReport |
Vendored
Conformance checker for the workspace's browser extensions (sprint 4.45): the
| Item |
|---|
pub struct Vendored |
Vendored :: fn defaults() -> Self |
Vendored :: fn for_extension(root : & Path, dir : & Path) -> Result <Self, GuardError> |
Vendored :: fn from_descriptor_text(text : & str, path : PathBuf) -> Result <Self, GuardError> |
Vendored :: fn matches(& self, rel : & Path, is_dir : bool) -> bool |
descriptor (other)
extension.toml — the descriptor beside manifest.json.
| Item |
|---|
fn is_adr_id(id : & str) -> bool |
fn is_rule_id(id : & str) -> bool |
Descriptor
extension.toml — the descriptor beside manifest.json.
| Item |
|---|
pub struct Descriptor |
Descriptor :: fn parse(text : & str) -> Result <Self, DescriptorError> |
Descriptor :: fn read(dir : & Path) -> Result <Self, DescriptorError> |
Descriptor :: fn exemption(& self, rule_id : & str) -> Option <& Exempt> |
DescriptorError
extension.toml — the descriptor beside manifest.json.
| Item |
|---|
pub enum DescriptorError |
Exempt
extension.toml — the descriptor beside manifest.json.
| Item |
|---|
pub struct Exempt |
Against
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub enum Against |
Compared
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct Compared |
EffectGate
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub enum EffectGate |
Gate
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct Gate |
GateSource
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub enum GateSource |
GatedSite
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct GatedSite |
GatedSites
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct GatedSites |
fn api_registrations(source : & str, api : & str, method : & str, filter : & str) -> GatedSites |
fn first_timer_or_observer(source : & str) -> GatedSites |
ListenerFacts
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct ListenerFacts |
fn message_listener_sites(source : & str) -> ListenerFacts |
ListenerSite
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct ListenerSite |
Operand
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub enum Operand |
SideEffect
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct SideEffect |
SinkSite
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct SinkSite |
Sinks
Sites and the gates that dominate them, as the dominance_gate kind reads them
| Item |
|---|
pub struct Sinks |
fn dynamic_code_sinks(source : & str) -> Sinks |
evaluate (other)
Evaluate the rule table against one admitted extension.
| Item |
|---|
fn params(column : & str) -> BTreeMap <String, String> |
fn evaluate(rules : & Rule, ctx : & Context <'_>) -> Vec <Verdict> |
fn evaluator(kind : PredicateKind) -> Option <Evaluator> |
fn built_kinds() -> Vec <PredicateKind> |
Context
Evaluate the rule table against one admitted extension.
| Item |
|---|
pub struct Context<'a> |
Status
Evaluate the rule table against one admitted extension.
| Item |
|---|
pub enum Status |
Status :: fn as_str(self) -> & 'static str |
Status :: fn fails_gate(self) -> bool |
UrlLiterals
Evaluate the rule table against one admitted extension.
| Item |
|---|
pub struct UrlLiterals |
fn url_literals(source : & str) -> UrlLiterals |
Verdict
Evaluate the rule table against one admitted extension.
| Item |
|---|
pub struct Verdict |
Flow
Flows that end in a real-world action, as the pair_emission kind reads them (J1).
| Item |
|---|
pub struct Flow |
fn flows(source : & str) -> Vec <Flow> |
CallSite
In-flight guards around a call, as the call_site_guard kind reads them (E5).
| Item |
|---|
pub struct CallSite |
GuardFacts
In-flight guards around a call, as the call_site_guard kind reads them (E5).
| Item |
|---|
pub struct GuardFacts |
fn guard_facts(source : & str) -> GuardFacts |
manifest (other)
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
fn glob_matches(glob : & str, text : & str) -> bool |
fn any_covers(patterns : & String, url : & str) -> bool |
Background
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub struct Background |
ContentScript
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub struct ContentScript |
ContentSecurityPolicy
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub struct ContentSecurityPolicy |
Host
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub enum Host |
Manifest
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub struct Manifest |
Manifest :: fn parse(json : & str) -> Result <Self, ManifestError> |
Manifest :: fn page_loadable(& self) -> PageLoadable |
Manifest :: fn is_page_loadable(& self, rel : & str) -> bool |
ManifestError
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub enum ManifestError |
MatchPattern
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub struct MatchPattern |
MatchPattern :: fn parse(pattern : & str) -> Result <Self, PatternError> |
MatchPattern :: fn covers(& self, url : & str) -> bool |
PageLoadable
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub struct PageLoadable |
PatternError
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub enum PatternError |
Port
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub enum Port |
Scheme
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub enum Scheme |
WebAccessible
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub struct WebAccessible |
World
manifest.json as the checker reads it, and Chrome match patterns.
| Item |
|---|
pub enum World |
Listener
window.postMessage producers and message listeners, as the cross-file rule reads
| Item |
|---|
pub struct Listener |
ListenerConstant
window.postMessage producers and message listeners, as the cross-file rule reads
| Item |
|---|
pub struct ListenerConstant |
MessageFacts
window.postMessage producers and message listeners, as the cross-file rule reads
| Item |
|---|
pub struct MessageFacts |
fn message_facts(source : & str, fields : & String) -> MessageFacts |
Producer
window.postMessage producers and message listeners, as the cross-file rule reads
| Item |
|---|
pub struct Producer |
query (other)
Tree-sitter queries held in the table, run over one file.
| Item |
|---|
fn run_query(source : & str, query : & str) -> Result <Vec <Match>, QueryError> |
fn top_level_names(source : & str) -> BTreeSet <String> |
fn top_level_unread(source : & str) -> Vec <(usize, & 'static str)> |
Capture
Tree-sitter queries held in the table, run over one file.
| Item |
|---|
pub struct Capture |
Match
Tree-sitter queries held in the table, run over one file.
| Item |
|---|
pub type Match: BTreeMap <String, Capture> |
QueryError
Tree-sitter queries held in the table, run over one file.
| Item |
|---|
pub enum QueryError |
fn compile(query : & str) -> Result <Vec <String>, QueryError> |
rules (other)
The rule table, loaded from docs/reference/extension-standard.tsv.
| Item |
|---|
pub const TABLE_PATH: & str |
pub const TABLE_MAX_BYTES: u64 |
fn parse_table(text : & str) -> Result <Vec <Rule>, TableError> |
fn is_iso_date(d : & str) -> bool |
fn load_table(repo_root : & Path) -> Result <Vec <Rule>, TableError> |
Applies
The rule table, loaded from docs/reference/extension-standard.tsv.
| Item |
|---|
pub enum Applies |
Class
The rule table, loaded from docs/reference/extension-standard.tsv.
| Item |
|---|
pub enum Class |
Decidable
The rule table, loaded from docs/reference/extension-standard.tsv.
| Item |
|---|
pub enum Decidable |
PredicateKind
The rule table, loaded from docs/reference/extension-standard.tsv.
| Item |
|---|
pub enum PredicateKind |
Rule
The rule table, loaded from docs/reference/extension-standard.tsv.
| Item |
|---|
pub struct Rule |
Severity
The rule table, loaded from docs/reference/extension-standard.tsv.
| Item |
|---|
pub enum Severity |
TableError
The rule table, loaded from docs/reference/extension-standard.tsv.
| Item |
|---|
pub enum TableError |
staged (other)
check --staged — the extensions a commit touches, evaluated whole against the
| Item |
|---|
fn staged_paths(root : & Path, cap : u64) -> Result <Vec <PathBuf>, GuardError> |
fn extensions_touched(paths : & PathBuf) -> Vec <PathBuf> |
fn index_files(root : & Path, dir : & Path, cap : u64) -> Result <Vec <PathBuf>, GuardError> |
fn index_read(root : & Path, path : & Path, cap : u64) -> Result <String, GuardError> |
template (other)
template <class> <name> — the standard's executable form (sprint 4.45 task 7).
| Item |
|---|
pub const FILES: & str; 4 |
fn source(class : Class, file : & str) -> Option <& 'static str> |
fn render(class : Class, file : & str, name : & str) -> Option <String> |
fn valid_name(name : & str) -> bool |
TemplateError
template <class> <name> — the standard's executable form (sprint 4.45 task 7).
| Item |
|---|
pub enum TemplateError |
fn scaffold(repo_root : & Path, class : Class, name : & str) -> Result <PathBuf, TemplateError> |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
tools_extension_conformance
descriptordominanceevaluateflowsguardsmanifestmessagesqueryrulesstagedtemplate
flowchart TD n_tools_extension_conformance["tools_extension_conformance"] n_tools_extension_conformance --> n_descriptor["descriptor"] n_tools_extension_conformance --> n_dominance["dominance"] n_tools_extension_conformance --> n_evaluate["evaluate"] n_tools_extension_conformance --> n_flows["flows"] n_tools_extension_conformance --> n_guards["guards"] n_tools_extension_conformance --> n_manifest["manifest"] n_tools_extension_conformance --> n_messages["messages"] n_tools_extension_conformance --> n_query["query"] n_tools_extension_conformance --> n_rules["rules"] n_tools_extension_conformance --> n_staged["staged"] n_tools_extension_conformance --> n_template["template"]
Public surface
`crate root`
| Item | What it is |
|---|---|
pub const DEFAULT_MAX_FILE_BYTES: u64 | Byte cap per file, read from metadata before that file's body is read (Gate 1.5.6). |
pub const DEFAULT_MAX_FILES: usize | File cap per run (Gate 1.5.6). |
pub const DESCRIPTOR_MAX_BYTES: u64 | Byte cap on extension.toml itself, read from metadata before the read. |
pub const EXTENSION_TOML: & str | The name of the per-extension descriptor read for the vendored list. |
pub struct Limits | Input bounds |
Limits :: fn default() -> Self | — |
pub enum GuardError | Why a directory was refused, or a read failed |
pub struct Admitted | What the guard admitted, and what it set aside by name. |
pub struct Vendored | The vendored list: defaults plus an extension's own vendored files |
Vendored :: fn defaults() -> Self | The list every extension gets without saying so. |
Vendored :: fn for_extension(root : & Path, dir : & Path) -> Result <Self, GuardError> | Defaults plus the vendored files array of <dir>/extension.toml, when present |
Vendored :: fn from_descriptor_text(text : & str, path : PathBuf) -> Result <Self, GuardError> | Defaults plus the vendored files array of a descriptor's text — the same reading for_extension applies to the file on disk, for a descriptor read from the index (check --staged) |
Vendored :: fn matches(& self, rel : & Path, is_dir : bool) -> bool | Whether a path relative to the extension directory is vendored. |
fn find_repo_root(start : & Path) -> Option <PathBuf> | Walk up from start to the directory holding .git |
fn guard(repo_root : & Path, dir : & Path, limits : Limits) -> Result <Admitted, GuardError> | Admit an extension directory (Gate 1.5.6) |
pub struct ParseReport | Per-file parse-cleanliness measurement. |
fn probe_source(file : & Path, source : & str) -> ParseReport | Parse one JavaScript source and count ERROR and MISSING nodes |
fn read_capped(path : & Path, rel : & Path, cap : u64) -> Result <String, GuardError> | Read one admitted file under the byte cap |
fn probe(repo_root : & Path, admitted : & Admitted, limits : Limits,) -> Result <Vec <ParseReport>, GuardError> | Parse every admitted file |
pub const GIT_POINTER_MAX_BYTES: u64 | Byte cap on each .git file head_commit reads (HEAD, a gitdir: pointer, a commondir, one loose ref): none is more than a line. |
pub const PACKED_REFS_MAX_BYTES: u64 | Byte cap on packed-refs, one line per ref. |
fn head_commit(repo_root : & Path) -> Option <String> | The commit HEAD names, read from the repository's own files with no subprocess: .git/HEAD (or, in a worktree, the directory the .git file's gitdir: line names — followed as written, since a worktree's git dir legitimately sits outside the worktree), then the loose ref it names (in the git dir, then the common dir), then packed-refs in the common dir |
fn read_extension_doc(root : & Path, rel : & Path) -> Result <Option <String>, GuardError> | Read one extension document (a README a rule's doc= names) the way the descriptor is read: a symlink is refused unread (the walk admits no symlink, and a document is no different), the path is canonicalized and prefix-checked against root, and the size is checked from metadata against DESCRIPTOR_MAX_BYTES before the read |
`descriptor`
| Item | What it is |
|---|---|
pub enum DescriptorError | — |
pub struct Exempt | — |
pub struct Descriptor | The descriptor, validated. |
fn is_adr_id(id : & str) -> bool | An ADR id as this repository names them: four ASCII digits. |
fn is_rule_id(id : & str) -> bool | A rule id as the table names them: E or J followed by digits. |
Descriptor :: fn parse(text : & str) -> Result <Self, DescriptorError> | — |
Descriptor :: fn read(dir : & Path) -> Result <Self, DescriptorError> | Read <dir>/extension.toml under the descriptor cap |
Descriptor :: fn exemption(& self, rule_id : & str) -> Option <& Exempt> | The exemption row for a rule id, if any. |
`dominance`
| Item | What it is |
|---|---|
pub enum GateSource | Where a gate's tested value comes from. |
pub struct Gate | One condition dominating a site. |
pub struct GatedSite | A site with the gates that dominate it. |
pub struct GatedSites | Sites of a gated selector plus what the reading could not hold. |
pub enum Against | What a listener compares an event-data field against. |
pub struct Compared | — |
pub enum EffectGate | What dominates one side effect, read from the gates on its lexical path. |
pub struct SideEffect | — |
pub struct ListenerSite | A message listener (E3). |
pub struct ListenerFacts | — |
pub enum Operand | How a dynamic-code sink's operand reads. |
pub struct SinkSite | — |
pub struct Sinks | — |
fn message_listener_sites(source : & str) -> ListenerFacts | E3 sites of one file. |
fn api_registrations(source : & str, api : & str, method : & str, filter : & str) -> GatedSites | E7 sites of one file: <api>.<event>.<method>(…, { urls: filter }). |
fn first_timer_or_observer(source : & str) -> GatedSites | E8 site of one file: the first timer or observer, if any. |
fn dynamic_code_sinks(source : & str) -> Sinks | E10 sites of one file. |
`evaluate`
| Item | What it is |
|---|---|
pub enum Status | — |
Status :: fn as_str(self) -> & 'static str | The wire spelling, as --json and the text report print it. |
Status :: fn fails_gate(self) -> bool | Whether this status fails the commit gate (decision 2). |
pub struct Verdict | — |
pub struct Context<'a> | Everything an evaluator may read |
fn params(column : & str) -> BTreeMap <String, String> | Parse a key=value;key=value parameter column into a map |
fn evaluate(rules : & Rule, ctx : & Context <'_>) -> Vec <Verdict> | One verdict per row that applies to the extension's class, plus one failed verdict per exemption that names no such row. |
fn evaluator(kind : PredicateKind) -> Option <Evaluator> | The evaluator for a kind, or None while it is not built |
fn built_kinds() -> Vec <PredicateKind> | The kinds with an evaluator, derived from evaluator — the record cites this list; the code consults the function. |
pub struct UrlLiterals | What url_literals found: literal URLs with their lines, and the lines of template strings that carry a substitution and a fragment beginning with a URL scheme. |
fn url_literals(source : & str) -> UrlLiterals | String literals in a JavaScript source that spell an http(s)/ws(s) URL, with their 1-based lines |
`flows`
| Item | What it is |
|---|---|
pub struct Flow | One flow: a unit that reaches an action. |
fn flows(source : & str) -> Vec <Flow> | The flows of one file. |
`guards`
| Item | What it is |
|---|---|
pub struct CallSite | A call to a wrapper-guarded callee. |
pub struct GuardFacts | — |
fn guard_facts(source : & str) -> GuardFacts | Read one file's guards. |
`manifest`
| Item | What it is |
|---|---|
pub enum ManifestError | — |
pub enum World | The world a content script runs in. |
pub struct ContentScript | — |
pub struct WebAccessible | — |
pub struct ContentSecurityPolicy | — |
pub struct Manifest | The manifest fields the rules read |
pub struct Background | MV3 background: the service worker file, extension-relative. |
pub struct PageLoadable | What a page can load: fetchable resource patterns and the scripts that execute in the page's realm. |
Manifest :: fn parse(json : & str) -> Result <Self, ManifestError> | Parse a manifest.json body |
Manifest :: fn page_loadable(& self) -> PageLoadable | The page-loadable set (see module docs). |
Manifest :: fn is_page_loadable(& self, rel : & str) -> bool | Whether an extension-relative path is page-loadable: listed as a MAIN-world script, or matched by a web_accessible_resources glob. |
fn glob_matches(glob : & str, text : & str) -> bool | * matches any run of characters, including /; everything else is literal |
pub struct MatchPattern | A Chrome match pattern, parsed. |
pub enum Scheme | — |
pub enum Port | A port constraint on an exact host. |
pub enum Host | — |
pub enum PatternError | — |
MatchPattern :: fn parse(pattern : & str) -> Result <Self, PatternError> | — |
MatchPattern :: fn covers(& self, url : & str) -> bool | Whether a literal URL (scheme://host:port/path...) falls inside this pattern |
fn any_covers(patterns : & String, url : & str) -> bool | Whether url falls inside any of patterns; a pattern that does not parse is skipped, the caller having reported it on its own row. |
`messages`
| Item | What it is |
|---|---|
pub struct ListenerConstant | One constant a listener compares an event-data field against. |
pub struct Listener | A message listener and what it compares. |
pub struct Producer | A produced constant: postMessage({ <field>: '<value>' }) on the window channel. |
pub struct MessageFacts | — |
fn message_facts(source : & str, fields : & String) -> MessageFacts | Read one file's listeners and producers for the given fields. |
`query`
| Item | What it is |
|---|---|
pub enum QueryError | — |
pub struct Capture | One capture of one match. |
pub type Match: BTreeMap <String, Capture> | One match: capture name (without @) → capture. |
fn compile(query : & str) -> Result <Vec <String>, QueryError> | Compile query against the grammar without running it — the check a row gets once, before any file is read — and return its capture names (without @), so a row's top_level_reference can be checked against what the query defines. |
fn run_query(source : & str, query : & str) -> Result <Vec <Match>, QueryError> | Compile query and run it over source. |
fn top_level_names(source : & str) -> BTreeSet <String> | Names declared at the top level of the file. |
fn top_level_unread(source : & str) -> Vec <(usize, & 'static str)> | Top-level constructs top_level_names does not read, with their lines: a let/const/var declarator whose name is a pattern (destructuring), and an export statement (whatever it declares or re-exports) |
`rules`
| Item | What it is |
|---|---|
pub const TABLE_PATH: & str | Repo-relative path of the table. |
pub const TABLE_MAX_BYTES: u64 | Byte cap on the table, read from metadata before the read (Gate 1.5.6). |
pub enum Class | The two extension classes the standard names. |
pub enum Applies | Which rows apply to a given extension class. |
pub enum PredicateKind | The closed set of predicate kinds |
pub enum Decidable | — |
pub enum Severity | — |
pub struct Rule | — |
pub enum TableError | — |
fn parse_table(text : & str) -> Result <Vec <Rule>, TableError> | Parse the table text |
fn is_iso_date(d : & str) -> bool | YYYY-MM-DD by shape: ten characters, digits with - at positions 4 and 7 |
fn load_table(repo_root : & Path) -> Result <Vec <Rule>, TableError> | Load the table from the repository root. |
`staged`
| Item | What it is |
|---|---|
fn staged_paths(root : & Path, cap : u64) -> Result <Vec <PathBuf>, GuardError> | The repo-relative paths staged for commit — added, copied, modified, renamed and deleted: a deleted listener file changes the extension as much as an edited one, and the snapshot after the deletion is what runs |
fn extensions_touched(paths : & PathBuf) -> Vec <PathBuf> | The extension directories (extensions/<name>) the staged paths touch, in order. |
fn index_files(root : & Path, dir : & Path, cap : u64) -> Result <Vec <PathBuf>, GuardError> | Every tracked regular file under dir in the index, repo-relative |
fn index_read(root : & Path, path : & Path, cap : u64) -> Result <String, GuardError> | One file's content as staged (git show :<path>), under cap bytes |
`template`
| Item | What it is |
|---|---|
pub const FILES: & str; 4 | One embedded template file: its extension-relative path and its text. |
fn source(class : Class, file : & str) -> Option <& 'static str> | The embedded text of templates/<class>/<file>. |
fn render(class : Class, file : & str, name : & str) -> Option <String> | A template file rendered for name. |
pub enum TemplateError | Why a scaffold was refused. |
fn valid_name(name : & str) -> bool | Whether a name is one path component of the allowed alphabet: A-Za-z0-9A-Za-z0-9-* — no separator, no dot, no space. |
fn scaffold(repo_root : & Path, class : Class, name : & str) -> Result <PathBuf, TemplateError> | Write the class's files to <repo_root>/extensions/<name>/, refusing an existing directory |
No pub use re-exports: every item above is declared in this crate.
Boundary
Depends on no other workspace tier.
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) | tooling |
| Location | crates/tools/extension-conformance |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `tools-doc-truth` | tools | no | always |
| `tools-packet-compile` | tools | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
clap | ^4 | derive | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
thiserror | ^2 | — | no | always |
toml | ^0.8 | — | no | always |
tree-sitter | ^0.25 | — | no | always |
tree-sitter-javascript | ^0.25 | — | no | always |
Development, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `tools-cli-conformance` | tools | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tempfile | ^3 | — | no | always |
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["tools-extension-conformance"] SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"] SELF -->|runtime| n_tools_doc_truth["tools-doc-truth"] SELF -->|runtime| n_tools_packet_compile["tools-packet-compile"] 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-extension-conformance | `src/main.rs` |
| lib | tools_extension_conformance | `src/lib.rs` |
| test | cli_test | `tests/cli_test.rs` |
Error model
| Error type | Named by |
|---|---|
DescriptorError | declared, no public signature returns it |
GuardError | guard, index_files, index_read, probe, read_capped, read_extension_doc, … (7 total) |
ManifestError | declared, no public signature returns it |
PatternError | declared, no public signature returns it |
QueryError | compile, run_query |
TableError | load_table, parse_table |
TemplateError | scaffold |
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| 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/descriptor.rs |
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 153 |
| Integration tests | 16 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 18 | 0 | 0 |
descriptor | 5 | 0 | 0 |
dominance | 17 | 0 | 0 |
evaluate | 9 | 0 | 0 |
flows | 2 | 0 | 0 |
guards | 3 | 0 | 0 |
manifest | 15 | 0 | 0 |
messages | 5 | 0 | 0 |
query | 7 | 0 | 0 |
rules | 12 | 0 | 0 |
staged | 4 | 0 | 0 |
template | 6 | 0 | 0 |
What the tests establish, by name:
a_directory_outside_the_repository_is_refused_with_exit_two_and_unread—tests/cli_test.rsa_read_failure_after_admission_exits_three_not_two—tests/cli_test.rsan_unclean_file_exits_one_and_is_named—tests/cli_test.rsbare_invocation_prints_usage_not_a_bare_error—tests/cli_test.rscheck_exits_zero_when_every_unbuilt_row_is_exempt_and_the_built_rows_pass—tests/cli_test.rscheck_fails_e1_and_e11_and_names_the_permission_and_the_url—tests/cli_test.rscheck_reads_the_admitted_directory_whatever_the_shell_cwd_is—tests/cli_test.rscheck_reads_the_readme_for_e6_and_refuses_a_symlinked_one_unread—tests/cli_test.rscheck_refuses_a_malformed_today_and_reports_development_layout—tests/cli_test.rscheck_reports_every_applicable_rule_and_exits_one_while_any_row_is_unsupported—tests/cli_test.rscheck_staged_evaluates_the_index_snapshot_not_the_working_tree—tests/cli_test.rscheck_staged_reports_a_whole_extension_removal_and_evaluates_nothing—tests/cli_test.rscheck_without_a_descriptor_exits_three_with_the_file_named—tests/cli_test.rsclean_extension_exits_zero_and_lists_each_file—tests/cli_test.rstemplate_scaffolds_an_extension_that_passes_check_with_nothing_failing—tests/cli_test.rsvendored_files_are_named_as_skipped_not_parsed—tests/cli_test.rsa_descriptor_over_the_cap_is_refused_at_read—src/descriptor.rsa_layout_entry_in_an_unimplemented_form_is_refused—src/descriptor.rsan_adr_citation_is_four_digits_or_refused—src/descriptor.rsan_exemption_is_typed_a_rule_id_a_reason_and_a_date—src/descriptor.rsclass_is_required_and_closed—src/descriptor.rsthe_two_committed_descriptors_parse—src/descriptor.rsa_filter_urls_array_with_a_non_literal_element_is_unread—src/dominance.rsa_gate_is_read_with_the_truth_value_the_effect_requires—src/dominance.rsa_listener_that_writes_outer_state_after_a_literal_comparison_is_a_site—src/dominance.rsa_listener_with_no_side_effect_has_none_and_an_unread_handler_says_so—src/dominance.rsa_literal_composed_operand_is_not_a_site_and_anything_else_is_untracked—src/dominance.rsa_registration_at_module_level_in_a_bare_try_has_no_gate—src/dominance.rsa_remove_or_has_listener_reference_is_not_unread—src/dominance.rsa_storage_callback_parameter_and_a_name_assigned_inside_it_are_storage_reads—src/dominance.rs- _… 139 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 92 | 118 |
Public modules with a //! block | 11 | 11 |
pie showData
title Public items with rustdoc
"Documented" : 92
"No rustdoc detected" : 26
Metrics
| Metric | Value |
|---|---|
| Rust source files | 13 |
| Source lines | 10639 |
| Code lines | 8814 |
| Public API items | 118 |
| Public modules | 11 |
| Tests | 169 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 9 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"constant" : 9
"enum" : 21
"function" : 38
"method" : 15
"struct" : 34
"type alias" : 1
pie showData
title Rust source composition
"Code" : 8814
"Blank or comment" : 1825
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.