lint#
Validate manifests against the bundled APDS contract.
Overview#
agentpm lint defaults to strict standalone APDS validation: every authored manifest must explicitly declare a supported standard and satisfy its structural and local semantic rules. Missing, malformed, or unsupported declarations fail without needing --strict. That flag additionally treats warning advice as errors.
Validation uses the bundled, version-pinned contract offline. Standalone success does not establish resolved dependency correctness, packaged-file validity, or Runner readiness. init and export --manifest declare the supported standard in new scaffolds. Lint never adds or rewrites that declaration.
Command synopsis#
agentpm lint [PATHS...] [--schema <PATH>] [--strict] [--format <pretty|json|ndjson>] [--fix]
agentpm lint [PATHS...] --legacy [--strict] [--format <pretty|json|ndjson>]
agentpm lint [PATHS...] --apds <standalone|resolved|packaged> [--graph <FILE>] [--package-root <DIR>] [--format <pretty|json|ndjson>]Arguments#
PATHS(default:./agent.json). Files/dirs/globs to lint. Explicit files may have any filename, such asreviewer.agent.jsonormanifest.json. Directories are scanned recursively foragent.json. Missing inputs, empty scans, and unmatched patterns fail rather than reporting success without checking a manifest.--schema <PATH>. Load a local development schema without replacing canonical authoring checks. Even a permissive override cannot make a manifest with a missingstandardor another canonical defect pass. Output includes a non-authoritativeschema.overridewarning;--stricttreats it as a failure. An override cannot authorize publication. The CLI ignores CWD-relative schema files unless explicitly selected.--strict. Treat warnings as errors (schema violations are always errors).--format <pretty|json|ndjson>(default:pretty). Choose human-readable output or machine-friendly JSON/NDJSON.--fix. Add a missing$schemaeditor hint only after a supported, explicitly declared manifest passes canonical validation. It never addsstandardor repairs an invalid declaration. Undeclared, invalid, or unsupported input is not written. When no fix is needed, the original bytes remain unchanged.--legacy. Read-only compatibility check for undeclared historical manifests. Uses the same APDS engine and cannot be combined with--fix,--schema, or--apds. See older local manifests.
Explicit APDS evaluation#
Ordinary lint uses standalone scope. Use an explicit scope to evaluate APDS 1.0.0 structure and semantic relationships with supplied context:
agentpm lint --apds standalone agent.json
agentpm lint --apds packaged --package-root . agent.json
agentpm lint --apds resolved --graph selected-graph.json agent.jsonstandalone checks the manifest without resolving dependencies or inspecting package files. packaged additionally checks applicable content inside the explicitly supplied complete package root. resolved checks relationships against the exact selected dependency manifests supplied in a local graph. These modes use the bundled contract offline, accept explicit manifest filenames, and cannot be combined with --schema or --fix.
The graph file contains complete, artifacts and edges. Each artifact declares a unique local id, namespaced identity, kind, exact version and local manifest path. Paths resolve relative to the graph file, or may be absolute. Each edge declares from (an artifact ID or root), field (the declaring dependency's JSON Pointer) and to (the selected artifact ID). This is a validator input format; it does not require changing agent.lock or contacting a Registry.
Results distinguish conformant within the requested scope, nonconformant, incomplete and unsupported. Without needed graph or package context, dependent checks remain unevaluated. A complete package that lacks a required file is nonconformant. Unsupported vector/index representations and complex governed record-schema projection checks return unsupported with the affected rules left unevaluated. They are not declared invalid solely because the CLI cannot establish those properties.
JSON and NDJSON reports retain the existing file, ok and issues fields. APDS evaluations include apds metadata: selected standard, level, status, evaluated rules, unevaluated rules and notes. Findings identify rule IDs and affected source paths. Only a conformant result returns success; incomplete, unsupported and nonconformant evaluations return a nonzero exit status. Warning advice can additionally fail --strict. No Runner behavior or local execution readiness is established by these checks.
evaluated_rules lists rule IDs for which this implementation completed checks in the requested scope. A check can succeed because an optional declaration is absent: checking that no binding introduces an undeclared dependency does not require a manifest to contain bindings. The list is not test coverage or proof that every clause of a rule was exercised. A rule may also appear in unevaluated when other checks for that rule need more context. Implementations may stop after different failures, so their evaluated-rule lists can differ while their conformance results agree.
Use --format=json or --format=ndjson in CI and parse the result for gating.
Examples#
Lint the current manifest#
agentpm lintMissing fields and invalid relationships produce diagnostics with the source path, affected JSON pointer, rule ID, and remediation. For example, a missing declaration identifies /standard with APDS-ID-001 and asks you to add the supported selector; an unsupported declaration asks you to select a supported contract or use a CLI that supports the declared version.
Lint multiple paths (file + directory + glob)#
agentpm lint manifest.json ./packages "tools/**/agent.json"Load a development schema override#
agentpm lint --schema ./schemas/dev.agentpm.schema.jsonArbitrary HTTP(S) schema overrides are rejected rather than fetched. The pinned APDS schema URI and the historical AgentPM schema URL resolve to the bundled copy offline. A local override is loaded, but the same canonical authoring checks still run, including the explicit standard requirement. The override is labeled non-authoritative and cannot substitute for publish preflight.
Strict mode (warnings become errors)#
agentpm lint --strictMachine-readable output#
agentpm lint --format=jsonJSON is an array of file reports; NDJSON emits one report per line. Reports retain file, ok, and issues; issue fields include file, level, message, instance_path, and schema_path, with rule_id where applicable. Diagnostics stay structured on stdout, with command-level failure information on stderr.
Auto-fix safe issues#
agentpm lint --fix
# adds a missing $schema hint only to an otherwise valid supported manifestHow lint classifies issues#
Human output lists semantic/domain errors before schema fallbacks and always identifies
the failing manifest and JSON pointer. Generic union errors covered by a more specific
diagnostic are suppressed; equivalent duplicates are shown once. Large value echoes are
bounded, and closed unions name accepted alternatives where possible. For example, a
Tool missing entrypoint reports that field at /entrypoint, rather than dumping the manifest
at /oneOf. Publish validation, including --dry-run, uses the same contextual renderer.
JSON and NDJSON retain the report and issue fields shown above. Human-only expansion,
ordering, truncation, and deduplication do not discard machine diagnostics. The optional
rule_id field carries the applicable APDS rule identity for canonical findings;
warning advice remains separate from normative conformance.
Always failures:
- Any JSON Schema validation failure. (Example:
"description" is a required property) - A missing, malformed, or unsupported
standardin ordinary authoring lint. - An empty or whitespace-only
description, including during legacy compatibility checks. Earlier CLI versions only warned; add a meaningful description before linting or republishing. The schema owns this error; there is no duplicate warning.
Warnings (unless --strict):
- Missing
$schema. Message:Missing $schema; editors may lack IntelliSense. - An explicit development schema override. Its result is labeled non-authoritative.
Semantic error checks (beyond schema):
- Interpreter mismatch between
runtime.typeandentrypoint.command. Error message example:runtime.type should match entrypoint.command (python vs node). - Loop graph validation for
kind: "loop"manifests (entry phase, transitions, reachable terminals, checkpoints, and error-policy consistency). - Agent binding membership validation for
kind: "agent"manifests (bindingspackage identities must already be declared in the matching top-level dependency collection).
Lint catches issues early so installs and publishes are predictable. agentpm publish runs lint automatically and will block the publish on any lint errors.
Exit codes#
0— All checked manifests passed (no errors; warnings allowed unless--strict).1— Validation failed, including missing/empty inputs, unsupported or incomplete evaluation, or warnings when--strictis set.
Older local manifests#
Use --legacy to preview what an undeclared local manifest needs before migration:
agentpm lint --legacy ./agent.json --format jsonOnly when standard is absent, the command adds the supported selector to an in-memory copy and runs the same standalone APDS engine. It does not write the copy or change the original file. The report is labeled compatibility: "legacy-unverified" and has no apds verdict for that inferred input, even if the compatibility check passes. A malformed declaration is not treated as absent. Explicitly declared unsupported standards still fail with rule IDs, source paths, and remediation; --legacy cannot fall back to another contract.
To upgrade, review and fix the local manifest, then manually add the supported root declaration:
{
"standard": { "id": "agentpm", "version": "1.0.0" }
}This is a fragment to merge into the existing manifest, not a replacement file. Run ordinary agentpm lint afterward. For Knowledge or Memory packages, rebuild derived output after editing the manifest and before publishing. A compatibility check cannot authorize publish, package, or a saved-build publication; those commands have no legacy bypass.
Historical installed artifacts can still be consumed by existing install, run, Template generation, and installed Knowledge/Memory inspection flows. Do not edit installed package bytes or republish historical versions to satisfy local authoring lint. See generated Template workspaces for the local root written by agentpm new.
Recommended workflow#
- Run
agentpm lintlocally during development. - Use
agentpm lint --format=jsonin CI to gate merges. - Add
--strictfor release branches to enforce clean manifests. - After declaring the supported standard and fixing errors, use
--fixto add a missing$schemahint; commit any change.
Loop and binding boundary#
For Loop and Agent binding manifests, agentpm lint intentionally stays local:
- it validates Loop graph structure and determinism
- it validates that Agent bindings reference already-declared top-level package identities
- it does not resolve Loop phase IDs against an installed Loop package
- it does not resolve Memory spaces or operations against installed Memory Blueprints
- it does not compare Loop access intent with Agent bindings and reject conflicts
Notes & gotchas#
$schemafield. Including$schemaenables IDE IntelliSense; onlystandardselects the definition contract.--fixcan add the editor hint to an otherwise valid supported manifest.- Globs & directories. When passing directories, ensure your shell doesn’t expand globs unexpectedly; quote them if needed (e.g.,
"tools/**/agent.json").