Skip to content

fix(dataloader): bound split cache filenames without legacy aliasing (#261) - #262

Merged
Birfy merged 6 commits into
mainfrom
fix/issue-261-cache-filenames
Oct 15, 2026
Merged

Birfy merged 6 commits into
mainfrom
fix/issue-261-cache-filenames

Conversation

@Birfy

@Birfy Birfy commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Closes #261.

Summary

  • Bound row-cache filename components and make slash-containing, traversal-style, Unicode, punctuation and long split values portable single-file entries.
  • Preserve ordinary short cache filenames and the datasets-server request values. Lossy filename conversions carry an identity digest.
  • Use a versioned suffix for transformed names so a pre-upgrade raw-split cache entry cannot alias a new sanitized filename. Existing cache files are left intact.
  • Add 23 offline cache-name cases, including real cache reads/writes, request preservation and a legacy-upgrade collision regression; document the compatibility behavior in the changelog.

Validation on this exact head

Published tree: 7436ba152d43ff5aa70834762c57ec81f8e986cb, based on f3d8b848845e248af8673c931f6d5326fa1e5f65.

  • Python 3.12.14 full suite: 3,408 passed, 57 skipped, 18 failed, 0 errors (603.29 seconds). This is not a passing full-suite result.
  • All 18 failing tests were reproduced on unchanged base main: 17 Bubblewrap sandbox-startup failures with Failed to create NETLINK_ROUTE socket: Operation not permitted, plus tests/test_porous_molecules::test_the_pdf_is_actually_written, whose Chromium/PDF failure also reproduced on the base.
  • Focused dataloader/cache-name suite: 50 passed.
  • Offline wheel build, clean production-wheel installation, metadata and CLI/MCP smoke passed. All 23 new cache-name regressions passed against the installed wheel; existing pytest tooling was supplied separately after verifying the production import came from that wheel.
  • Strict offline docs build with existing cached fonts passed; navigation check covered 82 rendered pages, and 10 documentation JavaScript tests passed.
  • Local browser-layout validation remains blocked: the bundled Playwright Chromium is absent and the installed Chromium cannot start under this environment's socket restrictions. The same limitation reproduced on the base. The local browser limitation remains recorded here; hosted validation below supplies the browser check and Python-version matrix.
  • Independent final review passed bounded offline controls: pre-upgrade collision and unchanged legacy entries, eight ordinary-filename compatibility controls, 2,007 deterministic component identities, the 200-byte basename bound, and real multipage cached rows with URL/timeout preservation.
  • No live provider or dataset calls were made. Earlier interrupted or pre-correction runs are not counted as final-head validation.

Hosted validation

Exact head 9a5d176ec20ca87ff55688b87d0c181ce9ef10b4 is terminal green:

  • Tests: Python 3.9, 3.10, 3.11, 3.12 and 3.13 all passed pytest, wheel build and installed-wheel smoke.
  • Documentation: strict build, JavaScript tests, navigation and the real browser-layout check all passed. Deployment was correctly skipped for this PR.

Independent final review and all applicable hosted checks have passed. The local limitations above remain disclosed. No test gates or workflow settings were weakened; formal repository review and merge protections still apply.

…tity

Keep normal cache filenames and request parameters unchanged. Bound transformed filename components with identity digests and a versioned suffix that cannot alias legacy integer-page cache names.

Add offline real-cache and legacy-upgrade regressions for issue #261.
@Birfy
Birfy marked this pull request as ready for review October 14, 2026 16:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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-10-14T16:11:23.462348Z 9a5d176 Draft marked ready
ℹ️ 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.

@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: 9a5d176ec2

ℹ️ 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 agentdescent/dataloader.py Outdated
Comment on lines +270 to +271
parts = (_slug(config), split, str(offset), str(length))
components = tuple(_rows_cache_component(part) for part in parts)

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 Hash long configs before discarding their identity

When a config's slug exceeds 48 characters, this passes the already-lossy _slug(config) into _rows_cache_component, so distinct configs that normalize to the same slug—such as "a/" + "x" * 1000 and "a:" + "x" * 1000—produce the same .v2.json cache path. After one config is fetched, requesting the other silently returns rows from the first; use the raw config to compute the digest when bounding a long config while preserving the legacy slug only for unchanged short names.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 6445210: when the config component has to be bounded, the digest is now taken over the raw config (_rows_cache_component(slug, identity=config)), not the lossy slug. Short config slugs keep their legacy .json names. New regression test_long_configs_that_slug_identically_keep_distinct_entries ("a/"+"x"*1000 vs "a:"+"x"*1000) fails on 9a5d176 and passes now; test_dataloader*.py 51 passed locally.

@Birfy Birfy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review

Verdict: LGTM (Closes #261)

Faithful fix for the unbounded / traversal-prone split component in _rows_payload. Ordinary short filenames stay byte-identical (components == parts → .json), so existing cache hits are preserved; anything that must be sanitised or truncated gets a ~{sha256[:32]} identity suffix and a .v2.json basename so a pre-upgrade literal cannot alias the new name.

Checked locally on head 9a5d176:

  • pytest tests/test_dataloader_cache_names.py → 23 passed
  • pytest tests/test_dataloader.py tests/test_dataloader_cache_names.py → 50 passed
  • Confirmed the new regressions fail when dataloader.py is swapped back to main's implementation (aliasing / nested paths / unbounded names)

Hosted CI is fully green (tests 3.9–3.13 + docs build; deploy skipped). Ready to merge from our side.

(Posted as COMMENT because GitHub blocks APPROVE from the author account.)

…ding (#261)

Review on #262: a config over 48 slug chars was hashed from _slug(config),
so 'a/'+x*1000 and 'a:'+x*1000 shared one .v2.json page and the second
silently returned the first's rows. Hash the raw config instead; short
config slugs keep their legacy filenames. Regression added.

@Birfy Birfy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Re-review at 6445210

Verdict: LGTM — Codex's P2 (long configs that slug identically shared one .v2.json page) is fixed: the bounded config component is now digested from the raw config, while short config slugs keep their legacy .json names.

  • New test_long_configs_that_slug_identically_keep_distinct_entries ("a/"+"x"*1000 vs "a:"+"x"*1000) fails on 9a5d176, passes on 6445210; test_dataloader.py + test_dataloader_cache_names.py 51 passed locally.
  • Hosted CI on 6445210: build + tests 3.9–3.13 green (deploy skipped).

No unresolved blocking feedback. Ready to merge.

(Posted as COMMENT — author account cannot APPROVE.)

Birfy and others added 3 commits October 15, 2026 08:08
Resolve CHANGELOG.md conflict with recently merged entries.
Resolve CHANGELOG.md: keep #261 dataloader cache filenames above newly merged main entries.

@Birfy Birfy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Re-check after merging main (post-#264/#253)

CHANGELOG conflict resolved by keeping this PR's Fixed entry above the newly merged #263 FileCache note. Exact-head CI (build + 3.9–3.13) is green again; still MERGEABLE. Prior LGTM stands (self-approve blocked → COMMENT).

@Birfy Birfy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Re-review at 6c5f523: still LGTM. This push only merges current main (1049ab5, after #250/#260/#279 landed); the sole conflict was CHANGELOG.md, resolved by keeping both entries, and the branch diff against main is unchanged apart from that. Full local suite passed and CI is green. Mergeable, no open blocking feedback.

@Birfy
Birfy merged commit 3947aee into main Oct 15, 2026
7 checks passed
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.

dataloader: _rows_payload leaves split unslugged — path traversal / nested cache dirs / unbounded filenames

1 participant