instar 1.3.152 → 1.3.154

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.
@@ -0,0 +1,91 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: minor -->
5
+
6
+ ## What Changed
7
+
8
+ Release notes are now authored as per-PR **fragments** instead of a single shared
9
+ `upgrades/NEXT.md`. Each PR drops its release note at `upgrades/next/<slug>.md`,
10
+ touching a distinct file, so two concurrent PRs never collide on the release
11
+ notes — the bottleneck that made many-agent merges un-landable in real time.
12
+
13
+ A new pure script, `scripts/assemble-next-md.mjs`, folds every fragment (sorted
14
+ deterministically by filename) — plus any legacy `upgrades/NEXT.md`, for backward
15
+ compatibility — into a single `upgrades/NEXT.md`, merging by section: one What
16
+ Changed, one What to Tell Your User, one Summary of New Capabilities, one Evidence,
17
+ each being the concatenation of that section across all inputs. Non-canonical
18
+ sections are preserved and appended. The emitted bump directive is the highest tier
19
+ among the fragments (major beats minor beats patch); it is a documentation hint only
20
+ — the real release tier still comes from `.instar/release-tier.json`, which is
21
+ untouched.
22
+
23
+ The publish workflow gains ONE new step, "Assemble release-note fragments", placed
24
+ immediately before the existing "Check if NEXT.md has content to publish" step.
25
+ Everything downstream — the tier gate, version resolution, the rename, the upgrade
26
+ guide check, publish, and commit — is unchanged. With no fragments and no legacy
27
+ NEXT.md, the assemble step does nothing and the existing skip logic fires exactly as
28
+ before, so the no-fragments path reproduces current behavior byte-for-byte. After a
29
+ release is cut, consumed fragments are deleted (`rm -f upgrades/next/*.md`) and the
30
+ existing commit step stages the deletions. The pre-push gate is now fragment-aware:
31
+ it validates the assembled result in-memory (never writing NEXT.md to disk during
32
+ pre-push), so a PR that ships only a fragment passes the same section and content
33
+ checks the publish gate enforces, and a malformed fragment fails the push loudly.
34
+ `upgrades/NEXT.md` remains fully supported as a legacy, backward-compatible path.
35
+
36
+ ## What to Tell Your User
37
+
38
+ If you run a Codex-based agent, it can now run in autonomous mode and keep itself going across
39
+ many turns until the goal is met — the same way a Claude agent does. Before, a Codex agent in
40
+ autonomous mode would quietly stop after a single turn. Nothing to configure; it applies on the
41
+ next update, and Claude agents are unaffected.
42
+
43
+ Behind the scenes, the way I prepare release notes got a lot more robust. Each
44
+ change now writes its own small note in its own file, instead of every change
45
+ fighting over one shared notes file. That means when several updates are being
46
+ prepared at the same time, they no longer block each other, so improvements reach
47
+ you faster and with less risk of a release getting stuck. Nothing changes about how
48
+ I talk to you — this is purely a smoother release pipeline on my side.
49
+
50
+ ## Summary of New Capabilities
51
+
52
+ - `setup-autonomous.sh` now enables native /goal delegation for Codex agents (detected via config
53
+ `enabledFrameworks` containing `codex-cli`), not just Claude Code >= 2.1.139. Codex autonomous
54
+ mode auto-delegates to native /goal; the stop-hook's existing `goal_mode:native` branch defers.
55
+ - `PostUpdateMigrator` marker bump (`native-goal/set` → `IS_CODEX_AGENT`) re-deploys the fixed
56
+ setup script to existing agents.
57
+
58
+ | Capability | How to Use |
59
+ |-----------|-----------|
60
+ | Per-PR release-note fragments | Write `upgrades/next/<slug>.md` (one file per change) |
61
+ | Fragment assembler | `node scripts/assemble-next-md.mjs` (runs automatically in publish) |
62
+ | Legacy NEXT.md | Still supported — folded in for backward compatibility |
63
+
64
+ ## Evidence
65
+
66
+ - Root cause traced by reading setup-autonomous.sh: the native /goal hand-off existed but was
67
+ gated on `claude --version >= 2.1.139` (empty for a codex agent → codex fell to the dark
68
+ Phase-1 no-op). Proven live in round 2 that codex /goal sustains 1→2→3 across turns.
69
+ - Unit: `tests/unit/autonomous-codex-native-goal-detection.test.ts` — both sides of the
70
+ decision boundary (codex enables, Claude/absent skips, multi-framework enables, missing config
71
+ best-effort skips).
72
+ - Unit: `tests/unit/PostUpdateMigrator-autonomousStopHook.test.ts` — a prior native-/goal setup
73
+ is re-deployed by the marker bump; all existing cases stay green (8 tests).
74
+ - `tsc --noEmit` + `npm run lint` clean.
75
+ - Spec: `docs/specs/codex-autonomy-native-goal-autowire.md` (+ `.eli16.md`).
76
+ - Side-effects: `upgrades/side-effects/codex-autonomy-native-goal-autowire.md`.
77
+ - Final proof is the live drive: Codey running the real /autonomous skill and sustaining multi-turn.
78
+
79
+ ## What Changed — Codex agents now run autonomous mode on their own (Claude parity)
80
+
81
+ When you put an agent in autonomous mode, it should keep working across many turns until the job
82
+ is done. Claude agents already did this (via the stop hook). Codex agents did NOT — they would
83
+ quietly stop after one turn. Codex actually has its own way to sustain a multi-turn run (its
84
+ built-in /goal loop), and instar already handed the goal off to it automatically — but only
85
+ behind a check for "Claude command-line version 2.1.139+", which is empty for a Codex agent. So
86
+ Codex agents fell through that Claude-shaped gate and never got the hand-off.
87
+
88
+ This adds a small framework-aware fallback: if the Claude check doesn't apply, instar detects a
89
+ Codex agent (from its own config) and hands the goal to Codex's native /goal loop. Now a Codex
90
+ agent in autonomous mode sustains multi-turn work automatically, the same as a Claude agent. The
91
+ Claude path is unchanged, and the sensitive stop hook is untouched.
@@ -0,0 +1,43 @@
1
+ # Side-effects — Codex autonomous native /goal auto-wire
2
+
3
+ ## 1. What files/state does this touch at runtime?
4
+ `.claude/skills/autonomous/scripts/setup-autonomous.sh` (skill content). At autonomous-mode
5
+ activation on a CODEX agent, it now additionally POSTs `/autonomous/native-goal/set` (which the
6
+ script already did for Claude>=2.1.139) — injecting `/goal <completion_condition>` into the
7
+ session and marking the job `goal_mode:native` in `<topic>.local.md`. No new files, no config
8
+ keys, no schema. The PostUpdateMigrator re-deploys the script to existing agents (marker bump).
9
+
10
+ ## 2. Does it change any functional behavior?
11
+ - **Claude agents:** none. The Claude version gate is untouched; the codex check only runs when
12
+ the Claude gate already failed.
13
+ - **Codex agents:** a codex autonomous job now auto-delegates to native `/goal` (previously it
14
+ fell through to the dark Phase-1 codexLoopDriver no-op and silently never sustained multi-turn).
15
+ The stop-hook's existing `goal_mode:native` branch then defers to native `/goal`.
16
+
17
+ ## 3. What happens on failure / weird config?
18
+ Best-effort: the detection one-liner is `... 2>/dev/null || echo "0"`, so a missing/malformed
19
+ config.json or absent python → `0` → not-codex → exactly the prior behavior (no regression). A
20
+ codex agent whose native `/goal` POST fails → the script prints "Native /goal: unavailable" and
21
+ instar's own completion evaluator drives (the existing fallback).
22
+
23
+ ## 4. Migration parity — do existing agents get it?
24
+ Yes. `migrateAutonomousStopHookTopicKeyed` marker bumped `native-goal/set` → `IS_CODEX_AGENT`,
25
+ so prior native-/goal installs are re-deployed; customized scripts (no stock fingerprint) are
26
+ left untouched; already-updated agents skip (idempotent). New agents get it via installAutonomousSkill.
27
+
28
+ ## 5. Could it spam / flood / burn resources?
29
+ No. It adds at most one extra `python3` config read + (for codex) one `native-goal/set` POST,
30
+ once, at autonomous-mode activation — the same POST the script already made for Claude.
31
+
32
+ ## 6. Rollback / off-switch?
33
+ Revert the PR. The marker would revert too; a reverted-version agent retains `native-goal/set`
34
+ (still functional for Claude). No residual state, no flag.
35
+
36
+ ## 7. Concurrency / ordering?
37
+ None new. Runs inline in the single setup-autonomous.sh activation flow, after the Claude gate.
38
+
39
+ ## Blast radius
40
+ Small + additive, codex-only. One ~5-line fallback in setup-autonomous.sh + one migration marker
41
+ bump in PostUpdateMigrator. No change to the sensitive stop-hook (the goal_mode:native defer
42
+ already existed), no change to the Claude path. Mirrors the #604/#609 codex framework-additive
43
+ pattern. The codexLoopDriver:true config footgun is a separate low-pri follow-up (#40 notes).
@@ -0,0 +1,151 @@
1
+ # Side-Effects Review — Per-PR release-note fragments
2
+
3
+ **Version / slug:** `nextmd-release-note-fragments`
4
+ **Date:** `2026-05-31`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `required` (release-pipeline blast radius — see §1, §7)
7
+
8
+ ## Summary of the change
9
+
10
+ The release pipeline consumed a single shared `upgrades/NEXT.md` per merge. With
11
+ many agents merging concurrently, every PR rewrote NEXT.md, so every PR collided on
12
+ it within minutes — the release notes became an un-landable hot file. This change
13
+ introduces per-PR release-note FRAGMENTS (`upgrades/next/<slug>.md`): two PRs touch
14
+ different fragment files and never collide.
15
+
16
+ The mechanism is an ASSEMBLE PRE-STEP. A new pure script
17
+ (`scripts/assemble-next-md.mjs`) folds every fragment (deterministic filename sort)
18
+ plus any legacy `upgrades/NEXT.md` into a single `upgrades/NEXT.md`, merging by
19
+ section. The publish workflow runs it immediately BEFORE the existing
20
+ "Check if NEXT.md has content to publish" step; everything downstream is unchanged.
21
+ The pre-push gate validates the assembled result in-memory (never writing NEXT.md).
22
+
23
+ ## Decision-point inventory
24
+
25
+ 1. **No-fragments / no-legacy-NEXT.md → no-op (exit 0 quietly).** The existing skip
26
+ logic then fires. This is the load-bearing backward-compat boundary.
27
+ 2. **Malformed fragment (content but no parseable `## ` section, or only
28
+ comments/whitespace) → loud non-zero exit.** Fails the workflow rather than
29
+ shipping a broken guide.
30
+ 3. **Idempotency guard:** an input carrying `GENERATED_MARKER` is dropped when any
31
+ non-generated input is present; folded straight through (stable re-emit) when it
32
+ is the sole input. Decides "is this a fresh fragment set or a re-run on prior
33
+ output?"
34
+ 4. **Bump tier = MAX(fragments).** A hint only; the real tier is
35
+ `.instar/release-tier.json` (untouched).
36
+ 5. **pre-push gate active-guide selection:** assembled in-flight notes win; else fall
37
+ back to the versioned guide; else "no guide" error.
38
+
39
+ ## 1. Over-block
40
+
41
+ **What legitimate inputs does this change reject?** A fragment with real prose but no
42
+ `## ` heading is rejected — intentional, because the assembler can't place headless
43
+ prose under a known section. An effectively-empty fragment (comments/whitespace only)
44
+ is rejected — intentional, an empty fragment file is a mistake. A hand-authored legacy
45
+ `upgrades/NEXT.md` is NOT rejected: it is folded in (backward compat). The
46
+ no-fragments-and-no-NEXT.md case is NOT an error — it is a clean exit-0 no-op, so the
47
+ existing "nothing to publish" skip is preserved exactly. **No legitimate current input
48
+ is newly rejected:** today's flow ships a NEXT.md, which still validates and publishes
49
+ unchanged.
50
+
51
+ ## 2. Under-block
52
+
53
+ **What does this still miss?** The assembler does not deep-validate each fragment's
54
+ section CONTENT (camelCase keys, inline code, missing Evidence) — that remains the job
55
+ of `validateGuideContent`, which runs against the ASSEMBLED result in both the pre-push
56
+ gate and (post-rename) `check-upgrade-guide.js`. So a defect in a fragment is caught at
57
+ the assembled layer, not per-fragment; this is acceptable because the assembled doc is
58
+ exactly what publishes. It does not detect two fragments making contradictory claims —
59
+ out of scope (humans review notes). It does not garbage-collect stale fragments that
60
+ were never released; the publish path deletes only the fragments it just consumed.
61
+
62
+ ## 3. Level-of-abstraction fit
63
+
64
+ **Right layer?** Yes. The assembler is a pure string→string function with a thin CLI
65
+ wrapper (same shape as `resolve-release-tier.mjs` / `resolve-publish-version.mjs`),
66
+ unit-tested in isolation. The workflow change is one additive step plus one `rm` in the
67
+ existing consumption path — it does not touch the tier gate, version resolution, rename,
68
+ guide check, publish, or commit logic. The pre-push gate reuses the SAME assemble
69
+ function (single source of truth), so pre-push and publish can never diverge on how
70
+ fragments fold.
71
+
72
+ ## 4. Signal vs authority compliance
73
+
74
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
75
+
76
+ No new blocking AUTHORITY over releases is added. The assembler is a transform, not a
77
+ gate: its only failure mode is a malformation (exit non-zero), which is the same loud
78
+ behavior the publish workflow already wants. The real publish AUTHORITY is unchanged —
79
+ `.instar/release-tier.json` (Layer 2) and `validateGuideContent` (the section/content
80
+ gate) still decide what ships. The emitted bump comment is explicitly a documentation
81
+ SIGNAL, not authority (the code comment and the artifact both say so).
82
+
83
+ ## 5. Interactions
84
+
85
+ - **UpgradeGuideProcessor**: scans `upgrades/` for files matching
86
+ `^(\d+\.\d+\.\d+)\.md$`. `readdirSync` returns the subdir name `next` (no `.md`
87
+ suffix) → not matched → ignored. Verified by reading `getAvailableGuides`. The
88
+ `upgrades/next/` directory is invisible to guide delivery.
89
+ - **check-upgrade-guide.js**: iterates `upgrades/*.md` files (skips `NEXT.md`); the
90
+ `next/` subdir is not a `.md` file → skipped. By publish time fragments are already
91
+ deleted and NEXT.md renamed, so it validates the assembled+renamed guide. Verified
92
+ end-to-end in a scratch dir (assemble → rename → check → exit 0).
93
+ - **pre-push-gate.js**: now imports the assembler; assembles in-memory; the side-effects
94
+ artifact check (§5 of the gate) reads the assembled "What Changed" instead of raw
95
+ NEXT.md. No NEXT.md is written during pre-push.
96
+ - **Idempotency / re-runs**: the `GENERATED_MARKER` guard prevents a re-run from
97
+ double-folding prior output back over still-present fragments.
98
+ - No interaction with SessionReaper, sentinels, recovery, or any runtime path — this is
99
+ build/CI tooling only.
100
+
101
+ ## 6. External surfaces
102
+
103
+ - New directory `upgrades/next/` and new file convention `upgrades/next/<slug>.md`.
104
+ - New script `scripts/assemble-next-md.mjs` (build-time only; never shipped to agent
105
+ runtime paths).
106
+ - One new publish workflow step + one `rm` in the existing rename step.
107
+ - New CLAUDE.md / build-skill guidance instructing fragment authoring; a
108
+ `PostUpdateMigrator` CLAUDE.md backfill for deployed agents.
109
+ - No HTTP routes, no config keys, no Telegram, no agent runtime behavior change.
110
+
111
+ ## 7. Rollback cost
112
+
113
+ **Low and clean.** Three independent revert points, each safe on its own:
114
+ - Remove the "Assemble release-note fragments" workflow step + the `rm` line → publish
115
+ reverts to consuming NEXT.md directly (NEXT.md authoring still works).
116
+ - Revert the pre-push gate to validating NEXT.md directly.
117
+ - Delete `scripts/assemble-next-md.mjs` + its test.
118
+ Because the no-fragments path is a byte-for-byte no-op, a half-rollback (e.g. removing
119
+ only the workflow step while authors still write fragments) degrades gracefully: the
120
+ release simply skips (no NEXT.md), which the release-readiness sentinel surfaces — it
121
+ never ships a wrong or partial guide. No state, no schema, no irreversible op, no data
122
+ migration. Fragments are plain markdown files.
123
+
124
+ ## Conclusion
125
+
126
+ Additive, backward-compatible, pure-function-at-the-core change to build/CI tooling.
127
+ The release-critical invariant — "the no-fragments path reproduces exact current
128
+ behavior" — is enforced by code (clean exit-0 no-op) and covered by tests (CLI exits 0
129
+ and writes nothing; pre-push accepts a fragment-only push and rejects a malformed one).
130
+ Blast radius is contained to the assemble pre-step; the tier gate, version resolution,
131
+ and content validation that actually authorize a release are untouched.
132
+
133
+ ## Second-pass review (if required)
134
+
135
+ Required (release-pipeline). Reviewer focus: confirm the publish.yml diff is additive
136
+ (the assemble step precedes the unchanged skip-check; the `rm` rides the existing
137
+ `if:` guard and the existing `git add upgrades/`), and that the no-fragments path still
138
+ skips cleanly. Pending.
139
+
140
+ ## Evidence pointers
141
+
142
+ - `tests/unit/assemble-next-md.test.ts` — 25 tests: section merge, deterministic order,
143
+ max bump tier, single fragment, legacy fold, no-op/quiet, malformed→loud, idempotent
144
+ (in-memory + on-disk CLI), WTTYU backtick-free.
145
+ - `tests/unit/pre-push-gate.test.ts` — fragment-aware integration: accepts fragment-only
146
+ push (writes no NEXT.md), rejects WTTYU inline code via assembled validation, rejects
147
+ malformed fragment loudly.
148
+ - Manual end-to-end (scratch dir): fragment → `assemble-next-md.mjs` →
149
+ `mv NEXT.md <version>.md` + `rm next/*.md` → `check-upgrade-guide.js` exit 0.
150
+ - `upgrades/next/release-note-fragments.md` — this PR's own release note (dogfoods the
151
+ mechanism; the PR does not touch `upgrades/NEXT.md`).