GeezerVison is showing github.com — id(publications): publish() compares placements raw — a direct-pushed non-canonical spelling (/arena/, //world) defeats the one-program-per-placement check its siblings normalise for · Issue #6459 · developing-today/code
id(publications): publish() compares placements raw — a direct-pushed non-canonical spelling (/arena/, //world) defeats the one-program-per-placement check its siblings normalise for #6459Labels app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientqueue/parkedQueue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobstatus/parkedDeliberately paused with a recorded resume conditiontask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DescriptionProblem
Registry::publish (pkgs/id/src/publications.rs:226) is the one placement comparison in the module that does not compare by the mount a record actually names.
publish canonicalises the incoming path mount, then checks whether the placement is taken with raw equality (line 242):
.any(|existing| existing.placement == publication.placement)
Its two sibling operations were both fixed to compare by normalised spelling, because records can exist in the registry that bypassed publish() — the field is pub (publications: Vec<Publication>, line ~129), and the module's own tests simulate such records with direct pushes:
unpublish (line 269) normalises both the wanted placement and every stored placement (normalise_mount_spelling, lines 281/293), with the comment: a record stored under a non-canonical spelling "must still be removable by its canonical name".
boot_warnings (line 307) shadow-matches on normalise_mount_spelling(path) (line 318), because a stored //world "is the /world mount".
normalise_mount_spelling itself (line 168) exists, per its doc comment, "so records that bypassed publish() (hand-edited files, direct publications pushes) still compare and shadow-match by the placement they actually name, not by their raw spelling: //world is the /world mount, and /api/ is /api."
publish's taken-placement check never got the same treatment, and no test covers it.
Verified behaviour (code read @ main 917e1a3bdb, logic trace against the in-tree tests)
- Direct-push a record the way the module's own tests do (lines 601/675/688):
registry.publications.push(mount("/arena/", false)) — a non-shadow mount, so nothing else interferes.
registry.publish(mount("/arena", false), KNOWN_EXPLORER_ROUTES):
- the incoming path canonicalises to
/arena;
- the taken check compares
PathMount { path: "/arena/" } == PathMount { path: "/arena" } → false, so the "placement already published" refusal does not fire;
- the shadow check finds no shadow for
/arena;
- the record is pushed (line 260). The registry now holds two publications for the same mount, contradicting
publish's own contract: "one program per placement — a second publish must unpublish first, never silently replace".
- The resulting state is also one the persistence layer refuses to restore:
save() writes both records, and load() → validate_persisted (line 391) rejects the non-canonical /arena/ spelling (and would reject the duplicate) — so a registry publish happily built fails loudly on the next boot, instead of the duplicate being refused at publish time.
The same trace holds for //world vs /world (with the shadow acknowledgement set) and /games//arena vs /games/arena.
Note the laptop was unreachable during the filing run (agent proxy proxy closed during CONNECT, real SSH closed), so no compiled probe was run; the verification is the code read above plus the module's own tests, which pin every premise: direct pushes are a supported state (tests at lines 601/675/688), normalise_mount_spelling("/api/") == "/api" semantics (test at line 688), and canonicalisation of /arena/ being refused as a stored spelling while publish canonicalises its input (tests at lines 456-466, 660-673).
Why it matters
publish is the write-side guard for the one-program-per-placement invariant (#2147). The two read/remove-side operations already assume non-canonical records can be present; the write side assuming they cannot is exactly how a duplicate mount enters the set — and it then either double-binds at runtime apply or makes the persisted registry unloadable at boot. This is the publish-side counterpart of closed #5179 (load-side: Registry::load restores records publish() would refuse).
Acceptance criteria
publish's taken-placement check compares path mounts by normalised spelling (the same normalise_mount_spelling comparison unpublish uses), so publishing /arena refuses when a stored /arena/, //arena, or equivalent spelling already names that mount — and vice versa.
- Listener placements keep exact
SocketAddr equality.
- Regression tests: publish-after-direct-push duplicates are refused for at least a trailing-slash spelling and a doubled-separator spelling, on both a plain mount (e.g.
/arena) and an acknowledged shadow mount (e.g. /world); a publish of a genuinely different mount after a direct push still succeeds.
- Existing publications tests keep passing (
cargo test -p id publications or the crate's equivalent CI check).
Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests app/idPackage/app: id (pkgs/ or apps/ in this repo) on Nov 6, 2026dezren39 commented on Nov 6, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (new-issue-creator-code-a)
- Session / ID: cron new-issue-creator-code-a run 2026-11-06T07:05Z
- Found via: filed this run
- Task: Filed this issue — publish()'s taken-placement check compares raw placement equality while unpublish/boot_warnings normalise mount spelling, so a direct-pushed non-canonical record defeats the one-program-per-placement guard.
- Expectation: effort s — done when publish refuses a placement whose normalised spelling is already taken, with regression tests for trailing-slash and doubled-separator spellings.
- Links: queue packet packet-6459-small-fix.json (repo-health-code-pilot)
dezren39 commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 Triage verdict: confirmed
Verified against current origin/main (252d430853fd2d4835341bb46ac3e36aa1f1a4a7). In Registry::publish, the incoming PathMount is canonicalized, but the taken-placement guard at pkgs/id/src/publications.rs:242 compares existing.placement == publication.placement directly. A direct-pushed /arena/ therefore does not equal the canonical /arena; the same raw-spelling gap applies to //world versus /world. This is reachable because publications is public and existing tests directly push entries (:601, :675, :688). By contrast, unpublish and boot_warnings normalize stored paths at :281, :293, and :318. So the one-program-per-placement guard can be bypassed for logically identical path mounts.
Follow-up fix task 10950 is queued in repo-health-code-pilot: normalize path-placement comparison while preserving exact listener address equality, with trailing-slash/doubled-separator and distinct-mount regressions. No code changes were made during triage. No associated open PR was found.
dezren39 commented on Nov 9, 2026 agent-note:v1 lane code-k task 10950 stage handed_off: revalidated issue #6459 OPEN no hard-stop labels; execution lane opencode row 3332; handing off to opencode claimant, parking task 10950. next: claimant launches bound session. dezren39 commented on Nov 9, 2026 agent-note:v1 lane=code-b task=10950 stage=handed_off — Issue #6459 revalidated fresh: OPEN, no hard-stop labels. Task 10950 (small_fix) opencode-assigned (lane row 3332); handing off to opencode claimant, parking 1200s.
🤖 Agent note · handed off
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-m — Session/ID: task 10950, repo-queue-worker-shift-m 2026-11-09 run. Task 10950 (small_fix) for issue #6459: Fix id publication duplicate check for normalized path mounts; attempts 4/4 on this claim. Fresh check: issue #6459 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels. Execution lane row 3332 = opencode (repeat handoff). Checkpointed handed_off; parking task 10950 for 20 minutes for the claimant window. dezren39 commented on Nov 10, 2026
Agent note — lane code-t, task 10950 (small_fix, issue #6459)
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-b — Session/ID: task 10950, repo-queue-worker-shift-b 2026-11-09 run. Task 10950 (small_fix) for issue #6459: id publication duplicate check for normalized path mounts; attempts 4/4 (at cap — claimant launch matters; if the lease lapses unlaunched the task will need its cap raised to return). Fresh check: issue #6459 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels. Execution lane row 3332 = opencode. Handoff reason: scheduled shift is time-bounded; claimant is the persistent execution session. Checkpointed handed_off; parking task 10950 for 20 minutes for the claimant window.
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 10, 2026
Lane code-n picked up task 10950 (issue #6459) — handed off to opencode claimant.
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-t — Session/ID: task 10950, repo-queue-worker-shift-t 2026-11-10 run. Task 10950 (small_fix) for issue #6459: Fix id publication duplicate check for normalized path mounts (#6459); attempts 4/4 AT CAP on this claim. Fresh check: issue #6459 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels, no status/needs-triage. Execution lane row 3332 = opencode (repeat handoff). Checkpointed handed_off; parking task 10950 for 20 minutes for the claimant window. dezren39 commented on Nov 11, 2026
Agent note — task 10950 done (lane any-a): publish() placement check normalised via PR #8680
MetadataMetadataapp/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientqueue/parkedQueue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobstatus/parkedDeliberately paused with a recorded resume conditiontask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DevelopmentNo branches or pull requestsIssue actions
|