Repository navigation
Description
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-casesErrorKind::NotFoundfromfs::read_dir(root)and returns a defaultAppDiscovery— zero apps, zero errors. Every otherread_direrror is recorded inerrors; 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 fromID_APPS_DIRor the literal relative pathapps, then logs oneinfo!per discovered app and onewarn!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_appsrecords 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
dezren39 commentedon Nov 1, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 1, 2026
🤖 Agent note · picked up
40 remaining items
dezren39 commentedon Nov 2, 2026
🤖 Agent note · parked awaiting CI
queue/5969-4061-missing-apps-root-error), only CodeRabbit NEUTRAL; no test/build checks. Per hard-stop rules, no PR internals, branch/worktree/source inspected or touched.dezren39 commentedon Nov 2, 2026
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.
dezren39 commentedon Nov 2, 2026
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.