From 5459f42241c4a3e1eec04a1c0d33d1145374c2e8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 17:43:48 +0000 Subject: [PATCH 1/2] docs: qualify migration Store path fallback ADR 0013 said no line the command prints names the procfs descriptor. Error messages built from root-joined paths are translated back to the operator's target, but the `Store:` summary takes a separate route: it prints the canonicalised store path, and when canonicalisation fails its fallback returns `store_path(root)` unchanged, which can be `/proc/self/fd//lmdb`. State both outcomes. No runtime behaviour changes; the pin outlives every use of the root, so a normal run does not reach the fallback. Addresses cameri/nostream#1177 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XJGB15j7gmiM167Cjm4J79 (cherry picked from commit d8fed78c0091267c1b8048e23273dbe098f35ce9) --- .changeset/adr-0013-store-fallback.md | 9 +++++++++ docs/rewrite/decisions/0013-pg-to-lmdb-migration.md | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .changeset/adr-0013-store-fallback.md diff --git a/.changeset/adr-0013-store-fallback.md b/.changeset/adr-0013-store-fallback.md new file mode 100644 index 000000000..2f5c82863 --- /dev/null +++ b/.changeset/adr-0013-store-fallback.md @@ -0,0 +1,9 @@ +--- +--- + +docs: qualify the migration ADR's descriptor-output guarantee + +ADR 0013 said no printed line names the procfs descriptor. Error messages are +translated back to the operator's target, but the `Store:` summary takes a +separate route whose canonicalisation fallback returns `store_path(root)` +unchanged. The ADR now says so. No runtime behaviour changes. diff --git a/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md b/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md index f84821823..737f2493e 100644 --- a/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md +++ b/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md @@ -168,9 +168,14 @@ still resolves an absolute name, and a rename inside that pair still reaches the it needs an fd-relative environment open inside heed, which is a dependency change and not a change here. -No line the command prints names the descriptor: every message built from a root-joined path is -translated back to the target the operator typed, because `/proc/self/fd/` dies with the -process and is not a path anyone can act on. The cost of the pin, recorded rather than left to be +Every error message built from a root-joined path is translated back to the target the operator +typed, because `/proc/self/fd/` dies with the process and is not a path anyone can act on. The +`Store:` summary is not one of those messages: it takes a separate route, printing +`fs::canonicalize(store_path(root))` and falling back to `store_path(root)` unchanged when +canonicalisation fails. Where `root` is the procfs spelling and the canonicalisation fails, the +line can therefore print `/proc/self/fd//lmdb`. That needs the pin to be gone while the summary +is written. The pin outlives every use of the root, so a normal run does not reach the fallback. +The cost of the pin, recorded rather than left to be discovered: `--verify` now opens the target directory itself, so it needs **read** permission on the target where the path-only version needed search alone, and a `0300` target is refused by the pin with the target's own path in the line. That is accepted and not mitigated — the target is a From 7cf2b3692d03168edee1bba03f83aff48a807580 Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Thu, 3 Dec 2026 08:16:19 -0500 Subject: [PATCH 2/2] docs: the Store fallback's condition is a failed canonicalisation, not a closed pin Greptile P2 on #1359: the pin holds the target directory, not its lmdb child, so a child renamed after the last manifest write makes canonicalisation fail while the pin is still open. The paragraph now names canonicalisation failure as the condition and keeps the closed pin as one of two ways to reach it. --- docs/rewrite/decisions/0013-pg-to-lmdb-migration.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md b/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md index 737f2493e..2cd6495eb 100644 --- a/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md +++ b/docs/rewrite/decisions/0013-pg-to-lmdb-migration.md @@ -173,8 +173,13 @@ typed, because `/proc/self/fd/` dies with the process and is not a path anyon `Store:` summary is not one of those messages: it takes a separate route, printing `fs::canonicalize(store_path(root))` and falling back to `store_path(root)` unchanged when canonicalisation fails. Where `root` is the procfs spelling and the canonicalisation fails, the -line can therefore print `/proc/self/fd//lmdb`. That needs the pin to be gone while the summary -is written. The pin outlives every use of the root, so a normal run does not reach the fallback. +line can therefore print `/proc/self/fd//lmdb`. A pin that is gone is one way to fail, since the +descriptor dies with it. Another is an `lmdb` child renamed after the last manifest write: the pin +holds the target directory, not the store under it, so canonicalising the child can fail while the +pin is open. Neither is a normal run's shape — the pin outlives every use of the root, and the copy +is the only writer while it holds the target — and both need an actor who can write the target, +which is the interval the pin narrows rather than closes. + The cost of the pin, recorded rather than left to be discovered: `--verify` now opens the target directory itself, so it needs **read** permission on the target where the path-only version needed search alone, and a `0300` target is refused by the