dsh-vibe-math 2.7.3 → 2.8.1
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.
- package/LICENSE +21 -21
- package/README.en.md +682 -682
- package/README.md +683 -683
- package/docs/AUDIT-CHECKLIST.md +758 -744
- package/docs/COMPAT-AUDIT-ROUND2.md +351 -351
- package/docs/COMPAT-AUDIT-ROUND3.md +154 -154
- package/docs/audit-methodology.md +93 -0
- package/docs/final-paper.md +172 -172
- package/docs/formal-verification.md +613 -588
- package/docs/generate_framework_diagram_v2.py +114 -114
- package/docs/generate_framework_diagram_v3.py +127 -127
- package/docs/math-computation.md +195 -194
- package/docs/release-notes/README.en.md +2 -0
- package/docs/release-notes/README.md +2 -0
- package/docs/release-notes/RELEASE-NOTES-2.0.22.md +112 -112
- package/docs/release-notes/RELEASE-NOTES-2.1.0.md +143 -143
- package/docs/release-notes/RELEASE-NOTES-2.2.0.md +266 -266
- package/docs/release-notes/RELEASE-NOTES-2.2.1.md +43 -43
- package/docs/release-notes/RELEASE-NOTES-2.2.2.md +88 -88
- package/docs/release-notes/RELEASE-NOTES-2.3.0.md +207 -207
- package/docs/release-notes/RELEASE-NOTES-2.3.1.md +134 -134
- package/docs/release-notes/RELEASE-NOTES-2.3.10.md +105 -105
- package/docs/release-notes/RELEASE-NOTES-2.3.11.md +57 -57
- package/docs/release-notes/RELEASE-NOTES-2.3.12.md +80 -80
- package/docs/release-notes/RELEASE-NOTES-2.3.2.md +145 -145
- package/docs/release-notes/RELEASE-NOTES-2.3.3.md +115 -115
- package/docs/release-notes/RELEASE-NOTES-2.3.4.md +69 -69
- package/docs/release-notes/RELEASE-NOTES-2.3.5.md +63 -63
- package/docs/release-notes/RELEASE-NOTES-2.3.6.md +66 -66
- package/docs/release-notes/RELEASE-NOTES-2.3.7.md +59 -59
- package/docs/release-notes/RELEASE-NOTES-2.3.8.md +45 -45
- package/docs/release-notes/RELEASE-NOTES-2.3.9.md +70 -70
- package/docs/release-notes/RELEASE-NOTES-2.8.0.en.md +65 -0
- package/docs/release-notes/RELEASE-NOTES-2.8.0.md +65 -0
- package/docs/release-notes/RELEASE-NOTES-2.8.1.en.md +49 -0
- package/docs/release-notes/RELEASE-NOTES-2.8.1.md +49 -0
- package/docs/release-playbook.md +111 -0
- package/docs/slv-playbook.md +117 -0
- package/docs/test-timing.md +158 -157
- package/docs//346/236/266/346/236/204/345/233/276.md +77 -77
- package/installer.js +792 -792
- package/package.json +18 -3
- package/prompt-corpus-v2/formal-verify-v2.json +2 -2
- package/prompt-corpus-v2/formal-verify-v2.md +4 -0
- package/prompt-corpus-v3/formal-verify-v3.json +7 -7
- package/prompt-corpus-v3/formal-verify-v3.md +14 -0
- package/prompt-corpus-v5/prompt-corpus-v5.json +61 -61
- package/prompt-corpus-v5/prompt-corpus-v5.md +122 -0
- package/scripts/clean-temp.mjs +234 -0
- package/scripts/release-check.mjs +181 -0
- package/tests/audit-engine-faces.mjs +298 -0
- package/tests/audit-formal-sensitivity.mjs +345 -342
- package/tests/audit-installer-compat.test.mjs +256 -256
- package/tests/audit-math-computation-sensitivity.mjs +1 -1
- package/tests/audit-persona-sensitivity.mjs +323 -323
- package/tests/audit-persona-surface.test.mjs +431 -431
- package/tests/audit-prompt-duplication.mutants.mjs +3 -2
- package/tests/audit-prompt-invariants.mjs +589 -546
- package/tests/audit-registration.mjs +78 -78
- package/tests/audit-spec-traceability.mjs +193 -193
- package/tests/audit-status-report-fields.mjs +172 -172
- package/tests/audit-v5-integrity.mjs +795 -795
- package/tests/audit-v5-sensitivity.mjs +433 -432
- package/tests/e2e-v5-round2.test.mjs +2453 -2426
- package/tests/formal-verify-v2.test.mjs +1806 -1800
- package/tests/formal-verify-v3.test.mjs +1757 -1750
- package/tests/formal-verify-v4.test.mjs +2114 -2106
- package/tests/formal-verify-v5.test.mjs +774 -767
- package/tests/math-computation-discovery.mutants.mjs +3 -3
- package/tests/math-computation-shared.test.mjs +122 -5
- package/tests/math-computation-v2.test.mjs +14 -2
- package/tests/math-computation-v3.test.mjs +14 -2
- package/tests/math-computation-v4.test.mjs +739 -739
- package/tests/prompt-v5-integrity.test.mjs +1291 -1291
- package/tests/release-check.mutants.mjs +78 -0
- package/tests/run-tests.mjs +393 -332
- package/tests/selfdrive-v5.mjs +560 -560
- package/tests/temp-hygiene.mutants.mjs +80 -0
- package/tests/v2-fix-probes.mutants.mjs +4 -0
- package/tests/v2-fix-probes.test.mjs +1034 -1033
- package/tests/v2v3-interrupt.mutants.mjs +111 -0
- package/tests/v3-fix-probes.mutants.mjs +99 -95
- package/tests/v3-fix-probes.test.mjs +891 -890
- package/tests/v4-final-paper.mutants.mjs +116 -0
- package/tests/v4-final-paper.test.mjs +628 -0
- package/tests/v5-institute-fixes.mutants.mjs +218 -190
- package/vibe-math-v2/agent.cordis.yml +376 -376
- package/vibe-math-v2/math-computation.js +17 -15
- package/vibe-math-v2/preset.yml +2 -2
- package/vibe-math-v2/v2/347/232/204/351/242/235/345/244/226/350/246/201/346/261/202.txt +21 -21
- package/vibe-math-v2/vibe-math-v2.js +5078 -5011
- package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +486 -486
- package/vibe-math-v3/agent.cordis.yml +420 -420
- package/vibe-math-v3/math-computation.js +17 -15
- package/vibe-math-v3/preset.yml +2 -2
- package/vibe-math-v3/vibe-math-v3.js +6215 -6149
- package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +649 -649
- package/vibe-math-v4/agent.cordis.yml +438 -438
- package/vibe-math-v4/math-computation.js +17 -15
- package/vibe-math-v4/preset.yml +2 -2
- package/vibe-math-v4/vibe-math-v4.js +4520 -4422
- package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +1015 -1015
- package/vibe-math-v5/math-computation.js +17 -15
- package/vibe-math-v5/vibe-math-v5.js +93 -11
- package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +1728 -1728
- package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +693 -693
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Registered mutant harness for the v4 final-paper path — the suite carries its own proof.
|
|
2
|
+
// Each family is a SINGLE content-anchored mutation of the v4 preset (no line numbers); the suite runs
|
|
3
|
+
// through the V4_PLUGIN seam. Child runs are bounded (a timeout is a HANG); skipped families are printed
|
|
4
|
+
// and counted. Exit criterion: every family reddens BY NAME; ALL MUTANTS RED AS REQUIRED + exit 0 only then.
|
|
5
|
+
// Run: node tests/v4-final-paper.mutants.mjs
|
|
6
|
+
import { readFileSync, writeFileSync, mkdirSync, copyFileSync, rmSync, readdirSync } from 'node:fs'
|
|
7
|
+
import { execFileSync } from 'node:child_process'
|
|
8
|
+
import { dirname, join } from 'node:path'
|
|
9
|
+
import { tmpdir } from 'node:os'
|
|
10
|
+
import { fileURLToPath } from 'node:url'
|
|
11
|
+
const HERE = dirname(fileURLToPath(import.meta.url))
|
|
12
|
+
const REPO = join(HERE, '..')
|
|
13
|
+
const PRESET = 'vibe-math-v4'
|
|
14
|
+
const MAIN = PRESET + '.js'
|
|
15
|
+
const SUITE = 'tests/v4-final-paper.test.mjs'
|
|
16
|
+
const ENV = 'V4_PLUGIN'
|
|
17
|
+
const START_MS = Date.now()
|
|
18
|
+
// This suite is long, so the default child budget is generous; MUTANT_CHILD_TIMEOUT_MS overrides it.
|
|
19
|
+
const CHILD_TIMEOUT_MS = Number(process.env.MUTANT_CHILD_TIMEOUT_MS || 300000)
|
|
20
|
+
const TIMES = []
|
|
21
|
+
const hangs = []
|
|
22
|
+
const skipped = []
|
|
23
|
+
function copyGraph(file, dest) {
|
|
24
|
+
const src = join(REPO, PRESET, file)
|
|
25
|
+
copyFileSync(src, join(dest, file))
|
|
26
|
+
for (const m of readFileSync(src, 'utf8').matchAll(/from\s+'(\.\/[A-Za-z0-9_.-]+\.js)'/g)) {
|
|
27
|
+
const dep = m[1].slice(2)
|
|
28
|
+
if (!readdirSync(dest).includes(dep)) copyGraph(dep, dest)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function runFamily(f) {
|
|
32
|
+
const dest = join(tmpdir(), 'v4paper-mut-' + Math.random().toString(36).slice(2, 10))
|
|
33
|
+
mkdirSync(dest, { recursive: true })
|
|
34
|
+
copyGraph(MAIN, dest)
|
|
35
|
+
const target = join(dest, f.editFile || MAIN)
|
|
36
|
+
const before = readFileSync(target, 'utf8').replace(/\r\n?/g, '\n') // task-7: anchors are LF; a CRLF checkout made them match 0 times
|
|
37
|
+
if (/\r/.test(before)) { console.error('SETUP-FAIL - the anchor source was not EOL-normalised (CRLF leaked into anchor matching)'); process.exit(1) }
|
|
38
|
+
const n = before.split(f.from).length - 1
|
|
39
|
+
const okCount = f.lastOnly || f.all ? n >= 1 : n === 1
|
|
40
|
+
if (!okCount) {
|
|
41
|
+
skipped.push(f.name + ' (anchor x' + n + ')')
|
|
42
|
+
console.error(' SKIP - ' + f.name + ' (anchor x' + n + ')')
|
|
43
|
+
rmSync(dest, { recursive: true, force: true })
|
|
44
|
+
return false
|
|
45
|
+
}
|
|
46
|
+
const mutated = f.lastOnly
|
|
47
|
+
? (() => { const i = before.lastIndexOf(f.from); return before.slice(0, i) + f.to + before.slice(i + f.from.length) })()
|
|
48
|
+
: before.split(f.from).join(f.to)
|
|
49
|
+
writeFileSync(target, mutated, 'utf8')
|
|
50
|
+
try { execFileSync(process.execPath, ['--check', target], { stdio: 'pipe' }) }
|
|
51
|
+
catch (e) {
|
|
52
|
+
writeFileSync(target, before, 'utf8')
|
|
53
|
+
skipped.push(f.name + ' (mutation did not compile)')
|
|
54
|
+
console.error(' SKIP - ' + f.name + ' (mutation did not compile; restored)')
|
|
55
|
+
rmSync(dest, { recursive: true, force: true })
|
|
56
|
+
return false
|
|
57
|
+
}
|
|
58
|
+
const t0 = Date.now()
|
|
59
|
+
let out = ''
|
|
60
|
+
let code = 0
|
|
61
|
+
let hang = false
|
|
62
|
+
try {
|
|
63
|
+
out = execFileSync(process.execPath, [SUITE], {
|
|
64
|
+
cwd: REPO, encoding: 'utf8', timeout: CHILD_TIMEOUT_MS, killSignal: 'SIGKILL',
|
|
65
|
+
env: Object.assign({}, process.env, { [ENV]: join(dest, MAIN) }),
|
|
66
|
+
})
|
|
67
|
+
} catch (e) {
|
|
68
|
+
if (e && (e.killed || e.signal === 'SIGKILL')) hang = true
|
|
69
|
+
code = (e && e.status) || 1
|
|
70
|
+
out = String((e && e.stdout) || '') + String((e && e.stderr) || '')
|
|
71
|
+
}
|
|
72
|
+
const ms = Date.now() - t0
|
|
73
|
+
TIMES.push([f.name, ms])
|
|
74
|
+
if (hang) hangs.push(f.name + '(' + Math.round(ms / 1000) + 's)')
|
|
75
|
+
const named = out.split(/\r?\n/).filter((l) => /^\s*(FAIL - | {2}- )/.test(l) && f.expect.test(l)).map((l) => l.trim())
|
|
76
|
+
const ok = !hang && code !== 0 && named.length > 0
|
|
77
|
+
console.log((hang ? ' HANG - ' : (ok ? ' ok - ' : ' FAIL - ')) + f.name + ' [' + ms + 'ms]' + (named.length ? ' :: ' + named[0].slice(0, 150) : ' :: no named red (exit=' + code + ')'))
|
|
78
|
+
rmSync(dest, { recursive: true, force: true })
|
|
79
|
+
return ok
|
|
80
|
+
}
|
|
81
|
+
const FAMILIES = [
|
|
82
|
+
{
|
|
83
|
+
// task-11: the not-detected case must WARN on the reachable surfaces (finalize return + status view).
|
|
84
|
+
// Dropping the appended note must redden the guarding assertion BY NAME.
|
|
85
|
+
name: 'task-11/v4: the not-detected warning drops the actionable sentence',
|
|
86
|
+
from: '已探测 PATH 与文档化的常见 TeX 根;可用 paperLatexCommand 指定绝对路径。',
|
|
87
|
+
to: '',
|
|
88
|
+
expect: /\[task-9\/v4\]/,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
// task-10: restoring the merged order lets an unresolvable explicit command fall through to another
|
|
92
|
+
// engine again (the documented rule is "explicit ⇒ only it").
|
|
93
|
+
name: 'task-10/v4: the explicit LaTeX command falls through to another engine again',
|
|
94
|
+
from: 'const order=prefer?[prefer]:base',
|
|
95
|
+
to: 'const order=(prefer?[prefer]:[]).concat(base.filter(x=>x!==prefer))',
|
|
96
|
+
expect: /\[task-10\/v4\]/,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
// The delivered artifacts must state WHY no PDF was produced (the body is composed BEFORE compilation,
|
|
100
|
+
// so this note is written after it). Blunting the zh note must redden that guard BY NAME.
|
|
101
|
+
name: 'deliverable/v4: the delivered paper stops stating that no engine was detected',
|
|
102
|
+
from: "zh?'本机未检测到 LaTeX 引擎:只产出 tex+md'",
|
|
103
|
+
to: "zh?''",
|
|
104
|
+
expect: /\[deliverable\/v4\]/,
|
|
105
|
+
},
|
|
106
|
+
]
|
|
107
|
+
let red = 0
|
|
108
|
+
for (const f of FAMILIES) { const t0 = Date.now(); const ok = runFamily(f); const ms = Date.now() - t0; if (ok) red++ }
|
|
109
|
+
console.log('')
|
|
110
|
+
console.log('mutant families reddening the v4 final-paper path by name: ' + red + '/' + FAMILIES.length)
|
|
111
|
+
console.log('skipped=[' + skipped.join(' | ') + ']')
|
|
112
|
+
console.log('timings: ' + TIMES.map((t) => String(t[0]).split(':')[0] + '=' + t[1] + 'ms').join(' '))
|
|
113
|
+
console.log('TOTAL WALL TIME (all families + setup): ' + (Date.now() - START_MS) + 'ms (' + Math.round((Date.now() - START_MS) / 1000) + 's)')
|
|
114
|
+
console.log('hangs=[' + hangs.join(' | ') + ']')
|
|
115
|
+
if (red !== FAMILIES.length || skipped.length || hangs.length) process.exit(1)
|
|
116
|
+
console.log('ALL MUTANTS RED AS REQUIRED')
|