feat(evolve): --mode=burst|loop flag + mechanical write-stop-marker refusal (soc-hwax #mode-loop-flag)#395
Merged
Merged
Conversation
boshu2
added a commit
that referenced
this pull request
May 21, 2026
… subcommand (soc-6svt) Mechanical drift fix: the new `ao evolve config --show` subcommand from the parent commit drifted `cli/docs/COMMANDS.md` (TestCobraConformance fail) and `registry.json` (registry-check job fail). Both regenerated via project's standard scripts. Sibling pattern: matches the COMMANDS.md regen pattern from W1a's soc-hwax PR (#395) — same TestCobraConformance signal, same fix. Fitness: CI failures 5 → expected 3 (cli-docs-parity + registry-check clear; agentops-contract-canaries may need a baseline refresh in a follow-up commit).
…efusal (soc-hwax #mode-loop-flag)
Adds --mode={burst,loop} to ao evolve. New ao evolve write-stop-marker
subcommand writes DORMANT/STOP/KILL markers in burst mode and refuses
with exit 1 under --mode=loop, giving operator-driven cron sessions a
mechanical no-self-stop contract.
§A7 fallback decision: in-file HTML comments (kept Steps 1/3/7 scope
minimal — each comment is a single line, no conditional sections).
- cli/cmd/ao/evolve.go: --mode string flag (default burst), validation
in runEvolve, shared evolveModeBurst/Loop constants
- cli/cmd/ao/evolve_write_stop_marker.go: new subcommand with mode
detection + marker canonicalization + filesystem write
- cli/cmd/ao/evolve_test.go: TestValidateEvolveMode,
TestEvolveModeFlagRegisteredWithBurstDefault,
TestRunEvolveRejectsInvalidMode (L1)
- cli/cmd/ao/evolve_write_stop_marker_test.go: L2 table tests for
burst-writes / loop-refuses across dormant|stop|kill + registration
+ normalize helper
- skills/evolve/SKILL.md: Flag table row + Step 1/3/7 HTML comments
- skills/evolve/references/loop-mode.md: invariants + CLI primitives
- docs/plans/2026-05-21-evolve-loop-epic-design.md: epic design memo
- cli/docs/COMMANDS.md: regen via scripts/generate-cli-reference.sh
- skills-codex/{.agentops-manifest.json,evolve/.agentops-generated.json}:
source_hash refresh via post-edit hook
Closes-scenario: soc-hwax#mode-loop-flag
Bounded-context: BC5-Runtime
Evidence: cli/cmd/ao/evolve_write_stop_marker.go
…hwax) Mechanical follow-up to commit 2b1aaf5 (--mode=burst|loop flag + write-stop-marker refusal). CI failed on three gates that the original commit didn't run locally: 1. registry-check: regenerated registry.json after new `ao evolve write-stop-marker` subcommand. Sibling pattern: matches the COMMANDS.md regen step soc-ij7e (#394) did for its new subcommand. 2. skill-lint typo: 3 HTML comments referenced `references/loop-mode.md.` with a trailing period (end of sentence). Linkage check parsed the period as part of the filename and reported "does not exist". Removed all 3 HTML comments — the same intent is documented at `skills/evolve/references/loop-mode.md` already, linked from the flag table row. 3. token-budget overflow: pre-W1a SKILL.md was at 9993 tokens (7 under the 10000 limit); W1a's 7-line additions pushed it to 10240 (240 over). Reduction path: - Removed 3 verbose HTML comments (per #2 above) — saved ~245 tokens - Trimmed flag-table row description ("deterministic no-self-stop" → "Operator-loop") - Drive-by: trimmed two verbose pre-existing References descriptions (long-loop-discipline, snapshot-pattern-for-long-cycle-gates) since the token budget margin is tight; both still accurately describe their references. - Final: 10240 → 9989 tokens (under 10000 limit by 11). skills-codex/* hash regenerated via `scripts/regen-codex-hashes.sh`; codex SKILL.md itself untouched (W1a did not edit it, neither did this commit; parity preserved). Tests: TestCobraConformance pass; lint-skills.sh evolve ✓; test-token-budgets.sh evolve at 9989/10000.
be74e47 to
77b946b
Compare
…nces.yaml.template (soc-6svt follow-up) PR #396 (soc-6svt, just merged) introduced .agents/evolve/preferences.yaml.template as the operator starter template, plus a .gitignore negation to commit it. plugin-load-test was path-filtered to skip on #396 so the violation didn't surface — but it surfaces on this PR (#395), blocking soc-hwax's merge. The template is intentional state per the soc-g2qd epic design (docs/plans/2026-05-21-evolve-loop-epic-design.md §A2 — preferences.yaml shipping path). Adding it to the audit-truth allowlist alongside cycle-history.jsonl and session-state.json (the other two .agents/evolve/* tracked paths). Coordinated update: both ALLOWED_PATHS_REGEX (tracked-file check) and ALLOWED_REINCLUDES_REGEX (.gitignore negation check) get the new path. .gitignore already has the matching `!/.agents/evolve/preferences.yaml.template` line from #396. Sibling pattern: matches the way reconcile/* paths were added when the Reconciliation Engine arc shipped (comments in the script reference that addition). Fitness: plugin-load-test 1 failure → 0; check-no-tracked-agents.sh exits 0 locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
/evolve self-stops in operator-driven cron sessions because its defaults assume agent-as-operator.
--mode=loopflips the contract: operator owns stop signals; CLI mechanically refuses self-written STOPs.What changed
cli/cmd/ao/evolve.go--mode stringflag (burst|loop, default burst) +validateEvolveModehelper called fromrunEvolvecli/cmd/ao/evolve_write_stop_marker.go--mode=loop, writes.agents/evolve/<MARKER>under burstcli/cmd/ao/evolve_test.go--mode=invalidrejected; mode flag registered with burst defaultcli/cmd/ao/evolve_write_stop_marker_test.goskills/evolve/SKILL.md^### Step)skills/evolve/references/loop-mode.mddocs/plans/2026-05-21-evolve-loop-epic-design.mdcli/docs/COMMANDS.mdscripts/generate-cli-reference.shskills-codex/{.agentops-manifest.json,evolve/.agentops-generated.json}check-codex-parity-drift.shPASSHow tested
go test -count=1 ./cmd/ao/— 10175 pass, 1 skip (full suite green after CLI-docs regen; pre-regenTestCobraConformancecorrectly flagged the doc drift)go build ./... && go vet ./...— greengrep '^### Step' skills/evolve/SKILL.mdconfirms only Steps 1/3/7 edited (12 Step markers preserved at same positions)bash scripts/check-codex-parity-drift.sh— PASS§A7 fallback decision
Chose in-file HTML comments (not two-file split). Each Step comment is one line; no conditional sections needed. Two-file split would have ballooned the surface for a single-line contract reminder. CLI mechanical enforcement (
write-stop-markerrefusal) is the real invariant; SKILL.md comments only document intent for human readers.See: docs/plans/2026-05-21-evolve-loop-epic-design.md §A1 + §A7
TODOs the worker leaves for the epic
cli/internal/evolve.preferences.Load()intodetectEvolveWriteStopMarkerModeonce soc-6svt lands (currently flag-only).ao evolve operator-stop(Wave 2) — separate code path explicit operator override.ao evolve blocked(Wave 2) — typed blocked event instead of STOP.Closes-scenario: soc-hwax#mode-loop-flag
Bounded-context: BC5-Runtime
Evidence: cli/cmd/ao/evolve_write_stop_marker.go