Skip to content

Test Commands

NON-NORMATIVE.

Run these from the repo root. In this repo, workspace root = repo root.

cd "$(git rev-parse --show-toplevel)"

Use WSL, Git Bash, or another Unix shell on Windows.

Canonical full-stack entrypoint

scripts/validate-full-stack.sh is the canonical bootstrap + validation command.

Default path, with mocked route tests and static migration validation only:

bash scripts/validate-full-stack.sh --skip-supabase

Local database path, with Supabase CLI + Docker:

bash scripts/validate-full-stack.sh --with-supabase

The script does this, in this order:

set -euo pipefail
python -m venv .venv              # if .venv does not exist
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e '.[dev]' # on cold boot or when pyproject.toml changed
npm install                       # on cold boot or when package-lock.json changed
export PYTHONPATH=src

It writes logs under .morphism/validation/<timestamp>/.

Exact command matrix

These are the exact commands mirrored by the full-stack script.

Governance and repo integrity

python scripts/policy_check.py --mode ci --explain
python scripts/drift_detector.py
python scripts/validate-registry.py
bash tests/e2e-inventory-system.sh
python scripts/dependency_health.py --check
python scripts/runbook_coverage.py --check

TypeScript and app surfaces

npm run lint
npm run typecheck
npm test

Python validation and benchmarks

npm run test:python
npm run test:benchmarks

Optional staging smoke

npm run test:staging

Set STAGING_URL first when you want to hit a deployed surface:

STAGING_URL=https://your-staging-url npm run test:staging

Authenticated staging checks only run when STAGING_AUTH_COOKIE is set.

Root package scripts

The repo root exposes these convenience commands:

npm run test:python
npm run test:benchmarks
npm run test:staging
npm run validate:full

npm run validate:full is equivalent to:

bash scripts/validate-full-stack.sh --skip-supabase

Supabase integration path

--with-supabase adds the local database integration sequence below:

cd apps/morphism
npx supabase start
npx supabase db reset
npm run test -- src/__tests__/supabase-local.integration.test.ts
npx supabase stop

Without --with-supabase, the script prints local DB integration skipped and relies on:

pytest tests/test_supabase_migrations.py

inside the Python suite for migration presence, order, and schema sanity.

SSOT maintenance

After editing SSOT-backed blocks in AGENTS.md, SSOT.md, or GUIDELINES.md, refresh atoms and registry:

python scripts/ssot_extract.py
python scripts/ssot_verify.py

Docs verification

To verify MkDocs navigation and link integrity after governance doc changes:

mkdocs build --strict
python scripts/docs_graph.py --check
python scripts/docs_contract.py --check

When validating a PR or local branch against a base branch, run the diff-aware docs contract check as well:

python scripts/docs_contract.py --check --commit-range origin/main...HEAD

Temporary exceptions to the runtime-doc coupling rule must be recorded in:

.morphism/policies/docs_contract_waivers.json

Each waiver needs an id, doc path, path_globs, reason, owner, and expiry date.