diff --git a/CHANGES.md b/CHANGES.md index 66ec2b5..d277427 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -59,7 +59,7 @@ concern - readable here, never shipped as something to parse. --- -## 8.0.0-beta.41 - 2026-10-05 - raw capture / raw status / --replaces-bundle: documentation from git repositories as a bundle, with drift reporting +## 8.0.0-beta.42 - 2026-10-05 - raw accept: an occupied folder name held by a captured bundle points at --replaces-bundle **Author:** Torben Nehmer @@ -152,8 +152,18 @@ concern - readable here, never shipped as something to parse. - kb/CONTRACT.md names section anchors in wikilinks and the Broken Anchors finding - kb/CONTRACT.md names unwritten scaffold sections and the Unfilled Template Sections finding - wiki-ingest and wiki-manage call xref add with --rel, not the --rel-a/--rel-b removed in 4.0.0 +- raw accept: an occupied folder name held by a captured bundle points at --replaces-bundle +### raw accept: an occupied folder name held by a captured bundle points at --replaces-bundle + +The ON FAILURE reaction `raw accept incoming/` prints for an occupied name still said +"rename the folder - there is no `--replaces` for a folder". For the new edition of a captured +bundle that is the wrong route: renaming makes it a second, separate source. The reaction now +names `--replaces-bundle` for a name held by a captured bundle and keeps renaming for every other +folder. `raw/CONTRACT.md` ยง "Getting a file in" says the same about the capture fields of a +captured folder: they come from its manifest, not from one flag pair (Gitea #177). + ### raw capture / raw status / --replaces-bundle: documentation from git repositories as a bundle, with drift reporting Documentation from a git repository used to reach an instance only by hand: copy the files into diff --git a/VERSION b/VERSION index 3300041..17e8140 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.0.0-beta.41 +8.0.0-beta.42 diff --git a/raw/CONTRACT.md b/raw/CONTRACT.md index d7c8081..b4ff13e 100644 --- a/raw/CONTRACT.md +++ b/raw/CONTRACT.md @@ -85,7 +85,9 @@ tools/wikitool raw accept --fidelity verbatim --authority reporting incoming/pro The folder name is the bundle name, so the name rule below applies to it and not to the files inside: two `README.md` in different subfolders are no conflict. A folder is accepted alone, with -one `--fidelity`/`--authority` pair for all of it, and `incoming/projekt-x` is gone afterwards. +one `--fidelity`/`--authority` pair for all of it - a folder `raw capture` wrote takes the pair +from its manifest instead ([below](#getting-a-repository-in-raw-capture)) - and +`incoming/projekt-x` is gone afterwards. Every check runs before anything moves: an empty folder is refused, and so is one with a hidden entry (a name starting with `.`), a symlink or a special file anywhere below it - each is named. That is what keeps the clean-up safe: only directories the moves emptied are removed, so no file diff --git a/tools/CONTRACT.md b/tools/CONTRACT.md index d86ace7..bfbac5c 100644 --- a/tools/CONTRACT.md +++ b/tools/CONTRACT.md @@ -1656,7 +1656,7 @@ Promote one or more files, or one folder, from `incoming/` into `raw/`. **ON FAILURE** - raw accept: A file does not exist or is not directly in `incoming/`; two files in one call share a filename; a target path already exists; or a target path would be over the path budget (160 UTF-16 code units below the instance root) -> Fix the named argument and retry once. A file inside a subdirectory of `incoming/` is accepted with its whole folder (`raw accept incoming/`) or moved up into `incoming/` first. For a path over the budget, rename the file in `incoming/` to something shorter - the refusal comes before anything moves, so `incoming/` and `raw/` are unchanged -- raw accept incoming/: The folder is not directly in `incoming/`, is combined with another argument, `--page` or `--replaces`, holds no file, or holds a hidden entry, a symlink or a special file; a target path is over the budget; or the folder name is already occupied under `raw/` -> Nothing moved. Fix what the message names and retry once; for an occupied name, rename the folder in `incoming/` - there is no `--replaces` for a folder +- raw accept incoming/: The folder is not directly in `incoming/`, is combined with another argument, `--page` or `--replaces`, holds no file, or holds a hidden entry, a symlink or a special file; a target path is over the budget; or the folder name is already occupied under `raw/` -> Nothing moved. Fix what the message names and retry once. For an occupied name held by a captured bundle, the folder is its new edition: `raw accept incoming/ --replaces-bundle `. Any other occupied name: rename the folder in `incoming/` - such a folder has no replacement form - raw accept: `--fidelity`/`--authority` is missing, or names `unknown` or a value outside the schema's enum -> Pass both with a valid value, then retry once - raw accept: The target name is already occupied anywhere under `raw/` by something the call does not own -> Not fixed by retrying: the refusal names `--replaces` (same source, new edition) and renaming in `incoming/` (a separate source) as the two routes, and neither is the tool's to pick. Show the message to the user and wait - raw accept: `--page` names an unknown page or one with no `raw_files:` yet, an existing `raw_files:` entry is missing on disk, a file to be moved has more than one owning page, or `--page` would overwrite an already-set `fidelity`/`authority` with a different value -> Fix the named argument and retry once; a different capture value on an existing page is a new edition - `--replaces` diff --git a/tools/chemenu/commands/raw_cmd.py b/tools/chemenu/commands/raw_cmd.py index 106ff50..9c32ebd 100644 --- a/tools/chemenu/commands/raw_cmd.py +++ b/tools/chemenu/commands/raw_cmd.py @@ -1056,8 +1056,10 @@ def _replace_bundle( "`--page` or `--replaces`, holds no file, or holds a hidden entry, a symlink or a " "special file; a target path is over the budget; or the folder name is already " "occupied under `raw/`", - reaction="Nothing moved. Fix what the message names and retry once; for an occupied " - "name, rename the folder in `incoming/` - there is no `--replaces` for a folder", + reaction="Nothing moved. Fix what the message names and retry once. For an occupied " + "name held by a captured bundle, the folder is its new edition: `raw accept " + "incoming/ --replaces-bundle `. Any other occupied name: rename " + "the folder in `incoming/` - such a folder has no replacement form", ), cli_contract.Failure( label="raw accept",