No description
  • Rust 86.8%
  • Python 13%
  • Shell 0.2%
Find a file
trvon e56ea81f9d
Some checks failed
build / build-linux (pull_request) Successful in 36s
build / build-macos (pull_request) Has been cancelled
build / release (pull_request) Has been cancelled
docs: publish lexical language parity contract
2026-08-30 15:58:33 -06:00
.forgejo/workflows ci: use Forgejo artifact actions; disable unsupported cache 2026-08-30 10:34:22 -06:00
.github/workflows chore: initial import of brick (evidence-aware code structure visualization) 2026-08-30 09:17:34 -06:00
docs docs: publish lexical language parity contract 2026-08-30 15:58:33 -06:00
scripts chore: initial import of brick (evidence-aware code structure visualization) 2026-08-30 09:17:34 -06:00
skills/brick-sast chore: remove tracked Python bytecode 2026-08-30 14:26:22 -06:00
src fix(scan): mask multiline block comments 2026-08-30 15:57:50 -06:00
tests fix(scan): mask multiline block comments 2026-08-30 15:57:50 -06:00
.gitignore chore: remove tracked Python bytecode 2026-08-30 14:26:22 -06:00
AGENTS.md chore: initial import of brick (evidence-aware code structure visualization) 2026-08-30 09:17:34 -06:00
Cargo.lock chore: initial import of brick (evidence-aware code structure visualization) 2026-08-30 09:17:34 -06:00
Cargo.toml chore: initial import of brick (evidence-aware code structure visualization) 2026-08-30 09:17:34 -06:00
README.md docs: publish lexical language parity contract 2026-08-30 15:58:33 -06:00
rust-toolchain.toml chore: initial import of brick (evidence-aware code structure visualization) 2026-08-30 09:17:34 -06:00

Brick

Brick builds an evidence-aware visual representation of a codebase. Directories become compounds, files become rooms, classes/functions become structural elements, and dependency edges show calls, imports, and inheritance. The same model is emitted as versioned JSON for other tools, including a future Fold integration.

The initial extractor provides first-class lexical profiles for Rust, Dart, C/C++, and JavaScript/TypeScript, with explicitly secondary Python and Swift coverage. Symbol extraction is intentionally conservative and lexical in v0.1; every relationship records its backend, confidence, and all contributing source locations so consumers can distinguish it from imported symbolic evidence. See language support and parity for the construct-level coverage matrix and first-class promotion contract.

Quick start

cargo run -- build ../fold --json fold.brick.json --html fold.brick.html

Exclude generated or checked-in output by exact directory component (repeatable):

cargo run -- build ../yams --exclude site --exclude build \
  --json yams.brick.json --html yams.brick.html

Layer Fold findings onto the building:

cargo run -- build ../fold \
  --fold-report ../fold/build/findings.json \
  --json fold.brick.json \
  --html fold.brick.html

Fold artifact paths are normalized lexically across /, \\, ., and .. components before repository-relative matching. Findings for excluded, generated, or genuinely missing files remain diagnostics instead of being attached to a neighboring source file.

Render an existing model or enforce an explicit experimental gate:

cargo run -- render fold.brick.json --html fold.brick.html
cargo run -- check fold.brick.json --min-score 70 --max-cycles 5

Open the generated HTML in a browser. It loads Cytoscape.js from unpkg by default; an internal or vendored URL can be supplied with --cytoscape-url.

What v0.1 provides

  • A deterministic schema for repository, directory, file, class, function, external dependency, and Fold finding nodes.
  • Contains, defines, calls, imports, inherits, and flags edges.
  • Per-edge evidence lane, backend, confidence, and provenance.
  • SCC-based cycle counts, unresolved references, isolation, fan-in/fan-out, and an inspectable experimental structural-health composite.
  • An interactive compound graph with layout switching, dependency focus, and node/edge inspection.
  • Fold native findings-json and SARIF ingestion without collapsing backend or confidence.
  • A focused Rust test suite, quality gate, bounded auto-loop, and artifact-based benchmark runner.
  • A labeled language-parity corpus with independent gates for every advertised language; Python and Swift remain characterization-only secondary profiles.

Important limits

Brick v0.1 is a seed, not a compiler frontend. Lexical extraction can miss macros, overload resolution, dynamic dispatch, generated code, aliases, and multiline signatures. Its score is not proof of correctness, maintainability, or security. Use the component metrics and evidence records; do not rank teams or repositories by the composite alone.

Unqualified calls such as lock, size, and empty may merge unrelated C++ targets or remain external; recursion and overloads may also appear as lexical self-cycles. File fan-out is therefore a decomposition signal, not proof of semantic coupling. Scope architecture gates to production paths and verify each candidate against source and tests. Cross-translation-unit and namespaced C++ resolution remain priority adapter work.

The next serious analyzer milestone should consume compiler/YAMS/Fold graph facts through adapters while retaining the standalone lexical lane as a fast preview. See docs/architecture/graph-model.md and docs/ROADMAP.md.

Development

cargo fmt --check
cargo test
cargo clippy --all-targets -- -D warnings
./scripts/quality-gate.sh
python3 tests/benchmarks/runner.py self-test

Repository workflow is in AGENTS.md and docs/prompts.

Brick pins nightly-2026-05-28 in rust-toolchain.toml, matching Fold's Rust analyzer. Rustup selects it automatically for Cargo, rustfmt, and Clippy commands run inside this repository.

Agent skill

The evidence-aware architecture review workflow lives in skills/brick-sast/. It includes a deterministic JSON summary helper and a review reference that keeps graph observations separate from source-verified architectural conclusions. Validate the package with:

env UV_CACHE_DIR=/private/tmp/brick-uv-cache uv run --with pyyaml \
  python /path/to/skill-creator/scripts/quick_validate.py skills/brick-sast