Skip to content

aware app install can later discover and run a sibling manifest #502

Description

@pawellisowski

Summary

On CLI v0.134.0, aware app install <folder> can select and install one top-level .flo/.app manifest while later discovery and by-id verbs select a different sibling manifest from the copied folder. PR #499 makes the selection deterministic but demonstrates that the install has no durable record of which manifest was authoritative.

Observed (verified in source / at runtime)

  1. On main, install_app_from_path takes the first .flo/.app returned by read_dir, loads that app, and copies the entire source directory to apps/<app-id> (cli/src/install/local.rs:66-93). The chosen manifest path is not persisted.
  2. Later discovery independently calls find_app_manifest for the installed directory (cli/src/manifest/loader.rs:65-90). That selector prefers <dir-name>.flo, then the first .flo, then the first .app (cli/src/manifest/loader.rs:181-196). After installation renames the directory to the selected manifest's app: id, this can be a different question from the install-time selection.
  3. Reproduced on rebased PR refactor: share artifact writing and PATH binary lookup #499 with bundle/bundle.flo declaring app: alpha beside bundle/alpha.flo declaring app: decoy:
$ aware app install bundle
✓ installed alpha (lockfile written)

$ aware app list
warning: app "decoy" is in directory "alpha" — name and `app:` field disagree
ID     VERSION  NODES  CONNS  LAYOUT
decoy  0.1.0    1      0      linear

$ aware app show alpha
app:           decoy
description:   sibling decoy manifest

The install-time lockfile.yaml says app: alpha, while discovery and show load decoy.

Repro

Create a source directory bundle/ containing these two valid apps:

# bundle/bundle.flo
app: alpha
version: 0.1.0
description: selected manifest
nodes:
  - id: gate
    inline: { kind: predicate, description: always pass, code: "true" }
requires: []
# bundle/alpha.flo
app: decoy
version: 0.1.0
description: sibling decoy manifest
nodes:
  - id: gate
    inline: { kind: predicate, description: always pass, code: "true" }
requires: []

Then run with an empty temporary AWARE_HOME:

aware app install bundle
aware app list
aware app show alpha

On main, which file install chooses depends on filesystem enumeration order. With PR #499's canonical selector, install consistently chooses bundle.flo, then later discovery consistently chooses alpha.flo after the directory becomes apps/alpha/.

Expected / proposal

An installed app must have exactly one durable authoritative manifest, and every later surface (list, show, run, explain, export, compile/update paths) must load the same manifest that install validated.

Choose and specify one contract before implementation:

  • persist the selected relative manifest path as installed metadata and make installed-app resolution honor it; or
  • reject ambiguous source folders containing multiple top-level app manifests before copying.

Keep this separate from PR #499's independent artifact-writer and PATH-lookup deduplications.

Why it matters

The CLI can report a successful install and write a lock for app A, then list and run app B from the same installed directory. That is silent wrong-app execution, not merely a naming warning.

References

Activity

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

    bugSomething isn't workingqa-readyFix shipped or ready for QA validation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions