[FEATURE] Derive immutable invocation-scoped authority brokers #26

Open
opened 2026-10-24 03:58:10 +02:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Native tools prepare a specific command before requesting file authority. A
single executable may inspect an image or publish a newly built image, so its
authenticated manifest describes more operations than one invocation needs.
Launchd should let that invocation retain an immutable broker limited to its
prepared file operations.

Proposed behavior and scope

Add an explicit derivation operation to Launchd's existing job-bound broker.
Accept a complete, counted set of exact operation, object-class, raw selector
and lifetime rows. Validate every row against the original authenticated
manifest, inherited script and invoking session ceilings. Return a fresh,
SEND-only derived broker with those immutable rows; derivation opens no files,
pregrants no objects and performs no interactive approval.

Use the derived broker for the native
Boot backend: inspect and
verify request only their original reads, while build and extraction add only
the exact selected publications. Commands with no file operations retire their
unused original broker before ordinary effects and need no derived broker.
Keep acquisition and release behavior compatible for existing clients.

Authority, security and reliability

The producer is Launchd's retained authenticated job receiver. Caller-supplied
names, hashes, request numbers and slots are descriptions, never authority.
Derived rows must be a subset of every original ceiling, with exact selector
bytes and lifetimes no broader than invocation scope. A derived receiver cannot
derive a broader broker or regain the original receiver.

At the first accepted preparation, Launchd must reject actual pending or live
original file grants and put the original receiver into a monotone
prepare/cleanup-only state. Block simultaneous ordinary acquisitions.
Commit delivery, abort, cancellation and uncertain delivery cannot restore
broader ordinary access. This transition uses Launchd's actual job/grant
tables; client counters and local alias deletion do not prove revocation.

The client must positively retire its original broader local sender before
ordinary command effects. Retain the actual original binding, generation,
correlation and lifetime in an opaque derived receipt, with its own once-only
retirement. Failed delivery, malformed receipts, cancellation or uncertain
retirement freeze the actual owner. Do not reacquire a transaction by ID, retry
an uncertain derivation or replace the first error with a cleanup error.
Existing grants remain tied to their original issuer and exact retirement
route. Job teardown must account for original and derived receivers and any
in-flight replies. Detached signing authority remains separate.

Acceptance criteria

  • Define coordinated LibIPC, Launchd and LibCli request, receipt and
    lifecycle contracts before adopting them in native tools.
  • Validate exact prepared rows against manifest, script and session ceilings
    without opening objects or granting interactive escalation.
  • Reject unknown operations, wider lifetimes, wildcard substitutions,
    selector changes, duplicate rows, malformed counts and stale job generations.
  • Enforce the original receiver's monotone preparation/cleanup state against
    actual pending and live grants; abort or uncertain delivery cannot reopen it.
  • Require positive retirement of the original broader sender before normal
    effects; retain independent cleanup uncertainty and refuse reuse.
  • Retire each derived receiver and its owned grants once, including failed
    transfer, cancellation, job exit and outstanding reply paths.
  • Add original codec, policy and lifecycle controls plus bounded native
    workloads for read-only, publishing and authority-free commands.
  • Document ownership and compatibility in the affected components and
    technical manual; keep files and counted row sets free of arbitrary limits.

Alternatives and tradeoffs

A private Rust field that omits a publisher does not narrow a broker still held
by the process. Opening every potential object during preparation changes effect
ordering and unnecessarily retains grants. An immutable derived broker narrows
future requests while preserving on-demand acquisition and original cleanup.
It adds a small explicit receiver lifecycle that must be accounted for fully.

Tracking and rollout

Coordinate with Boot-tool issue 6,
Integration PR 12.
Land the producer, shared codecs and client together before native Boot adopts
the derived route. Keep existing clients usable until their explicit migration.

## Problem and motivation Native tools prepare a specific command before requesting file authority. A single executable may inspect an image or publish a newly built image, so its authenticated manifest describes more operations than one invocation needs. Launchd should let that invocation retain an immutable broker limited to its prepared file operations. ## Proposed behavior and scope Add an explicit derivation operation to Launchd's existing job-bound broker. Accept a complete, counted set of exact operation, object-class, raw selector and lifetime rows. Validate every row against the original authenticated manifest, inherited script and invoking session ceilings. Return a fresh, SEND-only derived broker with those immutable rows; derivation opens no files, pregrants no objects and performs no interactive approval. Use the derived broker for the native [Boot backend](https://git.erikinkinen.fi/erix/boot-tool/issues/6): inspect and verify request only their original reads, while build and extraction add only the exact selected publications. Commands with no file operations retire their unused original broker before ordinary effects and need no derived broker. Keep acquisition and release behavior compatible for existing clients. ## Authority, security and reliability The producer is Launchd's retained authenticated job receiver. Caller-supplied names, hashes, request numbers and slots are descriptions, never authority. Derived rows must be a subset of every original ceiling, with exact selector bytes and lifetimes no broader than invocation scope. A derived receiver cannot derive a broader broker or regain the original receiver. At the first accepted preparation, Launchd must reject actual pending or live original file grants and put the original receiver into a monotone prepare/cleanup-only state. Block simultaneous ordinary acquisitions. Commit delivery, abort, cancellation and uncertain delivery cannot restore broader ordinary access. This transition uses Launchd's actual job/grant tables; client counters and local alias deletion do not prove revocation. The client must positively retire its original broader local sender before ordinary command effects. Retain the actual original binding, generation, correlation and lifetime in an opaque derived receipt, with its own once-only retirement. Failed delivery, malformed receipts, cancellation or uncertain retirement freeze the actual owner. Do not reacquire a transaction by ID, retry an uncertain derivation or replace the first error with a cleanup error. Existing grants remain tied to their original issuer and exact retirement route. Job teardown must account for original and derived receivers and any in-flight replies. Detached signing authority remains separate. ## Acceptance criteria - [ ] Define coordinated LibIPC, Launchd and LibCli request, receipt and lifecycle contracts before adopting them in native tools. - [ ] Validate exact prepared rows against manifest, script and session ceilings without opening objects or granting interactive escalation. - [ ] Reject unknown operations, wider lifetimes, wildcard substitutions, selector changes, duplicate rows, malformed counts and stale job generations. - [ ] Enforce the original receiver's monotone preparation/cleanup state against actual pending and live grants; abort or uncertain delivery cannot reopen it. - [ ] Require positive retirement of the original broader sender before normal effects; retain independent cleanup uncertainty and refuse reuse. - [ ] Retire each derived receiver and its owned grants once, including failed transfer, cancellation, job exit and outstanding reply paths. - [ ] Add original codec, policy and lifecycle controls plus bounded native workloads for read-only, publishing and authority-free commands. - [ ] Document ownership and compatibility in the affected components and technical manual; keep files and counted row sets free of arbitrary limits. ## Alternatives and tradeoffs A private Rust field that omits a publisher does not narrow a broker still held by the process. Opening every potential object during preparation changes effect ordering and unnecessarily retains grants. An immutable derived broker narrows future requests while preserving on-demand acquisition and original cleanup. It adds a small explicit receiver lifecycle that must be accounted for fully. ## Tracking and rollout Coordinate with [Boot-tool issue 6](https://git.erikinkinen.fi/erix/boot-tool/issues/6), [Integration PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12). Land the producer, shared codecs and client together before native Boot adopts the derived route. Keep existing clients usable until their explicit migration.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:33 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/launchd#26
No description provided.