No check enforces the two-line PURPOSE header position in source files #630

Closed
opened 2026-09-26 00:48:22 +00:00 by claude · 2 comments
Member

Found during IW-622 (phase-01-context.md, Scope). No lint, scalafix rule, hook or test checks that a file starts with two // PURPOSE: lines at lines 1-2. IW-622 and its sibling defects (a second PURPOSE line after package, or only one PURPOSE line) went undetected for this reason. A repository-wide check in the lint gate would catch this class of defect.

Found during IW-622 (phase-01-context.md, Scope). No lint, scalafix rule, hook or test checks that a file starts with two `// PURPOSE:` lines at lines 1-2. IW-622 and its sibling defects (a second PURPOSE line after `package`, or only one PURPOSE line) went undetected for this reason. A repository-wide check in the lint gate would catch this class of defect.
Author
Member

Intake: needs-input. Before this issue can be analysed, please answer these questions:

  1. Which files must the check cover? The options are: (a) Scala files only (*.scala, *.mill), or (b) also shell, BATS, frontend TS/CSS and Markdown docs. Markdown docs already use <!-- PURPOSE: --> headers at lines 1-2.

  2. Which Scala files are exempt? On origin/main (bcb2d5b5), a check at lines 1-2 fails these files, and no open issue covers them:

    • (a) the 27 commands/*.scala shims. They have one PURPOSE line, and docs/testing.md lines 167-168 exempt them on purpose.
    • (b) .iw/commands/test.scala, which has a PURPOSE line and then a // USAGE: line. This is the command-script header format.
    • (c) 2 files under each of research/approach-3-hybrid/ and research/approach-4-combined/.

    For each group, say: exempt, fix in this change, or delete (research/).

  3. How does the check pass while #622, #628 and #629 are still open? These three issues cover the 25 failing core/test files. The options are:

    • (a) This change also fixes all 25 files, and the three issues close with it.
    • (b) This change adds a baseline or allowlist, and the fixes in the three issues then make it smaller.
    • (c) This change waits until #622, #628 and #629 are merged.

    #629 also asks whether to delete DebugTest.scala. That decision changes the list of files for option (a).

Intake: needs-input. Before this issue can be analysed, please answer these questions: 1. Which files must the check cover? The options are: (a) Scala files only (`*.scala`, `*.mill`), or (b) also shell, BATS, frontend TS/CSS and Markdown docs. Markdown docs already use `<!-- PURPOSE: -->` headers at lines 1-2. 2. Which Scala files are exempt? On origin/main (bcb2d5b5), a check at lines 1-2 fails these files, and no open issue covers them: - (a) the 27 `commands/*.scala` shims. They have one PURPOSE line, and `docs/testing.md` lines 167-168 exempt them on purpose. - (b) `.iw/commands/test.scala`, which has a PURPOSE line and then a `// USAGE:` line. This is the command-script header format. - (c) 2 files under each of `research/approach-3-hybrid/` and `research/approach-4-combined/`. For each group, say: exempt, fix in this change, or delete (research/). 3. How does the check pass while #622, #628 and #629 are still open? These three issues cover the 25 failing `core/test` files. The options are: - (a) This change also fixes all 25 files, and the three issues close with it. - (b) This change adds a baseline or allowlist, and the fixes in the three issues then make it smaller. - (c) This change waits until #622, #628 and #629 are merged. #629 also asks whether to delete `DebugTest.scala`. That decision changes the list of files for option (a).
mph closed this issue 2026-10-10 19:25:47 +00:00
Owner

Let’s drop this for now

Let’s drop this for now
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#630
No description provided.