vibeqm-check 0.4.7 → 0.4.9

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 CHANGED
@@ -145,7 +145,7 @@ that caused it. The report appears on the run's summary page.
145
145
  ```yaml
146
146
  - uses: actions/checkout@v4
147
147
  with: { fetch-depth: 0 } # the checks sample history
148
- - uses: vibeqm/vibeqm-check@v0.4.7
148
+ - uses: vibeqm/vibeqm-check@v0.4.9
149
149
  with: { min-level: 2 } # optional: fail the run below this level
150
150
  ```
151
151
 
@@ -483,6 +483,20 @@ function reviewedExceptions(root, files) {
483
483
  .map((p) => (p.length >= 4 && /^[0-9a-f]{7,40}$/.test(p[0]) ? p[1] : p[0])));
484
484
  return (f) => ignored.has(f) || patterns.some((re) => re.test(f));
485
485
  }
486
+ /** Release tags (DEC-147): tagged and pushed, or nothing released yet and the
487
+ * repository says so. A local working tag (a baseline, say) that never reached the
488
+ * host is not a release. `remote` is the host's tag list, or null when unknown. */
489
+ export function releaseTags(tags, remote, notLive) {
490
+ const versions = tags.filter((t) => /^v?\d+(\.\d+)+/.test(t));
491
+ const unpushed = tags.length > 0 && !!remote && !tags.some((t) => remote.includes(t));
492
+ if ((!tags.length || unpushed) && notLive)
493
+ return { ok: `no release tags ${unpushed ? "pushed " : ""}yet, and the repository says nothing is released: "${notLive.trim().slice(0, 60)}" (tag the first release)` };
494
+ if (!tags.length)
495
+ return { problem: 'no release tags (if nothing is released yet, say so in the rules file or the README: "nothing is live yet")' };
496
+ if (unpushed)
497
+ return { problem: `${tags.length} release tag(s) here, none pushed to the host` };
498
+ return { ok: `${tags.length} release tag(s)${remote ? ", pushed" : ""}${versions.length ? "" : " (none looks like a version, e.g. v1.2.0)"}` };
499
+ }
486
500
  export function configurationBasics(root) {
487
501
  const files = tracked(root);
488
502
  const gate = "Configuration basics";
@@ -499,18 +513,14 @@ export function configurationBasics(root) {
499
513
  }
500
514
  const tags = (git(root, ["tag", "--list"]) ?? "").split("\n").filter(Boolean);
501
515
  const remote = tags.length ? hostTags(root) : null;
502
- const versions = tags.filter((t) => /^v?\d+(\.\d+)+/.test(t));
503
516
  // Nothing released yet, said in the rules file or the README, needs no tag (DEC-147);
504
517
  // the first release is tagged. A template's blank is a choice, not a statement.
505
518
  const notLive = [...RULES_FILES, "README.md"].map((f) => read(root, f).split("\n").find((l) => NOT_LIVE.test(l) && !placeholders(l).length)).find(Boolean);
506
- if (!tags.length && notLive)
507
- ok.push(`no release tags yet, and the repository says nothing is released: "${notLive.trim().slice(0, 60)}" (tag the first release)`);
508
- else if (!tags.length)
509
- problems.push("no release tags (if nothing is released yet, say so in the rules file or the README: \"nothing is live yet\")");
510
- else if (remote && !tags.some((t) => remote.includes(t)))
511
- problems.push(`${tags.length} release tag(s) here, none pushed to the host`);
512
- else
513
- ok.push(`${tags.length} release tag(s)${remote ? ", pushed" : ""}${versions.length ? "" : " (none looks like a version, e.g. v1.2.0)"}`);
519
+ const release = releaseTags(tags, remote, notLive);
520
+ if (release.ok)
521
+ ok.push(release.ok);
522
+ if (release.problem)
523
+ problems.push(release.problem);
514
524
  const found = files.filter((f) => !/\.(png|jpe?g|gif|pdf|zip|lock|woff2?)$/i.test(f)).filter((f) => SECRET.test(read(root, f)));
515
525
  // A repository's allowlist is its own claim, so it only excuses files under test
516
526
  // folders: an allowlist of ".*" or "config/" must not hide a live credential.
@@ -177,6 +177,20 @@ export function dataBoundary(root) {
177
177
  return r3(gate, "met", `${relative(root, hit)} mentions the data boundary (check it lists what may go to which AI company)`);
178
178
  return r3(gate, existsSync(vibeqm(root)) ? "not-met" : "not-visible", "no written data boundary: which code and data may go to which AI company");
179
179
  }
180
+ export function aiBudget(root) {
181
+ const gate = "AI budget";
182
+ const re = /\b(AI|model|token|API|LLM)\b[^\n]{0,80}\bbudget\b|\bbudget\b[^\n]{0,80}\b(AI|model|token|API|LLM)\b/i;
183
+ const named = mdFiles(vibeqm(root)).filter((p) => re.test(readFileSync(p, "utf8")));
184
+ // A heading is not a budget: the file must state a limit and who is told when it is reached.
185
+ const limit = /\d[^\n]{0,40}\b(a month|per month|monthly|per task|a task|per day|a day)\b|\b(monthly|per-task|daily)\b[^\n]{0,40}\d/i;
186
+ const told = /\b(told|notif\w*|alert\w*|email\w*|warn\w*)\b/i;
187
+ const hit = named.find((p) => limit.test(readFileSync(p, "utf8")) && told.test(readFileSync(p, "utf8")));
188
+ if (hit)
189
+ return r3(gate, "met", `${relative(root, hit)} states an AI budget with its limit and who is told (check where the limit is enforced)`);
190
+ if (named.length)
191
+ return r3(gate, "not-met", `${relative(root, named[0])} mentions an AI budget but not both the limit (an amount a month or a task) and who is told when it is reached`);
192
+ return r3(gate, existsSync(vibeqm(root)) ? "not-met" : "not-visible", "no AI budget: a monthly or per-task limit, where it is enforced, and who is told when it is reached");
193
+ }
180
194
  const notVisible = (gate, need) => (_root) => r3(gate, "not-visible", need);
181
195
  export const level3 = [
182
196
  oneWrittenStandard,
@@ -191,7 +205,9 @@ export const level3 = [
191
205
  lessonsRecorded,
192
206
  notVisible("Gates proven", "needs a record of each automated Level 2–3 check catching a planted fault; attach proof"),
193
207
  dataBoundary,
194
- notVisible("Agent plug-ins and tools", "outside plug-ins, tool servers and skills must be pinned and added as high-risk changes; attach proof"),
208
+ aiBudget,
209
+ notVisible("Guardrail changes approved", "every change to rules files, hooks, CI configuration and agent settings needs a person's approval; attach proof"),
210
+ notVisible("Agent plug-ins and tools", "outside plug-ins, tool servers and skills must be pinned (to a commit hash or checksum where the source offers one) and added as high-risk changes; attach proof"),
195
211
  notVisible("Parallel agents and rollback", "agents on separate branches through the same checks, and a tried rollback; attach proof"),
196
212
  notVisible("Generated-code licensing", "a license check on new code; attach proof"),
197
213
  notVisible("Reviewer proven", "the AI peer reviewer's model and version need a record of catching a planted-fault set (at least five known-bad changes, including a weakened test and a prompt-injection case), kept where the agent can't edit it; attach proof"),
package/dist/src/fixes.js CHANGED
@@ -25,6 +25,8 @@ const NEEDS = {
25
25
  "Critical rules enforced": "answer",
26
26
  "Risk classes and peer review by risk": "answer",
27
27
  "Data boundary": "answer",
28
+ "AI budget": "answer",
29
+ "Guardrail changes approved": "host",
28
30
  "Reviewer proven": "answer",
29
31
  "Service-bound items (applicability)": "answer",
30
32
  };
@@ -412,10 +414,28 @@ const FIXES = {
412
414
  verify: RERUN,
413
415
  minutes: 15,
414
416
  }),
417
+ "AI budget": () => ({
418
+ why: "Autonomy without a spending limit is an open tab with an AI company.",
419
+ steps: [
420
+ "Ask the person for the budget: a monthly or per-task limit on AI spending, where it is enforced (the provider's spending cap, a key's limit, a plan) and who is told when it is reached.",
421
+ "Write it in `VibeQM/` (the standard, or `VibeQM/AI_BUDGET.md`).",
422
+ ],
423
+ verify: RERUN,
424
+ minutes: 10,
425
+ }),
426
+ "Guardrail changes approved": () => ({
427
+ why: "An agent that can rewrite its own rules, hooks or CI can switch off the checks that hold it.",
428
+ steps: [
429
+ "Require a person's approval for changes to the rules files, `.githooks/`, `.github/workflows/` and agent settings: a CODEOWNERS entry with required review, or for one person an ask rule on those paths in the agent's settings.",
430
+ "Record it in `vqm-proof.json` (gate \"Guardrail changes approved\"), with a recent change that went through it.",
431
+ ],
432
+ verify: RERUN,
433
+ minutes: 15,
434
+ }),
415
435
  "Agent plug-ins and tools": () => ({
416
436
  why: "Plug-ins and tool servers run with the agent's permissions; they are dependencies.",
417
437
  steps: [
418
- "List the MCP servers, plug-ins and outside skills in use (`.mcp.json`, settings), pin their versions, and note who approved each.",
438
+ "List the MCP servers, plug-ins and outside skills in use (`.mcp.json`, settings), pin them to a commit hash or checksum where the source offers one (a version tag can be moved), else an exact version, and note who approved each.",
419
439
  "Record the list in `vqm-proof.json` (gate \"Agent plug-ins and tools\").",
420
440
  ],
421
441
  verify: RERUN,
package/dist/src/types.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The VibeQM framework version these checks follow; a claim names it (VQM_SPEC §13). */
2
- export const FRAMEWORK_VERSION = "0.4.7";
2
+ export const FRAMEWORK_VERSION = "0.4.8";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeqm-check",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "description": "Self-assessment for the Vibe Quality Model (VibeQM): fact checks on a repository, with evidence for every gate",
5
5
  "keywords": [
6
6
  "vibe-quality-model",