Skip to content

feat: configurable per-tool build/test commands + opt-in go-test runner - #8

Open
DatScreamer wants to merge 3 commits into
QuentinCody:mainfrom
DatScreamer:feat/test-runner-commands
Open

feat: configurable per-tool build/test commands + opt-in go-test runner#8
DatScreamer wants to merge 3 commits into
QuentinCody:mainfrom
DatScreamer:feat/test-runner-commands

Conversation

@DatScreamer

Copy link
Copy Markdown

What & why

Every tool runner hard-codes its argv (go build ./..., golangci-lint run ...), there is no
config override, and there is no full-suite test tool. A Go project whose dev server
rebuilds with build tags (e.g. -tags 'dev devaccounts') cannot have Interlinked run that
exact command — so Interlinked's checks compile into a separate Go build cache, recompiling
per surface (measured ~30–84 s cold vs ~6–21 s warm on the motivating Go workspace). This
branch lets a project declare its build/lint/test commands once and have every Interlinked
surface honor them.

Changes

  1. New two-tier config.interlinked/tool-commands.json (committed) +
    .interlinked/tool-commands.local.json (gitignored), keyed by check/config names
    (go_build, go_test, golangci_lint, …). A full command array wins; otherwise
    base_args replace the runner's default scope (./...) so Go flag ordering stays correct.
    Trust split mirrors merge.ts: the committed team tier may set base_args +
    timeout_ms (flags for a fixed binary / a bounded cap); command/env stay personal-tier
    (interlinked doctor reports violations). No shell interpolation — argv is written as
    executed (-tags 'dev devaccounts' is ONE token ["-tags","dev devaccounts"]).
  2. Runners honor the overridego-build, golangci-lint, and the new go-test tool
    spawn the configured argv, sync + async variants (src/harness/check-engine/).
  3. New go-test catalog tool — project-wide, opt-in (auto-runs only when the project
    configures go_test, or on explicit --only go-test / --tools go-test /
    verify --only go-test), generic + Go test parsers producing [proven] per-test findings.
    Wired into check --only/--tools/--report, TOOL_IDS, and the ALL_TOOL_IDS drift guard.
  4. affected_tests carries the tags — PostToolUse on a .go edit runs
    go test <tags> -count=1 ./<pkg>, replacing the full-suite ./... scope with the touched
    package (src/harness/quality-checks/).
  5. Skills + docs updated (interlinked-verify, interlinked-setup, router; design doc
    docs/interlinked-test-runners-plan.md).

Verification

  • npm run typecheck — all feature files clean; only the pre-existing WIP error
    (go-halstead-walk.ts, untracked) remains on this checkout.
  • Affected suites (check-engine, verify, check, quality-checks, dispatchers): 104 files /
    2796 tests pass
    ; two mutation-kill suites pass; new unit/integration tests for the
    resolver, runner argv+parser, and verify-tools resolution.
  • Full npm test: one regression this change introduced (a check-command available-checks
    list pin) was fixed before opening the PR; the failing files on a full run fail identically
    on pristine origin/main (Node 20.19.2 lacks node:sqlite for the mutation-journal
    suites, plus known metrics/compiler-gate env-timing flakes).

Acceptance (isolated GOCACHE, re-confirmed after rebase)

Measurement Command Cache state Wall
Before (stock install) check --only go-build untagged, no shared cache 8.7 s
After (branch) check --only go-build tagged, dev-warmed reuse 6.0–6.8 s (clean)
After (branch) check --only go-test tagged, dev-warmed reuse 21–26 s (per-test findings)
Reference go build -tags 'dev devaccounts' ./... fresh (no reuse) 29.3 s
Reference go test -tags 'dev devaccounts' ./... fresh (no reuse) 84.4 s

After-runs hug the warmed-tagged-cache baseline (direct warm repeats 5.5 s build / 23 s
suite), proving the tagged command reuses the dev cache instead of recompiling.

Known v1 gaps (deferred, documented in the plan)

  • verify --json has no per-runner go-test section yet (fixed-shape schema).
  • Coverage-gate resolver wiring (js/ts/python only).
  • PostToolUse honors the config after interlinked harness restart in existing repos.

Closes #7

Add a dedicated two-tier config (.interlinked/tool-commands.json +
tool-commands.local.json, keyed by check/config names) so a project can pin
the exact argv Interlinked spawns for its build/lint/test tools.

- Trust split mirrors guard-rules merge.ts: committed TEAM tier may set
  base_args (flags for a fixed binary) and timeout_ms; command/env stay
  personal-tier (arbitrary executable / runtime rewiring).
- Check-engine catalog runners (go-build, golangci-lint, new go-test) honor
  the override; a full command argv wins, otherwise base_args replace the
  default scope so Go flag ordering stays correct.
- affected_tests go dispatcher carries the go_test tags, replacing the
  full-suite ./... scope token with the touched package.
- New 'go-test' catalog tool: project-wide, opt-in (auto-runs only when the
  project configures go_test or is explicitly requested), sync + async
  runners, generic fallback + Go test parsers producing [proven] findings.
- verify streaming gains --only go-test (requestedOnly) with the resolved
  command; check --only/--tools and check --report list go-test.
- Regression tests: config resolver (trust/precedence/validation), go-test
  runner argv+parser, engine mocks, verify-tools resolution pin.
…up/router

Skill-impact review for the custom build/test command feature: the verify
skill gains a 'Custom build/test command overrides' section (config shape,
trust split, no-shell argv, opt-in go-test), setup documents the two new
config files, and the router routes 'tool_commands' to interlinked-verify.
The __tests__/check.test.ts pin (sibling of commands/check.test.ts) was
missed by the go-test tool-id wiring; update its exact unknown-check message
so the drift guard covers both check test files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable per-tool build/test commands + opt-in full-suite go-test runner

1 participant