cfgit-impact 0.1.0__tar.gz → 0.1.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.
@@ -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.0
3
+ Version: 0.1.2
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,16 +9,35 @@ 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.0
12
+ Requires-Dist: cfgit<0.2.0,>=0.1.2
13
13
  Requires-Dist: httpx>=0.27
14
14
  Description-Content-Type: text/markdown
15
15
 
16
- # cfg-impact
16
+ # cfgit-impact
17
17
 
18
18
  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.
@@ -1,9 +1,28 @@
1
- # cfg-impact
1
+ # cfgit-impact
2
2
 
3
3
  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=1100,
110
+ max_tokens=4096,
110
111
  )
111
112
  parsed = _parse_jsonish(result.get("content", ""))
112
113
  overview_data["llm"] = {
@@ -412,7 +413,7 @@ def _log_llm_consent(provider_name: str, records: list[str]) -> None:
412
413
  return
413
414
  _CONSENT_LOGGED.add(key)
414
415
  print(
415
- f"cfg-impact: sending redacted structural diff for {', '.join(records)} to {provider_name}",
416
+ f"cfgit-impact: sending redacted structural diff for {', '.join(records)} to {provider_name}",
416
417
  file=sys.stderr,
417
418
  )
418
419
 
@@ -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 None
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
@@ -1,5 +1,5 @@
1
1
  # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
- """Provider-agnostic LLM clients for cfg-impact."""
2
+ """Provider-agnostic LLM clients for cfgit-impact."""
3
3
 
4
4
  from cfg_impact.providers.base import BaseImpactProvider, ProviderError
5
5
  from cfg_impact.providers.factory import ImpactProviderFactory
@@ -1,5 +1,5 @@
1
1
  # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
- """Lean provider interface for cfg-impact narration."""
2
+ """Lean provider interface for cfgit-impact narration."""
3
3
  from __future__ import annotations
4
4
 
5
5
  from abc import ABC, abstractmethod
@@ -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 concise JSON with keys: summary (one concrete sentence), behavior_change (what "
53
- "the agent will now do differently, specifically), blast_radius (which named configs or "
54
- "consumers are affected and why), risk_level (low|medium|high), rollback_note, unknowns "
55
- "(array of only real unknowns)."
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,5 +1,5 @@
1
1
  # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
- """Claude provider for cfg-impact narration."""
2
+ """Claude provider for cfgit-impact narration."""
3
3
  from __future__ import annotations
4
4
 
5
5
  import json
@@ -1,5 +1,5 @@
1
1
  # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
- """Factory for cfg-impact LLM providers."""
2
+ """Factory for cfgit-impact LLM providers."""
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import Any
@@ -1,5 +1,5 @@
1
1
  # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
- """Google Gemini provider for cfg-impact narration."""
2
+ """Google Gemini provider for cfgit-impact narration."""
3
3
  from __future__ import annotations
4
4
 
5
5
  import json
@@ -1,5 +1,5 @@
1
1
  # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
- """OpenAI provider for cfg-impact narration."""
2
+ """OpenAI provider for cfgit-impact narration."""
3
3
  from __future__ import annotations
4
4
 
5
5
  import json
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "cfgit-impact"
3
- version = "0.1.0"
3
+ version = "0.1.2"
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.0,<0.2.0",
10
+ "cfgit>=0.1.2,<0.2.0",
11
11
  "httpx>=0.27",
12
12
  ]
13
13