Skip to content

The machine-level block points every session at the instruction render (#445) - #449

Merged
tonite31 merged 1 commit into
mainfrom
fix/445-machine-block-render
Sep 4, 2026
Merged

The machine-level block points every session at the instruction render (#445)#449
tonite31 merged 1 commit into
mainfrom
fix/445-machine-block-render

Conversation

@tonite31

@tonite31 tonite31 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Closes #445

What changed

renderMachineBlock (apps/cli/src/connect.ts), the template connectMachine writes into ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md and ~/.gemini/GEMINI.md, gains one bullet directly after the self context bullet, wrapped to the block's own width and matching the wording BLOCK_BODY already uses for the project-level block:

  • Also run self instruction render and follow it: the workspace's execution rules, tool notes and procedures, rendered whole outside the context budget. Outside a registered project, self instruction render --project <slug>. If it prints only its head line, none are recorded yet.

Does the machine block refresh on version change?

No, and this PR does not add that. refreshBlocks (the project block's path) is called from foldProject, so a project's AGENTS.md/CLAUDE.md is rewritten to the current template on nearly every write command, version mismatch or not — upsertBlock doesn't even compare versions, it just always replaces whatever sits between the markers. The machine-level block has no equivalent caller: connectMachine only runs from an explicit self init (when the agents question is answered yes) or an explicit self connect --global. An existing machine file carrying the old block sits stale until one of those is run by hand; nothing today detects the stale version marker and offers a refresh. That's a separate gap from #445 and is left alone here.

Case table

docs/maintainers/case-tables/440-instructions.md gains cell G17, numbered after G16, asserting the whole bullet lands in all three machine files after self connect --global. The group table's G row and the designed-cells count (147 → 148) are updated, and a new "added for #445" entry documents the cell.

Golden fixture

test/fixtures/golden/piped.txt regenerated with node test/golden.mjs --write — the only diff is the new bullet inside the self connect --global section. That triggered a real fix: golden.test.mjs's G3 test asserted every instruction-naming line in the fixture came from the root usage listing (plus one exempted receipt phrase); the new bullet's two instruction-naming lines now legitimately live inside the machine block, so G3's exemption widens to admit any line inside the block's own begin/end markers.

Docs

Grepped docs/ and apps/cli/README.md for text that quotes the machine block's individual bullets (as opposed to summarizing the block generally) — none found, so no doc changes beyond the case table.

Gates run

  • pnpm --filter superself typecheck — pass
  • pnpm --filter superself build — pass
  • node test/structure.mjs — pass
  • node --test test/guide.test.mjs test/docs.test.mjs test/golden.test.mjs test/instruction-context.test.mjs test/init-mode.test.mjs — 112/112 pass

CI runs the full suite on this PR.

🤖 Generated with Claude Code

…render, beside the self context bullet it already carried.

Cell G17 in docs/maintainers/case-tables/440-instructions.md covers it, golden.test.mjs's G3 scope widens to admit the machine block's own instruction mentions, and the golden fixture is regenerated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: rayim <rayim@inflike.com>
@tonite31
tonite31 merged commit f41ead3 into main Sep 4, 2026
3 checks passed
@tonite31
tonite31 deleted the fix/445-machine-block-render branch September 4, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The machine-level managed block does not point a session at self instruction render

2 participants