name: 0ctx-enterprise-hardening description: Implement and iterate enterprise-grade controls in 0ctx (audit logging, session correctness, observability, encrypted backups, reliability gates). Use when users request hardening from POC to production, compliance-readiness improvements, or operational robustness work.
0ctx Enterprise Hardening
Use this skill to execute high-confidence hardening work in the existing architecture.
Scope Priorities
- Correctness first:
- Session-aware context behavior across short-lived MCP socket requests.
- Explicit context isolation.
- Control plane second:
- Audit trail for mutating operations.
- Health and metrics endpoints.
- Backup/restore with encryption.
- Release safety third:
- Tests, CI gates, and migration safety.
Repository Touchpoints
packages/core/src/db.tspackages/core/src/graph.tspackages/core/src/schema.tspackages/core/src/encryption.tspackages/daemon/src/handlers.tspackages/daemon/src/server.tspackages/daemon/src/metrics.tspackages/daemon/src/logger.tspackages/daemon/src/backup.tspackages/mcp/src/tools.tspackages/mcp/src/index.ts
Execution Pattern
- Inspect current behavior.
- Implement one hardening slice end-to-end.
- Add/extend tests for the same slice.
- Run gates before moving to next slice.
Required Gates
npm run typecheck
npm run build
npm run test
Done Criteria
- No regression in existing MCP graph workflows.
- New control surface is observable through MCP/daemon endpoints.
- Tests cover positive and failure paths.
- Migrations are versioned and backward-safe.