Harness Intelligence Wiki
HarnessEntry Points

Implementation

Deliver a retained Architecture/SPEC pair through delivery-phase gates, a plan-derived Execution Frontier, review, docs ingest, and closeout

Implementation takes one bounded delivery goal from a retained Architecture/SPEC pair to a closed delivery. $delivery-phase routes the work. It loads one phase at a time and checks durable evidence before each step.

  • Use this when: an accepted spec, issue, or plan must become implemented, reviewed, and documented change.
  • It gives you: gated planning, scoped worker execution, focused validation, Verification, one Full Code Review Pass, docs ingest, and closeout.
  • It ends with: a final commit, CI results, backlog status readback, a torn-down Owned Stack, and a report of the phase path taken.
  • Wrapped phase/skills: $delivery-phase routes to Requirements Phase (which runs $write-backlog, then $create-plan), $implement-spec, $review-phase, $debugging-phase, and $docs-ingest-phase.

Invocation

$delivery-phase is explicit-only. Its frontmatter sets disable-model-invocation: true, so a human or a goal must name it. The entry mode decides how far one invocation goes:

Entry modeTriggerBehavior
Full deliveryThe user asks to deliver a bounded goal end to end.Re-enters the router after each phase until closeout.
ResumeThe user returns after manual spec, plan, or other work.Emits one Phase Result and stops.
HITL checkpointThe user wants one phase handled, then a manual stop.Emits one Phase Result and stops.
CloseoutThe work is done; evidence, docs, tracker, or PR state remain.Finishes the remaining closeout work, then stops.

Resume intent alone does not grant Full Delivery continuation. Every entry mode is AFK: each pending user question becomes an Autonomous Decision, and each out-of-bounds decision is posted to the thread at once. Full Delivery continues to closeout and takes an out-of-bounds Autonomous Decision at each bound. Other modes stop at their requested boundary and ask nothing; their stop report names the next phase. Only missing access that no decision can grant stops a run early.

Delivery Chain

Each arrow back to the router is one common Phase Result. Full Delivery follows every arrow without a stop. Other entry modes stop after one phase.

Router Order

The router reads durable authority and selects exactly one phase:

  1. Context continuity. Resolve only the Context Pointers the next action needs. Each pointer has an authority kind, locator, optional selector, identity, and freshness rule; a timestamp alone is not freshness. One bounded refresh is allowed. Otherwise the action is blocked.
  2. Human steering. A durable human_steering_required stays terminal until its recorded access is present. New missing-access evidence selects human steering; every other boundary takes an out-of-bounds Autonomous Decision.
  3. Architecture/SPEC Pair Complete. Required before any dependent dispatch, in every mode, including local and resumed work.
  4. Failure continuity. A failed task or repair evidence follows the failure contract: block only the dependent chain, keep scope custody, and retry only with new evidence.
  5. Review state. The pass count comes from review.mjs status, the number of valid Pass Reports. review_due, an active review run, an unrouted Pass Report, or a budget decision selects review. debug_active resumes debugging. repair_active resumes implementation.
  6. Backlog Projection Complete. Required before implementation. Missing, stale, or contradictory proof selects phases/spec.md, which routes the exact gap to Requirements Phase.
  7. Plan Complete. A missing or stale retained plan selects phases/spec.md, which routes it to Requirements Phase; delivery has no plan phase. Incomplete plan work, invalidated evidence, or a provider fact without readback selects implementation.
  8. Review. Every completed implementation selects review until a valid Pass Report covers the delivery.
  9. Docs or closeout. Docs-affecting work selects docs ingest. Otherwise closeout runs.

Starting Authority: The Architecture/SPEC Pair

Delivery starts from a retained pair, not from a spec alone:

  • ARCHITECTURE.md with status: compiled and readiness: agent-ready.
  • SPEC.md with readiness: agent-ready.

Both name the same capability and the current accepted grill decisions. Each artifact needs a retained commit, an immutable blob URL, and matching bytes. Every OUT-### and AC-### in the spec must resolve to an architecture selector and a source decision anchor. A gap blocks dispatch and routes the exact artifact, selector, and missing proof to Requirements Phase. Legacy and local work have no exemption. Matching proof adds no human approval gate.

Backlog Projection Before Implementation

Before implementation, the router requires a current write-backlog result for the same spec identity. It names the provider destination, Epic and Story identities, provider Task IDs and URLs, the same V*, native blocker edges, and observed state from exact readback. A missing or stale projection selects phases/spec.md, which applies both the Architecture/SPEC Pair Complete gate and the Backlog Projection Complete gate and routes the gap to Requirements Phase, the owner of write-backlog. Delivery has no separate backlog phase.

Plan: create-plan and PLAN.md

Requirements Phase runs create-plan right after write-backlog: on a written result with provider Tasks, or with task_identity_mode: planning-only when no backlog provider is configured. A blocked Write Backlog result stops with no plan. create-plan commits and pushes PLAN.md and verifies its immutable blob URL; delivery consumes it through the Plan Complete gate.

create-plan composes $grilling, $parallel-research, $swarm-planner, $tdd, $codebase-design, $show-me, and $wait-what into one run. It writes exactly one PLAN.md in the spec folder and never implements code.

PLAN.md contains:

  • Context Pointers to the retained ARCHITECTURE.md and SPEC.md, with blob URLs, source identities, decision selectors, and freshness rules.
  • architecture_applicability: local | architecture-bearing, with evidence.
  • Situation, problem, solution shape, decision ledger, assumptions, codebase findings, external research, and ## Wiki Context.
  • The dependency graph, parallel execution waves, testing strategy, risks, validation gates per task and wave, and unresolved questions.

Each Tn task carries depends_on, location, owned_paths (its Active Write Scope), read_dependencies, shared_runtime_resources, relevant_input_set, wave_boundary, validation, task_identity_mode and its identity fields, assigned_skills, implementation_skill_guidance, the TDD fields (tdd_status, tdd_target, red_command, expected_red_failure, green_command, reason_not_testable, red_evidence, green_evidence), codebase_design_notes, review_mode, and the runtime fields (runtime_validation, runtime_target, runtime_evidence, runtime_cleanup).

One task_identity_mode applies to the whole plan. Mixing modes is invalid:

  • provider-task: each Tn aliases one provider Task. relation_mode is native or body-links, and depends_on mirrors native blocker edges. Planning creates no second Task identity.
  • planning-only: Tn is the execution identity. Provider fields are not_applicable, relation_mode is unprojected, and each task records a nonempty backlog_sync_skip_reason. This mode applies only to a planning request without a retained projection.

An architecture-bearing plan also holds the Target Ownership Topology, Declared Dependency Graph, Responsibility Acceptance Criteria, Architecture Waves (A*, distinct from worker waves W*), Public Seam Contract, and Migration Ledger. Its tasks add architecture_wave, behavior_owner, integration_surface, public_seam, topology_delta, forbidden_ownership, temporary_seams, and responsibility_acceptance_criteria.

$swarm-planner supplies the dependency-aware Tn graph. Inside create-plan, the plan schema and the plan-reviewer subagent override its standalone output file and review step. Task validation is focused; CI owns the full suite.

Implement: implement-spec

implement-spec requires the pair and an execution-ready PLAN.md. When PLAN.md is missing or invalid, it routes to Requirements Phase. An execution-only amendment also returns to Requirements Phase as plan-only input; delivery and implement-spec never run create-plan themselves.

When the delivery brief names a design-phase promote commit, its UI files are Design-Owned UI Code: accepted input that tasks extend with logic and data, never reimplement. The parent puts this rule in each worker brief that touches those files. A change to a design-owned file is a defect fix only. implement-spec records each one in IMPLEMENTATION-NOTES.md with the defect and the file, and delivery-phase records it in its Phase Result.

  1. Resolve the spec folder under apps/wiki/content/docs/project/specs/<domain>/<spec>/ and load the working set: wiki AGENTS.md, ARCHITECTURE.md, SPEC.md, PLAN.md, IMPLEMENTATION-NOTES.md, and the spec's tech-debt item files under apps/wiki/content/docs/project/tech-debt/<domain>/<spec>/.
  2. Seed IMPLEMENTATION-NOTES.md from its template and keep it current during the run.
  3. Compute the Execution Frontier, reserve Active Write Scopes, and dispatch scoped workers. Each worker brief runs $simplify on the task's changed code once GREEN, before the task validation and before the Task Result reaches its Task Gate. See Sequential and Parallel Delivery.
  4. Apply each Task Gate as soon as its result arrives. A passed gate releases dependents immediately; summary reconciliation follows asynchronously.
  5. After the first meaningful in-scope commit is pushed, reuse or create the matching draft PR. One plan creates at most one pull request per Touched Repository; split or stack PRs only when the user explicitly asks. An empty commit never qualifies. $pr writes its provisional body: Summary from the plan, Evidence and Review Pending:. The draft PR does not satisfy any gate.
  6. In provider-task mode, route each directly observed work start, repair resume, blocker, PR, merge, staging deployment, or production deployment through write-backlog delivery-status, with exact readback. Merge is never deployment evidence. The Ticket Live State rule covers the rest of the delivery.
  7. For UI changes, record durable before/after links under UI Evidence Links through repo-asset-management. Local paths and transient URLs are not evidence.
  8. For tasks with runtime_validation: required, record conclusive public-entrypoint evidence or keep the task blocked.
  9. Run verify-behavior in verify mode for visibly exercisable acceptance. See Project Verification Flow.
  10. Audit each acceptance criterion as met, unmet, or blocked. Write the ## Manual Review Checklist. Finalize the spec folder.
  11. Return evidence pointers to delivery-phase, which runs $review-phase Code Review and then $docs-ingest-phase when the spec folder needs ingest.

Quality skills apply throughout:

  • $tdd: no production code before a failing test for behavior-changing work. Forgotten RED is recovered as tdd_status: recovered, never excused with reason_not_testable.
  • $codebase-design: the parent reviews each worker change in its vocabulary: interface, seam, adapter, depth, leverage, locality, and test surface.
  • $simplify: worker brief instruction 12 runs it on each task's changed code once GREEN, so the task validation proves the simplified code.

Debt inside the active goal is fixed before work advances. When debt outside the goal affects an implementation decision, standalone implement-spec stops and hands the human the $requirements-phase command with a brief: the exact debt, the decision it needs, and current source pointers. Execution resumes from the recorded outcome. Inside AFK delivery-phase, implement-spec takes an out-of-bounds Autonomous Decision instead, records it in IMPLEMENTATION-NOTES.md, and continues.

Only debt that lies outside the goal, needs a product or scope decision, or is externally blocked survives the run. Each such item gets its own file at apps/wiki/content/docs/project/tech-debt/<domain>/<spec>/<debt-slug>.md; the spec's item files form its ledger. Each item file names the debt, why it cannot be resolved now, the decision or blocker, and the owner or next action, and is one canonical input of $resolve-debt-phase. Phrases such as "do this later" or "temporary workaround" are forbidden.

Validation Scope

Local validation is focused: tests for the changed behavior, integration checks the change touches, and type and lint checks for affected workspaces. CI owns broad regression. A local broad run happens only at closeout as a fallback when CI lacks the full suite or E2E. Validation Gates defines Verification Tiers, the Owned Stack, and the New Discriminator rule.

Review

review.md is the only review-transition authority. It rechecks the pair and requires implementation, Task Gates, Verification, reconciliation, Architecture Checkpoints, and acceptance evidence. Full Delivery invokes $review-phase immediately. Other modes persist review_due with an invocation context, name $review-phase as the next phase in their stop report, and stop.

review-phase runs one Full Code Review Pass: one fresh Reviewer finds and verifies at most five P0–P2 findings (security, performance, contract drift, unrequested behavior, costly smells), and retain commits one Pass Report at .devpunks/delivery/<goal>/reviews/pass-<n>.json. simplify runs earlier, in each implement-spec worker brief; implement-spec finalize owns acceptance-criterion and skill-evidence records. review-phase runs every Code Review; workers and other phases leave Code Review to it.

  • Every delivery takes one Full Code Review Pass, whatever its size.
  • Ordinary accepted repair runs Focused Repair Validation and reruns only invalidated Verification.
  • A second pass is eligible only when repair changes architecture, security or authorization, a public contract, runtime or deployment topology, or accepted scope.
  • At two completed passes, a further pass needs the human's own words already in the goal or thread, passed as --human-direction. Without them, delivery takes an out-of-bounds Autonomous Decision on review_budget_exhausted: it captures the open findings as debt and continues to docs ingest or closeout.

Findings route by return_route: human_steering_required takes one out-of-bounds Autonomous Decision per blocking finding, which follows the implementation route when it needs a code change and the debt_follow_up route otherwise; debugging opens debugging; implementation opens repair; debt_follow_up captures debt once, keyed by Pass Report path and finding ID, then resumes the recorded route. Delivery records pass_report and review_run_id in its handoff; it stores no pass count.

Ticket Live State

In provider-task mode, every linked Task follows the delivery in real time. write-backlog delivery-status lists the Delivery Checkpoints; each phase records the ones it passes, with exact readback, before it exits:

CheckpointTicket fact
Worker dispatch starts a Taskwork started
Draft PR created or reusedPR URL, draft
review_due persistedreview started
Pass Report retainedreview result: Pass Report path, route.primary, open findings
Route opens repair or debuggingwork resumed, with finding ids
Out-of-bounds Autonomous Decision on human_steering_required or review_budget_exhaustedwork resumed, with the decision taken
Required access missingblocked, with the access needed
Access restoredwork resumed
Closeout PR handover read backPR ready, review requested
Merge, staging or production observedthe matching evidence

On every entry the router reads the linked Tasks back first. A ticket behind its latest checkpoint is stale; the router records the missing fact before it selects a phase.

Docs Ingest

After review, docs-affecting work runs $docs-ingest-phase. It documents current truth only, never speculative future behavior. Otherwise it records an explicit no-op reason.

Closeout

Closeout requires a valid Pass Report for the delivery first. Then it:

  1. Creates the final path-limited commit of delivery-owned paths and leaves unrelated dirty files unstaged.
  2. Reruns release classification and exact-tree provider proof when the final tree differs from the pre-review candidate.
  3. Pushes and awaits CI per check, or runs the local broad run fallback.
  4. Hands over the PR: $pr regenerates the body's Managed Region from final evidence, gh pr ready runs on an open draft, review goes to the person who asked for the change when that login differs from the PR author, and the body, draft state and review request are read back. Merge stays with the human.
  5. Watches the open PR at its current head (PR Watch): required checks, reviews and comments from external reviewers (bots and humans), and mergeability with its blockers. It uses the host's PR-watch capability, else bounded polling with backoff. Valid findings and failed checks go through accepted repair; a rejected or deferred finding records a reason. A new head resets the watch. It reports mergeable, not mergeable or pending with the reason, and never merges. An open delivery PR keeps closeout active until the watch reports for the current head.
  6. Routes final observed facts through write-backlog delivery-status and reads back the status. Fog completion needs production evidence for every resulting Story and Task.
  7. Tears down the Owned Stack through owned cleanup.
  8. For UI changes, confirms durable UI Evidence links in the $pr Evidence section, or the PR-ready handoff when no PR exists.

Pausing Across Sessions

$handoff writes a compact Delivery Handoff outside the workspace. The receiving session always cold-routes from current authorities and never reuses the in-memory Delivery Context Packet.

Terminal Outcome

The closeout report opens with the Autonomous Decisions list, out-of-bounds first, or with Autonomous Decisions: none; the PR body opens with the same list in delivery's Autonomous Decisions Block, above the $pr Managed Region. Then the report names the goal, phase state, artifacts touched, validation labelled focused, CI, or local broad run, review result, debugging result or skip reason, docs result or no-op reason, tracker or PR state with the PR handover readback, UI Evidence state, and the exit: done, blocked, or split into follow-up. It reports only the phases that ran.

On this page