Repository navigation
Description
Summary
LocalIndex::resolve in pkgs/id/src/references.rs (landed by PR #2756 for #2259) never looks at IndexedObject.cleared. A tombstoned target is offered as an ordinary candidate, is auto-picked by Resolution::single(), and can be committed by insert_unambiguous — a fresh reference that render immediately reports as RenderState::Cleared. A cleared object also still counts in claimants, so a tombstone sharing a title with a live object makes the live object read as contested and blocks its unambiguous insert. The Candidate type carries no cleared marker, so nothing downstream can tell a dead candidate from a live one.
Relevant code (main 466cf98, references.rs):
resolve(:383-407) iterates all objects of the sigil and callsbest_match— noclearedfilter.best_match(:410-475) never readsobject.clearedeither; the petname tier (:430-444) likewise.claimants(:368-380) counts cleared objects as claimants for contested determination.render(:543-578) is the only placeclearedis honored — after the reference already exists.
Evidence (verified this run, laptop probe)
Probe: ~/git/fleet/probe-2026-11-02-laneA-references/ — verbatim references.rs (md5 b939a8c3b71faa4fef2958834888ce1c) plus the two minimal compile fixes described in #4454 (the module does not compile as landed; the fixes touch only the StoreId Default impl and an owned String in from_markdown, neither of which affects resolution). The module's 12 own tests pass in the probe; two added probe tests (tests/cleared.rs, log patched-output.txt) demonstrate:
cleared_target_still_resolves_and_auto_inserts ... ok
— index holding ONLY a cleared "Roadmap": resolve("roadmap") returns 1 candidate
for the tombstone, single() returns it, insert_unambiguous succeeds, and the
fresh reference immediately renders as RenderState::Cleared.
cleared_duplicate_makes_live_target_contested ... ok
— one live "Minutes" + one cleared "Minutes": resolve returns 2 candidates,
is_contested() is true, insert_unambiguous("minutes") fails Ambiguous(2)
even though only one live target exists.
Why it matters
The design record (doc/2026-10-30T13-25-00Z_design_friendly_name_references.md §4) defines the cleared state for rendering stored references — a citation degrades to its label. It never sanctions minting new references to tombstones, and the contested rule it adopts ("two or more claims for the same surface") is about live claims an author must choose between. As written, deletion of a document silently (a) keeps it insertable by anyone resolving its name, and (b) poisons the name for the live document that replaced it — the exact ambiguity the contested rule exists to surface only when a real choice exists.
Acceptance criteria
-
resolvedoes not return candidates for cleared objects (all tiers, including petname matches), or candidates for cleared objects are explicitly marked as cleared inCandidateand excluded fromsingle()/insert_unambiguous— one stated rule, documented in the module docs. -
claimantsdoes not count cleared objects: a live target whose only same-surface namesake is cleared resolves uncontested andinsert_unambiguoussucceeds. - Existing behavior for stored references is unchanged:
renderstill reportsRenderState::Clearedfor a reference whose target was cleared after insertion (existing testa_cleared_target_degrades_to_its_labelstill passes). - New tests cover: cleared-only phrase resolves to no auto-insertable candidate; live+cleared duplicate inserts unambiguously; the module's existing 12 tests still pass (after the id(lib): references.rs does not compile — LocalIndex derives Default over a StoreId with no Default impl, and from_markdown breaks with a borrow of a loop-local String (PR #2756) #4454 compile fix).
Distinct from: #4454 (the same module's compile errors — this issue is the resolution semantics, visible only once the module compiles), #2259 (the PoC tracker this module implements), #4298 (notes.rs cyclic revise parents — different module).
Activity
dezren39 commentedon Nov 2, 2026
🤖 Agent note · state: filed
100 remaining items
dezren39 commentedon Nov 3, 2026
agent-note:v1
event: parked
task: 6366 (repo-health-code-pilot; worker repo-worker-code; OpenChamber scheduled lane 262eb403-3347-4a7c-ba6b-e7bc263ca853)
state: parked until 2026-11-03T09:37:43Z.
blocker: Canonical PR #4537 remains OPEN on queue/6366-4455-cleared-object-resolve at d831908, authored by dezren39 (Drew); fresh checks: basic guard SUCCESS, CodeRabbit NEUTRAL. Dependency #4454 is CLOSED. This lane did not touch or merge the Drew-owned PR and created no competing PR.
resume: After explicit ownership handoff or PR closure/merge, revalidate #4455, PR #4537, checks, diff, and targeted tests.
labels: queue/parked + status/parked; work/assigned retained.
bookkeeping: openchamber scheduled lane — sandbox bookkeeping deferred to fleet reconciliation.
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: reviewed (coverage loop-back)
Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 6366 (small_fix, queued, priority 40) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
Found via: coverage loop-back 2026-11-03
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: parked (resume brief — verify then merge an existing PR)
queue: repo-health-code-pilot
task: 6366
by: openchamber-scheduled-lane
at: 2026-11-03T14:04Z
The work already exists: PR #4537, open, awaiting verification
Claiming this task found
origin/queue/6366-4455-cleared-object-resolvewith one commit (d831908bf, "fix(id): exclude cleared objects from resolve candidates and claimants (#4455)") and PR #4537 open againstmain. The change is exactly the fix the issue describes, and it is small:claimants()gains.filter(|object| !object.cleared)— a tombstone no longer contests its live namesake.resolve()filters!object.clearedwhile collecting candidates — a tombstoned target is no longer offered, soResolution::single()/insert_unambiguouscannot auto-pick it.a_cleared_only_target_does_not_resolve_or_insertanda_cleared_duplicate_does_not_contest_a_live_target.Why it is parked rather than merged
main, and its diff no longer applies tomain'sreferences.rs(git apply --checkfails at:384) —mainmoved under it.git merge-tree --write-treereports no conflicts, so a plain merge ofmaininto the branch should be mechanical.d831908bthe only run isopencode-config-guard(pass); noid-workflow basic job exists for that commit, so the merge gate has not actually been exercised for the Rust change. That is a coverage gap worth noting when this PR is next touched.cargo testofreferenceshits unrelated pre-existing compile errors (ChainExt.link, id: build: local topic links and backlink projection #3816) and that thereferences.rscompile breakage is id(lib): references.rs does not compile — LocalIndex derives Default over a StoreId with no Default impl, and from_markdown breaks with a borrow of a loop-local String (PR #2756) #4454. The honest verification for this fix is: mergemainin (picking up whatever id(lib): references.rs does not compile — LocalIndex derives Default over a StoreId with no Default impl, and from_markdown breaks with a borrow of a loop-local String (PR #2756) #4454/id: build: local topic links and backlink projection #3816 statemainis in), run the two named tests, and only then enqueue the merge.Resume instruction (20 minutes from 2026-11-03T14:03Z)
If
mainstill fails to compilereferencesfor the #4454/#3816 reasons, that is a pre-existing main break: record it on #4454 rather than treating it as this PR's failure.Merge pull request #4537 from developing-today/queue/6366-4455-cleare…
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: done
task: 6366 (repo-health-code-pilot, small_fix) — lane 8ac61616-3815-4e7b-b33d-840a3829154a
pr: #4537 (merged)
merge_sha: 0467ae0
Cleared objects are now excluded from
LocalIndex::resolvecandidates andclaimantscounts, per the rule documented in thereferences.rsmodule docs. A cleared-only index yields no candidate (insert_unambiguous→ NoMatch); live + cleared duplicate title is uncontested and inserts; render of references stored before clearing still reports Cleared.Verification: branch was 583 commits behind main (including a later
claimantspetname change), so I mergedorigin/maininto the branch and rancargo test --lib referenceson the merged result — 21 passed, 0 failed (includes the petname contested/uncontested cases). PR checks green on the merge commit2e5ffc28b; merged as0467ae0f.