Repository navigation
Shared Markdown fence/link readers, strict newestVersion, middleware Vary merging, package contributor guides (#1118, #1119, #1120, #1121) - #1122
Merged
Conversation
…ry (#1118) Link discovery in check-local-links.ts read only `[x](target)`, so a dead link with a title, an angle-bracket destination or balanced parentheses escaped checking. markdownLinkTargets now reads inline links and images as CommonMark does (titles in "", '' or (), <...> destinations, balanced and escaped parentheses, a link around an image) and reference definitions (not GitHub footnotes). Links inside fenced code are code. The repository's Markdown readers each kept their own fence rules and disagreed: a four-space "closing" run closed the fence for the link checker but not for docs search. packages/core/src/markdown-fences.ts holds the CommonMark rules docs search already followed (#826), and headingsOf, markdownAnchors, yamlBlocks, withoutFences, the guidance-claims rule-4 fence exemption and build-llms-full's demoteHeadings/pinDocsMentions now all use it. Scripts import core; core imports nothing from scripts. Over every tracked Markdown file the anchors, YAML blocks, fence-stripped text and docs-search headings are identical before and after; the only newly discovered link is the CI workflow around the README badge, which resolves. No dead links found. Refs #1118, #826 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mplementation (#1121) packages/mcp/AGENTS.md said the package owns JSON-RPC 2.0 framing, version negotiation, request ids and cursor pagination; src/mcp.ts serves every request through the official SDK's Server and createMcpHandler, and its lists return every declared entry. It now separates the SDK's protocol from URLCode's declarative mapping, admission and safe result/error behavior, describes the stateless server (no sessions, GET stream or replay) and states streaming per core's streamingTargets: native self-hosted, delegated Vercel (adapter support, not provider deployment proof), refused AWS. The same stale claims are fixed in packages/mcp/llms.txt (which also described sessions, a GET stream and Vercel as refused, and an Origin rule without alias origins) and in the mcp authoring description (regenerated into urlcode.json and README.md). packages/store/AGENTS.md replaced its blanket "every caller can read and change every record" with the scoped contract: shared vs owned collections, readers mounts and membership, and the transition/transfer/create gates, with their code and tests; the issue-routing line no longer names extension page styling (the ui package is gone). scripts/check-agent-facts.ts derives three more facts (the workspace packages under packages/, core's streamingTargets, and the mcp extension's SDK serving path and lack of pagination) and rejects prose that contradicts them, so the old package sentences now fail check:docs; test/agent-facts.test.ts plants each shipped sentence and the current wording. Refs #1121, #1091 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d ignores invalid versions (#1119) The owned comparator converted numeric identifiers to Number, so 1.0.0-9007199254740993 and 1.0.0-9007199254740992 tied, and its loose pattern accepted leading-zero identifiers and empty build metadata. newestVersion now validates strict SemVer 2.0.0, compares numeric identifiers by digit count then digits, ignores build metadata for precedence (equal-precedence ties resolve to the greatest string, so the answer is order-independent) and never chooses an invalid version; `outdated` reports a registry answer with no valid version. Kept owned rather than promoting semver to a runtime dependency: semver 7.8.5 compares numeric identifiers as Numbers too (compare returns 0 for the issue's pair), and accepts a leading `v`. Refs #1119 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#1120) Both standalone CORS middleware modules replaced the downstream response's Vary with Origin, dropping tokens the producer set. They now merge Origin case-insensitively, keep other tokens in order, do not duplicate an existing Origin, and leave Vary: * as *, on allowed and disallowed origins alike. A downstream Response with immutable headers is copied instead of throwing. The recipes/middleware copy is regenerated from the cookbook. Adds a composition regression for all three modules. Refs #1120. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r and link scanner packedLinkProblems kept its own fence reader (trimmed closing fence, any indent) and the old inline/reference link regexes, the last Markdown reader #1118 had not moved. It now uses packages/core/src/markdown-fences.ts fenceLines and check-local-links' markdownLinkTargets, so titled, angle-bracket and balanced-paren links in shipped documents are checked too. Code spans are masked rather than removed so a line that starts with one is not read as a reference definition. Refs #1118. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Vary (#1120) The cookbook's negotiate, bucket and locale middleware replaced the downstream response's Vary with accept, cookie and accept-language, the same overwrite the CORS modules had. Each now merges its token case-insensitively through a local helper, keeps other tokens in order, does not duplicate an existing token, leaves Vary: * as *, and copies a downstream response whose headers are immutable. The recipes/middleware copies are regenerated from the cookbook. The composition regression is renamed middleware-vary.test.ts and covers all seven modules. Refs #1120. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and change
#1118: one Markdown fence reader and titled-link discovery
packages/core/src/markdown-fences.tshas no dependencies and follows CommonMark's fence rules. All seven repo readers now use it:headingsOfcheck-local-linksmarkdownAnchorscheck-doc-yamlyamlBlockscheck-guidance-claimsbuild-llms-full'sdemoteHeadingsandpinDocsMentionspackage-audit'spackedLinkProblemsmarkdownLinkTargetsreplaces the old regexes. It finds titled links,<angle>destinations, balanced and escaped parentheses, an image wrapped in a link, and reference definitions indented 0–3 spaces. It skips GitHub footnotes.#1119:
newestVersionsemver: it has the same precision bug (semver.comparecalls1.0.0-9007199254740993and…992equal) and would add 101 KB as a runtime dependency.#1120: middleware no longer overwrites
VaryVary, ignoring case, keeping*as*, and adding no duplicates. An immutable downstream response is copied before its headers change.docs:cookbook-index.#1121: package contributor guides match the code
AGENTS.md,llms.txtand the authoring description now say the official SDK owns the protocol. They no longer mention cursor pagination, and the extension is stateless. Streaming: native on Node, delegated on Vercel, refused on AWS.AGENTS.mdnow describes the scoped access contract (shared vs owner collections, readers, transitions) and drops the leftover ui notes. auth's guide was already correct.check-agent-factsnow rejects prose naming package folders that don't exist, wrong streaming targets, and claims that the mcp extension owns the protocol or paginates.Verification
test/doc-checks.test.ts: link-scanner units, an end-to-end checker run, and an 11-case fence fixture run through every reader.test/addon-files.test.ts: fixed cases, all 40,320 orderings of a mixed set, and 500 generated sets cross-checked againstsemver.rsort.test/middleware-vary.test.ts: 54 cases; 28 of them fail on the old code.test/agent-facts.test.ts.test/package-audit.test.tspasses 7/7 on the shared readers. The real package audit passes.npm run verifyexited 0.Closes #1118
Closes #1119
Closes #1120
Closes #1121
🤖 Generated with Claude Code