feat: report a skill-name collision across the listing (#2248)

SEP-2640: hosts MUST NOT assume name uniqueness, and when two entries in one
listing collide on `name` a host MUST disambiguate them rather than silently
discarding or preferring one.

`checkSkillConformance` structurally cannot see this — it takes one entry and
a collision is a property of the pair — so `checkSkillNameCollisions` walks
the listing and returns a finding per colliding entry, each naming the
others. All three clients merge it into the entry's own findings, so it
carries through the header badge, the CLI report and the TUI row marks with
no new surface.

**It is a `warning`, not an `error`,** and that is the severity split doing
its job. The obligation is on the *consumer*: a server may legitimately
publish two skills with the same name under different paths, and the SEP's
own `acme/billing/refunds` example is exactly that shape. Calling it an error
would tell a conforming author their catalog is invalid. `--verify` therefore
still exits 0 for a collision.

In the web screen it renders as a banner directly under the Conformance
header and is filtered out of the findings list, the same treatment
`dynamic-resources` gets: it changes how everything below it should be read,
and stating one fact twice reads as two findings.

Fixed while adding it: an entry whose only finding was a banner one rendered
an EMPTY findings container instead of "no structural issues", because the
list's presence was decided on the unfiltered set while its contents were
filtered. `listedIssues` is now derived once and used for both.

The fixture gains `acme/reports` + `globex/reports`, both fully conforming
and sharing the name `reports` — also the only fixture with a multi-segment
skill path, which nothing else exercised. Eight skills over four pages now,
and the integration test walks the cursor to exhaustion rather than asserting
a fixed page count, so a future fixture does not require editing it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ND46Ci64DC3tzBy9aG81Nc
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-09-07 19:02:18 -04:00
commit 4fa00d1cfd

View file

@ -25,6 +25,14 @@
* observation" and says hosts MUST NOT treat it as extending the manifest,
* so this is the fixture for that rule: the Inspector must show the extra
* child as *not listed* rather than as one of the skill's files (#2248).
* - `acme/reports` and `globex/reports` collide on `frontmatter.name`. Both
* are **fully conforming** — SEP-2640 requires only that the segment before
* `/SKILL.md` equal the name, which multi-segment paths satisfy while still
* sharing a final segment, and the SEP's own `acme/billing/refunds` example
* is this shape. The obligation is on the *consumer*: hosts MUST NOT assume
* name uniqueness and MUST tell two same-named skills apart rather than
* collapsing or preferring one. This pair is also the only fixture with a
* multi-segment skill path, which nothing else here exercises (#2248).
* - `lying-listing` advertises one `description` in its `skills/list` entry
* and serves a different one in its `SKILL.md` — the violation no digest can
* catch, because the digest is over the bytes the server served and says
@ -283,6 +291,26 @@ const LYING_MD = skillMd(
"# Lying listing\n\nThe description this file carries is not the one the listing advertised.",
);
// Same `name`, different paths — see the module header. Their `SKILL.md` files
// are derived from these objects like every other fixture's, so each entry is
// internally consistent and the ONLY thing to report is the collision.
const ACME_REPORTS_FM: Frontmatter = {
name: "reports",
description: "Build the weekly report from the acme ledger",
};
const ACME_REPORTS_MD = skillMd(
ACME_REPORTS_FM,
"# Reports (acme)\n\nOne of two skills named `reports`; tell them apart by URI.",
);
const GLOBEX_REPORTS_FM: Frontmatter = {
name: "reports",
description: "Build the weekly report from the globex ledger",
};
const GLOBEX_REPORTS_MD = skillMd(
GLOBEX_REPORTS_FM,
"# Reports (globex)\n\nThe other skill named `reports`; same name, different server path.",
);
const FIXTURE_SKILLS: FixtureSkill[] = [
{
path: "data-analysis",
@ -358,6 +386,28 @@ const FIXTURE_SKILLS: FixtureSkill[] = [
},
],
},
{
path: "acme/reports",
frontmatter: ACME_REPORTS_FM,
files: [
{
uri: "skill://acme/reports/SKILL.md",
text: ACME_REPORTS_MD,
mimeType: "text/markdown",
},
],
},
{
path: "globex/reports",
frontmatter: GLOBEX_REPORTS_FM,
files: [
{
uri: "skill://globex/reports/SKILL.md",
text: GLOBEX_REPORTS_MD,
mimeType: "text/markdown",
},
],
},
{
path: "wrong-folder",
frontmatter: MISMATCHED_FM,