confab-framework 0.3.0__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.
- confab_framework-0.3.0/LICENSE +21 -0
- confab_framework-0.3.0/PKG-INFO +147 -0
- confab_framework-0.3.0/README.md +125 -0
- confab_framework-0.3.0/__init__.py +44 -0
- confab_framework-0.3.0/__main__.py +4 -0
- confab_framework-0.3.0/claims.py +553 -0
- confab_framework-0.3.0/cli.py +931 -0
- confab_framework-0.3.0/confab_framework.egg-info/PKG-INFO +147 -0
- confab_framework-0.3.0/confab_framework.egg-info/SOURCES.txt +32 -0
- confab_framework-0.3.0/confab_framework.egg-info/dependency_links.txt +1 -0
- confab_framework-0.3.0/confab_framework.egg-info/entry_points.txt +2 -0
- confab_framework-0.3.0/confab_framework.egg-info/top_level.txt +1 -0
- confab_framework-0.3.0/config.py +274 -0
- confab_framework-0.3.0/gate.py +670 -0
- confab_framework-0.3.0/pyproject.toml +36 -0
- confab_framework-0.3.0/setup.cfg +4 -0
- confab_framework-0.3.0/supports.py +427 -0
- confab_framework-0.3.0/tests/test_claims.py +510 -0
- confab_framework-0.3.0/tests/test_config.py +206 -0
- confab_framework-0.3.0/tests/test_gate.py +348 -0
- confab_framework-0.3.0/tests/test_report.py +222 -0
- confab_framework-0.3.0/tests/test_tracker.py +528 -0
- confab_framework-0.3.0/tests/test_verify.py +368 -0
- confab_framework-0.3.0/tracker.py +592 -0
- confab_framework-0.3.0/verify.py +1058 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dennis Chou
|
|
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.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: confab-framework
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Structural confabulation detection and prevention for multi-agent systems
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Repository, https://github.com/dennischoubot-glitch/confab-framework
|
|
7
|
+
Project-URL: Issues, https://github.com/dennischoubot-glitch/confab-framework/issues
|
|
8
|
+
Keywords: agents,confabulation,verification,multi-agent,llm,ai-safety
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Topic :: Software Development :: Testing
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# confab-framework
|
|
24
|
+
|
|
25
|
+
Structural confabulation detection and prevention for multi-agent systems.
|
|
26
|
+
|
|
27
|
+
Agents state falsehoods confidently. Other agents copy them forward indefinitely. This framework makes verification structural (enforced by code) rather than aspirational (suggested by docs).
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install confab-framework
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Or from source:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install -e ./core/confab
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install confab-framework
|
|
45
|
+
cd your-project/
|
|
46
|
+
confab init # generate a confab.toml
|
|
47
|
+
# Edit confab.toml — add your priority/handoff files to files_to_scan
|
|
48
|
+
confab gate # verify carry-forward claims against reality
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Python API
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from confab import ConfabGate
|
|
55
|
+
|
|
56
|
+
# From a config file
|
|
57
|
+
gate = ConfabGate("confab.toml")
|
|
58
|
+
report = gate.run()
|
|
59
|
+
|
|
60
|
+
if report.has_failures:
|
|
61
|
+
print(report.format_report())
|
|
62
|
+
elif report.has_stale:
|
|
63
|
+
print(f"{report.stale_claims} stale claims need verification")
|
|
64
|
+
else:
|
|
65
|
+
print(f"Clean: {report.passed} claims verified")
|
|
66
|
+
|
|
67
|
+
# Check inline text directly
|
|
68
|
+
outcomes = gate.check("Audio pipeline blocked on OPENAI_API_KEY")
|
|
69
|
+
for o in outcomes:
|
|
70
|
+
print(f"{o.result.value}: {o.evidence}")
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## How It Works
|
|
74
|
+
|
|
75
|
+
Agents in multi-agent systems pass claims forward at handoff points — "the pipeline is blocked on X," "file Y exists," "the config is ready." When an agent states a falsehood confidently, the next agent copies it forward. The confab framework breaks this cascade by extracting claims from handoff text, auto-verifying them against reality (filesystem, environment variables, script syntax, config parsing, pipeline outputs), and tracking how long unverified claims persist. Claims that fail verification get flagged; claims that linger without verification get marked stale. The gate runs at every agent handoff point, supplying the oracle bits that distinguish confabulation from understanding.
|
|
76
|
+
|
|
77
|
+
The pipeline: **Extract** (scan for claims) → **Classify** (type + verifiability) → **Verify** (check against ground truth) → **Track** (SQLite persistence across runs) → **Report** (failures + staleness + tree health).
|
|
78
|
+
|
|
79
|
+
## Commands
|
|
80
|
+
|
|
81
|
+
| Command | Description |
|
|
82
|
+
|---------|-------------|
|
|
83
|
+
| `confab gate` | Run the full cascade gate |
|
|
84
|
+
| `confab check "text"` | Check inline text for claims |
|
|
85
|
+
| `confab extract file.md` | Extract claims without verifying |
|
|
86
|
+
| `confab quick` | One-line gate summary |
|
|
87
|
+
| `confab prune` | Identify stale build sections to remove |
|
|
88
|
+
| `confab sweep` | Show tracked claims by staleness |
|
|
89
|
+
| `confab sweep --stats` | Tracker statistics |
|
|
90
|
+
| `confab report` | System health dashboard (gate + supports + coverage) |
|
|
91
|
+
| `confab init` | Generate a starter `confab.toml` |
|
|
92
|
+
|
|
93
|
+
## Configuration
|
|
94
|
+
|
|
95
|
+
`confab.toml` in your workspace root:
|
|
96
|
+
|
|
97
|
+
```toml
|
|
98
|
+
[confab]
|
|
99
|
+
files_to_scan = ["docs/priorities.md", "notes/handoff.md"]
|
|
100
|
+
stale_threshold = 3
|
|
101
|
+
db_path = "confab_tracker.db"
|
|
102
|
+
|
|
103
|
+
[confab.env_vars]
|
|
104
|
+
known = ["OPENAI_API_KEY", "DATABASE_URL"]
|
|
105
|
+
|
|
106
|
+
[confab.pipelines]
|
|
107
|
+
"my_pipeline.py" = ["output/data/", "output/report.json"]
|
|
108
|
+
|
|
109
|
+
# Optional: name-based pipeline matching for status claims
|
|
110
|
+
[confab.pipeline_names]
|
|
111
|
+
"data pipeline" = "my_pipeline.py"
|
|
112
|
+
|
|
113
|
+
# Optional: count verification sources
|
|
114
|
+
[confab.count_sources.my_entries]
|
|
115
|
+
file = "data/entries.json"
|
|
116
|
+
type = "json_array"
|
|
117
|
+
json_path = "entries"
|
|
118
|
+
|
|
119
|
+
[confab.count_sources.task_queue]
|
|
120
|
+
file = "queue.md"
|
|
121
|
+
type = "regex_count"
|
|
122
|
+
pattern = "^###\\s+Task\\s+\\d+"
|
|
123
|
+
rate_per_day = 3.0
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Without a config file, the framework auto-detects context and uses sensible defaults.
|
|
127
|
+
|
|
128
|
+
## Claim Types
|
|
129
|
+
|
|
130
|
+
| Type | Example | Verification |
|
|
131
|
+
|------|---------|-------------|
|
|
132
|
+
| `file_exists` | "config.json is ready" | `os.path.exists()` |
|
|
133
|
+
| `file_missing` | "output.csv doesn't exist" | `os.path.exists()` |
|
|
134
|
+
| `env_var` | "blocked on OPENAI_API_KEY" | `.env` files + `os.environ` |
|
|
135
|
+
| `pipeline_works` | "audio pipeline operational" | Output artifact check |
|
|
136
|
+
| `pipeline_blocked` | "publishing blocked" | Output artifact check |
|
|
137
|
+
| `script_runs` | "generate.py works" | `py_compile` + import check |
|
|
138
|
+
| `config_present` | "settings.toml configured" | Parse + key check |
|
|
139
|
+
| `count_claim` | "144 tests passing" | Source-specific count |
|
|
140
|
+
|
|
141
|
+
## Architecture
|
|
142
|
+
|
|
143
|
+
See [DESIGN.md](DESIGN.md) for the full architecture, including the cascade propagation problem, verification methods, and the gate's role at agent handoff points.
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
MIT
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# confab-framework
|
|
2
|
+
|
|
3
|
+
Structural confabulation detection and prevention for multi-agent systems.
|
|
4
|
+
|
|
5
|
+
Agents state falsehoods confidently. Other agents copy them forward indefinitely. This framework makes verification structural (enforced by code) rather than aspirational (suggested by docs).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install confab-framework
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or from source:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install -e ./core/confab
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install confab-framework
|
|
23
|
+
cd your-project/
|
|
24
|
+
confab init # generate a confab.toml
|
|
25
|
+
# Edit confab.toml — add your priority/handoff files to files_to_scan
|
|
26
|
+
confab gate # verify carry-forward claims against reality
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Python API
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from confab import ConfabGate
|
|
33
|
+
|
|
34
|
+
# From a config file
|
|
35
|
+
gate = ConfabGate("confab.toml")
|
|
36
|
+
report = gate.run()
|
|
37
|
+
|
|
38
|
+
if report.has_failures:
|
|
39
|
+
print(report.format_report())
|
|
40
|
+
elif report.has_stale:
|
|
41
|
+
print(f"{report.stale_claims} stale claims need verification")
|
|
42
|
+
else:
|
|
43
|
+
print(f"Clean: {report.passed} claims verified")
|
|
44
|
+
|
|
45
|
+
# Check inline text directly
|
|
46
|
+
outcomes = gate.check("Audio pipeline blocked on OPENAI_API_KEY")
|
|
47
|
+
for o in outcomes:
|
|
48
|
+
print(f"{o.result.value}: {o.evidence}")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## How It Works
|
|
52
|
+
|
|
53
|
+
Agents in multi-agent systems pass claims forward at handoff points — "the pipeline is blocked on X," "file Y exists," "the config is ready." When an agent states a falsehood confidently, the next agent copies it forward. The confab framework breaks this cascade by extracting claims from handoff text, auto-verifying them against reality (filesystem, environment variables, script syntax, config parsing, pipeline outputs), and tracking how long unverified claims persist. Claims that fail verification get flagged; claims that linger without verification get marked stale. The gate runs at every agent handoff point, supplying the oracle bits that distinguish confabulation from understanding.
|
|
54
|
+
|
|
55
|
+
The pipeline: **Extract** (scan for claims) → **Classify** (type + verifiability) → **Verify** (check against ground truth) → **Track** (SQLite persistence across runs) → **Report** (failures + staleness + tree health).
|
|
56
|
+
|
|
57
|
+
## Commands
|
|
58
|
+
|
|
59
|
+
| Command | Description |
|
|
60
|
+
|---------|-------------|
|
|
61
|
+
| `confab gate` | Run the full cascade gate |
|
|
62
|
+
| `confab check "text"` | Check inline text for claims |
|
|
63
|
+
| `confab extract file.md` | Extract claims without verifying |
|
|
64
|
+
| `confab quick` | One-line gate summary |
|
|
65
|
+
| `confab prune` | Identify stale build sections to remove |
|
|
66
|
+
| `confab sweep` | Show tracked claims by staleness |
|
|
67
|
+
| `confab sweep --stats` | Tracker statistics |
|
|
68
|
+
| `confab report` | System health dashboard (gate + supports + coverage) |
|
|
69
|
+
| `confab init` | Generate a starter `confab.toml` |
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
`confab.toml` in your workspace root:
|
|
74
|
+
|
|
75
|
+
```toml
|
|
76
|
+
[confab]
|
|
77
|
+
files_to_scan = ["docs/priorities.md", "notes/handoff.md"]
|
|
78
|
+
stale_threshold = 3
|
|
79
|
+
db_path = "confab_tracker.db"
|
|
80
|
+
|
|
81
|
+
[confab.env_vars]
|
|
82
|
+
known = ["OPENAI_API_KEY", "DATABASE_URL"]
|
|
83
|
+
|
|
84
|
+
[confab.pipelines]
|
|
85
|
+
"my_pipeline.py" = ["output/data/", "output/report.json"]
|
|
86
|
+
|
|
87
|
+
# Optional: name-based pipeline matching for status claims
|
|
88
|
+
[confab.pipeline_names]
|
|
89
|
+
"data pipeline" = "my_pipeline.py"
|
|
90
|
+
|
|
91
|
+
# Optional: count verification sources
|
|
92
|
+
[confab.count_sources.my_entries]
|
|
93
|
+
file = "data/entries.json"
|
|
94
|
+
type = "json_array"
|
|
95
|
+
json_path = "entries"
|
|
96
|
+
|
|
97
|
+
[confab.count_sources.task_queue]
|
|
98
|
+
file = "queue.md"
|
|
99
|
+
type = "regex_count"
|
|
100
|
+
pattern = "^###\\s+Task\\s+\\d+"
|
|
101
|
+
rate_per_day = 3.0
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Without a config file, the framework auto-detects context and uses sensible defaults.
|
|
105
|
+
|
|
106
|
+
## Claim Types
|
|
107
|
+
|
|
108
|
+
| Type | Example | Verification |
|
|
109
|
+
|------|---------|-------------|
|
|
110
|
+
| `file_exists` | "config.json is ready" | `os.path.exists()` |
|
|
111
|
+
| `file_missing` | "output.csv doesn't exist" | `os.path.exists()` |
|
|
112
|
+
| `env_var` | "blocked on OPENAI_API_KEY" | `.env` files + `os.environ` |
|
|
113
|
+
| `pipeline_works` | "audio pipeline operational" | Output artifact check |
|
|
114
|
+
| `pipeline_blocked` | "publishing blocked" | Output artifact check |
|
|
115
|
+
| `script_runs` | "generate.py works" | `py_compile` + import check |
|
|
116
|
+
| `config_present` | "settings.toml configured" | Parse + key check |
|
|
117
|
+
| `count_claim` | "144 tests passing" | Source-specific count |
|
|
118
|
+
|
|
119
|
+
## Architecture
|
|
120
|
+
|
|
121
|
+
See [DESIGN.md](DESIGN.md) for the full architecture, including the cascade propagation problem, verification methods, and the gate's role at agent handoff points.
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Confabulation Framework — structural detection and prevention for multi-agent systems.
|
|
2
|
+
|
|
3
|
+
Solves the cascade propagation problem: agents state falsehoods confidently,
|
|
4
|
+
other agents copy them forward indefinitely. This framework makes verification
|
|
5
|
+
structural (enforced by code) rather than aspirational (suggested by docs).
|
|
6
|
+
|
|
7
|
+
Quick start (CLI)::
|
|
8
|
+
|
|
9
|
+
pip install confab-framework
|
|
10
|
+
confab init # generate a confab.toml
|
|
11
|
+
confab gate # run the cascade gate
|
|
12
|
+
|
|
13
|
+
Quick start (Python API)::
|
|
14
|
+
|
|
15
|
+
from confab import ConfabGate
|
|
16
|
+
|
|
17
|
+
gate = ConfabGate("confab.toml")
|
|
18
|
+
report = gate.run()
|
|
19
|
+
|
|
20
|
+
if report.has_failures:
|
|
21
|
+
print(report.format_report())
|
|
22
|
+
|
|
23
|
+
See DESIGN.md for architecture.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
from .config import ConfabConfig, get_config, load_config, set_config
|
|
27
|
+
from .gate import run_gate, quick_check, GateReport, ConfabGate
|
|
28
|
+
from .claims import extract_claims, extract_claims_from_file, Claim, ClaimType
|
|
29
|
+
from .verify import verify_claim, verify_all, VerificationResult, VerificationOutcome
|
|
30
|
+
|
|
31
|
+
__version__ = "0.2.0"
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
# High-level API
|
|
35
|
+
"ConfabGate",
|
|
36
|
+
# Configuration
|
|
37
|
+
"ConfabConfig", "get_config", "load_config", "set_config",
|
|
38
|
+
# Gate (function-based)
|
|
39
|
+
"run_gate", "quick_check", "GateReport",
|
|
40
|
+
# Claims
|
|
41
|
+
"extract_claims", "extract_claims_from_file", "Claim", "ClaimType",
|
|
42
|
+
# Verification
|
|
43
|
+
"verify_claim", "verify_all", "VerificationResult", "VerificationOutcome",
|
|
44
|
+
]
|