Skip to content

Add in-house deployment kit, docs and lockfile; fix bandit gate and stale UI test - #11

Open
VamikaSinghal wants to merge 2 commits into
mainfrom
chore/in-house-deployment
Open

VamikaSinghal wants to merge 2 commits into
mainfrom
chore/in-house-deployment

Conversation

@VamikaSinghal

Copy link
Copy Markdown
Collaborator

Summary

Makes the backend reproducible to run on infrastructure the operator controls (macOS launchd service, bare Linux, or Docker), documents the whole configuration/security/dependency surface, and fixes the two things keeping CI red on main that are not release-artefact related.

  • Scripts: scripts/setup_local.sh (uv/CPython 3.12 venv from a pinned lockfile, generated .env token, optional on-device embedding model, sqlite-vec check), start_backend.sh / stop_backend.sh / health_check.sh (FastAPI or standalone entry point, pidfile + log, 4-step health contract), backup_local.sh / restore_local.sh (WAL-safe vault + index snapshot).
  • Service: deploy/launchd/install.sh + uninstall.sh (user LaunchAgent with KeepAlive).
  • Containers: Dockerfile, docker-compose.yml (api + optional worker/proxy profiles), .dockerignore.
  • Pins: backend/requirements.lock.txt (uv pip compile --universal, 46 packages).
  • Config: .env.example rewritten as a full single-user reference; .gitignore extended (env files, venv, run state, data, backups, models, SQLite side files, keys).
  • Docs: docs/INSTALLATION.md, CONFIGURATION.md, OPERATIONS.md, SECURITY.md, DEPENDENCIES.md, IN_HOUSE_MIGRATION_REPORT.md; deployment topology appended to ARCHITECTURE.md; pointers in README.md / SETUP.md.
  • Fixes: SHA1 content fingerprints marked usedforsecurity=False in agent_sessions.py, obsidian_writeback.py, storage.py, vault.py (bandit B324, no behaviour change). test_macos_ui_quality_contract.py updated to the AppleSignInSupport symbols introduced in 40705d3.

No application architecture, framework or feature changes.

Verification (macOS 26, Apple Silicon, Xcode CLT + uv only)

  • pytest backend/tests: 2152 passed, 0 failed (was 1 failed on main)
  • All CI eval gates pass (retrieval_eval, tool_routing_eval, adapter_contract_eval, context_pack_eval, token_calibration_eval, agent_task_eval --deterministic, delivery_eval, rerank_eval, adaptation_eval, check_connector_baseline, check_docs_current, backend_beta_smoke, appstore_compliance_lint 46/46)
  • bandit -c .bandit.yaml -r backend scripts -ll: 0 medium/high (was 8 high); pip-audit --strict: clean
  • macos/build.sh (CORTEX_BUNDLE_PYTHON=0, ad-hoc): builds, codesign --verify --deep --strict passes
  • Both server entry points: health/ready, 401 on bad token, capture → approve → search → cited ask, MCP initialize + tools/list
  • launchd service survives kill -9 (auto-restart, data intact); backup → restore round-trip; clean-clone install on a fresh venv/port

Not verified here: Docker image (no Docker on the machine), Node packages (no Node 22). validate_update_manifest.py / ops_readiness_check.py still fail on the missing site/downloads/Cortex-0.2.0-51.dmg, same as on main; that is a release-pipeline check, unchanged by this PR.

🤖 Generated with Claude Code

Vamika Singhal and others added 2 commits October 17, 2026 19:14
…test

- scripts/setup_local.sh: uv/CPython 3.12 venv from pinned lockfile, generated .env token,
  optional on-device embedding model, sqlite-vec verification
- scripts/start_backend.sh, stop_backend.sh, health_check.sh: service wrappers for the
  FastAPI and standalone entry points with pidfile/log and a 4-step health contract
- scripts/backup_local.sh, restore_local.sh: WAL-safe vault + index backup and restore
- deploy/launchd: user LaunchAgent installer/uninstaller (KeepAlive, verified crash recovery)
- Dockerfile, docker-compose.yml, .dockerignore: Linux container path (api, optional
  worker/proxy profiles); untested locally (no Docker on the build machine)
- backend/requirements.lock.txt: universal lock of backend/requirements*.txt
- .env.example rewritten as a full single-user reference; .gitignore covers env, venv,
  run state, data, backups, models, keys
- docs: INSTALLATION, CONFIGURATION, OPERATIONS, SECURITY, DEPENDENCIES,
  IN_HOUSE_MIGRATION_REPORT; ARCHITECTURE deployment topology; README/SETUP pointers
- Mark SHA1 content fingerprints usedforsecurity=False (bandit B324; CI security gate)
- Update test_macos_ui_quality_contract to the AppleSignInSupport gate symbols

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ot requirements, remote site-feed validation

- test_rerank_eval: run warmup_embedding_provider() before checking the effective provider so
  the gate skips (as intended) when model2vec is not installed instead of failing on hash recall
- requirements.txt: restrict rumps to macOS; pyobjc cannot build on the ubuntu pip-audit runner
- validate_update_manifest.py: --allow-remote-artifacts accepts https artifacts not on disk and
  cross-checks their sha256 against the committed checksums file; strict mode unchanged
- ci.yml distribution step and ops_readiness_check site check use the new flag (release-dir
  validation stays strict)
- migration report updated

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant