Skip to content

add TaskRunner scheduling protos: PullInDeadline, KpRotation, KpDeletion#339

Merged
insipx merged 1 commit into
mainfrom
push-wzruswsslulk
Jul 6, 2026
Merged

add TaskRunner scheduling protos: PullInDeadline, KpRotation, KpDeletion#339
insipx merged 1 commit into
mainfrom
push-wzruswsslulk

Conversation

@insipx

@insipx insipx commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Adds three task variants to xmtp.mls.database.Task for generic recurring-task support in libxmtp's TaskRunner:

  • PullInDeadline (tag 4) — generic one-shot "run a task sooner" primitive: lowers a target task row's next_attempt_at_ns to MIN(current, not_later_than_ns), targeting the row by its unique data_hash.
  • KpRotation (tag 5) — recurring singleton: rotate + upload a fresh key package when the identity's rotation deadline is due.
  • KpDeletion (tag 6) — recurring singleton: delete superseded local key-package material past its delete_at_ns.

Empty payloads on the two singletons give each a stable data_hash so pull-ins can target them.

Replaces this PR's earlier single KpMaintenance message: rotation and deletion are now independent tasks (different deadlines, cadences, and latency tolerances), and the nudge mechanism is generic rather than KP-specific.

Consumed by xmtp/libxmtp#3805 + xmtp/libxmtp#3806 (generic layer, vendored regen ahead of pin) and a follow-up KP-consumer stack; libxmtp's proto_version gets bumped to this PR's merge SHA once landed.

🤖 Generated with Claude Code

Note

Add PullInDeadline, KpRotation, and KpDeletion task variants to TaskRunner scheduling protos

Extends the Task oneof in task.proto with three new variants (field numbers 4–6).

  • PullInDeadline carries a target_data_hash and a not_later_than_ns timestamp for deadline-based scheduling
  • KpRotation and KpDeletion are empty messages representing recurring singleton key package operations

Macroscope summarized f9f0a35.

@insipx
insipx requested a review from a team as a code owner June 29, 2026 17:56
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 29, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Purely additive protobuf schema changes adding new message types (PullInDeadline, KpRotation, KpDeletion) and corresponding Task oneof variants. No existing fields modified. Author is the designated code owner of this proto file.

You can customize Macroscope's approvability policy. Learn more.

PullInDeadline (tag 4): generic one-shot 'run a task sooner' primitive — lowers
a target task row's next_attempt_at_ns to MIN(current, not_later_than_ns).
KpRotation (tag 5) / KpDeletion (tag 6): recurring singleton tasks for key
package rotation and superseded-key-material deletion; empty payloads give
each a stable data_hash so pull-ins can target them.

Replaces the earlier single KpMaintenance message.
@insipx insipx changed the title add KpMaintence proto add TaskRunner scheduling protos: PullInDeadline, KpRotation, KpDeletion Jul 2, 2026
@insipx
insipx force-pushed the push-wzruswsslulk branch from 503dc57 to f9f0a35 Compare July 2, 2026 14:20
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 2, 2026 14:20

Dismissing prior approval to re-evaluate f9f0a35

@insipx
insipx merged commit b51de7f into main Jul 6, 2026
7 checks passed
@insipx
insipx deleted the push-wzruswsslulk branch July 6, 2026 21:15
insipx added a commit to xmtp/libxmtp that referenced this pull request Jul 6, 2026
… + regen xmtp_proto (#3805)

Proto-only base of the TaskRunner-recurrence stack. Adds three variants
to the `xmtp.mls.database.Task` oneof (vendored regen):

- **`PullInDeadline` (tag 4)** — generic one-shot "run a task sooner"
primitive: lowers a target task row's `next_attempt_at_ns` to
`MIN(current, not_later_than_ns)`, targeting the row by its unique
`data_hash`.
- **`KpRotation` (tag 5)** / **`KpDeletion` (tag 6)** — recurring
singleton tasks for key-package maintenance; empty payloads give each a
stable `data_hash` so pull-ins can target them.

Minimal dispatch arms (warn + delete) keep `xmtp_mls` compiling
standalone; real handlers land in the stacked PRs (#3806 generic layer,
#3814 KP consumers).

`gen/` is regenerated AHEAD of the upstream proto pin: xmtp/proto#339
carries all three messages; `proto_version` gets bumped to its merge SHA
once it lands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible
markers, and the markers themselves will not be visible in the GitHub
rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's
description, Macroscope will append its summary at the bottom of the
description. -->
> [!NOTE]
> ### Add `PullInDeadline`, `KpRotation`, and `KpDeletion` task variants
to the MLS database worker
> - Adds three new `Task` oneof variants to the protobuf schema in
[xmtp.mls.database.rs](https://github.com/xmtp/libxmtp/pull/3805/files#diff-1b48cc83eb618a15345516b946b4138dae9c2be24155cc8d9a950038f118096c):
`PullInDeadline` (with `target_data_hash` and `not_later_than_ns`),
`KpRotation`, and `KpDeletion`.
> - Regenerates serde impls and the proto descriptor binary to include
these new types.
> - Adds placeholder match arms in
[tasks.rs](https://github.com/xmtp/libxmtp/pull/3805/files#diff-b3d01dc512a077cf4b625f516f8c36ea61978f070bcce720ed8d522065a268b6)
that log a warning and delete the task — no business logic is
implemented yet.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized
bd706d7.</sup>
> <!-- Macroscope's review summary ends here -->
>
> <!-- macroscope-ui-refresh -->
<!-- Macroscope's pull request summary ends here -->
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