@yakovlev-i-a/dsh-openfoam-workbench 0.0.0-stage → 0.9.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +692 -0
  2. package/CORE.md +50 -0
  3. package/LICENSE +202 -0
  4. package/NOTICE +29 -0
  5. package/README.md +373 -2
  6. package/client.js +48 -0
  7. package/cordis.patch.yml +18 -0
  8. package/icon.png +0 -0
  9. package/lib/buildlib.js +42 -0
  10. package/lib/caselib.js +212 -0
  11. package/lib/core.js +47 -0
  12. package/lib/discover.js +139 -0
  13. package/lib/escalations.js +92 -0
  14. package/lib/explib.js +149 -0
  15. package/lib/impact.js +55 -0
  16. package/lib/index.js +109 -0
  17. package/lib/knowledge.js +108 -0
  18. package/lib/meshlib.js +375 -0
  19. package/lib/needs-input.js +32 -0
  20. package/lib/of-case.js +485 -0
  21. package/lib/of-engine.js +1061 -0
  22. package/lib/paperlib.js +200 -0
  23. package/lib/presentation.js +365 -0
  24. package/lib/registry.js +142 -0
  25. package/lib/routing-guard.js +126 -0
  26. package/lib/runtime.js +580 -0
  27. package/lib/scaffold-cht.js +318 -0
  28. package/lib/scaffold-compressible.js +171 -0
  29. package/lib/scaffold.js +355 -0
  30. package/lib/settings-schema.js +86 -0
  31. package/lib/skills.js +53 -0
  32. package/lib/tools/build.js +90 -0
  33. package/lib/tools/case.js +1082 -0
  34. package/lib/tools/env.js +592 -0
  35. package/lib/tools/experience.js +165 -0
  36. package/lib/tools/mesh.js +408 -0
  37. package/lib/tools/meta.js +95 -0
  38. package/lib/tools/papers.js +105 -0
  39. package/lib/tools/render.js +94 -0
  40. package/lib/tools/run.js +331 -0
  41. package/lib/versions.js +133 -0
  42. package/licenses/dsh-openfoam-doctor-MIT.txt +21 -0
  43. package/locale/en.json +6 -0
  44. package/locale/ru.json +6 -0
  45. package/package.json +44 -4
  46. package/skills/openfoam-analyze/SKILL.md +27 -0
  47. package/skills/openfoam-case-builder/SKILL.md +61 -0
  48. package/skills/openfoam-cht/SKILL.md +83 -0
  49. package/skills/openfoam-code-modify/SKILL.md +32 -0
  50. package/skills/openfoam-mesh-independence/SKILL.md +55 -0
  51. package/skills/openfoam-meshing/SKILL.md +30 -0
  52. package/skills/openfoam-paper-reproduction/SKILL.md +36 -0
  53. package/skills/openfoam-self-evolution/SKILL.md +21 -0
  54. package/skills/openfoam-solver-development/SKILL.md +61 -0
  55. package/skills/openfoam-stats/SKILL.md +46 -0
  56. package/skills/openfoam-viz/SKILL.md +35 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,692 @@
1
+ # Changelog
2
+
3
+ ## v0.9.27
4
+
5
+ - The npm account enables publishing only with proof of presence: the first
6
+ attempt (web-login session, no 2FA) staged `0.9.26` and the staged version
7
+ blocked republishing that number (`E409 Cannot publish over previously staged
8
+ version`). `0.9.27` is the same content published with a granular access token
9
+ that has `bypass_2fa`.
10
+ - 174 tests.
11
+
12
+ ## v0.9.26
13
+
14
+ Packaging for distribution.
15
+
16
+ - `package.json`: `private` is now `false` with `publishConfig.access: public`, so
17
+ the package can be published to npm as
18
+ `@yakovlev-i-a/dsh-openfoam-workbench` (still `0.x`, as agreed).
19
+ - README documents all three install paths: a commit-pinned git spec, the npm
20
+ package, and a local checkout.
21
+ - Repository metadata moved to the current state (65 tools) and the
22
+ `dsh-plugin` topic is set for discovery.
23
+ - 174 tests.
24
+
25
+ ## v0.9.25
26
+
27
+ `strict` routing with an audited exception path.
28
+
29
+ - **`enforceToolRouting: 'strict'`**: a `bash`/`write`/`edit` call that writes a
30
+ case dictionary is refused with a message that names the plugin tool *and* the
31
+ escalation call.
32
+ - **`openfoam_escalate({ target, operation, toolsTried, why, ttlMinutes })`**
33
+ (65th tool) grants **one single-use token** for one target, valid 10 minutes.
34
+ The request is verified against the call history: at least one named plugin
35
+ tool must have been called **and failed** in the last 15 minutes, so the
36
+ exception carries evidence instead of a claim. The hook consumes the token on
37
+ the next matching write, so one escalation authorises exactly one write.
38
+ - **`escalationAuthority: 'auto' | 'ask'`** (default `auto`, as agreed for the
39
+ first release): `auto` issues the token from the verified evidence, `ask`
40
+ routes the decision to the DSH approval answerer and fails closed without it.
41
+ - `openfoam_usage_report` gains an `escalations` section (active, used, expired
42
+ and the recent request/consume events), next to the `routing` section, so
43
+ "which tools were tried, why it failed, what was let through" is an artifact.
44
+ - 174 tests (evidence verification, single use, TTL and target scoping,
45
+ auto/ask authority, strict vs warn vs deny).
46
+
47
+ ## v0.9.24
48
+
49
+ Steering the agent onto the plugin's tools, in layers.
50
+
51
+ - **New `enforceToolRouting` setting** (`off` / `warn` / `deny`, default `warn`).
52
+ The plugin subscribes to DSH's `tools/pre-execute` waterfall and classifies
53
+ every call: a `bash`/`write`/`edit` that writes a case dictionary
54
+ (`system/`, `constant/`, `0/`, or a known dictionary file name) is a bypass.
55
+ `warn` records it, `deny` returns a refusal naming the tool to use
56
+ (`openfoam_dict_set`, `openfoam_read_dict`) so the change is classified,
57
+ journaled and reversible.
58
+ - `openfoam_usage_report` now carries a `routing` section (bypass attempts with
59
+ tool, target and decision), so "the work went through bash" is visible instead
60
+ of inferred.
61
+ - `lib/routing-guard.js` is deliberately conservative: reads, `ls`, solver runs
62
+ and the plugin's own tools are never flagged; the shell patterns are known to
63
+ be evadable (printf/python indirection), which the README states plainly —
64
+ the guard is a deterrent and a signal, the sandbox stays the boundary.
65
+ - 169 tests (routing classification, warn/deny/off modes, hook wiring).
66
+
67
+ ## v0.9.23
68
+
69
+ Security review follow-up: the write gate and the run whitelist, again.
70
+
71
+ - **Braces are refused in a scalar value.** `value='{ } libs ("libevil.so")'`
72
+ used to pass every check (one line, no `;`, balanced braces) and produced
73
+ `writeInterval { } libs ("libevil.so");` as a *low* impact change — the line
74
+ parser saw only `writeInterval` and the injected entry was invisible to the
75
+ structural guard. Any `{`/`}` in a value is now an error by name.
76
+ - **Every `#` directive is critical.** `#includeEtc`/`#includeIfPresent`/
77
+ `#includeFunc`/`#inputMode`/`#remove` were applied as low/high because the
78
+ pattern used a trailing word boundary after `#include`; any `#word` token now
79
+ forces approval (`#codeStream`, `#calc`, `#eval`, absolute includes, rewrites).
80
+ - **Structural invariant**: replacing one entry may not change the number of
81
+ semicolons in the file (an append is exempt by design), on top of the existing
82
+ top-level key comparison.
83
+ - **Argument whitelist**: `-case`, `-dict`, `-solver`, `-roots`, `-hostRoots`,
84
+ `-libs` are refused in both `-x value` and `-x=value` forms.
85
+ - **`clean(force:true)` requires approval**: forcing past the case-marker guard is
86
+ destructive and now fails closed without an answerer.
87
+ - `test/golden/work/` (generated runs, ~2.6 MB including a 49k-line mesh) is out
88
+ of git and gitignored.
89
+ - Tests: 165, including regressions for each item above.
90
+
91
+ ## v0.9.22
92
+
93
+ A clean com v2606 install fixed the segfaults, and com now passes the whole
94
+ golden matrix.
95
+
96
+ - The com crashes were **the local installation**, not the case or the plugin: a
97
+ fresh `openfoam2606` from the official apt repository runs `rhoPimpleFoam` and
98
+ `chtMultiRegionFoam` normally. `scripts/reinstall-com.sh` documents the purge +
99
+ reinstall (the apt install ships no tutorials; `openfoam2606-tutorials` is a
100
+ separate package).
101
+ - **Compressible golden `sphereBox` on both families**: org and com agree within
102
+ ~0.1 % (`p` 99.88-100.07 kPa, `T.max` 300.036 K, `U.max` ~17.5 m/s), which also
103
+ showed that the earlier org setup (separate `p`/`p_rgh` pair) over-pressurised
104
+ the box; both families now use one `p` field with a wave-transmissive outlet.
105
+ - **CHT golden `sphereCht` on both families**: com gets its own mesh fixture
106
+ (`sphereChtCom`, built by com's `splitMeshRegions`; the mapped-patch metadata is
107
+ not portable), plus com-side dictionary requirements: solid `p` field,
108
+ enthalpy solvers (`h`/`hFinal`), `heRhoThermo` keys, interface condition
109
+ `compressible::turbulentTemperatureCoupledBaffleMixed`. Solid heats 300 ->
110
+ 313.1-313.9 K on com (org: 311.4-312.2 K), gas max 500 K on both.
111
+ - Only `pitzDaily` stays org-only, with the reason recorded (the apt install has
112
+ no tutorials directory).
113
+ - 161 tests.
114
+
115
+ ## v0.9.21
116
+
117
+ - **`openfoam_case_scaffold` family `compressible`**: family-aware rho-thermo
118
+ (`hePsiThermo` + internal energy + `p`/`p_rgh` for org's `foamRun fluid`;
119
+ `heRhoThermo` + enthalpy + `p` for com's `rhoPimpleFoam`), with the working
120
+ scheme set (`div(phi,(p|rho))` vs `div(phi,h)`/`div(phid,p)`), `constant/g`,
121
+ `pRef`, laminar transport, and the gas initialised at rest so the inlet drives
122
+ the flow instead of an impulsive pressure wave.
123
+ - **Golden case `sphereBox`**: compressible gas around the sphere on the stored
124
+ snappy mesh (17587 cells); QoI recorded on org 14. The values are regression
125
+ references of this transient blocked-duct run, not a validated benchmark.
126
+ - **CHT scaffold is family-complete as far as the solvers allow**: interface
127
+ temperature is `coupledTemperature` on org and
128
+ `compressible::turbulentTemperatureCoupledBaffleMixed` (with `Tnbr`,
129
+ `kappaMethod`, `sampleMode`) on com; com thermo keys (`Hf`, `heRhoThermo`,
130
+ `constIso`/`hConst`) and a fixed-value inlet are used where com's dictionary
131
+ API differs.
132
+ - Two com findings recorded, both build-level, not case-level:
133
+ `rhoPimpleFoam` and `chtMultiRegionFoam` **segfault** in this com v2606
134
+ installation (`dictionary::clone()`), and org's `mappedWall` interface
135
+ metadata is not portable to com (needs a com-built fixture).
136
+ - 161 tests.
137
+
138
+ ## v0.9.20
139
+
140
+ Golden cases start from **stored meshes**, and the tool surface stays at 64.
141
+
142
+ - `test/golden/meshes/` — two fixtures (gzipped `polyMesh`): `sphereFlow`
143
+ (snappy: 100 mm cube minus 50 mm sphere, 17587 cells, level 1-2) and
144
+ `sphereCht` (blockMesh + sphere cell zone + `splitMeshRegions`: 7448 fluid /
145
+ 552 solid). Both families read the same files, so a golden run is deterministic
146
+ and takes seconds.
147
+ - `sphereCht` golden now copies the fixture and only generates dictionaries
148
+ (`zero` mesh commands at run time); the runner reads `.gz` boundaries.
149
+ - **`openfoam_create_zone` removed** (the 65th tool): the golden path no longer
150
+ needs it, the underlying commands (`createZones`, `topoSet`, `setsToZones`) are
151
+ whitelisted, and a tool that only writes one small dictionary and calls a
152
+ whitelisted command does not justify the extra surface. `caps.splitRegions`
153
+ keeps the org/com difference as data.
154
+ - Verified: org runs `cavity`, `pitzDaily`, `sphereCht` green; com runs `cavity`
155
+ green (skips carry their reasons).
156
+
157
+ ## v0.9.19
158
+
159
+ Cell zones are now a capability, which is the step that unblocks multi-region
160
+ work on both families.
161
+
162
+ - **`caps.zoneTool`** (`createZones` on org, `topoSet` on com) and
163
+ **`caps.splitRegions`** (`-cellZones all -defaultRegion fluid` vs
164
+ `-cellZones -overwrite`), both probed from the installation.
165
+ - **New tool `openfoam_create_zone`**: carves one cell zone out of a single mesh
166
+ from a sphere/box/cylinder, distribution-aware, writes the dictionaries the
167
+ mechanism needs (com also needs `fvSchemes`/`fvSolution` placeholders before
168
+ splitting). Verified: org `createZones` -> `solid`, com `topoSet`+`setsToZones`
169
+ -> `solid`.
170
+ - **Golden recipe `sphereCht` is mechanism-agnostic**: `blockMesh` -> `zone` ->
171
+ `splitMeshRegions`, all through the capability; org stays green.
172
+ - **CHT scaffold knows the com layout** as far as it is understood:
173
+ `thermophysicalProperties`, `turbulenceProperties`, case-level `constant/g`,
174
+ `heRhoThermo` + `sensibleEnthalpy` and `div(phi,h)`/`div(phid,p)` schemes for
175
+ com; org keeps `hePsiThermo` + internal energy.
176
+ - Remaining com blocker, recorded with the exact reason: com injects per-region
177
+ boundary conditions with `changeDictionary -region` from a shared `0.orig` and
178
+ names the interface condition `turbulentTemperatureCoupledBaffleMixed`, so
179
+ `coupledTemperature` is not accepted on a `mappedWall`.
180
+
181
+ ## v0.9.18
182
+
183
+ The golden matrix is proven in CI, not just locally.
184
+
185
+ - `.github/workflows/golden.yml` runs on every push to main: docker images
186
+ `dicehub/openfoam:14` and `dicehub/openfoam:opencfd-2606`, Node bootstrapped
187
+ inside the image, installation located via `WM_PROJECT_DIR` or a glob/find
188
+ fallback, containers started with `--user root --entrypoint bash` (the images
189
+ ship a login-shell entrypoint and an unprivileged user).
190
+ - Verified in CI: org container finds `/home/openfoam/OpenFOAM-14` and runs
191
+ `cavity`, `pitzDaily`, `sphereCht` — all ok; com container finds
192
+ `/home/openfoam/OpenFOAM-2606`, runs `cavity` ok (identical QoI to org) and
193
+ skips the other two with recorded reasons.
194
+ - `run-golden.mjs` exits 2 when a requested distribution is not installed
195
+ (before, a missing installation made the run pass silently).
196
+ - Discovery also scans the home directories container images use.
197
+
198
+ ## v0.9.17
199
+
200
+ Golden cases: stored reference quantities for real OpenFOAM runs.
201
+
202
+ - `test/golden/` — three cases with a recipe (`cases.mjs`): `cavity`
203
+ (incompressible, both families), `pitzDaily` (compressible, org 14) and
204
+ `sphereCht` (the sphere-in-box CHT case that the scaffold itself builds).
205
+ - `scripts/run-golden.mjs` — discovers installations, prepares/clones each case,
206
+ runs mesh + solver, extracts the quantities (cells, non-orthogonality, field
207
+ min/max, final time) and compares with `test/golden/expected/<distribution>.json`
208
+ (`--update` re-blesses, a reviewed change).
209
+ - `test/golden-schema.test.mjs` — catches a broken expected file or a declared
210
+ quantity without a value in the normal (OpenFOAM-free) test job.
211
+ - `.github/workflows/golden.yml` — the same script inside OpenFOAM containers,
212
+ matrix `org` (dicehub/openfoam:14) and `com` (dicehub/openfoam:opencfd-2606).
213
+ - Verified locally: `org` runs all three cases green; `com` runs `cavity` green
214
+ with **identical** QoI to org (0.344284, 0.0485151), `pitzDaily` is skipped
215
+ with a recorded reason (rhoPimpleFoam segfaults in this com build) and
216
+ `sphereCht` is skipped (com has no `createZones`; use topoSet + setsToZones).
217
+ - Fixed on the way: the incompressible scaffold wrote `simpleFoam` for transient
218
+ cases (now `pimpleFoam`), the pressure reference was missing from the PIMPLE
219
+ block, and a closed domain got no `pRefCell` in the algorithm actually used.
220
+
221
+ ## v0.9.16
222
+
223
+ - **`openfoam_case_scaffold` with `family: "cht"`** writes a complete
224
+ conjugate-heat-transfer case once the region meshes exist:
225
+ - per-region `system/<r>/{fvSchemes,fvSolution}` and `constant/<r>/*`
226
+ (fluid: `hePsiThermo` air + laminar momentum/thermophysical transport + `g`/`pRef`;
227
+ solid: `heSolidThermo` with `{rho, Cv, kappa}` from the call), `0/<r>/*`;
228
+ - `coupledTemperature` on the `<region>_to_<other>` interface patches and
229
+ physical conditions on the outer walls/inlets/outlets, chosen from the
230
+ patch roles of the region's own `polyMesh/boundary`;
231
+ - org glue `system/regionSolvers` + `#includeIfPresent` controlDict for
232
+ `foamMultiRun`; com glue `constant/regionProperties` + `chtMultiRegionFoam`;
233
+ - the root `system/fvSolution` that `foamMultiRun` requires.
234
+ - Verified end to end on a fresh sphere-in-box case: `blockMesh` -> `createZones`
235
+ -> `splitMeshRegions` -> scaffold -> `foamMultiRun` with **no manual edits**
236
+ (solid 300 -> 311-312 K, gas 482-501 K over 0.02 s).
237
+ - Doctor: `coupledTemperature`/`coupledPressure`/... are known patch-field types,
238
+ and region field findings name the field path with its region.
239
+ - 153 tests (CHT scaffold: org/com glue, interface BC placement, refusals).
240
+
241
+ ## v0.9.15
242
+
243
+ The second live test — a conjugate-heat-transfer sphere-in-box (solid sphere
244
+ conducting heat, small `Cv` to heat fast) — plus the fixes it exposed.
245
+
246
+ - **`openfoam_field_stats` takes `region`**, so per-region extrema work in CHT
247
+ cases (`-region solid`).
248
+ - **Doctor: multi-region field/patch consistency** (`checkRegionFieldPatches`):
249
+ a `boundaryField` entry that names no patch of the region is a warning, a
250
+ patch without an entry is an error, and a `coupled`/`mapped` condition on a
251
+ plain wall patch is an error — the exact trap of `splitMeshRegions` naming
252
+ interface patches `<region>_to_<other>` while templates still say `wall`.
253
+ - **Whitelist**: `createZones`, `foamSetupCHT`, `setsToZones`; the classic
254
+ compressible solvers are spelled correctly now (`rhoPimpleFoam` was
255
+ `rhopimpleFoam`, so it could never run).
256
+ - README states the targets explicitly: **org 14 and com v2606** are tested;
257
+ other releases stay `partial`/`unknown` until added.
258
+
259
+ ## v0.9.14
260
+
261
+ Version-capability layer, wired through the tools that generate content.
262
+
263
+ - **`lib/versions.js` v2**: one capability object per installation — `family`,
264
+ `modular`, `support` (full/partial/unknown), `blockMeshScale`,
265
+ `featuresUtility`/`featuresDict`/`featuresDictStyle`, `postProcess`,
266
+ `fieldStats`, `transportFile`, `turbulenceFile`, `regionModel`, `zeroDir`.
267
+ `probeCaps()` asks the installation itself (version + which utilities exist)
268
+ and caches the result; `versionCaps()` gives the same object without probing.
269
+ - **`openfoam_mesh_plan`** is capability-driven: `scale` vs `convertToMeters`,
270
+ snappy quality keys, and the feature dictionary the family expects
271
+ (`surfaceFeaturesDict` on org, `surfaceFeatureExtractDict` on com). The result
272
+ reports `caps` and an advisory on partial/unknown releases.
273
+ - **`openfoam_case_scaffold`** takes `caps`: modular (`foamRun` + `solver`) vs
274
+ legacy (`simpleFoam`), `physicalProperties`/`momentumTransport` vs
275
+ `transportProperties`/`turbulenceProperties`; org 9 now falls back to the
276
+ legacy form instead of assuming the modular one.
277
+ - **`openfoam_check`** reports `caps` and adds an `untested-version` warning when
278
+ the release is outside the support matrix.
279
+ - **`openfoam_env_check`/`openfoam_version_info`** return `caps` per
280
+ distribution; README documents the support matrix and the capability model.
281
+ - Tests: capability matrix (org 14/9, com v2606/v2512), scaffold and mesh_plan
282
+ conventions per capability, feature-dictionary naming.
283
+
284
+ ## v0.9.13
285
+
286
+ All findings from the sphere-in-box live test (F1-F12), plus a first step towards
287
+ a version-capability layer.
288
+
289
+ - **`lib/versions.js`**: one capability object per installation (`family`, `modular`,
290
+ `snappyQualityKeys`, `fieldStats`, `postProcess`, `features`, `thermoFile`,
291
+ `turbulenceFile`, `regionModel`, `zeroDir`) from the distribution/version.
292
+ - **F1/F9** whitelist: `surfaceFeatureExtract`, `surfaceFeatures`, `foamPostProcess`.
293
+ Parentheses are allowed in command arguments again (`-func cellMax(U)`); `;`,
294
+ `|`, `&`, backticks, `$` and redirects stay forbidden.
295
+ - **F3** `mesh_plan` emits `errorReduction 0.75`, `nSmoothScale 4`, `maxIter 100`
296
+ (org 14 aborted in the morphing phase without them).
297
+ - **F2** `mesh_plan` writes a placeholder `system/controlDict` when the case has
298
+ none, so `blockMesh` can start; it says so in `notes` and never overwrites one.
299
+ - **F7** the doctor reports unknown `patchField` types (`unknown-bc-type`) and
300
+ knows that `alphat*WallFunction` exists only as `compressible::...`.
301
+ - **F12** the doctor flags compressible cases without an energy-flux scheme, and
302
+ `div(phi,e)` without the pressure-work term `div(phi,(p|rho))`.
303
+ - **F6** `no-nonortho-correctors` reads the algorithm the case actually uses
304
+ (transient -> PIMPLE/PISO, steady -> SIMPLE).
305
+ - **F10** `openfoam_case_scaffold` takes `family` and refuses anything but
306
+ incompressible-laminar instead of silently writing an incompressible case.
307
+ - **F11** patch roles use the `type` when given and know sphere/ball/obstacle/
308
+ airfoil/blade/... names, so a sphere gets `noSlip`.
309
+ - **F8** new read-only `openfoam_field_stats` (min/max, magnitude) built on the
310
+ distribution's `postProcess`/`foamPostProcess` and `cellMin`/`cellMax`.
311
+ - **F5** the geometry-scale gate ignores floating-point noise at the threshold.
312
+
313
+ ## v0.9.12
314
+
315
+ - **Live approval verified end to end** on a real profile: `dict_set` on
316
+ `controlDict.libs` requested approval with `{hasService, hasAgent, hasCallId}`
317
+ all true, `allowed-once` applied the write, `rejected` left the file unchanged,
318
+ and `openfoam_dict_undo` restored the previous value afterwards.
319
+ - The result carries the **actual** outcome (`allowed-once` / `rejected` /
320
+ `cancelled` / `unavailable`) instead of a generic "refused".
321
+
322
+ ## v0.9.11
323
+
324
+ - **The approval service is resolved when it is needed, not at mount time.** The
325
+ `approval` service is mounted by the base bundle after this plugin, so
326
+ `ctx.get('approval')` during `apply()` returned `undefined` and every critical
327
+ change failed closed with "service is not mounted". The plugin now keeps a
328
+ getter and resolves the service inside the tool call; the refusal also reports
329
+ `approval: {hasService, hasAgent, hasCallId}` so a live smoke test shows
330
+ exactly what is missing (on this host: agent ✓, callId ✓).
331
+
332
+ ## v0.9.10
333
+
334
+ Security pass from the third audit: the write gate and the file layer.
335
+
336
+ - **No dictionary-entry injection**: `entry` must be a plain OpenFOAM key
337
+ (`[A-Za-z_][A-Za-z0-9_.:]*`), and `value` must be a single line without `;`
338
+ and with balanced braces. `value="50;\nlibs (\"...\")"` was previously
339
+ written as a low-impact change and is now refused by name.
340
+ - **Executable directives are critical**: a value containing `#codeStream`,
341
+ `#calc`, `#eval`, `#include` or `codeStream` requires approval regardless of
342
+ the entry it is written to.
343
+ - **Path containment**: `containedPath()` refuses `..`, absolute paths and
344
+ symlinks that leave the case, and `read_dict`/`dict_set`/`dict_undo` use it, so
345
+ `system/../../outside.txt` is no longer readable or writable. Experience card
346
+ ids are validated as slugs before deletion.
347
+ - **`clean` requires a case marker** (`system/controlDict`, `system/blockMeshDict`
348
+ or `constant/polyMesh`); a directory named `2024` with `build.log` is no longer
349
+ treated as a time directory unless `force: true`.
350
+ - **`commandAllowed` refuses context-changing arguments** (`-libs`, `-case`,
351
+ `-roots`, `-hostRoots`), not just non-whitelisted applications.
352
+ - **Paper downloads are size-capped** (50 MB) and use the package version in the
353
+ User-Agent.
354
+ - **Metadata**: the market index ru description is generated from the package
355
+ description (it said 61 tools), the stray `.tmp-pack.json` is gone, and
356
+ `.gitignore` covers files as well as directories.
357
+
358
+ ## v0.9.9
359
+
360
+ Hotfix: the plugin failed to mount in a real DSH profile.
361
+
362
+ - `lib/index.js` read the optional approval service as `ctx.approval`, but the
363
+ restricted Cordis context throws on any property that is not declared in
364
+ `inject`, so `apply()` aborted with `cannot get property "approval" without
365
+ inject` and the whole entry stayed inactive (no tools, no skills, no core
366
+ section). The lookup now goes through `ctx.get('approval')`, which returns
367
+ `undefined` when the service is absent.
368
+ - Regression test: `apply()` is mounted against a Proxy context that throws on
369
+ every uninjected property; the tool set must still register.
370
+
371
+ ## v0.9.8
372
+
373
+ Second reliability pass from the v0.9.7 audit.
374
+
375
+ - **TOCTOU guard**: the change is computed from a snapshot whose hash is kept;
376
+ right before the journal and the write (i.e. after a possibly long approval
377
+ wait) the file is re-read and compared, and a concurrent modification aborts
378
+ the change instead of overwriting the newer content. The refusal tells the
379
+ agent to re-read and prepare the edit again.
380
+ - **`undo` is depth-aware**: the top-level entry is removed only at brace depth
381
+ 0, so an identical `key ...;` inside a nested dictionary is left alone.
382
+ - **Strict `purgeWrite`**: only a literal zero (`0`, `0.0`, `00`) is low impact;
383
+ `-1`, `abc` and an empty value are high. `runTimeModifiable` moved to high as
384
+ well (it changes how dictionaries are re-read during a run).
385
+ - **Metadata**: `package.json` description now states 63 tools (the market index
386
+ is regenerated from it), and two guards check the description count and the
387
+ index description.
388
+ - Approval answers now report `approval: {outcome, hasAgent, hasCallId}` so the
389
+ live smoke test can be verified without guessing.
390
+
391
+ ## v0.9.7
392
+
393
+ Reliability release: no new tools, only the defects the v0.9.6 review found.
394
+
395
+ - **`purgeWrite` is value-aware**: `0` stays low impact, any value `> 0` is high
396
+ impact (preview), because it deletes older time directories — a long run's
397
+ history is not an organisational setting.
398
+ - **Approval is always required for `libs`/`functions`**; the `approvals` switch
399
+ is gone (it never took effect and implied the protection was optional). A
400
+ missing agent identity or a missing answerer refuses the change (fail-closed).
401
+ - **Sub-dictionaries are refused explicitly**: `dict_set` edits single-line
402
+ top-level entries; `functions { ... }` now returns a named error instead of a
403
+ confusing "entry not found", and the block is never half-edited.
404
+ - **Undo of an appended key removes the line** (`existedBefore` is recorded in
405
+ the journal) instead of writing an empty value.
406
+ - **No file is written without a durable undo record**: the journal is written
407
+ before the case file, and a failure aborts the change (the temp file and any
408
+ journal entry are rolled back).
409
+ - **Release consistency**: the market index guard now verifies that the pinned
410
+ commit really carries the indexed version, and the README intro tool count is
411
+ checked against the status line and the registry.
412
+
413
+ ## v0.9.6
414
+
415
+ - **Impact-based write policy** (`lib/impact.js`): the decision comes from the
416
+ entry semantics, not the file. `controlDict` output keys apply; boundary and
417
+ initial conditions, `fvSchemes`, `fvSolution`, `constant/*`, `deltaT` and
418
+ `application` **preview** (`applied: false`, rendered as `NOT APPLIED`) until
419
+ `apply: true`; `controlDict` `libs`/`functions` request user approval through
420
+ the DSH `ctx.approval` seam and fail closed when it is not mounted.
421
+ `writeMode: impact | apply | preview` (Settings) overrides it.
422
+ - **`expect`** refuses a write whose current value differs, and every applied
423
+ change gets a `changeId` + `afterHash`.
424
+ - **`openfoam_dict_undo`** (63rd tool) reverts a change and refuses when the file
425
+ changed after it, so a later edit is never silently discarded.
426
+ - CORE.md: a write tool answering `applied: false` has changed nothing - apply it
427
+ or say so.
428
+ - Tests: classification (0/U and 0/Yi high, writeInterval low, deltaT high,
429
+ unknown high, libs critical), mode overrides, expect, undo + stale undo, and
430
+ approval allowed-once / rejected / missing-service fail-closed.
431
+
432
+ ## v0.9.5
433
+
434
+ - **No shell string is built from paths or commands.** Every OpenFOAM call
435
+ (`openfoam_run`, the async registry, `mesh_verify`, `stl_fit`, `wmake`,
436
+ `solver_smoke`, `version_info`, `env_check`) now runs through one static
437
+ script with the bashrc, working directory, log path and command passed as
438
+ positional parameters / argv (`FOAM_RUN_SCRIPT`, `FOAM_LOG_SCRIPT`,
439
+ `runFoam`, `spawnFoamLog`). A path containing `"`, `'`, `$()`, backticks,
440
+ `;` or newlines can no longer become shell code; the whitelist also returns
441
+ the parsed `argv` instead of a string to re-split.
442
+ - `set --` clears the positional parameters before sourcing: OpenFOAM's com
443
+ `etc/bashrc` forwards `"$@"` into `etc/config.sh/setup`, so a non-empty list
444
+ made the probe hang (this surfaced as a 30 s stall per distribution in
445
+ `openfoam_env_check`).
446
+ - Child processes run with `stdin: ignore`.
447
+ - Security section in the README states explicitly that the plugin executes
448
+ local commands as the OS user and is not a sandbox.
449
+ - Tests: injection regression suite (paths with `$()`, quotes, spaces,
450
+ backticks; bashrc path with substitution; argv literalness; whitelist argv).
451
+
452
+ ## v0.9.4
453
+
454
+ - **Iron rule 1 is no longer absolute.** "Every turn calls a tool" forced a tool
455
+ call even for conceptual questions ("why does the pressure equation carry this
456
+ correction?"), which produced theatre calls and less natural answers. It now
457
+ splits the two cases: verify with a tool when the answer depends on the user's
458
+ case, the installed OpenFOAM or a run result; answer a conceptual question
459
+ directly, citing the source only when the version matters. Rule 3
460
+ ("Check, don't guess") still pins the anti-hallucination side, and the routing
461
+ table is unchanged.
462
+
463
+ ## v0.9.3
464
+
465
+ - **Explicit `foamRoot` beats discovery.** Discovery filled `foamRoots` even when
466
+ the profile set the legacy single `foamRoot`, and `rootFor` prefers
467
+ `foamRoots[distribution]`, so a configured install was silently replaced by
468
+ whatever was installed on the machine. Discovery now runs only when neither
469
+ `foamRoot` nor `foamRoots` is configured. This is also why the v0.9.1 CI
470
+ failure only reproduced without OpenFOAM installed. Regression test added.
471
+
472
+ ## v0.9.2
473
+
474
+ - **CI fix**: `openfoam_list_solvers` treated `applications/modules` like
475
+ `applications/solvers` and only accepted directories that hold `Make/files`.
476
+ Module directories are solvers in their own right (org layout), so the tool
477
+ now lists them directly and walks only `applications/solvers` and
478
+ `applications/legacy` down to the `Make/files` level. Verified: org 42
479
+ solvers, com 69 including `chtMultiRegionFoam`.
480
+
481
+ ## v0.9.1
482
+
483
+ Second-review fixes (1-9 from the agreed list).
484
+
485
+ - **`limiter-wide-open` advice is legal**: OpenFOAM rejects `k > 1`
486
+ (`should be >= 0 and <= 1`); the fix now says `limitedLinear 1` only, with the
487
+ k in (0,1] scale stated.
488
+ - **`caseBBox` reads only the `vertices` block and applies `scale`**: a hex block
489
+ resolution tuple `(30 10 10)` is no longer read as a vertex, so CHT and
490
+ multi-block cases stop reporting a 30 m box and a false `geometry-scale` ask.
491
+ - **`closed-domain-no-pref`** recognises `waveTransmissive`, `fixedFluxPressure`,
492
+ `prghPressure`, `advective`, `supersonicFreestream`, `pinnedValue` as pressure
493
+ references (a transmissive outlet is not a closed domain).
494
+ - **`u-empty-patch`** is one finding per case listing all empty patches.
495
+ - **blockMesh vertex heuristics**: the wrong `block-vertex-mismatch` rule
496
+ (`hexCount*8 > vertexCount`) is removed and `vertex-count` is advice, not an
497
+ error (blocks share vertices).
498
+ - **`mesh_verify`/doctor problems** now include the threshold lines behind
499
+ "Failed N mesh checks." (`faces with face pyramid volume < 2e-11: 10001`), so a
500
+ failure no longer comes back with an empty problems list.
501
+ - **`list_solvers`** recurses `applications/{solvers,modules,legacy}` to the
502
+ `Make/files` level; com now lists 69 solvers including `chtMultiRegionFoam`.
503
+ - **`resolvedFrom`** tracing on the path-bearing answers (inspect_case,
504
+ case_probe_facts, check) - `{kind, root, input}`.
505
+ - **`openfoam_case_scaffold`** writes `case-manifest.json` (application,
506
+ algorithm, distribution, compressible, phases, turbulence, patches) and its
507
+ description states it writes no geometry; `paper_search` reports `degraded`
508
+ when a source failed.
509
+
510
+ ## v0.9.0
511
+
512
+ - **`openfoam_case_scaffold`**: a case can now be built from nothing. Writes
513
+ `controlDict`, `fvSchemes`, `fvSolution`, the constant files and `0/U`, `0/p`
514
+ for incompressible **laminar** flow (SIMPLE steady or PIMPLE transient),
515
+ deriving the boundary conditions from the case's own patches (inlet/outlet/
516
+ wall/empty/symmetry, with `pRefCell` for closed domains) and falling back to
517
+ the `inlet/outlet/walls` set `mesh_plan` creates. Distribution-aware: org 14
518
+ gets `application foamRun; solver incompressibleFluid;` plus
519
+ `momentumTransport`/`physicalProperties`; com v2606 gets `application
520
+ simpleFoam;` plus `turbulenceProperties`/`transportProperties`. Runs the doctor
521
+ afterwards and returns its findings. Verified end to end on both: STL → mesh
522
+ plan → blockMesh → solver → `End` (2.2 s per run).
523
+ - **`stl_generate` creates the case directory** instead of failing with
524
+ "case not found", so the first step of a from-scratch build works.
525
+ - Turbulent/compressible/CHT requests are refused with a tutorial hint rather
526
+ than guessed.
527
+ - README: a "Supported versions" matrix (org 14 vs com v2606) and an explicit
528
+ statement that other branches are best effort.
529
+
530
+ ## v0.8.1
531
+
532
+ - **`steps` describes the whole run.** On a log larger than `logTailBytes` the
533
+ tools counted the tail window and reported it as the total (224 MB / 74 318
534
+ steps came back as 1 331). `progressFrom` now takes a full-file count:
535
+ `steps` is the run total, `stepsInWindow` is what the tail saw, and
536
+ `logWindow.truncated` says the window was smaller. Counting costs ~0.25 s per
537
+ 90 MB (measured) and is bounded by a 4 s budget; `solve_verify` exposes the
538
+ same fields next to `metrics.timeSteps`.
539
+
540
+ ## v0.8.0
541
+
542
+ Fixes from the first external review (BFER series, ESI v2512) except the two
543
+ feature requests, which land in v0.9.0.
544
+
545
+ - **`limiter-wide-open` was inverted.** `limitedLinear k` computes
546
+ `psi = clamp(2r/k, 0, 1)` (`limitedLinear.H`), so k -> 0 is the disabled
547
+ limiter and k = 1 is the conservative default. The rule now warns only below
548
+ 0.1 and its advice no longer asks for a weaker scheme.
549
+ - **Run registry next to the case.** Records and logs go to
550
+ `<case>/.openfoam-runs` (discovered across `caseRoots`), never into whatever
551
+ `caseRoots[0]` happens to be; `runsDir` is a documented setting.
552
+ - **Log arguments.** `log_path` and `path` are interchangeable on
553
+ `run_progress`, `solve_verify` and `residual_series`; a wrong name returns
554
+ "log_path (alias: path) is required — got: ...", and "case not found" lists
555
+ the searched roots.
556
+ - **`mesh_verify` verdict.** `failed` mirrors `pass`, and a checkMesh that
557
+ cannot run now reports the OpenFOAM message in `problems`/`regions[].error`.
558
+ - **`0_orig`.** Initial fields are found in `0/`, `0.orig/` or `0_orig/` by
559
+ inspect_case, case_probe_facts, the doctor and `restore0Dir`; `probe_facts`
560
+ reads patch names from `polyMesh/boundary` (it used to disagree with
561
+ inspect_case) and accepts `case_path`/`casePath`.
562
+ - **`read_source`** lists similarly named files and points at
563
+ `openfoam_find_source` instead of a bare "not found".
564
+ - The four log tools now say which one to call (metrics vs progress vs verdict
565
+ vs series).
566
+ - Release guard: a test fails when the README status line and `package.json`
567
+ disagree, when the CHANGELOG lacks the current version, or when the package
568
+ `files` list misses CHANGELOG/LICENSE/NOTICE/client.
569
+
570
+ ## v0.7.0
571
+
572
+ Marketplace readiness.
573
+
574
+ - **CI**: `.github/workflows/tests.yml` runs the unit suite on Node 20/22/24 for
575
+ every push and pull request (the suite is host-agnostic; host-dependent tests
576
+ skip themselves).
577
+ - **Packaging**: `exports["./package.json"]` added (tools that resolve the
578
+ manifest by subpath no longer fail), icon and client verified through a
579
+ consumer-style resolution, `npm pack` ships 48 files / 243 KB.
580
+ - **Docs**: Requirements section, marketplace install path, a committed render
581
+ as the README screenshot.
582
+ - **`scripts/make-market-index.mjs`** builds a format-1 index entry pinned to a
583
+ commit (version, publishTimestamp, git source, engines, icon URL); a test runs
584
+ it through the real `@deepseek-ai/dsh-plugin-market-index` validator and
585
+ `marketInstallTarget`.
586
+
587
+ ## v0.6.2
588
+
589
+ - **PNG plugin icon.** `icon.png` (512×512, 143 KiB) replaces `icon.svg`; the
590
+ package export `./icon` points at it. DSH reads the icon as a base64 data URL
591
+ and caps raw bytes at 256 KiB, so the 1254×1254 source was downscaled and
592
+ re-encoded (PNG is explicitly supported alongside SVG/JPEG/WebP).
593
+
594
+ ## v0.6.1
595
+
596
+ - **`needs_input` is language-neutral.** The payload now carries the decision
597
+ (`kind`, numbers in `data`, stable option ids with English labels) and one
598
+ English instruction for the model; the user-facing wording is the agent's job
599
+ (CORE.md: ask in `{{language}}`, translate the labels). `lib/i18n.js` and the
600
+ `responseLanguage` reads in `mesh_plan`/`check` are gone, so every future gate
601
+ needs one template, not one per language. The registry renders
602
+ `[<kind>] <ask>` + `id: label` options and still accepts the legacy
603
+ `{question, options}` shape.
604
+
605
+ ## v0.6.0
606
+
607
+ - **Settings page.** `lib/settings-schema.js` exports a native schemastery
608
+ `Config` (resolved from the DSH installation, so the bundle stays
609
+ dependency-free) with fields for `foamRoots`, `foamBashs`, `defaultDistribution`,
610
+ `paraviewExe/Python`, `pythonPath`, `caseRoots`, `extraCommands`, `corePath`,
611
+ `logTailBytes`, `scaleAskAbove` and `language`. Without the host library the
612
+ export degrades to `undefined` and the plugin works as before.
613
+ - **One language for human-facing tool text.** `lib/i18n.js` holds the
614
+ geometry-scale question/options template per language; `mesh_plan` and `check`
615
+ now emit the same question in the resolved language (Russian and English
616
+ shipped, others fall back to English). The Russian hardcode in `check` is gone.
617
+ - Tests: settings schema (native marker, a field for every default, graceful
618
+ degradation) and language coverage for both gate call sites (79 total).
619
+
620
+ ## v0.5.0
621
+
622
+ - **Zero-configuration installs.** `cordis.patch.yml` ships an empty config; the
623
+ plugin discovers OpenFOAM installations (`/opt`, `/usr/lib/openfoam`,
624
+ `/usr/local`, `~/OpenFOAM`, `$WM_PROJECT_DIR`) and ParaView (`/opt`
625
+ directories, `PATH`). Explicit profile config still wins.
626
+ - **Configurable response language.** `language: ''` follows the OS locale
627
+ (`LC_ALL`/`LC_MESSAGES`/`LANG`); `language: ru` (or any code/name) forces one.
628
+ `CORE.md` carries a `{{language}}` placeholder resolved on every assembly, so
629
+ the same file serves every language; `openfoam_env_check` reports the choice.
630
+ - `caseRoots: []` now warns in the config warnings instead of failing later.
631
+ - Discovery/language tests (5) and the machine-neutral patch guard.
632
+
633
+ ## v0.4.4
634
+
635
+ - Web UI: the call summary of every `openfoam_*` tool row is blue
636
+ (`#3b518c` light, `#9db4e0` dark) through the client half.
637
+
638
+ ## v0.4.3
639
+
640
+ - Web UI: orange ring around `openfoam_*` rows and an orange tool name
641
+ (replaced by the blue summary in v0.4.4).
642
+
643
+ ## v0.4.2
644
+
645
+ - Browser half of the bundle (`client.js`, `dsh.client`) that styles
646
+ `openfoam_*` tool rows.
647
+
648
+ ## v0.4.0
649
+
650
+ - Region-aware doctor: `check` walks `system/<r>/`, `0/<r>/`, `constant/<r>/`,
651
+ tags findings with their region and accepts `region=`.
652
+
653
+ ## v0.3.9
654
+
655
+ - `<case-dir-name>.foam` is created on every case-creating path and is the only
656
+ accepted ParaView entry file.
657
+ - Geometry-scale gate: `mesh_plan`/`check` ask the human (`needs_input`) when the
658
+ bounding box exceeds `scaleAskAbove` (0.1 m).
659
+
660
+ ## v0.3.8
661
+
662
+ - Dead-code removal, boundary-parser dedup, `restore0Dir` wired as a builtin.
663
+
664
+ ## v0.3.7
665
+
666
+ - Tail-read logs (`logTailBytes`, 4 MB) and table renders for eight tools.
667
+
668
+ ## v0.3.6
669
+
670
+ - com multi-region: `regionProperties` groups, `0.orig/` + `restore0Dir`,
671
+ per-region renders.
672
+
673
+ ## v0.3.5
674
+
675
+ - `openfoam-cht` skill and skills guard tests.
676
+
677
+ ## v0.3.4
678
+
679
+ - Registration layer (`lib/registry.js`): strict schema, render wrapper,
680
+ per-tool telemetry, `needs_input` question block.
681
+
682
+ ## v0.3.0
683
+
684
+ - Multi-region (CHT) support, honest verifiers, tool routing, `openfoam_usage_report`.
685
+
686
+ ## v0.2.0
687
+
688
+ - Bundle version in `env_check`/`version_info`; documented update flow.
689
+
690
+ ## v0.1.0
691
+
692
+ - Initial prototype: case inspection, doctor, meshing, runs, renders.