Skip to content

fix(pay): read a settlement clause standing on its own as the method - #162

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
iliasabk:fix/pay-standalone-settlement-clause
Sep 21, 2026
Merged

ralyodio merged 1 commit into
profullstack:masterfrom
iliasabk:fix/pay-standalone-settlement-clause

Conversation

@iliasabk

Copy link
Copy Markdown
Contributor

readPayLine reads "…, settled in SOL" / "via bank transfer" / "paid in USDC" off the end of a line and returns it as the method. normalisePay then splits a string pay field on newlines and ; before handing each piece to readPayLine — so the moment the settlement clause stands on its own, the whole pay is refused with Could not find an amount in "", an error that quotes an empty string and names nothing.

So all of these were rejected while the same clause inline on a line parses fine:

  • pay: "$0.25 per task; settled in SOL" — the ; is the documented line separator and the same mark SETTLED itself tolerates in front of the clause ([,;]?), which made the clause's own syntax unreachable in the string form.
  • pay: "$0.25 per task\nsettled in SOL" — a clause per line is exactly how the one-line-per-price box invites the text to be written.
  • pay: ["$100 an hour", "via bank transfer"] — the array form an API client naturally produces.
  • pay: [{ text: "paid in USDC" }, { text: "$5k fixed" }] — same for the object-text form.

A standalone clause that names a recognised coin or rail now becomes the method (namedMethod, first one wins, an explicit payMethod still overrides it, as before). A clause naming anything else — in London, paid in magic beans — still refuses the pay, now quoting the clause text itself.

Covered by test/pay-standalone-method.test.ts: the ;, newline, array-entry and {text} forms all read as method + one line, a clause before the lines works, unrecognised words still refuse, payMethod still wins, and unpaid on its own line still clears the lines.

tsc clean, node --test — 366/366 pass.

Submitted under the current paid Agentic Jobs bug-fix offer.

A listing split into one clause per line - "$0.25 per task" then
"settled in SOL" on the next line, after a semicolon, or as its own
array entry - refused the whole pay: the clause was parsed as a price
line, and "Could not find an amount in \"\"" told nobody anything.
The ; the multi-line string splits on is the same mark SETTLED already
tolerates before the clause, so the string form made the clause's own
syntax unreachable.

A standalone clause naming a recognised coin or rail now becomes the
method instead; a clause naming anything else still refuses the pay.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@ralyodio
ralyodio merged commit 50b53ab into profullstack:master Sep 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants