Skip to content

fix(share): refuse an unreadable .hyperframesignore when a snapshot picks files to send - #7573

Merged
terencecho merged 1 commit into
mainfrom
codex/share-scan-strict-exports
Nov 12, 2026
Merged

terencecho merged 1 commit into
mainfrom
codex/share-scan-strict-exports

Conversation

@terencecho

Copy link
Copy Markdown
Contributor

What

snapshotProject and snapshotFiles are strict about .hyperframesignore again by default: an ignore file this package can't read makes them throw invalid_source_ignore. Change detection opts into the lenient reading with { lenientIgnore: true }. projectFingerprint names no files, so it always reads leniently.

Why

#7568 (shipped in 0.9.35) made both snapshot functions fall back to scratch-only exclusions when the ignore file can't be read. That keeps change detection working, but a host that builds an archive from the same snapshot then includes files the ignore file meant to exclude. That covers files named on the file's valid lines too, because one unsupported line makes the whole file unreadable. For example, an ignore file with private-notes.txt and /renders/ would let private-notes.txt into the archive. Before 0.9.35 the snapshot threw, and the archive was refused.

How

  • snapshotProject(dir, { lenientIgnore }) and snapshotFiles(dir, files, { lenientIgnore }) choose between the strict reader (readSourceIgnore, the default) and the change-detection reader (readChangeIgnore).
  • projectFingerprint passes lenientIgnore: true, so export freshness and share status keep working with a gitignore-style ignore file, as they do in 0.9.35.
  • Source capture is unchanged and still uses the strict reader.
  • The share-source doc now says that anything picking project files to upload stops with an error on such a file.

Hosts that call the snapshot functions for change detection need to pass { lenientIgnore: true } to keep 0.9.35's behavior there.

Test plan

  • New kernel.test.mjs test with one valid and one unsupported line: the default snapshot and snapshotFiles reject with invalid_source_ignore, as does a symlinked ignore file, and the lenient snapshot still runs. It fails on main and passes with this change.
  • The fix(share): keep change detection working with a gitignore-style .hyperframesignore #7568 tests now pass lenientIgnore and still pass. projectFingerprint works with an unsupported or symlinked ignore file, and a readable ignore file excludes its paths both ways.
  • Share package suite: 134/134 on Node 26. Typecheck, oxlint and oxfmt are clean, and the commit hooks pass.

🤖 Generated with Claude Code

…icks files to send

0.9.35 made snapshotProject and snapshotFiles fall back to scratch-only
exclusions when .hyperframesignore can't be read. That is right for change
detection, but a host that builds an archive from the same snapshot then
includes files the ignore file meant to exclude, including ones named on its
valid lines.

The snapshot is strict again by default and throws invalid_source_ignore.
Change detection opts in with { lenientIgnore: true }, and projectFingerprint,
which names no files, always reads leniently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Nov 11, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 11, 2026, 11:36 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 99 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 5c0edb5c590c3077b2102d1f77b3645806d35a81.

The fix closes the ignored-file export regression. snapshotProject and snapshotFiles now use readSourceIgnore on the default path before returning any file inventory. A mixed valid/unsupported ignore file therefore refuses the export instead of discarding its valid exclusions. Source capture independently retains the same strict reader.

The permissive path is explicit (lenientIgnore: true), and projectFingerprint sets it after the caller options so hash-only change detection remains available. The docs describe the changed default and host opt-in. Generated declarations preserve the existing calls and add the optional argument correctly. I found no production file-selection caller in this repository that opts into lenient behavior.

Validation: isolated share-package build/type checking and all 134 tests passed locally on Node 24.22.2, through pytest-gate.sh. The new mixed-ignore regression fails with main’s snapshot implementation (Missing expected rejection) and passes after restoring this head. Lint and format checks pass. Trial merge with main 6cc734fd is clean. A fresh adversarial source pass found no additional defect.

Scope: audited both snapshot paths, strict/lenient reader behavior, fingerprint consumers, source capture, generated API types and the regression. This is package/local evidence; I did not rebuild the entire repository or run a fresh Desktop/backend walk. Hosts upgrading from 0.9.35 that need permissive handling of unsupported ignore syntax must opt their change-detection-only snapshot calls into lenient handling, as the PR states; export selectors should retain the strict default.

Need: yes, restore the export exclusion boundary · Size: focused API/default fix · Reuse: existing strict and change-detection readers · Simpler: strict default with explicit opt-in · Structure: fine (checked snapshotProject, snapshotFiles, projectFingerprint and source capture; one shared reader selection covers both selectors).
Risk: medium — shared filesystem/export API; failure now refuses file selection.

Verdict: APPROVE
Reasoning: strict selection is restored across both snapshot APIs while explicitly lenient change detection remains supported and tested.

— Rames / cutroom-review

@terencecho
terencecho added this pull request to the merge queue Nov 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 12, 2026
@terencecho
terencecho added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 35cf03c Nov 12, 2026
84 checks passed
@terencecho
terencecho deleted the codex/share-scan-strict-exports branch November 12, 2026 01:06
@heygengenesis heygengenesis Bot mentioned this pull request Nov 12, 2026
4 of 6 tasks

This branch was successfully deployed

1 active deployment
staging - docs — 5c0edb5c Deployed Nov 11, 2026 by mintlify[bot]
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.

2 participants