Skip to content

Describe corpus files without naming them, in comments, docs and made-up test data - #83

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, one CHANGELOG line, and some test data that tests make up named files from the maintainer's local collection of test files, and two comments gave a path into that collection. Each mention now describes the file without naming it, and keeps every fact it stated. There is no behaviour change. This is the vscode half of B-35. The core half is mathworks/data-explorer-core#154.

B-35 (a2f3b41): 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 ..., keeping every fact; comments and docs only, no behaviour change; ... scan both repos (core and vscode, 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. On main 4209e6d (the main the row cites, and still the current main):

  • 2 tracked lines gave a path into the local collection: test/blockSidIdentity.test.ts:7 and test/fixtures/make-fixtures.mjs:433.
  • 36 hits on 7 distinctive collection file names, in 13 files: src comments, test comments, test data literals, and the 1.36.0 CHANGELOG entry. One of them was the source path of the service-interface fixture, in make-fixtures.mjs.
  • 2 more collection file names appeared without their extension, in comments in usageCells.test.ts (the dictionary one also in a src/host/usageCells.ts comment).

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

Fix. One commit, 14 files.

  • Paths into the collection: both are gone. The file is now "a shipped Simulink demo model", the same words core uses.
  • The demo model's file name: replaced by the same description in 3 src comments (nameExtract.ts, usageCells.ts, table-main.ts), in the comments of 4 tests, and in make-fixtures.mjs. Row ids and link targets quoted in comments now read <model>.slx/....
  • The service-interface fixture's comment keeps its description ("the corpus's one binary dictionary with a service interface, trimmed") and drops the source file's path.
  • CHANGELOG 1.36.0: the reported file is now "an 8 MB MAT-file". The rest of the sentence is unchanged.
  • Model and dictionary names that tests make up, and the comments that quote them, are renamed to invented names (Sedan, Truck, EngineLoop, FuelPath, aircraft, songs.mat, "a shared dictionary"). This touches usageCells, treeTableCells, filterEntries, nameExtract, banners and rowCap tests, plus the matching comments in usageCells.ts and dex-tree-table.ts. I checked the invented names against the collection's names: none of them is a collection file.

Deviation from the row, and why. The row says "comments and docs only". In vscode, some hits were test data literals: model URIs and model names that a test makes up, and the expected cell text built from them. The standing rule covers code too, and the row asks for a zero result, so those literals were renamed as well. Inside each test, a name is renamed the same way everywhere it appears, so every assertion pins what it pinned before. No assertion was loosened.

No behaviour change.

  • Every changed line under src/ is a comment line. This prints 0: git diff -U0 origin/main HEAD -- src | grep -E '^[+-]' | grep -vE '^(\+\+\+|---) ' | grep -vE '^[+-]\s*(//|\*|/\*\*)' | wc -l
  • The built extension is byte-identical to main's. All 127 files under dist/ (source maps excluded) have the same sha after npm run build && npm run build:web on main 4209e6d and on this head.
  • The unit and integration counts are the same as main's.

MATLAB truth. None needed. No code path changed.

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 its place.

Changed existing tests. Each test changed only by renaming made-up names, so each still pins exactly what it pinned before:

  • treeTableCells.test.ts: the tooltip and grouping tests.
  • usageCells.test.ts: the same-named blocks test and the overwrite test.
  • filterEntries.test.ts: block records.
  • nameExtract.test.ts: one record per block.
  • banners.test.ts and rowCap.test.ts: the file name in the error message.
  • Comments only: blockSidIdentity.test.ts, usageEndToEnd.test.ts.

The scan, over tracked files at the head. The name list is the collection's file basenames minus every basename tracked in this repo (602 names). It lives outside the repo, because committing it would commit the names. A name counts only as a whole basename: no [A-Za-z0-9_.-] before it and no [A-Za-z0-9_] after it.

  • git grep -n -i delite gives 0 lines (2 before).
  • Collection basenames give 59 hits (95 before). All 59 are 4 generic file names that the bench generator writes for itself, or that tests pick as made-up inputs (for example a dictionary shared by two made-up models). None of them refers to a collection file. Without those 4 names, the count is 0 (36 before).
  • The 2 file names that appeared without their extension now give 0.
  • Customer tokens, a count-only git grep -I -i -F for each one: the 4 tokens that give 0 in core give 0 here too (0 before). The other 3 tokens are the same 3 that Describe corpus files in comments and docs without naming them data-explorer-core#154 identifies as ordinary words (a block name and two file-format words). This change adds and removes the same number of hits on each of them.

Kept on purpose.

  • A model name that is data inside a repo fixture: the Source of object_array_text.sldd, the line in make-fixtures.mjs that writes it, the binary fixture mcos/variableUsageArray.mat, and objectExpansion.test.ts, which reads it (its assertion, and the comment at :430 that says where the fixture came from). It is the bare name of a MATLAB-shipped demo model, not a collection file. It is fixture content, and changing it would change fixture bytes.
  • Block, subsystem and variable names. They are not file names.
  • The 4 generic file names above (a case-sensitive scan; case-insensitively a 5th generic name appears in the piBuilder and propertyInspector tests, which this PR does not touch).

Customer-name check. The lane was refused a command that would print the lines matching the name list, and used counts only. The orchestrator, who holds the list, confirms the 3 high-count tokens are ordinary words (a common class-name word, "data" and a file format); the 4 that are names give 0 in both repos, before and after.

Gates (at the head, a2f3b41)

  • The branch is based on the current origin/main (4209e6d), so it needs no merge.
  • npm run verify: exit 0. 183 test files and 3539 tests passed (the same as main). The leak, lockfile and local-path checks are OK.
  • npm run test:integration: exit 0. 275 passing and 1 pending (the same as main).
  • The tree is clean after both.

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

…them

Two comments pointed at a path in the maintainer's private corpus, and
comments, one CHANGELOG line and some invented test data named corpus
files and models. The standing rule is that no code, comment or doc names a
corpus file or a customer.

- The two corpus paths and the demo model's file name now read "a shipped
  Simulink demo model". Row ids and link targets quoted in comments use
  `<model>.slx`.
- The service-interface fixture's comment keeps its description and drops
  the source file's path.
- The 1.36.0 CHANGELOG entry says "an 8 MB MAT-file".
- Model and dictionary names that tests make up, and the comments that
  quote them, are renamed to invented ones. Each name is renamed the same
  way everywhere inside a test, so every assertion pins what it pinned
  before.

There is no behaviour change. The built extension (dist/, without source
maps) is byte-identical to main's, and the unit suite has the same counts.
Kept on purpose: model names that are data inside repo fixtures, block and
variable names, and generic synthetic file names that the bench generator
and tests pick for themselves.
@ww-mw ww-mw changed the title Describe corpus files in comments and docs without naming them Describe corpus files without naming them, in comments, docs and made-up test data Oct 19, 2026
@ww-mw
ww-mw merged commit 18653a3 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:05
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