Skip to content

Tester ACK should be gated on per-repo checks: exit codes, not free-form prose #2123

Closed as not planned

Description

@jwbron

Problem

The tester role's confirmation was honored in PR #2105, with the tester explicitly attesting "The full tests/ suite has 6694 passes plus 5 unrelated pre-existing failures" and earlier ACKing the coder after make lint (mypy) was fixed. Consensus closed and the PR opened. CI then immediately failed with two failures:

  1. Unit Tests — orchestrator/tests/test_mcp_tools.py::TestToolRouting::test_all_tools_registered. The PR added a new MCP tool (validate_repo_config) to orchestrator/mcp_tools.py but did not update the registration test fixture. Test was never run — the tester's "full tests/ suite" scope missed orchestrator/tests/.
  2. YAML Lint — six new golden files (tests/shared/egg_config/golden/*.yaml) added by the tester itself fail yamllint with [indentation] wrong indentation: expected 2 but found 0. Tester never re-ran make lint-yaml against its own commit.

Both failures share one shape: the tester's attestation was free-form prose ("tests pass", "lint passes after mypy fix") with a partial scope, and BRC consensus accepted it.

Why the BRC re-review mechanism didn't catch this

It's not a re-review bug. _un_confirm_stale_reviewers() and invalidate_overlapping_acks() in orchestrator/peer_consensus.py work correctly — we observed CONSENSUS_RE_REVIEW fire for reviewer_concurrency in this same pipeline when tester re-proposed v2. The gap is upstream: the tester's attestation itself was scoped narrowly, so even after re-review, the same incomplete result was re-confirmed.

The right scope is per-repo, not hardcoded

config/repositories.yaml already defines a per-repo checks: block:

repo_settings:
  some-org/some-repo:
    checks:
      - name: lint
        command: make lint
      - name: test
        command: make test-all

These are the declared quality gates for that repo. They're the gates CI runs. They're the gates the autofixer pulls from. They should be the gates the tester gates its ACK on — for any repo, not just egg.

Today, the tester contract (shared/egg_contracts/agent_roles.py::TESTER_ROLE.responsibilities) says only:

"Run linters and type checkers, apply auto-fixes where possible / Report test coverage, lint/type-check results, and document deficiencies found"

— silent on which command, which scope, or whether the attestation is verifiable. Whatever the agent decides to run becomes the de facto contract.

Likewise REVIEWER_CONTRACT_ROLE.responsibilities:

"Verify acceptance criteria are met / Check task completion status / Validate contract consistency"

— silent on whether to independently re-run the declared checks: against the producer's final commit. So reviewer_contract ACKed without verifying.

Suggested directions

Pick one or combine — exact shape is a planning question.

  1. Tighten the tester contract to require running every entry in the per-repo checks: list against the producer's current commit and reporting each exit code. Free-form "tests pass" prose stops being acceptable; the BRC propose payload should carry a structured checks_passed: [{name, command, exit_code, duration_s}, ...] field, and the orchestrator's check_confirm_guard should reject the proposal if any exit_code is non-zero or if the payload's commit SHA doesn't match the current proposal SHA.
  2. Have reviewer_contract re-run all checks: against the producer's final commit before ACKing. Cheap insurance against tester-scope drift, and the same code path the autofixer uses already loads the checks: block via get_repo_checks(repo) in config/repo_config.py.
  3. Plan-phase responsibility: when a task adds a new MCP tool, a new public API, or any other module-level registration that has a corresponding fixture/registration test, the plan should explicitly enumerate the fixture file as a required edit. The orchestrator MCP tool registration test is one of several "registration witnesses" that exist (probably similar tests for agent roles, gateway routes, etc. — worth a sweep). Doesn't replace 1 or 2; complementary.

The first option is cheapest and pins the gap at the source. It also makes the contract repo-config-driven instead of egg-specific — every onboarded repo's checks: block becomes its own attestation contract.

Interaction with #2042

make test is now changeset-aware via #2042's grimp selector. If a repo's checks: lists command: make test, the tester runs the narrowed selector. That's correct except when the diff touches a registration site (an MCP tool registry, a role enum, etc.) that has a hardcoded-fixture test elsewhere whose import path may or may not be in the grimp graph reachable from the changed file. Worth a follow-up: either the selector should escalate to all-roots when changed files match a "registration site" allowlist, OR the per-repo checks: for production paths should specify make test-all (or pytest with no path arg). Out of scope for this ticket; note it for #2042 follow-up.

Evidence

  • PR Simplify repository configuration — schema cleanup, layered repo+local config, onboard skill, validator #2105 — BRC consensus reached at 01:22:09; CI failed at 01:28
  • Failing tests: orchestrator/tests/test_mcp_tools.py::TestToolRouting::test_all_tools_registered (Unit Tests) + tests/shared/egg_config/golden/*.yaml (YAML lint)
  • Tester's attestation: NACK at 01:06:14 in .egg-state/brc-history/2073-implement.md ("The full tests/ suite has 6694 passes...") and earlier ACK after coder's mypy fix without re-running make lint-yaml
  • Makefile::test-all: $(PYTEST) tests/ gateway/tests/ orchestrator/tests/ shared/tests/ -v -m "not functional"
  • pyproject.toml::testpaths: lists all four roots
  • BRC re-review mechanism (verified working): CONSENSUS_RE_REVIEW to reviewer_concurrency at 01:20:17
  • Per-repo checks: schema: config/repositories.yaml.example:202-204 (- name: lint / command: make lint, - name: test / command: make test)
  • Existing loader: config/repo_config.py::get_repo_checks(repo) already returns the validated list

Out of scope

References

Activity

  1. added
    p0
    on Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions