The recorded end-to-end shopping demo (ported from scripts/demo-shopping{,-full}.sh via the script-scan pipeline), rebuilt on infrastructure-screencast: cold Chrome start, humanized Amazon+eBay search through the extension bridge, streaming ingest telemetry, first-pass analysis, top-5 enrichment, dual-AI recommendations, buy links — all while recording the screen with terminal-left/browser-right choreography. The four inline python formatters of the bash originals are absorbed into unit-tested Rust.
| Tier | tools |
| Role | unclassified (baselined) |
| Path | crates/tools/demo-shopping |
| Edition | 2021 |
| Targets | tools-demo-shopping, tools_demo_shopping |
| Public items | 11 across 0 modules |
| Tests | 9 |
What it is for
Pure logic for the shopping demo: product parsing/sorting/formatting and journal-signal classification. Ports (and unit-tests) the four inline python blobs from demo-shopping-full.sh.
Capabilities
crate root
Pure logic for the shopping demo: product parsing/sorting/formatting and
| Item |
|---|
fn extract_db_query(query : & str) -> String |
fn search_command(query : & str) -> Value |
fn enrich_command(urls : Value) -> Value |
JournalSignal
Pure logic for the shopping demo: product parsing/sorting/formatting and
| Item |
|---|
pub enum JournalSignal |
fn classify_journal(recent : & str) -> JournalSignal |
Product
Pure logic for the shopping demo: product parsing/sorting/formatting and
| Item |
|---|
pub struct Product |
fn parse_compare(json : & str) -> Vec <Product> |
fn format_top(products : & Product, k : usize) -> String |
fn top5_urls(products : & Product) -> Value |
fn comparison_lines(products : & Product, k : usize) -> String |
fn buy_links(products : & Product, k : usize) -> String |
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
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub struct Product | One product row from /api/shopping/compare, reduced to what the demo renders |
fn parse_compare(json : & str) -> Vec <Product> | Parse the compare-endpoint JSON into price-sorted products (pure) |
fn format_top(products : & Product, k : usize) -> String | The "Found N products |
fn top5_urls(products : & Product) -> Value | Top-5 enrichment targets as the bridge's urls JSON (python blob #1 tail — in memory now, no /tmp/demo_top5_urls.json side file). |
fn comparison_lines(products : & Product, k : usize) -> String | The AI-prompt comparison lines (python blob #3). |
fn buy_links(products : & Product, k : usize) -> String | The buy-links box body (python blob #4). |
fn extract_db_query(query : & str) -> String | Extract the DB-search noun from the spoken query (the bash grep list): prefer a known product noun, else the first two words |
pub enum JournalSignal | What the recent service journal says about an in-flight search. |
fn classify_journal(recent : & str) -> JournalSignal | Classify recent journal output (pure) |
fn search_command(query : & str) -> Value | The shopping_search bridge command body (typed, never string-spliced). |
fn enrich_command(urls : Value) -> Value | The enrich_products bridge command body. |
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into infrastructure.
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/demo-shopping |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_tools["tools"] --> n_infrastructure["infrastructure"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `infrastructure-screencast` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
anyhow | ^1 | — | no | always |
serde_json | ^1 | — | no | always |
Development. None.
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["tools-demo-shopping"] SELF -->|runtime| n_infrastructure_screencast["infrastructure-screencast"] 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-demo-shopping | `src/main.rs` |
| lib | tools_demo_shopping | `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 | 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 |
|---|---|
API_KEY | src/main.rs |
HOME | src/main.rs |
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 9 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 11 | 0 | 0 |
What the tests establish, by name:
bridge_commands_are_typed_json_never_spliced_strings—src/lib.rsbuy_links_lists_price_and_url_per_pick—src/lib.rscomparison_lines_carry_brand_rank_and_url—src/lib.rsdb_query_prefers_a_product_noun_else_first_two_words—src/lib.rsjournal_classification_priority_matches_the_bash_order—src/lib.rsmalformed_or_not_ok_json_yields_empty_never_panics—src/lib.rsparse_sorts_by_landed_price_and_missing_prices_sort_last—src/lib.rstop5_urls_skips_missing_and_defaults_unknown_site_to_amazon—src/lib.rstop_table_formats_dollars_site_and_brand—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 11 | 11 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 11
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 2 |
| Source lines | 716 |
| Code lines | 617 |
| Public API items | 11 |
| Public modules | 0 |
| Tests | 9 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 3 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"enum" : 1
"function" : 9
"struct" : 1
pie showData
title Rust source composition
"Code" : 617
"Blank or comment" : 99
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.