dsh-vibe-math 0.3.11 → 0.3.12
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/package.json +1 -1
- package/vibe-math-v2/vibe-math-v2.js +12 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-vibe-math",
|
|
3
3
|
"description": "Multi-agent mathematical problem-solving & verification frameworks for DeepSeek Harness — TWO agent presets in one install: vibe-math-v1 (classic pipeline: brainstorm → solver iteration → multi-verifier debate → Verified) and vibe-math-v2 (new probability-driven architecture: qs.json + Propos knowledge base + explorer→solver→review/debate verdict). Installing this bundle auto-installs both presets into the DSH preset root.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "installer.js",
|
|
7
7
|
"exports": {
|
|
@@ -706,6 +706,7 @@ export function apply(ctx) {
|
|
|
706
706
|
if (p.在问题清单) continue // 已晋升:其证明/证伪经晋升问题的解法验证,避免同一内容双重验证
|
|
707
707
|
const proofs = p.证明列表 || []; const refutes = p.证伪列表 || []
|
|
708
708
|
if (proofs.length === 0 && refutes.length === 0) {
|
|
709
|
+
if (String(p.id).indexOf('p-tmp-') === 0) continue // 临时假设由「判断下述命题是否成立:p_{q-tmp}」问题统一验证,避免裸命题验证双重路径
|
|
709
710
|
out.push({ rId: 'r-' + p.id, kind: 'proposition', pId: p.id, 概述: p.概述, prob: Number(p.布尔估计) || 0, priority: p.优先级 === 'never' ? 999 : Number(p.优先级) })
|
|
710
711
|
} else {
|
|
711
712
|
for (let j = 0; j < proofs.length; j++) { if (proofs[j].正确概率 === 1 || proofs[j].正确概率 === 0 || proofs[j].已验) continue; if (!String(proofs[j].完整过程 || '').trim()) continue; out.push({ rId: 'r-' + p.id + '-pf' + j, kind: 'prop-proof', pId: p.id, 概述: p.概述, side: '证明', process: proofs[j].完整过程 || '', idx: j, prob: Number(proofs[j].正确概率) || 0, priority: p.优先级 === 'never' ? 999 : Number(p.优先级) }) }
|
|
@@ -809,7 +810,7 @@ export function apply(ctx) {
|
|
|
809
810
|
if (parsed.dead_end_reason) dir.dead_end_reason = parsed.dead_end_reason
|
|
810
811
|
if (typeof parsed.survival_probability === 'number') dir.survival = clamp01(parsed.survival_probability)
|
|
811
812
|
if (parsed.lemmas && parsed.lemmas.length) { for (let i = 0; i < parsed.lemmas.length; i++) await addLemmaAsProposition(qid, parsed.lemmas[i]) }
|
|
812
|
-
if (parsed.sub_questions && parsed.sub_questions.length) { for (let i = 0; i < parsed.sub_questions.length; i++) await addSubQuestion(qid, dirId, parsed.sub_questions[i]) }
|
|
813
|
+
if (parsed.sub_questions && parsed.sub_questions.length) { for (let i = 0; i < parsed.sub_questions.length; i++) { const rec = await addSubQuestion(qid, dirId, parsed.sub_questions[i]); if (rec) { dir.sub_questions = dir.sub_questions || []; dir.sub_questions.push(rec) } } }
|
|
813
814
|
}
|
|
814
815
|
if (status === 'success') {
|
|
815
816
|
if (parsed && parsed.solution) {
|
|
@@ -875,8 +876,16 @@ export function apply(ctx) {
|
|
|
875
876
|
// 1) q_sub 本身(问题类,完整陈述)入 qs.json;
|
|
876
877
|
// 2) p_{q-tmp}(命题类临时假设:对 q_sub 的某种回答)入 Propos/;
|
|
877
878
|
// 3) 「判断下述命题是否成立:p_{q-tmp}」(问题类)入 qs.json。
|
|
879
|
+
// 返回 {subId,judgeId,assumeId},由 handleSolver 在最终保存 progress 时记入方向(避免旧 progress 覆盖丢记录)。
|
|
878
880
|
async function addSubQuestion(qid, dirId, sq) {
|
|
879
|
-
if (!sq || !sq.q_sub_statement) return
|
|
881
|
+
if (!sq || !sq.q_sub_statement) return undefined
|
|
882
|
+
const q = await findQ(qid)
|
|
883
|
+
if (q) {
|
|
884
|
+
const prog = parseProgress(q)
|
|
885
|
+
const d = prog.directions.find(function (x) { return x.id === dirId })
|
|
886
|
+
// 去重:同一方向已注册过相同陈述的 q_sub 则跳过(避免多轮重复上报产生重复问题/假设)
|
|
887
|
+
if (d && d.sub_questions && d.sub_questions.some(function (x) { return x.statement === sq.q_sub_statement })) { logActivity('subquestion', 'duplicate q_sub skipped for ' + qid + '/' + dirId); return undefined }
|
|
888
|
+
}
|
|
880
889
|
const qs = await getQs()
|
|
881
890
|
const subId = qid + '-sub-' + shortId()
|
|
882
891
|
const assumeId = 'p-tmp-' + shortId()
|
|
@@ -893,9 +902,8 @@ export function apply(ctx) {
|
|
|
893
902
|
来源问题: qid,
|
|
894
903
|
}
|
|
895
904
|
await upsertProposition(p)
|
|
896
|
-
const q = qs.find(function (x) { return x.id === qid })
|
|
897
|
-
if (q) { const prog = parseProgress(q); const d = prog.directions.find(function (x) { return x.id === dirId }); if (d) { d.sub_questions = d.sub_questions || []; d.sub_questions.push({ subId: subId, judgeId: judgeId, assumeId: assumeId }) } await saveProgress(qid, prog) }
|
|
898
905
|
logActivity('subquestion', qid + ' → q_sub ' + subId + ' + 判断问题 ' + judgeId + ' + 临时假设 ' + assumeId)
|
|
906
|
+
return { subId: subId, judgeId: judgeId, assumeId: assumeId, statement: sq.q_sub_statement }
|
|
899
907
|
}
|
|
900
908
|
async function addSolution(qid, solutionText, prob) {
|
|
901
909
|
const qs = await getQs(); const q = qs.find(function (x) { return x.id === qid }); if (!q) return
|