Skip to content

Add trustline-removal preconditions to the ChangeTrust example #81

Description

@kalepail

Note

Automated notice: This issue was filed from Stellar Raven's automated evaluation pipeline. Evidence and a public source record are included below. The finding may still be incomplete or incorrect — please verify against the live surface before acting on it.

Finding

The assets skill teaches ChangeTrust(limit: 0) as trustline removal without
the preconditions that make the operation safe and valid. A zero limit can fail
when balance or buying liabilities remain, and an asset trustline referenced by
a liquidity pool cannot be deleted. Open offers commonly create the liabilities
that must be cleared first.

The omission is safety-relevant because a wallet-display entry, claimable
balance, classic asset trustline, and pool-share position require different
actions.

Evidence

Observed 2026-08-04 in the exposed skills.stellar-dev.assets playbook and
checked against:

Additional recorded evidence:

  • current skills.stellar-dev.assets removal example says only limit: "10000", // 0 to remove trustline
  • current skill best practices omit balance, buying-liability, open-offer, and liquidity-pool-use preconditions
  • official operation result documentation defines CHANGE_TRUST_INVALID_LIMIT and CHANGE_TRUST_CANNOT_DELETE
  • CAP-0038 defines liquidityPoolUseCount as a deletion constraint for asset trustlines
  • 2026-08-05 live primary-source recheck: stellar/stellar-dev-skill main (381ca32) assets SKILL.md still presents limit 0 as removal without balance, liability, offer, or pool-reference preconditions
  • 2026-08-05 primary-source check: Stellar XDR and CAP-0038 define CHANGE_TRUST_INVALID_LIMIT for an uncleared balance/liability and CHANGE_TRUST_CANNOT_DELETE for a pool reference

Recommendation

Expand the one removal example just enough to require: identify the asset by
code and issuer; distinguish an actual trustline from display or claimable-
balance state; clear balance and relevant offers/liabilities; exit pool-share
positions or references; then submit ChangeTrust(limit: 0) and surface the
specific result code.

Source Record

This was found by the downstream Raven eval/improvements loop and recorded as sk-013 (skills, discovered 2026-08-04).

Public source record: improvements/skills/sk-013-trustline-removal-omits-safety-preconditions.md

Immutable source snapshot: aaef9b7ad7ba

Resolution Handoff

When a fix is deployed, please link the resolving issue or PR to the source record above and notify Raven through:

https://github.com/stellar-experimental/stellar-raven/issues/new?template=upstream-improvement-ready.yml&title=%5Bupstream-ready%5D%20sk-013%3A%20

Include the finding id, resolving issue/PR, deployed version or timestamp, and the smallest live recheck. Raven independently verifies the upstream surface before changing the finding to fixed-upstream; issue closure or a merged PR alone is not treated as proof. After a distinct reviewer repeats the live check, the active finding is retired to Raven's resolved ledger; a commit-pinned snapshot is preserved when available.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions