Skip to content

feat(evolve): per-repo preferences.yaml schema + loader + ao evolve config --show (soc-6svt #preferences-yaml)#396

Merged
boshu2 merged 4 commits into
mainfrom
feat/evolve-preferences-soc-6svt
May 21, 2026
Merged

feat(evolve): per-repo preferences.yaml schema + loader + ao evolve config --show (soc-6svt #preferences-yaml)#396
boshu2 merged 4 commits into
mainfrom
feat/evolve-preferences-soc-6svt

Conversation

@boshu2
Copy link
Copy Markdown
Owner

@boshu2 boshu2 commented May 21, 2026

Why

Different repos have different /evolve physics. Hardcoded defaults force ADRs per-repo to override. Per-repo YAML separates skill-doctrine from repo-policy.

What changed

Surface Change
schemas/evolve-preferences.v1.schema.json New JSON Schema draft-07 for the v1 preferences shape
cli/internal/evolve/preferences.go New loader: Load(ctx) (*Prefs, error) with file:line error context
cli/cmd/ao/evolve_config.go New ao evolve config --show [--json] subcommand
.agents/evolve/preferences.yaml.template New starter template
.gitignore Negation rules for the template path

Resolution order

defaults < preferences.yaml < CLI flag (caller-applied)

Invalid keys/types -> exit 1 with preferences.yaml:line:col context. Never silent fallback.

How tested

  • L2: malformed YAML -> ao evolve config --show exits 1, stderr has file:line
  • L1: preferences.Load() table tests cover defaults, valid, invalid types, out-of-range, unknown keys
  • go test ./cli/internal/evolve/ ./cli/cmd/ao/ green (299+ tests across both)

See: docs/plans/2026-05-21-evolve-loop-epic-design.md §A2 (created by parallel worker W1a in soc-hwax PR)

Closes-scenario: soc-6svt#preferences-yaml
Bounded-context: BC5-Runtime
Evidence: cli/internal/evolve/preferences.go

…onfig --show (soc-6svt #preferences-yaml)

Phase 1 of the soc-g2qd epic. Different repos need different /evolve
physics. Hardcoded defaults force ADRs per-repo to override; per-repo
YAML separates skill-doctrine from repo-policy.

New surfaces:
- schemas/evolve-preferences.v1.schema.json — JSON Schema draft-07
- cli/internal/evolve/preferences.go — typed loader with file:line errors
- cli/cmd/ao/evolve_config.go — new ao evolve config --show [--json]
- .agents/evolve/preferences.yaml.template — operator starter template
- .gitignore — negate the template path so it ships in the repo

Resolution order:
  defaults < preferences.yaml < CLI flag (caller-applied)

Invalid keys, types, or out-of-range values exit 1 with
'preferences.yaml:line:column' context. No silent fallback.

Closes-scenario: soc-6svt#preferences-yaml
Bounded-context: BC5-Runtime
Evidence: cli/internal/evolve/preferences.go
boshu2 added 3 commits May 21, 2026 11:22
… 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).
…olve config subcommand (soc-6svt)

The cli-command-surface-matrix canary hardcodes the count of top/sub/all command headings in cli/docs/COMMANDS.md. After this PR's `ao evolve config` subcommand:

- top=73 → 73 (unchanged; new command is a subcommand, not top-level)
- sub=197 → 198 (+1: `ao evolve config`)
- all=270 → 271 (+1)

Sibling pattern: matches how PR #390 (soc-vuu6.25 ao session bootstrap) bumped the same fixture when ao session bootstrap landed.

Fitness: agentops-contract-canaries 1 failure → 0; cli-command-surface-smoke.sh passes locally (`cli-help-matrix-ok` emitted).
…tamp (soc-4ake)

The "compressed cycle ledger truncates notes to 140 chars" test (tests/scripts/export-session-summary.bats:71) wrote a cycle dated 2026-05-20T10:00:00Z and ran export-session-summary.sh which defaults to a 24h window. After 2026-05-21 that date falls outside the window and the test fails ("grep cycle 1 failed"). This bug was already filed as soc-4ake; #396 surfaced it because bats-tests runs on this PR.

Fix: replace the hardcoded date with `$(date -u +%Y-%m-%dT%H:%M:%SZ)` so the cycle always falls inside the default window.

Sibling pattern: matches the dynamic-now pattern in `write_cycle` callsites of other test files (e.g., tests/scripts/*.bats that use $(date)).

Fitness: bats-tests 1 failure → 0; export-session-summary.bats 11/11 passing locally.

Drive-by fix justification: #396 cannot merge without bats-tests green, and the bead (soc-4ake) was already filed against this exact test:line. Closing soc-4ake atomically with this commit.
@github-actions github-actions Bot added the tests label May 21, 2026
@boshu2 boshu2 merged commit 2d2b806 into main May 21, 2026
71 checks passed
@boshu2 boshu2 deleted the feat/evolve-preferences-soc-6svt branch May 21, 2026 15:56
boshu2 added a commit that referenced this pull request May 21, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant