Skip to content

fix: restrict specification publication to declared content - #3

Merged
jeremi merged 1 commit into
mainfrom
fix/toc-publication-boundary
Nov 4, 2026
Merged

jeremi merged 1 commit into
mainfrom
fix/toc-publication-boundary

Conversation

@jeremi

@jeremi jeremi commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

The framework adapter currently turns linked repository Markdown into extra site pages and copies unrelated non-Markdown files into public downloads. This publishes repository tooling and lockfiles alongside the specification, even when they are absent from toc.yml.

Use root README.md and toc.yml as the complete page inventory. Reject local Markdown links outside that inventory with a useful error, and remove the synthetic Linked documents group. Publish only selected support links, requirement contract/test references, metadata downloads, and local schema dependencies. Native API declarations independently retain byte-identical source contracts and their dependency files, so Source OpenAPI downloads continue to work.

Missing local schema dependencies fail generation. Download-directory indexes list only published files, and output checks validate their links. Existing source-root, hidden-path, symlink, and native API protections remain in place. The API Guide profile keeps its existing behavior.

Validation:

  • TDD regressions reproduced automatic page discovery, unreferenced source copying, missing original native-contract downloads, missing schema dependencies, and broken support-index links.
  • Renderer suite: 114 passed, four optional external-fixture tests skipped, zero failures. The current Registry canonical integration passed separately, including the unchanged-source assertion.
  • Complete framework example and API Guide builds, static checks, search, downloads, and HTTP checks passed.
  • Fresh independent review reproduced the two edge cases and verified both fixes; no remaining findings in its scope.
  • The consuming Registry source retains its requirement and OpenAPI contracts unchanged by this correction.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T11:41:26.124871Z b01a20e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jeremi
jeremi merged commit ab2f953 into main Nov 4, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b01a20e4c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread adapters/framework.mjs
Comment on lines +924 to +927
for (const reference of [...new Set([...SPECIFICATION_DOWNLOADS, ...referencedPaths])].sort()) {
pending.push({ relative: reference });
}
return copied.toSorted();
while (pending.length) await copyEntry(pending.shift());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include root-relative assets in the publication graph

For a framework site built with base /, a page containing ![Logo](/assets/logo.svg) or <img src="/assets/logo.svg"> now loses its image even when assets/logo.svg exists. collectReferencedSupportPaths excludes references starting with /, while rewriteReference leaves them unchanged. Previously, the full support-file walk published the asset; this new reference-only loop omits it, producing a broken image and a missing-target error from checkBuilt. Include source-owned root-relative references in the graph without restoring unrestricted copying.

Useful? React with 👍 / 👎.

Comment thread adapters/framework.mjs
Comment on lines +279 to +282
const target = safeRelativeTarget(
page.sourceName,
decodedPathname(page.sourceName, pathname),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve encoded delimiters when resolving support filenames

When a linked filename contains an encoded # or ?, decoding the pathname before passing it to safeRelativeTarget truncates the filename: that helper splits its argument on those characters again. For example, assets/a%23b.svg becomes the support target assets/a, so the existing assets/a#b.svg is no longer published, although the rendered URL still points to it. The parent commit published this asset successfully. Normalize the already-separated, decoded pathname without treating its literal filename characters as URL delimiters.

Useful? React with 👍 / 👎.

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