Skip to content

fix(agents): wire flat-file YAML loader into AgentRegistry (v0.1.11) - #8

Merged
ste-bah merged 1 commit into
mainfrom
fix/agentregistry-flatfile-v0.1.11
Apr 27, 2026
Merged

fix(agents): wire flat-file YAML loader into AgentRegistry (v0.1.11)#8
ste-bah merged 1 commit into
mainfrom
fix/agentregistry-flatfile-v0.1.11

Conversation

@ste-bah

@ste-bah ste-bah commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

v0.1.10 wired the flat-file YAML-frontmatter loader into the wrong agent system.

There are two parallel agent systems in this repo:

System Loader Used by
DiscoveryCatalog LocalDiscoverySource::load_all() CLI subcommand archon agent list/search/info
AgentRegistry AgentRegistry::load_with_user_home() TUI /agent list, /run-agent, AgentTool spawning, all session paths

v0.1.10 added flat-file parsing to LocalDiscoverySource (DiscoveryCatalog). The TUI surface — which is what Steven actually uses — reads from AgentRegistry, which only walked .archon/agents/custom/<name>/ 6-file dirs. Result: 333+ flat-file YAML agents in .archon/agents/*.md invisible to the TUI.

Fix

  • New load_flat_file_agents(dir, source) -> Vec<CustomAgentDefinition> in crates/archon-core/src/agents/loader.rs
  • Recursive walk of .archon/agents/, skips custom/ (handled by 6-file path) and dot/underscore-prefixed dirs
  • Parses YAML frontmatter via serde_yml, maps name/description/tools/model/color/tags to CustomAgentDefinition
  • Body after frontmatter becomes system_prompt
  • Wired as priority tiers 4.5 (project) and 5.5 (user) in AgentRegistry::load_with_user_home
  • User > project, 6-file > flat-file at same scope

Test plan

  • 9 new loader tests (frontmatter parse, recursive walk, custom skip, README skip, malformed, missing root, tools CSV/array, filename fallback)
  • 5 new registry tests including lockstep fixture
  • cargo nextest run: 435 archon-core tests PASS
  • cargo fmt --check: PASS
  • cargo build --release --bin archon -j1: PASS
  • TUI binary smoke (Steven): /agent list returns >200 (was 13), /run-agent over-engineering-therapist "say hi" dispatches in default mode

v0.1.10 added flat-file YAML-frontmatter agent discovery to
LocalDiscoverySource (the DiscoveryCatalog code path used by the CLI
subcommand `archon agent list`). The TUI surface (/agent list,
/run-agent, AgentTool spawning, all session paths) reads from a
DIFFERENT system — `AgentRegistry::load_with_user_home()` — which
v0.1.10 did not touch.

Result: /agent list in the TUI showed 13 agents — only the
.archon/agents/custom/<name>/ 6-file dirs. The 305 flat-file .md
agents in .archon/agents/ (claude-flow shape: over-engineering-
therapist.md, coding-pipeline/*.md, github/*.md, analysis/*.md,
etc.) were silently dropped by the registry loader.

Root cause: AgentRegistry::load_with_user_home only walked five
sources (built-ins, project plugins, user plugins, project custom
6-file, user custom 6-file). No flat-file path existed.

Fix:
- New load_flat_file_agents(dir, source) in loader.rs. Walks
  .archon/agents/ recursively, skips custom/ (6-file path) and
  dotted/underscored dirs, parses YAML frontmatter via serde_yml,
  maps to CustomAgentDefinition. Handles tools as CSV string or
  YAML array. Falls back to filename stem when name: key absent.
- Wired as tiers 4/6 (flat-file) and 5/7 (6-file) in the registry
  loader. 6-file loads AFTER flat-file at each scope so the more
  explicit 6-file shape wins on key collision. User scope wins
  over project scope (existing convention).
- 9 loader tests + 5 registry tests (including lockstep fixture).
- Version 0.1.10 → 0.1.11.

Observations:
- cargo test -p archon-core: 435 passed, 0 failed
- cargo fmt --check: clean
- cargo build --release --bin archon: PASS
- 305 flat-file .md agents on disk, 0 name collisions with custom/
- 2 workspace snapshot failures pre-existing in archon-tui (splash)
@ste-bah
ste-bah merged commit 08763dd into main Apr 27, 2026
ste-bah added a commit that referenced this pull request May 4, 2026
…re isolation

Phase 4 ships routing engine, DAG wave grouping, conditional specialist
selection from .archon/specs/gametheory.yaml, and final-stage assembly
(scanner/mapper/writer/combiner/style_applier).

Tier 1 classification and specialist execution remain stubs in Phase 4:
  - generate_synthetic_fingerprint uses keyword regex matching
  - execute_specialist_stub returns templated placeholder text per agent
  - CLI prints a NOTE banner on every run/replay flagging stub mode
Phase 5 wires real LLM agent execution while retaining keyword fallback.

Cold-read audit fixes from #8 + #9:
  - resolve_spec_path search ladder: --spec-path flag, $ARCHON_SPEC_PATH
    env, upward walk 5 levels, ~/.archon/specs/, /etc/archon/specs/.
    GameTheoryError::SpecNotFound enumerates all searched paths on miss.
  - Failure isolation design + test hook (-FORCE-FAIL-FOR-TEST agent_key
    suffix). failed_specialists Vec<(key, msg)> in FullPipelineResult.
    Run status "partial" when mixed success/fail, "completed" otherwise.
    [FAILED] placeholder section in combiner output.
  - shadow_games_count condition removed from spec (Option B). Agent is
    mandatory so condition never evaluated.
  - CLI NOTE banner in run + replay output until real agents wired.

7 new Cozo relations (gt_routing_decisions, gt_enabled_specialists,
gt_skipped_specialists, gt_specialist_outputs, gt_sections,
gt_final_reports, gt_provenance_edges) all use key=>values syntax.
Idempotent via existing run_create + COZO_RELATION_ALREADY_EXISTS const.

CLI: archon gametheory {run, list-runs, show, inspect-routing, replay}
[--spec-path PATH] [--classify-only].

Tests: gametheory 14 -> 49 (+35 new). Phase 1+2 sealed at 62/62
archon-docs.
@ste-bah
ste-bah deleted the fix/agentregistry-flatfile-v0.1.11 branch May 8, 2026 19:48
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.

1 participant