fix(editor): expose filesystem info for checkpoints - #47
Merged
Conversation
dsent
marked this pull request as ready for review
July 22, 2026 02:28
aldum
requested changes
Jul 22, 2026
Checkpoint timestamp lookup called FS.getInfo, but the adapter exposed only FS.exists, crashing the first checkpoint. Mirror getInfo across runtime and test backends, and route exists through it so metadata semantics stay centralized. Add a filesystem regression spec that verifies the metadata shape and type-filter behavior on the target branch. Refs: compy-editor-checkpoint-fs-getinfo-crash
dsent
force-pushed
the
agent/checkpoint-fs-getinfo
branch
from
July 23, 2026 22:52
2c125e1 to
38d7c75
Compare
Collaborator
Author
|
@aldum I must clarify that I encountered this bug using the branch with a heavily updated editor that we now use for lessons. Didn't realize this at the moment. Thus, the bug was caused by the code that we've just wrote and that is not yet merged. However, I explored the options and came to a conclusion that this is, in fact, not a bad solution. We save checkpoints and need to check the last modification time. The only way to do that without adding any new API seemed to read the current project object and iterate over all files until a matching one is found. This is quite ugly imo (and I'm not sure it gets regenerated often). link/symlink rename is removed as it defends against a situation that should not happen. Type annotations added. |
dsent
added a commit
to dsent/compy-ide
that referenced
this pull request
Jul 27, 2026
aldum
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
FS.getInfo(path, filtertype, vfs)through the runtime filesystem adapterFileInfoshape for LuaCATS-aware editor toolinglfs.attributesFS.existsthroughFS.getInfoWhy
The checkpoint timestamp lookup calls
FS.getInfo, but the adapter only exposedFS.exists. The missing method crashes the first checkpoint attempt. This isolates the adapter fix as one commit on top ofaldum/dev.API compatibility
The production
FS.existssignature was already(path, filtertype, vfs). This change adds the optionalfiltertypeargument only to the test backend, bringing it in line with production. Omitting the argument still passesniland checks for any filesystem entry, so existing one-argument calls keep the same behavior. Existing production callers use the filter to distinguish files from directories.FileInfo.typeis alove.FileType;sizeandmodtimeare optional because LÖVE may be unable to determine them. The test backend useslfs.attributes, which follows symbolic links, so it maps only LuaFileSystem'sfileanddirectorymodes directly and reports other modes as LÖVE'sother. It does not claimsymlinksemantics.Validation
tests/util/fs_spec.lua: 9 successes, 0 failures, 0 errorsluac5.1 -p src/util/filesystem.lua tests/util/fs_spec.luagit diff --check origin/dev...HEAD