Skip to content

Add platform health monitor#167

Merged
Pigbibi merged 1 commit into
mainfrom
codex/platform-health-monitor
Jul 5, 2026
Merged

Add platform health monitor#167
Pigbibi merged 1 commit into
mainfrom
codex/platform-health-monitor

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a machine-readable platform health report for runtime settings/config drift
  • add scheduled/manual platform health monitor workflow with Codex-ready repair issue context
  • cover health report and workflow guardrails in Python tests

Test Plan

  • python3 -m unittest discover -s python/tests -v
  • python3 python/scripts/build_config.py --check
  • python3 python/scripts/runtime_settings.py validate
  • python3 python/scripts/build_config.py --platform-health-report
  • python3 python/scripts/build_config.py --live-candidate-queue >/tmp/qrs-live-queue.json && python3 -m json.tool /tmp/qrs-live-queue.json >/dev/null
  • node tests/strategy_switch_worker_validation.mjs
  • actionlint .github/workflows/platform-health-monitor.yml

Co-Authored-By: Codex <noreply@openai.com>
@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

🤖 Codex PR Review

⚠️ Human review required: The Codex review could not be completed.

No Codex service URL or API key configured. Set CODEX_AUDIT_SERVICE_URL, ANTHROPIC_API_KEY, or OPENAI_API_KEY.

Please ensure a human reviewer checks this PR before merging.

@Pigbibi
Pigbibi merged commit 40634ab into main Jul 5, 2026
8 checks passed
@Pigbibi
Pigbibi deleted the codex/platform-health-monitor branch July 5, 2026 21:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 733e790654

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

catalog = _strategy_catalog_by_profile(strategy_catalog)
config_errors = validate(config)
default_profile_errors = report_default_strategy_profile_drift(config, catalog)
derivation_errors = report_strategy_profile_derivation_drift(config, catalog)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve health report output when config schema fails

If platform-config.json has a schema error that validate() already detects, such as a strategy missing domain, this unconditional derivation check still calls strategy_to_json_compat() and raises KeyError before any health-report JSON is emitted. In the scheduled workflow that turns the actionable validation messages into only report_missing, so the repair issue loses the context this monitor is meant to provide; skip derivation when schema validation fails or make it tolerate incomplete strategy entries.

Useful? React with 👍 / 👎.

node --check --input-type=module < web/strategy-switch-console/page_asset.js
node --check --input-type=module < web/strategy-switch-console/strategy_profiles_asset.js
node --check --input-type=module < web/strategy-switch-console/app_css.js
node --check --input-type=module < web/strategy-switch-console/app_js.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check the served app script, not only its wrapper

app_js.js is a generated module that exports the contents of web/strategy-switch-console/app.js as a string, so this node --check only validates the wrapper syntax. A syntax error in the actual served /app.js would still break the strategy switch console in browsers while this scheduled monitor passes; add a direct check of web/strategy-switch-console/app.js or pipe that source into node --check.

Useful? React with 👍 / 👎.

},
{
"name": "live_candidate_queue",
"status": "warn" if live_candidate_queue else "pass",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail live-candidate profiles that become live-switchable

For a live_candidate/shadow_candidate profile that is accidentally made live-switchable (runtime_enabled: true, can_switch_live: true, live included in allowed_execution_modes, and no blocked_live_reason), the health report still treats the queue as only a warning and exits 0, so the scheduled workflow will not open a repair issue. This matters because the Worker live gate checks those switch fields but not lifecycle_stage, so the guardrail in the report should fail candidates that are already live-enabled rather than only counting them for review.

Useful? React with 👍 / 👎.

"""Report whether the generated strategy profile catalog drifts from platform-config.json."""
expected = strategy_to_json_compat(config.get("strategies", {}))
expected_by_profile = {entry["profile"]: entry for entry in expected}
catalog = _strategy_catalog_by_profile(strategy_catalog)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Detect duplicate strategy profiles before collapsing

When strategy-profiles.example.json contains the same profile twice, this conversion collapses the list to a dict before the derivation checks run. If the first entry is stale or unsafe and a later duplicate matches platform-config.json, the report passes even though the Worker keeps the first duplicate when normalizing profiles, so the served switch catalog can still use the stale gate fields; detect duplicate profiles against the raw list before comparing the collapsed catalog.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant