Skip to content

fix: ls -R hierarchy + tracking baseline + incompatible flags (#714, #561)#799

Closed
pszymkowiak wants to merge 1 commit intodevelopfrom
fix/ls-recursive-hierarchy
Closed

fix: ls -R hierarchy + tracking baseline + incompatible flags (#714, #561)#799
pszymkowiak wants to merge 1 commit intodevelopfrom
fix/ls-recursive-hierarchy

Conversation

@pszymkowiak
Copy link
Copy Markdown
Collaborator

Closes #714, Closes #561

Changes

  1. ls -R hierarchy (rtk ls -R flattens recursive output and loses hierarchy context #714): recursive output now shows directory structure with indentation
  2. Tracking baseline (fix: ls tracking baseline should compare against ls not ls -la #561): savings compared against plain ls (not ls -la)
  3. Incompatible flags: -1, -d, -F, -i, -p passthrough to raw ls

Before/After

BEFORE (flat):               AFTER (hierarchy):
empty-dir/                    readme.md  6B
group-a/                      empty-dir:
group-b/                      group-a:
nested/                         details.md  8B
readme.md  6B                   overview.md  11B
details.md  8B                group-b:
overview.md  11B                examples.md  9B
examples.md  9B                 overview.md  11B
overview.md  11B                nested:
notes.md  6B                      notes.md  6B

LLM comprehension test

20 ls variants tested with llama3.1:8b, phi4:14b, Claude — 100% comprehension on hierarchy.

  • 1114 tests passing
  • All 20 ls variants working (basic, sort, recursive, edge cases)
  • LLMs correctly identify file locations in recursive output

…561)

- ls -R: preserve directory hierarchy with indentation (files under their dir)
- Tracking: compare against plain ls (not ls -la) for honest savings
- Passthrough for flags incompatible with -l parser: -1, -d, -F, -i, -p

Tested with 3 LLMs (llama, phi4, claude) on 20 ls variants: 100% comprehension.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
@pszymkowiak pszymkowiak added bug Something isn't working effort-medium 1-2 jours, quelques fichiers filter-quality Filter produces incorrect/truncated signal labels Mar 24, 2026
@pszymkowiak
Copy link
Copy Markdown
Collaborator Author

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟡 Risk medium

Summary

Fixes recursive ls output to display directory hierarchy with indentation instead of flat listing, changes the tracking baseline to compare against plain ls rather than ls -la, and adds passthrough for flags incompatible with the -l parser (-1, -d, -F, -C, -m, -x, -i, -p).

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #714, #561


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@aeppling
Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

@mgierok
Copy link
Copy Markdown
Contributor

mgierok commented Mar 31, 2026

I I believe this is a very necessary fix. Codex, in particular, has significant difficulties working without it, which in practice leads to increased token usage.

pszymkowiak added a commit that referenced this pull request Apr 12, 2026
…#714)

- Recursive ls output now shows directory headers + indented children so the
  LLM can tell which files live in which directory. Previously every entry
  was collapsed into a flat list that lost all path information.
- Incompatible flags (-1, -d, -F, -C, -m, -x, -i, -p) change ls output format
  enough that our `ls -la` parser breaks. Pass those through to raw ls so
  users still get the expected behavior.

Supersedes #799 — ported to the new `runner::run_filtered` architecture.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
@pszymkowiak
Copy link
Copy Markdown
Collaborator Author

Closing — superseded by #1251.

This PR was based on the pre-refacto src/ls.rs and could not be rebased cleanly after the module moved to src/cmds/system/ls.rs with the new runner::run_filtered architecture (refacto #904). #1251 ports the fix to the current codebase with the same scope (recursive hierarchy + incompatible flags passthrough).

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

Labels

bug Something isn't working effort-medium 1-2 jours, quelques fichiers filter-quality Filter produces incorrect/truncated signal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants