← Back to Pull requests

fix(configure-goal): reject list values that parse to nothing instead of clearing the setting #9690

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Dec 01, 2026 00:04 UTC
Author

Goal And Delivered Outcome

  • Outcome basis / optional anchor: reproduced defect; configure-goal counterpart of #9372 / #9373, which hardened register-agent and left configure-goal unchanged.

  • Goal/source and gap: configure-goal --registered-agent replaces the roster, and --clear-registered-agents is the explicit way to empty it. A value that parses to no usable id ("", ",", " , ") was silently dropped by _clean_registered_agents(), causing the preview to report ok=true with changed_fields: ["registered_agents"] and --execute to wipe the roster (for example when a script passes --registered-agent "$AGENT" with an unset variable). --allowed-domain had the exact same defect, wiping allowed_domains instead of requiring --clear-allowed-domains.

  • Observable before → after, with the validation row that proves it:

  • - Before: configure-goal --registered-agent "" --execute returned ok=true and cleared ["agent-a", "agent-b"] to []; --allowed-domain "" cleared ["docs"] to [].
    - After: both raise ValueError pointing to --clear-registered-agents / --clear-allowed-domains, leaving the registry unchanged (unit and real_entrypoint rows below). Valid ids, empty entries between valid ids (agent-a,,agent-c), explicit clear flags, and programmatic empty lists keep their existing behavior.
  • Issue/task and intended base: Related to #9372; intended base main.
  • Author Declaration

  • Written by: model_agent (Claude, Anthropic), reviewed by the submitting human operator.
  • Implemented against

  • Specification and revision: configure-goal --help (--registered-agent / --allowed-domain vs explicit --clear- flags) and the empty-request rule #9373 established for register-agent.

  • Criteria:
  • | Criterion (spec clause) | Disposition | Symbol / path | Test or command |
    | --- | --- | --- | --- |
    | Empty or delimiter-only --registered-agent values fail before any write (preview and execute) | implemented | loopx/configure_goal.py::configure_goal | tests/control_plane/test_configure_goal_registered_agents.py::test_empty_or_delimiter_only_values_are_rejected (8 cases) |
    | Valid ids, skipped empty entries, and explicit --clear-registered-agents are unchanged | implemented | loopx/configure_goal.py::configure_goal | tests/control_plane/test_configure_goal_registered_agents.py::test_valid_ids_and_explicit_clear_keep_working |
    | Empty or delimiter-only --allowed-domain values are rejected while --clear-allowed-domains still clears | implemented | loopx/configure_goal.py::configure_goal | tests/control_plane/test_configure_goal_registered_agents.py::test_empty_or_delimiter_only_allowed_domains_are_rejected (3 cases) |

  • Self-check before submission: verified all 11 rejection cases fail on base and pass after the change, while valid lists and --clear- flags remain unchanged. Checked --write-scope "" already changes nothing and left it untouched.
  • Scope And Continuation

  • Completed scope and remaining work: complete within this scope.

  • Slice boundary / successor: N/A — self-contained bug fix.
  • Validation

  • Tested revision: de444765e

  • Run state: finished

  • Input classes: synthetic
  • | Check kind | Result | Public-safe evidence / limitation |
    | --- | --- | --- |
    | unit | passed | tests/control_plane/test_configure_goal_registered_agents.py (12 passed on Python 3.13 and 3.14; the 11 rejection cases fail on base). |
    | unit | passed | 12 suites exercising configure_goal / register-agent: 729 passed (3 failures matched base: 2 Windows-only test_windows_install.py cases on macOS and pre-existing #9586 test_steward_generic_monitor_todo.py); 10 --allowed-domain suites: 695 passed, 0 failed. |
    | static | passed | ruff check and git diff --check clean on all changed files. |
    | real_entrypoint | passed | python -m loopx.cli configure-goal --registered-agent "", ",", " , ": rejected with explicit message, roster unchanged. |

  • Coverage and gaps: verified on macOS with Python 3.13 and 3.14; logic is OS-independent.
  • Frontend / Visual Evidence

  • UI impact: none

  • Before: N/A

  • After: N/A

  • First viewport and preview: N/A

  • States and viewports shown: N/A

  • Source data: none

  • Attention review: N/A

  • Craft review: N/A
  • Type of Change

  • Bug fix
  • LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Technical Direction

  • Direction / acceptance reference, when applicable: Core control-plane hardening
  • Shared-authority RFC fixture impact

    N/A

    Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).

  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.

  • I kept the change scoped to the linked issue/task.

  • Existing English/Chinese RFC pairs (including ledger entries) both have a diff, and the local premerge check python3 scripts/check_rfc_bilingual.py --base origin/main --head HEAD passes, or no paired RFC changed.

  • I completed the visual evidence section for UI changes, or marked UI impact none.

  • Every commit includes a DCO Signed-off-by trailer (git commit -s).
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: loopx-agent Review duration: 256m
    All Vouch review confidence checks passed
    Residual risk 0.43 = Change Risk (0.75) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #9690"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 43.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 42.9% · Moderate risk
    42.9%