- Seed Prompt Constraints: The
PROJECT_SEED.mdfile acted as a highly effective "constitution". It prevented the common failure mode of sub-agents inventing new features (e.g., "let's add a Redis backend") by strictly enforcing the "local-first, zero-ops" constraint. - Explicit State Tracking: The combination of
TASKS.md(hierarchical),PROGRESS.md(status), andNEXT_STEPS.md(continuation context) meant that even with context window resets, the orchestrator never lost track of the sequence. - Sequential Drafting: Creating the documents in the specific order defined in
PROJECT_SEED.mdallowed concepts to build naturally.ARCHITECTURE.mddefined the components thatAPI_SPEC.mdlater exposed, preventing circular dependencies in the specs.
- Terminology Drift: Initial drafts occasionally slipped into using "Quota" vs "Constraint" or "Limit". We had to enforce a strict vocabulary review to ensure "Constraint Graph" was the dominant mental model, not "Rate Limit Table".
- Scope Creep in Policy: There was a temptation to make the Policy Engine a full Turing-complete language (Lua/WASM). We restricted it to a YAML-based rule set to maintain the "Constitutional" non-negotiable nature and keep the daemon simple.
- Code-Doc Lockstep: When implementation begins, strict adherence to
API_SPEC.mdis required. If the code needs to diverge, the spec must be updated first (Spec-Driven Development). - Testing Strategy: The
ACCEPTANCE.mdprovides good end-to-end scenarios, but unit testing the "Prediction Engine" with deterministic time mocking will be critical and wasn't fully detailed in the docs.
The "Required Document Set" is complete with 0 implementation code written, preserving a pure design phase. This should reduce code churn significantly.
- Iterative Orchestration Loop: Enhancing
loop.shwith a maximum iteration limit (50) and per-iteration logging provides better observability and prevents infinite run costs or context contamination. - Sentinel Sanity Checks: Injecting constitutional rules (like mandatory sentinel identifiers) directly into the
LOOP_PROMPT.mdacts as a "guardrail", ensuring that even after many iterations, the agent remains compliant with the project's core invariants. - Structured Logs: Moving to a
logs/directory with timestamped files allows for post-hoc analysis of "hallucination paths" or decision logic without cluttering the project root.
- Context Continuity: Deciding between
--continue(stateful) and fresh runs (stateless). Fresh runs are safer for disk-sourced truth, but--continuecan reduce repeated "orientation" overhead. We opted for NO--continuein the improved loop to allow the orchestrator to build on its internal reasoning.