✨ feat: the lock and this Mac's files say niyam (P-55)

Merged
AT
23d ago
+1080-169

Slice: #266

The lock and this Mac's files use niyam's names. Every old name is still read until P-57 (#268). The owner asked in chat on 2026-11-11, "I want to fix everything", and approved this with a šŸ‘.

Config folder

  • ~/.config/niyam/ holds the agent folders, session records and locked/gh. The launcher is ~/.config/niyam/bin/niyam.
  • machine and session-start write only the new place.
  • Every reader takes the new place, then the old: the session file, the session record (guard, as-agent), agentsSetUp, lockout's lists, and doctor's launcher check. When a new record exists, it wins.
  • machine leaves ~/.config/process-rules and the old launcher in place. upgrade repoints both launchers.

Agent variable

  • Sessions get NIYAM_AGENT, with PROCESS_RULES_AGENT still set beside it: in the session script, as-agent's env and the cloud session's env file.
  • Every reader goes through agentIn, which takes either: doctor, onboard's agent-session refusal, and agentSession (pre-push, owner-step). A reader that missed one would take an agent session for the owner.

Lock text

  • The placeholder token is niyam-no-agent-token, and isNoToken counts both placeholders (cloud.ts, work.ts).
  • The SSH refusal says niyam:, and the headers say "Written by niyam machine" / "Written by niyam session-start".

Hooks

  • They try the new launcher, then the old, then niyam on PATH. The pre-push hook counts NIYAM_AGENT or PROCESS_RULES_AGENT.
  • 0.6.8's and 0.6.9's texts join the older lists, so onboard replaces them in place, and as-agent's OWN_COMMANDS still covers them.
  • The env plan says "update … to this release's lock" for a repo already locked.

Doctor and older files

  • A 0.6.9 session file and record count, so a session started before the upgrade keeps working with no machine run. A test covers exactly that, with the token under the old keychain service only.
  • doctor marks ā–² a Mac with only the old folder or old launcher.

Tests: src/older-texts.test.ts freezes 0.6.9's texts, checked against this repo's deployed settings and hook. The new tests cover every fallback read and the mixed states: the hooks in a real sh, each variable alone, and both tokens. pnpm check passes: 1317 tests, 99.56% lines.

Left for P-56 (#267): the workflow, cloud path, settings file, onboard branch, template and other internal names. Recorded in docs/decisions.md; the README is updated.

šŸ¤– Generated with Claude Code


Summary by cubic

Renames the lock and this Mac's local files from process-rules to niyam, still reading every old name until P-57.

  • machine and session-start write ~/.config/niyam/ — agent folders, session records, the locked gh folder, and the launcher ~/.config/niyam/bin/niyam — and every reader takes the new place, then the old.
  • Agent sessions get NIYAM_AGENT beside PROCESS_RULES_AGENT; readers accept either.
  • The lock's placeholder token is now niyam-no-agent-token; both placeholders count as no token, and the SSH refusal and header texts say niyam:. The hooks try the new launcher, then the old, then niyam on PATH.

Compatibility

  • machine leaves the old folder and launcher in place; upgrade repoints both launchers.
  • doctor now checks the old launcher beside the new one, marking ā–² a Mac with only the old folder or launcher and āœ— one whose launcher cannot run or still runs process-rules.
  • The lockout spares only agent folders' signing keys, including an agent whose login is bin, sessions, or locked, and no longer exempts an owner key named like the config folders' bin, sessions, or locked entries.
  • A session file or record that 0.6.9 wrote still counts, so a session started before the upgrade keeps working with no machine run.
  • onboard replaces 0.6.9's hooks and lock texts in place.