dsh-vibe-math 2.7.3 → 2.8.0

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 (101) hide show
  1. package/LICENSE +21 -21
  2. package/README.en.md +682 -682
  3. package/README.md +683 -683
  4. package/docs/AUDIT-CHECKLIST.md +755 -744
  5. package/docs/COMPAT-AUDIT-ROUND2.md +351 -351
  6. package/docs/COMPAT-AUDIT-ROUND3.md +154 -154
  7. package/docs/audit-methodology.md +93 -0
  8. package/docs/final-paper.md +172 -172
  9. package/docs/formal-verification.md +613 -588
  10. package/docs/generate_framework_diagram_v2.py +114 -114
  11. package/docs/generate_framework_diagram_v3.py +127 -127
  12. package/docs/math-computation.md +195 -194
  13. package/docs/release-notes/README.en.md +1 -0
  14. package/docs/release-notes/README.md +1 -0
  15. package/docs/release-notes/RELEASE-NOTES-2.0.22.md +112 -112
  16. package/docs/release-notes/RELEASE-NOTES-2.1.0.md +143 -143
  17. package/docs/release-notes/RELEASE-NOTES-2.2.0.md +266 -266
  18. package/docs/release-notes/RELEASE-NOTES-2.2.1.md +43 -43
  19. package/docs/release-notes/RELEASE-NOTES-2.2.2.md +88 -88
  20. package/docs/release-notes/RELEASE-NOTES-2.3.0.md +207 -207
  21. package/docs/release-notes/RELEASE-NOTES-2.3.1.md +134 -134
  22. package/docs/release-notes/RELEASE-NOTES-2.3.10.md +105 -105
  23. package/docs/release-notes/RELEASE-NOTES-2.3.11.md +57 -57
  24. package/docs/release-notes/RELEASE-NOTES-2.3.12.md +80 -80
  25. package/docs/release-notes/RELEASE-NOTES-2.3.2.md +145 -145
  26. package/docs/release-notes/RELEASE-NOTES-2.3.3.md +115 -115
  27. package/docs/release-notes/RELEASE-NOTES-2.3.4.md +69 -69
  28. package/docs/release-notes/RELEASE-NOTES-2.3.5.md +63 -63
  29. package/docs/release-notes/RELEASE-NOTES-2.3.6.md +66 -66
  30. package/docs/release-notes/RELEASE-NOTES-2.3.7.md +59 -59
  31. package/docs/release-notes/RELEASE-NOTES-2.3.8.md +45 -45
  32. package/docs/release-notes/RELEASE-NOTES-2.3.9.md +70 -70
  33. package/docs/release-notes/RELEASE-NOTES-2.8.0.en.md +65 -0
  34. package/docs/release-notes/RELEASE-NOTES-2.8.0.md +65 -0
  35. package/docs/release-playbook.md +103 -0
  36. package/docs/slv-playbook.md +117 -0
  37. package/docs/test-timing.md +158 -157
  38. package/docs//346/236/266/346/236/204/345/233/276.md +77 -77
  39. package/installer.js +792 -792
  40. package/package.json +13 -3
  41. package/prompt-corpus-v2/formal-verify-v2.json +2 -2
  42. package/prompt-corpus-v2/formal-verify-v2.md +4 -0
  43. package/prompt-corpus-v3/formal-verify-v3.json +7 -7
  44. package/prompt-corpus-v3/formal-verify-v3.md +14 -0
  45. package/prompt-corpus-v5/prompt-corpus-v5.json +61 -61
  46. package/prompt-corpus-v5/prompt-corpus-v5.md +122 -0
  47. package/scripts/clean-temp.mjs +234 -0
  48. package/tests/audit-engine-faces.mjs +298 -0
  49. package/tests/audit-formal-sensitivity.mjs +345 -342
  50. package/tests/audit-installer-compat.test.mjs +256 -256
  51. package/tests/audit-math-computation-sensitivity.mjs +1 -1
  52. package/tests/audit-persona-sensitivity.mjs +323 -323
  53. package/tests/audit-persona-surface.test.mjs +431 -431
  54. package/tests/audit-prompt-duplication.mutants.mjs +3 -2
  55. package/tests/audit-prompt-invariants.mjs +589 -546
  56. package/tests/audit-registration.mjs +78 -78
  57. package/tests/audit-spec-traceability.mjs +193 -193
  58. package/tests/audit-status-report-fields.mjs +172 -172
  59. package/tests/audit-v5-integrity.mjs +795 -795
  60. package/tests/audit-v5-sensitivity.mjs +433 -432
  61. package/tests/e2e-v5-round2.test.mjs +2453 -2426
  62. package/tests/formal-verify-v2.test.mjs +1806 -1800
  63. package/tests/formal-verify-v3.test.mjs +1757 -1750
  64. package/tests/formal-verify-v4.test.mjs +2114 -2106
  65. package/tests/formal-verify-v5.test.mjs +774 -767
  66. package/tests/math-computation-discovery.mutants.mjs +3 -3
  67. package/tests/math-computation-shared.test.mjs +122 -5
  68. package/tests/math-computation-v2.test.mjs +14 -2
  69. package/tests/math-computation-v3.test.mjs +14 -2
  70. package/tests/math-computation-v4.test.mjs +739 -739
  71. package/tests/prompt-v5-integrity.test.mjs +1291 -1291
  72. package/tests/run-tests.mjs +393 -332
  73. package/tests/selfdrive-v5.mjs +560 -560
  74. package/tests/temp-hygiene.mutants.mjs +80 -0
  75. package/tests/v2-fix-probes.mutants.mjs +4 -0
  76. package/tests/v2-fix-probes.test.mjs +1034 -1033
  77. package/tests/v2v3-interrupt.mutants.mjs +111 -0
  78. package/tests/v3-fix-probes.mutants.mjs +99 -95
  79. package/tests/v3-fix-probes.test.mjs +891 -890
  80. package/tests/v4-final-paper.mutants.mjs +108 -0
  81. package/tests/v5-institute-fixes.mutants.mjs +218 -190
  82. package/vibe-math-v2/agent.cordis.yml +376 -376
  83. package/vibe-math-v2/math-computation.js +17 -15
  84. package/vibe-math-v2/preset.yml +2 -2
  85. package/vibe-math-v2/v2/347/232/204/351/242/235/345/244/226/350/246/201/346/261/202.txt +21 -21
  86. package/vibe-math-v2/vibe-math-v2.js +5078 -5011
  87. package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +486 -486
  88. package/vibe-math-v3/agent.cordis.yml +420 -420
  89. package/vibe-math-v3/math-computation.js +17 -15
  90. package/vibe-math-v3/preset.yml +2 -2
  91. package/vibe-math-v3/vibe-math-v3.js +6215 -6149
  92. package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +649 -649
  93. package/vibe-math-v4/agent.cordis.yml +438 -438
  94. package/vibe-math-v4/math-computation.js +17 -15
  95. package/vibe-math-v4/preset.yml +2 -2
  96. package/vibe-math-v4/vibe-math-v4.js +4490 -4422
  97. package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +1015 -1015
  98. package/vibe-math-v5/math-computation.js +17 -15
  99. package/vibe-math-v5/vibe-math-v5.js +93 -11
  100. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +1728 -1728
  101. package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +693 -693
@@ -0,0 +1,80 @@
1
+ // Falsifiability driver for scripts/clean-temp.mjs (task-12): a SINGLE-SITE edit in the sweeper must
2
+ // turn its own guard (`--self-test`) NAMED-red, while the unmutated control stays green. The mutated
3
+ // copy is written as a DOT-SIBLING inside scripts/ so the module still resolves REPO/tests correctly
4
+ // (a copy in %TEMP% would fail the prefix-extraction check for the wrong reason), and it is always
5
+ // removed in `finally`.
6
+ import { spawnSync } from 'node:child_process'
7
+ import { readFileSync, rmSync, writeFileSync } from 'node:fs'
8
+ import { dirname, join } from 'node:path'
9
+ import { fileURLToPath } from 'node:url'
10
+
11
+ const HERE = dirname(fileURLToPath(import.meta.url))
12
+ const REPO = join(HERE, '..')
13
+ const SRC = join(REPO, 'scripts', 'clean-temp.mjs')
14
+
15
+ const FAMILIES = [
16
+ {
17
+ // The age threshold is the whole safety property: without it every suite dir looks deletable.
18
+ name: 'the age threshold is dropped (a FRESH suite dir starts looking stale)',
19
+ from: '.filter((e) => Number(e.mtimeMs) < cut)',
20
+ to: '.filter(() => true)',
21
+ expect: /a FRESH suite dir is never swept/,
22
+ },
23
+ {
24
+ // The prefix test keeps the sweeper from touching ANY top-level directory of the temp root.
25
+ name: 'the suite-prefix test is dropped (any top-level dir starts looking like ours)',
26
+ from: 'prefixes.some((p) => String(e.name).startsWith(p))',
27
+ to: 'true',
28
+ expect: /only exact suite prefixes are swept/,
29
+ },
30
+ {
31
+ // task-15: "parent is gone" is the safety property - dropping it makes OUR OWN running gate look like
32
+ // a leftover, which is exactly the false positive that would make this tool dangerous to auto-run.
33
+ name: 'the parent-gone test is dropped (a live-parented gate looks like a leftover)',
34
+ from: 'return e.parentGone === true',
35
+ to: 'return true',
36
+ expect: /a process with a LIVE parent .* is never called a leftover/,
37
+ },
38
+ {
39
+ // task-15: the command-line gate is what keeps unrelated programs (editors, other stacks) out.
40
+ name: 'the command-line gate is dropped (any orphaned program looks like ours)',
41
+ from: "if (!patterns.some((re) => re.test(String(e.cmd || '')))) return false",
42
+ to: 'if (false) return false',
43
+ expect: /an unrelated program is never reported/,
44
+ },
45
+ ]
46
+
47
+ function runSelftest(scriptPath) {
48
+ const r = spawnSync(process.execPath, [scriptPath, '--self-test'], { encoding: 'utf8', timeout: 60000, cwd: REPO })
49
+ return { code: r.status, out: String(r.stdout || '') + String(r.stderr || '') }
50
+ }
51
+
52
+ const control = runSelftest(SRC)
53
+ console.log('control (unmutated sweeper): exit=' + control.code + (control.code === 0 ? ' green, as required' : ' NOT GREEN'))
54
+ if (control.code !== 0) console.log(control.out.split(/\r?\n/).filter((l) => /FAIL/.test(l)).slice(0, 3).join('\n'))
55
+
56
+ let red = 0
57
+ for (const f of FAMILIES) {
58
+ const dest = join(REPO, 'scripts', '.tmp-hygiene-' + Math.random().toString(36).slice(2, 10) + '.mjs')
59
+ let ok = false
60
+ try {
61
+ let text = readFileSync(SRC, 'utf8').replace(/\r\n?/g, '\n')
62
+ if (/\r/.test(text)) { console.error('SETUP-FAIL - the anchor source was not EOL-normalised (CR leaked into anchor matching)'); process.exit(1) }
63
+ const hits = text.split(f.from).length - 1
64
+ if (hits !== 1) { console.error('SETUP-FAIL - anchor ' + JSON.stringify(f.from) + ' matched ' + hits + ' time(s), expected exactly 1'); process.exit(1) }
65
+ writeFileSync(dest, text.replace(f.from, f.to), 'utf8')
66
+ const r = runSelftest(dest)
67
+ const named = r.out.split(/\r?\n/).filter((l) => /^\s*FAIL - /.test(l) && f.expect.test(l)).map((l) => l.trim())
68
+ ok = r.code !== 0 && named.length > 0
69
+ console.log((ok ? ' ok - ' : ' FAIL - ') + f.name + ' [exit=' + r.code + ']' + (named.length ? ' :: ' + named[0].slice(0, 140) : ' :: no named red (exit=' + r.code + ')'))
70
+ if (ok) red++
71
+ } finally {
72
+ try { rmSync(dest, { force: true }) } catch (e) { /* best effort */ }
73
+ }
74
+ }
75
+
76
+ console.log('')
77
+ console.log('mutant families reddening the temp-hygiene guard by name: ' + red + '/' + FAMILIES.length)
78
+ console.log('control green: ' + (control.code === 0))
79
+ if (red !== FAMILIES.length || control.code !== 0) process.exit(1)
80
+ console.log('ALL MUTANTS RED AS REQUIRED')
@@ -89,6 +89,10 @@ FAMILIES.push(
89
89
  { name: 'F-B: one registration site reverted to a literal', expect: /\[F-B\/v2\] 两处注册点都由 paramProps\(\)/,
90
90
  from: "objParams(paramProps()), 'vibe_math_set_params')", to: "objParams({ mode: { type: 'string', enum: ['manual', 'auto'] } }), 'vibe_math_set_params')" },
91
91
  )
92
+ FAMILIES.push(
93
+ { name: 'task-9/v2: the not-detected log drops the actionable sentence', expect: /\[task-9\/v2\]/,
94
+ from: '已探测 PATH 与文档化的常见 TeX 根;可用 paperLatexCommand 指定绝对路径。', to: '' },
95
+ )
92
96
  for (const f of FAMILIES) { const t0 = Date.now(); lastHang = false; const ok = runFamily(f); const ms = Date.now() - t0; TIMES.push([f.name, ms]); if (lastHang) hangs.push(f.name + "(" + Math.round(ms / 1000) + "s)"); if (ok) red++ }
93
97
  console.log('')
94
98
  console.log('mutant families reddening the v2 probe by name: ' + red + '/' + FAMILIES.length)