Skip to content
Back to skills

Execution Engine

ASecurity

Skill-native CocoFlow transcript completion-event reader. Replaces the former flow-event-reader runtime helper.

  • 724 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 5, 2026
ai-agents

Works with

  • terminal

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add Snowflake-Labs/cocoplus --skill execution-engine --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Execution Engine?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Execution Engine
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snowflake-labs-execution-engine-cocoplus/badge)](https://www.skillsdirectory.com/skills/snowflake-labs-execution-engine-cocoplus)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "flow-event-reader"
description: "Skill-native CocoFlow transcript completion-event reader. Replaces the former flow-event-reader runtime helper."
version: "2.0.1"
author: "CocoPlus"
tags:
  - cocoplus
  - execution-engine
  - skill-native
---

Your objective is to correct background CocoPod completion timestamps from authoritative transcript queue records.

## Inputs

Accept direct arguments or a queued request from `.cocoplus/v2-runtime-requests.jsonl`:

- `transcript_path`
- `flow_state` (default `.cocoplus/lifecycle/flow-state.json`)
- `idempotency_key`

## Timestamp Precedence

Use transcript-derived completion records as the strongest source:

1. `completed_at` from a terminal transcript record
2. `timestamp` from a terminal transcript record
3. `enqueued_at` only when no completion timestamp exists
4. existing hook/tool-result timing as fallback

Do not overwrite transcript-derived timestamps with hook timing. If a pod already has `completion_source: "enqueue_record"` and `completion_timestamp_reliable: true`, preserve it unless a newer transcript record for the same pod has an explicit terminal `completed_at`.

## Procedure

1. Read the existing flow-state JSON if present; otherwise start with `{ "pods": [] }`.
2. Read the transcript JSONL line by line.
3. Identify queue/subagent completion records using named fields only:
   - `subagent_id`, `pod_id`, `agent_id`, or `task_id`
   - `status`, `event`, or `type`
   - `completed_at`, `timestamp`, or `enqueued_at`
4. For each terminal completion event (`completed`, `failed`, `exited`, `cancelled`), update the matching pod record:
   - `completed_at`
   - `completion_source: "enqueue_record"`
   - `completion_timestamp_reliable: true`
5. If a pod has only hook/tool-result timing, preserve it but mark:
   - `completion_source: "tool_result_fallback"`
   - `completion_timestamp_reliable: false`
6. Write `flow_state` atomically.

## Queue Settlement

When invoked from `.cocoplus/v2-runtime-requests.jsonl`, follow `execution-engine/runtime-queue`:

1. Claim the request using `idempotency_key` or a derived key from `transcript_path` and `flow_state`.
2. Reconcile the flow-state file.
3. Append `completed` settlement with `artifact: flow_state`.
4. Append `failed` if the transcript cannot be read or `flow_state` cannot be written.

## Output

Report:

```text
CocoFlow completion events reconciled.
Pods corrected: <N>
Fallback records retained: <N>
Flow state: <path>
```

## Exit Criteria

- [ ] Transcript-derived completion records set `completion_source`.
- [ ] Fallback records are explicitly marked unreliable.
- [ ] The flow-state file remains valid JSON.
- [ ] Queued requests are settled and can be replayed without duplicating state changes.

## Anti-Rationalization

| Shortcut / Temptation | Why It Fails |
|-----------------------|--------------|
| Treat the skill as complete because the file exists | Skill contracts must describe observable behavior and verification, not just command names. |
| Skip artifact and safety checks for a small command | Small commands still mutate state or guide execution; preserve the same gates. |

Files in this skill

  • flow-event-reader.skill.md3.1 KB
  • flow-gate-clear.skill.md1.6 KB
  • flow-gate-status.skill.md1.4 KB
  • flow-pause.skill.md1.2 KB
  • flow-research.skill.md1.9 KB
  • flow-resume.skill.md1.6 KB
  • flow-run.skill.md23.3 KB
  • flow-settle.skill.md2.1 KB
  • flow-status.skill.md3.4 KB
  • flow-template.skill.md3.4 KB
  • flow-view.skill.md4.3 KB
  • model-tier-resolve.skill.md1.6 KB
  • noop-check.skill.md1.5 KB
  • runtime-queue.skill.md3.3 KB
  • templates/drain-loop.md392 B
  • templates/hitl-gate.md358 B
  • templates/litmus-test.md398 B
  • templates/noop-workflow.md441 B
  • templates/per-project-working-directory.md408 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…