Skip to content

RedHeartSecretMan/dag-skill / skill/dag

Coordinate an Approved DAG in a Git-backed Target Project by selecting runnable Tickets, dispatching one end-to-end Execution Agent per Ticket, and accepting verified results. Use when the user asks to execute, advance, continue, or resume an Approved DAG.

FileKindSize
SKILL.mdskill md38.9 KB
agents/openai.yamlconfig218 B
references/definition-binding.mdmarkdown9.4 KB
references/execution-artifacts.mdmarkdown8.1 KB
references/integration-transitions.mdmarkdown16.4 KB
references/outcome-closure.mdmarkdown9.9 KB
references/runnable-scheduling.mdmarkdown6.8 KB
references/ticket-execution.mdmarkdown12.6 KB
scripts/commit.pyexecutablescript7.5 KB
scripts/lib/__init__.pyscript92 B
scripts/lib/artifacts.pyscript57.9 KB
scripts/lib/common.pyscript12.1 KB
scripts/lib/git_ops.pyscript10.3 KB
scripts/lib/receipt.pyscript8.0 KB
scripts/lib/scheduling.pyscript33.2 KB
scripts/lib/tracker.pyscript48.4 KB
scripts/lib/transitions.pyscript61.8 KB
scripts/promote.pyexecutablescript2.0 KB
scripts/publish.pyexecutablescript9.3 KB
scripts/runtime.pyexecutablescript16.4 KB
scripts/verify.pyexecutablescript4.4 KB

references/runnable-scheduling.md

View on GitHub
# Plan Admission, Record Claims, and Recover Writers

Read this reference before evaluating candidate Tickets on the Runnable Frontier, recording a live `Execution Claim`, or reconciling writer liveness during recovery.

## Plan deterministic admission

`scripts/publish.py admission-decision` is a read-only Coordinator planner for the admission step. It evaluates live claims and candidate Tickets together, then atomically publishes a deterministic `Execution Admission Decision`. It does not create a claim, assign a writer, change a workspace, move a Git ref, or enter a Promotion transition.

```bash
python3 <this-skill-root>/scripts/publish.py admission-decision \
  --request <off-delivery>/admission-request.json \
  --output <off-delivery>/admission-decision.json
```

The request has `schema_version: 1` and `kind: Execution Admission Request`, a `run_id`, `coordinator_generation`, known `agent_slots` and `runtime_skill_slots` capacity, `accepted_direct_inputs` (`name` + identity), `accepted_prerequisites` (`ticket_id` + output identity), current `live_claims`, and open `candidates`. Each claim declares its phase, changed paths, shared interfaces, and resource reservations. Candidates additionally declare non-negative `priority`, `age`, `required_inputs` (`name` + identity), and `hard_dependencies` (`ticket_id` + output identity).

The planner checks all live claims before admitting a candidate. It compares required input and dependency identities, then rejects missing or stale Accepted direct inputs, unmet or stale Hard Dependencies, overlapping changed paths or shared interfaces (including parent/child path overlap), exclusive resources already held, capacity overflow, duplicate Ticket identities, and unknown agent or Runtime Skill capacity. Resource quantities must be positive. Unknown capacity produces `capacity_unknown` and selects no candidate that requires the unknown resource.

Build / Review work can be admitted concurrently when its paths and resources are independent. At most one live or newly selected `promotion` candidate enters the Promotion lane. Candidate ordering is deterministic: priority descending, age descending, then Ticket ID ascending. A lower-ranked Promotion candidate receives `promotion_lane_busy` after a higher-ranked one is selected.

The output contains a digest-bound `request_path` and `request_sha256`, `run_id`, `coordinator_generation`, `selected` candidates with owner, phase, lane, rank, `admission_reason: accepted`, and embedded `changed_paths`, `shared_interfaces`, `resources`, and `hard_dependencies`, plus `rejected` candidates with actionable reasons (`missing_accepted_input`, `hard_dependency_unmet`, `path_or_interface_conflict`, `resource_conflict`, `capacity_exceeded`, `capacity_unknown`, or `promotion_lane_busy`). `commit.py claim` rereads the embedded request path and rechecks its digest and selected candidate fields, so the caller does not need to pass `--request` again.

The decision is an admission proposal. The Coordinator rereads current live state before atomically recording a claim and its Ticket Base. A stale decision cannot authorize a writer; a changed frontier requires a new request and decision.

## Commit an Execution Claim

`scripts/commit.py claim` is the Coordinator's locked CAS boundary after admission planning. It records one live Ticket claim in the off-delivery Run Receipt; it does not start an Agent, create a worktree, or change a Git ref.

```bash
python3 <this-skill-root>/scripts/commit.py claim \
  --receipt <off-delivery>/run-receipt.json \
  --decision <off-delivery>/admission-decision.json \
  --claim <off-delivery>/execution-claim.json \
  --expected-generation <current-coordinator-generation> \
  --expected-receipt-sha256 <current-receipt-sha256>
```

The claim contains `ticket_id`, `owner_id`, `claim_generation`, workspace, branch, phase, exact `ticket_base` commit/tree, changed paths, shared interfaces, and resource reservations. The Coordinator supplies these values after preparing the safe workspace and current Base.

Before writing, the helper verifies:

- the Receipt digest and `coordinator_generation` are current;
- the decision, claim, and Receipt share one `run_id` and `coordinator_generation`;
- the decision accepted this Ticket and the owner, phase, lane, `changed_paths`, `shared_interfaces`, and `resources` match the embedded candidate record;
- the claim's Ticket Base, workspace, branch, paths, and resources satisfy the claim schema;
- no different live claim already owns the Ticket.

When the Run Receipt contains a `Tracker Policy` ([`outcome-closure.md`](outcome-closure.md#tracker-policy)), the helper also verifies that `changed_paths` and `shared_interfaces` do not overlap `tracker_paths`, rejects new claims while `pending_tracker_updates` remain under `per_ticket` scope, and rejects dependent claims whose prerequisites remain in `pending_tracker_updates` under `batched` scope.

The helper appends the claim and increments `coordinator_generation` through the locked Receipt CAS writer, returning the new `coordinator_generation` and `receipt_sha256`. Repeating the same claim with the updated Receipt generation is idempotent. A stale decision, old generation, conflicting owner, or changed claim fails before Receipt mutation.

## Reconcile writer liveness and publish a Resume Capsule

`scripts/publish.py resume-capsule` consumes one current live claim and publishes an off-delivery `Execution Resume Capsule`. It does not terminate an Agent, replace a writer, mutate the Run Receipt, or dispatch work.

```bash
python3 <this-skill-root>/scripts/publish.py resume-capsule \
  --receipt <off-delivery>/run-receipt.json \
  --ticket-id <ticket-id> \
  --writer-state stopped \
  --liveness-evidence <off-delivery>/stop-evidence.txt \
  --artifact-root <off-delivery-or-workspace>/artifacts \
  --output <off-delivery>/resume/resume-capsule.json
```

The helper validates the single live claim, its owner, workspace, branch, phase, Base, and reservations. If the Receipt contains an indexed `Execution Checkpoint Record` ([`execution-artifacts.md`](execution-artifacts.md#execution-checkpoint-records)) for the same claim generation, it rereads the record, Capsule, Checkpoint, and evidence artifacts before adding a compact checkpoint summary.

`--writer-state` has three meanings:

- `live`: require liveness evidence, preserve the current owner, and report `resume_allowed: false`.
- `stopped`: require a regular stop-evidence file and report `resume_allowed: true`.
- `unknown`: require a named `--recheck-event`, preserve the claim, and report `resume_allowed: false`.

Silence, timeout, resource disappearance, or an absent liveness proof never becomes `stopped`. The output is a resume input for the Coordinator workflow; a replacement Agent still receives the original Ticket, branch, workspace, WIP, Base, and evidence only after the writer boundary is established.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall