Skip to content

refactor: align the agent-compatibility catalog with what the platform implements and the marketplace generates #2137

Closed

Description

@vybe

Summary

The agent-compatibility catalog (src/backend/services/compatibility/spec.py, 101 checks) and its human twin (docs/agent-validation-spec.md) have drifted from what the platform actually implements and from what the create-agent wizards in the public abilityai/abilities marketplace actually generate. A full review — all 101 checks against static_checks.py, collector.py, and the live backend — found three classes of problem:

  1. Checks that validate fields Trinity does not implement. git.commit_paths / git.ignore_paths / git.push_enabled appear only inside services/compatibility/ and two docs — there is no backend reader anywhere. That is T-017 (HARD), G-003, G-004, G-005 gating on a fiction. Same for a template.yaml metrics: key (D-006) and for .trinity/post-check (I-005), whose sole reason for existing in git_service._TRINITY_AUTHORED_PATHS is a comment pointing back at I-005. No executor exists for it.
  2. Checks that fail every agent we ship, by construction. The wizards emit .claude/skills/<name>/SKILL.md and never .claude/commands/, so F-008 is a guaranteed INFO failure. Schedule messages are written as "Run /some-skill — …", but _slash_command() uses re.match(r"^\s*/…"), so A-001 fails on every agent while P-006 (HARD, approval gates) never fires at all. _command_names() globs only .claude/commands/, so X-007 and T-016 cannot see a skill-based agent. G-002 compares against the 45-entry fleet-wide _GITIGNORE_PATTERNS that Trinity itself injects at git-init.
  3. Duplicates and self-contradictions. c_t016 and c_x007 are the same logic under two ids; c_k002 is literally return c_t015(snap); K-005 is an AI restatement of static S-010; T-012 is a one-directional X-004; I-001..I-004 ask "is the output contract documented?" four ways. P-009 tells authors to split reference material out of SKILL.md, and P-004 then flags the resulting reference.md — because _skill_files() walks every .md under .claude/skills/.

Separately, the anti-drift test has a blind spot: TestSpecDocSync::test_ids_match_doc matches ^\|\s*([A-Z]-\d{3})\s*\| — a single letter. The doc's DP-001…DP-005 (Runtime Data Paths) never matched, so five checks are documented, indexed in the Check Index, and entirely unimplemented. The guarantee "the two can't drift" does not currently hold.

Context

The compatibility report is a user-facing surface — GET /api/agents/{name}/compatibility, the get_agent_compatibility_report MCP tool, and CompatibilityPanel.vue on the agent Overview. An agent scaffolded by the marketplace wizards today lands with roughly nine SOFT/INFO failures that are not the author's fault and cannot be acted on, which trains operators to ignore the panel. Meanwhile the one HARD check that guards autonomous runs from hanging on an approval gate (P-006) is silently inert.

Field-consumption note relevant to severity: use_cases and capabilities are surfaced only by _build_local_template() (the bundled-gallery path) in services/template_service.py. The GitHub-sourced builder does not surface them, and repo-first deployment is now the default path — so T-010 and T-011 are SOFT-failing agents for fields the common path never reads.

Acceptance Criteria

  • Catalog reduced from 101 to ~86 checks; test_catalog_size updated to the new pinned number
  • Dead-field checks removed: T-017, G-003, G-004, G-005 (git: block), D-006 (metrics:), I-005 (post-check) — or, if the git: block is intended to ship, a linked issue implements it and the checks stay
  • Legacy/no-longer-generated checks removed: F-008 (.claude/commands/ required), F-012 (docs/memory/requirements.md), F-013 (CHANGELOG.md)
  • Duplicates removed: T-012 (→ X-004), T-016 (→ X-007), K-002 (→ T-015), K-005 (→ S-010), I-003 + I-004 (→ I-001); G-002 dropped or narrowed to agent-authored patterns only
  • C-009 merged into C-006; C-012 (persona coherence) dropped or reduced to INFO
  • Downgraded SOFT → INFO: T-007 (version), T-008 (author), T-010 (use_cases), T-011 (capabilities), K-003 (.env.example comments)
  • _slash_command() matches a slash command anywhere in the message, not only at position 0 — P-006 and X-007 demonstrably fire on a "Run /skill — …" schedule in a unit test
  • _command_names() also resolves .claude/skills/<name>/SKILL.md, so X-007 passes on a skill-based agent and fails on a genuinely missing target
  • A-001 accepts a slash command anywhere in the message
  • P-004 scopes to SKILL.md only (never companion reference.md/examples.md) and its threshold no longer contradicts P-009
  • P-006 honors an explicit opt-out for skills that gate by design (the marketplace already carries an automation: autonomous | gated | manual frontmatter convention) — a deliberately-gated scheduled skill is not reported as a HARD failure
  • T-013 explicitly PASSes when use_cases is absent, mirroring T-014
  • F-004 (.env.example) is conditional on the agent declaring credentials — K-001 already covers the case that matters at HARD
  • test_ids_match_doc regex widened to [A-Z]{1,2}-\d{3} so a two-letter prefix can never again drift silently
  • DP-001…DP-004 either implemented in spec.py + static_checks.py, or removed from the doc's Check Index; DP-005 removed (the collector does not read .trinity/pre-snapshot)
  • docs/agent-validation-spec.md regenerated to match: Check Index, per-check definitions, severity summary, auto-fixable list, and the "Implementation deviations" note all consistent with spec.py
  • An agent scaffolded fresh by a create-agent wizard reports zero HARD and zero unactionable SOFT findings — added as a fixture-based regression test alongside the existing good-agent test

Technical Notes

Files in scope:

  • src/backend/services/compatibility/spec.py — the catalog
  • src/backend/services/compatibility/static_checks.py — _slash_command, _command_names, _skill_files, c_p004, c_p006, c_g002
  • src/backend/services/compatibility/collector.py — snapshot paths (no change needed unless DP-005 is kept)
  • docs/agent-validation-spec.md — the human source of truth
  • tests/unit/test_compatibility_checks.py — TestSpecDocSync, test_catalog_size

Check IDs are documented as stable and never renumbered; removals should leave the remaining ids untouched and the doc should note the retired ids so old persisted rows in agent_compatibility_results are interpretable.

Two of the findings are arguably type-bug rather than cleanup and could be split out if that helps sequencing: P-006 never fires (a HARD guard that has been inert since it shipped) and X-007 is blind to .claude/skills/ (false failures on the only layout the wizards produce).

Marketplace-parity gap, optional and not required by the criteria above: the platform catalog has no equivalent of the marketplace's own audit rubric item that cross-references CLAUDE.md's capability/dispatch tables against the skills actually present in .claude/skills/. That would be a cheap STATIC check if we want the two rubrics to converge rather than merely stop conflicting.

Activity

  1. added
    priority-p2
    type-refactor
    theme-devex
    complexity-medium
    status-ready
    on Aug 12, 2026
  2. vybe commented on Aug 12, 2026

    @vybe
    ContributorAuthor

    /claim

  3. added
    status-in-progress
    and removed
    status-ready
    on Aug 12, 2026
  4. github-actions commented on Aug 12, 2026

    @github-actions

    Claimed by @vybe. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/2137-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #2137
  5. added a commit that references this issue on Aug 13, 2026
    b2b3391
  6. added
    status-in-dev
    and removed
    status-in-progress
    on Aug 13, 2026
  7. added a commit that references this issue on Aug 13, 2026
  8. removed
    status-in-dev
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-mediumpriority-p2theme-devextype-refactor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions