Name the SCOPE-block mistake in compose warnings (REUSE-WP-0020-T03)
An index row with no id now says whether it looks like a SCOPE.md capability block, instead of leaving the author to work out why their repo contributes nothing to the federated index. That confusion is invisible without a diagnostic: the row is valid YAML, the file parses, and the member just silently disappears. Swept all 61 federation sources with --refresh: evidence-binder is the only affected member. The other ten zero-count repos are genuine empty scaffolds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
9d015d4604
commit
0300c5b142
3 changed files with 67 additions and 4 deletions
|
|
@ -283,3 +283,33 @@ def test_malformed_source_still_listed_with_zero_count(tmp_path, monkeypatch):
|
|||
)
|
||||
remote = next(s for s in federated["sources"] if s["repo"] == "remote-repo")
|
||||
assert remote["count"] == 0
|
||||
|
||||
|
||||
def test_scope_shaped_row_names_the_mistake(tmp_path, monkeypatch):
|
||||
"""A SCOPE.md capability block copied into an index should say so."""
|
||||
body = """
|
||||
version: 1
|
||||
domain: helix_forge
|
||||
capabilities:
|
||||
- type: library
|
||||
title: Evidence-to-target binding
|
||||
description: Links evidence items to structured targets.
|
||||
keywords: [evidence, binding]
|
||||
"""
|
||||
_, warnings = _compose_with_remote_body(body, tmp_path, monkeypatch)
|
||||
hint = next(w for w in warnings if "remote-repo" in w)
|
||||
assert "SCOPE.md capability block" in hint
|
||||
assert "id/name/summary" in hint
|
||||
|
||||
|
||||
def test_plain_missing_id_gets_no_scope_hint(tmp_path, monkeypatch):
|
||||
body = """
|
||||
version: 1
|
||||
capabilities:
|
||||
- name: Has a name but no id
|
||||
summary: Something
|
||||
"""
|
||||
_, warnings = _compose_with_remote_body(body, tmp_path, monkeypatch)
|
||||
hint = next(w for w in warnings if "remote-repo" in w)
|
||||
assert "has no id" in hint
|
||||
assert "SCOPE.md" not in hint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue