@louisultra/dsh-verymath 0.0.0-stage → 0.3.2
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/CHANGELOG.md +133 -0
- package/LICENSE +21 -0
- package/NOTICE.md +35 -0
- package/README.md +108 -2
- package/README_EN.md +105 -0
- package/UPSTREAM.json +106 -0
- package/cordis.patch.yml +12 -0
- package/docs/capability-examples.md +581 -0
- package/docs/examples/README.md +32 -0
- package/docs/examples/bad_scan.md +10 -0
- package/docs/examples/broken-proof.lean +9 -0
- package/docs/examples/claims.md +7 -0
- package/docs/examples/knapsack.json +10 -0
- package/docs/examples/matrix.json +1 -0
- package/docs/examples/points.csv +21 -0
- package/docs/examples/qp.json +8 -0
- package/docs/examples/research-ws/project/GOALS.yaml +4 -0
- package/docs/examples/research-ws/workstreams/ws-lsa/report.md +13 -0
- package/docs/examples/research-ws/workstreams/ws-lsa/reviews/r1.json +1 -0
- package/docs/examples/research-ws/workstreams/ws-lsa/status.yaml +1 -0
- package/docs/examples/source.csv +4 -0
- package/lib/core/error.d.ts +20 -0
- package/lib/core/error.js +25 -0
- package/lib/core/gates.d.ts +42 -0
- package/lib/core/gates.js +217 -0
- package/lib/core/glossary.d.ts +101 -0
- package/lib/core/glossary.js +243 -0
- package/lib/core/graph.d.ts +118 -0
- package/lib/core/graph.js +460 -0
- package/lib/core/index.d.ts +120 -0
- package/lib/core/index.js +197 -0
- package/lib/core/paper.d.ts +163 -0
- package/lib/core/paper.js +73 -0
- package/lib/core/paths.d.ts +2 -0
- package/lib/core/paths.js +12 -0
- package/lib/core/sage.d.ts +61 -0
- package/lib/core/sage.js +212 -0
- package/lib/core/skills.d.ts +11 -0
- package/lib/core/skills.js +110 -0
- package/lib/tool/index.d.ts +21 -0
- package/lib/tool/index.js +1144 -0
- package/package.json +92 -4
- package/skills/after-ocr/SKILL.md +123 -0
- package/skills/after-ocr/references/audit-schema.md +94 -0
- package/skills/after-ocr/references/error-taxonomy.md +179 -0
- package/skills/after-ocr/scripts/merge_audit_logs.py +329 -0
- package/skills/after-ocr/scripts/scan_markdown_ocr.py +350 -0
- package/skills/after-ocr/tests/test_scripts.py +84 -0
- package/skills/discover-math-problems/SKILL.md +115 -0
- package/skills/discover-math-problems/references/artifact-contract.md +93 -0
- package/skills/discover-math-problems/references/autonomous-research-protocol.md +86 -0
- package/skills/discover-math-problems/references/conjecture-generation-protocol.md +63 -0
- package/skills/discover-math-problems/references/extremal-graph-variants.md +53 -0
- package/skills/graph-theory-paper-reading/SKILL.md +600 -0
- package/skills/invariant-computation/SKILL.md +169 -0
- package/skills/invariant-computation/examples/invariant_summary.example.json +51 -0
- package/skills/invariant-computation/manifest.yaml +46 -0
- package/skills/invariant-computation/references/INDEX.md +20 -0
- package/skills/invariant-computation/references/failure_modes.md +40 -0
- package/skills/invariant-computation/references/method_route_map.md +177 -0
- package/skills/invariant-computation/references/source_notes.md +19 -0
- package/skills/invariant-computation/references/tool_catalog.md +65 -0
- package/skills/invariant-computation/references/validation_checks.md +52 -0
- package/skills/invariant-computation/schema/invariant_summary.schema.json +260 -0
- package/skills/lean-formalization/SKILL.md +111 -0
- package/skills/lean-formalization/lean-runtime/config/env.example +5 -0
- package/skills/lean-formalization/lean-runtime/config/lean_agent.example.toml +28 -0
- package/skills/lean-formalization/lean-runtime/config/numina_runtime.example.toml +12 -0
- package/skills/lean-formalization/lean-runtime/examples/smoke/LocalLeanSmoke.lean +7 -0
- package/skills/lean-formalization/lean-runtime/prompts/complete_sorries.md +3 -0
- package/skills/lean-formalization/lean-runtime/prompts/formalize_statement.md +3 -0
- package/skills/lean-formalization/lean-runtime/prompts/prove_theorem.md +3 -0
- package/skills/lean-formalization/lean-runtime/prompts/repair_lean_file.md +3 -0
- package/skills/lean-formalization/lean-runtime/references/backend_adapter_checklist.md +36 -0
- package/skills/lean-formalization/lean-runtime/references/direct_lean_workflow.md +48 -0
- package/skills/lean-formalization/lean-runtime/references/failure_taxonomy.md +17 -0
- package/skills/lean-formalization/lean-runtime/references/interactive_orchestration.md +83 -0
- package/skills/lean-formalization/lean-runtime/references/lean_agent_capability_map.md +116 -0
- package/skills/lean-formalization/lean-runtime/references/lean_lsp_mcp_adapter.md +219 -0
- package/skills/lean-formalization/lean-runtime/references/lean_runtime_configuration.md +92 -0
- package/skills/lean-formalization/lean-runtime/references/numina_reverse_analysis.md +80 -0
- package/skills/lean-formalization/lean-runtime/references/numina_runtime.md +41 -0
- package/skills/lean-formalization/lean-runtime/references/numina_subagent_troubleshooting.md +77 -0
- package/skills/lean-formalization/lean-runtime/references/review_checklist.md +10 -0
- package/skills/lean-formalization/lean-runtime/references/specialist_agent_patterns.md +65 -0
- package/skills/lean-formalization/lean-runtime/schemas/config.schema.json +12 -0
- package/skills/lean-formalization/lean-runtime/schemas/result.schema.json +33 -0
- package/skills/lean-formalization/lean-runtime/schemas/task.schema.json +30 -0
- package/skills/lean-formalization/lean-runtime/scripts/ai4m_lean.py +222 -0
- package/skills/lean-formalization/lean-runtime/scripts/check_lean_project.py +134 -0
- package/skills/lean-formalization/lean-runtime/scripts/common.py +296 -0
- package/skills/lean-formalization/lean-runtime/scripts/configure_lean.py +222 -0
- package/skills/lean-formalization/lean-runtime/scripts/detect_sorry.py +49 -0
- package/skills/lean-formalization/lean-runtime/scripts/direct_task.py +100 -0
- package/skills/lean-formalization/lean-runtime/scripts/extract_minimal_failure.py +74 -0
- package/skills/lean-formalization/lean-runtime/scripts/numina_runtime.py +414 -0
- package/skills/lean-formalization/lean-runtime/scripts/smoke_test.py +75 -0
- package/skills/lean-formalization/lean-runtime/scripts/tool_status.py +79 -0
- package/skills/lean-formalization/lean-runtime/scripts/validate_patch.py +81 -0
- package/skills/lean-formalization/lean-runtime/scripts/verify_delivery.py +484 -0
- package/skills/lean-formalization/lean-runtime/tests/fixtures/after_bad.lean +4 -0
- package/skills/lean-formalization/lean-runtime/tests/fixtures/after_statement_changed.lean +4 -0
- package/skills/lean-formalization/lean-runtime/tests/fixtures/before.lean +4 -0
- package/skills/lean-formalization/lean-runtime/tests/fixtures/failure.lean +7 -0
- package/skills/lean-formalization/lean-runtime/tests/test_check_lean_project.py +59 -0
- package/skills/lean-formalization/lean-runtime/tests/test_cli.py +377 -0
- package/skills/lean-formalization/lean-runtime/tests/test_common_config.py +84 -0
- package/skills/lean-formalization/lean-runtime/tests/test_configure_lean.py +138 -0
- package/skills/lean-formalization/lean-runtime/tests/test_detect_sorry.py +24 -0
- package/skills/lean-formalization/lean-runtime/tests/test_direct_task.py +69 -0
- package/skills/lean-formalization/lean-runtime/tests/test_numina_runtime.py +168 -0
- package/skills/lean-formalization/lean-runtime/tests/test_validate_patch.py +29 -0
- package/skills/lean-setup/SKILL.md +99 -0
- package/skills/least-squares/README.md +85 -0
- package/skills/least-squares/SKILL.md +613 -0
- package/skills/least-squares/examples.md +380 -0
- package/skills/math-beamer/SKILL.md +325 -0
- package/skills/math-beamer/references/build-and-layout-audit.md +63 -0
- package/skills/math-beamer/references/math-domain-patterns.md +56 -0
- package/skills/math-beamer/references/template-policy.md +43 -0
- package/skills/math-beamer/references/template-source-index.md +51 -0
- package/skills/math-beamer/templates/catalog.yaml +235 -0
- package/skills/math-beamer/templates/packs/algebra-number-theory-talk/main.tex +45 -0
- package/skills/math-beamer/templates/packs/algebra-number-theory-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/algorithm-talk/main.tex +43 -0
- package/skills/math-beamer/templates/packs/algorithm-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/analysis-core-talk/main.tex +49 -0
- package/skills/math-beamer/templates/packs/analysis-core-talk/template.yaml +19 -0
- package/skills/math-beamer/templates/packs/backup-heavy-talk/main.tex +40 -0
- package/skills/math-beamer/templates/packs/backup-heavy-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/beamerposter-a0/main.tex +45 -0
- package/skills/math-beamer/templates/packs/beamerposter-a0/template.yaml +12 -0
- package/skills/math-beamer/templates/packs/combinatorics-graph-talk/main.tex +53 -0
- package/skills/math-beamer/templates/packs/combinatorics-graph-talk/template.yaml +18 -0
- package/skills/math-beamer/templates/packs/control-systems-talk/main.tex +51 -0
- package/skills/math-beamer/templates/packs/control-systems-talk/template.yaml +18 -0
- package/skills/math-beamer/templates/packs/course-lecture-zh/main.tex +43 -0
- package/skills/math-beamer/templates/packs/course-lecture-zh/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/data-experiment-results/main.tex +45 -0
- package/skills/math-beamer/templates/packs/data-experiment-results/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/dynamical-systems-talk/main.tex +42 -0
- package/skills/math-beamer/templates/packs/dynamical-systems-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/geometry-topology-talk/main.tex +43 -0
- package/skills/math-beamer/templates/packs/geometry-topology-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/information-coding-crypto-talk/main.tex +49 -0
- package/skills/math-beamer/templates/packs/information-coding-crypto-talk/template.yaml +18 -0
- package/skills/math-beamer/templates/packs/logic-foundations-category-talk/main.tex +51 -0
- package/skills/math-beamer/templates/packs/logic-foundations-category-talk/template.yaml +18 -0
- package/skills/math-beamer/templates/packs/numerical-analysis-talk/main.tex +51 -0
- package/skills/math-beamer/templates/packs/numerical-analysis-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/optimization-talk/main.tex +58 -0
- package/skills/math-beamer/templates/packs/optimization-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/pde-analysis-talk/main.tex +49 -0
- package/skills/math-beamer/templates/packs/pde-analysis-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/probability-statistics-talk/main.tex +52 -0
- package/skills/math-beamer/templates/packs/probability-statistics-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/reading-group-paper/main.tex +46 -0
- package/skills/math-beamer/templates/packs/reading-group-paper/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/seminar-minimal-en/main.tex +60 -0
- package/skills/math-beamer/templates/packs/seminar-minimal-en/template.yaml +13 -0
- package/skills/math-beamer/templates/packs/seminar-minimal-zh/main.tex +60 -0
- package/skills/math-beamer/templates/packs/seminar-minimal-zh/template.yaml +13 -0
- package/skills/math-beamer/templates/packs/theorem-proof-talk/main.tex +60 -0
- package/skills/math-beamer/templates/packs/theorem-proof-talk/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/thesis-defense/main.tex +42 -0
- package/skills/math-beamer/templates/packs/thesis-defense/template.yaml +9 -0
- package/skills/math-beamer/templates/packs/workshop-tutorial/main.tex +32 -0
- package/skills/math-beamer/templates/packs/workshop-tutorial/template.yaml +9 -0
- package/skills/math-beamer/templates/preview-gallery.md +32 -0
- package/skills/math-beamer/templates/previews/algebra-number-theory-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/algebra-number-theory-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/algorithm-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/algorithm-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/analysis-core-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/analysis-core-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/backup-heavy-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/backup-heavy-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/beamerposter-a0-content.png +0 -0
- package/skills/math-beamer/templates/previews/beamerposter-a0-cover.png +0 -0
- package/skills/math-beamer/templates/previews/combinatorics-graph-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/combinatorics-graph-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/control-systems-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/control-systems-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/course-lecture-zh-content.png +0 -0
- package/skills/math-beamer/templates/previews/course-lecture-zh-cover.png +0 -0
- package/skills/math-beamer/templates/previews/data-experiment-results-content.png +0 -0
- package/skills/math-beamer/templates/previews/data-experiment-results-cover.png +0 -0
- package/skills/math-beamer/templates/previews/dynamical-systems-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/dynamical-systems-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/geometry-topology-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/geometry-topology-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/information-coding-crypto-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/information-coding-crypto-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/logic-foundations-category-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/logic-foundations-category-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/numerical-analysis-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/numerical-analysis-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/optimization-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/optimization-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/pde-analysis-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/pde-analysis-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/probability-statistics-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/probability-statistics-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/reading-group-paper-content.png +0 -0
- package/skills/math-beamer/templates/previews/reading-group-paper-cover.png +0 -0
- package/skills/math-beamer/templates/previews/seminar-minimal-en-content.png +0 -0
- package/skills/math-beamer/templates/previews/seminar-minimal-en-cover.png +0 -0
- package/skills/math-beamer/templates/previews/seminar-minimal-zh-content.png +0 -0
- package/skills/math-beamer/templates/previews/seminar-minimal-zh-cover.png +0 -0
- package/skills/math-beamer/templates/previews/theorem-proof-talk-content.png +0 -0
- package/skills/math-beamer/templates/previews/theorem-proof-talk-cover.png +0 -0
- package/skills/math-beamer/templates/previews/thesis-defense-content.png +0 -0
- package/skills/math-beamer/templates/previews/thesis-defense-cover.png +0 -0
- package/skills/math-beamer/templates/previews/workshop-tutorial-content.png +0 -0
- package/skills/math-beamer/templates/previews/workshop-tutorial-cover.png +0 -0
- package/skills/math-beamer/templates/review-report.md +54 -0
- package/skills/math-beamer/templates/slide-source-ledger.md +22 -0
- package/skills/math-beamer/templates/source-packet.md +50 -0
- package/skills/math-glossary/SKILL.md +347 -0
- package/skills/math-glossary/references/glossary-schema.md +71 -0
- package/skills/math-glossary/references/glossary-usage-guide.md +176 -0
- package/skills/math-glossary/references/glossary-web-template.md +127 -0
- package/skills/math-glossary/references/glossary.schema.json +76 -0
- package/skills/math-glossary/references/user-manual.md +435 -0
- package/skills/math-glossary/requirements-ai.txt +3 -0
- package/skills/math-glossary/requirements.txt +3 -0
- package/skills/math-glossary/scripts/glossary_backup.py +42 -0
- package/skills/math-glossary/scripts/glossary_build.py +467 -0
- package/skills/math-glossary/scripts/glossary_enrich_examples.py +283 -0
- package/skills/math-glossary/scripts/glossary_export.py +333 -0
- package/skills/math-glossary/scripts/glossary_web.py +1265 -0
- package/skills/math-paper-reading/README.md +163 -0
- package/skills/math-paper-reading/SKILL.md +48 -0
- package/skills/math-paper-reading/agent_router.md +36 -0
- package/skills/math-paper-reading/references/proof_pattern_taxonomy.md +123 -0
- package/skills/math-paper-reading/references/quality_rubric.md +36 -0
- package/skills/math-paper-reading/skill_base.md +627 -0
- package/skills/math-paper-reading/skill_literature_search.md +866 -0
- package/skills/math-paper-reading/skill_paper_deep_read.md +1024 -0
- package/skills/math-paper-reading/skill_pathway_proof.md +718 -0
- package/skills/math-paper-reading/skill_reference_manager.md +746 -0
- package/skills/matlab-runner/SKILL.md +217 -0
- package/skills/matlab-runner/examples/README.md +33 -0
- package/skills/matlab-runner/examples/matrix_report.m +28 -0
- package/skills/matlab-runner/examples/plot_damped_sine.m +64 -0
- package/skills/matlab-runner/examples/test_vector_norm.m +12 -0
- package/skills/matlab-runner/references/client-setup.md +24 -0
- package/skills/matlab-runner/references/file-session-safety.md +86 -0
- package/skills/matlab-runner/references/numerical-safety.md +126 -0
- package/skills/matlab-runner/references/resource-safety.md +125 -0
- package/skills/mixed-integer-programming/SKILL.md +119 -0
- package/skills/mixed-integer-programming/lp-examples.md +251 -0
- package/skills/mixed-integer-programming/mip-examples-verified.md +118 -0
- package/skills/open-problem-research-pipeline/SKILL.md +76 -0
- package/skills/open-problem-research-pipeline/skill_literature_analysis.md +201 -0
- package/skills/open-problem-research-pipeline/skill_literature_proof_framework.md +206 -0
- package/skills/open-problem-research-pipeline/skill_literature_search.md +172 -0
- package/skills/open-problem-research-pipeline/skill_qskill.md +177 -0
- package/skills/osqp-solver/SKILL.md +245 -0
- package/skills/osqp-solver/references/citation.md +25 -0
- package/skills/osqp-solver/references/dual-infeasible-example.json +14 -0
- package/skills/osqp-solver/references/feasible-example.json +21 -0
- package/skills/osqp-solver/references/primal-infeasible-example.json +17 -0
- package/skills/osqp-solver/references/python-api.md +95 -0
- package/skills/osqp-solver/references/verification.md +94 -0
- package/skills/osqp-solver/scripts/check_osqp_environment.py +120 -0
- package/skills/osqp-solver/scripts/solve_qp.py +943 -0
- package/skills/paper-writing/SKILL.md +115 -0
- package/skills/paper-writing/skill_claim_evidence_ledger.md +55 -0
- package/skills/paper-writing/skill_formula_environment_and_readability.md +41 -0
- package/skills/paper-writing/skill_latex_build_and_layout_audit.md +73 -0
- package/skills/paper-writing/skill_notation_and_variable_consistency.md +42 -0
- package/skills/paper-writing/skill_paper_skeleton_and_logical_architecture.md +54 -0
- package/skills/paper-writing/skill_proof_obligation_and_assumption_audit.md +57 -0
- package/skills/paper-writing/templates/claim-evidence-ledger.md +23 -0
- package/skills/paper-writing/templates/proof-obligation-ledger.md +22 -0
- package/skills/paper-writing/templates/rapid-prototype-paper-skeleton.md +46 -0
- package/skills/paper-writing/templates/source-packet.md +37 -0
- package/skills/paper-writing/templates/submission-readiness.md +41 -0
- package/skills/proof-blueprint-review/SKILL.md +129 -0
- package/skills/proof-blueprint-review/references/agent-mediated-proof-protocol.md +57 -0
- package/skills/proof-blueprint-review/references/generation-agent.md +45 -0
- package/skills/proof-blueprint-review/references/proof-acceptance-contract.md +41 -0
- package/skills/proof-blueprint-review/references/verification-agent.md +37 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Math Beamer Review Report
|
|
2
|
+
|
|
3
|
+
## Build
|
|
4
|
+
|
|
5
|
+
- Root file:
|
|
6
|
+
- Engine:
|
|
7
|
+
- Command:
|
|
8
|
+
- Result:
|
|
9
|
+
- PDF:
|
|
10
|
+
- Log:
|
|
11
|
+
|
|
12
|
+
## Hard Failures
|
|
13
|
+
|
|
14
|
+
- Fatal errors:
|
|
15
|
+
- Missing files:
|
|
16
|
+
- Undefined references:
|
|
17
|
+
- Undefined citations:
|
|
18
|
+
- Duplicate labels:
|
|
19
|
+
|
|
20
|
+
## Layout Warnings
|
|
21
|
+
|
|
22
|
+
- Overfull boxes:
|
|
23
|
+
- Underfull boxes:
|
|
24
|
+
- Crowded frames:
|
|
25
|
+
- Formula overflow:
|
|
26
|
+
- Figure readability:
|
|
27
|
+
- Navigation/title collisions:
|
|
28
|
+
|
|
29
|
+
## Mathematical Review
|
|
30
|
+
|
|
31
|
+
- Unsupported claims:
|
|
32
|
+
- Assumptions at risk:
|
|
33
|
+
- Notation drift:
|
|
34
|
+
- Proof status issues:
|
|
35
|
+
- Experimental or numeric result issues:
|
|
36
|
+
|
|
37
|
+
## Template And Branding
|
|
38
|
+
|
|
39
|
+
- Template:
|
|
40
|
+
- Selected source and preview paths:
|
|
41
|
+
- Explicitly requested style changes:
|
|
42
|
+
- Rendered pages compared with the selected previews and approved samples:
|
|
43
|
+
- Cover, typography, page structure, navigation, and block comparison:
|
|
44
|
+
- Unrequested changes corrected or still unresolved:
|
|
45
|
+
- Visual comparison completed or unavailable:
|
|
46
|
+
- Third-party assets:
|
|
47
|
+
- Institutional logos/colors:
|
|
48
|
+
- License notes:
|
|
49
|
+
|
|
50
|
+
## Next Revision
|
|
51
|
+
|
|
52
|
+
1.
|
|
53
|
+
2.
|
|
54
|
+
3.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Slide Source Ledger
|
|
2
|
+
|
|
3
|
+
| Slide | Claim / object | Source | Status | Risk | Notes |
|
|
4
|
+
| --- | --- | --- | --- | --- | --- |
|
|
5
|
+
| 1 | Title, authors, event | User-provided metadata | confirmed | low | Replace placeholders before release. |
|
|
6
|
+
| 2 | Talk outline | Generated from approved section map | draft | medium | Confirm timing and audience. |
|
|
7
|
+
|
|
8
|
+
## Status Values
|
|
9
|
+
|
|
10
|
+
- `confirmed`: directly supported by provided source.
|
|
11
|
+
- `needs-citation`: claim is plausible but citation is missing.
|
|
12
|
+
- `needs-proof`: mathematical statement needs proof or proof reference.
|
|
13
|
+
- `experimental`: supported only by experiment or computation.
|
|
14
|
+
- `conjectural`: should be labeled as conjecture, heuristic, or future work.
|
|
15
|
+
- `remove-or-soften`: unsupported or overstated.
|
|
16
|
+
|
|
17
|
+
## Required Checks
|
|
18
|
+
|
|
19
|
+
- Every theorem, lemma, proposition, corollary, and conjecture has a source.
|
|
20
|
+
- Every numeric result names the run, table, log, or dataset.
|
|
21
|
+
- Every figure names its source file and whether it was generated or copied.
|
|
22
|
+
- Every assumption omitted from a slide is listed in speaker notes or backup.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Math Beamer Source Packet
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
- Talk title:
|
|
6
|
+
- Audience:
|
|
7
|
+
- Duration:
|
|
8
|
+
- Language:
|
|
9
|
+
- Target slide count:
|
|
10
|
+
- Required template or style:
|
|
11
|
+
|
|
12
|
+
## Sources
|
|
13
|
+
|
|
14
|
+
| Source | Type | Path / URL | Authority | Notes |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| | paper / notes / code / data / figure / bibliography | | primary / secondary | |
|
|
17
|
+
|
|
18
|
+
## Mathematical Objects
|
|
19
|
+
|
|
20
|
+
- Definitions:
|
|
21
|
+
- Main theorems:
|
|
22
|
+
- Lemmas:
|
|
23
|
+
- Algorithms:
|
|
24
|
+
- Examples:
|
|
25
|
+
- Experiments:
|
|
26
|
+
- Figures:
|
|
27
|
+
- Open questions:
|
|
28
|
+
|
|
29
|
+
## Constraints
|
|
30
|
+
|
|
31
|
+
- Build engine:
|
|
32
|
+
- Citation style:
|
|
33
|
+
- Branding:
|
|
34
|
+
- Confidential material:
|
|
35
|
+
- Do not include:
|
|
36
|
+
|
|
37
|
+
## Selected Template
|
|
38
|
+
|
|
39
|
+
- Template name and source path:
|
|
40
|
+
- Selected cover and content previews:
|
|
41
|
+
- Explicitly requested style changes (none by default):
|
|
42
|
+
- Approved sample source and rendered pages:
|
|
43
|
+
|
|
44
|
+
## Approval Checkpoints
|
|
45
|
+
|
|
46
|
+
- Template selection:
|
|
47
|
+
- Sample frames:
|
|
48
|
+
- Full draft:
|
|
49
|
+
- Compilation:
|
|
50
|
+
- Public release:
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: math-glossary
|
|
3
|
+
description: "术语库构建与管理 skill。当用户需要从专业词汇文献(PDF/Excel/TXT/JSON/CSV/YAML/MDX/扫描件)中提取、构建、维护双语术语库时使用。触发场景:用户说'建术语库'、'整理数学词汇'、'从词典提取术语'、'术语库'、'glossary'、'词汇表'、'翻译术语管理',需要查询术语库('查术语'、'流形英文怎么说'),或翻译 agent 需要查询/更新术语库时。学科无关的通用框架,数学是第一个应用场景。在 DSH 中优先使用 verymath_glossary_query / verymath_glossary_upsert / verymath_glossary_build / verymath_python_check 工具执行。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 数学术语库构建与管理
|
|
7
|
+
|
|
8
|
+
从专业词汇资源中构建结构化的双语术语库,支持构建、维护、查询、导出。框架本身是学科无关的,数学是第一个应用场景。
|
|
9
|
+
|
|
10
|
+
> **用户手册**:`references/user-manual.md` — 面向终端用户的完整使用手册,涵盖快速开始、Web 管理、日志系统、FAQ。
|
|
11
|
+
|
|
12
|
+
## DSH 工具入口(本插件提供)
|
|
13
|
+
|
|
14
|
+
在 DSH 宿主中,本 skill 的确定性操作优先通过 `@louisultra/dsh-verymath` 插件提供的模型工具执行,而不是直接起子进程:
|
|
15
|
+
|
|
16
|
+
| 任务 | 工具 | 说明 |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| 查询术语 | `verymath_glossary_query` | 按英文/中文/term_id/子领域查询 `glossary.json`,返回例句,支持子领域过滤,无需 Python |
|
|
19
|
+
| 存词/更新 | `verymath_glossary_upsert` | 读论文/翻译遇到新术语时追加或更新条目;自动维护排序、连续 idx 与日期,**不要手改 glossary.json** |
|
|
20
|
+
| 结构化建库/扩充 | `verymath_glossary_build` | 运行 `scripts/` 下的 `glossary_build.py` 等脚本(需本地 Python 3);Excel 缺依赖时工具会报告部分成功,如实转述 |
|
|
21
|
+
| 依赖检查 | `verymath_python_check` | 检查 Python 3 是否可用并给出安装提示 |
|
|
22
|
+
| 结构化校验 | (无工具时)读 JSON 后按 `references/glossary-schema.md` 校验 | 术语库不变量见下文 |
|
|
23
|
+
|
|
24
|
+
规则:
|
|
25
|
+
|
|
26
|
+
1. **查询类请求**(用户问某个术语怎么说/中英对照)直接用 `verymath_glossary_query`;结果为空再走构建流程。
|
|
27
|
+
2. **执行 `glossary_build.py` / `glossary_export.py` / `glossary_backup.py` / `glossary_enrich_examples.py` 前**先调 `verymath_python_check`;不可用时把工具返回的安装提示原样告知用户,不要自行安装。
|
|
28
|
+
3. **`glossary_web.py`(Flask Web 管理界面)是长驻服务**,不通过 `verymath_glossary_build` 运行;仅在用户明确要求时用 shell 启动,并遵守下文 loopback 安全边界。
|
|
29
|
+
4. 本 skill 目录即脚本根目录(`scripts/`、`references/` 相对于本 SKILL.md 解析);把产物写到用户工作区(如 `glossary/glossary.json`),不要写回 skill 目录。
|
|
30
|
+
5. 翻译 agent 查词约定、冲突裁决、备份与日志规范见下文原流程,行为不变。
|
|
31
|
+
|
|
32
|
+
## 数据模型
|
|
33
|
+
|
|
34
|
+
> 完整数据模型见 `references/glossary-schema.md`。该文件定义了所有字段、排序规则和术语库文件结构。开始前先读取它。
|
|
35
|
+
|
|
36
|
+
核心要点:每条术语是一个 JSON 对象,`term_id` 是唯一标识。同一条英文术语如有别名,别名展开为独立行(同一 `en`,`cn` 为别名,其余字段一致,`term_id` 加 `__N` 后缀区分)。术语库以 JSON 文件为唯一事实源,Excel 仅用于导出供人工审阅。
|
|
37
|
+
|
|
38
|
+
## 入口交互流程
|
|
39
|
+
|
|
40
|
+
当用户触发此 skill 时,按顺序询问以下问题。**每次只问一个问题**,等用户回答后
|
|
41
|
+
再问下一个。宿主支持结构化提问工具时可使用;不支持时直接用简短文本提问,不要
|
|
42
|
+
依赖某个专用客户端工具。
|
|
43
|
+
|
|
44
|
+
### 第1问:术语来源
|
|
45
|
+
|
|
46
|
+
先让用户输入文件路径(用户可以直接在聊天框里输入路径或拖拽文件)。接收到路径后,用 shell 验证路径是否存在。如果不存在,请用户重新输入。确认后进入第2问。
|
|
47
|
+
|
|
48
|
+
### 第2问:库类型
|
|
49
|
+
|
|
50
|
+
按以下内容提问:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
header: "术语库类型"
|
|
54
|
+
question: "你想构建哪种类型的术语库?"
|
|
55
|
+
options (multiSelect: false):
|
|
56
|
+
- label: "可更新库(推荐)"
|
|
57
|
+
description: "后续可搜索、新增、修改"
|
|
58
|
+
- label: "固定库"
|
|
59
|
+
description: "建完不可进行后续操作"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- "可更新库":构建完成后保持可维护状态。
|
|
63
|
+
- "固定库":只跑构建流程。
|
|
64
|
+
|
|
65
|
+
### 第3问:来源文件类型
|
|
66
|
+
|
|
67
|
+
按以下内容提问:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
header: "文件类型"
|
|
71
|
+
question: "来源文件是什么类型?"
|
|
72
|
+
options (multiSelect: false):
|
|
73
|
+
- label: "文本文档(推荐)"
|
|
74
|
+
description: "PDF / TXT / Excel / Markdown,从内容中直接提取术语对"
|
|
75
|
+
- label: "结构化数据"
|
|
76
|
+
description: "JSON / CSV / YAML,已有字段映射,直接导入"
|
|
77
|
+
- label: "电子词典"
|
|
78
|
+
description: "MDX 格式词典文件,解包后提取"
|
|
79
|
+
- label: "扫描件 PDF"
|
|
80
|
+
description: "需 OCR 处理"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
- "文本文档":从文档内容中提取术语对,适用于大多数场景
|
|
84
|
+
- "结构化数据":源文件已是键值对或表格,按字段映射导入。支持 JSON(对象数组或键值对象)、CSV(自动编码检测)、YAML
|
|
85
|
+
- "电子词典":MDX 格式词典文件,用 mdict-utils 解包为文本后提取
|
|
86
|
+
- "扫描件 PDF":需 OCR 处理
|
|
87
|
+
|
|
88
|
+
## 构建流程
|
|
89
|
+
|
|
90
|
+
### 第一步:解析与提取术语
|
|
91
|
+
|
|
92
|
+
从源文件中提取英文→中文的术语对。
|
|
93
|
+
|
|
94
|
+
**双语对照格式(如《新英汉数学词汇》)**:按行解析。"英文 中文"的对应关系通常是工整的对照格式,直接拆分。
|
|
95
|
+
|
|
96
|
+
**Excel 表格格式**:自动识别英文列和中文列。优先找表头含 "English/英文/术语/term" 和 "中文/翻译/译名/Chinese/translation" 的列。
|
|
97
|
+
|
|
98
|
+
**纯文本格式**:识别相邻出现的 "英文术语" + "中文翻译" 模式。数学术语的英文通常是单个单词或短语(如 *manifold*、*homotopy group*),中文通常是 2-6 个字的词或短语。
|
|
99
|
+
|
|
100
|
+
**Markdown 格式**:识别 Markdown 中的术语对照。常见排版结构包括:
|
|
101
|
+
- 表格:`| English | 中文 |` → 逐行提取
|
|
102
|
+
- 列表:`- term → 译法` 或 `- term (译法)`
|
|
103
|
+
- 分隔符对照:`EN | CN` 格式的术语表
|
|
104
|
+
|
|
105
|
+
**JSON 格式**:直接读取 JSON 文件,自动识别字段映射:
|
|
106
|
+
|
|
107
|
+
1. 如果 JSON 是对象数组 `[{...}, {...}]`:自动匹配字段名
|
|
108
|
+
- en 列识别:`en` / `english` / `term` / `word` / `keyword` / `name`
|
|
109
|
+
- cn 列识别:`cn` / `chinese` / `translation` / `definition` / `译名` / `中文` / `翻译`
|
|
110
|
+
- pos 列识别:`pos` / `词性` / `part_of_speech`
|
|
111
|
+
- field 列识别:`field` / `领域` / `domain` / `discipline` / `学科`
|
|
112
|
+
- 未识别的字段忽略
|
|
113
|
+
2. 如果 JSON 是键值对象 `{"term": "translation", ...}`:直接当作 `{en: cn}` 对解析
|
|
114
|
+
3. 已符合本术语库 schema 的 JSON(有 `term_id`、`en`、`cn`)可直接合并,但仍需走冲突检测
|
|
115
|
+
|
|
116
|
+
**CSV 格式**:用 Python `csv` 模块自动检测分隔符(逗号/制表符)和编码(UTF-8/UTF-8 BOM/GBK)。首行当作表头,按上述 JSON 的字段识别规则匹配列名。跳过空行。
|
|
117
|
+
|
|
118
|
+
**YAML 格式**:用 `yaml.safe_load()` 解析,然后按 JSON 格式的同样逻辑处理。
|
|
119
|
+
|
|
120
|
+
对 CSV/TSV/JSON/YAML,优先使用正式离线入口(DSH 中用 `verymath_glossary_build` 工具,`script: "glossary_build.py"`,`args` 传源路径与选项;其他宿主用 shell):
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
python3 scripts/glossary_build.py "/path/to/source.csv"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
该命令自动识别常用列名、记录文件名与行号/记录号、生成唯一 `term_id`、排序并连续
|
|
127
|
+
编号。默认不覆盖已有 JSON;覆盖必须先确认备份并显式添加 `--force`。PDF、OCR、
|
|
128
|
+
MDX 和自由文本仍按本节工作流解析并人工复核,不伪装成已经自动化。
|
|
129
|
+
|
|
130
|
+
**MDX 电子词典格式**:用 `mdict -x <file>.mdx -d <output_dir>` 解包为 `.txt` 文件,然后解析:
|
|
131
|
+
|
|
132
|
+
- 每条记录以 `</>` 分隔
|
|
133
|
+
- 每条记录的第一行是关键词(英文术语)
|
|
134
|
+
- 后续行是 HTML 内容,从 `<div class="title">` 提取英文术语,从 `<div class="text">` 提取中文译名
|
|
135
|
+
- 跳过 `@@@LINK=xxx` 条目(它们是交叉引用,不是独立术语)
|
|
136
|
+
|
|
137
|
+
为什么会这样设计——学术界的术语数据分布在多种格式中:开放术语项目用 JSON/YAML 发布,政企标注用 CSV,中文词典社区(FreeMdict)用 MDX 发布高质量英汉词典。覆盖这四种格式意味着 skill 可以直接导入现成的术语数据源,而不必人工重新整理。
|
|
138
|
+
|
|
139
|
+
**溯源精度**:解析每条术语时,在 `source` 字段中记录来源信息(如文件名+行号),以便后续追溯每条术语在源文件中的具体位置。无需额外的 `note` 字段。
|
|
140
|
+
|
|
141
|
+
提取后,为每条术语构造完整 JSON:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
term = {
|
|
145
|
+
"term_id": en_term,
|
|
146
|
+
"en": en_term,
|
|
147
|
+
"cn": cn_term,
|
|
148
|
+
"pos": "", # 词性用中文填写,如 "名词"、"动词"、"形容词"
|
|
149
|
+
"field": [], # 子领域,支持数组(如 ["代数拓扑", "代数几何"]),从 "/" 分隔的文本自动拆分
|
|
150
|
+
"source": source_name, # 来源文件名
|
|
151
|
+
"examples": [],
|
|
152
|
+
"created_at": today,
|
|
153
|
+
"updated_at": today
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
`today` 的格式为 ISO 日期 `YYYY-MM-DD`。
|
|
158
|
+
|
|
159
|
+
> **注意**:别名不再作为字段存储。如果术语有别名(如 `axiom of choice` 别名
|
|
160
|
+
> `AC`),别名应展开为独立行:同一 `en`,`cn` 为别名,其余字段与原术语一致。
|
|
161
|
+
> 无 `__N` 后缀的 `term_id` 标识来源中首先出现的主译名;该身份不依赖排序后的
|
|
162
|
+
> 显示位置。排序时仍按 `en`、`cn`,确保别名相邻。
|
|
163
|
+
|
|
164
|
+
### 第二步:冲突检测与合并
|
|
165
|
+
|
|
166
|
+
如果 `glossary.json` 已经存在,将新提取的术语与现有术语比较:
|
|
167
|
+
|
|
168
|
+
1. **新术语(term_id 不存在)**:直接加入
|
|
169
|
+
2. **重复术语(同一 term_id)**:用新来源的值覆盖旧值,并把旧值记录到变更日志中
|
|
170
|
+
3. **同一来源内部的冲突**(同一 term_id 在同一来源中出现多次,译法不同):列出冲突条目让用户逐条裁决
|
|
171
|
+
|
|
172
|
+
冲突展示格式:
|
|
173
|
+
```
|
|
174
|
+
发现 1 条术语存在冲突译法:
|
|
175
|
+
|
|
176
|
+
homology:
|
|
177
|
+
· 同调(来源:新英汉数学词汇 第3章)
|
|
178
|
+
· 同源性(来源:新英汉数学词汇 第7章)
|
|
179
|
+
· 二者均保留
|
|
180
|
+
|
|
181
|
+
请选择保留哪个译法?(输入 1 或 2 或 3)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 第三步:排序与安全写入
|
|
185
|
+
|
|
186
|
+
将最终结果按英文术语字母顺序排序后写入 glossary.json,然后自动导出 Excel。所有输出文件统一扁平存放在来源文件所在目录下的"术语库"文件夹中。
|
|
187
|
+
|
|
188
|
+
排序 + 连续编号 + 写入 + 导出的顺序:
|
|
189
|
+
|
|
190
|
+
1. `terms.sort(key=lambda t: (t.get("en", "").lower(), t.get("cn", "").lower()))` — 按 en -> cn 两级排序
|
|
191
|
+
2. `for i, t in enumerate(terms, 1): t["idx"] = i` — 重新连续分配 idx
|
|
192
|
+
3. 写入 `glossary.json`
|
|
193
|
+
4. 调用 `glossary_export.py export` 导出 Excel(新导出成功后删除旧 .xlsx)
|
|
194
|
+
5. 对 JSON 和 Excel 都要做排序+重编号,保证 idx 连续无断层
|
|
195
|
+
|
|
196
|
+
如果 `openpyxl` 缺失或导出失败,保留已经原子写入的 JSON,但必须报告
|
|
197
|
+
“JSON 已完成、Excel 待完成”,不得声称整个构建流程已经完成。补齐依赖后再单独
|
|
198
|
+
运行 `scripts/glossary_export.py export`。
|
|
199
|
+
|
|
200
|
+
依赖齐全时保持三者一致:JSON(事实源)→ Excel(导出)→ Web 前端(读取 JSON
|
|
201
|
+
展示)。`_save_terms()` 统一处理此流程;Excel 暂缺时,JSON 仍是可继续工作的
|
|
202
|
+
事实源。
|
|
203
|
+
|
|
204
|
+
**重要:Excel 导出后将旧的 .xlsx 文件删除,只保留最新一份。** 导出的 Excel 文件命名为 `glossary_YYYY-MM-DD.xlsx`,如果同一天多次导出会覆盖,不同日期导出则删除前一天的文件。
|
|
205
|
+
|
|
206
|
+
## 维护操作与Web管理界面(可更新库模式)
|
|
207
|
+
|
|
208
|
+
> **模板文档**:`references/glossary-web-template.md` — 详细记录了 Web 界面模板的所有可定制点(路径、端口、字段、配色、文案等)。后续建立新的术语库维护网页时,阅读该文档按需修改即可。
|
|
209
|
+
|
|
210
|
+
构建完成后,可从 package 根目录启动本地 Web 服务器:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
python3 scripts/glossary_web.py \
|
|
214
|
+
--glossary "/absolute/path/to/glossary.json"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
默认只监听 `127.0.0.1:7788` 并打开系统浏览器。无图形界面环境使用
|
|
218
|
+
`--no-browser`。界面没有身份认证;除非用户明确理解风险并添加
|
|
219
|
+
`--allow-remote`,不得绑定非 loopback 地址。使用完毕后优先在启动终端按
|
|
220
|
+
`Ctrl+C` 停止服务器。
|
|
221
|
+
|
|
222
|
+
**文件说明**:
|
|
223
|
+
- `scripts/glossary_web.py` — Web 管理界面模板(单文件 Flask 应用,内嵌 HTML/CSS/JS)
|
|
224
|
+
- `scripts/glossary_backup.py` — 备份脚本(扩充流程手动触发)
|
|
225
|
+
- `scripts/glossary_build.py` — CSV/TSV/JSON/YAML 结构化建库入口
|
|
226
|
+
- `scripts/glossary_export.py` — Excel 导入导出脚本
|
|
227
|
+
|
|
228
|
+
界面支持:
|
|
229
|
+
|
|
230
|
+
- 🔍 **搜索** — 输入即搜,前缀匹配英文/中文
|
|
231
|
+
- 👁️ **查看** — 点击术语所在行,展示完整字段(含统计栏:总数、来源、首字母分布)
|
|
232
|
+
- ✏️ **修改** — 在详情中编辑,显示前后对比,二次确认后修改
|
|
233
|
+
- 🗑️ **删除** — 二次确认后删除
|
|
234
|
+
- ➕ **新增** — 填写英文+中文+词性+子领域+来源,自动查重
|
|
235
|
+
|
|
236
|
+
写操作(修改/删除/新增)自动记录到 `修改记录.md` 并刷新 Excel 导出。所有写操作均自动按 en → cn 排序并重新分配连续 idx。JSON / Excel / Web 前端三者随时保持同步。
|
|
237
|
+
|
|
238
|
+
### 新术语库部署步骤
|
|
239
|
+
|
|
240
|
+
1. 保持脚本位于 package 的 `scripts/` 中,不复制或改写模板。
|
|
241
|
+
2. 在用户明确选择的工作目录创建 `glossary.json`。
|
|
242
|
+
3. 从 package 根目录运行上述启动命令,并通过 `--glossary` 传入数据路径。
|
|
243
|
+
4. 需要改变端口时传 `--port`,不修改源码。
|
|
244
|
+
5. 验证搜索、新增、编辑、删除、日志和 Excel 刷新均只影响该数据目录。
|
|
245
|
+
|
|
246
|
+
### 第4问:是否备份
|
|
247
|
+
|
|
248
|
+
按以下内容提问:
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
header: "预先备份"
|
|
252
|
+
question: "扩充前是否需要备份当前术语库?"
|
|
253
|
+
options (multiSelect: false):
|
|
254
|
+
- label: "需要(推荐)"
|
|
255
|
+
description: "扩充前自动备份 glossary.json 到备份文件"
|
|
256
|
+
- label: "不需要"
|
|
257
|
+
description: "直接扩充,不额外备份"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### 扩充操作(CLI 端)
|
|
261
|
+
|
|
262
|
+
如果用户想利用新的术语对照资料对术语库进行大范围扩充,需要在终端输入精确指令:
|
|
263
|
+
|
|
264
|
+
> **"我想扩充当前术语库"**
|
|
265
|
+
|
|
266
|
+
只有这一句精确匹配才会触发扩充流程。skill 按顺序引导用户:
|
|
267
|
+
|
|
268
|
+
1. 先问"请提供用于扩充的源文件路径"
|
|
269
|
+
2. 验证路径存在后,询问第4问(是否备份)
|
|
270
|
+
3. 走构建流程(解析→提取→冲突检测→合并)
|
|
271
|
+
4. 完成后自动刷新 Excel 并生成扩充记录
|
|
272
|
+
|
|
273
|
+
**注意:第4问是扩充流程专属问题,不在初始构建的四问交互流程中。初始构建的第3问之后直接进入构建流程,不需要第4问。**
|
|
274
|
+
|
|
275
|
+
#### 扩充记录日志
|
|
276
|
+
|
|
277
|
+
扩充完成后,必须在术语库目录生成 `扩充记录.md`,包含两个表格:
|
|
278
|
+
|
|
279
|
+
**第一个表 — 新增术语**(无新增时显示"本次扩充无新增术语"):
|
|
280
|
+
|
|
281
|
+
| 序号 | 英文术语 | 中文译名 | 词性 | 子领域 | 来源 | 例句(英文) | 例句(中文) | 创建时间 | 更新时间 |
|
|
282
|
+
|------|---------|---------|------|--------|------|-----------|-----------|----------|----------|
|
|
283
|
+
|
|
284
|
+
每行为一条新增术语的全部字段信息。序号按最终排序后的连续 idx。
|
|
285
|
+
|
|
286
|
+
**第二个表 — 替换术语**(无替换时显示"本次扩充无替换术语"):
|
|
287
|
+
|
|
288
|
+
| 序号 | 词汇 | 替换前信息 | 替换后信息 | 变更原因 |
|
|
289
|
+
|------|------|-----------|-----------|----------|
|
|
290
|
+
|
|
291
|
+
每行为一条被替换术语,替换前后只填被修改的字段,格式为 `字段名:旧值 → 新值`,多字段用 `<br>` 分行。变更原因说明替换的动机(如"补全缺失字段""语义修正""来源更新")。
|
|
292
|
+
|
|
293
|
+
#### 扩充后处理
|
|
294
|
+
|
|
295
|
+
1. JSON 按 en → cn 排序后重新连续分配 idx
|
|
296
|
+
2. 调用 `glossary_export.py` 重新导出 Excel(删除旧 .xlsx,只保留新导出的)
|
|
297
|
+
3. 生成 `扩充记录.md`(上述格式)
|
|
298
|
+
4. 如果用户选择了"需要备份",先用 `glossary_backup.py` 备份当前 glossary.json
|
|
299
|
+
5. JSON 和 Excel 都要做排序+重编号,保证 idx 连续无断层
|
|
300
|
+
|
|
301
|
+
扩充完成后展示操作指引。
|
|
302
|
+
|
|
303
|
+
## 依赖检查
|
|
304
|
+
|
|
305
|
+
首次使用脚本时先调 `verymath_python_check` 工具(其他宿主用 shell 做只读检查):
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
python3 -c "import flask, openpyxl, yaml"
|
|
309
|
+
python3 -c "import openai" # 仅例句自动补全需要
|
|
310
|
+
python3 -c "import shutil; print(shutil.which('mdict') or 'missing')" # 仅 MDX
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
缺少依赖时先向用户报告用途和安装范围,获得确认后再安装:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
python3 -m pip install -r requirements.txt
|
|
317
|
+
python3 -m pip install -r requirements-ai.txt # 可选
|
|
318
|
+
python3 -m pip install mdict-utils # 仅 MDX,可选
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
不得自动安装依赖,不得读取未明确提供的密钥,不得把密钥写入术语库、日志或命令
|
|
322
|
+
输出。
|
|
323
|
+
|
|
324
|
+
## 写入与安全边界
|
|
325
|
+
|
|
326
|
+
- 只写入用户明确选择的术语库目录。
|
|
327
|
+
- 覆盖或批量扩充前先展示目标路径;用户选择备份时先运行
|
|
328
|
+
`scripts/glossary_backup.py`。
|
|
329
|
+
- JSON 使用原子替换;新 Excel 导出成功后才清理旧 Excel。
|
|
330
|
+
- 不直接发布源词典、论文、扫描件或其他可能受版权约束的语料。
|
|
331
|
+
- Web 界面默认只绑定 loopback 地址,远程暴露需用户显式授权。
|
|
332
|
+
- AI 例句属于待审阅建议,不得当作原始文献证据。
|
|
333
|
+
|
|
334
|
+
## 与翻译 agent 的约定
|
|
335
|
+
|
|
336
|
+
> **完整使用指南**:`references/glossary-usage-guide.md` — 供第三方翻译 Agent 调用术语库的完整文档,包含查词流程、多义词消歧策略、示例代码。需要调用术语库的 Agent 应优先阅读该指南。
|
|
337
|
+
|
|
338
|
+
本 skill 只负责术语库的构建和维护,不直接调用翻译 agent。与翻译 agent 之间的接口约定:
|
|
339
|
+
|
|
340
|
+
- 翻译 agent 读取 `glossary.json`,建立 `{term_id → cn}` 映射表;**在 DSH 中新增/更新术语一律走 `verymath_glossary_upsert` 工具**,不要手改 JSON(工具自动维护不变量)
|
|
341
|
+
- 翻译时优先按 `term_id` 精确查找,再按 en 子串匹配
|
|
342
|
+
- 同一个 en 在不同 field 下有不同 cn(多义术语),需根据文献上下文所属子领域以及语境选择
|
|
343
|
+
- 术语若有例句(`examples`),翻译 agent 应将原文上下文与例句对比,选择语义最接近的义项
|
|
344
|
+
- 术语库中例句缺失且用户同意调用外部模型时,可调用
|
|
345
|
+
`scripts/glossary_enrich_examples.py`。必须用 `--model` 和 `--api-key`(或
|
|
346
|
+
`MATH_GLOSSARY_MODEL`、`MATH_GLOSSARY_API_KEY`)显式配置;自定义
|
|
347
|
+
OpenAI-compatible endpoint 使用 `--api-base`。生成结果需人工审阅。
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# 术语库 JSON 数据模型
|
|
2
|
+
|
|
3
|
+
机器可读版本见同目录的 `glossary.schema.json`。除 JSON Schema 可表达的字段约束外,
|
|
4
|
+
还必须满足以下跨条目不变量:`term_id` 全局唯一;条目按 `en`、`cn` 排序;`idx`
|
|
5
|
+
从 1 开始连续编号。
|
|
6
|
+
|
|
7
|
+
## 完整字段
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"term_id": "manifold",
|
|
12
|
+
"en": "manifold",
|
|
13
|
+
"cn": "流形",
|
|
14
|
+
"pos": "名词",
|
|
15
|
+
"field": ["拓扑学"],
|
|
16
|
+
"source": "新英汉数学词汇",
|
|
17
|
+
"examples": [
|
|
18
|
+
{"en": "a smooth manifold", "cn": "光滑流形"}
|
|
19
|
+
],
|
|
20
|
+
"created_at": "2026-07-10",
|
|
21
|
+
"updated_at": "2026-07-10"
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 字段定义
|
|
26
|
+
|
|
27
|
+
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|
|
28
|
+
|------|------|------|--------|------|
|
|
29
|
+
| `term_id` | string | ✅ | — | 唯一标识。单条术语用 `en` 的小写形式;同 en 多条时(别名行)用 `en__N` 后缀区分 |
|
|
30
|
+
| `en` | string | ✅ | — | 英文术语原文 |
|
|
31
|
+
| `cn` | string | ✅ | — | 中文译名(如为别名行,cn 即别名) |
|
|
32
|
+
| `pos` | string | ❌ | `""` | 词性,中文填写:名词 / 动词 / 形容词 / 副词 / 介词 / 动词短语 等 |
|
|
33
|
+
| `field` | array | ❌ | `[]` | 子领域,支持多值。如 `["代数拓扑", "代数几何"]` |
|
|
34
|
+
| `source` | string | ❌ | `""` | 来源参考书名称 |
|
|
35
|
+
| `examples` | array | ❌ | `[]` | 例句 `[{en, cn}, ...]` |
|
|
36
|
+
| `created_at` | string | ✅ | 当前时间 | ISO 日期 YYYY-MM-DD |
|
|
37
|
+
| `updated_at` | string | ✅ | 当前时间 | ISO 日期 YYYY-MM-DD |
|
|
38
|
+
|
|
39
|
+
## 别名处理
|
|
40
|
+
|
|
41
|
+
别名**不作为字段存储**。如果术语有别名:
|
|
42
|
+
|
|
43
|
+
- 别名展开为独立行:同一 `en`,`cn` 为别名,其余字段(pos/field/source/examples)与原术语一致
|
|
44
|
+
- term_id 规则:来源中首先出现、被选作主译名的记录用 `en` 小写,后续别名行加
|
|
45
|
+
`__N` 后缀(如 `axiom of choice` 和 `axiom of choice__1`)
|
|
46
|
+
- 排序规则:先按 `en` 首字母,再按 `cn` 首字母,确保别名紧邻原术语
|
|
47
|
+
|
|
48
|
+
`term_id` 是稳定身份,不能用排序后的物理行号判断主译名。按 `cn` 排序后,无后缀
|
|
49
|
+
记录不保证位于同一 `en` 分组的第一行;调用方应显式查找无 `__N` 后缀的记录。
|
|
50
|
+
|
|
51
|
+
## 排序规则
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
en 首字母升序 → cn 首字母升序
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
所有写操作后自动执行此排序并重新连续分配 `idx`。
|
|
58
|
+
|
|
59
|
+
## 文件结构
|
|
60
|
+
|
|
61
|
+
所有输出文件存放在来源文件所在目录下的"术语库"文件夹中,扁平存放:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
<来源文件所在目录>/
|
|
65
|
+
└── 术语库/
|
|
66
|
+
├── glossary.json ← 主术语库
|
|
67
|
+
├── glossary_backup_<时间戳>.json ← 扩充流程手动触发备份
|
|
68
|
+
├── glossary_<YYYY-MM-DD>.xlsx ← 自动导出的 Excel
|
|
69
|
+
├── 修改记录.md ← Web 界面写操作日志
|
|
70
|
+
└── 扩充记录.md ← 批量扩充日志
|
|
71
|
+
```
|