Name LangChain files for their header's time, and keep a stream's origins in one order - #45
Merged
Merged
Conversation
…gins in one order Both were found by comparing the OAP's asz.view documents with asz's own on real landed files. - The LangChain collector read the clock once per pass for a file's name and once per file for its header's collected time. A server that stores files by session and sequence names them from the header, so it named every LangChain file apart from asz: all 50 on a real root, by up to 99 milliseconds. None of the 7,185 Claude Code files differed. One time now serves the pass, as in every other adapter. - A stream's opened_by listed its origins in the order a Go map gave them, so a stream with several candidate origins changed from one read to the next. On a real conversation whose stream had three, five reads gave three orders. They are now in relation id order, as the relations list is.
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.
The OAP's Java view builder must produce the same
asz.viewdocument as asz for the same files. Comparing the two on real landed files found two bugs in asz itself:atin its header. A server that stores files by session and sequence names a file from its header, as the OAP does, so it named every LangChain file differently from asz. On a real root, all 50 LangChain files differed, by up to 99 milliseconds. None of the 7,185 Claude Code files did. One time now serves the pass, as in every other adapter. Files landed before this keep their names, because landed files are never rewritten.opened_bychanged from one read to the next. It was built by ranging over the fold's relations, a Go map. So a stream with several candidate origins listed them in a different order on each read: five reads of a real conversation gave three orders. They are now in relation id order, as therelationslist is.Tests:
TestAFileIsNamedForTheTimeItsHeaderSayslands a real LangChain capture with a clock that moves on every read. It fails with either half of the collector fix undone, the transcript files or the body files.TestAStreamsOriginsKeepOneOrderrenders a stream with three origins 50 times. It fails on the first render without the sort.After both fixes, the OAP's documents equal asz's on every real conversation whose files were landed after the fix:
On the older real root, 60 of 65 are identical. The other 5 differ only in the names of LangChain files landed before the fix.
make checkpasses.