Skip to content

Error Codes

Every error raised by nubos-pilot is a NubosPilotError with a stable code string, a human-readable message, and an optional details object. Callers (workflows, plan-checker, test suites) match on err.code verbatim, never on the message.

js
class NubosPilotError extends Error {
  constructor(code, message, details) {
    super(message);
    this.name = 'NubosPilotError';
    this.code = code;
    this.details = details;
  }
}

The codes below are grouped by source module.

Core / lifecycle

CodeSourceMeaning
not-in-projectlib/core.cjsprojectStateDir(cwd) could not find a .nubos-pilot/ ancestor.
lock-timeoutlib/core.cjswithFileLock could not acquire the lock within timeoutMs.
unknown-commandnp-tools.cjsTop-level dispatch received an unrecognized command name.
unknown-init-workflownp-tools.cjsinit <workflow> dispatched to an unregistered workflow.

Layout / IDs

CodeSourceMeaning
layout-invalid-numberlib/layout.cjsMilestone/slice/task number is not a non-negative integer.
layout-invalid-idlib/layout.cjsID string does not match the expected shape (M<NNN>, S<NNN>, T<NNNN>, or M<NNN>-S<NNN>[-T<NNNN>]).
layout-invalid-sluglib/layout.cjsSlug does not match /^[a-z0-9-]+$/.
layout-slice-slug-mismatchlib/layout.cjsExisting slice directory has a slug different from the one requested.

Roadmap / milestone

CodeSourceMeaning
roadmap-parse-errorlib/roadmap.cjsroadmap.yaml unreadable or invalid YAML.
roadmap-too-largelib/roadmap.cjsroadmap.yaml exceeds 1 MB cap.
roadmap-invalid-milestonelib/roadmap.cjsMilestone input missing id.
roadmap-duplicate-milestonelib/roadmap.cjsMilestone id already exists.
roadmap-milestone-not-foundlib/roadmap.cjsReferenced milestone id does not exist.
roadmap-invalid-sluglib/roadmap.cjsPhase slug (legacy schema) missing or invalid.
roadmap-invalid-descriptionlib/roadmap.cjsBacklog description empty or contains YAML separator pattern.
roadmap-description-too-longlib/roadmap.cjsBacklog description exceeds 500 chars.
phase-not-foundlib/roadmap.cjsgetPhase(n) — no milestone with that number/id.

Tasks

CodeSourceMeaning
tasks-invalid-frontmatterlib/tasks.cjsTask frontmatter missing required field or wrong type.
tasks-invalid-statuslib/tasks.cjsstatus value not in {pending, in-progress, done, skipped, parked}.
tasks-invalid-tierlib/tasks.cjstier value not in {haiku, sonnet, opus}.
tasks-invalid-ownerlib/tasks.cjsowner value not recognized.
tasks-unknown-deplib/tasks.cjsdepends_on references a task id that does not exist in the graph.
tasks-cycliclib/tasks.cjsloadTaskGraph detected a dependency cycle.
task-frontmatter-missinglib/tasks.cjsTask file has no frontmatter block at all.
task-status-line-missinglib/tasks.cjsTask body has no status: line where one is required.
invalid-task-statuslib/tasks.cjsStatus transition violates the lifecycle state machine.
task-not-foundlib/tasks.cjsTask id not present in the loaded graph / directory.

Agents

CodeSourceMeaning
agent-not-foundlib/agents.cjsloadAgent(name) could not find agents/<name>.md.
agent-invalid-frontmatterlib/agents.cjsRequired field missing, or name does not match filename stem.
agent-forbidden-fieldlib/agents.cjsFrontmatter contains model, model_profile, or hooks.
agent-invalid-tierlib/agents.cjstier value not in {haiku, sonnet, opus}.
invalid-tierlib/model-profiles.cjsresolve-model was given an invalid tier.
invalid-profilelib/model-profiles.cjsresolve-model was given an invalid model_profile.

Git / commit

CodeSourceMeaning
commit-paths-invalidlib/git.cjsassertCommittablePaths rejected the input shape.
commit-all-paths-gitignoredlib/git.cjsAll paths in files_modified are gitignored (hard-fail).
commit-no-pathslib/git.cjsCommit invoked with an empty path list.
task-commit-not-foundlib/git.cjsfindCommitByTaskId found no matching commit.
list-task-commits-invalidlib/git.cjslistTaskCommits given an empty/invalid prefix.

State / config

CodeSourceMeaning
schema-version-mismatchlib/state.cjsSTATE.md schema version does not match the runtime expectation.
config-parse-errorbin/np-tools/config.cjsconfig.json is not valid JSON.
config-forbidden-keybin/np-tools/config.cjsDotted key path contains a forbidden segment.
config-invalid-keybin/np-tools/config.cjsDotted key segment violates /^[a-zA-Z0-9_-]+$/.

Templates

CodeSourceMeaning
template-not-foundlib/template.cjsTemplate file missing.
template-unresolved-varlib/template.cjs placeholder has no answer key.

Verify / validate

CodeSourceMeaning
verify-file-unreadablelib/verify.cjsVERIFICATION.md cannot be read at the expected path.
verify-milestone-dir-missinglib/verify.cjs/np:verify-work <N> invoked on a milestone that has no directory yet.
verify-work-invalid-phasebin/np-tools/verify-work.cjsMilestone argument not a positive integer.
verify-work-not-foundbin/np-tools/verify-work.cjsMilestone id not in roadmap.yaml.
verify-work-invalid-sc-idbin/np-tools/verify-work.cjsrecord-sc SC id not of the form SC-<N>.
verify-work-invalid-statusbin/np-tools/verify-work.cjsSC status not Pass / Fail / Defer / Pending.
verify-work-file-unreadablebin/np-tools/verify-work.cjsrecord-sc before emit-draft.
verify-work-sc-not-foundbin/np-tools/verify-work.cjsSC id absent from the draft VERIFICATION.md.

Output-schema enforcement (ADR-0017)

CodeSourceMeaning
output-schema-violationlib/output-lint.cjs::enforceFile, bin/np-tools/output-lint.cjs check --enforce, bin/np-tools/doctor.cjs::_checkOutputSchemasOutput artefact failed schema lint. Inspect the violations[] array — re-spawn the producing agent with the diff as feedback. Never hand-edit.
output-schema-not-foundlib/schemas/index.cjs::getSchemaUnknown schema name passed to output-lint. Run output-lint list to see registered names.
output-lint-missing-filebin/np-tools/output-lint.cjs check--file <path> argument missing or empty.
output-lint-missing-schemabin/np-tools/output-lint.cjs prompt--schema <name> argument missing.
output-lint-cannot-infer-schemabin/np-tools/output-lint.cjs checkFilename does not match a known artefact pattern (*-VERIFICATION.md, *-VALIDATION.md, *-RESEARCH.md, spawn-*.md); pass --schema explicitly.
output-lint-unknown-verbbin/np-tools/output-lint.cjsVerb not in `check

Project lifecycle / archive (ADR-0016)

CodeSourceMeaning
archive-no-projectlib/archive.cjs::archiveProjectPROJECT.md not present — nothing to archive.
archive-not-completelib/archive.cjs::archiveProjectProject status reports blockers; pass --force (or run /np:close-project first) to archive anyway. Manifest will record forced: true.
archive-worktrees-presentlib/archive.cjs::archiveProject.nubos-pilot/worktrees/ is non-empty. Clean up via /np:worktree-list / /np:worktree-remove, or pass --force.
archive-collisionlib/archive.cjs::archiveProjectMore than 99 archives for the same slug + date — should never happen in practice.
archive-path-escapelib/archive.cjs::readArchiveFileRelative path in archive-project read --rel escapes the archive directory. Path-traversal guard.
archive-invalid-project-statuslib/archive.cjs::setProjectStatusValue not in {active, completed}.
archive-read-missing-namebin/np-tools/archive-project.cjsread verb without --name <archive-dir>.
archive-read-missing-relbin/np-tools/archive-project.cjsread verb without --rel <relative-path>.
archive-project-unknown-verbbin/np-tools/archive-project.cjsVerb not in `status
close-project-unknown-verbbin/np-tools/close-project.cjsVerb not in `init
project-already-initializedbin/np-tools/new-project.cjs::_applyPROJECT.md exists and Phase -1 was not taken. Re-run with Phase -1 archive choice or resolve manually.

Researcher reconciliation (ADR-0018)

CodeSourceMeaning
researcher-spawn-missinglib/researcher-reconciler.cjs::parseSpawnOutputSpawn output file does not exist at the expected path.
researcher-spawn-frontmatterlib/researcher-reconciler.cjs::parseSpawnOutputSpawn output frontmatter unparseable — file likely violates researcher-output schema.
researcher-reconcile-no-research-dirlib/researcher-reconciler.cjs::prepareReconcilerInputNo research/ subdir under M<NNN>/. Stage 1 of the swarm did not run.
researcher-reconcile-no-spawn-fileslib/researcher-reconciler.cjs::prepareReconcilerInputresearch/ exists but contains no spawn-*.md files.
researcher-reconcile-no-finalbin/np-tools/researcher-reconcile.cjs gateM<NNN>-RESEARCH.md does not exist yet. Reconciler stage did not run or failed schema lint.
researcher-reconcile-invalid-milestonebin/np-tools/researcher-reconcile.cjsMilestone argument not a positive integer.
researcher-reconcile-missing-filebin/np-tools/researcher-reconcile.cjs parse-spawn--file <path> argument missing.
researcher-reconcile-unknown-verbbin/np-tools/researcher-reconcile.cjsVerb not in `parse-spawn

