Skip to content

lockCaller: let a leaf pin its caller onto a deferred callback #489

Closed as duplicate

Description

@Shinrai

A leaf that stores work to run later on behalf of whoever called it (a scheduler or registry leaf) cannot make that work run as the caller. self.slothlet.lockCaller(fn) always pins the leaf that is currently running, which is the registry leaf itself.

Real case

rummage's deadline extension builds a reminder engine per consumer through self.deadline.engine(...) and ticks them all from one scheduled job. The ticks run as the deadline extension, not as each owning consumer. Owner attribution is currently carried as a payload field (owner, taken from metadata.caller()) instead of by the caller identity the rest of the system uses.

Proposal

  • self.slothlet.lockCaller(fn, { as: "caller" }) pins the current leaf's caller (the identity metadata.caller() would report) onto fn instead of the leaf.
  • Letting a leaf act as its caller is a privilege, so it must be gated by a permission rule (the same kind of explicit grant as metadata.caller), and it should compose with principals (feat(permissions): named, module-owned principals — async-resolved identity facts for sync conditions #459) once they land.
  • The pinned identity is captured at call time and cannot be changed afterwards (same guarantees as today's lockCaller).

Activity

  1. added
    type: enhancementAn improvement to existing functionality without adding a new feature
    priority: mediumShould be addressed in the normal course of development
    status: not startedNot implemented yet — no code exists for this
    on Sep 28, 2026
  2. Shinrai commented on Sep 28, 2026

    @Shinrai
    ContributorAuthor

    Same capability as #477 (a leaf pinning its caller, not itself, onto a deferred callback). I've copied the permission gate, the principals composition, the immutability guarantee and the deadline-engine case into #477 so nothing is lost. Closing in favor of #477.

  3. added
    status: duplicateThis issue or pull request already exists elsewhere
    and removed
    status: not startedNot implemented yet — no code exists for this
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumShould be addressed in the normal course of developmentstatus: duplicateThis issue or pull request already exists elsewheretype: enhancementAn improvement to existing functionality without adding a new feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions