Commit Graph

20 Commits

Author SHA1 Message Date
Adrien Eppling 861a46dee5 fix(core): never-worse output guard so RTK never exceeds the raw command
RTK could emit more tokens than the underlying command on small inputs:
filters that add headers, summaries, re-indentation, or a tee hint, plus
synthetic no-result messages ("0 matches", "No stashes", "[docker] 0
containers") printed where the raw command emitted nothing. Both break the
Transparency principle and inflate tokens instead of saving them.

- core::guard::never_worse(raw, filtered) returns raw when the filtered form
  has more tokens (reuses tracking::estimate_tokens), so RTK output is never
  larger than the real command.
- runner::emit_guarded(filtered, hint, raw) composes body + tee hint, guards
  the whole, prints, and returns what was shown so printed == tracked.
- run_captured_filter guards the run_filtered* family centrally; per-site
  guards cover the remaining single-string filters.
- On empty raw, emit empty and preserve the exit code instead of a synthetic
  no-result message (the messages were cosmetic with no dependents; #2461
  reports the grep one as actively harmful).
- git stash show now propagates its exit code instead of masking a real
  failure as Ok(0).

Resolves #2551.
2026-06-23 21:53:35 +02:00
Tailoo 5e7eab5846 fix(dotnet): keep raw fallback when parsed failures incomplete
test_needs_raw_fallback dropped the raw stdout prepend whenever every
parsed failure carried detail, but never checked the list was complete
against summary.failed. A run reporting 5 failures but parsing only 3
detailed blocks would silently lose the 2 unparsed failures.

Add a `failed_tests.len() < summary.failed` clause so the raw fallback is
kept when the structured section is numerically incomplete. Add a
regression test and fix an inconsistent existing fixture (failed: 5 with a
single parsed entry) that the new clause correctly flagged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 22:41:00 +02:00
Tailoo 2d9dc1ab9e fix(dotnet): stop duplicating failures on failing test runs
On failing `dotnet test` runs the orchestrator prepended the full raw
stdout ahead of the filtered summary. The `Failed Tests:` section already
reproduces each failure (name + message + clipped stack) parsed from
TRX/console, so every failure was printed twice — inflating output +65%
vs raw, scaling linearly with failure count (issue #2501).

Gate the raw-stdout prepend behind `test_needs_raw_fallback`: skip it when
the structured section carries detail, keep it when the filter is blind
(no failures parsed, or a parsed failure has empty detail — e.g. a
self-closing <UnitTestResult> with no <ErrorInfo>, or a build failure /
crash where nothing reaches failed_tests).

Extracts two pure, unit-tested fns (`test_needs_raw_fallback`,
`compose_failure_output`) so the orchestration decision is covered without
running dotnet.

Closes #2501

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 22:46:27 +02:00
Adrien Eppling 16d6599b4c refacto(cmds): strip decorator noise from filter output
Separator lines (═══, ---) and an emoji status marker cost tokens
without adding signal for the LLM — RTK output must never add noise
over raw. Semantic labels are kept; the emoji is swapped for plain
monochrome unicode.
2026-06-05 17:41:53 +02:00
aesoft b6054a5fef refacto(truncations): Set global CAPS for truncation
Following tee and hint refacto
Add global CAP constant to be inherited , to enable easier global configuration later
2026-05-20 17:29:14 +02:00
Adrien Eppling 548e4dd995 fix(tee): safe truncation caps and compose-ps tee content fix
Replace all bare magic offset literals (e.g. 21 for cap=20) with named
constants (MAX_XXX + 1) so offsets stay in sync if caps change.
Fix compose_ps to tee pre-formatted lines instead of raw tab-separated
input, so tail -n +N gives the agent readable content.
All 13 affected modules updated: container, dotnet, gh, glab, go, lint,
pnpm, pytest, rubocop, cargo, aws. 1884 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 10:23:01 +02:00
Nicolas Le Cam f005dbf299 chore: fix clippy 0.1.95 warnings 2026-05-10 12:44:38 +02:00
Artiom Tofan c5245d74fa fix(dotnet): 🐛 format warnings section in build/test/restore outputs
- Refactor warning formatting to improve consistency across output sections.
- Ensure warnings are displayed correctly in all relevant output formats.
2026-05-07 15:54:18 +02:00
Artiom Tofan 271bc53f35 fix(dotnet): 🐛 format build/test/restore output summaries
- Improve formatting of output summaries for build, test, and restore commands.
- Ensure status lines are emitted last for better stream consumption.
2026-05-07 15:54:18 +02:00
Artiom Tofan 106305b197 fix(dotnet): 🐛 format build/test/restore output sections
- Separate warnings and errors into distinct sections.
- Ensure status line is emitted last for clarity.
- Maintain consistency with native `dotnet` output behavior.
2026-05-07 15:54:18 +02:00
Artiom Tofan ed161b0a33 fix(dotnet): move build/test/restore status line to the bottom
The `ok` / `fail` verdict line was emitted at the top of the filtered
output, before errors and warnings. Consumers reading the tail of the
stream — `| tail -N`, IDE log followers, agent watch/monitor loops,
bounded-context-window readers — saw error noise followed by EOF with
no verdict anywhere near the end, silently breaking any agent loop that
gates the next step on build success.

Reorder `format_build_output`, `format_test_output`, and
`format_restore_output` to emit the body first, then the separator
(only when the body is non-empty), then the verdict header last,
matching native `dotnet` which ends with `Build succeeded.` or
`Build FAILED.`.

Add three regression tests using strict `output.lines().last()` plus a
`tail -5` inclusion assertion so future regressions that append a
trailing context line get caught.

Closes #1574

Signed-off-by: Artiom Tofan <arto@queue-it.com>
2026-05-07 15:54:18 +02:00
Nicolas Le Cam b269918710 test(dotnet): try to lessen test flakiness
Fix seems counter intuitive but it helps a lot on my machine.
Before, I had 234 errors (23%) out of 1,000 tests run; now, I only have one (0.1%)

It's not totaly fixed but it reduce error a lot and avoids having one almost every time I test a PR.

Another way to completly fix it would be to use std::fs::set_times on old.trx to set each time in the past, but it requires unstable fs_set_times feature, so I'm not sure you'll agree with that

Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
2026-04-26 02:04:58 +02:00
Adrien Eppling 52643791bc Merge origin/develop into feat/refacto-stream-binary
Integrates ~30 develop commits (PR #997): AWS expansion (8→25 cmds),
SSH signing for git commit/push, go test context, grep stdin leak fix,
default-to-ask permissions, gh pr merge passthrough.

Conflict resolution (4 files):
- git.rs: kept .output()+stdin(inherit) for commit/push (SSH/GPG signing)
- go_cmd.rs: accepted incoming + added pub(crate) visibility
- hook_check.rs: merged binary_hook_registered + other_integration_installed
- hook_cmd.rs: fixed permissions path, println→writeln for Gemini deny

Verified: 1445 tests pass, 0 clippy errors, all manual integration tests pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-04 21:21:01 +02:00
aesoft a2312df5f2 feat(stream): standardize command execution with exec_capture() 2026-04-04 20:38:43 +02:00
aesoft deda44f736 fix(docs): clean some docs + disclaimer 2026-04-02 21:33:38 +02:00
aesoft 234909d2c7 fix(automod): add auto discovery for cmds 2026-03-30 17:58:00 +02:00
aesoft 32ff4663cd fix(cmds): exit code unified return code flow 2026-03-29 13:40:54 +02:00
aesoft 135fea693e fix(refacto): conflict w/ dev 2026-03-25 19:56:53 +01:00
aesoft 46fa31c4b8 chore(refacto-codebase): Folders + Technical docs
- codebase more clear for humans and AI agents
- alignement on vision and filter quality in technical docs
2026-03-24 22:14:35 +01:00
aesoft f1ac236e46 fix: start folder & docs refacto 2026-03-23 19:00:52 +01:00