Repository navigation
feat(port): ls.ts formatSize + createLsTool as ls.t27 (Closes #6107) - #6556
Merged
Merged
Conversation
One-commit replacement of the earlier PR for this issue: its follow-up commit lacked an issue reference and failed L1 TRACEABILITY. The spec is the final version from that PR (tests compare with std.mem.eql, no copied helper). Closes #6107 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 5, 2026
Contributor
This was referenced Oct 5, 2026
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.
Closes #6107
Ports
trios/agent-server/apps/server/src/tools/filesystem/ls.ts(gHashTag/BrowserOS @ 928e1624a50e, md5 matches the issue's quote) tospecs/port/browseros/trios/agent-server/apps/server/src/tools/filesystem/ls.t27. This one file is the whole change.What is ported
formatSize: ported in full, writing into a byte buffer.bytes/1024andbytes/1048576are exact binary fractions, sotoFixed(1)(which rounds a tie up) is integer round-half-up. Ties are pinned in the tests: 1280 ->1.3KB, 2883584 ->2.8MB.createLsTool(cwd): the AI SDK tool object, path resolve,assertWithinRoot, readdir and stat are I/O. They keep the name with anundefined;body that no test calls. Every decisionexecutemakes after the directory has been read is inls_text(entries, limit, buf):limit || DEFAULT_LS_LIMIT(0 -> 500);/, then files asname (size);localeCompare(sensitivity: 'base')order, as a rank table measured from node/ICU (agreed with it on 200k random ASCII pairs);(Showing L of T entries. Use limit=2L to see more.)footer;(empty directory).A comment in the spec states the limits: ASCII names only, integer limits only, and at most 256 entries.
Every expected string in the tests was printed by the original's own code under node.
Acceptance criteria (run on the t27c lab, master t27c @ e7afb32)
Negative control: with 3 expected values flipped (
1.5KB->1.6KB,limit=6->limit=7,_x (1B)->_y (1B)), the run givestests 7, pass 4, FAIL 3, naming exactly those three tests. The tests compare withstd.mem.eql. A local byte-equality helper was dropped because duplicate-bodies flagged it as a copy ofgen_w367.t27'sslices_equal.Files:
ls.t27(.t27). Nothing is generated or committed (gen/ output is not tracked for port specs, same as #6528/#6531/#6534).Replaces #6536. That PR had the same file, but its second commit had no issue reference and failed L1 TRACEABILITY. This PR has the same final spec in one commit.
🤖 Generated with Claude Code