← Back to Pull requests

fix(agent-directory): report a Goal without canonical authority #9692

Open
unknown opened this pull request with 531 lines diff across 6 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; no existing issue or PR found.

  • Goal/source and gap: handle_agent_directory() already catches status-collection failures and returns a structured agent_directory_collection_failed payload. Its except tuple missed LocalCoordinationAuthorityUnavailable (a RuntimeError), so running agent-directory against a registered Goal that has not yet migrated to canonical authority crashed with an unhandled traceback.

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

  • - Before: loopx --format json agent-directory --goal-id <unmigrated> printed a Python traceback.
    - After: exits 1 with {"ok": false, "schema_version": "peer_agent_directory_v0", "error_code": "agent_directory_collection_failed", "goal_id": ..., "reason": "...Canonical authority..."} (unit and real_entrypoint rows below).
  • Issue/task and intended base: none; main.
  • Author Declaration

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

  • Specification and revision: no written specification; follows handle_agent_directory()'s existing agent_directory_collection_failed error contract.

  • Criteria:
  • | Criterion (spec clause) | Disposition | Symbol / path | Test or command |
    | --- | --- | --- | --- |
    | agent-directory reports a Goal without canonical authority instead of crashing | implemented | loopx/cli_commands/agent_directory.py::handle_agent_directory | tests/control_plane/test_agent_directory_unmigrated_goal.py::test_agent_directory_reports_a_goal_without_canonical_authority |

  • Self-check before submission: 2-line addition of LocalCoordinationAuthorityUnavailable to the existing except tuple. Verified the new test fails on base with an unhandled traceback and passes with the fix; migrated Goals are unaffected.
  • Scope And Continuation

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

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

  • Tested revision: d0dc40d6c

  • Run state: finished

  • Input classes: synthetic
  • | Check kind | Result | Public-safe evidence / limitation |
    | --- | --- | --- |
    | unit | passed | tests/control_plane/test_agent_directory_unmigrated_goal.py and tests/control_plane/test_peer_agent_directory.py passed under Python 3.13 (combined regression run: 328 passed, 3 skipped; 1 unrelated pre-existing failure reproduced identically on base). |
    | static | passed | ruff check and git diff --check clean on all changed files. |
    | real_entrypoint | passed | python -m loopx.cli --format json agent-directory --goal-id selected on an unmigrated Goal returns exit 1 with error_code: agent_directory_collection_failed and the canonical authority message. |

  • Coverage and gaps: verified on macOS with Python 3.13 and 3.15; 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: 531 lines (+398 / -133) across 6 files Reviewer: loopx-agent Review duration: 256m
    All Vouch review confidence checks passed
    Residual risk 0.41 = Change Risk (0.71) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.71 · 531 lines diff across 6 files
    0.71
    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.376
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.071
    Real PR Conversation Timeline
    1 comments
    "Review active on #9692"
    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: 71% (HIGH) · Higher = larger blast radius
    71%
    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: 40.5% · Moderate risk
    40.5%