heartbeat-execution-boundaries

heartbeat-execution-boundaries is a cursor rule for Cursor from paperclipai/paperclip. It costs 0 tokens per session (1,596 once invoked), scanned A, original, MIT.

A code-organization rule for a heartbeat service, which coordinates recurring work through distinct lifecycle stages. It defines where the coordinator, supporting modules, and regression tests belong.

In plain words
What is it for?
Use it when adding or changing heartbeat scheduling, queue handling, run preparation, execution settings, or related tests.
Why use it?
It prevents execution authority, resource ownership, and lifecycle behavior from becoming unclear or scattered across the codebase.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when adding or changing heartbeat scheduling, queue handling, run preparation, execution settings, or related tests.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/paperclipai/paperclip/heartbeat-execution-boundaries
About the project

Paperclip is a Node.js server and React application for coordinating AI agents as a business team, with goals, organizational roles, budgets, governance, and work tracking in one interface. It is used by people managing multiple agents or autonomous agent organizations across tools such as OpenClaw, Claude Code, Codex, and Cursor. The catalogue includes skills, agents, an MCP add-on, and an instruction for working with Paperclip.

paperclipai/paperclip · 102,719 stars · on GitHub · paperclip.ing

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/paperclipai/paperclip

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for heartbeat-execution-boundaries

README.md
[![agentmods](https://agentmods.dev/badge/rules/paperclipai/paperclip/heartbeat-execution-boundaries/github.svg)](https://agentmods.dev/rules/paperclipai/paperclip/heartbeat-execution-boundaries)
Your own site
<a href="https://agentmods.dev/rules/paperclipai/paperclip/heartbeat-execution-boundaries"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/heartbeat-execution-boundaries/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for heartbeat-execution-boundaries

Your own site · 80×15
<a href="https://agentmods.dev/rules/paperclipai/paperclip/heartbeat-execution-boundaries"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/heartbeat-execution-boundaries.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,596 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01596
Opus 5.5 $0.00000 $0.00638
Sonnet 5.5 $0.00000 $0.00319
Haiku 4.5 $0.00000 $0.00160

Measured 2d ago against content hash 7f5065f8cc5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

heartbeat-execution-boundaries scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/heartbeat-execution-boundaries.mdc · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Heartbeat execution boundaries

Scope and purpose

This rule covers the heartbeat entry point, its extracted modules, heartbeat-prefixed sibling services, and heartbeat regression tests. Keep the code organized so a reader can follow whether work may start, who owns the execution, and how its outcome and resources settle.

Folder structure and module responsibilities

server/src/services/heartbeat.ts is the public entry point and lifecycle coordinator. Heartbeat-specific modules and their focused *.test.ts tests belong in server/src/services/heartbeat/. Tests that exercise the assembled heartbeat service also live in server/src/__tests__/heartbeat-*.test.ts. Keep these roles distinct: the entry point should make the lifecycle readable, while modules own the behavior of a particular phase or domain.

Use these existing boundaries when deciding where a change belongs. Paths below are relative to server/src/services/heartbeat/:

Modules Responsibility
queue.ts, scheduling.ts Queue admission, coalescing, and dispatch; timer and monitor scheduling.
run-preparation.ts, execution-configuration.ts Run context and tool access; effective execution configuration and credentials.
session-preparation.ts, run-state.ts Session selection and resume preparation; persisted run/session state and retrieval.
workspaces.ts, workspace-preparation.ts Workspace resolution, reuse, and validation; preparing the selected workspace and acquiring its environment.
environment-selection.ts, runtime-selection.ts Execution environment policy; selecting or restoring the execution runtime.
runtime-execution.ts Dispatching prepared work through the runtime and handling its execution result.
run-completion.ts, run-lifecycle.ts Success/failure settlement; shared status transitions, events, and completion handoffs.
run-control.ts, retries.ts, recovery.ts Stop and cancellation; retry scheduling; restart recovery and unfinished cleanup.
task-context.ts, task-markdown.ts Assembling task context and rendering assignment text.
run-output.ts, run-log.ts Per-run output handling; log formatting, redaction, and payload bounds.

Read the full file on GitHub · 130 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 130 lines · 0 tokens per session scan A 7f5065f8cc5f

Subscribe to this mod's changes

heartbeat-execution-boundaries is a cursor rule published in the GitHub repository paperclipai/paperclip (102,719 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,596 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-14.