@foldrun/core 17.0.1 → 17.1.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/dist/src/scan.d.ts +3 -7
- package/dist/src/scan.js +13 -11
- package/package.json +1 -1
- package/src/scan.ts +17 -11
package/dist/src/scan.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export interface ScanRule {
|
|
|
10
10
|
help: string;
|
|
11
11
|
/** OWASP Top 10 for Agentic Applications (2026) ids it guards against. */
|
|
12
12
|
owasp?: string[];
|
|
13
|
+
/** Its anchor on docs.foldrun.io/checks, when it is not the id with "/"
|
|
14
|
+
* read as "-" — a rule documented as a row of a table, not a section. */
|
|
15
|
+
anchor?: string;
|
|
13
16
|
}
|
|
14
17
|
export interface ScanFile {
|
|
15
18
|
/** Relative to the workspace root (`agents/x/agent.md`), or `library/…`. */
|
|
@@ -59,13 +62,6 @@ export interface ScanOptions {
|
|
|
59
62
|
}
|
|
60
63
|
export declare const OWASP_URL = "https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026";
|
|
61
64
|
export declare const SCAN_RULES: readonly ScanRule[];
|
|
62
|
-
/**
|
|
63
|
-
* The rules `foldrun check` and the deploy have always had — "will this
|
|
64
|
-
* run?" — given ids so a finding from them can be filtered, ignored,
|
|
65
|
-
* baselined and carried in SARIF like the scanner's. Coarse on purpose, one
|
|
66
|
-
* per kind of file; the message says exactly what is wrong. Their level is
|
|
67
|
-
* each problem's own, so it is not fixed here.
|
|
68
|
-
*/
|
|
69
65
|
export declare const CHECK_RULES: readonly (Omit<ScanRule, "level"> & {
|
|
70
66
|
level?: ScanLevel;
|
|
71
67
|
})[];
|
package/dist/src/scan.js
CHANGED
|
@@ -315,18 +315,20 @@ export const SCAN_RULES = [
|
|
|
315
315
|
* per kind of file; the message says exactly what is wrong. Their level is
|
|
316
316
|
* each problem's own, so it is not fixed here.
|
|
317
317
|
*/
|
|
318
|
+
/** The checks page lists check's own rules in one table, under this heading. */
|
|
319
|
+
const OWN_RULES = "checks-own-rules";
|
|
318
320
|
export const CHECK_RULES = [
|
|
319
|
-
{ id: "agent/config", category: "config", title: "An agent's frontmatter or references are wrong", help: "A field foldrun cannot read, or a tool, skill, colleague or hook it names that does not exist. The message says which and what to write." },
|
|
320
|
-
{ id: "flow/config", category: "config", title: "A flow's steps or options are wrong", help: "A step naming no agent, an option value the parser cannot read, a verify: written as prose, or an arrangement that cannot have what its instruction asks for." },
|
|
321
|
+
{ id: "agent/config", anchor: OWN_RULES, category: "config", title: "An agent's frontmatter or references are wrong", help: "A field foldrun cannot read, or a tool, skill, colleague or hook it names that does not exist. The message says which and what to write." },
|
|
322
|
+
{ id: "flow/config", anchor: OWN_RULES, category: "config", title: "A flow's steps or options are wrong", help: "A step naming no agent, an option value the parser cannot read, a verify: written as prose, or an arrangement that cannot have what its instruction asks for." },
|
|
321
323
|
{ id: "flow/outward-ungated", category: "security", title: "A step that acts outside the workspace with no check and no approval", help: "Give the step a verify: that reads what it did, or an approval (`!`), so a wrong post or send is caught before it repeats.", owasp: ["ASI02", "ASI09"] },
|
|
322
|
-
{ id: "tool/config", category: "config", title: "A tool's definition or program is wrong", help: "A run: program that does not exist, a package it imports that nothing declares, or a leftover type: field." },
|
|
323
|
-
{ id: "skill/config", category: "config", title: "A skill does not follow the skill format", help: "SKILL.md needs a name and a description the model can choose it by." },
|
|
324
|
-
{ id: "eval/config", category: "config", title: "An eval names nothing, or has no cases", help: "An eval names one agent or flow that exists and holds at least one case." },
|
|
325
|
-
{ id: "hook/config", category: "config", title: "A hook is not a valid hook, or a hooks: name resolves to nothing", help: "hooks/<name>/hook.md with on:, and run.mjs beside it; a run refuses a step whose hook is missing rather than run it unguarded." },
|
|
326
|
-
{ id: "knowledge/okf", category: "config", title: "A knowledge or memory document is not a conformant OKF bundle entry", help: "Each document needs a type:; dates are YYYY-MM-DD; stale documents are flagged so an agent does not treat them as current." },
|
|
327
|
-
{ id: "workspace/config", category: "config", title: "A workspace or account setting cannot be read", help: "AGENTS.md defaults — limits:, network:, foldrun_version: — that would leave every agent on the level above, and paths a deploy refuses." },
|
|
328
|
-
{ id: "library/config", category: "config", title: "A library entry is wrong", help: "The same rules as in a workspace, for the account's shared library." },
|
|
329
|
-
{ id: "paths/workspace-spelling", category: "config", title: "An older spelling of a workspace path", help: "`../../storage/x` still works; `workspace/storage/x` reads the same in every tool, script and check." },
|
|
324
|
+
{ id: "tool/config", anchor: OWN_RULES, category: "config", title: "A tool's definition or program is wrong", help: "A run: program that does not exist, a package it imports that nothing declares, or a leftover type: field." },
|
|
325
|
+
{ id: "skill/config", anchor: OWN_RULES, category: "config", title: "A skill does not follow the skill format", help: "SKILL.md needs a name and a description the model can choose it by." },
|
|
326
|
+
{ id: "eval/config", anchor: OWN_RULES, category: "config", title: "An eval names nothing, or has no cases", help: "An eval names one agent or flow that exists and holds at least one case." },
|
|
327
|
+
{ id: "hook/config", anchor: OWN_RULES, category: "config", title: "A hook is not a valid hook, or a hooks: name resolves to nothing", help: "hooks/<name>/hook.md with on:, and run.mjs beside it; a run refuses a step whose hook is missing rather than run it unguarded." },
|
|
328
|
+
{ id: "knowledge/okf", anchor: OWN_RULES, category: "config", title: "A knowledge or memory document is not a conformant OKF bundle entry", help: "Each document needs a type:; dates are YYYY-MM-DD; stale documents are flagged so an agent does not treat them as current." },
|
|
329
|
+
{ id: "workspace/config", anchor: OWN_RULES, category: "config", title: "A workspace or account setting cannot be read", help: "AGENTS.md defaults — limits:, network:, foldrun_version: — that would leave every agent on the level above, and paths a deploy refuses." },
|
|
330
|
+
{ id: "library/config", anchor: OWN_RULES, category: "config", title: "A library entry is wrong", help: "The same rules as in a workspace, for the account's shared library." },
|
|
331
|
+
{ id: "paths/workspace-spelling", anchor: OWN_RULES, category: "config", title: "An older spelling of a workspace path", help: "`../../storage/x` still works; `workspace/storage/x` reads the same in every tool, script and check." },
|
|
330
332
|
];
|
|
331
333
|
/** The rule id of a check or deploy problem, from where it was found and
|
|
332
334
|
* the flow lint's tag when it has one. */
|
|
@@ -354,7 +356,7 @@ export function scanRule(id) {
|
|
|
354
356
|
}
|
|
355
357
|
/** Where a rule's docs live — one page, an anchor per rule. */
|
|
356
358
|
export function ruleDocsUrl(id) {
|
|
357
|
-
return `https://docs.foldrun.io/checks#${id.replace(/\//g, "-")}`;
|
|
359
|
+
return `https://docs.foldrun.io/checks#${RULE_BY_ID.get(id)?.anchor ?? id.replace(/\//g, "-")}`;
|
|
358
360
|
}
|
|
359
361
|
// ── fingerprints ───────────────────────────────────────────────────────────
|
|
360
362
|
/** rule + file + the text that was flagged, normalised. Not the line number:
|
package/package.json
CHANGED
package/src/scan.ts
CHANGED
|
@@ -50,6 +50,9 @@ export interface ScanRule {
|
|
|
50
50
|
help: string;
|
|
51
51
|
/** OWASP Top 10 for Agentic Applications (2026) ids it guards against. */
|
|
52
52
|
owasp?: string[];
|
|
53
|
+
/** Its anchor on docs.foldrun.io/checks, when it is not the id with "/"
|
|
54
|
+
* read as "-" — a rule documented as a row of a table, not a section. */
|
|
55
|
+
anchor?: string;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
export interface ScanFile {
|
|
@@ -400,18 +403,21 @@ export const SCAN_RULES: readonly ScanRule[] = [
|
|
|
400
403
|
* per kind of file; the message says exactly what is wrong. Their level is
|
|
401
404
|
* each problem's own, so it is not fixed here.
|
|
402
405
|
*/
|
|
406
|
+
/** The checks page lists check's own rules in one table, under this heading. */
|
|
407
|
+
const OWN_RULES = "checks-own-rules";
|
|
408
|
+
|
|
403
409
|
export const CHECK_RULES: readonly (Omit<ScanRule, "level"> & { level?: ScanLevel })[] = [
|
|
404
|
-
{ id: "agent/config", category: "config", title: "An agent's frontmatter or references are wrong", help: "A field foldrun cannot read, or a tool, skill, colleague or hook it names that does not exist. The message says which and what to write." },
|
|
405
|
-
{ id: "flow/config", category: "config", title: "A flow's steps or options are wrong", help: "A step naming no agent, an option value the parser cannot read, a verify: written as prose, or an arrangement that cannot have what its instruction asks for." },
|
|
410
|
+
{ id: "agent/config", anchor: OWN_RULES, category: "config", title: "An agent's frontmatter or references are wrong", help: "A field foldrun cannot read, or a tool, skill, colleague or hook it names that does not exist. The message says which and what to write." },
|
|
411
|
+
{ id: "flow/config", anchor: OWN_RULES, category: "config", title: "A flow's steps or options are wrong", help: "A step naming no agent, an option value the parser cannot read, a verify: written as prose, or an arrangement that cannot have what its instruction asks for." },
|
|
406
412
|
{ id: "flow/outward-ungated", category: "security", title: "A step that acts outside the workspace with no check and no approval", help: "Give the step a verify: that reads what it did, or an approval (`!`), so a wrong post or send is caught before it repeats.", owasp: ["ASI02", "ASI09"] },
|
|
407
|
-
{ id: "tool/config", category: "config", title: "A tool's definition or program is wrong", help: "A run: program that does not exist, a package it imports that nothing declares, or a leftover type: field." },
|
|
408
|
-
{ id: "skill/config", category: "config", title: "A skill does not follow the skill format", help: "SKILL.md needs a name and a description the model can choose it by." },
|
|
409
|
-
{ id: "eval/config", category: "config", title: "An eval names nothing, or has no cases", help: "An eval names one agent or flow that exists and holds at least one case." },
|
|
410
|
-
{ id: "hook/config", category: "config", title: "A hook is not a valid hook, or a hooks: name resolves to nothing", help: "hooks/<name>/hook.md with on:, and run.mjs beside it; a run refuses a step whose hook is missing rather than run it unguarded." },
|
|
411
|
-
{ id: "knowledge/okf", category: "config", title: "A knowledge or memory document is not a conformant OKF bundle entry", help: "Each document needs a type:; dates are YYYY-MM-DD; stale documents are flagged so an agent does not treat them as current." },
|
|
412
|
-
{ id: "workspace/config", category: "config", title: "A workspace or account setting cannot be read", help: "AGENTS.md defaults — limits:, network:, foldrun_version: — that would leave every agent on the level above, and paths a deploy refuses." },
|
|
413
|
-
{ id: "library/config", category: "config", title: "A library entry is wrong", help: "The same rules as in a workspace, for the account's shared library." },
|
|
414
|
-
{ id: "paths/workspace-spelling", category: "config", title: "An older spelling of a workspace path", help: "`../../storage/x` still works; `workspace/storage/x` reads the same in every tool, script and check." },
|
|
413
|
+
{ id: "tool/config", anchor: OWN_RULES, category: "config", title: "A tool's definition or program is wrong", help: "A run: program that does not exist, a package it imports that nothing declares, or a leftover type: field." },
|
|
414
|
+
{ id: "skill/config", anchor: OWN_RULES, category: "config", title: "A skill does not follow the skill format", help: "SKILL.md needs a name and a description the model can choose it by." },
|
|
415
|
+
{ id: "eval/config", anchor: OWN_RULES, category: "config", title: "An eval names nothing, or has no cases", help: "An eval names one agent or flow that exists and holds at least one case." },
|
|
416
|
+
{ id: "hook/config", anchor: OWN_RULES, category: "config", title: "A hook is not a valid hook, or a hooks: name resolves to nothing", help: "hooks/<name>/hook.md with on:, and run.mjs beside it; a run refuses a step whose hook is missing rather than run it unguarded." },
|
|
417
|
+
{ id: "knowledge/okf", anchor: OWN_RULES, category: "config", title: "A knowledge or memory document is not a conformant OKF bundle entry", help: "Each document needs a type:; dates are YYYY-MM-DD; stale documents are flagged so an agent does not treat them as current." },
|
|
418
|
+
{ id: "workspace/config", anchor: OWN_RULES, category: "config", title: "A workspace or account setting cannot be read", help: "AGENTS.md defaults — limits:, network:, foldrun_version: — that would leave every agent on the level above, and paths a deploy refuses." },
|
|
419
|
+
{ id: "library/config", anchor: OWN_RULES, category: "config", title: "A library entry is wrong", help: "The same rules as in a workspace, for the account's shared library." },
|
|
420
|
+
{ id: "paths/workspace-spelling", anchor: OWN_RULES, category: "config", title: "An older spelling of a workspace path", help: "`../../storage/x` still works; `workspace/storage/x` reads the same in every tool, script and check." },
|
|
415
421
|
];
|
|
416
422
|
|
|
417
423
|
/** The rule id of a check or deploy problem, from where it was found and
|
|
@@ -439,7 +445,7 @@ export function scanRule(id: string): (Omit<ScanRule, "level"> & { level?: ScanL
|
|
|
439
445
|
|
|
440
446
|
/** Where a rule's docs live — one page, an anchor per rule. */
|
|
441
447
|
export function ruleDocsUrl(id: string): string {
|
|
442
|
-
return `https://docs.foldrun.io/checks#${id.replace(/\//g, "-")}`;
|
|
448
|
+
return `https://docs.foldrun.io/checks#${RULE_BY_ID.get(id)?.anchor ?? id.replace(/\//g, "-")}`;
|
|
443
449
|
}
|
|
444
450
|
|
|
445
451
|
// ── fingerprints ───────────────────────────────────────────────────────────
|