Repository navigation
capture: unnamed scope ships owner-only to the default (not held); --reevaluate-held - #330
Conversation
…--reevaluate-held Operator decision 2026-12-03 (changes plan decision 16): a scope the routing table does not name at all is treated like `*` on a multi-instance host — the session ships to the DEFAULT instance owner-only (`*` declared, new cause OwnerOnlyUnnamedScope) instead of being HELD. Holding was final and withdrew an already-shipped prefix, while scopeuse reads header-shaped text anywhere in a transcript as a read, so fixture names in test output froze and withdrew whole sessions (measured: 15 such holds on one host, 14 on fixture names). The only routing hold left is a scope the table EXPLICITLY routes to an instance this host does not configure; its held_reason now says exactly that. `cairn-capture --reevaluate-held [-apply]` recovers the holds the old rule made: it selects legacy "scope X routes to no configured instance" holds, re-decides each over V, and (given -host/-worker/-capture-token-file) probes the destination. -apply refuses to run without probes, clears only holds the destination answered with a position (re-checked at the write), and reports a 410 as needs-server-restore, leaving it held so the next pass neither re-holds nor loops on it. "routed back to …, which deleted" holds are excluded by name. Red/green: the routing tests fail at origin/main 7dc510c (held / withdrawn) and pass here; route.go mutants (main's condition restored, the condition widened, the explicit hold removed, the unnamed owner-only case dropped) each fail named tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…cident) leakscan refused route.go's '2026-12-03' as a dated incident stamp; the operator decision is now cited by its PR (#330) in code. The plan, README and CHANGELOG keep the date, which leakscan does not flag there. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Audit round 0: requirements and deletion pass for #330 (head
|
| # | requirement | author |
|---|---|---|
| R1 | On a multi-instance host, a scope the routing table does not name goes to the default instance owner-only, like *. It is no longer held, and a default-bound session is no longer withdrawn for it. |
Zach: operator decision 2026-12-03, which amends plan decision 16 |
| R2 | A scope the table explicitly routes to an alias this host does not configure stays held. | Zach: keep the hold only for that case |
| R2b | That hold's held_reason gets new wording. |
UNATTRIBUTED-UNKNOWN (agent-derived; needed so the legacy text can be selected) |
| R3 | A one-off --reevaluate-held mode, read-only by default, prints the list. -apply runs only with probes. |
Zach: re-evaluate the existing holds once, and show the operator the list before any live apply |
| R4 | A 410 answer is reported needs-server-restore and left held, never cleared. |
Zach: withdrawn sessions are restored server-side |
| R5 | The routed back to …, which deleted … holds are excluded by name. |
Zach: those stay frozen |
| R6 | The bytes column (claudeBytes) |
UNATTRIBUTED-UNKNOWN (a support for reviewing the list) |
R1, questioned as Zach's. The rule places {civitai-routed scope, unnamed scope} on the default instance owner-only. That is the same answer {civitai-routed scope, *} and a cross-instance session already get, so it applies the existing accepted trade-off. It does not create a new one.
I ran a read-only dry run of --reevaluate-held on a copy of one host's state, with no probes. The copy's checksum was unchanged afterwards. 8 of the 15 recoverable holds have scopes that route to both personal and civitai. Applying would put content those sessions read from civitai onto personal, owner-only. That is the decision behind the list review Zach asked for, so it is not a new premise. It should be read on the list before -apply.
R4. The PR lists what needs a server restore. It does not do the restore. The restore follows the existing README section, so the second half of the operator's ask is a manual follow-up.
Delete
Examined: route.go (the hold branch and the new owner-only cause), reevaluate.go, the new CLI mode and flag, the README, plan and CHANGELOG rows, and both test files.
--reevaluate-heldis a one-off by design, and it is running: built from this head and run read-only on a state copy, it selected 15 holds and excluded 5. After the apply it has nothing to select. Removing it is a candidate once its job is done.- Closing condition: the read-only listing shows
held=with nounprobed,shiporprobe-failedrows on every host that has a capture state.
- Closing condition: the read-only listing shows
- Nothing else qualifies. Every other behaviour answers one of the operator decisions above.
Simplify: no candidate. The operator may run /simplify afterwards; I did not.
D1 — remove `--reevaluate-held` (reevaluate.go, the -apply flag, its tests) once the one-off recovery has run on every host with a capture state (closing check: the read-only listing has no unprobed/ship/probe-failed rows)
Audit round 1: full adversarial audit of #330 (head
|
…n that path Round 1 of #330's audit (0 red): the docs said an already-shipped session is no longer withdrawn for an unnamed scope, which holds only for a session bound to the DEFAULT instance. One bound to another instance moves as a `*` session does: withdrawn from there, rebound to the default, re-shipped whole from offset 0, owner-only (at main it was withdrawn and HELD). CHANGELOG and README now say so, and TestAClientBoundSessionThatReadsAnUnnamedScopeMovesOwnerOnlyToTheDefault pins the withdrawal from client and the owner-only rebinding on personal (mutants: main's hold condition, and the unnamed owner-only case dropped, each fail it). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
What
Operator decision 2026-12-03 (it changes plan decision 16): on a host with more than one instance, a scope the routing table does not name at all is now treated like
*. The session ships to the default instance, owner-only (*declared, new causeOwnerOnlyUnnamedScope) and is no longer held. A session already bound to the default instance that picks up such a scope is no longer withdrawn. One bound to another instance (e.g. client) moves the way a*session does: it is withdrawn from that instance, rebound to the default, and its whole transcript re-shipped there owner-only. At main, it was withdrawn and then held.TestAClientBoundSessionThatReadsAnUnnamedScopeMovesOwnerOnlyToTheDefaultpins this path.held_reasonnow says exactly that:scope X is routed by the table to instance Y, which this host does not configure.cairn-capture --reevaluate-held [-apply], a one-off way to recover the holds the old rule made (details below).route.gocomments,internal/capture/README.md(step 3, plus a new section on--reevaluate-held), plan decision 16 (note with the date and reason) and CHANGELOG.Why
scopeusetreats header-shaped text anywhere in a transcript as a scope read: grep or test output, a source read, assistant prose. Because a hold was final and withdrew any prefix already shipped, one fixture name in a tool result froze a whole session. On one two-instance host this held 15 sessions: 14 on fixture names (alpha-notes,a,b,checkout-service) and 1 on a real scope that was registered later. One live session was withdrawn frompersonal.--reevaluate-heldscope X routes to no configured instance.Vwith the currentDecide.-host/-worker/-capture-token-file, it sends the destination the position probe, which stores nothing.Possible outcomes:
ship/unprobed/needs-server-restore/probe-failed/still-held/excluded.-applyrefuses to run without probes. All the target holds are legacy (history_keptfalse), so the local state can't prove they were never withdrawn.-applyclears onlyshipholds, and re-checks each one at the moment it writes.needs-server-restoreand left held, with its original reason. The next pass neither re-holds it nor loops on it.routed back to …, which deleted this session's transcriptholds are excluded by name.Tests
internal/capture/unnamed_test.goandcmd/cairn-capture/reeval_test.go. The CLI tests run against real in-process worker pods, including a real withdrawal followed by a 410 probe.origin/main7dc510c and green here:*cases and "explicitly unconfigured → still held" are invariant guards: they were green before and are still green.route.goeach fail named tests:multi || namedshipholdsOverlap
The change stays in
internal/capture,cmd/cairn-captureand docs. It doesn't touchcmd/cairnlog(feat/log-repo-scope) orcmd/cairn-ui/internal/pgstore(#328). CHANGELOG gets one new top row and may conflict textually with other PRs that add rows.🤖 Generated with Claude Code