Skip to content

Preflight: a missing ON_DEMAND module shows as '(no load-bearing rules)' instead of unreadable #461

Backlog

Description

@stackbilt-admin

Problem

When the manifest resolves an ON_DEMAND module whose file is missing on disk, the preflight answer (#447) behaves differently on each path:

  • adf context --files without --bundle: readBindingRules skips the missing file (packages/cli/src/commands/adf-preflight.ts, around line 144), and Binds prints the module as (no load-bearing rules). That reads as "this module governs the file but has nothing load-bearing". In fact the module couldn't be read at all.
  • With --bundle, and over MCP getProjectContext: bundleModules throws Module not found (packages/adf/src/bundler.ts, around line 54), so the command exits 2 or the MCP call returns isError.

An agent can't tell a missing module from an empty one, and the CLI and MCP disagree for the same input. Found in the adversarial review of #458.

Expected

  • Without --bundle, a missing module is reported under unreadable[] with reason not found, and the text line reads <module> (unreadable: not found), the same as a parse error. Exit code stays 0.
  • --bundle and MCP keep failing as today. Alternatively they report it the same way, but whichever behaviour is chosen must be the same for the CLI and MCP and stated in docs/cli-reference.md.

Acceptance

  • A fixture manifest with an ON_DEMAND entry pointing at a missing file, triggered by --files, reports the module under unreadable (non-bundle JSON) and never as (no load-bearing rules).
  • A test pins the --bundle / MCP behaviour for the same fixture.

Part of #437 · Refs #447, #460

Activity

  1. added
    bug
    priority:p2
    epic:preflight
    on Nov 28, 2026
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

    bugepic:preflightpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions