@cspeach/cli 1.1.14 → 1.1.15

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.
@@ -371,6 +371,26 @@ export async function runSaveCommand(args) {
371
371
  if (spec.artefactType === 'plan')
372
372
  writePlanHandover(path, args.log);
373
373
  args.log(`Saved: ${path}`);
374
+ // Project Register (2026-09-18): when this laptop has joined a project, a
375
+ // decision / fix record is written to the LOCAL outbox as a by-product of the
376
+ // save. No project joined → `activeProject()` is one missing-file read and
377
+ // nothing else happens. A record failure never fails the save.
378
+ try {
379
+ const { activeProject } = await import('../register/store.js');
380
+ const joined = activeProject();
381
+ if (joined) {
382
+ const { recordFromEnvelope } = await import('../register/records.js');
383
+ const res = recordFromEnvelope(env, path, joined, { name: args.author.name }, args.cwd);
384
+ if (res?.file)
385
+ args.log(`Recorded for team project ${joined.projectId}: ${res.written} objects → ${res.file}`);
386
+ if (res?.refused.length) {
387
+ args.log(`Not recorded (${res.refused.length} not in the team project's object list): ${res.refused.slice(0, 5).join(', ')}${res.refused.length > 5 ? ', …' : ''}`);
388
+ }
389
+ }
390
+ }
391
+ catch (e) {
392
+ args.log(`(team project record not written: ${e instanceof Error ? e.message : String(e)})`);
393
+ }
374
394
  if (planExtract && prior) {
375
395
  args.log(`(revision v${env.version} of the existing plan — version chain preserved, no new id)`);
376
396
  }