Skip to content

investigation(test): classify the 76 prose-gate test files — execute, checksum or keep — with the command each execute-class gate should run #1511

Closed

Description

@admarble

Epic: graph-2026-10-fundamentals Tier: judgment Execution: sequant_run Blocked by: #1502

Problem

76 test files (30,461 lines) read a SKILL.md and assert on its text with toContain/toMatch. Google's testing guidance calls this shape a change detector: a transformation of the same information as the thing under test, breaking on any edit without checking behaviour. But skills are the product here, so the distinction is in how a gate is written. PR #1290 extracts the grep pattern from the skill and runs real grep on sample names — that tests the prose. A phrase-presence assertion is a checksum. This node reads every file and writes the table F-12 acts on. It changes no test.

Classes:

  • execute — the skill section names a command or pattern the test can run (the fix(#1276): /qa §6i counts changed CI workflow files as gate-test files #1290 pattern); the row names the command.
  • checksum — the assertion checks that wording is present and nothing else; deletable under D-3's default.
  • keep — the assertion guards a contract another tool parses (e.g. lint:skill-gates exact phrases, Evidence: grammar, SEQUANT_MUTATION marker); stays as is.

Acceptance Criteria

  • AC-1: Every prose-gate file has a row. Evidence: test -f docs/internal/graph-2026-10-fundamentals/prose-gates.md && echo "rows=$(grep -cE '^\| (src|scripts|__tests__)/' docs/internal/graph-2026-10-fundamentals/prose-gates.md) files=$(npx tsx scripts/qa/health-report.ts --json | jq .proseGate.files)" → rows=N files=N with the same N
  • AC-2: Every row has a class. Evidence: grep -E '^\| (src|scripts|__tests__)/' docs/internal/graph-2026-10-fundamentals/prose-gates.md | grep -vcE '\| (execute|checksum|keep) \|' → 0
  • AC-3: Every execute row names a command. Evidence: grep -E '^\| (src|scripts|__tests__)/.*\| execute \|' docs/internal/graph-2026-10-fundamentals/prose-gates.md | grep -vc '\'→0`
  • AC-4: Totals are stated for F-12. Evidence: grep -cE '^\*\*Totals:\*\* execute [0-9]+, checksum [0-9]+, keep [0-9]+' docs/internal/graph-2026-10-fundamentals/prose-gates.md → 1
  • AC-5: Self-agreement is reported (human-read metric rule). Evidence: grep -cE '^\*\*Re-read:\*\* [0-9]+ of 8 rows agreed' docs/internal/graph-2026-10-fundamentals/prose-gates.md → 1 (eight rows re-classified blind at the end; the number is reported, not gated)

Prior fixes / producers

May touch

docs/internal/graph-2026-10-fundamentals/prose-gates.md (new). Nothing else.

Non-Goals

  • Editing or deleting any test (F-12).
  • Deciding D-3; the table informs it.
  • No edits under plugin/, .claude/skills/, templates/skills/ (I-1).

Done when

The table exists with one classified row per prose-gate file, totals, and a self-agreement line.

Activity

  1. added
    graph-2026-10-fundamentals
    on Oct 18, 2026
  2. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    Runner context, 2026-10-19, before launch (fundamentals W1; judgment tier, all phases on Opus; stop-at-PR). main = ec9d583.

    Docs-only output (prose-gates.md). No code changes expected.

    For every phase, and the qa phase by name: run the full suite at most once, in the foreground, under timeout, after a WIP commit. Each MCP-dispatched phase has a 30-minute wall, and this wave runs 7 issues at once. Prefer the targeted npx vitest run <files> for the ACs.
    CHANGELOG: add [Unreleased] lines, not changelog.d/ fragments. #1370 has not merged.
    Freeze: nothing under plugin/, .claude/skills/ or templates/skills/.
    Health baseline: if this PR changes a measured metric, regenerate scripts/qa/health-baseline.json with npx tsx scripts/qa/health-report.ts --write-baseline after the last source change. Never hand-edit it. npm run lint:health must print "no metric rose".

  3. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (5 ACs, 1 directory)

    AC Quality Check

    • All 5 ACs are single-line and have a command-shaped Evidence: clause. ✅
    • Vacuity check against main (ec9d583): prose-gates.md does not exist yet, so every evidence command fails today. None is vacuous. ✅
    • proseGate.files = 76 at HEAD. All 76 paths start with src/ (63), scripts/ (8) or __tests__/ (5), so the AC-1 row regex can reach every one. ✅
    • ⚠️ AC-1 counts any line that starts | src/, | scripts/ or | __tests__/. If the re-read table (AC-5) or any other table in the doc starts its rows with a path, those rows inflate rows= and AC-1 fails. Re-read rows must start with a different column (for example | 1 | src/… |).
    • ⚠️ AC-2 / AC-3 pin the cell shape. The class cell must be exactly | execute |, | checksum | or | keep |, with single spaces and no bold or code formatting. An execute row passes AC-3 only if it contains a backtick, so the command goes in backticks.
    • AC-5 reports the self-agreement number without gating it, which is correct for a human-read metric. The rubric must be written down before the first-pass classification. Otherwise the re-read just measures memory.

    Scope Assessment

    Non-Goals: present (no test edits, D-3 not decided here, no edits under plugin/, .claude/skills/ or templates/skills/).

    Metric Value Status
    Feature count 1 (one table document) ✅
    AC items 5 ✅
    Directory spread 1 (docs/internal/graph-2026-10-fundamentals/) ✅

    Verdict: ✅ SCOPE_OK. The reading load is large: 76 files, 30,693 lines (the issue says 30,461; it has grown since filing). The largest are phase-executor.test.ts (3,181), doctor.test.ts (1,791) and sync.test.ts (1,701). This is a time risk, not a scope risk. See the plan.


    Acceptance Criteria

    AC-1: Every prose-gate file has a row

    Verification: Manual Test (run the shell command)
    Scenario: Given the doc on the branch → When the AC-1 command runs → Then it prints rows=76 files=76.
    Assumptions: No test file is added or removed on main before merge. If one is, proseGate.files changes, so re-derive the list right before the PR.

    AC-2: Every row has a class

    Verification: Manual Test (grep)
    Scenario: Given 76 path rows → When the AC-2 grep runs → Then it prints 0.

    AC-3: Every execute row names a command

    Verification: Manual Test (grep)
    Scenario: Given the execute rows → When the AC-3 grep runs → Then it prints 0. Each command is one the test could actually run against the skill section, in the #1290 shape: extract a pattern or command from the prose and run it on sample input.

    AC-4: Totals are stated for F-12 (#1512)

    Verification: Manual Test (grep)
    Scenario: Given the doc → When grepped → Then it has exactly one line **Totals:** execute A, checksum B, keep C with A+B+C = 76. The regex anchors only the prefix, so text can follow, such as a false-positive sub-count.

    AC-5: Self-agreement is reported

    Verification: Manual Test (grep)
    Scenario: Given the first pass is complete → When 8 rows are re-classified blind → Then the doc has **Re-read:** K of 8 rows agreed and names each disagreement.


    Implementation Plan

    Phase 1: Rubric and file list (before reading any test)

    1. Create docs/internal/graph-2026-10-fundamentals/prose-gates.md with a Method section:
      • the selection rule: SKILL.md appears in the file and toContain|toMatch appears in the file, the same heuristic as scripts/qa/health-report.ts:223, plus the HEAD SHA
      • the three class definitions copied from the issue
      • the mixed-file precedence rule (OQ-1)
      • the false-positive rule (OQ-2)
    2. Produce the 76 paths from the same heuristic (git ls-files over *.test.ts/*.spec.ts) and check the count against npx tsx scripts/qa/health-report.ts --json | jq .proseGate.files.

    Phase 2: Classification (the bulk of the work)

    1. Classify every file. The 30 k lines will not fit in one serial read under the 30-minute MCP wall, so split the list into 4 batches of about 19 files, balanced by line count. Hand each batch to a parallel subagent with only the rubric. Each agent returns one row per file: | path | class | command-or-reason |, plus the assertion lines (file:line) the class rests on. Commit a WIP after each batch lands (MCP 30-minute watchdog).
    2. Merge the batches into the main table and sort by path. For execute rows, the third column names the runnable command in backticks, e.g. extract the glob from `### Phase Detection` and run `grep -o '{[^}]*}'` on sample comments. For keep rows, name the parser or tool the wording feeds (lint:skill-gates, ac-parser Evidence:, SEQUANT_MUTATION, /qa §6i). For checksum rows, name the asserted phrase or phrases.

    Phase 3: Totals, re-read, findings

    1. Add the **Totals:** execute A, checksum B, keep C line, with the false-positive sub-count after it.
    2. Re-read: pick 8 rows with a recorded, reproducible selection (for example the first 8 paths by sha1(path) order) that include at least 1 row of each class. Re-classify them in a fresh subagent that gets only the rubric and the 8 paths, never the first-pass table. Record **Re-read:** K of 8 rows agreed, then a small table whose rows start with an index column (see the AC-1 note) and give the reason for each disagreement.
    3. Add a short Findings for test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 / D-3 section: the false-positive count (OQ-2), any file whose checksum assertions are the only coverage of a skill section that a live parser reads, and the files with the most execute candidates.
    4. Run the five evidence commands and paste their output into the PR body. No test changes. npm run lint:health should still print "no metric rose" (docs only). No CHANGELOG line: this is an internal investigation doc, and "May touch" names only this file.

    Design Review

    1. Where does this logic belong? A docs-only artifact in docs/internal/graph-2026-10-fundamentals/, owned by investigation(test): classify the 76 prose-gate test files — execute, checksum or keep — with the command each execute-class gate should run #1511 and read by test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 (issue-graph §artifact walk). No code changes. health-report.ts stays untouched even where the doc finds it over-counts (OQ-2). Any such finding is recorded for a follow-up.
    2. What's the simplest correct approach? One markdown table with a row per file and a class per file. Rejected: one row per assertion. It would be more precise, but it breaks the AC-1 row = file equality and multiplies the reading cost. Per-file precedence plus a short reason column captures what test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 needs.
    3. What existing pattern does this follow, and how often has it been re-patched? It follows the fix(#1276): /qa §6i counts changed CI workflow files as gate-test files #1290 execute-pattern gate (the target shape) and the human-read-metric rule (rubric plus blind self-agreement). The prior work on this class is investigation(qa): section leave-one-out ablation of /qa SKILL.md — which of 3,754 lines are load-bearing, measured on the seeded-defect fixture #1068 (leave-one-out ablation, open) and fix(#1276): /qa §6i counts changed CI workflow files as gate-test files #1290. This node only measures and fixes nothing, so the recurrence count has nothing to re-patch. The class is tracked in investigation(qa): section leave-one-out ablation of /qa SKILL.md — which of 3,754 lines are load-bearing, measured on the seeded-defect fixture #1068 / test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512.
    4. What would a senior reviewer challenge?
      • "Your 76 includes files that don't read a skill at all." It does. A rough check finds about 15 files where SKILL.md appears only as a path string in a fixture or error message, e.g. phase-executor.test.ts:2709 asserts on an error string containing .claude/skills/spec/SKILL.md. Others include doctor.test.ts, update.test.ts, merge-check.test.ts, opencode.test.ts and checkout-lock.test.ts. AC-1 forces a row for each one, and AC-2 forces one of the three classes. See OQ-2.
      • "How is a mixed file classed?" See OQ-1. Without a rule, test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 could delete a keep assertion that sits in a mostly-checksum file.
      • "A blind re-read by the same agent in the same context is not blind." That is why it runs in a fresh subagent.
    5. Producers and consumers of the artifact. Producer: this issue only. Consumers: test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 (convert or delete per D-3) and the D-3 owner decision. The 76 count comes from one producer, collectMetrics in scripts/qa/health-report.ts:212-227, which AC-1 reads. The doc's file list must come from the same heuristic, so there is one producer and no parity concern.

    No design choice between rival implementations, so no ADR.


    Feature Quality Planning

    All standard checks pass. Notable items:


    Open Questions

    1. Mixed files: which class does a file with assertions of more than one class get? Recommendation: precedence keep > execute > checksum, and the reason cell gives approximate counts, e.g. keep (SEQUANT_MUTATION marker); also ~6 checksum phrases. Impact if wrong: a plain checksum label on a mixed file invites test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 to delete a parser-contract assertion.
    2. Metric false positives (about 15 of 76 never read skill prose): which class? The issue allows only three classes. Recommendation: class them keep, since F-12 should leave them alone, with reason not a prose gate: SKILL.md appears only as a path/fixture string. Report them separately after the totals, e.g. **Totals:** execute A, checksum B, keep C (of which F not prose gates), and record the over-count as a finding against health-report.ts. Do not fix the metric here. Impact if wrong: if the owner wants a fourth class, AC-2's regex must change first. That is an AC edit, not an exec decision.
    3. Should the execute command be a full shell line or a description plus the key command? Recommendation: a one-line description with the key command in backticks, as in fix(#1276): /qa §6i counts changed CI workflow files as gate-test files #1290. test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 writes the real test. Impact: low.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Docs-only investigation with grep-checked ACs. testgen has no code to stub, and there is no UI. The risk is reading volume and classification consistency, which the rubric, parallel batches and blind re-read cover. QA should spot-check about 5 rows against the files themselves, not just run the greps.


    Label Review

    Current: graph-2026-10-fundamentals
    Recommended: + docs, + planned
    Reason: The only output is a docs file.
    Quality Loop: Won't auto-enable (SCOPE_OK, 5 ACs).

  4. added
    planned
    on Oct 19, 2026
  5. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    Correction to the runner context above (health baseline), 2026-10-19:

    • Regenerate scripts/qa/health-baseline.json only to record a metric that went down.
    • If npm run lint:health reports a metric rose (for example functions.longest.lines or emptyCatch.total), do not regenerate to make it pass. Restructure so the metric holds: put new logic in a new small function instead of growing an existing long one.
    • If holding it is impossible, leave the baseline unchanged and name the rise in the PR body for the owner.
  6. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    QA Verdict: NEEDS_VERIFICATION

    AC coverage: 5/5 met

    Gaps:

    • Required CI check test still pending; re-run QA once it reports
  7. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    Execution Verification (runner, 2026-10-19), PR #1553, merged as f1ab2b2

    The runner re-ran AC-1..AC-5 verbatim:

    • AC-1: rows=76 files=76
    • AC-2: 0
    • AC-3: 0
    • AC-4: 1
    • AC-5: 1 (7 of 8 agreed)

    CI green. The finding that 34 of the 76 counted files are not prose gates feeds #1512. The owner ruled on 2026-10-19 that proseGate.lines rises of that class are absorbed into the baseline. No issue redefines the metric yet: #1512 converts and deletes gates but keeps the count definition (its AC-1 caps the file count at keep + execute), so path-only files stay counted. (Corrected 2026-10-19: an earlier version of this text said #1512 fixes the metric.)

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

    graph-2026-10-fundamentalsplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions