session-lifecycle
Operational session protocol for task-scoped leases, reconciliation, checkpoints, inspection, queue promotion, and handoff across long-running work.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Operational session protocol for task-scoped leases, reconciliation, checkpoints, inspection, queue promotion, and handoff across long-running work.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Rules and strategies for managing agent context window size, avoiding bloat, and preserving signal-to-noise ratio.
Standard patterns for error handling, retry logic, circuit breakers, and graceful degradation.
Detect and remove contradictions across agent policies before execution.
Multi-step tool workflows via code orchestration to reduce latency, context pollution, and token overhead.
Bind project-specific prompts to local schema and workflow artifacts while keeping the harness core generic and globally reusable.
Operational session protocol for task-scoped leases, reconciliation, checkpoints, inspection, queue promotion, and handoff across long-running work.
| name | session-lifecycle |
| description | Operational session protocol for task-scoped leases, reconciliation, checkpoints, inspection, queue promotion, and handoff across long-running work. |
| version | 6.0.0 |
Enforce the operational protocol for long-running work when a single task or lease is claimed, resumed, checkpointed, inspected, promoted, and handed off.
in_progress workreadysession-lifecycle selects and claims the next issue from SQLite. Project or domain skills execute the assigned work.task_status is separate from lease metadata. The canonical vocabulary is pending, ready, in_progress, blocked, needs_recovery, done, and failed.task_status transition, and before release or close.task_status, a short summary, evidence or artifact references, and next_step.close(done) or explicitly through promote_queue.begin_incremental, begin_recovery, and host-aware next_action calls must carry host plus hostCapabilities so workload-class dispatch stays deterministic and explainable.The verified runtime in agent-harness-core exposes:
begin_incrementalbegin_recoverycheckpointcloseinspect_exportinspect_auditinspect_health_snapshotpromote_queueHost-facing surfaces:
SessionLifecycleAdapter for in-process integrationsrc/bin/session-lifecycle.ts for JSON-driven CLI executionsrc/bin/session-lifecycle-mcp.ts for MCP-hosted lifecycle toolsExample fixtures live under examples/session-lifecycle/.
AGENTS.MD contract and any explicit local AGENTS.md overrides.in_progress issues, lease expiry, and checkpoint freshness.task_status change.close(done), allow lifecycle-driven queue promotion to advance newly eligible dependent issues.inspect_export, inspect_audit, or inspect_health_snapshot for read-only state inspection; do not mutate canonical state from ad-hoc scripts when inspection is enough.SessionOrchestrator.beginIncrementalSession() claims or resumes the lease, writes the initial SQLite checkpoint, and loads mem0 context at task scope.needs_recovery, recorded as canonical SQLite evidence, and block fresh claims until recovery is resolved.SessionOrchestrator.beginRecoverySession() is the explicit resolution path: it closes the stale lease set, opens a fresh recovery lease, writes the recovery claim checkpoint, and then resumes execution under the new lease.SessionOrchestrator.checkpoint() writes the canonical checkpoint to SQLite, records the structured payload in events, and only writes mem0 when the checkpoint is significant or explicitly requested.SessionOrchestrator.close() writes the final checkpoint, links the derived mem0 record back to SQLite through memory_links, releases the lease, and promotes newly eligible dependent issues when appropriate.SessionOrchestrator.promoteQueue() is the explicit queue-advancement path for promoting eligible pending issues without hand-written project logic.needs_recovery or stale state is unresolvedpromote_queueharness-lifecycle — umbrella model for long-running workprompt-contract-bindings — keeps prompt-specific schema/workflow local while lifecycle behavior stays globalplanning-tracking — provides the work units and dependency structuresession-logging — records the session journal and handoff detailsinteraction-loop — governs decision checkpoints with the user6.0.0 — replaced the coding-specific progressPath / featureListPath / planPath / syncManifestPath claim contract with a generic artifacts[{ kind, path }] surface while keeping host-aware routing requirements unchanged.5.0.0 — made host-aware dispatch a hard public contract: begin_incremental, begin_recovery, and host-aware next_action calls now require explicit host and hostCapabilities, and lifecycle dispatch enforces policy-driven workload-class routing.4.0.0 — hard-cut the public observability contract to inspect_export, inspect_audit, and inspect_health_snapshot, and require contractVersion: "4.0.0" on every session-lifecycle CLI payload.3.0.0 — replaced the old inspect_overview / inspect_issue read-only surface with inspect_export, inspect_audit, and inspect_health_snapshot so observability exports, audit trails, and health snapshots are first-class runtime contracts.1.1.0 — promoted agent-harness-core to the repo-native source of truth, documented inspect_overview, inspect_issue, explicit promote_queue, and automatic queue promotion on close(done).