sourceharbor

Testing

SourceHarbor uses layered verification.

Think of it like product evidence in layers:

  1. Fast checks catch broken contracts and fake tests
  2. Doctor classifies first-run blockers before you burn time on deeper smoke
  3. Core suites verify Python surfaces and shared behavior
  4. Supervisor clean path proves the repo-managed operator path locally
  5. Long live smoke extends into secret and provider gates on purpose

Five-Layer Verification Contract

Think of this like airport checkpoints:

Do not force every heavy check into the default local path. Each layer answers a different question.

Layer Default trigger Primary entrypoints What it proves
pre-commit local edit / commit prep fast local checks below + web lint the fastest contributor-side contract stays honest before deeper proof
pre-push contributor-side push gate .githooks/pre-push the default local parity hook stays deterministic and does not silently expand into a full closeout audit
hosted GitHub pull_request / push ci.yml, pre-commit.yml, dependency-review.yml, codeql.yml on PR/push, trivy.yml, trufflehog.yml, zizmor.yml the branch-protected remote contract for pull requests and main
nightly hosted schedule codeql.yml on schedule thin background security refresh; keep this lane small and do not create a separate weekly governance bucket
manual human-triggered or operator-triggered ./bin/repo-side-strict-ci --mode pre-push, ./bin/quality-gate --mode pre-push, ./bin/governance-audit --mode audit, ./bin/smoke-full-stack --offline-fallback 0, repo-owned real-profile browser proof, build-public-api-image.yml, build-ci-standard-image.yml, release-evidence-attest.yml provider/browser/release/publication truth plus closeout-grade repo/public audits

Fast Local Checks

python3 scripts/governance/check_env_contract.py --strict
python3 scripts/governance/check_host_safety_contract.py
python3 scripts/governance/check_host_specific_path_references.py
python3 scripts/governance/check_test_assertions.py
python3 scripts/governance/check_route_contract_alignment.py
python3 scripts/governance/check_public_entrypoint_references.py
python3 scripts/governance/check_public_personal_email_references.py
python3 scripts/governance/check_public_sensitive_surface.py
python3 scripts/governance/check_local_private_ledger_migration.py
python3 scripts/governance/check_external_lane_contract.py
eval "$(bash scripts/ci/prepare_web_runtime.sh --shell-exports)"
( cd "$WEB_RUNTIME_WEB_DIR" && npm run lint )
python3 scripts/runtime/maintain_external_cache.py --json

First-Run Doctor

./bin/doctor

What it tells you:

What they cover:

Core Python Test Suite

bash scripts/ci/python_tests.sh

What it covers:

Supervisor Clean Path

./bin/bootstrap-full-stack
./bin/full-stack up
source .runtime-cache/run/full-stack/resolved.env
./bin/full-stack status
curl -sS "${SOURCE_HARBOR_API_BASE_URL}/healthz"
curl -I "http://127.0.0.1:${WEB_PORT}/ops"

What it proves:

Important local-truth notes:

Long Live Smoke Lane

./bin/smoke-full-stack --offline-fallback 0

What it proves:

Important boundary:

Local-Only Login Browser Lane

GitHub-hosted CI stays login-free.

If a browser flow genuinely depends on a real signed-in Chrome session, treat it as a local-only proof lane instead of a hosted CI lane.

SourceHarbor now uses a dedicated isolated Chrome root:

Bootstrap and start it with:

./bin/bootstrap-repo-chrome --json
./bin/start-repo-chrome --json
python3 scripts/runtime/resolve_chrome_profile.py --mode repo-runtime --json
bash scripts/ci/external_playwright_smoke.sh --browser chromium --real-profile --url https://example.com

Hosted workflows must not reference SOURCE_HARBOR_CHROME_* or try to reuse a local persistent browser profile.

Git Hooks

Install hooks with:

./bin/install-git-hooks

Pre-commit and pre-push should block:

PR-Facing Security And Dependency Checks

These checks now sit on the remote branch-protected pull-request path together with python-tests, web-lint, and pre-commit. They still answer a different question from the small local proof path above: they widen GitHub-side supply-chain, workflow-safety, and secret-scanning coverage rather than replacing the repo-managed local supervisor proof.

Those branch-protected checks are current remote required checks today, so this page should not describe them as optional or merely advisory.

External-Proof Workflow-Dispatch Lanes

These still stay outside the default pull-request gate:

Think of them like specialist inspectors after the core exam:

Manual Truth Audits And Closeout Lanes

These commands are the closer’s toolkit, not the default newcomer path.

Use them when you need remote/public truth, current-proof receipts, or release and provider evidence that go beyond the ordinary local and PR-facing lanes.

./bin/repo-side-strict-ci --mode pre-push
./bin/quality-gate --mode pre-push
./bin/governance-audit --mode audit
python3 scripts/governance/probe_remote_platform_truth.py
python3 scripts/governance/check_remote_required_checks.py
python3 scripts/governance/check_remote_security_alerts.py
python3 scripts/governance/probe_external_lane_workflows.py
python3 scripts/governance/check_current_proof_commit_alignment.py
python3 scripts/governance/render_newcomer_result_proof.py && python3 scripts/governance/check_newcomer_result_proof.py
python3 scripts/governance/render_current_state_summary.py && python3 scripts/governance/check_current_state_summary.py

Closeout note:

Mutation-readiness note:

What this layer proves:

Public-Proof Boundary

For the public evidence ladder, read proof.md.