-
Notifications
You must be signed in to change notification settings - Fork 0
CONTRIBUTING
Thanks for your interest. Cortex is a personal portfolio project, but patches, bug reports, and ideas are welcome.
Cortex is macOS-only. Linux and Windows are not supported and patches that add support are out of scope for the v0.2.x series.
| Requirement | Install |
|---|---|
| macOS 13+ (Ventura or later) | required |
| Python 3.11 or 3.12 | brew install python@3.11 |
| Node.js 18+ | brew install node |
| pnpm | npm install -g pnpm |
| Anthropic credentials | one of: Bedrock bearer token (Keychain), GCP Vertex ADC, or ANTHROPIC_API_KEY — Cortex falls back to deterministic rule-based plans without one |
git clone https://github.com/StevenWang-CY/cortex.git
cd cortex
make setup # creates .venv, installs Python + pnpm deps
pip install pre-commit && pre-commit install
cp cortex/.env.example .env
python -m cortex.scripts.seed_config --root .Common shortcuts (see Makefile):
make dev # start the daemon
make test # pytest
make lint # ruff
make typecheck # mypy --strict
make codegen # regenerate TypeScript schema types
make codegen-check # the CI drift gate
make ci # everything CI runsThis is the project's most important convention. The Pydantic models in cortex/libs/schemas/ are the single source of truth for every shape that crosses the daemon ↔ browser-extension boundary. The generated TypeScript file at cortex/apps/browser_extension/types/generated/cortex_schemas.d.ts is hands-off:
- Edit a Pydantic model in
cortex/libs/schemas/. - Run
make codegento regenerate the.d.ts. - Commit both the Python change and the regenerated
.d.tstogether. - The pre-commit hook and the
schema-codegen-checkCI job both runmake codegen-check, which fails the commit / PR if the.d.tsis stale.
Don't hand-edit the .d.ts. The file's header refuses it.
- Add a member to
cortex/libs/schemas/ws_message_types.py::MessageType. - If the daemon dispatches on it, add a case in
cortex/services/api_gateway/websocket_server.py::_process_messageand update the catalog tests. - Run
make codegenand commit the regenerated.d.tsalongside. - The TypeScript dispatch sites in
background.ts/popup.tsxnow type-check against the new union; their switch'sneverdefault flags any forgotten case at build time.
See cortex/docs/apis.md for the full message catalog.
Significant fixes that close a known issue use the audit Fxx:
prefix and link the corresponding entry in
audit/findings.md, e.g.:
audit F19: end-to-end correlation IDs across HTTP + WS + logs
Smaller fixes use a Conventional-Commits-flavoured prefix
(docs:, meta:, devx:, test:, fix:, audit Fxx:). See
git log --oneline for examples.
Before submitting:
-
make cipasses locally (lint + typecheck + tests + codegen drift check) - You added or updated tests for any code change
- If you touched a Pydantic schema, you ran
make codegenand committed the regenerated.d.ts - If your change relates to an audit finding, the commit subject
starts with
audit Fxx:andaudit/execution-log.mdis updated - No new
print()calls (usestructlogviacortex.libs.logging.event) - No biometric or webcam-frame data added to any LLM prompt path (see SECURITY.md)
- Linux or Windows support (out of scope for v0.2.x — Cortex is tied to AVFoundation, TCC, and macOS-specific frameworks)
- Any change that puts biometrics into an LLM payload
- Removal of the consent ladder, undo stack, or capability-token gate
- Bypassing the schema codegen drift gate
Use the issue templates. For security issues, file a private security advisory instead.
By contributing, you agree your contribution is licensed under the MIT License.