condor-for-games 0.4.0

Rust pathfinding library for grids, polygonal scenes, navmeshes, and replanning.
Documentation
# Resource-safe validation entrypoints for humans and coding agents.
# Keep Cargo output in this repository's normal target/ directory.

default:
    @just --list

format:
    cargo fmt --all

format-check:
    cargo fmt --all -- --check

check:
    CARGO_BUILD_JOBS=2 cargo check --all-features

check-example example:
    CARGO_BUILD_JOBS=2 cargo check --example "{{example}}" --all-features

check-condor-bench-examples:
    CARGO_BUILD_JOBS=2 cargo check -p condor-bench --examples --all-features

clippy-fast:
    CARGO_BUILD_JOBS=2 cargo clippy --lib --all-features -- -D warnings

clippy-target target:
    if [ "{{target}}" = "continuous" ]; then CARGO_BUILD_JOBS=2 cargo clippy -p condor-pathfinding-geometry --test "{{target}}" --all-features -- -D warnings; elif [ "{{target}}" = "grid_core" ] || [ "{{target}}" = "grid_preprocessing" ] || [ "{{target}}" = "any_angle" ] || [ "{{target}}" = "replanning" ] || [ "{{target}}" = "mapf" ]; then CARGO_BUILD_JOBS=2 cargo clippy -p condor-pathfinding-grid --test "{{target}}" --all-features -- -D warnings; elif [ "{{target}}" = "navmesh" ]; then CARGO_BUILD_JOBS=2 cargo clippy -p condor-pathfinding-navmesh --test "{{target}}" --all-features -- -D warnings; elif [ "{{target}}" = "benchmark_metadata" ]; then CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test "{{target}}" --all-features -- -D warnings; elif [ "{{target}}" = "story" ]; then CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test "{{target}}" --all-features -- -D warnings; else CARGO_BUILD_JOBS=2 cargo clippy --lib --test "{{target}}" --all-features -- -D warnings; fi

# Package-graph guards. Both workspace audits enforce the exact current-phase
# facade back-edges; T008 removes the last Lab allowance before the final
# no-back-edge graph becomes required.
architecture-check-package package:
    UV_CACHE_DIR=target/condor/uv-cache uv run --no-project python scripts/architecture-check.py package "{{package}}"

architecture-check-transitional:
    UV_CACHE_DIR=target/condor/uv-cache uv run --no-project python scripts/architecture-check.py transitional

architecture-check:
    UV_CACHE_DIR=target/condor/uv-cache uv run --no-project python scripts/architecture-check.py final

# Package-local library lanes used while implementation moves out of the
# facade. An optional libtest substring keeps each recipe useful for focused
# edit loops without broadening to integration targets.
test-core-lib filter="":
    if [ -n "{{filter}}" ]; then CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-core --lib --all-features -- "{{filter}}"; else CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-core --lib --all-features; fi

clippy-core-lib:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-pathfinding-core --lib --all-features -- -D warnings

test-geometry-lib filter="":
    if [ -n "{{filter}}" ]; then CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-geometry --lib --all-features -- "{{filter}}"; else CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-geometry --lib --all-features; fi

clippy-geometry-lib:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-pathfinding-geometry --lib --all-features -- -D warnings

test-geometry-docs:
    CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-geometry --doc --all-features

check-root-lib-all-features:
    CARGO_BUILD_JOBS=2 cargo check -p condor-for-games --lib --all-features

# Verify the published facade archive against versioned domain dependencies.
# Never bypass Cargo's archive compilation with `--no-verify`.
package-root:
    CARGO_BUILD_JOBS=2 cargo package -p condor-for-games --allow-dirty

test-grid-lib filter="":
    if [ -n "{{filter}}" ]; then CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-grid --lib --all-features -- "{{filter}}"; else CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-grid --lib --all-features; fi

test-grid-docs:
    CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-grid --doc --all-features

clippy-grid-lib:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-pathfinding-grid --lib --all-features -- -D warnings

package-grid:
    CARGO_BUILD_JOBS=2 cargo package -p condor-pathfinding-grid --allow-dirty

test-navmesh-lib filter="":
    if [ -n "{{filter}}" ]; then CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-navmesh --lib --all-features -- "{{filter}}"; else CARGO_BUILD_JOBS=2 cargo test -p condor-pathfinding-navmesh --lib --all-features; fi

clippy-navmesh-lib:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-pathfinding-navmesh --lib --all-features -- -D warnings

# Normal agent edit-loop check: name the one affected integration test target.
test-fast target:
    if [ "{{target}}" = "any_angle" ]; then scripts/with-any-angle-test-lock.sh env CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-pathfinding-grid --test "{{target}}"; elif [ "{{target}}" = "continuous" ]; then CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-pathfinding-geometry --test "{{target}}"; elif [ "{{target}}" = "grid_core" ] || [ "{{target}}" = "grid_preprocessing" ] || [ "{{target}}" = "replanning" ] || [ "{{target}}" = "mapf" ]; then CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-pathfinding-grid --test "{{target}}"; elif [ "{{target}}" = "navmesh" ]; then CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-pathfinding-navmesh --all-features --test "{{target}}"; elif [ "{{target}}" = "benchmark_metadata" ]; then CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test "{{target}}"; elif [ "{{target}}" = "story" ]; then scripts/with-any-angle-test-lock.sh env CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-harness --test "{{target}}"; else CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run --test "{{target}}"; fi

test-grid:
    just test-fast grid_core

test-any-angle:
    just test-fast any_angle

# Scoped any-angle runtime edit-loop lane. This builds the normal grid-owner
# binary and excludes corpus, capture, story, and stress routes.
test-any-angle-case filter:
    scripts/with-any-angle-test-lock.sh env CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-pathfinding-grid --test any_angle -- "{{filter}}"

# Explicit opt-in lanes for prepared-graph tests that intentionally construct
# dense all-vertex visibility graphs or cover a V2 scenario slice.
test-prepared-any-angle-promotion test:
    scripts/with-any-angle-test-lock.sh env CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=1 cargo nextest run -p condor-harness --test any_angle_oracles --run-ignored only -- "{{test}}"

test-any-angle-prepared-growth:
    just test-prepared-any-angle-promotion prepared_parity::graph_size_smoke_reports_dense_growth

test-prepared-any-angle-promotion-parity:
    just test-prepared-any-angle-promotion prepared_parity::v2_direct_los_prepared_matches_oracle
    just test-prepared-any-angle-promotion prepared_parity::v2_density_prepared_matches_oracle
    just test-prepared-any-angle-promotion prepared_parity::v2_corridor_slalom_prepared_matches_oracle
    just test-prepared-any-angle-promotion prepared_parity::v2_direct_los_prepared_matches_sampling_oracle
    just test-prepared-any-angle-promotion prepared_parity::v2_corner_stress_prepared_matches_oracle

test-grid-preprocessing:
    just test-fast grid_preprocessing

test-continuous:
    just test-fast continuous

test-navmesh:
    just test-fast navmesh

test-replanning:
    just test-fast replanning

test-benchmark-metadata:
    just test-condor-bench-benchmark-metadata

test-product-surface:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-for-games --test product_surface

test-story:
    just test-fast story

# Explicit opt-in stress evidence. This remains excluded from normal test runs.
test-story-stress:
    CONDOR_STORY_STRESS=1 CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=1 cargo nextest run -p condor-harness --test story --run-ignored only story_stress_open_field_128_astar_vs_bfs

test-mapf:
    just test-fast mapf

test-condor-lab:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-lab --test condor_lab_tui

# Mutable LDtk Path Lab: document round-trip, solver surface, and TUI contracts.
test-condor-path-lab:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-path-lab --all-features

clippy-condor-path-lab:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-path-lab --all-targets --all-features -- -D warnings

# Open a committed Path Lab corpus family (grid | any-angle | polygon | navmesh | mapf | replanning).
open-path-lab-corpus family:
    cargo run -q -p condor-path-lab -- "tools/condor-path-lab/corpus/{{family}}/world.ldtk"

# Generated evidence is deliberately local and ignored. This smoke writes one
# catalog under target/condor without collecting Criterion measurements.
smoke-evidence-output:
    CARGO_BUILD_JOBS=2 cargo run -p condor-bench --example capture_benchmark_scorecard

# Lab builds its snapshot from runtime registries, so a clean clone has no
# prerequisite generated evidence directory.
test-condor-lab-empty-evidence:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-lab --test condor_lab_tui lab_model_builds_without_generated_evidence

test-condor-bench-benchmark-metadata:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test benchmark_metadata

clippy-condor-bench-benchmark-metadata:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test benchmark_metadata --all-features -- -D warnings

test-condor-bench-product-surface:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test product_surface

# Geometry conformance owns the harness-level geometry corpus. The direct
# crate-level smoke targets remain fixture-free in their owning packages.
test-geometry-conformance:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-harness --test geometry_conformance

clippy-geometry-conformance:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test geometry_conformance --all-features -- -D warnings

# Fixture-free direct grid-owner smokes. These establish narrow evidence routes
# before the existing root corpus moves to the harness and bench packages.
test-grid-conformance:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-harness --test grid_conformance

clippy-grid-conformance:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test grid_conformance --all-features -- -D warnings

test-any-angle-oracles:
    scripts/with-any-angle-test-lock.sh env CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=1 cargo nextest run -p condor-harness --test any_angle_oracles

clippy-any-angle-oracles:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test any_angle_oracles --all-features -- -D warnings

test-endpoint-contracts:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-harness --test endpoint_contracts

clippy-endpoint-contracts:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test endpoint_contracts --all-features -- -D warnings

test-replanning-conformance:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-harness --test replanning_conformance

clippy-replanning-conformance:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test replanning_conformance --all-features -- -D warnings

test-mapf-conformance:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-harness --test mapf_conformance

clippy-mapf-conformance:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test mapf_conformance --all-features -- -D warnings

# Navmesh corpus conformance is harness-owned; the published crate's
# `navmesh` target remains fixture-free source-adjacent coverage.
test-navmesh-conformance:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=1 cargo nextest run -p condor-harness --test navmesh_conformance

clippy-navmesh-conformance:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test navmesh_conformance --all-features -- -D warnings

# Fixture-backed exact discriminator/oracle cases have their own serial target.
test-navmesh-oracles:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=1 cargo nextest run -p condor-harness --test navmesh_oracles

clippy-navmesh-oracles:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-harness --test navmesh_oracles --all-features -- -D warnings

test-flow-field-capture:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test flow_field_capture

clippy-flow-field-capture:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test flow_field_capture --all-features -- -D warnings

test-jps-plus-capture:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test jps_plus_capture

clippy-jps-plus-capture:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test jps_plus_capture --all-features -- -D warnings

test-grid-preprocessing-capture:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test grid_preprocessing_capture

clippy-grid-preprocessing-capture:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test grid_preprocessing_capture --all-features -- -D warnings

test-any-angle-capture:
    scripts/with-any-angle-test-lock.sh env CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test any_angle_capture

clippy-any-angle-capture:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test any_angle_capture --all-features -- -D warnings

test-replanning-capture:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test replanning_capture

clippy-replanning-capture:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test replanning_capture --all-features -- -D warnings

test-continuous-capture:
    scripts/with-continuous-capture-lock.sh env CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test continuous_capture

clippy-continuous-capture:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test continuous_capture --all-features -- -D warnings

test-continuous-governance:
    CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run -p condor-bench --test continuous_governance

clippy-continuous-governance:
    CARGO_BUILD_JOBS=2 cargo clippy -p condor-bench --test continuous_governance --all-features -- -D warnings

# Final non-ignored test tier. Doctests remain a separate Cargo command because
# cargo-nextest does not support them on stable Rust.
test-full:
    scripts/with-any-angle-test-lock.sh scripts/with-continuous-capture-lock.sh env CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=2 cargo nextest run --profile ci --workspace --all-targets --all-features
    cargo test --workspace --doc --all-features

# Exact oracle differential evidence: one ignored test at a time, with no
# competing test processes. Example:
# just test-oracle exhaustive_3x3_anya_matches_oracle
test-oracle test:
    scripts/with-any-angle-test-lock.sh env CONDOR_ORACLE_EXHAUSTIVE=1 CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=1 cargo nextest run -p condor-harness --test any_angle_oracles --run-ignored only "{{test}}"

# Navmesh exactness oracle scale/traffic evidence: one ignored test at a time.
# Example: just test-navmesh-oracle generated_ladder_matches_oracle
test-navmesh-oracle test:
    CONDOR_NAVMESH_ORACLE_SCALE=1 CARGO_BUILD_JOBS=2 NEXTEST_TEST_THREADS=1 cargo nextest run -p condor-harness --test navmesh_oracles --run-ignored only "{{test}}"

# Benchmark evidence is deliberately explicit and lane-scoped. Pass Criterion
# arguments after `--`, for example: `just bench-any-angle-promotion -- --sample-size 30`.
bench-grid-core packs="uniform" *criterion_args:
    CONDOR_BENCH_PACKS={{packs}} CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench grid_core {{criterion_args}}

bench-grid-lab packs="story-grid" *criterion_args:
    CONDOR_BENCH_PACKS={{packs}} CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench grid_lab {{criterion_args}}

bench-continuous-core *criterion_args:
    CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench continuous_core {{criterion_args}}

bench-continuous-stress *criterion_args:
    CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench continuous_stress {{criterion_args}}

bench-navmesh-direct *criterion_args:
    CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench navmesh_direct {{criterion_args}}

bench-navmesh-prepared *criterion_args:
    CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench navmesh_prepared {{criterion_args}}

bench-any-angle packs="any-angle" *criterion_args:
    CONDOR_BENCH_PACKS={{packs}} CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench any_angle {{criterion_args}}

bench-any-angle-promotion *criterion_args:
    CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench any_angle_promotion {{criterion_args}}

bench-prepared-any-angle-promotion *criterion_args:
    CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --bench prepared_any_angle_promotion {{criterion_args}}

# CI-equivalent quality gate. Avoid this in the normal edit loop.
ci: format-check clippy-full test-full bench-compile

clippy-full:
    CARGO_BUILD_JOBS=2 cargo clippy --workspace --all-targets --all-features -- -D warnings

# Compile one benchmark binary without collecting Criterion measurements.
bench-compile-one bench:
    CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --all-features --no-run --bench "{{bench}}"

# CI/full-boundary compilation of every isolated benchmark binary.
bench-compile-all:
    CARGO_BUILD_JOBS=2 cargo bench -p condor-bench --all-features --no-run

bench-compile: bench-compile-all