6 Commits

Author SHA1 Message Date
can1357 8e72d4778e test(ttsr): cover human-readable inference note
(cherry picked from commit 8867610c39cf302089b7a4203e3ff8886fb1af52)
2026-07-29 23:08:24 +02:00
roboomp 43534b25bc fix(ttsr): flag text-source inference for unlisted file extensions
`omp ttsr test <file>` inferred the match source from the path extension
against a hardcoded allowlist (`SOURCE_FILE_EXT`); a supplied source file
whose extension was absent silently fell through to the text (prose)
context, where tool-scoped rules can never match. The result was a false
negative indistinguishable from a non-matching regex, contradicting the
documented "a positional that resolves to a file defaults to tool/edit
context" contract.

- Emit an explanatory note when a resolvable file path is supplied and the
  source is inferred as `text`, pointing at `--source tool --tool edit`.
  Surfaced in both text and `--json` output via `TestReport.inferenceNote`.
- Extend the allowlist with the .NET family and other common source
  languages (cs, razor, cshtml, fs, fsx, vb, sh, bash, sql, zig, dart,
  scala, ex, exs, proto, tf).

Left the fall-through default itself unchanged (inverting the test is a
behaviour change and a maintainer call).

Fixes #6887
2026-07-28 10:35:31 +00:00
oldschoola a2854ba768 fix: migrate coding-agent tests from fs.rm to removeWithRetries
Migrate 203 test files (356 call sites) from fs.rm/fs.rmSync to
removeWithRetries/removeSyncWithRetries to reduce EBUSY test failures
on Windows. removeWithRetries is now exported from @oh-my-pi/pi-utils.

The migration uses a regex-based approach that:
- Replaces fs.rm(path, { recursive, force }) → removeWithRetries(path)
- Replaces fs.rmSync(path, { recursive, force }) → removeSyncWithRetries(path)
- Replaces fs.rm(path) → removeWithRetries(path) (no options)
- Skips fs.rm/fs.rmSync inside template literals (bun --eval scripts)
- Adds imports to existing @oh-my-pi/pi-utils import or creates new one
- Removes unused fs imports where fs.rm was the only fs usage (4 files)
2026-06-23 15:28:05 -07:00
can1357 fa45b9e7f9 test(coding-agent): migrated temp file creation to system temp directory
- Standardized all test temporary file handling to use the system temp directory (`os.tmpdir`) instead of creating artifacts inside the source tree.
- Added lifecycle management to `ttsr-cli.test.ts` to ensure temporary directories are created once per test run and cleaned up automatically.
- Updated file generation paths in CLI and reproduction tests to prevent local state pollution.
2026-06-19 05:11:40 +02:00
can1357 d182db3973 feat(coding-agent): implemented gitignore-aware scan command to ttsr cli
- Added the `scan` action to `ttsr` CLI with support for gitignore-aware file globbing.
- Integrated AST pre-filtering and optimized AST/regex matching to evaluate scan rules.
- Implemented file size limits, binary file detection, and custom `--no-gitignore` and `--max-bytes` flags.
- Introduced comprehensive test suites validating directory mapping, exclusions, and size-limit enforcement.
2026-06-18 01:57:23 +02:00
can1357 30229b97c4 feat(cli): added TTSR CLI command with list and test execution modes
- Added a top-level `ttsr` CLI command with `list` and `test` actions.
- Added snippet input handling for inline text, `--file` path, and stdin via `--file -`.
- Added test-mode context inference and result output for matched and unmatched rules.
- Added CLI tests for source inference, explicit source overrides, JSON output, and list mode.
2026-06-17 20:42:19 +02:00