[stack] Add structured court case briefs - #210
Draft
ThatXliner wants to merge 19 commits into
Draft
Conversation
The article pipeline emitted one ~900-word markdown blob per item. The prose was careful — nonpartisan framing, sponsor claims treated as intent, removed oversight named rather than called "streamlining" — but structurally it gave the reader one decision: read all of it, or none of it. Nothing was scannable, everything rendered at equal weight, and quotes were just italic text that nothing verified. A brief is the same analysis stored as typed pieces instead of prose: a hook, stat tiles, before/after changes, affected groups, unknowns, a glossary, and optional long-form sections. The reader can stop at any depth and still have learned something true. Editorial guarantees move into the types rather than being trusted to a prompt: - `kind` on a change is mechanical (creates/repeals/waives/funds), never evaluative — a brief can say what a provision does, not whether it's good. - `before`/`after` forces current law to be stated separately from the change. - `direction` on an affected group tops out at mixed/unclear, so the model can decline to score a group instead of manufacturing symmetry. - `unknowns` is non-empty: no brief can claim to have settled everything. - Legal status is derived from the scraped bill status, so "would" vs "does" comes from a string match rather than an inference. Generation is three steps, one of which costs a token. The LLM structures the brief (grounded in the official text plus the existing vetted article), then two deterministic passes run: every quote is checked verbatim against the whole source document and stripped if it doesn't match — the claim survives, the citation doesn't — and loaded political vocabulary in the model's own voice triggers one regeneration. Quotes are exempt from the lint: a sponsor may call their bill "common sense", and quoting that is reporting. Argument-level framing deliberately stays in the existing cited dual-lens. Briefs describe mechanism; the lens carries the debate. Bills only. The schema is written around legislative mechanics, and executive actions and court cases each need their own design pass — `content_brief` already carries a contentType, so adding one is a generator, not a migration. Content without a brief keeps rendering the markdown article. Two adjacent fixes found while verifying this: - `pnpm db:seed` had been failing outright: the fixture bill descriptions exceed the table's 100-char check constraint. Clamped with the same helper the scraper and API use. - `pnpm test` in the scraper globbed `src/**/*.test.ts` unquoted, so the shell expanded it one level deep and silently ran 2 of 5 test files. Quoted, so Node's runner does the globbing: 23 tests now discovered instead of 7. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
PR #198 intentionally scopes the article revamp to bills. This stacked follow-up applies the same rich, scannable reading model to court cases without forcing judicial records into bill-specific concepts such as provisions, funding, or legislative status.
Validation
git diff --check