Skip to content

Commit a82eeb2

Browse files
committed
docs(adr): address sentinel threads on ADR 0019
Name the daemon-owned ledger and teardown ordering, restore the normalized asyncDispose rejection contract with its drift issue, and record the footprint baseline command and why it no longer applies.
1 parent 9043518 commit a82eeb2

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎docs/adr/0019-request-bound-platform-runtime.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Destructive operations hold the ownership lease across fence validation, the nat
158158
A preflight check alone is insufficient.
159159
Session state may hold only a neutral facet-specific handle; persisted recovery holds the descriptor and neutral metadata.
160160
The capture-kit durable-capture coordinator, which the daemon composes, owns persistence, adoption, compensation, fencing, and exact-owner recovery.
161+
The daemon owns the app-log admission ledger and session-teardown ordering.
161162
Events and the proposed journal are observability, not recovery authority.
162163
The [durable resource recovery contracts](../../packages/capture-kit/docs/durable-resource-recovery.md) own the lifecycle, cleanup, and recovery details.
163164

@@ -261,6 +262,7 @@ The staged migration cost temporary coexistence; closed execution shapes and str
261262

262263
These targets are proposed defaults, not accepted commitments or authorization for work.
263264
The proposed daemon top-level footprint is at most 60; its [measured baseline](../evidence/daemon-footprint-baseline-2026-09-02.md) is evidence, not a commitment.
265+
The baseline counted top-level files of the old root daemon directory; since the daemon moved into layer folders in `@agent-device/daemon`, the target needs a new counting rule before it binds.
264266
`@agent-device/daemon` remains a permanent R65 zone; the target concerns its contents, not directory retirement.
265267
**Entry-to-platform hop count.** The hop trace and measured hop counts belong to [ADR 0023](0023-end-state-hop-trace.md).
266268
Composition and family runtime-loading boundaries count as hops, and package direction and named facets constrain any collapse.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
# Daemon footprint baseline, 2026-09-02
22

33
The pre-migration daemon top-level footprint measured 199 production TypeScript files, excluding tests, at [the baseline commit](https://github.com/callstack/agent-device/commit/e624ef9d3f5c30be7a4f7597fd6bd74dd61336e3). This historical measurement informs the proposed target in [ADR 0019](../adr/0019-request-bound-platform-runtime.md); it is not a current file count or accepted budget.
4+
5+
The count is the number of top-level `.ts` files directly in `src/daemon/`, not recursive, measured with:
6+
7+
```sh
8+
git ls-tree --name-only e624ef9d3f src/daemon/ | grep -E '\.ts$' | grep -vE '\.test\.ts$' | wc -l
9+
```
10+
11+
That directory no longer exists: the daemon now lives in layer folders under `packages/daemon/src/`, which has one top-level production file. So the old measure does not apply to the current layout, and the ≤60 target needs a new counting rule.

‎packages/capture-kit/docs/durable-resource-recovery.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
A durable start returns a process-local live handle and a bounded, JSON-safe, versioned descriptor sufficient for deterministic recovery by the exact owner.
44
The facet-specific handle provides idempotent `finish()` returning `FinishOutcome`, `forceCleanup()` returning `CleanupOutcome`, and an idempotent `[Symbol.asyncDispose]` adapter that carries no typed result.
5-
The adapter resolves for confirmed cleanup or already-missing outcomes and converts a cleanup-pending outcome to the facet error.
6-
A rejected cleanup operation escapes without normalization by the shared adapter.
5+
The adapter resolves only for confirmed cleanup or already-missing outcomes.
6+
Otherwise, it rejects with a normalized `ownership-lost` or `cleanup-pending` error.
7+
Known drift: today a rejected cleanup operation escapes the shared adapter without normalization (#4334).
78

89
Each destructive finish or cleanup holds the authoritative ownership lease across fence validation, native side effect, and persisted transition, or uses a token atomically enforced by the native or provider operation.
910
A preflight check alone is insufficient.

0 commit comments

Comments
 (0)