cfgit-impact 0.1.1__tar.gz → 0.1.3__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.
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/.gitignore +9 -0
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/PKG-INFO +21 -2
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/README.md +19 -0
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/cfg_impact/overview.py +23 -5
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/cfg_impact/providers/base.py +4 -4
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/pyproject.toml +2 -2
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/cfg_impact/__init__.py +0 -0
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/cfg_impact/providers/__init__.py +0 -0
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/cfg_impact/providers/claude.py +0 -0
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/cfg_impact/providers/factory.py +0 -0
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/cfg_impact/providers/gemini.py +0 -0
- {cfgit_impact-0.1.1 → cfgit_impact-0.1.3}/cfg_impact/providers/openai_provider.py +0 -0
|
@@ -116,6 +116,15 @@ activemq-data/
|
|
|
116
116
|
.cfg/
|
|
117
117
|
/.cfg.toml
|
|
118
118
|
|
|
119
|
+
# Local project notes and recording drafts
|
|
120
|
+
docs/project-notes/
|
|
121
|
+
*.mp4
|
|
122
|
+
*.mov
|
|
123
|
+
*.webm
|
|
124
|
+
*.mkv
|
|
125
|
+
*.avi
|
|
126
|
+
*.m4v
|
|
127
|
+
|
|
119
128
|
# Local secrets and overrides
|
|
120
129
|
*.local
|
|
121
130
|
.streamlit/secrets.toml
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cfgit-impact
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Optional cfgit plugin for deterministic system-impact summaries and opt-in LLM narration of database record diffs
|
|
5
5
|
Project-URL: Homepage, https://github.com/AusafMo/cfgit
|
|
6
6
|
Project-URL: Repository, https://github.com/AusafMo/cfgit
|
|
@@ -9,7 +9,7 @@ Project-URL: Documentation, https://github.com/AusafMo/cfgit/tree/main/plugins/c
|
|
|
9
9
|
Author: Mohammad Ausaf
|
|
10
10
|
License-Expression: Apache-2.0
|
|
11
11
|
Requires-Python: >=3.11
|
|
12
|
-
Requires-Dist: cfgit<0.2.0,>=0.1.
|
|
12
|
+
Requires-Dist: cfgit<0.2.0,>=0.1.3
|
|
13
13
|
Requires-Dist: httpx>=0.27
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
|
|
@@ -19,6 +19,25 @@ Optional system-impact analysis for cfgit.
|
|
|
19
19
|
|
|
20
20
|
This package is deliberately outside `src/cfg/core/`. The cfgit core stays LLM-free and provider-free; this plugin owns both deterministic impact analysis and optional LLM narration.
|
|
21
21
|
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
Install cfgit with the database extras you use, then install the optional impact
|
|
25
|
+
plugin from PyPI into the same Python environment:
|
|
26
|
+
|
|
27
|
+
- [`cfgit-impact`](https://pypi.org/project/cfgit-impact/)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install 'cfgit[mongo,postgres,mcp]'
|
|
31
|
+
pip install cfgit-impact
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For `pipx` installs:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pipx install 'cfgit[mongo,postgres,mcp]'
|
|
38
|
+
pipx inject cfgit cfgit-impact
|
|
39
|
+
```
|
|
40
|
+
|
|
22
41
|
## Boundary
|
|
23
42
|
|
|
24
43
|
- `src/cfg/core/` never imports this plugin.
|
|
@@ -4,6 +4,25 @@ Optional system-impact analysis for cfgit.
|
|
|
4
4
|
|
|
5
5
|
This package is deliberately outside `src/cfg/core/`. The cfgit core stays LLM-free and provider-free; this plugin owns both deterministic impact analysis and optional LLM narration.
|
|
6
6
|
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Install cfgit with the database extras you use, then install the optional impact
|
|
10
|
+
plugin from PyPI into the same Python environment:
|
|
11
|
+
|
|
12
|
+
- [`cfgit-impact`](https://pypi.org/project/cfgit-impact/)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install 'cfgit[mongo,postgres,mcp]'
|
|
16
|
+
pip install cfgit-impact
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
For `pipx` installs:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pipx install 'cfgit[mongo,postgres,mcp]'
|
|
23
|
+
pipx inject cfgit cfgit-impact
|
|
24
|
+
```
|
|
25
|
+
|
|
7
26
|
## Boundary
|
|
8
27
|
|
|
9
28
|
- `src/cfg/core/` never imports this plugin.
|
|
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import asyncio
|
|
6
6
|
import json
|
|
7
|
+
import re
|
|
7
8
|
import sys
|
|
8
9
|
from typing import Any
|
|
9
10
|
|
|
@@ -106,7 +107,7 @@ async def overview_with_optional_llm(
|
|
|
106
107
|
payload,
|
|
107
108
|
json_dumps=lambda payload: json.dumps(payload, indent=2, sort_keys=True),
|
|
108
109
|
temperature=0.1,
|
|
109
|
-
max_tokens=
|
|
110
|
+
max_tokens=4096,
|
|
110
111
|
)
|
|
111
112
|
parsed = _parse_jsonish(result.get("content", ""))
|
|
112
113
|
overview_data["llm"] = {
|
|
@@ -422,11 +423,28 @@ def _parse_jsonish(text: str) -> dict[str, Any] | None:
|
|
|
422
423
|
if not raw:
|
|
423
424
|
return None
|
|
424
425
|
if raw.startswith("```"):
|
|
425
|
-
raw = raw.strip(
|
|
426
|
-
if raw.startswith("json"):
|
|
427
|
-
raw = raw[4:]
|
|
426
|
+
raw = raw[3:].strip()
|
|
427
|
+
if raw.lower().startswith("json"):
|
|
428
|
+
raw = raw[4:].strip()
|
|
429
|
+
fence_end = raw.rfind("```")
|
|
430
|
+
if fence_end != -1:
|
|
431
|
+
raw = raw[:fence_end].strip()
|
|
428
432
|
try:
|
|
429
433
|
data = json.loads(raw)
|
|
430
434
|
except json.JSONDecodeError:
|
|
431
|
-
return
|
|
435
|
+
return _parse_partial_json_fields(raw)
|
|
432
436
|
return data if isinstance(data, dict) else None
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
def _parse_partial_json_fields(raw: str) -> dict[str, Any] | None:
|
|
440
|
+
parsed: dict[str, Any] = {}
|
|
441
|
+
for key in ("summary", "behavior_change", "blast_radius", "risk_level", "rollback_note"):
|
|
442
|
+
match = re.search(rf'"{key}"\s*:\s*"((?:\\.|[^"\\])*)"', raw, flags=re.DOTALL)
|
|
443
|
+
if match:
|
|
444
|
+
try:
|
|
445
|
+
parsed[key] = json.loads(f'"{match.group(1)}"')
|
|
446
|
+
except json.JSONDecodeError:
|
|
447
|
+
parsed[key] = match.group(1)
|
|
448
|
+
if '"unknowns"' in raw:
|
|
449
|
+
parsed.setdefault("unknowns", [])
|
|
450
|
+
return parsed or None
|
|
@@ -49,10 +49,10 @@ class BaseImpactProvider(ABC):
|
|
|
49
49
|
"upstream/downstream roles, overlapping responsibilities), naming the specific "
|
|
50
50
|
"config_ids. Do NOT say 'impact unknown' when the diff is present, read it. Only list a "
|
|
51
51
|
"genuine unknown if it truly cannot be inferred from the provided data.\n"
|
|
52
|
-
"Return
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
52
|
+
"Return terse JSON with keys: summary (one concrete sentence), behavior_change (one "
|
|
53
|
+
"short sentence), blast_radius (one short sentence naming affected configs), risk_level "
|
|
54
|
+
"(low|medium|high), rollback_note (one short sentence), unknowns (array of only real "
|
|
55
|
+
"unknowns). Return raw JSON only; do not wrap it in Markdown or code fences."
|
|
56
56
|
),
|
|
57
57
|
},
|
|
58
58
|
{"role": "user", "content": json_dumps(payload)},
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "cfgit-impact"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.3"
|
|
4
4
|
description = "Optional cfgit plugin for deterministic system-impact summaries and opt-in LLM narration of database record diffs"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
7
7
|
license = "Apache-2.0"
|
|
8
8
|
authors = [{ name = "Mohammad Ausaf" }]
|
|
9
9
|
dependencies = [
|
|
10
|
-
"cfgit>=0.1.
|
|
10
|
+
"cfgit>=0.1.3,<0.2.0",
|
|
11
11
|
"httpx>=0.27",
|
|
12
12
|
]
|
|
13
13
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|