Skip to content

fix(tier1): finish the author and metadata.id review round from #499 - #513

Merged
rng1995 merged 6 commits into
mainfrom
naren/author-policy-followups
Nov 13, 2026
Merged

rng1995 merged 6 commits into
mainfrom
naren/author-policy-followups

Conversation

@rng1995

@rng1995 rng1995 commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Finishes the review round for #499, which was squash-merged as be88fa81 before these fixes landed — and whose branch GitHub deleted on merge, which is why these corrections arrive as a separate PR rather than as review commits on the original.

Items 1 and 2 are live defects in released code, not polish.

1. A blocking HIGH on legitimate non-Latin author names

The guard rejected every character in Unicode category C, which includes Cf — the format category that holds the zero-width joiners ordinary Persian, Arabic and Devanagari names are written with. On main today, under both bundled profiles:

author_value_problem('زهرا احمدی')      # ZWJ  -> 'contains control or invisible formatting characters'
author_value_problem('अमि‌त')            # ZWNJ -> same
author_value_problem('Anne-Marie\xady')  # soft hyphen -> same

author_format is HIGH, so each of those blocks publication. The guard now rejects Cc/Cs/Co plus an explicit set of genuinely dangerous format characters — U+061C, U+200E/F, U+202A–U+202E, U+2066–U+2069, U+FEFF — built with chr(0x…) so no literal control characters sit in the source. The message is now true of what it rejects: "contains control, private-use, or bidirectional formatting characters". Bidi overrides, tabs, private-use and surrogates are still rejected.

2. An intranet address reported as having no email address

_BARE_EMAIL_PATTERN required a dot in the domain, so an undotted intranet address never matched and fell through to author_without_email (INFO) — reported as "Author has no email address" when one is plainly present. root@buildhost, jane@example and ops@localhost are now author_format HIGH.

The pattern is [^\s<>@]*\w@\w[^\s<>@]* rather than simply dropping the dot, because dropping it turns the social-handle form the docstring documents into a blocking finding. Jane Doe (@jdoe), Team (@org-handle), @jdoe and Platform Team @ Example all stay clean.

3. Documentation that main does not have

docs/tier1-validation.mdx said "under registry each skill that shares an ID fails", which is true only of catalog-summary.json. It now states what is true per surface: the run exits nonzero, each sharing member's entry is "passed": false with the conflict under catalog_findings and counted in severity_counts, and the skill's own report keeps its single-skill verdict under report_verdict beside report_scope: "single_skill". Main documented neither of those field names anywhere. The author bullet now also says that joiners are accepted and that an undotted intranet address counts as a bare address.

4. Two uncovered branches

  • test_domain_restriction_rejects_well_formed_author_outside_the_domain pins the shape_ok=True / domain_ok=False half of the branch; the existing test only covered shape_ok=False, which now also carries an explicit shape_ok is False assertion so the two halves are distinguished.
  • test_a_skill_that_fails_on_its_own_keeps_its_reason_over_the_id_conflict asserts "2/2 skills failed validation", that "3/2" does not appear, and that a skill failing on its own keeps its own reason rather than the conflict one.

Neither changes behaviour.

5. A carried advisory now says which skill it came from

The collection aggregator preserved a passing child's advisories with a bare add_finding, so in a catalog of N skills the findings arrived as an unattributed pile. prefix_finding is extracted from merge_with_prefix (behaviour-preserving) and a new merge_advisories_with_prefix gives each carried advisory a [skill] location and metadata.collection_skill. It never touches passed, so an advisory from a passing child stays advisory.

collection_skill is deliberately not added to merge_with_prefix itself, which also prefixes rule, workflow and reference/… names where that key would be a lie.

The per-skill roll-up message no longer reads "All schema and structure checks passed" directly above a list of advisory findings.

6. catalog_findings makes the severity bump auditable

A catalog entry recorded the severity bump from a duplicate-ID conflict without recording what caused it. Each matched conflict is now attached as {category, check_name, severity, blocking, message}. Only added when the member actually has a conflict, so a clean entry's shape is unchanged. Main's application point inside _write_catalog_summary is kept — one pass, no double counting — and main's parametrized matrix test is extended to assert the exact contents and "catalog_findings" not in entry for the non-conflicting member, covering both the serial and parallel paths.

Verification

Selection of 11 validator files plus tests/models, tests/golden, tests/reporting, test_commands.py, test_catalog_discovery.py and test_catalog_results.py, -n 6:

result FAILED set
this branch 1 failed, 3562 passed, 1 skipped test_tier3_completed_agent_docs.py::test_validate_tier3_writes_the_same_report_pair
baseline be88fa81 1 failed, 3545 passed, 1 skipped identical

Identical failure sets — nothing introduced. That test lives in tests/reporting, untouched here, and failed on every baseline taken today. The +17 passes are the new cases. ruff check clean; CHANGELOG entries under ## Unreleased only, with zero deletions from released sections.

Noted for whoever picks this up

merge_with_prefix still does not tally severity counters, which is why the collection path needs a tally_severity loop beside it. Every other caller — rules, workflows, plugin, quality, script-lint, rubric — still under-reports summary.*_count; html.py compensates by counting findings directly, json_reporter.py does not. Out of scope here, but it is the same class of inconsistency as the rest of this round.

🤖 Generated with Claude Code

rng1995 and others added 2 commits November 13, 2026 10:37
#499 was squash-merged while this round of review fixes was still in
flight, so these arrive separately from the code they correct. Two of them
are live defects in main.

The author character guard matched all of Unicode category C, which also
covers ZWNJ (U+200C) and ZWJ (U+200D). Persian, Arabic and Devanagari
names need those joiners to render, so a legitimate name failed
SCHEMA.author_format at HIGH under both bundled profiles, as did a soft
hyphen and any code point unassigned in the running interpreter's Unicode
data -- which made the verdict depend on the interpreter's version rather
than on the value, and made the message untrue of what it rejected. The
guard now takes Cc/Cs/Co plus an explicit set of bidirectional marks,
embeddings, overrides, isolates and the byte-order mark.

The bare-email pattern required a dotted domain, so root@buildhost and
jane@example took the plain-attribution path and were reported as "Author
has no email address" -- plainly false of a value that is nothing but an
address, and the opposite verdict from [email protected] for the same
shape. The discriminator is now a word character on each side of the @,
which keeps a social handle such as Jane Doe (@JDoe), a bare @JDoe and
Platform Team @ Example clean, and also catches a non-ASCII local part
that the old pattern's successor would have missed.

Collection validation already preserved a passing skill's advisories, but
carried the findings unchanged, so nothing said which member produced one.
merge_advisories_with_prefix names the skill in the finding's location and
in metadata.collection_skill, and never touches passed, so an advisory
stays advisory. The per-skill roll-up no longer claims every check passed
next to a list of that skill's advisories.

A catalog-summary.json entry already carried the member verdict and the
severity bump from a duplicate metadata.id, but a catalog validates each
skill on its own, so nothing in that skill's output said what caused
either. The entry now lists them under catalog_findings.

Adds the two tests the review asked for with no behaviour change: a
well-formed author outside an author_email_regex domain (the shape_ok=True
half of that branch, which nothing covered), and the catalog failure dedup
guard asserting "2/2 skills failed validation" rather than "3/2" when a
skill carries both its own failure and a shared ID.

docs/tier1-validation.mdx described neither the narrowed guard nor the
report_verdict / report_scope shape #499 shipped; both are now documented.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Only CHANGELOG.md conflicted: main's new Unreleased Fixed entry from #509
and this branch's four entries were both inserted at the top of that
section. Resolved by keeping main's entry in the position main gave it,
with the branch entries following, so the diff against main stays purely
additive. Every released section is byte-identical to main's copy.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
rng1995 and others added 4 commits November 13, 2026 11:16
…se half

Review follow-up on #511. _expected_behaviors_verified settled an expectation
whenever every checkable token it named was observed, so one that also asked
for something only the final answer could show was settled by the artifact
alone: "writes `report.py` and explains why each column was dropped" lifted
the gate although the second half was never checked. That inverts the defect
#511 set out to fix -- instead of discarding a score the evidence supports, it
kept one the evidence does not.

Every clause of an expectation must now name a checkable artifact of its own.
Clauses are split on the ordinary joiners (and, then, also, plus, as well as,
while, before, after, a semicolon, or a sentence break), never on a bare dot,
so an artifact path keeps its extension. A clause naming nothing checkable
keeps the gate, exactly as a wholly prose expectation already did.

The split is deliberately generous: an unrecognized clause shape reads as
prose and keeps the gate, which withholds a score. Lifting the gate wrongly
keeps a score the evidence does not support, so the two errors are not
symmetric and the ambiguous case belongs on the withholding side.

Tests cover the pure-artifact, pure-prose, unobserved-artifact and mixed
forms across each joiner, plus the end-to-end path through
behavior_evidence_gap. Removing the clause check fails five of them.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
@rng1995
rng1995 merged commit 6000e28 into main Nov 13, 2026
27 checks passed
@rng1995
rng1995 deleted the naren/author-policy-followups branch November 13, 2026 19:40
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.

1 participant