Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 25 additions & 46 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,33 @@ Before editing:
`CONTRIBUTING.md` is the canonical human contribution guide. The design rules
behind this file live in `docs/design/principles.md`.

## Disk and external-checkout policy

The main disk is limited to 100 GB. Rust build artifacts and repositories used
for real-repository code-graph qualification belong on the mounted workspace
volume, not in this checkout or the main disk.

- Before any Cargo command that can compile (`build`, `check`, `test`,
`clippy`, `bench`, `doc`, `install`, `package`, or a Make target that invokes
one), set `CARGO_TARGET_DIR` beneath `/Volumes/Workspace/crabbuild-target`.
- Every repository checkout and worktree must have its own target directory.
Never share one Cargo target directory between different repositories or
concurrent worktrees: feature sets, build scripts, and locks can collide.
- Use a stable, descriptive directory such as
`/Volumes/Workspace/crabbuild-target/compass-main` for this checkout and
`/Volumes/Workspace/crabbuild-target/compass-<worktree-name>` for another
Compass worktree. For another repository, include that repository and
checkout/worktree name.
- Set the variable on every new shell/tool invocation; do not assume an export
from an earlier command persists. For example:

```bash
CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main \
cargo test -p compass-model --locked
```

- Verify the volume is mounted and the chosen directory is writable before a
long build. Create only the specific per-checkout directory needed. If
`/Volumes/Workspace` is unavailable, stop and report it rather than falling
back to a local `target/` directory.
- Do not delete, clean, or reuse another repository's target directory. Run
`cargo clean` only with the intended `CARGO_TARGET_DIR` explicitly set and
only when the task actually requires reclaiming or invalidating those
artifacts.
- Find repositories used to qualify Compass code graphs under
`/Volumes/Workspace/Github` first. When a task genuinely requires a missing
public repository, clone it under
`/Volumes/Workspace/Github/<owner>/<repository>`; do not clone qualification
repositories into the Compass tree, `/tmp`, or the main-disk GitHub folder.
- Treat external qualification repositories as read-only inputs. Do not modify,
update, reset, or clean an existing checkout unless the task explicitly
requires it. Keep generated Compass artifacts outside their tracked source
or remove only artifacts created by the current task.
## Build artifacts and external checkouts

Compass build artifacts are large. Where they live is a per-contributor
environment choice, not a repository rule — this guide does not mandate any
specific path or volume.

- If you redirect Cargo output with `CARGO_TARGET_DIR`, give every repository
checkout and worktree its own directory. Never share one target directory
between different repositories or concurrent worktrees: feature sets, build
scripts, and locks can collide.
- `CARGO_TARGET_DIR` does not persist between shell or tool invocations. Set it
on each command that can compile (`build`, `check`, `test`, `clippy`, `bench`,
`doc`, `install`, `package`, or a Make target that invokes one).
- Verify the chosen directory exists and is writable before a long build.
- Run `cargo clean` only with the intended `CARGO_TARGET_DIR` explicitly set,
and only when the task actually requires reclaiming or invalidating those
artifacts. Never clean another repository's target directory.
- Treat external repositories used to qualify Compass code graphs as read-only
inputs. Do not modify, update, reset, or clean an existing checkout unless the
task explicitly requires it. Keep generated Compass artifacts outside their
tracked source, or remove only artifacts created by the current task. Do not
clone qualification repositories into the Compass tree.

Some Makefile targets consume binaries through a literal local `target/` path
after Cargo finishes. Prefer direct Cargo commands with `CARGO_TARGET_DIR` for
normal verification. Before using packaging, install, or release targets,
inspect the target and ensure its artifact lookup also points at the selected
external directory; never allow it to trigger a second local build silently.
after Cargo finishes. If you have redirected `CARGO_TARGET_DIR`, prefer direct
Cargo commands for normal verification, and inspect packaging, install, or
release targets before use so they do not silently trigger a second build.

## Product invariants

Expand Down
12 changes: 6 additions & 6 deletions PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ and requires matching ordered observations from JSON, store, and a repeated
store execution. Timing is measured but removed before the deterministic
response-baseline comparison.

Run the gate with this checkout's external Cargo target:
Run the gate. If you redirect Cargo output, use a target directory dedicated to
this checkout:

```bash
CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-<checkout> \
python3 scripts/qualify_query_relevance.py
python3 scripts/qualify_query_relevance.py
```

The gate fails on generated-artifact, corpus/schema/digest drift,
Expand Down Expand Up @@ -95,11 +95,11 @@ amplification, immutable-object reuse, GC state, and JSON/typed-query/
CompassQL differential results. It also measures a small real CLI workflow:
clean build, unchanged update, one-file update, and cold JSON/store search.
The store workflow passes `--store sqlite`; ordinary builds remain JSON-only.
Run it from a checkout with the required external target directory:
Run it from a checkout. If you redirect Cargo output, use a target directory
dedicated to this checkout:

