dsh-vibe-math 2.7.2 → 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 (153) hide show
  1. package/LICENSE +21 -21
  2. package/README.en.md +682 -681
  3. package/README.md +683 -682
  4. package/cordis.patch.yml +112 -16
  5. package/docs/AUDIT-CHECKLIST.md +755 -518
  6. package/docs/COMPAT-AUDIT-ROUND2.md +354 -328
  7. package/docs/COMPAT-AUDIT-ROUND3.md +154 -154
  8. package/docs/audit-methodology.md +93 -0
  9. package/docs/final-paper.md +172 -172
  10. package/docs/formal-verification.md +613 -588
  11. package/docs/generate_framework_diagram_v2.py +114 -114
  12. package/docs/generate_framework_diagram_v3.py +127 -127
  13. package/docs/math-computation.md +195 -187
  14. package/docs/parameter-schema.md +37 -0
  15. package/docs/release-notes/README.en.md +2 -0
  16. package/docs/release-notes/README.md +2 -0
  17. package/docs/release-notes/RELEASE-NOTES-2.0.22.md +112 -112
  18. package/docs/release-notes/RELEASE-NOTES-2.1.0.md +143 -143
  19. package/docs/release-notes/RELEASE-NOTES-2.2.0.md +266 -266
  20. package/docs/release-notes/RELEASE-NOTES-2.2.1.md +43 -43
  21. package/docs/release-notes/RELEASE-NOTES-2.2.2.md +88 -88
  22. package/docs/release-notes/RELEASE-NOTES-2.3.0.md +207 -207
  23. package/docs/release-notes/RELEASE-NOTES-2.3.1.md +134 -134
  24. package/docs/release-notes/RELEASE-NOTES-2.3.10.md +105 -105
  25. package/docs/release-notes/RELEASE-NOTES-2.3.11.md +57 -57
  26. package/docs/release-notes/RELEASE-NOTES-2.3.12.md +80 -80
  27. package/docs/release-notes/RELEASE-NOTES-2.3.2.md +145 -145
  28. package/docs/release-notes/RELEASE-NOTES-2.3.3.md +115 -115
  29. package/docs/release-notes/RELEASE-NOTES-2.3.4.md +69 -69
  30. package/docs/release-notes/RELEASE-NOTES-2.3.5.md +63 -63
  31. package/docs/release-notes/RELEASE-NOTES-2.3.6.md +66 -66
  32. package/docs/release-notes/RELEASE-NOTES-2.3.7.md +59 -59
  33. package/docs/release-notes/RELEASE-NOTES-2.3.8.md +45 -45
  34. package/docs/release-notes/RELEASE-NOTES-2.3.9.md +70 -70
  35. package/docs/release-notes/RELEASE-NOTES-2.7.2.en.md +2 -2
  36. package/docs/release-notes/RELEASE-NOTES-2.7.2.md +3 -3
  37. package/docs/release-notes/RELEASE-NOTES-2.7.3.en.md +67 -0
  38. package/docs/release-notes/RELEASE-NOTES-2.7.3.md +67 -0
  39. package/docs/release-notes/RELEASE-NOTES-2.8.0.en.md +65 -0
  40. package/docs/release-notes/RELEASE-NOTES-2.8.0.md +65 -0
  41. package/docs/release-notes/TEMPLATE.md +6 -0
  42. package/docs/release-playbook.md +103 -0
  43. package/docs/slv-playbook.md +117 -0
  44. package/docs/status-report-fields.md +167 -0
  45. package/docs/test-timing.md +158 -154
  46. package/docs//346/236/266/346/236/204/345/233/276.md +77 -77
  47. package/installer.js +793 -783
  48. package/package.json +260 -203
  49. package/prompt-corpus-persona/persona-corpus.json +9 -9
  50. package/prompt-corpus-persona/persona-corpus.md +225 -33
  51. package/prompt-corpus-v2/formal-verify-v2.json +295 -115
  52. package/prompt-corpus-v2/formal-verify-v2.md +2290 -282
  53. package/prompt-corpus-v3/formal-verify-v3.json +112 -112
  54. package/prompt-corpus-v3/formal-verify-v3.md +227 -143
  55. package/prompt-corpus-v4/formal-verify-v4.json +18 -18
  56. package/prompt-corpus-v4/formal-verify-v4.md +49 -44
  57. package/prompt-corpus-v5/prompt-corpus-v5.json +82 -82
  58. package/prompt-corpus-v5/prompt-corpus-v5.md +573 -207
  59. package/scripts/clean-temp.mjs +234 -0
  60. package/scripts/update-doc-counts.mjs +71 -0
  61. package/tests/audit-artifact-docs.mjs +72 -0
  62. package/tests/audit-artifact-docs.mutants.mjs +58 -0
  63. package/tests/audit-engine-faces.mjs +298 -0
  64. package/tests/audit-formal-sensitivity.mjs +345 -342
  65. package/tests/audit-installer-assertions.mutants.mjs +63 -0
  66. package/tests/audit-installer-compat.test.mjs +256 -208
  67. package/tests/audit-installer-policy.test.mjs +41 -8
  68. package/tests/audit-math-computation-contract.mjs +64 -8
  69. package/tests/audit-math-computation-contract.mutants.mjs +106 -0
  70. package/tests/audit-math-computation-parity.mjs +164 -3
  71. package/tests/audit-math-computation-sensitivity.mjs +5 -3
  72. package/tests/audit-package-membership.mjs +57 -0
  73. package/tests/audit-package-membership.mutants.mjs +28 -0
  74. package/tests/audit-participant-set-parity.mjs +160 -0
  75. package/tests/audit-path-discipline.mjs +83 -0
  76. package/tests/audit-path-discipline.mutants.mjs +51 -0
  77. package/tests/audit-persona-sensitivity.mjs +323 -309
  78. package/tests/audit-persona-surface.mutants.mjs +69 -0
  79. package/tests/audit-persona-surface.test.mjs +431 -390
  80. package/tests/audit-prompt-duplication.mjs +143 -0
  81. package/tests/audit-prompt-duplication.mutants.mjs +51 -0
  82. package/tests/audit-prompt-invariants.mjs +589 -508
  83. package/tests/audit-readme-bilingual.test.mjs +152 -0
  84. package/tests/audit-readme-counts.mjs +95 -0
  85. package/tests/audit-readme-counts.mutants.mjs +52 -0
  86. package/tests/audit-registration.mjs +78 -0
  87. package/tests/audit-spec-traceability.mjs +193 -193
  88. package/tests/audit-status-report-fields.mjs +172 -0
  89. package/tests/audit-status-report-fields.mutants.mjs +64 -0
  90. package/tests/audit-v3-registration-parity.mjs +156 -0
  91. package/tests/audit-v5-integrity.mjs +795 -508
  92. package/tests/audit-v5-lean-abstention.mjs +392 -0
  93. package/tests/audit-v5-lean-abstention.mutants.mjs +106 -0
  94. package/tests/audit-v5-prompt-duplication.mjs +88 -0
  95. package/tests/audit-v5-prompt-duplication.mutants.mjs +34 -0
  96. package/tests/audit-v5-sensitivity.mjs +433 -427
  97. package/tests/e2e-identity-a6.mutants.mjs +65 -0
  98. package/tests/e2e-v5-round2.test.mjs +2453 -1981
  99. package/tests/formal-verify-v2.test.mjs +1778 -1724
  100. package/tests/formal-verify-v3.mutants.mjs +117 -0
  101. package/tests/formal-verify-v3.test.mjs +1724 -1671
  102. package/tests/formal-verify-v4.mutants.mjs +152 -0
  103. package/tests/formal-verify-v4.test.mjs +2114 -1574
  104. package/tests/formal-verify-v5.test.mjs +790 -724
  105. package/tests/helpers/doc-counts-format.mjs +41 -0
  106. package/tests/helpers/math-computation-fake-seam.mjs +4 -0
  107. package/tests/math-computation-a1.mutants.mjs +72 -0
  108. package/tests/math-computation-archive-rerun.mutants.mjs +65 -0
  109. package/tests/math-computation-discovery.mutants.mjs +76 -0
  110. package/tests/math-computation-shared.test.mjs +392 -6
  111. package/tests/math-computation-v2.test.mjs +779 -0
  112. package/tests/math-computation-v3.test.mjs +771 -0
  113. package/tests/math-computation-v4.mutants.mjs +133 -0
  114. package/tests/math-computation-v4.test.mjs +739 -0
  115. package/tests/prompt-v5-integrity.test.mjs +1291 -1280
  116. package/tests/run-tests.mjs +393 -202
  117. package/tests/run-tests.mutants.mjs +70 -0
  118. package/tests/selfdrive-v5.mjs +560 -508
  119. package/tests/selfdrive-v5.mutants.mjs +132 -0
  120. package/tests/temp-hygiene.mutants.mjs +80 -0
  121. package/tests/v2-fix-probes.mutants.mjs +104 -0
  122. package/tests/v2-fix-probes.test.mjs +1040 -0
  123. package/tests/v2-list-agents-and-next-step.mutants.mjs +106 -0
  124. package/tests/v2v3-interrupt.mutants.mjs +111 -0
  125. package/tests/v3-fix-probes.mutants.mjs +99 -0
  126. package/tests/v3-fix-probes.test.mjs +892 -0
  127. package/tests/v4-final-paper.mutants.mjs +108 -0
  128. package/tests/v5-institute-fixes.mutants.mjs +218 -0
  129. package/vibe-math-v2/agent.cordis.yml +378 -322
  130. package/vibe-math-v2/math-computation.js +144 -53
  131. package/vibe-math-v2/math-engines.js +12 -12
  132. package/vibe-math-v2/preset.yml +2 -2
  133. package/vibe-math-v2/v2/347/232/204/351/242/235/345/244/226/350/246/201/346/261/202.txt +21 -21
  134. package/vibe-math-v2/vibe-math-v2.js +5097 -4755
  135. package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +491 -487
  136. package/vibe-math-v3/agent.cordis.yml +422 -356
  137. package/vibe-math-v3/math-computation.js +144 -53
  138. package/vibe-math-v3/math-engines.js +12 -12
  139. package/vibe-math-v3/preset.yml +2 -2
  140. package/vibe-math-v3/vibe-math-v3.js +6235 -5873
  141. package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +649 -649
  142. package/vibe-math-v4/agent.cordis.yml +438 -402
  143. package/vibe-math-v4/math-computation.js +144 -53
  144. package/vibe-math-v4/math-engines.js +12 -12
  145. package/vibe-math-v4/preset.yml +2 -2
  146. package/vibe-math-v4/vibe-math-v4.js +4490 -4269
  147. package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +1015 -1013
  148. package/vibe-math-v5/agent.cordis.yml +46 -12
  149. package/vibe-math-v5/math-computation.js +144 -53
  150. package/vibe-math-v5/math-engines.js +12 -12
  151. package/vibe-math-v5/vibe-math-v5.js +1266 -229
  152. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +1728 -1660
  153. package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +693 -693
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Probe for prompt-audit M3 (v3): the two registerTool paths must not drift.
3
+ *
4
+ * v3 declares each tool twice — the session handler table inside makeSession()
5
+ * (registerTool(name, description, parameters, executeFn)) and the real
6
+ * `tools.register` at apply scope (registerTool(name, description, parameters,
7
+ * handlerName)). The parameter schemas are guarded by audit-prompt-invariants
8
+ * (I13/I14); the DESCRIPTIONS were not, and five of them had already drifted.
9
+ *
10
+ * Checks per tool (33 of them):
11
+ * - MISSING : registered on only one path
12
+ * - DESC-DRIFT : the description argument text differs between the two paths
13
+ * - SCHEMA-DRIFT : the parameter-schema argument text differs
14
+ * - NO-SOURCE : a description is not read from the shared module-level table
15
+ * (the "one source of truth" claim would be nominal only)
16
+ * - BAD-REF : a TOOL_DESC.<name> reference has no matching entry in the table
17
+ *
18
+ * Read-only: parses the source text, never executes the plugin.
19
+ *
20
+ * Sensitivity probe (the suite must be falsifiable):
21
+ * node tests/audit-v3-registration-parity.mjs --self-probe '["<from>","<to>"]'
22
+ * The pair is applied to the source text, so a first-occurrence mutation makes the
23
+ * second path disagree and the probe must exit 1.
24
+ */
25
+ import { readFileSync } from 'node:fs';
26
+ import { fileURLToPath } from 'node:url';
27
+ import { dirname, join } from 'node:path';
28
+
29
+ const HERE = dirname(fileURLToPath(import.meta.url));
30
+ let SRC = readFileSync(join(HERE, '..', 'vibe-math-v3', 'vibe-math-v3.js'), 'utf8');
31
+
32
+ const SELF_PROBE = process.argv.indexOf('--self-probe');
33
+ if (SELF_PROBE !== -1 && process.argv[SELF_PROBE + 1]) {
34
+ const [from, to] = JSON.parse(process.argv[SELF_PROBE + 1]);
35
+ const before = SRC;
36
+ SRC = SRC.replace(from, to);
37
+ if (SRC === before) { console.log('MUTATION DID NOT APPLY: ' + from); process.exit(2); }
38
+ }
39
+
40
+ /** Skip a string literal (any quote) starting at i; returns the index after it. */
41
+ function skipString(s, i) {
42
+ const q = s[i];
43
+ i++;
44
+ while (i < s.length) {
45
+ if (s[i] === '\\') { i += 2; continue; }
46
+ if (s[i] === q) return i + 1;
47
+ i++;
48
+ }
49
+ return i;
50
+ }
51
+
52
+ // Normalise line endings: this file is checked out with CRLF on Windows, and a stray \r
53
+ // between an entry's `,` and its key would make the table parser under-count (it did).
54
+ SRC = SRC.replace(/\r/g, '');
55
+
56
+ /** Collect a top-level-comma-separated argument list starting at `open` (an index of `(`). */
57
+ function argsOf(s, open) {
58
+ let depth = 0;
59
+ const args = [];
60
+ let cur = '';
61
+ for (let i = open; i < s.length; i++) {
62
+ const c = s[i];
63
+ if (c === '"' || c === "'" || c === '`') { const j = skipString(s, i); cur += s.slice(i, j); i = j - 1; continue; }
64
+ if (c === '(' || c === '[' || c === '{') { depth++; cur += c; continue; }
65
+ if (c === ')' || c === ']' || c === '}') {
66
+ depth--;
67
+ if (depth === 0) { args.push(cur.trim()); return args; }
68
+ cur += c; continue;
69
+ }
70
+ if (c === ',' && depth === 1) { args.push(cur.trim()); cur = ''; continue; }
71
+ if (depth >= 1) cur += c;
72
+ }
73
+ return args;
74
+ }
75
+
76
+ const calls = [];
77
+ for (const m of SRC.matchAll(/registerTool\(\s*'([A-Za-z0-9_]+)'/g)) {
78
+ const open = SRC.indexOf('(', m.index + 'registerTool'.length);
79
+ calls.push({ name: m[1], at: m.index, args: argsOf(SRC, open) });
80
+ }
81
+
82
+ const byName = new Map();
83
+ for (const c of calls) {
84
+ if (!byName.has(c.name)) byName.set(c.name, []);
85
+ byName.get(c.name).push(c);
86
+ }
87
+
88
+ // The shared description table (module-level `const TOOL_DESC = { … }`).
89
+ //
90
+ // Keys are collected with an ANCHORED PER-LINE regex inside the table's own text slice —
91
+ // string values are blanked out first (keeping every newline) so the `{`/`}` braces inside
92
+ // the sync_meta documentation text cannot shift a brace-depth scanner (that mis-parse is
93
+ // exactly how an earlier version of this probe silently saw 15 of 33 entries).
94
+ const tableAt = SRC.search(/const\s+TOOL_DESC\s*=\s*\{/);
95
+ const tableKeys = new Set();
96
+ if (tableAt !== -1) {
97
+ const open = SRC.indexOf('{', tableAt);
98
+ // slice to the matching close brace with strings blanked (newlines preserved)
99
+ let depth = 0;
100
+ let end = -1;
101
+ let blanked = '';
102
+ for (let i = open; i < SRC.length; i++) {
103
+ const c = SRC[i];
104
+ if (c === '"' || c === "'" || c === '`') {
105
+ const stop = skipString(SRC, i);
106
+ for (let k = i; k < stop; k++) blanked += (SRC[k] === '\n' ? '\n' : ' ');
107
+ i = stop - 1;
108
+ continue;
109
+ }
110
+ blanked += c;
111
+ if (c === '{') depth++;
112
+ else if (c === '}') { depth--; if (depth === 0) { end = i; break; } }
113
+ }
114
+ const tableText = blanked.slice(0, end === -1 ? blanked.length : end - open + 1);
115
+ for (const m of tableText.matchAll(/^[ \t]*([A-Za-z_$][\w$]*)\s*:/gm)) tableKeys.add(m[1]);
116
+ }
117
+
118
+ let descDrift = 0;
119
+ let schemaDrift = 0;
120
+ let noSource = 0;
121
+ let badRef = 0;
122
+ const missing = [];
123
+ for (const [name, list] of byName) {
124
+ if (list.length !== 2) { missing.push(name + ' (' + list.length + ' registration(s))'); continue; }
125
+ const [a, b] = list.map((c) => ({ desc: c.args[1], schema: c.args[2] }));
126
+ if (a.desc !== b.desc) {
127
+ descDrift++;
128
+ console.log('DESC-DRIFT ' + name);
129
+ console.log(' path#1: ' + String(a.desc).slice(0, 140));
130
+ console.log(' path#2: ' + String(b.desc).slice(0, 140));
131
+ }
132
+ if (a.schema !== b.schema) {
133
+ schemaDrift++;
134
+ console.log('SCHEMA-DRIFT ' + name);
135
+ console.log(' path#1: ' + String(a.schema).slice(0, 140));
136
+ console.log(' path#2: ' + String(b.schema).slice(0, 140));
137
+ }
138
+ for (const d of [a.desc, b.desc]) {
139
+ const want = 'TOOL_DESC.' + name;
140
+ if (d === want) continue;
141
+ if (/^TOOL_DESC\./.test(d)) { badRef++; console.log('BAD-REF ' + name + ' → ' + d); continue; }
142
+ noSource++;
143
+ console.log('NO-SOURCE ' + name + ' → ' + String(d).slice(0, 140));
144
+ }
145
+ }
146
+
147
+ console.log('shared TOOL_DESC entries: ' + tableKeys.size);
148
+ console.log('tools registered twice: ' + [...byName.values()].filter((v) => v.length === 2).length + ' / ' + byName.size);
149
+ console.log('DESC-DRIFT count: ' + descDrift);
150
+ console.log('SCHEMA-DRIFT count: ' + schemaDrift);
151
+ console.log('descriptions not from the shared table: ' + noSource);
152
+ console.log('bad TOOL_DESC references: ' + badRef);
153
+ console.log('one-path-only tools: ' + (missing.length ? missing.join(', ') : 'none'));
154
+ const ok = descDrift === 0 && schemaDrift === 0 && noSource === 0 && badRef === 0 && missing.length === 0 && tableKeys.size === byName.size;
155
+ console.log(ok ? '=== DESC PARITY OK ===' : '=== DESC PARITY FAILED ===');
156
+ process.exit(ok ? 0 : 1);