<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Allen McCabe</title>
    <description>The latest articles on DEV Community by Allen McCabe (@fissible).</description>
    <link>https://dev.to/fissible</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3860034%2Febd594f3-ed25-4a3f-8466-12be86ed847b.png</url>
      <title>DEV Community: Allen McCabe</title>
      <link>https://dev.to/fissible</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fissible"/>
    <language>en</language>
    <item>
      <title>I built an eval harness to prove an LLM worked. It proved the opposite.</title>
      <dc:creator>Allen McCabe</dc:creator>
      <pubDate>Fri, 24 Jul 2026 16:40:34 +0000</pubDate>
      <link>https://dev.to/fissible/i-built-an-eval-harness-to-prove-an-llm-worked-it-proved-the-opposite-327m</link>
      <guid>https://dev.to/fissible/i-built-an-eval-harness-to-prove-an-llm-worked-it-proved-the-opposite-327m</guid>
      <description>&lt;p&gt;I set out to have a language model classify integration failures. I built an evaluation harness to prove it worked. The harness proved it wasn't worth using.&lt;/p&gt;

&lt;p&gt;Final architecture: deterministic rules do the classification and structured extraction. The LLM does exactly one thing, writing plain-English incident summaries. Cheap rules to sort, AI to explain.&lt;/p&gt;

&lt;p&gt;Harness is here: &lt;a href="https://github.com/fissible/llm-triage-eval" rel="noopener noreferrer"&gt;https://github.com/fissible/llm-triage-eval&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are the numbers, then how I got them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The headline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Classification:&lt;/strong&gt; rules 89.7%, LLM 87.9%, across 58 hand-reviewed cases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt engineering:&lt;/strong&gt; v1 = v2 = v3 = 89.7%. Three prompt revisions moved nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extraction:&lt;/strong&gt; against a fair baseline, LLM and regex agree 90 to 97% on structured fields. My earlier claim that extraction was the LLM's territory was wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Summaries:&lt;/strong&gt; faithfulness 4.62/5, validated. Completeness 4.26/5, retracted (more on that below).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; $0. Local model via Ollama, roughly 8 to 10 seconds per case.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;A legacy integration layer is being retired and rebuilt. Its failures are voluminous, repetitive, and hard to reason about: a wall of stack traces where the same handful of root causes repeat thousands of times.&lt;/p&gt;

&lt;p&gt;I wanted a failure taxonomy and triage tool. Feed it exported logs, get back a categorized set of distinct problems rather than an undifferentiated pile.&lt;/p&gt;

&lt;p&gt;Secondary benefit that turned out to matter: the labeled failure set doubles as a migration-acceptance suite. If the replacement handles all 58 distinct failures correctly, it covers what the old system was actually failing on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data pipeline
&lt;/h2&gt;

&lt;p&gt;Roughly 4,000 parsed failures collapse to 58 distinct signatures, deduplicated by error type plus normalized message plus originating element. In one case, 675 expression errors were approximately one bug.&lt;/p&gt;

&lt;p&gt;Two things mattered more than anything model-related.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Streaming parse.&lt;/strong&gt; Line-by-line via a generator, constant memory on 100MB+ files. Header regex plus block-field regex.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Correlated-detail enrichment.&lt;/strong&gt; This is the key move and it's entirely deterministic. A failing transaction logs a generic error at ERROR level, and separately, at WARN, a JSON blob keyed by correlation ID carrying the actual root cause. A two-pass scan collects the detail blocks by correlation ID and attaches them to the error case.&lt;/p&gt;

&lt;p&gt;The impact was large. One generic routing category de-aliased from 287 cases to 85. A database timeout category went from 0 to 60, because the real cause had been invisible behind a wrapper.&lt;/p&gt;

&lt;p&gt;That is worth sitting with. The single biggest improvement in classification quality came from stitching correlated log lines together with regex, before any model saw anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  The taxonomy and the doctrine
&lt;/h2&gt;

&lt;p&gt;Thirteen categories, derived from frequency counts on real logs, defined by &lt;strong&gt;root cause rather than error code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The labeling standard, which I'll call the doctrine: classify by the deepest root cause visible in the correlated details, not the generic wrapper. A routing error whose underlying detail is a duplicate key violation is a constraint violation, not a routing error. With one nuance: a timeout &lt;em&gt;calling&lt;/em&gt; a downstream service over HTTP is a downstream timeout; a true database timeout requires the JDBC call to be inside the failing component.&lt;/p&gt;

&lt;p&gt;A rule-based classifier pre-tagged every case, which made building the golden set a review task rather than blind labeling. That weak labeler also became the deterministic baseline the LLM had to beat, which turned out to be the most consequential design decision in the project.&lt;/p&gt;

&lt;p&gt;The 58 cases are sanitized, environment-tagged, and human-reviewed. The original error type is withheld from the model's input, since including it would trivialize the task.&lt;/p&gt;

&lt;h2&gt;
  
  
  The harness
&lt;/h2&gt;

&lt;p&gt;Three eval types:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Classification.&lt;/strong&gt; Accuracy, per-category precision and recall, confusion matrix, compared against the rule baseline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extraction.&lt;/strong&gt; Per-field accuracy on HTTP method, status, target entity, error type, operation, and constraint, compared against a regex parser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Summary.&lt;/strong&gt; The model writes a one-sentence incident summary; an LLM-as-judge scores faithfulness and completeness from 1 to 5.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Discipline throughout: temperature 0, structured output via schemas, every run writes a timestamped JSON report, prompts are versioned so regressions are diffable, and the golden set is the regression target.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan triage:eval &lt;span class="nt"&gt;--source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;db &lt;span class="nt"&gt;--only-reviewed&lt;/span&gt; &lt;span class="nt"&gt;--prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;v3
php artisan triage:eval-extract
php artisan triage:eval-summary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Findings
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rules beat the model at classification.&lt;/strong&gt; 89.7% to 87.9%. Not a rout, but the model has to be &lt;em&gt;better&lt;/em&gt; to justify latency, cost, and nondeterminism, and it wasn't better at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prompt engineering did nothing.&lt;/strong&gt; Three prompt versions, identical accuracy. The entire improvement in this project, an 8.7 point jump from 81% to 89.7%, came from making the labeling doctrine coherent. Not from prompts. Once I could state clearly what the correct label was, both the rules and the model improved, and the rules improved more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The harness caught a bug in itself.&lt;/strong&gt; Running with the v2 prompt flag produced a report labeled v2, but the runner never threaded the version through to the classifier, so it silently re-ran v1. The tell was identical token counts across supposedly different runs. Without the harness recording token counts per run, three prompt versions would have looked like a real negative result rather than a wiring bug producing a fake one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A fair baseline erased the model's apparent edge on extraction.&lt;/strong&gt; With a shallow regex, the model looked dramatically better, because it dug into correlated details the regex ignored. Making the regex details-aware closed the gap: agreement of 96.5% on HTTP method, 94.8% on status, 93.1% on constraint, 89.7% on operation. The two fields that still diverge, error type at 62% and target entity at 83%, differ for definitional reasons rather than accuracy: when a failure chain carries several error codes, which one is "the" type is a question about the taxonomy, not the extractor.&lt;/p&gt;

&lt;p&gt;I had previously claimed extraction was where the LLM earned its place. That claim was an artifact of a weak baseline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summaries are where the model wins.&lt;/strong&gt; Given a failure with correlated details, it produces a readable root-cause-and-cascade narrative that no regex is going to write.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validating the judge
&lt;/h2&gt;

&lt;p&gt;Scoring summaries with an LLM judge that shares a model with the summarizer is self-evaluation, and I didn't want to report those numbers without checking them. So I scored 15 summaries by hand and compared.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Axis&lt;/th&gt;
&lt;th&gt;Exact&lt;/th&gt;
&lt;th&gt;Within-1&lt;/th&gt;
&lt;th&gt;Mean bias&lt;/th&gt;
&lt;th&gt;Quadratic-weighted κ&lt;/th&gt;
&lt;th&gt;Verdict&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Faithfulness&lt;/td&gt;
&lt;td&gt;80%&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;-0.07&lt;/td&gt;
&lt;td&gt;0.57&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Completeness&lt;/td&gt;
&lt;td&gt;40%&lt;/td&gt;
&lt;td&gt;80%&lt;/td&gt;
&lt;td&gt;+0.13&lt;/td&gt;
&lt;td&gt;0.10&lt;/td&gt;
&lt;td&gt;Do not trust&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Faithfulness holds.&lt;/strong&gt; Never off by more than one point, near-zero bias, κ of 0.57. The 4.62 stands with moderate confidence. This is the axis that matters most, since it's asking whether the model invented facts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Completeness does not.&lt;/strong&gt; κ of 0.10, exact agreement 40%. Don't cite the 4.26. Two things are likely tangled: completeness is genuinely more subjective, and with only 15 items scored mostly 4s and 5s, κ becomes unstable and reads low even where within-1 agreement is 80%. Either way the honest call is inconclusive.&lt;/p&gt;

&lt;p&gt;The most useful thing I learned here wasn't statistical. Scoring completeness by hand was &lt;em&gt;hard&lt;/em&gt;, and I disagreed with my own earlier judgments. That's not a judge problem, it's a rubric problem. I had written a coherent doctrine for classification labels and never wrote one for what "complete" means in a summary. The judge disagreed with me because I disagreed with myself.&lt;/p&gt;

&lt;p&gt;LLM-as-judge worked on the objective axis and failed on the subjective one, which is roughly what you'd hope, and worth knowing rather than assuming.&lt;/p&gt;

&lt;h2&gt;
  
  
  The resulting architecture
&lt;/h2&gt;

&lt;p&gt;Deterministic rules and parsers do classification and structured extraction. The LLM writes the plain-English summary on demand.&lt;/p&gt;

&lt;p&gt;The LLM classifier and extractor still exist, but only inside the eval harness, as the measured contender. Swapping to a stronger model is a two-value config change, so when I want to know whether a frontier model changes the answer, the benchmark is already there. It just isn't in the live path.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell you to take from this
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Build the eval harness first.&lt;/strong&gt; Its job isn't to prove the model works. It's to find out where the model belongs, and the answer might be "almost nowhere."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A fair baseline is everything.&lt;/strong&gt; A weak regex made the model look great. A strong one erased the edge. Strengthen the baseline before concluding the model wins.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coherent labeling doctrine beats prompt engineering.&lt;/strong&gt; The entire gain in this project came from knowing what the right answer was. Prompt versions were noise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The harness catches the builder's mistakes.&lt;/strong&gt; It caught my silent prompt-wiring bug and it caught my premature claim about extraction. Both were my errors, and both were invisible without measurement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Root cause hides behind generic wrappers.&lt;/strong&gt; Stitching correlated context together was the highest-leverage work in the project, and it was regex.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate your judge.&lt;/strong&gt; And when it disagrees with you, consider that your rubric might be the problem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local-first is honest about cost.&lt;/strong&gt; Free iteration, no data leaving the machine, and a benchmark that can measure hosted models later rather than assuming them.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The uncomfortable version of all this: I spent most of the project building the thing that told me not to build the thing. That was the project working correctly.&lt;/p&gt;

&lt;p&gt;The harness is on GitHub: &lt;a href="https://github.com/fissible/llm-triage-eval" rel="noopener noreferrer"&gt;https://github.com/fissible/llm-triage-eval&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Your API contract belongs in CI</title>
      <dc:creator>Allen McCabe</dc:creator>
      <pubDate>Sun, 17 May 2026 04:36:32 +0000</pubDate>
      <link>https://dev.to/fissible/your-api-contract-belongs-in-ci-4273</link>
      <guid>https://dev.to/fissible/your-api-contract-belongs-in-ci-4273</guid>
      <description>&lt;h1&gt;
  
  
  Treating OpenAPI specs as build artifacts: a working pattern in Laravel with accord, forge, and drift.
&lt;/h1&gt;

&lt;p&gt;You ship a Laravel API. You publish OpenAPI docs. The two are correct on the day you launch.&lt;/p&gt;

&lt;p&gt;Three months later they aren't.&lt;/p&gt;

&lt;p&gt;Maybe a &lt;code&gt;nullable&lt;/code&gt; slipped into a response field and the iOS client started crashing on null pointer dereferences. Maybe a field got renamed in v1.2 and a partner integration silently broke for two weeks. Maybe an entire endpoint got added without a spec entry, and the docs page lies to every new developer who reads it.&lt;/p&gt;

&lt;p&gt;The spec didn't lie when it was written. It just stopped being true.&lt;/p&gt;

&lt;p&gt;The cost of catching that drift scales with how late you catch it: cheap in your editor, manageable in CI, expensive in staging, ruinous in production. The longer the contract goes unverified, the more confidently your team builds on top of a fiction.&lt;/p&gt;

&lt;p&gt;The good news is that a contract is just a spec file. It can be checked. It can be a CI gate. The version of this checking that I've found practical is what this post is about.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "API contract adherence" actually means
&lt;/h2&gt;

&lt;p&gt;Two specific guarantees:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Implementation matches spec.&lt;/strong&gt; Every route the application actually serves is described by the spec. Every request and response shape that goes over the wire conforms to the schemas in the spec.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spec matches implementation.&lt;/strong&gt; No spec entries describe routes the application no longer serves. No schemas in the spec describe shapes the application no longer produces.
Both directions matter. If your spec says "/users supports DELETE" and your code removed DELETE last sprint, clients are going to call DELETE and you're going to wonder why they're seeing 405s.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;OpenAPI 3.0 is the standard format for writing this contract down. It's a YAML or JSON document describing paths, operations, parameters, request bodies, and response shapes. The format is mature enough that I'm going to skip describing it in this post. If you're working on a JSON HTTP API, you've seen OpenAPI before; if you haven't, the &lt;a href="https://swagger.io/specification/" rel="noopener noreferrer"&gt;spec docs&lt;/a&gt; are short.&lt;/p&gt;

&lt;p&gt;The interesting question isn't "what does OpenAPI look like." The interesting question is: &lt;em&gt;how do you keep your spec honest?&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Three classes of drift
&lt;/h2&gt;

&lt;p&gt;When your spec and your implementation get out of sync, the drift falls into roughly three buckets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structural drift.&lt;/strong&gt; Routes added, removed, or moved. The spec says &lt;code&gt;/v1/posts&lt;/code&gt; exists; your code doesn't have it. Or your code has &lt;code&gt;/v1/posts/{id}/restore&lt;/code&gt;; the spec doesn't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shape drift.&lt;/strong&gt; Request or response bodies that no longer match the schema. The spec says &lt;code&gt;name&lt;/code&gt; is required and a string; your code is now accepting an array, or making it optional, or removing the field entirely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Semantic drift.&lt;/strong&gt; The route exists and the shape matches, but the &lt;em&gt;meaning&lt;/em&gt; has changed. Same field name, different units. Same status code, different conditions for returning it. This is the hardest class to catch programmatically and the most expensive when it happens.&lt;/p&gt;

&lt;p&gt;The first two classes are mechanizable. The third is mostly about reviewer discipline. The pattern I'll describe handles the first two well enough that the third is the only thing humans still need to look for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contract adherence as a CI/CD gate
&lt;/h2&gt;

&lt;p&gt;The pattern I want to talk about is treating contract adherence as a build gate. Not a soft expectation, not a documentation chore, but a hard CI check that exits non-zero when violated.&lt;/p&gt;

&lt;p&gt;This is more useful than runtime-only validation, for one reason: by the time a contract violation hits production, the cost is already incurred. Catching it at build time means the version of the code that violates the contract literally cannot merge. The drift doesn't ship.&lt;/p&gt;

&lt;p&gt;A CI gate has three components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A &lt;strong&gt;spec file&lt;/strong&gt; that's authoritative (committed to the repo, reviewed in PRs, treated as code).&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;runtime validator&lt;/strong&gt; that checks live requests and responses against the spec.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;drift detector&lt;/strong&gt; that runs in CI, compares the routes the app actually exposes against the routes the spec describes, and fails the build on mismatch.
You can build this yourself. You can also use existing tools. I built and maintain the toolchain I'm about to describe because the existing PHP options either didn't enforce both directions, didn't support multiple frameworks, or were heavy enough that adoption was a project unto itself.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The working pattern, in Laravel
&lt;/h2&gt;

&lt;p&gt;The toolchain is called &lt;a href="https://github.com/fissible/accord" rel="noopener noreferrer"&gt;accord&lt;/a&gt;, and it's the foundation of a small family of &lt;a href="https://fissible.dev/" rel="noopener noreferrer"&gt;Fissible&lt;/a&gt; packages that together cover the spec → validate → drift loop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/fissible/forge" rel="noopener noreferrer"&gt;&lt;code&gt;fissible/forge&lt;/code&gt;&lt;/a&gt; scaffolds an OpenAPI spec from your existing routes.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/fissible/accord" rel="noopener noreferrer"&gt;&lt;code&gt;fissible/accord&lt;/code&gt;&lt;/a&gt; validates live traffic against the spec at runtime.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/fissible/drift" rel="noopener noreferrer"&gt;&lt;code&gt;fissible/drift&lt;/code&gt;&lt;/a&gt; detects drift between routes and spec, and fails CI when it happens.
Each piece is independently useful, and they snap together into the CI/CD gate.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 1: get a spec, even if it's empty
&lt;/h3&gt;

&lt;p&gt;If your API has been running without a spec, the cheapest first step is to scaffold one from your existing routes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require &lt;span class="nt"&gt;--dev&lt;/span&gt; fissible/forge
php artisan accord:generate &lt;span class="nt"&gt;--title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"My API"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;forge walks your registered routes, infers request body schemas from your Laravel &lt;code&gt;FormRequest&lt;/code&gt; classes, and writes a starting &lt;code&gt;resources/openapi/v1.yaml&lt;/code&gt; with every endpoint accounted for. Response schemas are scaffolded as empty objects, and those are the ones you fill in to describe what your API actually returns.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;FormRequest&lt;/code&gt; inference is the one piece of forge that I want to call out. Laravel's validation rules are already a declarative description of an input contract, so lifting them into an OpenAPI request schema is mostly a translation problem rather than a generation problem. If your codebase uses &lt;code&gt;FormRequest&lt;/code&gt; classes in a disciplined way, you get half of the spec for free.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: turn on runtime validation in log mode
&lt;/h3&gt;

&lt;p&gt;Install accord and register the middleware:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require fissible/accord
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// bootstrap/app.php (Laravel 11+)&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Fissible\Accord\Drivers\Laravel\Http\Middleware\ValidateApiContract&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;withMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Middleware&lt;/span&gt; &lt;span class="nv"&gt;$middleware&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$middleware&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;appendToGroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'api'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ValidateApiContract&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure log mode initially:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ACCORD_FAILURE_MODE=log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Log mode is the adoption trick. In log mode, accord still validates every request and response, but instead of throwing on violations it logs PSR-3 warnings and lets the request through. Your application keeps working, your logs start filling up with concrete violations, and you have a list of things to fix in your spec or your code before flipping to exception mode.&lt;/p&gt;

&lt;p&gt;Without this mode, adopting accord on a live API is a "stop everything" project. With it, adoption is "run it for a week, fix what surfaces, then flip the switch."&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: add the CI gate
&lt;/h3&gt;

&lt;p&gt;Once you trust the spec, add drift's &lt;code&gt;accord:validate&lt;/code&gt; command to CI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check API contract (drift)&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;php artisan accord:validate&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check implementation coverage&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;php artisan drift:coverage&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;accord:validate&lt;/code&gt; exits non-zero if the spec and the implementation have drifted in either direction. &lt;code&gt;drift:coverage&lt;/code&gt; is an optional second check that catches routes that exist in the codebase but are wired to nothing (skeleton routes, a real production hazard).&lt;/p&gt;

&lt;p&gt;With this gate in place, the only way to merge a route change is to update the spec to match. The spec stops being a documentation artifact and becomes part of the codebase under the same review discipline as any other change.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's technically interesting under the hood
&lt;/h2&gt;

&lt;p&gt;Most of what makes accord work is unglamorous: parse the OpenAPI document, build a route lookup, hand each request through a validator that knows about JSON schemas. Three pieces are worth pulling out.&lt;/p&gt;

