diff --git a/AGENTS.md b/AGENTS.md index baa784e..da42fbf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,7 +58,7 @@ src/bd_archive/ │ ├── mount.py # plain mount/umount (no sudo) │ ├── udisks.py # is_available, mount/unmount, loop_setup/loop_delete │ ├── eject.py # eject + close_tray + drive_status (CDROM ioctl, CDS_* constants) -│ ├── mediainfo.py # detect_disc_capacity (parses all non-00h format-type descriptors, falls back to Track Size for rewritable media) +│ ├── mediainfo.py # detect_disc_capacity (Free Blocks for write-once, Track Size for rewritables; assumes growisofs spare=none — no format → no OSA) │ ├── optical.py # list_drives + resolve_device (sysfs sr* enum, interactive picker) │ └── lsof.py # find_device_holders (optional — no-op if lsof absent) ├── archive/ # domain logic over tools/ @@ -82,6 +82,8 @@ Layering: `commands/` → `archive/` → `tools/` → `shell/`. Lower layers nev Four subcommands form a pipeline. `create` previews disc count + last-disc fill before prompting for confirmation, so users can dry-run sizing without committing. +1. **`create`** (`commands/create.py`) reads disc capacity via `tools.mediainfo.detect_disc_capacity` (or `args.bytes`), scans the source, and computes slice sizing plus a disc-count estimate (optionally measuring the compression ratio via `--sample`). The user confirms via `prompt_yn` before any heavy work begins (skip with `-y`). Then runs `tools.dar.create_sliced` with `--hash sha512 --min-digits 4 -Q` (plus `-z[:level] -am` when compression is enabled) to slice the source into per-disc-sized `.dar` files in `/tmp/`. par2 is generated **inline** via dar's `-E` hook (`bd_archive._par2_helper`) — the hook fires after each slice is fully written, so par2 reads the slice while it is still hot in the OS page cache, eliminating most SSD read traffic of the create phase. After dar completes, the catalog is isolated. For each slice in order: regenerate `README.txt` with the right disc number and call `tools.mkisofs.build` (mkisofs `-iso-level 3 -udf -V