audrey 1.1.2 → 1.2.0
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/CHANGELOG.md +101 -0
- package/README.md +39 -12
- package/dist/mcp-server/codex-hooks-probe.d.ts +22 -0
- package/dist/mcp-server/codex-hooks-probe.d.ts.map +1 -0
- package/dist/mcp-server/codex-hooks-probe.js +160 -0
- package/dist/mcp-server/codex-hooks-probe.js.map +1 -0
- package/dist/mcp-server/config.d.ts +26 -2
- package/dist/mcp-server/config.d.ts.map +1 -1
- package/dist/mcp-server/config.js +52 -20
- package/dist/mcp-server/config.js.map +1 -1
- package/dist/mcp-server/hooks.d.ts +28 -0
- package/dist/mcp-server/hooks.d.ts.map +1 -1
- package/dist/mcp-server/hooks.js +91 -2
- package/dist/mcp-server/hooks.js.map +1 -1
- package/dist/mcp-server/index.d.ts +242 -2
- package/dist/mcp-server/index.d.ts.map +1 -1
- package/dist/mcp-server/index.js +806 -240
- package/dist/mcp-server/index.js.map +1 -1
- package/dist/mcp-server/tool-schemas.d.ts +32 -2
- package/dist/mcp-server/tool-schemas.d.ts.map +1 -1
- package/dist/mcp-server/tool-schemas.js +55 -0
- package/dist/mcp-server/tool-schemas.js.map +1 -1
- package/dist/src/audrey.d.ts +14 -2
- package/dist/src/audrey.d.ts.map +1 -1
- package/dist/src/audrey.js +152 -28
- package/dist/src/audrey.js.map +1 -1
- package/dist/src/autopilot.d.ts +22 -0
- package/dist/src/autopilot.d.ts.map +1 -1
- package/dist/src/autopilot.js +271 -50
- package/dist/src/autopilot.js.map +1 -1
- package/dist/src/capsule.d.ts +23 -0
- package/dist/src/capsule.d.ts.map +1 -1
- package/dist/src/capsule.js +56 -11
- package/dist/src/capsule.js.map +1 -1
- package/dist/src/confidence.d.ts +9 -1
- package/dist/src/confidence.d.ts.map +1 -1
- package/dist/src/confidence.js +16 -2
- package/dist/src/confidence.js.map +1 -1
- package/dist/src/consolidate.d.ts +4 -0
- package/dist/src/consolidate.d.ts.map +1 -1
- package/dist/src/consolidate.js +206 -34
- package/dist/src/consolidate.js.map +1 -1
- package/dist/src/controller.d.ts +17 -1
- package/dist/src/controller.d.ts.map +1 -1
- package/dist/src/controller.js +244 -128
- package/dist/src/controller.js.map +1 -1
- package/dist/src/db.d.ts.map +1 -1
- package/dist/src/db.js +233 -56
- package/dist/src/db.js.map +1 -1
- package/dist/src/encode.d.ts +2 -1
- package/dist/src/encode.d.ts.map +1 -1
- package/dist/src/encode.js +41 -4
- package/dist/src/encode.js.map +1 -1
- package/dist/src/events.d.ts +48 -1
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +160 -62
- package/dist/src/events.js.map +1 -1
- package/dist/src/export.d.ts.map +1 -1
- package/dist/src/export.js +4 -4
- package/dist/src/export.js.map +1 -1
- package/dist/src/grounding.d.ts +111 -0
- package/dist/src/grounding.d.ts.map +1 -0
- package/dist/src/grounding.js +259 -0
- package/dist/src/grounding.js.map +1 -0
- package/dist/src/hybrid-recall.d.ts +16 -7
- package/dist/src/hybrid-recall.d.ts.map +1 -1
- package/dist/src/hybrid-recall.js +22 -11
- package/dist/src/hybrid-recall.js.map +1 -1
- package/dist/src/import.d.ts +10 -0
- package/dist/src/import.d.ts.map +1 -1
- package/dist/src/import.js +122 -22
- package/dist/src/import.js.map +1 -1
- package/dist/src/llm.d.ts.map +1 -1
- package/dist/src/llm.js +16 -0
- package/dist/src/llm.js.map +1 -1
- package/dist/src/preflight.d.ts.map +1 -1
- package/dist/src/preflight.js +89 -47
- package/dist/src/preflight.js.map +1 -1
- package/dist/src/project.d.ts +4 -1
- package/dist/src/project.d.ts.map +1 -1
- package/dist/src/project.js +65 -5
- package/dist/src/project.js.map +1 -1
- package/dist/src/recall.d.ts.map +1 -1
- package/dist/src/recall.js +138 -13
- package/dist/src/recall.js.map +1 -1
- package/dist/src/redact.d.ts +1 -1
- package/dist/src/redact.d.ts.map +1 -1
- package/dist/src/redact.js +185 -5
- package/dist/src/redact.js.map +1 -1
- package/dist/src/routes.d.ts.map +1 -1
- package/dist/src/routes.js +91 -18
- package/dist/src/routes.js.map +1 -1
- package/dist/src/trust.d.ts +35 -0
- package/dist/src/trust.d.ts.map +1 -0
- package/dist/src/trust.js +77 -0
- package/dist/src/trust.js.map +1 -0
- package/dist/src/types.d.ts +24 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +4 -38
- package/benchmarks/adapter-kit.mjs +0 -20
- package/benchmarks/adapter-self-test.mjs +0 -170
- package/benchmarks/adapters/example-allow.mjs +0 -31
- package/benchmarks/adapters/mem0-platform.mjs +0 -274
- package/benchmarks/adapters/registry.json +0 -51
- package/benchmarks/adapters/zep-cloud.mjs +0 -304
- package/benchmarks/baselines.js +0 -174
- package/benchmarks/build-leaderboard.mjs +0 -183
- package/benchmarks/cases.js +0 -549
- package/benchmarks/create-conformance-card.mjs +0 -148
- package/benchmarks/create-submission-bundle.mjs +0 -190
- package/benchmarks/dry-run-external-adapters.mjs +0 -177
- package/benchmarks/guardbench.js +0 -1265
- package/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +0 -50
- package/benchmarks/output/external/guardbench-external-dry-run.json +0 -69
- package/benchmarks/output/external/guardbench-external-evidence.json +0 -56
- package/benchmarks/output/guardbench-conformance-card.json +0 -63
- package/benchmarks/output/guardbench-manifest.json +0 -414
- package/benchmarks/output/guardbench-raw.json +0 -1279
- package/benchmarks/output/guardbench-summary.json +0 -2123
- package/benchmarks/output/leaderboard/guardbench-leaderboard.json +0 -93
- package/benchmarks/output/leaderboard/guardbench-leaderboard.md +0 -7
- package/benchmarks/output/submission-bundle/guardbench-conformance-card.json +0 -63
- package/benchmarks/output/submission-bundle/guardbench-manifest.json +0 -414
- package/benchmarks/output/submission-bundle/guardbench-raw.json +0 -1279
- package/benchmarks/output/submission-bundle/guardbench-summary.json +0 -2123
- package/benchmarks/output/submission-bundle/schemas/guardbench-adapter-registry.schema.json +0 -69
- package/benchmarks/output/submission-bundle/schemas/guardbench-adapter-self-test.schema.json +0 -156
- package/benchmarks/output/submission-bundle/schemas/guardbench-conformance-card.schema.json +0 -184
- package/benchmarks/output/submission-bundle/schemas/guardbench-external-dry-run.schema.json +0 -74
- package/benchmarks/output/submission-bundle/schemas/guardbench-external-evidence.schema.json +0 -108
- package/benchmarks/output/submission-bundle/schemas/guardbench-external-run.schema.json +0 -160
- package/benchmarks/output/submission-bundle/schemas/guardbench-leaderboard.schema.json +0 -179
- package/benchmarks/output/submission-bundle/schemas/guardbench-manifest.schema.json +0 -213
- package/benchmarks/output/submission-bundle/schemas/guardbench-publication-verification.schema.json +0 -47
- package/benchmarks/output/submission-bundle/schemas/guardbench-raw.schema.json +0 -184
- package/benchmarks/output/submission-bundle/schemas/guardbench-submission-manifest.schema.json +0 -151
- package/benchmarks/output/submission-bundle/schemas/guardbench-summary.schema.json +0 -249
- package/benchmarks/output/submission-bundle/submission-manifest.json +0 -131
- package/benchmarks/output/submission-bundle/validation-report.json +0 -31
- package/benchmarks/output/summary.json +0 -2354
- package/benchmarks/perf-snapshot.js +0 -307
- package/benchmarks/perf.bench.js +0 -169
- package/benchmarks/public-paths.mjs +0 -97
- package/benchmarks/reference-results.js +0 -75
- package/benchmarks/report.js +0 -280
- package/benchmarks/run-external-guardbench.mjs +0 -303
- package/benchmarks/run.js +0 -735
- package/benchmarks/schemas/guardbench-adapter-registry.schema.json +0 -69
- package/benchmarks/schemas/guardbench-adapter-self-test.schema.json +0 -156
- package/benchmarks/schemas/guardbench-conformance-card.schema.json +0 -184
- package/benchmarks/schemas/guardbench-external-dry-run.schema.json +0 -74
- package/benchmarks/schemas/guardbench-external-evidence.schema.json +0 -108
- package/benchmarks/schemas/guardbench-external-run.schema.json +0 -160
- package/benchmarks/schemas/guardbench-leaderboard.schema.json +0 -179
- package/benchmarks/schemas/guardbench-manifest.schema.json +0 -213
- package/benchmarks/schemas/guardbench-publication-verification.schema.json +0 -47
- package/benchmarks/schemas/guardbench-raw.schema.json +0 -184
- package/benchmarks/schemas/guardbench-submission-manifest.schema.json +0 -151
- package/benchmarks/schemas/guardbench-summary.schema.json +0 -249
- package/benchmarks/snapshots/perf-0.22.2.json +0 -123
- package/benchmarks/snapshots/perf-0.23.0.json +0 -123
- package/benchmarks/validate-adapter-module.mjs +0 -107
- package/benchmarks/validate-adapter-registry.mjs +0 -145
- package/benchmarks/validate-adapter-self-test.mjs +0 -96
- package/benchmarks/validate-guardbench-artifacts.mjs +0 -400
- package/benchmarks/verify-external-evidence.mjs +0 -351
- package/benchmarks/verify-publication-artifacts.mjs +0 -309
- package/benchmarks/verify-submission-bundle.mjs +0 -172
- package/docs/AUDREY_PAPER_OUTLINE.md +0 -178
- package/docs/MEMORY_BENCHMARKING.md +0 -59
- package/docs/PRODUCTION_BACKLOG.md +0 -321
- package/docs/assets/audrey-feature-grid.jpg +0 -0
- package/docs/assets/audrey-logo.svg +0 -45
- package/docs/assets/audrey-wordmark.png +0 -0
- package/docs/paper/00-master.md +0 -48
- package/docs/paper/01-introduction.md +0 -27
- package/docs/paper/02-related-work.md +0 -47
- package/docs/paper/03-problem-definition.md +0 -108
- package/docs/paper/04-design.md +0 -164
- package/docs/paper/05-guardbench-spec.md +0 -412
- package/docs/paper/06-implementation.md +0 -115
- package/docs/paper/07-evaluation.md +0 -168
- package/docs/paper/08-discussion-limitations.md +0 -61
- package/docs/paper/09-conclusion.md +0 -11
- package/docs/paper/SUBMISSION_README.md +0 -162
- package/docs/paper/appendix-a-demo-transcript.md +0 -114
- package/docs/paper/arxiv-compile-report.schema.json +0 -116
- package/docs/paper/arxiv-source.schema.json +0 -61
- package/docs/paper/audrey-paper-v1.md +0 -1108
- package/docs/paper/browser-launch-plan.json +0 -209
- package/docs/paper/browser-launch-plan.schema.json +0 -100
- package/docs/paper/browser-launch-results.json +0 -86
- package/docs/paper/browser-launch-results.schema.json +0 -66
- package/docs/paper/claim-register.json +0 -138
- package/docs/paper/claim-register.schema.json +0 -81
- package/docs/paper/evidence-ledger.md +0 -103
- package/docs/paper/output/arxiv/README-arxiv.txt +0 -8
- package/docs/paper/output/arxiv/arxiv-manifest.json +0 -41
- package/docs/paper/output/arxiv/main.tex +0 -951
- package/docs/paper/output/arxiv/references.bib +0 -222
- package/docs/paper/output/arxiv-compile-report.json +0 -24
- package/docs/paper/output/submission-bundle/LICENSE +0 -21
- package/docs/paper/output/submission-bundle/README.md +0 -440
- package/docs/paper/output/submission-bundle/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +0 -50
- package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-dry-run.json +0 -69
- package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-evidence.json +0 -56
- package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-conformance-card.json +0 -63
- package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-manifest.json +0 -414
- package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-raw.json +0 -1279
- package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-summary.json +0 -2123
- package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.json +0 -93
- package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.md +0 -7
- package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/submission-manifest.json +0 -131
- package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/validation-report.json +0 -31
- package/docs/paper/output/submission-bundle/benchmarks/output/summary.json +0 -2354
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-adapter-registry.schema.json +0 -69
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-adapter-self-test.schema.json +0 -156
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-conformance-card.schema.json +0 -184
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-dry-run.schema.json +0 -74
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-evidence.schema.json +0 -108
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-run.schema.json +0 -160
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-leaderboard.schema.json +0 -179
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-manifest.schema.json +0 -213
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-publication-verification.schema.json +0 -47
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-raw.schema.json +0 -184
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-submission-manifest.schema.json +0 -151
- package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-summary.schema.json +0 -249
- package/docs/paper/output/submission-bundle/docs/AUDREY_PAPER_OUTLINE.md +0 -178
- package/docs/paper/output/submission-bundle/docs/paper/00-master.md +0 -48
- package/docs/paper/output/submission-bundle/docs/paper/01-introduction.md +0 -27
- package/docs/paper/output/submission-bundle/docs/paper/02-related-work.md +0 -47
- package/docs/paper/output/submission-bundle/docs/paper/03-problem-definition.md +0 -108
- package/docs/paper/output/submission-bundle/docs/paper/04-design.md +0 -164
- package/docs/paper/output/submission-bundle/docs/paper/05-guardbench-spec.md +0 -412
- package/docs/paper/output/submission-bundle/docs/paper/06-implementation.md +0 -115
- package/docs/paper/output/submission-bundle/docs/paper/07-evaluation.md +0 -168
- package/docs/paper/output/submission-bundle/docs/paper/08-discussion-limitations.md +0 -61
- package/docs/paper/output/submission-bundle/docs/paper/09-conclusion.md +0 -11
- package/docs/paper/output/submission-bundle/docs/paper/SUBMISSION_README.md +0 -162
- package/docs/paper/output/submission-bundle/docs/paper/appendix-a-demo-transcript.md +0 -114
- package/docs/paper/output/submission-bundle/docs/paper/arxiv-compile-report.schema.json +0 -116
- package/docs/paper/output/submission-bundle/docs/paper/arxiv-source.schema.json +0 -61
- package/docs/paper/output/submission-bundle/docs/paper/audrey-paper-v1.md +0 -1108
- package/docs/paper/output/submission-bundle/docs/paper/browser-launch-plan.json +0 -209
- package/docs/paper/output/submission-bundle/docs/paper/browser-launch-plan.schema.json +0 -100
- package/docs/paper/output/submission-bundle/docs/paper/browser-launch-results.json +0 -86
- package/docs/paper/output/submission-bundle/docs/paper/browser-launch-results.schema.json +0 -66
- package/docs/paper/output/submission-bundle/docs/paper/claim-register.json +0 -138
- package/docs/paper/output/submission-bundle/docs/paper/claim-register.schema.json +0 -81
- package/docs/paper/output/submission-bundle/docs/paper/evidence-ledger.md +0 -103
- package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/README-arxiv.txt +0 -8
- package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/arxiv-manifest.json +0 -41
- package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/main.tex +0 -951
- package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/references.bib +0 -222
- package/docs/paper/output/submission-bundle/docs/paper/output/arxiv-compile-report.json +0 -24
- package/docs/paper/output/submission-bundle/docs/paper/paper-submission-bundle.schema.json +0 -70
- package/docs/paper/output/submission-bundle/docs/paper/publication-pack.json +0 -81
- package/docs/paper/output/submission-bundle/docs/paper/publication-pack.schema.json +0 -60
- package/docs/paper/output/submission-bundle/docs/paper/references.bib +0 -222
- package/docs/paper/output/submission-bundle/package.json +0 -235
- package/docs/paper/output/submission-bundle/paper-submission-manifest.json +0 -379
- package/docs/paper/paper-submission-bundle.schema.json +0 -70
- package/docs/paper/publication-pack.json +0 -81
- package/docs/paper/publication-pack.schema.json +0 -60
- package/docs/paper/references.bib +0 -222
- package/scripts/audit-release-completion.mjs +0 -440
- package/scripts/create-arxiv-source.mjs +0 -368
- package/scripts/create-paper-submission-bundle.mjs +0 -214
- package/scripts/finalize-release.mjs +0 -601
- package/scripts/prepare-release-cut.mjs +0 -277
- package/scripts/publish-release-bundle.mjs +0 -252
- package/scripts/publish-release-github-api.mjs +0 -494
- package/scripts/run-vitest.mjs +0 -34
- package/scripts/smoke-cli.js +0 -92
- package/scripts/sync-paper-artifacts.mjs +0 -112
- package/scripts/verify-arxiv-compile.mjs +0 -476
- package/scripts/verify-arxiv-source.mjs +0 -224
- package/scripts/verify-browser-launch-plan.mjs +0 -254
- package/scripts/verify-browser-launch-results.mjs +0 -303
- package/scripts/verify-paper-artifacts.mjs +0 -798
- package/scripts/verify-paper-claims.mjs +0 -254
- package/scripts/verify-paper-submission-bundle.mjs +0 -218
- package/scripts/verify-publication-pack.mjs +0 -210
- package/scripts/verify-python-package.py +0 -201
- package/scripts/verify-release-readiness.mjs +0 -920
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
|
-
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
3
|
-
import { dirname, join, relative, resolve } from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { validateSchema } from '../benchmarks/validate-guardbench-artifacts.mjs';
|
|
6
|
-
|
|
7
|
-
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
|
-
const DEFAULT_DIR = 'docs/paper/output/arxiv';
|
|
9
|
-
const DEFAULT_SCHEMA = 'docs/paper/arxiv-source.schema.json';
|
|
10
|
-
const REQUIRED_FILES = ['main.tex', 'references.bib', 'README-arxiv.txt'];
|
|
11
|
-
const SEEDED_SECRET = 'sk-guardbench-secret-0000000000000000000000000000';
|
|
12
|
-
|
|
13
|
-
function fromRoot(path) {
|
|
14
|
-
return resolve(ROOT, path);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function readJson(path) {
|
|
18
|
-
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function sha256File(path) {
|
|
22
|
-
return createHash('sha256').update(readFileSync(path)).digest('hex');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function countBibEntries(text) {
|
|
26
|
-
return [...text.matchAll(/@\w+\s*\{/g)].length;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function walkFiles(dir, root = dir) {
|
|
30
|
-
return readdirSync(dir, { withFileTypes: true }).flatMap(entry => {
|
|
31
|
-
const path = join(dir, entry.name);
|
|
32
|
-
if (entry.isDirectory()) return walkFiles(path, root);
|
|
33
|
-
return relative(root, path).replaceAll('\\', '/');
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function checkSourceHash(label, sourcePath, expectedHash, failures) {
|
|
38
|
-
if (!sourcePath || !expectedHash) return;
|
|
39
|
-
const absolute = fromRoot(sourcePath);
|
|
40
|
-
if (!existsSync(absolute)) {
|
|
41
|
-
failures.push(`arxiv-manifest.json: missing source file for ${label}: ${sourcePath}`);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (expectedHash !== sha256File(absolute))
|
|
45
|
-
failures.push(`arxiv-manifest.json: ${label} hash is stale`);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function parseArgs(argv = process.argv.slice(2)) {
|
|
49
|
-
const args = {
|
|
50
|
-
dir: DEFAULT_DIR,
|
|
51
|
-
schema: DEFAULT_SCHEMA,
|
|
52
|
-
json: false,
|
|
53
|
-
};
|
|
54
|
-
for (let i = 0; i < argv.length; i++) {
|
|
55
|
-
const token = argv[i];
|
|
56
|
-
if ((token === '--dir' || token === '--source-dir') && argv[i + 1]) args.dir = argv[++i];
|
|
57
|
-
else if (token === '--schema' && argv[i + 1]) args.schema = argv[++i];
|
|
58
|
-
else if (token === '--json') args.json = true;
|
|
59
|
-
else if (token === '--help' || token === '-h') args.help = true;
|
|
60
|
-
else throw new Error(`Unknown argument: ${token}`);
|
|
61
|
-
}
|
|
62
|
-
return args;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function usage() {
|
|
66
|
-
return `Usage: node scripts/verify-arxiv-source.mjs [options]
|
|
67
|
-
|
|
68
|
-
Options:
|
|
69
|
-
--dir <path> arXiv source directory. Default: ${DEFAULT_DIR}.
|
|
70
|
-
--schema <path> arXiv source manifest schema. Default: ${DEFAULT_SCHEMA}.
|
|
71
|
-
--json Print the machine-readable verification report.
|
|
72
|
-
`;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function verifyArxivSourcePackage(options = {}) {
|
|
76
|
-
const dir = fromRoot(options.dir ?? DEFAULT_DIR);
|
|
77
|
-
const schemaPath = fromRoot(options.schema ?? DEFAULT_SCHEMA);
|
|
78
|
-
const manifestPath = join(dir, 'arxiv-manifest.json');
|
|
79
|
-
const failures = [];
|
|
80
|
-
let manifest;
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
manifest = readJson(manifestPath);
|
|
84
|
-
} catch (error) {
|
|
85
|
-
return {
|
|
86
|
-
ok: false,
|
|
87
|
-
dir,
|
|
88
|
-
files: [],
|
|
89
|
-
citationCount: 0,
|
|
90
|
-
bibEntries: 0,
|
|
91
|
-
failures: [`arxiv-manifest.json: ${error.message}`],
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
failures.push(...validateSchema(manifest, readJson(schemaPath), 'audrey-arxiv-source'));
|
|
97
|
-
} catch (error) {
|
|
98
|
-
failures.push(`schema: ${error.message}`);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const listed = new Map((manifest.files ?? []).map(file => [file.path, file]));
|
|
102
|
-
for (const file of REQUIRED_FILES) {
|
|
103
|
-
if (!listed.has(file))
|
|
104
|
-
failures.push(`arxiv-manifest.json: missing required file record ${file}`);
|
|
105
|
-
}
|
|
106
|
-
if (listed.has('arxiv-manifest.json'))
|
|
107
|
-
failures.push('arxiv-manifest.json: must not include a self-hash file record');
|
|
108
|
-
checkSourceHash(
|
|
109
|
-
'sourceMarkdown',
|
|
110
|
-
manifest.sourceMarkdown,
|
|
111
|
-
manifest.sourceHashes?.sourceMarkdown,
|
|
112
|
-
failures,
|
|
113
|
-
);
|
|
114
|
-
checkSourceHash(
|
|
115
|
-
'publicationPack',
|
|
116
|
-
manifest.publicationPack,
|
|
117
|
-
manifest.sourceHashes?.publicationPack,
|
|
118
|
-
failures,
|
|
119
|
-
);
|
|
120
|
-
checkSourceHash(
|
|
121
|
-
'referencesBib',
|
|
122
|
-
'docs/paper/references.bib',
|
|
123
|
-
manifest.sourceHashes?.referencesBib,
|
|
124
|
-
failures,
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
for (const [file, record] of listed) {
|
|
128
|
-
const path = join(dir, file);
|
|
129
|
-
if (!existsSync(path)) {
|
|
130
|
-
failures.push(`${file}: listed in manifest but missing from package`);
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
const bytes = readFileSync(path).byteLength;
|
|
134
|
-
if (record.bytes !== bytes) failures.push(`${file}: byte length mismatch`);
|
|
135
|
-
if (record.sha256 !== sha256File(path)) failures.push(`${file}: sha256 mismatch`);
|
|
136
|
-
if (record.source && record.source !== 'generated') {
|
|
137
|
-
const sourcePath = fromRoot(record.source);
|
|
138
|
-
if (existsSync(sourcePath)) {
|
|
139
|
-
const sourceSha = sha256File(sourcePath);
|
|
140
|
-
if (record.source === 'docs/paper/references.bib' && sourceSha !== record.sha256) {
|
|
141
|
-
failures.push(`${file}: source bibliography has changed since arXiv package creation`);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const actualFiles = walkFiles(dir)
|
|
148
|
-
.filter(file => file !== 'arxiv-manifest.json')
|
|
149
|
-
.sort();
|
|
150
|
-
const listedFiles = [...listed.keys()].sort();
|
|
151
|
-
const listedSet = new Set(listedFiles);
|
|
152
|
-
for (const file of actualFiles) {
|
|
153
|
-
if (!listedSet.has(file))
|
|
154
|
-
failures.push(`${file}: present in package but missing from manifest`);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const mainPath = join(dir, 'main.tex');
|
|
158
|
-
const bibPath = join(dir, 'references.bib');
|
|
159
|
-
const main = existsSync(mainPath) ? readFileSync(mainPath, 'utf-8') : '';
|
|
160
|
-
const bib = existsSync(bibPath) ? readFileSync(bibPath, 'utf-8') : '';
|
|
161
|
-
const citationCount = [...main.matchAll(/\\cite\{([^}]+)\}/g)].length;
|
|
162
|
-
const citedIds = new Set(
|
|
163
|
-
[...main.matchAll(/\\cite\{([^}]+)\}/g)].flatMap(match =>
|
|
164
|
-
match[1].split(',').map(id => id.trim()),
|
|
165
|
-
),
|
|
166
|
-
);
|
|
167
|
-
const bibIds = new Set([...bib.matchAll(/@\w+\s*\{\s*([^,\s]+)/g)].map(match => match[1].trim()));
|
|
168
|
-
const bibEntries = countBibEntries(bib);
|
|
169
|
-
|
|
170
|
-
if (!main.includes('\\documentclass')) failures.push('main.tex: missing documentclass');
|
|
171
|
-
if (!main.includes('\\begin{abstract}')) failures.push('main.tex: missing abstract');
|
|
172
|
-
if (!main.includes('\\bibliography{references}'))
|
|
173
|
-
failures.push('main.tex: missing bibliography command');
|
|
174
|
-
if (main.includes('[@')) failures.push('main.tex: contains unconverted Markdown citation syntax');
|
|
175
|
-
if (/^#{1,6}\s/m.test(main))
|
|
176
|
-
failures.push('main.tex: contains unconverted Markdown heading syntax');
|
|
177
|
-
if (main.includes(SEEDED_SECRET)) failures.push('main.tex: contains seeded raw secret');
|
|
178
|
-
if (/([A-Z]:\\|file:\/\/|C:\\Users\\|B:\\Projects\\)/i.test(main))
|
|
179
|
-
failures.push('main.tex: contains a local absolute path');
|
|
180
|
-
if (citationCount < 1) failures.push('main.tex: expected at least one citation');
|
|
181
|
-
if (bibEntries !== 21) failures.push(`references.bib: expected 21 entries, found ${bibEntries}`);
|
|
182
|
-
for (const id of citedIds) {
|
|
183
|
-
if (!bibIds.has(id)) failures.push(`main.tex: cites missing bibliography id ${id}`);
|
|
184
|
-
}
|
|
185
|
-
if (manifest.tex?.citationCount !== citationCount)
|
|
186
|
-
failures.push('arxiv-manifest.json: citation count is stale');
|
|
187
|
-
if (manifest.tex?.bibEntryCount !== bibEntries)
|
|
188
|
-
failures.push('arxiv-manifest.json: bibliography count is stale');
|
|
189
|
-
|
|
190
|
-
return {
|
|
191
|
-
ok: failures.length === 0,
|
|
192
|
-
dir,
|
|
193
|
-
manifestPath,
|
|
194
|
-
files: listedFiles,
|
|
195
|
-
citationCount,
|
|
196
|
-
bibEntries,
|
|
197
|
-
failures,
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function main() {
|
|
202
|
-
const args = parseArgs();
|
|
203
|
-
if (args.help) {
|
|
204
|
-
console.log(usage());
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
const report = verifyArxivSourcePackage(args);
|
|
208
|
-
if (args.json) console.log(JSON.stringify(report, null, 2));
|
|
209
|
-
else if (report.ok) console.log(`arXiv source package verification passed: ${report.dir}`);
|
|
210
|
-
else {
|
|
211
|
-
console.error('arXiv source package verification failed:');
|
|
212
|
-
for (const failure of report.failures) console.error(`- ${failure}`);
|
|
213
|
-
}
|
|
214
|
-
if (!report.ok) process.exit(1);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
218
|
-
try {
|
|
219
|
-
main();
|
|
220
|
-
} catch (error) {
|
|
221
|
-
console.error(error.stack ?? error.message);
|
|
222
|
-
process.exit(1);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { dirname, resolve } from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { publicPath } from '../benchmarks/public-paths.mjs';
|
|
5
|
-
import { validateSchema } from '../benchmarks/validate-guardbench-artifacts.mjs';
|
|
6
|
-
import { verifyPublicationPack } from './verify-publication-pack.mjs';
|
|
7
|
-
|
|
8
|
-
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
|
-
const DEFAULT_PLAN = 'docs/paper/browser-launch-plan.json';
|
|
10
|
-
const DEFAULT_SCHEMA = 'docs/paper/browser-launch-plan.schema.json';
|
|
11
|
-
const REQUIRED_TARGETS = [
|
|
12
|
-
'arxiv-preprint',
|
|
13
|
-
'hacker-news-show',
|
|
14
|
-
'reddit-discussion',
|
|
15
|
-
'x-launch-thread',
|
|
16
|
-
'linkedin-launch-post',
|
|
17
|
-
];
|
|
18
|
-
const REQUIRED_PREFLIGHT_COMMANDS = [
|
|
19
|
-
'npm run release:gate:paper',
|
|
20
|
-
'npm run paper:publication-pack',
|
|
21
|
-
'npm run paper:bundle:verify',
|
|
22
|
-
'npm run paper:launch-plan',
|
|
23
|
-
];
|
|
24
|
-
const ALLOWED_HOSTS = {
|
|
25
|
-
arxiv: ['arxiv.org'],
|
|
26
|
-
'hacker-news': ['news.ycombinator.com'],
|
|
27
|
-
reddit: ['www.reddit.com', 'reddit.com'],
|
|
28
|
-
x: ['twitter.com', 'x.com'],
|
|
29
|
-
linkedin: ['www.linkedin.com', 'linkedin.com'],
|
|
30
|
-
};
|
|
31
|
-
const PLATFORM_ENTRY_RULES = {
|
|
32
|
-
arxiv: new Set(['arxiv-title', 'arxiv-abstract']),
|
|
33
|
-
'hacker-news': new Set(['hacker-news-title', 'hacker-news-comment']),
|
|
34
|
-
reddit: new Set(['reddit-title', 'reddit-body']),
|
|
35
|
-
x: new Set(['x-post-1', 'x-post-2']),
|
|
36
|
-
linkedin: new Set(['linkedin-post']),
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
function fromRoot(path) {
|
|
40
|
-
return resolve(ROOT, path);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function readText(path) {
|
|
44
|
-
const absolute = fromRoot(path);
|
|
45
|
-
if (!existsSync(absolute)) throw new Error(`Missing required file: ${path}`);
|
|
46
|
-
return readFileSync(absolute, 'utf-8');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function readJson(path) {
|
|
50
|
-
return JSON.parse(readText(path));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function parseArgs(argv = process.argv.slice(2)) {
|
|
54
|
-
const args = {
|
|
55
|
-
plan: DEFAULT_PLAN,
|
|
56
|
-
schema: DEFAULT_SCHEMA,
|
|
57
|
-
json: false,
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
for (let i = 0; i < argv.length; i++) {
|
|
61
|
-
const token = argv[i];
|
|
62
|
-
if (token === '--plan' && argv[i + 1]) args.plan = argv[++i];
|
|
63
|
-
else if (token === '--schema' && argv[i + 1]) args.schema = argv[++i];
|
|
64
|
-
else if (token === '--json') args.json = true;
|
|
65
|
-
else if (token === '--help' || token === '-h') args.help = true;
|
|
66
|
-
else throw new Error(`Unknown argument: ${token}`);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return args;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function usage() {
|
|
73
|
-
return `Usage: node scripts/verify-browser-launch-plan.mjs [options]
|
|
74
|
-
|
|
75
|
-
Options:
|
|
76
|
-
--plan <path> Browser launch plan JSON. Default: ${DEFAULT_PLAN}.
|
|
77
|
-
--schema <path> Browser launch plan schema. Default: ${DEFAULT_SCHEMA}.
|
|
78
|
-
--json Print the machine-readable verification report.
|
|
79
|
-
`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function isAllowedHost(platform, value) {
|
|
83
|
-
try {
|
|
84
|
-
const url = new URL(value);
|
|
85
|
-
return (ALLOWED_HOSTS[platform] ?? []).includes(url.hostname);
|
|
86
|
-
} catch {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function hasPendingBoundary(text) {
|
|
92
|
-
return /\b(pending|not claim|not claimed|does not report|remain pending|live evidence|strict evidence)\b/i.test(
|
|
93
|
-
text,
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function validateTarget(target, entryMap, sourceIds) {
|
|
98
|
-
const failures = [];
|
|
99
|
-
const allowedEntries = PLATFORM_ENTRY_RULES[target.platform] ?? new Set();
|
|
100
|
-
const targetEntries = [];
|
|
101
|
-
|
|
102
|
-
if (!isAllowedHost(target.platform, target.url)) {
|
|
103
|
-
failures.push(`${target.id}: URL host is not allowed for ${target.platform}`);
|
|
104
|
-
}
|
|
105
|
-
for (const entryId of target.contentEntryIds) {
|
|
106
|
-
const entry = entryMap.get(entryId);
|
|
107
|
-
if (!entry) {
|
|
108
|
-
failures.push(`${target.id}: unknown publication-pack entry ${entryId}`);
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
if (entry.platform !== target.platform) {
|
|
112
|
-
failures.push(
|
|
113
|
-
`${target.id}: entry ${entryId} belongs to ${entry.platform}, not ${target.platform}`,
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
if (!allowedEntries.has(entryId)) {
|
|
117
|
-
failures.push(`${target.id}: entry ${entryId} is not approved for ${target.platform}`);
|
|
118
|
-
}
|
|
119
|
-
if (entry.text.length > entry.maxChars) {
|
|
120
|
-
failures.push(`${target.id}: entry ${entryId} exceeds maxChars`);
|
|
121
|
-
}
|
|
122
|
-
if (/\b(Mem0|Zep)\b/.test(entry.text) && !hasPendingBoundary(entry.text)) {
|
|
123
|
-
failures.push(
|
|
124
|
-
`${target.id}: entry ${entryId} mentions Mem0/Zep without pending boundary language`,
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
targetEntries.push(entry);
|
|
128
|
-
}
|
|
129
|
-
for (const sourceId of target.sourceRefs) {
|
|
130
|
-
if (!sourceIds.has(sourceId)) failures.push(`${target.id}: unknown sourceRef ${sourceId}`);
|
|
131
|
-
}
|
|
132
|
-
for (const artifact of target.artifactRefs) {
|
|
133
|
-
if (!existsSync(fromRoot(artifact)))
|
|
134
|
-
failures.push(`${target.id}: missing artifactRef ${artifact}`);
|
|
135
|
-
}
|
|
136
|
-
if (target.platform === 'reddit' && target.manualRuleCheckRequired !== true) {
|
|
137
|
-
failures.push(`${target.id}: Reddit target must require a manual subreddit rule check`);
|
|
138
|
-
}
|
|
139
|
-
if (target.platform === 'hacker-news' && target.manualRuleCheckRequired !== true) {
|
|
140
|
-
failures.push(`${target.id}: Hacker News target must require a manual guideline check`);
|
|
141
|
-
}
|
|
142
|
-
if (target.platform === 'arxiv' && target.manualRuleCheckRequired !== true) {
|
|
143
|
-
failures.push(`${target.id}: arXiv target must require a manual category/metadata check`);
|
|
144
|
-
}
|
|
145
|
-
if (!target.humanRequired)
|
|
146
|
-
failures.push(`${target.id}: browser launch targets must require a human operator`);
|
|
147
|
-
if (!target.authRequired)
|
|
148
|
-
failures.push(`${target.id}: browser launch targets must require authenticated account review`);
|
|
149
|
-
if (target.operatorChecks.length < 2)
|
|
150
|
-
failures.push(`${target.id}: operator checklist is too thin`);
|
|
151
|
-
if (target.postSubmitChecks.length < 1) failures.push(`${target.id}: missing post-submit checks`);
|
|
152
|
-
if (
|
|
153
|
-
target.platform === 'x' &&
|
|
154
|
-
target.status === 'blocked-until-artifact-url' &&
|
|
155
|
-
!targetEntries.some(entry => entry.requiresArtifactUrl === true)
|
|
156
|
-
) {
|
|
157
|
-
failures.push(
|
|
158
|
-
`${target.id}: X artifact-url launch target must include a publication entry with reserved URL budget`,
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return failures;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export async function verifyBrowserLaunchPlan(options = {}) {
|
|
166
|
-
const plan = readJson(options.plan ?? DEFAULT_PLAN);
|
|
167
|
-
const schema = readJson(options.schema ?? DEFAULT_SCHEMA);
|
|
168
|
-
const publicationReport = await verifyPublicationPack({ pack: plan.publicationPack });
|
|
169
|
-
const publicationPack = readJson(plan.publicationPack);
|
|
170
|
-
const entryMap = new Map((publicationPack.entries ?? []).map(entry => [entry.id, entry]));
|
|
171
|
-
const sourceIds = new Set((plan.sources ?? []).map(source => source.id));
|
|
172
|
-
const ids = new Set();
|
|
173
|
-
const targetReports = [];
|
|
174
|
-
const failures = [
|
|
175
|
-
...validateSchema(plan, schema, 'audrey-browser-launch-plan').map(
|
|
176
|
-
failure => `browser launch plan schema: ${failure}`,
|
|
177
|
-
),
|
|
178
|
-
];
|
|
179
|
-
|
|
180
|
-
if (!publicationReport.ok) {
|
|
181
|
-
failures.push(...publicationReport.failures.map(failure => `publication pack: ${failure}`));
|
|
182
|
-
}
|
|
183
|
-
if (plan.publicationPack !== 'docs/paper/publication-pack.json') {
|
|
184
|
-
failures.push('browser launch plan must point at docs/paper/publication-pack.json');
|
|
185
|
-
}
|
|
186
|
-
for (const command of REQUIRED_PREFLIGHT_COMMANDS) {
|
|
187
|
-
if (!(plan.preflightCommands ?? []).includes(command))
|
|
188
|
-
failures.push(`Missing browser-launch preflight command: ${command}`);
|
|
189
|
-
}
|
|
190
|
-
for (const target of plan.targets ?? []) {
|
|
191
|
-
const targetFailures = [];
|
|
192
|
-
if (ids.has(target.id)) targetFailures.push(`${target.id}: duplicate target id`);
|
|
193
|
-
ids.add(target.id);
|
|
194
|
-
targetFailures.push(...validateTarget(target, entryMap, sourceIds));
|
|
195
|
-
targetReports.push({
|
|
196
|
-
id: target.id,
|
|
197
|
-
platform: target.platform,
|
|
198
|
-
status: target.status,
|
|
199
|
-
url: target.url,
|
|
200
|
-
contentEntryIds: target.contentEntryIds,
|
|
201
|
-
manualRuleCheckRequired: target.manualRuleCheckRequired,
|
|
202
|
-
ok: targetFailures.length === 0,
|
|
203
|
-
failures: targetFailures,
|
|
204
|
-
});
|
|
205
|
-
failures.push(...targetFailures);
|
|
206
|
-
}
|
|
207
|
-
for (const id of REQUIRED_TARGETS) {
|
|
208
|
-
if (!ids.has(id)) failures.push(`Missing browser-launch target: ${id}`);
|
|
209
|
-
}
|
|
210
|
-
const ordered = [...(plan.targets ?? [])]
|
|
211
|
-
.sort((a, b) => a.order - b.order)
|
|
212
|
-
.map(target => target.id);
|
|
213
|
-
if (ordered.join('|') !== REQUIRED_TARGETS.join('|')) {
|
|
214
|
-
failures.push(`Browser-launch target order must be ${REQUIRED_TARGETS.join(', ')}`);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return {
|
|
218
|
-
schemaVersion: '1.0.0',
|
|
219
|
-
suite: 'Audrey browser launch plan verification',
|
|
220
|
-
generatedAt: new Date().toISOString(),
|
|
221
|
-
ok: failures.length === 0,
|
|
222
|
-
plan: publicPath(fromRoot(options.plan ?? DEFAULT_PLAN)),
|
|
223
|
-
publicationPack: publicPath(fromRoot(plan.publicationPack)),
|
|
224
|
-
targets: targetReports,
|
|
225
|
-
failures,
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
async function main() {
|
|
230
|
-
const args = parseArgs();
|
|
231
|
-
if (args.help) {
|
|
232
|
-
console.log(usage());
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const report = await verifyBrowserLaunchPlan(args);
|
|
237
|
-
if (args.json) {
|
|
238
|
-
console.log(JSON.stringify(report, null, 2));
|
|
239
|
-
} else if (report.ok) {
|
|
240
|
-
console.log(`Browser launch plan verification passed: ${report.targets.length} target(s)`);
|
|
241
|
-
} else {
|
|
242
|
-
console.error('Browser launch plan verification failed:');
|
|
243
|
-
for (const failure of report.failures) console.error(`- ${failure}`);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (!report.ok) process.exit(1);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
250
|
-
main().catch(error => {
|
|
251
|
-
console.error(error.stack ?? error.message);
|
|
252
|
-
process.exit(1);
|
|
253
|
-
});
|
|
254
|
-
}
|