Files
learnharness/src/agent/prompts
amosblomqvist 67fbc0575f Author-once plan protocol: single mermaid plan_init + derived statuses + live quiz nodeId validation
- plan_init is now the ONLY plan tool: a mermaid 'graph TD' block parsed by a
  constrained-subset parser (mermaid-plan.ts) with line-precise errors; the
  seven mutation/tracking tools are gone by design (2026-09-03 design pass).
- Re-call plan_init = sanctioned wholesale rewrite; slugs are permanent.
- derivePlanStatuses (contracts/plan.ts): done = passed check tagged with a
  quiz nodeId; current = open check's node else first topo-ready node — the
  tracking the teacher no longer declares by hand.
- questionToolsFor(ctx) (tools.ts): the quiz schema chains a dynamic plan-
  nodeId validation against the LIVE record — an invalid nodeId is rejected
  at the call boundary and the teacher retries mid-turn, before any UI.
  Static questionTools stay validator-less for the default path.
- Prompts rewritten for mermaid authoring + derived position.
- Out-of-lane surgical touches (flagged for master review):
  src/core/question-core.ts (quizInputObject export + nodeId description),
  src/core/contracts/plan.ts (derivePlanStatuses + doc).
2026-09-09 03:04:16 +03:00
..

Prompt fragments

The teacher's system prompt is composed at agent creation:

  1. src/agent/system-prompt.md — the base (owned by the orchestrator; do not edit from a worker).
  2. Every numeric-prefix *.md fragment in this directory, in sorted filename order, joined with --- separators. The loader enforces the numeric prefix (\d*-*.md) — other files (like this README) never enter the model's prompt.

Rules for adding a fragment:

  • Name it with a numeric order prefix: 10-plan-tree.md, 20-jobs.md, 30-phases.md.
  • One fragment per workstream — your brief tells you which filename you own.
  • Document YOUR tools/behaviors exactly; reference tool input field names verbatim (they must match the zod schemas).
  • Keep it tight: fragments are always in context. No restating the base prompt.