corcc 0.3.0__tar.gz → 0.3.2__tar.gz
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.
- corcc-0.3.2/LICENSE +21 -0
- corcc-0.3.2/PKG-INFO +59 -0
- corcc-0.3.2/README.md +44 -0
- {corcc-0.3.0 → corcc-0.3.2}/pyproject.toml +5 -3
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc/__init__.py +1 -1
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc/notation.py +7 -0
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc/paragraph.py +3 -2
- corcc-0.3.2/src/corcc.egg-info/PKG-INFO +59 -0
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc.egg-info/SOURCES.txt +2 -0
- corcc-0.3.2/src/corcc.egg-info/requires.txt +5 -0
- corcc-0.3.2/tests/test_corcc_regressions.py +45 -0
- corcc-0.3.0/PKG-INFO +0 -10
- corcc-0.3.0/src/corcc.egg-info/PKG-INFO +0 -10
- corcc-0.3.0/src/corcc.egg-info/requires.txt +0 -5
- corcc-0.3.0/tests/test_corcc_regressions.py +0 -24
- {corcc-0.3.0 → corcc-0.3.2}/setup.cfg +0 -0
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc/cli.py +0 -0
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc/forge.py +0 -0
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc.egg-info/dependency_links.txt +0 -0
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc.egg-info/entry_points.txt +0 -0
- {corcc-0.3.0 → corcc-0.3.2}/src/corcc.egg-info/top_level.txt +0 -0
- {corcc-0.3.0 → corcc-0.3.2}/tests/test_corcc.py +0 -0
corcc-0.3.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sancovp
|
|
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.
|
corcc-0.3.2/PKG-INFO
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: corcc
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Chain-of-Reasoning Compiler-Compiler — spoken reasoning + persona-melt gauge
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: chaincompiler-accc==0.3.2
|
|
10
|
+
Requires-Dist: chaincompiler==0.3.2
|
|
11
|
+
Requires-Dist: honeyc==0.3.2
|
|
12
|
+
Requires-Dist: rulecatcher==0.3.2
|
|
13
|
+
Requires-Dist: click
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# corcc — the chain-of-reasoning compiler
|
|
17
|
+
|
|
18
|
+
`corcc` is one of the three chain compilers of [ChainCompiler](https://github.com/sancovp/chaincompiler), a
|
|
19
|
+
compiler-compiler for cognition. It compiles **chains of reasoning** (CoRs). A CoR is spoken: one paragraph that performs
|
|
20
|
+
ordered moves and ends in a decision. A `PersonaSpec` is those moves in order, each `Move` carrying the cue phrases that
|
|
21
|
+
count as evidence it was performed; the last move is the held convergence.
|
|
22
|
+
|
|
23
|
+
- `forge_persona(spec, db=…)` forges the move chain as an attention-chain language;
|
|
24
|
+
- `lint(persona, cor_text)` gates a spoken CoR against that language. Drift out of the syntax is the persona *melting*,
|
|
25
|
+
which is why the lint is called the melt-gauge;
|
|
26
|
+
- `package(persona, out_dir=…)` writes the CoR as `<name>/SKILL.md`, with its paragraph skeleton and its inner attention
|
|
27
|
+
chain; a move recovered without its cue phrases is cued by its own name in the skeleton;
|
|
28
|
+
- the seed personas: `BANDIT` (`Task → Recall → Decide → Execute → Reward` — given a task, it exploits a proven chain or
|
|
29
|
+
explores by constructing one; the default CoR everywhere), `EINSTEIN` and `FEYNMAN`.
|
|
30
|
+
|
|
31
|
+
It is made from the [`chaincompiler`](https://pypi.org/project/chaincompiler/) base and composes
|
|
32
|
+
[`chaincompiler-accc`](https://pypi.org/project/chaincompiler-accc/) for its inner attention template;
|
|
33
|
+
[`sccc`](https://pypi.org/project/sccc/) chains its CoRs with attention chains and skills.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install corcc
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
It installs the `corcc` command. To work on it, clone the [repository](https://github.com/sancovp/chaincompiler) and run
|
|
42
|
+
`./install.sh`, which installs all fifteen packages editable.
|
|
43
|
+
|
|
44
|
+
## Use
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from corcc import BANDIT, forge_persona, package
|
|
48
|
+
|
|
49
|
+
persona = forge_persona(BANDIT, db="cor.db") # the BANDIT: Task → Recall → Decide → Execute → Reward
|
|
50
|
+
print(package(persona, out_dir="skills")) # skills/banditchain/SKILL.md
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Its design
|
|
54
|
+
|
|
55
|
+
The repository's [`DESIGN.md`](https://github.com/sancovp/chaincompiler/blob/main/DESIGN.md) §5.
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT.
|
corcc-0.3.2/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# corcc — the chain-of-reasoning compiler
|
|
2
|
+
|
|
3
|
+
`corcc` is one of the three chain compilers of [ChainCompiler](https://github.com/sancovp/chaincompiler), a
|
|
4
|
+
compiler-compiler for cognition. It compiles **chains of reasoning** (CoRs). A CoR is spoken: one paragraph that performs
|
|
5
|
+
ordered moves and ends in a decision. A `PersonaSpec` is those moves in order, each `Move` carrying the cue phrases that
|
|
6
|
+
count as evidence it was performed; the last move is the held convergence.
|
|
7
|
+
|
|
8
|
+
- `forge_persona(spec, db=…)` forges the move chain as an attention-chain language;
|
|
9
|
+
- `lint(persona, cor_text)` gates a spoken CoR against that language. Drift out of the syntax is the persona *melting*,
|
|
10
|
+
which is why the lint is called the melt-gauge;
|
|
11
|
+
- `package(persona, out_dir=…)` writes the CoR as `<name>/SKILL.md`, with its paragraph skeleton and its inner attention
|
|
12
|
+
chain; a move recovered without its cue phrases is cued by its own name in the skeleton;
|
|
13
|
+
- the seed personas: `BANDIT` (`Task → Recall → Decide → Execute → Reward` — given a task, it exploits a proven chain or
|
|
14
|
+
explores by constructing one; the default CoR everywhere), `EINSTEIN` and `FEYNMAN`.
|
|
15
|
+
|
|
16
|
+
It is made from the [`chaincompiler`](https://pypi.org/project/chaincompiler/) base and composes
|
|
17
|
+
[`chaincompiler-accc`](https://pypi.org/project/chaincompiler-accc/) for its inner attention template;
|
|
18
|
+
[`sccc`](https://pypi.org/project/sccc/) chains its CoRs with attention chains and skills.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install corcc
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
It installs the `corcc` command. To work on it, clone the [repository](https://github.com/sancovp/chaincompiler) and run
|
|
27
|
+
`./install.sh`, which installs all fifteen packages editable.
|
|
28
|
+
|
|
29
|
+
## Use
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from corcc import BANDIT, forge_persona, package
|
|
33
|
+
|
|
34
|
+
persona = forge_persona(BANDIT, db="cor.db") # the BANDIT: Task → Recall → Decide → Execute → Reward
|
|
35
|
+
print(package(persona, out_dir="skills")) # skills/banditchain/SKILL.md
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Its design
|
|
39
|
+
|
|
40
|
+
The repository's [`DESIGN.md`](https://github.com/sancovp/chaincompiler/blob/main/DESIGN.md) §5.
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
MIT.
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "corcc"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
description = "Chain-of-Reasoning Compiler-Compiler — spoken reasoning + persona-melt gauge"
|
|
9
|
+
readme = "README.md"
|
|
9
10
|
requires-python = ">=3.11"
|
|
10
|
-
|
|
11
|
+
license = "MIT"
|
|
12
|
+
dependencies = ["chaincompiler-accc==0.3.2", "chaincompiler==0.3.2", "honeyc==0.3.2", "rulecatcher==0.3.2", "click"]
|
|
11
13
|
|
|
12
14
|
[project.scripts]
|
|
13
15
|
corcc = "corcc.cli:main"
|
|
@@ -20,6 +20,13 @@ class Move:
|
|
|
20
20
|
name: str
|
|
21
21
|
cues: tuple[str, ...]
|
|
22
22
|
|
|
23
|
+
def __post_init__(self) -> None:
|
|
24
|
+
# a one-phrase tuple written without its comma is a bare string, whose first letter would become the cue
|
|
25
|
+
if isinstance(self.cues, str):
|
|
26
|
+
raise TypeError(f"Move {self.name!r}: cues is the string {self.cues!r}, not a tuple of cue phrases — "
|
|
27
|
+
f"write ({self.cues!r},)")
|
|
28
|
+
object.__setattr__(self, "cues", tuple(self.cues))
|
|
29
|
+
|
|
23
30
|
|
|
24
31
|
@dataclass(frozen=True)
|
|
25
32
|
class PersonaSpec:
|
|
@@ -18,7 +18,8 @@ def must_say_directive(spec: PersonaSpec) -> str:
|
|
|
18
18
|
|
|
19
19
|
def cor_template(spec: PersonaSpec) -> str:
|
|
20
20
|
"""A fill-in paragraph skeleton with one clause per move and its cue — rendered via the base's
|
|
21
|
-
`cor_skeleton` (single source of the format). Each Move contributes its first cue phrase
|
|
21
|
+
`cor_skeleton` (single source of the format). Each Move contributes its first cue phrase; a move that carries
|
|
22
|
+
none (a persona recovered without its cues) is cued by its own name, `cor_skeleton`'s default."""
|
|
22
23
|
moves = [m.name for m in spec.moves]
|
|
23
|
-
cues = {m.name: m.cues[0] for m in spec.moves}
|
|
24
|
+
cues = {m.name: m.cues[0] for m in spec.moves if m.cues}
|
|
24
25
|
return cor_skeleton(moves, cues)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: corcc
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Chain-of-Reasoning Compiler-Compiler — spoken reasoning + persona-melt gauge
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: chaincompiler-accc==0.3.2
|
|
10
|
+
Requires-Dist: chaincompiler==0.3.2
|
|
11
|
+
Requires-Dist: honeyc==0.3.2
|
|
12
|
+
Requires-Dist: rulecatcher==0.3.2
|
|
13
|
+
Requires-Dist: click
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# corcc — the chain-of-reasoning compiler
|
|
17
|
+
|
|
18
|
+
`corcc` is one of the three chain compilers of [ChainCompiler](https://github.com/sancovp/chaincompiler), a
|
|
19
|
+
compiler-compiler for cognition. It compiles **chains of reasoning** (CoRs). A CoR is spoken: one paragraph that performs
|
|
20
|
+
ordered moves and ends in a decision. A `PersonaSpec` is those moves in order, each `Move` carrying the cue phrases that
|
|
21
|
+
count as evidence it was performed; the last move is the held convergence.
|
|
22
|
+
|
|
23
|
+
- `forge_persona(spec, db=…)` forges the move chain as an attention-chain language;
|
|
24
|
+
- `lint(persona, cor_text)` gates a spoken CoR against that language. Drift out of the syntax is the persona *melting*,
|
|
25
|
+
which is why the lint is called the melt-gauge;
|
|
26
|
+
- `package(persona, out_dir=…)` writes the CoR as `<name>/SKILL.md`, with its paragraph skeleton and its inner attention
|
|
27
|
+
chain; a move recovered without its cue phrases is cued by its own name in the skeleton;
|
|
28
|
+
- the seed personas: `BANDIT` (`Task → Recall → Decide → Execute → Reward` — given a task, it exploits a proven chain or
|
|
29
|
+
explores by constructing one; the default CoR everywhere), `EINSTEIN` and `FEYNMAN`.
|
|
30
|
+
|
|
31
|
+
It is made from the [`chaincompiler`](https://pypi.org/project/chaincompiler/) base and composes
|
|
32
|
+
[`chaincompiler-accc`](https://pypi.org/project/chaincompiler-accc/) for its inner attention template;
|
|
33
|
+
[`sccc`](https://pypi.org/project/sccc/) chains its CoRs with attention chains and skills.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install corcc
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
It installs the `corcc` command. To work on it, clone the [repository](https://github.com/sancovp/chaincompiler) and run
|
|
42
|
+
`./install.sh`, which installs all fifteen packages editable.
|
|
43
|
+
|
|
44
|
+
## Use
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from corcc import BANDIT, forge_persona, package
|
|
48
|
+
|
|
49
|
+
persona = forge_persona(BANDIT, db="cor.db") # the BANDIT: Task → Recall → Decide → Execute → Reward
|
|
50
|
+
print(package(persona, out_dir="skills")) # skills/banditchain/SKILL.md
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Its design
|
|
54
|
+
|
|
55
|
+
The repository's [`DESIGN.md`](https://github.com/sancovp/chaincompiler/blob/main/DESIGN.md) §5.
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Regressions in what a CoR's package writes: the directive it carries says what the paragraph does (the public
|
|
2
|
+
repository's bug sweeps, pull requests #1 and #2), and a move with no cue phrase is cued by its name (personapack's
|
|
3
|
+
recovered personas).
|
|
4
|
+
|
|
5
|
+
Each fails on the code before its fix and passes after it.
|
|
6
|
+
"""
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
import pytest
|
|
12
|
+
|
|
13
|
+
from corcc import forge_persona, package, prime
|
|
14
|
+
from corcc.notation import BANDIT, Move, PersonaSpec
|
|
15
|
+
from corcc.paragraph import cor_template, must_say_directive
|
|
16
|
+
|
|
17
|
+
DIRECTIVE = "State your reasoning as ONE paragraph that performs, in order, 5 moves: "
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_the_directive_has_its_verb():
|
|
21
|
+
assert must_say_directive(BANDIT).startswith(DIRECTIVE)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_a_move_with_no_cue_is_cued_by_its_name(tmp_path: Path):
|
|
25
|
+
# a persona recovered without its cue phrases (personapack's SamayaReviewer) packages, its skeleton naming each
|
|
26
|
+
# cue-less move by the move's own name — the base's `cor_skeleton` default
|
|
27
|
+
spec = PersonaSpec(name="Reviewer", moves=(Move("Enumerate", ()), Move("Trace", ("follow the call",)),
|
|
28
|
+
Move("Validate", ())))
|
|
29
|
+
assert cor_template(spec) == "[Enumerate: …Enumerate…] → [Trace: …follow the call…] → [Validate: …Validate…]"
|
|
30
|
+
skill = Path(package(forge_persona(spec, db=str(tmp_path / "rules.db")), out_dir=str(tmp_path / "skills")))
|
|
31
|
+
assert "[Enumerate: …Enumerate…]" in skill.read_text(encoding="utf-8")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_a_move_whose_cues_is_a_bare_string_is_refused():
|
|
35
|
+
# `("one phrase")` without its comma is a string, and its first letter would be the move's cue
|
|
36
|
+
with pytest.raises(TypeError, match="not a tuple of cue phrases"):
|
|
37
|
+
Move("Execute", ("produce the action, now sealed"))
|
|
38
|
+
assert Move("Execute", ["produce the action"]).cues == ("produce the action",)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_every_door_that_writes_the_directive_writes_it_whole(tmp_path: Path):
|
|
42
|
+
persona = forge_persona(BANDIT, db=str(tmp_path / "rules.db"))
|
|
43
|
+
skill = Path(package(persona, out_dir=str(tmp_path / "skills")))
|
|
44
|
+
assert DIRECTIVE in skill.read_text(encoding="utf-8")
|
|
45
|
+
assert DIRECTIVE in prime(persona)
|
corcc-0.3.0/PKG-INFO
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: corcc
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: Chain-of-Reasoning Compiler-Compiler — spoken reasoning + persona-melt gauge
|
|
5
|
-
Requires-Python: >=3.11
|
|
6
|
-
Requires-Dist: chaincompiler-accc==0.3.0
|
|
7
|
-
Requires-Dist: chaincompiler==0.3.0
|
|
8
|
-
Requires-Dist: honeyc==0.3.0
|
|
9
|
-
Requires-Dist: rulecatcher==0.3.0
|
|
10
|
-
Requires-Dist: click
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: corcc
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: Chain-of-Reasoning Compiler-Compiler — spoken reasoning + persona-melt gauge
|
|
5
|
-
Requires-Python: >=3.11
|
|
6
|
-
Requires-Dist: chaincompiler-accc==0.3.0
|
|
7
|
-
Requires-Dist: chaincompiler==0.3.0
|
|
8
|
-
Requires-Dist: honeyc==0.3.0
|
|
9
|
-
Requires-Dist: rulecatcher==0.3.0
|
|
10
|
-
Requires-Dist: click
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"""The directive a CoR carries says what the paragraph does (the public repository's bug sweeps, pull requests #1 and #2).
|
|
2
|
-
|
|
3
|
-
It fails on the code before the fix and passes after it.
|
|
4
|
-
"""
|
|
5
|
-
from __future__ import annotations
|
|
6
|
-
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
from corcc import forge_persona, package, prime
|
|
10
|
-
from corcc.notation import BANDIT
|
|
11
|
-
from corcc.paragraph import must_say_directive
|
|
12
|
-
|
|
13
|
-
DIRECTIVE = "State your reasoning as ONE paragraph that performs, in order, 5 moves: "
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def test_the_directive_has_its_verb():
|
|
17
|
-
assert must_say_directive(BANDIT).startswith(DIRECTIVE)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_every_door_that_writes_the_directive_writes_it_whole(tmp_path: Path):
|
|
21
|
-
persona = forge_persona(BANDIT, db=str(tmp_path / "rules.db"))
|
|
22
|
-
skill = Path(package(persona, out_dir=str(tmp_path / "skills")))
|
|
23
|
-
assert DIRECTIVE in skill.read_text(encoding="utf-8")
|
|
24
|
-
assert DIRECTIVE in prime(persona)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|