evolve
Governed repo evolution with fixed phase semantics and bounded outcomes.
- License 许可
- MIT
- 所属仓库
- ZachDreamZ/runx
- 最近更新
- 2026-07-17
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- evolve
- runx
- { "category": "code" }
- description
- Governed repo evolution with fixed phase semantics and bounded outcomes.
02 资源文件 5
- 参考文档fixtures/evolve-introspect.yaml1.0 KB
- 参考文档fixtures/evolve-plan-spec.yaml901 B
- 脚本inspect_repo.mjs855 B
- 脚本validate_mode.mjs361 B
- 参考文档X.yaml4.8 KB
03 SKILL.md 正文
Evolve
Evolve the current repository through governed phases with fixed semantics and optional bounded revision. With no objective, the default behavior is introspective: analyze the repo, recommend one bounded improvement, and stop at a plan-quality artifact set.
This is not autonomous code generation. It governs the shape around cognition: every phase produces a typed artifact, every mutation requires approval, and every step emits a receipt. A single evolve run ends in a bounded artifact, not an open-ended improvement loop.
What this skill does
- Resolves an evolution mode: introspective recommendation or directed plan.
- Runs fixed phase semantics over the repo context.
- Produces typed planning artifacts grounded in repo evidence.
- Stops at
specin the shipped runner; it does not mutate files, create patches, or open PRs. - Emits receipt-ready phase artifacts and an explicit stop state.
When to use this skill
- To inspect a repository and recommend one bounded high-value improvement.
- To plan a directed change before implementation, patching, or PR work.
- To convert a repo, skill, receipt, or self-improvement objective into a governed artifact set.
- To create a scafld-style spec when governance applies.
- To preserve phase semantics while allowing the concrete runner to compress phases into fewer visible steps.
When not to use this skill
- For autonomous mutation. The shipped runner stops at plan or spec artifacts.
- For
terminate=patchorterminate=pr. Those modes are currently rejected until a real execution lane exists. - For vague "make it better" loops without evidence or a bounded objective.
- To bypass policy, approval, receipts, or dirty-worktree risk reporting.
- When the target repository cannot be inspected. Return
needs_inputorneeds_more_evidence.
Procedure
-
Resolve mode and target.
- No objective means introspective recommendation mode.
- An objective means directed planning mode.
- Resolve the target as repo, skill, receipt, or self from the objective and runner flags.
- Gate: if
terminateispatchorpr, stop immediately withrejected_unsupported_termination. - Gate: if the repo root or target cannot be resolved, return
needs_input.
-
Preflight using
scope + ingest.- Inspect repo root, git state, base branch, dirty worktree,
.ai/presence, detected languages, likely test commands, and risk signals. - This step is deterministic: no agent cognition and no mutation.
- Evidence expected: paths or commands inspected, git state, target resolution, and any constraints discovered.
- Inspect repo root, git state, base branch, dirty worktree,
-
Model the opportunity or objective.
- In introspective mode, rank opportunities grounded in repo state, receipts, failing runs, visible docs, current plans, or explicit operator context.
- In directed mode, restate the objective with target kind, constraints, success criteria, and non-goals.
- Gate: if evidence does not support a bounded valuable move, return
no_recommendationfor introspection orneeds_more_evidencefor a directed objective.
-
Materialize planning artifacts.
- Produce
opportunity_reportandrecommended_objectivefor introspection. - Produce
objective_brief,diagnosis_report,change_plan, andspec_documentwhen applicable. - Include touchpoints, risk, acceptance checks, approval gates, and expected receipts. Do not include patch content unless a separate approved runner exists.
- Produce
-
Evaluate plan quality.
- Confirm the plan is one bounded outcome, not a hidden loop.
- Confirm every recommendation is grounded in cited evidence.
- Confirm mutation is not implied by prose.
- Gate: if the plan depends on unresolved policy or ownership decisions,
return
needs_humanwith the exact decision required.
-
Stop and emit receipt expectations.
- Stop at
specby default. - A valid receipt should record mode, target, preflight profile, phase artifacts, evidence refs, stop state, rejected termination requests, and whether runner-owned post-run reflect was appended.
- Stop at
Canonical semantics
Complex runx skills share one internal phase language:
scopeingestmodelmaterializeevaluatereviseverifyratify
The current evolve runner uses a bounded subset and compresses some phases
into fewer concrete steps. That is allowed. What stays fixed is the meaning of
the phases, not the number of steps. When a runner opts in, runx may also
append a runner-owned post-run reflect projection after the receipt is written.
That projection is Knowledge-only metadata, not another canonical phase.
Current runner mapping
Introspect
Caller-mediated. This is the zero-argument recommendation lane. It uses
scope + ingest + model to analyze the current repo and produce:
opportunity_report: ranked opportunities grounded in repo evidence.recommended_objective: one bounded next move.change_plan: a concrete plan for that recommendation.spec_document: a draft scafld-style spec when governance applies.
No approval gate and no mutation happen in this runner. It is introspection only. It also opts out of post-run reflect because it is already an introspective lane.
Preflight
Deterministic. This is the current scope + ingest step. It inspects the
target repo and produces a repo_profile: repo root, git state, base branch,
dirty worktree, .ai/ presence (scafld initialized), detected languages, test
commands, and risk signals. No agent cognition, no mutation.
Plan
Caller-mediated. This is the current model step and also drafts bounded plan
artifacts. Given the objective and repo profile, it produces four artifacts in
one pass:
objective_brief: restatement with target kind, constraints, and success criteria.diagnosis_report: current repo state relative to the objective.change_plan: ordered phases, acceptance checks, touchpoints, and risk.spec_document: draft scafld spec when governance applies.
Directed evolve runs opt into runner-owned post-run reflect. That projection
is derived from the completed receipt and run ledger after the bounded plan
lane finishes; it does not add another visible graph step or mutation path.
Termination guard
evolve currently stops at plan/spec artifacts. If a caller requests
terminate=patch or terminate=pr, the runner fails immediately with a clear
error instead of pretending it can mutate or publish.
Edge cases and stop conditions
- Unsupported termination: return
rejected_unsupported_terminationforpatchorpr. - No objective and no evidence-backed opportunity: return
no_recommendation. - Directed objective is too broad: return
needs_inputwith a bounded rewrite request. - Repo root missing, unreadable, or not a repo when one is required: return
needs_input. - Dirty worktree: continue only for planning, record the dirty state, and do not imply that changes can be applied safely.
- Target skill, receipt, or self context cannot be resolved: return
needs_inputwith the missing selector. - Evidence supports multiple unrelated improvements: rank them but recommend one bounded move; list the rest as non-selected opportunities.
- Requested hidden revision loop: refuse the loop and stop at the governed artifact.
- Policy or ownership decision required before planning can be trusted: return
needs_human.
Output schema
Return a structured artifact set:
status: introspection_complete | plan_complete | no_recommendation | needs_input | needs_more_evidence | needs_human | rejected_unsupported_termination | refused
mode: introspect | directed
target:
kind: repo | skill | receipt | self | unknown
ref: string | null
inputs:
objective: string | null
repo_root: string
terminate: spec | patch | pr
repo_profile:
git_state: string
base_branch: string | null
dirty_worktree: boolean
scafld_initialized: boolean
languages: [string]
test_commands: [string]
risk_signals: [string]
opportunity_report:
ranked: [object]
evidence_refs: [string]
recommended_objective: string | null
objective_brief: object | null
diagnosis_report: object | null
change_plan:
phases: [object]
touchpoints: [string]
acceptance_checks: [string]
approval_gates: [string]
risks: [string]
spec_document: string | null
stop_state:
termination: spec
mutation_performed: false
reason: string
receipt_expectations:
phase_artifacts_recorded: [string]
evidence_refs_recorded: [string]
rejected_requests: [string]
post_run_reflect: appended | opted_out | not_applicable
Worked example
Command:
runx evolve "add websocket adapter support"
Expected result:
status: plan_complete
mode: directed
target:
kind: repo
ref: .
objective_brief:
summary: Add websocket adapter support as a bounded repo change.
success_criteria:
- Adapter contract documented
- Integration points identified
- Acceptance checks named before mutation
change_plan:
phases:
- name: scope
artifact: repo_profile
- name: model
artifact: objective_brief
- name: materialize
artifact: spec_document
approval_gates:
- Human approval before any patch lane
stop_state:
termination: spec
mutation_performed: false
reason: Shipped evolve runner stops at plan/spec artifacts.
If the caller instead runs runx evolve "add websocket adapter support" --terminate pr, the correct result is rejected_unsupported_termination,
not a synthetic PR plan.
Inputs
objective(optional): what to evolve toward. If omitted,evolveuses the introspective recommendation runner.repo_root(optional): repository root. Defaults to cwd.terminate(optional): defaults tospec.patchandprare currently rejected by the shipped runner.target(optional): explicit repo, skill path, receipt id, or self target when the objective alone is not enough.constraints(optional): operator-provided boundaries such as ownership, forbidden files, required evidence, or delivery policy.
04 同仓库更多 Skills
zapier-handoff
Validate a runx execution context and hand off a governed payload to a Zapier Catch Hook with scoped auth, idempotency, and receipt expectations.
x402-pay
Execute a governed x402 payment by delegating to the canonical spend flow with the x402 runtime path selected.
work-plan
Decompose a build objective into governed runx execution steps.
web-fetch
Fetch and extract one web source within an explicit allowlist, returning the content by digest with full provenance.
weather-forecast
Normalize provider weather evidence into an action-safe forecast packet with provenance, uncertainty, and stop conditions for downstream agents.
vuln-triage
Triage dependency or ecosystem vulnerability risk into remediation and advisory packets, grounding on verified CVE evidence when it is supplied.