runtime-lifecycle-coordination
Skill0 starsChanged 47 days agoApache-2.0View on GitHub
Coordinate in-process command idempotency, provider side effects, run supervision, session cleanup, shutdown, and replay-live lifecycle boundaries.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- changesets-releaseSkill
- local-ci-paritySkill
- npm-releaseSkill
- package-architectureSkill
- package-artifact-validationSkill
- pnpm-supply-chainSkill
- provider-adapter-developmentSkill
- public-api-evolutionSkill
- runtime-contract-evolutionSkill
- workspace-lifecycleSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use this skill when a change touches any of:
- Distinctive: line 22
Do not use this skill when:
- Distinctive: line 55
Write a deterministic failing test with controlled promises and an injected store/provider.
- Distinctive: line 58
Commit owning start/settlement events and receipts atomically.
- Distinctive: line 60
Document the in-process boundary: reservations survive transient store errors in one runtime instance but are not crash-durable.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Runtime lifecycle coordination
Trigger
Use this skill when a change touches any of:
packages/runtime/src/or its lifecycle/concurrency tests- command receipt reservation, duplicate/conflict behavior, or transient store failures
- provider session/run activation, event staging, supervision, interrupt, close, or shutdown
- replay-then-live subscription coordination or bounded in-process buffers
Counter-trigger
Do not use this skill when:
- changing wire DTO shapes or state tables — use
runtime-contract-evolution - implementing a provider adapter — use
provider-adapter-development - changing lease acquisition/removal mechanics — use
workspace-lifecycle - changing package dependencies or the monorepo graph — use
package-architecture
Owns
packages/runtime/src— runtime composition, store, projection, subscriptions, and lifecycle coordinationpackages/runtime/test— deterministic runtime lifecycle and adversarial regressionsdocs/adr/ADR-0002-command-receipts-and-idempotency.md— command identity and receipt semanticsdocs/adr/ADR-0005-run-cancel-close-dispose.md— cancellation and cleanup orderingdocs/adr/ADR-0016-provider-event-activation.md— synchronous event capture and activation
Does not own
packages/protocol/src— owned byruntime-contract-evolutionpackages/provider/src— owned byprovider-adapter-developmentpackages/workspace/src— owned byworkspace-lifecycletools/repo/check-dag.ts— owned bypackage-architecture
Relationships
boundary-with→runtime-contract-evolution— the protocol defines legal states and receipts; runtime coordination makes those transitions atomic and replayable.boundary-with→provider-adapter-development— adapters provide effects and callbacks; runtime owns activation, normalization, and settlement ordering.boundary-with→workspace-lifecycle— workspace code owns lease safety; runtime owns when acquisition and cleanup occur relative to session state.boundary-with→package-architecture— package architecture owns dependency direction; this skill owns behavior inside the runtime package.escalates-to→public-api-evolution— any exported runtime behavior or type change needs consumer and compatibility classification.depends-on→local-ci-parity— lifecycle fault and race tests must run in the canonical gate.
Procedure
- Write a deterministic failing test with controlled promises and an injected store/provider. Avoid timers for ordering assertions.
- Reserve a validated command ID and canonical fingerprint before the first external effect. On a transient persistence failure, retain a bounded in-memory logical operation so exact retry finishes it without reissuing the effect; changed payload returns
command_id_conflict. - Fence state synchronously before awaiting provider callbacks. Provider ingress must consult the fence, capture hostile values without throwing, and emit a typed
provider_contract_violationdiagnostic or terminal failure. - Commit owning start/settlement events and receipts atomically. Activate bounded staged events only after their owner event commits; preserve emission order and explicit overflow diagnostics.
- On close/shutdown, attempt all required cleanup phases, retain truthful retry state after failure, and never publish success while cleanup remains incomplete. Clear retained commands, sinks, supervision, routing, and fences only after terminal cleanup succeeds.
- Document the in-process boundary: reservations survive transient store errors in one runtime instance but are not crash-durable. A durable store must transact command reservation, events, projection, and receipt with its own recovery record.
Failure-mode checklist:
- same ID/same payload, same ID/changed payload, and competing interaction settlements
- provider effect succeeds but commit rejects, then exact retry and shutdown
- interaction arrives while interrupt is awaiting the provider
- completion/event contains cycles, accessors, proxies, or malformed discriminants
- close/dispose/release fail separately and together, then retry
- replay/live activation, overflow, terminal subscription, and coordination-map cleanup
Verification
pnpm --filter @relvo-labs/agent-runtime test
pnpm --filter @relvo-labs/agent-runtime typecheck
pnpm --filter @relvo-labs/agent-executor test
pnpm skills:check
pnpm gateProvenance
- Source: independent — authored for this repository against the official Node.js event-loop and asynchronous-flow documentation, npm package lifecycle guidance, and the repository runtime/event/idempotency ADRs named above; no external prose was incorporated.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

