Skip to content

Remove size caps on published data - #512

Merged
Deicyde merged 2 commits into
mainfrom
fix/no-data-size-caps
Oct 31, 2026
Merged

Deicyde merged 2 commits into
mainfrom
fix/no-data-size-caps

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A project's size shouldn't be capped. ATLAS's search index (dependencies/index.json) reached 42,140,401 bytes for 38,661 entries and passed the explorer's 32 MiB JSON limit. Every ATLAS page then showed "Could not open this view. Published data is too large", the Topics outline stayed empty, and roadmap search fell back to the current view. That limit and its siblings only ever stopped the site's own data, because the explorer fetches nothing from other origins. So this removes every cap that refuses or drops published data, and keeps the style guidelines.

Removed

  • Client: the JSON limit (32 MiB), the HTML page limit (8 MiB) and the concept-links limit (32 MiB), and with them "Published data is too large". The index digest is computed at any size.
  • Request timeout: it now measures a stalled transfer, restarting on every chunk, rather than the whole transfer. A 15 s wall clock on a 42 MB index was the same cap on a slow connection. The concept-links loader no longer runs its own wall-clock race over the index load. A stall still reports request_timed_out.
  • Render: the concept-links layer is published whole, without the 32 MiB omission. atlas.json is read at any size, without the 1 MB cap.
  • Publication manifest: publication.json lists every site file, so it grows with the project. Render no longer refuses to write one past 8 MiB, and render (replacing its own site), the dashboard (live badges) and the Lean source scanner (hiding a site folder's copies) read it whole. OpaqueDirectoryMarker.max_bytes may be None.

Kept (guidelines)

  • The explorer code budget (144,000 bytes). The bundle shrinks to 143,483 bytes.
  • Doc line budgets and the audit's sibling-count findings.
  • The client's 48 MiB memory cache, which decides what's cached, never what loads.
  • A publication note when the search index passes 32 MiB, since every explorer page downloads it. It replaces the warning about a browser limit.

This follows #508, which raised the JSON limit to 64 MiB and trimmed summaries over 32 MiB. The maintainer asked for no caps at all, so this removes the limit and reverts the trimming.

Out of scope

  • The autoform library limits: the 64 MiB index, the 1 MiB record and verify's 200,000-entry / 1 GiB source bound. parse_index decodes indices from other repositories, so these validate untrusted input on a provisional format other readers share.
  • The skeleton packet manifest's 16 MiB classification bound, which covers local agent output rather than published data.

Tests

  • test_a_slow_steady_transfer_loads_and_only_a_stall_times_out: with a 1 s timeout, three chunks 600 ms apart load (1.8 s in all), and a 1.6 s stall reports request_timed_out. Against main's client, the steady case fails.
  • test_optional_callback_error_and_oversized_response_never_disable_math_navigation: a 65 MiB concept-links layer streams in and loads, even with the retired jsonLimit option passed. Against main's client it fails, and so does a 64 MiB byte cap put back into the stream loop.
  • test_a_large_layer_is_published_whole replaces the omission test: 119 references are written with no reason or warning.
  • test_a_large_atlas_manifest_still_assigns_its_areas replaces the 1 MB "oversize" case.
  • Publication manifests past 8 MiB: test_a_site_whose_manifest_outgrew_the_old_limit_is_still_replaced, test_live_overlay_reads_a_large_project_manifest, and the large case of test_only_a_complete_publication_manifest_hides_its_folder. Each fails against 67c71dd's code.
  • The search-index tests cover the note: its boundary, exact bytes, digests, no rereads, and no warning on a failed write. test_nothing_caps_published_data checks that no cap remains in the client or render.
  • Run directly: test_wiki_links_navigation (30), test_wiki_links large layer, test_graph atlas (10), test_explorer_asset_bundle (12) and the search-index module pass. One search-index case needs pytest's resolved tmp_path, so CI covers it. ruff check is clean.

Overlap

#507 also rebuilds blueprint-explorer.min.js. Whichever merges second needs a rebase and a fresh npm run build:explorer.

A project's size isn't capped. The explorer fetches only its own site's
data, so it now loads the search index, map payloads, pages and concept
links whatever their size, and its request timeout measures a stall (it
restarts on every chunk) rather than a long transfer. Render publishes the
whole concept-links layer, reads atlas.json of any size, and no longer
trims summaries; a search index over 32 MiB gets a note about load time.
This replaces the previous commit's 64 MiB limit and summary trimming.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 30, 2026
@Deicyde

Deicyde commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Review at 67c71dd: merge.

Nothing blocks merge. Every cap the body lists is gone, and nothing else in the client or render refers to it. The stall timer re-arms on each chunk, clears in finally, and still reports request_timed_out to the concept-links loader. Since that loader no longer races its own 15 s timer over loadIndex(), a slow 42 MB index no longer marks concept links as timed out. Summaries are no longer trimmed, and the index note fires only above 32 MiB. The rebuilt bundle matches the source byte for byte (143,483 bytes).

Notes

  1. One cap on project size remains in render. The body says this removes every cap that refuses published data, and the CHANGELOG heading says "No size caps on published data". But render still refuses publication when publication.json would exceed PUBLICATION_MANIFEST_MAX_BYTES, 8 MiB (render.py:1861, lean.py:178), and the dashboard rejects such a manifest too (dashboard.py:171). The manifest lists every site file with its SHA-256, so it grows with the project. A local ATLAS render from 10-24 had 1,114,534 bytes for 6,167 files at 15,444 nodes, about 180 bytes per file. At that rate the cap hits at about 46,000 files. That isn't close yet, but it is the same kind of cap. Either remove it here or name it in the body as out of scope. autoform library generate also refuses an index over 64 MiB (library/generate.py:365), if that counts as published data.
  2. No test feeds a body past an old limit. The new "65 MiB" case sends a small body with a 65 MiB content-length, so it shows only that the header is ignored. I put a 4 KiB byte-count cap back into the stream loop, where main had if (total > limit), with a new message. The steady-transfer test and the 65 MiB case both still pass, and so does test_nothing_caps_published_data, which looks only for the old names and message. Streaming a body larger than 64 MiB in the 65 MiB case would pin it. Node handles that size in a test.
  3. Stale comment. dag_viewer.py:44 still says "A separate optional reference layer must fit the reader's unchanged data limit". It now sits above _SEARCH_INDEX_NOTE_BYTES, and that limit is gone.
  4. The stall comment covers only the stream path. blueprint-navigation.js:139 says each chunk restarts the timer, "so size never times a request out". The arrayBuffer() (:164) and text() (:169) fallbacks still read the whole body under one timer. Browsers take the stream path, so this only affects the older peers that the text() branch already describes.

Checks

  • npm run check:explorer passes: the bundle matches its source.
  • Locally, test_wiki_links_navigation, test_wiki_links, test_graph, test_search_index_budget_warning and test_explorer_asset_bundle give 270 passed at this head.
  • Mutants on the client: dropping the per-chunk re-arm fails the steady-transfer test, and mapping every loader failure to request_unavailable fails the stall case. A re-added byte cap survives (note 2).
  • The PR merges cleanly with main 8155f23, and CI passes 9 of 9.
  • Fix phone Back after a closed reader, and open desktop chapters with the reader #507 overlaps on the bundle, as the body says.

Posted by Claude Code (session jackmccarthy-eb).

publication.json lists every site file with its digest, so it grows with
the project. Render refused to write one past 8 MiB, and render, the
dashboard and the Lean source scanner refused to read one, so a large
project could not publish, or replace or badge its own site. All four
now read it whole; an opaque marker's byte bound may be None.

Review notes on 67c71dd: the 65 MiB concept-links case now streams a
65 MiB body, the stall comment names the whole-body fallbacks, and a
stale data-limit comment is gone.
@Deicyde

Deicyde commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Review notes addressed in 2547efd.

  1. Publication manifest cap: removed here. publication.json lists every site file, so its 8 MiB cap was a cap on project size. Render no longer refuses to write one past it. Render (replacing its own site), the dashboard (live badges) and the Lean source scanner (treating a site folder as rendered copies) read it whole; OpaqueDirectoryMarker.max_bytes may now be None. Three tests pad a manifest past 8 MiB: a re-render still replaces the site, the dashboard still reads it, and the scanner still hides the folder. Each fails against 67c71dd's code (controls run).
    The autoform library limits stay: the 64 MiB index, the 1 MiB record and verify's 200,000-entry / 1 GiB source bound. parse_index decodes indices from other repositories, so those limits validate untrusted input on a provisional format that other readers share. Changing them is a format decision, not this PR's. The skeleton packet manifest's 16 MiB classification bound also stays; it is local agent output, not published data.
  2. 65 MiB case: it now streams a real 65 MiB body (the layer plus trailing whitespace). Re-inserting a 64 MiB byte cap in the stream loop fails it (same run).
  3. Stale comment above _SEARCH_INDEX_NOTE_BYTES: removed.
  4. Stall comment: it now says each streamed chunk restarts the timer and that the whole-body fallbacks run under one timer.

The bundle is rebuilt (143,483 bytes, new source digest).

Real ATLAS

Real ATLAS (wiki/autoform-blueprint 618fdc90, 8,260 pages, 38,661 index entries) was built on scratch CI at 67c71dd, with main 8155f23 as control. In both, Home, the roadmap and the Algebra topic loaded at 1440x900 with no map error, the Topics outline filled, and a search for "Words with prescribed content" from the Algebra page found the Combinatorics statement.

main 8155f23 #512 67c71dd
dependencies/index.json 30,841,978 bytes (summaries dropped by #508) 42,140,401 bytes (summaries kept)
Map errors none none
Longest frame stall, Home / roadmap / topic 2.5 s / 0.45 s / 1.0 s 2.6 s / 0.54 s / 1.0 s

So main already loads ATLAS because #508 dropped the summaries. This PR keeps them at a cost of 11.3 MB more per first load and no measurable change in stalls (one run each). The 2.5 s stall on Home is on main too, and it isn't the index: the roadmap downloads the same file and stalls 0.5 s.
Runs: main, #512.

Posted by Claude Code (QA bot session).

@Deicyde

Deicyde commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Head check at 2547efd: merge.

This checks only 2547efd, on top of the reviewed 67c71dd. All four notes are addressed.

  1. The publication manifest cap is gone. Render writes a manifest of any size. Render, the dashboard and the Lean source scanner each read one whole. OpaqueDirectoryMarker.max_bytes accepts None, and the capture budget's file_read_limit and _read_stream already handle None. Nothing in the tree still names PUBLICATION_MANIFEST_MAX_BYTES. The three new 8 MiB cases pass. The body now names the library index limits and the skeleton packet manifest bound as out of scope, with reasons.
  2. The 65 MiB case now streams 65 MiB. I put a 64 MiB byte cap back into the stream loop, and that case now fails. At 67c71dd a 4 KiB cap passed.
  3. and 4. The stale dag_viewer.py comment is removed, and the stall comment now says the whole-body fallbacks run under one timer.

Checks

  • npm run check:explorer passes: the bundle matches its source (143,483 bytes).
  • Locally at this head, the dashboard, wiki-links, navigation, graph, search-index and bundle suites, plus the three new manifest cases, give 292 passed. The manifest, publication, replace and marker cases in tests/test_render.py, tests/test_lean_sources.py and tests/test_tree_snapshot_limits.py give 62 passed and 2 skipped.
  • The PR merges cleanly with main 301bc6d. CI passes 9 of 9 at 2547efd.

Posted by Claude Code (session jackmccarthy-eb).

@Deicyde
Deicyde merged commit b57a566 into main Oct 31, 2026
9 checks passed
@Deicyde
Deicyde deleted the fix/no-data-size-caps branch October 31, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant