SourceHarbor

Local Runbook

This is the operator runbook for local proof, not a hosted deployment guide.

What To Run First

  1. Copy .env.example to .env.
  2. Install dependencies with:
set -a
source .env
set +a
UV_PROJECT_ENVIRONMENT="${UV_PROJECT_ENVIRONMENT:-$SOURCE_HARBOR_CACHE_ROOT/project-venv}" \
  uv sync --frozen --extra dev --extra e2e
  1. Run ./bin/doctor to see env/runtime blockers before boot.
  2. Boot the stack with ./bin/bootstrap-full-stack and ./bin/full-stack up.
  3. Use start-here.md to queue the first real job.

Keep the local boot topology honest:

Where To Look When Something Feels Off

That temporary .env.local is intentional. It pins the local browser-facing API base URL and the local write-session fallback into the repo-managed web runtime so manual intake and other web writes keep working even when local env profiles contain non-truthy strings like CI=false.

Current local video-first note:

Do not hand-delete .runtime-cache/ when local verification expands the repo footprint. Use runtime-cache-maintenance for repo-side maintenance, and use disk-space-cleanup --wave ... only when you are intentionally running a governed cleanup wave from reference/disk-space-governance.md.

Current scratch-space rule:

The two runtime-heavy local caches worth recognizing by name are:

If you want a clean local runtime reset before another verification pass, use ./bin/full-stack down first; that shutdown path now also attempts to tear down repo-owned core services instead of leaving Postgres/Temporal residue behind.

If you create an ad-hoc mutation workspace such as .runtime-cache/tmp/mutation-debug, delete it after the debugging turn ends so the tmp/ budget does not fail-close future governance runs.

Do not hand-delete the repo-owned external cache root resolved by SOURCE_HARBOR_CACHE_ROOT either.

Local Browser Login State

If a local browser proof actually needs login state, SourceHarbor uses a dedicated browser root instead of your default personal Chrome root:

./bin/bootstrap-repo-chrome --json
./bin/start-repo-chrome --json
./bin/open-repo-chrome-tabs --site-set login-strong-check --json
python3 scripts/runtime/resolve_chrome_profile.py --mode repo-runtime --json

The runtime model is now:

Hosted CI stays login-free. Real-profile browser proof is a local-only lane.

When you intentionally keep browser proof sessions in local env files, treat GITHUB_COOKIE, GOOGLE_COOKIE, RESEND_COOKIE, and YOUTUBE_COOKIE as maintainer-local, read-only proof helpers only. They are not public repo contract requirements, and they must never be committed, synced to shared stores, or echoed into runtime artifacts.

Site Capability Ledger

Treat these as the current local-proof site roles, not as a promise that every site should become a deep integration target.

Site Why it exists in the local runbook Strongest layer today Current gate Verdict
Google Account proves repo-owned Chrome login persistence and restart sanity DOM / page-state proof local login state when you intentionally run real-profile checks already-covered
YouTube proves the strongest current source + browser proof lane hybrid: Data API + DOM / page-state proof shared operator key persistence plus local login state when strict live proof is reopened already-covered
Bilibili account center proves whether the repo-owned profile still has the Bilibili account session needed for stronger local checks DOM today, hybrid later only if account-side automation becomes worth the maintenance cost human login in the repo-owned profile external-blocked
Resend dashboard proves notification/admin readiness and sender-chain follow-through, not source ingestion admin UI + provider configuration human login plus RESEND_FROM_EMAIL / sender-domain setup external-blocked
RSSHub / RSS sources source-universe intake coverage lives here, not in browser proof HTTP / API source availability and route/feed correctness already-covered

Do not treat Google Account or Resend as future ingestion targets just because they are part of the login-check tab set. They are operator proof surfaces.

If you want the longer-lived “what can still be deepened safely” map, read site-capability.md.

Quick Diagnosis Loop

  1. Re-run the smallest failing command.
  2. Check .runtime-cache/logs/ for the matching component log.
  3. Inspect /api/v1/jobs/<job-id> or /api/v1/feed/digests if the issue is inside a pipeline run.
  4. Use proof.md to keep local proof separate from remote proof claims.
  5. Use runtime-truth.md when Postgres, SQLite, artifacts, and release truth start sounding like one mixed story.
  6. Treat ./bin/smoke-full-stack --offline-fallback 0 as the long live-smoke lane, not as the same thing as the local supervisor proof.

When you need the strict repo-side closeout gate from a maintainer workstation, ./bin/repo-side-strict-ci --mode pre-push still prefers the standard-env container path, but it can now fall back to the host-bootstrapped pre-push quality gate when Docker itself is the only missing layer.

Boundaries

For the disk-space map, safe cleanup boundary, and legacy-path migration rules, read reference/disk-space-governance.md.