ruvnet-brain 4.3.21 → 4.3.26
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 +5 -5
- package/bin/install.mjs +275 -60
- package/console/app.js +189 -9
- package/console/index.html +70 -24
- package/console/scope.css +137 -0
- package/console/scope.html +144 -0
- package/console/scope.js +209 -0
- package/console/style.css +26 -0
- package/console/tips.html +1 -0
- package/kb/corpus-release-identity.mjs +239 -0
- package/kb/update-storage-transaction.mjs +20 -3
- package/package.json +9 -2
- package/plugin/.claude-plugin/plugin.json +2 -2
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/commands/checkpoint.md +61 -0
- package/plugin/hooks/codex-hooks.json +64 -1
- package/plugin/hooks/hook-contracts.json +299 -6
- package/plugin/hooks/hooks.json +81 -1
- package/plugin/mcp/server.mjs +23 -0
- package/plugin/scripts/advocacy-catalog.mjs +245 -0
- package/plugin/scripts/advocacy-route.mjs +460 -0
- package/plugin/scripts/continuation-gate.mjs +25 -2
- package/plugin/scripts/continuation-objective.mjs +7 -1
- package/plugin/scripts/continuity-hook-policy.mjs +190 -15
- package/plugin/scripts/coverage-integrity.mjs +7 -0
- package/plugin/scripts/gates.mjs +113 -10
- package/plugin/scripts/grounding-turn-gate.mjs +167 -0
- package/plugin/scripts/grounding-turn-mark.mjs +91 -0
- package/plugin/scripts/hook-shim.mjs +14 -0
- package/plugin/scripts/nightly-scheduler.mjs +37 -4
- package/plugin/scripts/project-progression-checkpoint.mjs +145 -0
- package/plugin/scripts/project-progression-contract.mjs +16 -0
- package/plugin/scripts/project-progression-hook.mjs +3 -0
- package/plugin/scripts/project-progression-producer.mjs +252 -0
- package/plugin/scripts/project-progression-reader.mjs +271 -0
- package/plugin/scripts/project-progression-session-start.mjs +93 -16
- package/plugin/scripts/project-progression-sources.mjs +220 -0
- package/plugin/scripts/project-progression-store.mjs +106 -13
- package/plugin/scripts/ruvnet-gate1-pattern.mjs +29 -0
- package/plugin/scripts/session-snapshot-hook.mjs +115 -7
- package/plugin/scripts/session-start-budget.mjs +59 -0
- package/plugin/scripts/session-start-core.mjs +234 -457
- package/plugin/scripts/session-start-fsutil.mjs +61 -0
- package/plugin/scripts/session-start-health.mjs +64 -0
- package/plugin/scripts/session-start-hook-description.mjs +45 -0
- package/plugin/scripts/session-start-issue-alert.mjs +77 -0
- package/plugin/scripts/session-start-repo-identity.mjs +54 -0
- package/plugin/scripts/session-start-signals.mjs +73 -0
- package/plugin/scripts/session-start-trace.mjs +86 -0
- package/plugin/scripts/session-start-update-plane.mjs +104 -0
- package/plugin/scripts/unprompted-runtime.mjs +32 -2
- package/plugin/skills/ruvnet-brain/PLAYBOOK.md +26 -2
- package/plugin/skills/ruvnet-brain/SKILL.md +67 -2
- package/scripts/adr-072-completion.mjs +1 -1
- package/scripts/agentdb-fleet-doctor.mjs +5 -1
- package/scripts/approved-runtime.mjs +197 -0
- package/scripts/brain-novice-50.mjs +16 -1
- package/scripts/brain-score.mjs +23 -5
- package/scripts/build-bundle.mjs +971 -530
- package/scripts/build-concepts.mjs +36 -116
- package/scripts/console-engine.test.mjs +8 -7
- package/scripts/console-runtime-identity.mjs +4 -0
- package/scripts/corpus-aggregates.mjs +94 -77
- package/scripts/corpus-candidate.mjs +475 -222
- package/scripts/corpus-next-seed.mjs +225 -0
- package/scripts/corpus-promotion.mjs +58 -0
- package/scripts/corpus-reconcile.mjs +411 -105
- package/scripts/doc-currency.mjs +16 -1
- package/scripts/dual-host-deliberation.mjs +25 -2
- package/scripts/dual-host-suggest.mjs +17 -1
- package/scripts/falsify.mjs +13 -3
- package/scripts/gist-receipts.mjs +482 -87
- package/scripts/github-health-watch.mjs +12 -2
- package/scripts/handoff-asset.mjs +34 -0
- package/scripts/hook-retirement-check.mjs +8 -1
- package/scripts/host-registry.mjs +1 -1
- package/scripts/ingest-gists.mjs +74 -101
- package/scripts/job-heartbeat.sh +77 -14
- package/scripts/learning-replay-execution.mjs +10 -4
- package/scripts/nightly-gists.sh +27 -13
- package/scripts/nightly-two-run-proof.mjs +1 -1
- package/scripts/nightly-watchdog.mjs +61 -4
- package/scripts/onboarding-console.mjs +364 -28
- package/scripts/oracle/produce-questions.mjs +293 -0
- package/scripts/oracle/producer-hosts.mjs +235 -0
- package/scripts/oracle/repo-recall.mjs +448 -0
- package/scripts/oracle/retrieval-accuracy.mjs +818 -0
- package/scripts/oracle/source-tree.mjs +165 -0
- package/scripts/oracle/source-units.mjs +391 -0
- package/scripts/oracle/spike-run.mjs +98 -0
- package/scripts/oracle/unit-inventory.mjs +141 -0
- package/scripts/oracle/unit-sampling.mjs +128 -0
- package/scripts/oracle/validate-labels.mjs +250 -0
- package/scripts/private-overlay.mjs +248 -0
- package/scripts/product-integrity-contract.mjs +1 -1
- package/scripts/proxy/claude-proxied.sh +6 -0
- package/scripts/proxy/proxy-revert.sh +5 -0
- package/scripts/proxy/proxy-up.sh +6 -0
- package/scripts/proxy/proxy-verify.mjs +4 -0
- package/scripts/public-inputs.mjs +409 -0
- package/scripts/public-verification-inputs.mjs +112 -26
- package/scripts/public-verification-lane.mjs +1 -1
- package/scripts/published-surface-probe.mjs +34 -4
- package/scripts/qe/card-lane-gate.mjs +16 -1
- package/scripts/qe/session-start-gate.mjs +16 -1
- package/scripts/rebuild-gists-from-receipts.mjs +58 -78
- package/scripts/record-lesson.mjs +4 -1
- package/scripts/rehearse-corpus-pipeline.mjs +994 -0
- package/scripts/release-abort-stale.mjs +5 -1
- package/scripts/release-authority.mjs +104 -12
- package/scripts/release-channel-kind.mjs +86 -0
- package/scripts/release-convergence-watchdog.mjs +7 -2
- package/scripts/release-projection.mjs +177 -72
- package/scripts/release-transaction-provider.mjs +47 -10
- package/scripts/release-transaction.mjs +40 -11
- package/scripts/release.mjs +252 -17
- package/scripts/retrieval-canary.mjs +87 -0
- package/scripts/rvf-index-audit.mjs +573 -13
- package/scripts/rvf-wire.mjs +269 -0
- package/scripts/seal-gist-receipt.mjs +65 -0
- package/scripts/selfcheck.mjs +42 -21
- package/scripts/source-coverage.mjs +253 -24
- package/scripts/status-honesty.mjs +25 -0
- package/scripts/sync-census.mjs +0 -0
- package/scripts/sync-version.mjs +2 -0
- package/scripts/trismart.mjs +42 -0
- package/scripts/updater-manifest.mjs +162 -0
- package/scripts/verify-channels.mjs +17 -5
- package/scripts/wired-check.mjs +48 -10
- package/tri-smart-skill/QUICKSTART.md +37 -0
- package/tri-smart-skill/README.md +92 -0
- package/tri-smart-skill/install.cmd +14 -0
- package/tri-smart-skill/install.command +13 -0
- package/tri-smart-skill/install.mjs +51 -0
- package/tri-smart-skill/install.sh +9 -0
- package/tri-smart-skill/tri-smart/SKILL.md +90 -0
- package/tri-smart-skill/tri-smart/evals/evals.json +25 -0
- package/tri-smart-skill/tri-smart/references/protocol.md +25 -0
- package/tri-smart-skill/tri-smart/references/provider-cli.md +18 -0
- package/tri-smart-skill/tri-smart/scripts/review.mjs +154 -0
- package/tri-smart-skill/tri-smart/scripts/setup.mjs +97 -0
- package/tri-smart-skill/tri-smart/scripts/verify-access.mjs +107 -0
- package/scripts/corpus-seed-publish.mjs +0 -110
|
@@ -169,6 +169,72 @@ export function validateRetrievalQueryEvidence(evidence) {
|
|
|
169
169
|
return evidence;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
// An exemption is a RECORDED, EVIDENCED admission that one eligible store's upstream bytes cannot
|
|
173
|
+
// support a source-grounded question — never a bypass. It satisfies the inventory obligation only;
|
|
174
|
+
// buildRetrievalCanaryPlan still demands a row for every eligible store, so an exempted store must
|
|
175
|
+
// also leave the eligible corpus before a canary plan can be sealed. Recording one is a coverage
|
|
176
|
+
// policy decision that someone has to make in the open, which is the entire point.
|
|
177
|
+
export function validateOracleExemptions(exemptions) {
|
|
178
|
+
if (exemptions === null || exemptions === undefined) return [];
|
|
179
|
+
if (canonicalJson(Object.keys(exemptions || {}).sort()) !== canonicalJson(['exemptions', 'kind', 'schemaVersion'])
|
|
180
|
+
|| exemptions.schemaVersion !== 1 || exemptions.kind !== 'ruvnet-brain-retrieval-oracle-exemptions'
|
|
181
|
+
|| !Array.isArray(exemptions.exemptions)) {
|
|
182
|
+
throw new Error('retrieval oracle exemptions are malformed');
|
|
183
|
+
}
|
|
184
|
+
for (const row of exemptions.exemptions) {
|
|
185
|
+
if (canonicalJson(Object.keys(row || {}).sort()) !== canonicalJson(['evidencePaths', 'reason', 'store', 'upstreamSha'])
|
|
186
|
+
|| typeof row.store !== 'string' || !/^[a-z0-9][a-z0-9._-]*$/.test(row.store)
|
|
187
|
+
|| typeof row.reason !== 'string' || row.reason.trim().length < 24
|
|
188
|
+
|| !HEX40.test(String(row.upstreamSha || ''))
|
|
189
|
+
|| !Array.isArray(row.evidencePaths) || row.evidencePaths.length < 1
|
|
190
|
+
|| row.evidencePaths.some((file) => typeof file !== 'string' || !file || path.isAbsolute(file)
|
|
191
|
+
|| file.split(/[\\/]/).includes('..'))) {
|
|
192
|
+
throw new Error(`retrieval oracle exemption for ${row?.store || '(missing)'} is malformed`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const stores = exemptions.exemptions.map((row) => row.store);
|
|
196
|
+
if (new Set(stores).size !== stores.length) throw new Error('retrieval oracle exemptions name a store twice');
|
|
197
|
+
return exemptions.exemptions;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// The cheap, standalone form of the denominator gate buildRetrievalCanaryPlan enforces at release
|
|
201
|
+
// time against a 567MB seed. Missing evidence is a FAILURE here, named store by store, seconds after
|
|
202
|
+
// a new repository lands in coverage — not six minutes into release-qe on a runner.
|
|
203
|
+
export function auditOracleCoverage({ coverage, queryEvidence, exemptions = null } = {}) {
|
|
204
|
+
const checked = validateCoverageLedger(coverage);
|
|
205
|
+
if (!checked.valid) throw new Error(`coverage ledger is invalid: ${checked.failures.join('; ')}`);
|
|
206
|
+
validateRetrievalQueryEvidence(queryEvidence);
|
|
207
|
+
const eligibleRows = coverage.rows.filter((row) => row.kind === 'repository'
|
|
208
|
+
&& row.disposition === 'eligible' && row.status === 'CURRENT');
|
|
209
|
+
const eligible = ordered(eligibleRows.map(storeOf));
|
|
210
|
+
if (!eligible.length || new Set(eligible).size !== eligible.length || eligible.some((store) => !store)) {
|
|
211
|
+
throw new Error('eligible coverage denominator is invalid');
|
|
212
|
+
}
|
|
213
|
+
const oracle = new Set(Object.keys(queryEvidence.queries));
|
|
214
|
+
const exempted = validateOracleExemptions(exemptions);
|
|
215
|
+
const exemptStores = new Set(exempted.map((row) => row.store));
|
|
216
|
+
const uncovered = eligible.filter((store) => !oracle.has(store));
|
|
217
|
+
const missing = uncovered.filter((store) => !exemptStores.has(store));
|
|
218
|
+
const exempt = uncovered.filter((store) => exemptStores.has(store));
|
|
219
|
+
const extra = ordered([...oracle].filter((store) => !eligible.includes(store)));
|
|
220
|
+
const stale = ordered(exempted.map((row) => row.store).filter((store) => !uncovered.includes(store)));
|
|
221
|
+
const result = { eligible: eligible.length, covered: eligible.length - uncovered.length,
|
|
222
|
+
missing, exempt, extra, staleExemptions: stale };
|
|
223
|
+
if (missing.length) {
|
|
224
|
+
throw new Error(`independent retrieval oracle has no source-grounded row for ${missing.length} of `
|
|
225
|
+
+ `${eligible.length} eligible stores: ${missing.join(', ')}`);
|
|
226
|
+
}
|
|
227
|
+
if (extra.length) {
|
|
228
|
+
throw new Error(`independent retrieval oracle covers ${extra.length} store(s) outside the eligible `
|
|
229
|
+
+ `denominator: ${extra.join(', ')}`);
|
|
230
|
+
}
|
|
231
|
+
if (stale.length) {
|
|
232
|
+
throw new Error(`retrieval oracle exemption is stale for ${stale.join(', ')}; the store is covered `
|
|
233
|
+
+ 'or no longer eligible, so the recorded admission must be removed');
|
|
234
|
+
}
|
|
235
|
+
return result;
|
|
236
|
+
}
|
|
237
|
+
|
|
172
238
|
export function verifyQueryOracleSource(queryEvidence, candidateSourceSha, {
|
|
173
239
|
cwd = process.cwd(), run = spawnSync, allowSquashedSource = false,
|
|
174
240
|
} = {}) {
|
|
@@ -600,13 +666,34 @@ export function buildPlanFromFiles({ coverageFile, baselineFile, candidateFile,
|
|
|
600
666
|
return plan;
|
|
601
667
|
}
|
|
602
668
|
|
|
669
|
+
export function auditOracleCoverageFromFiles({ coverageFile, oracleFile, exemptionsFile = null,
|
|
670
|
+
candidateSourceSha = null, cwd = process.cwd() }) {
|
|
671
|
+
const coverage = JSON.parse(fs.readFileSync(regular(coverageFile, 'coverage'), 'utf8'));
|
|
672
|
+
const queryEvidence = JSON.parse(fs.readFileSync(regular(oracleFile, 'query oracle'), 'utf8'));
|
|
673
|
+
const exemptions = exemptionsFile
|
|
674
|
+
? JSON.parse(fs.readFileSync(regular(exemptionsFile, 'oracle exemptions'), 'utf8')) : null;
|
|
675
|
+
const inventory = auditOracleCoverage({ coverage, queryEvidence, exemptions });
|
|
676
|
+
// The second half of step 7's proof: the oracle's own commit must be a strict ancestor of the
|
|
677
|
+
// candidate that consumes it, and its tracked bytes must be identical at both.
|
|
678
|
+
const strictAncestor = candidateSourceSha
|
|
679
|
+
? Boolean(verifyQueryOracleSource(queryEvidence, candidateSourceSha, { cwd })) : null;
|
|
680
|
+
return { ...inventory, oracleSourceCommit: queryEvidence.sourceCommit, strictAncestor };
|
|
681
|
+
}
|
|
682
|
+
|
|
603
683
|
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
604
684
|
try {
|
|
605
685
|
const argv = process.argv.slice(2);
|
|
686
|
+
if (argv.includes('--audit')) {
|
|
687
|
+
const report = auditOracleCoverageFromFiles({ coverageFile: arg(argv, '--coverage'),
|
|
688
|
+
oracleFile: arg(argv, '--oracle'), exemptionsFile: arg(argv, '--exemptions'),
|
|
689
|
+
candidateSourceSha: arg(argv, '--candidate-sha'), cwd: arg(argv, '--repo') || process.cwd() });
|
|
690
|
+
console.log(JSON.stringify({ ok: true, ...report }));
|
|
691
|
+
} else {
|
|
606
692
|
const plan = buildPlanFromFiles({ coverageFile: arg(argv, '--coverage'), baselineFile: arg(argv, '--baseline'),
|
|
607
693
|
candidateFile: arg(argv, '--candidate'), oracleFile: arg(argv, '--oracle'), assetsDir: arg(argv, '--assets'),
|
|
608
694
|
outFile: arg(argv, '--out'), cwd: arg(argv, '--repo') || process.cwd() });
|
|
609
695
|
console.log(JSON.stringify({ ok: true, planSha256: plan.planSha256, cases: plan.cases.length }));
|
|
696
|
+
}
|
|
610
697
|
} catch (error) {
|
|
611
698
|
console.error(`[retrieval-canary] ${error.message}`);
|
|
612
699
|
process.exitCode = 1;
|