```bash
CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-store-<checkout> \
scripts/qualify_compass_store_release.sh
scripts/qualify_compass_store_release.sh
```

The default graph sizes are 32, 128, and 512 generated nodes. Raw JSON and
Expand Down
12 changes: 5 additions & 7 deletions advisor-plans/006-harden-media-ingestion.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,16 @@ document IR planned in 007. It is intentionally safe to land first.

## Commands you will need

Set the external target on every Cargo invocation:

| Purpose | Command | Expected on success |
|---|---|---|
| Media tests | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-media --locked` | exit 0 |
| Semantic tests | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-semantic --locked` | exit 0 |
| Lint | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo clippy -p compass-media -p compass-semantic --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Media tests | `cargo test -p compass-media --locked` | exit 0 |
| Semantic tests | `cargo test -p compass-semantic --locked` | exit 0 |
| Lint | `cargo clippy -p compass-media -p compass-semantic --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Format | `cargo fmt --all -- --check` | exit 0 |
| Boundary | `sh scripts/check_product_boundary.sh` | exit 0 |

If `/Volumes/Workspace` is unavailable or unwritable, stop. Do not fall back to
a target directory inside the checkout.
If you redirect Cargo output with `CARGO_TARGET_DIR`, set it on every
invocation above and use a directory dedicated to this checkout.

## Scope

Expand Down
10 changes: 5 additions & 5 deletions advisor-plans/007-versioned-document-artifact.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ Set the external target on every Cargo invocation:

| Purpose | Command | Expected on success |
|---|---|---|
| Media | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-media --locked` | exit 0 |
| Semantic | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-semantic --locked` | exit 0 |
| Files | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-files --locked` | exit 0 |
| Lint | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo clippy -p compass-media -p compass-semantic -p compass-files --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Media | `cargo test -p compass-media --locked` | exit 0 |
| Semantic | `cargo test -p compass-semantic --locked` | exit 0 |
| Files | `cargo test -p compass-files --locked` | exit 0 |
| Lint | `cargo clippy -p compass-media -p compass-semantic -p compass-files --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Format | `cargo fmt --all -- --check` | exit 0 |
| Boundary | `sh scripts/check_product_boundary.sh` | exit 0 |

If `/Volumes/Workspace` is unavailable or unwritable, stop rather than using a
If the chosen Cargo target directory is unwritable, stop rather than using a
local `target/` directory.

## Scope
Expand Down
12 changes: 6 additions & 6 deletions advisor-plans/008-lossless-document-fusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ boundaries.

| Purpose | Command | Expected on success |
|---|---|---|
| Semantic | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-semantic --locked` | exit 0 |
| Core | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-core --locked` | exit 0 |
| Graph | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-graph --locked` | exit 0 |
| CLI contract | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-cli --test compass_product --locked` | exit 0 |
| Qualification | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main ./scripts/qualify_code_graph_v1.sh --fixtures-only` | exit 0 |
| Lint | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo clippy -p compass-semantic -p compass-core -p compass-graph --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Semantic | `cargo test -p compass-semantic --locked` | exit 0 |
| Core | `cargo test -p compass-core --locked` | exit 0 |
| Graph | `cargo test -p compass-graph --locked` | exit 0 |
| CLI contract | `cargo test -p compass-cli --test compass_product --locked` | exit 0 |
| Qualification | `./scripts/qualify_code_graph_v1.sh --fixtures-only` | exit 0 |
| Lint | `cargo clippy -p compass-semantic -p compass-core -p compass-graph --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Format | `cargo fmt --all -- --check` | exit 0 |

Stop if the external target volume is unavailable; never build into the repo.
Expand Down
14 changes: 7 additions & 7 deletions advisor-plans/009-structural-markdown-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ local graphs without runtime downloads or model dependence.

| Purpose | Command | Expected on success |
|---|---|---|
| Languages | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-languages --locked` | exit 0 |
| Markdown coverage | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-languages --test markdown_coverage --locked` | exit 0 |
| Media | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-media --locked` | exit 0 |
| Ingest | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-ingest --locked` | exit 0 |
| Core | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-core --locked` | exit 0 |
| Qualification | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main ./scripts/qualify_code_graph_v1.sh --fixtures-only` | exit 0 |
| Lint | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo clippy -p compass-languages -p compass-media -p compass-ingest -p compass-core --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Languages | `cargo test -p compass-languages --locked` | exit 0 |
| Markdown coverage | `cargo test -p compass-languages --test markdown_coverage --locked` | exit 0 |
| Media | `cargo test -p compass-media --locked` | exit 0 |
| Ingest | `cargo test -p compass-ingest --locked` | exit 0 |
| Core | `cargo test -p compass-core --locked` | exit 0 |
| Qualification | `./scripts/qualify_code_graph_v1.sh --fixtures-only` | exit 0 |
| Lint | `cargo clippy -p compass-languages -p compass-media -p compass-ingest -p compass-core --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Format | `cargo fmt --all -- --check` | exit 0 |

## Scope
Expand Down
10 changes: 5 additions & 5 deletions advisor-plans/010-native-ooxml-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ without LibreOffice, Python, credentials, or a model.

| Purpose | Command | Expected on success |
|---|---|---|
| Media | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-media --locked` | exit 0 |
| Files | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-files --locked` | exit 0 |
| Semantic | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-semantic --locked` | exit 0 |
| Core | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-core --locked` | exit 0 |
| Lint | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo clippy -p compass-media -p compass-files -p compass-semantic -p compass-core --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Media | `cargo test -p compass-media --locked` | exit 0 |
| Files | `cargo test -p compass-files --locked` | exit 0 |
| Semantic | `cargo test -p compass-semantic --locked` | exit 0 |
| Core | `cargo test -p compass-core --locked` | exit 0 |
| Lint | `cargo clippy -p compass-media -p compass-files -p compass-semantic -p compass-core --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Format | `cargo fmt --all -- --check` | exit 0 |
| Boundary | `sh scripts/check_product_boundary.sh` | exit 0 |

Expand Down
12 changes: 6 additions & 6 deletions advisor-plans/011-bounded-native-rtf.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ destinations. Never execute, decompress, open, or emit embedded payload bytes.

| Purpose | Command | Expected on success |
|---|---|---|
| Media | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-media --locked` | exit 0 |
| Files | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-files --locked` | exit 0 |
| Semantic | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-semantic --locked` | exit 0 |
| Core | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-core --locked` | exit 0 |
| Dependency policy | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo tree -p compass-media --locked` | exit 0; review only intended dependency changes |
| Lint | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo clippy -p compass-media -p compass-files -p compass-semantic -p compass-core --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Media | `cargo test -p compass-media --locked` | exit 0 |
| Files | `cargo test -p compass-files --locked` | exit 0 |
| Semantic | `cargo test -p compass-semantic --locked` | exit 0 |
| Core | `cargo test -p compass-core --locked` | exit 0 |
| Dependency policy | `cargo tree -p compass-media --locked` | exit 0; review only intended dependency changes |
| Lint | `cargo clippy -p compass-media -p compass-files -p compass-semantic -p compass-core --all-targets --all-features --locked -- -D warnings` | exit 0 |
| Format | `cargo fmt --all -- --check` | exit 0 |
| Boundary | `sh scripts/check_product_boundary.sh` | exit 0 |

Expand Down
12 changes: 6 additions & 6 deletions advisor-plans/012-document-qualification-gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ For every shipped format, qualification must assert:

| Purpose | Command | Expected on success |
|---|---|---|
| Document qualification | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main ./scripts/qualify_document_graph_v1.sh --fixtures-only` | exit 0; all format cases pass |
| Code qualification | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main ./scripts/qualify_code_graph_v1.sh --fixtures-only` | exit 0 |
| Product contract | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test -p compass-cli --test compass_product --locked` | exit 0 |
| Workspace tests | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo test --workspace --lib --bins --locked` | exit 0 |
| Workspace lint | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main cargo clippy --workspace --lib --bins --locked -- -D warnings` | exit 0 |
| Document qualification | `./scripts/qualify_document_graph_v1.sh --fixtures-only` | exit 0; all format cases pass |
| Code qualification | `./scripts/qualify_code_graph_v1.sh --fixtures-only` | exit 0 |
| Product contract | `cargo test -p compass-cli --test compass_product --locked` | exit 0 |
| Workspace tests | `cargo test --workspace --lib --bins --locked` | exit 0 |
| Workspace lint | `cargo clippy --workspace --lib --bins --locked -- -D warnings` | exit 0 |
| Format | `cargo fmt --all -- --check` | exit 0 |
| Boundary | `sh scripts/check_product_boundary.sh` | exit 0 |

Expand Down Expand Up @@ -169,7 +169,7 @@ It must:
- accept `--fixtures-only` and reject unknown flags;
- require `CARGO_TARGET_DIR` to be an absolute path outside the Compass checkout
rather than silently choosing a local target; local executions under this
repository must use `/Volumes/Workspace/crabbuild-target/compass-main`, while
repository must use its own dedicated Cargo target directory, while
CI may use a checkout-specific directory under its runner temp volume;
- run manifest validation and the typed cross-format test;
- run product-boundary checks relevant to documents;
Expand Down
Loading