Source-repository inventory: project discovery, technology-stack detection, git facts behind an injectable seam, and incremental re-scan watermarks. Assessment, not mutation.
| Tier | operations |
| Role | unclassified (baselined) |
| Path | crates/operations/repo-inventory |
| Edition | 2021 |
| Targets | scan_report, operations_repo_inventory |
| Public items | 97 across 10 modules |
| Tests | 95 |
What it is for
Source-repository inventory: discover project directories, detect their technology stack, read git facts through an injectable seam, and compute watermarks so an unchanged repository is skipped on re-scan.
# Posture: assessment, not mutation
This crate never writes to a scanned repository. No commit, no checkout, no config change, no hook execution, no network fetch. Every git subcommand it invokes is read-only and drawn from an allowlist. This mirrors operations-net-discovery's "assessment, not exploitation" invariant (ADR 0001).
# Shape
Pure models and pure functions, with exactly one I/O seam (GitRunner, landing in T-1.3.1). default = — the crate compiles and unit-tests with --no-default-features and performs zero I/O, so detect_stack and the watermark logic are testable without a filesystem or a git binary.
# Two levels, deliberately
A repository and a working tree are not the same thing. Repository holds stable logical identity; Worktree holds mutable per-checkout state. Repository carries no head, branch, or dirty field at all — with several worktrees on divergent branches, any single such field on the parent would be false. See ADR 0001 A-2.
GitRunner: https://docs.rs/operations-repo-inventory detect_stack: crate::detect_stack
Capabilities
Discovery
Project discovery: enumerate every directory under a scan root and say what each one is.
| Item |
|---|
pub struct Discovery |
Discovery :: fn degraded_count(& self) -> usize |
fn discover <H : ScanHost>(host : & H, root : & Path) -> Result <Discovery, ScanError> |
RepoKind
Project discovery: enumerate every directory under a scan root and say what each one is.
| Item |
|---|
pub enum RepoKind |
RepoRef
Project discovery: enumerate every directory under a scan root and say what each one is.
| Item |
|---|
pub struct RepoRef |
ScanError
Errors raised while scanning.
| Item |
|---|
pub enum ScanError |
ScanError :: fn is_systemic(& self) -> bool |
git (other)
Git fact collection over the GitRunner seam.
| Item |
|---|
pub const MAX_LOG_COMMITS: usize |
pub const MAX_STATUS_ENTRIES: usize |
fn fingerprint_status(stdout : & u8) -> String |
fn status_args() -> Vec <& 'static str> |
fn log_args(max_commits : usize) -> Vec <String> |
GitFacts
Git fact collection over the GitRunner seam.
| Item |
|---|
pub struct GitFacts |
fn git_facts <R : GitRunner>(runner : & R, worktree : & Path) -> Result <GitFacts, ScanError> |
StatusEntry
Git fact collection over the GitRunner seam.
| Item |
|---|
pub struct StatusEntry |
DirEntryInfo
The ScanHost seam: every filesystem read flows through this trait.
| Item |
|---|
pub struct DirEntryInfo |
EntryKind
The ScanHost seam: every filesystem read flows through this trait.
| Item |
|---|
pub enum EntryKind |
ScanHost
The ScanHost seam: every filesystem read flows through this trait.
| Item |
|---|
pub trait ScanHost |
SystemScanHost
The ScanHost seam: every filesystem read flows through this trait.
| Item |
|---|
pub struct SystemScanHost |
SystemScanHost :: fn canonicalize(& self, path : & Path) -> Result <PathBuf, ScanError> |
SystemScanHost :: fn list_dir(& self, path : & Path) -> Result <Vec <DirEntryInfo>, ScanError> |
SystemScanHost :: fn entry_kind(& self, path : & Path) -> Result <EntryKind, ScanError> |
SystemScanHost :: fn identity(& self, path : & Path) -> Result <String, ScanError> |
SystemScanHost :: fn read_file_bounded(& self, path : & Path, max_bytes : usize) -> Result <String, ScanError> |
BranchState
The two-level repository model and the completeness vocabulary.
| Item |
|---|
pub enum BranchState |
Completeness
The two-level repository model and the completeness vocabulary.
| Item |
|---|
pub enum Completeness |
Oid
The two-level repository model and the completeness vocabulary.
| Item |
|---|
pub struct Oid |
Oid :: fn new(sha : impl Into <String>) -> Self |
Oid :: fn as_str(& self) -> & str |
RepoIdentity
The two-level repository model and the completeness vocabulary.
| Item |
|---|
pub struct RepoIdentity |
RepoIdentity :: fn new(id : impl Into <String>) -> Self |
RepoIdentity :: fn as_str(& self) -> & str |
Repository
The two-level repository model and the completeness vocabulary.
| Item |
|---|
pub struct Repository |
RunOutcome
The two-level repository model and the completeness vocabulary.
| Item |
|---|
pub enum RunOutcome |
Worktree
The two-level repository model and the completeness vocabulary.
| Item |
|---|
pub struct Worktree |
runner (other)
The GitRunner seam: every git invocation flows through this trait.
| Item |
|---|
pub const READ_ONLY_SUBCOMMANDS: & & str |
pub const STRIPPED_ENV: & & str |
pub const SAFETY_CONFIG: & & str |
pub const MAX_OUTPUT_BYTES: usize |
pub const DEFAULT_TIMEOUT: Duration |
fn check_read_only(args : & & str) -> Result <(), ScanError> |
GitOutput
The GitRunner seam: every git invocation flows through this trait.
| Item |
|---|
pub struct GitOutput |
GitRunner
The GitRunner seam: every git invocation flows through this trait.
| Item |
|---|
pub trait GitRunner |
SystemGitRunner
The GitRunner seam: every git invocation flows through this trait.
| Item |
|---|
pub struct SystemGitRunner |
SystemGitRunner :: fn discover() -> Result <Self, ScanError> |
SystemGitRunner :: fn with_binary(path : impl Into <PathBuf>) -> Result <Self, ScanError> |
SystemGitRunner :: fn with_timeout(mut self, timeout : Duration) -> Self |
SystemGitRunner :: fn binary(& self) -> & Path |
SystemGitRunner :: fn run(& self, cwd : & Path, args : & & str) -> Result <GitOutput, ScanError> |
scan (other)
Tying it together: discover, collect facts, roll worktrees up, and decide the run outcome.
| Item |
|---|
fn common_git_dir(parent_git_dir : & Path) -> PathBuf |
fn collect_facts <R : GitRunner>(runner : & R, worktree : & Path, verify_stability : bool,) -> Result <GitFacts, ScanError> |
Repository
The two-level repository model and the completeness vocabulary.
| Item |
|---|
Repository :: fn divergent_heads(& self) -> bool |
Repository :: fn head_count(& self) -> usize |
Repository :: fn worktree_count(& self) -> usize |
Repository :: fn dirty_worktree_count(& self) -> usize |
ScanReport
Tying it together: discover, collect facts, roll worktrees up, and decide the run outcome.
| Item |
|---|
pub struct ScanReport |
fn scan <R : GitRunner>(discovery : & Discovery, runner : & R, verify_stability : bool,) -> Result <ScanReport, ScanError> |
DetectedStack
Technology-stack detection: a pure function over a file listing.
| Item |
|---|
pub struct DetectedStack |
FileEntry
Technology-stack detection: a pure function over a file listing.
| Item |
|---|
pub struct FileEntry |
FileEntry :: fn file(relative_path : impl Into <String>) -> Self |
FileEntry :: fn dir(relative_path : impl Into <String>) -> Self |
ManifestIssue
Technology-stack detection: a pure function over a file listing.
| Item |
|---|
pub struct ManifestIssue |
Stack
Technology-stack detection: a pure function over a file listing.
| Item |
|---|
pub enum Stack |
fn detect_stack_detailed(entries : & FileEntry, contents : & BTreeMap <String, String>,) -> StackReport |
fn detect_stack(entries : & FileEntry) -> Vec <DetectedStack> |
StackReport
Technology-stack detection: a pure function over a file listing.
| Item |
|---|
pub struct StackReport |
FixtureGitRunner
Fixtures for testing consumers of the seams, without touching a real filesystem.
| Item |
|---|
pub struct FixtureGitRunner |
FixtureGitRunner :: fn new() -> Self |
FixtureGitRunner :: fn with_response(mut self, subcommand : & str, stdout : impl Into <Vec <u8>>) -> Self |
FixtureGitRunner :: fn with_truncated_response(mut self, subcommand : & str, stdout : impl Into <Vec <u8>>) -> Self |
FixtureGitRunner :: fn with_failure(mut self, subcommand : & str, stderr : impl Into <String>) -> Self |
FixtureGitRunner :: fn with_head_sequence(self, heads : & & str) -> Self |
FixtureGitRunner :: fn call_count(& self) -> usize |
FixtureGitRunner :: fn calls(& self) -> Vec <Vec <String>> |
FixtureGitRunner :: fn run(& self, _cwd : & StdPath, args : & & str) -> Result <GitOutput, ScanError> |
FixtureScanHost
Fixtures for testing consumers of the seams, without touching a real filesystem.
| Item |
|---|
pub struct FixtureScanHost |
FixtureScanHost :: fn new() -> Self |
FixtureScanHost :: fn with(mut self, path : impl Into <PathBuf>, entries : Vec <DirEntryInfo>) -> Self |
FixtureScanHost :: fn with_file(mut self, path : impl Into <PathBuf>, contents : impl Into <String>) -> Self |
FixtureScanHost :: fn with_link(mut self, path : impl Into <PathBuf>, target : impl Into <PathBuf>) -> Self |
FixtureScanHost :: fn unreadable(mut self, path : impl Into <PathBuf>) -> Self |
FixtureScanHost :: fn with_identity_sequence(self, path : impl Into <PathBuf>, ids : & & str) -> Self |
FixtureScanHost :: fn canonicalize(& self, path : & Path) -> Result <PathBuf, ScanError> |
FixtureScanHost :: fn list_dir(& self, path : & Path) -> Result <Vec <DirEntryInfo>, ScanError> |
FixtureScanHost :: fn entry_kind(& self, path : & Path) -> Result <EntryKind, ScanError> |
FixtureScanHost :: fn identity(& self, path : & Path) -> Result <String, ScanError> |
FixtureScanHost :: fn read_file_bounded(& self, path : & Path, max_bytes : usize) -> Result <String, ScanError> |
watermark (other)
Incremental re-scan watermarks.
| Item |
|---|
pub const SCANNER_VERSION: u32 |
pub const MAX_DIGEST_ENTRIES: usize |
pub const MAX_DIGEST_BYTES: usize |
fn status_digest(entries : & StatusEntry, contents : & BTreeMap <String, Vec <u8>>,) ->(String, bool, Option <String>) |
fn inventory_watermark(repo_identity : RepoIdentity, worktree_path : impl Into <String>, facts : & GitFacts, status_contents : & BTreeMap <String, Vec <u8>>, manifests : & HashInput,) -> InventoryWatermark |
fn decide(previous : Option <& InventoryWatermark>, current : & InventoryWatermark) -> ScanDecision |
HashInput
Incremental re-scan watermarks.
| Item |
|---|
pub struct HashInput |
fn manifest_digest(manifests : & HashInput) ->(String, bool, Option <String>) |
InventoryWatermark
Incremental re-scan watermarks.
| Item |
|---|
pub struct InventoryWatermark |
ScanDecision
Incremental re-scan watermarks.
| Item |
|---|
pub enum ScanDecision |
How to use it
From `examples/scan_report.rs`:
use std::collections::BTreeMap;
use std::path::PathBuf;
use operations_repo_inventory::{
discover, scan, Completeness, RepoKind, SystemGitRunner, SystemScanHost,
};
fn main() {
let root: PathBuf = std::env::args_os()
.nth(1)
.map_or_else(|| PathBuf::from("."), PathBuf::from);
let host = SystemScanHost;
let discovery = match discover(&host, &root) {
Ok(d) => d,
Err(e) => {
eprintln!("scan failed: {e}");
Module structure
operations_repo_inventory
discovererrorgithostmodelrunnerscanstacktestkitwatermark
flowchart TD n_operations_repo_inventory["operations_repo_inventory"] n_operations_repo_inventory --> n_discover["discover"] n_operations_repo_inventory --> n_error["error"] n_operations_repo_inventory --> n_git["git"] n_operations_repo_inventory --> n_host["host"] n_operations_repo_inventory --> n_model["model"] n_operations_repo_inventory --> n_runner["runner"] n_operations_repo_inventory --> n_scan["scan"] n_operations_repo_inventory --> n_stack["stack"] n_operations_repo_inventory --> n_testkit["testkit"] n_operations_repo_inventory --> n_watermark["watermark"]
Public surface
`discover`
| Item | What it is |
|---|---|
pub enum RepoKind | What a discovered directory turned out to be. |
pub struct RepoRef | One discovered directory. |
pub struct Discovery | The result of walking a scan root. |
Discovery :: fn degraded_count(& self) -> usize | How many entries are less than Complete. |
fn discover <H : ScanHost>(host : & H, root : & Path) -> Result <Discovery, ScanError> | Walk root and classify every immediate child directory |
`error`
| Item | What it is |
|---|---|
pub enum ScanError | Why a directory could not be fully inventoried. |
ScanError :: fn is_systemic(& self) -> bool | Whether this error invalidates the whole run rather than one entry |
`git`
| Item | What it is |
|---|---|
pub const MAX_LOG_COMMITS: usize | Maximum commits read from git log before the tally is declared incomplete. |
pub const MAX_STATUS_ENTRIES: usize | Maximum status entries recorded before the dirty-tree picture is declared incomplete. |
pub struct StatusEntry | One entry from git status --porcelain=v2 |
pub struct GitFacts | Deterministic facts about one working tree. |
fn fingerprint_status(stdout : & u8) -> String | Digest raw status output, for the bookended stability comparison |
fn status_args() -> Vec <& 'static str> | The status argument vector |
fn log_args(max_commits : usize) -> Vec <String> | The log argument vector, bounded to max_commits + 1 so truncation is detectable |
fn git_facts <R : GitRunner>(runner : & R, worktree : & Path) -> Result <GitFacts, ScanError> | Collect every deterministic git fact for one working tree, in two invocations |
`host`
| Item | What it is |
|---|---|
pub enum EntryKind | What a directory entry is, determined without following symlinks. |
pub struct DirEntryInfo | One entry in a directory listing. |
pub trait ScanHost | Read-only filesystem access |
pub struct SystemScanHost | Real filesystem access via std::fs. |
SystemScanHost :: fn canonicalize(& self, path : & Path) -> Result <PathBuf, ScanError> | — |
SystemScanHost :: fn list_dir(& self, path : & Path) -> Result <Vec <DirEntryInfo>, ScanError> | — |
SystemScanHost :: fn entry_kind(& self, path : & Path) -> Result <EntryKind, ScanError> | — |
SystemScanHost :: fn identity(& self, path : & Path) -> Result <String, ScanError> | — |
SystemScanHost :: fn read_file_bounded(& self, path : & Path, max_bytes : usize) -> Result <String, ScanError> | — |
`model`
| Item | What it is |
|---|---|
pub struct Oid | A git object id |
Oid :: fn new(sha : impl Into <String>) -> Self | Wrap a git object id. |
Oid :: fn as_str(& self) -> & str | The underlying hex string. |
pub struct RepoIdentity | Stable logical identity of a repository, independent of any checkout |
RepoIdentity :: fn new(id : impl Into <String>) -> Self | Wrap a repository identity. |
RepoIdentity :: fn as_str(& self) -> & str | The underlying identity string. |
pub enum BranchState | Which branch a working tree is on, if any |
pub enum Completeness | How much of a record could actually be established |
pub enum RunOutcome | How a whole scan ended |
pub struct Worktree | A single working tree: the mutable, per-checkout half of the model. |
pub struct Repository | A repository: the stable, logical half of the model |
`runner`
| Item | What it is |
|---|---|
pub struct GitOutput | Captured output of one git invocation. |
pub const READ_ONLY_SUBCOMMANDS: & & str | Subcommands this crate is permitted to invoke |
pub const STRIPPED_ENV: & & str | Environment variables that must never be inherited by a git child process |
pub const SAFETY_CONFIG: & & str | -c overrides that disable anything a scanned repository could use to run its own code |
pub const MAX_OUTPUT_BYTES: usize | Hard cap on captured stdout per invocation. |
pub const DEFAULT_TIMEOUT: Duration | Wall-clock cap on one invocation. |
pub trait GitRunner | Run read-only git subcommands against a working tree |
pub struct SystemGitRunner | Real git invocation via std::process::Command. |
SystemGitRunner :: fn discover() -> Result <Self, ScanError> | Build a runner using the first allowlisted git binary that exists |
SystemGitRunner :: fn with_binary(path : impl Into <PathBuf>) -> Result <Self, ScanError> | Build a runner with an explicit binary path |
SystemGitRunner :: fn with_timeout(mut self, timeout : Duration) -> Self | Override the per-invocation wall-clock cap. |
SystemGitRunner :: fn binary(& self) -> & Path | The pinned binary path. |
fn check_read_only(args : & & str) -> Result <(), ScanError> | Reject a subcommand that is not on the read-only allowlist |
SystemGitRunner :: fn run(& self, cwd : & Path, args : & & str) -> Result <GitOutput, ScanError> | — |
`scan`
| Item | What it is |
|---|---|
pub struct ScanReport | The result of a whole sweep. |
Repository :: fn divergent_heads(& self) -> bool | Whether the checkouts disagree about where HEAD is. |
Repository :: fn head_count(& self) -> usize | How many distinct HEADs the checkouts are on. |
Repository :: fn worktree_count(& self) -> usize | How many checkouts this repository has. |
Repository :: fn dirty_worktree_count(& self) -> usize | How many checkouts have uncommitted changes. |
fn common_git_dir(parent_git_dir : & Path) -> PathBuf | Reduce a worktree's gitdir: pointer to the common git directory it belongs to |
fn collect_facts <R : GitRunner>(runner : & R, worktree : & Path, verify_stability : bool,) -> Result <GitFacts, ScanError> | Collect facts for one working tree, optionally verifying the tree held still |
fn scan <R : GitRunner>(discovery : & Discovery, runner : & R, verify_stability : bool,) -> Result <ScanReport, ScanError> | Roll a Discovery up into the two-level model, collecting git facts as it goes |
`stack`
| Item | What it is |
|---|---|
pub struct FileEntry | One entry from a directory listing, as observed by the caller. |
FileEntry :: fn file(relative_path : impl Into <String>) -> Self | A regular file at relative_path. |
FileEntry :: fn dir(relative_path : impl Into <String>) -> Self | A directory at relative_path. |
pub enum Stack | A recognized technology stack. |
pub struct DetectedStack | A detected stack and the evidence for it |
pub struct ManifestIssue | A manifest that was found but could not be parsed |
pub struct StackReport | The full result of stack detection: what was found, and what would not parse. |
fn detect_stack_detailed(entries : & FileEntry, contents : & BTreeMap <String, String>,) -> StackReport | Detect stacks and report manifests that do not parse |
fn detect_stack(entries : & FileEntry) -> Vec <DetectedStack> | Detect the technology stacks a project uses, from a listing of its files |
`testkit`
| Item | What it is |
|---|---|
pub struct FixtureScanHost | An in-memory filesystem for tests |
FixtureScanHost :: fn new() -> Self | A fixture with nothing in it. |
FixtureScanHost :: fn with(mut self, path : impl Into <PathBuf>, entries : Vec <DirEntryInfo>) -> Self | Declare a directory and its entries. |
FixtureScanHost :: fn with_file(mut self, path : impl Into <PathBuf>, contents : impl Into <String>) -> Self | Declare a regular file's contents. |
FixtureScanHost :: fn with_link(mut self, path : impl Into <PathBuf>, target : impl Into <PathBuf>) -> Self | Declare a symlink and where it resolves to. |
FixtureScanHost :: fn unreadable(mut self, path : impl Into <PathBuf>) -> Self | Mark a path as unreadable, so reads of it fail. |
FixtureScanHost :: fn with_identity_sequence(self, path : impl Into <PathBuf>, ids : & & str) -> Self | Successive identities a path reports on repeated observation |
FixtureScanHost :: fn canonicalize(& self, path : & Path) -> Result <PathBuf, ScanError> | — |
FixtureScanHost :: fn list_dir(& self, path : & Path) -> Result <Vec <DirEntryInfo>, ScanError> | — |
FixtureScanHost :: fn entry_kind(& self, path : & Path) -> Result <EntryKind, ScanError> | — |
FixtureScanHost :: fn identity(& self, path : & Path) -> Result <String, ScanError> | — |
FixtureScanHost :: fn read_file_bounded(& self, path : & Path, max_bytes : usize) -> Result <String, ScanError> | — |
pub struct FixtureGitRunner | A GitRunner that replays canned output and counts invocations |
FixtureGitRunner :: fn new() -> Self | A runner with no canned responses. |
FixtureGitRunner :: fn with_response(mut self, subcommand : & str, stdout : impl Into <Vec <u8>>) -> Self | Canned successful stdout for a subcommand. |
FixtureGitRunner :: fn with_truncated_response(mut self, subcommand : & str, stdout : impl Into <Vec <u8>>) -> Self | Canned truncated stdout, simulating an output cap being hit. |
FixtureGitRunner :: fn with_failure(mut self, subcommand : & str, stderr : impl Into <String>) -> Self | Canned failure for a subcommand. |
FixtureGitRunner :: fn with_head_sequence(self, heads : & & str) -> Self | Successive HEAD values returned by rev-parse, to simulate mid-scan mutation. |
FixtureGitRunner :: fn call_count(& self) -> usize | How many times GitRunner::run was called. |
FixtureGitRunner :: fn calls(& self) -> Vec <Vec <String>> | Every argument vector seen, in order. |
FixtureGitRunner :: fn run(& self, _cwd : & StdPath, args : & & str) -> Result <GitOutput, ScanError> | — |
`watermark`
| Item | What it is |
|---|---|
pub const SCANNER_VERSION: u32 | Bumped only when the meaning of a collected fact changes, forcing re-collection. |
pub const MAX_DIGEST_ENTRIES: usize | Maximum status entries folded into a digest before it is declared incomplete. |
pub const MAX_DIGEST_BYTES: usize | Maximum bytes of content hashed into one digest before it is declared incomplete. |
pub struct InventoryWatermark | The deterministic half of the re-scan decision. |
pub enum ScanDecision | Whether a re-scan needs to do work. |
pub struct HashInput | Content supplied for hashing: a path and the bytes at it. |
fn status_digest(entries : & StatusEntry, contents : & BTreeMap <String, Vec <u8>>,) ->(String, bool, Option <String>) | Digest the dirty-tree picture |
fn manifest_digest(manifests : & HashInput) ->(String, bool, Option <String>) | Digest the manifest set. |
fn inventory_watermark(repo_identity : RepoIdentity, worktree_path : impl Into <String>, facts : & GitFacts, status_contents : & BTreeMap <String, Vec <u8>>, manifests : & HashInput,) -> InventoryWatermark | Build the watermark for one working tree. |
fn decide(previous : Option <& InventoryWatermark>, current : & InventoryWatermark) -> ScanDecision | Decide whether a re-scan must do work, naming what changed |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
ScanError | error::ScanError |
{BranchState,Completeness,Oid,RepoIdentity,Repository,RunOutcome,Worktree} | model::{BranchState,Completeness,Oid,RepoIdentity,Repository,RunOutcome,Worktree} |
{DirEntryInfo,EntryKind,ScanHost,SystemScanHost} | host::{DirEntryInfo,EntryKind,ScanHost,SystemScanHost} |
{GitOutput,GitRunner,SystemGitRunner} | runner::{GitOutput,GitRunner,SystemGitRunner} |
{decide,inventory_watermark,HashInput,InventoryWatermark,ScanDecision,SCANNER_VERSION,} | watermark::{decide,inventory_watermark,HashInput,InventoryWatermark,ScanDecision,SCANNER_VERSION,} |
{detect_stack,detect_stack_detailed,DetectedStack,FileEntry,ManifestIssue,Stack,StackReport,} | stack::{detect_stack,detect_stack_detailed,DetectedStack,FileEntry,ManifestIssue,Stack,StackReport,} |
{discover,Discovery,RepoKind,RepoRef} | discover::{discover,Discovery,RepoKind,RepoRef} |
{git_facts,GitFacts,StatusEntry} | git::{git_facts,GitFacts,StatusEntry} |
{scan,ScanReport} | scan::{scan,ScanReport} |
Boundary
Depends on no other workspace tier.
Shares tier operations with 40 other crates: operations-approval-workflow, operations-assessments, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-liveview, operations-camera-registry, … (40 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) | operations |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/operations/repo-inventory |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
hex | ^0.4 | — | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
sha2 | ^0.10 | — | no | always |
thiserror | ^2 | — | no | always |
toml | ^0.8 | — | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
serde_json | ^1 | — | no | always |
Build. None.
Depended on by. Nothing in this workspace.
Feature flags
| Feature | Enables | On by default |
|---|---|---|
default | — | yes |
flowchart LR n_default["default"]
Targets
| Kind | Name | Source |
|---|---|---|
| example | scan_report | `examples/scan_report.rs` |
| lib | operations_repo_inventory | `src/lib.rs` |
Error model
| Error type | Named by |
|---|---|
ScanError | check_read_only, collect_facts, discover, git_facts, scan |
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/runner.rs |
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 95 |
| Integration tests | 0 |
| Examples | 1 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
discover | 4 | 2 | 0 |
error | 1 | 0 | 0 |
git | 8 | 1 | 0 |
host | 4 | 2 | 0 |
model | 7 | 2 | 0 |
runner | 9 | 2 | 0 |
scan | 4 | 2 | 0 |
stack | 7 | 0 | 0 |
testkit | 2 | 0 | 0 |
watermark | 10 | 0 | 0 |
What the tests establish, by name:
a_root_swapped_mid_traversal_fails_the_run—src/discover.rsa_stable_root_is_not_flagged_as_mutated—src/discover.rsdirectory_names_with_spaces_and_parens_are_handled—src/discover.rsentry_count_equals_directory_count_with_zero_omissions—src/discover.rsevery_child_directory_is_returned_and_classified—src/discover.rsgit_pointer_with_relative_traversal_is_refused—src/discover.rsgitdir_pointer_outside_root_is_recorded_not_followed—src/discover.rsmalformed_git_pointer_is_reported_not_guessed—src/discover.rsnested_repo_inside_a_repo_does_not_confuse_the_parent—src/discover.rsone_bad_directory_does_not_abort_the_sweep—src/discover.rsregular_files_at_the_root_are_not_reported_as_projects—src/discover.rsresults_are_in_deterministic_order—src/discover.rsroot_mutation_is_never_reported_as_a_partial_inventory—src/discover.rssymlink_escaping_the_root_is_refused_and_reported—src/discover.rssymlink_inside_the_root_is_still_not_followed—src/discover.rsunreadable_directory_is_recorded_with_a_reason_not_dropped—src/discover.rsunusable_root_is_a_systemic_failure_not_an_empty_result—src/discover.rsworktree_is_typed_and_attributed_to_its_parent—src/discover.rsa_failing_log_keeps_the_status_facts—src/git.rsa_path_containing_spaces_survives—src/git.rsa_renamed_entry_yields_the_correct_path—src/git.rsa_repo_git_cannot_parse_degrades_rather_than_erroring—src/git.rsa_truncated_log_reports_unknown_rather_than_a_wrong_total—src/git.rsan_unborn_repo_costs_only_one_invocation—src/git.rsan_unmerged_entry_yields_the_correct_path—src/git.rscosts_at_most_two_git_invocations—src/git.rsdetached_head_is_reported_with_its_sha—src/git.rsdirty_entries_carry_status_codes_not_just_paths—src/git.rsnon_utf8_paths_do_not_panic_or_drop_the_entry—src/git.rsreal_porcelain_v2_entry_yields_the_correct_path—src/git.rs- _… 65 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 85 | 97 |
Public modules with a //! block | 10 | 10 |
pie showData
title Public items with rustdoc
"Documented" : 85
"No rustdoc detected" : 12
Metrics
| Metric | Value |
|---|---|
| Rust source files | 11 |
| Source lines | 4117 |
| Code lines | 2899 |
| Public API items | 97 |
| Public modules | 10 |
| Tests | 95 |
| Examples | 1 |
| Cargo features | 1 |
| Direct runtime dependencies | 6 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"constant" : 10
"enum" : 8
"function" : 15
"method" : 41
"struct" : 21
"trait" : 2
pie showData
title Rust source composition
"Code" : 2899
"Blank or comment" : 1218
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.