Skip to content

Commit 87bdd22

Browse files
shengyfuCopilot
andcommitted
Bound initial managed attachment retries
Keep new attempts limited to authoritative uncommitted catalog contention, preserve absent or pending initial intent and immutable receipts, and continue from the actual consumed sequence. Cover pre-lease transaction failure, persisted-lease resumption, bounded exhaustion, and actual dropped-response replay without altering shipping retry behavior. Co-authored-by: Copilot App <[email protected]>
1 parent 1ce701f commit 87bdd22

5 files changed

Lines changed: 470 additions & 66 deletions

File tree

‎SHARED_WORKTREE_INDEXES.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,16 @@ For example, native catalog writer contention can return `busy`/`catalog-io`
10501050
without committing a view. Committed or unknown outcomes require recovery, not
10511051
retry-as-new. Bound both attempts and total waiting time.
10521052

1053+
For an initial attachment there may be no committed pin yet. Use the catalog
1054+
`lookup` and `views.recover` results to distinguish an absent root from a saved
1055+
pending exact intent; neither a failed receipt nor an absent root proves that
1056+
all preparation state was rolled back. Retain the owner and lease identity,
1057+
check any saved pending view/version/target, and retry only an already captured
1058+
exact commit, not a freshly resolved symbolic name. An acceptance or completion
1059+
whose response was lost still requires the original operation token, even if
1060+
the view is now published. Reserve a fresh sequence for each authorized new
1061+
attempt and start subsequent operations after the last sequence consumed.
1062+
10531063
Ownership is bound to an issued namespace/instance challenge and the identity
10541064
of an OS-locked guard. Death is positively proved only by acquiring that same
10551065
guard. Missing/replaced/inaccessible files, PID reuse, disconnected clients and

‎tgrep-cli/tests/shared_daemon.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,19 @@ impl Daemon {
274274
result
275275
}
276276

277-
fn attach_without_response(&self, params: Value) {
277+
fn without_response(&self, method: &str, params: Value) {
278278
let mut stream =
279279
TcpStream::connect(("127.0.0.1", self.marker["port"].as_u64().unwrap() as u16))
280280
.unwrap();
281281
stream
282282
.set_write_timeout(Some(Duration::from_secs(5)))
283283
.unwrap();
284-
writeln!(stream, "{}", self.request("attach", params.clone())).unwrap();
284+
writeln!(stream, "{}", self.request(method, params)).unwrap();
285285
drop(stream);
286+
}
287+
288+
fn attach_without_response(&self, params: Value) {
289+
self.without_response("attach", params.clone());
286290
let started = Instant::now();
287291
loop {
288292
let response = self

0 commit comments

Comments
 (0)