* feat(#2982): extend no-source-grep lint to catch var-binding readFileSync.includes() The base lint (scripts/lint-no-source-grep.cjs) only catches readFileSync(...).<text-method>() chained directly. The much more common var-binding form escapes it: const src = fs.readFileSync(p, 'utf8'); // 50 lines later if (src.includes('foo')) {} // ← still grep, lint missed it Scan of the test suite found ~141 files using this pattern. Implementation built TDD per #2982 with structured-IR assertions: scripts/lint-no-source-grep-extras.cjs - detectVarBindingViolations(src) — pure detector, two passes: pass 1 collects vars bound from readFileSync, pass 2 finds any <var>.<includes|startsWith|endsWith|match|search>( on those vars. - detectWrappedAssertOkMatch(src) — flags assert.ok(<expr>.match(...)) which escapes the assert.match rule. - VIOLATION enum exposes stable codes for tests to assert on. scripts/lint-no-source-grep.cjs - Wires the new detectors into the existing per-file check; one additional violation row per file with the first 3 sample tokens. tests/bug-2982-lint-var-binding.test.cjs - 13 tests, all assertions on typed VIOLATION enum / structured records. Covers all 5 text-match methods, multi-var, no-bind, string literal (must NOT trigger), wrapped assert.ok(.match), and assert.match (must NOT double-flag). Migration backlog (#2974 expanded scope): - 42 files annotated `// allow-test-rule: source-text-is-the-product` (legitimate — they read .md/.json/.yml files whose deployed text IS the product) - 3 files annotated `// allow-test-rule: pending-migration-to-typed-ir [#2974]` (read .cjs/.js source — clear migration debt) - 95 files annotated `pending-migration-to-typed-ir [#2974]` with `Per-file review may reclassify as source-text-is-the-product during migration` (mixed — manual review under #2974) After this lands the lint reports 0 violations on main; new violations in PRs surface immediately. Closes #2982 Refs #2974 * test(#2982): fix truncated test name per CR The label ended with a bare '(' from a copy-paste mishap. Now reads 'does NOT flag .matchAll(...) — matchAll is not match, so assert.ok(.matchAll(...)) is not flagged'. * chore(#2982): add changeset fragment for PR #2985 * chore(#2982): add changeset fragment for PR #2985
This commit is contained in:
5
.changeset/silly-newts-swim.md
Normal file
5
.changeset/silly-newts-swim.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
type: Added
|
||||
pr: 2982
|
||||
---
|
||||
Extended no-source-grep lint to catch var-binding readFileSync.includes() pattern. Tests now fail when source-grep is hidden behind a parser wrapper. See #2982.
|
||||
5
.changeset/zesty-moles-forage.md
Normal file
5
.changeset/zesty-moles-forage.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
type: Added
|
||||
pr: 2982
|
||||
---
|
||||
Extended no-source-grep lint to catch var-binding readFileSync.includes() pattern. Tests now fail when source-grep is hidden behind a parser wrapper. See #2982.
|
||||
81
scripts/lint-no-source-grep-extras.cjs
Normal file
81
scripts/lint-no-source-grep-extras.cjs
Normal file
@@ -0,0 +1,81 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Extended detector for the no-source-grep rule (#2982).
|
||||
*
|
||||
* The base lint (scripts/lint-no-source-grep.cjs) only catches the
|
||||
* direct-chain form: readFileSync(...).includes(...). The much more common
|
||||
* var-binding form escapes it:
|
||||
*
|
||||
* const src = fs.readFileSync(p, 'utf8');
|
||||
* // ... 50 lines later ...
|
||||
* assert.ok(src.includes('foo')); // ← still source-grep, lint missed it
|
||||
*
|
||||
* This module exposes pure detectors that scan source text and return
|
||||
* structured violation records. The CLI wrapper (in the base lint) calls
|
||||
* these for each test file.
|
||||
*
|
||||
* Tests assert on the typed VIOLATION enum codes, not on prose messages.
|
||||
*/
|
||||
|
||||
const VIOLATION = Object.freeze({
|
||||
VAR_FROM_READFILE_USED_IN_TEXT_MATCH: 'var_from_readfile_used_in_text_match',
|
||||
WRAPPED_ASSERT_OK_MATCH: 'wrapped_assert_ok_match',
|
||||
});
|
||||
|
||||
const TEXT_MATCH_METHODS = ['includes', 'startsWith', 'endsWith', 'match', 'search'];
|
||||
|
||||
/**
|
||||
* Single-pass scanner. Tracks variables bound from a readFileSync call,
|
||||
* then flags any subsequent <var>.<method>( use where method is one of
|
||||
* TEXT_MATCH_METHODS.
|
||||
*/
|
||||
function detectVarBindingViolations(src) {
|
||||
// Pass 1: collect variables bound from readFileSync.
|
||||
// Matches: const|let|var <name> = [fs.]readFileSync(
|
||||
const bindRe = /(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:[A-Za-z_$][\w$.]*\.)?readFileSync\s*\(/g;
|
||||
const boundVars = new Set();
|
||||
let m;
|
||||
while ((m = bindRe.exec(src)) !== null) {
|
||||
boundVars.add(m[1]);
|
||||
}
|
||||
if (boundVars.size === 0) return [];
|
||||
|
||||
// Pass 2: find <var>.<method>( on any bound var.
|
||||
const findings = [];
|
||||
// Build a regex alternation from the bound var names.
|
||||
const alt = [...boundVars].map((v) => v.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|');
|
||||
const useRe = new RegExp(
|
||||
`\\b(${alt})\\s*\\.\\s*(${TEXT_MATCH_METHODS.join('|')})\\s*\\(`,
|
||||
'g',
|
||||
);
|
||||
while ((m = useRe.exec(src)) !== null) {
|
||||
findings.push({
|
||||
kind: VIOLATION.VAR_FROM_READFILE_USED_IN_TEXT_MATCH,
|
||||
variable: m[1],
|
||||
method: m[2],
|
||||
});
|
||||
}
|
||||
return findings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects assert.ok(<expr>.match(/.../)) and assert.ok(<expr>.match(<expr>))
|
||||
* which is the same anti-pattern as assert.match but escapes the simpler
|
||||
* regex used by the base lint.
|
||||
*/
|
||||
function detectWrappedAssertOkMatch(src) {
|
||||
const re = /assert\.ok\s*\(\s*[A-Za-z_$][\w$.]*\.match\s*\(/g;
|
||||
const findings = [];
|
||||
let m;
|
||||
while ((m = re.exec(src)) !== null) {
|
||||
findings.push({ kind: VIOLATION.WRAPPED_ASSERT_OK_MATCH });
|
||||
}
|
||||
return findings;
|
||||
}
|
||||
|
||||
function detectAll(src) {
|
||||
return [...detectVarBindingViolations(src), ...detectWrappedAssertOkMatch(src)];
|
||||
}
|
||||
|
||||
module.exports = { detectVarBindingViolations, detectWrappedAssertOkMatch, detectAll, VIOLATION };
|
||||
@@ -110,6 +110,28 @@ function check(filepath) {
|
||||
}
|
||||
}
|
||||
|
||||
// Patterns F..G (#2982): var-binding readFileSync().<text-method>() and
|
||||
// assert.ok(<expr>.match(...)). These escape the simpler patterns above
|
||||
// because the bind and the use are on different lines or wrapped.
|
||||
const extras = require('./lint-no-source-grep-extras.cjs');
|
||||
const varBindFindings = extras.detectVarBindingViolations(content);
|
||||
if (varBindFindings.length > 0) {
|
||||
const samples = varBindFindings.slice(0, 3)
|
||||
.map((f) => `${f.variable}.${f.method}()`)
|
||||
.join(', ');
|
||||
violations.push({
|
||||
reason: `readFileSync-bound variable used in text-match method: ${samples}${varBindFindings.length > 3 ? `, …+${varBindFindings.length - 3} more` : ''}`,
|
||||
fix: 'Expose typed IR; assert on structured fields. Or // allow-test-rule: <reason>',
|
||||
});
|
||||
}
|
||||
const wrappedFindings = extras.detectWrappedAssertOkMatch(content);
|
||||
if (wrappedFindings.length > 0) {
|
||||
violations.push({
|
||||
reason: `assert.ok(<expr>.match(...)) — escapes assert.match rule (${wrappedFindings.length} occurrence${wrappedFindings.length > 1 ? 's' : ''})`,
|
||||
fix: 'Use assert.equal on a typed field, not regex match on text. Or // allow-test-rule: <reason>',
|
||||
});
|
||||
}
|
||||
|
||||
if (violations.length === 0) return null;
|
||||
return { file: rel, violations };
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD Agent Required Reading Consistency Tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Agent size budget.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD AI Evals Framework Tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Anti-Pattern Enforcement Tests (#1491)
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - Antigravity Install Plumbing
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression guard for #2012: AskUserQuestion is Claude Code-only — non-Claude
|
||||
* runtimes (OpenAI Codex, Gemini, etc.) render it as a markdown code block
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Audit-Fix Command Tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2196
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - autonomous --interactive flag
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - autonomous --to N flag
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression tests for bug #1924: gsd-update silently deletes user-generated files
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression tests for #1967 cache invalidation.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2015: worktree executor creates branch from master
|
||||
* instead of the current feature branch HEAD.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression tests for #2075: gsd-executor worktree merge systematically
|
||||
* deletes prior-wave committed files.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression tests for bug #2136 / #2206
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2388: plan-phase silently renames feature branch
|
||||
* when phase slug has changed since the branch was created.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2396: hardcoded host-level test commands bypass
|
||||
* container-only project Makefiles.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Bug #2399: commit_docs:true is ignored in plan-phase
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Bug #2410 — /gsd:manager background execute-phase Task fails with
|
||||
* "Stream idle timeout" on multi-plan phases.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Bug #2419: gsd-project-researcher agent type not found
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Bug #2421: gsd-planner emits grep-count acceptance gates that count comment text
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2431: quick.md and execute-phase.md worktree teardown
|
||||
* silently accumulates locked worktrees via `2>/dev/null || true`.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for bug #2439
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression tests for fix/2441-sdk-decouple
|
||||
*
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2470.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Bug #2492: Add gates to ensure discuss-phase decisions are translated to
|
||||
* plans (plan-phase, BLOCKING) and verified against shipped artifacts
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2502: insert-phase does not update STATE.md's
|
||||
* next-phase recommendation after inserting a decimal phase.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for bug #2516
|
||||
*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Do not copy this pattern.
|
||||
|
||||
/**
|
||||
* Bug #2524: gsd-sdk query --ws <name> silently ignores the workstream flag.
|
||||
* Tests that --ws is forwarded through the call chain:
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Bugs #2549, #2550, #2552: discuss-phase context bloat and cache invalidation.
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Bug #2559: Stale document references in Research phase
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Regression tests for bug #2661:
|
||||
* `/gsd-execute-phase N --auto` with parallelization: true, use_worktrees: false
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2698: CRLF line endings break agent-block strip regexes
|
||||
*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Regression — issue #2770
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2772: worktree isolation is unconditionally disabled
|
||||
* when `.gitmodules` exists in the repo, even when the plan does not touch
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for bug #2775
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for bug #2784
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Regression test for bug #2808
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #2831: OpenCode @file references contain literal `$HOME`
|
||||
* which OpenCode does not expand — `@$HOME/.config/opencode/...` is resolved
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tests — /gsd-sketch --wrap-up silently no-ops (#2949)
|
||||
*
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
|
||||
/**
|
||||
|
||||
100
tests/bug-2982-lint-var-binding.test.cjs
Normal file
100
tests/bug-2982-lint-var-binding.test.cjs
Normal file
@@ -0,0 +1,100 @@
|
||||
'use strict';
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Do not copy this pattern.
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
|
||||
const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const path = require('node:path');
|
||||
|
||||
const { detectVarBindingViolations, VIOLATION } = require(path.join(__dirname, '..', 'scripts', 'lint-no-source-grep-extras.cjs'));
|
||||
|
||||
// detectVarBindingViolations is pure: takes source text, returns a list of
|
||||
// violation records. Tests assert on the structured records, not on the
|
||||
// detector's prose (per "Prohibited: Raw Text Matching on Test Outputs").
|
||||
|
||||
describe('Bug #2982: var-binding readFileSync.includes() detector', () => {
|
||||
test('VIOLATION enum exposes the documented codes', () => {
|
||||
assert.deepEqual(
|
||||
Object.keys(VIOLATION).sort(),
|
||||
['VAR_FROM_READFILE_USED_IN_TEXT_MATCH', 'WRAPPED_ASSERT_OK_MATCH'].sort(),
|
||||
);
|
||||
});
|
||||
|
||||
test('flags a single var bound from readFileSync then used with .includes() later', () => {
|
||||
const src = [
|
||||
"const x = fs.readFileSync('foo.cjs', 'utf8');",
|
||||
'// some lines later',
|
||||
"if (x.includes('foo')) { /* ... */ }",
|
||||
].join('\n');
|
||||
const findings = detectVarBindingViolations(src);
|
||||
assert.equal(findings.length, 1);
|
||||
assert.equal(findings[0].kind, VIOLATION.VAR_FROM_READFILE_USED_IN_TEXT_MATCH);
|
||||
assert.equal(findings[0].variable, 'x');
|
||||
assert.equal(findings[0].method, 'includes');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Bug #2982: var-binding detector — coverage of methods (#2982)', () => {
|
||||
const { detectVarBindingViolations, VIOLATION } = require(require('node:path').join(__dirname, '..', 'scripts', 'lint-no-source-grep-extras.cjs'));
|
||||
|
||||
for (const method of ['includes', 'startsWith', 'endsWith', 'match', 'search']) {
|
||||
test(`flags <var>.${method}( on a readFileSync-bound variable`, () => {
|
||||
const src = `const c = fs.readFileSync('x.cjs','utf8');\nc.${method}('foo');\n`;
|
||||
const findings = detectVarBindingViolations(src);
|
||||
assert.equal(findings.length, 1);
|
||||
assert.equal(findings[0].method, method);
|
||||
});
|
||||
}
|
||||
|
||||
test('flags multiple violations across multiple variables', () => {
|
||||
const src = [
|
||||
"const a = readFileSync('a.cjs', 'utf8');",
|
||||
"const b = fs.readFileSync('b.cjs');",
|
||||
"if (a.includes('x')) {}",
|
||||
"if (b.startsWith('y')) {}",
|
||||
"a.endsWith('z');",
|
||||
].join('\n');
|
||||
const findings = detectVarBindingViolations(src);
|
||||
assert.equal(findings.length, 3);
|
||||
const byVar = findings.reduce((acc, f) => {
|
||||
acc[f.variable] = (acc[f.variable] || []).concat(f.method);
|
||||
return acc;
|
||||
}, {});
|
||||
assert.deepEqual(byVar.a.sort(), ['endsWith', 'includes']);
|
||||
assert.deepEqual(byVar.b, ['startsWith']);
|
||||
});
|
||||
|
||||
test('does NOT flag .includes() on a variable that was not bound from readFileSync', () => {
|
||||
const src = "const arr = [1, 2, 3];\nif (arr.includes(2)) {}";
|
||||
assert.deepEqual(detectVarBindingViolations(src), []);
|
||||
});
|
||||
|
||||
test('does NOT flag a fresh string literal substring check', () => {
|
||||
const src = "if ('hello world'.includes('world')) {}";
|
||||
assert.deepEqual(detectVarBindingViolations(src), []);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Bug #2982: assert.ok(...match(...)) detector', () => {
|
||||
const { detectWrappedAssertOkMatch, VIOLATION } = require(require('node:path').join(__dirname, '..', 'scripts', 'lint-no-source-grep-extras.cjs'));
|
||||
|
||||
test('flags assert.ok(text.match(/.../)) which escapes assert.match', () => {
|
||||
const src = "assert.ok(text.match(/Failures: \\d+/));";
|
||||
const findings = detectWrappedAssertOkMatch(src);
|
||||
assert.equal(findings.length, 1);
|
||||
assert.equal(findings[0].kind, VIOLATION.WRAPPED_ASSERT_OK_MATCH);
|
||||
});
|
||||
|
||||
test('does NOT flag assert.match itself (covered by base lint)', () => {
|
||||
const src = "assert.match(text, /foo/);";
|
||||
assert.deepEqual(detectWrappedAssertOkMatch(src), []);
|
||||
});
|
||||
|
||||
test('does NOT flag .matchAll(...) — matchAll is not match, so assert.ok(.matchAll(...)) is not flagged', () => {
|
||||
const src = "assert.ok([...text.matchAll(/foo/g)].length > 0);";
|
||||
assert.deepEqual(detectWrappedAssertOkMatch(src), []);
|
||||
});
|
||||
});
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Common Bug Patterns Reference Tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - chain flag preservation in plan-phase
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression test for #1860: detectConfigDir in gsd-check-update.js should
|
||||
* prioritize .claude over .config/opencode so that Claude Code sessions
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* CLAUDE.md generation and new-project workflow tests
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - Claude Skills Migration (#1504)
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression tests for bug #1991
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Tests for code_review_command hook in ship workflow (#1876)
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD Code Review Tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
|
||||
const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - codex-config.cjs
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - Commands
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - Concurrency Safety
|
||||
*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Asserts every exact-match key in config-schema.cjs appears at least once
|
||||
* in docs/CONFIGURATION.md. A key present in the validator but absent from
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - Adaptive Context Enrichment for 1M Models
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - core.cjs
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Cursor CLI Reviewer Tests (#1960)
|
||||
*
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
const { describe, test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for --all flag on /gsd-discuss-phase (#2188)
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - discuss-phase incremental checkpoint saves
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - discuss-phase power user mode
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests — Codebase Drift Detection (#2003)
|
||||
*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for /gsd-edit-phase (#2617)
|
||||
*
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Tests for #2310: plan-phase chunked mode + filesystem fallback.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for #2380 — /gsd-sync-skills cross-runtime skill sync.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for claude_md_assembly "link" mode (#2415).
|
||||
* Verifies that generate-claude-md writes @-references instead of inlined
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for #2430 — LEARNINGS.md consumption loop.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for gsd-new-milestone todo-to-phase linking (#2433).
|
||||
* Verifies the workflow text contains the correct linking and auto-close steps.
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for gsd-health MILESTONES.md drift detection (#2446).
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for ROADMAP wave dependency surfacing (#2447).
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for canonical artifact registry and gsd-health W019 lint (#2448).
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Execute-phase active flag prompt tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Execute-phase worktree shared artifact ownership tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
const { describe, test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Extract-Learnings Command & Workflow Tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Forensics Tests
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - frontmatter CLI integration
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Validates the gates taxonomy reference document (#1715).
|
||||
*
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Tests for `/gsd-settings-advanced` — power-user configuration command (#2528).
|
||||
*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
const { describe, it, test, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - Hermes Agent Skills Migration
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Import Command Tests — import-command.test.cjs
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Ingest Docs Tests — ingest-docs.test.cjs
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Tests for workflow.inline_plan_threshold config key and routing logic (#1979).
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression tests for install process hook copying, permissions, manifest
|
||||
* tracking, uninstall cleanup, and settings.json registration.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
/**
|
||||
* Tests for `--minimal` install profile (#2762).
|
||||
*
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Locks docs/INVENTORY.md's "(N shipped)" headline counts against the
|
||||
* filesystem for each of the six families. INVENTORY.md is the
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* iOS Scaffold Safety Tests (#2023)
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* Regression: issue #2639 — Codex install generated agent TOMLs with stale
|
||||
* Claude-specific references (CLAUDE.md, .claude/skills/, .claudeignore).
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Tools Tests - Kilo Install Plumbing
|
||||
*
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
'use strict';
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Reads .md/.json/.yml product files whose deployed text IS what the
|
||||
// runtime loads — testing text content tests the deployed contract.
|
||||
|
||||
const { describe, test, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// allow-test-rule: pending-migration-to-typed-ir [#2974]
|
||||
// Tracked in #2974 for migration to typed-IR assertions per CONTRIBUTING.md
|
||||
// "Prohibited: Raw Text Matching on Test Outputs". Per-file review may
|
||||
// reclassify some entries as source-text-is-the-product during migration.
|
||||
|
||||
/**
|
||||
* GSD Milestone Summary Tests
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user