instar 1.3.438 → 1.3.439
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/autonomous/SKILL.md +24 -6
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +20 -10
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +20 -20
- package/upgrades/1.3.439.md +23 -0
- package/upgrades/side-effects/autonomous-setup-race-hardening.md +56 -0
|
@@ -75,7 +75,20 @@ if json.dumps(hooks) != before:
|
|
|
75
75
|
|
|
76
76
|
**2b. Write the state file DIRECTLY** (do NOT shell out to bash — the session ID env var is only available inside Claude Code):
|
|
77
77
|
|
|
78
|
-
Use the **Write tool** to create `.instar/autonomous
|
|
78
|
+
Use the **Write tool** to create the **per-topic** state file `.instar/autonomous/<topicId>.local.md`,
|
|
79
|
+
where `<topicId>` is the `report_topic` value you set below (the Telegram topic id you already know
|
|
80
|
+
in-context). For example, if `report_topic` is `19437`, write `.instar/autonomous/19437.local.md`.
|
|
81
|
+
|
|
82
|
+
**WHY PER-TOPIC (setup-race hardening):** the stop hook reads this per-topic file **directly**
|
|
83
|
+
(`.instar/autonomous/<topicId>.local.md`) — it is the canonical state path, keyed on topic so
|
|
84
|
+
multiple topics run concurrent autonomous jobs without collision. Writing the per-topic path here
|
|
85
|
+
closes a boot-window race: two autonomous sessions starting near-simultaneously must NOT both write
|
|
86
|
+
the single legacy file `.instar/autonomous-state.local.md` (the hook still migrates that legacy file
|
|
87
|
+
for in-flight older jobs, but new jobs write the per-topic file from the start so there is nothing to
|
|
88
|
+
collide on). If you somehow have no `report_topic`, fall back to `.instar/autonomous-state.local.md`
|
|
89
|
+
(one-at-a-time, back-compat only).
|
|
90
|
+
|
|
91
|
+
Write this content:
|
|
79
92
|
|
|
80
93
|
```markdown
|
|
81
94
|
---
|
|
@@ -197,17 +210,20 @@ The stop hook detects the promise and allows exit.
|
|
|
197
210
|
The user can always stop autonomous mode:
|
|
198
211
|
|
|
199
212
|
1. **Via messaging**: Send "stop everything" or "emergency stop" — the MessageSentinel intercepts
|
|
200
|
-
2. **Via file**: `touch .instar/autonomous-emergency-stop` — the stop hook checks for this
|
|
201
|
-
|
|
213
|
+
2. **Via file**: `touch .instar/autonomous-emergency-stop` — the stop hook checks for this (this flag is
|
|
214
|
+
global, so it halts EVERY topic's autonomous job at once)
|
|
215
|
+
3. **Via cancel**: `/cancel-autonomous` — removes this topic's state file
|
|
202
216
|
|
|
203
217
|
The stop hook checks for emergency stop on EVERY iteration. User safety is never compromised.
|
|
204
218
|
|
|
205
219
|
### /cancel-autonomous
|
|
206
220
|
|
|
207
|
-
To manually cancel:
|
|
221
|
+
To manually cancel THIS topic's job, remove its per-topic state file (substitute the topic id):
|
|
208
222
|
```bash
|
|
209
|
-
rm -f .instar/autonomous
|
|
223
|
+
rm -f .instar/autonomous/<topicId>.local.md
|
|
210
224
|
```
|
|
225
|
+
(Older one-at-a-time jobs may still live at the legacy `.instar/autonomous-state.local.md` — remove
|
|
226
|
+
that instead if the per-topic file is absent.)
|
|
211
227
|
|
|
212
228
|
---
|
|
213
229
|
|
|
@@ -259,7 +275,9 @@ Feeling tired (as an AI) and deferring. **You don't get tired. The hook knows th
|
|
|
259
275
|
|
|
260
276
|
The stop hook is at `.claude/skills/autonomous/hooks/autonomous-stop-hook.sh`.
|
|
261
277
|
|
|
262
|
-
It reads state from `.instar/autonomous
|
|
278
|
+
It reads state from the per-topic file `.instar/autonomous/<topicId>.local.md` (resolving the topic
|
|
279
|
+
from the tmux session), and migrates the legacy single file `.instar/autonomous-state.local.md` into
|
|
280
|
+
the per-topic path on first run for any in-flight older job. It then:
|
|
263
281
|
- Blocks exit if tasks are incomplete
|
|
264
282
|
- Feeds the task list + goal back as the next prompt
|
|
265
283
|
- Increments the iteration counter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostUpdateMigr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 export class PostUpdateMigrator {
|
|
|
1672
1672
|
// (which carry `native-goal/set` but not `IS_CODEX_AGENT`); customized scripts (no stock
|
|
1673
1673
|
// `autonomous-state.local.md` fingerprint) are still left untouched.
|
|
1674
1674
|
upgrade('.claude/skills/autonomous/scripts/setup-autonomous.sh', 'IS_CODEX_AGENT', 'autonomous-state.local.md', 'skills/autonomous/scripts/setup-autonomous.sh (codex native /goal auto-wire)');
|
|
1675
|
-
// SKILL.md
|
|
1676
|
-
//
|
|
1677
|
-
//
|
|
1678
|
-
//
|
|
1679
|
-
//
|
|
1680
|
-
//
|
|
1681
|
-
//
|
|
1682
|
-
//
|
|
1683
|
-
//
|
|
1684
|
-
|
|
1675
|
+
// SKILL.md fixes (cumulative — the upgrade re-deploys the whole bundled SKILL.md, so a
|
|
1676
|
+
// single marker bump carries every fix to date):
|
|
1677
|
+
// (1) Step 2a registration-path fix: the prior bundled SKILL.md registered the stop hook
|
|
1678
|
+
// at `.instar/hooks/instar/autonomous-stop-hook.sh` (a path where the hook is never
|
|
1679
|
+
// deployed → silent Stop-hook failure → the autonomous loop never re-engaged). The
|
|
1680
|
+
// fixed SKILL.md registers the deployed skill path and self-heals any stale entry.
|
|
1681
|
+
// (2) Step 2b per-topic state-file write (setup-race hardening): the prior SKILL.md told
|
|
1682
|
+
// the agent to Write the single legacy file `.instar/autonomous-state.local.md`. The
|
|
1683
|
+
// hook migrates that on first run, but in the boot window before migration two
|
|
1684
|
+
// sessions starting near-simultaneously can both write the legacy file and collide.
|
|
1685
|
+
// The fixed SKILL.md instructs writing the per-topic file the hook reads directly,
|
|
1686
|
+
// `.instar/autonomous/<topicId>.local.md` (keyed on report_topic), so new jobs never
|
|
1687
|
+
// touch the shared legacy path. The hook's reading logic is unchanged (per-topic
|
|
1688
|
+
// preferred, legacy fallback + migrate for in-flight older jobs).
|
|
1689
|
+
// Marker bumped `Stop hook registered (correct skill path)` → `PER-TOPIC (setup-race hardening)`:
|
|
1690
|
+
// the new marker is present ONLY in fix (2)'s version, so an agent that already received
|
|
1691
|
+
// fix (1) (it carries the old marker but not the new one) still gets re-deployed to fix (2).
|
|
1692
|
+
// Customized SKILL.md files (missing the stock `ALL_TASKS_COMPLETE` fingerprint) are left
|
|
1693
|
+
// untouched (idempotent — a second run finds the new marker and no-ops).
|
|
1694
|
+
upgrade('.claude/skills/autonomous/SKILL.md', 'PER-TOPIC (setup-race hardening)', 'ALL_TASKS_COMPLETE', 'skills/autonomous/SKILL.md (per-topic state-file write at setup — closes boot-window race)');
|
|
1685
1695
|
}
|
|
1686
1696
|
/**
|
|
1687
1697
|
* Deploy any missing built-in skills (e.g., guardian job skills added after initial setup).
|