Files
roboco/tests/unit/config/test_x_engine_flag.py
T
Renn F da17c49f2d feat(marketing): HoM feature-spotlight X drafts + brand-voice charter (v0.18.0 B)
The Head of Marketing now markets features, not just releases: a default-off
x_feature_spotlight loop periodically spawns the HoM to investigate what shipped
(CHANGELOG, feature flags, docs/map, KB) and draft ONE held marketing post via
propose_feature_spotlight, reviewed in the X post queue.

- New x_feature source (distinct from x_post, fixing panel mislabeling) + a
  panel Feature-spotlight branch.
- brand_voice column on company_goals (migration 061, single head) as the
  CEO-editable voice source, surfaced in Settings and injected into the HoM
  briefing; a VOICE GUIDE baseline in head-marketing.md.
- propose_feature_spotlight verb (HoM-only), mirroring propose_roadmap.

Gated by x_feature_spotlight_enabled (default off; flag-off dormancy proven).
Also fixed two real bugs found mid-build: company_goals API schemas dropped
brand_voice on GET/PUT; the live charter UI is goals-tab.tsx, not the unmounted
company-goals-card.tsx. Full suite green (2935); migration single-head verified.
2026-07-04 07:34:40 +02:00

49 lines
1.4 KiB
Python

"""The X engine is gated by default-off config flags (mirrors release manager)."""
from __future__ import annotations
import os
from unittest import mock
from roboco.config import Settings
from roboco.services.settings import FEATURE_FLAGS, validate_setting
_DEFAULT_INTERVAL = 1800
_DEFAULT_MAX_OPEN = 10
def test_x_engine_disabled_by_default() -> None:
s = Settings()
assert s.x_engine_enabled is False
assert s.x_mentions_interval_seconds == _DEFAULT_INTERVAL
assert s.x_max_open_posts == _DEFAULT_MAX_OPEN
def test_x_engine_reads_env_var() -> None:
with mock.patch.dict(os.environ, {"ROBOCO_X_ENGINE_ENABLED": "true"}):
assert Settings().x_engine_enabled is True
def test_x_mentions_interval_reads_env_var() -> None:
override = 900
with mock.patch.dict(
os.environ, {"ROBOCO_X_MENTIONS_INTERVAL_SECONDS": str(override)}
):
assert Settings().x_mentions_interval_seconds == override
def test_x_engine_flag_registered_in_feature_flags() -> None:
assert "x_engine_enabled" in [key for key, _ in FEATURE_FLAGS]
def test_x_engine_flag_validates_as_bool() -> None:
validate_setting("x_engine_enabled", "true")
def test_x_feature_spotlight_disabled_by_default() -> None:
assert Settings().x_feature_spotlight_enabled is False
def test_x_feature_spotlight_flag_registered_in_feature_flags() -> None:
assert "x_feature_spotlight_enabled" in [key for key, _ in FEATURE_FLAGS]