Skip to content

Commit 2d5ddbc

Browse files
clay-goodclaude
andcommitted
fix(extract): read "governed under", "controlled by", and doublet gov-law
Three governing-law phrasings that CHOICE-001 read as "no governing-law clause" because the GOV_LAW anchor never reached "the laws of X": - `governed under the laws of X` — GOVERNED_BY allowed only the `by` preposition; added `under` (same clause, different preposition). - `controlled by the laws of X` — added `controlled by` to the verb set. It still requires "the laws of" to follow, so corporate control ("controlled by Beta Holdings") is not mistaken for a governing-law clause. - `governed by, and enforced under, the laws of X` — the intervening verb+preposition doublet sat between the first verb and "the laws of"; the old pattern accepted only "and construed in accordance with". Generalized to `and (construed|enforced|interpreted|governed) (in accordance with|under|by)`. Zero golden churn (no corpus fixture uses these forms). Decoy guards: a disclaimed "not governed by", an ordinary "operates under the laws of", and corporate "controlled by X" stay unmatched. 6 regression tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0647790 commit 2d5ddbc

3 files changed

Lines changed: 30 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
**Vaulytica is the second pair of eyes you can cite.**
66

7-
`1,111 deterministic rules` · `20 cross-document checks` · `5 pre-disclosure checks` · `3 execution-readiness reconciliations` · `5 derived-deadline families` · `16 document sub-domains` · `88 state-law overlays (non-compete · security deposit · usury · will formalities)` · `10 export formats` · `0 servers` · `0 AI` · `5,843 passing tests` · `v9.41.0` · `MIT`
7+
`1,111 deterministic rules` · `20 cross-document checks` · `5 pre-disclosure checks` · `3 execution-readiness reconciliations` · `5 derived-deadline families` · `16 document sub-domains` · `88 state-law overlays (non-compete · security deposit · usury · will formalities)` · `10 export formats` · `0 servers` · `0 AI` · `5,849 passing tests` · `v9.41.0` · `MIT`
88

99
![Vaulytica landing page — "Drop legal docs. Get a report. Nothing leaves your browser."](docs/images/hero.png)
1010

@@ -1332,7 +1332,7 @@ npm run dev # open the printed URL
13321332
npm run build # static site → dist/
13331333
npm run typecheck # tsc --noEmit
13341334
npm run lint # eslint
1335-
npm run test # vitest — 5,843 tests, ~35s
1335+
npm run test # vitest — 5,849 tests, ~35s
13361336
npm run coverage # vitest + V8 coverage, enforces the regression floor
13371337
npm run accuracy # v5 Ground Truth harness → tools/accuracy/SCOREBOARD.md
13381338
npm run mutation # Stryker mutation score (scoped to extractors; slow, off the per-push path)

src/extract/govlaw-phrasing.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,30 @@ const REGISTERS: Array<[clause: string, want: RegExp]> = [
2020
// The elliptical "that of" statement form, where "that" == "the law".
2121
["The governing law shall be that of the State of Texas.", /Texas/],
2222
["The governing law is that of New York.", /New York/],
23+
// `under` as the preposition, `controlled by` as the verb, and an intervening
24+
// "and <verb> <prep>," doublet between the first verb and "the laws of".
25+
["This Agreement shall be governed under the laws of the State of Oregon.", /Oregon/],
26+
["This Agreement shall be controlled by the laws of the State of Arizona.", /Arizona/],
27+
[
28+
"This Agreement shall be governed by, and enforced under, the laws of the State of Nevada.",
29+
/Nevada/,
30+
],
31+
[
32+
"This Agreement shall be governed by and interpreted under the laws of Washington.",
33+
/Washington/,
34+
],
2335
];
2436

2537
// Decoys: an adjective before "laws" must not turn a non-choice-of-law phrase
2638
// into a jurisdiction, and a non-jurisdiction "laws of X" must stay unmatched.
2739
const NO_GOV_LAW: string[] = [
2840
"The parties shall comply with the applicable laws of any jurisdiction in which they operate.",
2941
"Nothing herein alters the immutable laws of physics governing the equipment.",
42+
// "controlled by X" is corporate control, not a governing-law verb, unless
43+
// "the laws of" follows immediately.
44+
"Acme is controlled by Beta Holdings under the laws of Delaware for tax purposes.",
45+
// A disclaimed governing law must stay unmatched.
46+
"This Agreement shall not be governed by the laws of the State of New York.",
3047
];
3148

3249
describe("governing-law phrasing guard", () => {

src/extract/jurisdictions.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,18 @@ const SOVEREIGN_PREFIX = String.raw`the\s+(?:State|Commonwealth|Republic|Kingdom
5959
// exclusively by", "governed solely by" — and the rigid "governed\s+by" token
6060
// dropped the whole clause, so CHOICE-001 reported "no governing-law clause" on
6161
// a document that plainly names one. The adverb is optional and does not change
62-
// the clause's meaning, so this only widens what matches.
63-
const GOVERNED_BY = String.raw`governed\s+(?:(?:exclusively|solely|only|entirely)\s+)?by`;
62+
// the clause's meaning, so this only widens what matches. `under` joins `by` as
63+
// the preposition — "governed under the laws of X" is the same clause as
64+
// "governed by the laws of X".
65+
const GOVERNED_BY = String.raw`governed\s+(?:(?:exclusively|solely|only|entirely)\s+)?(?:by|under)`;
66+
// The intervening doublet — "governed by, and construed in accordance with, the
67+
// laws of X" / "governed by, and enforced under, the laws of X". The second
68+
// verb+preposition sits between the first verb and "the laws of"; without this
69+
// optional clause the anchor never reached "the laws of" and the whole
70+
// governing-law clause was read as absent.
71+
const GOV_LAW_DOUBLET = String.raw`(?:and\s+(?:construed|enforced|interpreted|governed)\s+(?:in\s+accordance\s+with|under|by)\s*,?\s*)?`;
6472
const GOV_LAW = new RegExp(
65-
String.raw`\b((?:${GOVERNED_BY}|(?:interpreted|construed|resolved)\s+(?:under|in\s+accordance\s+with)|subject\s+to|determined\s+(?:under|by|in\s+accordance\s+with))\s*,?\s*(?:and\s+construed\s+(?:in\s+accordance\s+with\s*,?\s*)?)?the\s+(?:substantive\s+|internal\s+|domestic\s+|local\s+|applicable\s+)*laws?\s+of\s+(?:${SOVEREIGN_PREFIX})?([A-Z][A-Za-z\s&-]+?))(?=[.,;)]|\s+(?:without|excluding|and|regardless)|$)`,
73+
String.raw`\b((?:${GOVERNED_BY}|controlled\s+by|(?:interpreted|construed|resolved)\s+(?:under|in\s+accordance\s+with)|subject\s+to|determined\s+(?:under|by|in\s+accordance\s+with))\s*,?\s*${GOV_LAW_DOUBLET}the\s+(?:substantive\s+|internal\s+|domestic\s+|local\s+|applicable\s+)*laws?\s+of\s+(?:${SOVEREIGN_PREFIX})?([A-Z][A-Za-z\s&-]+?))(?=[.,;)]|\s+(?:without|excluding|and|regardless)|$)`,
6674
"gi",
6775
);
6876

0 commit comments

Comments
 (0)