Skip to content

fix: files Baker describes in a directory manifest are reported untracked #48

Description

@VladSam42

🤖 claude-finalizer: file_coverage_in_manifest (biotope/metadata.py) compares a FileObject's contentUrl with the file's path relative to the project root. Baker writes contentUrl relative to the directory it scanned, while the FileObjects biotope add appends are project-relative. A file Baker describes is therefore not tracked unless a FileSet also covers it. is_file_tracked, find_owning_manifest, mv and rm all go through this function. Raised in the review of #46 (#46 (comment)).

Repro on main (2227394, 0.9.1), synthetic files:

mkdir -p repro/data/tables && cd repro && git init -q
printf 'id,value\n1,x\n2,y\n' > data/tables/measurements.csv
printf 'free text\n' > data/notes.txt
biotope init . --no-prompt
biotope add data
biotope mv data/tables/measurements.csv data/tables/renamed.csv

The manifest mixes both conventions:

cr:FileObject  file_0         tables/measurements.csv  (Baker, relative to data/)
cr:FileObject  file_b65c1c0d  data/notes.txt           (biotope, relative to the project)

is_file_tracked(<root>/data/tables/measurements.csv, <root>) is False and is_file_tracked(<root>/data/notes.txt, <root>) is True. biotope mv refuses the described CSV:

❌ File '…/data/tables/measurements.csv' is not tracked. Use 'biotope add' first.

The 0.10 branch (#46, e2b5e82) gives the same result.

Fix. Resolve contentUrl with resolve_content_url(content_url, manifest_dataset_dir, biotope_root), as biotope add does, and compare the resolved paths.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions