ethernium-continuity-omega 2.1.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.
Files changed (40) hide show
  1. ethernium_continuity_omega-2.1.0/LICENSE +22 -0
  2. ethernium_continuity_omega-2.1.0/PKG-INFO +93 -0
  3. ethernium_continuity_omega-2.1.0/README.md +37 -0
  4. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/__init__.py +1 -0
  5. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/archive_manager.py +77 -0
  6. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/automation_common.py +270 -0
  7. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/bootstrap_context.py +36 -0
  8. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/bootstrap_project.py +167 -0
  9. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/cognitive_map.py +111 -0
  10. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/context_loader.py +160 -0
  11. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/continuity_status.py +76 -0
  12. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/continuity_suggest.py +64 -0
  13. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/decision_engine.py +136 -0
  14. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/discover_project.py +109 -0
  15. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/doc_parity_check.py +127 -0
  16. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/encoding_sanitizer.py +135 -0
  17. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/heal_parity.py +78 -0
  18. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/hook_utils.py +89 -0
  19. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/memory_graph_lite.py +64 -0
  20. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/notify_webhook.py +143 -0
  21. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/omega_engine.py +135 -0
  22. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/run_continuity_cycle.py +18 -0
  23. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/run_continuity_omega.py +200 -0
  24. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/secret_detector.py +49 -0
  25. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/summarize_memory.py +58 -0
  26. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/sync_external_dev_context.py +232 -0
  27. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/sync_translations.py +79 -0
  28. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/system_membership_check.py +68 -0
  29. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/update_memory.py +81 -0
  30. ethernium_continuity_omega-2.1.0/continuity_omega/continuity_legacy/vector_store_lite.py +69 -0
  31. ethernium_continuity_omega-2.1.0/ethernium_continuity_omega.egg-info/PKG-INFO +93 -0
  32. ethernium_continuity_omega-2.1.0/ethernium_continuity_omega.egg-info/SOURCES.txt +38 -0
  33. ethernium_continuity_omega-2.1.0/ethernium_continuity_omega.egg-info/dependency_links.txt +1 -0
  34. ethernium_continuity_omega-2.1.0/ethernium_continuity_omega.egg-info/entry_points.txt +2 -0
  35. ethernium_continuity_omega-2.1.0/ethernium_continuity_omega.egg-info/requires.txt +5 -0
  36. ethernium_continuity_omega-2.1.0/ethernium_continuity_omega.egg-info/top_level.txt +1 -0
  37. ethernium_continuity_omega-2.1.0/pyproject.toml +37 -0
  38. ethernium_continuity_omega-2.1.0/setup.cfg +4 -0
  39. ethernium_continuity_omega-2.1.0/tests/test_omega_logic.py +84 -0
  40. ethernium_continuity_omega-2.1.0/tests/test_parity_logic.py +35 -0
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ethernium (X: @Steveblackbeard)
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.
22
+
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: ethernium-continuity-omega
3
+ Version: 2.1.0
4
+ Summary: Continuity Legacy (Omega): Enterprise Oracle. Advanced RAG, cognitive maps, and proactive impact analysis.
5
+ Author: SteveBlackbeard
6
+ Project-URL: Homepage, https://github.com/SteveBlackbeard/CONTINUITY-LEGACY-by-Ethernium
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: typer[all]>=0.9.0
14
+ Requires-Dist: rich>=13.0.0
15
+ Requires-Dist: chromadb>=0.4.0
16
+ Requires-Dist: networkx>=3.0
17
+ Requires-Dist: sentence-transformers
18
+ Dynamic: license-file
19
+
20
+ # Continuity Omega (v2.1.0) - Enterprise Evolution Oracle
21
+
22
+
23
+
24
+ [![Version](https://img.shields.io/badge/version-2.1.0-blue.svg)](https://github.com/SteveBlackbeard/CONTINUITY-LEGACY-by-Ethernium)
25
+
26
+ [![Requirement](https://img.shields.io/badge/hardware-monster--grade-red.svg)](https://github.com/SteveBlackbeard/CONTINUITY-LEGACY-by-Ethernium)
27
+
28
+
29
+
30
+ **Omega** is the ultimate AI Oracle. It uses Semantic RAG and Cognitive Graphs to protect the project DNA.
31
+
32
+
33
+
34
+ ---
35
+
36
+
37
+
38
+ ## Installation (Quick)
39
+
40
+
41
+
42
+ ```bash
43
+
44
+ # Install the Enterprise edition from its folder
45
+
46
+ pip install -e .
47
+
48
+
49
+
50
+ # Setup the Omega Guardian Entry Point
51
+
52
+ continuity-omega --hook
53
+
54
+ ```
55
+
56
+
57
+
58
+ ---
59
+
60
+
61
+
62
+ ## Minimal Usage
63
+
64
+
65
+
66
+ ```bash
67
+
68
+ # Index and visualize the decision lineage
69
+
70
+ continuity-omega --index --map
71
+
72
+ ```
73
+
74
+
75
+
76
+ ---
77
+
78
+
79
+
80
+ ## Hardware Profile (Technical Monster)
81
+
82
+ - **CPU**: 4-8 Cores (AVX2 recommended).
83
+
84
+ - **RAM**: 8GB+ (16GB Recommended).
85
+
86
+ - **Python**: 3.9+ (Requires chromadb, networkx, sentence-transformers).
87
+
88
+
89
+
90
+ ---
91
+
92
+ *Continuity: Protecting the logical lineage of your software.*
93
+
@@ -0,0 +1,37 @@
1
+ # Continuity Omega (v2.1.0) - Enterprise Evolution Oracle
2
+
3
+ [![Version](https://img.shields.io/badge/version-2.1.0-blue.svg)](https://github.com/SteveBlackbeard/CONTINUITY-LEGACY-by-Ethernium)
4
+ [![Requirement](https://img.shields.io/badge/hardware-monster--grade-red.svg)](https://github.com/SteveBlackbeard/CONTINUITY-LEGACY-by-Ethernium)
5
+
6
+ **Omega** is the ultimate AI Oracle. It uses Semantic RAG and Cognitive Graphs to protect the project DNA.
7
+
8
+ ---
9
+
10
+ ## Installation (Quick)
11
+
12
+ ```bash
13
+ # Install the Enterprise edition from its folder
14
+ pip install -e .
15
+
16
+ # Setup the Omega Guardian Entry Point
17
+ continuity-omega --hook
18
+ ```
19
+
20
+ ---
21
+
22
+ ## Minimal Usage
23
+
24
+ ```bash
25
+ # Index and visualize the decision lineage
26
+ continuity-omega --index --map
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Hardware Profile (Technical Monster)
32
+ - **CPU**: 4-8 Cores (AVX2 recommended).
33
+ - **RAM**: 8GB+ (16GB Recommended).
34
+ - **Python**: 3.9+ (Requires chromadb, networkx, sentence-transformers).
35
+
36
+ ---
37
+ *Continuity: Protecting the logical lineage of your software.*
@@ -0,0 +1 @@
1
+ """Core helpers for Continuity Legacy."""
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ archive_manager.py — CONTINUITY LEGACY Pro
4
+ ==========================================
5
+ Systemic Log Rotation & Context Archiving.
6
+
7
+ Moves historical outputs and oversized log files from .continuity/
8
+ to .continuity/archive/ to prevent context window saturation while
9
+ preserving the project's 'Genetic Code'.
10
+ """
11
+
12
+ import os
13
+ import json
14
+ import shutil
15
+ import datetime
16
+ from pathlib import Path
17
+
18
+ # Config
19
+ MAX_LOG_SIZE_BYTES = 50 * 1024 # 50KB threshold for rotation
20
+ ARCHIVE_DIR_NAME = "archive"
21
+
22
+ def rotate_logs(repo_root: Path):
23
+ print(f"[*] Archive Manager: Evaluating log health in {repo_root}...")
24
+
25
+ continuity_dir = repo_root / ".continuity"
26
+ archive_dir = continuity_dir / ARCHIVE_DIR_NAME
27
+
28
+ if not continuity_dir.exists():
29
+ print("[!] No .continuity directory found. Skipping archiving.")
30
+ return
31
+
32
+ archive_dir.mkdir(parents=True, exist_ok=True)
33
+
34
+ # Files to track for rotation
35
+ targets = [
36
+ "DECISIONS_LOG.md",
37
+ "TIMELINE.md",
38
+ ]
39
+
40
+ for target in targets:
41
+ file_path = continuity_dir / target
42
+ if file_path.exists() and file_path.stat().st_size > MAX_LOG_SIZE_BYTES:
43
+ timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
44
+ archive_name = f"{target.replace('.md', '')}_{timestamp}.md"
45
+ dest_path = archive_dir / archive_name
46
+
47
+ print(f" [>] Rotating {target} (Size: {file_path.stat().st_size} bytes)")
48
+ shutil.copy2(file_path, dest_path)
49
+
50
+ # Reset the active file with a link to the archive
51
+ with open(file_path, "w", encoding="utf-8") as f:
52
+ f.write(f"# {target.replace('.md', '').replace('_', ' ')}\n")
53
+ f.write(f"> [!] LOG ROTATED on {timestamp}. See archive/{archive_name} for history.\n\n")
54
+
55
+ # Cleanup old cycle reports in outputs
56
+ outputs_dir = repo_root / "outputs" / "continuity"
57
+ if outputs_dir.exists():
58
+ # Keep only the last 10 reports, archive the rest? Or just prune.
59
+ # For '' we archive them.
60
+ report_archive = archive_dir / "reports"
61
+ report_archive.mkdir(exist_ok=True)
62
+
63
+ all_reports = sorted(list(outputs_dir.glob("*.json")), key=os.path.getmtime)
64
+ if len(all_reports) > 10:
65
+ to_archive = all_reports[:-10]
66
+ print(f" [>] Archiving {len(to_archive)} historical reports...")
67
+ for r in to_archive:
68
+ shutil.move(str(r), str(report_archive / r.name))
69
+
70
+ print("[✔] Archiving Cycle Complete.")
71
+
72
+ if __name__ == "__main__":
73
+ import argparse
74
+ parser = argparse.ArgumentParser(description="Rotate and archive continuity logs.")
75
+ parser.add_argument("--repo-root", default=".", help="Root directory of the project")
76
+ args = parser.parse_args()
77
+ rotate_logs(Path(args.repo_root).resolve())
@@ -0,0 +1,270 @@
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ from copy import deepcopy
5
+ from datetime import datetime, timezone
6
+ from pathlib import Path
7
+ from typing import Any
8
+
9
+
10
+ class Color:
11
+ """Terminal color constants for standardized elite CLI feedback."""
12
+ PURPLE = "\033[95m"
13
+ CYAN = "\033[96m"
14
+ DARKCYAN = "\033[36m"
15
+ BLUE = "\033[94m"
16
+ GREEN = "\033[92m"
17
+ YELLOW = "\033[93m"
18
+ RED = "\033[91m"
19
+ WHITE = "\033[97m"
20
+ BOLD = "\033[1m"
21
+ UNDERLINE = "\033[4m"
22
+ END = "\033[0m"
23
+
24
+
25
+ def echo(text: str, color: str = "") -> None:
26
+ """Prints text to the console with optional color formatting.
27
+
28
+ Args:
29
+ text: The string to be printed.
30
+ color: The ANSI color code to apply (e.g., Color.GREEN).
31
+ """
32
+ if color:
33
+ print(f"{color}{text}{Color.END}")
34
+ else:
35
+ print(text)
36
+
37
+
38
+ DEFAULT_CONFIG = {
39
+ "template_name": "CONTINUITY LEGACY",
40
+ "project_name": "YOUR_PROJECT",
41
+ "project_slug": "your_project",
42
+ "context_file": "PROJECT_CONTEXT.md",
43
+ "state_file": "STATE.json",
44
+ "roadmap_file": "ROADMAP.md",
45
+ "continuity_dir": ".continuity",
46
+ "outputs_dir": "outputs/continuity",
47
+ "external_docs": {
48
+ "enabled": False,
49
+ "folder_name": "YOUR_PROJECTDEV",
50
+ "root_override": "",
51
+ },
52
+ "metadata": {
53
+ "generated_by": "Continuity Legacy by Ethernium",
54
+ "tool_version": "5.0.0",
55
+ "creator": "@Steveblackbeard",
56
+ "include_in_reports": True,
57
+ },
58
+ }
59
+
60
+ ALLOWED_MEMBERSHIP_STATUSES = [
61
+ "canonical",
62
+ "bridge",
63
+ "archive_source",
64
+ "external_optional",
65
+ ]
66
+
67
+
68
+ def utc_now_iso() -> str:
69
+ return datetime.now(timezone.utc).isoformat()
70
+
71
+
72
+ def resolve_repo_root(repo_root: str | Path | None, current_file: str | Path) -> Path:
73
+ if repo_root:
74
+ resolved = Path(repo_root).resolve()
75
+ else:
76
+ resolved = Path(current_file).resolve().parents[2]
77
+
78
+ if not (resolved / "continuity_legacy.json").exists() and not (resolved / ".continuity").exists():
79
+ raise ValueError(f"Security Warning: Path '{resolved}' does not appear to be a CONTINUITY LEGACY repository.")
80
+
81
+ return resolved
82
+
83
+
84
+ def load_config(repo_root: Path) -> dict:
85
+ """Loads and merges the continuity-legacy.json configuration.
86
+
87
+ Args:
88
+ repo_root: The filesystem path to the root of the project.
89
+
90
+ Returns:
91
+ A dictionary containing the merged project configuration.
92
+ """
93
+ config_file = repo_root / "continuity-legacy.json"
94
+ payload = {}
95
+ if config_file.exists():
96
+ payload = json.loads(config_file.read_text(encoding="utf-8"))
97
+
98
+ return _deep_merge(DEFAULT_CONFIG, payload)
99
+
100
+
101
+ def save_config(repo_root: Path, config: dict) -> None:
102
+ """Saves the continuity-legacy.json configuration to the repository root.
103
+
104
+ Args:
105
+ repo_root: The filesystem path to the root of the project.
106
+ config: The configuration dictionary to persist.
107
+ """
108
+ config_file = repo_root / "continuity-legacy.json"
109
+ config_file.write_text(json.dumps(config, indent=2), encoding="utf-8")
110
+
111
+
112
+ def config_path(repo_root: str | Path) -> Path:
113
+ return Path(repo_root) / "continuity_legacy.json"
114
+
115
+
116
+ def read_text(path: str | Path) -> str:
117
+ return Path(path).read_text(encoding="utf-8", errors="ignore")
118
+
119
+
120
+ def write_text(path: str | Path, content: str) -> None:
121
+ target = Path(path)
122
+ target.parent.mkdir(parents=True, exist_ok=True)
123
+ target.write_text(content.rstrip() + "\n", encoding="utf-8")
124
+
125
+
126
+ def read_json(path: str | Path, default: Any | None = None) -> Any:
127
+ file_path = Path(path)
128
+ if not file_path.exists():
129
+ return deepcopy(default)
130
+ return json.loads(file_path.read_text(encoding="utf-8"))
131
+
132
+
133
+ def write_json(path: str | Path, payload: Any) -> None:
134
+ target = Path(path)
135
+ target.parent.mkdir(parents=True, exist_ok=True)
136
+ target.write_text(json.dumps(payload, indent=2, ensure_ascii=True), encoding="utf-8")
137
+
138
+
139
+ def _deep_merge(base: dict[str, Any], override: dict[str, Any]) -> dict[str, Any]:
140
+ merged = deepcopy(base)
141
+ for key, value in override.items():
142
+ if isinstance(value, dict) and isinstance(merged.get(key), dict):
143
+ merged[key] = _deep_merge(merged[key], value)
144
+ else:
145
+ merged[key] = value
146
+ return merged
147
+
148
+
149
+ def build_context_snapshot(repo_root: Path, external_root_override: Path | None = None) -> dict:
150
+ """Builds a comprehensive snapshot of the project context from multiple sources.
151
+
152
+ Args:
153
+ repo_root: The root directory of the project.
154
+ external_root_override: Optional path to an external documentation root.
155
+
156
+ Returns:
157
+ A dictionary containing the aggregated 'truth' of the project.
158
+ """
159
+ config = load_config(repo_root)
160
+ state = read_json(state_path(repo_root, config), {})
161
+ context_text = read_text(context_path(repo_root, config))
162
+ roadmap_text = read_text(roadmap_path(repo_root, config))
163
+
164
+ return {
165
+ "project_name": config.get("project_name"),
166
+ "project_slug": config.get("project_slug"),
167
+ "phase": state.get("status", "unknown"),
168
+ "next_actions": state.get("next_actions", []),
169
+ "context_summary": context_text[:2000],
170
+ "roadmap_summary": roadmap_text[:2000],
171
+ "last_decision": state.get("last_decision", "none"),
172
+ "timestamp": utc_now_iso(),
173
+ }
174
+
175
+
176
+ def context_path(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
177
+ config = config or load_config(repo_root)
178
+ return Path(repo_root) / config["context_file"]
179
+
180
+
181
+ def state_path(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
182
+ config = config or load_config(repo_root)
183
+ return Path(repo_root) / config["state_file"]
184
+
185
+
186
+ def roadmap_path(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
187
+ config = config or load_config(repo_root)
188
+ return Path(repo_root) / config["roadmap_file"]
189
+
190
+
191
+ def continuity_dir(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
192
+ config = config or load_config(repo_root)
193
+ return Path(repo_root) / config["continuity_dir"]
194
+
195
+
196
+ def continuity_doc_path(repo_root: str | Path, name: str, config: dict[str, Any] | None = None) -> Path:
197
+ return continuity_dir(repo_root, config) / name
198
+
199
+
200
+ def outputs_dir(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
201
+ config = config or load_config(repo_root)
202
+ return Path(repo_root) / config["outputs_dir"]
203
+
204
+
205
+ def bootstrap_output_path(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
206
+ return outputs_dir(repo_root, config) / "context_bootstrap_summary.json"
207
+
208
+
209
+ def continuity_report_path(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
210
+ return outputs_dir(repo_root, config) / "continuity_cycle_report.json"
211
+
212
+
213
+ def dependency_map_path(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
214
+ return continuity_dir(repo_root, config) / "registry" / "document_dependency_map.json"
215
+
216
+
217
+ def membership_registry_path(repo_root: str | Path, config: dict[str, Any] | None = None) -> Path:
218
+ return continuity_dir(repo_root, config) / "registry" / "system_membership_registry.json"
219
+
220
+
221
+ def load_dependency_map(repo_root: str | Path, config: dict[str, Any] | None = None) -> dict[str, Any]:
222
+ return read_json(dependency_map_path(repo_root, config), {"version": "1.0", "documents": []}) or {
223
+ "version": "1.0",
224
+ "documents": [],
225
+ }
226
+
227
+
228
+ def load_membership_registry(repo_root: str | Path, config: dict[str, Any] | None = None) -> dict[str, Any]:
229
+ return read_json(
230
+ membership_registry_path(repo_root, config),
231
+ {
232
+ "version": "1.0",
233
+ "allowed_statuses": ALLOWED_MEMBERSHIP_STATUSES,
234
+ "entries": [],
235
+ },
236
+ ) or {
237
+ "version": "1.0",
238
+ "allowed_statuses": ALLOWED_MEMBERSHIP_STATUSES,
239
+ "entries": [],
240
+ }
241
+
242
+
243
+ def is_ignored(repo_root: str | Path, rel_path: str) -> bool:
244
+ ignore_file = Path(repo_root) / ".continuityignore"
245
+ if not ignore_file.exists():
246
+ return False
247
+
248
+ import fnmatch
249
+ patterns = [line.strip() for line in ignore_file.read_text(encoding="utf-8").splitlines() if line.strip() and not line.startswith("#")]
250
+ for pattern in patterns:
251
+ if fnmatch.fnmatch(rel_path, pattern):
252
+ return True
253
+ return False
254
+
255
+
256
+ def external_root(
257
+ repo_root: str | Path,
258
+ config: dict[str, Any] | None = None,
259
+ override: str | Path | None = None,
260
+ ) -> Path | None:
261
+ config = config or load_config(repo_root)
262
+ external_cfg = config.get("external_docs", {})
263
+ if override:
264
+ return Path(override).resolve()
265
+ root_override = str(external_cfg.get("root_override") or "").strip()
266
+ if root_override:
267
+ return Path(root_override).resolve()
268
+ if not external_cfg.get("enabled"):
269
+ return None
270
+ return Path(repo_root).resolve().parent / str(external_cfg.get("folder_name") or "PROJECTDEV")
@@ -0,0 +1,36 @@
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ import json
5
+ from pathlib import Path
6
+
7
+ from core.automation_common import bootstrap_output_path, resolve_repo_root
8
+ from core.context_loader import build_context_snapshot, summarize_snapshot
9
+
10
+
11
+ def parse_args() -> argparse.Namespace:
12
+ parser = argparse.ArgumentParser(description="Build a continuity snapshot for the current project.")
13
+ parser.add_argument("--repo-root", default=None)
14
+ parser.add_argument("--output-json", default=None)
15
+ parser.add_argument("--external-root", default=None)
16
+ parser.add_argument("--no-print", action="store_true")
17
+ return parser.parse_args()
18
+
19
+
20
+ def main() -> None:
21
+ args = parse_args()
22
+ repo_root = resolve_repo_root(args.repo_root, __file__)
23
+ snapshot = build_context_snapshot(repo_root, args.external_root)
24
+ output_path = bootstrap_output_path(repo_root)
25
+ if args.output_json:
26
+ output_path = Path(args.output_json)
27
+ if not output_path.is_absolute():
28
+ output_path = repo_root / output_path
29
+ output_path.parent.mkdir(parents=True, exist_ok=True)
30
+ output_path.write_text(json.dumps(snapshot, indent=2, ensure_ascii=True), encoding="utf-8")
31
+ if not args.no_print:
32
+ print(summarize_snapshot(snapshot))
33
+
34
+
35
+ if __name__ == "__main__":
36
+ main()