Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7aa3b49
feat(evals): ShortCircuit — skip expensive evaluators on early fail
renaudcepre Mar 30, 2026
93c85f5
feat(core): eval-aware types, events, and DI fixes
renaudcepre Mar 25, 2026
5041457
feat(evals): native eval system with @session.eval()
renaudcepre Mar 26, 2026
4310e57
feat(reporters): Rich eval table, multi-model history, console.print
renaudcepre Mar 27, 2026
82f736b
feat: tests, examples, and documentation
renaudcepre Mar 29, 2026
29204bc
chore: entity exports, pyproject config
renaudcepre Mar 29, 2026
bc4d16d
Merge branch 'main' into feat/evals-native
renaudcepre Mar 30, 2026
3ed68a4
fix ci
renaudcepre Mar 30, 2026
7abeb1d
Merge branch 'feat/evals-native' of github.com:renaudcepre/protest in…
renaudcepre Mar 30, 2026
ad7a207
chore: fix all lint — move imports to top-level, no lazy imports
renaudcepre Mar 30, 2026
5f5e9a0
feat(evals): Judge protocol — LLM-as-judge via inversion of dependency
renaudcepre Mar 31, 2026
015c451
fix(reporters): show in/out token split in eval usage summary
renaudcepre Mar 31, 2026
8e748ce
fix(history): exclude error-only runs from stats, propagate is_error …
renaudcepre Mar 31, 2026
6149633
refactor: remove getattr abuse — proper typing and Protocol contracts
renaudcepre Mar 31, 2026
c081255
fix(hashing): fail-hard canonicalization, evaluator_identity() protocol
renaudcepre Mar 31, 2026
d7fbba3
refactor: replace kind string literals with SuiteKind StrEnum
renaudcepre Mar 31, 2026
905d3c8
refactor: move lazy imports to top-level, remove PLC0415 per-file ign…
renaudcepre Mar 31, 2026
b703fa8
fix: resolve all 32 mypy errors, type EvalContext generics properly
renaudcepre Mar 31, 2026
39bd555
refactor: remove dead duck-typed evaluator markers, add typed examples
renaudcepre Mar 31, 2026
155db22
ci: update workflow to install dependencies and fix mypy invocation
renaudcepre Mar 31, 2026
96d3632
refactor: remove redundant type ignores, update dependency management
renaudcepre Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ jobs:
with:
python-version: "3.12"

- name: Install dependencies
run: uv sync --all-extras --group dev

- name: Type check
run: uvx mypy --strict protest
run: uv run mypy protest

test:
needs: lint
Expand Down Expand Up @@ -103,7 +106,7 @@ jobs:
files: coverage.xml
fail_ci_if_error: false

c docs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand Down
49 changes: 49 additions & 0 deletions docs/core-concepts/console.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Console Output

Print progress and debug messages that bypass test capture.

## The Problem

`print()` inside tests and fixtures is captured by ProTest. During long-running fixtures (pipeline imports, graph seeding), there's no visible feedback.

## `console.print`

```python
from protest import console

@fixture()
async def pipeline():
for i, scene in enumerate(scenes):
console.print(f"[cyan]pipeline:[/] importing {scene.name} ({i+1}/{len(scenes)})")
await import_scene(scene)
return driver
```

Messages appear inline in the reporter output, between test results.

## Rich Markup

`console.print` supports Rich markup. The Rich reporter renders colors; the ASCII reporter strips tags.

```python
console.print(f"[bold green]done[/] in {duration:.1f}s")
console.print(f"[yellow]warning:[/] slow query ({elapsed:.2f}s)")
```

## Raw Mode

Skip markup processing with `raw=True`:

```python
console.print("debug: raw bytes here", raw=True)
```

The message is passed as-is to both reporters.

## How It Works

`console.print` sends a `USER_PRINT` event through the event bus. The reporter receives it and writes to the real stdout (bypassing test capture). This means:

- Messages appear immediately, not buffered until test end
- Works with `-n 4` (concurrent tests) — the event bus serializes per plugin
- No interference with test capture or `result.output`
Loading
Loading