Repository navigation
Conversation
Port of BrowserOS trios/agent-server/apps/server/src/tools/filesystem/ls.ts at 928e1624a50e. formatSize is ported in full (integer toFixed(1) rounding); createLsTool keeps its name as plumbing and its decisions (dirs first, ICU base-sensitivity order, stable sort, limit || 500, cut-off footer, empty directory) live in ls_text. 7 tests pin outputs printed by the original under node; a negative control (4 flipped expectations) fails 3. Closes #6107 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Oct 5, 2026
duplicate-bodies flagged the test helper as a copy of gen_w367.t27's slices_equal. Tests now compare with std.mem.eql; any non-test use is folded into the loop that needed it. Criteria and negative control re-run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR DashboardGenerated at: 2026-10-05 16:27:57 UTC
Summary
Seal Status
|
This was referenced Oct 5, 2026
Owner
Author
|
Superseded by #6556: the same final spec in a single commit that carries |
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).🤖 Generated with Claude Code