← Back to Pull requests

fix(connect): reconnect a Goal registered under another spelling of its directory #9691

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; no existing issue or PR found (#7243 is a separate case-alias problem in write scopes).

  • Goal/source and gap: bootstrap_project() normalizes --project with Path.resolve(). On a case-insensitive APFS volume (macOS default), resolve() preserves the caller's letter case while os.getcwd() returns the on-disk spelling. A Goal connected once with --project ~/code/app for ~/Code/App therefore records repo: .../code/app; afterwards, loopx connect from inside the project (or the reverse: a registered project re-connected with differently cased --project) fails with Canonical creation is not bound to the registered original operation, source and target, because the canonical-creation check compares the registered repo string with the current state path.

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

  • - Before: connecting with one letter case and reconnecting from the project directory (or with another case spelling) failed with Canonical creation is not bound ....
    - After: when the registered absolute repo refers to the same directory (Path.samefile), bootstrap_project() keeps the registered spelling (and the default project registry route under it), so both directions succeed with kept-existing (unit and real_entrypoint rows below).
  • Issue/task and intended base: none; main.
  • Author Declaration

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

  • Specification and revision: no written specification. Aligns bootstrap_project() reconnect handling with the canonical-creation binding recorded in loopx/control_plane/coordination/new_goal_initialization.ts.

  • Criteria:
  • | Criterion (spec clause) | Disposition | Symbol / path | Test or command |
    | --- | --- | --- | --- |
    | A Goal registered under another spelling of the same directory reconnects from the project directory | implemented | loopx/bootstrap.py::bootstrap_project, _same_directory | tests/test_connect_project_path_case.py::test_a_goal_connected_with_another_spelling_reconnects_from_the_project |
    | A correctly registered Goal reconnects with a differently cased --project | implemented | loopx/bootstrap.py::bootstrap_project, _same_directory | tests/test_connect_project_path_case.py::test_a_goal_reconnects_with_a_differently_cased_project_path |
    | A relative registered repo is not compared against the working directory | implemented | loopx/bootstrap.py::_same_directory (is_absolute() guard) | unchanged connect/bootstrap suites |

  • Self-check before submission: kept the fix cross-platform (Path.samefile without macOS-only F_GETPATH). Both new tests fail on base with Canonical creation is not bound ... and safely skip on case-sensitive Linux filesystems.
  • Scope And Continuation

  • Completed scope and remaining work: complete within this scope. New registrations still record the caller's spelling; explicit absolute --registry or --state-file arguments spelled with different case are still used as passed.

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

  • Tested revision: 9372540c3

  • Run state: finished

  • Input classes: synthetic
  • | Check kind | Result | Public-safe evidence / limitation |
    | --- | --- | --- |
    | unit | passed | tests/test_connect_project_path_case.py (2 passed on Python 3.13 and 3.14; both fail on base with Canonical creation is not bound ...). |
    | unit | passed | Connect/bootstrap suites (test_connect_project_path_case.py, test_new_goal_storage_defaults.py, test_canonical_handoff_invariants.py, test_goal_terminal_no_followup.py, test_bootstrap_command_pack_platform.py, test_install_hint_platform.py): 239 passed, 10 skipped, 0 failed. |
    | static | passed | ruff check and git diff --check clean; mypy reports the same 6 pre-existing errors in loopx/bootstrap.py as base. |
    | real_entrypoint | passed | python -m loopx.cli connect across both casing directions and reconnecting a base-created Goal: appended then kept-existing with status ok. |

  • Coverage and gaps: verified on macOS (case-insensitive APFS) with Python 3.13 and 3.14. Tests skip on case-sensitive Linux; not run on Windows (Path.samefile is cross-platform).
  • 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.30 = Change Risk (0.52) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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
    Real PR Conversation Timeline
    1 comments
    "Review active on #9691"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 29.7% · Safe to merge
    29.7%