mino-run
Execution Engine
Read an approved task from local briefs, run any pre-flight check, acquire the global execution lock, modify the codebase, commit the result, and hand off a stable commit SHA to verify.
This skill is the only writer of .mino/run.lock and the only place where Attempt Count increments. All structured artifacts (events, brief section, lock file) are rendered from templates in templates/.
Workflow
Step 1: Resolve Target
- Accept either an issue locator (e.g.,
issue-42) or aTask Key - Resolve to the canonical
Task Keybefore any other step - Load
.mino/briefs/issue-{N}.mdand the latest valid event sequence from the issue
Step 2: Eligibility Check
Refuse to proceed and halt with a clear message if any of these are not true:
Approval State: approvedApproved Revision == Spec Revision(otherwise direct user to/mino-taskfor re-approval)Executability: executable(skipcontainertasks; they decompose, not execute)Workflow Entry State: ready_to_start- All
Depends Ontask keys are indonestate
Step 3: Pre-flight (Internal)
Invoke /mino-checkup pre-flight issue-{N} as a sub-step. If pre-flight marks the task blocked, do not proceed; let checkup own the checkup_preflight_blocked event and halt.
This step exists per Iron Tree Protocol § Required Capabilities and is referenced in § Decision Function notes — pre-flight is run's internal gate, not a separate Loop Mode step.
Step 4: Acquire Global Run Lock
The protocol guarantees serial run execution per repository.
Check whether
.mino/run.lockexists:- If absent → proceed
- If present and not stale (acquired within the last 2 hours) → refuse execution. Print the active task key, issue number, and
acquired_atfrom the lock. Suggest: "wait for the active run to complete, or remove.mino/run.lockif you are sure it is dead." - If present and stale (
acquired_atolder than 2 hours) → ask the user explicitly: "A stale.mino/run.lockfrom {acquired_at} for {task_key} (issue-{N}) was found. Override? (yes/no)". Only proceed onyes.
Write
.mino/run.lockfromtemplates/lock.yml.tmpl. Lock file content is local-only; do NOT stage or commit it.From this point on, release the lock on every exit path (success, halt, failure). Use a guarded structure if your runtime supports it.
Step 5: Begin Attempt
Capture attempt_count_before = Attempt Count for potential rollback in Step 7.E.
- Increment
Attempt Countby 1. - Update brief Workflow State section:
Current Stage: runNext Stage: verifyWorkflow Entry State: ready_to_startCode Publication State: local_only(provisional; finalized in Step 7)
- Record
run_startedlocally (silent) — rendertemplates/event-run-started.yml.tmpland write to.mino/events/issue-{N}/{next_seq:04d}-run-started.yml. Do NOT post a GitHub comment.
Step 6: Execute
Perform the actual work:
- Read each file in the brief's
Target Filessection. - Apply changes guided by the brief's
Acceptance Criteriaand anyFailure Contextfrom a previous attempt (if retrying, attempt a different approach — never repeat the same fix). - Run any code-generation, scaffold, or fix-up commands the task requires.
- Track changed files and commands run; both feed into the Execution Summary.
Print compact progress lines, one per substep:
[run] issue-{N}: reading 3 target files
[run] issue-{N}: applying edits to AuthService.ts
[run] issue-{N}: regenerating types
[run] issue-{N}: done; 4 files changedStep 7: Commit (or fail-publish)
Decide the commit path based on file change status.
7.A No file changes
Some tasks are research-only or update only .mino/briefs/ content. If git status --porcelain -- ':!.mino/briefs/' ':!.mino/locks/' returns empty:
- Skip commit
- Set
commit_sha_or_not_applicable = not_applicable - Set
Code Publication State = not_applicable - Proceed to Step 8
7.B Files changed → commit
git add -A -- ':!.mino/briefs/' ':!.mino/locks/'
git commit -m "[run] #{N}: {concise change summary}"The commit message format is fixed: [run] #{N}: {summary} where {N} is the issue number (literal # so GitHub auto-links the commit on the issue timeline) and {summary} is one short imperative sentence. Do NOT add Closes #{N} / Fixes #{N} / Resolves #{N}: mino-checkup owns the done transition, not GitHub auto-close.
If commit succeeds:
- Capture
commit_sha = git rev-parse HEAD - Set
Code Publication State = local_only(verify will push and flip topublished) - Proceed to Step 8
7.E Commit fails (pre-commit hook rejects, missing identity, signing failure, etc.)
Per protocol § Phase 4 and contract § run, commit failure must not consume retry budget.
Roll back the attempt counter: set
Attempt Count = attempt_count_before(the value captured in Step 5).Update brief sections (surgical replace):
Failure Context← record the exact commit error output, the command that failed, the failedVerify Anchor SHAplaceholder (usenone — commit refused), and ISO timestamp. Use the same structure asverify's failure-context section but markFailed Check: git commit.Workflow State:Current Stage: runNext Stage: verifyWorkflow Entry State: ready_to_startCode Publication State: local_only
Render
templates/event-run-commit-failed.yml.tmpl, write to.mino/events/issue-{N}/{next_seq:04d}-run-commit-failed.yml. Then post an issue comment with narrative + the same yml content (this event is audible). Comment body:⚠️ run commit failed — #{N} Action: resolve the commit issue (hook, identity, signing, …) and re-run `/mino-run issue-{N}` (no retry budget consumed).Release
.mino/run.lock. Halt.
Step 8: Mark Run Complete
Only reachable from 7.A or 7.B success.
- Update brief sections:
Execution Summary← rendertemplates/brief-section-execution-summary.md.tmplWorkflow State:Current Stage: verifyNext Stage: verifyWorkflow Entry State: ready_to_startCode Publication State: local_only(ornot_applicablefrom 7.A)
- Record
run_completedlocally (silent) — rendertemplates/event-run-completed.yml.tmpland write to.mino/events/issue-{N}/{next_seq:04d}-run-completed.yml. Do NOT post a GitHub comment.
After the local state is updated and before releasing the lock, sync the GitHub stage label so humans see progress:
gh issue edit {N} --remove-label "stage:run" --add-label "stage:verify"Label sync failure is a warning, not an error: log stage_label_sync_failed: <reason> in the run report and proceed. The local yml remains authoritative.
Step 9: Release Lock & Hand Off
- Remove
.mino/run.lock. - Detect orchestrator mode: if
.mino/loops/active.lockexists AND itsholder_agent: mino-taskAND itsheartbeat_atis within the last 6 hours: return silently (the orchestrator will read the updated brief / events and dispatch the next step). Do NOT print the stepwise hand-off. - Stepwise mode (no active orchestrator lease): print
Run /mino-verify issue-{N} to validate the commit.
Aggregate Handoff (special case)
If the target task is composite/container and all required children are done, do not execute. Instead:
- Skip Steps 4–8 (no lock, no commit, no run events)
- Detect orchestrator mode: if
.mino/loops/active.lockexists AND itsholder_agent: mino-taskAND itsheartbeat_atis within the last 6 hours: return silently. - Stepwise mode: print
All children of issue-{N} are done. Run /mino-checkup aggregate issue-{N} to finalize the parent.
Stop Conditions
Halt the loop and report rather than continue if the chosen task reaches:
Workflow Entry State: blockedWorkflow Entry State: pending_acceptanceCurrent Stage: done
Templates
All artifact shapes are externalized; run MUST NOT generate freehand variations.
templates/event-run-started.yml.tmpltemplates/event-run-completed.yml.tmpltemplates/event-run-commit-failed.yml.tmpltemplates/brief-section-execution-summary.md.tmpltemplates/lock.yml.tmpl
Variable syntax is . Replace literally; do not introduce conditional logic in templates.
Constraints
- Do NOT execute unapproved tasks.
- Do NOT execute when
Approved Revision != Spec Revision. - Do NOT acquire
.mino/run.lockwithout writing it fromlock.yml.tmpl. - Do NOT proceed past a stale lock without explicit user confirmation.
- Do NOT run sibling tasks in parallel (V1 is serial; see protocol § Execution Lock).
- Do NOT push commits —
verifyowns push. - Do NOT bypass git hooks with
--no-verifyor equivalent flags. - Do NOT increment
Attempt Countanywhere except Step 5; do NOT change it on commit failure (roll back toattempt_count_before). - Do NOT commit
.mino/briefs/or.mino/locks/files; the commit pathspec excludes both. - Do NOT write
Pass/Fail OutcomeorCompletion Basis. Only verify and checkup may set these. - Do NOT invent fields in the YAML events; the schema is fixed by
workflow-state-contract.md. - Do NOT overwrite
Open Questions / Warningsin the brief; replace target sections only. - Always release
.mino/run.lockon exit, including failure paths. - Do NOT
push --force,reset --hardpast the remote tip, rebase or amend any pushed commit; usegit revertto undo published work (see protocol § Multi-Agent Git Hygiene). - Do NOT treat
gh issue editlabel-sync failures as fatal; the local event yml is authoritative. - Do NOT post a GitHub comment for
run_startedorrun_completed— both are silent in v1.10. - Do post an audible comment for
run_commit_failed.
