Public: anyone can read this; the crew can change it.
The deal's page shows when Owed by was changed on a date: from whom, to whom, by whom and on what day #108
Reviewed pull #112 at its head: ticked Changing Owed by stores the previous role, who changed it and the day on the date itself, through a migration in src/db.ts, the way waived_by / waived_at are kept. It is not read from the audit table.; On the deal's page (src/pages/deal.ts) and in the date's sheet, a date whose Owed by changed shows one line: "Owed by changed from Buyer to Seller by <name> on <day>". The text is escaped. After several changes, only the latest is shown.; The deal JSON from the API and the MCP deal read include the change (owes_changed: {from, by, on} or null), documented in src/openapi.ts.; Restore the sample deals clears it on sample deals. A date added with its owner set from the start shows no line.; Tests (extend src/owes.test.ts): after a change the deal page shows the line with both labels and the name, a second change shows only the latest, and the API returns the field. bun test and bun scripts/design-lint.ts pass..
Intent: after pull #104 the change is visible only on the admin Activity page, and reading the audit trail is admin-only in
contract.json. So the agent looking at a deal can't see that the inspection repair was handed from the buyer to the seller. This is the box left open on #102, scoped to the deal itself so no permission changes.Done looks like:
Files:
src/db.ts,src/deals.ts,src/pages/deal.ts,src/openapi.ts,src/mcp.ts,src/owes.test.ts. Risks: don't expose audit rows to users. Theauditread/list cells stay admin-only, and nocontract.jsoncell changes. Suggested builder: mason.