Thanks for your interest in improving CorpOS — a reference implementation of an autonomous company (firm model, work contracts, and a policy-gated control plane). This document explains how to set up the project and what is expected of a contribution.
CorpOS is a reference / educational implementation, not a production-hardened multi-tenant SaaS. Contributions must not:
- Soften or remove the reference-architecture scope language in the README or SECURITY.md.
- Imply production guarantees (multi-tenant isolation, production OIDC/TLS, real payment providers) that the codebase does not provide.
- Commit secrets, live credentials, or real customer data.
Please also follow the Code of Conduct.
- Node.js ≥ 22 (see
.nvmrc; CI covers 22 and 24). - npm 11.17.0 via Corepack (
packageManagerinpackage.json). Required for enforceableallowScripts/strict-allow-scripts.
npm ci --include=dev
npm run build
./scripts/harness/verify.sh # build · typecheck · test · lint · format · stack guards
./scripts/harness/adversarial.sh # authorized local adversarial probes
# Force a clean reinstall (CI does this): CORPOS_VERIFY_CLEAN=1 ./scripts/harness/verify.shA contribution is not finished until ./scripts/harness/verify.sh is green
locally. CI runs verify and adversarial on every pull request to main.
Useful commands:
npm run dev # ops console on $PORT or 3000
npm test
npm run scenario # HITL default-off; exits non-zero unless exception is auto-settled
npm run audit:verifyHeadless company-day settles that must exit 0 need autoApproveException: true
(used in tests). Product demos and the ops console keep it false.
- Workspaces: firm logic in
packages/core, MCP knowledge inpackages/mcp-knowledge, HTTP inapps/api, ops UI inapps/console. - ToolGateway is the sole chokepoint for consequential tools; unknown tools fail closed.
- Do not introduce Express or
better-sqlite3(enforced by the harness). - Prefer Drizzle + libsql, Hono, and the official MCP SDK for new integration surfaces.
Non-trivial architectural decisions are recorded as ADRs in
docs/adr/README.md. If your change introduces or reverses
a decision, add or update an ADR.
If you change the ops console layout materially, regenerate README assets:
npm run build && npm run start # or PORT=3100 npm run start
npm run screenshots # see docs/assets/README.md- Conventional-commit-ish titles:
feat(core): trust unlock after company day. - Small, reviewable diffs — one logical change per PR.
- Never commit secrets,
*.dbfiles,.env, ordist/. - Open a pull request against
main; fill in the PR template; CI must pass before merge.
| Check | Where |
|---|---|
| OpenSSF Scorecard | .github/workflows/scorecard.yml |
| CodeQL | .github/workflows/codeql.yml |
| Dependabot | .github/dependabot.yml |
| Local verify | ./scripts/harness/verify.sh |
| Local adversarial | ./scripts/harness/adversarial.sh |
By contributing, you agree that your contributions are licensed under the Apache License 2.0.