@ericrisco/rsc 2.0.12 → 2.0.13

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/manifest.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.12",
2
+ "version": "2.0.13",
3
3
  "counts": {
4
4
  "skills": 273,
5
5
  "agents": 33,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ericrisco/rsc",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "description": "A guided harness builder that turns your goal into a minimal, verified AI-agent setup using strict best practices.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -64,5 +64,27 @@
64
64
  },
65
65
  "publishConfig": {
66
66
  "access": "public"
67
- }
67
+ },
68
+ "rscFixes": [
69
+ {
70
+ "fixedIn": "2.0.6",
71
+ "symptom": "A guard your team disarmed (.rsc/.no-gitmoji and similar) comes back armed after cloning the repo"
72
+ },
73
+ {
74
+ "fixedIn": "2.0.8",
75
+ "symptom": "rsc doctor reports commandOrphans for skills that are installed, and rsc capabilities shows no skills (macOS/Linux)"
76
+ },
77
+ {
78
+ "fixedIn": "2.0.10",
79
+ "symptom": "onboard fails with RSC_ONBOARDING_INCOMPLETE: installed agents differ from accepted policy (antigravity, windsurf, cline, roo, continue, amp, jules, zed, aider)"
80
+ },
81
+ {
82
+ "fixedIn": "2.0.11",
83
+ "symptom": "Stop or PreCompact hook error: Hook JSON output validation failed, and a 'consider compacting' notice repeating after every turn"
84
+ },
85
+ {
86
+ "fixedIn": "2.0.12",
87
+ "symptom": "Security: session continuation context could come from a different git worktree"
88
+ }
89
+ ]
68
90
  }
package/scripts/doctor.js CHANGED
@@ -18,6 +18,7 @@ import { inspectMemoryWiring } from '../targets/memory.js';
18
18
  import { metricsSummary } from '../targets/session-memory-core.mjs';
19
19
  import { agentPath } from '../targets/agents.js';
20
20
  import { projectOptOuts } from '../targets/opt-outs.js';
21
+ import { versionReport } from './lib/versions.js';
21
22
 
22
23
  // Gates the committed manifest says the team disarmed, still armed here. Read through the same
23
24
  // partition the installer uses, so a machine-only switch somebody's older rsc wrote into the
