Skip to content

id(serve): app discovery is silent when the apps root does not exist — a missing or mispointed root looks exactly like zero apps installed #4061

Closed

Description

@dezren39

Problem

When the apps root does not exist, app discovery fails silently:

  • discover_apps (pkgs/id/src/app_manifest.rs:155-167, main @ df3f836) special-cases ErrorKind::NotFound from fs::read_dir(root) and returns a default AppDiscovery — zero apps, zero errors. Every other read_dir error is recorded in errors; a missing root is the one failure mode that leaves no trace.
  • cmd_serve (pkgs/id/src/commands/serve.rs:782-792) resolves the root from ID_APPS_DIR or the literal relative path apps, then logs one info! per discovered app and one warn! per discovery error. For a missing root it logs neither — and it never logs the root path it scanned.

So running serve from a working directory without an apps/ folder (or with ID_APPS_DIR mispointed, or from a packaged install whose apps live elsewhere) is indistinguishable in the logs from a host that legitimately has zero apps installed: the #2324 discovery feature appears to do nothing, with no signal pointing at the cause.

Verified this run with a probe crate on the laptop compiling a sha256-identical copy of app_manifest.rs from main df3f836 (probe: ~/git/fleet/probe-appmanifest-20261101 on the laptop): discover_apps("/nonexistent-apps-root-probe-xyz") returns apps=0, errors=0.

Why it matters

Discovery's design contract (#2324, design §3) is "degrade, don't die — with a named error": a malformed app disables only itself with a named error. A missing root is the same class of operator error at one level up, and it is currently the only silent one. As apps move from PoC to real installs (the flake already copies apps/ into the test package's share dir, pkgs/id/flake.nix), "no apps found" will be the first symptom of every packaging/path mistake.

Acceptance criteria

  • A nonexistent apps root produces a visible signal at serve startup: either discover_apps records a named error entry for the missing root (which serve already logs as a warning), or serve logs a warning naming the resolved root path when it does not exist — triage picks the layer, but the signal must name the path.
  • A unit test covers the missing-root case and asserts the new signal (error entry or equivalent) is produced.
  • Existing behavior is preserved otherwise: a present-but-empty root and a root with valid/invalid apps behave as today, and the checked-in tic-tac-toe app still discovers.
  • Serve startup logs (or the discovery result) make it possible to tell "root missing", "root present, 0 apps", and "root present, N apps" apart.

Activity

  1. added
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/lowNice to have; do when convenient
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    effort/sSmall: expected under 2 hours of work
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: new-issue-creator-code-a run 2026-11-01 17:05 CST
    • Found via: filed this run
    • Task: Filed this issue — discover_apps returns empty apps AND empty errors for a missing root, so serve logs nothing when the apps root is absent/mispointed; verified by a laptop probe crate against a sha256-identical copy of app_manifest.rs @ df3f836
    • Expectation: effort/s — triage confirms on current main, picks the layer (discovery error entry vs serve warning), routes the fix per the acceptance criteria
    • Links: queue packet enqueued this run (repo-health-code-pilot)
  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 1, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  5. 40 remaining items

  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked awaiting CI

  7. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: picked_up
    task: 5969 (repo-health-code-pilot, repo-worker-code, lane code-h)
    state: claimed fix #4061 (resume from awaiting_ci). Fresh revalidation: issue #4061 OPEN, no hard-stop labels; canonical PR #4425 OPEN, MERGEABLE/CLEAN, head 1287954, Codex review completed with no findings. The earlier no-test-evidence gap is now closed: a verbatim-module probe crate (md5 dc6dc2469862497fdad19873fd418826, identical to PR head pkgs/id/src/app_manifest.rs) built on the laptop passes 10/10 tests including the new discovery_reports_missing_root; the full id lib remains blocked on main by issue #4454, unrelated to this module.
    next: merge PR #4425 under standing merge authority (CI runs on main only), then complete task 5969.

  9. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: done
    task: 5969 (repo-health-code-pilot, repo-worker-code, lane code-h)
    state: fixed_merged. PR #4425 MERGED at 2026-11-02T17:34:18Z, merge commit 748d2e5. Fix: discover_apps no longer special-cases ErrorKind::NotFound, so a missing apps root records the generic path-bearing error entry that serve warn!-logs at startup; new unit test discovery_reports_missing_root asserts 0 apps and exactly 1 error naming the path.
    tests: verbatim-module probe crate on the laptop (md5 dc6dc2469862497fdad19873fd418826, byte-identical to PR head app_manifest.rs) — cargo test 10/10 pass, including all existing discovery tests. Full id lib test remains blocked on main by issue #4454 (references.rs), unrelated to this module.
    next: none for task 5969; closing issue #4061.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions