From e405e7ba23c5d5ba8a647fededbcbc1f3ab7c4b2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Oct 2026 11:50:03 +0000 Subject: [PATCH] fix(demo): turn on the platform's scheduled work for pnpm demo only Since 17.5 the platform arms no package-authored scheduled work unless the deployment sets OS_AUTOMATION_SCHEDULED_WORK_ENABLED, so on 18.1 the six daily sweeps behind M3's inbox reminders register on `pnpm demo` but never arm. Ruling C on #82: the demo boot passes the variable, `pnpm dev` keeps the platform default (off), and the README says what a deployment sets. The demo child gets `true` only when the variable is unset; an exported value, `false` included, is the operator's and wins. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn --- README.md | 4 ++++ scripts/demo.mjs | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 894b003..bd0a90b 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ intention — a fictional multi-entity group, six months of negotiation and a book of contracts already in force, so every list has something on its first screen. Sign in with `admin@objectos.ai` / `admin123`. +`pnpm demo` also turns on the platform's scheduled work, which is off by +default, so the daily reminder sweeps run on the demo book; a deployment that +wants those reminders in the inbox sets `OS_AUTOMATION_SCHEDULED_WORK_ENABLED=true`. + Point the two locales at different databases; they key their rows on localised titles, so seeding one on top of the other gives you both books. diff --git a/scripts/demo.mjs b/scripts/demo.mjs index 7d5ddbb..b8b8a46 100644 --- a/scripts/demo.mjs +++ b/scripts/demo.mjs @@ -63,6 +63,10 @@ import { connect, createServer } from 'node:net'; const DEMO_SEED_ENV_VAR = 'CLM_DEMO_SEED'; const SEED_LOCALE_ENV_VAR = 'OS_SEED_LOCALE'; +// The platform's switch for package-authored scheduled work (off by default +// since 17.5). The demo boot turns it on so the daily sweeps arm and M3's +// reminders reach the inbox; `pnpm dev` keeps the default (issue #82, ruling C). +const SCHEDULED_WORK_ENV_VAR = 'OS_AUTOMATION_SCHEDULED_WORK_ENABLED'; /** * The account name the fixture's `clm_review.reviewer` resolves against. @@ -653,6 +657,10 @@ const startDemo = () => { env: { ...process.env, [DEMO_SEED_ENV_VAR]: '1', + // Only when unset: an exported value, `false` included, is the operator's + // and wins. A value kept only in a `.env*` file does not — `os dev` never + // overrides a variable already in its environment. + [SCHEDULED_WORK_ENV_VAR]: process.env[SCHEDULED_WORK_ENV_VAR] ?? 'true', ...(process.env[SEED_LOCALE_ENV_VAR] === undefined ? {} : { [SEED_LOCALE_ENV_VAR]: process.env[SEED_LOCALE_ENV_VAR] }),