&lt;h3&gt;
  
  
  PSR-7/15 core, framework drivers
&lt;/h3&gt;

&lt;p&gt;The validator and middleware in &lt;code&gt;src/&lt;/code&gt; have no Laravel dependency, no Slim dependency, no Mezzio dependency. Framework integration lives entirely in &lt;code&gt;src/Drivers/{Framework}/&lt;/code&gt;. The Laravel driver is a thin service provider plus a middleware wrapper that adapts Laravel's request/response objects into PSR-7 messages.&lt;/p&gt;

&lt;p&gt;The boundary is enforced architecturally: anything outside &lt;code&gt;src/Drivers/&lt;/code&gt; is forbidden from importing framework-specific code. Adding a new framework driver is implementing &lt;code&gt;DriverInterface&lt;/code&gt; and writing a glue middleware. The cleanliness of this boundary is the kind of thing that doesn't matter the day you build it and matters every day after.&lt;/p&gt;

&lt;h3&gt;
  
  
  FailureMode as an enum, not a flag
&lt;/h3&gt;

&lt;p&gt;I wanted three behaviours for contract violations: throw, log, or hand the result to a user-provided callable. The naive way is to thread booleans and special config values through the validator. The honest way is a single enum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="n"&gt;enum&lt;/span&gt; &lt;span class="nc"&gt;FailureMode&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'exception'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nc"&gt;Log&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'log'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nc"&gt;Callable&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'callable'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The validator produces an immutable &lt;code&gt;ValidationResult&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;final&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ValidationResult&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nv"&gt;$valid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$version&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;self&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* ... */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;invalid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$version&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;self&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* ... */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The failure mode decides what to do with the result. The benefit shows up when you go to extend: adding a fourth behaviour (queued reporting, for example) is a new enum case and a new branch, not a new flag and a new conditional everywhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pluggable spec sources
&lt;/h3&gt;

&lt;p&gt;A spec doesn't have to be a local file. The &lt;code&gt;SpecSourceInterface&lt;/code&gt; abstraction lets accord load specs from anywhere:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;SpecSourceInterface&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$version&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;?OpenApi&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$version&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default file source loads YAML or JSON from disk. A URL source fetches from a remote endpoint with optional PSR-16 caching, which is useful when multiple services validate against a shared central spec. A custom source lets you load specs from a database, a registry, or a tenant-specific lookup in a multi-tenant API. The interface is intentionally small: two methods, and you can validate against specs from anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this fits in Fissible's larger picture
&lt;/h2&gt;

&lt;p&gt;I run a company called &lt;a href="https://fissible.dev/" rel="noopener noreferrer"&gt;Fissible&lt;/a&gt; and build a product called Station, a self-hosted Laravel CMS and workflow platform. Station ships with a Platform Core that lets focused modules (CMS, Flow, Forms, an API module, more on the way) dock in and share auth, navigation, search, and admin UI.&lt;/p&gt;

&lt;p&gt;The API module is where accord becomes load-bearing. Station's API surface is contract-validated end to end: forge scaffolds the spec from the routes the modules expose, accord validates live traffic, drift fails CI when the spec and the implementation diverge. Treating the contract as code isn't an aspirational team policy in Station. It's mechanically enforced.&lt;/p&gt;

&lt;p&gt;If you want to see this pattern running end-to-end on a real product, &lt;a href="https://fissible.dev/station" rel="noopener noreferrer"&gt;Station&lt;/a&gt; is where to look. If you just want the validator and the CI gate for your own Laravel API, &lt;a href="https://github.com/fissible/accord" rel="noopener noreferrer"&gt;accord&lt;/a&gt; and &lt;a href="https://github.com/fissible/drift" rel="noopener noreferrer"&gt;drift&lt;/a&gt; are the two packages to install.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;p&gt;API contract adherence is a CI/CD problem more than a documentation problem. You write the contract once. You validate against it at runtime. You fail the build when it drifts. After that, the spec is honest because the build won't pass otherwise, and the cost of a contract violation collapses from "found in production" to "found in the PR that introduced it."&lt;/p&gt;

&lt;p&gt;The earlier a breach is caught, the cheaper it is to fix. Treating the spec as a build gate makes catching it the default.&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>api</category>
      <category>openai</category>
    </item>
    <item>
      <title>Why I built a SQLite workbench in bash</title>
      <dc:creator>Allen McCabe</dc:creator>
      <pubDate>Fri, 03 Apr 2026 20:03:59 +0000</pubDate>
      <link>https://dev.to/fissible/why-i-built-a-sqlite-workbench-in-bash-3m5o</link>
      <guid>https://dev.to/fissible/why-i-built-a-sqlite-workbench-in-bash-3m5o</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;You SSH into a server. The SQLite database is right there — you can see it in the filesystem.&lt;br&gt;
Every GUI tool you own stops working. TablePlus, DB Browser, Beekeeper — all of them need a local connection. sqlite3 is available, but it's raw SQL with no browsing. litecli is read-biased and still needs installing.&lt;br&gt;
You need to look at some rows, update a field, check an index. You end up writing SELECT statements into a CLI, copying output into a notes file, writing UPDATE statements by hand.&lt;br&gt;
There's a better way.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The build
&lt;/h2&gt;

&lt;p&gt;ShellQL is built on shellframe — a TUI framework I wrote in bash. shellframe handles screen management, keyboard routing, dirty-region rendering, and component lifecycle. Writing a new application on top of it is closer to writing a React app than writing a bash script.&lt;/p&gt;

&lt;p&gt;The surprising parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mouse support in bash is real, and it's not that hard once you understand xterm escape sequences&lt;/li&gt;
&lt;li&gt;SQLite's &lt;code&gt;.schema&lt;/code&gt; output is parseable enough to build a schema browser without any external tools&lt;/li&gt;
&lt;li&gt;Tab management (multiple tables open simultaneously) required rethinking shellframe's focus model&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The SSH use case
&lt;/h2&gt;

&lt;p&gt;This is the thing that makes ShellQL different from every other SQLite tool.&lt;/p&gt;

&lt;p&gt;If the machine has bash and sqlite3, ShellQL runs. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Production servers (read and write, with care)&lt;/li&gt;
&lt;li&gt;Docker containers&lt;/li&gt;
&lt;li&gt;CI environments for debugging test databases&lt;/li&gt;
&lt;li&gt;Remote dev boxes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No GUI install. No port forwarding. No pulling the file to your laptop and pushing it back.&lt;/p&gt;

&lt;p&gt;SSH in, run &lt;code&gt;shql /var/app/production.db&lt;/code&gt;, browse your data.&lt;/p&gt;




&lt;h2&gt;
  
  
  Full CRUD
&lt;/h2&gt;

&lt;p&gt;Most TUI database tools are read-only. ShellQL isn't.&lt;/p&gt;

&lt;p&gt;The record editor is a schema-aware form overlay. It shows column types and NOT NULL constraints. Tab through fields, edit values, press Enter to submit. Insert new rows the same way.&lt;/p&gt;

&lt;p&gt;Table creation uses a SQL query tab preloaded with a &lt;code&gt;CREATE TABLE&lt;/code&gt; template — you get full DDL control without a rigid GUI wizard.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mouse support
&lt;/h2&gt;

&lt;p&gt;This one surprised people in early demos. Most bash tools are keyboard-only by design. ShellQL supports both.&lt;/p&gt;

&lt;p&gt;Keyboard navigation is fast once you learn it — the keybindings are shown at the bottom of every screen. Mouse works for everything else: clicking into tables, scrolling rows, selecting records.&lt;/p&gt;

&lt;p&gt;This matters for adoption. Not everyone who SSHes into a server is a power user.&lt;/p&gt;




&lt;h2&gt;
  
  
  Install and try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;fissible/tap/shellql
shql my.db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Tool page: &lt;a href="https://fissible.dev/tools/shellql" rel="noopener noreferrer"&gt;https://fissible.dev/tools/shellql&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/fissible/shellql" rel="noopener noreferrer"&gt;https://github.com/fissible/shellql&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
      <category>database</category>
      <category>tooling</category>
      <category>bash</category>
    </item>
  </channel>
</rss>
