Skip to content

[CTX-0022] fix(registry): batch 1 - entry types, URL identity, SPDX validation - #57

Merged
Xuepoo merged 1 commit into
mainfrom
carryctx/ctx-0022
Sep 26, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
carryctx/ctx-0022

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Implements three registry validation fixes (PLUG-REG-001, PLUG-REG-004, PLUG-REG-014):

Changes

1. validateRawEntryTypes() - Pre-normalization type validation (#48)

  • Validates field types before normalization to prevent silent coercion
  • Reports wrong types as errors rather than defaulting
  • Covers all required, optional, array, object, and nested fields

2. parseRepositoryIdentity() - Centralized URL parsing (#51)

  • Extracts owner, repo, fullPath, and host from repository URLs
  • Preserves nested namespaces (e.g., gitlab.com/group/subgroup/repo)
  • Used by rawManifestUrl() and repositoryName() for consistency

3. SPDX expression validation - Balanced parentheses (#54)

  • Validates parentheses balance before tokenization
  • Tokenizes expressions preserving parentheses as separate tokens
  • Handles complex expressions: (MIT OR Apache-2.0) AND BSD-3-Clause

Testing

All fixes include comprehensive test coverage (113 tests passing).

Quality Gates

  • ✅ Formatting (prettier)
  • ✅ Linting (markdownlint-cli2)
  • ✅ Type checking (tsc)
  • ✅ Tests (bun test)

Priority: P2 | Area: plugins | Labels: fix, P2, area:plugins | Milestone: v0.1.0 | Task: CTX-0022

Closes #48
Closes #51
Closes #54

…alidation

Implements three registry validation fixes (PLUG-REG-001, PLUG-REG-004, PLUG-REG-014):

1. validateRawEntryTypes() - Pre-normalization type validation (#48)
   - Validates field types before normalization to prevent silent coercion
   - Reports wrong types as errors rather than defaulting
   - Covers all required, optional, array, object, and nested fields

2. parseRepositoryIdentity() - Centralized URL parsing (#51)
   - Extracts owner, repo, fullPath, and host from repository URLs
   - Preserves nested namespaces (e.g., gitlab.com/group/subgroup/repo)
   - Used by rawManifestUrl() and repositoryName() for consistency

3. SPDX expression validation - Balanced parentheses (#54)
   - Validates parentheses balance before tokenization
   - Tokenizes expressions preserving parentheses as separate tokens
   - Handles complex expressions: (MIT OR Apache-2.0) AND BSD-3-Clause

All fixes include comprehensive test coverage.

Closes #48, #51, #54
@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 26, 2026
@Xuepoo Xuepoo added fix Bug fix P2 Priority: medium area:plugins labels Sep 26, 2026
@Xuepoo
Xuepoo merged commit f90877d into main Sep 26, 2026
6 checks passed
@Xuepoo
Xuepoo deleted the carryctx/ctx-0022 branch September 26, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugins fix Bug fix P2 Priority: medium

Projects

None yet

1 participant