Skip to content

ateapi: rename store.DeletePreconditions to OptionalPrecondition - #3989

Merged
Luiz Oliveira (laoj2) merged 1 commit into
agent-substrate:mainfrom
haiyanmeng:rename-delete-preconditions
Nov 19, 2026
Merged

Luiz Oliveira (laoj2) merged 1 commit into
agent-substrate:mainfrom
haiyanmeng:rename-delete-preconditions

Conversation

@haiyanmeng

@haiyanmeng haiyanmeng commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Pure rename: store.DeletePreconditions becomes store.OptionalPrecondition, and its doc comment drops the delete-only wording. No behavior change.

Custom methods such as SuspendActor will take the same optional uid and version guards as deletes. Rename the type so the name fits both uses.

Addresses #1773

AI use: I used Claude Code to make the rename and run the tests. I reviewed the diff.

  • Tests pass (no code changes)
  • Docs updated

@haiyanmeng
haiyanmeng force-pushed the rename-delete-preconditions branch from 59f4112 to 512c49c Compare November 19, 2026 02:06
@haiyanmeng haiyanmeng added area/api-machinery kind/cleanup Small fixes that are not bugs, for example a typo in a code comment labels Nov 19, 2026
@haiyanmeng
haiyanmeng force-pushed the rename-delete-preconditions branch from 512c49c to eb50a1b Compare November 19, 2026 02:20
@haiyanmeng
haiyanmeng marked this pull request as ready for review November 19, 2026 02:21
Custom methods such as SuspendActor will take the same optional uid and
version guards as deletes. Rename the type so the name fits both uses.

Signed-off-by: Haiyan Meng <[email protected]>
@haiyanmeng
haiyanmeng force-pushed the rename-delete-preconditions branch from eb50a1b to 2e47dbd Compare November 19, 2026 13:15
@laoj2
Luiz Oliveira (laoj2) added this pull request to the merge queue Nov 19, 2026
Merged via the queue into agent-substrate:main with commit d7dd187 Nov 19, 2026
5 checks passed
Yufan Su (yufan-su) pushed a commit to yufan-su/substrate that referenced this pull request Nov 20, 2026
…nt-substrate#4004)

`store.OptionalPrecondition` and `store.Precondition` have the same uid
and version fields. They differ only in whether an unset guard is an
error or a skipped check. This keeps one `Precondition`. `Check` skips
unset guards. Update methods call `ValidateRequired` first, so they
still require both guards. Deletes and marks for deletion call only
`Check`. Store behavior is unchanged.

This reverses the separate optional type, which agent-substrate#3989 renamed from
`DeletePreconditions`. Custom methods such as `SuspendActor` (agent-substrate#1773) can
call `Check` without `ValidateRequired`. The trade-off is that the
compiler no longer catches optional guards passed to an update method.
That mistake now fails at runtime with `ErrPreconditionRequired`.

Addresses agent-substrate#1773

AI use: I used Claude Code to review the diff and draft the commit
message and this description. I reviewed both.

- [x] Tests pass
- [x] Docs updated

---------

Signed-off-by: Haiyan Meng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api-machinery kind/cleanup Small fixes that are not bugs, for example a typo in a code comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants