Skip to content

id(app_manifest): discovery registers apps whose program.source does not exist — manifest is never checked against its folder #4064

Closed

Description

@dezren39

Problem

discover_apps (pkgs/id/src/app_manifest.rs:152-200, main @ df3f836) validates the manifest's text but never checks it against the folder it describes: a [program].source path that does not exist inside the app folder is accepted, and the app is returned in apps with no error. parse_app_manifest checks the source path's shape (relative, Component::Normal only, app_manifest.rs:124-133) — shape is all that is ever checked; nothing stats the path, in either the parser or discovery.

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, probe2 binary): an app folder ghost-app/ whose app.toml declares

[program]
kind = "roc-world"
source = "program/does-not-exist.wasm"

with no program/ directory on disk at all → discover_apps returns apps=1, errors=0 — the ghost app is fully "discovered", and cmd_serve (src/commands/serve.rs:786-788) logs it as a discovered app.

Why it matters

Discovery is the host's registration gate (#2324: "validates … and registers the app"; design §3 same). Its per-app error isolation exists so a broken app folder disables itself with a named error instead of failing mysteriously later. A moved/renamed program directory — the exact accident that just happened in-repo when tic-tac-toe moved from examples/ to apps/tic-tac-toe/program/ in #3926 — currently produces a successfully-discovered app that will only fail at launch time, in a different code path, with no pointer back to the manifest.

Acceptance criteria

  • Discovery (or a validation step it calls) checks that a declared program.source exists inside the app folder (file or directory — the checked-in manifest uses the program/ directory) and records a named per-app error, excluding the app from apps, when it does not.
  • A unit test covers the ghost-source case: app excluded, one error naming the missing source path.
  • The checked-in tic-tac-toe app (source program/, a directory) still discovers cleanly, and module_hash-only manifests (no source) are unaffected.
  • Serve's discovered-app logging therefore never reports an app whose declared program is absent.

Activity

  1. added
    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 registers an app whose program.source does not exist on disk, verified by a laptop probe crate (probe2) against a sha256-identical copy of app_manifest.rs @ df3f836: ghost app discovered with apps=1, errors=0
    • Expectation: effort/s — triage confirms on current main, then 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 on Nov 1, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane D shift
    • Session / ID: task 5962
    • Found via: queue claim
    • Task: Triage of issue id(app_manifest): discovery registers apps whose program.source does not exist — manifest is never checked against its folder #4064 — confirm on current main that discover_apps registers an app whose declared program.source does not exist, and route the fix packet per the issue's acceptance criteria.
    • Expectation: effort class s; done = behavior confirmed or refuted against current main with evidence, and a fix task enqueued (or the issue routed otherwise) with findings posted here.
    • Links: packet evidence cites the probe2 laptop probe against app_manifest.rs at df3f836; this triage re-checks current main.
  5. 1 remaining item

  6. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
  7. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane D shift
    • Session / ID: task 5972
    • Found via: queue claim (fix packet enqueued by triage task 5962)
    • Task: Fix issue id(app_manifest): discovery registers apps whose program.source does not exist — manifest is never checked against its folder #4064 — discovery must reject apps whose declared program.source does not exist: named per-app error + exclusion in discover_apps, ghost-source unit test, and the existing discovery test fixture updated to create the valid app's program/ directory.
    • Expectation: effort class s; done = branch queue/5972-4064-ghost-source-discovery with the fix and tests, targeted app_manifest tests passing, PR opened.
    • Links: branch queue/5972-4064-ghost-source-discovery, worktree ~/git/fleet/task-5972 on the laptop, base main 070f0d9.
  8. added a commit that references this issue on Nov 1, 2026
  9. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

No one assigned

    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 jobtask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions