fix(file-lock): keep the Windows holder record out of *.json scans #6164
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 #6164"
general
weight: 0.35
BigDataDZ
Goal And Delivered Outcome
lock_holder_pathwrites the holder record to a persistent sidecar named<file>.lock.holder.jsonbeside the locked state file. It survives release, and scans that collect.jsonstate records read it as state. Native chat admission (ChatExternalConversations.pending()) crashes withKeyError: 'binding_id', and Windows-only test walkers flake. POSIX keeps the record inside.lock, so Linux CI never sees it.- Before: with a holder sidecar beside a request journal, the second external request admission raises
KeyError: 'binding_id', andglob(".json")beside a locked file lists the sidecar.- After: admission succeeds and
pending()lists only request journals; the Windows sidecar is<file>.lock.holderand never matches.json. Proven by theregression_parityrows below.main.Author Declaration
Implemented against
.jsonsidecar name, plus a defensive filter in the product walker), anddocs/reference/protocols/file-lock-acquisition-v0.mdat base04bd639b4.| Criterion (spec clause) | Disposition | Symbol / path | Test or command |
| --- | --- | --- | --- |
| The Windows holder sidecar must not be named like a state file | implemented |
lock_holder_pathinloopx/file_lock.py|tests/test_file_lock.py::test_windows_holder_sidecar_is_not_a_json_state_file|| Existing installs: legacy
.lock.holder.jsonrecords are migrated and still read while an older process may hold the lock | implemented |lock_holder_paths,_read_latest_holder_record,_persist_holder_record|test_windows_holder_removes_a_legacy_json_sidecar_on_acquire,test_windows_holder_reader_prefers_the_latest_acquisition|| Product walkers that must stay
.json-shaped filter the holder name defensively (external chat requests) | implemented |ChatExternalConversations.pending|tests/test_chat_conversation_bindings.py::test_external_request_listing_ignores_lock_holder_records|| Lock-artifact name lists stay complete (machine-state classification, goal deletion safety check) | implemented |
loopx/paths.py,loopx/control_plane/goals/deletion_service.py| existing suites listed under Validation || POSIX holder layout and liveness semantics unchanged | implemented |
lock_holder_liveness|test_posix_holder_liveness_reads_the_lock_file_record|| Patch every other
.jsonwalker individually | out_of_scope | — | The rename fixes them going forward; see Coverage and gaps |- Verified:
- I read every
lock_holder_pathcaller and every module that both takesexclusive_file_lockand globs.json.- Each new test fails on the base and passes on the head.
- Assumed, not verified:
- Windows behavior is simulated on Linux by giving
loopx.file_lockanosproxy withname == "nt".- Kernel locking still uses the host backend, so
msvcrtitself was not exercised.Scope And Continuation
Validation
ce95406da4b3bccd7fa69fc0923035b22fe5a9cf(the code is identical to the parent5347064f7; the head adds only the docs commit)| Check kind | Result | Public-safe evidence / limitation |
| --- | --- | --- |
|
regression_parity|passed| The four newtests/test_file_lock.pytests fail on basefile_lock.py(three fail outright; the latest-record test guards the new two-name reader) and pass on head. ||
regression_parity|passed|tests/test_chat_conversation_bindings.py::test_external_request_listing_ignores_lock_holder_recordsfails on the base with the exactKeyError: 'binding_id'from the issue, and passes on head. It exercises the real admission path with theordinaryfixture. ||
unit|passed| Focused suites on the rebased head:test_file_lock.py,test_file_lock_cross_process.py,test_chat_conversation_bindings.py,test_collaboration_sidecar_scan.py,control_plane/test_legacy_coordination_writer_fence.py: 44 passed, 2 skipped (platform skips). ||
unit|passed| Broader run on the pre-rebase head: all test files referencinglock_holder,deletion_service,_runtime_root_has_machine_stateorexternal_conversationsgave 665 passed, 1 failed. The failure wastest_delegation_stop_nested_host.py::...[sqlite-paused]under-n 4load; it passed 3/3 serial runs on the head and 3/3 on the base, so it is unrelated. ||
static|passed| ruff on changed files;mypy(configured strict set);git diff --check;scripts/generate_semantic_inventory.py --changed-from HEADfound no new vocabulary carriers. ||
static|passed|loopx canary premerge --from-git-diff: risk-profile smokes 8/8 and the public boundary scan passed. Itssemantic-vocabulary-drift-smokeinitially flagged stale line numbers inproject_registry_io_manifest_v1.json; this PR regenerates the manifest (twopaths.pyline shifts, no classification change) and the smoke now passes. I did not rerun the full premerge command after regenerating. ||
real_entrypoint|not_run| No native Windows host was available. |- The rename closes the whole class going forward for every
.jsonwalker. Older Windows installs keep one legacy record per lock until that lock is next acquired; external chat admission filters it explicitly.- Mixed-version upgrade window: an older process does not see the new name, so its diagnostics report
absentfor records written by a newer process. Holder records are advisory, and the kernel lock stays authoritative.- Legacy cleanup is best-effort: an
OSErrorleaves the record for the next holder.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
N/A. This PR makes no claim against the TypeScript migration or shared Goal Authority RFCs.
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).Future-facing pass: applied.
lock_holder_pathsgives the two name-list owners (paths.py,deletion_service.py) one helper instead of hand-spelled names. I considered and deferred a shared state-directory walk helper across all.jsonwalkers, because the rename removes the hazard for them.Changes runtime behavior of
loopx/*, so this is left for maintainer review and merge.🤖 Generated with Claude Code