quantum-reasoning-skill 1.0.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.
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # Quantum Reasoning Skill
2
+ > **Superseded:** this standalone skill was merged into **Axiomize 2.0** and now lives as
3
+ > `axiomize.reasoning` in **[Furox-Art/axiomize-quantum-skills-2.0](https://github.com/Furox-Art/axiomize-quantum-skills-2.0)**,
4
+ > where it ships next to the scientific modeling engine as `skills/quantum-reasoning/`.
5
+ > New work, issues, and contributions should go to the Axiomize repo. This repository is kept
6
+ > for historical reference and will be archived.
7
+
8
+ A **model-agnostic reasoning skill** that keeps multiple genuinely different possibilities alive, verifies and compares them, suppresses weak paths, revives useful alternatives when evidence changes, and selects the best-supported result only at the end.
9
+
10
+ > This is quantum-inspired classical reasoning, not quantum computation.
11
+
12
+ ## Main artifact
13
+
14
+ The project is centered on [`SKILL.md`](./SKILL.md). The skill changes the model's reasoning procedure without retraining the model.
15
+
16
+ ```text
17
+ problem
18
+ -> open diverse possibilities
19
+ -> verify independently
20
+ -> compare contradictions and shared assumptions
21
+ -> score / classify branches
22
+ -> allocate compute dynamically
23
+ -> suspend or reject weak branches
24
+ -> revive branches when evidence changes
25
+ -> verify collapse criteria
26
+ -> select the best-supported answer
27
+ ```
28
+
29
+ ## Design goals
30
+
31
+ - Reduce early lock-in to the first plausible answer.
32
+ - Maintain genuinely independent hypotheses or solution strategies.
33
+ - Prefer falsification and tool-based verification over self-confidence.
34
+ - Expand search when uncertainty is high and concentrate compute when evidence is strong.
35
+ - Detect correlated branches so repeated assumptions are not counted as independent evidence.
36
+ - Keep high-information alternatives recoverable instead of deleting them too early.
37
+ - Work across hosts that can preserve the skill instruction contract.
38
+ - Make reasoning-control decisions measurable without exposing private chain-of-thought.
39
+
40
+ ## Repository contents
41
+
42
+ - [`SKILL.md`](./SKILL.md) — model-facing protocol
43
+ - [`reference/branch_controller.py`](./reference/branch_controller.py) — deterministic reference scoring, state transition, revival, uncertainty and collapse logic
44
+ - [`docs/MEASUREMENT.md`](./docs/MEASUREMENT.md) — explicit formulas, thresholds and calibration requirements
45
+ - [`docs/COMPATIBILITY.md`](./docs/COMPATIBILITY.md) — capability-based host compatibility contract
46
+ - [`examples/usage.md`](./examples/usage.md) — task examples
47
+ - [`examples/host-integration.md`](./examples/host-integration.md) — generic host integration patterns
48
+ - [`benchmark/cases.jsonl`](./benchmark/cases.jsonl) — deterministic seed cases
49
+ - [`benchmark/evaluate.py`](./benchmark/evaluate.py) — baseline-vs-skill evaluator
50
+ - [`benchmark/validate_submission.py`](./benchmark/validate_submission.py) — reproducible community-result bundle validator
51
+ - [`benchmark/schemas/`](./benchmark/schemas/) — JSON Schema contracts for cases, metadata, result rows and comparison output
52
+ - [`benchmark/README.md`](./benchmark/README.md) — reproducible benchmark protocol
53
+ - [`CONTRIBUTING.md`](./CONTRIBUTING.md) — contribution and independent benchmark-submission policy
54
+ - [`SECURITY.md`](./SECURITY.md) — vulnerability-reporting policy
55
+ - [`CITATION.cff`](./CITATION.cff) — citation metadata
56
+ - [`tests/`](./tests/) — behavioral and validation tests
57
+ - GitHub Actions validation on pushes and pull requests
58
+ - CI-gated automated tag and GitHub Release publishing
59
+
60
+ ## Core capabilities
61
+
62
+ - Adaptive multi-branch reasoning
63
+ - Semantic diversity requirements
64
+ - Active / dormant / rejected branch states
65
+ - Independent verification rules
66
+ - Contradiction and shared-assumption checks
67
+ - Correlation penalty for duplicated/shared-assumption branches
68
+ - Interference-like cross-branch comparison
69
+ - Dynamic compute allocation from uncertainty
70
+ - Measurable branch revival rules
71
+ - Explicit stopping / collapse criteria
72
+ - Baseline-vs-skill benchmark telemetry
73
+ - Final requirement and contradiction check
74
+
75
+ ## Usage
76
+
77
+ Install or provide `SKILL.md` to a compatible agent/skill system, then invoke it for difficult reasoning tasks. No Python package or model fine-tuning is required to use the skill itself.
78
+
79
+ See [`docs/COMPATIBILITY.md`](./docs/COMPATIBILITY.md) before integrating a new host and [`examples/host-integration.md`](./examples/host-integration.md) for generic installation patterns.
80
+
81
+ The Python reference implementation is optional. It exists to make the qualitative policy auditable and testable:
82
+
83
+ ```python
84
+ from reference.branch_controller import Branch, BranchMetrics, collapse_decision
85
+ ```
86
+
87
+ ## Benchmarking
88
+
89
+ The repository provides the **protocol, cases, schemas, evaluator and submission validator** needed to test the skill. Real model evaluations are intentionally **community-run**: users test the models/providers they have access to and may submit reproducible results back to the project.
90
+
91
+ The project does not require the maintainer to run every commercial or local model, and it does not treat the absence of maintainer-run model tests as a missing implementation feature.
92
+
93
+ A valid comparison uses the **same model, model version, task set, tool access, temperature/sampling settings and token-budget policy** with and without `SKILL.md`.
94
+
95
+ ```bash
96
+ python benchmark/evaluate.py \
97
+ --cases benchmark/cases.jsonl \
98
+ --baseline path/to/baseline-results.jsonl \
99
+ --skill path/to/skill-results.jsonl \
100
+ --output comparison.json
101
+ ```
102
+
103
+ Community PR bundles are machine-checked. They must contain their own `cases.jsonl`, raw baseline and skill JSONL files, metadata, the generated comparison output and a short README. CI recomputes the comparison and rejects tampered or incomplete bundles.
104
+
105
+ ```bash
106
+ python benchmark/validate_submission.py \
107
+ --root benchmark/results/community \
108
+ --allow-empty
109
+ ```
110
+
111
+ Third-party results remain measurements from their submitters, not automatic project endorsements or universal performance claims. A single positive run is not enough to claim general improvement.
112
+
113
+ Users can submit results through the **Benchmark result** issue template or as a reproducible benchmark-result pull request. See [`benchmark/README.md`](./benchmark/README.md) and [`CONTRIBUTING.md`](./CONTRIBUTING.md).
114
+
115
+ ## Validation
116
+
117
+ Run the repository checks locally with:
118
+
119
+ ```bash
120
+ python -m unittest discover -s tests -v
121
+ python benchmark/evaluate.py --help
122
+ python benchmark/validate_submission.py --root benchmark/results/community --allow-empty
123
+ ```
124
+
125
+ CI validates the skill contract, local links, Python syntax, benchmark seed data, JSON Schema files, community benchmark bundles and behavioral tests. Third-party GitHub Actions are pinned to exact commit SHAs.
126
+
127
+ ## Releases
128
+
129
+ Release publishing is repository-native and CI-gated. Update `CHANGELOG.md`, then change the root `VERSION` file to a semantic version. A release is considered only after the `validate-skill` workflow succeeds on `main`; the `publish-release` workflow then creates the corresponding `v<version>` tag and GitHub Release if it does not already exist.
130
+
131
+ ## Status
132
+
133
+ **v0.3.1 — hardened measurable prototype.** The branch-control mechanism, benchmark infrastructure, host compatibility contract, community-result validation, repository security/citation metadata and CI-gated release controls are implemented. Real-model evaluation is intentionally delegated to independent users and contributors, and the project makes no universal performance claim without reproducible external evidence.
package/SECURITY.md ADDED
@@ -0,0 +1,17 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ Security fixes are applied to the current `main` branch and the latest published release.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ Do not publish exploit details, credentials, tokens, private benchmark data, or other sensitive material in a public issue.
10
+
11
+ Prefer GitHub's private **Report a vulnerability** / Security Advisory flow when it is available for this repository. If that private channel is unavailable, open a minimal public issue that only requests a private contact path and does not include vulnerability details.
12
+
13
+ ## Scope
14
+
15
+ Relevant reports include vulnerabilities in repository automation, benchmark ingestion/validation, release workflows, or reference code that could cause untrusted contributed content to execute unexpectedly, alter releases, or expose secrets.
16
+
17
+ Reasoning-quality disagreements and ordinary protocol bugs are not security vulnerabilities; use the normal bug-report issue form for those.
package/SKILL.md ADDED
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: quantum-reasoning
3
+ description: Maintain multiple genuinely different candidate hypotheses or solution paths, test them against evidence and tools, suppress weak or contradictory paths, revive useful alternatives when new evidence appears, and collapse to the best-supported answer only at the end.
4
+ ---
5
+
6
+ # Quantum Reasoning Skill
7
+
8
+ A model-facing reasoning protocol inspired by the idea of keeping multiple possibilities alive before selection. It runs on classical models and classical hardware; it is not quantum computation.
9
+
10
+ ## When to use
11
+
12
+ Use this skill when a problem is difficult, ambiguous, high-stakes, multi-step, or vulnerable to early commitment: mathematics, scientific reasoning, debugging, planning, architecture, model selection, hypothesis testing, and technical diagnosis.
13
+
14
+ Do not add branching overhead to trivial questions.
15
+
16
+ ## Core protocol
17
+
18
+ ### 1. Frame the state
19
+
20
+ Identify the objective, constraints, verified facts, assumptions, unknowns, and available tools. Keep facts separate from hypotheses.
21
+
22
+ ### 2. Open a diverse possibility set
23
+
24
+ Create several materially different candidate paths. Diversity is mandatory: do not count paraphrases, cosmetic variants, or branches that depend on the same hidden assumption as independent possibilities.
25
+
26
+ Prefer orthogonal strategy classes when applicable, such as:
27
+
28
+ - direct derivation
29
+ - counterexample / falsification
30
+ - decomposition
31
+ - alternative model or mechanism
32
+ - numerical or executable test
33
+ - independent reconstruction
34
+ - adversarial critique
35
+
36
+ ### 3. Maintain branch states
37
+
38
+ Treat each candidate as one of:
39
+
40
+ - **active** — worth more compute now
41
+ - **dormant** — currently weak but potentially recoverable
42
+ - **rejected** — contradicted or decisively invalidated
43
+
44
+ Never permanently reject a branch merely because another branch initially looks more plausible.
45
+
46
+ ### 4. Evaluate each branch independently
47
+
48
+ Judge branches using evidence, not eloquence. Consider:
49
+
50
+ - empirical or logical support
51
+ - external verification
52
+ - independence from other branches
53
+ - information gain
54
+ - contradiction count and severity
55
+ - unresolved assumptions
56
+ - expected value of another reasoning step
57
+ - compute / tool cost
58
+
59
+ Self-reported model confidence alone is weak evidence.
60
+
61
+ ### 5. Use tools to falsify, not merely confirm
62
+
63
+ When available, route claims through the strongest suitable verifier: executable code, numerical tests, formal solvers, source lookup, direct file inspection, unit tests, symbolic algebra, or an independent model pass.
64
+
65
+ Actively search for evidence that would disprove leading branches.
66
+
67
+ ### 6. Apply interference-like comparison
68
+
69
+ Compare branches against each other without pretending to perform quantum interference.
70
+
71
+ - Reinforce conclusions independently reached by different verified paths.
72
+ - Penalize branches that conflict with verified facts.
73
+ - Detect shared assumptions so correlated branches are not double-counted.
74
+ - Transfer newly verified facts to every branch they constrain.
75
+ - Preserve meaningful disagreement instead of averaging incompatible claims.
76
+
77
+ ### 7. Allocate compute dynamically
78
+
79
+ Use uncertainty to control width and depth.
80
+
81
+ - **Low uncertainty:** narrow quickly and deepen the strongest path.
82
+ - **High uncertainty:** widen the possibility set.
83
+ - **High-value unresolved branch:** spend additional tool or reasoning budget.
84
+ - **Redundant or contradicted branch:** move to dormant or rejected.
85
+
86
+ Branch count is adaptive, not fixed.
87
+
88
+ ### 8. Permit branch revival
89
+
90
+ If new evidence invalidates a leading assumption or materially improves a dormant branch, restore that branch to active status and re-evaluate the ranking.
91
+
92
+ ### 9. Stop when more search has low value
93
+
94
+ Collapse the possibility set when one result is sufficiently verified, remaining branches are redundant or falsified, or additional search is unlikely to change the decision enough to justify its cost.
95
+
96
+ If multiple branches remain genuinely unresolved, report the alternatives and what evidence would distinguish them.
97
+
98
+ ### 10. Produce the answer
99
+
100
+ Synthesize only from the strongest supported surviving branches. Run a final contradiction and requirement check before answering.
101
+
102
+ Do not expose hidden chain-of-thought. Return the conclusion, concise supporting evidence, important uncertainty, and materially different surviving alternatives when necessary.
103
+
104
+ ## Adaptive intensity
105
+
106
+ Use a rough internal intensity level:
107
+
108
+ - **light:** 2–3 distinct candidates, one comparison pass
109
+ - **standard:** 4–8 candidates, verification + pruning + one revival check
110
+ - **deep:** 8+ candidates only when the problem and compute budget justify it; use repeated verification and adaptive expansion
111
+
112
+ Do not mechanically maximize branch count. The goal is better search of the possibility space, not more text.
113
+
114
+ ## Operational reference policy
115
+
116
+ When the host system can track aggregate branch metadata, use explicit normalized values in `[0, 1]` for evidence, verification, independence, information gain, contradiction severity, unresolved assumptions, compute cost, shared-assumption overlap, and semantic redundancy.
117
+
118
+ A provider-agnostic reference controller is available in [`reference/branch_controller.py`](./reference/branch_controller.py). Its defaults make the qualitative protocol testable:
119
+
120
+ - independence is reduced when branches share critical assumptions or are near-duplicates
121
+ - strong contradiction can reject a branch
122
+ - weak branches become dormant instead of disappearing
123
+ - dormant branches can revive after a material evidence, verification, or contradiction change
124
+ - uncertainty controls a recommended search width
125
+ - collapse requires a verified leader, low contradiction, and a meaningful margin over surviving alternatives
126
+
127
+ The exact scoring weights and thresholds are **reference defaults, not validated constants**. They must be calibrated against benchmark evidence rather than treated as universal truths. See [`docs/MEASUREMENT.md`](./docs/MEASUREMENT.md) for the auditable formulas and thresholds.
128
+
129
+ Hosts that cannot expose these aggregate measurements should still follow the qualitative protocol above and must not invent numeric telemetry.
130
+
131
+ ## Benchmark requirement
132
+
133
+ Do not claim that this skill improves reasoning merely because the protocol sounds plausible. Compare the same model and task configuration with and without the skill and measure at least accuracy, compute/token cost, latency, error recovery, contradiction resolution, and branch diversity when observable.
134
+
135
+ The reproducible benchmark schema and evaluator live under [`benchmark/`](./benchmark/README.md).
136
+
137
+ ## Non-negotiable rules
138
+
139
+ 1. Do not call this real quantum computation.
140
+ 2. Do not treat repeated wording as independent evidence.
141
+ 3. Do not let one branch evaluate itself without challenge when verification is possible.
142
+ 4. Prefer falsification and executable checks over intuition.
143
+ 5. Preserve a recoverable record of high-information dormant branches.
144
+ 6. Collapse only after cross-branch comparison.
145
+ 7. Never fabricate evidence, tool results, sources, certainty, or branch telemetry.
146
+ 8. Do not present reference thresholds as empirically validated until benchmark evidence exists.
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.1
@@ -0,0 +1,134 @@
1
+ # Benchmark protocol
2
+
3
+ This directory measures whether the skill improves results rather than merely producing more reasoning text.
4
+
5
+ ## Who runs the benchmarks
6
+
7
+ Real model evaluations are intentionally **community-run**. The repository supplies the benchmark protocol, seed cases, JSON Schemas, evaluator and submission validator; users run experiments on the models/providers they have access to.
8
+
9
+ Maintainer-run access to every commercial or local model is not required. The project therefore separates **benchmark infrastructure** from **third-party empirical results**.
10
+
11
+ Submitted results are evidence from the contributor who produced them. They are not automatically endorsed by the project and should not be generalized beyond the tested model/version/configuration without replication.
12
+
13
+ ## Principle
14
+
15
+ Run the **same model, model version, task set, tool access, temperature/sampling settings, and token budget policy** twice:
16
+
17
+ 1. baseline: normal instructions without `SKILL.md`
18
+ 2. skill: the same setup with `SKILL.md`
19
+
20
+ Do not compare different models and attribute the difference to the skill.
21
+
22
+ ## Seed cases
23
+
24
+ `cases.jsonl` contains deterministic smoke-test cases. They are intentionally small and are **not sufficient evidence of reasoning improvement**. A serious evaluation should add difficult held-out tasks from the target domains and report their provenance/licensing.
25
+
26
+ Each case has:
27
+
28
+ ```json
29
+ {"id":"...","domain":"...","prompt":"...","accepted_answers":["..."]}
30
+ ```
31
+
32
+ ## Machine-readable schemas
33
+
34
+ The contracts are versioned with the repository:
35
+
36
+ - [`schemas/case.schema.json`](./schemas/case.schema.json) — one benchmark case
37
+ - [`schemas/result.schema.json`](./schemas/result.schema.json) — one baseline/skill result row
38
+ - [`schemas/metadata.schema.json`](./schemas/metadata.schema.json) — experiment metadata
39
+ - [`schemas/comparison.schema.json`](./schemas/comparison.schema.json) — evaluator comparison output
40
+
41
+ A result row requires:
42
+
43
+ ```json
44
+ {
45
+ "case_id": "math-arithmetic-001",
46
+ "answer": "323",
47
+ "tokens": 120,
48
+ "tool_calls": 0,
49
+ "latency_ms": 950
50
+ }
51
+ ```
52
+
53
+ Failed/refused runs should still be represented rather than silently removed. The optional `status` field may be `ok`, `refusal`, `timeout`, or `error`.
54
+
55
+ Skill-aware runners may additionally record observable aggregate telemetry such as `branches_total`, `branches_distinct`, `revived_branches`, `recovered_errors`, `contradictions_found`, and `contradictions_resolved`. Do not store private chain-of-thought.
56
+
57
+ ## Evaluate one run
58
+
59
+ ```bash
60
+ python benchmark/evaluate.py \
61
+ --cases benchmark/cases.jsonl \
62
+ --skill path/to/skill-results.jsonl
63
+ ```
64
+
65
+ ## Compare baseline vs skill
66
+
67
+ ```bash
68
+ python benchmark/evaluate.py \
69
+ --cases benchmark/cases.jsonl \
70
+ --baseline path/to/baseline-results.jsonl \
71
+ --skill path/to/skill-results.jsonl \
72
+ --output comparison.json
73
+ ```
74
+
75
+ The evaluator reports exact-answer accuracy, mean token use, tool calls, latency, branch diversity, revival/error recovery, contradiction resolution, and baseline-to-skill deltas.
76
+
77
+ ## Required experimental controls
78
+
79
+ For a publishable comparison, record at minimum:
80
+
81
+ - provider and exact model/version
82
+ - date of the run
83
+ - decoding/sampling parameters
84
+ - context and output limits
85
+ - tool availability
86
+ - prompt wrapper/system instructions
87
+ - number of repetitions per case
88
+ - random seed when the provider supports one
89
+ - hardware/runtime details for local models
90
+ - failures, refusals and timeouts rather than silently dropping them
91
+
92
+ Use multiple repetitions for stochastic models and report confidence intervals. Keep benchmark cases separate from any prompts used while designing or tuning the skill.
93
+
94
+ ## Submitting community results
95
+
96
+ Results can be submitted in either of two ways:
97
+
98
+ 1. Open a **Benchmark result** issue and provide the required metadata plus links/attachments to the result artifacts.
99
+ 2. Open a pull request containing a reproducible result bundle under:
100
+
101
+ ```text
102
+ benchmark/results/community/<provider>-<model>-<YYYY-MM-DD>/
103
+ ```
104
+
105
+ Every benchmark-result PR bundle must contain:
106
+
107
+ ```text
108
+ metadata.json
109
+ cases.jsonl
110
+ baseline.jsonl
111
+ skill.jsonl
112
+ comparison.json
113
+ README.md
114
+ ```
115
+
116
+ Including `cases.jsonl` inside the bundle makes the exact evaluated case set immutable and reviewable even when custom cases are used.
117
+
118
+ Generate `comparison.json` with `benchmark/evaluate.py`; do not hand-edit it. Before opening a PR, validate the bundle:
119
+
120
+ ```bash
121
+ python benchmark/validate_submission.py --root benchmark/results/community
122
+ ```
123
+
124
+ CI runs the same validator. It rejects missing artifacts, incomplete metadata, duplicate/missing case results, and a `comparison.json` that differs from a fresh evaluator recomputation.
125
+
126
+ See [`../CONTRIBUTING.md`](../CONTRIBUTING.md) for the complete submission and integrity policy.
127
+
128
+ ## Interpretation
129
+
130
+ A useful result is not simply "skill accuracy is higher". Report the trade-off between accuracy and compute. A skill that gains 1 percentage point while using 5x tokens may be undesirable for many workloads.
131
+
132
+ The reference thresholds in `reference/branch_controller.py` are defaults to test, not validated constants. Benchmark evidence should drive later calibration.
133
+
134
+ The project makes no universal performance claim from a single model, provider, benchmark or contributor submission. Independent replication is preferred.
@@ -0,0 +1,6 @@
1
+ {"id":"math-arithmetic-001","domain":"mathematics","prompt":"Compute 17 * 19.","accepted_answers":["323"],"notes":"Exact-answer sanity case."}
2
+ {"id":"math-algebra-001","domain":"mathematics","prompt":"Solve x^2 - 5x + 6 = 0. Return the roots in ascending order separated by a comma.","accepted_answers":["2, 3","2,3"],"notes":"Checks independent verification of a simple factorization."}
3
+ {"id":"logic-contradiction-001","domain":"logic","prompt":"Premises: All A are B. No B are C. Some A are C. Are the premises jointly consistent? Answer yes or no.","accepted_answers":["no"],"notes":"Requires contradiction detection."}
4
+ {"id":"debug-python-001","domain":"debugging","prompt":"A Python function is intended to return the first item of xs: def first(xs): return xs[1]. What integer index should replace 1?","accepted_answers":["0"],"notes":"Minimal root-cause diagnosis."}
5
+ {"id":"science-units-001","domain":"scientific-reasoning","prompt":"A car travels at 20 m/s for 15 s at constant speed. How many meters does it travel? Return only the number.","accepted_answers":["300"],"notes":"Simple quantitative verification case."}
6
+ {"id":"probability-001","domain":"probability","prompt":"A fair coin is flipped twice. What is the probability of exactly one head? Return a decimal.","accepted_answers":["0.5",".5"],"notes":"Checks enumeration versus shortcut reasoning."}