tickmarkr 1.90.0 → 1.90.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,9 +17,20 @@ export type DoctorOpts = {
|
|
|
17
17
|
* baseline AND tip-verify on SentioQ's first external run, a class invisible to
|
|
18
18
|
* dogfooding (this repo's own includes are rooted at tests/).
|
|
19
19
|
*
|
|
20
|
+
* Q130s (TRIAL T-OBS-6): the ignore must be <rootDir>-anchored. Jest
|
|
21
|
+
* testPathIgnorePatterns are REGEXES matched against the ABSOLUTE test path; an
|
|
22
|
+
* unanchored "/.tickmarkr/" also matches every suite INSIDE a worktree provisioned at
|
|
23
|
+
* <repo>/.tickmarkr/worktrees.noindex/… — jest discovers nothing there and the whole
|
|
24
|
+
* gate battery fails closed (SentioQ run 2: 10 dispatches, 0 merges). Anchored
|
|
25
|
+
* patterns resolve <rootDir> to the worktree itself and stay inert. Vitest
|
|
26
|
+
* include/exclude globs match root-relative paths, so they cannot self-match, but the
|
|
27
|
+
* prescribed shape is root-anchored anyway.
|
|
28
|
+
*
|
|
20
29
|
* Text-level heuristic, advisory only — never enters health/doctor.json or routing.
|
|
21
|
-
* ponytail: ceilings —
|
|
22
|
-
* variables is judged by its literal text
|
|
30
|
+
* ponytail: ceilings — comments are stripped before judgment, but an include built
|
|
31
|
+
* from variables is still judged by its literal text, and a pattern string containing
|
|
32
|
+
* `//` would be truncated by the line-comment strip. Each costs one advisory row,
|
|
33
|
+
* nothing more.
|
|
23
34
|
*/
|
|
24
35
|
export declare function runnerIgnoreFinding(cwd: string): {
|
|
25
36
|
verdict: "pass" | "warn";
|
|
@@ -22,9 +22,20 @@ const attentionRow = (text) => ` ${statusRow("warn", text)}`;
|
|
|
22
22
|
* baseline AND tip-verify on SentioQ's first external run, a class invisible to
|
|
23
23
|
* dogfooding (this repo's own includes are rooted at tests/).
|
|
24
24
|
*
|
|
25
|
+
* Q130s (TRIAL T-OBS-6): the ignore must be <rootDir>-anchored. Jest
|
|
26
|
+
* testPathIgnorePatterns are REGEXES matched against the ABSOLUTE test path; an
|
|
27
|
+
* unanchored "/.tickmarkr/" also matches every suite INSIDE a worktree provisioned at
|
|
28
|
+
* <repo>/.tickmarkr/worktrees.noindex/… — jest discovers nothing there and the whole
|
|
29
|
+
* gate battery fails closed (SentioQ run 2: 10 dispatches, 0 merges). Anchored
|
|
30
|
+
* patterns resolve <rootDir> to the worktree itself and stay inert. Vitest
|
|
31
|
+
* include/exclude globs match root-relative paths, so they cannot self-match, but the
|
|
32
|
+
* prescribed shape is root-anchored anyway.
|
|
33
|
+
*
|
|
25
34
|
* Text-level heuristic, advisory only — never enters health/doctor.json or routing.
|
|
26
|
-
* ponytail: ceilings —
|
|
27
|
-
* variables is judged by its literal text
|
|
35
|
+
* ponytail: ceilings — comments are stripped before judgment, but an include built
|
|
36
|
+
* from variables is still judged by its literal text, and a pattern string containing
|
|
37
|
+
* `//` would be truncated by the line-comment strip. Each costs one advisory row,
|
|
38
|
+
* nothing more.
|
|
28
39
|
*/
|
|
29
40
|
export function runnerIgnoreFinding(cwd) {
|
|
30
41
|
const readIf = (p) => (existsSync(join(cwd, p)) ? readFileSync(join(cwd, p), "utf8") : "");
|
|
@@ -41,10 +52,23 @@ export function runnerIgnoreFinding(cwd) {
|
|
|
41
52
|
const isVitest = !isJest && (vitestConfig !== undefined || /\bvitest\b/.test(testScript));
|
|
42
53
|
if (!isJest && !isVitest)
|
|
43
54
|
return undefined;
|
|
44
|
-
|
|
55
|
+
// Comments are stripped before judgment: a commented-out ignore must not false-pass,
|
|
56
|
+
// and a prose comment mentioning .tickmarkr must not false-warn the anchor probe.
|
|
57
|
+
const stripComments = (s) => s.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
|
|
58
|
+
const configText = stripComments(isJest
|
|
45
59
|
? `${jestConfig ? readIf(jestConfig) : ""}${pkg.jest ? JSON.stringify(pkg.jest) : ""}`
|
|
46
|
-
: vitestConfig ? readIf(vitestConfig) : "";
|
|
60
|
+
: vitestConfig ? readIf(vitestConfig) : "");
|
|
47
61
|
if (/\.tickmarkr|worktrees\.noindex/.test(configText)) {
|
|
62
|
+
// Q130s self-match probe: erase every <rootDir>-anchored token (through the end of
|
|
63
|
+
// its quoted string); any surviving mention is a pattern that would also match
|
|
64
|
+
// inside a provisioned worktree (jest regex-vs-absolute-path semantics only).
|
|
65
|
+
const unanchored = configText.replace(/<rootDir>[^"'`\s]*/g, "");
|
|
66
|
+
if (isJest && /\.tickmarkr|worktrees\.noindex/.test(unanchored)) {
|
|
67
|
+
return {
|
|
68
|
+
verdict: "warn",
|
|
69
|
+
detail: `jest ignore for .tickmarkr/ is not <rootDir>-anchored — testPathIgnorePatterns are regexes against ABSOLUTE paths, so inside run worktrees (provisioned under .tickmarkr/worktrees.noindex/) it matches EVERY suite and the test gate fails closed; use "<rootDir>/\\\\.tickmarkr/" in ${jestConfig ?? "the package.json jest block"}`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
48
72
|
return { verdict: "pass", detail: `${isJest ? "jest" : "vitest"} config ignores .tickmarkr/ — run worktrees stay out of the suite` };
|
|
49
73
|
}
|
|
50
74
|
// Rooted collection globs never reach .tickmarkr/…; only repo-wide `**/`-style patterns (or
|
|
@@ -54,8 +78,8 @@ export function runnerIgnoreFinding(cwd) {
|
|
|
54
78
|
return { verdict: "pass", detail: `${isJest ? "jest" : "vitest"} collection globs are rooted — run worktrees are not collectable` };
|
|
55
79
|
}
|
|
56
80
|
const remedy = isJest
|
|
57
|
-
? `add "
|
|
58
|
-
: `add "
|
|
81
|
+
? `add "<rootDir>/\\\\.tickmarkr/" to testPathIgnorePatterns in ${jestConfig ?? "the package.json jest block"}`
|
|
82
|
+
: `add ".tickmarkr/**" to test.exclude in ${vitestConfig ?? "a vitest config"}`;
|
|
59
83
|
return {
|
|
60
84
|
verdict: "warn",
|
|
61
85
|
detail: `${isJest ? "jest" : "vitest"} collects repo-wide and will scan .tickmarkr/ run worktrees (duplicate suites, false reds) — ${remedy}`,
|