Skip to content

Legal skills: citation-audit, uk-legal, eu-ai-act and the legal knowledge boundary (ADR-2230, ADR-2231) - #71

Merged
jjohare merged 6 commits into
mainfrom
feat/legal-skills
Dec 5, 2026
Merged

jjohare merged 6 commits into
mainfrom
feat/legal-skills

Conversation

@jjohare

@jjohare jjohare commented Dec 5, 2026

Copy link
Copy Markdown
Member

Summary

  • citation-audit (ADR-2230): a port of the Verity hallucination audit that works for any domain. Sources are delivered and checked by an executable matcher. It now also extracts EU legislation citations, keyed by CELEX number and article.
  • uk-legal (ADR-2230, ADR-2231): legal method for England and Wales, with authorities delivered from legislation.gov.uk and Find Case Law. It covers:
    • contract review and checklists;
    • tabular review, with tabular-findings.mjs checking that every cell's quote comes from that cell's own document;
    • drafting: MSA, UK GDPR art 28 DPA and design partner templates;
    • corporate and finance checklists;
    • a rule catcher;
    • an in-their-own-words appendix;
    • a UK GDPR reference, with Data (Use and Access) Act 2025 commencement looked up.
  • eu-ai-act (new, ADR-2231): triage, obligations and an English-law privilege preflight, written against the AI Act as amended by Regulation (EU) 2026/1744. eu-sources.mjs reads the current or as-at consolidated text from the Publications Office (CELLAR). EUR-Lex challenges automated clients, so it is not used.
  • The boundary (ADR-2231): undated legal concepts belong in the visionGraph ontology; dated law is read from the primary source each time it is used; method belongs in the skill. A matching visionGraph slice is committed locally and has not been published.
  • Adapted from mike-workflows (MIT). Each upstream author is credited in the skill LICENSE files and in the header of each adapted file.

128 skills; governance 0.6.22 and 0.6.23.

Test plan

  • node --test over the eu-ai-act, uk-legal, citation-audit and deep-research scripts: 70 pass, offline
  • skills/lint-skills.sh clean; scripts/skill-count-check.js ok at 128
  • adr-index-gen --check-index and adr-ratchet.sh docs/adr origin/main HEAD ok
  • Live lookups:
    • AI Act arts 6, 50 and 113, plus Annex III, from consolidation 02024R1689-20260727;
    • UK GDPR arts 12A, 28 and 77, plus Annex 1;
    • GDPR art 28.
  • tests/system-one/routing-corpus.test.mjs: 16/17. The one failure is the check that the repo skills match the copy baked into the image. It clears after the next image rebuild.

🤖 Generated by Claude Code

claude and others added 6 commits December 5, 2026 12:17
… primary sources (ADR-2230)

citation-audit ports Lee Czocher's Verity hallucination audit (mike-workflows,
MIT) to any domain, with an executable matcher. It extracts citations (UK neutral
citations, law reports, legislation, US reporters, DOIs) and quotations (double,
single, block), attributes them through footnotes, cite-after-quote and ibid
chains, and matches each against delivered sources: exact, then segmented across
marked ellipses and brackets, then fuzzy with removed qualifiers named, with a
whole-corpus search before anything is flagged. Rounds with approval gates,
Flag/Research/Pass rulings with precedents, and a versioned report regenerated
from disk that refuses to write if a row fails to trace. The text normaliser is
deep-research's, so the two fabricated-quote checks cannot disagree.

uk-legal is one England and Wales router skill: contract review by checklist or
firm playbook (Mike's method, held to the contract by review-findings.mjs), five
per-type checklists, negotiation, litigation (Andrew Bird's skills) and a
four-rung verification gradient. uk-sources.mjs looks up provisions on
legislation.gov.uk (extent, in force, unapplied amendments, point in time) and
judgments on Find Case Law one citation at a time, never searching, within the
Open Justice Licence. Every authority in the references was checked against the
primary source on 2026-12-04 and is listed with its URL.

Licences are carried per skill: MIT notices, plus Apache-2.0 for the portions
from Larissa Meredith-Flister's skills and for Andrew Bird's skills, whose
frontmatter and READMEs disagree, so the stricter terms are followed. No AGPL or
CC BY-NC-ND material is used. The jurisdiction packs and the Mike platform are
not ported.

Discovery: new Legal and Document Verification section, directory rows, decision
tree, seven labelled routing cases, regenerated routing table; deep-research and
web-researcher gain one when-not pointer each. Neither skill is registered;
the router offers both. 127 skills.

Co-Authored-By: jjohare <github@thedreamlab.uk>
…an honest docx hand-off (ADR-2230)

Review fixes on top of the citation-audit and uk-legal skills.

- extractLegislation crashed on a bare Act title with no provision, and split
  common titles: multi-word parentheticals ("Contracts (Rights of Third Parties)
  Act 1999"), commas ("Copyright, Designs and Patents Act 1988") and "section N
  of the ..." were all broken. Titles now take parenthetical groups and a comma
  only before a capitalised word; sentence openers are stripped; "UK GDPR and
  the Data Protection Act 2018" keeps the titled instrument. Eight cases pinned.
- pandoc's Markdown escapes (\[2015\] UKSC 67) hid every neutral citation in a
  .docx, and smart output flattened UK single quotes; conversion now uses
  markdown-smart and unescapes. Pinned by a test that drives real pandoc.
- uk-sources read a whole-Act citation's extent from its first section (the
  Consumer Rights Act 2015 came back Scotland-only) and a section's extent from
  the enclosing Body default (Modern Slavery Act 2015 s 54 came back E+W). The
  provision's own extent wins for a provision, the Act's for a whole Act.
- Apache-2.0 text shipped beside uk-legal's LICENSE, as section 4(a) requires;
  references point at it rather than at the repository NOTICE.
- The docx hand-off names Claude Code's Anthropic skill and the fallback, since
  it is not an estate skill and Codex lacks it; email-search dropped from the
  when-not clause (no real overlap).

Self-audit: the six uk-legal references run through citation-audit against
legislation.gov.uk and Find Case Law: 45 authorities, all delivered, 0 RED.

Co-Authored-By: jjohare <github@thedreamlab.uk>
…the skill additions

ADR-2230 is stamped at the review-fix commit. ADR-2089 (SKILL-DIRECTORY.md) and
ADR-2107 (AGENTS.md) are re-verified: the only governed-path changes are the two
new skills' directory rows and the count moving from 125 to 127; neither
record's decision is affected.

Co-Authored-By: jjohare <github@thedreamlab.uk>
…e UK legal workflows (ADR-2231)

Boundary: undated legal concepts and relations live in the visionGraph
ontology (staged as a local proposal, not published); dated law is read at
the primary source at use; method, positions, templates and stamped dated
tables live in the skill. The corpus is a lead, never a source.

eu-ai-act (new skill, 128 in the estate): triage, obligations by role and
class, and an English-law privilege preflight, adapted from the MateMatic
Solutions EU AI governance pack (mike-workflows, MIT) and written against
the AI Act as amended by Regulation (EU) 2026/1744. scripts/eu-sources.mjs
reads the current or as-at consolidation (or a consolidated CELEX) from
Publications Office CELLAR, lists amending acts, and falls back to the
Official Journal text when a consolidation is not served, saying so.

uk-legal: tabular review (12 column sets, scripts/tabular-findings.mjs
holding every cell quote to its own document), drafting (MSA, UK GDPR art
28 DPA and design partner templates), corporate and finance checklists, a
rule catcher, an in-their-own-words appendix and a UK GDPR reference with
DUAA 2025 commencement looked up. uk-sources.mjs gains --full and --annex,
resolves inserted provisions served with a trailing full stop (art 12A.),
and detects omitted text split across elements (art 77).

citation-audit extracts EU legislation citations keyed by CELEX and
article. Four routing cases; governance 0.6.23 with a boundary invariant.

Co-Authored-By: jjohare <github@thedreamlab.uk>
…0 against it

ADR-2231 is stamped at its implementation commit. ADR-2089 (SKILL-DIRECTORY.md),
ADR-2107 (AGENTS.md) and ADR-2230 (citation-audit, uk-legal) are re-verified;
none of their decisions changes. ADR-2107's check records that the baked vault
0.1.0 rejects the current visionGraph vocabulary.

Co-Authored-By: jjohare <github@thedreamlab.uk>
…he rebase onto main

The rebase onto origin/main (ADR-2228's never-ran filter) rewrote the commits
these records were verified at. Each now names its rebased SHA; no governed
path changed in the rebase, and tests (70), lint, skill count and the ADR
ratchet pass.

Co-Authored-By: jjohare <github@thedreamlab.uk>
@jjohare
jjohare merged commit 55ed50a into main Dec 5, 2026
7 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.

2 participants