title: Stage 1 - Data & Models (Foundation) status: IN_PROGRESS
Establish the underlying database structure and filesystem mirroring required for the Co-Worker agent's state management.
AgentInstance model (PostgreSQL/MongoDB as applicable) to include:
co_worker_enabled: (Boolean) Default: False.rework_threshold: (Integer) Range 0-100. Default: 80.max_rework_count: (Integer) Default: 3..cortex/ directory in the agent's unique jail during initialization.history.log append logic (JSON format).Reference: src/memdir/memdir.ts
.cortex/ directory exists immediately on agent startup (idempotent initialization).history.log to prevent partial write corruption.