Skip to content

Add project configuration and document-glob support #14

Description

@adrianbrowning

What to build

Add a project-level mdcode configuration that defines the Markdown documents, source roots, filters, and validation defaults for a repository. Consumers should be able to run common workflows without repeating command-line wiring in every local script and CI job.

Acceptance criteria

  • A documented configuration format supports document paths or globs, source/output roots, and default filters.
  • The CLI can load the configuration for check and synchronization workflows.
  • Command-line options can intentionally override configuration defaults.
  • Invalid configuration produces actionable validation errors.
  • A complete example is included for a consumer repository and CI job.

Blocked by

Activity

  1. adrianbrowning commented on Aug 8, 2026

    @adrianbrowning
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: enhancement
    Summary: Add a small, non-executable project configuration for mdcode documents, roots, and default filters.

    Current behavior:
    Every workflow must repeat document paths, working roots, and filters on the command line. There is no mdcode configuration convention or configuration validation.

    Desired behavior:
    A repository can define common defaults in mdcode.config.json. The CLI discovers that file from the working directory or accepts an explicit --config path. Commands use configuration values as defaults, while explicit CLI options intentionally override them.

    Key interfaces:

    • Configuration file — JSON only, named mdcode.config.json. Do not execute JavaScript or TypeScript configuration.
    • Configuration shape — documents is an array of Markdown paths or globs; sourceRoot and outputRoot define default operation roots; filter supplies default language and metadata filtering.
    • Path resolution — resolve configuration-relative paths against the configuration file directory and apply existing guarded-path rules to file operations.
    • CLI precedence — explicit command-line document inputs, roots, and filters override the corresponding configuration defaults.
    • Validation — reject malformed JSON, unknown/invalid field shapes, unmatched required document selections, and unsafe paths with actionable messages.

    Acceptance criteria:

    • mdcode.config.json supports document paths or globs, sourceRoot, outputRoot, and default filters.
    • The CLI discovers the default configuration or loads an explicit --config path for check and synchronization workflows.
    • Explicit CLI options override configuration defaults predictably.
    • Configuration paths are resolved relative to the configuration file and unsafe paths fail clearly.
    • Invalid configuration produces actionable validation errors.
    • Documentation includes a complete consumer configuration, local command, and CI example.
    • Tests cover discovery, explicit selection, glob expansion, precedence, and validation errors.

    Out of scope:

    Verification status:
    Confirmed: no existing mdcode configuration convention exists. This issue remains blocked by #6.

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

    enhancementNew feature or requestready-for-agentFully specified and ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions