LearnNewsExamplesServices
Frontmatter
id12889
titleB4-safe activation: replace config-Provider `data.debug=true` mutations in lifecycle/maintenance scripts
stateClosed
labels
airefactoringarchitecture
assigneesneo-opus-vega
createdAtJun 11, 2026, 4:20 AM
updatedAtJun 12, 2026, 5:42 AM
githubUrlhttps://github.com/neomjs/neo/issues/12889
authorneo-opus-vega
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 12, 2026, 5:42 AM

B4-safe activation: replace config-Provider data.debug=true mutations in lifecycle/maintenance scripts

Closed v13.0.0/archive-v13-0-0-chunk-17 airefactoringarchitecture
neo-opus-vega
neo-opus-vega commented on Jun 11, 2026, 4:20 AM

Context

Surfaced in @neo-fable's review of PR #12885 (operator-flagged: "setting DATA on a state provider… ouch"). Several lifecycle/maintenance scripts activate debug logging by mutating the shared AiConfig reactive Provider SSOT at runtime<Config>.data.debug = true — which is the ADR 0019 B4 write-class (consumers must read resolved leaves, never mutate the Provider). PR #12885 removed this from the two summary/backfill children (routing progress to stderr directly instead); the other call-sites remain.

The Problem

Consumer-side mutation of the reactive Provider singleton is the #12335 / #12435 hazard class (shared-instance bleed), and in the cloud deployment it hard-codes child verbosity non-operator-controllably for production-resident children.

Affected sites (V-B-A'd against dev)

  • ai/scripts/runners/runSandman.mjs:94Memory_Config.data.debug = true
  • ai/scripts/maintenance/syncKnowledgeBase.mjs:19KB_Config.data.debug = true
  • ai/scripts/migrations/migrateMemoryCore.mjs:63MC_Config.data.debug = true
  • ai/scripts/maintenance/ingestTenant.mjs:185KB_Config.data.debug = true

The Fix

Replace each config.data.debug = true mutation with a B4-safe activation — e.g. emit the intended operator-visible output directly to stderr (the captured channel; the pattern PR #12885 adopted via console.error('[INFO] …')), OR a non-Provider logger-sink / config-materialization path. Constraint: the Provider is read-only for consumers.

Decision Record impact

aligned-with ADR 0019 (reactive Provider SSOT — read resolved leaves, never mutate).

Out of Scope

  • The PR #12885 summary/backfill children (already fixed there).

Related

  • PR #12885 (#12812) — where this was surfaced + fixed for two of the sites.
  • #12456 — Eliminate ai/ AiConfig-SSOT antipatterns (epic; this is the write-side sibling of its read-side scope).
  • #12335 / #12435 — the B4 singleton-mutation hazard family.

Release classification: post-v13 (B4-safety cleanup; non-blocking — a known runtime-mutation hazard, not a v13 ship-blocker).

Origin Session ID: b159aa60-24b1-4abd-864b-100573458d38. Authored by Claude Opus 4.8 (@neo-opus-vega).

tobiu referenced in commit 21d502e - "fix(agentos): B4-safe debug activation via setEnvOverride (#12889) (#12952) on Jun 12, 2026, 5:42 AM
tobiu closed this issue on Jun 12, 2026, 5:42 AM