Skip to content

Accept covers globs in hub schema (L1 of #5) #94

Closed

Description

@Connorrmcd6

Why

Part of #5 (covers globs + ghost-anchor coverage). That issue is a deferred research epic; this carves out the one piece that is small, safe, and shippable now: making the covers field exist and be authorable.

Today covers is forward-declared in the spec (§9.1) but the schema actively rejects it — a hub author who writes covers: gets a parse error (deny_unknown_fields), and there's a test (covers_field_is_rejected) asserting that. This issue flips that: accept and store the field, validate it, but do not let it touch the verdict. The advisory "louder coverage pass" that actually uses these globs stays in #5, gated on a recall study.

What

  • Add optional #[serde(default)] pub covers: Vec<String> to Frontmatter in surf-core/src/hub.rs. Globs are repo-root-relative, same dialect as config.hubs.
  • Replace covers_field_is_rejected with covers_field_is_accepted; add round-trip + default-empty tests.
  • Validate the globs in surf lint (reuse the glob::Pattern::new error path already used for --files in check.rs) so a malformed covers is a clear lint error, not a runtime surprise.
  • Optional nicety: surf lint warns if a hub's own anchored files aren't matched by its own covers (catches fat-fingered globs).

Non-negotiable constraints

  • The verdict never reads covers. surf check pass/fail must be byte-for-byte unchanged whether or not a hub declares covers. This is just parse + store + lint. Per §5/§8, the fuzzy layer can only ever advise.

Explicitly out of scope (stays in #5)

  • The advisory coverage pass that diffs changed files against covers globs.
  • Any reviewer-plugin / LLM consumption.

Verification

  • cargo test -p surf-core — new accept/round-trip/default-empty tests pass.
  • Author a hub with a covers: block and confirm surf check exit code is identical to the same hub without it.
  • surf lint flags a malformed glob.

Design context: see the research comment on #5.

Activity

  1. added this to the 0.7.0 milestone on Jun 13, 2026
  2. added a commit that references this issue on Jun 18, 2026
    495c76d
  3. added a commit that references this issue on Jun 18, 2026
  4. added 2 commits that reference this issue on Jul 28, 2026
    91367ae
    f6d0a2a
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

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions