Skip to content

fix(core): add type guards for unknown frontmatter values in URIConstructionService#2412

Merged
kitelev merged 1 commit intomainfrom
fix/uri-construction-typecheck
Mar 23, 2026
Merged

fix(core): add type guards for unknown frontmatter values in URIConstructionService#2412
kitelev merged 1 commit intomainfrom
fix/uri-construction-typecheck

Conversation

@kitelev
Copy link
Owner

@kitelev kitelev commented Mar 23, 2026

Summary

Root Cause

PR #2376 replaced console.* with ILogger — the TypeScript errors in this file went unnoticed because unit tests pass (they don't run tsc), but build and typecheck CI jobs fail.

Impact: All 14+ commits after PR #2376 had failing CI → Auto Release skipped every time → no releases since v15.0.1.

Changes

  • Line 70: Added typeof isDefinedBy !== "string" guard before passing to extractWikiLink()
  • Line 97: Replaced uid || null with typeof uid === "string" ? uid : null for correct narrowing

Test plan

  • tsc --noEmit --skipLibCheck passes (0 errors)
  • All 212 plugin unit test suites pass
  • All 69/70 CLI test suites pass (1 pre-existing integration failure)
  • Pre-commit hooks pass (lint, BDD 100%, archgate)

…ructionService

frontmatter is typed as Record<string, unknown>, but extractUID and
resolveOntologyURL were passing unknown values where string was expected.
This broke tsc since PR #2376 and blocked all auto-releases.
@kitelev kitelev merged commit 1873536 into main Mar 23, 2026
12 checks passed
@kitelev kitelev deleted the fix/uri-construction-typecheck branch March 23, 2026 18:20
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