ruvnet-brain 4.7.20 → 4.7.22
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/README.md +2 -2
- package/bin/install.mjs +618 -104
- package/console/activity.js +122 -38
- package/kb/download-retry.mjs +93 -21
- package/kb/forge-guard-injection.mjs +277 -0
- package/kb/forge-update.mjs +166 -38
- package/kb/lifecycle-evidence-retention.mjs +151 -14
- package/kb/model-requirements.mjs +4 -1
- package/kb/refresh-run.mjs +175 -27
- package/kb/verify-citation.mjs +15 -2
- package/package.json +3 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/mcp/managed-cli-interface.mjs +16 -8
- package/plugin/scripts/adr-currency-gate.mjs +2 -1
- package/plugin/scripts/advisory-contract.mjs +21 -0
- package/plugin/scripts/advocacy-route.mjs +5 -4
- package/plugin/scripts/agentdb-recall-process.mjs +115 -5
- package/plugin/scripts/agentdb-recall-reader.mjs +44 -2
- package/plugin/scripts/agentdb-recall.mjs +49 -17
- package/plugin/scripts/automatic-update.mjs +9 -1
- package/plugin/scripts/brain-confirmation.mjs +2 -1
- package/plugin/scripts/brain-footprint.mjs +72 -11
- package/plugin/scripts/capability-registry.mjs +1 -1
- package/plugin/scripts/capacity-aware-parallel-work.mjs +2 -1
- package/plugin/scripts/codex-overnight-notice.mjs +33 -0
- package/plugin/scripts/completion-claim-evidence.mjs +241 -23
- package/plugin/scripts/continuation-gate.mjs +75 -11
- package/plugin/scripts/decision-gate.mjs +13 -63
- package/plugin/scripts/decision-outcomes.mjs +36 -0
- package/plugin/scripts/decision-recall-gate.mjs +40 -5
- package/plugin/scripts/decision-record.mjs +8 -3
- package/plugin/scripts/degradation-watch.mjs +2 -1
- package/plugin/scripts/developer-update-lock.mjs +172 -33
- package/plugin/scripts/developer-update-owner.mjs +8 -5
- package/plugin/scripts/developer-update-policy.mjs +4 -1
- package/plugin/scripts/developer-update.mjs +155 -53
- package/plugin/scripts/doc-currency.mjs +2 -16
- package/plugin/scripts/duplicate-gate.mjs +2 -1
- package/plugin/scripts/entrypoint.mjs +34 -0
- package/plugin/scripts/footprint-io.mjs +135 -8
- package/plugin/scripts/grok-hook-adapter.mjs +2 -1
- package/plugin/scripts/ground-ruvnet.sh +6 -3
- package/plugin/scripts/grounding-answer.mjs +2 -1
- package/plugin/scripts/grounding-code-projection.mjs +2 -1
- package/plugin/scripts/grounding-substance.mjs +2 -1
- package/plugin/scripts/grounding-turn-gate.mjs +2 -2
- package/plugin/scripts/grounding-turn-mark.mjs +2 -2
- package/plugin/scripts/hook-context-budget.mjs +2 -1
- package/plugin/scripts/hook-input.mjs +2 -2
- package/plugin/scripts/hook-shim.mjs +9 -2
- package/plugin/scripts/host-update.mjs +29 -5
- package/plugin/scripts/identifier-preflight.mjs +2 -1
- package/plugin/scripts/kb-copy-proof.mjs +57 -9
- package/plugin/scripts/learn-capture.mjs +2 -1
- package/plugin/scripts/learning-store.mjs +62 -16
- package/plugin/scripts/lesson-bridge.mjs +2 -2
- package/plugin/scripts/lesson-gate.mjs +7 -39
- package/plugin/scripts/lesson-promote.mjs +83 -22
- package/plugin/scripts/lesson-scope.mjs +51 -0
- package/plugin/scripts/lesson-store.mjs +1 -1
- package/plugin/scripts/md-stamp.mjs +2 -1
- package/plugin/scripts/native-turn-transcript.mjs +98 -6
- package/plugin/scripts/nightly-scheduler.mjs +10 -5
- package/plugin/scripts/package-recommender.mjs +2 -2
- package/plugin/scripts/project-store-resolver.mjs +19 -0
- package/plugin/scripts/routing-outcome-capture.mjs +2 -1
- package/plugin/scripts/ruflo-bin.mjs +14 -6
- package/plugin/scripts/ruflo-memory-hooks.mjs +157 -19
- package/plugin/scripts/session-snapshot-hook.mjs +25 -5
- package/plugin/scripts/session-start-core.mjs +7 -16
- package/plugin/scripts/session-start-health.mjs +98 -10
- package/plugin/scripts/session-start-issue-alert.mjs +63 -0
- package/plugin/scripts/session-start-update-plane.mjs +15 -1
- package/plugin/scripts/signal-watch.mjs +2 -1
- package/plugin/scripts/spend-guard.mjs +2 -1
- package/plugin/scripts/substitution-wall.mjs +2 -1
- package/plugin/scripts/turn-outcome-capture.mjs +7 -3
- package/plugin/scripts/unprompted-runtime.mjs +20 -3
- package/plugin/scripts/update-apply.mjs +186 -15
- package/plugin/skills/release-proof/scripts/release-proof.mjs +2 -1
- package/plugin/skills/ruvnet-brain/PLAYBOOK.md +2 -2
- package/plugin/skills/ruvnet-brain/SKILL.md +3 -2
- package/scripts/adr-072-completion.mjs +2 -1
- package/scripts/agentdb-context.mjs +2 -1
- package/scripts/agentdb-fleet-doctor.mjs +30 -8
- package/scripts/approved-runtime.mjs +2 -1
- package/scripts/architecture-review-lock.mjs +2 -1
- package/scripts/ascii-drift.mjs +2 -1
- package/scripts/brain-latency-50.mjs +2 -1
- package/scripts/brain-novice-50.mjs +2 -16
- package/scripts/brain-score.mjs +13 -2
- package/scripts/build-bundle.mjs +2 -1
- package/scripts/build-concepts.mjs +2 -1
- package/scripts/candidate-ci-receipt.mjs +2 -1
- package/scripts/candidate-host-evidence.mjs +2 -1
- package/scripts/card-from-source.mjs +2 -1
- package/scripts/ci/warm-brain-models.mjs +2 -1
- package/scripts/claims-verify.mjs +7 -3
- package/scripts/claude-controlled-terminal.mjs +2 -1
- package/scripts/claude-terminal-mod.mjs +2 -1
- package/scripts/code-release-corpus.mjs +2 -1
- package/scripts/codex-boot-surface-proof.mjs +208 -0
- package/scripts/codex-hook-trust-reconcile.mjs +67 -1
- package/scripts/codex-hook-trust.mjs +40 -1
- package/scripts/codex-hook-wrapper-history.mjs +2 -1
- package/scripts/codex-host-execution-proof.mjs +2 -1
- package/scripts/completion-claim-replay.mjs +2 -1
- package/scripts/console-engine.mjs +8 -3
- package/scripts/corpus-canary.mjs +2 -1
- package/scripts/corpus-candidate.mjs +2 -2
- package/scripts/corpus-coverage-sidecar.mjs +2 -1
- package/scripts/corpus-dispatch-decision.mjs +2 -1
- package/scripts/corpus-dispatch-receipt.mjs +2 -1
- package/scripts/corpus-next-seed.mjs +2 -1
- package/scripts/corpus-qa.mjs +2 -1
- package/scripts/corpus-reconcile.mjs +2 -2
- package/scripts/corpus-watchdog.mjs +2 -1
- package/scripts/count-chunks.mjs +2 -1
- package/scripts/customer-state-matrix.mjs +2 -1
- package/scripts/derive-passage-content-map.mjs +2 -1
- package/scripts/development-push-check.mjs +2 -1
- package/scripts/dispatch-receipt.mjs +2 -1
- package/scripts/doc-currency.mjs +2 -1
- package/scripts/dream-issue-gate.mjs +2 -1
- package/scripts/dual-host-deliberation.mjs +2 -16
- package/scripts/dual-host-suggest.mjs +2 -16
- package/scripts/eval-brain.mjs +7 -3
- package/scripts/execution-policy.mjs +2 -1
- package/scripts/execution-preflight.mjs +2 -1
- package/scripts/falsify.mjs +2 -1
- package/scripts/fix-metaharness-memretrieve.mjs +2 -1
- package/scripts/fix-workstream.mjs +2 -1
- package/scripts/full-hints.mjs +2 -1
- package/scripts/full-suite-gate.mjs +2 -1
- package/scripts/grok-host.mjs +68 -0
- package/scripts/hook-qualify-core.mjs +3 -1
- package/scripts/hook-qualify.mjs +2 -1
- package/scripts/hook-retirement-check.mjs +2 -1
- package/scripts/host-registry.mjs +2 -1
- package/scripts/independent-review-receipt.mjs +2 -1
- package/scripts/ingest-new-repos.mjs +2 -1
- package/scripts/ingest-repo.mjs +12 -2
- package/scripts/integration-evidence.mjs +2 -1
- package/scripts/issue-fix.mjs +7 -24
- package/scripts/issue-watch.mjs +116 -40
- package/scripts/job-heartbeat.sh +54 -19
- package/scripts/key-canary.mjs +9 -3
- package/scripts/latency-to-surface.mjs +2 -1
- package/scripts/learning-replay-cli.mjs +97 -19
- package/scripts/learning-replay-execution.mjs +2 -0
- package/scripts/learning-replay-fixture.mjs +3 -0
- package/scripts/learning-replay-proof.mjs +14 -13
- package/scripts/learning-replay.mjs +3 -3
- package/scripts/learnings.mjs +2 -1
- package/scripts/lesson-ratify.mjs +88 -40
- package/scripts/loop-checkpoint.mjs +2 -1
- package/scripts/metaharness-receipts.mjs +2 -1
- package/scripts/model-catalog.mjs +2 -1
- package/scripts/model-currency-evidence.mjs +6 -4
- package/scripts/model-currency.mjs +33 -3
- package/scripts/model-native-catalog.mjs +2 -1
- package/scripts/model-router-agent-hook.mjs +2 -1
- package/scripts/model-router-dispatch.mjs +2 -1
- package/scripts/model-router-engine.mjs +2 -1
- package/scripts/model-router-outcome.mjs +2 -1
- package/scripts/model-router-setup.mjs +2 -1
- package/scripts/model-routing-eval.mjs +2 -1
- package/scripts/model-routing-gateway.mjs +2 -1
- package/scripts/model-routing-launchers.mjs +4 -1
- package/scripts/model-terminal-gateway.mjs +2 -1
- package/scripts/model-terminal-launchers.mjs +2 -1
- package/scripts/model-weekly-analyst.mjs +2 -1
- package/scripts/model-weekly-cycle.mjs +2 -1
- package/scripts/model-weekly-qualification.mjs +2 -1
- package/scripts/nightly-gists.sh +26 -20
- package/scripts/nightly-two-run-proof.mjs +2 -1
- package/scripts/nightly-watchdog.mjs +158 -47
- package/scripts/no-silent-substitution.mjs +2 -1
- package/scripts/notify.sh +11 -6
- package/scripts/ntfy-inbox.mjs +41 -18
- package/scripts/onboarding-console.mjs +123 -23
- package/scripts/oracle/abstain-threshold-sweep.mjs +2 -1
- package/scripts/oracle/abstain-trace.mjs +2 -1
- package/scripts/oracle/doc2query-generate.mjs +2 -1
- package/scripts/oracle/doc2query-reach.mjs +2 -1
- package/scripts/oracle/judge-train.mjs +2 -1
- package/scripts/oracle/need-set-split.mjs +2 -1
- package/scripts/oracle/produce-questions.mjs +2 -16
- package/scripts/oracle/repo-recall.mjs +2 -2
- package/scripts/oracle/retrieval-accuracy.mjs +2 -2
- package/scripts/oracle/sona-query-adapter-eval.mjs +2 -1
- package/scripts/oracle/source-tree.mjs +2 -15
- package/scripts/oracle/source-units.mjs +2 -16
- package/scripts/oracle/spike-run.mjs +2 -16
- package/scripts/oracle/validate-labels.mjs +2 -16
- package/scripts/org-repo-count.mjs +2 -1
- package/scripts/package-cards.mjs +2 -1
- package/scripts/prepublication-evidence.mjs +2 -1
- package/scripts/private-overlay.mjs +2 -1
- package/scripts/product-integrity-contract.mjs +2 -1
- package/scripts/protected-release-invocation.mjs +2 -1
- package/scripts/public-verification-abandon.mjs +2 -1
- package/scripts/public-verification-aggregate.mjs +2 -1
- package/scripts/public-verification-finalizer.mjs +2 -1
- package/scripts/public-verification-inputs.mjs +2 -1
- package/scripts/public-verification-lane.mjs +2 -1
- package/scripts/publication-receipt.mjs +2 -1
- package/scripts/published-surface-probe.mjs +2 -1
- package/scripts/qe/card-lane-gate.mjs +2 -16
- package/scripts/qe/session-start-gate.mjs +2 -16
- package/scripts/qe/ux-suite.mjs +2 -1
- package/scripts/qualified-candidate-check.mjs +2 -1
- package/scripts/rebuild-gists-from-receipts.mjs +2 -1
- package/scripts/recall-latency-probe.mjs +48 -0
- package/scripts/recommendation-eval.mjs +2 -1
- package/scripts/recommendation-floor.mjs +2 -1
- package/scripts/recommendation-judge-score.mjs +2 -1
- package/scripts/recommendation-real-host-score.mjs +2 -1
- package/scripts/recommendation-real-host.mjs +2 -1
- package/scripts/refresh-capability-only-store.mjs +2 -1
- package/scripts/refresh-model-catalog.mjs +2 -1
- package/scripts/rehearse-corpus-pipeline.mjs +2 -1
- package/scripts/release-authority.mjs +2 -1
- package/scripts/release-evidence-aggregate.mjs +2 -1
- package/scripts/release-payload.mjs +2 -1
- package/scripts/release-projection.mjs +2 -1
- package/scripts/release-proof.mjs +2 -1
- package/scripts/release-qualification-contract.mjs +82 -28
- package/scripts/release-qualification.mjs +8 -1
- package/scripts/release-vector.mjs +2 -1
- package/scripts/restore-local-ingests.mjs +2 -1
- package/scripts/retrieval-canary.mjs +2 -1
- package/scripts/route-cheap.mjs +2 -1
- package/scripts/route-gold-rank.mjs +2 -1
- package/scripts/route-index-memory.mjs +2 -1
- package/scripts/route-latency-warm.mjs +2 -1
- package/scripts/router-utilization.mjs +2 -1
- package/scripts/routing-flywheel.mjs +2 -1
- package/scripts/run-operational-benchmark.mjs +2 -1
- package/scripts/run-operational-benchmark.v3.mjs +2 -1
- package/scripts/rvf-index-audit.mjs +2 -16
- package/scripts/seal-gist-receipt.mjs +2 -1
- package/scripts/security-guidance-codex-compat.mjs +2 -1
- package/scripts/selfcheck.mjs +2 -1
- package/scripts/signal-watch.mjs +2 -1
- package/scripts/source-coverage.mjs +2 -1
- package/scripts/stabilization-receipt.mjs +2 -1
- package/scripts/stamp-sweep.mjs +2 -1
- package/scripts/status-honesty.mjs +2 -1
- package/scripts/sync-commands.mjs +2 -2
- package/scripts/top100-benchmark.mjs +2 -1
- package/scripts/top100-corpus.mjs +2 -1
- package/scripts/user-model-hook-install.mjs +2 -1
- package/scripts/user-model-prompt-hook.mjs +2 -1
- package/scripts/verify-bundle.mjs +3 -1
- package/scripts/verify-model-catalog.mjs +2 -1
- package/scripts/version.mjs +2 -1
- package/scripts/wired-check.mjs +13 -5
- package/scripts/worktree-integrity.mjs +2 -2
package/scripts/stamp-sweep.mjs
CHANGED
|
@@ -39,6 +39,7 @@ import path from 'node:path';
|
|
|
39
39
|
import { spawnSync } from 'node:child_process';
|
|
40
40
|
import { fileURLToPath } from 'node:url';
|
|
41
41
|
import { ensureStamp, hasStamp, stampInsertionPoint } from '../plugin/scripts/md-stamp.mjs';
|
|
42
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
42
43
|
|
|
43
44
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
44
45
|
export const REPO_ROOT = path.resolve(HERE, '..');
|
|
@@ -137,7 +138,7 @@ function main() {
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
function isMain() {
|
|
140
|
-
try { return
|
|
141
|
+
try { return isDirectInvocation(import.meta.url); }
|
|
141
142
|
catch { return false; }
|
|
142
143
|
}
|
|
143
144
|
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
import fs from 'node:fs';
|
|
29
29
|
import path from 'node:path';
|
|
30
30
|
import { fileURLToPath } from 'node:url';
|
|
31
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
31
32
|
|
|
32
33
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
33
34
|
|
|
@@ -115,7 +116,7 @@ export function scanRepo(root = ROOT) {
|
|
|
115
116
|
return out;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
if (
|
|
119
|
+
if (isDirectInvocation(import.meta.url)) {
|
|
119
120
|
const bad = scanRepo();
|
|
120
121
|
if (bad.length) {
|
|
121
122
|
console.error('status-honesty: ASSERTED (underived) terminal success literals found:\n');
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
import fs from 'node:fs';
|
|
35
35
|
import path from 'node:path';
|
|
36
36
|
import { fileURLToPath } from 'node:url';
|
|
37
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
37
38
|
|
|
38
39
|
const ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
39
40
|
const DIR = path.join(ROOT, 'plugin', 'commands');
|
|
@@ -76,8 +77,7 @@ function rebuild(aliasText, canonicalFrontmatter, canonicalBody) {
|
|
|
76
77
|
// able to crash the caller that merely imported this module: not-resolvable means not-main.
|
|
77
78
|
function resolvedIsMain() {
|
|
78
79
|
try {
|
|
79
|
-
return
|
|
80
|
-
&& fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
|
|
80
|
+
return isDirectInvocation(import.meta.url);
|
|
81
81
|
} catch { return false; }
|
|
82
82
|
}
|
|
83
83
|
if (!resolvedIsMain()) { /* imported for its exports — do nothing else */ } else {
|
|
@@ -10,6 +10,7 @@ import { performance } from 'node:perf_hooks';
|
|
|
10
10
|
import { createHash } from 'node:crypto';
|
|
11
11
|
import { execFileSync } from 'node:child_process';
|
|
12
12
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
13
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
13
14
|
|
|
14
15
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
16
|
const CORPUS = path.join(ROOT, 'evals', 'top-100.json');
|
|
@@ -476,4 +477,4 @@ Use --out when a durable evidence artifact is intentional; release checks are pu
|
|
|
476
477
|
});
|
|
477
478
|
}
|
|
478
479
|
|
|
479
|
-
if (
|
|
480
|
+
if (isDirectInvocation(import.meta.url)) await main();
|
|
@@ -5,6 +5,7 @@ import path from 'node:path';
|
|
|
5
5
|
import { createHash } from 'node:crypto';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { semanticAssertionsFor } from './top100-semantic-assertions.mjs';
|
|
8
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
8
9
|
|
|
9
10
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
10
11
|
const HELD_OUT = path.join(ROOT, 'evals', 'held-out.json');
|
|
@@ -105,7 +106,7 @@ export function corpusHash(corpus) {
|
|
|
105
106
|
return createHash('sha256').update(JSON.stringify(corpus.questions)).digest('hex');
|
|
106
107
|
}
|
|
107
108
|
|
|
108
|
-
if (
|
|
109
|
+
if (isDirectInvocation(import.meta.url)) {
|
|
109
110
|
const corpus = buildTop100();
|
|
110
111
|
fs.writeFileSync(OUT, JSON.stringify({ ...corpus, sha256: corpusHash(corpus) }, null, 2) + '\n');
|
|
111
112
|
console.log(`${OUT}: ${corpus.questions.length} questions, sha256=${corpusHash(corpus)}`);
|
|
@@ -5,6 +5,7 @@ import path from 'node:path';
|
|
|
5
5
|
import os from 'node:os';
|
|
6
6
|
import crypto from 'node:crypto';
|
|
7
7
|
import { pathToFileURL } from 'node:url';
|
|
8
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
8
9
|
|
|
9
10
|
export function shellQuote(value) { return `'${value.replaceAll("'", "'\\''")}'`; }
|
|
10
11
|
|
|
@@ -134,7 +135,7 @@ export function applyUserModelHooks(plan) {
|
|
|
134
135
|
return { applied: true, written };
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
if (
|
|
138
|
+
if (isDirectInvocation(import.meta.url)) {
|
|
138
139
|
try {
|
|
139
140
|
const args = process.argv.slice(2);
|
|
140
141
|
if (args.some(arg => !['--apply', '--dry-run', '--plan'].includes(arg))) throw new Error('Usage: user-model-hook-install.mjs [--apply|--dry-run|--plan]');
|
|
@@ -8,6 +8,7 @@ import os from 'node:os';
|
|
|
8
8
|
import { spawnSync } from 'node:child_process';
|
|
9
9
|
import { pathToFileURL } from 'node:url';
|
|
10
10
|
import { weeklyCycleStatus } from './model-weekly-cycle.mjs';
|
|
11
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
11
12
|
|
|
12
13
|
export const PRESENTATION = 'For terminal briefings: give concise executive status; use narrow padded ASCII tables with borders, plain cell text, aligned columns and short rows. Never send pipe-delimited Markdown tables to this terminal. Use short lists when a table would wrap. Do not flood the response with commands or technical logs.';
|
|
13
14
|
|
|
@@ -65,6 +66,6 @@ async function main() {
|
|
|
65
66
|
process.stdout.write(JSON.stringify(envelope(promptContext(payload))) + '\n');
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
if (
|
|
69
|
+
if (isDirectInvocation(import.meta.url)) {
|
|
69
70
|
main().catch(() => process.stdout.write(JSON.stringify(envelope(PRESENTATION)) + '\n'));
|
|
70
71
|
}
|
|
@@ -42,7 +42,9 @@ export function verifyBundle(bundlePath, sigPath = `${bundlePath}.sig`, pubPath
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// CLI
|
|
45
|
-
|
|
45
|
+
// Copied ALONE into every brain bundle (scripts/build-bundle.mjs), so it cannot import
|
|
46
|
+
// plugin/scripts/entrypoint.mjs; this is that helper's comparison, inline: real paths on both sides.
|
|
47
|
+
if ((() => { try { return Boolean(process.argv[1]) && fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url)); } catch { return false; } })()) {
|
|
46
48
|
const [bundle, sig] = process.argv.slice(2);
|
|
47
49
|
if (!bundle) { console.error('Usage: node scripts/verify-bundle.mjs <bundle.zip> [<bundle.zip.sig>]'); process.exit(2); }
|
|
48
50
|
const r = verifyBundle(bundle, sig);
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import fs from 'node:fs';
|
|
16
16
|
import path from 'node:path';
|
|
17
17
|
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
18
19
|
|
|
19
20
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
21
|
const ROOT = path.resolve(__dirname, '..');
|
|
@@ -99,6 +100,6 @@ export async function main(argv = process.argv) {
|
|
|
99
100
|
console.log(`✓ model-catalog VERIFIED: ${r.checked} model facts match the ${live ? 'LIVE OpenRouter' : 'committed snapshot'} catalog (pulled ${source.pulledAt}, ${r.ageDays.toFixed(1)}d old ≤ 14d).`);
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
if (
|
|
103
|
+
if (isDirectInvocation(import.meta.url)) {
|
|
103
104
|
main().catch((e) => { console.error('verify-model-catalog error:', e.message); process.exit(1); });
|
|
104
105
|
}
|
package/scripts/version.mjs
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import fs from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
9
10
|
|
|
10
11
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
12
|
export const PLUGIN_JSON = path.join(ROOT, 'plugin', '.claude-plugin', 'plugin.json');
|
|
@@ -35,6 +36,6 @@ export function getVersionTag() {
|
|
|
35
36
|
export const stripTag = (v) => String(v).replace(/^v/, '');
|
|
36
37
|
|
|
37
38
|
// CLI: `node scripts/version.mjs` prints the version (handy for shell scripts).
|
|
38
|
-
if (
|
|
39
|
+
if (isDirectInvocation(import.meta.url)) {
|
|
39
40
|
process.stdout.write(getVersion() + '\n');
|
|
40
41
|
}
|
package/scripts/wired-check.mjs
CHANGED
|
@@ -172,8 +172,8 @@ const STANDALONE = [
|
|
|
172
172
|
// plist's own ProgramArguments on 2026-07-23, not assumed from the header comment alone:
|
|
173
173
|
['clear-claude-tmp', 'launchd, every 3h (out-of-repo scheduler) — confirmed live: '
|
|
174
174
|
+ 'com.stuartkerr.clear-claude-tmp.plist is loaded and its ProgramArguments invoke this exact file'],
|
|
175
|
-
['nightly-gists', '
|
|
176
|
-
+ 'com.ruvnet.brain-gists
|
|
175
|
+
['nightly-gists', 'manual re-embed of the developer checkout gists store (the launchd job '
|
|
176
|
+
+ 'com.ruvnet.brain-gists was retired 2026-10-26: no installed brain reads that store)'],
|
|
177
177
|
['nightly-wrapper', 'author-run maintenance harness, deliberately unscheduled; refuses primary, nested, and dirty worktrees'],
|
|
178
178
|
['routing-flywheel', 'launchd nightly 04:45 --dry-run (out-of-repo scheduler) — confirmed live: '
|
|
179
179
|
+ 'com.ruvnet.routing-flywheel.plist is loaded and its ProgramArguments invoke this exact file'],
|
|
@@ -226,6 +226,8 @@ const STANDALONE = [
|
|
|
226
226
|
+ 'starts themselves (--url http://127.0.0.1:.../page.html, via Playwright) — needs a live '
|
|
227
227
|
+ 'rendered page, not a static diff, so it is a dev-loop tool like gen-console-images.mjs, not a '
|
|
228
228
|
+ 'CI step'],
|
|
229
|
+
['recall-latency-probe', 'human-run measurement (#429): times prompt recall and SessionStart restore against a real '
|
|
230
|
+
+ 'project store and exits 1 outside the budgets; it reads the owner\'s live store and loads the machine, so no scheduler runs it'],
|
|
229
231
|
['dev-plugin-link', 'developer convenience CLI — its own header: "Users never run it." Hot-links '
|
|
230
232
|
+ 'the cached plugin install to the working tree so hook edits apply without a CC restart'],
|
|
231
233
|
|
|
@@ -409,13 +411,13 @@ export const REQUIRED_OPERATIONAL_EXPORTS = [
|
|
|
409
411
|
const isTestFile = (f) => /\.(test|spec)\.(mjs|js)$/.test(path.basename(f))
|
|
410
412
|
|| f.includes(`${path.sep}tests${path.sep}`) || f.startsWith(`tests${path.sep}`);
|
|
411
413
|
|
|
412
|
-
function walk(abs, recurse, out = []) {
|
|
414
|
+
function walk(abs, recurse, out = [], prune = () => false) {
|
|
413
415
|
let entries = [];
|
|
414
416
|
try { entries = fs.readdirSync(abs, { withFileTypes: true }); } catch { return out; }
|
|
415
417
|
for (const e of entries) {
|
|
416
418
|
const full = path.join(abs, e.name);
|
|
417
419
|
if (e.isDirectory()) {
|
|
418
|
-
if (recurse && e.name !== 'node_modules' && !e.name.startsWith('.')) walk(full, recurse, out);
|
|
420
|
+
if (recurse && e.name !== 'node_modules' && !e.name.startsWith('.') && !prune(full)) walk(full, recurse, out, prune);
|
|
419
421
|
} else out.push(full);
|
|
420
422
|
}
|
|
421
423
|
return out;
|
|
@@ -451,7 +453,10 @@ function callerFiles(repo = REPO) {
|
|
|
451
453
|
// wired into pre-push and `wired-check` went on reporting it `manual`. This file's own note names
|
|
452
454
|
// the remedy: "an invoker outside the roots proves the ROOTS are incomplete — the fix is to add
|
|
453
455
|
// the root, never to" special-case the module. Same rule, applied to the extension filter.
|
|
454
|
-
|
|
456
|
+
// Pruned BEFORE descending (see the worktrees note below): 100+ agent worktrees under .claude/ are full
|
|
457
|
+
// repository copies, and walking them only to drop every file afterwards dominated this audit's run time.
|
|
458
|
+
const worktrees = path.join(repo, '.claude', 'worktrees');
|
|
459
|
+
for (const f of walk(abs, true, [], (dir) => dir === worktrees)) {
|
|
455
460
|
// `.claude/` is a caller root because `.claude/settings.json` genuinely invokes hooks. But
|
|
456
461
|
// `.claude/worktrees/<agent>/` holds FULL COPIES of this repository (Claude Code agent
|
|
457
462
|
// worktrees), and a copy of the repo is not a caller of the repo. Measured 2026-09-11: with any
|
|
@@ -634,6 +639,9 @@ export function callersOf(mod, files, repo = REPO, sourceCache = createInvocatio
|
|
|
634
639
|
const rel = path.relative(repo, f).split(path.sep).join('/');
|
|
635
640
|
if (rel === mod.rel) continue; // self
|
|
636
641
|
if (isTestFile(rel)) continue; // a test is not a caller
|
|
642
|
+
// Cheap substring pre-filter: callerPattern() only ever matches text that contains the literal file
|
|
643
|
+
// name, so skipping the regex when the name is absent cannot change the result, only its cost.
|
|
644
|
+
if (!sourceCache.read(f)?.includes(mod.file)) continue;
|
|
637
645
|
const src = sourceCache.commentFree(f);
|
|
638
646
|
if (src !== null && re.test(src)) hits.push(rel);
|
|
639
647
|
}
|
|
@@ -12,6 +12,7 @@ import path from 'node:path';
|
|
|
12
12
|
import crypto from 'node:crypto';
|
|
13
13
|
import { spawnSync } from 'node:child_process';
|
|
14
14
|
import { fileURLToPath } from 'node:url';
|
|
15
|
+
import { isDirectInvocation } from '../plugin/scripts/entrypoint.mjs';
|
|
15
16
|
|
|
16
17
|
function git(cwd, args) {
|
|
17
18
|
const result = spawnSync('git', ['-C', cwd, ...args], { encoding: 'utf8' });
|
|
@@ -101,8 +102,7 @@ export function assertPrimaryCheckoutUnchanged(root, before) {
|
|
|
101
102
|
return after;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
const invokedDirectly =
|
|
105
|
-
&& fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
105
|
+
const invokedDirectly = isDirectInvocation(import.meta.url);
|
|
106
106
|
if (invokedDirectly) {
|
|
107
107
|
try {
|
|
108
108
|
const command = process.argv[2];
|