fix(leases): treat case aliases as overlapping write scopes #7252
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.289
Real PR Conversation Timeline
1 comments
"Review active on #7252"
general
weight: 0.35
JasonBuildAI
Goal And Delivered Outcome
This prevents a silent exclusive-write bypass for default hard-lease multi-agent goals on case-insensitive Windows and macOS: two agents can otherwise hold active leases for
src/Main.tsandsrc/main.ts, or Unicode-equivalent names such assrc/Σ.tsandsrc/ς.ts, which name one physical file.status: "applied",acquired: true, and mutated the provider; after the change it exits 1 withwrite_scope_conflictand leaves provider state unchanged. This includes classes of any interval width, for examplesrc/[ß-\u20df].tsagainstsrc/SS.tsandsrc/[\u212a-\u412a].tsagainstsrc/K.ts, and glob token boundaries such assrc/?.ts/src/SS.ts,src/S?.ts/src/ß.ts,src/[S]S.ts/src/ß.tsandsrc/[!Σ].ts/src/SS.ts.Closes #7243; baseloopx-project/loopx:mainatf63647e2e867a30dd8761baaa1df69cba9c9860b. This head is rebased onto that revision.Author Declaration
Implemented against
docs/reference/canonical-lease-renew.md,Repository-relative scope identity, revisionf63647e2e867a30dd8761baaa1df69cba9c9860b. The linked issue and default provider contract inlocal-authority-provider-selection.mddefine the affected default path.| Criterion (spec clause) | Disposition | Symbol / path | Test or command |
| --- | --- | --- | --- |
|
Host/path case aliases remain overlapping| implemented |foldCharacter,caseFold,classMemberMatches,fnmatchcase,singleCharacterMatchLengths,scopePairOverlapsinloopx/control_plane/work_items/task_lease_acquire_decision.ts|tests/control_plane_ts/task_lease_workspace.test.ts;tests/control_plane/test_canonical_lease_scopes.py|| Case folding is limited to conflict comparison; retained and request spelling stays unchanged | implemented |
comparisonWriteScopes,normalizeWriteScopes|scope comparison folds case aliases without rewriting retained or request spelling; operation-identity replay assertion || Character-class membership keeps the original interval, negation order and Unicode alias set at any interval width | implemented |
characterClass,foldPreimagesByFold,maximumFoldConsumption,classMatchLengths| wide-interval positive, reversed and negated cases; negated expansion, Σ/ς, ß/SS,ẞ, KELVIN SIGN and astral cases || Glob tokens preserve one-character alias equivalence across token boundaries | implemented |
fnmatchcase,singleCharacterMatchLengths|?/SS,S?/ß,[S]S/ß and[!Σ]/SS overlap in TypeScript and real File/SQLite CLI tests || The shared decision serves both File and SQLite hard-lease authority | implemented |
evaluateTaskLeaseAcquireDecision| ParameterizedFileandSQLitereal-CLI test |f63647e2e867a30dd8761baaa1df69cba9c9860b, read the contract clause and shared callers, and ran the focused and adjacent suites at7dee604a7f6955929806278f7a1a636082e81bf9; persistence schemas, provider code, request identity and UI remain unchanged. Earlier review rounds found ASCII, simple-class, singleton-range, wide-interval and negated-continuation gaps; those remain as regressions. The latest review found question-mark and cross-token glob aliases, including?versusSS,S?and[S]Sversusß; matching now runs over the folded code-point stream, and negated classes use the same one-character expansion set. Existing repository-wide suite gaps on native Windows are disclosed rather than claimed green.Scope And Continuation
Validation
7dee604a7f6955929806278f7a1a636082e81bf9(rebased ontof63647e2e)| Check kind | Result | Public-safe evidence / limitation |
| --- | --- | --- |
|
static|passed|npm run -s typecheck:control-plane; Ruff over the changed control-plane scope and the changed Python test; semantic-vocabulary advisory smoke passed. ||
unit|passed| Twelve adjacent lease suites passed with 0 failures, including workspace, acquire, acquire CLI, repository, lifecycle, inspection, eligibility, renew, blocked/deferred lifecycle, leased continuation and production-scale fixture; environment-gated PostgreSQL and symlink cases skipped.retained_lease_receiptsstill fails on native Windows while parsing its unchanged fixed fixture (Bad escaped character in JSON), so it is disclosed and not counted as green. ||
regression_parity|passed|pytest tests/control_plane/test_canonical_lease_scopes.py -q: 102 passed. Parameterized File/SQLite cases cover question-mark, literal/class token boundaries, negated-class expansion and wide intervals in both scope orders; each rejected acquire or atomic Todo claim leaves canonical provider state unchanged. ||
real_entrypoint|passed| Real CLI with File and SQLite canonical authority rejects ASCII, Σ/ς, ß/SS, wide intervals,?/SS,S?/ß,[S]S/ß and[!Σ]/SS for exclusive acquire and atomic Todo claim; replay keeps request identity. An independent 264-case glob/alias oracle reported 0 mismatches. ||
integration|passed|loopx canary premerge --from-git-diff --git-diff-base upstream/main: 5 direct checks and 17 selected catalog/risk smokes, 0 failures. ||
manual|passed| The inverse fold map is process-cached. On this host the first mixed comparison took 0.43ms and 3,000 warm wide/narrow/token-boundary comparisons took 18.9ms, so interval width and token expansion do not add a path-length multiplier. |retained_lease_receiptsnative-Windows fixture failure is disclosed above. No installed product or native macOS same-file rerun is claimed: the comparison covers the Unicode case-fold equivalence class and conservatively overlaps aliases that differ between hosts (for example dotlessıandI).Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).