Skip to content

feat(server): report renewal targets dropped by an identity change - #423

Merged
TarikGul merged 2 commits into
mainfrom
tg/report-pruned-renewal-targets
Aug 17, 2026
Merged

feat(server): report renewal targets dropped by an identity change#423
TarikGul merged 2 commits into
mainfrom
tg/report-pruned-renewal-targets

Conversation

@TarikGul

Copy link
Copy Markdown
Member

A renewal pass silently discarded targets promised by a previous identity. It counted them in a log line and returned only the survivors, so a host saw a target stop appearing in outcomes with nothing saying why. Raw Account targets are exactly the ones that do not survive a rotation, and the surface has no way to list the ledger, so there was no way to notice or recover.

StatementRenewalReport carries the labels it dropped. The information was already in hand at the pruning site; only the count reached the caller, so this is one additive field rather than new API surface.

Labels come from one function shared with resolve_target, so a pruned entry reads the same as a renewed one, and it derives without an active session because pruning is decided before the ledger is resolved against entropy.

The CLI reports each dropped target with the reason and what to do about it. Both host READMEs now point at report.pruned instead of telling hosts a pruned entry is undetectable.

Scope

Raised twice in review on #417. A reader and an untrack are still missing and are tracked separately: those need decisions this does not, and the report may reduce how much a reader is worth.

Verification

Live through the CLI: /renew against the People chain, period 20682, three targets renewed. The two pruning tests now assert the reported labels, not just that entries were dropped.

A pass silently discarded targets promised by a previous identity. It counted
them in a log line and returned only the survivors, so a host saw a target stop
appearing in `outcomes` with nothing saying why. Raw account targets are exactly
the ones that do not survive a rotation, and the surface has no way to list the
ledger, so there was no way to notice or recover.

`StatementRenewalReport` now carries the labels it dropped. The information was
already in hand at the pruning site; only the count reached the caller.

Labels come from one function shared with `resolve_target`, so a pruned entry
reads the same as a renewed one, and it derives without an active session
because pruning is decided before the ledger is resolved.

Reviewed twice on #417 as a gap this leaves open. A reader and an untrack are
still missing, tracked separately: those need design decisions this does not.
@TarikGul
TarikGul requested a review from a team August 17, 2026 03:42
Comment thread rust/crates/truapi-server/src/runtime/signing_host/allowance_renewal.rs Outdated
Comment thread android/truapi-host/README.md Outdated
Comment thread rust/crates/truapi-host-cli/src/main.rs
Pruning rewrites the whole ledger but read it outside the lock, so a
`track_targets` landing in the gap was overwritten by a view that predated it and
that account was tracked nowhere afterwards. `track_targets` already holds the
lock across its own read-modify-write; this now matches. The new test fails
without the change, losing the concurrently tracked target outright.

The dropped labels are logged where the prune happens rather than only returned.
Every step between there and the report can fail, and `run_tick` reads only the
exhaustion flag and the outcome count, so the log is the one place a prune is
recorded unconditionally. The durable version belongs with the reader.

A prune is not a failed renewal, so it no longer borrows the failure event, which
rendered it red beside chain rejections and counted toward nothing. There is an
`AllowanceRenewalPruned` event and a `pruned` count in the summary, so the
all-foreign case reads as three dropped targets rather than three failures
followed by "no tracked allowance targets".

Both host READMEs said a pruned target was absent from the report one sentence
before saying it was listed in it. The stale half is gone and the examples read
`report.pruned`.
@TarikGul
TarikGul added this pull request to the merge queue Aug 17, 2026
Merged via the queue into main with commit f4389ba Aug 17, 2026
24 of 27 checks passed
@TarikGul
TarikGul deleted the tg/report-pruned-renewal-targets branch August 17, 2026 18:05
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.

3 participants