Output
Source files: src/output/progress.ts, src/output/terminal.ts
The output module provides real-time terminal feedback while tests are running. LLM invocations can take anywhere from seconds to minutes per test file, so without live feedback the tool would appear frozen. The spinner system animates Unicode Braille characters at 80ms intervals, showing which test is currently running and progress through the suite. When a test completes, the spinner is replaced with a result line showing pass/fail counts.
The colour system uses raw ANSI escape codes rather than a library like chalk. It detects whether stdout is a TTY — in a terminal, it shows animated spinners and coloured output. In piped or CI output (where escape codes and line overwriting would produce garbage), it falls back to static, unadorned lines.
Spinner system
Section titled “Spinner system”createProgress(total) returns a Progress object with three methods:
start(testName, index)
Section titled “start(testName, index)”Starts an animated spinner (TTY) or prints a static line (non-TTY):
⠹ [1/5] Running auth-middleware.md...Uses Unicode Braille frames (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏) cycling at 80ms intervals.
retry(testName, attempt, maxRetries)
Section titled “retry(testName, attempt, maxRetries)”Replaces the spinner with a retry indicator:
⟳ [1/3] Retrying auth-middleware.md...result(testName, results, index)
Section titled “result(testName, results, index)”Stops the spinner and prints the final result with an icon:
✔ [1/5] auth-middleware.md · 2 passed ✗ [2/5] api-routes.md · 1 failed ⚠ [3/5] broken-test.md · 1 erroredResults from a single test file may contain multiple scenarios (e.g. “2 passed, 1 failed”).
Colour utilities
Section titled “Colour utilities”The colors object is exported for use across the output layer:
| Function | ANSI code | Usage |
|---|---|---|
green | \x1b[32m | Passed counts |
red | \x1b[31m | Failed counts |
yellow | \x1b[33m | Errored counts, warnings |
cyan | \x1b[36m | Spinner frames |
dim | \x1b[2m | Index tags, separators |
bold | \x1b[1m | Emphasis |
greenBold | \x1b[1;32m | Final “PASSED” verdict |
redBold | \x1b[1;31m | Final “FAILED” verdict |
Colour is disabled when NO_COLOR is set or FORCE_COLOR=0, following the no-color standard.
Terminal summary
Section titled “Terminal summary”printSummary() in terminal.ts prints the final output after all tests complete:
Semantic tests completed
Report: semantic-test-results/latest.mdCI Output: semantic-test-results/ci-results.jsonDebug: semantic-test-results/debug/
Passed: 10Failed: 2Errored: 0
Validation Issues: - [missing-id] Missing LLM-extracted ID for test in ...
FAILEDSections
Section titled “Sections”| Line | Colour | Condition |
|---|---|---|
| Passed count | Green | Always |
| Failed count | Red | Always |
| Errored count | Yellow | Only if > 0 |
| Skipped count | Dim | Only if > 0 |
| Invalid count | Dim | Only if > 0 |
| Validation issues | Yellow header | Only if validation ran and has issues |
| Final verdict | Green bold / Red bold | ”PASSED” or “FAILED” |