Skip to content

build: run deslag in fmt-check - #508

Merged
webern merged 3 commits into
mainfrom
deslag-onboarding
Nov 9, 2026
Merged

webern merged 3 commits into
mainfrom
deslag-onboarding

Conversation

@webern

@webern webern commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Human Summary

I have been experimentally building a linter for things that LLMs do in prose that annoy me. Here we onboard that linter, deslag, on a subset of the repo and fix the lints it found.

Summary

deslag, the prose linter added to the build tools in #488, now runs as part of make fmt-check, after clang-format. deslag.toml selects:

  • AGENTS.md and every Markdown file under docs/
  • comments in the mx::api headers and sources (src/include/mx/api, src/private/mx/api)

Generated code (src/private/mx/core/generated) is excluded. Every deslag lint is on. The limits are the defaults except two: 30 entries for the AGENTS.md repository layout, and 700/350 characters for a paragraph/list item.

To get the gate green:

  • Fixed the prose deslag reported in AGENTS.md, 41 api headers, xml-backend.md and api-roundtrip-classifier.md. Most fixes are "has no X" becoming "does not have an X", em dashes, and "own"/"at all" padding. A few long paragraphs were split, and the classifier doc lost its bold and italics.
  • Trimmed the AGENTS.md repository layout to 30 one-line entries, and updated its quality-gates paragraph to say fmt-check runs deslag.
  • Deleted seven design docs that only recorded finished or superseded work: mx-core-plan, mx-core-opus-4.7, mx-core-gpt-5.0, mx-impl-port-brief, mx-impl-port-plan, newgen-integration-plan and release-process.
  • Removed every reference to those seven docs, including the "(plan §2.x)" citations in the gen/cpp templates. That accounts for the comment-only changes in 223 regenerated core files.

make doctor reports a missing deslag on the fmt-check row. Natively, fmt-check stops with a pointer to make deslag. The mx-sdk image already ships deslag, so CI needs no workflow change.

Testing

  • make fmt-check passes in Docker (clang-format and deslag, 122 files)
  • make gen leaves the tree unchanged (generated output matches the templates)
  • make gen-test passes (154 tests)
  • make core-roundtrip-test passes (842 test cases)
  • make api-test not run locally; only comments changed under mx::api

References

@webern webern added non-breaking fixes or implementation that do not require breaking changes api Affects the mx::api layer gen The gen/ directory which is generating code from the spec ai Issues opened by, or through, a coding agent. labels Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

gen-quality gen/

gen-quality: 84.8 / 100   (floor 84.5, +0.3)

  structure     86.2  x0.50   [fn 90.8 / file 81.6]
  cyclomatic    89.0  x0.25
  cognitive     77.9  x0.25

  436 functions across 32 files, 8133 lines (largest file 1103)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:1014   _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      35
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      97
  size       gen/plates/build.py:1014   _validate_config_against_ir        90
  size       gen/plates/build.py:572    _value_plate                       89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit 90e7b993eec451ef107b4f84c7fcebb76d964fa2.

Comment thread deslag.toml Resolved
Comment thread deslag.toml Resolved
Comment thread deslag.toml Resolved
Comment thread src/include/mx/api/ApiCommon.h Resolved
Comment thread src/include/mx/api/TransposeData.h Resolved
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

gen-quality gen/

gen-quality: 84.8 / 100   (floor 84.5, +0.3)

  structure     86.2  x0.50   [fn 90.8 / file 81.6]
  cyclomatic    89.0  x0.25
  cognitive     77.9  x0.25

  436 functions across 32 files, 8133 lines (largest file 1103)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:1014   _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      35
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      97
  size       gen/plates/build.py:1014   _validate_config_against_ir        90
  size       gen/plates/build.py:572    _value_plate                       89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit 4a2ae997f4c2092eeeb1d42228f0547153deaaea.

Onboard deslag, the prose linter, for AGENTS.md, docs/ and the mx::api
headers and sources. make fmt-check now runs deslag check after
clang-format. Generated code is excluded.

Fix the prose deslag reports in those files, and delete the old design
docs that recorded finished work, along with the references to them
(including the plan citations in gen/cpp templates, regenerated).
Fix the enclosure comment's negation, restore the transpositions table
with a density override for TransposeData.h, reword two banned-phrase
hints in both the md and cpp sections, and fix the MarkDataChoice prose
main gained since the branch was cut.
@webern
webern force-pushed the deslag-onboarding branch from 8047458 to f4d4343 Compare November 9, 2026 09:22
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

gen-quality gen/

gen-quality: 84.8 / 100   (floor 84.5, +0.3)

  structure     86.2  x0.50   [fn 90.8 / file 81.6]
  cyclomatic    89.0  x0.25
  cognitive     77.9  x0.25

  436 functions across 32 files, 8133 lines (largest file 1103)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:1014   _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      35
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      97
  size       gen/plates/build.py:1014   _validate_config_against_ir        90
  size       gen/plates/build.py:572    _value_plate                       89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit 1a3fa22bc7865c098a2f9e37d5d7db5844637b58.

Comment thread .github/release/Package.swift.template Resolved
Signed-off-by: Matthew James Briggs <matthew.james.briggs@gmail.com>
@webern
webern marked this pull request as ready for review November 9, 2026 09:37
@webern
webern merged commit 8990162 into main Nov 9, 2026
@webern
webern deleted the deslag-onboarding branch November 9, 2026 09:38
@webern webern mentioned this pull request Nov 9, 2026
3 of 4 tasks
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

gen-quality gen/

gen-quality: 84.8 / 100   (floor 84.5, +0.3)

  structure     86.2  x0.50   [fn 90.8 / file 81.6]
  cyclomatic    89.0  x0.25
  cognitive     77.9  x0.25

  436 functions across 32 files, 8133 lines (largest file 1103)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:1014   _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      35
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      97
  size       gen/plates/build.py:1014   _validate_config_against_ir        90
  size       gen/plates/build.py:572    _value_plate                       89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit 89901629b64dd8fb2942b1e1d6850e43dd2ad55d.

webern added a commit that referenced this pull request Nov 9, 2026
## Summary

Extends deslag to the agent skills and bans the word "knob".

- `deslag.toml` now lints `/.agents/skills/**/*.md`. `.claude/skills` is
a symlink to the same directory, so only the `.agents` path is listed.
- The four skills whose frontmatter says `llm-edit: false`
(`mx-api-doctrine`, `mx-comments`, `mx-open-issue`, `mx-open-pr`) are
excluded by exact path, since their owner does not want automatic prose
edits. `mx-comments` and `mx-api-doctrine` gain the marker in this PR.
- `mx-api-classify-roundtrip-failures` was the only skill with lint
hits. They are fixed without changing its meaning: emphasis removed, em
dashes and an arrow replaced, and a few negations reworded.
- "knob" and "knobs" are banned in the `md` and `cpp` lints. The
existing uses are replaced with the real term (field or parameter) in
`gen/AGENTS.md`, `gen/DESIGN.md`, the `gen/press/engine.py` docstring, a
comment in `gen/tests/test_press.py`, the review instructions under
`.github/instructions/`, and the `mx-api-doctrine` heading.
- The `mx-open-issue` and `mx-open-pr` skills and
`api-headers.instructions.md` are also rewrapped to 100 columns.

No code behavior changes: the Python edits are in docstrings and
comments.

## Testing

- [x] `make fmt-check` passes (clang-format and `deslag check`)
- [x] `deslag explain` shows the four `llm-edit: false` skills excluded,
including through the `.claude/skills` symlink
- [x] `gen/press/engine.py` and `gen/tests/test_press.py` byte-compile
- [ ] The gen test suite was not run, because only docstrings and
comments changed

## References

- Follows #508, which added deslag to `fmt-check`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Issues opened by, or through, a coding agent. api Affects the mx::api layer gen The gen/ directory which is generating code from the spec non-breaking fixes or implementation that do not require breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant