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. The list is curated from throw new NubosPilotError(...) sites in lib/ and bin/.

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.
init-internal-errornp-tools.cjsCatch-all wrapper for unexpected throws inside the init dispatcher.

Phase / plan / tasks

CodeSourceMeaning
phase-not-foundlib/phase.cjsPhase number is malformed or no matching directory exists.
phase-slug-mismatchlib/phase.cjsPhase directory exists with a slug that does not match the expected one.
plan-not-foundlib/plan.cjsparsePlan was given a path that does not exist.
plan-diff-invalid-phaselib/plan-diff.cjsnp:plan-diff invoked with non-numeric phase.
plan-diff-invalid-plan-idlib/plan-diff.cjsPlan-id format violates <NN>-<NN>.
plan-diff-phase-not-foundlib/plan-diff.cjsDiff target phase directory is missing.
tasks-invalid-frontmatterlib/tasks.cjsTask frontmatter missing required field or value.
tasks-invalid-statuslib/tasks.cjsstatus value not in the allowed enum.
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.

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 (D-25 hard-fail).
commit-no-pathslib/git.cjsCommit invoked with an empty path list.
task-commit-not-foundlib/git.cjsnp:undo-task could not locate the matching commit.
list-task-commits-invalidlib/git.cjsgit log --grep filter produced an unparseable result.

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 / progress

CodeSourceMeaning
verify-file-unreadablelib/verify.cjsVerification target file cannot be read.
verify-phase-dir-missinglib/verify.cjsnp:verify-work invoked on a phase that has no directory yet.
progress-read-errorlib/progress.cjsnp:progress failed to read a state file.
next-internal-errorlib/next.cjsCatch-all wrapper for np:next internals.

Undo

CodeSourceMeaning
undo-revert-conflictlib/undo.cjsgit revert produced merge conflicts.
undo-dirty-treelib/undo.cjsWorking tree has uncommitted changes; refuses to revert.
undo-invalid-plan-idlib/undo.cjsPlan id does not match <NN>-<NN>.
undo-task-missing-idbin/np-tools/undo-task.cjsnp:undo-task invoked without a task id.
undo-task-invalid-idbin/np-tools/undo-task.cjsTask id format invalid.
checkpoint-orphanlib/undo.cjsFound a checkpoint without a corresponding commit.
checkpoint-invalid-tasklib/checkpoint.cjsCheckpoint operation referenced an unknown task.
checkpoint-invalid-task-idlib/checkpoint.cjsTask id format invalid.

Gaps / metrics

CodeSourceMeaning
gaps-invalid-audit-pathlib/gaps.cjsnp:plan-milestone-gaps audit path is malformed.
gaps-audit-not-foundlib/gaps.cjsAudit file does not exist.
gaps-audit-too-largelib/gaps.cjsAudit file exceeds the safety size limit.
gaps-missing-source-phaselib/gaps.cjsAudit references a phase that no longer exists.
gaps-no-milestonelib/gaps.cjsNo milestone scope can be derived from the audit.
metrics-invalid-recordlib/metrics.cjsMetrics record fails schema validation.
metrics-invalid-phaselib/metrics.cjs / lib/metrics-aggregate.cjsPhase number malformed.

Roadmap render

CodeSourceMeaning
roadmap-render-read-errorlib/roadmap-render.cjsCould not read roadmap.yaml.

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
eval-review-invalid-arg / eval-review-not-foundbin/np-tools/eval-review.cjsnp:eval-review argument or target invalid.
ai-integration-phase-invalid-arg / ai-integration-phase-not-foundbin/np-tools/ai-integration-phase.cjsnp:ai-integration-phase argument or target invalid.
project-already-initializedbin/np-tools/new-project.cjsnp:new-project invoked when PROJECT.md already exists.
invalid-slugbin/np-tools/new-project.cjsSlug is empty after stripping non-alphanumeric chars.
answers-missing-fieldbin/np-tools/new-project.cjsInterview answer file missing a required key.