Skip to content

doctor, pantry, recipe and report resolve config from CWD, ignoring -b #711

Closed

Description

@drawmeanelephant

Suggested labels: bug, area: cli


Discovery audit finding M14 (medium) — cooklang/cookcli @ 7c2f48b (v0.38.1), audited 2026-10-12. Repro verified.

Summary

cook doctor (and pantry/recipe/report) resolve config/aisle.conf/pantry.conf from the CWD, ignoring -b.

Where

src/main.rs configure_context (base path only wired for Server/ShoppingList/Build); src/doctor.rs run_aisle/run_pantry use ctx.aisle()/ctx.pantry() while scanning args.base_path.

Repro

From any directory:

$ cook doctor aisle -b /path/to/recipes     # /path/to/recipes has config/aisle.conf
No aisle configuration found
(all ingredients reported uncategorized)

cook shopping-list -b /path/to/recipes uses the same config correctly.

Expected

-b selects the recipe directory and its config/ for every command that scans that directory.

Actual

With doctor (and pantry/recipe/report), the config is resolved from the current working directory, not -b.

Acceptance criteria (red → green)

  • Red: the repro reports "No aisle configuration found" despite config/aisle.conf existing under -b.
  • Green: the repro finds and uses the aisle configuration from <base>/config/.

Verification

Executed repro.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions