Skip to content

fix(cli): fold and suggest near-miss kind names - #883

Merged
Birfy merged 1 commit into
mainfrom
fix/882-kind-aliases
Nov 8, 2026
Merged

Birfy merged 1 commit into
mainfrom
fix/882-kind-aliases

Conversation

@Birfy

@Birfy Birfy commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #882

What changed

--kind and spec kind now behave like algorithm and parameter names: a value that matches exactly one of text, skill_dir, skill_library, agent_dir, agent_code, plugin, policy_slot once case and -/_ are ignored resolves to it (skill-library → skill_library, SKILL_DIR → skill_dir). A remaining close typo appends ; did you mean 'skill_library'?. Unrelated names like nope still get the full list and no guess.

algorithms list/run, init, MCP list_algorithms / algorithm_spec, and compose share resolve_kind. Written specs use the canonical name.

Verification at the tip

Tip SHA: ef39c17
Ran:

  • pytest -q tests/test_evolvespec.py tests/test_cli_algorithms_bare.py tests/test_cli_algorithms_run.py tests/test_guess_kind_skill_library.py tests/test_cli_json_usage_errors.py tests/test_mcp_algorithm_spec.py tests/test_algorithms.py tests/test_changelog_fragments.py → passed
    Not run:
  • full suite — CI

`--kind` and spec `kind` now resolve case and `-`/`_` aliases
(`skill-library` → `skill_library`) the same way algorithm and
parameter names already do, and a close typo ends with
"did you mean 'skill_library'?".

Closes #882
@Birfy

Birfy commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS
Tip SHA: ef39c17
Ran: pytest -q tests/test_evolvespec.py tests/test_cli_algorithms_bare.py tests/test_cli_algorithms_run.py tests/test_guess_kind_skill_library.py tests/test_cli_json_usage_errors.py tests/test_mcp_algorithm_spec.py tests/test_algorithms.py tests/test_changelog_fragments.py at the tip → passed (exit 0). risk_gate.py from main → T2 (185 changed lines / 8 files).
Not run: full suite (CI covers 3.9–3.13).

Correctness. --kind and spec kind now fold case and -/_ onto the canonical KINDS entry (skill-library / SKILL_LIBRARY → skill_library), so algorithms list, init, algorithms run, MCP list_algorithms / algorithm_spec, and compose accept the same aliases algorithm and parameter names already do. Written specs store the canonical kind (so skill_library seeding and layout still run). A near-miss typo such as skil_library ends with did you mean 'skill_library'?; unrelated nope still lists every kind and does not guess. argparse choices= on init / run --kind is kept (unknown values stay invalid choice) after a type=fold_kind conversion.

Risk. T2 by size (package CLI/spec validation, under the 250-line cap). No evolve-loop or installer change. AGENT_PAUSE=false; will squash-merge when required CI is green (or arm --auto while it runs).

@Birfy
Birfy enabled auto-merge (squash) November 8, 2026 06:10
@Birfy

Birfy commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS
Tip SHA: ef39c17
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 883 → T2 (185 changed lines / 8 files)
  • pytest -q tests/test_evolvespec.py tests/test_cli_algorithms_bare.py tests/test_cli_algorithms_run.py tests/test_guess_kind_skill_library.py tests/test_cli_json_usage_errors.py tests/test_mcp_algorithm_spec.py tests/test_algorithms.py tests/test_changelog_fragments.py → passed
    Not run:
  • full suite — CI

fold_kind / resolve_kind match the existing algorithm-name and parameter-name path: case and -/_ fold to a unique KINDS entry (skill-library / SKILL_LIBRARY → skill_library), and a leftover close typo (skil_library, difflib cutoff 0.75) appends ; did you mean 'skill_library'? without guessing at unrelated names like nope.

The shared helper is wired through the surfaces #882 named: algorithms list/run (including the free-text group-level --kind), init / write_starter_spec, MCP list_algorithms and algorithm_spec (the latter via algorithms_run_payload), EvolveSpec.__post_init__ so later kind in alg.kinds checks see the canonical name, and compose. Written specs keep skill_library, which the init and algorithms run tests cover. The changelog fragment is present.

One non-blocking note: init --kind and algorithms run --kind still go through argparse type=fold_kind, choices=KINDS. Aliases resolve, but a near-miss like init --kind skil_library still gets argparse's invalid choice rather than the did you mean suffix that algorithms list --kind skil_library and resolve_kind produce. That's acceptable — choices= keeps the valid list in --help — and is not a merge blocker.

Risk: T2 (under the 250-line cap). AGENT_PAUSE=false.

@Birfy
Birfy merged commit 53a99fc into main Nov 8, 2026
9 checks passed
@Birfy
Birfy deleted the fix/882-kind-aliases branch November 8, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: --kind rejects hyphen/case variants that algorithm names already accept (skill-library, SKILL_LIBRARY)

1 participant