Skip to content

S4: catalog discovery — .relix/ directories up the hierarchy, nearest-wins overlay #8

Closed

Description

@david-Darkcollective

Part of #17. Design: docs/design.md §5.1–§5.2.

Scope

  • Discovery: walk from the working directory (or -C) upward, collecting .relix/ directories.
    • Stop after $HOME, the same ceiling profiles.json is found under.
    • A .relix/root file stops the walk at that directory.
    • Outside $HOME, only the working directory is read.
  • Load order, outermost first:
    1. ~/.relix/catalog/*.relix
    2. each project level's catalog/*.relix, in lexical order within a directory
    3. --catalog=FILE and RELIX_CATALOG_PATH (:-separated)
    4. -i bindings
    5. the script
  • Overlay: a nearer declaration replaces a farther one of the same name. Each file is parsed with Relix.parse(text, source), the nearest declaration of each name is kept, and the survivors are defined with define(Statement...).
  • relixrc: key = value defaults (output, profile), nearest wins, with command-line options beating it.
  • -N/--no-catalog turns discovery off.
  • Declaring opens nothing: no connection or introspection happens until a query references the name.

Dependencies

Acceptance

  • @TempDir trees cover:
    • the $HOME ceiling, the root marker and the outside-$HOME case
    • lexical order
    • nearest-wins, including an outer view reading an inner replacement of its source
    • -N, --catalog and RELIX_CATALOG_PATH
  • A piped script (cat q.relix | relix) resolves catalog names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliThe relix command itselfbacklogNot yet scheduledenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions