Regenerate the `<!-- BEGIN generated:crate-index -->` block in docs/AI_CONTEXT.md from `cargo metadata` + manifest-path layering. Idempotent; --check / --write. Keeps the AI context map's crate inventory from drifting.
| Tier | tools |
| Role | unclassified (baselined) |
| Path | crates/tools/gen-ai-context |
| Edition | 2021 |
| Targets | tools-gen-ai-context, tools_gen_ai_context |
| Public items | 7 across 1 module |
| Tests | 63 |
What it is for
Library half of tools-gen-ai-context: symbols::scan_symbols is reused directly by tools-org-knowledge's symbol-boundary code chunker (sprint 3.96 US-3.96.3) rather than re-derived -- this crate already owns the pub-item text-scan heuristic and its precision tradeoff.
Capabilities
symbols (other)
Capability index — what each crate actually exposes, not what it is for.
| Item |
|---|
pub const KINDS: & str; 6 |
fn indexable(rel : & str, known : & std::collections::BTreeSet <String>) -> bool |
Row
Capability index — what each crate actually exposes, not what it is for.
| Item |
|---|
pub struct Row |
fn build_index(crates : & (String, String, std::path::PathBuf), repo : & std::path::Path, known : & std::collections::BTreeSet <String>,) -> Vec <Row> |
fn render_tsv(rows : & Row, stamp : & str) -> String |
Symbol
Capability index — what each crate actually exposes, not what it is for.
| Item |
|---|
pub struct Symbol |
fn scan_symbols(src : & str) -> Vec <Symbol> |
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_gen_ai_context
symbols
Public surface
`symbols`
| Item | What it is |
|---|---|
pub const KINDS: & str; 6 | Kinds of public item worth indexing |
pub struct Symbol | One exported item. |
fn scan_symbols(src : & str) -> Vec <Symbol> | Extract the public items declared in one Rust source file |
pub struct Row | One row of the capability index. |
fn indexable(rel : & str, known : & std::collections::BTreeSet <String>) -> bool | Is this file one the index may describe? known is what git ls-files reports: tracked files plus staged additions |
fn build_index(crates : & (String, String, std::path::PathBuf), repo : & std::path::Path, known : & std::collections::BTreeSet <String>,) -> Vec <Row> | Build the capability index for a set of (crate name, layer, crate dir) |
fn render_tsv(rows : & Row, stamp : & str) -> String | Render rows as TSV, newest-tooling-friendly and trivially greppable |
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) | unclassified (baselined) |
| Location | crates/tools/gen-ai-context |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
anyhow | ^1 | — | no | always |
clap | ^4 | derive | no | always |
serde_json | ^1 | — | no | always |
Development, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `tools-cli-conformance` | tools | no | always |
Build. None.
Depended on by. 1 workspace crate.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_tools_corpus["tools-corpus"] -->|uses| SELF SELF["tools-gen-ai-context"] SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"] 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-gen-ai-context | `src/main.rs` |
| lib | tools_gen_ai_context | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
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 | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
1 workspace crate depends on this one: tools-corpus.
Verification
| Kind | Count |
|---|---|
| Unit tests | 63 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
symbols | 7 | 0 | 3 |
What the tests establish, by name:
a_cargo_relative_path_is_rebased_when_the_readme_is_relocated—src/main.rsa_fenced_block_is_left_alone—src/main.rsa_non_workspace_manifest_does_not_terminate_the_walk—src/main.rsa_repo_rooted_path_and_a_non_path_survive_relocation_unchanged—src/main.rscli_definition_conforms—src/main.rscrate_manual_body_prefers_readme_over_full_doc_over_description—src/main.rsdefuse_relocated_links_drops_relative_paths_but_keeps_the_text—src/main.rsdefuse_relocated_links_drops_rustdoc_intra_doc_links_too—src/main.rsdefuse_relocated_links_handles_multiple_links_on_one_line—src/main.rsdefuse_relocated_links_keeps_real_urls_and_fragments_as_links—src/main.rsdoc_summary_for_manifest_empty_when_no_source_present—src/main.rsdoc_summary_for_manifest_prefers_main_rs_over_lib_rs—src/main.rsdoc_summary_for_manifest_reads_lib_rs_next_to_the_manifest—src/main.rsextract_doc_summary_empty_when_no_doc_comment—src/main.rsextract_doc_summary_skips_leading_copyright_block—src/main.rsextract_doc_summary_takes_first_paragraph_only—src/main.rsextract_doc_summary_truncates_long_paragraphs_at_a_word_boundary—src/main.rsextract_full_doc_keeps_headers_and_blank_paragraph_breaks_unlike_the_summary—src/main.rsinternal_deps_empty_when_no_workspace_deps—src/main.rsinternal_deps_keeps_only_workspace_members_and_excludes_self—src/main.rslayer_for_application_dir_uses_the_tier_like_any_other—src/main.rslayer_from_grouped_path—src/main.rslayer_none_when_not_under_crates—src/main.rslayer_rank_orders_the_core_chain_before_any_auxiliary_layer—src/main.rslayer_unknown_segment_is_other—src/main.rsno_workspace_anywhere_above_is_none_rather_than_a_wrong_guess—src/main.rsparse_metadata_takes_every_member_under_crates_incl_bin_only—src/main.rsparse_related_extracts_deps_and_sorts_by_name—src/main.rsrender_escapes_pipes_and_empty_desc—src/main.rsrender_groups_by_layer_in_order_and_includes_application—src/main.rs- _… 33 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 7 | 7 |
Public modules with a //! block | 1 | 1 |
pie showData
title Public items with rustdoc
"Documented" : 7
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 3 |
| Source lines | 2388 |
| Code lines | 1796 |
| Public API items | 7 |
| Public modules | 1 |
| Tests | 63 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 3 |
| Workspace reverse dependencies | 1 |
pie showData
title Public API by kind
"constant" : 1
"function" : 4
"struct" : 2
pie showData
title Rust source composition
"Code" : 1796
"Blank or comment" : 592
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.