← Back to Pull requests

v1.0.0 #21

Closed
unknown closed this pull request without merging on Aug 07, 2025 08:38 UTC
View on GitHub
unknown unknown commented on Jun 23, 2025 14:10 UTC
Author

1.0.0

1.0.0 is a complete rewrite of ansifmt.

At this stage, ansifmt has been fully rewritten. It now includes a test suite. This version is entirely incompatible with ansifmt 0.3.0 and older. Notably, some of its features were purposefully lost in this rewrite.
Users should expect a new library on top of this one to replace them in the future.

Changes

  • ansifmt is now split in two modules: Ansi, which provides APIs for escape sequences (in Ansi), attributes as a low-level representation (in Ansi.Attribute) and terminal-compatible colors (in Ansi.Color), and Fmt, which provides a pretty-printable string API built on top of Ansi.

  • The Color API has been simplified. Colors can now be constructed using built-in integers ; they will be normalized-on-demand. Advanced is now called Basic. Minimal has been dropped as it is already covered by Basic, assuming that modern terminal emulators support 8-bit colors.

  • The Styling API (now called Ansi) has been tremendously simplified and is now based on a choice type instead of a record type.

  • parse_hex is now of_hex_repr.

  • Luminance calculation now linearizes properly the color.
  • Features

  • A new Fmt API is available, which allows to construct strings with specific parts stylized using Ansi. This includes a convenient function, Fmt.print, to print in the terminal, stripping escape sequences when the output channel is not a TTY (by default -- this is configurable).

  • Color parsing now supports deserialization of strings of the form rgb(r, g, b).

  • Ansi, Attributes, Color and Fmt objects are serializable.

  • Ansi objects are now deserializable.
  • Removed

  • The Formatting API has been fully dropped. We estimate that ansifmt is not the right place to put this in. Instead, we are working on another library, built on top of ansifmt, that will provide these features in an improved manner.

  • The IO API has been removed following Formatting.
  • Performance

    No benchmark has been done, so this should be taken with a grain of salt, but it is likely that the new version exhibits better performance, due to simplification of implementation and lightening of the library overall.

    Diff: 281 lines (+210 / -71) across 3 files Reviewer: chshersh Review duration: 64468m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 281 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.338
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #21"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.7% (MEDIUM) · Higher = larger blast radius
    39.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.7% · Safe to merge
    15.7%