@lifeaitools/rdc-skills 0.24.3 → 0.24.4
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.
package/git-sha.json
CHANGED
package/package.json
CHANGED
|
@@ -126,22 +126,31 @@ function runHook(payload, extraEnv = {}) {
|
|
|
126
126
|
|
|
127
127
|
// ---------------------------------------------------------------------------
|
|
128
128
|
// 4. PreToolUse legacy behavior preserved (warn-only, never blocks)
|
|
129
|
+
// Uses a fresh temp dir as HOME/USERPROFILE so no fixit.marker is visible
|
|
130
|
+
// regardless of real machine state — makes the warn-path assertion deterministic.
|
|
129
131
|
// ---------------------------------------------------------------------------
|
|
130
132
|
{
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
tool_input: { command: 'git commit -m "no convention and no uuid"' },
|
|
135
|
-
});
|
|
136
|
-
assert('pre: warn exits zero (never blocks)', res.status === 0, res.stderr);
|
|
137
|
-
assert('pre: emits warn systemMessage', /no work item reference/.test(res.stdout), res.stdout);
|
|
133
|
+
const fakeHome = mkdtempSync(join(tmpdir(), 'wic-home-'));
|
|
134
|
+
try {
|
|
135
|
+
const preEnv = { HOME: fakeHome, USERPROFILE: fakeHome };
|
|
138
136
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
137
|
+
const res = runHook({
|
|
138
|
+
hook_event_name: 'PreToolUse',
|
|
139
|
+
tool_name: 'Bash',
|
|
140
|
+
tool_input: { command: 'git commit -m "no convention and no uuid"' },
|
|
141
|
+
}, preEnv);
|
|
142
|
+
assert('pre: warn exits zero (never blocks)', res.status === 0, res.stderr);
|
|
143
|
+
assert('pre: emits warn systemMessage', /no work item reference/.test(res.stdout), res.stdout);
|
|
144
|
+
|
|
145
|
+
const ok = runHook({
|
|
146
|
+
hook_event_name: 'PreToolUse',
|
|
147
|
+
tool_name: 'Bash',
|
|
148
|
+
tool_input: { command: 'git commit -m "feat(x): conventional"' },
|
|
149
|
+
}, preEnv);
|
|
150
|
+
assert('pre: conventional passes silently', ok.status === 0 && ok.stdout.trim() === '', ok.stdout);
|
|
151
|
+
} finally {
|
|
152
|
+
rmSync(fakeHome, { recursive: true, force: true });
|
|
153
|
+
}
|
|
145
154
|
}
|
|
146
155
|
|
|
147
156
|
// ---------------------------------------------------------------------------
|