@attalabs/vinaya 0.44.1 → 0.47.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/README.md +6 -4
- package/dist/checks/bin/check-body-bare-digits.js +233 -195
- package/dist/checks/bin/check-branch-topology.js +70 -23
- package/dist/checks/bin/check-brief-shape.js +233 -195
- package/dist/checks/bin/check-changeset-coverage.js +94 -16
- package/dist/checks/bin/check-ci-shard-coverage.js +3 -0
- package/dist/checks/bin/check-closes-n.js +128 -34
- package/dist/checks/bin/check-coherence.js +336 -245
- package/dist/checks/bin/check-dispatch-readiness.js +3623 -463
- package/dist/checks/bin/check-doc-claims.js +233 -195
- package/dist/checks/bin/check-doc-coverage-push.js +243 -196
- package/dist/checks/bin/check-doc-coverage.js +243 -196
- package/dist/checks/bin/check-doctrine-no-procedures.js +233 -195
- package/dist/checks/bin/check-doctrine-portability.js +233 -195
- package/dist/checks/bin/check-evidence-fresh.js +9983 -1995
- package/dist/checks/bin/check-exec-bits.js +3 -0
- package/dist/checks/bin/check-first-push-dispatch.js +301 -224
- package/dist/checks/bin/check-issue-milestone-attach.js +65 -10
- package/dist/checks/bin/check-issue-objectives-numbering.js +233 -195
- package/dist/checks/bin/check-issue-parts-coverage.js +65 -10
- package/dist/checks/bin/check-issue-surface-globs.js +1032 -236
- package/dist/checks/bin/check-issue-title-grammar.js +5 -1
- package/dist/checks/bin/check-no-disk-state.js +5 -1
- package/dist/checks/bin/check-pr-premise-reassert.js +10 -1
- package/dist/checks/bin/check-pr-report-density.js +5 -1
- package/dist/checks/bin/check-principal-test-plan-wait.js +253 -201
- package/dist/checks/bin/check-quoted-command.js +233 -195
- package/dist/checks/bin/check-reader-resolvable-prose.js +233 -195
- package/dist/checks/bin/check-registry-gates.js +131 -34
- package/dist/checks/bin/check-retired-vocabulary.js +233 -195
- package/dist/checks/bin/check-review-gate.js +233 -195
- package/dist/checks/bin/check-single-plan-pr.js +5 -1
- package/dist/checks/bin/check-surface-scope.js +107 -32
- package/dist/checks/bin/check-test-plan.js +253 -201
- package/dist/checks/bin/check-token-collection-wired.js +3 -0
- package/dist/checks/bin/check-workspace-escape.js +3 -0
- package/dist/checks/bin/verify-coherence.js +237 -148
- package/dist/checks/bin/verify-dispatch.js +870 -66
- package/dist/checks/bin/verify-docs.js +13 -6
- package/dist/harness.js +57 -10
- package/dist/index.js +16617 -7187
- package/dist/lib/pre-push-cache-test-run.js +4487 -2170
- package/dist/lib/pre-push-changed-files.js +251 -12
- package/dist/lib/pre-push-mode.js +69 -19
- package/dist/lib/pre-push-progress-dir.js +10265 -2853
- package/dist/lib/pre-push-record-tests.js +67 -19
- package/dist/lib/pre-push-select-tests.js +520 -222
- package/dist/lib/push-progress-observer.js +9176 -1757
- package/dist/process.js +2 -0
- package/dist/programs/archive.js +8948 -1547
- package/dist/programs/audit.js +9176 -1772
- package/dist/programs/check.js +9248 -1845
- package/dist/programs/commit-msg.js +8984 -1583
- package/dist/programs/dev-review-loop.js +15612 -7634
- package/dist/programs/dispatch.js +9977 -2726
- package/dist/programs/log-emit.js +9011 -1660
- package/dist/programs/log-selftest.js +8908 -1507
- package/dist/programs/log-send.js +9081 -1594
- package/dist/programs/pr-report.js +9476 -1820
- package/dist/programs/pr-snapshot.js +8916 -1515
- package/dist/programs/pr-verify-evidence.js +9481 -1825
- package/dist/programs/pr.js +11709 -4033
- package/dist/programs/review-post.js +11140 -3496
- package/dist/programs/review-status.js +8996 -1533
- package/dist/programs/run-engine.js +22031 -18759
- package/dist/programs/sync.js +9030 -1629
- package/dist/programs/task-brief.js +10185 -1821
- package/dist/programs/task-sweep.js +9266 -1621
- package/dist/programs/task-tools-serve.js +77118 -16678
- package/dist/programs/tokens.js +8966 -1565
- package/dist/programs/waiver.js +8983 -1582
- package/dist/types/harness/kernel/dev-process-socket/loader/load-process.d.ts +1 -1
- package/dist/types/harness/processes/vinaya-strict/tools/legacy-markers.d.ts +8 -0
- package/dist/types/harness/processes/vinaya-strict/tools/task-contract/brief-validation.d.ts +3 -3
- package/dist/types/harness/processes/vinaya-strict/tools/task-contract/objectives.d.ts +5 -6
- package/dist/vinaya-strict/checks/registry.ts +2 -2
- package/dist/vinaya-strict/executing/developer/developer-doctrine-shape.test.ts +8 -0
- package/dist/vinaya-strict/executing/developer/developer-turn-result.ts +1 -1
- package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.test.ts +2 -2
- package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.ts +30 -20
- package/dist/vinaya-strict/executing/developer/reference.md +5 -3
- package/dist/vinaya-strict/integration/config/vinaya-config-section.ts +29 -7
- package/dist/vinaya-strict/integration/policies/vinaya-policies.ts +4 -4
- package/dist/vinaya-strict/integration/process/process-integration.ts +5 -1
- package/dist/vinaya-strict/process.yaml +6 -1
- package/dist/vinaya-strict/thinking/plan-reviewer/doctrine.md +68 -0
- package/dist/vinaya-strict/thinking/plan-reviewer/grants.yaml +19 -0
- package/dist/vinaya-strict/thinking/plan-reviewer/output.schema.json +388 -0
- package/dist/vinaya-strict/thinking/planner/doctrine.md +4 -1
- package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.test.ts +10 -2
- package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.ts +5 -1
- package/dist/vinaya-strict/thinking/planner/tools/open-issue.test.ts +198 -34
- package/dist/vinaya-strict/thinking/planner/tools/open-issue.ts +120 -193
- package/dist/vinaya-strict/thinking/planner/tools/planner-operations.test.ts +629 -15
- package/dist/vinaya-strict/thinking/planner/tools/planner-operations.ts +726 -62
- package/dist/vinaya-strict/thinking/planner/tools/planner-tools.test.ts +505 -5
- package/dist/vinaya-strict/thinking/planner/tools/planner-tools.ts +636 -21
- package/package.json +3 -2
- package/studio-standalone/apps/vinaya-studio/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/build-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/milestones/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/chunks/209.js +2 -2
- package/studio-standalone/apps/vinaya-studio/.next/server/chunks/951.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/middleware-build-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/pages/500.html +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/preview-props.json +3 -3
- package/studio-standalone/apps/vinaya-studio/.next/server/server-reference-manifest.json +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/151-c365f0ef8268ad13.js +1 -0
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/19-aa314f13784dcc58.js +4 -0
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/{layout-dfa2186095e797bd.js → layout-f038e8deecb2bf5f.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/milestones/{page-2fffb49104860a15.js → page-12314f4deb06a414.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/{page-6ae258f663623b2a.js → page-7a06aa3cdd046fa8.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/tasks/{page-2fffb49104860a15.js → page-12314f4deb06a414.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/css/8eb5ed5b65b9692e.css +1 -0
- package/studio-standalone/apps/vinaya-studio/log-follow.mjs +708 -93
- package/studio-standalone/apps/vinaya-studio/log-sync-folder-source.mjs +699 -84
- package/studio-standalone/apps/vinaya-studio/studio-server.mjs +4692 -3116
- package/vinaya-strict/artifacts/templates/brief-template.md +4 -0
- package/vinaya-strict/artifacts/templates/issue-rationale-template.md +7 -3
- package/vinaya-strict/artifacts/templates/pr-report-template.md +1 -1
- package/vinaya-strict/doctrine/contracts/planner-developer.md +2 -1
- package/vinaya-strict/doctrine/enforcement.md +4 -4
- package/vinaya-strict/doctrine/roles/principal.md +1 -1
- package/vinaya-strict/doctrine/state-machine.md +7 -2
- package/vinaya-strict/executing/developer/reference.md +5 -3
- package/vinaya-strict/thinking/plan-reviewer/doctrine.md +68 -0
- package/vinaya-strict/thinking/planner/doctrine.md +4 -1
- package/vinaya-strict/thinking/planner/reference.md +29 -8
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/151-23bea4cac9687151.js +0 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/853-1d5548ff3a55a75f.js +0 -4
- package/studio-standalone/apps/vinaya-studio/.next/static/css/fb16828fc3128d4c.css +0 -1
- /package/studio-standalone/apps/vinaya-studio/.next/static/{3URbt6IPajL5OOhijN1-x → bJrgAp9Kl4JsCUYkeAYez}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/.next/static/{3URbt6IPajL5OOhijN1-x → bJrgAp9Kl4JsCUYkeAYez}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -23,6 +24,7 @@ var __toCommonJS = (from) => {
|
|
|
23
24
|
return entry;
|
|
24
25
|
};
|
|
25
26
|
var __moduleCache;
|
|
27
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
26
28
|
var __returnValue = (v) => v;
|
|
27
29
|
function __exportSetter(name, newValue) {
|
|
28
30
|
this[name] = __returnValue.bind(null, newValue);
|
|
@@ -47,6 +49,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
47
49
|
throw err[0];
|
|
48
50
|
return res;
|
|
49
51
|
};
|
|
52
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
50
53
|
|
|
51
54
|
// ../../harness/kernel/adapters/code-host/github/strip-code.ts
|
|
52
55
|
function maskCode(body) {
|
|
@@ -213,7 +216,7 @@ function commentMarkerFamily(name) {
|
|
|
213
216
|
function anchorAlternation(spellings) {
|
|
214
217
|
return `(?:${spellings.map((spelling) => spelling.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})`;
|
|
215
218
|
}
|
|
216
|
-
var REGION_PREFIX, PROVENANCE_HEADING, CLAIM_ANCHOR, QUOTES_FILE_ANCHOR, VENDOR_EXAMPLE_ANCHOR, COMMENT_MARKER_PREFIX, FROZEN_BRIEF_MARKER, DEVELOPER_ROUND_MARKER, DEVELOPER_STOP_MARKER, LOOP_PUBLISHED_MARKER, LOOP_PAUSED_MARKER, LOOP_UNPUSHED_WORK_RESUME_MARKER, PRINCIPAL_RULING_MARKER, OBJECTIVES_VERSION_MARKER, DEFERRED_FINDINGS_MARKER, COMMENT_MARKER_PREFIX_CURRENT, COMMENT_MARKER_PREFIXES, COMMENT_MARKER_PREFIX_PATTERN, REGION_PREFIX_CURRENT, REGION_PREFIXES, PROVENANCE_HEADINGS, CLAIM_ANCHORS, QUOTES_FILE_ANCHORS, VENDOR_EXAMPLE_ANCHORS;
|
|
219
|
+
var REGION_PREFIX, PROVENANCE_HEADING, CLAIM_ANCHOR, QUOTES_FILE_ANCHOR, VENDOR_EXAMPLE_ANCHOR, COMMENT_MARKER_PREFIX, FROZEN_BRIEF_MARKER, DEVELOPER_ROUND_MARKER, DEVELOPER_STOP_MARKER, LOOP_PUBLISHED_MARKER, LOOP_PAUSED_MARKER, LOOP_UNPUSHED_WORK_RESUME_MARKER, PRINCIPAL_RULING_MARKER, OBJECTIVES_VERSION_MARKER, DOCUMENTATION_EDIT_MARKER, DEFERRED_FINDINGS_MARKER, COMMENT_MARKER_PREFIX_CURRENT, COMMENT_MARKER_PREFIXES, COMMENT_MARKER_PREFIX_PATTERN, REGION_PREFIX_CURRENT, REGION_PREFIXES, PROVENANCE_HEADINGS, CLAIM_ANCHORS, QUOTES_FILE_ANCHORS, VENDOR_EXAMPLE_ANCHORS;
|
|
217
220
|
var init_legacy_markers = __esm(() => {
|
|
218
221
|
REGION_PREFIX = { old: "AEG", current: "VINAYA" };
|
|
219
222
|
PROVENANCE_HEADING = {
|
|
@@ -235,6 +238,7 @@ var init_legacy_markers = __esm(() => {
|
|
|
235
238
|
LOOP_UNPUSHED_WORK_RESUME_MARKER = commentMarkerFamily("loop:unpushed-work-resume");
|
|
236
239
|
PRINCIPAL_RULING_MARKER = commentMarkerFamily("principal:ruling");
|
|
237
240
|
OBJECTIVES_VERSION_MARKER = commentMarkerFamily("objectives");
|
|
241
|
+
DOCUMENTATION_EDIT_MARKER = commentMarkerFamily("documentation");
|
|
238
242
|
DEFERRED_FINDINGS_MARKER = commentMarkerFamily("deferred-findings");
|
|
239
243
|
COMMENT_MARKER_PREFIX_CURRENT = COMMENT_MARKER_PREFIX.current;
|
|
240
244
|
COMMENT_MARKER_PREFIXES = [COMMENT_MARKER_PREFIX.current, COMMENT_MARKER_PREFIX.old];
|
|
@@ -305,6 +309,7 @@ var init_doctrine_map = __esm(() => {
|
|
|
305
309
|
{ key: "roles/developer.md", source: "executing/developer/doctrine.md", role: "developer", ships: true },
|
|
306
310
|
{ key: "roles/developer/reference.md", source: "executing/developer/reference.md", ships: true },
|
|
307
311
|
{ key: "roles/operator.md", source: "executing/operator/doctrine.md", role: "operator", ships: true },
|
|
312
|
+
{ key: "roles/plan-reviewer.md", source: "thinking/plan-reviewer/doctrine.md", role: "plan-reviewer", ships: true },
|
|
308
313
|
{ key: "roles/planner.md", source: "thinking/planner/doctrine.md", role: "planner", ships: true },
|
|
309
314
|
{ key: "roles/planner/reference.md", source: "thinking/planner/reference.md", ships: true },
|
|
310
315
|
{ key: "roles/principal.md", source: "doctrine/roles/principal.md", role: "principal", ships: true },
|
|
@@ -380,13 +385,13 @@ function installCheckRegistry(checks) {
|
|
|
380
385
|
var registry;
|
|
381
386
|
|
|
382
387
|
// src/lib/package-root.ts
|
|
383
|
-
import { existsSync as
|
|
384
|
-
import { dirname as dirname2, join as
|
|
388
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
389
|
+
import { dirname as dirname2, join as join4 } from "node:path";
|
|
385
390
|
import { fileURLToPath } from "node:url";
|
|
386
391
|
function packageRoot(moduleUrl) {
|
|
387
392
|
let dir = dirname2(fileURLToPath(moduleUrl));
|
|
388
|
-
while (!
|
|
389
|
-
if (
|
|
393
|
+
while (!existsSync4(join4(dir, "package.json"))) {
|
|
394
|
+
if (existsSync4(join4(dir, ".git")))
|
|
390
395
|
break;
|
|
391
396
|
const parent = dirname2(dir);
|
|
392
397
|
if (parent === dir)
|
|
@@ -401,15 +406,15 @@ function cliPackageRoot() {
|
|
|
401
406
|
var init_package_root = () => {};
|
|
402
407
|
|
|
403
408
|
// ../../harness/processes/vinaya-strict/checks/registry.ts
|
|
404
|
-
import { join as
|
|
409
|
+
import { join as join5, relative as relative2, sep as sep2 } from "node:path";
|
|
405
410
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
406
411
|
function resolveCheckBin(packageDir, moduleUrl) {
|
|
407
412
|
const fromPackage = relative2(packageDir, fileURLToPath2(moduleUrl));
|
|
408
413
|
const bundled = fromPackage === "dist" || fromPackage.startsWith(`dist${sep2}`);
|
|
409
|
-
return bundled ? { dir:
|
|
414
|
+
return bundled ? { dir: join5(packageDir, "dist", "checks", "bin"), ext: ".js" } : { dir: join5(packageDir, "..", "..", "harness/processes/vinaya-strict/checks/bin"), ext: ".ts" };
|
|
410
415
|
}
|
|
411
416
|
function bin(name) {
|
|
412
|
-
return
|
|
417
|
+
return join5(BIN_DIR, `${name}${BIN_EXT}`);
|
|
413
418
|
}
|
|
414
419
|
function coreCheckRegistry() {
|
|
415
420
|
return REGISTRY.map(([spec]) => spec);
|
|
@@ -1006,7 +1011,7 @@ var init_registry = __esm(() => {
|
|
|
1006
1011
|
|
|
1007
1012
|
// ../../harness/processes/vinaya-strict/checks/bin/check-registry-gates.ts
|
|
1008
1013
|
import { execSync, execFileSync } from "node:child_process";
|
|
1009
|
-
import { existsSync as
|
|
1014
|
+
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
1010
1015
|
import matter from "gray-matter";
|
|
1011
1016
|
|
|
1012
1017
|
// ../../harness/processes/vinaya-strict/checks/doctrine-portability.ts
|
|
@@ -1527,10 +1532,30 @@ function findCrossingFiles(candidateFiles) {
|
|
|
1527
1532
|
}
|
|
1528
1533
|
|
|
1529
1534
|
// ../../harness/processes/vinaya-strict/checks/log-producer-graph.ts
|
|
1535
|
+
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
1536
|
+
import { join as join3, relative, sep } from "node:path";
|
|
1537
|
+
|
|
1538
|
+
// ../../harness/kernel/imports/alias-table.ts
|
|
1530
1539
|
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
1531
|
-
import { join as join2,
|
|
1540
|
+
import { join as join2, posix } from "node:path";
|
|
1532
1541
|
// ../../packages/test-selection/src/hunk-classes.ts
|
|
1533
1542
|
var LOAD_ERROR_CODES = new Set([2300, 2392, 2393, 2440, 2448, 2449, 2450, 2451]);
|
|
1543
|
+
// ../../packages/test-selection/src/path-aliases.ts
|
|
1544
|
+
function resolveAliasedSpecifier(specifier, table) {
|
|
1545
|
+
if (!table)
|
|
1546
|
+
return null;
|
|
1547
|
+
let best = null;
|
|
1548
|
+
for (const alias of table) {
|
|
1549
|
+
if (!specifier.startsWith(alias.prefix) || specifier.length === alias.prefix.length)
|
|
1550
|
+
continue;
|
|
1551
|
+
if (!best || alias.prefix.length > best.prefix.length)
|
|
1552
|
+
best = alias;
|
|
1553
|
+
}
|
|
1554
|
+
return best ? `${best.directory}${specifier.slice(best.prefix.length)}` : null;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
// ../../packages/test-selection/src/compiler-graph.ts
|
|
1558
|
+
var compilerIdentities = new WeakMap;
|
|
1534
1559
|
// ../../packages/test-selection/src/inventory.ts
|
|
1535
1560
|
var READER_KINDS = new Set(["code", "raw-bytes", "semantic", "parsed-keys", "schema-policy"]);
|
|
1536
1561
|
var EDGE_KINDS = new Set([
|
|
@@ -1587,7 +1612,7 @@ var OPEN_CALLS = new Set(["open", "openat", "openat2", "creat"]);
|
|
|
1587
1612
|
var GIT_PATH_READERS = new Set(["show", "cat-file", "rev-parse"]);
|
|
1588
1613
|
// ../../packages/test-selection/src/selector.ts
|
|
1589
1614
|
import { readdirSync as readdirSync2, readFileSync as readFileSync2, statSync as statSync2 } from "node:fs";
|
|
1590
|
-
import { dirname, extname, isAbsolute, join, resolve } from "node:path";
|
|
1615
|
+
import { basename as basename2, dirname, extname, isAbsolute, join, resolve } from "node:path";
|
|
1591
1616
|
|
|
1592
1617
|
// ../../packages/test-selection/src/scanner-inputs.ts
|
|
1593
1618
|
var TREE_READERS = new Set([
|
|
@@ -1753,12 +1778,82 @@ function resolveRelativeImport(fromFile, specifier, knownFiles) {
|
|
|
1753
1778
|
return null;
|
|
1754
1779
|
return resolveFileCandidate(resolve(dirname(fromFile), specifier), knownFiles);
|
|
1755
1780
|
}
|
|
1781
|
+
function resolveAliasedImport(root, specifier, table, knownFiles) {
|
|
1782
|
+
const path = resolveAliasedSpecifier(specifier, table);
|
|
1783
|
+
return path === null ? null : resolveFileCandidate(join(root, path), knownFiles);
|
|
1784
|
+
}
|
|
1756
1785
|
var TYPE_ONLY_CONDITIONS = new Set(["types", "typings"]);
|
|
1786
|
+
var yamlEscapes = new Map([
|
|
1787
|
+
["0", "\x00"],
|
|
1788
|
+
["a", "\x07"],
|
|
1789
|
+
["b", "\b"],
|
|
1790
|
+
["t", "\t"],
|
|
1791
|
+
["\t", "\t"],
|
|
1792
|
+
["n", `
|
|
1793
|
+
`],
|
|
1794
|
+
["v", "\v"],
|
|
1795
|
+
["f", "\f"],
|
|
1796
|
+
["r", "\r"],
|
|
1797
|
+
["e", "\x1B"],
|
|
1798
|
+
[" ", " "],
|
|
1799
|
+
['"', '"'],
|
|
1800
|
+
["/", "/"],
|
|
1801
|
+
["\\", "\\"],
|
|
1802
|
+
["N", "
"],
|
|
1803
|
+
["_", " "],
|
|
1804
|
+
["L", "\u2028"],
|
|
1805
|
+
["P", "\u2029"]
|
|
1806
|
+
]);
|
|
1757
1807
|
var PACKAGE_TEST_DATA_FOLDERS = new Set(["tests", "test", "__tests__", "specs", "fixtures"]);
|
|
1758
1808
|
var PACKAGE_PROSE_FILE_NAMES = new Set(["README.md", "CHANGELOG.md", "LICENSE"]);
|
|
1809
|
+
var DEPENDENCY_LISTS = new Set(["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]);
|
|
1759
1810
|
|
|
1760
1811
|
// ../../packages/test-selection/src/recorder.ts
|
|
1761
1812
|
var RECORDER_TIME_LIMIT_MS = 15 * 60000;
|
|
1813
|
+
// ../../harness/kernel/imports/alias-table.ts
|
|
1814
|
+
var BASE_CONFIG_PATH = "packages/typescript-config/base.json";
|
|
1815
|
+
function parseAliasTable(configText, configPath = BASE_CONFIG_PATH) {
|
|
1816
|
+
let document;
|
|
1817
|
+
try {
|
|
1818
|
+
document = JSON.parse(configText);
|
|
1819
|
+
} catch {
|
|
1820
|
+
return [];
|
|
1821
|
+
}
|
|
1822
|
+
const options = document?.compilerOptions;
|
|
1823
|
+
const paths = options?.paths;
|
|
1824
|
+
if (!paths || typeof paths !== "object" || Array.isArray(paths))
|
|
1825
|
+
return [];
|
|
1826
|
+
const out = [];
|
|
1827
|
+
for (const [key, targets] of Object.entries(paths)) {
|
|
1828
|
+
if (!key.endsWith("/*") || !Array.isArray(targets) || targets.length !== 1)
|
|
1829
|
+
continue;
|
|
1830
|
+
const target = targets[0];
|
|
1831
|
+
if (typeof target !== "string" || !target.endsWith("/*"))
|
|
1832
|
+
continue;
|
|
1833
|
+
const directory = posix.normalize(posix.join(posix.dirname(configPath), target.slice(0, -1))).replace(/\/$/, "");
|
|
1834
|
+
if (directory === "" || directory === "." || directory.startsWith(".."))
|
|
1835
|
+
continue;
|
|
1836
|
+
out.push({ prefix: key.slice(0, -1), directory: `${directory}/` });
|
|
1837
|
+
}
|
|
1838
|
+
return out;
|
|
1839
|
+
}
|
|
1840
|
+
var cache = new Map;
|
|
1841
|
+
function readAliasTable(repoRoot) {
|
|
1842
|
+
const file = join2(repoRoot, BASE_CONFIG_PATH);
|
|
1843
|
+
try {
|
|
1844
|
+
if (!existsSync2(file))
|
|
1845
|
+
return [];
|
|
1846
|
+
const text = readFileSync3(file, "utf8");
|
|
1847
|
+
const held = cache.get(file);
|
|
1848
|
+
if (held && held.text === text)
|
|
1849
|
+
return held.table;
|
|
1850
|
+
const table = parseAliasTable(text, BASE_CONFIG_PATH);
|
|
1851
|
+
cache.set(file, { text, table });
|
|
1852
|
+
return table;
|
|
1853
|
+
} catch {
|
|
1854
|
+
return [];
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1762
1857
|
// ../../harness/processes/vinaya-strict/integration/repository-verification.ts
|
|
1763
1858
|
function walkFiles(root) {
|
|
1764
1859
|
return walkTree(diskTree(root), root);
|
|
@@ -1768,16 +1863,16 @@ function walkFiles(root) {
|
|
|
1768
1863
|
var CLI_SOURCE_DIR = "apps/cli/src";
|
|
1769
1864
|
var PROCESSES_DIR = "harness/processes";
|
|
1770
1865
|
var KERNEL_DIR = "harness/kernel";
|
|
1771
|
-
var
|
|
1772
|
-
var
|
|
1866
|
+
var RUN_RECORDER_PATH = "harness/kernel/log/run-recorder.ts";
|
|
1867
|
+
var RUN_RECORDER_PRODUCER_NAMES = ["runRecorder", "createRunRecorder"];
|
|
1773
1868
|
var G7_EXEMPTIONS_PATH = ".vinaya/g7-exemptions.json";
|
|
1774
1869
|
function readG7Exemptions(root) {
|
|
1775
|
-
const path =
|
|
1776
|
-
if (!
|
|
1870
|
+
const path = join3(root, G7_EXEMPTIONS_PATH);
|
|
1871
|
+
if (!existsSync3(path))
|
|
1777
1872
|
return {};
|
|
1778
1873
|
let parsed;
|
|
1779
1874
|
try {
|
|
1780
|
-
parsed = JSON.parse(
|
|
1875
|
+
parsed = JSON.parse(readFileSync4(path, "utf8"));
|
|
1781
1876
|
} catch (error) {
|
|
1782
1877
|
throw new Error(`${G7_EXEMPTIONS_PATH} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
1783
1878
|
}
|
|
@@ -1797,22 +1892,24 @@ function blockingGateFiles(ring0Rows, existsFn) {
|
|
|
1797
1892
|
}
|
|
1798
1893
|
function gatherLogProducerGraph(root) {
|
|
1799
1894
|
const files = [
|
|
1800
|
-
...walkFiles(
|
|
1801
|
-
...[PROCESSES_DIR, KERNEL_DIR].flatMap((dir) => walkFiles(
|
|
1895
|
+
...walkFiles(join3(root, CLI_SOURCE_DIR)),
|
|
1896
|
+
...[PROCESSES_DIR, KERNEL_DIR].flatMap((dir) => walkFiles(join3(root, dir)).filter((f) => !relative(root, f).split(sep).includes("tests")))
|
|
1802
1897
|
].filter((f) => f.endsWith(".ts") && !f.endsWith(".test.ts"));
|
|
1803
1898
|
const known = new Set(files);
|
|
1804
|
-
const
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1899
|
+
const recorder = join3(root, RUN_RECORDER_PATH);
|
|
1900
|
+
const producers = new Set;
|
|
1901
|
+
if (known.has(recorder))
|
|
1902
|
+
producers.add(RUN_RECORDER_PATH);
|
|
1807
1903
|
const imports = new Map;
|
|
1904
|
+
const aliases = readAliasTable(root);
|
|
1808
1905
|
for (const file of files) {
|
|
1809
1906
|
const deps = [];
|
|
1810
|
-
for (const record of extractImportRecords(
|
|
1811
|
-
const target = resolveRelativeImport(file, record.specifier, known);
|
|
1907
|
+
for (const record of extractImportRecords(readFileSync4(file, "utf8"))) {
|
|
1908
|
+
const target = resolveRelativeImport(file, record.specifier, known) ?? resolveAliasedImport(root, record.specifier, aliases, known);
|
|
1812
1909
|
if (target === null)
|
|
1813
1910
|
continue;
|
|
1814
1911
|
deps.push(relative(root, target));
|
|
1815
|
-
if (target ===
|
|
1912
|
+
if (target === recorder && record.kind === "named" && record.names.some((n) => RUN_RECORDER_PRODUCER_NAMES.includes(n))) {
|
|
1816
1913
|
producers.add(relative(root, file));
|
|
1817
1914
|
}
|
|
1818
1915
|
}
|
|
@@ -1826,9 +1923,9 @@ init_registry();
|
|
|
1826
1923
|
var CHECK_NAME = "registry-gates";
|
|
1827
1924
|
var ENFORCEMENT_PATH = doctrineRepoPath("enforcement.md");
|
|
1828
1925
|
function readHookScanFiles() {
|
|
1829
|
-
return DOCTRINE_REPO_PATHS.filter((path) =>
|
|
1926
|
+
return DOCTRINE_REPO_PATHS.filter((path) => existsSync5(path)).map((path) => ({
|
|
1830
1927
|
path,
|
|
1831
|
-
content:
|
|
1928
|
+
content: readFileSync5(path, "utf8")
|
|
1832
1929
|
}));
|
|
1833
1930
|
}
|
|
1834
1931
|
function shippedHookPaths() {
|
|
@@ -1837,11 +1934,11 @@ function shippedHookPaths() {
|
|
|
1837
1934
|
return new Set([...tracked, ...initHookPaths()]);
|
|
1838
1935
|
}
|
|
1839
1936
|
function presentPaths(entries) {
|
|
1840
|
-
return [...entries].sort((a, b) => a.key.localeCompare(b.key)).map((entry) => doctrineRepoPath(entry.key)).filter((path) =>
|
|
1937
|
+
return [...entries].sort((a, b) => a.key.localeCompare(b.key)).map((entry) => doctrineRepoPath(entry.key)).filter((path) => existsSync5(path));
|
|
1841
1938
|
}
|
|
1842
1939
|
function readRoles() {
|
|
1843
1940
|
return presentPaths(ROLE_KEY_ENTRIES).map((rel) => {
|
|
1844
|
-
const { data } = matter(
|
|
1941
|
+
const { data } = matter(readFileSync5(rel, "utf8"));
|
|
1845
1942
|
return {
|
|
1846
1943
|
file: rel,
|
|
1847
1944
|
role_id: typeof data.role_id === "string" ? data.role_id : "",
|
|
@@ -1852,7 +1949,7 @@ function readRoles() {
|
|
|
1852
1949
|
}
|
|
1853
1950
|
function readContracts() {
|
|
1854
1951
|
return presentPaths(CONTRACT_ENTRIES).map((rel) => {
|
|
1855
|
-
const { data } = matter(
|
|
1952
|
+
const { data } = matter(readFileSync5(rel, "utf8"));
|
|
1856
1953
|
return {
|
|
1857
1954
|
file: rel,
|
|
1858
1955
|
producer: typeof data.producer === "string" ? data.producer : "",
|
|
@@ -1923,7 +2020,7 @@ function emitResult(result, blocking) {
|
|
|
1923
2020
|
}
|
|
1924
2021
|
}
|
|
1925
2022
|
async function main() {
|
|
1926
|
-
if (!
|
|
2023
|
+
if (!existsSync5(ENFORCEMENT_PATH)) {
|
|
1927
2024
|
emitCheckError({
|
|
1928
2025
|
schema: CHECK_SCHEMA_VERSION,
|
|
1929
2026
|
check: `${CHECK_NAME}.dormant`,
|
|
@@ -1933,7 +2030,7 @@ async function main() {
|
|
|
1933
2030
|
});
|
|
1934
2031
|
process.exit(0);
|
|
1935
2032
|
}
|
|
1936
|
-
const enforcementContent =
|
|
2033
|
+
const enforcementContent = readFileSync5(ENFORCEMENT_PATH, "utf8");
|
|
1937
2034
|
const rows = parseEnforcementRegistry(enforcementContent);
|
|
1938
2035
|
const ring0Rows = rows.filter((r) => r.ring === "ring0");
|
|
1939
2036
|
const candidateFiles = globCandidateFiles();
|
|
@@ -1951,7 +2048,7 @@ async function main() {
|
|
|
1951
2048
|
}
|
|
1952
2049
|
]
|
|
1953
2050
|
};
|
|
1954
|
-
const g1 = checkG1(rows,
|
|
2051
|
+
const g1 = checkG1(rows, existsSync5, { docs: readHookScanFiles(), shipped: shippedHookPaths() });
|
|
1955
2052
|
const g2 = checkG2(rows, candidateFiles);
|
|
1956
2053
|
const g3 = checkG3(ring0Rows, crossingFiles);
|
|
1957
2054
|
const g5 = checkG5(roles, contracts);
|
|
@@ -1960,11 +2057,11 @@ async function main() {
|
|
|
1960
2057
|
const g7 = checkG7({
|
|
1961
2058
|
enforcementMapPresent: true,
|
|
1962
2059
|
crossingFiles,
|
|
1963
|
-
blockingFiles: blockingGateFiles(ring0Rows,
|
|
2060
|
+
blockingFiles: blockingGateFiles(ring0Rows, existsSync5),
|
|
1964
2061
|
producers,
|
|
1965
2062
|
imports,
|
|
1966
2063
|
exemptions: readG7Exemptions(process.cwd()),
|
|
1967
|
-
existsFn:
|
|
2064
|
+
existsFn: existsSync5
|
|
1968
2065
|
});
|
|
1969
2066
|
emitResult(g1, true);
|
|
1970
2067
|
emitResult(g2, true);
|