DevelopCore & contracts
@holtkeeper/analyzers
The registry of analyzers Holtkeeper ships. The server’s job engine runs them; each implements the Analyzer contract of @holtkeeper/analyzer.
import { builtinAnalyzers } from '@holtkeeper/analyzers'| Kind | Scope | What it produces |
|---|---|---|
bundle |
repo | app builds and published packages: size per entrypoint, asset, release |
depgraph |
repo | dependency graph (JavaScript, Go): cycles, duplicate versions, statistics |
coverage |
repo | line, function and branch test coverage per source file |
testids |
repo | test attributes frontend templates expose, per component |
api-surface |
repo | public API of every package per version, for agents and semver checks |
licenses |
repo | third-party licenses judged against allow and deny lists |
stack |
group | runtimes, images and tools with end of life, and the team’s conventions |
assets |
repo | asset inventory checked against budgets, with smaller formats suggested |
branches |
repo | branches to clean up: merged, closed unmerged or stale, per author |
ci-jobs |
repo | CI job durations and failures over time |
i18n |
repo | translation gaps per locale |
propagate |
group | package updates rolled out across a team, failures handed to fix tasks |
review |
repo | AI review of a merge request |
rule-miner |
repo | learnings mined from merged merge requests’ review comments |
tracker |
group | declared entities tracked across repositories and documents |
audit |
repo | vulnerability audit with osv-scanner (data is an AuditReport) |
write-task |
repo | a code change pushed as a branch with a merge request (write worker pool) |
upgrade-check |
repo | AI check of what breaks when upgrading from one version to another |
rule-miner (@holtkeeper/rule-miner, whose registry copy has no store), review and write-task (@holtkeeper/write-task, whose registry copy refuses every task) need server state; the server replaces these registry copies with ones built on its store. The server also replaces upgrade-check (@holtkeeper/upgrade-check) with a copy that hands the agents the range’s public API and dependency changes; it is queued only by POST /api/releases/compare/check, never by schedules, triggers or freshness.
reviewChecks({ testids? }) returns the checks the review analyzer runs on changed lines: secrets and testids; testids takes the repository’s TestIdOverrides from the analyzers.testids setting.
bundle
Section titled “bundle”Measures what a repository ships as targets of one record (@holtkeeper/bundles): app builds and the versions of packages it publishes. It needs a checkout; the forge (npmRegistry), forge access (the token and rate-limited fetch for the forge’s own registry) and history are optional: without them packages are read anonymously and versions measured before are not skipped.
- Builds.
targets: [{ name, dir = '.', build?, dist?, entries? }], or thedist/buildshorthand for oneapptarget at the root. Without either, every package of the checkout that is the root orprivate, has abuildscript and either a Vite, webpack, Rspack, Rsbuild or Rollup config (<tool>.config.*) or abuildscript that calls one of them (NODE_ENV=production webpack --config webpack.mjs) is a target (appat the root, else the package name). One build with several entries (desktop, mobile, replay, …) is one target whose entrypoints come from the bundler’s manifest; setentriesto name them by output globs instead. Dependencies are installed once from the root lockfile (install,installScripts, as in @holtkeeper/coverage), then each target runsbuild(default<package manager> run build,CI=true,NODE_ENV=production, 20 minutes) through the job’s runner and measuresdist(default the first ofdist,build,out). A failed install is logged; a failed build or a missing output becomes afailedtarget with the error, so releases that no longer build are gaps, not failed jobs. Builds need network for the install: set thetoolchainsetting’snetworktofullincontainerexecution. - Packages. Every workspace package that is not
privateand has a version (packages/excludePackagesglobs narrow it) is measured at the version itspackage.jsonhas at the ref, plus up tohistoryearlier published versions (prereleases only withincludePrereleases). Archives come from the first registry that has the version, in this order:registries({ '@scope': url, '*': url }), the package’spublishConfig.registry,@scope:registry=/registry=of the package’s and the root’s.npmrc, the forge’s own registry for the repository (GitLab: the project’s npm endpoint), npmjs. Requests to the forge’s host go through the forge’sfetch(its per-token limits) with the forge token as a bearer token; other registries are read anonymously (or through the egress proxy). Versions earlier records measured are skipped, so a record holds only new versions; each measured version is also kept in the run cache. source:auto(default: both),buildorpackages. Flags:--source,--dist,--build,--history.- Nothing found. When detection finds no build and no package qualifies (and none was skipped as measured before), the record keeps
notesthat the report lists under a warning and the job log repeats: each package considered for a build and why it was passed over (nobuildscript, or abuildscript that calls no bundler and no bundler config), why no package counts as published (private root, nothing public with a version, orpackages/excludePackagesmatching none), and a pointer toanalyzers.bundle.targets, thebuild/distshorthand orsource: 'packages'. budgets: maximum JS and CSS gzip bytes per target name or glob, e.g.{ app: 400000, '@acme/*': 50000 }; the run ignores them, the stored metrics judge each target by them (Metrics).- Applies when the root
package.jsonnames workspaces,publishConfig,exportsor a bundler dependency, or apnpm-workspace.yamlexists. Repositories where it makes no sense turn it off withrepo.analyzers({ off: ['bundle'] }, Analyzers turned off): it is never queued automatically there, and the repository leaves Quality › Bundles and bundle shares.
Options: fix (default false: report only; true runs osv-scanner fix, the JavaScript and the Go fixers in the checkout and rescans), upgrade (major, minor or patch: the largest version jump osv-scanner fix may make, passed as --upgrade-config; unset leaves osv-scanner’s default, major; the JavaScript and Go fixers ignore it), allowlist (entries of @holtkeeper/vuln) and traits for conditional entries. Commands go through the job’s runner, so they run in the job’s sandbox. auditAnalysis renders the report with counts per severity and a findings table. The newest audit record of each repository is its current security state. Its metrics (auditMetrics) store AuditMetrics: active advisories (findings) and their counts per severity (severities, every severity present), allowlisted (ignored), expired allowlist entries (expired), advisories fixing removed (resolved), every active and allowlisted finding as AuditFindingMetric (advisories: advisory, aliases, summary, severity, package, ecosystem, version, source, fixed versions, and allowlisted: { until? } for those the allowlist hid) and firstSeen, when each finding was first reported on this line of history, keyed by auditFindingKey (advisory, ecosystem and package; not version or source). firstSeen carries a key over from the previous record’s metrics and otherwise uses the record’s createdAt from the metrics context; records stored before it existed have none, and a key is missing when no time is known. Fleet tables (the server’s GET /api/audits/findings) read only these metrics, never the report.
The analyzer declares no refresh: freshness never queues it. For npm and Go the server’s vulnerability index writes audit records without a checkout and queues this analyzer (trigger vuln-index) when audit.fix is on and it finds something new to fix; otherwise it runs on demand and on schedules people create.