quantum-reasoning-skill 1.0.0 → 1.1.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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Furox
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Furox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,133 +1,181 @@
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.
1
+ # Quantum Reasoning Skill
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/quantum-reasoning-skill)](https://pypi.org/project/quantum-reasoning-skill/)
4
+ [![npm](https://img.shields.io/npm/v/quantum-reasoning-skill)](https://www.npmjs.com/package/quantum-reasoning-skill)
5
+ [![PyPI stats](https://img.shields.io/badge/PyPI%20stats-informational)](https://pypi.org/project/quantum-reasoning-skill/#stats)
6
+ [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
7
+
8
+ A model-facing [Agent Skill](SKILL.md) that keeps several genuinely different hypotheses
9
+ alive, tests each against evidence and tools, revives alternatives when new evidence arrives,
10
+ and collapses to the best-supported answer only at the end. It is a **metaphor, not quantum
11
+ computing** — "measurement" means letting evidence collapse a branch.
12
+
13
+ > **Status: protocol implemented, effectiveness not yet demonstrated.** The skill contract,
14
+ > the reference controller and the benchmark harness are here and run. **No
15
+ > baseline-vs-skill model evaluation has been published**, so this project makes **no claim
16
+ > that it improves accuracy or costs less compute.** See
17
+ > [Benchmark status](#benchmark-status) before citing any number from here.
18
+
19
+ ## Quick start
20
+
21
+ `SKILL.md` is the deliverable. Three verified paths reach it:
22
+
23
+ ```bash
24
+ # 1. from a clone — nothing to install
25
+ git clone https://github.com/Furox-Art/quantum-reasoning-skill.git
26
+ cd quantum-reasoning-skill
27
+ python docs/quickstart.py
28
+
29
+ # 2. from PyPI — SKILL.md ships inside the wheel
30
+ pip install quantum-reasoning-skill
31
+ quantum-reasoning --validate
32
+
33
+ # 3. from npm — also published, 1.1.0
34
+ npm i quantum-reasoning-skill
35
+ npx quantum-reasoning --validate
36
+ ```
37
+
38
+ Copy `SKILL.md` into your host's skill directory, keeping the YAML front matter.
39
+ [`docs/getting-started.md`](docs/getting-started.md) walks the install; prompt shapes are in
40
+ [`examples/usage.md`](examples/usage.md), host integration shapes in
41
+ [`examples/host-integration.md`](examples/host-integration.md), and required host
42
+ capabilities in [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md).
43
+
44
+ `docs/quickstart.py` verifies the checkout, parses the front matter, exercises the controller
45
+ and smoke-tests the benchmark harness; it calls no model and invents no metrics. **Its
46
+ verified output is in [`docs/quickstart.md`](docs/quickstart.md)**, which is the single source
47
+ for it — including the scenario where the thresholds *refuse* to collapse, the clearest
48
+ evidence they are uncalibrated defaults. It is not duplicated here, because a pasted copy
49
+ drifts.
50
+
51
+ ## Distribution and the surface it exposes
52
+
53
+ Three channels ship `SKILL.md`, all on one version: a `git clone` (everything); the PyPI
54
+ wheel (`SKILL.md` + `VERSION` as package data, plus `reference/`, `benchmark/`, `docs/`,
55
+ `examples/`, and a `quantum-reasoning` console script); and the npm tarball (`SKILL.md`,
56
+ `VERSION`, `index.js`, `LICENSE`, `README.md`, and a `quantum-reasoning` bin). Both packaged
57
+ artifacts are verified against the **built** artifact, not a checkout. Versions are locked
58
+ across `VERSION`, `pyproject.toml`, `package.json`, `CITATION.cff` and `CHANGELOG.md` — read
59
+ the value from `VERSION`, not a badge ([details](CONTRIBUTING.md#toolchain-pinning)).
60
+
61
+ There is **no `ReasoningSession` class**. An earlier README claimed one, it never existed, and
62
+ asserting it made the release gate unsatisfiable. The real surface is two *non-compatible*
63
+ CLIs plus a library:
64
+
65
+ | Surface | Flags it actually accepts |
66
+ | --- | --- |
67
+ | `quantum-reasoning` — **Python** console script ([`bin/quantum-reasoning`](bin/quantum-reasoning)) | `--skill-file PATH`, `--validate`, `--json`, `--quiet`, `--help` |
68
+ | `npx quantum-reasoning` — **npm** CLI ([`index.js`](index.js)) | `--validate`, `--json`, `--path`, `--help` |
69
+ | `reference.branch_controller` — Python library | importable; see [Reference controller](#reference-controller) |
70
+ | `quantum_reasoning_skill.SKILL.md`, `.VERSION` | the shipped asset, as package data |
71
+
72
+ `--path` is npm-only; `--skill-file` and `--quiet` are Python-only. An unsupported flag exits
73
+ `2`.
74
+
75
+ ## Release contract
76
+
77
+ [`bin/check_release_contract.py`](bin/check_release_contract.py) is the gate CI runs before
78
+ any release. It asserts that `SKILL.md` resolves inside the installed wheel, that the
79
+ `quantum-reasoning` entry point is installed and succeeds against the installed asset, that
80
+ `reference.branch_controller` imports with a callable API, and that the version agrees
81
+ everywhere.
82
+
83
+ **Twelve public names in `reference/branch_controller.py` are frozen** — `DEFAULT_THRESHOLDS`,
84
+ `Branch`, `BranchMetrics`, `BranchState`, `Thresholds`, `branch_score`, `classify_branch`,
85
+ `collapse_decision`, `diversity_ratio`, `recommended_width`, `uncertainty_from_branches`,
86
+ `update_branch_state`. Renaming or removing any one **halts the release**. `WEIGHTS` is
87
+ deliberately *not* on the list: the scoring model can change without breaking the contract.
88
+
89
+ A **negative-control mode** proves the gate is fail-closed across four scenarios — removing
90
+ the installed `SKILL.md`, emptying it, and feeding the controller check a stub missing its
91
+ public API and a module returning wrong values — requiring each to be rejected. It does **not**
92
+ exercise `VERSION` or the console entry point.
93
+
94
+ ## Reference controller
95
+
96
+ The control loop behind the protocol: it scores branches, moves them between `active` /
97
+ `dormant` / `rejected`, revives recoverable ones, and decides when a search may collapse. It
98
+ never generates reasoning and never calls a model — it only consumes measurements you supply.
99
+
100
+ | Function | Role |
101
+ | --- | --- |
102
+ | `WEIGHTS`, `DEFAULT_THRESHOLDS`, `Thresholds` | the scoring model: per-metric weights, and the state / revival / collapse thresholds |
103
+ | `BranchMetrics`, `Branch`, `BranchState` | input types; `BranchMetrics` rejects values outside `[0, 1]` |
104
+ | `branch_score`, `effective_independence` | weighted score in `[0, 1]`, after penalising branches that share assumptions or near-duplicate a leader |
105
+ | `classify_branch`, `update_branch_state`, `should_revive` | move a branch to `dormant` or `rejected`, or revive it on material new evidence |
106
+ | `collapse_decision` | `(can_collapse, reason, leader)`; refuses when the margin is too small or a strong alternative is unresolved |
107
+ | `uncertainty_from_branches`, `normalized_entropy` | normalised Shannon entropy over surviving branch scores |
108
+ | `recommended_width` | uncertainty → suggested branch count for the next step |
109
+ | `diversity_ratio`, `rank_branches` | fraction of branch pairs that are materially distinct; ordering helper |
110
+
111
+ Weights and thresholds are **reference defaults, not validated constants** —
112
+ [`docs/MEASUREMENT.md`](docs/MEASUREMENT.md) gives the formulas and the list of values that
113
+ must be calibrated first.
114
+
115
+ ## Benchmark harness
116
+
117
+ [`benchmark/`](benchmark/README.md) measures whether the skill helps rather than merely
118
+ producing more text: `benchmark/evaluate.py` (evaluator), `benchmark/validate_submission.py`
119
+ (machine-validates a reproducible bundle), `benchmark/paths.py` (path confinement that rejects
120
+ `..` traversal and symlink escapes), `benchmark/cases.jsonl`, and four JSON Schemas — `case`,
121
+ `result`, `metadata`, `comparison`.
122
+
123
+ ```bash
124
+ python benchmark/evaluate.py --cases benchmark/cases.jsonl --skill skill-results.jsonl
125
+ ```
126
+
127
+ Inputs are confined to `--cases-dir` (default: each input's own directory), `--output` must
128
+ stay inside it, and reads are bounded by `--max-bytes`. Both `python benchmark/evaluate.py`
129
+ and `python -m benchmark.evaluate` work.
130
+
131
+ ## Tests, tooling and governance
132
+
133
+ About **43% of the Python here is tests** — 1,575 of 3,635 lines across **9 test modules**,
134
+ run with the standard library's `unittest` on Python 3.10–3.14 on Linux, Windows and macOS.
135
+ They cover the controller, the benchmark harness, import hardening, path boundaries,
136
+ dependency-lock drift and release-gate polling; `tests/test_readme_badges.py` keeps this
137
+ file's badges honest. The toolchain is pinned twice — `pyproject.toml`'s `dev` group with
138
+ `==`, and [`constraints.txt`](constraints.txt) with `==` **and** `--hash` digests for the full
139
+ transitive closure ([details](CONTRIBUTING.md#toolchain-pinning)).
140
+
141
+ Also here: [`codemeta.json`](codemeta.json) for machine-readable citation beside
142
+ [`CITATION.cff`](CITATION.cff); five issue templates (bug, feature, question, benchmark
143
+ result, plus a chooser in `config.yml`) and a pull-request template; a
144
+ [Code of Conduct](CODE_OF_CONDUCT.md) with a scientific-integrity section; a
145
+ [Security policy](SECURITY.md).
146
+
147
+ ## The protocol
148
+
149
+ `SKILL.md` is the normative contract. In short: **frame** the problem (verified vs assumed) →
150
+ **open branches** (genuinely different, not paraphrases) → **evaluate independently** (on
151
+ evidence, not eloquence) → **cross-check** (independently reached conclusions get reinforced)
152
+ → **prune and revive** (kill contradicted paths, keep dormant ones recoverable) → **collapse**
153
+ (only when one path is clearly better supported). `SKILL.md` also scopes when *not* to use it:
154
+ trivially answerable questions should not pay branching cost.
155
+
156
+ ## Benchmark status
157
+
158
+ **There are no published benchmark results.** `benchmark/cases.jsonl` holds six deterministic
159
+ smoke-test cases that prove the harness runs; they are explicitly **not sufficient evidence of
160
+ reasoning improvement**. Anyone can evaluate on models they have access to; every submitted
161
+ number must carry provenance (script, skill commit, provider and exact model version, run date,
162
+ sampling parameters, repetitions, platform), and one positive run establishes no general claim.
163
+ Rules: [CONTRIBUTING.md](CONTRIBUTING.md#benchmark-provenance-requirements).
164
+
165
+ ## How it compares
166
+
167
+ This table describes *mechanisms*, not measured performance. Nothing here has been
168
+ benchmarked against the rows above it.
169
+
170
+ | Approach | Mechanism | Limitation |
171
+ | --- | --- | --- |
172
+ | Chain-of-Thought ([Wei et al., 2022](https://arxiv.org/abs/2201.11903)) | One linear reasoning path | Early anchoring; alternatives are never kept alive |
173
+ | Tree-of-Thought ([Yao et al., 2023](https://arxiv.org/abs/2305.10601)) | Branch plus heuristic scoring | Scoring is fixed in advance; no evidence weighting or revival |
174
+ | Self-consistency ([Wang et al., 2022](https://arxiv.org/abs/2203.11171)) | Samples one prompt N times | Paraphrase diversity, not hypothesis diversity |
175
+ | **This skill** | Branches with evidence-weighted scores, correlation penalties, dormancy with revival, explicit collapse criteria | **Not yet validated:** no published result. Branch breadth costs tokens and latency. Needs a host that persists instructions. |
176
+
177
+ ## Documentation
178
+
179
+ Everything lives in [`docs/index.md`](docs/index.md) — getting started, quickstart and its
180
+ verified output, measurement methodology, host compatibility, report forms. Release history:
181
+ [CHANGELOG.md](CHANGELOG.md). License: [MIT](LICENSE).