Skip to content

Map v2 output names with versioned collision-safe components - #177

Closed
linroid wants to merge 2 commits into
torrent-v2-06-commit-barrierfrom
torrent-v2-06-output-mapping
Closed

linroid wants to merge 2 commits into
torrent-v2-06-commit-barrierfrom
torrent-v2-06-output-mapping

Conversation

@linroid

@linroid linroid commented Sep 12, 2026

Copy link
Copy Markdown
Owner

V2 file trees retain raw binary names, which cannot be used directly as filesystem destinations. Add a versioned mapping that preserves ordinary UTF-8 names, encodes unsafe names, bounds long components, and separates case/Unicode aliases with deterministic full-hash suffixes. Map all files and directories before selection; hybrid file IDs remain the original v1 indices and padding has no output.

Stack: based on #176, advancing #162 step 06. This computes relative components; actual provider checks, trusted-root joining, ownership, persisted mapping migration and v2 storage integration remain pending. Existing v1 paths are unchanged.

Validation: all 356 torrent JVM tests, both existing pinned-client v1 conformance scenarios, and the native-runtime guard pass. Four new tests cover ordinary Unicode, traversal and separators, invalid UTF-8, Windows device names, case/normalization aliases between files and directories, deterministic ordering, bounded long names and hybrid IDs. These checks do not certify v2 downloads or filesystem-provider integration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 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-09-12T14:41:19.230430Z 440c0b8 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.

@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: 440c0b8550

ℹ️ 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".

}

private fun collisionKey(value: String): String =
canonicalTorrentName(value).uppercase().lowercase()

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 Use a symmetric Unicode case fold for collision keys

When sibling components are ß and ẞ, this expression produces ss and ß, respectively, so neither name receives a hash suffix even though Unicode case-insensitive comparison—and the module's existing lowercase-based collision handling—treats them as aliases. Once this mapping is used on such a filesystem, the two authenticated files can resolve to the same destination; use a symmetric/full case fold and cover this pair in the collision test.

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 a1a0fc5. Collision keys now lowercase before uppercase expansion, then lowercase and normalize again, so ß, ẞ and ss share a collision group. The regression includes all three siblings and uses an independent lowercase-based destination check. All four mapping tests pass; the storage branch also inherits the fix.

@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

  548 files  + 5    548 suites  +5   3m 48s ⏱️ -8s
2 459 tests +12  2 459 ✅ +12  0 💤 ±0  0 ❌ ±0 
3 169 runs  +20  3 169 ✅ +20  0 💤 ±0  0 ❌ ±0 

Results for commit a1a0fc5. ± Comparison against base commit 25b38e0.

♻️ This comment has been updated with latest results.

@linroid

linroid commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #233 (V2 layout and verified storage) in the consolidated eight-PR stack for #162.

The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks.

Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment)

@linroid linroid closed this Sep 20, 2026
@linroid
linroid deleted the torrent-v2-06-output-mapping branch September 20, 2026 11:12
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