next into master #9

Open
clawbot wants to merge 5 commits from next into master
pull from: next
Collaborator

On this branch:

  • the repo standards from #1: the Makefile and script/ entrypoints, linting and tests in Docker, the module path sneak.berlin/go/dcf, the renames to Store and Object, and the README's required sections.
  • the card detection fix from #6: a card is detected by DCIM or PRIVATE/M4ROOT.
  • the parser from #2: a card is read by the DCF naming rules, with directory and file numbers on the types and anything else under DCIM listed as not conforming.
  • file groups from #3: files in one DCF directory that share a file number form one FileGroup with a primary member.
  • the API you ruled on in #4: GetStores(ctx) gets the cards, and GetStore(ctx) returns the single card or an error.

To know before merging: the library has not been run against a real card, and its README says it does not work yet.

Waiting on you: renaming master to main needs admin rights (sneak/project-management#10). This PR's base moves when that happens.

Model: opus-5-5

On this branch: - the repo standards from https://git.eeqj.de/sneak/dcf/issues/1: the `Makefile` and `script/` entrypoints, linting and tests in Docker, the module path `sneak.berlin/go/dcf`, the renames to `Store` and `Object`, and the README's required sections. - the card detection fix from https://git.eeqj.de/sneak/dcf/issues/6: a card is detected by `DCIM` or `PRIVATE/M4ROOT`. - the parser from https://git.eeqj.de/sneak/dcf/issues/2: a card is read by the DCF naming rules, with directory and file numbers on the types and anything else under `DCIM` listed as not conforming. - file groups from https://git.eeqj.de/sneak/dcf/issues/3: files in one DCF directory that share a file number form one `FileGroup` with a primary member. - the API you ruled on in https://git.eeqj.de/sneak/dcf/issues/4: `GetStores(ctx)` gets the cards, and `GetStore(ctx)` returns the single card or an error. To know before merging: the library has not been run against a real card, and its README says it does not work yet. Waiting on you: renaming `master` to `main` needs admin rights (https://git.eeqj.de/sneak/project-management/issues/10). This PR's base moves when that happens. Model: opus-5-5
clawbot added 1 commit 2026-11-02 20:30:52 +01:00
Adopt the standard tooling from sneak/prompts: the Makefile and script/
entrypoints, lint and test stages in one Dockerfile, the lint config, the
CI workflow and the formatter settings. make fmt also formats Go, with a
pinned Go from script/bootstrap. The module path becomes
sneak.berlin/go/dcf.

Fix the lint findings in pkg/dcf. DCFStore becomes Store and DCFObject
becomes Object. Three behaviours change. An error listing mount points is
now returned, where a typo used to drop it. Store.String() prints Store{
instead of DCFStore{, and a negative total as 0 B instead of a huge size.

Replace the placeholder test with real tests. Move the README into the
required sections. make build compiles the library; it pointed at a
command that does not exist.

Model: opus-5-5
Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
clawbot added the merge-ready label 2026-11-02 20:32:43 +01:00
sneak was assigned by clawbot 2026-11-02 20:32:43 +01:00
clawbot added 1 commit 2026-11-02 21:01:30 +01:00
A card was detected only with M4ROOT at its root, and asking for two or
more stores returned one too few. A mount point now counts when its root
holds a DCIM or PRIVATE/M4ROOT directory, and the count is exact.

The check and the counting are split from the partition listing so tests
can hand them temporary directories.

Model: opus-5-5
Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
clawbot added 1 commit 2026-11-03 19:25:36 +01:00
A card is now read by the naming rules in CIPA DC-009-2010, not by
looking for media extensions anywhere on the volume.

Store.Directories holds the DCF directories and their objects, with
directory and file numbers. Store.NonConforming lists everything else
under DCIM, including symlinks and names fs.FS refuses. Media under
PRIVATE/M4ROOT stays, with no DCF numbers. Media anywhere else is no
longer part of the store. A symlink is never followed, and a read error
names the card's mount point.

Model: opus-5-5
Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
clawbot added 1 commit 2026-11-03 20:05:46 +01:00
Files in one DCF directory that share a file number are one file group,
as section 4.3.2.2 of the specification says. `Directory.FileGroups`
lists them, each with its numbers, its members and its primary member. A
lone file is a group of one. A group reports its member count and total
size.

Section 6.2.1.3 gives a DCF basic file priority over a DCF extended image
file. It says nothing about a DCF optional file, so ranking every `JPG`
first is a choice. A `THM` comes last.

`isImageFile` now accepts `.tif`, so a `TIF` counts as an image.
`Store.Images`, `Store.Videos` and the totals still count each file on
its own.

Model: opus-5-5
Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
clawbot added 1 commit 2026-11-03 20:54:21 +01:00
GetStores replaces GetDCFStores: it takes a context, has no count
argument and returns a plain slice. GetStore returns the one mounted
card, or ErrNoStore or ErrMultipleStores.

Each Object keeps the fs.FS its card was read through, and Hash reads
through it, so tests can use fstest.MapFS. A cancelled context stops
the read before the next directory. Library errors wrap with %w.

Model: opus-5-5
Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin next:next
git checkout next
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dcf#9