diff --git a/AGENTS.md b/AGENTS.md index 3fb27854..382e34db 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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-` 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//`; 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 diff --git a/PERFORMANCE.md b/PERFORMANCE.md index 1bec8c01..c8608cdf 100644 --- a/PERFORMANCE.md +++ b/PERFORMANCE.md @@ -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- \ - python3 scripts/qualify_query_relevance.py +python3 scripts/qualify_query_relevance.py ``` The gate fails on generated-artifact, corpus/schema/digest drift, @@ -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- \ - 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 diff --git a/advisor-plans/006-harden-media-ingestion.md b/advisor-plans/006-harden-media-ingestion.md index b4465541..17c6ecbd 100644 --- a/advisor-plans/006-harden-media-ingestion.md +++ b/advisor-plans/006-harden-media-ingestion.md @@ -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 diff --git a/advisor-plans/007-versioned-document-artifact.md b/advisor-plans/007-versioned-document-artifact.md index a28c47c8..a5197105 100644 --- a/advisor-plans/007-versioned-document-artifact.md +++ b/advisor-plans/007-versioned-document-artifact.md @@ -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 diff --git a/advisor-plans/008-lossless-document-fusion.md b/advisor-plans/008-lossless-document-fusion.md index 4203d284..2125cbd4 100644 --- a/advisor-plans/008-lossless-document-fusion.md +++ b/advisor-plans/008-lossless-document-fusion.md @@ -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. diff --git a/advisor-plans/009-structural-markdown-html.md b/advisor-plans/009-structural-markdown-html.md index 36d243e3..f7be7318 100644 --- a/advisor-plans/009-structural-markdown-html.md +++ b/advisor-plans/009-structural-markdown-html.md @@ -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 diff --git a/advisor-plans/010-native-ooxml-documents.md b/advisor-plans/010-native-ooxml-documents.md index 7dced4be..5c476080 100644 --- a/advisor-plans/010-native-ooxml-documents.md +++ b/advisor-plans/010-native-ooxml-documents.md @@ -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 | diff --git a/advisor-plans/011-bounded-native-rtf.md b/advisor-plans/011-bounded-native-rtf.md index f8de1524..c8b46527 100644 --- a/advisor-plans/011-bounded-native-rtf.md +++ b/advisor-plans/011-bounded-native-rtf.md @@ -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 | diff --git a/advisor-plans/012-document-qualification-gate.md b/advisor-plans/012-document-qualification-gate.md index b3cdbd61..e86690f7 100644 --- a/advisor-plans/012-document-qualification-gate.md +++ b/advisor-plans/012-document-qualification-gate.md @@ -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 | @@ -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; diff --git a/advisor-plans/013-typescript-javascript-graph-quality.md b/advisor-plans/013-typescript-javascript-graph-quality.md index 60accb66..2bcfa8b5 100644 --- a/advisor-plans/013-typescript-javascript-graph-quality.md +++ b/advisor-plans/013-typescript-javascript-graph-quality.md @@ -2334,23 +2334,23 @@ syntax behavior changes over time. All Cargo commands that compile must use this worktree's unique external target: -`CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923` +`CARGO_TARGET_DIR=/crabbuild-target/compass-6923` -Verify `/Volumes/Workspace` is mounted and the directory is writable before the +Verify the qualification corpus root and Cargo target directory are writable before the first build. Stop rather than falling back to `target/`. | Purpose | Command | Expected result | |---|---|---| -| language tests | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 cargo test -p compass-languages --locked` | exit 0 | -| resolver tests | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 cargo test -p compass-resolve --locked` | exit 0 | -| program/core tests | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 cargo test -p compass-program -p compass-core --locked` | exit 0 | +| language tests | `cargo test -p compass-languages --locked` | exit 0 | +| resolver tests | `cargo test -p compass-resolve --locked` | exit 0 | +| program/core tests | `cargo test -p compass-program -p compass-core --locked` | exit 0 | | qualification unit tests | `python3 -m unittest benchmarks.performance.tests.test_audit benchmarks.performance.tests.test_correctness benchmarks.performance.tests.test_language_fixture_compare` | exit 0 | -| fixture qualification | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 ./scripts/qualify_code_graph_v1.sh --fixtures-only` | all cases pass | +| fixture qualification | `./scripts/qualify_code_graph_v1.sh --fixtures-only` | all cases pass | | JavaScript package checks | `npm ci && npm run typecheck:js && npm run test:js` | exit 0 | | product boundary | `sh scripts/check_product_boundary.sh` | no Graphify/runtime boundary violation | | format | `cargo fmt --all -- --check` | exit 0 | -| workspace lint | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 cargo clippy --workspace --lib --bins --locked -- -D warnings` | exit 0 | -| workspace tests | `CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 cargo test --workspace --lib --bins --locked` | exit 0 | +| workspace lint | `cargo clippy --workspace --lib --bins --locked -- -D warnings` | exit 0 | +| workspace tests | `cargo test --workspace --lib --bins --locked` | exit 0 | Each phase below adds a narrower verification command. Keep those commands in the final PR description with the exact commit, tool versions, and corpus pins. @@ -2878,7 +2878,7 @@ the exact release candidate, not an earlier feature commit or a working tree. 1. Promote the four audited corpora to pinned release gates after license and disk policy review. Store external read-only repositories beneath - `/Volumes/Workspace/Github//`; keep generated graphs and + `//`; keep generated graphs and audit artifacts outside tracked sources. 2. Add extended regression corpora for a large monorepo, current TypeScript compiler syntax, React/Next, Angular, Vue/Nuxt, Svelte/SvelteKit, and Astro. @@ -3012,7 +3012,7 @@ Stop and report rather than weakening the design if: - competitor inputs cannot be configured equivalently enough for a defensible comparison; - performance results are too noisy or incomplete for a public claim; -- `/Volumes/Workspace` is unavailable for a Cargo build or real-corpus checkout; +- `` is unavailable for a Cargo build or real-corpus checkout; - pre-existing user changes cannot be preserved. ## Maintenance notes diff --git a/benchmarks/performance/README.md b/benchmarks/performance/README.md index 1dd884ec..90465c0f 100644 --- a/benchmarks/performance/README.md +++ b/benchmarks/performance/README.md @@ -169,8 +169,7 @@ The Rust-side candidate seam has one opt-in compiler differential fixture. Run it from a checkout with the pinned Node dependencies installed: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 \ - cargo test -p compass-languages --test typescript_oracle_differential \ +cargo test -p compass-languages --test typescript_oracle_differential \ --locked -- --ignored ``` @@ -182,9 +181,8 @@ the separate checker oracle and keep the candidate adapter out of production: ```bash RUST_MIN_STACK=33554432 \ -COMPASS_TS_QUALIFICATION_ROOT=/Volumes/Workspace/Github// \ -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass- \ - cargo test -p compass-languages --test typescript_target_differential \ +COMPASS_TS_QUALIFICATION_ROOT=// \ +cargo test -p compass-languages --test typescript_target_differential \ checker_oracle_adjudicates_local_candidate_targets --locked -- --ignored --nocapture ``` diff --git a/benchmarks/performance/oracles/README.md b/benchmarks/performance/oracles/README.md index 1e719bb3..669951b6 100644 --- a/benchmarks/performance/oracles/README.md +++ b/benchmarks/performance/oracles/README.md @@ -51,17 +51,16 @@ Run them against an external, read-only corpus after `npm ci`: ```bash node benchmarks/performance/oracles/typescript-source-oracle.mjs \ - --root /Volumes/Workspace/Github// --jsonl + --root // --jsonl node benchmarks/performance/oracles/typescript-resolution-oracle.mjs \ - --root /Volumes/Workspace/Github// + --root // ``` The ignored Rust differential harness compares the source oracle's accepted construct ranges with the test-only Compass candidate emitter: ```bash -COMPASS_TS_QUALIFICATION_ROOT=/Volumes/Workspace/Github// \ -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 \ +COMPASS_TS_QUALIFICATION_ROOT=// \ cargo test -p compass-languages --test typescript_corpus_differential \ --locked -- --ignored --nocapture ``` @@ -75,8 +74,7 @@ Run target adjudication explicitly (it is ignored so normal native tests remain Node-free): ```bash -COMPASS_TS_QUALIFICATION_ROOT=/Volumes/Workspace/Github// \ -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 \ +COMPASS_TS_QUALIFICATION_ROOT=// \ cargo test -p compass-languages --test typescript_target_differential \ --locked -- --ignored --nocapture ``` @@ -91,9 +89,8 @@ explicit report path. The report is atomically written only when this ignored qualification test is run; it is never produced by normal Compass builds: ```bash -COMPASS_TS_QUALIFICATION_ROOT=/Volumes/Workspace/Github// \ -COMPASS_TS_TARGET_REPORT=/Volumes/Workspace//typescript-target-report.json \ -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-6923 \ +COMPASS_TS_QUALIFICATION_ROOT=// \ +COMPASS_TS_TARGET_REPORT=//typescript-target-report.json \ cargo test -p compass-languages --test typescript_target_differential \ --locked -- --ignored --nocapture ``` @@ -108,8 +105,8 @@ reason for every non-correct label under ```bash python3 benchmarks/performance/harness.py typescript-scorecard \ - --scorecard /Volumes/Workspace//typescript-scorecard.json \ - --output /Volumes/Workspace//typescript-scorecard-result.json + --scorecard //typescript-scorecard.json \ + --output //typescript-scorecard-result.json ``` The evaluator computes precision, 95% Wilson bounds, recall, target-cluster diff --git a/docs/design/code-graph-v1-qualification.md b/docs/design/code-graph-v1-qualification.md index 32dc4b93..82c004be 100644 --- a/docs/design/code-graph-v1-qualification.md +++ b/docs/design/code-graph-v1-qualification.md @@ -48,7 +48,7 @@ For a clean local checkout at the pinned commit, avoid a second clone with: ```bash ./scripts/qualify_code_graph_v1.sh \ --repositories tests/qualification/code-graph-v1-repositories.toml \ - --local-repository /Volumes/Workspace/Github/Entire + --local-repository /Entire ``` The release-corpus mode verifies the manifest pin, requires a clean source diff --git a/docs/implementation/compass-store-plan.md b/docs/implementation/compass-store-plan.md index e948f889..50963b4d 100644 --- a/docs/implementation/compass-store-plan.md +++ b/docs/implementation/compass-store-plan.md @@ -131,7 +131,7 @@ Every phase follows these rules independently: `compass-files`, query behavior in `compass-query`, and public command effects in `compass-cli`. 8. **Use one target directory per checkout.** Every compiling Cargo command - sets `CARGO_TARGET_DIR` under `/Volumes/Workspace/crabbuild-target` as + sets `CARGO_TARGET_DIR` under `/crabbuild-target` as required by `AGENTS.md`. ## Phase dependency map @@ -193,15 +193,12 @@ A phase is complete only when: The normal final Rust baseline is: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass- \ - cargo fmt --all -- --check -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass- \ - cargo clippy --workspace --lib --bins --locked -- -D warnings -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass- \ - cargo test --workspace --lib --bins --locked +cargo fmt --all -- --check +cargo clippy --workspace --lib --bins --locked -- -D warnings +cargo test --workspace --lib --bins --locked ``` -Use the actual unique checkout name. Verify `/Volumes/Workspace` is mounted and +Use the actual unique checkout name. Verify `` is mounted and writable before running Cargo; do not fall back to a local `target/`. ## Phase 0: Freeze the contract and build the reference store @@ -1077,21 +1074,18 @@ release metadata have settled. In addition to targeted crate tests, run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass- \ - cargo test -p compass-cli --test compass_product --locked +cargo test -p compass-cli --test compass_product --locked sh scripts/check_product_boundary.sh -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass- \ - cargo test -p compass-cypher --test tck --locked -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass- \ - cargo test -p compass-query --test opencypher_tck --locked +cargo test -p compass-cypher --test tck --locked +cargo test -p compass-query --test opencypher_tck --locked python3 scripts/check_compassql_support.py ./scripts/qualify_code_graph_v1.sh --fixtures-only ``` Run repository qualification on external repositories only under -`/Volumes/Workspace/Github` and treat them as read-only, following +`/Github` and treat them as read-only, following `AGENTS.md`. ### Exit and rollback diff --git a/docs/implementation/evidence-resolution-framework-phased-execution-plan.md b/docs/implementation/evidence-resolution-framework-phased-execution-plan.md index 386fcf70..8d1e337d 100644 --- a/docs/implementation/evidence-resolution-framework-phased-execution-plan.md +++ b/docs/implementation/evidence-resolution-framework-phased-execution-plan.md @@ -883,23 +883,18 @@ Every Cargo command must use a per-worktree target directory on the mounted workspace volume: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main \ - cargo test -p compass-resolve --test universal_evidence --locked +cargo test -p compass-resolve --test universal_evidence --locked -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main \ - cargo test -p compass-resolve --test universal_resolution --locked +cargo test -p compass-resolve --test universal_resolution --locked -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main \ - cargo clippy -p compass-resolve --all-targets --all-features --locked -- -D warnings +cargo clippy -p compass-resolve --all-targets --all-features --locked -- -D warnings -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main \ - cargo test -p compass-resolve --locked +cargo test -p compass-resolve --locked -CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-main \ - ./scripts/qualify_code_graph_v1.sh --fixtures-only +./scripts/qualify_code_graph_v1.sh --fixtures-only ``` -Before a long build, confirm `/Volumes/Workspace` is mounted and the selected +Before a long build, confirm `` is mounted and the selected target directory belongs only to this checkout. ## Phase dependencies diff --git a/docs/implementation/query-performance-accuracy-recall-phased-technical-design.md b/docs/implementation/query-performance-accuracy-recall-phased-technical-design.md index ba1b3897..098ebae9 100644 --- a/docs/implementation/query-performance-accuracy-recall-phased-technical-design.md +++ b/docs/implementation/query-performance-accuracy-recall-phased-technical-design.md @@ -428,7 +428,7 @@ Tune weights via relevance corpus; keep profile IDs for quick A/B. For each phase, run at least: -- `CARGO_TARGET_DIR=/Volumes/Workspace/crubuild-target/compass-main cargo test -p compass-query --test relevance_qualification --locked` +- `CARGO_TARGET_DIR=/crubuild-target/compass-main cargo test -p compass-query --test relevance_qualification --locked` - `python3 scripts/qualify_query_relevance.py` - phase-specific targeted tests: - intent parser unit tests, diff --git a/docs/superpowers/plans/2026-07-23-extraction-superset-parity.md b/docs/superpowers/plans/2026-07-23-extraction-superset-parity.md index 843ae4d1..f13cb496 100644 --- a/docs/superpowers/plans/2026-07-23-extraction-superset-parity.md +++ b/docs/superpowers/plans/2026-07-23-extraction-superset-parity.md @@ -463,7 +463,7 @@ git commit -m "feat: add graph superset parity checker" **Interfaces:** - Environment: - - `PODMAN_ROOT`, default `/Volumes/Workspace/Github/podman` + - `PODMAN_ROOT`, default `/podman` - `COMPASS_BIN`, default `target/release/compass` resolved from the Compass repository root - `GRAPHIFY_PYTHON`, default `/Users/haipingfu/graphify/.venv/bin/python` - `PARITY_SAMPLES`, default `3` @@ -524,7 +524,7 @@ Capture query output outside the timed result. Before reporting latency, normali Add a `Graphify superset qualification` subsection to `docs/implementation/extraction-pipeline.md` with: ```bash -PODMAN_ROOT=/Volumes/Workspace/Github/podman \ +PODMAN_ROOT=/podman \ bash scripts/qualify_graphify_superset.sh ``` @@ -590,7 +590,7 @@ Expected: the graph update exits successfully. Do not stage generated `graphify- Run: ```bash -PODMAN_ROOT=/Volumes/Workspace/Github/podman \ +PODMAN_ROOT=/podman \ COMPASS_BIN=/Users/haipingfu/graphify/compass/target/release/compass \ GRAPHIFY_PYTHON=/Users/haipingfu/graphify/.venv/bin/python \ bash scripts/qualify_graphify_superset.sh diff --git a/docs/superpowers/plans/2026-07-24-actionable-semantic-diff-mvp.md b/docs/superpowers/plans/2026-07-24-actionable-semantic-diff-mvp.md index d11bc6fe..a265cbad 100644 --- a/docs/superpowers/plans/2026-07-24-actionable-semantic-diff-mvp.md +++ b/docs/superpowers/plans/2026-07-24-actionable-semantic-diff-mvp.md @@ -1373,10 +1373,10 @@ Expected: every command exits `0`; no warnings; graph report regenerates success - [ ] **Step 4: Rebuild and inspect the real cocoindex comparison** -First replay the established LevelDB cases from `/Volumes/Workspace/Github/leveldb`: +First replay the established LevelDB cases from `/leveldb`: ```bash -cd /Volumes/Workspace/Github/leveldb +cd /leveldb /Users/haipingfu/graphify/compass/target/debug/compass history build 78a352f /Users/haipingfu/graphify/compass/target/debug/compass history build 4a0c572 --profile-from 78a352f /Users/haipingfu/graphify/compass/target/debug/compass diff 78a352f 4a0c572 @@ -1388,7 +1388,7 @@ git status --short Expected: the deadlock body edit is either explained from supported summaries or explicitly indeterminate, never reduced to location churn; the Zstd addition reports retained symbols/call/dependency evidence; the original checkout remains clean. -From `/Volumes/Workspace/Github/cocoindex`, using the newly built Compass binary: +From `/cocoindex`, using the newly built Compass binary: ```bash /Users/haipingfu/graphify/compass/target/debug/compass history build 90571539 --profile-from 71f9cc9 diff --git a/docs/superpowers/plans/2026-07-24-semantic-delta-phase-0-1.md b/docs/superpowers/plans/2026-07-24-semantic-delta-phase-0-1.md index e07515e8..4284ca1b 100644 --- a/docs/superpowers/plans/2026-07-24-semantic-delta-phase-0-1.md +++ b/docs/superpowers/plans/2026-07-24-semantic-delta-phase-0-1.md @@ -1750,7 +1750,7 @@ git log --stat --oneline HEAD~10..HEAD - [ ] **Step 5: Run a real-repository smoke test** -From `/Volumes/Workspace/Github/cocoindex`, using the newly built binary: +From `/cocoindex`, using the newly built binary: ```bash /Users/haipingfu/graphify/compass/target/debug/compass history build HEAD~1 --code-only diff --git a/docs/superpowers/plans/2026-07-25-versioned-history-sub-two-second.md b/docs/superpowers/plans/2026-07-25-versioned-history-sub-two-second.md index a3fca5f0..faf50d68 100644 --- a/docs/superpowers/plans/2026-07-25-versioned-history-sub-two-second.md +++ b/docs/superpowers/plans/2026-07-25-versioned-history-sub-two-second.md @@ -145,7 +145,7 @@ Keep the strict wall-clock assertion ignored in ordinary debug test runs and exe - [ ] **Step 2: Verify the pre-fix release gate fails** -Run the release CLI against `/Volumes/Workspace/Github/fjall` in a fresh shared clone. +Run the release CLI against `/fjall` in a fresh shared clone. Expected baseline: approximately 3.94 seconds, exceeding the 2.0-second limit. diff --git a/docs/superpowers/plans/2026-07-30-best-effort-code-graph-publication.md b/docs/superpowers/plans/2026-07-30-best-effort-code-graph-publication.md index b3dca89d..d2d3bf5c 100644 --- a/docs/superpowers/plans/2026-07-30-best-effort-code-graph-publication.md +++ b/docs/superpowers/plans/2026-07-30-best-effort-code-graph-publication.md @@ -103,7 +103,7 @@ Run: ```bash cargo fmt --all -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo check -p compass-model --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo check -p compass-model --locked ``` Expected: both commands exit 0. @@ -123,7 +123,7 @@ Add tests proving: Run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo test -p compass-model --test code_graph_validation --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo test -p compass-model --test code_graph_validation --locked ``` Expected: all tests pass. @@ -239,7 +239,7 @@ Run: ```bash cargo fmt --all -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo check -p compass-graph --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo check -p compass-graph --locked ``` Expected: both commands exit 0. @@ -262,7 +262,7 @@ Add tests for: Run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo test -p compass-graph --test graph_v1_normalization --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo test -p compass-graph --test graph_v1_normalization --locked ``` Expected: all tests pass. @@ -332,8 +332,8 @@ Add tests proving: Run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo test -p compass-graph --locked -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo clippy -p compass-graph --all-targets --locked -- -D warnings +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo test -p compass-graph --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo clippy -p compass-graph --all-targets --locked -- -D warnings ``` Expected: both commands exit 0. @@ -412,8 +412,8 @@ Add coverage for: Run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo test -p compass-core --test loading_coverage --locked -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo test -p compass-cli --lib --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo test -p compass-core --test loading_coverage --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo test -p compass-cli --lib --locked ``` Expected: both commands exit 0. @@ -472,8 +472,8 @@ Test complete and partial graphs across search, callers, callees, impact, explor Run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo test -p compass-query --locked -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo clippy -p compass-query --all-targets --locked -- -D warnings +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo test -p compass-query --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo clippy -p compass-query --all-targets --locked -- -D warnings ``` Expected: both commands exit 0. @@ -554,7 +554,7 @@ Run: ```bash cargo fmt --all --check -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo test --workspace --lib --bins --tests --locked +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo test --workspace --lib --bins --tests --locked ``` Expected: formatting passes and all non-ignored tests pass. @@ -564,7 +564,7 @@ Expected: formatting passes and all non-ignored tests pass. Run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo clippy -p compass-model -p compass-graph -p compass-core -p compass-query -p compass-cli --all-targets --locked -- -D warnings +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo clippy -p compass-model -p compass-graph -p compass-core -p compass-query -p compass-cli --all-targets --locked -- -D warnings ``` Expected: exit 0 with no warnings. @@ -574,7 +574,7 @@ Expected: exit 0 with no warnings. Run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target bash scripts/qualify_code_graph_v1.sh --fixtures-only +CARGO_TARGET_DIR=/compass-v1-remediation-target bash scripts/qualify_code_graph_v1.sh --fixtures-only ``` Expected: the production binary builds and every fixture, invariant, framework flow, and deterministic comparison passes. Record the complete qualification summary in the handoff. @@ -600,7 +600,7 @@ Expected: no whitespace errors, only intended files, and scoped commits. **Files:** - No repository source modifications -- Write benchmark logs under `/Volumes/Workspace/compass-heavy-framework-best-effort-20260730/` +- Write benchmark logs under `/compass-heavy-framework-best-effort-20260730/` **Interfaces:** @@ -613,8 +613,8 @@ Expected: no whitespace errors, only intended files, and scoped commits. Run: ```bash -CARGO_TARGET_DIR=/Volumes/Workspace/compass-v1-remediation-target cargo build --release --locked -p compass-cli --bin compass -shasum -a 256 /Volumes/Workspace/compass-v1-remediation-target/release/compass +CARGO_TARGET_DIR=/compass-v1-remediation-target cargo build --release --locked -p compass-cli --bin compass +shasum -a 256 /compass-v1-remediation-target/release/compass ``` Record the commit and binary hash. diff --git a/docs/superpowers/reviews/2026-07-30-best-effort-heavy-framework-qualification.md b/docs/superpowers/reviews/2026-07-30-best-effort-heavy-framework-qualification.md index 7fe432a5..dfd51eb0 100644 --- a/docs/superpowers/reviews/2026-07-30-best-effort-heavy-framework-qualification.md +++ b/docs/superpowers/reviews/2026-07-30-best-effort-heavy-framework-qualification.md @@ -47,8 +47,8 @@ Host: The source checkouts and generated evidence are retained under: ```text -/Volumes/Workspace/compass-heavy-framework-perf-20260729/repos -/Volumes/Workspace/compass-heavy-framework-best-effort-20260730 +/compass-heavy-framework-perf-20260729/repos +/compass-heavy-framework-best-effort-20260730 ``` ## Build Results diff --git a/docs/superpowers/specs/2026-07-23-history-build-all-design.md b/docs/superpowers/specs/2026-07-23-history-build-all-design.md index 51d4e1bd..2c1aa0af 100644 --- a/docs/superpowers/specs/2026-07-23-history-build-all-design.md +++ b/docs/superpowers/specs/2026-07-23-history-build-all-design.md @@ -371,7 +371,7 @@ compass history build main --all --code-only ### Real-repository qualification Create a shallow disposable clone of -`/Volumes/Workspace/Github/cocoindex` containing a small number of commits. +`/cocoindex` containing a small number of commits. Run: ```bash diff --git a/scripts/qualify_code_graph_v1.sh b/scripts/qualify_code_graph_v1.sh index dd0a2cc6..1c651e8c 100755 --- a/scripts/qualify_code_graph_v1.sh +++ b/scripts/qualify_code_graph_v1.sh @@ -5,10 +5,9 @@ QUALIFY_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" QUALIFY_TMP="$(mktemp -d "${TMPDIR:-/tmp}/compass-code-graph-v1.XXXXXX")" trap 'chmod -R u+w "$QUALIFY_TMP" 2>/dev/null || true; rm -rf -- "$QUALIFY_TMP"' EXIT -# Keep Rust build artifacts on the mounted workspace volume. Qualification -# intentionally exercises large repositories and must not fill the checkout's -# disk with a second target tree. -export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-/Volumes/Workspace/crabbuild-target/compass-main}" +# Qualification intentionally exercises large repositories. Set CARGO_TARGET_DIR +# before running if you want those build artifacts somewhere other than the +# checkout's own target directory. usage() { cat >&2 <&2 - exit 1 -fi mkdir -p "$target_dir" if [[ ! -w "$target_dir" ]]; then echo "error: target directory is not writable: $target_dir" >&2 diff --git a/skills/compass-release/SKILL.md b/skills/compass-release/SKILL.md index 6e70a036..c7daf30a 100644 --- a/skills/compass-release/SKILL.md +++ b/skills/compass-release/SKILL.md @@ -1,7 +1,7 @@ --- name: compass-release description: Release Compass from the latest origin/main. Use this skill whenever a user asks to sync Compass, bump a Compass version, create or merge a release PR, build or publish macOS/Linux/Windows artifacts, write release notes, verify release downloads, or build the matching VS Code VSIX. Follow the complete gated workflow rather than treating a release as a local version edit. -compatibility: Requires git, GitHub CLI (gh) with push/release permission, jq, Rust 1.97.1, Cargo, Node/npm, tar, shasum (or sha256sum), and a writable /Volumes/Workspace/crabbuild-target volume for Cargo builds. +compatibility: Requires git, GitHub CLI (gh) with push/release permission, jq, Rust 1.97.1, Cargo, Node/npm, tar, and shasum (or sha256sum). --- # Compass release @@ -23,7 +23,7 @@ Use these shell variables after the version is confirmed: version="" tag="compass-v${version}" branch="codex/release-${version}" -target_dir="/Volumes/Workspace/crabbuild-target/compass-release-${version}" +target_dir="${CARGO_TARGET_DIR:-$(git rev-parse --show-toplevel)/target}" ``` ## Safety gates @@ -31,7 +31,7 @@ target_dir="/Volumes/Workspace/crabbuild-target/compass-release-${version}" Stop and report the blocker instead of improvising when: 1. The worktree has user changes (`git status --short` is non-empty). Preserve them; never use `git reset --hard`, `git clean`, force-push, or overwrite unrelated files. -2. `/Volumes/Workspace` is missing or `$target_dir` cannot be created and written. Cargo must not fall back to a local `target/` directory. +2. `$target_dir` cannot be created and written. 3. The requested tag already exists, points at a different commit, or the GitHub release already exists. Published realizations are immutable. 4. `gh auth status` or repository permissions do not allow fetching, pushing, PR operations, or release inspection. 5. Metadata, validation, PR checks, tag validation, a release job, an archive checksum, or an archive smoke check fails. Do not publish a partial artifact set. @@ -80,10 +80,9 @@ Build release notes from the meaningful commits between the previous `compass-v* ## 3. Validate before publishing the PR -Verify the build volume and create only this checkout's target directory: +Create and verify this checkout's target directory: ```sh -test -d /Volumes/Workspace mkdir -p "$target_dir" test -w "$target_dir" ```