Skip to content

Relative-path resolution and read-range parity #76

Description

@valentina2509

Relative-path resolution and read-range parity

This is a tracking issue for defects caused by divergent code paths that
handle a secondary parameter (path anchor, range restriction) inconsistently
across branches.

Child issues

Issue Locus Status
#64 — Relative paths broken in file_info / repository_dump lore-revision/src/util/path.rs:19–34 (make_absolute) No PR
#25read_into returns internal error on sub-range request lore-storage/src/read.rs:548–569 (both branches) PR #37 open

Shared pattern

In both cases the code has two or more parallel branches that are intended to
be equivalent, but one (or more) branches omit a parameter transformation that
the reference branch performs correctly.

read_into (lore-storage/src/read.rs:548–569):
The fragmented branch handles the read range correctly. The compressed branch
(lines 548–559) decompresses the full buffer without applying the range slice
before the length check and copy. The uncompressed branch (lines 560–569)
compares slice.len() against buffer.len() instead of range.len(). Any
sub-range request on either non-fragmented path returns StorageError::internal
or copies incorrect data. PR #37 fixes both branches.

make_absolute / new_from_user_path (lore-revision/src/util/path.rs):
make_absolute (line 26) calls std::env::current_dir() instead of an
explicit repo root, so relative paths resolve correctly only when the process
CWD happens to match the repository root. new_from_user_path (lines 644–687)
shares the same anchor via std::path::absolute(). This gives the bug wide
blast radius across callers in file_info, repository_dump, and similar
entry points.

Fix directions

Background

Identified in the open-bug theme analysis (triage/2026-06-bug-theme-analysis.md,
branch valentina2509:docs/bug-theme-analysis).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions