@lifeaitools/rdc-skills 0.35.17 → 0.35.18

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rdc",
3
- "version": "0.35.17",
3
+ "version": "0.35.18",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code — plan, build, review, overnight unattended builds with work-item tracking and TDD enforcement.",
5
5
  "author": {
6
6
  "name": "LIFEAI",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeaitools/rdc-skills",
3
- "version": "0.35.17",
3
+ "version": "0.35.18",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code - plan, build, review, overnight builds",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -20,6 +20,8 @@
20
20
  import { dirname, join, resolve } from 'node:path';
21
21
  import { fileURLToPath } from 'node:url';
22
22
  import { spawnSync } from 'node:child_process';
23
+ import { mkdtempSync } from 'node:fs';
24
+ import { tmpdir } from 'node:os';
23
25
 
24
26
  const __dirname = dirname(fileURLToPath(import.meta.url));
25
27
  const REPO_ROOT = resolve(__dirname, '..');
@@ -31,10 +33,27 @@ function assert(name, condition, detail = '') {
31
33
  else process.stdout.write(` ok ${name}\n`);
32
34
  }
33
35
 
36
+ /**
37
+ * Every spawn gets an ISOLATED block ledger.
38
+ *
39
+ * This suite deliberately drives blocking fixtures, and the hook now records
40
+ * each refusal through the guard mitigator. Without an override it writes the
41
+ * REAL session ledger under %TEMP%/lifeai-guard-blocks — measured 2026-08-30,
42
+ * which already held this suite's fixtures ("npx playwright test --headed" and
43
+ * friends). A few suite runs cross REPEAT_THRESHOLD, after which a genuine
44
+ * --headed block reports "RULE DEFECT SUSPECTED" against a rule that is working
45
+ * perfectly. Test runs must never be able to discredit a live guard.
46
+ *
47
+ * lifeai-env's own guard tests carry this isolation plus a regression assertion
48
+ * that the live ledger is untouched; these two hooks shipped without either.
49
+ */
50
+ const LEDGER = mkdtempSync(join(tmpdir(), 'fpg-ledger-'));
51
+
34
52
  function runGate(command) {
35
53
  const res = spawnSync(process.execPath, [HOOK], {
36
54
  input: JSON.stringify({ tool_name: 'Bash', tool_input: { command } }),
37
55
  encoding: 'utf8',
56
+ env: { ...process.env, LIFEAI_GUARD_BLOCK_DIR: LEDGER, RDC_TEST: '1' },
38
57
  });
39
58
  const blocked = res.status === 1;
40
59
  return { blocked, stdout: res.stdout, status: res.status };
@@ -66,11 +66,24 @@ function makeRepo() {
66
66
  return { dir, head };
67
67
  }
68
68
 
69
+ /**
70
+ * Isolated block ledger — see the same note in foreground-process-gate.test.mjs.
71
+ *
72
+ * This hook records refusals through the guard mitigator, which keys on
73
+ * (rule id, argv shape) and escalates once a shape repeats. Fixtures that
74
+ * deliberately trigger a refusal would otherwise accumulate in the REAL session
75
+ * ledger under %TEMP%/lifeai-guard-blocks and eventually make a genuine refusal
76
+ * report "RULE DEFECT SUSPECTED" against a rule that is working.
77
+ *
78
+ * extraEnv still wins, so a case can override either value deliberately.
79
+ */
80
+ const LEDGER = mkdtempSync(join(tmpdir(), 'rwi-ledger-'));
81
+
69
82
  function runHook(payload, extraEnv = {}) {
70
83
  return spawnSync(process.execPath, [HOOK], {
71
84
  input: JSON.stringify(payload),
72
85
  encoding: 'utf8',
73
- env: { ...process.env, ...extraEnv },
86
+ env: { ...process.env, LIFEAI_GUARD_BLOCK_DIR: LEDGER, RDC_TEST: '1', ...extraEnv },
74
87
  });
75
88
  }
76
89