Skip to content

docs(tasks): file an unreadable file committing a partial version - #9

Merged
adammharris merged 1 commit into
mainfrom
agent/backlog-file-an-unreadable-file-commits-a-partial-version
Nov 6, 2026
Merged

adammharris merged 1 commit into
mainfrom
agent/backlog-file-an-unreadable-file-commits-a-partial-version

Conversation

@adammharris

Copy link
Copy Markdown
Member

What changed

Files one task, docs/tasks/an-unreadable-file-commits-a-partial-version.md, and lists it in docs/tasks/tasks.md. No code changes.

Why

commit in mocfl-cli/src/main.rs reads the tree through map_while, so the first file it can't read ends the iterator. Object::commit still runs and takes the shorter list as the version's complete state. The command then exits 1, but a new version has already landed without that file or anything sorted after it.

$ chmod 000 w/b.txt
$ mocfl commit o --from w -m v2 --user u      # exit 1
mocfl: could not read w/b.txt: Permission denied (os error 13)
$ mocfl ls o
a.txt
$ mocfl validate o --deep                     # exit 0
valid	urn:x	2 version(s), content verified

The earlier bytes are still in v1, so nothing is destroyed, but the head is wrong and the error doesn't say so. Retrying lands another version. If the unreadable file sorts first, the head ends up empty without --allow-empty. A first commit leaves a partial object.

How it was verified

Reproduced on origin/main at 03ff530 with a debug build of mocfl-cli, running as a non-root user. That covered each case in the task: the repro above, the retry, the first-sorted file and the first commit. prov check reports only the about.md finding that main already has. This is a documents-only change, so no build gate applies.

The fix branch is left free as agent/backlog-an-unreadable-file-commits-a-partial-version.

@adammharris
adammharris merged commit 98827d6 into main Nov 6, 2026
3 checks passed
@adammharris
adammharris deleted the agent/backlog-file-an-unreadable-file-commits-a-partial-version branch November 6, 2026 15:45
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