Skip to content

run start: lint declared targets against project roots and adapter id conventions #71

Description

@geuben

Task file: tasks/issue-71-target-lint.md

Problem

Plan-declared test targets are validated only at execution time, by failing to match. When a plan author gets a target's path convention wrong, the cost is paid mid-run as not_found first runs, declared_test_mismatch events, and extra advance round-trips — per cycle.

Two observed shapes:

  1. Project-root confusion: projects with a non-repo-root root in tdd.toml expect project-root-relative paths in targets, while other projects' conventions read as repo-root-relative. A plan author (human or agent) wrote proj::scripts/__tests__/x.test.js where the project root was scripts/, so the collected id was proj::__tests__/x.test.js — both the planner and the executor tripped on it, and both cycles' first runs were not_found.
  2. Adapter id spelling: class/method separators (Class.method vs Class/method on JVM runners) and describe-chain joins (vitest) — the formatting-only cases are advance: normalise describe/test id separator so a formatting-only difference is not a declared_test_mismatch #57's normalisation territory, but a lint would catch them before the run starts.

Proposal

Validate declared targets at plan register / run start, before anything executes:

  • Parse each target against its project's tdd.toml root and the adapter's id grammar. Flag targets whose path duplicates or omits the project root prefix, and targets whose separator spelling can't match the adapter's collected-id format.
  • For targets naming existing tests (pin cycles), optionally resolve them against a collection pass and fail registration on no-match — the cheapest possible time to learn the id is wrong.
  • For targets naming future tests (standard cycles), a static lint of the path/separator shape is still possible even though the test doesn't exist yet.

Complements #57 (runtime normalisation): the lint catches author-side convention errors early; normalisation absorbs the benign formatting drift that remains.

Activity

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

    hardenedPlan audited by agent-handoff-plan; ready for autonomous execution

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions