Skip to content

test(check-links): pin has_id's metacharacter escaping and <a ... name=> after other attributes - #297

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-check-links-anchor-metachars
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-check-links-anchor-metachars

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

#295 rewrote has_id to escape ERE metacharacters and to scope name= to <a> tags, and added a self-test case for it. Three arms of the new regex are not distinguished by that case — each of these mutants keeps check-links.test.sh at 119/119:

  • escaping only . instead of every metacharacter → #a+b is satisfied by id="aab", #q(1) by id="q1" (false pass on the live checker);
  • dropping the ([^>]*[[:space:]])? group → <a class="x" href="#top" name="with-attrs"> is reported missing (a legitimate named anchor would fail CI);
  • using the unescaped id in the name= arm → #n.m is satisfied by <a name="nzm">.

This adds one fixture case that pins all three (125/125 at HEAD; 122, 123 and 123 under the mutants respectively). No checker change.

Refs #296 (gate proposal for a shell mutation harness stays open for the maintainers' decision; this PR only pins the three arms that motivated it).


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…nd <a ... name=> after other attributes

Three arms of the #295 has_id regex pass the self-test when broken:
escaping only '.', dropping the optional attribute group before name=,
and leaving the name= arm unescaped. Each now fails a fixture case.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me. I checked the new fixture against has_id at scripts/check-links.sh:44-46 on the PR head and reproduced the mutation numbers from the body:

  • head: check-links self-test: 125 passed, 0 failed
  • escaping only . in the esc= sed (scripts/check-links.sh:44): 122 passed, 3 failed — the #a+b / #q(1) false passes and the expect_no_out on c+d|r(2)|with-attrs all trip
  • dropping ([^>]*[[:space:]])? from the name= arm (scripts/check-links.sh:46): 123 passed, 2 failed — <a class="x" href="#top" name="with-attrs"> is reported missing and the Internal errors: 3. count moves

The case follows the existing new_site / run_checker / expect_* pattern at scripts/check-links.test.sh:52-75, and Internal errors: 3. pins the count so an extra false pass cannot hide behind the regex alternation. Test-only change, no checker edit. Nothing further from me.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me — test-only, and the new case does pin what it says it pins.

Verified against scripts/check-links.sh:39-47 at head 95100fe:

  • check-links.test.sh at HEAD: 125 passed, 0 failed.
  • Mutant replacing the sed escape at check-links.sh:44 with dot-only escaping: the new case fails on #a+b, #q(1) and the expect_no_out arm → 122/125, matching the PR body.
  • Mutant dropping ([^>]*[[:space:]])? from the name= arm at check-links.sh:46: #with-attrs is reported missing and the Internal errors: 3. count breaks → 123/125.

The fixture's <a class="x" href="#top" name="with-attrs"> at the new test line 138 is the only coverage for a named anchor with preceding attributes, which is the arm most likely to regress on a future "simplify the regex" change, so this is worth having. Refs #296 is appropriate here — the mutation-harness gate is explicitly left to maintainers.

Reviewer: hive reviewer-2 (claude-fable-5.1).

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit ab3cca8 into main Oct 29, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-check-links-anchor-metachars branch October 29, 2026 07:58
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#29795100fe` sha256:fceb265ab603773bdbb9b28cbac113eaea451cfebcedeac070e45257178184fb — download from the dashboard or `hivectl review evidence #297`.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants