Skip to content

fix(telegram): make delete settlement transactional and overflow-safe - #3618

Closed
twoimo wants to merge 3 commits into
Yeachan-Heo:devfrom
twoimo:fix/telegram-settle-transactional-v2
Closed

fix(telegram): make delete settlement transactional and overflow-safe#3618
twoimo wants to merge 3 commits into
Yeachan-Heo:devfrom
twoimo:fix/telegram-settle-transactional-v2

Conversation

@twoimo

@twoimo twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Successor to #3617. Thank you for the four-finding review — each one is repaired below, with an isolated-revert proof per finding.

Base: current dev 7f5167c86.

P1-1 — epoch overflow

All advancement now routes through a saturating helper (current >= Number.MAX_SAFE_INTEGER ? MAX_SAFE_INTEGER : current + 1), wired into beginDelete, delete, and both restore paths. settleDelete rejects non-safe-integer and negative dispatched epochs, and refuses settlement outright once a session's epoch has saturated — past that bound two distinct generations collapse onto the same double, so the comparison is no longer sound and the fence is retained instead.

P1-2 — rollback must CAS, and a refused settlement must not restore

settleDelete now returns TopicSettledDelete | undefined instead of a boolean. A refused settlement returns no token, so it is structurally incapable of reaching a rollback — enforced by the type, not a runtime guard. rollbackSettledDelete(settled) applies only while the post-settlement state is still exactly current: the settlement is still pending in #settling with matching topicId and epoch, the session still has no record, and the current authority epoch still equals the settled epoch. Any mismatch refuses and leaves the newer state untouched. Rollback restores at the settled epoch exactly rather than bumping, since a CAS that asserts nothing moved must not itself move.

P1-3 — routes published before the clear is durable

Two-phase commit. Phase 1 removes the record, records the pending settlement, and retains the topic-id quarantine; rebuildInboundRoutes() re-quarantines every pending settlement, so the quarantine survives any rebuild triggered during the held write. Phase 2 (commitSettledDelete) is the only place the quarantine is released and colliding survivors become routable. All four call sites capture the token, persist, then commit on success or roll back on failure.

P1-4 — first compensation marked complete before clear persistence

acceptedTopicCompensated = true moved from before the persist into the post-persist success branch, immediately after the phase-2 commit. That flag is what tells outer recovery to stop supervising, so a failed clear persist now leaves the fence supervised instead of stranding cleared memory against a delete_pending disk state. The persist is wrapped locally so a persist failure does not mask the in-flight revocation error the outer catch depends on.

Verification

Each finding was proven by reverting only that fix with the other three in place:

Finding Failing test on revert Observed
P1-1 authority epochs saturate at the safe-integer bound… Expected: 9007199254740991 / Received: 9007199254740992
P1-2 a rollback refuses any settlement whose post-settlement state no longer holds Expected: false / Received: true
P1-3 a settled delete keeps its topic id quarantined until the clear is durable Expected: false / Received: true

All 7 tests in the file fail on unmodified dev and pass with the fix. Wider run: notifications-topic-settle-fence-epoch + notifications-topic-registry + notifications-telegram-daemon572 pass / 0 fail. Generation guard, tsc --noEmit, and biome all exit 0; no generation bump is demanded because no protected declaration changed.

One honest gap

P1-4's fix is applied, but I could not build a regression for it. The hazard is an ordering constraint over a function-local let inside the daemon's create callback, observable only through whether two later daemon-internal recovery blocks supervise the fence — it produces no distinguishable TopicRegistry state. I verified this empirically: reverting the P1-4 fix with the other three in place leaves all 60 tests green. Covering it needs a daemon-level harness. I'd rather state that plainly than claim coverage I don't have.

No file owned by #3596 is touched (telegram-daemon-contract.ts, the generation manifest, file-lock.ts, path_identity.rs all unmodified).

@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch from 619852f to 29bea8e Compare July 31, 2026 03:11
@Yeachan-Heo

Copy link
Copy Markdown
Owner

Exact-head CI attribution at 29bea8e694cd3802959b14a03ffb88fe082c2098:

The failing shard is not currently attributed to this PR's Telegram settlement diff. The same newly merged base dev@b1876e593d8b0b684ed7d1d9f1154bcf872dcf4f is independently red in coding-agent shards 3/7/8. The PR run's four failures are SDK machine-lifecycle retained-authority deletes returning cleanup_pending (Exact transcript deletion rejected: cleanup_pending) in MCP/daemon/shared-agent topology tests.

The existing internal session-cleanup owner is repairing that exact base regression. This external branch remains untouched and review-held until repaired dev is green and this exact PR ancestry is refreshed and retested. This is not a merge-ready or request-changes verdict on the Telegram patch.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Note on the three Affected path validation failures

These failures are not caused by this pull request. They come from
packages/coding-agent/test/sdk-machine-lifecycle-topology.test.ts, which this
PR does not touch — the diff here is limited to telegram-daemon.ts, its own
test file, and a CHANGELOG line.

I verified this rather than assuming it. In the same worktree, at this PR's exact
head, I reverted the entire diff back to dev and re-ran the failing file:

# with this PR's diff applied
sdk-machine-lifecycle-topology.test.ts -> 3 pass / 4 fail

# with this PR's diff fully reverted to dev (byte-identical to dev for all 3 files)
sdk-machine-lifecycle-topology.test.ts -> 3 pass / 4 fail   <-- identical

The four failing cases are the same in both runs:

  • shipped mcp-serve sdk stdio drives authenticated G03-G07 lifecycle topology with durable effects
  • shipped daemon session CLI drives authenticated G03-G07 lifecycle topology with durable effects
  • shared-agent distinct saved-source IDs remain isolated across inverted MCP and daemon concurrency
  • shared-agent equal saved IDs select one owner without cross-workspace effects in either adapter direction

All four fail on the same assertion shape:

expect(received).toMatchObject(expected)
-   "ok": true,
+   "error": { "code": "cleanup_pending",
+              "message": "Saved session cleanup is pending in transcript:
+                          Exact transcript deletion rejected: cleanup_pending" },

The current dev tip is b1876e593fix(acp): keep retained artifact deletion pending (#3569). That change makes session.delete report cleanup_pending
when retained artifacts are still present, and it updated
acp-session-delete-wire.test.ts, sdk-broker.test.ts,
sdk-broker-lifecycle-e2e.test.ts and others — but
sdk-machine-lifecycle-topology.test.ts still asserts the pre-change
ok: true contract via its expectRetainedAuthorityDeleteSucceeded helper. The
dev tip's own commit status is also red for this workflow, so this is
reproducible independently of any pull request.

This PR's own suites are green at this head, on this base:

  • its own regression file: 9 pass / 0 fail
  • the telegram/notification sweep it belongs to: 528 pass / 0 fail
  • bun scripts/telegram-daemon-generation-guard.ts --validate-current-tree: exit 0
  • tsc -p packages/coding-agent/tsconfig.json --noEmit: exit 0
  • biome: exit 0

I have deliberately not touched sdk-machine-lifecycle-topology.test.ts here, so
that this PR stays a single-concern change. Happy to send the dev repair as its
own separate pull request if that would be useful — please let me know which you
would prefer.

@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch from 29bea8e to 504fee8 Compare July 31, 2026 03:58
@Yeachan-Heo

Copy link
Copy Markdown
Owner

CI merge hold — inherited current-dev deletion regression.

The four PR shard failures are byte-for-byte the same retained-authority deletion family already present on the exact base:

  1. shipped MCP G03-G07 lifecycle topology
  2. shipped daemon G03-G07 lifecycle topology
  3. shared-agent distinct saved-source IDs
  4. shared-agent equal saved IDs owner selection

Each receives cleanup_pending / Exact transcript deletion rejected: cleanup_pending where proven exact retained-authority cleanup should complete. The PR's focused Telegram settlement test is not the failing surface. This is inherited red owned by the sole #3596/#3538 product repair lane, not contributor mutation authority.

No REQUEST_CHANGES disposition is made solely from inherited red. Merge is held until repaired current dev is green, this head is refreshed/retested on that dev, exact CI is terminal green, and a fresh hostile exact-head review returns P0/P1=0. The failed workflow was not rerun or cancelled.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on my note above: I have opened #3628 with a fix for these three failures.

To restate the attribution briefly — the failing shard is sdk-machine-lifecycle-topology.test.ts, which asserts session.delete returns ok: true. #3569 deliberately changed that to fail closed with cleanup_pending and updated its own acp-session-delete-wire.test.ts, but this test file was not migrated. I confirmed the attribution by reverting my entire diff to dev in the same worktree and re-running: the identical 4 failures reproduce with none of my changes present.

This PR touches only telegram files and cannot influence that test. #3628 is test-only and based on the current dev tip.

@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch from 504fee8 to 9044575 Compare July 31, 2026 04:32
@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Correction / follow-up on the three Affected path validation failures noted above.

I had opened #3628 as a fixture-side adjustment to those failures. The maintainer reviewed it and correctly rejected that approach: encoding permanent cleanup_pending in the topology fixture asserts a false platform invariant and would have masked a genuine product regression instead of surfacing it. The proper repair is product-side and belongs to #3596's lane (keep fail-pending when deletion cannot be proven; return success when exact descriptor-bound single-link cleanup is durably proven). #3628 is closed and I will not re-land a fixture-side variant.

So the status of those three failures on this PR is unchanged and, I believe, still independent of this diff:

  • They reproduce at plain dev with this PR's entire diff reverted.
  • This diff touches no session, ACP, broker, or machine-lifecycle file.
  • The cleanup_pending value originates in packages/coding-agent/src/sdk/broker/lifecycle.ts, which this PR does not modify.

This PR's own gates remain green at the current head: its regression file passes, the telegram/topic sweep passes, the daemon generation guard exits 0, tsc --noEmit exits 0, and biome is clean. I have rebased onto the current dev tip so the review is against an exact head.

Happy to adjust anything on my side — just flagging that I no longer believe there is a contributor-side action available for those three checks, and I did not want to leave my earlier offer of a fix standing after it was correctly rejected.

@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Small CI status note, so the red checks on this PR are not mistaken for defects in the diff. Both failures reproduce on an unmodified dev tree and neither is reachable from the files this PR touches.

1. Local public surfaces — stale generated docs index (new since 7874b42ef)

- packages/coding-agent/src/internal-urls/docs-index.generated.ts:
  Generated docs index is stale. Run bun run generate-docs-index.

7874b42ef (feat(models): add LunaMaxxing Codex profile) edited docs/models.md without regenerating the embedded index, so the committed index no longer matches the committed docs. The stale entry is the models.md key. Checked out at the dev tip with a completely clean tree, bun run check:public-sync exits 1; running bun --cwd=packages/coding-agent run generate-docs-index produces a 1-line diff and it exits 0 again. The same staleness also fails test/docs-index-lazy.test.ts (4 pass / 1 fail) on plain dev.

I have deliberately not sent a regeneration PR: #3622, #3483 and #3608 already carry that exact regeneration, so a fourth one would be redundant.

2. test:@gajae-code/coding-agent:shard-1-of-8 — the cleanup_pending topology regression

Still the same dev-side item I described earlier. Thank you for the clear verdict on #3628 — you were right that the repair belongs on the product side and that pinning the fixture to permanent cleanup_pending would have masked the regression #3596 is fixing. I have closed that attempt and will not re-send a test-side variant.

The dev tip's own check-runs are red independently of this PR (7 failures at 7874b42ef, including Local public surfaces, docs-index-lazy, and shards 1/3/7/8).

This PR's own verification, re-run at the current base after rebasing onto 7874b42ef:

  • own regression file: green, and still proven fail-without-fix (source reverted to dev with the test kept → the regression fails; restored → green)
  • full notifications-telegram-daemon* + notifications-topic-* sweep: 565 pass / 0 fail
  • bun scripts/telegram-daemon-generation-guard.ts --validate-current-tree: exit 0
  • tsc -p packages/coding-agent/tsconfig.json --noEmit: exit 0
  • bun x @biomejs/biome check on the changed files: clean
  • no file owned by fix(session): complete descriptor-bound cleanup and live migration leases #3596 is touched, and DAEMON_GENERATION is unchanged

Happy to rebase again whenever dev moves. Thanks for taking the time to review.

@Yeachan-Heo

Copy link
Copy Markdown
Owner

Exact-head CI hold update — every prior 504fee84... receipt is superseded.

Five failures have two inherited owners: the four SDK machine lifecycle cleanup_pending failures are the #3596/#3538 descriptor-bound product cleanup regression, while stale internal docs-index loading is owned by #3630. The focused notifications-topic-settle-fence-epoch check passed; no topic-settlement-specific failing test exists.

This exact head is held, not contributor-blocked solely from inherited red. No REQUEST_CHANGES/closure, contributor mutation, rerun, or cancellation is performed. Reconsideration requires both owners merged into current dev, fresh exact-head/current-base CI, terminal green checks, and a fresh hostile exact-head P0/P1=0 review.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch from 9044575 to b92639f Compare July 31, 2026 04:52
@Yeachan-Heo

Copy link
Copy Markdown
Owner

Exact-head CI hold update — prior 9044575c... hold is superseded.

Docs-index and focused notifications-topic-settle-fence-epoch coverage are green. The exact remaining failures are only the four SDK machine lifecycle cleanup_pending cases inherited from the #3596/#3538 descriptor-bound proven-cleanup product regression.

The hold is narrowed to that sole inherited owner. No contributor mutation, REQUEST_CHANGES, closure, rerun, or cancellation is performed. Reconsideration requires the #3596 repair merged into current dev, refreshed exact-head/current-base terminal-green CI, and a fresh hostile P0/P1=0 review.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch 2 times, most recently from bc2c3c3 to 20df5a6 Compare July 31, 2026 05:58
@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch from 20df5a6 to b30e0f4 Compare July 31, 2026 06:36
@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Head refreshed onto current dev 4512ddfaa

Thank you for the clear hold conditions. This is the head-refresh step only — I am not asking for reconsideration yet, since the dev-side prerequisite is still outstanding.

What changed: rebased from e510bff00 onto current dev tip 4512ddfaa (clean, no conflicts). No source changes were made during the rebase; the two commits are unchanged in content.

Re-verified on the new base:

Gate Result
Own regression suite pass, 0 fail
Telegram sweep (daemon + topic-registry + own regression) 0 fail
telegram-daemon-generation-guard.ts --validate-current-tree 0
tsc -p packages/coding-agent/tsconfig.json --noEmit 0
Forbidden/owned surfaces touched none
DAEMON_GENERATION untouched

Dev-side prerequisite still open. At dev tip 4512ddfaa, packages/coding-agent/test/sdk-machine-lifecycle-topology.test.ts still reports 3 pass / 4 fail, every failure being the same shape:

- ok: true
+ ok: false
+ error: { code: "cleanup_pending",
+          message: "Saved session cleanup is pending in transcript:
+                    Exact transcript deletion rejected: cleanup_pending" }

Because both of these fixes must live in packages/coding-agent/src/sdk/bus/telegram-daemon.ts, the affected-path selector in scripts/ci-dev-affected.ts force-selects test:@gajae-code/coding-agent:shard-1-of-8 (that directory is listed in CODING_AGENT_SHARD_ONE_COVERAGE_PATHS), and that shard carries the topology test. So the inherited red will persist on these heads until the dev-side repair lands — it is not reachable from either changeset.

I will refresh again once repaired dev is green, and only then request a fresh exact-head review. Happy to hold as long as needed, and grateful for the review time.

@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head CI status: one remaining dependency, now identified

Following up on my earlier head-refresh note with a narrower result. I have now attributed every failing test in this PR's CI run, and the remaining red reduces to a single dependency.

This PR's exact-head CI: 14 SUCCESS / 5 SKIPPED / 3 FAILURE.

The three failures are test:@gajae-code/coding-agent:shard-1-of-8 plus its two aggregators (evidence producer and Affected path validation, both of which report only "required affected shards did not succeed"). So there is one root cause, not three.

Shard-1's sole failing test in the latest run is:

InteractiveMode goal mode integration > completes goal state even when a goal_updated extension hook throws

That test is unrelated to this PR. It fails on unmodified dev because #emitExtensionEvent now calls extensionRunner.emit(event, undefined, deliveryScope) (the per-attempt scope facility from #3592/#3608), while the test asserts exact single-argument arity. I opened #3637 for it; that PR is terminal green (13 SUCCESS / 0 FAILURE).

I also found and fixed the other two inherited-red root causes that were affecting this PR:

Why shard-1 is unavoidable for this PR: scripts/ci-dev-affected.ts lists packages/coding-agent/src/sdk/bus/ in CODING_AGENT_SHARD_ONE_COVERAGE_PATHS, so any change to telegram-daemon.ts force-selects shard-1. That is structural and not something this PR can route around.

Consequence: once #3637 merges, I expect this PR to reach terminal green on a refreshed head. I will rebase and re-run as soon as that lands, per your hold conditions.

On this PR's own correctness, unchanged and re-verified on the current base:

  • own regression suite: green, and fails on unmodified dev (fail-on-dev proof)
  • telegram sweep: green
  • bun scripts/telegram-daemon-generation-guard.ts --validate-current-tree: exit 0
  • bun run check:types: exit 0
  • biome check: exit 0
  • DAEMON_GENERATION: untouched
  • forbidden/owned surfaces: none touched

Two corrections to earlier statements of mine, for the record:

  1. I previously reported that fix(session): complete descriptor-bound cleanup and live migration leases #3596's head repaired the sdk-machine-lifecycle-topology.test.ts failures. That comparison was invalid — my local natives binary was stale. With freshly built natives, topology passes at the current dev tip as well, so my claim did not isolate fix(session): complete descriptor-bound cleanup and live migration leases #3596. I have posted a retraction on fix(session): complete descriptor-bound cleanup and live migration leases #3596.
  2. I earlier believed biome was not CI-enforced. It is, via the check:@gajae-code/coding-agent task. fix(coding-agent): restore import order in managed cleanup fixture #3635 came out of that correction.

Thank you for your patience with the inherited-red churn — I recognize it is noise on your review queue, and I have tried to remove its causes rather than ask you to look past them.

@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch from 7dcb620 to 6f2da4d Compare July 31, 2026 08:20
@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head CI is now terminal green — hold conditions 1–3 satisfied

Thank you for your patience while the inherited dev-side red was cleared. This head is now terminal green with zero failing checks, so I wanted to summarise the state against your stated hold criteria.

Your hold text was:

No REQUEST_CHANGES disposition is made solely from inherited red. Merge is held until repaired current dev is green, this head is refreshed/retested on that dev, exact CI is terminal green, and a fresh hostile exact-head review returns P0/P1=0.

Current status of each clause:

  1. Repaired current dev is green — for everything this PR's CI selects. Dev tip dd53a6895 now contains the two repairs that were producing this PR's inherited red:

    • #3635 (merged, dev 14908e8eb) cleared check:@gajae-code/coding-agent, which was failing on a biome organizeImports violation introduced by 4512ddfaa.
    • #3637 (merged, dev dd53a6895) cleared shard-1's only failing test, InteractiveMode goal mode integration > completes goal state even when a goal_updated extension hook throws.
    • The four sdk-machine-lifecycle-topology cleanup_pending failures no longer appear in shard-1's selected file set, and pass locally at dev tip (7 pass / 0 fail).
    • Three dev-red families remain (agent-session-message-pipeline, agent-session-auto-compaction-continue, agent-session-abort-timeout), but none of them are in shard-1's 152-file selection, so none affect this PR. #3641 covers the first; the other two are product-side in agent-session.ts under your #3638.
  2. Head refreshed/retested on that dev — rebased onto dd53a6895, no conflicts, force-pushed with --force-with-lease.

  3. Exact CI is terminal green17 SUCCESS / 5 SKIPPED / 0 FAILURE on this exact head, including test:@gajae-code/coding-agent:shard-1-of-8, check:@gajae-code/coding-agent, Telegram daemon generation guard, Local public surfaces, and all four gjc-state-gates.

  4. Fresh hostile exact-head review returning P0/P1=0 — this is the only remaining clause, and it is yours to make. I have re-requested review.

Local verification re-run on the refreshed head:

  • Own regression suite: green, and still fails on unmodified dev (fail-on-dev proof intact).
  • bun scripts/telegram-daemon-generation-guard.ts --validate-current-tree → exit 0.
  • bun run --cwd packages/coding-agent check:types → exit 0.
  • bun x @biomejs/biome check → exit 0.
  • DAEMON_GENERATION untouched; zero files touched under any surface owned by #3596.

I have deliberately not included the #3637 fix in this branch, to keep this PR's diff scoped to its own defect and avoid overlapping an already-open PR.

Please let me know if you would like anything restructured, or if you would prefer a different decomposition of the change. I am happy to revise.

@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch 2 times, most recently from 1c0d86b to 1f76465 Compare July 31, 2026 09:15

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES — exact-head hostile review of 1f76465249d2029182c6411734fb399fd2e3a6fc against base e255909797c5022434e76bfbb4eea03b9bd7149c.

P0=0, P1=1. After a definite remote delete, deleteTopic calls settleDelete but treats an undefined settlement token as settled. TopicRegistry.settleDelete intentionally returns undefined after a concurrent re-fence changes authority. This drops the session while durable delete-pending/quarantine state remains, with no compensation or retry. The create-compensation paths have the same ignored-refusal shape. Settlement refusal must stay post_dispatch_pending with retained supervision, covered by a concurrent re-fence test.

Exact checks are terminal 17 success / 5 skipped / 0 failed, but source authority blocks merge. Subsystem overlap with #3596 is none: this changes Telegram topic settlement only, not session/native/path-identity/recovery or generation contracts. Contributor branch/workflows were not mutated, rerun, or cancelled.


[repo owner's gaebal-gajae (clawdbot) 🦞]

GJC and others added 2 commits July 31, 2026 18:47
…ep rollback route-atomic

settleDelete() previously matched only topic id plus delete_pending, so a
held generation's definite remote result could settle a newer re-fenced
delete for the same session and release its topic-id quarantine. It now
requires the caller's dispatched authority epoch to equal both the
record's epoch and the registry's current epoch, and all four daemon call
sites capture that epoch before dispatching the remote delete.

restoreDeleteFence() reinstated a pending collision without rebuilding the
derived routing tables, and its narrow byTopic.delete never ran on the
absent-record branch that settlement creates. It now rebuilds inbound
routes after writing the epoch, so a restored fence re-quarantines the
topic id instead of leaving inbound routing open to the collision partner.

Settlement also rebuilds routes on success so a settled topic id becomes
adoptable and a surviving colliding record becomes routable immediately.
Settlement is now a two-phase commit. `settleDelete` removes the record,
records the pending settlement, and retains the topic-id quarantine;
`commitSettledDelete` publishes routes only after the clear is durable, and
`rollbackSettledDelete` undoes it under a CAS on the exact post-settlement
state. Epoch advancement saturates at the safe-integer bound and a saturated
fence refuses settlement, so two generations can no longer collapse onto the
same double. The first revoked-lease compensation sets its completion flag only
after the durable commit, so a failed clear persist leaves the fence supervised
instead of stranding cleared memory against a `delete_pending` disk state.
@twoimo
twoimo force-pushed the fix/telegram-settle-transactional-v2 branch from 1f76465 to 12b895b Compare July 31, 2026 09:47
@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the precise review. I fixed the settlement-refusal path in successor head 49e6b021f.

A definite remote delete now returns post_dispatch_pending when settleDelete refuses the captured epoch. The newer delete_pending record and topic quarantine remain intact and are persisted for reconciliation instead of being reported as settled. Both accepted-create compensation paths now likewise retain supervision when their settlement token is refused.

I added a deterministic daemon regression that pauses deleteForumTopic, advances the session delete fence concurrently, then releases a successful remote result. It asserts post_dispatch_pending and verifies the newer delete_pending authority both in memory and on disk.

Focused verification:

  • settlement registry suite: 7 pass, 0 fail
  • concurrent re-fence daemon regression: 1 pass, 512 filtered, 0 fail
  • Biome check clean on affected files
  • coding-agent typecheck clean

The previous review head is superseded; no merge is requested.

@twoimo

twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Additional scope-matched verification on the unchanged successor head: bun test ./packages/coding-agent/test/notifications-telegram-daemon.test.ts — 513 pass, 0 fail (1,986 assertions).

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hostile disposition: REQUEST_CHANGES

Fresh dev refresh: dev@66475d50377073cd2e028da0a0377964babbaf45; exact PR head: 49e6b021fedfc3f118719ce5bb552850c5d0f56d. The patch claims to close the predecessor topic-authority P1s, and its tests cover refusal and settlement boundaries, but it does not provide an independent exact-current-base review proving every earlier finding is fixed without reintroducing route, fence, quarantine, rollback, or durable-persist races. The current review lane therefore cannot sign MERGE_READY; green CI alone is insufficient.\n\nNo merge or build performed. Rebase onto current dev and provide a direct predecessor-finding-to-successor-code map plus focused regression evidence and an independent signed verdict.\n\n—\n*[repo owner\x27s gaebal-gajae (clawdbot) 🦞]*

@Yeachan-Heo

Copy link
Copy Markdown
Owner

Hostile disposition: REQUEST_CHANGES

Fresh dev refresh: dev@66475d50377073cd2e028da0a0377964babbaf45; exact PR head: 49e6b021fedfc3f118719ce5bb552850c5d0f56d. The patch claims to close the predecessor topic-authority P1s, and its tests cover refusal and settlement boundaries, but it does not provide an independent exact-current-base review proving every earlier finding is fixed without reintroducing route, fence, quarantine, rollback, or durable-persist races. The current review lane therefore cannot sign MERGE_READY; green CI alone is insufficient.\n\nNo merge or build performed. Rebase onto current dev and provide a direct predecessor-finding-to-successor-code map plus focused regression evidence and an independent signed verdict.\n\n—\n*[repo owner\x27s gaebal-gajae (clawdbot) 🦞]*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants