@rafinery/cli 0.8.8 → 0.8.11
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.
|
@@ -26,12 +26,26 @@ try {
|
|
|
26
26
|
if (process.env.RAFA_HOOKS_DISABLED === "1") process.exit(0);
|
|
27
27
|
if (process.argv[4] !== "1") process.exit(0);
|
|
28
28
|
if (!existsSync(join(ROOT, "rafa.json"))) process.exit(0);
|
|
29
|
-
if (!existsSync(join(ROOT, ".rafa", ".git"))) process.exit(0);
|
|
30
29
|
|
|
31
30
|
const sh = (cmd, cwd = ROOT, timeout) =>
|
|
32
31
|
execSync(cmd, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], ...(timeout ? { timeout } : {}) }).trim();
|
|
33
32
|
const shR = (cmd, timeout) => sh(cmd, join(ROOT, ".rafa"), timeout);
|
|
34
33
|
|
|
34
|
+
// SELF-HEAL (owner 2026-07-23): a repo with rafa.json but no materialized .rafa
|
|
35
|
+
// instance must still mirror — "clone → just works" means the FIRST branch checkout
|
|
36
|
+
// bootstraps the lazy .rafa itself (same npx precedent as the pre-push checkpoint
|
|
37
|
+
// hook), bounded so a checkout can never hang. A bootstrap failure degrades to the
|
|
38
|
+
// old silent no-op — a checkout must never break.
|
|
39
|
+
if (!existsSync(join(ROOT, ".rafa", ".git"))) {
|
|
40
|
+
try {
|
|
41
|
+
console.error("rafa · no local .rafa instance — bootstrapping (one-time) …");
|
|
42
|
+
sh("npx -y @rafinery/cli pull", ROOT, 90000);
|
|
43
|
+
} catch {
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
if (!existsSync(join(ROOT, ".rafa", ".git"))) process.exit(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
35
49
|
const branch = sh("git rev-parse --abbrev-ref HEAD");
|
|
36
50
|
if (branch === "HEAD") process.exit(0); // detached — no mirror
|
|
37
51
|
if (!/^[A-Za-z0-9._/-]+$/.test(branch)) process.exit(0);
|
package/lib/releases.mjs
CHANGED
|
@@ -245,6 +245,25 @@ export const RELEASES = [
|
|
|
245
245
|
"sha and mints the node (brain ↔ code). Merges need NOT be PR-driven: a plain " +
|
|
246
246
|
"`git merge` + push to main reconciles too. `rafa update` re-vendors the scan SOP.",
|
|
247
247
|
},
|
|
248
|
+
{
|
|
249
|
+
version: "0.8.11",
|
|
250
|
+
contract: 1,
|
|
251
|
+
plans: 2,
|
|
252
|
+
requires: "update",
|
|
253
|
+
summary:
|
|
254
|
+
"(0.8.7/0.8.9 were unusable publishes — npm shipped the `workspace:*` dep " +
|
|
255
|
+
"literally; all unpublished — a prepublishOnly guard now BLOCKS npm publish outright.) " +
|
|
256
|
+
"FRESH-SLATE BRANCH MIRRORING: a NEW code branch's brain-mirror branch is cut " +
|
|
257
|
+
"FROM THE REMOTE TRUNK (the published org brain; fetched fresh, offline-safe " +
|
|
258
|
+
"fallback ladder) — never from whatever branch the local .rafa mirror sat on. " +
|
|
259
|
+
"No session leftovers cross branches, local-vs-remote drift can't leak into a " +
|
|
260
|
+
"new branch, and the branch's diff vs trunk stays exactly what the branch " +
|
|
261
|
+
"captured. Switching TO the trunk ff-freshens it from remote (divergence stays " +
|
|
262
|
+
"loud — `rafa pull --full --force` is the explicit adopt). SELF-HEAL: a repo " +
|
|
263
|
+
"with rafa.json but no materialized .rafa bootstraps it automatically on the " +
|
|
264
|
+
"first branch checkout (bounded; a failure never breaks the checkout). " +
|
|
265
|
+
"`rafa update` re-vendors the post-checkout hook.",
|
|
266
|
+
},
|
|
248
267
|
];
|
|
249
268
|
|
|
250
269
|
// The release this CLI build ships (last entry).
|
package/package.json
CHANGED