vigiles 28.0.0 → 29.0.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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/adapter-registry.d.ts +39 -0
  3. package/dist/adapter-registry.js +45 -0
  4. package/dist/adapter.d.ts +8 -0
  5. package/dist/adapter.js +10 -1
  6. package/dist/adapters/claude-code/adapter.js +6 -0
  7. package/dist/adapters/claude-code/layout.d.ts +5 -0
  8. package/dist/adapters/claude-code/plugin-loader.d.ts +10 -1
  9. package/dist/adapters/claude-code/plugin-loader.js +10 -1
  10. package/dist/adapters/codex/adapter.js +6 -0
  11. package/dist/adapters/codex/layout.d.ts +51 -5
  12. package/dist/adapters/codex/layout.js +13 -4
  13. package/dist/adapters/opencode/adapter.js +6 -0
  14. package/dist/audit-report.template.html +1 -1
  15. package/dist/audit-score.d.ts +7 -0
  16. package/dist/audit-score.js +49 -2
  17. package/dist/cli-main.js +82 -20
  18. package/dist/core/adapter.d.ts +23 -0
  19. package/dist/core/compile.js +11 -1
  20. package/dist/core/config-schema.d.ts +244 -0
  21. package/dist/core/config-schema.js +452 -0
  22. package/dist/core/refs.js +10 -1
  23. package/dist/core/surface-discovery.d.ts +270 -0
  24. package/dist/core/surface-discovery.js +425 -0
  25. package/dist/core/surface-scopes.d.ts +38 -1
  26. package/dist/core/surface-scopes.js +73 -1
  27. package/dist/core/symbols.d.ts +24 -2
  28. package/dist/core/symbols.js +66 -18
  29. package/dist/core/types.d.ts +36 -107
  30. package/dist/core/validate.d.ts +36 -22
  31. package/dist/core/validate.js +88 -176
  32. package/dist/exclude.d.ts +20 -0
  33. package/dist/exclude.js +11 -1
  34. package/dist/layout-registry.d.ts +14 -0
  35. package/dist/layout-registry.js +40 -0
  36. package/dist/plugin-loader.d.ts +49 -1
  37. package/dist/plugin-loader.js +120 -14
  38. package/dist/scan-core.d.ts +19 -0
  39. package/dist/scan-core.js +30 -0
  40. package/dist/scan-files.js +15 -5
  41. package/dist/scan.d.ts +63 -0
  42. package/dist/scan.js +68 -12
  43. package/dist/score-core.js +8 -0
  44. package/dist/setup-plan.d.ts +2 -1
  45. package/dist/setup-plan.js +7 -2
  46. package/dist/surface-discovery-fs.d.ts +12 -0
  47. package/dist/surface-discovery-fs.js +108 -0
  48. package/dist/vigilesrc.schema.json +1689 -0
  49. package/package.json +10 -6
@@ -133,7 +133,8 @@ export declare const WORKFLOW_RULES: readonly ["require-instructions-spec", "unt
133
133
  */
134
134
  export declare const NUDGE_RULES: readonly ["skill-description-budget", "frontmatter-valid", "skill-frontmatter", "prefer-compiled-hooks", "unmarked-refs", "lethal-trifecta", "skill-resource-resolves", "skill-missing-fence", "plugin-dir-layout", "delegation-trifecta", "hook-block-ineffective", "hook-matcher", "doc-refs"];
135
135
  export declare function mergeProjectConfig(existing: Record<string, unknown>, opts: {
136
- harness: string | string[];
136
+ /** Canonical harness names this repo targets, in the order to declare them. */
137
+ harnesses: readonly string[];
137
138
  strict: boolean;
138
139
  reportOnly?: boolean;
139
140
  /** Whether the LINT pillar is on (default true). The rule gate is a lint-layer
@@ -148,8 +148,13 @@ exports.NUDGE_RULES = [
148
148
  function mergeProjectConfig(existing, opts) {
149
149
  const config = { ...existing };
150
150
  let changed = false;
151
- if (config.harness === undefined) {
152
- config.harness = opts.harness;
151
+ // The NESTED key (#240). `init` writes the declaration with no roots — a repo
152
+ // whose surfaces sit where its harness reads them needs none, and a root is a
153
+ // fact only the owner knows. Writing the flat `harness`/`surfaceRoots` pair
154
+ // here would emit a config the loader now REFUSES, which is why this one line
155
+ // moved with the shape even though the rest of `init` did not.
156
+ if (config.harnesses === undefined) {
157
+ config.harnesses = Object.fromEntries(opts.harnesses.map((h) => [h, {}]));
153
158
  changed = true;
154
159
  }
155
160
  // The rule gate belongs to the LINT layer — a test-only setup records the
@@ -0,0 +1,12 @@
1
+ import { type DiscoveredSurface } from "./core/surface-discovery.js";
2
+ import { type ExcludeSet } from "./exclude.js";
3
+ /**
4
+ * Repo-relative paths of every file inside the bounded root set's surface dirs.
5
+ *
6
+ * Exported for the test that proves the bound holds — a caller that wants
7
+ * surfaces wants {@link discoverSurfacesOnDisk}.
8
+ */
9
+ export declare function boundedSurfacePaths(root: string, excludes?: ExcludeSet): readonly string[];
10
+ /** Every surface the bounded walk finds on disk under `root`, by shape. */
11
+ export declare function discoverSurfacesOnDisk(root: string, excludes?: ExcludeSet): readonly DiscoveredSurface[];
12
+ //# sourceMappingURL=surface-discovery-fs.d.ts.map
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.boundedSurfacePaths = boundedSurfacePaths;
4
+ exports.discoverSurfacesOnDisk = discoverSurfacesOnDisk;
5
+ /**
6
+ * The DISK half of surface discovery: enumerate the repo-relative paths inside
7
+ * the bounded root set, so the pure classifier in `src/core/surface-discovery.ts`
8
+ * can say which of them are surfaces.
9
+ *
10
+ * Paths only — never contents. Discovery answers "is there a surface here that
11
+ * nobody reads", which is a question about NAMES; reading a file nobody claims
12
+ * would be doing the very work the finding says is not being done.
13
+ *
14
+ * 🔴 THE WALK IS BOUNDED BY CONSTRUCTION, NOT BY A DEPTH COUNTER. One `readdir`
15
+ * of the repo root, one per DOT-DIRECTORY found there, and then descent ONLY
16
+ * into a directory named by `SURFACE_SHAPES` (`skills`/`agents`/`commands`).
17
+ * `src/`, `packages/`, `node_modules/` are never entered — there is no traversal
18
+ * that could reach them, so there is no budget to tune and no flag to get wrong.
19
+ * The module header of `core/surface-discovery.ts` holds the reason the bound is
20
+ * this shape and why an adapter may not widen it.
21
+ *
22
+ * `exclude` is applied PER ENTRY, not only at the entry point, for the reason
23
+ * b751471 measured: a vendored tree is normally excluded at its own root
24
+ * (`skills/vendored`), which is a DESCENDANT of a surface dir, so an
25
+ * entry-point-only check lets every one of its files through. Without this, a
26
+ * discovery pass that walks dot-directories would grade copied-in corpora as the
27
+ * repo's own work and the repo's only stated remedy would not reach it.
28
+ *
29
+ * Symlinks go through the ONE policy (`src/fs-walk.ts`): `walkableRoot` at each
30
+ * surface dir the layout-blind walk opens, `entryOf` for every entry below it.
31
+ */
32
+ const node_fs_1 = require("node:fs");
33
+ const node_path_1 = require("node:path");
34
+ const surface_discovery_js_1 = require("./core/surface-discovery.js");
35
+ const exclude_js_1 = require("./exclude.js");
36
+ const fs_walk_js_1 = require("./fs-walk.js");
37
+ /** The shape directory names, as a set — the only dirs the walk descends into. */
38
+ const SHAPE_DIRS = new Set(surface_discovery_js_1.SURFACE_SHAPES.map((s) => s.dir));
39
+ /** Directory entry names under `dir`, or `[]` when it cannot be read. */
40
+ function namesIn(dir) {
41
+ try {
42
+ return (0, node_fs_1.readdirSync)(dir);
43
+ }
44
+ catch {
45
+ return []; // unreadable: the same silence `entryOf` gives, never a throw
46
+ }
47
+ }
48
+ /** Every file path (repo-relative, POSIX) under an opened surface directory. */
49
+ function filesUnder(root, rel, excluded, out) {
50
+ const abs = (0, node_path_1.join)(root, rel);
51
+ for (const name of namesIn(abs)) {
52
+ const childRel = `${rel}/${name}`;
53
+ const childAbs = (0, node_path_1.join)(root, childRel);
54
+ if (excluded(childAbs))
55
+ continue;
56
+ const entry = (0, fs_walk_js_1.entryOf)(childAbs);
57
+ if (entry.kind === "dir")
58
+ filesUnder(root, childRel, excluded, out);
59
+ // `childRel` is built with `/` from `readdir` names (which never contain a
60
+ // separator), so it is already the POSIX form the classifier matches on.
61
+ else if (entry.kind === "file")
62
+ out.push(childRel);
63
+ }
64
+ }
65
+ /**
66
+ * Repo-relative paths of every file inside the bounded root set's surface dirs.
67
+ *
68
+ * Exported for the test that proves the bound holds — a caller that wants
69
+ * surfaces wants {@link discoverSurfacesOnDisk}.
70
+ */
71
+ function boundedSurfacePaths(root, excludes) {
72
+ const excluded = (0, exclude_js_1.excludedBy)(excludes);
73
+ const out = [];
74
+ // The repo root is a discovery root, and so is each of its dot-directories.
75
+ const roots = ["", ...namesIn(root).filter((n) => (0, surface_discovery_js_1.isDiscoveryRoot)(n))];
76
+ for (const base of roots.filter((b) => b === "" || !excluded((0, node_path_1.join)(root, b)))) {
77
+ for (const rel of surfaceDirsIn(root, base)) {
78
+ if (openableSurfaceDir(root, rel, excluded))
79
+ filesUnder(root, rel, excluded, out);
80
+ }
81
+ }
82
+ return out;
83
+ }
84
+ /** Repo-relative surface dirs directly under one discovery root. */
85
+ function surfaceDirsIn(root, base) {
86
+ const baseAbs = base === "" ? root : (0, node_path_1.join)(root, base);
87
+ return namesIn(baseAbs)
88
+ .filter((n) => SHAPE_DIRS.has(n))
89
+ .map((n) => (base === "" ? n : `${base}/${n}`));
90
+ }
91
+ /** May the walk open `<root>/<rel>` as a surface directory? */
92
+ function openableSurfaceDir(root, rel, excluded) {
93
+ const abs = (0, node_path_1.join)(root, rel);
94
+ if (excluded(abs))
95
+ return false;
96
+ // A FILE named `skills` is not a surface dir. A SYMLINKED one is (`entryOf`
97
+ // says "skip" for it, deliberately — that rule is for entries the walk finds
98
+ // INSIDE), so the entry point gets `walkableRoot`, which follows it unless
99
+ // the target contains the scanned root. See src/fs-walk.ts.
100
+ if ((0, fs_walk_js_1.entryOf)(abs).kind === "file")
101
+ return false;
102
+ return (0, fs_walk_js_1.walkableRoot)(abs, root);
103
+ }
104
+ /** Every surface the bounded walk finds on disk under `root`, by shape. */
105
+ function discoverSurfacesOnDisk(root, excludes) {
106
+ return (0, surface_discovery_js_1.discoverSurfaces)(boundedSurfacePaths(root, excludes));
107
+ }
108
+ //# sourceMappingURL=surface-discovery-fs.js.map