Newer
Older
cortex-hub / docs / features / harness_engineering / harness_tasks / foundation.md

title: Stage 1 - Data & Models (Foundation) status: IN_PROGRESS

priority: HIGH

Core Objectives

Establish the underlying database structure and filesystem mirroring required for the Co-Worker agent's state management.

Task Breakdown

  • DB Model Update: Modify the backend 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.
  • Workspace Mirroring:
    • Create .cortex/ directory in the agent's unique jail during initialization.
    • Implement history.log append logic (JSON format).

Claude Code Inspiration: Memory Context

Reference: src/memdir/memdir.ts

  • Ensure the .cortex/ directory exists immediately on agent startup (idempotent initialization).
  • Use a single line append-only JSON format for history.log to prevent partial write corruption.