Skip to content

id(app_manifest): discovery never checks route↔socket collisions — one app's route can equal another app's socket (or its own) and both register #6454

Closed

Description

@dezren39

Problem

discover_apps (pkgs/id/src/app_manifest.rs) enforces cross-app uniqueness for web paths in two separate namespaces: a new app's interfaces.web.route is compared only against already-registered apps' routes, and its socket only against their sockets. Route↔socket collisions are never checked — neither across two apps nor within a single manifest (route == socket).

Routes and sockets are the same namespace at the layer that binds them: pkgs/id/src/web/app_interface.rs treats them as one axum path space — it rejects a socket that collides with a host-registered route, and rejects a single section whose route and socket name the same path ("route and socket both bind {path}; they must differ", app_interface.rs:103-105, ~:410). Discovery is the only gate that sees the whole discovered set (the Phase 4 disposition table in app_manifest.rs assigns cross-app uniqueness to discovery: "unique across the discovered set; first folder in sort order wins, the loser is a named error"), and commands::serve only logs discovered apps today — no binding pass over the discovered set exists to catch what discovery misses. So two apps that would collide in one router both register cleanly, with no named error, and the collision surfaces only later as a bind failure (or an axum panic) in whatever step eventually binds the set.

Evidence (verified this run, laptop @ origin/main 50debbc)

Probe ~/git/fleet/probe-manifest-xcollision (real id crate, discover_apps over synthetic app folders):

  • X1 route-vs-socket: app-a route /shared, app-b route /b + socket /shared → registered=["app-a", "app-b"] errors=[]
  • X2 socket-vs-route: app-a route /a + socket /shared, app-b route /shared → registered=["app-a", "app-b"] errors=[]
  • X3 self route==socket: one app, route /same, socket /same → registered=["app-a"] errors=[] (the binding layer rejects exactly this shape for a single section; discovery/parse do not)
  • C1 control route↔route duplicate → second app rejected with the named duplicate-route error
  • C2 control socket↔socket duplicate → second app rejected with the named duplicate-socket error
  • C3 control all-distinct route/socket pairs → both apps register, no errors

Code: app_manifest.rs discover_apps — the route check searches discovery.apps for an equal route only; the socket check searches for an equal socket only; parse_app_manifest validates each path's shape (is_safe_web_path) but never compares the two fields.

Why it matters

Discovery's contract (Phase 4 disposition, #4203) is that cross-app path collisions are deterministic named errors at scan time, first-folder-wins. The cross-kind hole means the discovered set can be internally inconsistent in exactly the dimension the binding layer treats as one namespace — and because serve currently only logs discovery results, nothing downstream re-checks the set as a set. When a bind step for discovered apps lands, this becomes a startup failure (or panic) caused by two individually "valid" apps, with no error naming either.

Acceptance criteria

  • discover_apps rejects (named per-app error, first folder in sort order wins, other apps unaffected) any app whose route equals an already-registered app's socket, and any app whose socket equals an already-registered app's route — in both folder orders.
  • A manifest whose own route == socket is rejected at parse or discovery time with a named error (mirroring the binding layer's existing rule), instead of registering.
  • Same-kind duplicate behavior unchanged: route↔route and socket↔socket duplicates keep their current named errors; all-distinct sets register fully.
  • Tests in app_manifest.rs cover: route-vs-socket, socket-vs-route, self route==socket, plus the existing same-kind and distinct controls.
  • The Phase 4 disposition table rows for interfaces.web.route / interfaces.web.socket are updated to state the cross-kind rule.

Dedup

Searched open + closed issues for app_manifest route/socket/discovery: #4060 (closed) covered same-kind duplicate routes and shape validation; #5427 (closed) covered dot-segment spellings evading uniqueness; #4779 (closed) added the route==socket and host-collision checks in the single-section binding layer (web_interface_from_app_toml), which discovered apps never pass through. None covers cross-app route↔socket uniqueness at discovery, or route==socket at parse/discovery.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    on Nov 6, 2026
  2. developing-today commented on Nov 6, 2026

    @developing-today
    Contributor
  3. added
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 6, 2026
  4. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b (Lane B, new-issue-creator-code-b cron)
    • Session / ID: cron run 2026-11-06 00:20 CST
    • Found via: filed this run
    • Task: Filed after verifying with a laptop probe (~/git/fleet/probe-manifest-xcollision, real id crate) that discover_apps registers cross-kind route↔socket collisions and self route==socket with no error, while same-kind duplicates are rejected.
    • Expectation: effort/s — extend the discovery uniqueness checks across route/socket kinds (+ self-check), named errors, tests.
    • Links: probe ~/git/fleet/probe-manifest-xcollision; body file hidden_files/issue-id-manifest-route-socket-xcollision.md
  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 6, 2026
  6. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triage verdict: CONFIRMED — task 10926

  7. 28 remaining items

  8. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  9. dezren39 commented on Nov 9, 2026

    @dezren39
    MemberAuthor

    Verified fixed on current main 1bec591d5d: pkgs/id/src/app_manifest.rs now enforces the single route/socket namespace. Parse rejects a manifest whose own route equals its socket (:274-278, "route and socket both bind …; they must differ"); discovery rejects cross-kind collisions in both directions (:399-448, cases X1/X2) with first-folder-wins named errors. Regression coverage: parse_rejects_self_route_equal_socket (:726), discovery_rejects_route_colliding_with_registered_socket (:739), discovery_rejects_socket_colliding_with_registered_route (:765), discovery_rejects_self_route_equal_socket (:875), plus the discovery_cross_kind_namespace_matches_first_wins_model proptest (:798). The Phase 4 disposition rows in the module docs (:32-33) state the cross-kind rule. Merged via PR #6470 (49797dfd49da, 2026-11-06); the property test landed as PR #7372. Closing as fixed.

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)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/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