okstra 0.233.0 → 0.234.0

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 (30) hide show
  1. package/dist/cli-registry.mjs +6 -0
  2. package/dist/cli-registry.mjs.map +1 -1
  3. package/docs/architecture/storage-model.md +19 -0
  4. package/docs/cli.md +41 -1
  5. package/docs/project-structure-overview.md +3 -2
  6. package/package.json +1 -1
  7. package/runtime/BUILD.json +2 -2
  8. package/runtime/python/okstra_ctl/business_flow/cli.py +60 -6
  9. package/runtime/python/okstra_ctl/business_flow/contracts.py +12 -1
  10. package/runtime/python/okstra_ctl/business_flow/engine.py +17 -5
  11. package/runtime/python/okstra_ctl/business_flow/history.py +60 -0
  12. package/runtime/python/okstra_ctl/business_flow/source.py +35 -2
  13. package/runtime/python/okstra_ctl/business_flow/store.py +51 -14
  14. package/runtime/python/okstra_ctl/business_flow/sweep.py +124 -0
  15. package/runtime/python/okstra_ctl/doyouknow/cli.py +9 -9
  16. package/runtime/python/okstra_ctl/doyouknow/config.py +2 -2
  17. package/runtime/python/okstra_ctl/doyouknow/group_view.py +152 -0
  18. package/runtime/python/okstra_ctl/doyouknow/source_contracts.py +4 -3
  19. package/runtime/python/okstra_ctl/doyouknow/source_store.py +2 -2
  20. package/runtime/python/okstra_ctl/doyouknow/sources/business.py +116 -0
  21. package/runtime/python/okstra_ctl/doyouknow/sync.py +34 -9
  22. package/runtime/python/okstra_ctl/fixed_text.py +10 -0
  23. package/runtime/python/okstra_ctl/project_group.py +175 -0
  24. package/runtime/python/okstra_ctl/project_group_cli.py +62 -0
  25. package/runtime/schemas/business-flow-v1.schema.json +3 -0
  26. package/runtime/schemas/doyouknow-config-v1.schema.json +1 -1
  27. package/runtime/skills/okstra-explain-flow/SKILL.md +27 -2
  28. package/runtime/templates/doyouknow/group-view.css +103 -0
  29. package/runtime/templates/doyouknow/group-view.js +317 -0
  30. package/runtime/templates/doyouknow/group-view.template.html +72 -0
@@ -1,16 +1,18 @@
1
1
  from __future__ import annotations
2
2
 
3
- from collections.abc import Iterator
3
+ from collections.abc import Callable, Iterator
4
4
  from functools import partial
5
5
  from pathlib import Path
6
6
 
7
7
  from ..json_boundary import JsonBoundaryError
8
+ from ..project_group import group_project_roots
8
9
  from .config import SourceConfig, load_config
9
10
  from .contracts import DoyouknowError
10
11
  from .identity import stable_id
11
12
  from .registration import retry_pending, validate_source_and_update_refusal_cache
12
13
  from .source_contracts import SourceDomain, SourceKind, SourceScan
13
14
  from .source_store import apply_source_scan
15
+ from .sources.business import scan_business_flows
14
16
  from .sources.manager import scan_managers
15
17
  from .sources.memory import scan_memory_sources
16
18
  from .sources.task import scan_project_tasks
@@ -26,14 +28,37 @@ def _source_scans(home: Path, settings: SourceConfig) -> Iterator[SourceScan]:
26
28
  managers, projects = scan_managers(home, settings, gate=gate)
27
29
  yield from managers
28
30
  if "task" in enabled:
29
- registry_unavailable = any(scan.status == "unavailable" for scan in managers)
30
- for project_id, roots in sorted(projects.items()):
31
- if registry_unavailable:
32
- yield SourceScan(SourceDomain("task", project_id), (), (), "unavailable", ("project-registry-incomplete",))
33
- elif len(roots) != 1:
34
- yield SourceScan(SourceDomain("task", project_id), (), (), "unavailable", ("conflicting-project-roots",))
35
- else:
36
- yield scan_project_tasks(roots[0], project_id, settings)
31
+ incomplete = "project-registry-incomplete" if any(scan.status == "unavailable" for scan in managers) else None
32
+ yield from _project_scans("task", projects, incomplete, partial(_scan_with, scan_project_tasks, settings))
33
+ if "business" in enabled:
34
+ projects, registry_errors = group_project_roots(home)
35
+ incomplete = "project-group-registry-incomplete" if registry_errors else None
36
+ if incomplete:
37
+ # Reported on its own domain as well: with no readable group there is no project to carry it.
38
+ yield SourceScan(SourceDomain("business", "project-group-registry"), (), (), "unavailable", (incomplete,))
39
+ yield from _project_scans("business", projects, incomplete, partial(_scan_with, scan_business_flows, settings))
40
+
41
+
42
+ def _scan_with(scan: Callable[[Path, str, SourceConfig], SourceScan], settings: SourceConfig, root: Path, project_id: str) -> SourceScan:
43
+ return scan(root, project_id, settings)
44
+
45
+
46
+ def _project_scans(
47
+ kind: SourceKind, projects: dict[str, tuple[Path, ...]], incomplete: str | None, scan: Callable[[Path, str], SourceScan],
48
+ ) -> Iterator[SourceScan]:
49
+ """Scan each project under its one registered root.
50
+
51
+ A complete scan marks sources it did not see as missing, and one root is only known
52
+ to be the only root when the whole registry was read, so an incomplete registry
53
+ scans nothing.
54
+ """
55
+ for project_id, roots in sorted(projects.items()):
56
+ if incomplete:
57
+ yield SourceScan(SourceDomain(kind, project_id), (), (), "unavailable", (incomplete,))
58
+ elif len(roots) != 1:
59
+ yield SourceScan(SourceDomain(kind, project_id), (), (), "unavailable", ("conflicting-project-roots",))
60
+ else:
61
+ yield scan(roots[0], project_id)
37
62
 
38
63
 
39
64
  def sync_sources(*, home: Path | None = None, source: SourceKind | None = None) -> dict:
@@ -52,6 +52,16 @@ def value_lines(label: str, value: object) -> list[str]:
52
52
  return _value_lines(label, value, line)
53
53
 
54
54
 
55
+ def emit_result(payload: dict, *, text: bool, title: str) -> None:
56
+ """Print a command result as one JSON line, or as fixed text fields under `title`."""
57
+ if not text:
58
+ print(json.dumps(payload, ensure_ascii=False, allow_nan=False))
59
+ return
60
+ rows = [f"{title}\n", line("OK", payload["ok"])]
61
+ rows.extend(value_lines("Result", payload))
62
+ print("".join(rows), end="")
63
+
64
+
55
65
  def _quoted_scalar_line(label: str, value: object) -> str:
56
66
  return _line_prefix(label) + json.dumps(value, ensure_ascii=True) + "\n"
57
67
 
@@ -0,0 +1,175 @@
1
+ """Project-group registry: the project roots that belong to a named group."""
2
+ from __future__ import annotations
3
+
4
+ from datetime import datetime, timezone
5
+ from pathlib import Path
6
+
7
+ from okstra_project import ResolverError, upsert_project_json
8
+ from okstra_project.dirs import json_lock_path, registry_lock
9
+
10
+ from .json_boundary import JsonBoundaryError, load_owned_object, write_owned_object_atomic
11
+ from .manager_paths import ManagerPathError, _slug_segment
12
+
13
+ ARTIFACT = "project group"
14
+
15
+
16
+ class ProjectGroupError(ValueError):
17
+ """Project-group validation or I/O failure."""
18
+
19
+
20
+ def groups_root(home: Path) -> Path:
21
+ return Path(home) / "project-groups"
22
+
23
+
24
+ def group_path(home: Path, name: str) -> Path:
25
+ try:
26
+ segment = _slug_segment(name, "project-group")
27
+ except ManagerPathError as exc:
28
+ raise ProjectGroupError(str(exc)) from exc
29
+ return groups_root(home) / f"{segment}.json"
30
+
31
+
32
+ def _now_iso() -> str:
33
+ return datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
34
+
35
+
36
+ def _read_file(path: Path) -> dict:
37
+ try:
38
+ data = load_owned_object(path, artifact=ARTIFACT)
39
+ except JsonBoundaryError as exc:
40
+ raise ProjectGroupError(str(exc)) from exc
41
+ projects = data.get("projects")
42
+ if not isinstance(data.get("projectGroup"), str) or not isinstance(projects, list) or not all(
43
+ isinstance(row, dict)
44
+ and isinstance(row.get("projectId"), str)
45
+ and isinstance(row.get("projectRoot"), str)
46
+ for row in projects
47
+ ):
48
+ raise ProjectGroupError(f"malformed project group file: {path}")
49
+ return data
50
+
51
+
52
+ def _write_file(path: Path, data: dict) -> None:
53
+ try:
54
+ write_owned_object_atomic(path, data, artifact=ARTIFACT)
55
+ except JsonBoundaryError as exc:
56
+ raise ProjectGroupError(str(exc)) from exc
57
+
58
+
59
+ def _load(path: Path, name: str) -> dict:
60
+ data = _read_file(path)
61
+ # Different names can share one slug, and the file belongs to the first name stored in it.
62
+ if data["projectGroup"] != name:
63
+ raise ProjectGroupError(
64
+ f"project-group {name!r} shares its file with existing group "
65
+ f"{data['projectGroup']!r}: {path}"
66
+ )
67
+ return data
68
+
69
+
70
+ def read_group(home: Path, name: str) -> dict:
71
+ name = name.strip()
72
+ path = group_path(home, name)
73
+ if not path.is_file():
74
+ raise ProjectGroupError(f"unknown project-group: {name}")
75
+ return _load(path, name)
76
+
77
+
78
+ def add_project(
79
+ home: Path, name: str, project_id: str, project_root: Path, *, now: str | None = None
80
+ ) -> dict:
81
+ name = name.strip()
82
+ path = group_path(home, name)
83
+ root = Path(project_root).resolve()
84
+ if not root.is_dir():
85
+ raise ProjectGroupError(f"projectRoot is not a directory: {root}")
86
+ when = now or _now_iso()
87
+ with registry_lock(json_lock_path(path)):
88
+ data = (
89
+ _load(path, name)
90
+ if path.is_file()
91
+ else {"schemaVersion": 1, "projectGroup": name, "createdAt": when, "projects": []}
92
+ )
93
+ entry = next((row for row in data["projects"] if row["projectId"] == project_id), None)
94
+ changed = entry is None or entry.get("projectRoot") != str(root)
95
+ if changed:
96
+ try:
97
+ upsert_project_json(root, project_id, now=when)
98
+ except ResolverError as exc:
99
+ raise ProjectGroupError(str(exc)) from exc
100
+ if entry is None:
101
+ data["projects"].append(
102
+ {"projectId": project_id, "projectRoot": str(root), "linkedAt": when}
103
+ )
104
+ elif changed:
105
+ entry["projectRoot"] = str(root)
106
+ if changed:
107
+ data["projects"].sort(key=lambda row: row["projectId"])
108
+ _write_file(path, data)
109
+ return {
110
+ "ok": True,
111
+ "projectGroup": name,
112
+ "projectId": project_id,
113
+ "projectRoot": str(root),
114
+ "added": entry is None,
115
+ "changed": changed,
116
+ }
117
+
118
+
119
+ def remove_project(home: Path, name: str, project_id: str) -> dict:
120
+ name = name.strip()
121
+ path = group_path(home, name)
122
+ with registry_lock(json_lock_path(path)):
123
+ data = read_group(home, name)
124
+ kept = [row for row in data["projects"] if row["projectId"] != project_id]
125
+ if len(kept) == len(data["projects"]):
126
+ raise ProjectGroupError(f"project {project_id} is not in project-group {name}")
127
+ data["projects"] = kept
128
+ _write_file(path, data)
129
+ return {"ok": True, "projectGroup": name, "projectId": project_id, "removed": True}
130
+
131
+
132
+ def show_group(home: Path, name: str) -> dict:
133
+ data = read_group(home, name)
134
+ return {
135
+ "ok": True,
136
+ "projectGroup": data["projectGroup"],
137
+ "createdAt": str(data.get("createdAt") or ""),
138
+ "projects": [
139
+ {**row, "rootExists": Path(str(row.get("projectRoot") or "")).is_dir()}
140
+ for row in data["projects"]
141
+ ],
142
+ }
143
+
144
+
145
+ def _read_all(home: Path) -> tuple[list[dict], list[str]]:
146
+ groups, errors = [], []
147
+ groups_dir = groups_root(home)
148
+ for path in sorted(groups_dir.glob("*.json")) if groups_dir.is_dir() else []:
149
+ try:
150
+ groups.append(_read_file(path))
151
+ except ProjectGroupError as exc:
152
+ errors.append(f"{path.name}: {exc}")
153
+ return groups, errors
154
+
155
+
156
+ def list_groups(home: Path) -> dict:
157
+ groups, errors = _read_all(home)
158
+ return {
159
+ "ok": not errors,
160
+ "groups": [
161
+ {"projectGroup": data["projectGroup"], "projectCount": len(data["projects"])}
162
+ for data in groups
163
+ ],
164
+ "errors": errors,
165
+ }
166
+
167
+
168
+ def group_project_roots(home: Path) -> tuple[dict[str, tuple[Path, ...]], list[str]]:
169
+ """Every root the groups register for each projectId, and the unreadable group files."""
170
+ groups, errors = _read_all(home)
171
+ roots: dict[str, set[Path]] = {}
172
+ for data in groups:
173
+ for row in data["projects"]:
174
+ roots.setdefault(row["projectId"], set()).add(Path(row["projectRoot"]).resolve())
175
+ return {project_id: tuple(sorted(found)) for project_id, found in roots.items()}, errors
@@ -0,0 +1,62 @@
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ from pathlib import Path
5
+
6
+ from okstra_project.dirs import okstra_home
7
+
8
+ from .fixed_text import emit_result
9
+ from .project_group import (
10
+ ProjectGroupError,
11
+ add_project,
12
+ list_groups,
13
+ remove_project,
14
+ show_group,
15
+ )
16
+
17
+
18
+ def _parser() -> argparse.ArgumentParser:
19
+ parser = argparse.ArgumentParser(
20
+ prog="okstra project-group",
21
+ description="Register which project roots belong to a named project group.",
22
+ )
23
+ commands = parser.add_subparsers(dest="command", required=True)
24
+ for name in ("add", "remove", "show", "list"):
25
+ command = commands.add_parser(name)
26
+ if name != "list":
27
+ command.add_argument("--project-group", required=True)
28
+ if name in ("add", "remove"):
29
+ command.add_argument("--project-id", required=True)
30
+ if name == "add":
31
+ command.add_argument("--project-root", required=True, type=Path)
32
+ output = command.add_mutually_exclusive_group()
33
+ output.add_argument("--json", action="store_true", help="emit JSON (default)")
34
+ output.add_argument("--text", action="store_true", help="emit fixed text fields")
35
+ return parser
36
+
37
+
38
+ def _emit(payload: dict, *, text: bool) -> None:
39
+ emit_result(payload, text=text, title="Okstra project-group")
40
+
41
+
42
+ def main(argv: list[str] | None = None) -> int:
43
+ args = _parser().parse_args(argv)
44
+ home = okstra_home()
45
+ try:
46
+ if args.command == "add":
47
+ result = add_project(home, args.project_group, args.project_id, args.project_root)
48
+ elif args.command == "remove":
49
+ result = remove_project(home, args.project_group, args.project_id)
50
+ elif args.command == "show":
51
+ result = show_group(home, args.project_group)
52
+ else:
53
+ result = list_groups(home)
54
+ except (ProjectGroupError, OSError) as exc:
55
+ _emit({"ok": False, "reason": str(exc)}, text=args.text)
56
+ return 1
57
+ _emit(result, text=args.text)
58
+ return 0 if result["ok"] else 1
59
+
60
+
61
+ if __name__ == "__main__":
62
+ raise SystemExit(main())
@@ -749,6 +749,9 @@
749
749
  "host_runtime": {
750
750
  "type": "string",
751
751
  "minLength": 1
752
+ },
753
+ "project_group": {
754
+ "type": "string"
752
755
  }
753
756
  }
754
757
  },
@@ -7,7 +7,7 @@
7
7
  "schemaVersion": {"type": "integer", "const": 1},
8
8
  "autoRegister": {"type": "boolean"},
9
9
  "scope": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/text"}]},
10
- "sources": {"type": "array", "uniqueItems": true, "items": {"enum": ["memory", "manager", "task"]}},
10
+ "sources": {"type": "array", "uniqueItems": true, "items": {"enum": ["memory", "manager", "task", "business"]}},
11
11
  "includeProjects": {"$ref": "#/$defs/names"},
12
12
  "excludeProjects": {"$ref": "#/$defs/names"},
13
13
  "includeGroups": {"$ref": "#/$defs/names"},
@@ -19,12 +19,37 @@ Resolve `<host-runtime>` from the launcher's `OKSTRA_RUNTIME_HOST` when present;
19
19
 
20
20
  The runtime owns operation/model resolution, auditable invocation preparation, provider execution, source snapshots, validated result publication, shared knowledge and reports. Do not dispatch an unaudited replacement investigator or rerun an entire task when only an explanation failed.
21
21
 
22
+ By default the candidate projects are every project okstra has run in. When the user names a product or organization whose projects are registered as a project group (`okstra project-group list`), add `--project-group <name>`. The investigation then inspects that group's registered projects plus the current project, and the knowledge it receives is the claims those projects own. A claim's conflict status is still judged against every known project, so a conflict with a project outside the group is reported and reconciled across both. An unknown group fails the explanation; do not retry without the flag unless the user asks for the wider scope.
23
+
22
24
  For relevant stored knowledge:
23
25
 
24
26
  ```sh
25
- okstra explain-flow knowledge --query "<business question>"
27
+ okstra explain-flow knowledge --query "<business question>" [--project-group <name>]
26
28
  ```
27
29
 
30
+ ## Sweep a project group
31
+
32
+ Use this when the user wants the business flows of a whole project group explained, or stored explanations brought up to date. It runs one investigation per question, so the cost grows with the number of targets.
33
+
34
+ 1. List the group's projects with `okstra project-group show --project-group <name>`.
35
+ 2. Propose the questions. Read each member project's entry points, routes, jobs and top-level modules (read-only) and name one question per business domain, each owned by the project where the flow starts. Show the user the list and change it until they confirm it. Do not invent questions for a project you did not read.
36
+ 3. Write the confirmed list to a file as a JSON array of `{"projectId": "<member>", "question": "<business question>"}`.
37
+ 4. Plan first. This calls no model:
38
+
39
+ ```sh
40
+ okstra explain-flow sweep --project-group <name> --questions <file> [--stale]
41
+ ```
42
+
43
+ A listed question is a target unless its newest explanation is still `current`. Each target carries its reason: `new` (never explained), `historical` (a recorded project changed since) or `unverified` (a recorded source version cannot be compared, for example a member that is not a Git repository or tracks a symbolic link). An `unverified` question stays a target on every sweep, even right after it was explained. `--stale` adds every stored explanation that is `historical`; `--stale` alone refreshes without new questions. Report the target count with its reasons, the questions skipped as current, and every `Problem` line to the user. A `Problem` line can name a listed question that was not planned.
44
+ 5. Run only after the user accepts the target count:
45
+
46
+ ```sh
47
+ okstra explain-flow sweep --project-group <name> --questions <file> [--stale] --run --report-language <reader language> --host-runtime <current host runtime>
48
+ ```
49
+
50
+ Targets run one after another under the group, and a failed one does not stop the rest; the command exits 1 when any failed. A failed target printed with `(no record)` failed before its execution record was written. To retry one recorded target, run `okstra explain-flow rerun --execution <execution-id> --project-root <that member's root>`; the plan's JSON output lists each member's root under `roots`. To retry several, go back to step 4: plan again, report the new target count and run only after the user accepts it. Do not repeat `--run` on the earlier count, because `unverified` questions are targets again.
51
+ 6. To show the result, run `okstra doyouknow sync --source business` and then `okstra doyouknow view --project-group <name>`.
52
+
28
53
  For a failed or partial explanation:
29
54
 
30
55
  ```sh
@@ -43,4 +68,4 @@ Read the returned human report. Explain the business findings, verified scope an
43
68
 
44
69
  The investigation reads source, configuration, test bodies and explicitly supplied existing results. Its policy forbids executing tests, starting services, deploying, migrating or editing investigated projects. The report distinguishes that policy and the before/after source audit from an enforced write boundary. A report and a shared fact use the same accepted evidence. New runs retain prior reports and source baselines.
45
70
 
46
- Enforcement: `business_flow.engine` validates the result schema, source evidence and source stability before contribution; `agent.invocation` verifies standalone completion; `business_flow.store` preserves claim provenance and source versions. These behaviors are covered by the retired Python suite and existing invocation/JSON-boundary contract tests.
71
+ Enforcement: `business_flow.source.candidate_projects` selects the investigated projects and `business_flow.store.query_knowledge` the returned claims, covered by `tests/run/test_business_flow_invocation.py`; `business_flow.sweep.plan_sweep` decides the sweep targets, covered by `tests/doyouknow/test_explain_flow_sweep.py`; `business_flow.engine` validates the result schema, source evidence and source stability before contribution; `agent.invocation` verifies standalone completion; `business_flow.store` preserves claim provenance and source versions. These behaviors are covered by the retired Python suite and existing invocation/JSON-boundary contract tests.
@@ -0,0 +1,103 @@
1
+ :root {
2
+ --bg: #f7f7f5;
3
+ --panel: #ffffff;
4
+ --text: #1f2328;
5
+ --muted: #5f6670;
6
+ --line: #d9dbde;
7
+ --accent: #0969da;
8
+ --current: #1a7f37;
9
+ --historical: #9a6700;
10
+ --unverified: #6e7781;
11
+ --call: #0969da;
12
+ --event: #8250df;
13
+ --queue: #bf3989;
14
+ --shared-data: #1a7f37;
15
+ --file: #9a6700;
16
+ --batch: #cf222e;
17
+ }
18
+ @media (prefers-color-scheme: dark) {
19
+ :root {
20
+ --bg: #111418;
21
+ --panel: #1a1f25;
22
+ --text: #e6e8eb;
23
+ --muted: #9aa3ad;
24
+ --line: #2f363e;
25
+ --accent: #58a6ff;
26
+ --current: #3fb950;
27
+ --historical: #d29922;
28
+ --unverified: #8b949e;
29
+ --call: #58a6ff;
30
+ --event: #a371f7;
31
+ --queue: #db61a2;
32
+ --shared-data: #3fb950;
33
+ --file: #d29922;
34
+ --batch: #f85149;
35
+ }
36
+ }
37
+ * { box-sizing: border-box; }
38
+ body {
39
+ margin: 0;
40
+ background: var(--bg);
41
+ color: var(--text);
42
+ font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
43
+ }
44
+ main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
45
+ header h1 { margin: 0 0 4px; font-size: 22px; }
46
+ .meta { color: var(--muted); font-size: 13px; }
47
+ .hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
48
+ .empty { color: var(--muted); }
49
+ section { margin-top: 28px; }
50
+ h2 { font-size: 17px; margin: 0 0 10px; }
51
+ h3 { font-size: 14px; margin: 14px 0 6px; }
52
+ .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
53
+ .scroll { overflow-x: auto; }
54
+ table { width: 100%; border-collapse: collapse; }
55
+ th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
56
+ th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
57
+ code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
58
+ ul.plain { margin: 0; padding-left: 18px; }
59
+
60
+ .graph svg { width: 100%; height: auto; display: block; }
61
+ .graph .node circle { fill: var(--panel); stroke: var(--text); stroke-width: 1.5; cursor: pointer; }
62
+ .graph .node.outside circle { stroke-dasharray: 3 3; stroke: var(--muted); }
63
+ .graph .node.uninvestigated circle { fill: var(--bg); }
64
+ .graph .node.selected circle { stroke: var(--accent); stroke-width: 3; }
65
+ .graph .node text { fill: var(--text); font-size: 12px; text-anchor: middle; pointer-events: none; }
66
+ .graph .edge { fill: none; stroke-width: 1.8; cursor: pointer; }
67
+ .graph .edge.candidate { stroke-dasharray: 5 4; }
68
+ .graph .edge.dimmed { opacity: 0.15; }
69
+ .graph .edge.call, .legend .call { stroke: var(--call); color: var(--call); }
70
+ .graph .edge.event, .legend .event { stroke: var(--event); color: var(--event); }
71
+ .graph .edge.queue, .legend .queue { stroke: var(--queue); color: var(--queue); }
72
+ .graph .edge.shared-data, .legend .shared-data { stroke: var(--shared-data); color: var(--shared-data); }
73
+ .graph .edge.file, .legend .file { stroke: var(--file); color: var(--file); }
74
+ .graph .edge.batch, .legend .batch { stroke: var(--batch); color: var(--batch); }
75
+ .legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; font-size: 12px; }
76
+ .legend li::before { content: "━ "; }
77
+
78
+ .filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 12px; }
79
+ .filters input, .filters select {
80
+ font: inherit; color: var(--text); background: var(--panel);
81
+ border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
82
+ }
83
+ .filters input { min-width: 280px; }
84
+
85
+ details.flow { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
86
+ details.flow > summary { cursor: pointer; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
87
+ details.flow > summary .name { font-weight: 600; }
88
+ details.flow > .body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
89
+ .chip { border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; font-size: 12px; white-space: nowrap; }
90
+ .chip.current { color: var(--current); }
91
+ .chip.historical { color: var(--historical); }
92
+ .chip.unverified, .chip.partial { color: var(--unverified); }
93
+ .chip.complete { color: var(--muted); }
94
+ ol.steps { margin: 0; padding-left: 20px; }
95
+ ol.steps > li { margin-bottom: 12px; }
96
+ ol.steps .step-title { font-weight: 600; }
97
+ dl.fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 6px 0 0; font-size: 13px; }
98
+ dl.fields dt { color: var(--muted); }
99
+ dl.fields dd { margin: 0; }
100
+ dl.terms dt { font-weight: 600; margin-top: 6px; }
101
+ dl.terms dd { margin: 0; }
102
+ ul.facts { margin: 0; padding-left: 18px; }
103
+ ul.facts li { margin-bottom: 6px; }