Skip to content

Repo size + boundary gates are blind to first-party Go dirs outside internal/ and cmd/ #584

Description

@sunholo-voight-kampff

Found at sprint-planning time for #498 Lane B (mission iteration 138). Both findings were
reproduced first-party by the controller after the planner surfaced them, each with a
known-positive control so the zeros are measurements and not broken patterns.

1. make check-file-sizes enumerates find internal cmd only

make/code-health.mk:126 — the gate body is:

for file in $$(find internal cmd -name "*.go"); do

Measured:

Query Result
find internal cmd -name '*.go' | grep -c 'internal/apiserver/' 45 (known-positive: the gate does work)
find internal cmd -name '*.go' | grep -cE '^(runtime|std)/' 0
find runtime std -name '*.go' | wc -l 6 — the files genuinely exist

So every first-party Go package outside internal/ and cmd/ — today runtime/, std/,
testutil/, scripts/, tools/* — has no 800-line enforcement at all. This is not
hypothetical: #498 Lane B adds a new top-level public package serveapi/, and its design doc's
acceptance criterion "make check-file-sizes passes" would have passed identically if
serveapi/serveapi.go were 5,000 lines. The sprint plan works around it with an explicit
find serveapi -name '*.go' | xargs wc -l assertion, but that is a per-sprint patch of a
repo-wide gap.

2. make check-boundaries iterates three fixed package sets, and apiserver is in none

scripts/check_boundaries.sh enumerates CORE_PKGS, DASHBOARD_PKGS, CORE_SURFACE_PKGS.

Query Result
grep -c apiserver scripts/check_boundaries.sh 0
grep -c serveapi scripts/check_boundaries.sh 0
grep -c parser scripts/check_boundaries.sh 4 (control — the instrument matches)
bash scripts/check_boundaries.sh rc=0, OK: no architecture boundary violations.

The gate therefore passes whether or not internal/apiserver (or a future serveapi/) imports the
compiler core directly. The script's own header comment already anticipates this failure class:
it warns that a wrong package value "silently makes the gate pass on every import match".

Why this matters beyond the two gates

Both are vacuous-pass defects: the gate runs, exits 0, and is quoted downstream as evidence for
a claim it never covered. The #498 Lane B design doc had already measured the boundary-gate gap
(its row V18) and still listed make check-boundaries as an acceptance criterion — the measurement
was recorded and the conclusion built on it was not corrected.

Suggested fix

  • Derive both gates' file lists from go list ./... (or find . -name '*.go' minus vendor/
    worktrees/node_modules), not from a hardcoded directory pair / package array.
  • Add an anti-vacuity floor to each: assert the enumerated file count is above a known minimum and
    exit 1 loudly if the list comes back short, so a future re-scoping cannot silently empty it.
  • Add a self-test fixture that a deliberately-oversized file outside internal/+cmd/ is caught.

Not urgent enough to outrank the queue; filing so it is not re-discovered a third time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions