From 4ef21c5c0d78c243392a0a62116ba196f457495a Mon Sep 17 00:00:00 2001
From: Robert Douglas <57234112+realrobertdouglas@users.noreply.github.com>
Date: Wed, 2 Dec 2026 13:10:41 -0600
Subject: [PATCH 01/21] =?UTF-8?q?v2.9190=20=E2=80=94=20Lien=20desk:=20the?=
=?UTF-8?q?=20county's=20stamp=20goes=20on=20the=20lien=20you=20pressed=20?=
=?UTF-8?q?(findings=20808=20and=20813,=20punch=20list=20#479=20step=201)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Every door to the Release of record tab carried the job, not the lien. The
Payoffs row and the day's run now hand the lien's id, the tab opens on it,
and the tab holds the lien it stands on after Recorded on is kept.
Co-Authored-By: Claude Fable 5.2
---
docs/LIEN_DESK_ARCHITECTURE.md | 4 ++
docs/recent-features/v2.9190.md | 31 +++++++++++++++
.../LienFilingTabs.release.render.test.tsx | 39 +++++++++++++++++++
src/components/jobs/LienFilingTabs.tsx | 14 ++++++-
src/components/jobs/LienInstrumentsModal.tsx | 4 ++
.../jobs/LienPayoffs.render.test.tsx | 3 +-
src/components/jobs/LienPayoffs.tsx | 14 ++++---
.../jobs/LienRunReleases.render.test.tsx | 2 +-
src/components/jobs/LienRunReleases.tsx | 4 +-
.../release-a-filed-lien-after-it-is-paid.md | 2 +-
src/content/releaseNotes/v2.9190.ts | 15 +++++++
src/lib/jobs/lienReleaseOfRecord.test.ts | 15 +++++++
src/lib/jobs/lienReleaseOfRecord.ts | 14 +++++--
src/pages/LienDeskPage.tsx | 7 ++--
14 files changed, 150 insertions(+), 18 deletions(-)
create mode 100644 docs/recent-features/v2.9190.md
create mode 100644 src/content/releaseNotes/v2.9190.ts
diff --git a/docs/LIEN_DESK_ARCHITECTURE.md b/docs/LIEN_DESK_ARCHITECTURE.md
index 88ec9dfc1d..ec997827d7 100644
--- a/docs/LIEN_DESK_ARCHITECTURE.md
+++ b/docs/LIEN_DESK_ARCHITECTURE.md
@@ -727,6 +727,10 @@ last_updated: 2026-12-01
> The stamp is two `ChangeableValue`s, and each Keep is one update of the release row through `keepReleaseStamp`.
> A saved release prints from its own saved fields, and a lien with a release draws no save press.
> The tab's six render tests are `LienFilingTabs.release.render.test.tsx`.
+> **v2.9190 (a door names its lien, findings 808 and 813):** `pickReleaseTarget` takes a third value, the lien the door named, read after the lien the tab holds and before the rule.
+> The doors are a lien's row in Payoffs and a release's line on the day's run: each `onOpenRelease` hands the job and its `affidavitId`, `LienDeskPage` keeps it as `releaseLienId` on the window it opens, and `LienInstrumentsModal` hands it to `LienFilingTabs`.
+> The tab holds the lien it stands on: an effect writes the picked lien's id into `releaseTargetId`, so a release the county has just recorded no longer hands the tab to the job's other lien.
+> A door that names no lien (the Accounts Receivable chip, a deep link, the head's step) leaves the rule to pick, as before.
> **v2.8510 (one check over many bills, piece 3):** `PayoffsWindow` holds `checkKey`, and a place whose liened jobs still have an open bill hands `PlaceCard` an `onCheck`, the press *One check for this place ›*.
> [`LienPayoffCheck`](../src/components/jobs/LienPayoffCheck.tsx) then stands in for the list, with three inputs for the check, a `ChangeableValue` for what each bill gets, three totals, the sentence and the batch press.
> Its rule is [`lienPayoffCheck.ts`](../src/lib/jobs/lienPayoffCheck.ts), whose `checkBills`, `spreadCheck` and `checkPlan` are held by 14 tests.
diff --git a/docs/recent-features/v2.9190.md b/docs/recent-features/v2.9190.md
new file mode 100644
index 0000000000..58673ec0b5
--- /dev/null
+++ b/docs/recent-features/v2.9190.md
@@ -0,0 +1,31 @@
+# v2.9190 — Lien desk: the county’s stamp goes on the lien you pressed (2026-12-02)
+
+Findings 808 and 813 of run 17, step 1 of punch list #479 (the release road's faults). Client only. No migration, no function change, nothing owed on prod. Both faults were read in the code and never seen in a browser: no job on prod has two filed liens with a release each today.
+
+## What was wrong
+
+- **808.** Every door to the Lien window's **Release of record** tab carried the job and not the lien. On a job with two filed liens that each have a saved release, **Record the county’s stamp ›** on the second lien's Payoffs row opened the tab on the first lien. The day and the number were then kept on the wrong release.
+- **813.** The tab chose its lien again on every draw: the lien picked under **Which lien**, else the first whose release the county has not recorded, else the first. With nothing picked by hand, keeping **Recorded on** made that release a recorded one, and the rule handed the tab to the job's other lien before **Instrument number** was typed.
+
+## What changed
+
+- [`lienReleaseOfRecord.ts`](../../src/lib/jobs/lienReleaseOfRecord.ts): `pickReleaseTarget` takes a third value, the lien the door named. The order is the lien the tab holds, then the door's lien, then the rule as before.
+- [`LienPayoffs.tsx`](../../src/components/jobs/LienPayoffs.tsx) and [`LienRunReleases.tsx`](../../src/components/jobs/LienRunReleases.tsx): `onOpenRelease` hands the job and the row's `affidavitId`. Both rows already held it.
+- [`LienDeskPage.tsx`](../../src/pages/LienDeskPage.tsx) keeps it as `releaseLienId` on the window it opens, [`LienInstrumentsModal.tsx`](../../src/components/jobs/LienInstrumentsModal.tsx) hands it on, and [`LienFilingTabs.tsx`](../../src/components/jobs/LienFilingTabs.tsx) reads it in the pick.
+- `LienFilingTabs.tsx` holds the lien it stands on: an effect writes the picked lien's id into `releaseTargetId`. A lien picked under **Which lien** still wins, and a lien that is voided or belongs to another job falls back to the door and then the rule.
+- The guide [release a filed lien after it is paid](../../src/content/help/release-a-filed-lien-after-it-is-paid.md) says the press opens the tab on that lien.
+
+## Not in this change
+
+- A door that names no lien is left to the rule: the Accounts Receivable chip, a deep link, the Legal desk's **Record the release…** and the head's **Go to the release of record ›**.
+- The window's head still reads one release for the whole job. That is finding 809, step 2 of the card.
+
+## Tests
+
+- `lienReleaseOfRecord.test.ts`: the door's lien, the held lien over the door, a door that names no lien of the job, and the held lien after its release is recorded.
+- `LienFilingTabs.release.render.test.tsx`: the stamp's number is written to the release of the lien the door named. The door's lien is taken once the job's filings are read. The tab stays on its lien when the county's day arrives.
+- `LienPayoffs.render.test.tsx` and `LienRunReleases.render.test.tsx`: each press hands the job and the lien.
+
+## Looks owed
+
+- None on a real lien: no job on prod has two filed liens. On the ZZ Test job, with the live-write slot: two filed liens with a saved release each, **Record the county’s stamp ›** on the second row, and the tab reads *Releasing: instrument #* with the second lien's number. Every row is voided after, each release before its affidavit.
diff --git a/src/components/jobs/LienFilingTabs.release.render.test.tsx b/src/components/jobs/LienFilingTabs.release.render.test.tsx
index 01ea39d39a..e1251b7fd7 100644
--- a/src/components/jobs/LienFilingTabs.release.render.test.tsx
+++ b/src/components/jobs/LienFilingTabs.release.render.test.tsx
@@ -338,6 +338,45 @@ describe('Release of record: a job with two filed liens', () => {
})
})
+describe('Release of record: the tab opens on the lien its door named, and stays on it (findings 808 and 813)', () => {
+ const second = lien({ id: 'a2', recording_number: '2026-0500001', filed_at: '2026-11-16' })
+ const releasing = () => [...document.querySelectorAll('div')].find((d) => d.children.length === 1 && d.firstElementChild?.textContent === 'Releasing:')?.textContent ?? ''
+ const ui = (over: Partial) => (
+ {}} {...over} />
+ )
+
+ it('keeps the county’s stamp on the release of the lien whose row was pressed', async () => {
+ // Both liens have a saved release. Left to pick, the tab takes the first: the second lien's stamp went onto the first's release.
+ draw({ job: paid(), releaseLienId: 'a2', filings: [lien() as never, second as never, release() as never, release({ id: 'r2', fields: { releasesFilingId: 'a2' } }) as never] })
+ expect(releasing()).toContain('instrument #2026-0500001')
+ fireEvent.click(screen.getByRole('button', { name: /the release’s instrument number/ }))
+ fireEvent.change(screen.getByLabelText(/the release’s instrument number/), { target: { value: '2026-0431955' } })
+ fireEvent.click(screen.getByRole('button', { name: 'Keep' }))
+ await waitFor(() => expect(writes.updates).toHaveLength(1))
+ expect(writes.updates[0]).toMatchObject({ id: 'r2' })
+ })
+
+ it('takes the door’s lien once the filings are read, and a lien picked on the tab after it', () => {
+ const rows = [lien() as never, second as never, release() as never, release({ id: 'r2', fields: { releasesFilingId: 'a2' } }) as never]
+ const view = renderWithProviders(ui({ releaseLienId: 'a2', filings: [lien({ id: 'old', job_id: 'job-9', recording_number: '2026-0300000' }) as never] }))
+ view.rerender(ui({ releaseLienId: 'a2', filings: rows }))
+ expect(releasing()).toContain('instrument #2026-0500001')
+ fireEvent.click(document.querySelectorAll('[data-lien-release-which] input[type="radio"]')[0]!)
+ expect(releasing()).toContain('instrument #2026-0412207')
+ })
+
+ it('stays on its lien when the county’s day is kept, with the instrument number still to type', () => {
+ // The first lien is released. The tab opens on the second, whose release is saved and not recorded.
+ const first = release({ filed_at: '2026-11-23' })
+ const view = renderWithProviders(ui({ filings: [lien() as never, second as never, first as never, release({ id: 'r2', fields: { releasesFilingId: 'a2' } }) as never] }))
+ expect(releasing()).toContain('instrument #2026-0500001')
+ // Recorded on is kept on the second: every release is now recorded, and the rule alone went back to the first lien.
+ view.rerender(ui({ filings: [lien() as never, second as never, first as never, release({ id: 'r2', filed_at: '2026-11-24', fields: { releasesFilingId: 'a2' } }) as never] }))
+ expect(releasing()).toContain('instrument #2026-0500001')
+ expect(document.querySelector('[data-lien-release-saved]')!.textContent).toBe('Released. The county recorded it Nov 24.')
+ })
+})
+
describe('Release of record: the head’s release step lands on the tab’s own work (finding 804)', () => {
const lit = () => [...document.querySelectorAll('[data-landed]')].map((el) => Object.keys(el.dataset).filter((k) => k.startsWith('lienRelease')))
diff --git a/src/components/jobs/LienFilingTabs.tsx b/src/components/jobs/LienFilingTabs.tsx
index e39dfba650..cfabea12e9 100644
--- a/src/components/jobs/LienFilingTabs.tsx
+++ b/src/components/jobs/LienFilingTabs.tsx
@@ -152,6 +152,7 @@ export default function LienFilingTabs({
onOpenDeskNotice,
land = null,
landRelease = null,
+ releaseLienId = null,
headSlotRef,
onServePrinted,
onClose,
@@ -182,6 +183,8 @@ export default function LienFilingTabs({
land?: (LienMailProofLanding & { at: number }) | null
/** The head's release step was pressed (finding 804): land on the Release of record tab's own work, once for each press. `at` tells one press from the next. */
landRelease?: { at: number } | null
+ /** The filed lien the opener's press was made on (finding 808): the Release of record tab opens on that lien, not on the job's first. Absent, the tab picks. */
+ releaseLienId?: string | null
/** The Lien window's slot at the top of each paper's pane (Way 2 of finding 803): on a computer the window draws its steps' band and the papers' bar there, inside the paper's own scroll. */
headSlotRef?: (el: HTMLElement | null) => void
/** The filed lien's copies went to the printer from this window's press. */
@@ -265,7 +268,16 @@ export default function LienFilingTabs({
),
[live],
)
- const releaseTarget = pickReleaseTarget(releaseTargetList, releaseTargetId)
+ const releaseTarget = pickReleaseTarget(releaseTargetList, releaseTargetId, releaseLienId)
+ // The tab holds the lien it stands on (finding 813): a release the county has just recorded must not hand the tab to the job's other lien.
+ const releaseOnId = releaseTarget?.affidavit.id ?? null
+ // A door pressed on another lien while the tab is drawn moves it to that lien.
+ useEffect(() => {
+ if (releaseLienId) setReleaseTargetId(releaseLienId)
+ }, [releaseLienId])
+ useEffect(() => {
+ if (releaseOnId && releaseOnId !== releaseTargetId) setReleaseTargetId(releaseOnId)
+ }, [releaseOnId, releaseTargetId])
/** Open the service step on what the filing already holds, so a day recorded alone can take its receipts later. */
const openServiceStep = () => {
if (!filedAffidavit) return
diff --git a/src/components/jobs/LienInstrumentsModal.tsx b/src/components/jobs/LienInstrumentsModal.tsx
index 7b9d5cfb5e..a1bc2f988a 100644
--- a/src/components/jobs/LienInstrumentsModal.tsx
+++ b/src/components/jobs/LienInstrumentsModal.tsx
@@ -160,6 +160,7 @@ export default function LienInstrumentsModal({
onRecorded,
initialTab,
land: landOnOpen = null,
+ releaseLienId = null,
noticeMonths,
onOpenLienDesk,
onOpenRelease,
@@ -183,6 +184,8 @@ export default function LienInstrumentsModal({
initialTab?: 'demand' | 'notice' | 'affidavit' | 'release_record'
/** Open landed on one copy of one filing (`lienMailProofDoor.ts`): the press on a stop window's card on the Lien desk. The opener sets `initialTab` to the paper's tab. */
land?: LienMailProofLanding | null
+ /** The filed lien a release's door was pressed on (finding 808): the Release of record tab opens on that lien. Absent, the tab picks. */
+ releaseLienId?: string | null
/** The Lien desk's months for the § 53.056 notice (v2.3405) — recorded as months_covered instead of the last work month alone. */
noticeMonths?: string[] | null
/** The next step's door to the Lien desk on this job (punch list #82): notices and retainage are drafted, approved and sent there. Absent, the card has no desk button. */
@@ -2082,6 +2085,7 @@ export default function LienInstrumentsModal({
noticeMonths={noticeMonths ?? null}
land={land}
landRelease={landRelease}
+ releaseLienId={releaseLienId}
headSlotRef={setHeadSlot}
// The copies went to the printer here: this window's card reads the next stage at once, and the opener reads again once the print is filed.
onServePrinted={(id) => {
diff --git a/src/components/jobs/LienPayoffs.render.test.tsx b/src/components/jobs/LienPayoffs.render.test.tsx
index c90096d0c1..fd4ab06cb3 100644
--- a/src/components/jobs/LienPayoffs.render.test.tsx
+++ b/src/components/jobs/LienPayoffs.render.test.tsx
@@ -98,7 +98,8 @@ describe('LienPayoffs', () => {
expect(paid.querySelector('[data-lien-payoff-warn]')).toBeNull()
expect([...paid.querySelectorAll('[data-lien-payoff-steps] [data-step]')].map((s) => s.dataset.state)).toEqual(['done', 'now', 'later'])
fireEvent.click(paid.querySelector('[data-lien-payoff-press="release"]')!)
- expect(onOpenRelease).toHaveBeenCalledWith('j1')
+ // The door names the row's own lien (finding 808), so the tab opens on it and not on the job's first.
+ expect(onOpenRelease).toHaveBeenCalledWith('j1', 'a1')
const owes = rowOf('a2')
expect(owes.querySelector('[data-lien-payoff-say]')!.textContent).toBe('$5,160.50 is still open on this job’s bills.')
diff --git a/src/components/jobs/LienPayoffs.tsx b/src/components/jobs/LienPayoffs.tsx
index 42ebbfe037..7697b7aa80 100644
--- a/src/components/jobs/LienPayoffs.tsx
+++ b/src/components/jobs/LienPayoffs.tsx
@@ -61,7 +61,8 @@ type Props = {
/** The job's Bill tab, where a payment is recorded. */
onOpenBill: (jobId: string) => void
/** The job's Lien window on its Release of record tab. */
- onOpenRelease: (jobId: string) => void
+ /** The Lien window's Release of record tab for this job, on the lien whose row was pressed (finding 808). */
+ onOpenRelease: (jobId: string, affidavitId?: string) => void
isMobile?: boolean
/** Told once the check pane recorded a payment, so the desk reads again. */
onChanged?: () => void
@@ -267,7 +268,7 @@ function StepRounds({ row }: { row: LienPayoffRow }) {
)
}
-function LienRow({ row, isMobile, onDoor }: { row: LienPayoffRow; isMobile: boolean; onDoor: (door: LienPayoffDoor, jobId: string) => void }) {
+function LienRow({ row, isMobile, onDoor }: { row: LienPayoffRow; isMobile: boolean; onDoor: (door: LienPayoffDoor, jobId: string, affidavitId?: string) => void }) {
const done = row.step.step === 'done'
return (
: savedCopyRow}
+ {/* The facts the paper would print as blank lines, named before the save (finding 825, v2.9234). It names and does not hold. */}
+ {releaseBlanksWords ? (
+
+ {releaseBlanksWords}
+
+ ) : null}
Print for notarization
diff --git a/src/content/help/release-a-filed-lien-after-it-is-paid.md b/src/content/help/release-a-filed-lien-after-it-is-paid.md
index aef1b337f5..3e0ac67db5 100644
--- a/src/content/help/release-a-filed-lien-after-it-is-paid.md
+++ b/src/content/help/release-a-filed-lien-after-it-is-paid.md
@@ -93,6 +93,8 @@ A line at the top says what the money says. Green means the bills read paid. Amb
The payment date is already the day of the last payment. It prints on the paper, so check it. The buttons wait while the date is empty or a day still to come. A date before the day the lien was filed asks you once. Press **Keep this date** if it is right. A saved release keeps its date. You can correct it under **The paper** until the county records the release. Press **Print for notarization**. Then press **Save release record**. A lien takes one release, so the save press goes away once it is saved.
+The paper names the county, the owner, the legal description and the property address. A line above the buttons says when the paper has a blank line for one of them. It reads like *The paper has a blank line for the owner of record.* Property facts are fixed in the customer's address book. Fix them before you print. The buttons do not wait on it.
+
The leader signs the paper before a notary.
You can print the release with the day's other releases. Read [Print the releases in the run](#print-the-releases-in-the-run) below.
diff --git a/src/content/releaseNotes/v2.9234.ts b/src/content/releaseNotes/v2.9234.ts
new file mode 100644
index 0000000000..e89c5770ef
--- /dev/null
+++ b/src/content/releaseNotes/v2.9234.ts
@@ -0,0 +1,15 @@
+import type { ReleaseNote } from '../../lib/releaseNotes'
+
+const note: ReleaseNote = {
+ version: 'v2.9234',
+ date: '2026-12-02',
+ title: 'Release of record: a blank line on the paper is named before the save',
+ kind: 'fix',
+ highlights: [
+ 'On a job with no property facts, the release printed a blank line for the owner and the legal description. The tab said nothing.',
+ 'A line above the buttons now names each fact the paper would print blank, and where it is fixed.',
+ 'The buttons do not wait on it. A release that is owed can still be made.',
+ ],
+}
+
+export default note
diff --git a/src/lib/jobs/lienReleaseOfRecord.test.ts b/src/lib/jobs/lienReleaseOfRecord.test.ts
index 0ec74fdfe6..072fcb87b3 100644
--- a/src/lib/jobs/lienReleaseOfRecord.test.ts
+++ b/src/lib/jobs/lienReleaseOfRecord.test.ts
@@ -3,7 +3,7 @@ import { plainWordsFailures } from '../plainWords'
import { plainSentence, val } from '../valuesInPlace'
import type { LienPayoffAffidavit, LienPayoffPayment, LienPayoffRelease } from './lienPayoff'
import type { BankCheck } from './checkCleared'
-import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDay, releaseSavedPaymentDay, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayCheck, releasePaymentDayKey, releaseRecordedSentence, releaseSaveFields, releaseSavedHold, releaseStampDayCheck, releaseStampPatch, releaseTargets, releaseWaitsOnCheck } from './lienReleaseOfRecord'
+import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDay, releaseSavedPaymentDay, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayCheck, releasePaymentDayKey, releaseRecordedSentence, releaseSaveFields, releaseSavedHold, releaseStampDayCheck, releaseStampPatch, releaseTargets, releaseWaitsOnCheck } from './lienReleaseOfRecord'
// Every job, instrument and amount here is made up.
const TODAY = '2026-11-24'
@@ -383,3 +383,31 @@ describe('releasePaymentDayCheck (v2.9179)', () => {
expect(releasePaymentDayCheck('2026-11-25', '2026-11-24')).toBe(RELEASE_OF_RECORD_WORDS.payDayFuture)
})
})
+
+describe('the facts a release would print as blank lines are named before the save (finding 825, v2.9234)', () => {
+ const full = { county: 'Travis', ownerName: 'Marisol Okafor', legalDescription: 'LOT 1 BLK 2 LARKSPUR SUBD', propertyAddress: '212 Larkspur Court, Austin, TX' }
+
+ it('names nothing when the paper has every fact', () => {
+ expect(releasePaperBlanks(full)).toEqual([])
+ expect(releasePaperBlanksWords([])).toBeNull()
+ })
+
+ it('names each blank in the paper’s order, and spaces alone are a blank', () => {
+ expect(releasePaperBlanks({ ...full, ownerName: ' ', legalDescription: '' })).toEqual(['owner', 'legal'])
+ expect(releasePaperBlanks({ county: '', ownerName: '', legalDescription: '', propertyAddress: '' })).toEqual(['county', 'owner', 'legal', 'address'])
+ })
+
+ it('says which lines are blank and where a property fact is fixed', () => {
+ expect(releasePaperBlanksWords(['owner', 'legal'])).toBe('The paper has a blank line for the owner of record and the legal description. Property facts are fixed in the customer’s address book. Fix them before you print, or the release prints with the lines blank.')
+ expect(releasePaperBlanksWords(['legal'])).toBe('The paper has a blank line for the legal description. Property facts are fixed in the customer’s address book. Fix it before you print, or the release prints with the line blank.')
+ })
+
+ it('sends a blank address to the job, and a list of three reads with its commas', () => {
+ expect(releasePaperBlanksWords(['address'])).toBe('The paper has a blank line for the property address. The property address is the job’s own address. Fix it before you print, or the release prints with the line blank.')
+ expect(releasePaperBlanksWords(['county', 'owner', 'legal'])).toContain('for the county, the owner of record and the legal description.')
+ })
+
+ it('reads as plain words', () => {
+ for (const blanks of [['owner', 'legal'], ['address'], ['county', 'owner', 'legal', 'address']] as const) expect(plainWordsFailures(releasePaperBlanksWords(blanks) ?? '')).toEqual([])
+ })
+})
diff --git a/src/lib/jobs/lienReleaseOfRecord.ts b/src/lib/jobs/lienReleaseOfRecord.ts
index ba2b434f49..83cbfe69f7 100644
--- a/src/lib/jobs/lienReleaseOfRecord.ts
+++ b/src/lib/jobs/lienReleaseOfRecord.ts
@@ -314,6 +314,40 @@ export function releasePaymentDatePatch(fields: unknown, day: string): Record = { county: 'the county', owner: 'the owner of record', legal: 'the legal description', address: 'the property address' }
+
+/**
+ * The property facts a release would print as a blank line. A saved release prints as it was saved, so the tab asks
+ * this of a release still to save, while the facts can still be fixed on their own records.
+ */
+export function releasePaperBlanks(paper: { county: string; ownerName: string; legalDescription: string; propertyAddress: string }): ReleasePaperBlank[] {
+ const blank = (v: string) => !(v ?? '').trim()
+ return [
+ ...(blank(paper.county) ? (['county'] as const) : []),
+ ...(blank(paper.ownerName) ? (['owner'] as const) : []),
+ ...(blank(paper.legalDescription) ? (['legal'] as const) : []),
+ ...(blank(paper.propertyAddress) ? (['address'] as const) : []),
+ ]
+}
+
+const wordList = (words: ReadonlyArray): string => (words.length <= 2 ? words.join(' and ') : `${words.slice(0, -1).join(', ')} and ${words[words.length - 1]}`)
+
+/**
+ * The blanks named above the presses, and where each is fixed. Null with none. It names and does not hold: the lien's
+ * instrument number is what the county releases against, and a release that is owed must not wait on an address book.
+ */
+export function releasePaperBlanksWords(blanks: ReadonlyArray): string | null {
+ if (blanks.length === 0) return null
+ const one = blanks.length === 1
+ const named = `The paper has a blank line for ${wordList(blanks.map((b) => PAPER_BLANK_NAMES[b]))}.`
+ const property = blanks.some((b) => b !== 'address') ? ' Property facts are fixed in the customer’s address book.' : ''
+ const address = blanks.includes('address') ? ' The property address is the job’s own address.' : ''
+ return `${named}${property}${address} Fix ${one ? 'it' : 'them'} before you print, or the release prints with ${one ? 'the line' : 'the lines'} blank.`
+}
+
/** Why a recorded day cannot be kept, or null. */
export function releaseStampDayCheck(day: string, lienFiledYmd: string, todayYmd: string): string | null {
if (!day) return null
diff --git a/to-dos/lien-release-road-faults/README.md b/to-dos/lien-release-road-faults/README.md
index f4f8597586..2258cc2c6f 100644
--- a/to-dos/lien-release-road-faults/README.md
+++ b/to-dos/lien-release-road-faults/README.md
@@ -2,7 +2,7 @@
name: "The release road: every fault found on the way to releasing a paid lien, and the ones left to mend"
number: 479
group: ready
-status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · the first half of step 4 is built (v2.9219) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 10 is built in the tab (v2.9229) · step 12 is built (v2.9232) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 8, 9, 11, 13 and 14 are left, with the second halves of steps 4 and 10
+status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · the first half of step 4 is built (v2.9219) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 10 is built in the tab (v2.9229) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 8, 9, 11 and 14 are left, with the second halves of steps 4 and 10
summary: >
The owner asked for help releasing a paid lien and printing its release, and for every bug on
the way. One thread read the road in the code and found fourteen faults, findings 808 to 821.
@@ -77,7 +77,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 803 | In the Lien window, scrolling the paper folds the steps and the paper leaps. | seen | Mended, v2.9177 (PR #10637), on `main`. Its look on the live site is owed. |
| 804 | **Go to the release of record ›** only picks the tab, and a second press changes nothing. **Save release record** sat cut off at the window's bottom edge. | seen | Mended, v2.9175 (PR #10636), on `main`. Its look on the live site is owed. |
| 824 | The bin *Paid awaiting release* counts liens. Its press leaves no To do row for a paid lien that owes its release. | seen | Mended, v2.9163 (PR #10623), on `main`. It is step 6 of card #472. |
-| 825 | On a job with no property facts, the paper's owner and property description are blank lines. The tab says nothing before **Save release record** takes it. | seen | Not started. Step 13. |
+| 825 | On a job with no property facts, the paper's owner and property description are blank lines. The tab says nothing before **Save release record** takes it. | seen | Built, v2.9234. A line above the presses names each blank and where it is fixed. Step 13. |
| 826 | A lien was filed and then released. It never had a To do row, while the Board and Payoffs showed it. | seen | v2.9163 (PR #10623) added the rows, on `main`. This case is still to check on the live site. |
| 827 | A link that opens the Lien window on a job took about nine seconds to draw the window. | seen | Not started. Step 14. |
@@ -140,7 +140,8 @@ Lien desk lane's note of run 17 and are not on this card.
11. **Go to the affidavit › lands on the work (XS). 820.** The pattern of #10636.
12. **Built, v2.9232. The release's line takes a scan (S). 821.** The saved copy's editor on a release's line has
**Upload the scanned PDF**. The scan is named as a release in the job's folder.
-13. **Missing property facts are named before the save (S). 825.**
+13. **Built, v2.9234. Missing property facts are named before the save (S). 825.** A line above the presses names
+ each fact the paper would print blank. It names and does not hold.
14. **The slow link (S). 827.** Measure what the nine seconds are first. Then mend what the
measure shows.
From 488a29d789b8a7bf95f49c8699ba22a344ec1bc2 Mon Sep 17 00:00:00 2001
From: Robert Douglas <57234112+realrobertdouglas@users.noreply.github.com>
Date: Wed, 2 Dec 2026 15:03:13 -0600
Subject: [PATCH 13/21] =?UTF-8?q?v2.9238=20=E2=80=94=20Release=20of=20reco?=
=?UTF-8?q?rd:=20a=20saved=20release=20takes=20the=20record's=20facts,=20a?=
=?UTF-8?q?nd=20says=20when=20to=20print=20again=20(finding=20812,=20punch?=
=?UTF-8?q?=20list=20#479=20step=204)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The paper lists each fact the records now give differently from a saved release, and one counted press takes them
over the row as it stands. A print keeps the paper as it stood, and a line says what changed after it and to print
again. Both stop once the county records the release.
Co-Authored-By: Claude Fable 5.2
---
docs/LIEN_DESK_ARCHITECTURE.md | 4 ++
docs/recent-features/v2.9238.md | 33 +++++++++
.../LienFilingTabs.release.render.test.tsx | 57 +++++++++++++++
src/components/jobs/LienFilingTabs.tsx | 69 ++++++++++++++++---
.../release-a-filed-lien-after-it-is-paid.md | 4 ++
src/content/releaseNotes/v2.9238.ts | 16 +++++
src/lib/jobs/lienReleaseFacts.test.ts | 40 ++++++++++-
src/lib/jobs/lienReleaseFacts.ts | 36 +++++++++-
src/lib/jobs/lienReleaseOfRecord.test.ts | 49 ++++++++++++-
src/lib/jobs/lienReleaseOfRecord.ts | 68 +++++++++++++++++-
to-dos/lien-release-road-faults/README.md | 13 ++--
11 files changed, 366 insertions(+), 23 deletions(-)
create mode 100644 docs/recent-features/v2.9238.md
create mode 100644 src/content/releaseNotes/v2.9238.ts
diff --git a/docs/LIEN_DESK_ARCHITECTURE.md b/docs/LIEN_DESK_ARCHITECTURE.md
index 265338ac05..07ac8c44da 100644
--- a/docs/LIEN_DESK_ARCHITECTURE.md
+++ b/docs/LIEN_DESK_ARCHITECTURE.md
@@ -746,6 +746,10 @@ last_updated: 2026-12-02
> **v2.9229 (keeping one fact writes one fact, finding 819):** `keepReleaseStamp` reads the release's row fresh and builds `releaseStampPatch` on its facts as they stand, and refuses a row voided since (`releaseGone`).
> **v2.9232 (the release's line takes a scan, finding 821):** the saved copy's editor on a `release_of_record` row under *Filings on this job* draws `LienFiledScanPress` with `paper="release"`, which names the file with `lienReleaseScanName` and writes the link under `LIEN_RELEASE_SCAN_NOTE` through `saveFilingScan`, the two copy columns alone.
> **v2.9234 (blank facts are named before the save, finding 825):** `releasePaperBlanks` reads the release's drawn fields for a blank county, owner, legal description or property address, and `releasePaperBlanksWords` names them above the presses of a release still to save (`data-lien-release-blanks`), where it names and does not hold.
+> **v2.9238 (a saved release takes the records' facts again, the rest of finding 812):** `releaseRecordDrift` names the county, owner, legal description or property address the records now give differently from the saved paper, and `takeRecordFacts` reads the row fresh and writes `releaseRecordFactsPatch` on a release the county has not recorded.
+> A record that holds nothing never replaces a fact the paper has, and a fact the row does not keep is not counted, since the print draws it from the record already.
+> **v2.9238 (the paper as last printed):** `releaseFactsPatch` keeps the nine paper facts under `fields.printedPaper` whenever it sets `printedForNotary`, for the tab, Payoffs and the run alike, and takes it off with the mark.
+> `releasePaperChangedSincePrint` compares the row to it, `releaseReprintWords` says what changed and to print again, and `markReleaseOut` marks a second print when the paper changed since the first.
> **v2.9190 (a door names its lien, findings 808 and 813):** `pickReleaseTarget` takes a third value, the lien the door named, read after the lien the tab holds and before the rule.
> The doors are a lien's row in Payoffs and a release's line on the day's run: each `onOpenRelease` hands the job and its `affidavitId`, `LienDeskPage` keeps it as `releaseLienId` on the window it opens, and `LienInstrumentsModal` hands it to `LienFilingTabs`.
> The tab holds the lien it stands on: an effect writes the picked lien's id into `releaseTargetId`, so a release the county has just recorded no longer hands the tab to the job's other lien.
diff --git a/docs/recent-features/v2.9238.md b/docs/recent-features/v2.9238.md
new file mode 100644
index 0000000000..3731b70ece
--- /dev/null
+++ b/docs/recent-features/v2.9238.md
@@ -0,0 +1,33 @@
+# v2.9238 — Release of record: a saved release takes the record's facts, and says when to print again (2026-12-02)
+
+The second half of step 4 of punch list #479 (the release road's faults), the rest of finding 812. Client only. No migration, no function change, nothing owed on prod. Stacked on v2.9234 (step 13), which changes the same tab.
+
+## What was wrong
+
+- A saved release prints as it was saved. The first half (v2.9219) made its payment date correctable in place. The facts drawn from the records stayed as saved: the county, the owner of record, the legal description, the property address. A release saved with a blank line kept it after the address book was fixed.
+- Nothing said when the paper on the row differed from the copy that was printed and may be signed.
+
+## What changed
+
+- [`lienReleaseOfRecord.ts`](../../src/lib/jobs/lienReleaseOfRecord.ts): `releaseRecordDrift` names each of the four facts the records now give differently from the saved paper. `releaseRecordFactsPatch` takes them and leaves every other fact. A record that holds nothing never replaces a fact the paper has. A fact the row does not keep is not counted, since the print draws it from the record already.
+- [`lienReleaseFacts.ts`](../../src/lib/jobs/lienReleaseFacts.ts): `releaseFactsPatch` keeps the paper's nine facts under `fields.printedPaper` whenever it sets the print's mark, so the tab, Payoffs and the run all keep it. Taking the mark off takes the copy off. `releasePaperChangedSincePrint` compares the row to it.
+- `releaseReprintWords`: *The payment date changed after this release was printed Dec 2. Print it again before the notary signs.* With the notary's day kept it says to have it notarized again.
+- [`LienFilingTabs.tsx`](../../src/components/jobs/LienFilingTabs.tsx): **The paper** draws a line for each drifted fact, the paper's own beside the record's (`data-lien-release-drift`), and one counted press, *Use 2 facts from the record* (`data-lien-release-take-record`). `takeRecordFacts` reads the row fresh, and a release the county recorded or one voided takes nothing. The reprint line stands under them (`data-lien-release-reprint`). `markReleaseOut` marks a second print when the paper changed since the first, so the line clears.
+- Both stop once the county's day is kept: the paper is then the county's record.
+
+## Not in this change
+
+- The day's run. `releaseRunStage` still reads a release printed and then corrected as waiting on its notary. It is on the card under step 4.
+- A print made before the save. No row holds it, so nothing is compared.
+- A print marked before this version keeps no copy of its paper, so no line is drawn for it.
+
+## Tests
+
+- `lienReleaseFacts.test.ts`: the copy kept with the mark, what changed since, no copy and no print, the second print, the other facts' changes.
+- `lienReleaseOfRecord.test.ts`: the drift, a blank record, a fact the row does not keep, the patch, the reprint words with and without the notary's day, plain words.
+- `LienFilingTabs.release.render.test.tsx`: nothing when they agree, the lines and the counted press, the write over the fresh row, a release recorded in the meantime, the reprint line and the second mark.
+
+## Look owed
+
+- A ZZ Test look with the live-write slot, on the ZZ Test job: save a release while its property record lacks the owner, add the owner on the record, open the tab again and see the line and **Use 1 fact from the record**. Press it. Print, correct the payment date, see the reprint line, print again and see it go. Then void the release as the earlier walk did.
+- On a real lien a walker reads **The paper** only. Each press here writes.
diff --git a/src/components/jobs/LienFilingTabs.release.render.test.tsx b/src/components/jobs/LienFilingTabs.release.render.test.tsx
index 5adbb25f6c..621d8af76f 100644
--- a/src/components/jobs/LienFilingTabs.release.render.test.tsx
+++ b/src/components/jobs/LienFilingTabs.release.render.test.tsx
@@ -675,3 +675,60 @@ describe('Release of record: the facts the paper would print blank are named bef
expect(blanks()).toBeNull()
})
})
+
+describe('Release of record: a saved release takes the records’ facts again, and says when it changed after its print (finding 812, v2.9238)', () => {
+ // A release saved while the job had no property record: its paper keeps two blank lines.
+ const blankPaper = { releasesFilingId: 'a1', paymentDate: '2026-11-20', county: 'Travis', ownerName: '', legalDescription: '', propertyAddress: '212 Larkspur Court, Austin, TX' }
+ const drift = () => [...document.querySelectorAll('[data-lien-release-drift]')]
+ const take = () => document.querySelector('[data-lien-release-take-record]')
+ const reprint = () => document.querySelector('[data-lien-release-reprint]')
+
+ it('shows nothing when the paper and the records agree', () => {
+ draw({ job: paid(), filings: [lien() as never, release() as never] })
+ expect(drift()).toEqual([])
+ expect(take()).toBeNull()
+ expect(reprint()).toBeNull()
+ })
+
+ it('names each fact the records now give, the paper’s own beside the record’s, and counts them on the press', () => {
+ draw({ job: paid(), filings: [lien() as never, release({ fields: blankPaper }) as never] })
+ expect(drift().map((d) => d.dataset.lienReleaseDrift)).toEqual(['ownerName', 'legalDescription'])
+ expect(drift()[0]!.textContent).toBe('blank on the paper · the record says Marisol Okafor')
+ expect(take()!.textContent).toBe('Use 2 facts from the record')
+ })
+
+ it('takes them over the row as it is now, and leaves every other fact', async () => {
+ reads.fresh = { filed_at: null, voided_at: null, fields: { ...blankPaper, notarizedYmd: '2026-11-22' } }
+ const { onChanged } = draw({ job: paid(), filings: [lien() as never, release({ fields: blankPaper }) as never] })
+ fireEvent.click(take()!)
+ await waitFor(() => expect(writes.updates).toHaveLength(1))
+ expect(writes.updates[0]).toEqual({ id: 'r1', patch: { fields: { ...blankPaper, notarizedYmd: '2026-11-22', ownerName: 'Marisol Okafor', legalDescription: 'LOT 1 BLK 2 LARKSPUR SUBD' } } })
+ expect(await screen.findByText('The paper has the record’s facts.')).toBeTruthy()
+ expect(onChanged).toHaveBeenCalled()
+ })
+
+ it('takes nothing onto a release the county recorded in the meantime, and offers nothing on one it has', async () => {
+ reads.fresh = { filed_at: '2026-11-24', voided_at: null, fields: blankPaper }
+ draw({ job: paid(), filings: [lien() as never, release({ fields: blankPaper }) as never] })
+ fireEvent.click(take()!)
+ expect(await screen.findByText('This release is no longer open to a change. Close the window and read the job again.')).toBeTruthy()
+ expect(writes.updates).toEqual([])
+ cleanup()
+ draw({ job: paid(), filings: [lien() as never, release({ filed_at: '2026-11-24', fields: blankPaper }) as never] })
+ expect(drift()).toEqual([])
+ expect(take()).toBeNull()
+ })
+
+ it('says to print again when the paper changed after its print, and the next print keeps the paper as it stands', async () => {
+ const printedThen = { by: 'u1', name: 'Alex Rivera', at: '2026-12-02T18:00:00Z' }
+ const row = { releasesFilingId: 'a1', paymentDate: '2026-11-21', printedForNotary: printedThen, printedPaper: { paymentDate: '2026-11-20' } }
+ reads.fresh = { filed_at: null, voided_at: null, fields: row }
+ draw({ job: paid(), filings: [lien() as never, release({ fields: row }) as never] })
+ expect(reprint()!.textContent).toBe('The payment date changed after this release was printed Dec 2. Print it again before the notary signs.')
+ fireEvent.click(screen.getByRole('button', { name: 'Print for notarization' }))
+ await waitFor(() => expect(writes.updates).toHaveLength(1))
+ const kept = writes.updates[0]!.patch.fields as Record
+ expect((kept.printedPaper as Record).paymentDate).toBe('2026-11-21')
+ expect((kept.printedForNotary as Record).at).not.toBe(printedThen.at)
+ })
+})
diff --git a/src/components/jobs/LienFilingTabs.tsx b/src/components/jobs/LienFilingTabs.tsx
index 61cc502b94..9653d76585 100644
--- a/src/components/jobs/LienFilingTabs.tsx
+++ b/src/components/jobs/LienFilingTabs.tsx
@@ -86,11 +86,12 @@ import { formatYmdMonthDay } from '../../lib/jobs/billedExpectedPay'
import type { JobWorkMonths } from '../../lib/jobs/forecastWorkMonths'
import { lienTradeWords } from '../../lib/jobs/lienTradeWords'
import { MoneyText } from '../Money'
-import { ChangeableValue, ValueLine, ValueLines, ValueSentence } from '../valuesInPlace/ValuesInPlace'
+import { ChangeableValue, ValueLine, ValueLines, ValueSentence, WorkedOutValue } from '../valuesInPlace/ValuesInPlace'
import { plainSentence } from '../../lib/valuesInPlace'
-import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayKey, releaseSavedHold, releaseSavedPaymentDay, releaseRecordedSentence, releaseSaveFields, releaseStampDayCheck, releaseStampPatch, releaseTargets, releasePaymentDayCheck } from '../../lib/jobs/lienReleaseOfRecord'
+import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, RELEASE_RECORD_FACT_LABELS, type ReleaseRecordFact, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayKey, releaseSavedHold, releaseSavedPaymentDay, releaseRecordedSentence, releaseSaveFields, releaseStampDayCheck, releaseStampPatch, releaseTargets, releasePaymentDayCheck } from '../../lib/jobs/lienReleaseOfRecord'
import { payoffNote } from '../../lib/jobs/lienPayoffFields'
-import { releaseByNow, releaseFacts, releaseFactsPatch } from '../../lib/jobs/lienReleaseFacts'
+import { releaseByNow, releaseFacts, releaseFactsPatch, releasePaperChangedSincePrint } from '../../lib/jobs/lienReleaseFacts'
+import { countedLabel } from '../../lib/batchWords'
/**
* The statutory filing tabs of the Lien instruments modal (v2.2645, phase 3):
@@ -466,23 +467,25 @@ export default function LienFilingTabs({
})
}, [property, signerNameFallback, affidavitIssuer, job, tradeName, isSub, originalContractorName, originalContractorAddress, ownerName, claim.openBalance, claimCorrection, liveNotices.length, workDays, workMonths, affidavitForm, live, monthsByHand])
+ /** The four facts a release draws from the records, as the records give them now (v2.9238: a saved release can take them again). */
+ const releaseRecordNow: Record = useMemo(
+ () => ({ county: releaseTarget?.affidavit?.county || property.county, ownerName, legalDescription: property.legalDescription, propertyAddress: cleanStoredAddress(job.job_address) }),
+ [releaseTarget, property, ownerName, job.job_address],
+ )
const releaseFields: ReleaseOfRecordFields = useMemo(() => {
const lienRow = releaseTarget?.affidavit ?? null
const drawn: ReleaseOfRecordFields = {
- county: lienRow?.county || property.county,
+ ...releaseRecordNow,
claimantCompany: (issuer?.companyName ?? '').trim() || 'Click Plumbing and Electrical',
claimantPersonName: signerNameFallback,
recordingNumber: lienRow?.recording_number ?? '',
filedDate: lienRow?.filed_at ?? '',
- legalDescription: property.legalDescription,
- propertyAddress: cleanStoredAddress(job.job_address),
- ownerName,
paymentDate: releasePaymentDate,
}
// A release already saved prints as it was saved: its fields are the paper.
const saved = releaseTarget?.release?.fields
return saved && typeof saved === 'object' && !Array.isArray(saved) ? { ...drawn, ...(saved as Partial) } : drawn
- }, [releaseTarget, property, issuer, signerNameFallback, job, ownerName, releasePaymentDate])
+ }, [releaseTarget, releaseRecordNow, issuer, signerNameFallback, releasePaymentDate])
// Letterhead + reference strip (v2.2663): the same issuer block invoices use.
const docExtras: FilingDocExtras = useMemo(
@@ -998,14 +1001,16 @@ export default function LienFilingTabs({
* Mark a saved release as out for the notary (v2.9224, finding 815), as the day's run does when it prints one. The
* tab's own print and download left no mark, so the run offered the same release to print again. The row is read
* fresh and the mark goes over its facts as they stand. A release already marked, recorded or voided is left alone.
+ * A release whose paper changed after its print is marked again (v2.9238), so the row keeps the paper last printed.
*/
+ const releasePrintStands = (fields: unknown) => Boolean(releaseFacts(fields).printed) && releasePaperChangedSincePrint(fields).length === 0
const markReleaseOut = async () => {
const release = releaseTarget?.release
- if (!release || !authUser?.id || release.filed_at || releaseFacts(release.fields).printed) return
+ if (!release || !authUser?.id || release.filed_at || releasePrintStands(release.fields)) return
try {
const read = await withSupabaseRetry(() => supabase.from('job_lien_filings').select('id, filed_at, voided_at, fields').eq('id', release.id).maybeSingle(), 'mark the release as printed: read it first')
const row = read as { filed_at: string | null; voided_at: string | null; fields: unknown } | null
- if (!row || !releaseCorrectable(row) || releaseFacts(row.fields).printed) return
+ if (!row || !releaseCorrectable(row) || releasePrintStands(row.fields)) return
const printed = releaseByNow({ id: authUser.id, name: profileName ?? '' }, new Date().toISOString())
await withSupabaseRetry(() => supabase.from('job_lien_filings').update({ fields: releaseFactsPatch(row.fields, { printed }) } as never).eq('id', release.id), 'mark the release as printed for the notary')
onChanged()
@@ -1013,6 +1018,29 @@ export default function LienFilingTabs({
showToast(formatErrorMessage(e, RELEASE_OF_RECORD_WORDS.markFailed), 'error')
}
}
+ /**
+ * Take the records' facts onto a saved release (v2.9238, the rest of finding 812): the owner, the legal description,
+ * the county and the address as the records give them now. The row is read fresh, a release the county recorded or
+ * one voided takes nothing, and a record that holds nothing never blanks a fact the paper has.
+ */
+ const [recordFactsBusy, setRecordFactsBusy] = useState(false)
+ const takeRecordFacts = async () => {
+ const release = releaseTarget?.release
+ if (!release || recordFactsBusy) return
+ setRecordFactsBusy(true)
+ try {
+ const read = await withSupabaseRetry(() => supabase.from('job_lien_filings').select('id, filed_at, voided_at, fields').eq('id', release.id).maybeSingle(), 'take the record’s facts: read the release first')
+ const row = read as { filed_at: string | null; voided_at: string | null; fields: unknown } | null
+ if (!row || !releaseCorrectable(row)) throw new Error(RELEASE_OF_RECORD_WORDS.releaseGone)
+ await withSupabaseRetry(() => supabase.from('job_lien_filings').update({ fields: releaseRecordFactsPatch(row.fields, releaseRecordNow) } as never).eq('id', release.id), 'take the record’s facts onto the release')
+ showToast(RELEASE_OF_RECORD_WORDS.recordTaken, 'success')
+ onChanged()
+ } catch (e) {
+ showToast(formatErrorMessage(e, RELEASE_OF_RECORD_WORDS.stampFailed), 'error')
+ } finally {
+ setRecordFactsBusy(false)
+ }
+ }
/** A corrected date before the lien was filed is asked about once: the first Keep says so, the second takes it. */
const releaseCorrectAsked = useRef(null)
const checkReleaseCorrection = (draft: string): string | null => {
@@ -1810,6 +1838,9 @@ export default function LienFilingTabs({
const releaseMoneyBack = savedRelease ? releaseMoneyBackWords({ recorded: Boolean(savedRelease.filed_at), payments: job.payments ?? [], bank: bankChecks, todayYmd: todayYmd(), mark: releaseFacts(savedRelease.fields).moneyBack, open: claim.openBalance }) : null
// A saved release reads the hold Payoffs and the day's run keep (v2.9222, finding 814): its print was live while both held it.
const releaseSavedHeld = savedRelease ? releaseSavedHold({ recorded: Boolean(savedRelease.filed_at), open: claim.openBalance, fields: savedRelease.fields, cameBack: Boolean(releaseMoneyBack) }) : null
+ // The rest of finding 812 (v2.9238): where the records now differ from the saved paper, and whether it changed after its print.
+ const releaseDrift = savedRelease && releaseCorrectable(savedRelease) ? releaseRecordDrift(savedRelease.fields, releaseRecordNow) : []
+ const releaseReprint = savedRelease && releaseCorrectable(savedRelease) ? releaseReprintWords(savedRelease.fields) : null
const releaseSavedDead: CSSProperties = releaseSavedHeld ? { background: DEAD_PRESS_FILL, color: DEAD_PRESS_TEXT, border: '1px solid transparent', cursor: 'default' } : {}
// The paper's payment date, held before the print and the save (v2.9179): a saved release cannot be corrected.
const releaseDayWhy = savedRelease ? null : releasePaymentDayCheck(releasePaymentDate, todayYmd())
@@ -1902,7 +1933,25 @@ export default function LienFilingTabs({
onKeep={(value) => keepReleasePaymentDate(value)}
/>
+ {/* A fact the records now give differently (v2.9238): the paper's own beside the record's, and one press takes them. */}
+ {releaseDrift.map((d) => (
+
+
+ {d.saved || RELEASE_OF_RECORD_WORDS.recordBlank} · {RELEASE_OF_RECORD_WORDS.recordSays} {d.record}
+
+
+ ))}
+ {releaseDrift.length > 0 ? (
+ void takeRecordFacts()} disabled={recordFactsBusy} style={{ ...releaseOutline, marginTop: '0.45rem', padding: '0.3rem 0.8rem', cursor: recordFactsBusy ? 'wait' : 'pointer' }}>
+ {recordFactsBusy ? 'Saving…' : countedLabel('Use', releaseDrift.length, ['fact from the record', 'facts from the record'])}
+
+ ) : null}
+ {releaseReprint ? (
+
diff --git a/src/content/help/release-a-filed-lien-after-it-is-paid.md b/src/content/help/release-a-filed-lien-after-it-is-paid.md
index 3e0ac67db5..14be2b6b3d 100644
--- a/src/content/help/release-a-filed-lien-after-it-is-paid.md
+++ b/src/content/help/release-a-filed-lien-after-it-is-paid.md
@@ -95,6 +95,10 @@ The payment date is already the day of the last payment. It prints on the paper,
The paper names the county, the owner, the legal description and the property address. A line above the buttons says when the paper has a blank line for one of them. It reads like *The paper has a blank line for the owner of record.* Property facts are fixed in the customer's address book. Fix them before you print. The buttons do not wait on it.
+A saved release keeps the facts it was saved with. Was the owner or the legal description fixed after the save? **The paper** then lists each fact with what the record says now. Press the counted press under them, like {{button:outline|Use 2 facts from the record}}. The paper takes them. A fact the record does not hold is left as the paper has it.
+
+Did the paper change after it was printed? A line under **The paper** says what changed and the day of the print. It reads like *The payment date changed after this release was printed Dec 2.* Print it again, so the notary signs the paper the app holds. The line goes away after the print.
+
The leader signs the paper before a notary.
You can print the release with the day's other releases. Read [Print the releases in the run](#print-the-releases-in-the-run) below.
diff --git a/src/content/releaseNotes/v2.9238.ts b/src/content/releaseNotes/v2.9238.ts
new file mode 100644
index 0000000000..dac80cce40
--- /dev/null
+++ b/src/content/releaseNotes/v2.9238.ts
@@ -0,0 +1,16 @@
+import type { ReleaseNote } from '../../lib/releaseNotes'
+
+const note: ReleaseNote = {
+ version: 'v2.9238',
+ date: '2026-12-02',
+ title: 'Release of record: a saved release takes the record’s facts, and says when to print again',
+ kind: 'fix',
+ highlights: [
+ 'A saved release kept the owner and the legal description it was saved with, even after they were fixed.',
+ 'The paper now lists each fact the record gives differently. One press, like Use 2 facts from the record, takes them.',
+ 'A line says when the paper changed after it was printed, and to print it again before the notary signs.',
+ 'Both stop once the county records the release.',
+ ],
+}
+
+export default note
diff --git a/src/lib/jobs/lienReleaseFacts.test.ts b/src/lib/jobs/lienReleaseFacts.test.ts
index e069a32ad5..d1d67bbda6 100644
--- a/src/lib/jobs/lienReleaseFacts.test.ts
+++ b/src/lib/jobs/lienReleaseFacts.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
-import { RELEASE_FACT_KEYS, releaseByNow, releaseByYmd, releaseFacts, releaseFactsPatch } from './lienReleaseFacts'
+import { RELEASE_FACT_KEYS, RELEASE_PAPER_KEYS, releaseByNow, releaseByYmd, releaseFacts, releaseFactsPatch, releasePaperChangedSincePrint, releasePrintedPaper } from './lienReleaseFacts'
// Every name here is made up.
const WHO = { by: 'u1', name: 'Alex Rivera', at: '2026-11-27T03:30:00Z' }
@@ -23,7 +23,7 @@ describe('releaseFactsPatch', () => {
it('adds a fact and keeps the paper’s own fields', () => {
expect(releaseFactsPatch(paper, { notarizedYmd: '2026-12-01' })).toEqual({ ...paper, notarizedYmd: '2026-12-01' })
- expect(releaseFactsPatch(paper, { printed: WHO })).toEqual({ ...paper, printedForNotary: WHO })
+ expect(releaseFactsPatch(paper, { printed: WHO })).toMatchObject({ ...paper, printedForNotary: WHO })
expect(releaseFactsPatch(paper, { copies: { ...WHO, ymd: '2026-12-05' } })).toEqual({ ...paper, copiesSent: { ymd: '2026-12-05', by: 'u1', name: 'Alex Rivera', at: WHO.at } })
})
@@ -65,3 +65,39 @@ describe('who pressed', () => {
expect(releaseByYmd(WHO)).toBe('2026-11-26')
})
})
+
+describe('the paper as it stood at its last print (finding 812, v2.9238)', () => {
+ const saved = { releasesFilingId: 'a1', county: 'Travis', ownerName: 'Marisol Okafor', legalDescription: 'LOT 1 BLK 2', paymentDate: '2026-11-20', recordingNumber: '2026-0412207' }
+
+ it('is kept with the print’s mark, the nine facts the paper draws and nothing else', () => {
+ const marked = releaseFactsPatch(saved, { printed: WHO })
+ const kept = releasePrintedPaper(marked)!
+ expect(Object.keys(kept).sort()).toEqual([...RELEASE_PAPER_KEYS].sort())
+ expect(kept).toMatchObject({ county: 'Travis', ownerName: 'Marisol Okafor', paymentDate: '2026-11-20', propertyAddress: '' })
+ expect(releasePaperChangedSincePrint(marked)).toEqual([])
+ })
+
+ it('names what changed after the print, in the paper’s order', () => {
+ const marked = releaseFactsPatch(saved, { printed: WHO })
+ expect(releasePaperChangedSincePrint({ ...marked, paymentDate: '2026-11-21', ownerName: 'Marisol Okafor-Reyes' })).toEqual(['ownerName', 'paymentDate'])
+ })
+
+ it('says nothing of a release never printed, or of a print marked before the copy was kept', () => {
+ expect(releasePrintedPaper(saved)).toBeNull()
+ expect(releasePaperChangedSincePrint(saved)).toEqual([])
+ expect(releasePaperChangedSincePrint({ ...saved, printedForNotary: WHO })).toEqual([])
+ })
+
+ it('goes with the mark when the print is taken off, and a second print keeps the paper as it stands then', () => {
+ const marked = releaseFactsPatch(saved, { printed: WHO })
+ expect(releaseFactsPatch(marked, { printed: null })).toEqual(saved)
+ const again = releaseFactsPatch({ ...marked, paymentDate: '2026-11-21' }, { printed: { ...WHO, at: '2026-11-28T15:00:00Z' } })
+ expect(releasePrintedPaper(again)!.paymentDate).toBe('2026-11-21')
+ expect(releasePaperChangedSincePrint(again)).toEqual([])
+ })
+
+ it('is left alone by the other facts’ changes', () => {
+ const marked = releaseFactsPatch(saved, { printed: WHO })
+ expect(releasePrintedPaper(releaseFactsPatch(marked, { notarizedYmd: '2026-12-01' }))).toEqual(releasePrintedPaper(marked))
+ })
+})
diff --git a/src/lib/jobs/lienReleaseFacts.ts b/src/lib/jobs/lienReleaseFacts.ts
index 87f415fe09..46b0f97d93 100644
--- a/src/lib/jobs/lienReleaseFacts.ts
+++ b/src/lib/jobs/lienReleaseFacts.ts
@@ -44,6 +44,32 @@ function readBy(raw: unknown): ReleaseBy | null {
return at ? { by: text(r.by), name: text(r.name), at } : null
}
+/** The paper's own facts on a release row: the nine its print draws. */
+export const RELEASE_PAPER_KEYS = ['county', 'claimantCompany', 'claimantPersonName', 'recordingNumber', 'filedDate', 'legalDescription', 'propertyAddress', 'ownerName', 'paymentDate'] as const
+export type ReleasePaperKey = (typeof RELEASE_PAPER_KEYS)[number]
+
+/** Where a row keeps its paper as it stood at its last print (finding 812, v2.9238). */
+export const RELEASE_PRINTED_PAPER_KEY = 'printedPaper'
+
+const paperOf = (f: Record): Record => Object.fromEntries(RELEASE_PAPER_KEYS.map((k) => [k, text(f[k])])) as Record
+
+/** The paper as it stood at its last print, or null when the row keeps none: no print, or a print marked before v2.9238. */
+export function releasePrintedPaper(fields: unknown): Record | null {
+ const kept = asObject(fields)[RELEASE_PRINTED_PAPER_KEY]
+ return kept && typeof kept === 'object' && !Array.isArray(kept) ? paperOf(kept as Record) : null
+}
+
+/**
+ * The paper's facts that changed since its last print, in the paper's order. Empty when it was not printed, when the
+ * row keeps no copy of the print, or when nothing changed. A paper signed before a notary must be the one on the row.
+ */
+export function releasePaperChangedSincePrint(fields: unknown): ReleasePaperKey[] {
+ const printed = releasePrintedPaper(fields)
+ if (!printed) return []
+ const now = paperOf(asObject(fields))
+ return RELEASE_PAPER_KEYS.filter((k) => now[k] !== printed[k])
+}
+
/** The three facts off a release row's `fields`. A broken one reads as not there. */
export function releaseFacts(fields: unknown): ReleaseFacts {
const f = asObject(fields)
@@ -79,8 +105,14 @@ export type ReleaseFactsChange = {
export function releaseFactsPatch(fields: unknown, change: ReleaseFactsChange): Record {
const out = asObject(fields)
if (change.printed !== undefined) {
- if (change.printed) out[RELEASE_FACT_KEYS.printed] = { by: change.printed.by, name: change.printed.name, at: change.printed.at }
- else delete out[RELEASE_FACT_KEYS.printed]
+ // The print keeps the paper as it stood (v2.9238), for every screen that marks one: the tab, Payoffs and the run.
+ if (change.printed) {
+ out[RELEASE_FACT_KEYS.printed] = { by: change.printed.by, name: change.printed.name, at: change.printed.at }
+ out[RELEASE_PRINTED_PAPER_KEY] = paperOf(out)
+ } else {
+ delete out[RELEASE_FACT_KEYS.printed]
+ delete out[RELEASE_PRINTED_PAPER_KEY]
+ }
}
if (change.notarizedYmd !== undefined) {
const day = change.notarizedYmd.trim()
diff --git a/src/lib/jobs/lienReleaseOfRecord.test.ts b/src/lib/jobs/lienReleaseOfRecord.test.ts
index 072fcb87b3..adbb4b54a7 100644
--- a/src/lib/jobs/lienReleaseOfRecord.test.ts
+++ b/src/lib/jobs/lienReleaseOfRecord.test.ts
@@ -3,7 +3,8 @@ import { plainWordsFailures } from '../plainWords'
import { plainSentence, val } from '../valuesInPlace'
import type { LienPayoffAffidavit, LienPayoffPayment, LienPayoffRelease } from './lienPayoff'
import type { BankCheck } from './checkCleared'
-import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDay, releaseSavedPaymentDay, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayCheck, releasePaymentDayKey, releaseRecordedSentence, releaseSaveFields, releaseSavedHold, releaseStampDayCheck, releaseStampPatch, releaseTargets, releaseWaitsOnCheck } from './lienReleaseOfRecord'
+import { releaseFactsPatch } from './lienReleaseFacts'
+import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDay, releaseSavedPaymentDay, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayCheck, releasePaymentDayKey, releaseRecordedSentence, releaseSaveFields, releaseSavedHold, releaseStampDayCheck, releaseStampPatch, releaseTargets, releaseWaitsOnCheck } from './lienReleaseOfRecord'
// Every job, instrument and amount here is made up.
const TODAY = '2026-11-24'
@@ -411,3 +412,49 @@ describe('the facts a release would print as blank lines are named before the sa
for (const blanks of [['owner', 'legal'], ['address'], ['county', 'owner', 'legal', 'address']] as const) expect(plainWordsFailures(releasePaperBlanksWords(blanks) ?? '')).toEqual([])
})
})
+
+describe('a saved release takes the records’ facts again, and says when it changed after its print (finding 812, v2.9238)', () => {
+ const saved = { releasesFilingId: 'a1', county: 'Travis', ownerName: '', legalDescription: '', propertyAddress: '212 Larkspur Court, Austin, TX', paymentDate: '2026-11-20', notarizedYmd: '' }
+ const record = { county: 'Travis', ownerName: 'Marisol Okafor', legalDescription: 'LOT 1 BLK 2 LARKSPUR SUBD', propertyAddress: '212 Larkspur Court, Austin, TX' }
+ const WHO = { by: 'u1', name: 'Alex Rivera', at: '2026-12-02T18:00:00Z' }
+
+ it('names each fact the records now give differently, and nothing when they agree', () => {
+ expect(releaseRecordDrift(saved, record)).toEqual([
+ { key: 'ownerName', saved: '', record: 'Marisol Okafor' },
+ { key: 'legalDescription', saved: '', record: 'LOT 1 BLK 2 LARKSPUR SUBD' },
+ ])
+ expect(releaseRecordDrift({ ...saved, ...record }, record)).toEqual([])
+ })
+
+ it('never counts a record that holds nothing: the paper keeps the fact it has', () => {
+ expect(releaseRecordDrift({ ...saved, ownerName: 'Marisol Okafor' }, { ...record, ownerName: ' ', legalDescription: '' })).toEqual([])
+ })
+
+ it('never counts a fact the row does not keep: the print draws that one from the record already', () => {
+ expect(releaseRecordDrift({ releasesFilingId: 'a1', paymentDate: '2026-11-20' }, record)).toEqual([])
+ })
+
+ it('patches the drifted facts alone and keeps every other fact on the row', () => {
+ const row = { ...saved, releaseInstrument: '2026-0431955', copiesSent: { ymd: '2026-12-01' } }
+ expect(releaseRecordFactsPatch(row, record)).toEqual({ ...row, ownerName: 'Marisol Okafor', legalDescription: 'LOT 1 BLK 2 LARKSPUR SUBD' })
+ })
+
+ it('says to print again once the paper changed after its print, and names what changed', () => {
+ const printed = releaseFactsPatch(saved, { printed: WHO })
+ expect(releaseReprintWords(printed)).toBeNull()
+ const corrected = releaseRecordFactsPatch(printed, record)
+ expect(plainSentence(releaseReprintWords(corrected) ?? '')).toBe('The legal description and the owner of record changed after this release was printed Dec 2. Print it again before the notary signs.')
+ expect(releaseReprintWords(corrected)).toContain(val('day', 'Dec 2'))
+ })
+
+ it('says to notarize again when the notary’s day is already kept', () => {
+ const notarized = { ...releaseFactsPatch(saved, { printed: WHO }), notarizedYmd: '2026-12-02', paymentDate: '2026-11-21' }
+ expect(plainSentence(releaseReprintWords(notarized) ?? '')).toBe('The payment date changed after this release was printed Dec 2. Print it again and have it notarized again.')
+ })
+
+ it('says nothing of a release never printed, and reads as plain words', () => {
+ expect(releaseReprintWords(saved)).toBeNull()
+ const corrected = releaseRecordFactsPatch(releaseFactsPatch(saved, { printed: WHO }), record)
+ expect(plainWordsFailures(plainSentence(releaseReprintWords(corrected) ?? ''))).toEqual([])
+ })
+})
diff --git a/src/lib/jobs/lienReleaseOfRecord.ts b/src/lib/jobs/lienReleaseOfRecord.ts
index 83cbfe69f7..b7c9ea85a7 100644
--- a/src/lib/jobs/lienReleaseOfRecord.ts
+++ b/src/lib/jobs/lienReleaseOfRecord.ts
@@ -38,7 +38,7 @@ import { BANK_CHECK_WINDOW_DAYS, bankCheckForPayment, canActBeforeCheckClears, c
import { isCheckPayment } from './checkClearing'
import { lastPayment, payWayWords, releaseForAffidavit, releaseOwnInstrument, type LienPayoffAffidavit, type LienPayoffPayment, type LienPayoffRelease } from './lienPayoff'
import { fundsConfirmedWords, type FundsConfirmed } from './lienPayoffFields'
-import type { ReleaseMoneyBackMark } from './lienReleaseFacts'
+import { releaseByYmd, releaseFacts, releasePaperChangedSincePrint, type ReleaseMoneyBackMark, type ReleasePaperKey } from './lienReleaseFacts'
import { releaseMarkHolds, releaseMarkWords, releaseOnReturnedCheck } from './payoffReturned'
export const RELEASE_OF_RECORD_WORDS = {
@@ -77,6 +77,10 @@ export const RELEASE_OF_RECORD_WORDS = {
payDayLabel: 'Payment / satisfaction date',
paperHint: 'You can correct this date until the county records the release.',
paperCorrected: 'The release has the new payment date.',
+ /** A saved release takes the records' facts again, and says when it changed after its print (v2.9238). */
+ recordSays: 'the record says',
+ recordBlank: 'blank on the paper',
+ recordTaken: 'The paper has the record’s facts.',
countyRecordTag: 'the county’s record',
countyRecord: 'The county recorded this release. Its paper stays as it was saved.',
releaseGone: 'This release is no longer open to a change. Close the window and read the job again.',
@@ -314,6 +318,64 @@ export function releasePaymentDatePatch(fields: unknown, day: string): Record = {
+ county: 'the county',
+ claimantCompany: 'the claimant',
+ claimantPersonName: 'the signer',
+ recordingNumber: 'the lien’s instrument number',
+ filedDate: 'the day the lien was filed',
+ legalDescription: 'the legal description',
+ propertyAddress: 'the property address',
+ ownerName: 'the owner of record',
+ paymentDate: 'the payment date',
+}
+
+/** A record fact's label on its line: *Owner of record*. */
+export const RELEASE_RECORD_FACT_LABELS: Record = { county: 'County', ownerName: 'Owner of record', legalDescription: 'Legal description', propertyAddress: 'Property address' }
+
+export type ReleaseRecordDrift = { key: ReleaseRecordFact; saved: string; record: string }
+
+/**
+ * Where the records now say something else than the saved paper. A record that holds nothing never counts: taking
+ * it would put a blank line on a paper that has the fact. A fact the row does not keep at all never counts either:
+ * the print draws that one from the record already.
+ */
+export function releaseRecordDrift(savedFields: unknown, record: Record): ReleaseRecordDrift[] {
+ const saved = savedFields && typeof savedFields === 'object' && !Array.isArray(savedFields) ? (savedFields as Record) : {}
+ const out: ReleaseRecordDrift[] = []
+ for (const key of RELEASE_RECORD_FACTS) {
+ const now = (record[key] ?? '').trim()
+ if (typeof saved[key] !== 'string') continue
+ const kept = (saved[key] as string).trim()
+ if (now && now !== kept) out.push({ key, saved: kept, record: now })
+ }
+ return out
+}
+
+/** The saved paper with the records' facts taken, as the row's new `fields`: every other fact the row keeps is left as it is. */
+export function releaseRecordFactsPatch(fields: unknown, record: Record): Record {
+ const base = fields && typeof fields === 'object' && !Array.isArray(fields) ? { ...(fields as Record) } : {}
+ for (const d of releaseRecordDrift(base, record)) base[d.key] = d.record
+ return base
+}
+
+/**
+ * The line under **The paper** when it changed after its last print: *The payment date changed after this release
+ * was printed Dec 2. Print it again before the notary signs.* Null when the print and the row agree.
+ */
+export function releaseReprintWords(fields: unknown): string | null {
+ const changed = releasePaperChangedSincePrint(fields)
+ const facts = releaseFacts(fields)
+ if (changed.length === 0 || !facts.printed) return null
+ const named = wordList(changed.map((k) => PAPER_FACT_NAMES[k]))
+ const then = facts.notarizedYmd ? 'Print it again and have it notarized again.' : 'Print it again before the notary signs.'
+ return `${named.charAt(0).toUpperCase()}${named.slice(1)} changed after this release was printed ${val('day', formatYmdMonthDay(releaseByYmd(facts.printed)))}. ${then}`
+}
+
/** A fact the release prints as a blank line when its record holds nothing (finding 825, v2.9234), in the paper's order. */
export type ReleasePaperBlank = 'county' | 'owner' | 'legal' | 'address'
@@ -333,7 +395,9 @@ export function releasePaperBlanks(paper: { county: string; ownerName: string; l
]
}
-const wordList = (words: ReadonlyArray): string => (words.length <= 2 ? words.join(' and ') : `${words.slice(0, -1).join(', ')} and ${words[words.length - 1]}`)
+function wordList(words: ReadonlyArray): string {
+ return words.length <= 2 ? words.join(' and ') : `${words.slice(0, -1).join(', ')} and ${words[words.length - 1]}`
+}
/**
* The blanks named above the presses, and where each is fixed. Null with none. It names and does not hold: the lien's
diff --git a/to-dos/lien-release-road-faults/README.md b/to-dos/lien-release-road-faults/README.md
index 2258cc2c6f..b6e38f6104 100644
--- a/to-dos/lien-release-road-faults/README.md
+++ b/to-dos/lien-release-road-faults/README.md
@@ -2,7 +2,7 @@
name: "The release road: every fault found on the way to releasing a paid lien, and the ones left to mend"
number: 479
group: ready
-status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · the first half of step 4 is built (v2.9219) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 10 is built in the tab (v2.9229) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 8, 9, 11 and 14 are left, with the second halves of steps 4 and 10
+status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 10 is built in the tab (v2.9229) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 8, 9, 11 and 14 are left, with the second half of step 10
summary: >
The owner asked for help releasing a paid lien and printing its release, and for every bug on
the way. One thread read the road in the code and found fourteen faults, findings 808 to 821.
@@ -58,7 +58,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 809 | A release that is only saved reads *Released* in five places. They are the window's head, its suit stop, the stop's window, the desk's path and the Accounts Receivable chip. The day its row was made stands in for the county's day. The tab, Payoffs and the Board still say it waits for the county. The chip also shows the lien's own number as the release's. On a job with two liens, one release makes the whole job read released. | seen | Not started. Step 2. |
| 810 | A job has nothing open and no payment. It reads *The bills read paid. The release is owed.* A filed lien whose bill goes back to draft is one such job. The tab then prints a paper that swears payment as of today. | seen | Decided on card #477, call 2. Not built. Not a step here. |
| 811 | **Payment / satisfaction date** is not checked. Cleared, the paper prints *as of —*. A day still to come is taken. A day before the lien was filed is taken. The date is set once, from the window's kept copy of the job. So it can show today while the money line shows the real day. | read | Mended in part by v2.9179 (PR #10639), on `main`. It stops an empty day and a day still to come. The rest is mended by v2.9216, step 3: the date follows the job as it stands, and a day before the lien was filed is asked about once. |
-| 812 | A saved release cannot be corrected, and nothing says so. The only way is **Void**, **Confirm void** and making it again. Print needs no save, so a paper printed and signed can differ from the one saved after it. | read | Mended in part by v2.9219, step 4's first half: a saved release's payment date is corrected in place until the county's day is kept. Left: the facts drawn from the records, and the printed copy. |
+| 812 | A saved release cannot be corrected, and nothing says so. The only way is **Void**, **Confirm void** and making it again. Print needs no save, so a paper printed and signed can differ from the one saved after it. | read | Mended, v2.9219 and v2.9238, step 4. A saved release's payment date is corrected in place until the county's day is kept. It takes the records' facts again on one press. A line says when the paper changed after its print. Left: the run's stage for a release corrected after its print. |
| 813 | A job has two liens. Keeping **Recorded on** throws the tab onto the other lien before **Instrument number** is typed. | read | Built in step 1, v2.9190. The tab holds the lien it stands on. |
| 814 | A release is saved and the county has not recorded it. The job's bills owe again. The tab still says *Sign it before a notary. Then record it at the county.* Its print is live. Payoffs and the day's run hold the same release. | read | Mended by v2.9222, step 5: the tab reads the same hold, its two presses wait and the reason stands under them. |
| 815 | **Download PDF** files no copy. Neither press marks the release as printed for the notary. When a check then comes back, the app says no release has left the office. The day's run prints it again. | read | Mended by v2.9224, step 6: a download files a copy, and the tab's print or download marks a saved release as printed for the notary. |
@@ -114,13 +114,14 @@ Lien desk lane's note of run 17 and are not on this card.
number. On a job with two liens each lien reads for itself.
3. **Built, v2.9216. The rest of the payment date (S). 811.** The date follows the payment's own day, not the
window's kept copy. A day before the lien was filed is asked about once and then taken (call 3).
-4. **First half built, v2.9219. A saved release, and the paper that was printed (S). 812.** A saved release is corrected in
+4. **Built, v2.9219 and v2.9238. A saved release, and the paper that was printed (S). 812.** A saved release is corrected in
place until the county's day is kept (call 1). After that the tab says it is the county's
record. The tab also says when the facts on the screen differ from the last printed copy.
Built: the payment date, the one fact a person types, is a value in place under **The paper**,
- and is locked once the county's day is kept. Left, as a second PR: a press that reads the
- facts drawn from the records again (the owner, the legal description, the county), and the
- line that says the screen differs from the last printed copy.
+ and is locked once the county's day is kept. The second PR, v2.9238: **The paper** lists each
+ fact the records now give differently, and one counted press takes them. A print keeps the
+ paper as it stood, and a line says what changed after it and to print again. Left: the day's
+ run still reads a release printed and then corrected as waiting on its notary.
5. **Built, v2.9222. Bills that owe again hold the print (S). 814.** The tab reads the same hold as Payoffs and
the run, and says why.
6. **Built, v2.9224. A download is a copy, and a print is marked (S). 815.** **Download PDF** files a copy as the
From 2f114cc2fb5320fd2fd3853e02e52b828337b5da Mon Sep 17 00:00:00 2001
From: Robert Douglas <57234112+realrobertdouglas@users.noreply.github.com>
Date: Wed, 2 Dec 2026 15:06:30 -0600
Subject: [PATCH 14/21] =?UTF-8?q?v2.9239=20=E2=80=94=20Lien=20releases:=20?=
=?UTF-8?q?the=20run=20and=20Payoffs=20no=20longer=20overwrite=20a=20fact?=
=?UTF-8?q?=20kept=20elsewhere=20(finding=20819,=20punch=20list=20#479=20s?=
=?UTF-8?q?tep=2010)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
keepReleaseFacts reads every release it is handed in one read and builds its patch on the facts the database holds,
not on the copy the screen read when it drew. A release voided in the meantime is held with its reason.
Co-Authored-By: Claude Fable 5.2
---
docs/LIEN_DESK_ARCHITECTURE.md | 1 +
docs/recent-features/v2.9239.md | 27 +++++
src/content/releaseNotes/v2.9239.ts | 16 +++
src/lib/jobs/lienReleaseRun.ts | 2 +
src/lib/jobs/lienReleaseRunIo.keep.test.ts | 109 +++++++++++++++++++++
src/lib/jobs/lienReleaseRunIo.ts | 27 ++++-
to-dos/lien-release-road-faults/README.md | 9 +-
7 files changed, 185 insertions(+), 6 deletions(-)
create mode 100644 docs/recent-features/v2.9239.md
create mode 100644 src/content/releaseNotes/v2.9239.ts
create mode 100644 src/lib/jobs/lienReleaseRunIo.keep.test.ts
diff --git a/docs/LIEN_DESK_ARCHITECTURE.md b/docs/LIEN_DESK_ARCHITECTURE.md
index 07ac8c44da..17eac6c4a9 100644
--- a/docs/LIEN_DESK_ARCHITECTURE.md
+++ b/docs/LIEN_DESK_ARCHITECTURE.md
@@ -750,6 +750,7 @@ last_updated: 2026-12-02
> A record that holds nothing never replaces a fact the paper has, and a fact the row does not keep is not counted, since the print draws it from the record already.
> **v2.9238 (the paper as last printed):** `releaseFactsPatch` keeps the nine paper facts under `fields.printedPaper` whenever it sets `printedForNotary`, for the tab, Payoffs and the run alike, and takes it off with the mark.
> `releasePaperChangedSincePrint` compares the row to it, `releaseReprintWords` says what changed and to print again, and `markReleaseOut` marks a second print when the paper changed since the first.
+> **v2.9239 (the run and Payoffs read fresh too, the rest of finding 819):** `keepReleaseFacts` reads every release it is handed in one read and builds `releaseFactsPatch` on the facts the database holds, a release voided in the meantime is held with `RELEASE_RUN_WORDS.gone`, and a row's own `fields` is no longer written.
> **v2.9190 (a door names its lien, findings 808 and 813):** `pickReleaseTarget` takes a third value, the lien the door named, read after the lien the tab holds and before the rule.
> The doors are a lien's row in Payoffs and a release's line on the day's run: each `onOpenRelease` hands the job and its `affidavitId`, `LienDeskPage` keeps it as `releaseLienId` on the window it opens, and `LienInstrumentsModal` hands it to `LienFilingTabs`.
> The tab holds the lien it stands on: an effect writes the picked lien's id into `releaseTargetId`, so a release the county has just recorded no longer hands the tab to the job's other lien.
diff --git a/docs/recent-features/v2.9239.md b/docs/recent-features/v2.9239.md
new file mode 100644
index 0000000000..7666c513fa
--- /dev/null
+++ b/docs/recent-features/v2.9239.md
@@ -0,0 +1,27 @@
+# v2.9239 — Lien releases: the run and Payoffs no longer overwrite a fact kept elsewhere (2026-12-02)
+
+The second half of step 10 of punch list #479 (the release road's faults), the rest of finding 819. Client only. No migration, no function change, nothing owed on prod. Stacked on v2.9238, which changes the same card.
+
+## What was wrong
+
+- A release keeps its facts in one JSON column, `fields`. v2.9229 made the tab's writes read the row first.
+- The day's run, Payoffs and the returned check's mark write through `keepReleaseFacts`, which built the new `fields` on the copy each screen read when it drew. A fact another screen kept in the meantime was written over.
+
+## What changed
+
+- [`lienReleaseRunIo.ts`](../../src/lib/jobs/lienReleaseRunIo.ts): `keepReleaseFacts` reads every release it is handed in one read (`id, voided_at, fields`) and builds `releaseFactsPatch` on what the database holds. A row's own `fields` is no longer written.
+- A release voided in the meantime, or gone, takes no change. Its line carries `RELEASE_RUN_WORDS.gone`: *This release was voided on another screen. Close this and open it again.* The rest of the batch goes on.
+- A read that fails holds every row with its reason, and nothing is written.
+- The callers are unchanged: `LienRunReleases.tsx`, `LienPayoffs.tsx` and `useReturnedCaseLiens.ts`.
+
+## Why not a merge in the database
+
+- The card allowed either. A read then a write closes the window to the length of one round trip, with no migration and no push. A JSON merge in a function would close it wholly and is still open as a later step if a lost fact is ever seen.
+
+## Tests
+
+- `lienReleaseRunIo.keep.test.ts` (new): the write goes over the database's facts, one read for every release, a voided or missing release is held and the batch goes on, a failed read writes nothing, a failed write is passed and named, no rows asks nothing.
+
+## Look owed
+
+- None of its own. It rides with the ZZ Test looks of the same train: a notary's day kept in the run on a ZZ Test release keeps its other facts.
diff --git a/src/content/releaseNotes/v2.9239.ts b/src/content/releaseNotes/v2.9239.ts
new file mode 100644
index 0000000000..98c1e0f362
--- /dev/null
+++ b/src/content/releaseNotes/v2.9239.ts
@@ -0,0 +1,16 @@
+import type { ReleaseNote } from '../../lib/releaseNotes'
+
+const note: ReleaseNote = {
+ version: 'v2.9239',
+ date: '2026-12-02',
+ title: 'Lien releases: the run and Payoffs no longer overwrite a fact kept elsewhere',
+ kind: 'fix',
+ highlights: [
+ 'Keeping a notary’s day or the copies’ day wrote back every fact the screen had read when it opened.',
+ 'A fact kept on another screen in the meantime could be lost, like the county’s instrument number.',
+ 'The run, Payoffs and the returned check’s mark now read each release fresh and change their own fact alone.',
+ 'A release voided on another screen takes no change, and its line says so.',
+ ],
+}
+
+export default note
diff --git a/src/lib/jobs/lienReleaseRun.ts b/src/lib/jobs/lienReleaseRun.ts
index 71317a0b39..494e99554b 100644
--- a/src/lib/jobs/lienReleaseRun.ts
+++ b/src/lib/jobs/lienReleaseRun.ts
@@ -53,6 +53,8 @@ export const RELEASE_RUN_WORDS = {
popup: 'The print window was blocked. Allow pop-ups for this site, then print again.',
kept: 'The release took the change.',
failed: 'The release did not take the change.',
+ /** The release was voided on another screen after this one read it (finding 819, v2.9239). */
+ gone: 'This release was voided on another screen. Close this and open it again.',
} as const
export type ReleaseRunLine = {
diff --git a/src/lib/jobs/lienReleaseRunIo.keep.test.ts b/src/lib/jobs/lienReleaseRunIo.keep.test.ts
new file mode 100644
index 0000000000..579abd95a5
--- /dev/null
+++ b/src/lib/jobs/lienReleaseRunIo.keep.test.ts
@@ -0,0 +1,109 @@
+/**
+ * `keepReleaseFacts` reads each release fresh before it writes one fact (finding 819, v2.9239). The database is a
+ * stub: what it holds, what was asked of it and what was written are read back off it.
+ */
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { plainWordsFailures } from '../plainWords'
+import { RELEASE_RUN_WORDS } from './lienReleaseRun'
+import { keepReleaseFacts } from './lienReleaseRunIo'
+
+const db = vi.hoisted(() => ({
+ rows: [] as Array<{ id: string; voided_at: string | null; fields: unknown }>,
+ readError: null as { message: string } | null,
+ writeErrorFor: '' as string,
+ asked: [] as string[][],
+ writes: [] as Array<{ id: string; patch: Record }>,
+}))
+
+vi.mock('../supabase', () => ({
+ supabase: {
+ from: () => ({
+ select: () => ({
+ in: (_col: string, ids: string[]) => {
+ db.asked.push(ids)
+ return Promise.resolve(db.readError ? { data: null, error: db.readError } : { data: db.rows.filter((r) => ids.includes(r.id)), error: null })
+ },
+ }),
+ update: (patch: Record) => ({
+ eq: (_col: string, id: string) => {
+ if (db.writeErrorFor === id) return Promise.resolve({ data: null, error: { message: 'permission denied for table job_lien_filings', code: '42501' } })
+ db.writes.push({ id, patch })
+ return Promise.resolve({ data: null, error: null })
+ },
+ }),
+ }),
+ },
+}))
+
+afterEach(() => {
+ db.rows = []
+ db.readError = null
+ db.writeErrorFor = ''
+ db.asked.length = 0
+ db.writes.length = 0
+})
+
+// Every name and number here is made up.
+const WHO = { by: 'u1', name: 'Alex Rivera', at: '2026-12-02T18:00:00Z' }
+const paper = { releasesFilingId: 'a1', paymentDate: '2026-11-20' }
+
+describe('keepReleaseFacts reads each release fresh (finding 819, v2.9239)', () => {
+ it('writes the change over the facts the database holds now, not over the screen’s copy', async () => {
+ // Another screen kept the instrument number after this one read the release.
+ db.rows = [{ id: 'r1', voided_at: null, fields: { ...paper, releaseInstrument: '2026-0431955' } }]
+ const out = await keepReleaseFacts([{ releaseId: 'r1', fields: paper }], { notarizedYmd: '2026-12-01' })
+ expect(out).toEqual([{ releaseId: 'r1', ok: true, why: null }])
+ expect(db.writes).toEqual([{ id: 'r1', patch: { fields: { ...paper, releaseInstrument: '2026-0431955', notarizedYmd: '2026-12-01' } } }])
+ })
+
+ it('reads every release in one read', async () => {
+ db.rows = [
+ { id: 'r1', voided_at: null, fields: paper },
+ { id: 'r2', voided_at: null, fields: { ...paper, releasesFilingId: 'a2' } },
+ ]
+ await keepReleaseFacts([{ releaseId: 'r1', fields: paper }, { releaseId: 'r2', fields: paper }], { printed: WHO })
+ expect(db.asked).toEqual([['r1', 'r2']])
+ expect(db.writes.map((w) => w.id)).toEqual(['r1', 'r2'])
+ expect((db.writes[1]!.patch.fields as Record).releasesFilingId).toBe('a2')
+ })
+
+ it('holds a release voided in the meantime, or gone, with its reason, and keeps going', async () => {
+ db.rows = [
+ { id: 'r1', voided_at: '2026-12-02T17:00:00Z', fields: paper },
+ { id: 'r3', voided_at: null, fields: paper },
+ ]
+ const out = await keepReleaseFacts([{ releaseId: 'r1', fields: paper }, { releaseId: 'r2', fields: paper }, { releaseId: 'r3', fields: paper }], { notarizedYmd: '2026-12-01' })
+ expect(out).toEqual([
+ { releaseId: 'r1', ok: false, why: RELEASE_RUN_WORDS.gone },
+ { releaseId: 'r2', ok: false, why: RELEASE_RUN_WORDS.gone },
+ { releaseId: 'r3', ok: true, why: null },
+ ])
+ expect(db.writes.map((w) => w.id)).toEqual(['r3'])
+ expect(plainWordsFailures(RELEASE_RUN_WORDS.gone)).toEqual([])
+ })
+
+ it('writes nothing when the read fails, and names the reason on every row', async () => {
+ db.readError = { message: 'permission denied for table job_lien_filings' }
+ const out = await keepReleaseFacts([{ releaseId: 'r1', fields: paper }], { notarizedYmd: '2026-12-01' })
+ expect(out).toHaveLength(1)
+ expect(out[0]!.ok).toBe(false)
+ expect(out[0]!.why).toBeTruthy()
+ expect(db.writes).toEqual([])
+ })
+
+ it('goes past a write that fails and names it', async () => {
+ db.rows = [
+ { id: 'r1', voided_at: null, fields: paper },
+ { id: 'r2', voided_at: null, fields: paper },
+ ]
+ db.writeErrorFor = 'r1'
+ const out = await keepReleaseFacts([{ releaseId: 'r1', fields: paper }, { releaseId: 'r2', fields: paper }], { notarizedYmd: '2026-12-01' })
+ expect(out.map((o) => o.ok)).toEqual([false, true])
+ expect(db.writes.map((w) => w.id)).toEqual(['r2'])
+ })
+
+ it('asks nothing of the database with no rows', async () => {
+ expect(await keepReleaseFacts([], { notarizedYmd: '2026-12-01' })).toEqual([])
+ expect(db.asked).toEqual([])
+ })
+})
diff --git a/src/lib/jobs/lienReleaseRunIo.ts b/src/lib/jobs/lienReleaseRunIo.ts
index ed9e424aa6..bd8bc78a42 100644
--- a/src/lib/jobs/lienReleaseRunIo.ts
+++ b/src/lib/jobs/lienReleaseRunIo.ts
@@ -64,12 +64,35 @@ export type ReleaseFactsRow = { releaseId: string; fields: unknown }
export type ReleaseFactsOutcome = { releaseId: string; ok: boolean; why: string | null }
-/** Keep one change on each release, past a row that fails. */
+/** A release as the database holds it now. */
+type FreshRelease = { id: string; voided_at: string | null; fields: unknown }
+
+/**
+ * Keep one change on each release, past a row that fails. Every release is read fresh first, in one read (finding
+ * 819, v2.9239): a release keeps all its facts in one JSON column, and the change used to go over the copy the screen
+ * read when it drew, so a fact kept on another screen in the meantime was written over. A row's own `fields` is no
+ * longer written. A release voided in the meantime takes no change and says so, and a read that fails holds every
+ * row with its reason.
+ */
export async function keepReleaseFacts(rows: ReadonlyArray, change: ReleaseFactsChange): Promise {
const out: ReleaseFactsOutcome[] = []
+ if (rows.length === 0) return out
+ const fresh = new Map()
+ let unread: string | null = null
+ try {
+ const read = await withSupabaseRetry(() => supabase.from('job_lien_filings').select('id, voided_at, fields').in('id', rows.map((r) => r.releaseId)), 'lien releases: read the releases before a change')
+ for (const r of (read ?? []) as unknown as FreshRelease[]) fresh.set(r.id, r)
+ } catch (e) {
+ unread = formatErrorMessage(e, RELEASE_RUN_WORDS.failed)
+ }
for (const row of rows) {
+ const now = fresh.get(row.releaseId)
+ if (unread || !now || now.voided_at) {
+ out.push({ releaseId: row.releaseId, ok: false, why: unread ?? RELEASE_RUN_WORDS.gone })
+ continue
+ }
try {
- await withSupabaseRetry(() => supabase.from('job_lien_filings').update({ fields: releaseFactsPatch(row.fields, change) } as never).eq('id', row.releaseId), 'lien releases: keep a release’s facts')
+ await withSupabaseRetry(() => supabase.from('job_lien_filings').update({ fields: releaseFactsPatch(now.fields, change) } as never).eq('id', row.releaseId), 'lien releases: keep a release’s facts')
out.push({ releaseId: row.releaseId, ok: true, why: null })
} catch (e) {
out.push({ releaseId: row.releaseId, ok: false, why: formatErrorMessage(e, RELEASE_RUN_WORDS.failed) })
diff --git a/to-dos/lien-release-road-faults/README.md b/to-dos/lien-release-road-faults/README.md
index b6e38f6104..ee2eb4719a 100644
--- a/to-dos/lien-release-road-faults/README.md
+++ b/to-dos/lien-release-road-faults/README.md
@@ -2,7 +2,7 @@
name: "The release road: every fault found on the way to releasing a paid lien, and the ones left to mend"
number: 479
group: ready
-status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 10 is built in the tab (v2.9229) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 8, 9, 11 and 14 are left, with the second half of step 10
+status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 10 is built (v2.9229, v2.9239) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 8, 9, 11 and 14 are left
summary: >
The owner asked for help releasing a paid lien and printing its release, and for every bug on
the way. One thread read the road in the code and found fourteen faults, findings 808 to 821.
@@ -65,7 +65,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 816 | Voiding a filed affidavit that has a release leaves the release with no lien. Payoffs, the Board and the tab offer a second release, and the head still says released. Under **Filings on this job** a release's line names no lien, number or day, so two cannot be told apart. A release the county recorded voids with the same two presses and no words. | read, its line seen | Not started. Step 7. |
| 817 | Around the reload after **Save release record** a second release row can be written. Nothing in the database ties one release to one lien. A reload that fails draws *No recorded lien on this job*. | plausible | Not started. Step 8. |
| 818 | The desk's path is never told that a release waits on a check. It says *Paid — file the release of record.* with **File the release ›** while the tab's presses are dead. The Board keeps one chip a job in a bin. So on a job with two liens **Make N release ›** can leave one out. | read | Not started. Step 9. |
-| 819 | Keeping the instrument number writes every kept fact of the release back from the window's copy. A fact another screen wrote in the meantime is lost. That can be the notary's day, the copies' day or the mark of a check that came back. | plausible | Mended in the tab by v2.9229, step 10: the stamp's write reads the row fresh. The day's run and Payoffs still write from their own copy (`keepReleaseFacts`). |
+| 819 | Keeping the instrument number writes every kept fact of the release back from the window's copy. A fact another screen wrote in the meantime is lost. That can be the notary's day, the copies' day or the mark of a check that came back. | plausible | Mended, v2.9229 and v2.9239, step 10. The tab's writes read the row fresh. The day's run, Payoffs and the returned check's mark write through `keepReleaseFacts`, which now reads each release fresh too. |
| 820 | **Go to the affidavit ›** does nothing a person can see when the **Lien affidavit** tab is already picked. It is the same dead press as 804. | read | Not started. Step 11. |
| 821 | The stamp box says the stamped copy is saved on the release's line. That line takes a typed Drive link only. The scan press is drawn for a filed affidavit alone. | read | Built, v2.9232. The release's line draws **Upload the scanned PDF**. Step 12. |
@@ -136,8 +136,9 @@ Lien desk lane's note of run 17 and are not on this card.
ties one live release to one lien. This step is a migration and owes a push.
9. **The desk's path knows the wait, and one chip a lien (S). 818.** Built after card #477, since
that card changes what opens the presses.
-10. **Built in the tab, v2.9229. Keeping one fact writes one fact (S). 819.** The write reads the row fresh, or merges in the
- database. If it merges in the database it owes a push.
+10. **Built, v2.9229 and v2.9239. Keeping one fact writes one fact (S). 819.** Every writer reads the row fresh: the
+ tab (v2.9229), and the run, Payoffs and the returned check's mark through `keepReleaseFacts`
+ (v2.9239). No merge in the database was needed, so nothing owes a push.
11. **Go to the affidavit › lands on the work (XS). 820.** The pattern of #10636.
12. **Built, v2.9232. The release's line takes a scan (S). 821.** The saved copy's editor on a release's line has
**Upload the scanned PDF**. The scan is named as a release in the job's folder.
From 747ed17ea8291e1586e5b6ab6822a2ec81e998dd Mon Sep 17 00:00:00 2001
From: Robert Douglas <57234112+realrobertdouglas@users.noreply.github.com>
Date: Wed, 2 Dec 2026 15:15:42 -0600
Subject: [PATCH 15/21] =?UTF-8?q?v2.9240=20=E2=80=94=20Release=20of=20reco?=
=?UTF-8?q?rd:=20a=20lien=20takes=20one=20release,=20whatever=20the=20wind?=
=?UTF-8?q?ow=20shows=20(finding=20817,=20punch=20list=20#479=20step=208)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The save takes one press at a time and asks the database for a live release of the lien before it inserts. A partial
unique index holds the same rule in the database (migration 20261202211100, one push owed after the merge). A reload
of the window's lien records that fails keeps what the window holds.
Co-Authored-By: Claude Fable 5.2
---
docs/LIEN_DESK_ARCHITECTURE.md | 2 +
.../20261202211100_one_live_release_a_lien.md | 16 +++++
docs/recent-features/v2.9240.md | 34 +++++++++++
.../LienFilingTabs.release.render.test.tsx | 60 ++++++++++++++++++-
src/components/jobs/LienFilingTabs.tsx | 34 ++++++++++-
src/components/jobs/LienInstrumentsModal.tsx | 11 ++--
src/content/releaseNotes/v2.9240.ts | 15 +++++
src/lib/jobs/lienReleaseOfRecord.test.ts | 26 +++++++-
src/lib/jobs/lienReleaseOfRecord.ts | 12 ++++
src/lib/jobs/lienWindowNextStep.ts | 3 +
...20261202211100_one_live_release_a_lien.sql | 17 ++++++
to-dos/lien-release-road-faults/README.md | 10 ++--
12 files changed, 225 insertions(+), 15 deletions(-)
create mode 100644 docs/migrations/20261202211100_one_live_release_a_lien.md
create mode 100644 docs/recent-features/v2.9240.md
create mode 100644 src/content/releaseNotes/v2.9240.ts
create mode 100644 supabase/migrations/20261202211100_one_live_release_a_lien.sql
diff --git a/docs/LIEN_DESK_ARCHITECTURE.md b/docs/LIEN_DESK_ARCHITECTURE.md
index 17eac6c4a9..f94531e2f3 100644
--- a/docs/LIEN_DESK_ARCHITECTURE.md
+++ b/docs/LIEN_DESK_ARCHITECTURE.md
@@ -751,6 +751,8 @@ last_updated: 2026-12-02
> **v2.9238 (the paper as last printed):** `releaseFactsPatch` keeps the nine paper facts under `fields.printedPaper` whenever it sets `printedForNotary`, for the tab, Payoffs and the run alike, and takes it off with the mark.
> `releasePaperChangedSincePrint` compares the row to it, `releaseReprintWords` says what changed and to print again, and `markReleaseOut` marks a second print when the paper changed since the first.
> **v2.9239 (the run and Payoffs read fresh too, the rest of finding 819):** `keepReleaseFacts` reads every release it is handed in one read and builds `releaseFactsPatch` on the facts the database holds, a release voided in the meantime is held with `RELEASE_RUN_WORDS.gone`, and a row's own `fields` is no longer written.
+> **v2.9240 (one live release a lien, finding 817):** `recordRelease` takes one save at a time and asks the database for a live `release_of_record` row whose `fields ->> 'releasesFilingId'` is this lien before it inserts, and migration `20261202211100` holds the same rule as the partial unique index `job_lien_filings_one_live_release_idx`.
+> `isOneLiveReleaseRefusal` reads the index's refusal by its name, and `loadFilings` in `LienInstrumentsModal` keeps the records it holds when a reload fails.
> **v2.9190 (a door names its lien, findings 808 and 813):** `pickReleaseTarget` takes a third value, the lien the door named, read after the lien the tab holds and before the rule.
> The doors are a lien's row in Payoffs and a release's line on the day's run: each `onOpenRelease` hands the job and its `affidavitId`, `LienDeskPage` keeps it as `releaseLienId` on the window it opens, and `LienInstrumentsModal` hands it to `LienFilingTabs`.
> The tab holds the lien it stands on: an effect writes the picked lien's id into `releaseTargetId`, so a release the county has just recorded no longer hands the tab to the job's other lien.
diff --git a/docs/migrations/20261202211100_one_live_release_a_lien.md b/docs/migrations/20261202211100_one_live_release_a_lien.md
new file mode 100644
index 0000000000..e67a96e81d
--- /dev/null
+++ b/docs/migrations/20261202211100_one_live_release_a_lien.md
@@ -0,0 +1,16 @@
+# 20261202211100_one_live_release_a_lien.sql (2026-12-02, v2.9240)
+
+One live release a lien: step 8 of punch list #479 (the release road's faults), finding 817.
+
+A release of record names the affidavit it releases in `fields ->> 'releasesFilingId'`. Nothing in the database tied one release to one lien, so two saves around the Lien window's reload, or two windows, could each write a row. The migration adds one partial unique index, `job_lien_filings_one_live_release_idx`, on that key over rows where `kind = 'release_of_record'`, `voided_at IS NULL` and the key is present and not empty.
+
+- A voided release does not count, so a release made again after a void is taken.
+- A release from before the key was kept is left out.
+- Putting a voided release back while another is live is refused. That is the rule working. The dev's **Put back** shows the database's own words for it.
+- The client reads the refusal by the index's name (`ONE_LIVE_RELEASE_INDEX` in `src/lib/jobs/lienReleaseOfRecord.ts`). Rename one and rename the other.
+
+**Order.** The client ships first and is whole without the index: it asks the database for a live release before it saves. Push after the merge, in a quiet moment. The build takes a brief lock on `job_lien_filings`, a small table, under `lock_timeout = '3s'`.
+
+**If the push fails** with *could not create unique index … is duplicated*, two live releases already name one lien. Nothing was changed. Void the extra one in the app and push again. A read of prod on 2026-12-02 found three live releases on three liens and no duplicate.
+
+**Proved** on a throwaway local Postgres 15 with a stub table, since Docker was not running for the SQL beds: applied twice, nine checks (a second live release refused by name, another lien taken, a release after a void taken, a put-back beside a live one refused, rows with no key or an empty key left out, another kind of paper not held, a fact kept on the live release taken, a release re-pointed at a released lien refused), and a table that already held a duplicate, where the build failed and changed nothing. The stub is not the app's schema and Postgres 15 is not the app's 17, so the dry run at the push still counts.
diff --git a/docs/recent-features/v2.9240.md b/docs/recent-features/v2.9240.md
new file mode 100644
index 0000000000..81cad774df
--- /dev/null
+++ b/docs/recent-features/v2.9240.md
@@ -0,0 +1,34 @@
+# v2.9240 — Release of record: a lien takes one release, whatever the window shows (2026-12-02)
+
+Step 8 of punch list #479 (the release road's faults), finding 817. **Owes prod one `supabase db push`** after the merge: migration `20261202211100_one_live_release_a_lien.sql`. Stacked on v2.9239, which changes the same card.
+
+## What was wrong
+
+- The tab drew **Save release record** from the window's own list of the job's lien records. Around the reload after a save, or in a second window, the list could be old, and a second release row was written for the same lien. Nothing in the database tied one release to one lien.
+- `loadFilings` in the Lien window ignored a failed read and drew an empty list. A lien with a saved release then read *No recorded lien on this job*.
+
+## What changed
+
+- [`LienFilingTabs.tsx`](../../src/components/jobs/LienFilingTabs.tsx): `recordRelease` takes one save at a time and first asks the database for a live release that names this lien. If one is there it saves nothing, says *This lien already has a saved release. It is shown now.* and reads the job again.
+- The migration adds a partial unique index on `fields ->> 'releasesFilingId'` over live releases. `isOneLiveReleaseRefusal` reads its refusal by the index's name, and the save answers with the same sentence.
+- [`LienInstrumentsModal.tsx`](../../src/components/jobs/LienInstrumentsModal.tsx): a reload of the lien records that fails keeps what the window holds and says so (`LIEN_WINDOW_FILINGS_UNREAD`).
+- [`docs/migrations/20261202211100_one_live_release_a_lien.md`](../migrations/20261202211100_one_live_release_a_lien.md) has the order, the proof and what a failed push means.
+
+## Order on prod
+
+- The client is whole without the index, so it ships first. The push comes after the merge, with the push slot.
+- A read of prod on 2026-12-02 found three live releases on three liens and no duplicate, so the index builds today.
+
+## Not in this change
+
+- The dev's **Put back** on a voided release beside a live one. The database now refuses it in its own words. A sentence of the app's own is a later step if it is ever met.
+
+## Tests
+
+- `lienReleaseOfRecord.test.ts`: the refusal is known by its code and the index's name, and the test reads the migration for that name.
+- `LienFilingTabs.release.render.test.tsx`: the save's look and what it asks, nothing saved when one is there, one save from two fast presses, the database's refusal read as the same sentence.
+- The SQL was proved on a throwaway local Postgres 15, applied twice, nine checks and a table that already held a duplicate. Docker was not running for the SQL beds.
+
+## Look owed
+
+- After the push, a ZZ Test look with the live-write slot: on the ZZ Test job save a release, then try a second save from a second window opened before the first save. See the sentence and one release row. Void it as the earlier walk did.
diff --git a/src/components/jobs/LienFilingTabs.release.render.test.tsx b/src/components/jobs/LienFilingTabs.release.render.test.tsx
index 621d8af76f..e091ca32c8 100644
--- a/src/components/jobs/LienFilingTabs.release.render.test.tsx
+++ b/src/components/jobs/LienFilingTabs.release.render.test.tsx
@@ -20,7 +20,9 @@ vi.mock('../../hooks/useBankChecks', () => ({
},
}))
-const writes = vi.hoisted(() => ({ inserts: [] as Array>, updates: [] as Array<{ patch: Record; id: string }> }))
+const writes = vi.hoisted(() => ({ inserts: [] as Array>, updates: [] as Array<{ patch: Record; id: string }>, insertError: null as Record | null }))
+/** The live releases the database holds for the lien a save names (finding 817): what the save's own look finds. */
+const guard = vi.hoisted(() => ({ live: [] as Array<{ id: string }>, asked: [] as Array<[string, unknown]> }))
/** The release row as the database holds it now, for the fresh read a correction makes first (v2.9219). */
const reads = vi.hoisted(() => ({ fresh: null as Record | null, rows: {} as Record> }))
@@ -65,8 +67,22 @@ vi.mock('../../lib/supabase', async () => {
if (table !== 'job_lien_filings') return from(table)
return {
...(from(table) as object),
- select: (cols: string) => (cols === 'id, filed_at, voided_at, fields' ? { eq: (_col: string, id: string) => ({ maybeSingle: () => Promise.resolve({ data: reads.fresh ?? reads.rows[id] ?? null, error: null }) }) } : (from(table) as { select: (c: string) => unknown }).select(cols)),
+ select: (cols: string) => {
+ // The fresh read of one row before a write (v2.9229).
+ if (cols === 'id, filed_at, voided_at, fields') return { eq: (_col: string, id: string) => ({ maybeSingle: () => Promise.resolve({ data: reads.fresh ?? reads.rows[id] ?? null, error: null }) }) }
+ // The save's look for a live release of the lien (v2.9240).
+ if (cols === 'id') {
+ const chain = {
+ eq: (col: string, v: unknown) => (guard.asked.push([col, v]), chain),
+ is: (col: string, v: unknown) => (guard.asked.push([col, v]), chain),
+ limit: () => Promise.resolve({ data: guard.live, error: null }),
+ }
+ return chain
+ }
+ return (from(table) as { select: (c: string) => unknown }).select(cols)
+ },
insert: (row: Record) => {
+ if (writes.insertError) return { select: () => ({ single: () => Promise.resolve({ data: null, error: writes.insertError }) }) }
writes.inserts.push(row)
return { select: () => ({ single: () => Promise.resolve({ data: { id: 'new-release' }, error: null }) }) }
},
@@ -88,6 +104,9 @@ afterEach(() => {
auth.role = 'assistant'
writes.inserts.length = 0
writes.updates.length = 0
+ writes.insertError = null
+ guard.live = []
+ guard.asked.length = 0
reads.fresh = null
reads.rows = {}
printer.opens = true
@@ -732,3 +751,40 @@ describe('Release of record: a saved release takes the records’ facts again, a
expect((kept.printedForNotary as Record).at).not.toBe(printedThen.at)
})
})
+
+describe('Release of record: one live release a lien (finding 817, v2.9240)', () => {
+ const save = () => screen.getByRole('button', { name: 'Save release record' })
+
+ it('asks the database for a live release of this lien before it saves, then saves', async () => {
+ draw({ job: paid() })
+ fireEvent.click(save())
+ await waitFor(() => expect(writes.inserts).toHaveLength(1))
+ expect(guard.asked).toEqual([['job_id', 'job-2041'], ['kind', 'release_of_record'], ['voided_at', null], ['fields->>releasesFilingId', 'a1']])
+ })
+
+ it('saves nothing when the database already holds one, says so and reads the job again', async () => {
+ guard.live = [{ id: 'r-other-window' }]
+ const { onChanged } = draw({ job: paid() })
+ fireEvent.click(save())
+ expect(await screen.findByText('This lien already has a saved release. It is shown now.')).toBeTruthy()
+ expect(writes.inserts).toEqual([])
+ expect(onChanged).toHaveBeenCalled()
+ })
+
+ it('takes one save from two fast presses', async () => {
+ draw({ job: paid() })
+ fireEvent.click(save())
+ fireEvent.click(save())
+ await waitFor(() => expect(writes.inserts).toHaveLength(1))
+ await new Promise((r) => setTimeout(r, 20))
+ expect(writes.inserts).toHaveLength(1)
+ })
+
+ it('reads the database’s own refusal of a second release as the same sentence', async () => {
+ writes.insertError = { code: '23505', message: 'duplicate key value violates unique constraint "job_lien_filings_one_live_release_idx"', details: null, hint: null }
+ const { onChanged } = draw({ job: paid() })
+ fireEvent.click(save())
+ expect(await screen.findByText('This lien already has a saved release. It is shown now.')).toBeTruthy()
+ expect(onChanged).toHaveBeenCalled()
+ })
+})
diff --git a/src/components/jobs/LienFilingTabs.tsx b/src/components/jobs/LienFilingTabs.tsx
index 9653d76585..88e55ce8a2 100644
--- a/src/components/jobs/LienFilingTabs.tsx
+++ b/src/components/jobs/LienFilingTabs.tsx
@@ -88,7 +88,7 @@ import { lienTradeWords } from '../../lib/jobs/lienTradeWords'
import { MoneyText } from '../Money'
import { ChangeableValue, ValueLine, ValueLines, ValueSentence, WorkedOutValue } from '../valuesInPlace/ValuesInPlace'
import { plainSentence } from '../../lib/valuesInPlace'
-import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, RELEASE_RECORD_FACT_LABELS, type ReleaseRecordFact, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayKey, releaseSavedHold, releaseSavedPaymentDay, releaseRecordedSentence, releaseSaveFields, releaseStampDayCheck, releaseStampPatch, releaseTargets, releasePaymentDayCheck } from '../../lib/jobs/lienReleaseOfRecord'
+import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, isOneLiveReleaseRefusal, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, RELEASE_RECORD_FACT_LABELS, type ReleaseRecordFact, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayKey, releaseSavedHold, releaseSavedPaymentDay, releaseRecordedSentence, releaseSaveFields, releaseStampDayCheck, releaseStampPatch, releaseTargets, releasePaymentDayCheck } from '../../lib/jobs/lienReleaseOfRecord'
import { payoffNote } from '../../lib/jobs/lienPayoffFields'
import { releaseByNow, releaseFacts, releaseFactsPatch, releasePaperChangedSincePrint } from '../../lib/jobs/lienReleaseFacts'
import { countedLabel } from '../../lib/batchWords'
@@ -830,7 +830,11 @@ export default function LienFilingTabs({
setDocNote('')
onChanged()
} catch (e) {
- showToast(formatErrorMessage(e, 'Could not save the record.'), 'error')
+ // The database's rule refused a second live release for a lien (finding 817, v2.9240): read the job again, so the saved one draws.
+ if (isOneLiveReleaseRefusal(e)) {
+ showToast(RELEASE_OF_RECORD_WORDS.alreadyReleased, 'error')
+ onChanged()
+ } else showToast(formatErrorMessage(e, 'Could not save the record.'), 'error')
} finally {
setBusy(false)
}
@@ -951,10 +955,34 @@ export default function LienFilingTabs({
}, [filedAffidavit, busy, serviceDate, ownerProof, ocProof, isSub, showToast, onChanged])
/** Save the release of the lien the tab is on. It names its affidavit, and a lien that has a release takes no second one. */
- const recordRelease = () => {
+ /** One save at a time (finding 817, v2.9240): a second press while the first is still asking the database does nothing. */
+ const releaseSaving = useRef(false)
+ const recordRelease = async () => {
if (!releaseTarget || releaseTarget.release || releaseGate.hold || releasePaymentDayCheck(releasePaymentDate, todayYmd())) return
// A date before the lien was filed waits for its one answer (v2.9216).
if (releasePaymentDayAsk(releasePaymentDate, releaseTarget.affidavit.filed_at, releaseDayKept === releasePaymentDayKey(releaseTarget.affidavit.id, releasePaymentDate))) return
+ if (releaseSaving.current) return
+ releaseSaving.current = true
+ try {
+ // One live release a lien: asked of the database, since the window's own list can be old or unread.
+ const live = await withSupabaseRetry(
+ () => supabase.from('job_lien_filings').select('id').eq('job_id', job.id).eq('kind', 'release_of_record').is('voided_at', null).eq('fields->>releasesFilingId', releaseTarget.affidavit.id).limit(1),
+ 'save the release: look for one already saved',
+ )
+ if (((live ?? []) as unknown[]).length > 0) {
+ showToast(RELEASE_OF_RECORD_WORDS.alreadyReleased, 'error')
+ onChanged()
+ return
+ }
+ await saveRelease()
+ } catch (e) {
+ showToast(formatErrorMessage(e, 'Could not save the record.'), 'error')
+ } finally {
+ releaseSaving.current = false
+ }
+ }
+ const saveRelease = () => {
+ if (!releaseTarget) return
return insertFiling(
{
kind: 'release_of_record',
diff --git a/src/components/jobs/LienInstrumentsModal.tsx b/src/components/jobs/LienInstrumentsModal.tsx
index a1bc2f988a..203a458dc8 100644
--- a/src/components/jobs/LienInstrumentsModal.tsx
+++ b/src/components/jobs/LienInstrumentsModal.tsx
@@ -60,7 +60,7 @@ import type { LienTimelineCourtesy } from '../../lib/jobs/lienTimeline'
import LienTimelineStrip from './LienTimelineStrip'
import { LienLastWorkDayLine } from './LienLastWorkDayLine'
import { isLienOffice } from '../../lib/jobs/lienDesk'
-import { LIEN_WINDOW_TAB_LABEL, lienWindowNextStep } from '../../lib/jobs/lienWindowNextStep'
+import { LIEN_WINDOW_FILINGS_UNREAD, LIEN_WINDOW_TAB_LABEL, lienWindowNextStep } from '../../lib/jobs/lienWindowNextStep'
import { lienApproverFor } from '../../lib/jobs/lienApprovalWait'
import { LIEN_LAST_WORK_COLUMNS, lienLastWorkFactsOf, type LienLastWorkFacts } from '../../lib/jobs/lienLastWorkJobs'
import LienWindowFoldedSteps from './LienWindowFoldedSteps'
@@ -347,17 +347,20 @@ export default function LienInstrumentsModal({
setFilings([])
return
}
+ // A read that fails keeps the records the window holds (finding 817, v2.9240). It used to draw none, so a lien
+ // with a saved release read as *No recorded lien on this job* and its release could be saved a second time.
try {
- const { data } = await supabase
+ const { data, error } = await supabase
.from('job_lien_filings')
.select('*')
.eq('job_id', job.id)
.order('created_at', { ascending: false })
+ if (error) throw error
setFilings((data ?? []) as JobLienFilingRow[])
} catch {
- setFilings([])
+ showToast(LIEN_WINDOW_FILINGS_UNREAD, 'error')
}
- }, [job?.id])
+ }, [job?.id, showToast])
// The job's property (v2.5832), read first and on its own from the job's row: the kind was the last of five
// reads and came from the opener's copy of the row, so the window drew the residential dates until it landed.
diff --git a/src/content/releaseNotes/v2.9240.ts b/src/content/releaseNotes/v2.9240.ts
new file mode 100644
index 0000000000..2d4dc49e16
--- /dev/null
+++ b/src/content/releaseNotes/v2.9240.ts
@@ -0,0 +1,15 @@
+import type { ReleaseNote } from '../../lib/releaseNotes'
+
+const note: ReleaseNote = {
+ version: 'v2.9240',
+ date: '2026-12-02',
+ title: 'Release of record: a lien takes one release, whatever the window shows',
+ kind: 'fix',
+ highlights: [
+ 'Two fast presses of Save release record, or two open windows, could write two releases for one lien.',
+ 'The save now asks first whether the lien already has a release. If it has, the saved one is shown.',
+ 'A reload of the job’s lien records that fails no longer draws No recorded lien on this job. The window keeps what it holds and says so.',
+ ],
+}
+
+export default note
diff --git a/src/lib/jobs/lienReleaseOfRecord.test.ts b/src/lib/jobs/lienReleaseOfRecord.test.ts
index adbb4b54a7..fa09632760 100644
--- a/src/lib/jobs/lienReleaseOfRecord.test.ts
+++ b/src/lib/jobs/lienReleaseOfRecord.test.ts
@@ -1,10 +1,11 @@
+import { readFileSync } from 'node:fs'
import { describe, expect, it } from 'vitest'
import { plainWordsFailures } from '../plainWords'
import { plainSentence, val } from '../valuesInPlace'
import type { LienPayoffAffidavit, LienPayoffPayment, LienPayoffRelease } from './lienPayoff'
import type { BankCheck } from './checkCleared'
import { releaseFactsPatch } from './lienReleaseFacts'
-import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDay, releaseSavedPaymentDay, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayCheck, releasePaymentDayKey, releaseRecordedSentence, releaseSaveFields, releaseSavedHold, releaseStampDayCheck, releaseStampPatch, releaseTargets, releaseWaitsOnCheck } from './lienReleaseOfRecord'
+import { ONE_LIVE_RELEASE_INDEX, RELEASE_OF_RECORD_WORDS, canReleaseAnyway, isOneLiveReleaseRefusal, pickReleaseTarget, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDay, releaseSavedPaymentDay, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayCheck, releasePaymentDayKey, releaseRecordedSentence, releaseSaveFields, releaseSavedHold, releaseStampDayCheck, releaseStampPatch, releaseTargets, releaseWaitsOnCheck } from './lienReleaseOfRecord'
// Every job, instrument and amount here is made up.
const TODAY = '2026-11-24'
@@ -458,3 +459,26 @@ describe('a saved release takes the records’ facts again, and says when it cha
expect(plainWordsFailures(plainSentence(releaseReprintWords(corrected) ?? ''))).toEqual([])
})
})
+
+describe('one live release a lien: the database’s refusal (finding 817, v2.9240)', () => {
+ it('knows the rule’s own refusal by its code and the index’s name', () => {
+ expect(isOneLiveReleaseRefusal({ code: '23505', message: `duplicate key value violates unique constraint "${ONE_LIVE_RELEASE_INDEX}"` })).toBe(true)
+ expect(isOneLiveReleaseRefusal({ code: '23505', message: 'duplicate key', details: `Key ... ${ONE_LIVE_RELEASE_INDEX}` })).toBe(true)
+ })
+
+ it('is not any other refusal', () => {
+ expect(isOneLiveReleaseRefusal({ code: '23505', message: 'duplicate key value violates unique constraint "job_lien_filings_pkey"' })).toBe(false)
+ expect(isOneLiveReleaseRefusal({ code: '42501', message: ONE_LIVE_RELEASE_INDEX })).toBe(false)
+ expect(isOneLiveReleaseRefusal(null)).toBe(false)
+ expect(isOneLiveReleaseRefusal('x')).toBe(false)
+ })
+
+ it('carries the name the migration gives the index, and says it in plain words', () => {
+ expect(ONE_LIVE_RELEASE_INDEX).toBe('job_lien_filings_one_live_release_idx')
+ const sql = readFileSync('supabase/migrations/20261202211100_one_live_release_a_lien.sql', 'utf8')
+ expect(sql).toContain(`CREATE UNIQUE INDEX IF NOT EXISTS ${ONE_LIVE_RELEASE_INDEX}`)
+ expect(sql).toContain("(fields ->> 'releasesFilingId')")
+ expect(sql).toContain('voided_at IS NULL')
+ expect(plainWordsFailures(RELEASE_OF_RECORD_WORDS.alreadyReleased)).toEqual([])
+ })
+})
diff --git a/src/lib/jobs/lienReleaseOfRecord.ts b/src/lib/jobs/lienReleaseOfRecord.ts
index b7c9ea85a7..c6403f5109 100644
--- a/src/lib/jobs/lienReleaseOfRecord.ts
+++ b/src/lib/jobs/lienReleaseOfRecord.ts
@@ -77,6 +77,8 @@ export const RELEASE_OF_RECORD_WORDS = {
payDayLabel: 'Payment / satisfaction date',
paperHint: 'You can correct this date until the county records the release.',
paperCorrected: 'The release has the new payment date.',
+ /** One live release a lien (finding 817, v2.9240): the save found one already there. */
+ alreadyReleased: 'This lien already has a saved release. It is shown now.',
/** A saved release takes the records' facts again, and says when it changed after its print (v2.9238). */
recordSays: 'the record says',
recordBlank: 'blank on the paper',
@@ -318,6 +320,16 @@ export function releasePaymentDatePatch(fields: unknown, day: string): Record> 'releasesFilingId'. Nothing tied one release to
+-- one lien: two presses of Save release record around the window's reload, or two windows, could each write a row.
+-- The index refuses the second live row for the same affidavit. A voided release does not count, so a release made
+-- again after a void is taken. A release from before the key was kept (no releasesFilingId) is left out.
+--
+-- The build reads a small table once. It fails, and changes nothing, if two live releases already name one lien:
+-- void the extra one in the app, then push again.
+CREATE UNIQUE INDEX IF NOT EXISTS job_lien_filings_one_live_release_idx
+ ON public.job_lien_filings ((fields ->> 'releasesFilingId'))
+ WHERE kind = 'release_of_record'
+ AND voided_at IS NULL
+ AND (fields ->> 'releasesFilingId') IS NOT NULL
+ AND (fields ->> 'releasesFilingId') <> '';
diff --git a/to-dos/lien-release-road-faults/README.md b/to-dos/lien-release-road-faults/README.md
index ee2eb4719a..daf3cb96d7 100644
--- a/to-dos/lien-release-road-faults/README.md
+++ b/to-dos/lien-release-road-faults/README.md
@@ -2,7 +2,7 @@
name: "The release road: every fault found on the way to releasing a paid lien, and the ones left to mend"
number: 479
group: ready
-status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 10 is built (v2.9229, v2.9239) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 8, 9, 11 and 14 are left
+status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 9, 11 and 14 are left
summary: >
The owner asked for help releasing a paid lien and printing its release, and for every bug on
the way. One thread read the road in the code and found fourteen faults, findings 808 to 821.
@@ -15,7 +15,7 @@ summary: >
next: Step 2, finding 809. A release that is only saved stops reading Released, and one reading says where a release stands.
ask: owner · decide · A look at one drawing, still to be made. The window that refuses the void of an affidavit with a live release, and where its Take me there press lands.
size: L as a train of fourteen (M · M · S · S · S · S · M · M · S · S · XS · S · S · S); left: steps 2 and 4 to 14
-blocker: Steps 2, 4 to 6 and 10 to 14 have none. Step 7 waits on the owner's look at its drawing. Step 8 owes a migration. Step 9 is built after card #477.
+blocker: Steps 2, 4 to 6 and 10 to 14 have none. Step 7 waits on the owner's look at its drawing. Step 8 is built and owes one push after its merge. Step 9 is built after card #477.
opinion: build — step 2 next. With step 1 it is the pair that can mislead on a real lien, and a release cannot be taken back once the county records it.
mockup: not required — each step mends a press, a line or a guard on a screen that is already drawn. A step that redraws a screen draws it then.
---
@@ -63,7 +63,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 814 | A release is saved and the county has not recorded it. The job's bills owe again. The tab still says *Sign it before a notary. Then record it at the county.* Its print is live. Payoffs and the day's run hold the same release. | read | Mended by v2.9222, step 5: the tab reads the same hold, its two presses wait and the reason stands under them. |
| 815 | **Download PDF** files no copy. Neither press marks the release as printed for the notary. When a check then comes back, the app says no release has left the office. The day's run prints it again. | read | Mended by v2.9224, step 6: a download files a copy, and the tab's print or download marks a saved release as printed for the notary. |
| 816 | Voiding a filed affidavit that has a release leaves the release with no lien. Payoffs, the Board and the tab offer a second release, and the head still says released. Under **Filings on this job** a release's line names no lien, number or day, so two cannot be told apart. A release the county recorded voids with the same two presses and no words. | read, its line seen | Not started. Step 7. |
-| 817 | Around the reload after **Save release record** a second release row can be written. Nothing in the database ties one release to one lien. A reload that fails draws *No recorded lien on this job*. | plausible | Not started. Step 8. |
+| 817 | Around the reload after **Save release record** a second release row can be written. Nothing in the database ties one release to one lien. A reload that fails draws *No recorded lien on this job*. | plausible | Built, v2.9240, step 8. The save asks the database first, and a partial unique index holds the rule. It owes one push after its merge. |
| 818 | The desk's path is never told that a release waits on a check. It says *Paid — file the release of record.* with **File the release ›** while the tab's presses are dead. The Board keeps one chip a job in a bin. So on a job with two liens **Make N release ›** can leave one out. | read | Not started. Step 9. |
| 819 | Keeping the instrument number writes every kept fact of the release back from the window's copy. A fact another screen wrote in the meantime is lost. That can be the notary's day, the copies' day or the mark of a check that came back. | plausible | Mended, v2.9229 and v2.9239, step 10. The tab's writes read the row fresh. The day's run, Payoffs and the returned check's mark write through `keepReleaseFacts`, which now reads each release fresh too. |
| 820 | **Go to the affidavit ›** does nothing a person can see when the **Lien affidavit** tab is already picked. It is the same dead press as 804. | read | Not started. Step 11. |
@@ -132,8 +132,8 @@ Lien desk lane's note of run 17 and are not on this card.
looks at the drawing before this half is built. The other half does not wait: a release's line
under **Filings on this job** names its lien, its number and its day, and voiding a release
the county recorded takes words.
-8. **One release a lien (M). 817.** The save is guarded in the client. A rule in the database
- ties one live release to one lien. This step is a migration and owes a push.
+8. **Built, v2.9240. One release a lien (M). 817.** The save is guarded in the client. A rule in the database
+ ties one live release to one lien. This step is a migration and owes a push after its merge.
9. **The desk's path knows the wait, and one chip a lien (S). 818.** Built after card #477, since
that card changes what opens the presses.
10. **Built, v2.9229 and v2.9239. Keeping one fact writes one fact (S). 819.** Every writer reads the row fresh: the
From f673f0a8b8e074ea94b81774a51fe864939ba6f2 Mon Sep 17 00:00:00 2001
From: Robert Douglas <57234112+realrobertdouglas@users.noreply.github.com>
Date: Wed, 2 Dec 2026 16:05:01 -0600
Subject: [PATCH 16/21] chore(edge-kernels): regenerate the copy after the
release scan's names (v2.9232)
lienScanFile.ts gained the release's scan name and words in this PR and the copy
under supabase/functions/_shared/gcKernels was not regenerated, so the copy's test
failed here and in every PR stacked above.
Co-Authored-By: Claude Fable 5.2
---
.../gcKernels/lib/jobs/lienScanFile.ts | 25 +++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/supabase/functions/_shared/gcKernels/lib/jobs/lienScanFile.ts b/supabase/functions/_shared/gcKernels/lib/jobs/lienScanFile.ts
index ba95ef0645..71686ac29b 100644
--- a/supabase/functions/_shared/gcKernels/lib/jobs/lienScanFile.ts
+++ b/supabase/functions/_shared/gcKernels/lib/jobs/lienScanFile.ts
@@ -24,8 +24,8 @@ export function lienScanIsPdf(file: Pick): bo
return file.type === 'application/pdf' || /\.pdf$/i.test(file.name)
}
-/** Why a file cannot be added, in sentences, or null when it can. `paper` is the one to scan alone: *notice*, *affidavit*. */
-export function lienScanProblem(file: LienScanFileLike, paper: 'notice' | 'affidavit'): string | null {
+/** Why a file cannot be added, in sentences, or null when it can. `paper` is the one to scan alone: *notice*, *affidavit*, *release*. */
+export function lienScanProblem(file: LienScanFileLike, paper: 'notice' | 'affidavit' | 'release'): string | null {
if (!lienScanIsPdf(file) && !file.type.startsWith('image/')) return 'That file is not a scan or a photo. Add a PDF or a picture.'
if (file.size <= 0) return 'That file is empty. Scan the papers again.'
if (addFileTooBig(file.size)) return `That file is ${addFileSizeWords(file.size)}. The most a file can be is ${addFileSizeWords(ADD_FILE_MAX_BYTES)}. Scan this ${paper} alone, or at a lower quality.`
@@ -55,6 +55,19 @@ export function lienFiledScanName(jobNumber: string, ymd: string, file: Pick): string {
+ const job = jobNumber.trim() ? `Job ${jobNumber.trim()}, ` : ''
+ const day = ymd.trim() ? `, ${ymd.trim()}` : ''
+ return `Lien release, ${job}${LIEN_RELEASE_SCAN_NOTE}${day}.${lienScanExtension(file)}`
+}
+
/** The press's words. Each sentence is one idea, as a first-timer reads it. */
export const LIEN_FILED_SCAN_WORDS = {
press: 'Upload the scanned PDF',
@@ -64,3 +77,11 @@ export const LIEN_FILED_SCAN_WORDS = {
title: 'Pick the scan of the stamped affidavit from this computer. It goes in the job’s Drive folder, under Sent by us.',
failed: 'The file was not added. Nothing was saved.',
} as const
+
+/** The same press on a release's line (finding 821, v2.9232): only the paper it names differs. */
+export const LIEN_RELEASE_SCAN_WORDS = {
+ ...LIEN_FILED_SCAN_WORDS,
+ title: 'Pick the scan of the stamped release from this computer. It goes in the job’s Drive folder, under Sent by us.',
+ kept: 'Scan saved as the release’s saved copy.',
+ linkFailed: 'The scan is in the job’s Drive folder, but its link was not saved on the release.',
+} as const
From 2415e42f453392faa73b453f45a9cf04180ffdac Mon Sep 17 00:00:00 2001
From: Robert Douglas <57234112+realrobertdouglas@users.noreply.github.com>
Date: Wed, 2 Dec 2026 16:05:43 -0600
Subject: [PATCH 17/21] test(sql-beds): the early-on-check bed's releases each
name a lien of their own
The bed saved twenty-one releases on one made-up lien to ask who may save one and
with which reason. The one-live-release index this PR adds refuses the second.
The trigger does not read the lien by that id, so each release now names a
made-up lien of its own and the bed asks what it asked before.
Co-Authored-By: Claude Fable 5.2
---
.../tests/lien_early_on_check/20_scenario.sql | 45 ++++++++++---------
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/supabase/tests/lien_early_on_check/20_scenario.sql b/supabase/tests/lien_early_on_check/20_scenario.sql
index cdd1306e29..6b48b838c8 100644
--- a/supabase/tests/lien_early_on_check/20_scenario.sql
+++ b/supabase/tests/lien_early_on_check/20_scenario.sql
@@ -11,6 +11,9 @@
\set ON_ERROR_STOP 1
BEGIN;
+-- Since 20261202211100 a lien holds one live release (job_lien_filings_one_live_release_idx). This bed asks who may
+-- save a release and with which reason, not which lien it releases, and the trigger does not read the lien by that
+-- id. So each release this scenario saves names a made-up lien of its own, 437901 upward, and none meets the index.
CREATE SCHEMA leo;
CREATE FUNCTION leo.same(label text, got text, want text) RETURNS void LANGUAGE plpgsql AS $$
BEGIN
@@ -91,8 +94,8 @@ SET LOCAL ROLE authenticated;
-- ── dev ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d1');
-SELECT leo.same('dev: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d1')$q$), 'allowed 1');
-SELECT leo.same('dev: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d1')$q$), 'allowed 1');
+SELECT leo.same('dev: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437901","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d1')$q$), 'allowed 1');
+SELECT leo.same('dev: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437902","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d1')$q$), 'allowed 1');
SELECT leo.same('dev: the bank confirmed the funds, set on a lien', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d1","name":"Early dev","at":"2026-11-27T16:00:00.000Z","note":"set by dev"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 1');
SELECT leo.same('dev: a confirmation changed', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by dev"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 1');
RESET ROLE;
@@ -102,8 +105,8 @@ SELECT leo.same('dev: a confirmation taken off', leo.answer($q$UPDATE public.job
-- ── master_technician ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d2');
-SELECT leo.same('master_technician: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d2')$q$), 'allowed 1');
-SELECT leo.same('master_technician: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d2')$q$), 'allowed 1');
+SELECT leo.same('master_technician: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437903","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d2')$q$), 'allowed 1');
+SELECT leo.same('master_technician: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437904","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d2')$q$), 'allowed 1');
SELECT leo.same('master_technician: the bank confirmed the funds, set on a lien', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d2","name":"Early master_technician","at":"2026-11-27T16:00:00.000Z","note":"set by master_technician"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 1');
SELECT leo.same('master_technician: a confirmation changed', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by master_technician"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 1');
RESET ROLE;
@@ -113,8 +116,8 @@ SELECT leo.same('master_technician: a confirmation taken off', leo.answer($q$UPD
-- ── controller ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d3');
-SELECT leo.same('controller: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d3')$q$), 'allowed 1');
-SELECT leo.same('controller: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d3')$q$), 'allowed 1');
+SELECT leo.same('controller: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437905","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d3')$q$), 'allowed 1');
+SELECT leo.same('controller: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437906","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d3')$q$), 'allowed 1');
SELECT leo.same('controller: the bank confirmed the funds, set on a lien', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d3","name":"Early controller","at":"2026-11-27T16:00:00.000Z","note":"set by controller"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 1');
SELECT leo.same('controller: a confirmation changed', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by controller"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 1');
RESET ROLE;
@@ -124,48 +127,48 @@ SELECT leo.same('controller: a confirmation taken off', leo.answer($q$UPDATE pub
-- ── assistant ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d4');
-SELECT leo.same('assistant: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d4')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
-SELECT leo.same('assistant: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d4')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
+SELECT leo.same('assistant: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437907","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d4')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
+SELECT leo.same('assistant: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437908","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d4')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
SELECT leo.same('assistant: the bank confirmed the funds, set on a lien', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d4","name":"Early assistant","at":"2026-11-27T16:00:00.000Z","note":"set by assistant"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), '42501 Only a leader, a controller or a dev can say the bank confirmed the funds, or take that back.');
SELECT leo.same('assistant: a confirmation changed', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by assistant"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), '42501 Only a leader, a controller or a dev can say the bank confirmed the funds, or take that back.');
SELECT leo.same('assistant: a confirmation taken off', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields - 'fundsConfirmed' WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), '42501 Only a leader, a controller or a dev can say the bank confirmed the funds, or take that back.');
-- ── estimator ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d5');
-SELECT leo.same('estimator: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d5')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
-SELECT leo.same('estimator: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d5')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
+SELECT leo.same('estimator: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437909","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d5')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
+SELECT leo.same('estimator: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437910","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d5')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
SELECT leo.same('estimator: the bank confirmed the funds, set on a lien, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d5","name":"Early estimator","at":"2026-11-27T16:00:00.000Z","note":"set by estimator"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 0');
SELECT leo.same('estimator: a confirmation changed, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by estimator"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
SELECT leo.same('estimator: a confirmation taken off, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields - 'fundsConfirmed' WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
-- ── primary ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d6');
-SELECT leo.same('primary: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d6')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
-SELECT leo.same('primary: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d6')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
+SELECT leo.same('primary: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437911","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d6')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
+SELECT leo.same('primary: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437912","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d6')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
SELECT leo.same('primary: the bank confirmed the funds, set on a lien, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d6","name":"Early primary","at":"2026-11-27T16:00:00.000Z","note":"set by primary"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 0');
SELECT leo.same('primary: a confirmation changed, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by primary"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
SELECT leo.same('primary: a confirmation taken off, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields - 'fundsConfirmed' WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
-- ── superintendent ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d7');
-SELECT leo.same('superintendent: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d7')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
-SELECT leo.same('superintendent: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d7')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
+SELECT leo.same('superintendent: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437913","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d7')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
+SELECT leo.same('superintendent: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437914","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d7')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
SELECT leo.same('superintendent: the bank confirmed the funds, set on a lien, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d7","name":"Early superintendent","at":"2026-11-27T16:00:00.000Z","note":"set by superintendent"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 0');
SELECT leo.same('superintendent: a confirmation changed, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by superintendent"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
SELECT leo.same('superintendent: a confirmation taken off, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields - 'fundsConfirmed' WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
-- ── subcontractor ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d8');
-SELECT leo.same('subcontractor: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d8')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
-SELECT leo.same('subcontractor: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d8')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
+SELECT leo.same('subcontractor: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437915","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d8')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
+SELECT leo.same('subcontractor: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437916","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d8')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
SELECT leo.same('subcontractor: the bank confirmed the funds, set on a lien, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d8","name":"Early subcontractor","at":"2026-11-27T16:00:00.000Z","note":"set by subcontractor"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 0');
SELECT leo.same('subcontractor: a confirmation changed, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by subcontractor"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
SELECT leo.same('subcontractor: a confirmation taken off, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields - 'fundsConfirmed' WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
-- ── helpers ─────────────────────────────────────────────────────────────────────────────────────────
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d9');
-SELECT leo.same('helpers: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d9')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
-SELECT leo.same('helpers: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d9')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
+SELECT leo.same('helpers: a release before the check clears', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437917","releasedBeforeClearedReason":"the builder wired it too"}'::jsonb, '00000000-0000-0000-0000-0000004370d9')$q$), '42501 Only a leader, a controller or a dev can release a lien before its check clears.');
+SELECT leo.same('helpers: a release with money still open', leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437918","releasedUnpaidReason":"the owner asked for it"}'::jsonb, '00000000-0000-0000-0000-0000004370d9')$q$), '42501 Only a leader, a controller or a dev can release a lien with money still open.');
SELECT leo.same('helpers: the bank confirmed the funds, set on a lien, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"00000000-0000-0000-0000-0000004370d9","name":"Early helpers","at":"2026-11-27T16:00:00.000Z","note":"set by helpers"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 0');
SELECT leo.same('helpers: a confirmation changed, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = jsonb_set(fields, '{fundsConfirmed,note}', '"reworded by helpers"') WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
SELECT leo.same('helpers: a confirmation taken off, reaches no row', leo.answer($q$UPDATE public.job_lien_filings SET fields = fields - 'fundsConfirmed' WHERE id = '00000000-0000-0000-0000-000000437c02'$q$), 'allowed 0');
@@ -180,7 +183,7 @@ SELECT leo.same('and the first lien carries none, taken off last by a controller
SET LOCAL ROLE authenticated;
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d4');
SELECT leo.same('an assistant records an ordinary release',
- leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01"}'::jsonb, '00000000-0000-0000-0000-0000004370d4')$q$), 'allowed 1');
+ leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437919"}'::jsonb, '00000000-0000-0000-0000-0000004370d4')$q$), 'allowed 1');
SELECT leo.same('an assistant records a release that rests on a leader''s confirmation',
leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b02', 'release_of_record', 7000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c02","releasedOnConfirmedFunds":{"by":"00000000-0000-0000-0000-0000004370d2","name":"Early master_technician","at":"2026-11-20T15:00:00.000Z","note":"the bank said good funds"}}'::jsonb, '00000000-0000-0000-0000-0000004370d4')$q$), 'allowed 1');
SELECT leo.same('an assistant records a notice and a lien',
@@ -210,7 +213,7 @@ SELECT leo.same('the confirmation outlived the assistant''s other writes, with t
SET LOCAL ROLE authenticated;
SELECT leo.as_user('00000000-0000-0000-0000-0000004370d9');
SELECT leo.same('a helper''s ordinary release is refused by the row policy, as before',
- (leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01"}'::jsonb, '00000000-0000-0000-0000-0000004370d9')$q$) LIKE '42501 new row violates row-level security policy%')::text, 'true');
+ (leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437920"}'::jsonb, '00000000-0000-0000-0000-0000004370d9')$q$) LIKE '42501 new row violates row-level security policy%')::text, 'true');
SELECT leo.same('and a helper reads no filing', (SELECT count(*)::text FROM public.job_lien_filings), '0');
RESET ROLE;
@@ -221,7 +224,7 @@ SELECT leo.same('the service role''s write of a lien''s sends passes, and so doe
leo.answer($q$UPDATE public.job_lien_filings SET sends = '[{"recipient":"owner","method":"certified","tracking":"ZZ1","sent_on":"2026-10-03"}]'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$) || ' ' ||
leo.answer($q$UPDATE public.job_lien_filings SET fields = fields || '{"fundsConfirmed":{"by":"","name":"","at":"2026-11-27T16:30:00.000Z","note":"by the service role"}}'::jsonb WHERE id = '00000000-0000-0000-0000-000000437c01'$q$), 'allowed 1 allowed 1');
SELECT leo.same('the service role''s release with money still open passes too',
- leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437c01","releasedUnpaidReason":"by the service role"}'::jsonb, '00000000-0000-0000-0000-0000004370d2')$q$), 'allowed 1');
+ leo.answer($q$INSERT INTO public.job_lien_filings (job_id, kind, amount, fields, created_by) VALUES ('00000000-0000-0000-0000-000000437b01', 'release_of_record', 5000, '{"releasesFilingId":"00000000-0000-0000-0000-000000437921","releasedUnpaidReason":"by the service role"}'::jsonb, '00000000-0000-0000-0000-0000004370d2')$q$), 'allowed 1');
RESET ROLE;
DO $$ BEGIN RAISE NOTICE 'lien_early_on_check PASSED'; END $$;
From f59c800b75b0cafd3ab2f3c7fc646e1903f5f56b Mon Sep 17 00:00:00 2001
From: Tony
Date: Wed, 2 Dec 2026 20:59:49 -0600
Subject: [PATCH 18/21] docs(to-dos): card #479, its status lines brought
current (steps 2 and 11 are built, step 14 measured)
Co-Authored-By: Claude Fable 5.2
---
to-dos/lien-release-road-faults/README.md | 52 +++++++++++++----------
1 file changed, 29 insertions(+), 23 deletions(-)
diff --git a/to-dos/lien-release-road-faults/README.md b/to-dos/lien-release-road-faults/README.md
index cca2203700..e7c9afe70a 100644
--- a/to-dos/lien-release-road-faults/README.md
+++ b/to-dos/lien-release-road-faults/README.md
@@ -2,7 +2,7 @@
name: "The release road: every fault found on the way to releasing a paid lien, and the ones left to mend"
number: 479
group: ready
-status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · steps 2, 7, 9, 11 and 14 are left
+status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 2 is built (v2.9195) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 11 is built (v2.9230) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · step 14 is measured · steps 7 and 9 are left, and the word on step 14
summary: >
The owner asked for help releasing a paid lien and printing its release, and for every bug on
the way. One thread read the road in the code and found fourteen faults, findings 808 to 821.
@@ -12,11 +12,11 @@ summary: >
the most serious first. Two can mislead on a real lien today. On a job with two liens the
county's stamp can land on the wrong release. And a release that is only saved already reads
Released.
-next: Step 2, finding 809. A release that is only saved stops reading Released, and one reading says where a release stands.
-ask: owner · decide · A look at one drawing, still to be made. The window that refuses the void of an affidavit with a live release, and where its Take me there press lands.
-size: L as a train of fourteen (M · M · S · S · S · S · M · M · S · S · XS · S · S · S); left: steps 2 and 4 to 14
-blocker: Steps 2, 4 to 6 and 10 to 14 have none. Step 7 waits on the owner's look at its drawing. Step 8 is built and owes one push after its merge. Step 9 is built after card #477.
-opinion: build — step 2 next. With step 1 it is the pair that can mislead on a real lien, and a release cannot be taken back once the county records it.
+next: Step 7, finding 816. A release's line names its lien, its number and its day. The void of an affidavit with a live release is refused by the window as drawn.
+ask: owner · look · A look at the refused void on a ZZ Test lien once step 7 is built: the window, its Take me there press, and the way back to the affidavit.
+size: L as a train of fourteen (M · M · S · S · S · S · M · M · S · S · XS · S · S · S); left: steps 7 and 9
+blocker: Step 7 has none: the owner said *Yes, build it* on its drawing. Step 8 is built and owes one push after its merge. Step 9 is built after card #477. Step 14 is measured, and the measure found nothing of this door's to mend.
+opinion: build — step 7 next. A voided affidavit that leaves its release behind makes the desk offer a second release on the same lien.
mockup: mockup.html — the window that refuses the void of an affidavit with a live release, and where Take me there lands (call 2, step 7). Every other step mends a press, a line or a guard on a screen that is already drawn.
---
@@ -55,7 +55,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| # | What a person sees | Sure | State |
| --- | --- | --- | --- |
| 808 | A job has two filed liens, each with a saved release. **Record the county's stamp ›** on the second lien's Payoffs row opens the tab on the first lien. The day and the number are kept on the wrong release. | read | Built in step 1, v2.9190. Every door from a lien's own row names that lien. |
-| 809 | A release that is only saved reads *Released* in five places. They are the window's head, its suit stop, the stop's window, the desk's path and the Accounts Receivable chip. The day its row was made stands in for the county's day. The tab, Payoffs and the Board still say it waits for the county. The chip also shows the lien's own number as the release's. On a job with two liens, one release makes the whole job read released. | seen | Not started. Step 2. |
+| 809 | A release that is only saved reads *Released* in five places. They are the window's head, its suit stop, the stop's window, the desk's path and the Accounts Receivable chip. The day its row was made stands in for the county's day. The tab, Payoffs and the Board still say it waits for the county. The chip also shows the lien's own number as the release's. On a job with two liens, one release makes the whole job read released. | seen | Built in step 2, v2.9195. One reading says where a release stands, saved or recorded, and the five places read it. |
| 810 | A job has nothing open and no payment. It reads *The bills read paid. The release is owed.* A filed lien whose bill goes back to draft is one such job. The tab then prints a paper that swears payment as of today. | seen | Decided on card #477, call 2. Not built. Not a step here. |
| 811 | **Payment / satisfaction date** is not checked. Cleared, the paper prints *as of —*. A day still to come is taken. A day before the lien was filed is taken. The date is set once, from the window's kept copy of the job. So it can show today while the money line shows the real day. | read | Mended in part by v2.9179 (PR #10639), on `main`. It stops an empty day and a day still to come. The rest is mended by v2.9216, step 3: the date follows the job as it stands, and a day before the lien was filed is asked about once. |
| 812 | A saved release cannot be corrected, and nothing says so. The only way is **Void**, **Confirm void** and making it again. Print needs no save, so a paper printed and signed can differ from the one saved after it. | read | Mended, v2.9219 and v2.9238, step 4. A saved release's payment date is corrected in place until the county's day is kept. It takes the records' facts again on one press. A line says when the paper changed after its print. Left: the run's stage for a release corrected after its print. |
@@ -66,7 +66,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 817 | Around the reload after **Save release record** a second release row can be written. Nothing in the database ties one release to one lien. A reload that fails draws *No recorded lien on this job*. | plausible | Built, v2.9240, step 8. The save asks the database first, and a partial unique index holds the rule. It owes one push after its merge. |
| 818 | The desk's path is never told that a release waits on a check. It says *Paid — file the release of record.* with **File the release ›** while the tab's presses are dead. The Board keeps one chip a job in a bin. So on a job with two liens **Make N release ›** can leave one out. | read | Not started. Step 9. |
| 819 | Keeping the instrument number writes every kept fact of the release back from the window's copy. A fact another screen wrote in the meantime is lost. That can be the notary's day, the copies' day or the mark of a check that came back. | plausible | Mended, v2.9229 and v2.9239, step 10. The tab's writes read the row fresh. The day's run, Payoffs and the returned check's mark write through `keepReleaseFacts`, which now reads each release fresh too. |
-| 820 | **Go to the affidavit ›** does nothing a person can see when the **Lien affidavit** tab is already picked. It is the same dead press as 804. | read | Not started. Step 11. |
+| 820 | **Go to the affidavit ›** does nothing a person can see when the **Lien affidavit** tab is already picked. It is the same dead press as 804. | read | Built in step 11, v2.9230. The press lands on the paper and lights its presses. |
| 821 | The stamp box says the stamped copy is saved on the release's line. That line takes a typed Drive link only. The scan press is drawn for a filed affidavit alone. | read | Built, v2.9232. The release's line draws **Upload the scanned PDF**. Step 12. |
## Found on the same road
@@ -79,7 +79,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 824 | The bin *Paid awaiting release* counts liens. Its press leaves no To do row for a paid lien that owes its release. | seen | Mended, v2.9163 (PR #10623), on `main`. It is step 6 of card #472. |
| 825 | On a job with no property facts, the paper's owner and property description are blank lines. The tab says nothing before **Save release record** takes it. | seen | Built, v2.9234. A line above the presses names each blank and where it is fixed. Step 13. |
| 826 | A lien was filed and then released. It never had a To do row, while the Board and Payoffs showed it. | seen | v2.9163 (PR #10623) added the rows, on `main`. This case is still to check on the live site. |
-| 827 | A link that opens the Lien window on a job took about nine seconds to draw the window. | seen | Not started. Step 14. |
+| 827 | A link that opens the Lien window on a job took about nine seconds to draw the window. | seen | Measured on 2026-12-02. The door costs about a second on a warm load. Step 14. |
Findings 822 and 823 are faults of the desk's Board and To do, not of the road. They are in the
Lien desk lane's note of run 17 and are not on this card.
@@ -88,8 +88,8 @@ Lien desk lane's note of run 17 and are not on this card.
- **Card #477**, [*Lien release: what opens it once a payment is in*](../lien-release-opens-when-funds-land/README.md).
It holds what opens the three presses, the wait on a check, the override and its prompt. It
- also holds 810's mend: a job with no payment stops reading paid. Nothing of it is built: the
- override prompt's mock-up waits for the owner's look.
+ also holds 810's mend: a job with no payment stops reading paid. Nothing of it is built. The
+ owner said *Yes, build it* on the override prompt's mock-up on 2026-12-02.
- **Card #472**, [*Lien desk Board: the flow after a lien is filed*](../lien-desk-board-flow-after-filing/README.md).
Its step 6 is the two To do rows of 824 and 826. Its steps 7 and 8 are the lapsed lien's answer
and the counsel row.
@@ -99,8 +99,8 @@ Lien desk lane's note of run 17 and are not on this card.
- Check **Payment / satisfaction date** before printing. It is the day the paper swears to.
- Print and save the same paper. Save before the paper is signed, and change nothing between.
- A print before the save files a copy on the job. Each print press files another.
-- After **Save release record** the head reads *Released* at once. The county's day is still
- owed in **The county's stamp**.
+- After **Save release record** nothing reads *Released* until the county's day is kept in
+ **The county's stamp** (v2.9195).
## The steps left, one PR each
@@ -109,7 +109,7 @@ Lien desk lane's note of run 17 and are not on this card.
doors are a lien's row in Payoffs and a release's line on the day's run. A door that names no
lien is left to the tab's own rule: the Accounts Receivable chip, a deep link and the head's
step.
-2. **Saved is not released (M). 809.** One reading says where a release stands: saved, or
+2. **Built, v2.9195. Saved is not released (M). 809.** One reading says where a release stands: saved, or
recorded with the county's day. The five places read it. The chip shows the release's own
number. On a job with two liens each lien reads for itself.
3. **Built, v2.9216. The rest of the payment date (S). 811.** The date follows the payment's own day, not the
@@ -129,8 +129,8 @@ Lien desk lane's note of run 17 and are not on this card.
7. **Voids that leave nothing behind (M). 816.** The void of an affidavit with a live release
is refused by a window with a **Take me there** press, which brings the person to the release
and shows where to press (call 2). The window and its flow are drawn in
- [`mockup.html`](mockup.html), *Now* beside the suggestion, and the owner looks at the drawing
- before this half is built. The other half does not wait: a release's line
+ [`mockup.html`](mockup.html), *Now* beside the suggestion. The owner said *Yes, build it* on
+ the drawing on 2026-12-02. Neither half is built yet. The other half: a release's line
under **Filings on this job** names its lien, its number and its day, and voiding a release
the county recorded takes words.
8. **Built, v2.9240. One release a lien (M). 817.** The save is guarded in the client. A rule in the database
@@ -140,13 +140,17 @@ Lien desk lane's note of run 17 and are not on this card.
10. **Built, v2.9229 and v2.9239. Keeping one fact writes one fact (S). 819.** Every writer reads the row fresh: the
tab (v2.9229), and the run, Payoffs and the returned check's mark through `keepReleaseFacts`
(v2.9239). No merge in the database was needed, so nothing owes a push.
-11. **Go to the affidavit › lands on the work (XS). 820.** The pattern of #10636.
+11. **Built, v2.9230. Go to the affidavit › lands on the work (XS). 820.** The pattern of #10636.
12. **Built, v2.9232. The release's line takes a scan (S). 821.** The saved copy's editor on a release's line has
**Upload the scanned PDF**. The scan is named as a release in the job's folder.
13. **Built, v2.9234. Missing property facts are named before the save (S). 825.** A line above the presses names
each fact the paper would print blank. It names and does not hold.
-14. **The slow link (S). 827.** Measure what the nine seconds are first. Then mend what the
- measure shows.
+14. **Measured, 2026-12-02. The slow link (S). 827.** Measure what the nine seconds are first. Then mend what the
+ measure shows. Two warm loads of the link on a ZZ Test job drew the window 2.5 and 1.5 seconds
+ after the load began. The one job's read took between half a second and a second and a half.
+ The window was up at once after it. So the door costs about a second. The nine seconds was a
+ cold load of the Jobs page's scripts, which is the app's own start. The measure shows nothing
+ of this door's to mend. Whether the step closes with no build is asked of the owner.
## The calls, each answered
@@ -201,7 +205,9 @@ files have landed since, and the lines have moved.
## Where it stands
-Written on 2026-12-02 (UTC), brought current at 19:17 UTC the same day. Of the fourteen faults
-of the read, two are built in step 1 (808 and 813, v2.9190), one is mended in part on `main` (811)
-and one is decided on card #477 (810). Of the seven neighbours, five are mended on `main` by four
-PRs, and their looks on the live site are owed. Thirteen steps are left. Step 2 is next.
+Written on 2026-12-02 (UTC), brought current on 2026-12-03 (UTC). Of the fourteen steps, eleven
+are built: 1 to 6, 8, 10, 11, 12 and 13. Step 8 owes one push after its merge. Step 14 is
+measured, and the measure found nothing of this door's to mend. Two steps are left. Step 7 is
+next, both halves: the release's line that names its lien, and the refused void as drawn. Step 9
+is built after card #477. Finding 810 is decided on card #477 and is built with it. The looks on
+the live site are owed for every step.
From 035ad6b2b5d87bcb09d855ac760eac959a5e3cd0 Mon Sep 17 00:00:00 2001
From: Tony
Date: Wed, 2 Dec 2026 21:02:41 -0600
Subject: [PATCH 19/21] =?UTF-8?q?v2.9255=20=E2=80=94=20Release=20of=20reco?=
=?UTF-8?q?rd:=20a=20release's=20line=20names=20its=20lien=20(finding=2081?=
=?UTF-8?q?6,=20punch=20list=20#479=20step=207,=20first=20half)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Claude Fable 5.2
---
docs/LIEN_DESK_ARCHITECTURE.md | 1 +
docs/recent-features/v2.9255.md | 29 ++++++++
.../LienFilingTabs.release.render.test.tsx | 31 ++++++++
src/components/jobs/LienFilingTabs.tsx | 7 ++
.../release-a-filed-lien-after-it-is-paid.md | 2 +
src/content/releaseNotes/v2.9255.ts | 16 +++++
src/lib/jobs/lienReleaseLine.test.ts | 71 +++++++++++++++++++
src/lib/jobs/lienReleaseLine.ts | 51 +++++++++++++
to-dos/lien-release-road-faults/README.md | 16 ++---
9 files changed, 216 insertions(+), 8 deletions(-)
create mode 100644 docs/recent-features/v2.9255.md
create mode 100644 src/content/releaseNotes/v2.9255.ts
create mode 100644 src/lib/jobs/lienReleaseLine.test.ts
create mode 100644 src/lib/jobs/lienReleaseLine.ts
diff --git a/docs/LIEN_DESK_ARCHITECTURE.md b/docs/LIEN_DESK_ARCHITECTURE.md
index faebd5dbcb..9df8ab62a1 100644
--- a/docs/LIEN_DESK_ARCHITECTURE.md
+++ b/docs/LIEN_DESK_ARCHITECTURE.md
@@ -770,6 +770,7 @@ last_updated: 2026-12-02
> **v2.9239 (the run and Payoffs read fresh too, the rest of finding 819):** `keepReleaseFacts` reads every release it is handed in one read and builds `releaseFactsPatch` on the facts the database holds, a release voided in the meantime is held with `RELEASE_RUN_WORDS.gone`, and a row's own `fields` is no longer written.
> **v2.9240 (one live release a lien, finding 817):** `recordRelease` takes one save at a time and asks the database for a live `release_of_record` row whose `fields ->> 'releasesFilingId'` is this lien before it inserts, and migration `20261202211100` holds the same rule as the partial unique index `job_lien_filings_one_live_release_idx`.
> `isOneLiveReleaseRefusal` reads the index's refusal by its name, and `loadFilings` in `LienInstrumentsModal` keeps the records it holds when a reload fails.
+> **v2.9255 (a release's line names its lien, finding 816's first half):** a `release_of_record` row under *Filings on this job* draws `releaseLineWords` (`lienReleaseLine.ts`, `data-lien-release-line`): the lien from `releaseLineLien`, read over every filing on the job with the voided ones, then *saved December 2, 2026 · not yet recorded* or *recorded December 4, 2026 · instrument M* from `releaseOwnInstrument`.
> **v2.9190 (a door names its lien, findings 808 and 813):** `pickReleaseTarget` takes a third value, the lien the door named, read after the lien the tab holds and before the rule.
> The doors are a lien's row in Payoffs and a release's line on the day's run: each `onOpenRelease` hands the job and its `affidavitId`, `LienDeskPage` keeps it as `releaseLienId` on the window it opens, and `LienInstrumentsModal` hands it to `LienFilingTabs`.
> The tab holds the lien it stands on: an effect writes the picked lien's id into `releaseTargetId`, so a release the county has just recorded no longer hands the tab to the job's other lien.
diff --git a/docs/recent-features/v2.9255.md b/docs/recent-features/v2.9255.md
new file mode 100644
index 0000000000..5b88dd18bd
--- /dev/null
+++ b/docs/recent-features/v2.9255.md
@@ -0,0 +1,29 @@
+# v2.9255 — Release of record: a release's line names its lien (2026-12-03)
+
+Step 7 of punch list #479 (the release road's faults), finding 816, the half the card says does not wait. Client only. No migration, no function change, nothing owed on prod. Cut on top of v2.9240 (step 8), which changes the same tab.
+
+## What was wrong
+
+- Under **Filings on this job** a `release_of_record` row drew its kind, *Release of record*, and no fact. An affidavit's line names its filed day, its number and its service.
+- On a job with two liens the two releases could not be told apart. After an affidavit was voided, the release left behind looked like any other.
+
+## What changed
+
+- [`lienReleaseLine.ts`](../../src/lib/jobs/lienReleaseLine.ts), new: `releaseLineLien` reads the lien a release belongs to from every filing on the job, voided ones included. It reads `fields.releasesFilingId` first. A release saved before that key was kept goes to the job's one live filed lien, and to none on a job with two. `releaseLineWords` writes the line: *for instrument N · saved · not yet recorded*, then *recorded December 4, 2026 · instrument M* once the county's day is kept. A lien with no number is named by its filed day. A voided lien reads *which is voided*. A release that names no lien reads *names no lien on this job*.
+- The release's own number is `fields.releaseInstrument` alone, never the lien's number, as `releaseOwnInstrument` reads it (finding 809).
+- [`LienFilingTabs.tsx`](../../src/components/jobs/LienFilingTabs.tsx): the release's row draws the line (`data-lien-release-line`), with the same day words as the affidavit's line.
+- The help guide *release a filed lien after it is paid* says what the line reads.
+
+## Not in this change
+
+- The void of an affidavit with a live release still goes through. The window that refuses it is drawn on the card and is the step's other half.
+- Voiding a release the county recorded still takes two presses and no words.
+
+## Tests
+
+- `lienReleaseLine.test.ts`: the named lien, a voided lien, a release with no key on a job with one lien and with two, a key that points at no row, the saved and the recorded line, a lien with no number, two releases on one job.
+- `LienFilingTabs.release.render.test.tsx`: the line on a saved release and on a recorded one, two releases told apart, a voided lien, and no such line on an affidavit.
+
+## Look owed
+
+- Read only, on the live site: a job with a saved release shows its lien's instrument number and saved day on the release's line under **Filings on this job**. Nothing is pressed.
diff --git a/src/components/jobs/LienFilingTabs.release.render.test.tsx b/src/components/jobs/LienFilingTabs.release.render.test.tsx
index 72a859d6f9..43508b16e5 100644
--- a/src/components/jobs/LienFilingTabs.release.render.test.tsx
+++ b/src/components/jobs/LienFilingTabs.release.render.test.tsx
@@ -796,3 +796,34 @@ describe('Release of record: one live release a lien (finding 817, v2.9240)', ()
expect(onChanged).toHaveBeenCalled()
})
})
+
+describe('Release of record: a release’s line names its lien, its day and where it stands (finding 816, punch list #479 step 7)', () => {
+ const line = (id: string) => document.querySelector(`[data-lien-release-line="${id}"]`)!
+
+ it('names the lien and says the county has not recorded it', () => {
+ draw({ job: paid(), filings: [lien() as never, release() as never] })
+ expect(line('r1').textContent).toBe('for instrument 2026-0412207 · saved November 21, 2026 · not yet recorded')
+ })
+
+ it('names the county’s day and the release’s own number, never the lien’s as its own', () => {
+ draw({ job: paid(), filings: [lien() as never, release({ filed_at: '2026-11-23', fields: { releasesFilingId: 'a1', releaseInstrument: '2026-0431955' } }) as never] })
+ expect(line('r1').textContent).toBe('for instrument 2026-0412207 · recorded November 23, 2026 · instrument 2026-0431955')
+ })
+
+ it('tells the two releases of a job with two liens apart', () => {
+ const second = lien({ id: 'a2', recording_number: '2026-0500001', filed_at: '2026-11-16' })
+ draw({ job: paid(), filings: [lien() as never, second as never, release() as never, release({ id: 'r2', fields: { releasesFilingId: 'a2' } }) as never] })
+ expect(line('r1').textContent).toContain('for instrument 2026-0412207')
+ expect(line('r2').textContent).toContain('for instrument 2026-0500001')
+ })
+
+ it('says its lien is voided when the affidavit under it was voided', () => {
+ draw({ job: paid(), filings: [lien({ voided_at: '2026-11-25T15:00:00Z' }) as never, release() as never] })
+ expect(line('r1').textContent).toBe('for instrument 2026-0412207, which is voided · saved November 21, 2026 · not yet recorded')
+ })
+
+ it('draws no such line on an affidavit', () => {
+ draw({ job: paid(), filings: [lien() as never] })
+ expect(document.querySelector('[data-lien-release-line]')).toBeNull()
+ })
+})
diff --git a/src/components/jobs/LienFilingTabs.tsx b/src/components/jobs/LienFilingTabs.tsx
index 560c542212..0824347762 100644
--- a/src/components/jobs/LienFilingTabs.tsx
+++ b/src/components/jobs/LienFilingTabs.tsx
@@ -89,6 +89,7 @@ import { MoneyText } from '../Money'
import { ChangeableValue, ValueLine, ValueLines, ValueSentence, WorkedOutValue } from '../valuesInPlace/ValuesInPlace'
import { plainSentence } from '../../lib/valuesInPlace'
import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, isOneLiveReleaseRefusal, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, RELEASE_RECORD_FACT_LABELS, type ReleaseRecordFact, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayKey, releaseSavedHold, releaseSavedPaymentDay, releaseRecordedSentence, releaseSaveFields, releaseStampDayCheck, releaseStampPatch, releaseTargets, releasePaymentDayCheck } from '../../lib/jobs/lienReleaseOfRecord'
+import { releaseLineWords } from '../../lib/jobs/lienReleaseLine'
import { payoffNote } from '../../lib/jobs/lienPayoffFields'
import { releaseByNow, releaseFacts, releaseFactsPatch, releasePaperChangedSincePrint } from '../../lib/jobs/lienReleaseFacts'
import { countedLabel } from '../../lib/batchWords'
@@ -1267,6 +1268,12 @@ export default function LienFilingTabs({
{f.kind === 'affidavit' && f.filed_at ? `filed ${demandDate(f.filed_at)} · #${f.recording_number || '—'} · ${f.served_at ? `served ${demandDate(f.served_at)}` : `serve by ${demandDate(f.serve_due ?? '')}`}` : ''}
{f.kind === 'notice_53_056' || f.kind === 'retainage_53_057' ? : ''}
+ {/* A release names its lien, its day and where it stands (finding 816, v2.9255): two on one job are told apart, and one whose lien is voided says so. */}
+ {f.kind === 'release_of_record' ? (
+
+ {releaseLineWords({ fields: f.fields, created_at: f.created_at ?? '', filed_at: f.filed_at }, filings, demandDate)}
+
+ ) : null}
{isLienAppliedRow(f as unknown as LienAppliedRow) ? (
{lienAppliedRowWords(f as unknown as LienAppliedRow, calendarYmdInAppTzFromIso(f.created_at ?? ''))}
diff --git a/src/content/help/release-a-filed-lien-after-it-is-paid.md b/src/content/help/release-a-filed-lien-after-it-is-paid.md
index 75a7e25ef2..c29cdc4e79 100644
--- a/src/content/help/release-a-filed-lien-after-it-is-paid.md
+++ b/src/content/help/release-a-filed-lien-after-it-is-paid.md
@@ -131,6 +131,8 @@ Back on the Lien desk, press {{button:blue|Record the county’s stamp ›}} on
Until that day is kept, nothing reads *Released*. The top of the Lien window says *The release was made* with its day. The job's row in Accounts Receivable reads *Release saved*. The lien stands on the county's record until the county records the release.
+Under **Filings on this job** the release's line names its lien by instrument number. It shows the day the release was saved and says *not yet recorded*. After the county's day is kept it shows that day and the release's own instrument number.
+
The stamped copy goes on the release's line under **Filings on this job**. Press *link the saved copy* there. Then press {{button:outline|Upload the scanned PDF}} and pick the scan from this computer. The scan goes in the job's Drive folder and its link is kept on the line. A Drive link can be pasted there too.
## Print the releases in the run
diff --git a/src/content/releaseNotes/v2.9255.ts b/src/content/releaseNotes/v2.9255.ts
new file mode 100644
index 0000000000..b45998102b
--- /dev/null
+++ b/src/content/releaseNotes/v2.9255.ts
@@ -0,0 +1,16 @@
+import type { ReleaseNote } from '../../lib/releaseNotes'
+
+const note: ReleaseNote = {
+ version: 'v2.9255',
+ date: '2026-12-03',
+ title: 'Release of record: a release’s line names its lien',
+ kind: 'fix',
+ highlights: [
+ 'Under Filings on this job, a release’s line read Release of record and nothing else. Two releases on one job could not be told apart.',
+ 'The line now names the lien by its instrument number, the day the release was saved, and that the county has not recorded it yet.',
+ 'Once the county’s day is kept, the line shows that day and the release’s own instrument number.',
+ 'A release whose lien was voided says so on its line.',
+ ],
+}
+
+export default note
diff --git a/src/lib/jobs/lienReleaseLine.test.ts b/src/lib/jobs/lienReleaseLine.test.ts
new file mode 100644
index 0000000000..5e3b0edd23
--- /dev/null
+++ b/src/lib/jobs/lienReleaseLine.test.ts
@@ -0,0 +1,71 @@
+import { describe, expect, it } from 'vitest'
+import { releaseLineLien, releaseLineWords, type ReleaseLineFiling } from './lienReleaseLine'
+
+// Every id, number and day here is made up.
+const fmt = (ymd: string) => `<${ymd}>`
+const lien = (id: string, over: Partial = {}): ReleaseLineFiling => ({ id, kind: 'affidavit', filed_at: '2026-11-09', recording_number: '2026-0000001', voided_at: null, ...over })
+const release = (fields: Record, filed_at: string | null = null) => ({ fields, created_at: '2026-12-02T18:00:00Z', filed_at })
+
+describe('releaseLineLien', () => {
+ it('reads the lien the release names', () => {
+ const all = [lien('a1'), lien('a2', { recording_number: '2026-0000002', filed_at: '2026-11-20' })]
+ expect(releaseLineLien(release({ releasesFilingId: 'a2' }), all)).toEqual({ how: 'live', instrument: '2026-0000002', filedYmd: '2026-11-20' })
+ })
+
+ it('says when the named lien is voided', () => {
+ const all = [lien('a1', { voided_at: '2026-12-03T00:00:00Z' })]
+ expect(releaseLineLien(release({ releasesFilingId: 'a1' }), all)).toMatchObject({ how: 'voided', instrument: '2026-0000001' })
+ })
+
+ it('gives a release with no key to the job’s one filed lien', () => {
+ expect(releaseLineLien(release({}), [lien('a1')])).toMatchObject({ how: 'live', instrument: '2026-0000001' })
+ })
+
+ it('names no lien for a release with no key on a job with two filed liens', () => {
+ expect(releaseLineLien(release({}), [lien('a1'), lien('a2')])).toEqual({ how: 'none' })
+ })
+
+ it('names no lien when the key points at no row, and never claims a voided or an unfiled lien by default', () => {
+ expect(releaseLineLien(release({ releasesFilingId: 'gone' }), [lien('a1')])).toEqual({ how: 'none' })
+ expect(releaseLineLien(release({}), [lien('a1', { voided_at: '2026-12-03T00:00:00Z' })])).toEqual({ how: 'none' })
+ expect(releaseLineLien(release({}), [lien('a1', { filed_at: null })])).toEqual({ how: 'none' })
+ })
+
+ it('reads only affidavits as liens', () => {
+ const all: ReleaseLineFiling[] = [{ id: 'n1', kind: 'notice_53_056', filed_at: '2026-10-01', recording_number: null }]
+ expect(releaseLineLien(release({ releasesFilingId: 'n1' }), all)).toEqual({ how: 'none' })
+ })
+})
+
+describe('releaseLineWords', () => {
+ it('names the lien, the saved day and that the county has not recorded it', () => {
+ expect(releaseLineWords(release({ releasesFilingId: 'a1' }), [lien('a1')], fmt)).toBe('for instrument 2026-0000001 · saved <2026-12-02> · not yet recorded')
+ })
+
+ it('names the county’s day and the release’s own number once they are kept', () => {
+ expect(releaseLineWords(release({ releasesFilingId: 'a1', releaseInstrument: '2026-0000099' }, '2026-12-04'), [lien('a1')], fmt)).toBe('for instrument 2026-0000001 · recorded <2026-12-04> · instrument 2026-0000099')
+ })
+
+ it('never shows the lien’s number as the release’s own', () => {
+ expect(releaseLineWords(release({ releasesFilingId: 'a1' }, '2026-12-04'), [lien('a1')], fmt)).toBe('for instrument 2026-0000001 · recorded <2026-12-04> · no instrument number kept')
+ })
+
+ it('names a lien with no number by its filed day', () => {
+ expect(releaseLineWords(release({ releasesFilingId: 'a1' }), [lien('a1', { recording_number: ' ' })], fmt)).toBe('for the lien filed <2026-11-09> · saved <2026-12-02> · not yet recorded')
+ })
+
+ it('says a voided lien is voided', () => {
+ expect(releaseLineWords(release({ releasesFilingId: 'a1' }), [lien('a1', { voided_at: '2026-12-03T00:00:00Z' })], fmt)).toBe('for instrument 2026-0000001, which is voided · saved <2026-12-02> · not yet recorded')
+ })
+
+ it('says a release names no lien', () => {
+ expect(releaseLineWords(release({}), [lien('a1'), lien('a2')], fmt)).toBe('names no lien on this job · saved <2026-12-02> · not yet recorded')
+ })
+
+ it('tells two releases on one job apart', () => {
+ const all = [lien('a1'), lien('a2', { recording_number: '2026-0000002' })]
+ const one = releaseLineWords(release({ releasesFilingId: 'a1' }), all, fmt)
+ const two = releaseLineWords(release({ releasesFilingId: 'a2' }), all, fmt)
+ expect(one).not.toBe(two)
+ })
+})
diff --git a/src/lib/jobs/lienReleaseLine.ts b/src/lib/jobs/lienReleaseLine.ts
new file mode 100644
index 0000000000..86a7b2c368
--- /dev/null
+++ b/src/lib/jobs/lienReleaseLine.ts
@@ -0,0 +1,51 @@
+/**
+ * What a release of record's line says under **Filings on this job** (finding 816, punch list #479, step 7).
+ *
+ * The line read *Release of record* and nothing else. On a job with two liens the two releases could not be told
+ * apart, and a release whose lien was voided looked like any other. The line now names three things:
+ *
+ * - its lien: *for instrument N*, or *for the lien filed November 9, 2026* when the lien has no number yet;
+ * - its own day: *saved December 2, 2026* until the county’s day is kept, then *recorded December 4, 2026*;
+ * - where it stands: *not yet recorded*, or the number the county gave the release itself.
+ *
+ * A release names its lien in `fields.releasesFilingId`. One saved before that key was kept belongs to the job's
+ * one filed lien, as `releaseForAffidavit` reads it. A release whose lien is voided says so, and one that names no
+ * lien on a job with two says that.
+ *
+ * The app counts the days and does not judge the law.
+ */
+import { calendarYmdInAppTzFromIso } from '../../utils/dateUtils'
+import { releaseAffidavitId, releaseOwnInstrument, type LienPayoffRelease } from './lienPayoff'
+
+/** A filing as the line needs it: any row of the job, voided ones included. */
+export type ReleaseLineFiling = { id: string; kind: string; filed_at: string | null; recording_number: string | null; voided_at?: string | null }
+
+/** The lien a release's line names: a live filed lien, a voided one, or none. */
+export type ReleaseLineLien = { how: 'live' | 'voided'; instrument: string; filedYmd: string } | { how: 'none' }
+
+/** The lien this release belongs to, read from every filing on the job (`all`), voided ones included. */
+export function releaseLineLien(release: Pick, all: ReadonlyArray): ReleaseLineLien {
+ const affidavits = all.filter((f) => f.kind === 'affidavit')
+ const named = releaseAffidavitId(release)
+ const liveFiled = affidavits.filter((a) => !a.voided_at && a.filed_at)
+ // A release saved before the key was kept belongs to the job's one filed lien, and to none on a job with two.
+ const lien = named ? affidavits.find((a) => a.id === named) : liveFiled.length === 1 ? liveFiled[0] : undefined
+ if (!lien) return { how: 'none' }
+ return { how: lien.voided_at ? 'voided' : 'live', instrument: (lien.recording_number ?? '').trim(), filedYmd: (lien.filed_at ?? '').slice(0, 10) }
+}
+
+/**
+ * The line's words: *for instrument 2026-0412207 · saved December 2, 2026 · not yet recorded*. `fmt` writes a day
+ * ('YYYY-MM-DD') as the line's other rows do.
+ */
+export function releaseLineWords(release: Pick, all: ReadonlyArray, fmt: (ymd: string) => string): string {
+ const lien = releaseLineLien(release, all)
+ const forLien =
+ lien.how === 'none'
+ ? 'names no lien on this job'
+ : `${lien.instrument ? `for instrument ${lien.instrument}` : lien.filedYmd ? `for the lien filed ${fmt(lien.filedYmd)}` : 'for a lien not yet filed'}${lien.how === 'voided' ? ', which is voided' : ''}`
+ const recordedYmd = (release.filed_at ?? '').slice(0, 10)
+ if (!recordedYmd) return `${forLien} · saved ${fmt(calendarYmdInAppTzFromIso(release.created_at))} · not yet recorded`
+ const own = releaseOwnInstrument(release)
+ return `${forLien} · recorded ${fmt(recordedYmd)} · ${own ? `instrument ${own}` : 'no instrument number kept'}`
+}
diff --git a/to-dos/lien-release-road-faults/README.md b/to-dos/lien-release-road-faults/README.md
index e7c9afe70a..0004fd73be 100644
--- a/to-dos/lien-release-road-faults/README.md
+++ b/to-dos/lien-release-road-faults/README.md
@@ -2,7 +2,7 @@
name: "The release road: every fault found on the way to releasing a paid lien, and the ones left to mend"
number: 479
group: ready
-status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 2 is built (v2.9195) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 11 is built (v2.9230) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · step 14 is measured · steps 7 and 9 are left, and the word on step 14
+status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 2 is built (v2.9195) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 11 is built (v2.9230) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · the first half of step 7 is built (v2.9255) · step 14 is measured · the rest of step 7 and step 9 are left, and the word on step 14
summary: >
The owner asked for help releasing a paid lien and printing its release, and for every bug on
the way. One thread read the road in the code and found fourteen faults, findings 808 to 821.
@@ -12,7 +12,7 @@ summary: >
the most serious first. Two can mislead on a real lien today. On a job with two liens the
county's stamp can land on the wrong release. And a release that is only saved already reads
Released.
-next: Step 7, finding 816. A release's line names its lien, its number and its day. The void of an affidavit with a live release is refused by the window as drawn.
+next: The rest of step 7, finding 816. The void of an affidavit with a live release is refused by the window as drawn, and the void of a recorded release takes words.
ask: owner · look · A look at the refused void on a ZZ Test lien once step 7 is built: the window, its Take me there press, and the way back to the affidavit.
size: L as a train of fourteen (M · M · S · S · S · S · M · M · S · S · XS · S · S · S); left: steps 7 and 9
blocker: Step 7 has none: the owner said *Yes, build it* on its drawing. Step 8 is built and owes one push after its merge. Step 9 is built after card #477. Step 14 is measured, and the measure found nothing of this door's to mend.
@@ -62,7 +62,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 813 | A job has two liens. Keeping **Recorded on** throws the tab onto the other lien before **Instrument number** is typed. | read | Built in step 1, v2.9190. The tab holds the lien it stands on. |
| 814 | A release is saved and the county has not recorded it. The job's bills owe again. The tab still says *Sign it before a notary. Then record it at the county.* Its print is live. Payoffs and the day's run hold the same release. | read | Mended by v2.9222, step 5: the tab reads the same hold, its two presses wait and the reason stands under them. |
| 815 | **Download PDF** files no copy. Neither press marks the release as printed for the notary. When a check then comes back, the app says no release has left the office. The day's run prints it again. | read | Mended by v2.9224, step 6: a download files a copy, and the tab's print or download marks a saved release as printed for the notary. |
-| 816 | Voiding a filed affidavit that has a release leaves the release with no lien. Payoffs, the Board and the tab offer a second release, and the head still says released. Under **Filings on this job** a release's line names no lien, number or day, so two cannot be told apart. A release the county recorded voids with the same two presses and no words. | read, its line seen | Not started. Step 7. |
+| 816 | Voiding a filed affidavit that has a release leaves the release with no lien. Payoffs, the Board and the tab offer a second release, and the head still says released. Under **Filings on this job** a release's line names no lien, number or day, so two cannot be told apart. A release the county recorded voids with the same two presses and no words. | read, its line seen | Built in part, v2.9255: a release's line names its lien, its day and where it stands. Left: the refused void, and the words on a recorded release's void. Step 7. |
| 817 | Around the reload after **Save release record** a second release row can be written. Nothing in the database ties one release to one lien. A reload that fails draws *No recorded lien on this job*. | plausible | Built, v2.9240, step 8. The save asks the database first, and a partial unique index holds the rule. It owes one push after its merge. |
| 818 | The desk's path is never told that a release waits on a check. It says *Paid — file the release of record.* with **File the release ›** while the tab's presses are dead. The Board keeps one chip a job in a bin. So on a job with two liens **Make N release ›** can leave one out. | read | Not started. Step 9. |
| 819 | Keeping the instrument number writes every kept fact of the release back from the window's copy. A fact another screen wrote in the meantime is lost. That can be the notary's day, the copies' day or the mark of a check that came back. | plausible | Mended, v2.9229 and v2.9239, step 10. The tab's writes read the row fresh. The day's run, Payoffs and the returned check's mark write through `keepReleaseFacts`, which now reads each release fresh too. |
@@ -126,13 +126,13 @@ Lien desk lane's note of run 17 and are not on this card.
the run, and says why.
6. **Built, v2.9224. A download is a copy, and a print is marked (S). 815.** **Download PDF** files a copy as the
print does. Either press marks the release as out for the notary.
-7. **Voids that leave nothing behind (M). 816.** The void of an affidavit with a live release
+7. **First half built, v2.9255. Voids that leave nothing behind (M). 816.** The void of an affidavit with a live release
is refused by a window with a **Take me there** press, which brings the person to the release
and shows where to press (call 2). The window and its flow are drawn in
[`mockup.html`](mockup.html), *Now* beside the suggestion. The owner said *Yes, build it* on
- the drawing on 2026-12-02. Neither half is built yet. The other half: a release's line
- under **Filings on this job** names its lien, its number and its day, and voiding a release
- the county recorded takes words.
+ the drawing on 2026-12-02. That half is not built yet. Built, v2.9255: a release's line
+ under **Filings on this job** names its lien, its number and its day. Left with the window:
+ voiding a release the county recorded takes words.
8. **Built, v2.9240. One release a lien (M). 817.** The save is guarded in the client. A rule in the database
ties one live release to one lien. This step is a migration and owes a push after its merge.
9. **The desk's path knows the wait, and one chip a lien (S). 818.** Built after card #477, since
@@ -208,6 +208,6 @@ files have landed since, and the lines have moved.
Written on 2026-12-02 (UTC), brought current on 2026-12-03 (UTC). Of the fourteen steps, eleven
are built: 1 to 6, 8, 10, 11, 12 and 13. Step 8 owes one push after its merge. Step 14 is
measured, and the measure found nothing of this door's to mend. Two steps are left. Step 7 is
-next, both halves: the release's line that names its lien, and the refused void as drawn. Step 9
+next. Its first half is built, the release's line that names its lien (v2.9255). The refused void as drawn is left. Step 9
is built after card #477. Finding 810 is decided on card #477 and is built with it. The looks on
the live site are owed for every step.
From 0942f404b84c7d66e420310512652a4e697dbe5e Mon Sep 17 00:00:00 2001
From: Tony
Date: Wed, 2 Dec 2026 21:23:31 -0600
Subject: [PATCH 20/21] =?UTF-8?q?v2.9260=20=E2=80=94=20Lien=20window:=20a?=
=?UTF-8?q?=20lien=20with=20a=20release=20is=20not=20voided=20out=20from?=
=?UTF-8?q?=20under=20it=20(finding=20816,=20punch=20list=20#479=20step=20?=
=?UTF-8?q?7)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Claude Fable 5.2
---
docs/LIEN_DESK_ARCHITECTURE.md | 4 +
docs/recent-features/v2.9260.md | 34 ++++++
.../LienFilingTabs.release.render.test.tsx | 113 +++++++++++++++++-
src/components/jobs/LienFilingTabs.tsx | 61 +++++++++-
src/components/jobs/LienInstrumentsModal.tsx | 5 +
...ile-a-lien-and-never-miss-its-deadlines.md | 2 +
.../release-a-filed-lien-after-it-is-paid.md | 8 ++
src/content/releaseNotes/v2.9260.ts | 16 +++
src/lib/jobs/lienVoidRefusal.test.ts | 112 +++++++++++++++++
src/lib/jobs/lienVoidRefusal.ts | 97 +++++++++++++++
to-dos/lien-release-road-faults/README.md | 42 +++----
11 files changed, 471 insertions(+), 23 deletions(-)
create mode 100644 docs/recent-features/v2.9260.md
create mode 100644 src/content/releaseNotes/v2.9260.ts
create mode 100644 src/lib/jobs/lienVoidRefusal.test.ts
create mode 100644 src/lib/jobs/lienVoidRefusal.ts
diff --git a/docs/LIEN_DESK_ARCHITECTURE.md b/docs/LIEN_DESK_ARCHITECTURE.md
index 9df8ab62a1..543fba09e1 100644
--- a/docs/LIEN_DESK_ARCHITECTURE.md
+++ b/docs/LIEN_DESK_ARCHITECTURE.md
@@ -771,6 +771,10 @@ last_updated: 2026-12-02
> **v2.9240 (one live release a lien, finding 817):** `recordRelease` takes one save at a time and asks the database for a live `release_of_record` row whose `fields ->> 'releasesFilingId'` is this lien before it inserts, and migration `20261202211100` holds the same rule as the partial unique index `job_lien_filings_one_live_release_idx`.
> `isOneLiveReleaseRefusal` reads the index's refusal by its name, and `loadFilings` in `LienInstrumentsModal` keeps the records it holds when a reload fails.
> **v2.9255 (a release's line names its lien, finding 816's first half):** a `release_of_record` row under *Filings on this job* draws `releaseLineWords` (`lienReleaseLine.ts`, `data-lien-release-line`): the lien from `releaseLineLien`, read over every filing on the job with the voided ones, then *saved December 2, 2026 · not yet recorded* or *recorded December 4, 2026 · instrument M* from `releaseOwnInstrument`.
+> **v2.9260 (the refused void, the rest of finding 816):** **Void** on a filing's line goes through `pressVoid`, which asks `affidavitVoidRefusal` (`lienVoidRefusal.ts`) whether the affidavit has a live release as `releaseForAffidavit` reads it.
+> A saved release opens the confirm window *Void the release first*, and **Take me there ›** lights the release's own **Void** (`filingVoidPressSelector`, `data-lien-void-coach`), then the affidavit's once that release is voided (`data-lien-void-way-back`).
+> A release the county recorded opens *The county recorded this lien's release*, and **Go to the release of record ›** calls `onGoToRelease`, on which `LienInstrumentsModal` picks the paper and lands on the county's stamp, voiding nothing.
+> The void of a recorded release from its own line asks first (`releaseVoidTakesWords`, `recordedReleaseVoidWindow`): **Keep the release** is the safe press and **Void the release anyway** is red.
> **v2.9190 (a door names its lien, findings 808 and 813):** `pickReleaseTarget` takes a third value, the lien the door named, read after the lien the tab holds and before the rule.
> The doors are a lien's row in Payoffs and a release's line on the day's run: each `onOpenRelease` hands the job and its `affidavitId`, `LienDeskPage` keeps it as `releaseLienId` on the window it opens, and `LienInstrumentsModal` hands it to `LienFilingTabs`.
> The tab holds the lien it stands on: an effect writes the picked lien's id into `releaseTargetId`, so a release the county has just recorded no longer hands the tab to the job's other lien.
diff --git a/docs/recent-features/v2.9260.md b/docs/recent-features/v2.9260.md
new file mode 100644
index 0000000000..c58733d424
--- /dev/null
+++ b/docs/recent-features/v2.9260.md
@@ -0,0 +1,34 @@
+# v2.9260 — Lien window: a lien with a release is not voided out from under it (2026-12-03)
+
+The rest of step 7 of punch list #479 (the release road's faults), finding 816. Built as the card's `mockup.html` draws it, on the owner's *Yes, build it* of 2026-12-02 and *Every pick* of 2026-12-03. Client only. No migration, no function change, nothing owed on prod. Cut on top of v2.9255, the step's first half.
+
+## What was wrong
+
+- **Void**, then **Confirm void**, on a filed affidavit that had a live release went through. The release was left with no lien, and Payoffs, the Board and the tab then offered a second release.
+- A release the county had recorded voided from its own line with the same two presses and no words.
+
+## What changed
+
+- [`lienVoidRefusal.ts`](../../src/lib/jobs/lienVoidRefusal.ts), new and pure. `affidavitVoidRefusal` answers whether a filed affidavit has a live release, read as every other surface reads it (`releaseForAffidavit`), and whether the county has recorded it. `affidavitVoidRefusalWindow` writes the confirm window for each case. `releaseVoidTakesWords` and `recordedReleaseVoidWindow` are the void of a recorded release from its own line.
+- [`LienFilingTabs.tsx`](../../src/components/jobs/LienFilingTabs.tsx): **Void** on a filing's line goes through `pressVoid`.
+ - **A saved release.** The window *Void the release first* opens and nothing is voided. **Take me there ›** lights **Void** on the release's line through `landOnWhenThere`, with the line *Press Void here, then Confirm void. Then void the affidavit.* Once that release is voided, the affidavit's **Void** is lit with *The release is voided. The affidavit can be voided now.*
+ - **A release the county recorded.** The window *The county recorded this lien's release* names the county's day and the release's own number. **Go to the release of record ›** stands beside **Close**. It picks that lien on the tab and calls `onGoToRelease`.
+ - **A recorded release's own Void.** A confirm window, *The county recorded this release*. **Keep the release** is the safe press and takes the focus. **Void the release anyway** is red.
+ - Every other record keeps **Void**, then **Confirm void**.
+- [`LienInstrumentsModal.tsx`](../../src/components/jobs/LienInstrumentsModal.tsx): `onGoToRelease` picks the paper *Release of record* and lands on the county's stamp, the light **Go to the release of record ›** already uses.
+- The guides *file a lien and never miss its deadlines* and *release a filed lien after it is paid* say what the windows do.
+
+## Not in this change
+
+- The database refuses nothing here. A void written outside the Lien window is not stopped.
+- The window's own switch of paper has no render test of its own: the tab's test proves the call, and the look below proves the landing.
+
+## Tests
+
+- `lienVoidRefusal.test.ts`: no release, a saved one, a recorded one, a job with two liens, a release with no key, records that are not filed affidavits, each window's words, and the plain-words rules on every sentence.
+- `LienFilingTabs.release.render.test.tsx`: the refused void and Cancel; **Take me there ›**, the lit **Void**, the release's void and the way back; the recorded window and its press; an affidavit with no release; a job with two liens; the recorded release's own void, kept and voided; a saved release's two presses.
+
+## Look owed
+
+- A ZZ Test lien, with the live-write slot: a ZZ Test job with a filed affidavit and a saved release. Press **Void** on the affidavit's line, read the window, press **Take me there ›**, void the release, then void the affidavit. Every row is voided before the look ends, the release before its affidavit.
+- A real lien is read only. No walker presses **Void** on one.
diff --git a/src/components/jobs/LienFilingTabs.release.render.test.tsx b/src/components/jobs/LienFilingTabs.release.render.test.tsx
index 43508b16e5..fdaa08ad73 100644
--- a/src/components/jobs/LienFilingTabs.release.render.test.tsx
+++ b/src/components/jobs/LienFilingTabs.release.render.test.tsx
@@ -5,7 +5,7 @@
* save, and a job with two filed liens picks which one. The rules are held by `lienReleaseOfRecord.test.ts`.
* Wiring only: the writes go to a stub and are read back off it.
*/
-import { afterEach, describe, expect, it, vi } from 'vitest'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { cleanup, fireEvent, screen, waitFor } from '@testing-library/react'
import { makeJob, renderWithProviders } from '../../test/renderSmokeMocks'
import type { BankCheck } from '../../lib/jobs/checkCleared'
@@ -827,3 +827,114 @@ describe('Release of record: a release’s line names its lien, its day and wher
expect(document.querySelector('[data-lien-release-line]')).toBeNull()
})
})
+
+const voids = vi.hoisted(() => ({ ids: [] as string[] }))
+vi.mock('../../lib/jobs/lienFilingVoidIo', () => ({
+ voidLienFiling: vi.fn(async (f: { id: string }) => {
+ voids.ids.push(f.id)
+ return 'none'
+ }),
+}))
+
+describe('Filings on this job: the void of an affidavit with a live release is refused (finding 816, punch list #479 step 7)', () => {
+ const row = (id: string) => document.querySelector(`[data-lien-filing-row="${id}"]`)!
+ const voidPress = (id: string) => row(id).querySelector('[data-lien-filing-void]')!
+ beforeEach(() => {
+ voids.ids = []
+ })
+
+ it('opens a window, voids nothing, and Cancel leaves the line as it was', async () => {
+ draw({ job: paid(), filings: [lien() as never, release() as never] })
+ fireEvent.click(voidPress('a1'))
+ const dialog = await screen.findByRole('alertdialog', { name: 'Void the release first' })
+ expect(dialog.textContent).toContain('This lien has a release of record, saved November 21, 2026. A release needs its lien.')
+ expect(dialog.textContent).toContain('Void the release. Then void the affidavit.')
+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
+ await waitFor(() => expect(screen.queryByRole('alertdialog', { name: 'Void the release first' })).toBeNull())
+ expect(voidPress('a1').textContent).toBe('Void')
+ expect(document.querySelector('[data-lien-void-coach]')).toBeNull()
+ expect(voids.ids).toEqual([])
+ })
+
+ it('takes the person to the release’s Void, then back to the affidavit once the release is voided', async () => {
+ draw({ job: paid(), filings: [lien() as never, release() as never] })
+ fireEvent.click(voidPress('a1'))
+ fireEvent.click(await screen.findByRole('button', { name: 'Take me there ›' }))
+ await waitFor(() => expect(row('r1').querySelector('[data-lien-void-coach]')!.textContent).toBe('Press Void here, then Confirm void. Then void the affidavit.'))
+ expect(voidPress('r1').getAttribute('data-landed')).toBe('yes')
+ expect(voids.ids).toEqual([])
+ fireEvent.click(voidPress('r1'))
+ expect(voidPress('r1').textContent).toBe('Confirm void')
+ fireEvent.click(voidPress('r1'))
+ await waitFor(() => expect(voids.ids).toEqual(['r1']))
+ await waitFor(() => expect(row('a1').querySelector('[data-lien-void-way-back]')!.textContent).toBe('The release is voided. The affidavit can be voided now.'))
+ expect(document.querySelector('[data-lien-void-coach]')).toBeNull()
+ expect(voidPress('a1').getAttribute('data-landed')).toBe('yes')
+ })
+
+ it('says the county’s record stands for a recorded release, and its press opens the release of record and voids nothing', async () => {
+ const onGoToRelease = vi.fn()
+ draw({ job: paid(), activeTab: 'affidavit', onGoToRelease, filings: [lien() as never, release({ filed_at: '2026-11-23', fields: { releasesFilingId: 'a1', releaseInstrument: '2026-0431955' } }) as never] })
+ fireEvent.click(voidPress('a1'))
+ const dialog = await screen.findByRole('alertdialog', { name: 'The county recorded this lien’s release' })
+ expect(dialog.textContent).toContain('The release was recorded November 23, 2026 as 2026-0431955. The county’s record stands.')
+ expect(dialog.textContent).toContain('Ask counsel before either paper is voided.')
+ expect(screen.getByRole('button', { name: 'Close' })).toBeTruthy()
+ fireEvent.click(screen.getByRole('button', { name: 'Go to the release of record ›' }))
+ await waitFor(() => expect(onGoToRelease).toHaveBeenCalledWith('a1'))
+ expect(voids.ids).toEqual([])
+ expect(document.querySelector('[data-lien-void-coach]')).toBeNull()
+ })
+
+ it('voids an affidavit with no release with the same two presses as before', async () => {
+ draw({ job: paid(), filings: [lien() as never] })
+ fireEvent.click(voidPress('a1'))
+ expect(voidPress('a1').textContent).toBe('Confirm void')
+ expect(screen.queryByRole('alertdialog')).toBeNull()
+ fireEvent.click(voidPress('a1'))
+ await waitFor(() => expect(voids.ids).toEqual(['a1']))
+ })
+
+ it('refuses only the lien the release names on a job with two', async () => {
+ const second = lien({ id: 'a2', recording_number: '2026-0500001', filed_at: '2026-11-16' })
+ draw({ job: paid(), filings: [lien() as never, second as never, release() as never] })
+ fireEvent.click(voidPress('a2'))
+ expect(voidPress('a2').textContent).toBe('Confirm void')
+ fireEvent.click(voidPress('a1'))
+ expect(await screen.findByRole('alertdialog', { name: 'Void the release first' })).toBeTruthy()
+ })
+})
+
+describe('Filings on this job: voiding a release the county recorded takes words (finding 816)', () => {
+ const voidPress = (id: string) => document.querySelector(`[data-lien-filing-row="${id}"] [data-lien-filing-void]`)!
+ const recorded = () => release({ filed_at: '2026-11-23', fields: { releasesFilingId: 'a1', releaseInstrument: '2026-0431955' } })
+ beforeEach(() => {
+ voids.ids = []
+ })
+
+ it('asks in a window, and Keep the release voids nothing', async () => {
+ draw({ job: paid(), filings: [lien() as never, recorded() as never] })
+ fireEvent.click(voidPress('r1'))
+ const dialog = await screen.findByRole('alertdialog', { name: 'The county recorded this release' })
+ expect(dialog.textContent).toContain('It was recorded November 23, 2026 as 2026-0431955. Voiding it here does not undo the county’s record.')
+ expect(dialog.textContent).toContain('Ask counsel first.')
+ fireEvent.click(screen.getByRole('button', { name: 'Keep the release' }))
+ await waitFor(() => expect(screen.queryByRole('alertdialog')).toBeNull())
+ expect(voidPress('r1').textContent).toBe('Void')
+ expect(voids.ids).toEqual([])
+ })
+
+ it('voids on the red press that names the act', async () => {
+ draw({ job: paid(), filings: [lien() as never, recorded() as never] })
+ fireEvent.click(voidPress('r1'))
+ fireEvent.click(await screen.findByRole('button', { name: 'Void the release anyway' }))
+ await waitFor(() => expect(voids.ids).toEqual(['r1']))
+ })
+
+ it('leaves a release that is only saved to the two presses', () => {
+ draw({ job: paid(), filings: [lien() as never, release() as never] })
+ fireEvent.click(voidPress('r1'))
+ expect(voidPress('r1').textContent).toBe('Confirm void')
+ expect(screen.queryByRole('alertdialog')).toBeNull()
+ })
+})
diff --git a/src/components/jobs/LienFilingTabs.tsx b/src/components/jobs/LienFilingTabs.tsx
index 0824347762..23bebc0652 100644
--- a/src/components/jobs/LienFilingTabs.tsx
+++ b/src/components/jobs/LienFilingTabs.tsx
@@ -65,6 +65,7 @@ import { lienServeHasContractor } from '../../lib/jobs/lienServeNumbers'
import { LienServeCopiesPress } from './LienServeCopiesPress'
import { withSupabaseRetry, formatErrorMessage } from '../../utils/errorHandling'
import { useToastContext } from '../../contexts/ToastContext'
+import { useConfirmDialog } from '../../contexts/ConfirmDialogContext'
import { useAuth } from '../../hooks/useAuth'
import { LienVoidedByHandRecords } from './LienVoidedByHandRecords'
import { LienVoidedRecords } from './LienVoidedRecords'
@@ -90,6 +91,7 @@ import { ChangeableValue, ValueLine, ValueLines, ValueSentence, WorkedOutValue }
import { plainSentence } from '../../lib/valuesInPlace'
import { RELEASE_OF_RECORD_WORDS, canReleaseAnyway, pickReleaseTarget, isOneLiveReleaseRefusal, releaseMoneyBackWords, releaseMoneyGate, releaseNeedsBank, releasePaperBlanks, releasePaperBlanksWords, releaseRecordDrift, releaseRecordFactsPatch, releaseReprintWords, RELEASE_RECORD_FACT_LABELS, type ReleaseRecordFact, releaseCorrectable, releasePaymentDatePatch, releasePaymentDateShown, releasePaymentDayAsk, releasePaymentDayBeforeLien, releasePaymentDayKey, releaseSavedHold, releaseSavedPaymentDay, releaseRecordedSentence, releaseSaveFields, releaseStampDayCheck, releaseStampPatch, releaseTargets, releasePaymentDayCheck } from '../../lib/jobs/lienReleaseOfRecord'
import { releaseLineWords } from '../../lib/jobs/lienReleaseLine'
+import { VOID_REFUSAL_WORDS, affidavitVoidRefusal, affidavitVoidRefusalWindow, filingVoidPressSelector, recordedReleaseVoidWindow, releaseVoidTakesWords } from '../../lib/jobs/lienVoidRefusal'
import { payoffNote } from '../../lib/jobs/lienPayoffFields'
import { releaseByNow, releaseFacts, releaseFactsPatch, releasePaperChangedSincePrint } from '../../lib/jobs/lienReleaseFacts'
import { countedLabel } from '../../lib/batchWords'
@@ -157,6 +159,7 @@ export default function LienFilingTabs({
landRelease = null,
landAffidavit = null,
releaseLienId = null,
+ onGoToRelease,
headSlotRef,
onServePrinted,
onClose,
@@ -191,6 +194,8 @@ export default function LienFilingTabs({
landAffidavit?: { at: number } | null
/** The filed lien the opener's press was made on (finding 808): the Release of record tab opens on that lien, not on the job's first. Absent, the tab picks. */
releaseLienId?: string | null
+ /** The window that refuses an affidavit's void sends the person to that lien's release of record (finding 816): the window picks the paper and lands on the county's stamp. */
+ onGoToRelease?: (affidavitId: string) => void
/** The Lien window's slot at the top of each paper's pane (Way 2 of finding 803): on a computer the window draws its steps' band and the papers' bar there, inside the paper's own scroll. */
headSlotRef?: (el: HTMLElement | null) => void
/** The filed lien's copies went to the printer from this window's press. */
@@ -222,10 +227,14 @@ export default function LienFilingTabs({
const isMobile = useIsMobile()
const { user: authUser, role: authRole, profileName } = useAuth()
const { showToast } = useToastContext()
+ const confirmDialog = useConfirmDialog()
const [pdfBusy, setPdfBusy] = useState(false)
const [encloseInvoice, setEncloseInvoice] = useState(true)
const enclosedDocs = useMemo(() => (encloseInvoice ? invoiceDocs : []), [encloseInvoice, invoiceDocs])
const [voidPendingId, setVoidPendingId] = useState(null)
+ // The refused void's way (finding 816, v2.9260): the release whose **Void** is lit for the affidavit that was pressed, then the affidavit once that release is voided.
+ const [voidCoach, setVoidCoach] = useState<{ releaseId: string; affidavitId: string } | null>(null)
+ const [voidWayBackId, setVoidWayBackId] = useState(null)
const [recordStep, setRecordStep] = useState<'notice_sends' | 'notice_by_hand' | 'affidavit_filing' | 'affidavit_service' | null>(null)
const [ownerSend, setOwnerSend] = useState({ method: 'certified_mail', tracking: '', sentOn: todayYmd(), receiptUrl: '' })
const [ocSend, setOcSend] = useState({ method: 'certified_mail', tracking: '', sentOn: todayYmd(), receiptUrl: '' })
@@ -1192,12 +1201,49 @@ export default function LienFilingTabs({
const outcome = await voidLienFiling({ id: f.id, kind: f.kind })
showToast(lienVoidPaperWords(outcome, f.kind), lienVoidPaperStuck(outcome) ? 'error' : 'success')
setVoidPendingId(null)
+ // The release the refused void sent the person to is voided: the affidavit's line says so and its Void is lit.
+ if (voidCoach?.releaseId === f.id) {
+ const affidavitId = voidCoach.affidavitId
+ setVoidCoach(null)
+ setVoidWayBackId(affidavitId)
+ landUndo.current?.()
+ landUndo.current = landOnWhenThere(() => document.querySelector(filingVoidPressSelector(affidavitId)))
+ }
+ if (voidWayBackId === f.id) setVoidWayBackId(null)
onChanged()
} catch (e) {
showToast(formatErrorMessage(e, 'Could not void the record.'), 'error')
}
}
+ /**
+ * **Void** on a filing's line (finding 816, v2.9260). An affidavit with a live release is not voided: a window
+ * refuses it and its blue press leads to the release (`lienVoidRefusal.ts`). A release the county recorded asks
+ * in a confirm window first. Every other record turns its press into **Confirm void**, as before.
+ */
+ const pressVoid = async (f: JobLienFilingRow) => {
+ const refusal = affidavitVoidRefusal(f, live)
+ if (refusal) {
+ if (!(await confirmDialog(affidavitVoidRefusalWindow(refusal, demandDate)))) return
+ if (refusal.kind === 'saved') {
+ setVoidWayBackId(null)
+ setVoidCoach({ releaseId: refusal.releaseId, affidavitId: f.id })
+ landUndo.current?.()
+ landUndo.current = landOnWhenThere(() => document.querySelector(filingVoidPressSelector(refusal.releaseId)))
+ } else {
+ // The county's record: the release's own paper, on this lien, with the stamp lit. Nothing is voided.
+ setReleaseTargetId(f.id)
+ onGoToRelease?.(f.id)
+ }
+ return
+ }
+ if (releaseVoidTakesWords(f)) {
+ if (await confirmDialog(recordedReleaseVoidWindow(f, demandDate))) await voidFiling(f)
+ return
+ }
+ setVoidPendingId(f.id)
+ }
+
// ---------- render helpers ----------
const kindLabel = (k: string) =>
@@ -1331,15 +1377,26 @@ export default function LienFilingTabs({
View
{voidPendingId === f.id ? (
- void voidFiling(f)} style={{ background: 'none', border: 'none', color: 'var(--text-red-700)', fontWeight: 700, cursor: 'pointer', padding: 0, fontSize: '0.72rem' }}>
+ void voidFiling(f)} style={{ background: 'none', border: 'none', color: 'var(--text-red-700)', fontWeight: 700, cursor: 'pointer', padding: 0, fontSize: '0.72rem' }}>
{isLienAppliedRow(f as unknown as LienAppliedRow) ? 'Confirm undo' : 'Confirm void'}
) : (
- setVoidPendingId(f.id)} style={{ background: 'none', border: 'none', color: 'var(--text-muted)', cursor: 'pointer', padding: 0, fontSize: '0.72rem' }}>
+ void pressVoid(f)} style={{ background: 'none', border: 'none', color: 'var(--text-muted)', cursor: 'pointer', padding: 0, fontSize: '0.72rem' }}>
{isLienAppliedRow(f as unknown as LienAppliedRow) ? 'Undo' : 'Void'}
)}
+ {/* The refused void's way (finding 816): what to press on the release's line, then the way back on the affidavit's. */}
+ {voidCoach?.releaseId === f.id ? (
+
+ {VOID_REFUSAL_WORDS.pressVoidHere}
+
+ ) : null}
+ {voidWayBackId === f.id ? (
+
+ {VOID_REFUSAL_WORDS.wayBack}
+
+ ) : null}
{/* What went out (`lienMailProof.ts`): every mailed file with its own link, each envelope's number and receipt, and the receipt press. */}
{
+ setActiveTab('release_record')
+ setLandRelease({ at: Date.now() })
+ }}
headSlotRef={setHeadSlot}
// The copies went to the printer here: this window's card reads the next stage at once, and the opener reads again once the print is filed.
onServePrinted={(id) => {
diff --git a/src/content/help/file-a-lien-and-never-miss-its-deadlines.md b/src/content/help/file-a-lien-and-never-miss-its-deadlines.md
index 7dfeba8729..a632112625 100644
--- a/src/content/help/file-a-lien-and-never-miss-its-deadlines.md
+++ b/src/content/help/file-a-lien-and-never-miss-its-deadlines.md
@@ -156,6 +156,8 @@ Was the lien filed without this tab, by counsel or on paper from elsewhere? The
Was a filing recorded on the wrong job, or with the wrong day? Open that job's Lien window. Find the record under **Filings on this job**. Press **Void** on it, then **Confirm void**. The lien's paper goes back to the Lien desk by itself. A paper the leader approved is approved again, so nobody asks him twice. The Board shows it in **Ready to file**, or in **Held** when a fact holds it. A paper nobody had approved goes back to a draft. Then record the lien again with the right facts.
+Does the lien have a release of record? The app does not void the affidavit. A window says *Void the release first*. Press {{button:blue|Take me there ›}}. The release's **Void** lights up on its line. Press it, then **Confirm void**. The affidavit's line then says it can be voided now. Has the county already recorded the release? The window says so instead. Press {{button:blue|Go to the release of record ›}} to read the county's day and number. Ask counsel before either paper is voided.
+
### Several liens back from the clerk
Did a stack of liens come back from the County Clerk together? Record them in one sitting. Open the Lien desk's To do. On the Board, find the bin **Ready to file**. Under its print a line reads *Back from the clerk?* Press {{button:outline|Enter document numbers · 3 ›}} beside it. The press counts the liens in the bin. One window opens. It is named **Back from the clerk: record the filings**.
diff --git a/src/content/help/release-a-filed-lien-after-it-is-paid.md b/src/content/help/release-a-filed-lien-after-it-is-paid.md
index c29cdc4e79..d110fe21a3 100644
--- a/src/content/help/release-a-filed-lien-after-it-is-paid.md
+++ b/src/content/help/release-a-filed-lien-after-it-is-paid.md
@@ -167,6 +167,14 @@ The office takes a returned check off its job in Accounts Receivable. The check'
Accounts Receivable shows the liens too. The check's case has a box named **Liens on this money**. Read [the liens on a check that came back](/help/match-bank-deposits-to-bills#the-liens-on-a-check-that-came-back).
+## Void a release
+
+A release is voided on its line under **Filings on this job**. Press **Void**, then **Confirm void**. You can then make the release again.
+
+Has the county already recorded the release? **Void** opens a window first. It says that voiding the release here does not undo the county's record. Press {{button:blue|Keep the release}} to leave it as it is. Press {{button:red|Void the release anyway}} only after you ask counsel.
+
+A lien that has a release is not voided first. The app sends you to the release. Read [file a lien and never miss its deadlines](/help/file-a-lien-and-never-miss-its-deadlines).
+
## What the window does not do
The window does not make the paper. The Lien window's **Release of record** tab does that. A single payment is recorded on the job's Bill tab. The window says which one to open and when.
diff --git a/src/content/releaseNotes/v2.9260.ts b/src/content/releaseNotes/v2.9260.ts
new file mode 100644
index 0000000000..8a5ec7691d
--- /dev/null
+++ b/src/content/releaseNotes/v2.9260.ts
@@ -0,0 +1,16 @@
+import type { ReleaseNote } from '../../lib/releaseNotes'
+
+const note: ReleaseNote = {
+ version: 'v2.9260',
+ date: '2026-12-03',
+ title: 'Lien window: a lien with a release is not voided out from under it',
+ kind: 'fix',
+ highlights: [
+ 'Void on a filed lien that has a release of record no longer goes through. A window says to void the release first.',
+ 'Take me there lights Void on the release’s own line. Once the release is voided, the lien’s line says it can be voided now.',
+ 'When the county has already recorded the release, the window says the county’s record stands. Go to the release of record shows the county’s day and number, and voids nothing.',
+ 'Void on a release the county recorded now asks first. Keep the release is the safe press.',
+ ],
+}
+
+export default note
diff --git a/src/lib/jobs/lienVoidRefusal.test.ts b/src/lib/jobs/lienVoidRefusal.test.ts
new file mode 100644
index 0000000000..7c77f828be
--- /dev/null
+++ b/src/lib/jobs/lienVoidRefusal.test.ts
@@ -0,0 +1,112 @@
+import { describe, expect, it } from 'vitest'
+import { VOID_REFUSAL_WORDS, affidavitVoidRefusal, affidavitVoidRefusalWindow, filingVoidPressSelector, recordedReleaseVoidWindow, releaseVoidTakesWords } from './lienVoidRefusal'
+import { plainWordsFailures } from '../plainWords'
+
+// Every id, number and day here is made up.
+const fmt = (ymd: string) => `<${ymd}>`
+const row = (over: Record) => ({ id: 'x', job_id: 'j1', kind: 'affidavit', amount: 100, county: 'Travis', recording_number: '2026-0000001', filed_at: '2026-11-09' as string | null, created_at: '2026-11-09T15:00:00Z', fields: {} as unknown, ...over })
+const lien = (id = 'a1', over: Record = {}) => row({ id, ...over })
+const release = (id = 'r1', over: Record = {}) => row({ id, kind: 'release_of_record', filed_at: null, created_at: '2026-12-02T18:00:00Z', fields: { releasesFilingId: 'a1' }, ...over })
+
+describe('affidavitVoidRefusal', () => {
+ it('lets the void go on with no release', () => {
+ const a = lien()
+ expect(affidavitVoidRefusal(a, [a])).toBeNull()
+ })
+
+ it('refuses while a saved release names the lien', () => {
+ const a = lien()
+ expect(affidavitVoidRefusal(a, [a, release()])).toEqual({ kind: 'saved', releaseId: 'r1', savedYmd: '2026-12-02' })
+ })
+
+ it('refuses with the county’s day and the release’s own number once it is recorded', () => {
+ const a = lien()
+ const r = release('r1', { filed_at: '2026-12-04', fields: { releasesFilingId: 'a1', releaseInstrument: '2026-0000099' } })
+ expect(affidavitVoidRefusal(a, [a, r])).toEqual({ kind: 'recorded', releaseId: 'r1', recordedYmd: '2026-12-04', instrument: '2026-0000099' })
+ })
+
+ it('reads each lien for itself on a job with two', () => {
+ const a = lien()
+ const b = lien('a2', { recording_number: '2026-0000002' })
+ const all = [a, b, release('r2', { fields: { releasesFilingId: 'a2' } })]
+ expect(affidavitVoidRefusal(a, all)).toBeNull()
+ expect(affidavitVoidRefusal(b, all)).toMatchObject({ kind: 'saved', releaseId: 'r2' })
+ })
+
+ it('reads a release saved before the key was kept as the one filed lien’s own', () => {
+ const a = lien()
+ expect(affidavitVoidRefusal(a, [a, release('r1', { fields: {} })])).toMatchObject({ kind: 'saved', releaseId: 'r1' })
+ })
+
+ it('refuses nothing for a record that is not a filed affidavit', () => {
+ const draft = lien('a1', { filed_at: null })
+ expect(affidavitVoidRefusal(draft, [draft, release()])).toBeNull()
+ const notice = row({ id: 'n1', kind: 'notice_53_056' })
+ expect(affidavitVoidRefusal(notice, [notice, release()])).toBeNull()
+ const r = release()
+ expect(affidavitVoidRefusal(r, [lien(), r])).toBeNull()
+ })
+})
+
+describe('affidavitVoidRefusalWindow', () => {
+ it('sends the person to the release, and names the press for the act', () => {
+ const w = affidavitVoidRefusalWindow({ kind: 'saved', releaseId: 'r1', savedYmd: '2026-12-02' }, fmt)
+ expect(w).toEqual({
+ title: 'Void the release first',
+ message: 'This lien has a release of record, saved <2026-12-02>. A release needs its lien.\n\nVoid the release. Then void the affidavit.',
+ confirmLabel: 'Take me there ›',
+ cancelLabel: 'Cancel',
+ })
+ })
+
+ it('says the county’s record stands, and offers the release of record beside Close', () => {
+ const w = affidavitVoidRefusalWindow({ kind: 'recorded', releaseId: 'r1', recordedYmd: '2026-12-04', instrument: '2026-0000099' }, fmt)
+ expect(w).toEqual({
+ title: 'The county recorded this lien’s release',
+ message: 'The release was recorded <2026-12-04> as 2026-0000099. The county’s record stands.\n\nAsk counsel before either paper is voided.',
+ confirmLabel: 'Go to the release of record ›',
+ cancelLabel: 'Close',
+ })
+ expect(w.danger).toBeUndefined()
+ })
+
+ it('leaves the number out when none is kept', () => {
+ const w = affidavitVoidRefusalWindow({ kind: 'recorded', releaseId: 'r1', recordedYmd: '2026-12-04', instrument: '' }, fmt)
+ expect(w.message.startsWith('The release was recorded <2026-12-04>. The county’s record stands.')).toBe(true)
+ })
+})
+
+describe('the void of a release the county recorded', () => {
+ it('takes words only once the county’s day is kept', () => {
+ expect(releaseVoidTakesWords(release())).toBe(false)
+ expect(releaseVoidTakesWords(release('r1', { filed_at: '2026-12-04' }))).toBe(true)
+ expect(releaseVoidTakesWords(lien())).toBe(false)
+ })
+
+ it('opens on the safe press, with the act red and named', () => {
+ const w = recordedReleaseVoidWindow(release('r1', { filed_at: '2026-12-04', fields: { releaseInstrument: '2026-0000099' } }), fmt)
+ expect(w).toEqual({
+ title: 'The county recorded this release',
+ message: 'It was recorded <2026-12-04> as 2026-0000099. Voiding it here does not undo the county’s record.\n\nAsk counsel first.',
+ confirmLabel: 'Void the release anyway',
+ cancelLabel: 'Keep the release',
+ danger: true,
+ cancelIsSafe: true,
+ })
+ })
+})
+
+describe('the words on the way', () => {
+ it('are plain words', () => {
+ const windows = [
+ affidavitVoidRefusalWindow({ kind: 'saved', releaseId: 'r1', savedYmd: '2026-12-02' }, () => 'December 2, 2026'),
+ affidavitVoidRefusalWindow({ kind: 'recorded', releaseId: 'r1', recordedYmd: '2026-12-04', instrument: '2026-0000099' }, () => 'December 4, 2026'),
+ recordedReleaseVoidWindow(release('r1', { filed_at: '2026-12-04' }), () => 'December 4, 2026'),
+ ]
+ for (const text of [...windows.flatMap((w) => w.message.split('\n\n')), ...Object.values(VOID_REFUSAL_WORDS)]) expect(plainWordsFailures(text), text).toEqual([])
+ })
+
+ it('finds a line’s Void press', () => {
+ expect(filingVoidPressSelector('r1')).toBe('[data-lien-filing-row="r1"] [data-lien-filing-void]')
+ })
+})
diff --git a/src/lib/jobs/lienVoidRefusal.ts b/src/lib/jobs/lienVoidRefusal.ts
new file mode 100644
index 0000000000..7385c72998
--- /dev/null
+++ b/src/lib/jobs/lienVoidRefusal.ts
@@ -0,0 +1,97 @@
+/**
+ * The void that is refused, and the void that takes words (finding 816, punch list #479, step 7).
+ *
+ * Voiding a filed affidavit that has a live release left the release with no lien. Payoffs, the Board and the tab
+ * then offered a second release. The owner's answer (2026-12-02): the void is refused by a window, and its one blue
+ * press takes the person to the release and shows where to press. The drawing is `mockup.html` on the card.
+ *
+ * - **A saved release.** *Void the release first*, with **Take me there ›**. The press lights **Void** on the
+ * release's own line, with a line that says what to press. Once the release is voided, the affidavit's line
+ * says it can be voided now.
+ * - **A release the county recorded.** *The county recorded this lien's release*, with **Go to the release of
+ * record ›** beside Close. The press opens that lien's release on its paper and voids nothing.
+ *
+ * A release the county recorded voided from its own line with the same two presses as any record, and no words.
+ * Its **Void** now opens a confirm window (the owner's pick of 2026-12-03): the county's record stands whatever the
+ * app holds, the safe press keeps the release, and the red press names the act. A county day typed on the wrong
+ * release still has a way out.
+ *
+ * Nothing here voids anything. The app counts the days and does not judge the law.
+ */
+import type { ConfirmDialogOptions } from '../confirmDialogPress'
+import { calendarYmdInAppTzFromIso } from '../../utils/dateUtils'
+import { releaseForAffidavit, releaseOwnInstrument, type LienPayoffAffidavit, type LienPayoffRelease } from './lienPayoff'
+
+type FilingLike = LienPayoffAffidavit & LienPayoffRelease & { kind: string }
+
+/** Why an affidavit's void is refused: its release is saved, or the county has recorded it. */
+export type AffidavitVoidRefusal = { kind: 'saved'; releaseId: string; savedYmd: string } | { kind: 'recorded'; releaseId: string; recordedYmd: string; instrument: string }
+
+/**
+ * Whether the void of this affidavit is refused. `live` is the job's filings with the voided ones left out. The
+ * release is the affidavit's own as every other surface reads it (`releaseForAffidavit`): the one that names it, or
+ * on a job with one filed lien the one saved before the key was kept. Null lets the void go on.
+ */
+export function affidavitVoidRefusal(affidavit: F, live: ReadonlyArray): AffidavitVoidRefusal | null {
+ if (affidavit.kind !== 'affidavit' || !affidavit.filed_at) return null
+ const filed = live.filter((f) => f.kind === 'affidavit' && f.filed_at)
+ const release = releaseForAffidavit(
+ affidavit,
+ live.filter((f) => f.kind === 'release_of_record'),
+ filed.length,
+ )
+ if (!release) return null
+ const recordedYmd = (release.filed_at ?? '').slice(0, 10)
+ if (recordedYmd) return { kind: 'recorded', releaseId: release.id, recordedYmd, instrument: releaseOwnInstrument(release) }
+ return { kind: 'saved', releaseId: release.id, savedYmd: calendarYmdInAppTzFromIso(release.created_at) }
+}
+
+/** The window that refuses the void. Its blue press is the way on, so it is the plain confirm: Cancel or Close is quiet. */
+export function affidavitVoidRefusalWindow(refusal: AffidavitVoidRefusal, fmt: (ymd: string) => string): ConfirmDialogOptions {
+ if (refusal.kind === 'saved') {
+ return {
+ title: 'Void the release first',
+ message: `This lien has a release of record, saved ${fmt(refusal.savedYmd)}. A release needs its lien.\n\nVoid the release. Then void the affidavit.`,
+ confirmLabel: 'Take me there ›',
+ cancelLabel: 'Cancel',
+ }
+ }
+ return {
+ title: 'The county recorded this lien’s release',
+ message: `${recordedSentence('The release', refusal.recordedYmd, refusal.instrument, fmt)} The county’s record stands.\n\nAsk counsel before either paper is voided.`,
+ confirmLabel: 'Go to the release of record ›',
+ cancelLabel: 'Close',
+ }
+}
+
+/** True for a release whose void takes words: the county's day is kept on it. */
+export function releaseVoidTakesWords(f: { kind: string; filed_at: string | null }): boolean {
+ return f.kind === 'release_of_record' && Boolean((f.filed_at ?? '').slice(0, 10))
+}
+
+/** The confirm window on the void of a release the county recorded. Keeping it is the safe press, and the act is red. */
+export function recordedReleaseVoidWindow(release: Pick, fmt: (ymd: string) => string): ConfirmDialogOptions {
+ return {
+ title: 'The county recorded this release',
+ message: `${recordedSentence('It', (release.filed_at ?? '').slice(0, 10), releaseOwnInstrument(release), fmt)} Voiding it here does not undo the county’s record.\n\nAsk counsel first.`,
+ confirmLabel: 'Void the release anyway',
+ cancelLabel: 'Keep the release',
+ danger: true,
+ cancelIsSafe: true,
+ }
+}
+
+function recordedSentence(subject: string, ymd: string, instrument: string, fmt: (ymd: string) => string): string {
+ return instrument ? `${subject} was recorded ${fmt(ymd)} as ${instrument}.` : `${subject} was recorded ${fmt(ymd)}.`
+}
+
+/** The lines the tab draws on the way: under the release's lit **Void**, and on the affidavit's line once the release is voided. */
+export const VOID_REFUSAL_WORDS = {
+ pressVoidHere: 'Press Void here, then Confirm void. Then void the affidavit.',
+ wayBack: 'The release is voided. The affidavit can be voided now.',
+} as const
+
+/** The **Void** press of a filing's line, for the light. */
+export function filingVoidPressSelector(filingId: string): string {
+ return `[data-lien-filing-row="${filingId}"] [data-lien-filing-void]`
+}
diff --git a/to-dos/lien-release-road-faults/README.md b/to-dos/lien-release-road-faults/README.md
index 0004fd73be..ef2c7ee6d8 100644
--- a/to-dos/lien-release-road-faults/README.md
+++ b/to-dos/lien-release-road-faults/README.md
@@ -2,7 +2,7 @@
name: "The release road: every fault found on the way to releasing a paid lien, and the ones left to mend"
number: 479
group: ready
-status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 2 is built (v2.9195) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 11 is built (v2.9230) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · the first half of step 7 is built (v2.9255) · step 14 is measured · the rest of step 7 and step 9 are left, and the word on step 14
+status: asked 2026-12-02 (UTC) by the owner · the road read in the code and walked once on a ZZ Test lien the same day · the five mends that were in open PRs are on main · step 1 is built (v2.9190) · step 2 is built (v2.9195) · step 3 is built (v2.9216) · step 4 is built (v2.9219, v2.9238) · step 5 is built (v2.9222) · step 6 is built (v2.9224) · step 8 is built and owes a push (v2.9240) · step 10 is built (v2.9229, v2.9239) · step 11 is built (v2.9230) · step 12 is built (v2.9232) · step 13 is built (v2.9234) · the owner answered the three calls on 2026-12-02 · step 7 is built (v2.9255, v2.9260) · step 14 is measured and closed with no build · step 9 is left
summary: >
The owner asked for help releasing a paid lien and printing its release, and for every bug on
the way. One thread read the road in the code and found fourteen faults, findings 808 to 821.
@@ -12,11 +12,11 @@ summary: >
the most serious first. Two can mislead on a real lien today. On a job with two liens the
county's stamp can land on the wrong release. And a release that is only saved already reads
Released.
-next: The rest of step 7, finding 816. The void of an affidavit with a live release is refused by the window as drawn, and the void of a recorded release takes words.
-ask: owner · look · A look at the refused void on a ZZ Test lien once step 7 is built: the window, its Take me there press, and the way back to the affidavit.
-size: L as a train of fourteen (M · M · S · S · S · S · M · M · S · S · XS · S · S · S); left: steps 7 and 9
-blocker: Step 7 has none: the owner said *Yes, build it* on its drawing. Step 8 is built and owes one push after its merge. Step 9 is built after card #477. Step 14 is measured, and the measure found nothing of this door's to mend.
-opinion: build — step 7 next. A voided affidavit that leaves its release behind makes the desk offer a second release on the same lien.
+next: Step 9, finding 818, after card #477 is built. The desk's path knows the wait on a check, and the Board keeps one chip a lien.
+ask: owner · look · A look at the refused void on a ZZ Test lien: the window, its Take me there press, and the way back to the affidavit.
+size: L as a train of fourteen (M · M · S · S · S · S · M · M · S · S · XS · S · S · S); left: step 9
+blocker: Step 9 is built after card #477. Step 8 owes one push after its merge. Nothing else is left.
+opinion: build — card #477 next, then step 9, which closes this card.
mockup: mockup.html — the window that refuses the void of an affidavit with a live release, and where Take me there lands (call 2, step 7). Every other step mends a press, a line or a guard on a screen that is already drawn.
---
@@ -62,7 +62,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 813 | A job has two liens. Keeping **Recorded on** throws the tab onto the other lien before **Instrument number** is typed. | read | Built in step 1, v2.9190. The tab holds the lien it stands on. |
| 814 | A release is saved and the county has not recorded it. The job's bills owe again. The tab still says *Sign it before a notary. Then record it at the county.* Its print is live. Payoffs and the day's run hold the same release. | read | Mended by v2.9222, step 5: the tab reads the same hold, its two presses wait and the reason stands under them. |
| 815 | **Download PDF** files no copy. Neither press marks the release as printed for the notary. When a check then comes back, the app says no release has left the office. The day's run prints it again. | read | Mended by v2.9224, step 6: a download files a copy, and the tab's print or download marks a saved release as printed for the notary. |
-| 816 | Voiding a filed affidavit that has a release leaves the release with no lien. Payoffs, the Board and the tab offer a second release, and the head still says released. Under **Filings on this job** a release's line names no lien, number or day, so two cannot be told apart. A release the county recorded voids with the same two presses and no words. | read, its line seen | Built in part, v2.9255: a release's line names its lien, its day and where it stands. Left: the refused void, and the words on a recorded release's void. Step 7. |
+| 816 | Voiding a filed affidavit that has a release leaves the release with no lien. Payoffs, the Board and the tab offer a second release, and the head still says released. Under **Filings on this job** a release's line names no lien, number or day, so two cannot be told apart. A release the county recorded voids with the same two presses and no words. | read, its line seen | Built in step 7, v2.9255 and v2.9260. A release's line names its lien, its day and where it stands. The void of an affidavit with a live release is refused by a window that leads to the release. The void of a recorded release asks first. |
| 817 | Around the reload after **Save release record** a second release row can be written. Nothing in the database ties one release to one lien. A reload that fails draws *No recorded lien on this job*. | plausible | Built, v2.9240, step 8. The save asks the database first, and a partial unique index holds the rule. It owes one push after its merge. |
| 818 | The desk's path is never told that a release waits on a check. It says *Paid — file the release of record.* with **File the release ›** while the tab's presses are dead. The Board keeps one chip a job in a bin. So on a job with two liens **Make N release ›** can leave one out. | read | Not started. Step 9. |
| 819 | Keeping the instrument number writes every kept fact of the release back from the window's copy. A fact another screen wrote in the meantime is lost. That can be the notary's day, the copies' day or the mark of a check that came back. | plausible | Mended, v2.9229 and v2.9239, step 10. The tab's writes read the row fresh. The day's run, Payoffs and the returned check's mark write through `keepReleaseFacts`, which now reads each release fresh too. |
@@ -79,7 +79,7 @@ State is as read on GitHub and on `main` on 2026-12-02 at 19:17 UTC.
| 824 | The bin *Paid awaiting release* counts liens. Its press leaves no To do row for a paid lien that owes its release. | seen | Mended, v2.9163 (PR #10623), on `main`. It is step 6 of card #472. |
| 825 | On a job with no property facts, the paper's owner and property description are blank lines. The tab says nothing before **Save release record** takes it. | seen | Built, v2.9234. A line above the presses names each blank and where it is fixed. Step 13. |
| 826 | A lien was filed and then released. It never had a To do row, while the Board and Payoffs showed it. | seen | v2.9163 (PR #10623) added the rows, on `main`. This case is still to check on the live site. |
-| 827 | A link that opens the Lien window on a job took about nine seconds to draw the window. | seen | Measured on 2026-12-02. The door costs about a second on a warm load. Step 14. |
+| 827 | A link that opens the Lien window on a job took about nine seconds to draw the window. | seen | Measured on 2026-12-02: the door costs about a second on a warm load. Closed with no build on the owner's word of 2026-12-03. Step 14. |
Findings 822 and 823 are faults of the desk's Board and To do, not of the road. They are in the
Lien desk lane's note of run 17 and are not on this card.
@@ -126,13 +126,15 @@ Lien desk lane's note of run 17 and are not on this card.
the run, and says why.
6. **Built, v2.9224. A download is a copy, and a print is marked (S). 815.** **Download PDF** files a copy as the
print does. Either press marks the release as out for the notary.
-7. **First half built, v2.9255. Voids that leave nothing behind (M). 816.** The void of an affidavit with a live release
+7. **Built, v2.9255 and v2.9260. Voids that leave nothing behind (M). 816.** The void of an affidavit with a live release
is refused by a window with a **Take me there** press, which brings the person to the release
and shows where to press (call 2). The window and its flow are drawn in
[`mockup.html`](mockup.html), *Now* beside the suggestion. The owner said *Yes, build it* on
- the drawing on 2026-12-02. That half is not built yet. Built, v2.9255: a release's line
- under **Filings on this job** names its lien, its number and its day. Left with the window:
- voiding a release the county recorded takes words.
+ the drawing on 2026-12-02 and again on 2026-12-03 (*Every pick*). It is built as drawn, v2.9260.
+ Built, v2.9255: a release's line under **Filings on this job** names its lien, its number and
+ its day. Voiding a release the county recorded takes words: **Void** on its own line opens a
+ confirm window, *The county recorded this release*, with **Keep the release** and a red
+ **Void the release anyway** (the owner's pick of 2026-12-03, v2.9260).
8. **Built, v2.9240. One release a lien (M). 817.** The save is guarded in the client. A rule in the database
ties one live release to one lien. This step is a migration and owes a push after its merge.
9. **The desk's path knows the wait, and one chip a lien (S). 818.** Built after card #477, since
@@ -145,12 +147,12 @@ Lien desk lane's note of run 17 and are not on this card.
**Upload the scanned PDF**. The scan is named as a release in the job's folder.
13. **Built, v2.9234. Missing property facts are named before the save (S). 825.** A line above the presses names
each fact the paper would print blank. It names and does not hold.
-14. **Measured, 2026-12-02. The slow link (S). 827.** Measure what the nine seconds are first. Then mend what the
+14. **Closed with no build, 2026-12-03. The slow link (S). 827.** Measure what the nine seconds are first. Then mend what the
measure shows. Two warm loads of the link on a ZZ Test job drew the window 2.5 and 1.5 seconds
after the load began. The one job's read took between half a second and a second and a half.
The window was up at once after it. So the door costs about a second. The nine seconds was a
cold load of the Jobs page's scripts, which is the app's own start. The measure shows nothing
- of this door's to mend. Whether the step closes with no build is asked of the owner.
+ of this door's to mend. The owner closed the step with no build on 2026-12-03 (*Every pick*).
## The calls, each answered
@@ -170,6 +172,8 @@ The owner answered on 2026-12-02 (UTC), relayed by the managing session of run 1
**Answered on the drawing, 2026-12-02.** Asked *Card #479: is the release of record the right place for the press to lead?*, the owner pressed *Yes, build it*. So the window for a release the county has already recorded carries **Go to the release of record ›** beside Close, it leads where the drawing's step 4 shows, and it voids nothing. The whole drawing is the build: the refused void, **Take me there ›**, the lit **Void**, the way back, and this window.
+**Three more calls, answered 2026-12-03 (UTC).** They were put with their picks, and the owner said: *Every pick, both*. The refused void is built as drawn. The void of a release the county has recorded opens a confirm window, with **Keep the release** as the safe press and a red **Void the release anyway**: a county day typed on the wrong release still has a way out. Step 14 closes with no build, on the measure written under it.
+
## Where each lives
Files and lines are `main`'s at `c7cdafa95c`. Read them again before a step: five PRs on these
@@ -205,9 +209,7 @@ files have landed since, and the lines have moved.
## Where it stands
-Written on 2026-12-02 (UTC), brought current on 2026-12-03 (UTC). Of the fourteen steps, eleven
-are built: 1 to 6, 8, 10, 11, 12 and 13. Step 8 owes one push after its merge. Step 14 is
-measured, and the measure found nothing of this door's to mend. Two steps are left. Step 7 is
-next. Its first half is built, the release's line that names its lien (v2.9255). The refused void as drawn is left. Step 9
-is built after card #477. Finding 810 is decided on card #477 and is built with it. The looks on
-the live site are owed for every step.
+Written on 2026-12-02 (UTC), brought current on 2026-12-03 (UTC). Of the fourteen steps, twelve
+are built: 1 to 8 and 10 to 13. Step 8 owes one push after its merge. Step 14 was measured and
+the owner closed it with no build. One step is left. Step 9 is built after card #477, and
+finding 810 is built with that card. The looks on the live site are owed for every step.
From 578cceabc5ea83d9eecb0b293bfd8d84078800d4 Mon Sep 17 00:00:00 2001
From: Tony
Date: Wed, 2 Dec 2026 22:37:15 -0600
Subject: [PATCH 21/21] migration restamped 20261203043643: main holds a later
stamp than 20261202211100 and prod has applied it (punch list #479 step 8)
Co-Authored-By: Claude Fable 5.2
---
docs/LIEN_DESK_ARCHITECTURE.md | 2 +-
...se_a_lien.md => 20261203043643_one_live_release_a_lien.md} | 2 +-
docs/recent-features/v2.9240.md | 4 ++--
src/lib/jobs/lienReleaseOfRecord.test.ts | 2 +-
src/lib/jobs/lienReleaseOfRecord.ts | 2 +-
..._a_lien.sql => 20261203043643_one_live_release_a_lien.sql} | 0
supabase/tests/lien_early_on_check/20_scenario.sql | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
rename docs/migrations/{20261202211100_one_live_release_a_lien.md => 20261203043643_one_live_release_a_lien.md} (97%)
rename supabase/migrations/{20261202211100_one_live_release_a_lien.sql => 20261203043643_one_live_release_a_lien.sql} (100%)
diff --git a/docs/LIEN_DESK_ARCHITECTURE.md b/docs/LIEN_DESK_ARCHITECTURE.md
index c5704e91b9..b403ccc1b0 100644
--- a/docs/LIEN_DESK_ARCHITECTURE.md
+++ b/docs/LIEN_DESK_ARCHITECTURE.md
@@ -770,7 +770,7 @@ last_updated: 2026-12-03
> **v2.9238 (the paper as last printed):** `releaseFactsPatch` keeps the nine paper facts under `fields.printedPaper` whenever it sets `printedForNotary`, for the tab, Payoffs and the run alike, and takes it off with the mark.
> `releasePaperChangedSincePrint` compares the row to it, `releaseReprintWords` says what changed and to print again, and `markReleaseOut` marks a second print when the paper changed since the first.
> **v2.9239 (the run and Payoffs read fresh too, the rest of finding 819):** `keepReleaseFacts` reads every release it is handed in one read and builds `releaseFactsPatch` on the facts the database holds, a release voided in the meantime is held with `RELEASE_RUN_WORDS.gone`, and a row's own `fields` is no longer written.
-> **v2.9240 (one live release a lien, finding 817):** `recordRelease` takes one save at a time and asks the database for a live `release_of_record` row whose `fields ->> 'releasesFilingId'` is this lien before it inserts, and migration `20261202211100` holds the same rule as the partial unique index `job_lien_filings_one_live_release_idx`.
+> **v2.9240 (one live release a lien, finding 817):** `recordRelease` takes one save at a time and asks the database for a live `release_of_record` row whose `fields ->> 'releasesFilingId'` is this lien before it inserts, and migration `20261203043643` holds the same rule as the partial unique index `job_lien_filings_one_live_release_idx`.
> `isOneLiveReleaseRefusal` reads the index's refusal by its name, and `loadFilings` in `LienInstrumentsModal` keeps the records it holds when a reload fails.
> **v2.9190 (a door names its lien, findings 808 and 813):** `pickReleaseTarget` takes a third value, the lien the door named, read after the lien the tab holds and before the rule.
> The doors are a lien's row in Payoffs and a release's line on the day's run: each `onOpenRelease` hands the job and its `affidavitId`, `LienDeskPage` keeps it as `releaseLienId` on the window it opens, and `LienInstrumentsModal` hands it to `LienFilingTabs`.
diff --git a/docs/migrations/20261202211100_one_live_release_a_lien.md b/docs/migrations/20261203043643_one_live_release_a_lien.md
similarity index 97%
rename from docs/migrations/20261202211100_one_live_release_a_lien.md
rename to docs/migrations/20261203043643_one_live_release_a_lien.md
index e67a96e81d..747b1ad423 100644
--- a/docs/migrations/20261202211100_one_live_release_a_lien.md
+++ b/docs/migrations/20261203043643_one_live_release_a_lien.md
@@ -1,4 +1,4 @@
-# 20261202211100_one_live_release_a_lien.sql (2026-12-02, v2.9240)
+# 20261203043643_one_live_release_a_lien.sql (2026-12-02, v2.9240)
One live release a lien: step 8 of punch list #479 (the release road's faults), finding 817.
diff --git a/docs/recent-features/v2.9240.md b/docs/recent-features/v2.9240.md
index 81cad774df..67ac650222 100644
--- a/docs/recent-features/v2.9240.md
+++ b/docs/recent-features/v2.9240.md
@@ -1,6 +1,6 @@
# v2.9240 — Release of record: a lien takes one release, whatever the window shows (2026-12-02)
-Step 8 of punch list #479 (the release road's faults), finding 817. **Owes prod one `supabase db push`** after the merge: migration `20261202211100_one_live_release_a_lien.sql`. Stacked on v2.9239, which changes the same card.
+Step 8 of punch list #479 (the release road's faults), finding 817. **Owes prod one `supabase db push`** after the merge: migration `20261203043643_one_live_release_a_lien.sql`. Stacked on v2.9239, which changes the same card.
## What was wrong
@@ -12,7 +12,7 @@ Step 8 of punch list #479 (the release road's faults), finding 817. **Owes prod
- [`LienFilingTabs.tsx`](../../src/components/jobs/LienFilingTabs.tsx): `recordRelease` takes one save at a time and first asks the database for a live release that names this lien. If one is there it saves nothing, says *This lien already has a saved release. It is shown now.* and reads the job again.
- The migration adds a partial unique index on `fields ->> 'releasesFilingId'` over live releases. `isOneLiveReleaseRefusal` reads its refusal by the index's name, and the save answers with the same sentence.
- [`LienInstrumentsModal.tsx`](../../src/components/jobs/LienInstrumentsModal.tsx): a reload of the lien records that fails keeps what the window holds and says so (`LIEN_WINDOW_FILINGS_UNREAD`).
-- [`docs/migrations/20261202211100_one_live_release_a_lien.md`](../migrations/20261202211100_one_live_release_a_lien.md) has the order, the proof and what a failed push means.
+- [`docs/migrations/20261203043643_one_live_release_a_lien.md`](../migrations/20261203043643_one_live_release_a_lien.md) has the order, the proof and what a failed push means.
## Order on prod
diff --git a/src/lib/jobs/lienReleaseOfRecord.test.ts b/src/lib/jobs/lienReleaseOfRecord.test.ts
index fa09632760..85dd1e3442 100644
--- a/src/lib/jobs/lienReleaseOfRecord.test.ts
+++ b/src/lib/jobs/lienReleaseOfRecord.test.ts
@@ -475,7 +475,7 @@ describe('one live release a lien: the database’s refusal (finding 817, v2.924
it('carries the name the migration gives the index, and says it in plain words', () => {
expect(ONE_LIVE_RELEASE_INDEX).toBe('job_lien_filings_one_live_release_idx')
- const sql = readFileSync('supabase/migrations/20261202211100_one_live_release_a_lien.sql', 'utf8')
+ const sql = readFileSync('supabase/migrations/20261203043643_one_live_release_a_lien.sql', 'utf8')
expect(sql).toContain(`CREATE UNIQUE INDEX IF NOT EXISTS ${ONE_LIVE_RELEASE_INDEX}`)
expect(sql).toContain("(fields ->> 'releasesFilingId')")
expect(sql).toContain('voided_at IS NULL')
diff --git a/src/lib/jobs/lienReleaseOfRecord.ts b/src/lib/jobs/lienReleaseOfRecord.ts
index c6403f5109..d93eade3fb 100644
--- a/src/lib/jobs/lienReleaseOfRecord.ts
+++ b/src/lib/jobs/lienReleaseOfRecord.ts
@@ -320,7 +320,7 @@ export function releasePaymentDatePatch(fields: unknown, day: string): Record