Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4ef21c5
v2.9190 — Lien desk: the county's stamp goes on the lien you pressed …
realrobertdouglas Dec 2, 2026
70b501e
docs(to-dos): card #479 brought current — step 1 built, the five neig…
realrobertdouglas Dec 2, 2026
0076f9d
docs(to-dos): card #479, the owner's answers to its three calls, in t…
realrobertdouglas Dec 2, 2026
6c776b4
Merge remote-tracking branch 'origin/main' into claude/479-step1-rele…
realrobertdouglas Dec 2, 2026
8b106d4
docs: the release tab's render-test count after the merge with main
realrobertdouglas Dec 2, 2026
b6f4918
v2.9216 — Release of record: the payment date follows the payment (fi…
realrobertdouglas Dec 2, 2026
72934fe
docs: v2.9216's line, one sentence a line
realrobertdouglas Dec 2, 2026
fc8e858
v2.9219 — Release of record: correct a saved release's payment date (…
realrobertdouglas Dec 2, 2026
ff72d5c
v2.9222 — Release of record: a held release holds its print (finding …
realrobertdouglas Dec 2, 2026
281dc04
v2.9224 — Release of record: a download is a copy, and a print is mar…
realrobertdouglas Dec 2, 2026
ebdcf1a
v2.9229 — Release of record: the county's stamp no longer overwrites …
realrobertdouglas Dec 2, 2026
8f6d8d3
v2.9232 — Release of record: the stamped release goes on its line as …
realrobertdouglas Dec 2, 2026
bedea57
v2.9234 — Release of record: a blank line on the paper is named befor…
realrobertdouglas Dec 2, 2026
488a29d
v2.9238 — Release of record: a saved release takes the record's facts…
realrobertdouglas Dec 2, 2026
2f114cc
v2.9239 — Lien releases: the run and Payoffs no longer overwrite a fa…
realrobertdouglas Dec 2, 2026
747ed17
v2.9240 — Release of record: a lien takes one release, whatever the w…
realrobertdouglas Dec 2, 2026
f673f0a
chore(edge-kernels): regenerate the copy after the release scan's nam…
realrobertdouglas Dec 2, 2026
5d7efb1
Merge branch 'claude/479-step12-release-scan' into claude/479-step13-…
realrobertdouglas Dec 2, 2026
71609de
Merge branch 'claude/479-step13-property-facts-named' into claude/479…
realrobertdouglas Dec 2, 2026
76ea40c
Merge branch 'claude/479-step4b-record-facts-and-reprint' into claude…
realrobertdouglas Dec 2, 2026
d69322b
Merge branch 'claude/479-step10b-run-reads-fresh' into claude/479-ste…
realrobertdouglas Dec 2, 2026
2415e42
test(sql-beds): the early-on-check bed's releases each name a lien of…
realrobertdouglas Dec 2, 2026
13b5085
Merge branch 'main' of https://github.com/clickconstruction/pipetooli…
realrobertdouglas Dec 3, 2026
42f86c3
Merge remote-tracking branch 'origin/claude/479-step10-stamp-reads-fr…
Dec 3, 2026
8193840
Merge branch 'claude/479-step12-release-scan' into claude/479-step13-…
Dec 3, 2026
9fb4a66
Merge branch 'claude/479-step13-property-facts-named' into claude/479…
Dec 3, 2026
292f60d
Merge branch 'claude/479-step4b-record-facts-and-reprint' into claude…
Dec 3, 2026
eba0325
Merge branch 'claude/479-step10b-run-reads-fresh' into claude/479-ste…
Dec 3, 2026
f59c800
docs(to-dos): card #479, its status lines brought current (steps 2 an…
Dec 3, 2026
035ad6b
v2.9255 — Release of record: a release's line names its lien (finding…
Dec 3, 2026
0942f40
v2.9260 — Lien window: a lien with a release is not voided out from u…
Dec 3, 2026
272e8ce
Merge remote-tracking branch 'origin/main' into claude/479-step10b-ru…
Dec 3, 2026
013be94
Merge branch 'claude/479-step10b-run-reads-fresh' into claude/479-ste…
Dec 3, 2026
578ccea
migration restamped 20261203043643: main holds a later stamp than 202…
Dec 3, 2026
ee08a9c
Merge branch 'claude/479-step8-one-release-a-lien' into claude/479-st…
Dec 3, 2026
a8fa265
Merge branch 'claude/479-step7a-release-line-names-its-lien' into cla…
Dec 3, 2026
806814e
Merge remote-tracking branch 'origin/main' into claude/479-step7b-voi…
Dec 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/LIEN_DESK_ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,11 @@ last_updated: 2026-12-03
> **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 `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.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.
Expand Down
29 changes: 29 additions & 0 deletions docs/recent-features/v2.9255.md
Original file line number Diff line number Diff line change
@@ -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 <day> · 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.
34 changes: 34 additions & 0 deletions docs/recent-features/v2.9260.md
Original file line number Diff line number Diff line change
@@ -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.
144 changes: 143 additions & 1 deletion src/components/jobs/LienFilingTabs.release.render.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -796,3 +796,145 @@ 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<HTMLElement>(`[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()
})
})

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<HTMLElement>(`[data-lien-filing-row="${id}"]`)!
const voidPress = (id: string) => row(id).querySelector<HTMLButtonElement>('[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<HTMLButtonElement>(`[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()
})
})
Loading
Loading