Skip to content

docs(tasks): file commit accepting logical paths that conflict - #4

Merged
adammharris merged 1 commit into
mainfrom
agent/backlog-commit-accepts-conflicting-logical-paths
Oct 28, 2026
Merged

adammharris merged 1 commit into
mainfrom
agent/backlog-commit-accepts-conflicting-logical-paths

Conversation

@adammharris

Copy link
Copy Markdown
Member

Files a new task, docs/tasks/commit-accepts-conflicting-logical-paths.md, and lists it in docs/tasks/tasks.md. No code changes.

The defect

Object::commit checks each logical path on its own and never checks them against each other. OCFL 1.1 forbids a version whose logical paths repeat, or where one is a prefix of another (E095). The same rule applies to content paths (E101). Each of three cases gets through:

  • One path twice, with different bytes: the commit returns Ok. Both digests map to v1/content/a, and the second write replaces the first. validate reports nothing. validate_deep reports ContentDigestMismatch.
  • a and a/b in one commit: the commit fails with Io(AlreadyExists) after v1/content/a is already on disk. This contradicts commit's own "fails before it has written half a version".
  • a in v1, then a (same bytes) plus a/b in v2: the commit returns Ok, and validate reports nothing. The resulting state is forbidden by E095, and no filesystem can hold it.

The CLI cannot reach any of these, because a directory walk yields each path once. A library caller passing its own list can.

How it was found and checked

I found this by reading commit against the spec, then reproduced each case with a throwaway integration test against main (e97e69f). The task records the observed results. I checked the E095 and E101 wording against https://ocfl.io/1.1/spec/validation-codes.html. On main, cargo clippy --all-targets -- -D warnings and cargo test are green. prov check reports the same single pre-existing finding (about.md: not written) with and without this change.

@adammharris
adammharris merged commit 7b95de3 into main Oct 28, 2026
2 of 3 checks passed
@adammharris
adammharris deleted the agent/backlog-commit-accepts-conflicting-logical-paths branch October 30, 2026 01:26
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