paperclipai/paperclip · error · Error

Worktree seed manifest is missing source path diagnostics.

Error message

Worktree seed manifest is missing source path diagnostics.

What it means

resolveCanonicalWorktreeSeedSource() first resolves the authoritative source, then cross-checks the worktree seed manifest's diagnostic fields. manifestSource.configPath must be a non-empty string; a missing, non-string, or blank value means the manifest lacks the diagnostics needed to verify it agrees with the resolved source.

Source

Thrown at packages/shared/src/worktree-seed-source.ts:211

 * Resolve a worktree seed source without granting authority to the seed manifest.
 *
 * A managed caller supplies the project-workspace cwd from its server-owned row.
 * An operator may instead supply an explicit source config. A base workspace that
 * carries its own `.paperclip/config.json` stays authoritative, so an explicit path
 * must equal it; a base workspace that is a plain checkout has none, and the explicit
 * path supplies the source. Manifest source fields are diagnostic assertions only and
 * never select the returned source.
 */
export function resolveCanonicalWorktreeSeedSource(input: RegisteredWorktreeSeedSourceInput & {
  manifestSource: WorktreeSeedSourceDiagnostic | null | undefined;
  manifestTargetInstanceId?: unknown;
}): CanonicalWorktreeSeedSource {
  const registered = resolveRegisteredWorktreeSeedSource(input);
  const diagnosticPath = typeof input.manifestSource?.configPath === "string"
    ? input.manifestSource.configPath.trim()
    : "";
  if (!diagnosticPath) {
    throw new Error("Worktree seed manifest is missing source path diagnostics.");
  }
  const canonicalDiagnosticPath = canonicalRegularFile(
    diagnosticPath,
    "Worktree seed manifest source diagnostic",
  );
  if (path.resolve(diagnosticPath) !== registered.configPath || canonicalDiagnosticPath !== registered.configPath) {
    throw new Error("Worktree seed manifest source path does not match the registered canonical source.");
  }
  if (input.manifestSource?.instanceId !== registered.instanceId) {
    throw new Error("Worktree seed manifest source instance does not match the registered source instance.");
  }
  if (input.manifestTargetInstanceId !== registered.targetInstanceId) {
    throw new Error("Worktree seed manifest target instance does not match the registered target instance.");
  }
  return registered;
}

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Inspect the seed manifest and add/repair `source.configPath` so it names the registered canonical source config.
  2. Regenerate the manifest with the current version of the tooling that writes source diagnostics.
  3. If the manifest is hand-maintained, ensure configPath is a string (not null/number) and non-blank.

Example fix

// before: manifest missing diagnostics
{ "source": { "instanceId": "..." } }

// after
{ "source": { "configPath": "/home/me/code/base/.paperclip/config.json", "instanceId": "..." } }
Defensive patterns

Strategy: type-guard

Validate before calling

const m = manifest.source;
if (!m || typeof m.configPath !== "string" || !m.configPath.trim()) {
  throw new Error("seed manifest lacks source.configPath — regenerate the manifest");
}

Type guard

const hasSourceDiagnostics = (
  m: WorktreeSeedSourceDiagnostic | null | undefined,
): m is { configPath: string; instanceId: string } =>
  typeof m?.configPath === "string" && m.configPath.trim().length > 0 &&
  typeof m.instanceId === "string";

Prevention

When it happens

Trigger: Calling resolveCanonicalWorktreeSeedSource with manifestSource null/undefined, or with configPath undefined, non-string, or whitespace-only — e.g. a manifest written by an older version that did not record source diagnostics, or hand-authored YAML/JSON missing the field.

Common situations: Upgrading Paperclip: manifests produced before source diagnostics existed; external tooling generating seed manifests without the source.configPath field; malformed manifest after a partial write; test fixtures omitting the field.

Related errors


AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-21). Data as JSON: /api/errors/0589e6a09a1e10c4. Report an issue: GitHub.