Public: anyone can read this; the crew can change it.

The MLS description shows its length against the MLS public remarks limit, and one over it cannot be approved without saying so #109

opened this

Merged 25d 6h ago, live in production

The MLS description on /listings/:id now shows N / 1,000 characters beside its box. It counts in code points and updates as the agent types. I ran the listing, post-length, OpenAPI and terminal tests and they pass.

Notes

opened this

The MLS description on /listings/:id now shows N / 1,000 characters beside its box. It counts in code points and updates as the agent types. I ran the listing, post-length, OpenAPI and terminal tests and they pass. tsc and the gate and design-lint scripts were not run: there is no tsconfig.json, and the repo has no scripts/gate.ts or scripts/design-lint.ts (scripts/lint-design.ts is the lint script and printed no findings). I did not run the whole suite, and I never started the app.

What changed

  • Limit and counting: MLS_LIMIT = 1000 sits beside LIMITS in src/postlength.ts, with the counting helpers. The page, /fair-housing, the edit response and the terminal all use countLine(kind, text).
  • Approving over the limit: approveAsset in src/actions.ts refuses an MLS description over 1,000 with "Too long for the MLS remarks by N. Approve it knowing so: send tooLong: true." The page's Approve button reads "Approve — too long for the MLS" and sends too_long.
  • Terminal: it shows the count and the note, and asks for a second a.
  • Audit: such an approval is recorded as approved_too_long_for_mls; an over-length post still reads approved_too_long_for_x. I did not find a seller-report path that reads these outcomes, so I changed nothing there.
  • API and MCP: both go through the same approveAsset, so the rule holds there. They refuse approving outright (person_required), so only the page and terminal can use the acknowledgement. The PATCH summary in the OpenAPI description now names both limits, and contract/openapi.json is regenerated.
  • Live counter: static/listing.js recounts in code points on every keystroke for the MLS box. The 600 ms server check no longer overwrites that count.
  • No layout shift: the counter has min-width: 24ch in static/app.css.
  • README: the agent section says it in one sentence.

Tests

  • A 1,000-character description approves plainly.
  • A 1,001-character one is refused without the acknowledgement, refused with a non-true value, and accepted with tooLong: true.
  • The audit rows read approved then approved_too_long_for_mls.
  • The page renders the counter, and /fair-housing answers 1,001 / 1,000 characters.
  • The three sample listings' MLS descriptions stay under the limit in every tone.

Changed on purpose: the existing "each social post shows its length" test posted an over-length string as kind: "mls" and expected no length back. The MLS now has a length, so I changed that request to email_update, which still has none. Post-length behaviour is otherwise unchanged.

Not done: the X-style multi-limit line is not used for the MLS, since it has one limit. I did not loosen any contract.json cell.

To try it: open a listing's MLS description, paste more than 1,000 characters, and watch the counter. Save it, then Approve; the button names the overrun.

🤖 Generated with Claude Code

Closes #106

commented

The MLS description on /listings/:id now shows N / 1,000 characters beside its box. It counts in code points and updates as the agent types. I ran the listing, post-length, OpenAPI and terminal tests and they pass. tsc and the gate and design-lint scripts were not run: there is no tsconfig.json, and the repo has no scripts/gate.ts or scripts/design-lint.ts (scripts/lint-design.ts is the lint script and printed no findings). I did not run the whole suite, and I never started the app.

What changed

  • Limit and counting: MLS_LIMIT = 1000 sits beside LIMITS in src/postlength.ts, with the counting helpers. The page, /fair-housing, the edit response and the terminal all use countLine(kind, text).
  • Approving over the limit: approveAsset in src/actions.ts refuses an MLS description over 1,000 with "Too long for the MLS remarks by N. Approve it knowing so: send tooLong: true." The page's Approve button reads "Approve — too long for the MLS" and sends too_long.
  • Terminal: it shows the count and the note, and asks for a second a.
  • Audit: such an approval is recorded as approved_too_long_for_mls; an over-length post still reads approved_too_long_for_x. I did not find a seller-report path that reads these outcomes, so I changed nothing there.
  • API and MCP: both go through the same approveAsset, so the rule holds there. They refuse approving outright (person_required), so only the page and terminal can use the acknowledgement. The PATCH summary in the OpenAPI description now names both limits, and contract/openapi.json is regenerated.
  • Live counter: static/listing.js recounts in code points on every keystroke for the MLS box. The 600 ms server check no longer overwrites that count.
  • No layout shift: the counter has min-width: 24ch in static/app.css.
  • README: the agent section says it in one sentence.

Tests

  • A 1,000-character description approves plainly.
  • A 1,001-character one is refused without the acknowledgement, refused with a non-true value, and accepted with tooLong: true.
  • The audit rows read approved then approved_too_long_for_mls.
  • The page renders the counter, and /fair-housing answers 1,001 / 1,000 characters.
  • The three sample listings' MLS descriptions stay under the limit in every tone.

Changed on purpose: the existing "each social post shows its length" test posted an over-length string as kind: "mls" and expected no length back. The MLS now has a length, so I changed that request to email_update, which still has none. Post-length behaviour is otherwise unchanged.

Not done: the X-style multi-limit line is not used for the MLS, since it has one limit. I did not loosen any contract.json cell.

To try it: open a listing's MLS description, paste more than 1,000 characters, and watch the counter. Save it, then Approve; the button names the overrun.

🤖 Generated with Claude Code

commented

I've addressed all four of Sentinel's points on this branch and pushed. src/tty.test.ts and src/listings.test.ts pass (57 tests); I did not run the full suite.

  • Terminal test: I added "the terminal shows the MLS description's count, and one over 1,000 needs a second a" in src/tty.test.ts.
    • It uses a 1,003-character MLS description.
    • The screen shows 1,003 / 1,000 characters and ! Too long for the MLS remarks by 3.
    • The first a asks and leaves "0 of 7 approved".
    • The second a prints "Approved, too long for the MLS." and shows "1 of 7 approved".
    • The audit row reads approved_too_long_for_mls.
    • The terminal MLS paths are new in this pull, so the test fails without it.
  • API and MCP refusal: the existing "only a person approves" test in src/listings.test.ts now also pins that a 1,001-character MLS description with tooLong: true is refused with person_required on both the api and mcp doors, and stays unapproved.
  • Doc comment: the approveAsset comment in src/actions.ts is re-wrapped.
  • Seller report: I found no report code that reads audit outcomes, and the README now says so. The audit trail (approved_too_long_for_mls) is where it's recorded. If a seller report is meant to show it, that is a separate change.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs