List what happened in the order it happened, never by id - #46
Merged
Merged
Conversation
A stream's origins, the relations list and a node's edges were ordered by relation id. The ids end in hashes, so a workflow launch listed the streams it started in hash order. On 94 real conversations, 130 of the 150 steps that started several streams led with a stream other than the one their run named first. They are now ordered by where things happened. Inside one stream or one workflow run, a record's position decides: seq, row, block. Across streams, time decides, since a child's file can land before its parent's. The two are combined as a merge: each lane keeps its position order, and the lanes are merged by time. A single comparison that decides some pairs by position and others by time is not transitive. A relation is placed at the earliest record its evidence names, by the same rule. Each stream's origins are ordered on their own, and an origin that is not listed takes no part in the order. Workspace changes and tool executions stay in time order. Records of one instant are now ordered by where each was read, not by id and not by how the time is written. An id decides only between items one record supports. On the 94 conversations the content is unchanged; the order changed in 57.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A stream's
opened_by, therelationslist and a node'sedgeswere ordered by relation id. Relation ids end in hashes, so a workflow launch listed the streams it started in hash order. Horizon shows a step's firststartsedge as the stream to open, and its inspector lists them in this order. On 94 real conversations, 130 of the 150 steps that started several streams led with a stream other than the one their run named first.What changes
seq,row,block.internal/view/order.go). Each lane keeps its own position order, and the lanes are merged by taking, each time, the lane whose next item is earliest, a timed item before an untimed one. A single comparison that decides some pairs by position and others by time is not transitive, as the talk order found.compareTimesnow compares instants only.unresolvedand the othersessionsstay ordered by id; unresolved entries carry no position, and session nodes are the only nodes without one.Conversation.Edges.No key changes;
asz.viewstays 1.0.Measured
On the 94 real conversations (65 Claude Code, 8 MCP, 21 LangChain), every document has the same content as on
main. The order changed in 57. The documented example changes only in order.Tests
TestInOrderMergesLanesByTime: position inside a lane even where times disagree, time across lanes, lane heads of one time, untimed and unlanded items.TestAStreamsOriginsKeepOneOrder, rewritten: origins by position, with ids in the other order.TestEachStreamsOriginsAreOrderedOnTheirOwn: one stream's origins are not moved by another stream's, or by an origin that is not listed.TestAStepsEdgesAreInTheOrderTheyHappened: a launch's edges in its run's order; evidence in two lanes placed by time.TestRecordsOfOneTimeAreInTheOrderTheyWereRead: two spellings of one instant, times that do not parse, the runtime's change first.17 mutations of these rules were each caught by a test.
make checkpasses.