@@ -238,6 +239,9 @@ export function doctor({ target, home, cwd }) {
238
239
  // never rewrites somebody's machine — so the only thing owed is saying it out loud, and
239
240
  // saying it every run, because a notice offered once per session is a notice missed.
240
241
  optOutsNotApplied: optOutsNotApplied(root),
242
+ // First thing to read on any bug report: a project behind its CLI runs old hooks, and "it is
243
+ // already fixed" only helps once the fix is in `.rsc/`.
244
+ versions: versionReport(root),
241
245
  // Counted, never interpreted — by spec, the gap log's reader is the user.
242
246
  automationGaps: countGaps(root),
243
247
  memory,
@@ -0,0 +1,31 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { join, dirname } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ // Which rsc is running, and which rsc this project was last built with. Two different numbers, and
6
+ // the gap between them is where a published fix fails to arrive: hooks are materialized as copies
7
+ // under `.rsc/`, so a release changes nothing in a project until someone syncs it. Nobody could see
8
+ // that gap before — there was no `--version`, and bug reports arrived without one.
9
+
10
+ const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
11
+ export const CLI_VERSION = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8')).version;
12
+
13
+ /** `.rsc/.version` is written at install and at every sync — the version this project's hooks came from. */
14
+ export function installedVersion(root) {
15
+ try { return readFileSync(join(root, '.rsc', '.version'), 'utf8').trim() || null; } catch { return null; }
16
+ }
17
+
18
+ export function isNewer(a, b) {
19
+ const pa = String(a).split('.').map(Number);
20
+ const pb = String(b).split('.').map(Number);
21
+ for (let i = 0; i < 3; i++) {
22
+ if ((pa[i] || 0) > (pb[i] || 0)) return true;
23
+ if ((pa[i] || 0) < (pb[i] || 0)) return false;
24
+ }
25
+ return false;
26
+ }
27
+
28
+ export function versionReport(root) {
29
+ const installed = installedVersion(root);
30
+ return { cli: CLI_VERSION, installed, behind: Boolean(installed && isNewer(CLI_VERSION, installed)) };
31
+ }
package/scripts/rsc.js CHANGED
@@ -16,6 +16,7 @@ import { runUpgrade } from './lib/upgrade.js';
16
16
  import { diagnose, repair } from './lib/repair.js';
17
17
  import { DEFAULT_SKILL_FLOOR, withDefaultSkillFloor } from './lib/default-skill-floor.js';
18
18
  import { readManifest, writeManifest } from './lib/manifest-file.js';
19
+ import { versionReport } from './lib/versions.js';
19
20
  import {
20
21
  normalizeOnboarding, missingOnboardingFields, scanProject,
21
22
  buildOnboardingPlan, decodeGoal, encodeGoal, identifyPlan, recommendDeferredComponents,
@@ -23,6 +24,20 @@ import {
23
24
  import { applyAcceptedOnboarding, verifyOnboarding, ensureHarnessSkeleton, harnessReadiness } from './lib/onboarding-apply.js';
24
25
 
25
26
  const rawArgv = process.argv.slice(2);
27
+
28
+ // `rsc --version` — answered before anything else runs, offline, and in a shape a bug report can
29
+ // paste. Two numbers because there are two things: the CLI you just ran, and the harness this
30
+ // project was built with. When they differ the project is running old hooks, and a fix that was
31
+ // published may simply not be here yet.
32
+ if (['--version', '-v', 'version'].includes(rawArgv[0])) {
33
+ const v = versionReport(process.cwd());
34
+ const lines = [`rsc ${v.cli}`];
35
+ if (v.installed) lines.push(`installed in this project: ${v.installed}${v.behind ? ' (behind)' : ''}`);
36
+ else lines.push('installed in this project: none');
37
+ if (v.behind) lines.push('This project runs older hooks than this CLI. To catch up, run here:', ' npx @ericrisco/rsc@latest');
38
+ process.stdout.write(`${lines.join('\n')}\n`);
39
+ process.exit(0);
40
+ }
26
41
  const GLOBAL_VALUE_FLAGS = new Set([
27
42
  '--target', '--technical-level', '--accompaniment', '--project-kind', '--goal', '--goal-base64', '--software-scope', '--accept-plan',
28
43
  ]);
@@ -266,19 +266,58 @@ function isNewer(a, b) {
266
266
  return false;
267
267
  }
268
268
 
269
+ // "rsc X is out" was being ignored — the maintainer's own workspace sat on 2.0.4 for days with this
270
+ // notice on every session, and two people in two days reported bugs that were already fixed. A
271
+ // version number names nothing anyone recognises. A symptom does: someone who sees a red error after
272
+ // every turn updates the moment they are told that is what the update fixes (`suggest` §3: say what
273
+ // is wrong as a symptom, not as a cause).
274
+ //
275
+ // The symptoms travel for free: the registry's `/latest` document is the published package.json, so
276
+ // its `rscFixes` field — `{ fixedIn, symptom }` — arrives in the response this check already makes.
277
+ // It is text a model will read, so every entry is reduced to one short plain line or dropped.
278
+ const SEMVER_ONLY = /^\d+\.\d+\.\d+$/;
279
+ function fixesSince(list, installed, latest) {
280
+ if (!Array.isArray(list)) return [];
281
+ const out = [];
282
+ for (const item of list) {
283
+ if (!item || typeof item !== 'object' || typeof item.symptom !== 'string') continue;
284
+ if (!SEMVER_ONLY.test(String(item.fixedIn))) continue;
285
+ if (!isNewer(item.fixedIn, installed) || isNewer(item.fixedIn, latest)) continue;
286
+ const symptom = item.symptom.replace(/[\u0000-\u001f\u007f]+/g, ' ').replace(/\s+/g, ' ').trim().slice(0, 200);
287
+ if (symptom) out.push({ fixedIn: item.fixedIn, symptom });
288
+ }
289
+ return out.slice(0, 8);
290
+ }
291
+
269
292
  if (!process.env.RSC_NO_UPDATE_CHECK) {
270
293
  try {
271
294
  const installed = readFileSync(join(root, '.rsc', '.version'), 'utf8').trim();
272
- let latest = process.env.RSC_LATEST;
273
- if (!latest) {
295
+ let doc = null;
296
+ if (process.env.RSC_LATEST_JSON) doc = JSON.parse(process.env.RSC_LATEST_JSON);
297
+ else if (process.env.RSC_LATEST) doc = { version: process.env.RSC_LATEST };
298
+ else {
274
299
  const ctrl = new AbortController();
275
300
  const timer = setTimeout(() => ctrl.abort(), 1500);
276
301
  const res = await fetch('https://registry.npmjs.org/@ericrisco%2frsc/latest', { signal: ctrl.signal });
277
302
  clearTimeout(timer);
278
- latest = (await res.json()).version;
303
+ doc = await res.json();
279
304
  }
305
+ const latest = doc?.version;
280
306
  if (installed && latest && isNewer(latest, installed)) {
281
- process.stdout.write(`
307
+ let fixes = [];
308
+ try { fixes = fixesSince(doc.rscFixes, installed, latest); } catch { fixes = []; }
309
+ if (fixes.length) {
310
+ process.stdout.write(`
311
+ ===== rsc update available =====
312
+ rsc ${latest} is out — you have ${installed}. It fixes problems this install still has:
313
+ ${fixes.map((f) => ` - ${f.symptom} (fixed in ${f.fixedIn})`).join('\n')}
314
+ ACTION: before starting the task, tell the user in one line that the update fixes what they
315
+ may be seeing, and if they say yes, run it in this project:
316
+ npx @ericrisco/rsc@latest
317
+ ================================
318
+ `);
319
+ } else {
320
+ process.stdout.write(`
282
321
  ===== rsc update available =====
283
322
  rsc ${latest} is out — you have ${installed}.
284
323
  ACTION: tell the user a new version is available and, if they say yes, run:
@@ -286,6 +325,7 @@ ACTION: tell the user a new version is available and, if they say yes, run:
286
325
  (That reinstalls and refreshes the skill content to the latest.)
287
326
  ================================
288
327
  `);
328
+ }
289
329
  }
290
330
  } catch { /* offline / no baseline / parse error → stay silent */ }
291
331
  }