Skip to content

Slice mode is chosen on bytes but slices are capped on characters #368

Description

@TheAmericanMaker

What

Slice mode is chosen on byte sizes but slicing is capped on UTF-16 code units (mechanical 1.4): sumFileSizes sums stat().size and feeds resolveSliceMode (core/broadside/repo.ts:606), while slurpFileList compares running + block.length in characters (:568). For non-ASCII content the two disagree, so a repository can be sliced per directory when one slice would do, or the other way round.

Fix

Measure both on the same unit — read lengths in characters when choosing the mode (the files are read anyway), or cap slices in bytes.

Found by the 2026-09-15 self-audit (full-with-deep-audit on this repository at a159d6c, v0.25.0 + #353, ollama-cloud/deepseek-v4.1-flash); confirmed by reading before filing. Report and finding id in self-audit/2026-09-15-v0.25.0-full-with-deep-audit/REVIEW.md.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingself-auditFiled from a CodeCartographer self-audit run

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions