DevelopCore & contracts
@holtkeeper/settings
Settings that differ per folder, team or repository: audit policy, AI budgets, plus a few global ones such as the AI provider agents use. Each setting key can have entries for several scopes; the most specific one covering a repository wins.
Definitions
Section titled “Definitions”defineSetting({ key: 'audit.upgrade', label: 'Largest upgrade', description: '...', section: 'Audit', schema: z.enum(['major', 'minor', 'patch']), default: 'major', // what applies where no entry covers a repository; null when nothing does secret?: true, // sealed in storage, never sent to clients global?: true, // one value for every repository: only `{ all: true }` entries})Built in: llm.provider (global; the id or name of an AI provider credential, see @holtkeeper/agent; its schema carries "x-credential": "ai-provider" so the UI offers a credential picker; "x-credential": "github" offers credentials of kind github, "ai-sdk" those of kind ai-sdk, any other family every credential; tasks run on the fixed tiers of @holtkeeper/agent), llm.tiers (label Models, global, section AI, llmTiersSchema { fast?, main?, deep? }, each a list of up to 8 modelRouteSchema { model, credential?, effort? } most preferred first, default null: the models a tier runs on and falls back to; model is an id as the credential lists it, the id without its vendor or <family>@latest; credential ("x-credential": "ai-provider") defaults to llm.provider‘s; effort is low, medium or high, unset the tier’s; see @holtkeeper/server), llm.budget (see @holtkeeper/ai-usage), learnings.approvalDelayDays (section Knowledge, integer 0–365, default 3: days a new learned rule stays pending before it reaches prompts by itself; 0 activates at once) and learnings.expiryDays (section Knowledge, integer 1–3650, default 90: days an active learning lives without reinforcement before it expires), both read for the learning’s repository (for team- or organization-wide learnings, the entry for all repositories; see @holtkeeper/rules), audit.fix, audit.upgrade, audit.allowlist, audit.allowlistPolicy (allowlistPolicySchema: maxDays (optional, 1–3650: new and renewed allowlist entries must expire within that many days) and requireReason (default true); the default { requireReason: true } sets no expiry cap; whoever writes allowlist entries enforces it), repo.freeze (section Repositories, repoFreezeSchema { frozen (default true), reason?, until? }: Holtkeeper only analyzes the repository and never changes it, unless a narrower entry with frozen: false lifts the freeze, see @holtkeeper/server; see Freezes), repo.tests (label Tests, section Repositories, repoTestsSchema { expected (default true), reason? }, default { expected: true }: whether repositories are meant to have tests; see Repositories without tests), mergeRequests.comments (label Merge request reviews, section Merge requests, mergeRequestCommentsSchema { enabled (default true), reason? }, default { enabled: true }: whether Holtkeeper reviews and comments on merge requests; see Merge request reviews), access.crossTeam (label Reach, global, section Access: off, metadata or snippets, default defaultCrossTeam = snippets; how far people and agents read other teams’ catalog, one level for everyone with no per-team exceptions; the schema carries "x-labels" with a plain label per level; see @holtkeeper/server), tasks.write (global, section AI, edited in the panel’s Ops › Tasks, tasksWriteSchema: enabled (default false, the instance-wide switch for write tasks), perRepoUsd 1.5, perGroupUsd 5, weeklyUsd 40, maxRepos 10), mcp.ask (label Ask over MCP, global, section AI, mcpAskSchema: enabled (default false, the instance-wide switch for the MCP tool ask, see @holtkeeper/server), perAnswerUsd 0.3 (at most 2), perPersonPerDay 30, weeklyUsd 15). The server also registers commits.conventions (see @holtkeeper/commit-conventions) and the release settings releases, releases.notify and releases.announce (label Release announcements, section Releases, edited under Settings › Integrations: Slack channels that get a message per new version; see @holtkeeper/release and Release announcements), and security.alerts (label Urgent vulnerability alerts, global, section Audit, edited under Settings › Integrations: Slack channels that get a message per urgent advisory; see @holtkeeper/vuln-triage and Urgent vulnerability alerts), and slack.mergeRequestMarks (label Slack merge request marks, global, section Integrations: { enabled (default false), channels (default all), emoji }, extra emoji for open threads of people, approvals and merges on Slack messages linking merge requests; see Merge request marks). Every definition has a default: the value the code reading the setting uses when no entry covers a repository, typed as the schema’s output, or null when nothing applies until someone sets it (llm.provider). It describes behavior without an entry and is never written to the store; values a fresh install starts with are defaultSettings below. analyzerSettings fills it for analyzers.<kind> with what the options schema fills in by itself. Plugins add their own; the server validates values against the schema and exposes it as JSON Schema so the UI can build forms. A global setting accepts only entries for { all: true }: the server refuses other scopes and the panel offers no scope picker for it. When schema cannot describe the shape (a refined record that checks fields one by one, like analyzers.<kind>), form gives the shape shown to editors instead. help is optional Markdown guidance the panel shows next to the setting and its editor: what it changes, how its scopes combine and recommended values; description stays the one-line summary. A schema (or form) carrying "x-editor": "<name>" asks the panel for a dedicated editor instead of the generated form; The panel ships merge-request-policies, trackers and renovate. Analyzers name theirs with Analyzer.editor, which the server puts on the analyzers.<kind> form.
presets lists ready-made values ({ id, label, description?, value }, each passing schema) that the panel offers in a Preset picker. Applied to an object value a preset sets its own fields and keeps the others, so partial presets combine; other values are replaced. Built in: llm.budget (default, learn, small-team). Analyzers declare theirs as Analyzer.presets (options instead of value), which analyzerSettings turns into presets of analyzers.<kind>, e.g. the license policies of @holtkeeper/licenses.
Defaults on a fresh install
Section titled “Defaults on a fresh install”seedDefaultSettings({ store, definitions, defaults?, now? }) writes defaults (default defaultSettings) for { all: true } when the store holds no settings at all, and only once per store: the first call records settings:defaults-seeded in Store.kv (atomically through compareAndSet, so concurrent servers seed once), and later calls do nothing, even after every setting was removed. A store that already has settings is marked and left alone. Without kv the empty store is the only check; entry ids are stable (default:<key>), so concurrent seeding writes the same entries. Unknown keys, secret settings and values their schema rejects are skipped. Entries are updatedBy: 'system' and the run is audited as setting.seed by the system actor with details.keys. The server calls it at startup.
| Key | Default |
|---|---|
llm.budget |
preset default: block above $150 a week, the last $25 kept for interactive work |
llm.tiers |
fast claude-haiku@latest (low), main claude-sonnet@latest (medium), deep claude-sonnet@latest (high) |
audit.upgrade |
minor |
polling |
enabled, every 5m, 1h while webhooks deliver (defaultPolling of @holtkeeper/updates, added by the server) |
Freezes
Section titled “Freezes”repo.freeze values are { frozen, reason?, until? }: frozen defaults to true, so stored values without it are freezes; reason (up to 500 characters after trimming) is required while frozen and recommended on a lift (frozen: false), where an empty one is dropped; until is an ISO 8601 date-time with offset, without it the entry lasts until removed. Its form starts a new entry as { frozen: true, reason: '' }, so the editor shows the switch and the reason at once. activeFreeze(value, now?) returns the parsed value while it is in force (valid and now before until), freeze or lift alike. resolveRepoFreeze(entries, repo, now?) returns { frozen, reason?, until?, entry? } for a repository: the most specific covering entry among those in force (secret and invalid entries skipped), so a repository entry { frozen: false } keeps one repository of a frozen folder writable (and a deeper folder’s lift beats its parent folder’s freeze), and an expired entry, freeze or lift, lets the next broader one apply again; without one the repository is writable and entry is absent. lifted: true marks a deciding lift that overrides a broader freeze in force; a lift with nothing frozen above it decides nothing visible. A lift is an ordinary entry, so whoever has settings:write on a folder, team or repository can lift a broader freeze there, one set for everything included, and freezes stored before lifts existed are overridden the same way. Every reader of the setting goes through these helpers.
Repositories without tests
Section titled “Repositories without tests”repo.tests values are { expected, reason? }: expected defaults to true, reason (1–500 characters after trimming) says why a repository has no tests. As with repo.freeze, the most specific entry wins, so a repository entry { expected: true } lifts a folder entry { expected: false }. resolveRepoTests(entries, repo) returns { expected, reason?, entry? }: the winning entry, or the default without one; a secret or invalid winning value counts as the default. testsExpected(entries, repo) is its boolean. With tests off the server never queues coverage automatically, agents are told not to add or run tests, AI reviews never ask for tests (test-id comments still come), write tasks and propagation leave out test checks, and test write tasks are refused (see @holtkeeper/server). Test ids (analyzers.testids) are unaffected: end-to-end suites in other repositories read them.
Analyzers turned off
Section titled “Analyzers turned off”repo.analyzers (label Analyzers off, section Repositories) is not built in: the server registers repoAnalyzersSetting(analyzers) with the analyzers it runs (SwitchableAnalyzer: kind, label), so off accepts only their kinds and its JSON Schema lists them as an enum with x-labels. Values are { off, reason? } (repoAnalyzersSchema, the shape readers parse with): off defaults to [], reason (1–500 characters after trimming) says why. The default is { off: [] }. The most specific entry wins as a whole, so a repository entry { off: [] } turns a folder’s analyzers back on. resolveRepoAnalyzers(entries, repo) returns { off, reason?, entry? } (a secret or invalid winning value counts as the default, with no entry; reason only while something is off); analyzerOff(entries, repo, kind) gives { reason? } when kind is off. What turning an analyzer off changes is in @holtkeeper/server.
Merge request reviews
Section titled “Merge request reviews”mergeRequests.comments values are { enabled, reason? }: enabled defaults to true, reason (1–500 characters after trimming) says why reviews are off. The most specific entry wins, so a repository entry { enabled: true } lifts a folder entry { enabled: false }. resolveMergeRequestComments(entries, repo) returns { enabled, reason?, entry? }: the winning entry, or the default without one; a secret or invalid winning value counts as the default, and reason is kept only while it is off. With it off the server queues no AI review and posts nothing on the repository’s merge requests (see @holtkeeper/server); unlike repo.freeze it leaves branches, merge requests Holtkeeper opens and every other forge write alone.
Stale keys
Section titled “Stale keys”unknownSettingKeys(definition, value) lists the keys of a stored value the definition’s form (else schema) strips on parse, nested object fields included as dotted paths (limits.min), as UnknownSettingKey { key, movedTo? }. Schemas that keep (loose) or refuse (strict) extra keys, non-object values and secret settings give none. movedTo comes from the definition’s optional movedKeys (dotted path → where the option lives now, e.g. { ignore: 'assets.policy › ignore' }). It only reports: stored values are never rewritten. The server puts the result on listed and resolved entries.
Retired keys
Section titled “Retired keys”retiredSettingKeys lists keys Holtkeeper no longer reads: the old model settings (llm.model, llm.models), prose instructions that moved to rules (review.instructions, agent.instructions), the settings of the old knowledge base (agent.tools, knowledge.autoAccept, knowledge.embeddings, learnings.autoAccept, guide.autoAccept), the options of removed analyzers (analyzers.changelog, analyzers.delivery, analyzers.fleet, analyzers.port, analyzers.quality, analyzers.release-risk, analyzers.warmup) the boolean repo.readOnly, replaced by repo.freeze (stored values are not converted: set them again as freezes), and slack.reviews, the channel binding of the Slack review status, which now covers every channel the app is in. isRetiredSetting(key) checks one. The resolvers below return nothing for them, and the server hides their definitions and stored entries and refuses new values, so stored rows with values no schema accepts never break validation. The rows stay in the store until a one-off cleanup removes them; never reuse a retired key for a new setting.
Resolution
Section titled “Resolution”resolveSetting(entries, key, repo) picks, among entries whose scope covers the repository, the most specific:
- exact repository paths (
acme/round/web) - path globs, more literal leading folders first (
acme/round/**beforeacme/**;acme/*/webpins one folder) - teams (
widgets) - everything
A scope with several entries ranks by its broadest one. A deeper folder’s entry therefore beats its parent folder’s, any folder’s beats a team’s, and a team’s beats an entry for everything. A repository owned by two teams with entries of their own gets the newer one, which is why the panel offers folders first.
Ties go to the most recently updated entry; retired keys never resolve. The ranking is scopeSpecificity of @holtkeeper/access, shared with merge request policies, knowledge and AI budgets. resolveSettings(entries, repo) resolves every key at once. settingCascade(entries, key, repo) lists every covering entry in override order (the one that applies first, then the ones it overrides from narrow to broad) and settingCascades(entries, repo) does that for every key with a covering entry; the API exposes both as GET /api/settings/resolve?repo=forge:path (settings with the winners, cascade with the full lists).
effectiveSettings(definitions, entries, repo) gives one row per definition, in order and without retired keys: the single entry that applies as a whole (entry, absent when definition.default applies) and the covering entries it overrides (overridden, narrow to broad). Values are never merged field by field, a global definition counts only entries scoped { all: true }, and entries of keys without a definition are ignored. It backs the resolver rows of GET /api/settings/resolve.
Team rules for review and agents are not settings: they are repository rules files and panel rules, see @holtkeeper/rules.