Skip to content

2026 05 13 package api amd repo polish fixes#7

Merged
sergeyshmakov merged 3 commits into
mainfrom
2026-05-13-package-api-amd-repo-polish
May 15, 2026
Merged

2026 05 13 package api amd repo polish fixes#7
sergeyshmakov merged 3 commits into
mainfrom
2026-05-13-package-api-amd-repo-polish

Conversation

@sergeyshmakov
Copy link
Copy Markdown
Owner

@sergeyshmakov sergeyshmakov commented May 15, 2026

Summary by cubic

Aligns .match() with .covers() for wildcard prefix coverage and fixes * vs ** prefix checks. Also adds a Google Search Console verification file.

  • Bug Fixes

    • .match() now returns "covers" when a wildcard template prefixes a deeper concrete path, and "covered-by" in reverse.
    • Literal "parent/child" only when both paths are wildcard‑free; (*).covers(**) and (a.*.x).covers(a.**.x) now return false. Propagated to .match() and .startsWith().
    • Added regression tests for wildcard prefix coverage and * vs ** mismatches.
  • Refactors

    • Removed the whole-path patternMatches utility and unified logic on prefix checks plus wildcard detection.

Written for commit 49b53f3. Summary will update on new commits.

sergeyshmakov and others added 2 commits May 14, 2026 16:30
`tmplPrefix.covers(deeperConcrete)` returned true (a wildcard prefix
covers any path under its domain) but `tmplPrefix.match(deeperConcrete)`
returned null — the parent/child branch was gated off when wildcards
were present, and patternMatches only handled whole-path matches.

Unify the two: when one side has wildcards and matchesPrefix succeeds
on the longer side against the wildcard-bearing side as the prefix,
return covers / covered-by. This also subsumes the previous
patternMatches-based whole-match check (matchesPrefix with wildcards
in the prefix is strictly more general), so patternMatches is dropped.

Literal parent/child remains gated on both sides being wildcard-free.

Tests:
- tmpl.each().match(concrete[0].name) → covers (was null)
- tmpl.deep().match(deeper.path)      → covers (was null)
- all prior match() relations unchanged

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/impl/base-path-impl.ts">

<violation number="1" location="src/impl/base-path-impl.ts:70">
P2: `match()` now reports `covers`/`covered-by` even when both paths are wildcard templates. Guard these branches so they only apply when the opposite side is concrete.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/impl/base-path-impl.ts
`(*).covers(**)` and `(a.*.x).covers(a.**.x)` previously returned true
because `prefix[p] !== WILDCARD` short-circuited the equality check
against `full[f] === DEEP_WILDCARD`, silently treating `**` as a single
segment. `**` represents 0..N segments, so a single-segment element
(literal or `*`) in the prefix cannot cover it.

Propagated to `.match()` (reported `"covers"`/`"covered-by"`) and
`.startsWith()` for the same shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sergeyshmakov sergeyshmakov merged commit 6654a4c into main May 15, 2026
2 checks passed
@sergeyshmakov sergeyshmakov deleted the 2026-05-13-package-api-amd-repo-polish branch May 15, 2026 08:40
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant