Skip to content

docs(harness-principles): add 2 principles from 12-Factor Agents#28

Draft
markhazlett wants to merge 1 commit into
mainfrom
harness-principles/2026-05-15-12factor-control-flow-state
Draft

docs(harness-principles): add 2 principles from 12-Factor Agents#28
markhazlett wants to merge 1 commit into
mainfrom
harness-principles/2026-05-15-12factor-control-flow-state

Conversation

@markhazlett

Copy link
Copy Markdown
Owner

Summary

Mines Dex Horthy's 12-Factor Agents (HumanLayer, 2025) for two transferable principles that don't exist in the current 63-entry doc. Also bootstraps the Sources Mined section so future runs know what's already been covered.

Both principles clear the full quality bar: transferable, concrete mechanism, primary source verified via GitHub raw fetch, non-duplicative against existing §1–63, confidence high.

Principles Added

§64 — Deterministic Routing, LLM Reasoning (confidence: high)

Use deterministic code to route between agent states; reserve LLM calls for reasoning within bounded decision points, not for choosing which workflow to run.

The mechanism: classify input with a narrow LLM call, then route via explicit code to smaller, focused sub-prompts with fewer available tools. The doc's existing §29–34 cover phase-staging within a workflow; this is about the layer above — deciding which workflow to enter. Currently absent from the doc.

§65 — Context Window as the Primary Execution State Store (confidence: high)

Treat the context window as the canonical record of agent execution state; infer what step you're on and what's waiting from the accumulated event history, rather than maintaining a parallel state system.

The mechanism: execution metadata (current step, wait conditions, retry counts) is derived from the event log in context, not from a separate state table. Auxiliary state is minimized to items that cannot enter context (credentials, session IDs). Enables checkpointing and thread-forking as natural side effects. Complements §5 (layered context) and §39 (re-injection) without duplicating them.

Sources

Primary (verified via fetch):

Researched, primary source inaccessible (HTTP 403):

The 403-blocked sources are logged in Sources Mined for retry on the next run.

Not in scope

This PR only edits .claude/docs/harness-principles.md. Skills, hooks, agents, and commands are unchanged. Adoption of §64 or §65 (e.g., a deterministic skill-dispatch layer) is a follow-up task if approved.


Generated by Claude Code

…anLayer)

- Deterministic Routing, LLM Reasoning (§64) — use deterministic code
  to route between agent states; LLM for in-branch reasoning only
- Context Window as Primary Execution State Store (§65) — infer
  execution metadata from event history, minimize auxiliary state
- Add Sources Mined section (first entries: 12-factor-agents, Cognition,
  Anthropic engineering blog)
- Update Part XII checklist with §64 and §65 items

Primary source: https://github.com/humanlayer/12-factor-agents
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants