AlexandrAI AGENTS.md
agents-md

Thinklogi Harness State Snapshot Agent Guide

Agent guide for harness state persistence and public harnessSnapshot generation.

AGENTS.md

Guidance for coding agents working on Thinklogi Harness State Snapshot in the thinklogi project.

Project overview

This guide covers harness/state.mjs. The harness persists full state to the private harness state file and writes a redacted public snapshot for the app Agent screen. The snapshot includes active goal summary, agent summaries, and the highest priority tasks.

Primary source files

  • harness/state.mjs owns loadState, saveState, statePath, snapshotPath, and toSnapshot.
  • harness/cli.mjs calls loadState and saveState for init, tick, run, and status commands.
  • public/app.js fetches harnessSnapshot.json for the Agents screen.

Setup commands

npm run harness:init npm run harness:tick npm run harness:run npm test npm run build npm run dev

Change rules

  • Keep full harness state and public snapshot separate.
  • Ensure saveState writes both files every time.
  • Sort tasks by priority before taking the public snapshot.
  • Limit public task output so the Agents screen stays compact.
  • Keep loadState creating an initial state when no state file exists.

Testing

Cover missing state file, state save, snapshot save, active goal selection, fallback to latest goal, task priority sorting, task limit, and app behavior when snapshot fetch fails.

PR checklist

  • Public snapshot contains no local machine paths or secrets.
  • Agents screen tolerates a missing snapshot.
  • npm test, npm run harness:tick, and npm run build pass.