Skip to content

gates.json: test_affected has no cheap pnpm-workspace equivalent — add per-stack guidance #4

Description

@robercano

Context

gates.json defines a test_affected gate, wired to the Stop hook so an agent can't finish with a red affected-test run. But "test only what changed" isn't free in every stack:

  • pnpm workspaces: no built-in affected filter without extra tooling — pnpm --filter "...[origin/main]" test exists but is awkward and flaky inside worktrees; turbo/nx add a dep.
  • Foundry: forge test has no native "since base"; usually you just run all.
  • Other stacks (cargo, go, gradle) each differ.

Adapting the template to a TS+Solidity monorepo, the pragmatic choice was test_affected = the full suite.

Suggestion

Add a short note (in GETTING_STARTED.md Step 3 and/or a gates.json comment) with per-stack options for test_affected:

  • turbo/nx affected commands
  • pnpm --filter "...[<base>]"
  • "= full test suite" as a perfectly acceptable starting point (and the right default when the suite is fast)

Low-stakes, but it removes a head-scratch for new adopters and prevents a misconfigured test_affected from silently running everything (or nothing).

Found while using the template; tracked in the project's TEMPLATE_FEEDBACK log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions