Skip to content

fix(verify/doctor): missing external sources are ignored while CLI treats them as failures #622

Description

@kurosawareiji7007-hub

verify_source correctly reports external_status="missing" when a type=file locator is gone or unreadable. vouch source verify already marks that as !. But the library paths that agents and health checks use disagree:

Path Missing treated as?
CLI vouch source verify failure (!)
verify_all audit failed list ignored (only drift)
health.doctor silent (only emits source_drift)

where

  • src/vouch/verify.pyverify_all builds failed with only not stored_ok or external_status == "drift"
  • src/vouch/health.pydoctor only appends findings for source_drift

why it matters
vouch doctor can report ok: true while vouch source verify --fail-on-issue exits non-zero for the same KB. Agents that trust doctor / the verify audit miss disappeared upstream files.

repro

  1. put_source with source_type="file" and a real locator under the project root.
  2. Delete the external file.
  3. verify_sourceexternal_status == "missing", stored_ok == True.
  4. verify_all audit object_ids / data.failed omit that source.
  5. doctor has no source_missing finding; report.ok stays true.

expected — missing is counted like drift in verify_all's failed set, and doctor emits a warning source_missing (stored blob may still be fine; same severity as drift).

suggested fix — include "missing" in the verify_all failed predicate; add a source_missing warning branch next to source_drift in doctor. Leave CLI alone (already correct).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions