Skip to content

Phase 2: Deterministic Core #3

Description

@rmax

Description

Implement the deterministic core of the harness — all components that don't require a live model. This includes goal contracts, state machine, policy engine, Git repository store, SQLite event store, artifact hashing, evaluator pipeline, fake sandbox, and scripted agent.

Key Deliverables

  1. Goal Contract — typed YAML contract parser, validator, JSON Schema, contract hashing
  2. State Machine — all states, transition decisions, invalid transition prevention
  3. Policy Engine — path policy, command allowlist, dependency policy, approval gates
  4. Git Repository Store — checkpoint, restore, diff, branch, worktree management
  5. SQLite Event Store — SQLAlchemy models, Alembic migrations, repository pattern
  6. Artifact Store — SHA-256 hashing, hash chain, tamper-evident manifest
  7. Fake Sandbox — deterministic sandbox for unit tests
  8. Scripted Agent — deterministic agent for testing without a model
  9. Evaluator Pipeline — tiered evaluation, hard gates, evaluation vectors
  10. Budget Tracking — iteration, token, cost, runtime budgets

Acceptance Criteria

  • Goal contract parses from YAML and validates against schema
  • Invalid contracts return actionable error messages
  • State machine prevents invalid transitions by code
  • Every transition is persisted before continuing
  • Path policy rejects traversal and protected-file edits
  • Command policy rejects forbidden commands
  • Git store creates checkpoints and restores correctly
  • Worktrees are isolated from source repository
  • SQLite event store persists and queries events
  • Alembic migrations run successfully
  • Artifact hashing produces correct SHA-256 chains
  • Fake sandbox returns deterministic results
  • Scripted agent produces typed proposals
  • Evaluator pipeline runs tiered checks with correct ordering
  • Budget tracker enforces hard limits
  • Ruff, mypy, and all unit tests pass

Depends on: #1, #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:readyDependencies met, ready to work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions