vigiles 40.0.0 → 41.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.
- package/README.md +9 -8
- package/dist/adapter.d.ts +1 -1
- package/dist/adapters/claude-code/skill-listing.d.ts +27 -5
- package/dist/adapters/claude-code/skill-listing.js +29 -1
- package/dist/adapters/codex/skill-listing.d.ts +22 -4
- package/dist/adapters/codex/skill-listing.js +30 -1
- package/dist/audit-report.template.html +33 -43
- package/dist/cli-main.d.ts +4 -3
- package/dist/cli-main.js +121 -25
- package/dist/context-creep-lint.d.ts +123 -0
- package/dist/context-creep-lint.js +397 -0
- package/dist/core/always-loaded-limits.d.ts +118 -0
- package/dist/core/always-loaded-limits.js +175 -0
- package/dist/core/always-loaded.d.ts +15 -1
- package/dist/core/always-loaded.js +9 -0
- package/dist/core/baseline-store.d.ts +183 -0
- package/dist/core/baseline-store.js +392 -0
- package/dist/core/instruction-weight.d.ts +3 -3
- package/dist/core/instruction-weight.js +3 -3
- package/dist/core/legacy-baseline.d.ts +70 -0
- package/dist/core/legacy-baseline.js +117 -0
- package/dist/core/skill-listing.d.ts +24 -0
- package/dist/core/types.d.ts +14 -6
- package/dist/local-files.js +2 -2
- package/dist/rules/index.d.ts +25 -2
- package/dist/rules/index.js +22 -9
- package/dist/scan.js +27 -1
- package/dist/vigilesrc.schema.json +32 -0
- package/hooks/session-start.sh +4 -3
- package/package.json +1 -1
- package/dist/context-creep-ratchet.d.ts +0 -88
- package/dist/context-creep-ratchet.js +0 -270
- package/dist/core/instruction-baseline.d.ts +0 -333
- package/dist/core/instruction-baseline.js +0 -570
package/README.md
CHANGED
|
@@ -73,13 +73,14 @@
|
|
|
73
73
|
block; ONE idea per sentence; NO internal vocabulary (moat/flywheel) / NO
|
|
74
74
|
research/ links / NO enterprise/national-interest framing — name the user
|
|
75
75
|
benefit; ~220-line body cap; push depth into docs/ and LINK it. Assets: the hero
|
|
76
|
-
vigiles-audit.png is a REPRESENTATIVE report ("my-plugin", C 77) — the
|
|
77
|
-
|
|
78
|
-
enforced" preview is DEMOTED low + badged EXPERIMENTAL
|
|
79
|
-
research/rule-enforcer-design.md §8)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
prefers-color-scheme:dark emulated + a fullPage screenshot
|
|
76
|
+
vigiles-audit.png is a REPRESENTATIVE report ("my-plugin", C 77) — the grade
|
|
77
|
+
gauge + category rings + "Do these first" + broken references + always-loaded
|
|
78
|
+
context. The "Your rules → enforced" preview is DEMOTED low + badged EXPERIMENTAL
|
|
79
|
+
(the rule map is alpha — research/rule-enforcer-design.md §8) and sits below the
|
|
80
|
+
crop. Re-render if the UI changes: `npm run build` (rebuilds
|
|
81
|
+
report/dist/index.html from the SAMPLE fixture), then headless Chromium at a
|
|
82
|
+
1100px viewport with prefers-color-scheme:dark emulated + a fullPage screenshot
|
|
83
|
+
at deviceScaleFactor 2, cropped at the bottom of the always-loaded section
|
|
83
84
|
→ vigiles-audit.png (2200px wide).
|
|
84
85
|
-->
|
|
85
86
|
|
|
@@ -127,7 +128,7 @@ It's free and open-source, runs entirely on your machine, and never bills per to
|
|
|
127
128
|
## What it caught
|
|
128
129
|
|
|
129
130
|
<p align="center">
|
|
130
|
-
<img src="vigiles-audit.png" width="760" alt="vigiles audit report for my-plugin: a
|
|
131
|
+
<img src="vigiles-audit.png" width="760" alt="vigiles audit report for my-plugin: a C grade gauge (77/100) beside the verdict 'Two one-line fixes away from a B.' and '3 points to B', score rings for Truthfulness, Triggering, Structure and Safety plus dashed advisory rings for Tested and Evaluated, the findings in full, a numbered 'Do these first' list with '+N pts' gains, broken-reference findings, and the always-loaded context total split into three shares" />
|
|
131
132
|
</p>
|
|
132
133
|
|
|
133
134
|
**Like Google's Lighthouse, but for your agent harness.** One command grades it A–F across six categories, leads with a plain-English verdict — _"two one-line fixes away from a B"_ — and ranks every fix by the points it buys back:
|
package/dist/adapter.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type { HarnessAdapter, AdapterCapabilities } from "./core/adapter.js";
|
|
|
19
19
|
export type { HarnessDialect } from "./core/dialect.js";
|
|
20
20
|
export type { PluginLayout, SkillDiscovery, SurfaceDirs, SurfaceKind, } from "./core/layout.js";
|
|
21
21
|
export type { OutputStyle, OutputStyleRules, StyleSelection, } from "./core/output-style.js";
|
|
22
|
-
export type { ListedSkill, SkillListingRules } from "./core/skill-listing.js";
|
|
22
|
+
export type { ListedSkill, ListingLimit, SkillListingBudget, SkillListingRules, } from "./core/skill-listing.js";
|
|
23
23
|
export type { ModelRequest } from "./core/harness-driver.js";
|
|
24
24
|
export { executableSourceDirs, materializePrefix, surfaceDirs, } from "./core/layout.js";
|
|
25
25
|
/**
|
|
@@ -38,11 +38,33 @@
|
|
|
38
38
|
* binary with it; modelling them while CI runs the pinned release would leave
|
|
39
39
|
* the delivery test proving nothing.
|
|
40
40
|
*
|
|
41
|
-
* The listing as a WHOLE also has a budget
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* The listing as a WHOLE also has a budget, past which descriptions are
|
|
42
|
+
* dropped by least use. Read from the pinned 2.1.187 binary
|
|
43
|
+
* (`@anthropic-ai/claude-code-linux-x64@2.1.187`, sha256 bb02fcb3…bf361):
|
|
44
|
+
*
|
|
45
|
+
* budget = floor(contextWindowTokens × charsPerToken × fraction)
|
|
46
|
+
*
|
|
47
|
+
* - `fraction` is `skillListingBudgetFraction` from settings, default 0.01
|
|
48
|
+
* (`var FRd=0.01`);
|
|
49
|
+
* - `contextWindowTokens` defaults to 200 000 (`URd=200000`), 1 000 000 on
|
|
50
|
+
* a 1M-context model;
|
|
51
|
+
* - `charsPerToken` is 4 for the models in a fixed set (claude-3-*,
|
|
52
|
+
* opus-4-0/4-1/4-5/4-6, sonnet-4-0/4-5/4-6, haiku-4-5) and 3 for every
|
|
53
|
+
* other model (`function oA(e){if(!e)return 4;…return l3u.has(n)?4:3}`);
|
|
54
|
+
* - the env var `SLASH_COMMAND_TOOL_CHAR_BUDGET` replaces the whole number.
|
|
55
|
+
*
|
|
56
|
+
* The listing is measured against it as the sum of each entry's display width
|
|
57
|
+
* (`Bun.stringWidth`, not `.length`) plus one newline between entries, over
|
|
58
|
+
* every listed skill — bundled, user and plugin skills included, not only the
|
|
59
|
+
* repository's. Its floor is 200 000 × 3 × 0.01 = 6 000 characters, and that
|
|
60
|
+
* floor is {@link claudeCodeListingBudget}: the window and the chars per token
|
|
61
|
+
* depend on the model a person picks, so the smallest a commit can be sure of
|
|
62
|
+
* is what vigiles holds it to. A committed `skillListingBudgetFraction` moves
|
|
63
|
+
* it; the environment variable is per machine and is not read. vigiles sums
|
|
64
|
+
* entry LENGTHS without the newlines, an under-count of one character per
|
|
65
|
+
* listed skill (and more for wide characters, which `stringWidth` counts as 2).
|
|
45
66
|
*/
|
|
46
|
-
import type { SkillListingRules } from "../../core/skill-listing.js";
|
|
67
|
+
import type { SkillListingBudget, SkillListingRules } from "../../core/skill-listing.js";
|
|
68
|
+
export declare const claudeCodeListingBudget: SkillListingBudget;
|
|
47
69
|
export declare const claudeCodeSkillListing: SkillListingRules;
|
|
48
70
|
//# sourceMappingURL=skill-listing.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.claudeCodeSkillListing = void 0;
|
|
3
|
+
exports.claudeCodeSkillListing = exports.claudeCodeListingBudget = void 0;
|
|
4
4
|
/** The documented per-entry cap, in characters (UTF-16 units, as measured). */
|
|
5
5
|
const ENTRY_CAP = 1536;
|
|
6
6
|
/** What replaces the cut tail; the cap includes it. */
|
|
@@ -47,8 +47,36 @@ const entry = (skill, settings) => {
|
|
|
47
47
|
const combined = whenToUse === undefined ? description : `${description} - ${whenToUse}`;
|
|
48
48
|
return `- ${skill.dirName}: ${capped(combined, capFrom(settings))}`;
|
|
49
49
|
};
|
|
50
|
+
/** The context window the budget is computed on: the CLI's default, `URd=200000`. */
|
|
51
|
+
const FLOOR_WINDOW_TOKENS = 200_000;
|
|
52
|
+
/** Characters per token for every model outside the CLI's older-model set. */
|
|
53
|
+
const FLOOR_CHARS_PER_TOKEN = 3;
|
|
54
|
+
/** `skillListingBudgetFraction`'s default, `FRd=0.01`. */
|
|
55
|
+
const DEFAULT_FRACTION = 0.01;
|
|
56
|
+
/** The setting that moves the fraction, as the settings schema names it. */
|
|
57
|
+
const FRACTION_SETTING = "skillListingBudgetFraction";
|
|
58
|
+
/** The committed fraction when the CLI would accept it (`gt(0).lte(1)`), else none. */
|
|
59
|
+
const fractionFrom = (settings) => {
|
|
60
|
+
const v = settings[FRACTION_SETTING];
|
|
61
|
+
return typeof v === "number" && v > 0 && v <= 1 ? v : undefined;
|
|
62
|
+
};
|
|
63
|
+
/** `Math.max(1, Math.floor(window × charsPerToken × fraction))`, as the CLI computes it. */
|
|
64
|
+
const listingLimit = (settings) => {
|
|
65
|
+
const fraction = fractionFrom(settings);
|
|
66
|
+
const limit = Math.max(1, Math.floor(FLOOR_WINDOW_TOKENS *
|
|
67
|
+
FLOOR_CHARS_PER_TOKEN *
|
|
68
|
+
(fraction ?? DEFAULT_FRACTION)));
|
|
69
|
+
return fraction === undefined
|
|
70
|
+
? { limit }
|
|
71
|
+
: { limit, setBy: FRACTION_SETTING };
|
|
72
|
+
};
|
|
73
|
+
exports.claudeCodeListingBudget = {
|
|
74
|
+
limit: listingLimit,
|
|
75
|
+
capturedFrom: "claude-code 2.1.187 binary (sha256 bb02fcb3…bf361): function E2e — floor((window ?? 200000) × oA(model) × (skillListingBudgetFraction ?? 0.01)), oA = 4 for an older-model set else 3; floor at 200000 × 3",
|
|
76
|
+
};
|
|
50
77
|
exports.claudeCodeSkillListing = {
|
|
51
78
|
entry,
|
|
79
|
+
budget: exports.claudeCodeListingBudget,
|
|
52
80
|
capturedFrom: "code.claude.com/docs/en/skills (fetched 2026-10-31); measured on Claude Code 2.1.187 (VALIDATED_CC_VERSION)",
|
|
53
81
|
};
|
|
54
82
|
//# sourceMappingURL=skill-listing.js.map
|
|
@@ -33,10 +33,28 @@
|
|
|
33
33
|
* path; the size is reproducible from a commit, and each entry is off by
|
|
34
34
|
* the difference between that path and the one Codex printed.
|
|
35
35
|
*
|
|
36
|
-
* The listing as a whole has a budget
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* The listing as a whole has a budget, past which descriptions are shortened
|
|
37
|
+
* and then skills omitted ("Exceeded skills context budget …"). Read from
|
|
38
|
+
* `codex-rs/ext/skills/src/render.rs` and `extension.rs` at tag rust-v0.153.0
|
|
39
|
+
* (`skill_metadata_budget`):
|
|
40
|
+
*
|
|
41
|
+
* - a configured `max_context_tokens` wins, capped at 10 000 tokens;
|
|
42
|
+
* - else, at THREAD START (`CatalogSurface::ThreadContext`), the window is
|
|
43
|
+
* passed as `None`, so the budget is 8 000 CHARACTERS
|
|
44
|
+
* (`DEFAULT_SKILL_METADATA_CHAR_BUDGET`), each line costing its Unicode
|
|
45
|
+
* scalar count plus one newline;
|
|
46
|
+
* - on a TURN (`CatalogSurface::TurnInput`) it is 2% of the model's context
|
|
47
|
+
* window in tokens, each line costing ceil((bytes + 1) / 4).
|
|
48
|
+
*
|
|
49
|
+
* The thread-start number does not depend on the model, so it is
|
|
50
|
+
* {@link codexListingBudget}: 8 000 — compared against vigiles's Codex unit,
|
|
51
|
+
* BYTES, which is never smaller than the characters Codex counts, so a
|
|
52
|
+
* non-ASCII listing is reported over a little early, never late. A committed
|
|
53
|
+
* `[skills] max_context_tokens` in `.codex/config.toml` replaces it with that
|
|
54
|
+
* many tokens (at most 10 000), four bytes each. vigiles sums entries without
|
|
55
|
+
* the newline Codex adds to each line: one byte per listed skill under.
|
|
39
56
|
*/
|
|
40
|
-
import type { SkillListingRules } from "../../core/skill-listing.js";
|
|
57
|
+
import type { SkillListingBudget, SkillListingRules } from "../../core/skill-listing.js";
|
|
58
|
+
export declare const codexListingBudget: SkillListingBudget;
|
|
41
59
|
export declare const codexSkillListing: SkillListingRules;
|
|
42
60
|
//# sourceMappingURL=skill-listing.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.codexSkillListing = void 0;
|
|
3
|
+
exports.codexSkillListing = exports.codexListingBudget = void 0;
|
|
4
4
|
/** Longer descriptions are cut, in Unicode scalar values. */
|
|
5
5
|
const DESCRIPTION_CAP = 1024;
|
|
6
6
|
/** What replaces the cut tail; the cap includes it. */
|
|
@@ -33,8 +33,37 @@ const entry = (skill) => {
|
|
|
33
33
|
}
|
|
34
34
|
return `- ${name}: ${capped(description)} (file: ${skill.path})`;
|
|
35
35
|
};
|
|
36
|
+
/** `DEFAULT_SKILL_METADATA_CHAR_BUDGET`: the thread-start budget, no window passed. */
|
|
37
|
+
const THREAD_START_BUDGET = 8000;
|
|
38
|
+
/** `MAX_CONFIGURED_SKILL_METADATA_TOKEN_BUDGET`: a configured budget is capped here. */
|
|
39
|
+
const MAX_CONFIGURED_TOKENS = 10_000;
|
|
40
|
+
/** `APPROX_BYTES_PER_TOKEN`, the conversion `approx_token_count` uses. */
|
|
41
|
+
const BYTES_PER_TOKEN = 4;
|
|
42
|
+
/** The committed setting, as `.codex/config.toml` spells it. */
|
|
43
|
+
const TOKENS_SETTING = "skills.max_context_tokens";
|
|
44
|
+
const isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
45
|
+
/** `[skills] max_context_tokens` when it is a positive integer (`NonZeroUsize`). */
|
|
46
|
+
const configuredTokens = (settings) => {
|
|
47
|
+
const skills = settings["skills"];
|
|
48
|
+
const v = isRecord(skills) ? skills["max_context_tokens"] : undefined;
|
|
49
|
+
return typeof v === "number" && Number.isInteger(v) && v > 0 ? v : undefined;
|
|
50
|
+
};
|
|
51
|
+
const listingLimit = (settings) => {
|
|
52
|
+
const tokens = configuredTokens(settings);
|
|
53
|
+
return tokens === undefined
|
|
54
|
+
? { limit: THREAD_START_BUDGET }
|
|
55
|
+
: {
|
|
56
|
+
limit: Math.min(tokens, MAX_CONFIGURED_TOKENS) * BYTES_PER_TOKEN,
|
|
57
|
+
setBy: TOKENS_SETTING,
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
exports.codexListingBudget = {
|
|
61
|
+
limit: listingLimit,
|
|
62
|
+
capturedFrom: "openai/codex rust-v0.153.0 codex-rs/ext/skills/src/render.rs skill_metadata_budget + extension.rs:234 (thread start passes no window → 8_000 chars; max_context_tokens capped at 10_000)",
|
|
63
|
+
};
|
|
36
64
|
exports.codexSkillListing = {
|
|
37
65
|
entry,
|
|
66
|
+
budget: exports.codexListingBudget,
|
|
38
67
|
capturedFrom: "openai/codex codex-rs/skills/src/parser.rs + codex-rs/ext/skills/src/render.rs (main, fetched 2026-10-31); measured on codex-cli 0.153.0",
|
|
39
68
|
};
|
|
40
69
|
//# sourceMappingURL=skill-listing.js.map
|