Undo / recovery

CodeSourceMeaning
undo-missing-prefixbin/np-tools/undo.cjs/np:undo called with no argument.
undo-invalid-prefixbin/np-tools/undo.cjsPrefix not a milestone number or M<NNN>[-S<NNN>].
undo-task-missing-idbin/np-tools/undo-task.cjs/np:undo-task invoked without a task id.
undo-task-invalid-idbin/np-tools/undo-task.cjsTask id format invalid.
undo-task-commit-not-foundbin/np-tools/undo-task.cjsNo task(<id>): commit in the repo.
reset-slice-invalid-task-idbin/np-tools/reset-slice.cjsExplicit task id argument malformed.
reset-slice-no-statebin/np-tools/reset-slice.cjsSTATE.md not readable — not inside a nubos-pilot project.
checkpoint-invalid-tasklib/checkpoint.cjsCheckpoint operation referenced an unknown task.
checkpoint-invalid-task-idlib/checkpoint.cjsTask id format invalid.

Nubosloop / loop-run-round (ADR-0010)

CodeSourceMeaning
loop-run-round-invalid-task-idbin/np-tools/loop-run-round.cjsFirst positional argument does not match M<NNN>-S<NNN>-T<NNNN>.
loop-run-round-missing-phasebin/np-tools/loop-run-round.cjs--phase flag missing.
loop-run-round-invalid-phasebin/np-tools/loop-run-round.cjs--phase not in {preflight, post-researcher, post-executor, post-critics, commit, stuck}.
loop-run-round-preflight-missing-querybin/np-tools/loop-run-round.cjs--phase preflight invoked without --query.
loop-preflight-already-stampedbin/np-tools/loop-run-round.cjs--phase preflight re-invoked on a task whose loop has already entered the round-1 body (Gap #9 from the 2026-05-05 review). Pass --force-preflight to override.
loop-post-researcher-missing-spawn-auditbin/np-tools/loop-run-round.cjs--phase post-researcher invoked without swarm.research.k np-researcher audit entries (k-of-k Layer-C gate).
loop-run-round-post-executor-missing-verifybin/np-tools/loop-run-round.cjs--phase post-executor invoked without --verify-exit-code.
loop-post-executor-missing-spawn-auditbin/np-tools/loop-run-round.cjsLayer-C: no executor / build-fixer audit entry for the round.
loop-run-round-verify-output-traversalbin/np-tools/loop-run-round.cjs--verify-output-path resolves outside cwd or TMPDIR.
loop-run-round-verify-output-unreadablebin/np-tools/loop-run-round.cjs--verify-output-path could not be read.
loop-run-round-post-critics-missing-outputsbin/np-tools/loop-run-round.cjs--phase post-critics invoked with neither --critic-outputs nor --critic-outputs-path.
loop-run-round-post-critics-missing-outputs-invalid-jsonbin/np-tools/loop-run-round.cjsInline --critic-outputs is not valid JSON.
loop-run-round-post-critics-invalid-outputsbin/np-tools/loop-run-round.cjs--critic-outputs parsed JSON is not an array.
loop-run-round-post-critics-conflicting-outputsbin/np-tools/loop-run-round.cjs(L5) Both --critic-outputs and --critic-outputs-path passed. Pick exactly one.
loop-run-round-critic-outputs-path-traversalbin/np-tools/loop-run-round.cjs(L5) --critic-outputs-path resolves outside cwd or TMPDIR.
loop-run-round-critic-outputs-path-unreadablebin/np-tools/loop-run-round.cjs(L5) --critic-outputs-path cannot be read.
loop-run-round-critic-outputs-path-invalid-jsonbin/np-tools/loop-run-round.cjs(L5) --critic-outputs-path content is not valid JSON.
loop-run-round-critic-outputs-path-invalid-shapebin/np-tools/loop-run-round.cjs(L5) --critic-outputs-path JSON is neither an object nor an array.
loop-post-critics-missing-critic-auditbin/np-tools/loop-run-round.cjsLayer-C: no np-critic audit entry for the round. Single-Critic Revision — exactly one audit, not three.
loop-commit-precondition-missingbin/np-tools/loop-run-round.cjsLayer-B: --phase commit invoked without prior verify-green AND empty findings array on the checkpoint. Pass --force-commit-phase to override.
loop-run-round-stuck-conflicting-findingsbin/np-tools/loop-run-round.cjs(L5) Both --findings and --findings-path passed to --phase stuck. Pick exactly one.
arg-invalid-jsonbin/np-tools/_args.cjsGeneric optional-JSON-flag parse failure.

Loop tool-use audit

CodeSourceMeaning
loop-audit-invalid-task-idbin/np-tools/loop-audit-tool-use.cjsFirst positional argument does not match M<NNN>-S<NNN>-T<NNNN>.
loop-audit-missing-agentbin/np-tools/loop-audit-tool-use.cjsAppend mode invoked without --agent.
loop-audit-missing-logbin/np-tools/loop-audit-tool-use.cjs--tool-use-log required for an AUDITED_AGENT (Rule 9).
loop-audit-invalid-logbin/np-tools/loop-audit-tool-use.cjs--tool-use-log is not a JSON array.
loop-audit-agent-is-modulebin/np-tools/loop-audit-tool-use.cjs--agent resolves to a module file (module: true) — modules cannot be audited as if they were spawnable.
nubosloop-unknown-routelib/nubosloop.cjsA finding's route is not in KNOWN_ROUTING_BUCKETS — typo in ROUTE_TABLE. Fail-loud.
nubosloop-invalid-task-idlib/nubosloop.cjsrecordLoopState given an empty / malformed task id.
nubosloop-preflight-invalid-querylib/nubosloop.cjspreflightCacheLookup given an empty / non-string query.
nubosloop-audit-invalid-task-idlib/nubosloop.cjsauditToolUse given a malformed task id.
nubosloop-audit-invalid-agentlib/nubosloop.cjsauditToolUse given an empty / non-string agent name.
nubosloop-audit-invalid-loglib/nubosloop.cjsauditToolUse given a non-array tool-use log.
nubosloop-auto-log-invalid-task-idlib/nubosloop.cjsautoLogLearning task id does not match the required shape.

Headless subprocess (Cost Layer L6)

Codes raised by spawn-headless — see ADR-0010 §L6.

CodeSourceMeaning
spawn-headless-missing-agentbin/np-tools/spawn-headless.cjs--agent flag missing.
spawn-headless-invalid-agent-namebin/np-tools/spawn-headless.cjs--agent must match /^[a-zA-Z0-9_-]+$/ — defends against path-injection.
spawn-headless-missing-prompt-pathbin/np-tools/spawn-headless.cjs--prompt-path flag missing.
spawn-headless-missing-output-pathbin/np-tools/spawn-headless.cjs--output-path flag missing.
spawn-headless-invalid-timeoutbin/np-tools/spawn-headless.cjs--timeout-ms is non-numeric or below 1000.
spawn-headless-path-traversalbin/np-tools/spawn-headless.cjs--prompt-path or --output-path resolves outside cwd or TMPDIR.
spawn-headless-agent-not-foundbin/np-tools/spawn-headless.cjsAgent file not in any of .nubos-pilot/agents/, .claude/agents/, or the package agents/.
spawn-headless-prompt-unreadablebin/np-tools/spawn-headless.cjs--prompt-path could not be read.
spawn-headless-claude-not-foundbin/np-tools/spawn-headless.cjsThe claude binary (or NUBOS_PILOT_CLAUDE_BIN override) is not on $PATH.
spawn-headless-spawn-failedbin/np-tools/spawn-headless.cjsGeneric subprocess spawn failure (other than ENOENT / ETIMEDOUT).
spawn-headless-timed-outbin/np-tools/spawn-headless.cjsSubprocess exceeded --timeout-ms (or spawn.headless.timeout_ms).

A non-zero subprocess exit (i.e. claude itself ran and returned non-zero) does NOT raise an error. It returns rc=2 with exit_code and stderr_excerpt on the JSON payload, so the caller can decide to fall back to the Agent-tool path (spawn.headless.fallback_on_error).

Plan-milestone / execute-milestone

CodeSourceMeaning
plan-milestone-invalid-argbin/np-tools/plan-milestone.cjsMilestone argument invalid.
plan-milestone-not-foundbin/np-tools/plan-milestone.cjsMilestone not in roadmap.yaml.
plan-milestone-unknown-verbbin/np-tools/plan-milestone.cjsUnknown subcommand verb.
execute-milestone-invalid-argbin/np-tools/execute-milestone.cjsMilestone argument invalid.
execute-milestone-not-foundbin/np-tools/execute-milestone.cjsMilestone not in roadmap.yaml.
execute-milestone-invalid-task-idbin/np-tools/execute-milestone.cjsTask full-id malformed.
execute-milestone-task-milestone-mismatchbin/np-tools/execute-milestone.cjsTask belongs to a different milestone.
execute-milestone-task-not-foundbin/np-tools/execute-milestone.cjsTask plan file absent on disk.
execute-milestone-unknown-verbbin/np-tools/execute-milestone.cjsUnknown subcommand verb.

Install / payload

CodeSourceMeaning
staging-mkdir-failedlib/install/staging.cjsStaging directory could not be created.
staging-clean-failedlib/install/staging.cjsStale staging cleanup failed.
staging-swap-failedlib/install/staging.cjsAtomic swap from staging into payload failed.
manifest-build-failedlib/install/manifest.cjsCould not enumerate / hash the staged tree.
manifest-invalid-structurelib/install/manifest.cjsManifest JSON shape is wrong.
manifest-parse-failedlib/install/manifest.cjsManifest file unreadable / unparseable.
manifest-write-failedlib/install/manifest.cjsManifest atomic write failed.
manifest-path-traversalbin/install.jsManifest path contains .. or is absolute.
target-is-symlinkbin/install.jsRefuses to write into a symlinked payload directory.
backup-source-missinglib/install/backup.cjsFile to back up does not exist.
backup-refuses-symlinklib/install/backup.cjsRefuses to back up a symlink.
backup-rename-failedlib/install/backup.cjsBackup rename failed.
agents-md-missing-noticelib/install/agents-md.cjsGenerated AGENTS.md is missing the managed notice.
agents-md-invalid-inputlib/install/agents-md.cjsBad input to generateAgentsMd.
codex-toml-invalid-inputlib/install/codex-toml.cjsCodex config.toml repair input is invalid.

Workflow-specific

CodeSourceMeaning
project-already-initializedbin/np-tools/new-project.cjs/np:new-project invoked when PROJECT.md already exists.
project-not-initializedbin/np-tools/new-milestone.cjs/np:new-milestone invoked before /np:new-project.
answers-missing-fieldbin/np-tools/{new-project,new-milestone}.cjsInterview answer file missing a required key.
answers-not-readablebin/np-tools/{new-project,new-milestone}.cjs--apply <answers.json> path unreadable.
answers-parse-errorbin/np-tools/{new-project,new-milestone}.cjsAnswer file is not valid JSON.
new-milestone-forbidden-writebin/np-tools/new-milestone.cjsInternal defensive guard — should never surface.
discuss-invalid-phase-argbin/np-tools/discuss-phase.cjsMilestone argument not a positive integer.
discuss-phase-not-foundbin/np-tools/discuss-phase.cjsMilestone id not in roadmap.yaml.
research-invalid-phase-argbin/np-tools/research-phase.cjsMilestone argument not a non-negative integer.
research-phase-not-foundbin/np-tools/research-phase.cjsMilestone id not in roadmap.yaml.
add-tests-invalid-phasebin/np-tools/add-tests.cjsMilestone argument not a positive integer.
add-tests-verification-missingbin/np-tools/add-tests.cjsNo VERIFICATION.md found — run /np:verify-work <N> first.