@foldrun/core 17.0.1 → 17.1.1

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.
@@ -136,7 +136,7 @@ export function evaluateAlerts(cfg, facts, workspace, now) {
136
136
  key: `runs_per_hour/${flow}`,
137
137
  flow,
138
138
  headline: `${workspace}: ${flow} started ${n} times in an hour`,
139
- detail: `Past the ${cfg.runsPerHour} in alerts: runs_per_hour — a loop, a webhook sender retrying, or a schedule written wrong. Its Triggers page shows what started each; throttle: or debounce: caps it, and Settings → Pause stops it now.`,
139
+ detail: `Past the ${cfg.runsPerHour} in alerts: runs_per_hour — a loop, a webhook sender retrying, or a schedule written wrong. Its Triggers page shows what started each; throttle: or debounce: caps it, and Settings → Policies → Pause runs stops it now.`,
140
140
  });
141
141
  }
142
142
  }
@@ -102,7 +102,7 @@ export function failureFactsOf(step) {
102
102
  };
103
103
  return Object.keys(facts).length ? facts : undefined;
104
104
  }
105
- const UPGRADE = "or a plan that allows more (Settings → Billing)";
105
+ const UPGRADE = "or a plan that allows more (Billing)";
106
106
  const SCOPES = {
107
107
  "this run's": "run",
108
108
  "this workspace's": "workspace",
@@ -140,7 +140,7 @@ function tooBig(reason) {
140
140
  const what = kind === "memory" ? "GiB of memory" : pool[2];
141
141
  const fix = scope === "run" ? "Ask for less with size: or resources: on the agent, or raise the flow's compute:."
142
142
  : scope === "workspace" ? "Ask for less with size: or resources: on the agent, or raise the workspace's compute: (its AGENTS.md)."
143
- : scope === "account" ? `Ask for less with size: or resources: on the agent, raise the account's compute: (Settings → Governance), ${UPGRADE}.`
143
+ : scope === "account" ? `Ask for less with size: or resources: on the agent, raise the account's compute: (Settings → Policies → Governance), ${UPGRADE}.`
144
144
  : "Ask for less with size: or resources: on the agent: no machine here can hold a step this big.";
145
145
  return {
146
146
  class: "policy_denied",
@@ -59,7 +59,7 @@ export function credentialLine(c) {
59
59
  // ---------------------------------------------------------------- the account's own key
60
60
  //
61
61
  // An account brings its own model key without writing a provider: block:
62
- // three secrets in the ACCOUNT vault (set from Settings → Model, the API's
62
+ // three secrets in the ACCOUNT vault (set from Settings → Models, the API's
63
63
  // /api/account/model, or `foldrun account model set`). A provider: block at any
64
64
  // level still wins; this is what a step falls to when none names one, before
65
65
  // the platform's own credential.
@@ -1,7 +1,7 @@
1
1
  // The model environment for work an ACCOUNT asks for outside a step: an eval's
2
2
  // judge, the dashboard's "draft a flow with AI". Resolved the way a step
3
3
  // resolves it — the workspace's provider: block, else the account's, else the
4
- // account's own key from Settings → Model — and only then the platform's own
4
+ // account's own key from Settings → Models — and only then the platform's own
5
5
  // credential, which a hosted platform keeps for its operator's accounts
6
6
  // (platform.platformKeyAllowed). Every other account brings an API key;
7
7
  // asking for the platform's here is refused, not quietly billed to it.
@@ -22,7 +22,7 @@ export class ModelKeyError extends Error {
22
22
  this.status = status;
23
23
  }
24
24
  }
25
- export const NO_MODEL_KEY = "no model key: this account runs on its own API key, and none is set — add one in Settings → Model " +
25
+ export const NO_MODEL_KEY = "no model key: this account runs on its own API key, and none is set — add one in Settings → Models " +
26
26
  "(or `foldrun account model set <provider> --key …`), or write a provider: block in AGENTS.md";
27
27
  /**
28
28
  * `platform` is a function: the caller's own way to build the platform's env
@@ -18,7 +18,7 @@ export const OAUTH_CAPABILITIES = [
18
18
  // ------------------------------------------------------------ client
19
19
  {
20
20
  id: "client.authorization-code-pkce", role: "client", title: "Authorization code with PKCE (S256)", spec: "RFC 6749 §4.1, RFC 7636",
21
- status: "supported", note: "Settings → Connections or `foldrun connect`. PKCE is on for every connection.",
21
+ status: "supported", note: "Settings → Secrets → Connections or `foldrun connect`. PKCE is on for every connection.",
22
22
  proof: [platform("tests/oauth-connect.test.ts", "PKCE: on by default"), platform(KC, "authorization code + PKCE S256 + PAR"), cli("tests/cli-connect.test.ts", "connect: PKCE by default")],
23
23
  },
24
24
  {
@@ -200,8 +200,8 @@ export function providersInUse(tenant) {
200
200
  out.push({ spec, workspace, declaredIn, model: cheapestModel(spec) });
201
201
  };
202
202
  add(frontmatterOf(path.join(accountDir(tenant), "AGENTS.md")).provider, null, "account");
203
- // The account's own key from Settings → Model, which needs no block.
204
- add(accountModelBlock((name) => getSecret(tenant, name)?.value ?? null), null, "account (Settings → Model)");
203
+ // The account's own key from Settings → Models, which needs no block.
204
+ add(accountModelBlock((name) => getSecret(tenant, name)?.value ?? null), null, "account (Settings → Models)");
205
205
  for (const ws of safeList(() => listWorkspaces(tenant))) {
206
206
  const dir = workspaceDir(tenant, ws.name);
207
207
  add(frontmatterOf(path.join(dir, "AGENTS.md")).provider, ws.name, ws.name);
@@ -1209,7 +1209,7 @@ grantsOnly = false) {
1209
1209
  //
1210
1210
  // The URL sits in git; the token is a ${SECRET} resolved server-side. An
1211
1211
  // agent's own block wins over the workspace's, like everything else here.
1212
- // Then the account's own model key (Settings → Model), when it set one:
1212
+ // Then the account's own model key (Settings → Models), when it set one:
1213
1213
  // an account that brings its key need not write a block anywhere.
1214
1214
  const fileBlock = front.provider ?? workspaceFrontmatter(agentDir, tenant).provider;
1215
1215
  // foldrun's models (3 Nov 2026): an account that chose the platform's key
@@ -2299,7 +2299,7 @@ mayDefer) {
2299
2299
  // Chosen, but not to be had now: failed with why, before a sandbox —
2300
2300
  // never onto the account's stored key or the operator's.
2301
2301
  if (supply.kind === "refused") {
2302
- push("error", `foldrun's models: ${supply.reason} — or switch this account back to its own key (Settings → Model, \`foldrun account model use own\`)`);
2302
+ push("error", `foldrun's models: ${supply.reason} — or switch this account back to its own key (Settings → Models, \`foldrun account model use own\`)`);
2303
2303
  step.status = "failed";
2304
2304
  save();
2305
2305
  return;
@@ -2326,7 +2326,7 @@ mayDefer) {
2326
2326
  if (!platform.platformKeyAllowed(tenant)) {
2327
2327
  const own = Object.values(providerSecrets).concat(Object.values(providerEnv));
2328
2328
  if (primaryOnPlatform) {
2329
- push("error", `no model key: this account runs on its own API key, and none is set. Add one in Settings → Model ` +
2329
+ push("error", `no model key: this account runs on its own API key, and none is set. Add one in Settings → Models ` +
2330
2330
  `(or \`foldrun account model set <provider> --key …\`), or write a provider: block in AGENTS.md`);
2331
2331
  step.status = "failed";
2332
2332
  save();
@@ -2348,7 +2348,7 @@ mayDefer) {
2348
2348
  if (noCredentialInContainer) {
2349
2349
  push("error", "no model credential: this install has none and the account has no key of its own. Set ANTHROPIC_API_KEY " +
2350
2350
  "(or CLAUDE_CODE_OAUTH_TOKEN from `claude setup-token`) in the platform's environment — for Docker Compose, " +
2351
- "self-hosting/.env, then `docker compose up -d` — or add the account's key in Settings → Model " +
2351
+ "self-hosting/.env, then `docker compose up -d` — or add the account's key in Settings → Models " +
2352
2352
  "(`foldrun account model set <provider> --key …`)");
2353
2353
  step.status = "failed";
2354
2354
  save();
@@ -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
@@ -257,7 +257,7 @@ export const SCAN_RULES = [
257
257
  title: "An effort level the model this account runs on does not have",
258
258
  help: "Each model takes its own effort levels: GPT-6 and Claude take all five, Gemini stops at high, Kimi has low, high and max. " +
259
259
  "The step still runs, at the nearest level the model has, and the step's log says so. Write the level it has, or choose " +
260
- "a provider whose model has the one you want (Settings → Model provider).",
260
+ "a provider whose model has the one you want (Settings → Models).",
261
261
  },
262
262
  {
263
263
  id: "config/output-fitted",
@@ -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:
@@ -40,7 +40,7 @@ foldrun_version: "0.1"
40
40
  # that declares the same key replaces it *whole* — base_url and token never
41
41
  # merge across scopes, so a provider block belongs entirely at one level.
42
42
  #
43
- # Your own model key needs no block: Settings → Model provider, or
43
+ # Your own model key needs no block: Settings → Models, or
44
44
  # \`foldrun account model set anthropic --key …\` (an API key, not a login).
45
45
  # On foldrun's own platform you can run on foldrun's models instead, billed
46
46
  # in credits: \`foldrun account model use foldrun --provider anthropic\`.
@@ -393,7 +393,7 @@ and \`/api/metrics\` (Prometheus). Outside \`/api\`: \`/a2a/<account>/<ws>/flows
393
393
  (a published flow's agent card and A2A 1.0 JSON-RPC endpoint — an A2A key only, \`foldrun docs a2a\`).
394
394
 
395
395
  Every call answers — and the CLI sends — \`Foldrun-Version: YYYY-MM-DD\` (dated API
396
- versions; an account pin in Settings → API), \`X-RateLimit-*\` headers (a \`429\`
396
+ versions; an account pin in Settings → API keys → API), \`X-RateLimit-*\` headers (a \`429\`
397
397
  carries \`Retry-After\`), and writes that start work take an \`Idempotency-Key\`
398
398
  (a retry with the same key replays the first answer). The whole surface as
399
399
  OpenAPI 3.1: \`/api/openapi.json\` (open), or \`foldrun api spec --out openapi.json\`.
@@ -1257,7 +1257,7 @@ export interface StepRecord {
1257
1257
  * "provider: …" — or "none set" (model-credential.ts). */
1258
1258
  credential?: string;
1259
1259
  /** Whose key paid for the step's model calls (3 Nov 2026): "own" — the
1260
- * account's (a provider: block, Settings → Model), billed by its
1260
+ * account's (a provider: block, Settings → Models), billed by its
1261
1261
  * provider; "operator" — the platform's own credential, billed from the
1262
1262
  * step's tokens; "foldrun" — foldrun's models, billed per call by the
1263
1263
  * model gateway, never from the step. Absent on older records. */
@@ -1781,7 +1781,7 @@ export declare function runDisplayStatus(run: Pick<RunRecord, "status" | "stopRe
1781
1781
  export declare function runCost(run: RunRecord): number;
1782
1782
  /** Whether a step's tokens are the platform's to bill: it ran on the
1783
1783
  * platform's own model credential, not the account's key ("provider: …" —
1784
- * a provider: block, or Settings → Model), which the provider bills. The
1784
+ * a provider: block, or Settings → Models), which the provider bills. The
1785
1785
  * meter, the Usage page and the ledger split all ask this one question, so
1786
1786
  * what a page shows is what was charged. */
1787
1787
  export declare function stepBillsTokens(s: Pick<StepRecord, "credential" | "supply">): boolean;
@@ -1811,7 +1811,7 @@ export declare function billedTokenCost(s: {
1811
1811
  *
1812
1812
  * Tokens count only for steps that ran on the platform's own model
1813
1813
  * credential. A step on the account's own key (`credential` "provider: …" —
1814
- * a provider: block, or Settings → Model) was paid for at the provider, and
1814
+ * a provider: block, or Settings → Models) was paid for at the provider, and
1815
1815
  * billing it again here charged a BYOK customer twice. And a carried step's
1816
1816
  * tokens were billed where it ran, like its compute.
1817
1817
  */
package/dist/src/store.js CHANGED
@@ -2248,7 +2248,7 @@ const ACCOUNT_SEALED = {
2248
2248
  "oauth-clients.json": "OAuth client credentials — never served to a browser.",
2249
2249
  "ledger.jsonl": "the billing ledger — append-only, read it through Usage and Wallet.",
2250
2250
  "billing.json": "the account's billing settings — read and change them in Wallet.",
2251
- "oauth-connections.json": "connected apps and their health — see Settings → Connections.",
2251
+ "oauth-connections.json": "connected apps and their health — see Settings → Secrets → Connections.",
2252
2252
  "secret-health.json": "secret usage bookkeeping — see Settings → Secrets.",
2253
2253
  };
2254
2254
  export function accountFileSealed(rel) {
@@ -3319,7 +3319,7 @@ export function runCost(run) {
3319
3319
  }
3320
3320
  /** Whether a step's tokens are the platform's to bill: it ran on the
3321
3321
  * platform's own model credential, not the account's key ("provider: …" —
3322
- * a provider: block, or Settings → Model), which the provider bills. The
3322
+ * a provider: block, or Settings → Models), which the provider bills. The
3323
3323
  * meter, the Usage page and the ledger split all ask this one question, so
3324
3324
  * what a page shows is what was charged. */
3325
3325
  export function stepBillsTokens(s) {
@@ -3356,7 +3356,7 @@ export function billedTokenCost(s) {
3356
3356
  *
3357
3357
  * Tokens count only for steps that ran on the platform's own model
3358
3358
  * credential. A step on the account's own key (`credential` "provider: …" —
3359
- * a provider: block, or Settings → Model) was paid for at the provider, and
3359
+ * a provider: block, or Settings → Models) was paid for at the provider, and
3360
3360
  * billing it again here charged a BYOK customer twice. And a carried step's
3361
3361
  * tokens were billed where it ran, like its compute.
3362
3362
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldrun/core",
3
- "version": "17.0.1",
3
+ "version": "17.1.1",
4
4
  "description": "Agents are just folders. The format, the runner, the checks.",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "type": "module",
package/src/alerts.ts CHANGED
@@ -167,7 +167,7 @@ export function evaluateAlerts(cfg: AlertConfig, facts: AlertFacts, workspace: s
167
167
  key: `runs_per_hour/${flow}`,
168
168
  flow,
169
169
  headline: `${workspace}: ${flow} started ${n} times in an hour`,
170
- detail: `Past the ${cfg.runsPerHour} in alerts: runs_per_hour — a loop, a webhook sender retrying, or a schedule written wrong. Its Triggers page shows what started each; throttle: or debounce: caps it, and Settings → Pause stops it now.`,
170
+ detail: `Past the ${cfg.runsPerHour} in alerts: runs_per_hour — a loop, a webhook sender retrying, or a schedule written wrong. Its Triggers page shows what started each; throttle: or debounce: caps it, and Settings → Policies → Pause runs stops it now.`,
171
171
  });
172
172
  }
173
173
  }
package/src/failure.ts CHANGED
@@ -160,7 +160,7 @@ export function failureFactsOf(step: FailedStepLike): FailureFacts | undefined {
160
160
  return Object.keys(facts).length ? facts : undefined;
161
161
  }
162
162
 
163
- const UPGRADE = "or a plan that allows more (Settings → Billing)";
163
+ const UPGRADE = "or a plan that allows more (Billing)";
164
164
 
165
165
  const SCOPES: Record<string, LimitScope> = {
166
166
  "this run's": "run",
@@ -201,7 +201,7 @@ function tooBig(reason: string): FailureExplained | null {
201
201
  const fix =
202
202
  scope === "run" ? "Ask for less with size: or resources: on the agent, or raise the flow's compute:."
203
203
  : scope === "workspace" ? "Ask for less with size: or resources: on the agent, or raise the workspace's compute: (its AGENTS.md)."
204
- : scope === "account" ? `Ask for less with size: or resources: on the agent, raise the account's compute: (Settings → Governance), ${UPGRADE}.`
204
+ : scope === "account" ? `Ask for less with size: or resources: on the agent, raise the account's compute: (Settings → Policies → Governance), ${UPGRADE}.`
205
205
  : "Ask for less with size: or resources: on the agent: no machine here can hold a step this big.";
206
206
  return {
207
207
  class: "policy_denied",
@@ -74,7 +74,7 @@ export function credentialLine(c: ModelCredential): { type: "info" | "error"; te
74
74
  // ---------------------------------------------------------------- the account's own key
75
75
  //
76
76
  // An account brings its own model key without writing a provider: block:
77
- // three secrets in the ACCOUNT vault (set from Settings → Model, the API's
77
+ // three secrets in the ACCOUNT vault (set from Settings → Models, the API's
78
78
  // /api/account/model, or `foldrun account model set`). A provider: block at any
79
79
  // level still wins; this is what a step falls to when none names one, before
80
80
  // the platform's own credential.
package/src/model-env.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // The model environment for work an ACCOUNT asks for outside a step: an eval's
2
2
  // judge, the dashboard's "draft a flow with AI". Resolved the way a step
3
3
  // resolves it — the workspace's provider: block, else the account's, else the
4
- // account's own key from Settings → Model — and only then the platform's own
4
+ // account's own key from Settings → Models — and only then the platform's own
5
5
  // credential, which a hosted platform keeps for its operator's accounts
6
6
  // (platform.platformKeyAllowed). Every other account brings an API key;
7
7
  // asking for the platform's here is refused, not quietly billed to it.
@@ -26,7 +26,7 @@ export class ModelKeyError extends Error {
26
26
  }
27
27
 
28
28
  export const NO_MODEL_KEY =
29
- "no model key: this account runs on its own API key, and none is set — add one in Settings → Model " +
29
+ "no model key: this account runs on its own API key, and none is set — add one in Settings → Models " +
30
30
  "(or `foldrun account model set <provider> --key …`), or write a provider: block in AGENTS.md";
31
31
 
32
32
  /**
@@ -44,7 +44,7 @@ export const OAUTH_CAPABILITIES: OAuthCapability[] = [
44
44
  // ------------------------------------------------------------ client
45
45
  {
46
46
  id: "client.authorization-code-pkce", role: "client", title: "Authorization code with PKCE (S256)", spec: "RFC 6749 §4.1, RFC 7636",
47
- status: "supported", note: "Settings → Connections or `foldrun connect`. PKCE is on for every connection.",
47
+ status: "supported", note: "Settings → Secrets → Connections or `foldrun connect`. PKCE is on for every connection.",
48
48
  proof: [platform("tests/oauth-connect.test.ts", "PKCE: on by default"), platform(KC, "authorization code + PKCE S256 + PAR"), cli("tests/cli-connect.test.ts", "connect: PKCE by default")],
49
49
  },
50
50
  {
@@ -237,8 +237,8 @@ export function providersInUse(tenant: string): ProviderInUse[] {
237
237
  };
238
238
 
239
239
  add(frontmatterOf(path.join(accountDir(tenant), "AGENTS.md")).provider, null, "account");
240
- // The account's own key from Settings → Model, which needs no block.
241
- add(accountModelBlock((name) => getSecret(tenant, name)?.value ?? null), null, "account (Settings → Model)");
240
+ // The account's own key from Settings → Models, which needs no block.
241
+ add(accountModelBlock((name) => getSecret(tenant, name)?.value ?? null), null, "account (Settings → Models)");
242
242
  for (const ws of safeList(() => listWorkspaces(tenant))) {
243
243
  const dir = workspaceDir(tenant, ws.name);
244
244
  add(frontmatterOf(path.join(dir, "AGENTS.md")).provider, ws.name, ws.name);
package/src/runner.ts CHANGED
@@ -1352,7 +1352,7 @@ export function agentContext(
1352
1352
  //
1353
1353
  // The URL sits in git; the token is a ${SECRET} resolved server-side. An
1354
1354
  // agent's own block wins over the workspace's, like everything else here.
1355
- // Then the account's own model key (Settings → Model), when it set one:
1355
+ // Then the account's own model key (Settings → Models), when it set one:
1356
1356
  // an account that brings its key need not write a block anywhere.
1357
1357
  const fileBlock =
1358
1358
  (front.provider as Record<string, unknown> | undefined) ?? workspaceFrontmatter(agentDir, tenant).provider;
@@ -2493,7 +2493,7 @@ async function runStep(
2493
2493
  // Chosen, but not to be had now: failed with why, before a sandbox —
2494
2494
  // never onto the account's stored key or the operator's.
2495
2495
  if (supply.kind === "refused") {
2496
- push("error", `foldrun's models: ${supply.reason} — or switch this account back to its own key (Settings → Model, \`foldrun account model use own\`)`);
2496
+ push("error", `foldrun's models: ${supply.reason} — or switch this account back to its own key (Settings → Models, \`foldrun account model use own\`)`);
2497
2497
  step.status = "failed";
2498
2498
  save();
2499
2499
  return;
@@ -2522,7 +2522,7 @@ async function runStep(
2522
2522
  if (primaryOnPlatform) {
2523
2523
  push(
2524
2524
  "error",
2525
- `no model key: this account runs on its own API key, and none is set. Add one in Settings → Model ` +
2525
+ `no model key: this account runs on its own API key, and none is set. Add one in Settings → Models ` +
2526
2526
  `(or \`foldrun account model set <provider> --key …\`), or write a provider: block in AGENTS.md`,
2527
2527
  );
2528
2528
  step.status = "failed";
@@ -2547,7 +2547,7 @@ async function runStep(
2547
2547
  "error",
2548
2548
  "no model credential: this install has none and the account has no key of its own. Set ANTHROPIC_API_KEY " +
2549
2549
  "(or CLAUDE_CODE_OAUTH_TOKEN from `claude setup-token`) in the platform's environment — for Docker Compose, " +
2550
- "self-hosting/.env, then `docker compose up -d` — or add the account's key in Settings → Model " +
2550
+ "self-hosting/.env, then `docker compose up -d` — or add the account's key in Settings → Models " +
2551
2551
  "(`foldrun account model set <provider> --key …`)",
2552
2552
  );
2553
2553
  step.status = "failed";
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 {
@@ -337,7 +340,7 @@ export const SCAN_RULES: readonly ScanRule[] = [
337
340
  help:
338
341
  "Each model takes its own effort levels: GPT-6 and Claude take all five, Gemini stops at high, Kimi has low, high and max. " +
339
342
  "The step still runs, at the nearest level the model has, and the step's log says so. Write the level it has, or choose " +
340
- "a provider whose model has the one you want (Settings → Model provider).",
343
+ "a provider whose model has the one you want (Settings → Models).",
341
344
  },
342
345
  {
343
346
  id: "config/output-fitted",
@@ -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 ───────────────────────────────────────────────────────────
package/src/starter.ts CHANGED
@@ -47,7 +47,7 @@ foldrun_version: "0.1"
47
47
  # that declares the same key replaces it *whole* — base_url and token never
48
48
  # merge across scopes, so a provider block belongs entirely at one level.
49
49
  #
50
- # Your own model key needs no block: Settings → Model provider, or
50
+ # Your own model key needs no block: Settings → Models, or
51
51
  # \`foldrun account model set anthropic --key …\` (an API key, not a login).
52
52
  # On foldrun's own platform you can run on foldrun's models instead, billed
53
53
  # in credits: \`foldrun account model use foldrun --provider anthropic\`.
@@ -409,7 +409,7 @@ and \`/api/metrics\` (Prometheus). Outside \`/api\`: \`/a2a/<account>/<ws>/flows
409
409
  (a published flow's agent card and A2A 1.0 JSON-RPC endpoint — an A2A key only, \`foldrun docs a2a\`).
410
410
 
411
411
  Every call answers — and the CLI sends — \`Foldrun-Version: YYYY-MM-DD\` (dated API
412
- versions; an account pin in Settings → API), \`X-RateLimit-*\` headers (a \`429\`
412
+ versions; an account pin in Settings → API keys → API), \`X-RateLimit-*\` headers (a \`429\`
413
413
  carries \`Retry-After\`), and writes that start work take an \`Idempotency-Key\`
414
414
  (a retry with the same key replays the first answer). The whole surface as
415
415
  OpenAPI 3.1: \`/api/openapi.json\` (open), or \`foldrun api spec --out openapi.json\`.
package/src/store.ts CHANGED
@@ -2761,7 +2761,7 @@ const ACCOUNT_SEALED: Record<string, string> = {
2761
2761
  "oauth-clients.json": "OAuth client credentials — never served to a browser.",
2762
2762
  "ledger.jsonl": "the billing ledger — append-only, read it through Usage and Wallet.",
2763
2763
  "billing.json": "the account's billing settings — read and change them in Wallet.",
2764
- "oauth-connections.json": "connected apps and their health — see Settings → Connections.",
2764
+ "oauth-connections.json": "connected apps and their health — see Settings → Secrets → Connections.",
2765
2765
  "secret-health.json": "secret usage bookkeeping — see Settings → Secrets.",
2766
2766
  };
2767
2767
 
@@ -3616,7 +3616,7 @@ export interface StepRecord {
3616
3616
  * "provider: …" — or "none set" (model-credential.ts). */
3617
3617
  credential?: string;
3618
3618
  /** Whose key paid for the step's model calls (3 Nov 2026): "own" — the
3619
- * account's (a provider: block, Settings → Model), billed by its
3619
+ * account's (a provider: block, Settings → Models), billed by its
3620
3620
  * provider; "operator" — the platform's own credential, billed from the
3621
3621
  * step's tokens; "foldrun" — foldrun's models, billed per call by the
3622
3622
  * model gateway, never from the step. Absent on older records. */
@@ -4502,7 +4502,7 @@ export function runCost(run: RunRecord): number {
4502
4502
 
4503
4503
  /** Whether a step's tokens are the platform's to bill: it ran on the
4504
4504
  * platform's own model credential, not the account's key ("provider: …" —
4505
- * a provider: block, or Settings → Model), which the provider bills. The
4505
+ * a provider: block, or Settings → Models), which the provider bills. The
4506
4506
  * meter, the Usage page and the ledger split all ask this one question, so
4507
4507
  * what a page shows is what was charged. */
4508
4508
  export function stepBillsTokens(s: Pick<StepRecord, "credential" | "supply">): boolean {
@@ -4542,7 +4542,7 @@ export function billedTokenCost(s: { credential?: string; supply?: StepSupply; c
4542
4542
  *
4543
4543
  * Tokens count only for steps that ran on the platform's own model
4544
4544
  * credential. A step on the account's own key (`credential` "provider: …" —
4545
- * a provider: block, or Settings → Model) was paid for at the provider, and
4545
+ * a provider: block, or Settings → Models) was paid for at the provider, and
4546
4546
  * billing it again here charged a BYOK customer twice. And a carried step's
4547
4547
  * tokens were billed where it ran, like its compute.
4548
4548
  */