test(scratch): hold the partition name to injective, not only flat #271
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!271
Loading…
Reference in a new issue
No description provided.
Delete branch "test/scratch-partition-collision"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tests only. Corpus for #270, found while investigating the context-bleed report at #265.
The property that was missing
TestScratchPartitionNameIsFlatholds the traversal property — a requester cannot escape its partition. That is the property that was obviously worth having, and it is well covered.Nothing held the other one: that two requesters land in different partitions.
They do not.
scratchPartitionNamedeletes every non-alphanumeric rune, sohttp:fleet-client,http:fleet_client, andhttp:fleet.clientall resolve tohttpfleetclient.Two things make that more than cosmetic:
"http:" + X-Sirens-Caller, a caller-asserted header with no authentication behind it. So a caller can deliberately mangle punctuation to land in another caller's partition.234388bspills trimmed tool results into the partition automatically. The content at risk is not only what someone chose to save.What lands
Nine pairs. Six colliding, recorded as characterization with the issue number; three that must never collide, as permanent guards:
http:one/http:two318…544/http:318…544http:prefix must keep an HTTP caller out of a Discord user's partitionThat last guard is the one I would not drop. A fix that hashes the requester keeps it for free; a fix that normalises more aggressively could quietly lose it.
Why the second test exists
Flatness and injectivity trade against each other, and a fix for one can break the other. Deleting characters keeps flatness and loses injectivity. Using the raw requester as a directory name would pass every injectivity row here while reopening traversal.
So the second test asserts both hold together, over the same corpus.
Verified in both directions
"a/b" and "ab" no longer collide. If issue 270 was fixed, set collidesNow to falseregression: "318190481467244544" and "318190481467244545" now share partition "unattributed"The second is the interesting one — it merges two real Discord users into one partition, and no existing test noticed.
go vet,gofmt, fullgo test ./...,pre-commit run --filesclean. No live scratchpad was written or read; the collision is demonstrated by callingscratchPartitionNamedirectly.Quail (QA)