Specification

Every template on this site is described twice: a guide for you, and a manifest for your agent. The manifest, a small file called loop.yaml, is the loop's job description: what may start it, what it's allowed to do, what it must never do, how its work gets checked, and when it must stop and ask a human. You never have to read it, but your agent will, and that's the point: the rules are written down, not implied.

Two renderings, one truthHuman page and agent manifest both point back to one catalog source.catalog datahuman guideREADMEagent jobloop.yaml
The same loop is readable by people and agents.

Loopmaster loop.yaml Specification v0.1

Status: draft

This document defines the draft v0.1 Loopmaster loop manifest format. It is descriptive and backend-agnostic: a manifest declares what a loop needs, may do, must verify, and when it must escalate; backend-specific install instructions live in adjacent docs and in the backends hint section.

v0.1 remains draft until LM-RETRO-01. Template authors MAY propose changes while the first Phase 0 templates are being written. Consumers MUST NOT treat v0.1 as frozen until the retro explicitly freezes it.

1. Conformance language

The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, MAY, and OPTIONAL are to be interpreted as normative requirements for v0.1 manifests.

A conforming manifest:

  • MUST be named loop.yaml for templates, or <id>.loop.yaml for Loopmaster's own maintenance loops.
  • MUST validate against spec/loop.schema.json.
  • MUST set spec_version to the string "0.1".
  • MUST NOT include unknown top-level keys.
  • MUST include at least one permission in permissions.allowed_actions.
  • SHOULD keep field values short enough for an agent to read the whole manifest in one context window.
  • SHOULD keep prose documentation and manifest fields consistent: every operational claim in prose should map to a manifest field, and every manifest field should be explained by the human or agent install docs.

2. Manifest shape

Top-level fields are deliberately small and stable. Optional fields are omitted when they do not add useful installation or safety information.

FieldTypeRequiredExampleDefinition
spec_versionstringyes"0.1"Manifest spec version. v0.1 manifests MUST use the exact string "0.1".
idstringyesresearch-watchStable kebab-case identifier. It SHOULD match the template directory name.
namestringyesResearch Watch LoopHuman-readable display name.
purposestringyesMonitor sources and turn high-signal changes into cited findings or tasks.One-sentence description of the loop's job and outcome.
audiencearray of enum stringsyes[human, agent]Primary consumers. Allowed values: human, agent, operator, team.
triggerobjectyes{type: schedule, default: daily}What starts the loop. See §3.
inputsobjectno{sources: [{type: rss}]}External sources, files, or environment variables the loop reads. See §4.
capabilitiesarray of stringsno[polling, source_summarization, task_creation]Runtime or agent-harness capabilities needed to execute the loop.
permissionsobjectyes{allowed_actions: [read_web, write_report]}Actions the loop may and may not take. See §5.
stateobjectyes{paths: [.loopmaster/state/research-watch.json]}Durable state paths used for dedupe, memory, progress, or audit correlation.
outputsobjectyes{artifacts: [docs/research/YYYY-MM-DD-findings.md]}Files, notifications, or tasks the loop emits.
verificationobjectyes{required: [every finding has a source URL], commands: [{run: python3 tools/check.py}]}Declarative success criteria plus executable checks.
human_gatesobjectyes{required_for: [public publishing]}Conditions that require a human or reviewer before acting.
failure_policyobjectyes{retry: 2, escalate_after: repeated_provider_failure}Retry, escalation, and rollback behavior.
maintenanceobjectyes{freshness_cadence: weekly}How often the template or loop should be reviewed for rot.
backendsobjectyes{cron: {schedule: daily}}Runtime-specific install hints for supported backends.

3. trigger

trigger declares what starts the loop. It is a contract, not the scheduler implementation.

FieldTypeRequiredExampleDefinition
trigger.typeenum stringyesscheduleOne of schedule, webhook, manual, user_goal, ci_event, issue_event, feed_change.
trigger.defaultstringnodailyHuman-readable default cadence or starter condition.
trigger.schedulestringno0 9 * * 1Concrete schedule hint when the trigger is schedule-like.
trigger.eventstringnopull_request.failed_checkEvent name when the trigger is event-like.

4. inputs

inputs is OPTIONAL because some loops operate only on local state or a user goal. When present, it MUST contain at least one of the fields below.

FieldTypeRequiredExampleDefinition
inputs.sourcesarray of source objectsno[{type: web_search, query: agent loop engineering}]External or internal systems the loop reads.
inputs.environment_variablesarray of stringsno[GITHUB_TOKEN]Environment variable names required by the loop. Values MUST NOT appear in the manifest.
inputs.filesarray of stringsno[resources/SOURCES.md]Repo-relative or documented runtime paths the loop reads.

Source object fields:

FieldTypeRequiredExampleDefinition
typeenum stringyesrssOne of rss, web_search, github_repo, url, file, api, database, kanban, calendar.
namestringnoAnthropic engineering blogHuman-readable source label.
urlstringnohttps://www.anthropic.com/engineeringSource URL.
querystringnoagent loop engineeringSearch query or API query.
pathstringnodocs/research/loop-landscape.mdFile or state path.

5. permissions

permissions is REQUIRED because safety is part of the product. Empty permissions are invalid.

FieldTypeRequiredExampleDefinition
permissions.allowed_actionsarray of stringsyes[read_web, write_report, create_task]Actions the loop may perform autonomously. MUST contain at least one item.
permissions.forbidden_actionsarray of stringsno[publish_publicly_without_approval, spend_money]Actions the loop MUST NOT perform autonomously.
permissions.credential_scopesarray of stringsno[read:repo, issues:write]Credential scopes needed. Names only; never include secret values.

6. state

state is REQUIRED so loops can dedupe, resume, and produce an audit trail.

FieldTypeRequiredExampleDefinition
state.pathsarray of stringsyes[.loopmaster/state/research-watch.json]Files or stores where durable loop state is written.
state.retentionstringno90 daysHow long state should be kept before pruning or archiving.

7. outputs

outputs is REQUIRED and MUST contain at least one output category.

FieldTypeRequiredExampleDefinition
outputs.artifactsarray of stringsno[docs/research/YYYY-MM-DD-findings.md]Files or structured artifacts the loop writes.
outputs.notificationsarray of stringsno[summary]Notifications the loop may send.
outputs.tasksarray of stringsno[kanban_card_for_high_signal_finding]Task or issue outputs the loop may create.

8. verification

verification is REQUIRED. It combines human-readable assertions with commands that agents and CI can execute.

FieldTypeRequiredExampleDefinition
verification.requiredarray of stringsyes[every finding has a source URL]Declarative acceptance criteria.
verification.commandsarray of command objectsyes[{name: validate findings, run: python3 tools/check_findings.py}]Executable checks. MUST contain at least one command.

Command object fields:

FieldTypeRequiredExampleDefinition
namestringnovalidate findingsHuman-readable check name.
runstringyespython3 tools/check_findings.pyCommand to execute from the documented working directory.
expectedstringnoexits 0 and prints OKExpected success signal.

9. human_gates

human_gates is REQUIRED. A loop that appears to need no approval SHOULD still declare the boundary that would make it unsafe.

FieldTypeRequiredExampleDefinition
human_gates.required_forarray of stringsyes[public publishing, credential changes]Conditions that MUST stop for human or reviewer approval.
human_gates.approverstringnomaintainerRole or person expected to approve gated actions.

10. failure_policy

failure_policy is REQUIRED so agents know when to retry and when to stop.

FieldTypeRequiredExampleDefinition
failure_policy.retryintegeryes2Maximum retry attempts before escalation.
failure_policy.escalate_afterstringyesrepeated_provider_failureCondition or class of failure that triggers escalation.
failure_policy.rollbackstringnorevert the proposal branch and leave the previous state file unchangedRollback or recovery guidance.

11. maintenance

maintenance is REQUIRED because loop rot is an expected failure mode.

FieldTypeRequiredExampleDefinition
maintenance.freshness_cadencestringyesweeklyHow often to review this loop/template for source, API, model, or process drift.
maintenance.ownerstringnoLoopmaster maintainersOwner responsible for maintenance.
maintenance.audit_logstringnoloops/log/Where maintenance evidence is recorded.

12. backends

backends is REQUIRED and MUST contain at least one supported backend hint. Hints are not executable adapters; they tell an installer where the manifest maps onto runtime-specific setup.

Allowed backend keys in v0.1 are cron, github_actions, and agent_kanban.

FieldTypeRequiredExampleDefinition
backends.cronbackend hint objectno{schedule: daily}Installation hints for cron-like schedulers.
backends.github_actionsbackend hint objectno{workflow: .github/workflows/research-watch.yml}Installation hints for GitHub Actions.
backends.agent_kanbanbackend hint objectno{task_template: Create a weekly research watch task}Installation hints for agent task boards such as Hermes kanban.

Backend hint fields:

FieldTypeRequiredExampleDefinition
schedulestringnodailyCadence or cron expression.
workflowstringno.github/workflows/research-watch.ymlWorkflow file or runtime entry point.
task_templatestringnoCreate a weekly research-watch task assigned to researcherTask prompt or template hint.
install_notesarray of stringsno[Run from repo root]Backend-specific setup notes.

13. Worked example

This example updates the R1 §7 research-watch manifest to v0.1. It is intentionally still a draft template shape, but it validates against spec/loop.schema.json.

spec_version: "0.1"
id: research-watch
name: Research Watch Loop
purpose: Monitor sources and turn high-signal changes into cited findings or tasks.
audience: [human, agent]
trigger:
  type: schedule
  default: daily
  schedule: "0 9 * * *"
inputs:
  sources:
    - type: rss
      name: practitioner blogs
    - type: web_search
      query: agent loop engineering
    - type: github_repo
      url: https://github.com/anthropics/claude-cookbooks
capabilities:
  - polling
  - source_summarization
  - dedupe
  - task_creation
permissions:
  allowed_actions:
    - read_web
    - write_report
    - create_task
  forbidden_actions:
    - publish_publicly_without_approval
    - spend_money
    - delete_user_data
  credential_scopes:
    - web:read
    - kanban:create
state:
  paths:
    - .loopmaster/state/research-watch.json
  retention: 90 days
outputs:
  artifacts:
    - docs/research/YYYY-MM-DD-findings.md
  notifications:
    - summary
  tasks:
    - kanban_card_for_high_signal_finding
verification:
  required:
    - every finding has a source URL
    - no duplicate finding from previous state
    - recommendations include confidence/risk
  commands:
    - name: validate findings report
      run: python3 tools/validate_findings.py docs/research/YYYY-MM-DD-findings.md
      expected: exits 0 and prints OK
human_gates:
  required_for:
    - public publishing
    - product direction changes
    - credential changes
  approver: maintainer
failure_policy:
  retry: 2
  escalate_after: repeated_provider_failure
  rollback: leave prior state file unchanged and report partial findings only
maintenance:
  freshness_cadence: weekly
  owner: Loopmaster maintainers
  audit_log: loops/log/
backends:
  cron:
    schedule: daily
    install_notes:
      - Run from the repository root.
  github_actions:
    workflow: .github/workflows/research-watch.yml
  agent_kanban:
    task_template: Create a weekly research-watch task assigned to researcher.

14. Versioning notes

v0.1 is expected to change while the Phase 0 templates exercise it. Backward-incompatible changes SHOULD be recorded in spec/CHANGELOG.md. Unknown spec_version values MUST be rejected by v0.1 validators.