Skip to content

fix(errors): end each refusal with what to write - #165

Merged
ssweber merged 1 commit into
mainfrom
fix/msg-details
Nov 20, 2026
Merged

ssweber merged 1 commit into
mainfrom
fix/msg-details

Conversation

@ssweber

@ssweber ssweber commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Every refusal's detail() now ends with what to write, plus an example the field accepts. For example: Coil.operand: 'out' is not a CLICK address. Write an address, such as Y001. The .code, .field, .fields, click_id and exception class of every refusal stay the same. That was checked across 78,695 collected refusals.

Messages

  • Detail. detail() now ends with what to write for each listed code. Pointer refusals end "Write an address, such as DS1." or name the field's own bank.
  • Hex Math. A hex Math gives hex examples, such as DH1 + 2h and DH1 * ( -2h ). A function the formula's mode refuses names the other mode's registers.
  • SC and SD pointers. A pointer into SC or SD now suggests a writable address: SC50 or SD29.
  • Numbers. Numbers appear without quotes, such as 5 is …. Text keeps its quotes, so '1' and 1 stay distinct.
  • Quoted keywords. read_csv names a quoted keyword exactly, for example copy: oneshot="1" is in quotes; write oneshot=1.
  • sum-option-slot. This message no longer explains how CLICK behaves.
  • Docs. encoding.md and decoding.md give the new wording, and the UndecodedRungWarning docstring is fixed.

New checks (tests/test_refusal_details.py)

  • Messages. Every collected refusal has a short() and a detail(). The NO_DETAIL allowlist may only shrink.
  • Field names. Every .field and .fields item reads Class.field or Class.field[i].
  • Code coverage. Every Code raised at a FieldError site is reached by a collected refusal.
  • Examples. Each "such as" example is put back into its field, and the instruction must then build. Before the fixes this check caught 64 bad examples. Its EXAMPLE_NOT_SUBSTITUTED allowlist may only shrink.

Known gaps, next branch

19 allowlist entries are marked "the example comes from the field's banks, not from the other end or the other operand". These are odd inputs, such as Coil("Y001", range_end="$41"), that suggest Y001. A follow-up branch will build those examples from the partner field. It will also:

  • make the Send SD example follow the function code;
  • make the Math mode advice check constants as well as registers.

Checks

  • Editor-grid verdicts. Only the message lines changed, regenerated by make editor-grids.
  • Ground truth. No answers file, capture, golden or verify_progress.log changed.
  • Test expectations. 19 test files expect new text. Every new expected sentence was checked by building the advised form.

Gate

  • make lint: passed.
  • make docs-build: passed.
  • editor_grids.py --check: passed.
  • make test: 19105 passed, 139 skipped.

Each refusal's detail() now ends with what to write and an example
that the field accepts, such as "Write an address, such as DS1." A
hex Math gives hex examples, such as DH1 + 2h, and a pointer into SC
or SD gives a writable address, such as SC50 or SD29. Numbers show
without quotes. read_csv names a quoted keyword as oneshot="1" and
says to write oneshot=1.

tests/test_refusal_details.py checks that every refusal has a short()
and a detail(), that every .field is Class.field or Class.field[i],
that every Code raised as a FieldError is reached, and that each
"such as" example is accepted when put back into its field. Each
allowlist there can only shrink.

The .code, .field, .fields and click_id of every refusal, and its
exception class, are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ssweber
ssweber merged commit 41c22a7 into main Nov 20, 2026
7 checks passed
@ssweber
ssweber deleted the fix/msg-details branch November 20, 2026 03:11
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.

1 participant