You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9dac92a
Browse filesBrowse the repository at this point in the historyBrowse files
agent-dev: pre-check block v3 — always fire, never override (v1.3.2)
FixesAbilityai/trinity#955. v2 of the scaffolded ~/.trinity/pre-check
emitted "pipeline-tick: <reason>" when work was pending, which Trinity
applies as a message override to whichever schedule called the pre-check
— hijacking unrelated schedules (digests, heartbeats, batch jobs) into
running pipeline-tick logic instead of their own work. v3 strips the
block to a single `echo "fire"`; work-detection lives inside pipeline-tick
where it only affects pipeline-tick. Migration auto-rewrites both v1
(silenced schedules with empty stdout) and v2 (hijacked with override)
blocks to v3.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|`~/.trinity/pipelines/<slug>.yaml`| user home | write-through copy — Trinity's read surface |
31
31
|`~/.trinity/pipeline-state/<slug>/`| user home | per-instance state, read by dashboards and other agents |
32
-
|`~/.trinity/pre-check`| user home |advisory marker — emits a reason when pipeline-tick has work, always fires the schedule otherwise (see Step 6 for why) |
32
+
|`~/.trinity/pre-check`| user home |heartbeat gate — always emits `fire` so every schedule runs; never emits a message override (see Step 6 for why) |
33
33
|`dashboard.yaml` panel | agent repo (if present) | Trinity UI shows a row per instance |
@@ -162,9 +162,14 @@ date -u +%Y-%m-%dT%H:%M:%SZ > "$HOME/.trinity/pipelines/$SLUG.last_synced"
162
162
163
163
### Step 6: Extend ~/.trinity/pre-check
164
164
165
-
The pre-check script emits an advisory reason when pipeline-tick has work pending. **It always fires the schedule** — skip logic belongs inside pipeline-tick itself, not here. Multiple pipelines coexist by sharing one script with a single managed block (it scans every `~/.trinity/pipeline-state/*/*.json`).
165
+
The pre-check script always emits `fire` so the heartbeat schedule runs. It never emits a message override. Skip / work-detection logic belongs inside pipeline-tick itself, not here. Multiple pipelines share one script with a single managed block — no per-pipeline edits needed.
166
166
167
-
> ⚠️ **Why this constraint matters.** Trinity's pre-check API is **agent-global** — the same `~/.trinity/pre-check` is consulted before every scheduled skill on the agent, not just pipeline-tick. If the block ever returns empty stdout, Trinity silences **every** schedule on the agent (digests, heartbeats, batch jobs, the lot). Earlier versions of this template made that mistake. The block default MUST be `echo "fire"`.
167
+
> ⚠️ **Why this constraint matters.** Trinity's pre-check API is **agent-global** — the same `~/.trinity/pre-check` is consulted before every scheduled skill on the agent, not just pipeline-tick. Two failure modes both silently hijack unrelated schedules:
168
+
>
169
+
> 1.**Empty stdout** silences every schedule on the agent (digests, heartbeats, batch jobs, the lot). v1 of this template made this mistake.
170
+
> 2.**Any non-`fire`/`skip` stdout becomes the message override** applied to whichever schedule called the pre-check — overwriting the intended message of unrelated schedules and making them run whatever the override text says (e.g. `pipeline-tick`) instead of their own work. v2 of this template made this mistake.
171
+
>
172
+
> The block must emit exactly `echo "fire"` — nothing else.
168
173
169
174
```bash
170
175
PRE_CHECK="$HOME/.trinity/pre-check"
@@ -179,12 +184,16 @@ if [ ! -f "$PRE_CHECK" ]; then
179
184
fi
180
185
181
186
# Migrate or install the block
182
-
if grep -q "BEGIN add-pipeline block v2""$PRE_CHECK";then
183
-
echo"add-pipeline block v2 already present in pre-check — skipping."
187
+
if grep -q "BEGIN add-pipeline block v3""$PRE_CHECK";then
188
+
echo"add-pipeline block v3 already present in pre-check — skipping."
| pre-check has un-marked content | Append our block but warn the user to review |
319
-
| pre-check has v1 add-pipeline block (no `v2` marker) | Auto-rewrite to v2 (v1 emitted empty stdout when idle, silencing every other schedule on the agent — see Step 6) |
328
+
| pre-check has v1 or v2 add-pipeline block (no `v3` marker) | Auto-rewrite to v3 (v1 silenced other schedules with empty stdout; v2 hijacked other schedules with a `pipeline-tick:` message override — see Step 6) |
0 commit comments