Skip to content

faultgate-zero 0.2.0: check plugins and formats.load - #3

Merged
samirsawarkar merged 6 commits into
mainfrom
feat/check-plugins-formats
Oct 30, 2026
Merged

samirsawarkar merged 6 commits into
mainfrom
feat/check-plugins-formats

Conversation

@samirsawarkar

Copy link
Copy Markdown
Collaborator

Upstream change for Fault-Contract (spec section 7, M0). Fully backward compatible; adds features only.

What changes

  • Check plugins: a new entry point group, faultgate_zero.checks. Each object has name, default and run(trace, options) -> Verdict; default=True plugins join DEFAULT_CHECKS. Discovery happens once at import.
    • A plugin named like a built-in check (or two plugins with one name) is a usage error at startup.
    • A plugin that raises gives a verdict that did not fire (check crashed: <ExceptionType>), a FaultgateZeroWarning and a "check crashed" summary line. It never fails the user's test, including under -W error.
    • Plugin reasons joined by ; print one part per line, as policy reasons do.
  • faultgate_zero.formats.load(path, fmt="auto"): OTLP through faultgate-zero's own loader; OpenInference, Langfuse, LangSmith and Braintrust through faultgate's loaders, behind a new faultgate-zero[formats] extra (lazy import). Converted traces keep their prompts and answers. Malformed input is a FormatError (a ValueError).
  • Version 0.2.0, CHANGELOG, README sections, CI installs the formats extra.

Evidence

  • 221 passed, 5 skipped (the 190 tests from 0.1.0 unchanged, plus 31 new).
  • New tests: plugin discovered and runs (real dist-info entry point in a pytest subprocess), name clash stops the session, crashing plugin under -W default and -W error, every faultgate example format loads, prompts and answers survive conversion, malformed OTLP.
  • AES review: Codex ACCEPT at 1438fd4 after two REJECT rounds, whose findings are fixed here with regression tests. Scout: faultgate OK (.aes/scout/scout-b3a3f672.md).

Not released: PyPI 0.2.0 waits for a separate go-ahead.

🤖 Generated with Claude Code

samirsawarkar and others added 6 commits October 22, 2026 19:57
A plugin object has name, default and run(trace, options) -> Verdict. Discovered once at import;
a name clash with a built-in check is a usage error; a plugin that raises gives a verdict that did
not fire, a FaultgateZeroWarning and a 'check crashed' summary line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…extra

OTLP through the own loader; OpenInference, Langfuse, LangSmith and Braintrust through faultgate's
loaders (lazy import), converted with formats.to_zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… version 0.2.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asons print one part per line

Review finding: the crash warning escaped under an error filter. The warning is now guarded, with a
regression test for -W error in-process and in a pytest subprocess.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ormatError in auto mode

Review findings: faultgate writes chat messages as content, faultgate-zero reads parts, so converted
traces lost their text (and abstention never fired). formats.to_zero now turns message text into
parts. Auto-detection on malformed resourceSpans raised AttributeError; it now raises FormatError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… read as faultgate reads them

Converting OpenAI tool_calls too could count a call twice next to its tool span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@samirsawarkar
samirsawarkar merged commit d05891c into main Oct 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant