clawdie-ai/scripts
Operator & Claude Code 75009dcb7f refactor(identity): remove PLATFORM_ID/SERVICE_NAME/RUNTIME_USER env vars
Step 5 of system-namespace cutover: complete the env-var removal that
step 4 set up. All consumers now import SERVICE_NAME from
src/platform-identity.ts directly; the deprecated PLATFORM_*
re-exports in src/config.ts are gone.

src/config.ts:
- PLATFORM_ID, PLATFORM_SERVICE_NAME, PLATFORM_RUNTIME_USER exports
  removed.
- PLATFORM_RUNTIME_HOME stays (derived from SERVICE_NAME, used by
  ~10 consumers for path construction).
- Env-var allowlist drops PLATFORM_ID / PLATFORM_SERVICE_NAME /
  PLATFORM_RUNTIME_USER / PLATFORM_RUNTIME_HOME entries.
- CONTROLPLANE_AIDER_TMUX_SESSION uses SERVICE_NAME directly.

setup/onboarding.ts:
- writeIdentity() simplified to write only ASSISTANT_NAME (display).
  PLATFORM_ID / PLATFORM_SERVICE_NAME / PLATFORM_RUNTIME_USER are no
  longer written to .env. Fresh installs have no PLATFORM_* keys.
- Status emission switched from PLATFORM_ID to SERVICE_NAME.

setup/env-audit.ts:
- Audit lists SERVICE_NAME instead of PLATFORM_ID; the env-file
  PLATFORM_ID read is gone.

24 source files (src/*.ts, setup/*.ts, scripts/dashboard.ts):
- Bare PLATFORM_ID / PLATFORM_SERVICE_NAME / PLATFORM_RUNTIME_USER
  references replaced with SERVICE_NAME.
- Imports rewired: SERVICE_NAME comes from
  ../{src/}platform-identity.js, not from config.js.
- Imports deduped where the sed sweep produced collisions.

Shell scripts (scripts/bhyve-evidence.sh, glass.sh, inspect-system.sh):
- Hardcoded SERVICE_NAME='clawdie' and SERVICE_USER='clawdie'.
  No more grep-the-.env fallbacks; the constants are the source.

Tests (middle path):
- Mechanical fixes (import path, renamed assertion text):
  src/hostd/privileged-commands.test.ts, src/startup-report.test.ts,
  setup/env-audit.test.ts, setup/install-mode.test.ts.
- Skipped with `// system-namespace:` markers (pinned removed
  env-driven override behavior; Codex rewrites once the bootstrap-
  config service-user override path lands):
    setup/verify.test.ts > 'uses the platform service name for PID candidates'
    setup/service.test.ts > 'resolves a platform runtime separately from the tenant'

Test files still containing PLATFORM_* strings in vi.mock contents,
ENV_KEYS arrays, or comments are left untouched — they are test
artifacts that don't affect runtime; mock contents resolve to
'clawdie' which still equals SERVICE_NAME.

tsc clean. 2095 tests pass, 4 skipped, 0 fail.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  2095 passed | 4 skipped (2099)
2026-05-02 14:49:19 +02:00
..
hooks Add pre-commit security hook to block sensitive data 2026-03-23 22:58:21 +00:00
memory Add maintainer skills artifact builder 2026-04-29 13:12:30 +02:00
agent-logs.ts refactor(multitenant): centralize controlplane session paths 2026-04-23 10:11:40 +02:00
agent-status.ts Finish controlplane naming propagation sweep 2026-04-24 16:03:47 +02:00
agent-task-status.ts Finish controlplane naming propagation sweep 2026-04-24 16:03:47 +02:00
agent-task.ts Remove hardcoded mevy runtime identity 2026-05-02 07:16:30 +02:00
apply-skill.ts refactor: CI optimization, logging improvements, and codebase formatting (#456) 2026-02-25 23:13:36 +02:00
backfill-embeddings.ts chore: commit backfill-embeddings maintenance script 2026-04-21 09:01:23 +02:00
backup.ts Honor configured ZFS pool everywhere 2026-05-02 08:20:32 +02:00
bhyve-evidence.sh refactor(identity): remove PLATFORM_ID/SERVICE_NAME/RUNTIME_USER env vars 2026-05-02 14:49:19 +02:00
crowdin-sync.sh feat: Crowdin integration - Slovenian first (Sam & Claude) 2026-04-06 19:53:35 +02:00
dashboard.ts refactor(identity): remove PLATFORM_ID/SERVICE_NAME/RUNTIME_USER env vars 2026-05-02 14:49:19 +02:00
date-format.sh feat(setup): add FreeBSD onboarding and baseline sync 2026-03-14 02:51:10 +01:00
destroy-jails.sh Refactor V2 identity and platform ownership model 2026-04-24 07:49:09 +02:00
docs-compile.sh Public/internal docs restructure; CMS/verify cleanup (Sam & Codex) 2026-04-05 06:29:19 +00:00
docs-sync.cron.sh Public/internal docs restructure; CMS/verify cleanup (Sam & Codex) 2026-04-05 06:29:19 +00:00
fetch-upstream.ts fix: replace hardcoded 'clawdie' with AGENT_NAME across 22 files 2026-04-15 21:41:41 +00:00
fix-skill-drift.ts refactor(multitenant): make tenant and platform identity explicit 2026-04-23 21:41:42 +02:00
gen-changelog.ts fix: replace hardcoded 'clawdie' with AGENT_NAME across 22 files 2026-04-15 21:41:41 +00:00
git-doctor.sh fix(controlplane): stop git push token burn in jail 2026-04-25 19:37:54 +02:00
glass.sh refactor(identity): remove PLATFORM_ID/SERVICE_NAME/RUNTIME_USER env vars 2026-05-02 14:49:19 +02:00
harness-check.ts feat(phase4): just front door — 55 recipes + 10 CLI helper scripts 2026-04-13 23:26:22 +00:00
heartbeat.sh Refactor V2 identity and platform ownership model 2026-04-24 07:49:09 +02:00
hostd-cli.ts feat(phase4): just front door + safety rules + bugfix (Sam & Claude) 2026-04-14 01:28:31 +02:00
inspect-system.sh refactor(identity): remove PLATFORM_ID/SERVICE_NAME/RUNTIME_USER env vars 2026-05-02 14:49:19 +02:00
jail-provision.ts refactor(multitenant): make tenant and platform identity explicit 2026-04-23 21:41:42 +02:00
jail-status.ts fix(cli): correct jail-list columns (Sam & Codex) 2026-04-21 23:45:26 +02:00
platform-audit.ts Refactor V2 identity and platform ownership model 2026-04-24 07:49:09 +02:00
post-update.ts feat: add /update skill for pulling upstream changes (#372) 2026-02-23 01:03:13 +02:00
rebase.ts Skills engine v0.1 + multi-channel infrastructure (#307) 2026-02-19 01:55:00 +02:00
run-migrations.ts refactor: CI optimization, logging improvements, and codebase formatting (#456) 2026-02-25 23:13:36 +02:00
set-operator.ts refactor(setup): unify operator auth entrypoints 2026-04-27 08:13:36 +02:00
skill-add.ts feat(phase2): add skill library catalog and tooling 2026-04-13 23:06:50 +00:00
skill-list.ts feat(phase2): add skill library catalog and tooling 2026-04-13 23:06:50 +00:00
skill-sync.ts feat(phase2): add skill library catalog and tooling 2026-04-13 23:06:50 +00:00
system-health.ts fix(system-health): use display date format 2026-04-22 09:56:08 +02:00
tenant-lifecycle.ts refactor(multitenant): collapse planTenantApply allowedResources duplication 2026-04-24 19:12:12 +02:00
test-jail-runtime.ts refactor: replace container paradigm with FreeBSD jails, rename all container refs 2026-03-07 16:30:12 +01:00
test-memory-pipeline.ts refactor(multitenant): make tenant and platform identity explicit 2026-04-23 21:41:42 +02:00
uninstall-skill.ts refactor: CI optimization, logging improvements, and codebase formatting (#456) 2026-02-25 23:13:36 +02:00
update-core.ts feat: add /update skill for pulling upstream changes (#372) 2026-02-23 01:03:13 +02:00
update-readme-version.mjs chore(multitenant): harden agent workflow and README sync 2026-04-25 07:58:18 +02:00
validate-all-skills.ts refactor: replace WhatsApp with Telegram, rename container→jail, migrate skills to .agent/ 2026-03-07 18:36:27 +01:00
validate-library.ts feat(phase2): add skill library catalog and tooling 2026-04-13 23:06:50 +00:00
write-test-build-status.sh fix(runtime): align startup brief and test status paths 2026-04-26 12:48:47 +02:00