Skip to content

feat(port): ls.ts formatSize + createLsTool as ls.t27 (Closes #6107) - #6556

Merged
gHashTag merged 1 commit into
masterfrom
claude/bee-6107-v2
Oct 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/bee-6107-v2

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #6107

Ports trios/agent-server/apps/server/src/tools/filesystem/ls.ts (gHashTag/BrowserOS @ 928e1624a50e, md5 matches the issue's quote) to specs/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/1024 and bytes/1048576 are exact binary fractions, so toFixed(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 an undefined; body that no test calls. Every decision execute makes after the directory has been read is in ls_text(entries, limit, buf):

    • limit || DEFAULT_LS_LIMIT (0 -> 500);
    • directories first with a trailing /, then files as name (size);
    • localeCompare(sensitivity: 'base') order, as a rank table measured from node/ICU (agreed with it on 200k random ASCII pairs);
    • a stable sort;
    • the (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)

--- 1
present
--- 2
2
--- 3
0
289
--- 4
IMPLEMENTED
--- 5
7
--- 6
0
--- parse
parse-ok
--- test-report
--- test report: specs/port/browseros/trios/agent-server/apps/server/src/tools/filesystem/ls.t27 ---

  tests       7
  pass        7
  FAIL        0
  rate    100.0%

Negative control: with 3 expected values flipped (1.5KB -> 1.6KB, limit=6 -> limit=7, _x (1B) -> _y (1B)), the run gives tests 7, pass 4, FAIL 3, naming exactly those three tests. The tests compare with std.mem.eql. A local byte-equality helper was dropped because duplicate-bodies flagged it as a copy of gen_w367.t27's slices_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

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>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 16:44:42 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 41
PRs with All Checks Green 9
READY 8
FAILING 41
PENDING 0
NO CHECKS YET 0

These columns do not partition: 8 + 41 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=9f2c8a4829f6 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant