Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xNyk Council of high intelligence validate roster py

From Leeroopedia
Knowledge Sources
Domains Quality_Assurance, Agent_Configuration, CI_CD
Last Updated 2026-10-20 00:00 GMT

Overview

Concrete Python validator that checks consistency between SKILL.md prose and agents/*.md frontmatter to prevent silent roster drift in the Council of High Intelligence.

Description

validate-roster.py is a hard-gate CI validator that catches discrepancies between what `SKILL.md` documents (triads, polarity pairs, profiles, roster table) and what the agent frontmatter declares. The coordinator reads the prose for panel selection and tie-breaking, while panel selection reads the frontmatter — when the two disagree, the council silently seats the wrong people.

Three real drift incidents motivated this validator: Aristotle carried a `profiles` tag for a panel SKILL.md documents without him, and the Sutskever/Machiavelli and Socrates/Watts polarity pairs existed in frontmatter and the duo table but were missing from the Polarity Pairs list the coordinator reads.

The script checks: frontmatter completeness (required keys), method diversity (DMAD — no two agents share a reasoning method), polarity pair reciprocity and prose mirroring, profile size and member listing consistency, triad table membership, and roster table vs disk file agreement.

Usage

Run this script:

  • In CI (lint.yml workflow runs this as a gate)
  • After modifying agent frontmatter or SKILL.md prose tables
  • As a developer to catch drift before pushing

Code Reference

Source Location

Signature

def load_agents(agents_dir: Path) -> dict[str, dict]:
    """Load all council-*.md files, extract frontmatter council blocks.

    Returns: {agent_slug: council_metadata_dict}
    """

def main():
    """Run all validation checks.

    Usage: validate-roster.py [repo_root]
    Default repo_root: parent of the script's directory.

    Checks:
    1. Frontmatter completeness (required keys present)
    2. Method diversity (DMAD — unique reasoning_method per agent)
    3. Polarity pair reciprocity (A->B implies B->A)
    4. Polarity pairs mirrored in SKILL.md prose
    5. Profile size matches SKILL.md declared size
    6. Profile members match frontmatter tags
    7. Every tagged profile is documented in SKILL.md
    8. Triads referenced in frontmatter exist in triad table
    9. Roster table lists exactly the agents on disk

    Exit 0 = pass, non-zero = failures found
    """

Import

# Run from repo root (auto-detected):
python3 scripts/validate-roster.py

# Or specify a repo root:
python3 scripts/validate-roster.py /path/to/repo

I/O Contract

Inputs

Name Type Required Description
agents_dir Path Yes Directory with council-*.md files (default: repo/agents)
SKILL.md file Yes Canonical protocol with prose tables
PyYAML dependency Yes yaml.safe_load for frontmatter parsing

Outputs

Name Type Description
stdout str Summary: "== Roster Validation ==\nmembers: N checks: M", then [FAIL] lines
exit code int 0 = pass, non-zero = failures count

Usage Examples

Passing Run

$ python3 scripts/validate-roster.py
== Roster Validation ==
members: 18  checks: 156
[PASS] SKILL.md and agent frontmatter agree

Failing on Method Diversity Violation

# If two agents share the same reasoning_method:
$ python3 scripts/validate-roster.py
== Roster Validation ==
members: 18  checks: 156
[FAIL] reasoning_method 'elenchic-questioning' shared by ['socrates', 'aurelius']
1 problem(s) found

Failing on Polarity Pair Drift

# If a polarity pair exists in frontmatter but not in SKILL.md prose:
$ python3 scripts/validate-roster.py
== Roster Validation ==
members: 18  checks: 156
[FAIL] pair ['socrates', 'watts'] in frontmatter but not in SKILL.md
1 problem(s) found

Failing on Roster Mismatch

# If SKILL.md roster table lists an agent not on disk (or vice versa):
$ python3 scripts/validate-roster.py
[FAIL] roster/agent mismatch: only in SKILL.md ['plato'], only on disk []
1 problem(s) found

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment