โœจ feat: the lock reads niyam names, old ones too (P-50)

Merged
AT
24d ago
+589-218

P-50 of W-39 (athya-hq/athya_mono#3210): what P-17's lock reads takes niyam's names, and the old ones are still read. The owner approved this part on its own with a ๐Ÿ‘ on #227. P-49 (#234) has merged.

Keychain

  • The agent's token is stored under service niyam. read tries niyam, then process-rules.
  • machine copies a token found only under process-rules to niyam (a plan line, token copied to service niyam, account <agent>). It leaves the old entry, so an older CLI on the Mac still reads it.
  • The session file reads niyam, then process-rules. A session file an older release wrote, which reads process-rules alone, still counts for session-start and as-agent (sessionFileIs โ†’ older). doctor marks it โ–ฒ session file from an older release; it still works โ†’ niyam machine. So no session locks out between upgrade and machine.

Settings file

  • .github/niyam.json, with .github/process-rules.json read where it is missing. This covers loadSettings (session-start, guard, as-agent, doctor), the work rules, design, features, asks and the shared checks' Settings step. Errors name the file actually read.
  • onboard writes .github/niyam.json only in a repo that has neither. It keeps an existing .github/process-rules.json, which older CLIs and athya_mono's brief-issue.ts read.

Unchanged in P-17 and P-18: the lock's placeholder token, the SSH refusal, ~/.config/process-rules, the launcher and PROCESS_RULES_AGENT.

Tests for each fallback read:

  • token under the old service only, under both, under neither;
  • copy on machine, and a refused copy;
  • older session file in session-start, doctor and sessionFileIs;
  • settings: new only, old only, both (new wins), neither;
  • onboard keeping the old file;
  • the shared checks' Settings step under each name.

pnpm check passes: 1174 tests. No version bump; the coordinator releases.

Slice: #227

๐Ÿค– Generated with Claude Code


Summary by cubic

Updates the lock to read niyam's names while still accepting the pre-rename ones, so a repo or Mac set up before niyam keeps working without locking out.

Behavior

  • The token is stored under keychain service niyam. A token found only under process-rules is still read, and machine copies it to niyam while leaving the old entry for older CLIs; while the old entry is present, a new token is stored under both names.
  • The settings file is now .github/niyam.json, with .github/process-rules.json read everywhere the new one is missing. onboard keeps an existing old file, and agentHere, design warnings, renamed-feature lines, and the workflow schedule comment name the settings file actually read.
  • Session files an older release wrote still count for session-start and as-agent; doctor marks them as older until machine rewrites them.