Skip to content

Describe corpus files in comments and docs without naming them - #154

Merged
ww-mw merged 1 commit into
mainfrom
describe-corpus-files-without-naming-them
Oct 19, 2026
Merged

ww-mw merged 1 commit into
mainfrom
describe-corpus-files-without-naming-them

Conversation

@ww-mw

@ww-mw ww-mw commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Comments and docs named files and paths from the maintainer's local collection of test files, and one user's model. Each mention now says what the file is and keeps every fact it stated. Comments and docs only. dist is rebuilt for the .ts comments.

B-35: describe the local test files without naming them (PARTIAL)

Ruling. The maintainer's standing rule: "no corpus file or customer names in code, comments or docs" (B-06 already removed them from Simulink.VariantBank.md). The row says: "reword each mention to describe the file without naming it ('a text dictionary R2026b wrote', 'a matched pair of MATLAB-written dictionaries'), keeping every fact; comments and docs only, no behaviour change; core dist rebuilt for the .ts comment; scan ... tracked files only ... a guard test is NOT added (it would have to carry the names); instead the PR lists the grep it ran and its zero result."

What was wrong. Tracked files named local collection paths and file names: Simulink.VariantBankCoderInfo.md:129-132, Simulink.Parameter.md:112, VariantBankCoderInfoNode.ts:40 (and its dist copy), make_variantbank_r2027a.m:271, mcosDecodeWarnings.test.ts:19, parameterNode.test.ts:187 and variantBankFields.test.ts:976/979. All of them predate group H. I checked each one on main 3fb94fe and found it where the row said.

Root cause. Comments and docs written while debugging against the local collection used the file's name or path as shorthand for what the file is.

Fix. Each name or path is now a description that keeps the fact, for example "two text dictionaries R2026b wrote", "a matched pair of MATLAB-written dictionaries, one text and one binary, made by the same script", "a shipped Simulink demo model", <model>.slx/blocks/65 in node-id examples, and "one of the user's models". The scan the row asks for found more mentions than the row lists, and these were reworded the same way: a collection path in variantBankNoValue.test.ts, a user's model named in test/parity/matlab/DESIGN.md, the shipped demo model named by file (about 30 lines across src, test and dist), two MATLAB-written dictionaries named on 14 lines, and other collection paths. The change touches 35 source, test and doc files plus 17 rebuilt dist files.

No behaviour change. Every changed +/- line in a .ts, .js, .d.ts or .m file is a comment line. This command prints nothing:
git diff -U0 origin/main HEAD -- '*.ts' '*.js' '*.m' | grep -E '^[+-]' | grep -vE '^(\+\+\+|---) ' | grep -vE '^[+-]\s*(//|\*|/\*\*|%)'
The dist changes are comment lines and the .js.map column mappings that follow from them.

MATLAB truth. None needed. Only comment lines changed in two .m scripts (test/fixtures/make_variantbank_r2027a.m and test/parity/matlab/probe_text_empty_readback.m), so what MATLAB does cannot change.

Tests. No test was added: the row rules out a guard test, because it would have to carry the names. With no behaviour change, there is nothing that could fail before the change. The scan below takes the guard test's place.

Changed existing tests. Only comments changed, in 19 .test.ts files, one fixture script and one probe script. No assertion, input or expected value changed.

The scan, over tracked files at the head. The name list is the collection's file basenames minus every basename tracked in core or vscode (597 names). It lives outside the repo, because committing it would commit the names.

  • git grep -n -i -I delite HEAD -- . gives 0 lines (11 before).
  • Customer tokens, git grep -n -I -i -F for each one: the 4 tokens that are names give 0 (0 before). The other 3 tokens are ordinary words (a block name, the word "data" and one file format). They match ordinary code everywhere and are not names.
  • Collection basenames, git grep -n -I -w -F -f <597 names> HEAD -- . gives 27 lines (96 before). The -w flag is needed because without it short names match inside other words. The 27 lines are:
    • 15 lines use four generic file names as made-up test inputs (in blockParamUsages, ingestDispatch, parseWarnings and slddContent tests). These are string literals in test code that happen to share a name with a collection file. They do not refer to collection files. Renaming them would change test code, so they stay.
    • 12 lines are in the opt-in MATLAB read-back harness, which opens two collection files by name. See "Left out" below.
  • Excluding those two groups, the count is 0.

Left out (needs a decision): the read-back harness names the two files it opens. The row limits this change to comments and docs. In the harness the names are code and truth data: corpus('<name>') in test/parity/matlab/save_readbacks.mjs, "file": "<name>" in save_readbacks.truth.json, and the truth test compares that file field. The save_readbacks.mjs:11 comment and the header comments in probe_save_readbacks.m and readbacks.truth.test.ts say which files to supply. Rewording only those comments would hide the usage while the names stay in the code next to them. The options are:

  • (a) Keep the names in the harness, as now. It is opt-in and cannot run without the files.
  • (b) Take each file's full path from its own variable (for example DEX_READBACKS_BINARY and DEX_READBACKS_TEXT), and record the file's role in the truth file (for example "file": "binary of the pair"). This changes the harness and its truth file, and the truth should be re-derived by re-running probe_save_readbacks.m on R2027a with the new label.
  • (c) The same as (b), but keep the truth file's existing label and change only how the files are found.

Recommendation: (b), as its own small PR with the probe re-run. Note (review): probe_save_readbacks.m opens a corpus dictionary, which agents may not open in MATLAB, so either the maintainer runs that re-run or the label changes without one (c). The standing rule covers code too, and only (b) brings the scan to zero apart from the made-up test names.

Not in this PR. The row also scans the vscode repo. That half belongs to the vscode lane and was not scanned or changed here.

Not changed, record: src/datamodel/blockIdentity.ts:23 and :64 (and their dist copies) still name the shipped demo model by its bare name; it is a public MATLAB demo, not a collection file, so it is left as is.

Gates (at the head, bad9606)

  • Review (both lenses MERGE): all 31 changed .ts files are byte-identical at base and head with comments stripped; a read-only walk of 550 inputs shows 0 differences; vscode main with the packed core passes verify (3539) and integration (275, 1 pending).
  • rm -rf dist && npm run build: exit 0, and the tree is clean afterwards (the committed dist matches the build).
  • npm run verify: exit 0. 303 test files passed and 1 was skipped. 10815 tests passed and 27 were skipped (10842 total). The tarball, leak and browser-safety checks are OK.
  • Opt-in tests, with their variable set: DEX_READBACKS_CORPUS=<local collection>/parity npx vitest run test/parity/readbacks.truth.test.ts test/parity/m9MergedSaves.truth.test.ts gave 2 files and 45 tests passed, 0 skipped.
  • Live MATLAB tests were not run, because no code they reach changed (only comment lines changed in two .m scripts).
  • The branch is based on the current origin/main (3fb94fe), so it needs no merge.

Implements the maintainer's rulings, as audited in group H (2026-10-19).

Comments and docs named files and paths from the maintainer's local
collection of test files, and one user's model. Each mention now says
what the file is (a text dictionary R2026b wrote, a matched pair of
MATLAB-written dictionaries made by one script, a shipped Simulink demo
model) and keeps every fact it stated. Comments and docs only; dist is
rebuilt for the .ts comments.

The opt-in MATLAB read-back harness (save_readbacks.mjs, its truth file
and the two comments that tell how to run it) still names the two files
it opens, because it opens them by name. Changing that is a code change
and is left for a decision.
@ww-mw
ww-mw merged commit f4f5c97 into main Oct 19, 2026
4 checks passed
@ww-mw
ww-mw deleted the describe-corpus-files-without-naming-them branch October 19, 2026 08:01
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