--- id: RAIL-FAB-WP-0013 type: workplan title: "Path Scoped Duplicate Identity" domain: railiance repo: railiance-fabric status: finished owner: codex topic_slug: railiance planning_priority: high planning_order: 13 created: "2026-05-20" updated: "2026-05-20" state_hub_workstream_id: "bf80900b-606c-442c-aa15-d6272d73a8d6" --- # RAIL-FAB-WP-0013 - Path Scoped Duplicate Identity ## Goal Refine discovery reconciliation so path-scoped nodes, starting with `Lockfile` candidates, are not marked as duplicate entities solely because they share the same display label. This unblocks broad local-repo rollout by making rescan review output point to real identity concerns instead of expected repeated files such as `uv.lock` and `package-lock.json` across different checkouts. ## Background `RAIL-FAB-WP-0012` ingested a controlled three-repo baseline into the local Fabric registry. The only review-required repo was `repo-scoping`; all seven conflicted candidates were `Lockfile` nodes with labels `uv.lock` or `package-lock.json` under distinct `var/checkouts/...` paths. The current duplicate detector compares node kind plus normalized label/alias. That is useful for semantic declaration nodes, but too broad for file-backed path-scoped evidence. ## Design Principles - Keep semantic duplicate detection intact for declaration-like nodes. - For path-scoped node kinds, require matching source path identity before treating same-label nodes as possible duplicates. - Preserve conservative behavior when source path evidence is missing. - Add a regression test that mirrors the `repo-scoping` false-positive shape. - Rerun the controlled baseline before recommending broad rollout. ## Tasks ### T01 - Add Path-Scoped Reconciliation Coverage ```task id: RAIL-FAB-WP-0013-T01 status: done priority: high state_hub_task_id: "8d9cb1c2-77f7-45da-b942-a8d68454477a" ``` Add tests proving that same-label `Lockfile` nodes at different source paths do not raise `possible_duplicate_node`, while same-label semantic nodes still do. ### T02 - Implement Path-Aware Duplicate Detection ```task id: RAIL-FAB-WP-0013-T02 status: done priority: high state_hub_task_id: "7d4d439d-4f7f-4bdd-bc5f-b02524a10684" ``` Update reconciliation duplicate detection so path-scoped node kinds compare source anchors before emitting duplicate conflicts. ### T03 - Verify Controlled Rescan ```task id: RAIL-FAB-WP-0013-T03 status: done priority: high state_hub_task_id: "0d6cad1d-16f8-4ac7-b8d3-b62a2f8e4549" ``` Rerun the three-repo controlled rescan against the local registry and confirm that `repo-scoping` no longer reports the seven lockfile duplicate conflicts. Verification result: - Command: `registry scan-manifest registry/local-repos.yaml --repo-slug repo-scoping --repo-slug llm-connect --repo-slug railiance-fabric --previous-from-registry --ingest --no-lock`. - Report: `registry/.fabric-discovery/reports/2026-05-20t214250z-deterministic.rescan-report.json`. - Result: 3 scanned, 1 unchanged, 2 changed, 0 retired, 0 conflicted, 0 review required. - `repo-scoping` snapshot `5` still reports 7 changed lockfile candidates, but none are conflicted; the previous false `possible_duplicate_node` warnings are gone. - `registry rescan-status --review-only --json` shows 0 review-required repos. ### T04 - Rollout Recommendation ```task id: RAIL-FAB-WP-0013-T04 status: done priority: medium state_hub_task_id: "4be31147-b060-4b47-9589-8d3d8024879d" ``` Record whether broad all-local-repo baseline ingestion is ready after the identity refinement, or whether another targeted blocker remains. Recommendation: - Broad all-local-repo baseline ingestion is ready to attempt as an ingest-only operational run. - Keep `--previous-from-registry`, `--ingest`, and no `--accept` for the broad pass; review `registry rescan-status --review-only` before any projection. - Use safe projection only for clean repos with accepted repo-declaration candidates. Do not project candidate-only repositories until their discoveries are reviewed or explicitly accepted. ## Close Criteria - Unit tests cover path-scoped duplicate identity. - Reconciliation keeps semantic duplicate warnings intact. - Controlled rescan no longer flags distinct lockfiles as duplicates. - State Hub and this workplan capture the updated rollout recommendation.