feat: accept covers globs in hub schema (inert, lint-validated)#135
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94.
Carves the small, safe, shippable slice out of the
coversresearch epic (#5): the field now exists and is authorable, but it is inert in the verdict — exactly the constraint #94 demands.What changed
surf-core/src/hub.rs): optionalcovers: Vec<String>onFrontmatter— repo-root-relative globs, same dialect asconfig.hubs.skip_serializing_ifempty, so existing hubs are byte-unaffected on round-trip.covers_field_is_rejectedwithcovers_field_is_accepted+ round-trip + default-empty.surf-cli/src/lint.rs): a malformedcoversglob blocks (reusing theglob::Pattern::newpath--filesalready uses incheck, 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).coverswas "deliberately absent", and thehub-formathub claim that asserted unknown fields likecoversare rejected — the anchor is onparse_hub, whose span doesn't change, so the hash stayed green while the prose would have silently gone false. Also added a realcovers:block tohub-format.mdto dogfood the field.Non-negotiable constraint — held
The verdict never reads
covers.surf checkis byte-for-byte identical with or without acoversblock — verified on this repo (exit 0 both ways, thehub-formatclaim stays green).Out of scope (stays in #5)
The advisory coverage pass that diffs changed files against
coversglobs, 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.surf checkexit 0 with and without thecoversblock;surf lintreports 0 errors and no covers findings (valid glob, matches its own anchor).🤖 Generated with Claude Code