Skip to content

feat: accept covers globs in hub schema (inert, lint-validated)#135

Merged
Connorrmcd6 merged 2 commits into
mainfrom
feat/covers-globs-schema
Jun 18, 2026
Merged

feat: accept covers globs in hub schema (inert, lint-validated)#135
Connorrmcd6 merged 2 commits into
mainfrom
feat/covers-globs-schema

Conversation

@Connorrmcd6

Copy link
Copy Markdown
Owner

Closes #94.

Carves the small, safe, shippable slice out of the covers research epic (#5): the field now exists and is authorable, but it is inert in the verdict — exactly the constraint #94 demands.

What changed

  • Schema (surf-core/src/hub.rs): optional covers: Vec<String> on Frontmatter — repo-root-relative globs, same dialect as config.hubs. skip_serializing_if empty, so existing hubs are byte-unaffected on round-trip.
  • Tests: replaced covers_field_is_rejected with covers_field_is_accepted + round-trip + default-empty.
  • Lint (surf-cli/src/lint.rs): a malformed covers glob blocks (reusing the glob::Pattern::new path --files already uses in check, check --files / stats: invalid glob syntax is silently dropped #38) — silently dropping it would change scope with no signal. As a nicety, a hub whose globs don't match its own anchored files warns (catches fat-fingered globs).
  • Docs/dogfood: updated the proposal note (§9.1) that said covers was "deliberately absent", and the hub-format hub claim that asserted unknown fields like covers are rejected — the anchor is on parse_hub, whose span doesn't change, so the hash stayed green while the prose would have silently gone false. Also added a real covers: block to hub-format.md to dogfood the field.

Non-negotiable constraint — held

The verdict never reads covers. surf check is byte-for-byte identical with or without a covers block — verified on this repo (exit 0 both ways, the hub-format claim stays green).

Out of scope (stays in #5)

The advisory coverage pass that diffs changed files against covers globs, and any reviewer-plugin / LLM consumption.

Verification

  • cargo test -p surf-core / -p surf-cli — green (new accept/round-trip/default-empty + lint covers tests pass).
  • cargo fmt --all + cargo clippy --all-targets -D warnings — clean.
  • Dogfood: surf check exit 0 with and without the covers block; surf lint reports 0 errors and no covers findings (valid glob, matches its own anchor).

🤖 Generated with Claude Code

Connorrmcd6 and others added 2 commits June 18, 2026 07:55
…loses #94

Carve the small, safe slice out of the `covers` research epic (#5): make the
field exist and be authorable without letting it touch the verdict.

- Add optional `covers: Vec<String>` to `Frontmatter` (repo-root-relative
  globs, same dialect as `config.hubs`); skipped on serialize when empty so
  existing hubs are byte-unaffected.
- Replace the `covers_field_is_rejected` test with accept / round-trip /
  default-empty tests.
- Validate the globs in `surf lint`: a malformed glob blocks (reusing the
  `glob::Pattern::new` path `--files` uses), and a hub whose globs don't match
  its own anchored files warns (catches fat-fingered globs).
- The verdict never reads `covers`: `surf check` is byte-for-byte identical
  with or without it. Update the dogfood hub claim and the proposal note that
  previously said `covers` was rejected/absent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Connorrmcd6 Connorrmcd6 merged commit 495c76d into main Jun 18, 2026
5 checks passed
@Connorrmcd6 Connorrmcd6 deleted the feat/covers-globs-schema branch June 18, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant