sim-cli-core 0.3.5__py3-none-any.whl → 0.3.7__py3-none-any.whl
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.
- sim/_plugin_install.py +75 -255
- sim/_skills/sim-cli/SKILL.md +94 -0
- sim/_skills/sim-cli/gui/SKILL.md +239 -0
- sim/_skills/sim-cli/gui/snippets/dismiss_named_dialog.py +19 -0
- sim/cli.py +36 -119
- sim/compat.py +13 -16
- sim/describe.py +10 -27
- sim/driver.py +1 -1
- sim/gui/__init__.py +1 -1
- sim/inspect.py +2 -2
- sim/plugins.py +37 -21
- sim/server.py +1 -1
- {sim_cli_core-0.3.5.dist-info → sim_cli_core-0.3.7.dist-info}/METADATA +76 -99
- sim_cli_core-0.3.7.dist-info/RECORD +31 -0
- sim/plugin_catalog.py +0 -232
- sim_cli_core-0.3.5.dist-info/RECORD +0 -29
- {sim_cli_core-0.3.5.dist-info → sim_cli_core-0.3.7.dist-info}/WHEEL +0 -0
- {sim_cli_core-0.3.5.dist-info → sim_cli_core-0.3.7.dist-info}/entry_points.txt +0 -0
- {sim_cli_core-0.3.5.dist-info → sim_cli_core-0.3.7.dist-info}/licenses/LICENSE +0 -0
- {sim_cli_core-0.3.5.dist-info → sim_cli_core-0.3.7.dist-info}/licenses/NOTICE +0 -0
sim/_plugin_install.py
CHANGED
|
@@ -1,158 +1,64 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Migration shims for retired plugin installer commands.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
A `<source>` argument can be any of:
|
|
8
|
-
|
|
9
|
-
* ``sim-plugin-<name>`` / ``sim-plugin-<name>==<version>`` — exact pip
|
|
10
|
-
package spec.
|
|
11
|
-
* ``https://...whl`` / ``https://...tar.gz`` — direct wheel/sdist URL.
|
|
12
|
-
* ``./path/to/dir`` — local plugin source directory.
|
|
13
|
-
* ``./path/to/wheel.whl`` / ``./path/to/sdist.tar.gz`` — local artifact.
|
|
14
|
-
* ``git+https://...`` / ``git+ssh://...`` — git URL.
|
|
15
|
-
|
|
16
|
-
The resolver classifies the source with no network calls and no plugin
|
|
17
|
-
registry lookup. Then a single ``pip install`` invocation does the work.
|
|
3
|
+
``sim`` no longer installs or uninstalls plugin packages. Package mutation
|
|
4
|
+
belongs to the user's uv project; sim inspects installed packages, checks
|
|
5
|
+
drivers, and syncs bundled skills.
|
|
18
6
|
"""
|
|
19
7
|
from __future__ import annotations
|
|
20
8
|
|
|
21
9
|
import re
|
|
22
|
-
import
|
|
23
|
-
import subprocess
|
|
24
|
-
import sys
|
|
25
|
-
from dataclasses import dataclass, field
|
|
10
|
+
from dataclasses import dataclass
|
|
26
11
|
from pathlib import Path
|
|
27
12
|
from typing import Any
|
|
28
13
|
|
|
29
14
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@dataclass(frozen=True)
|
|
34
|
-
class ResolvedSource:
|
|
35
|
-
"""One install source classified into a canonical kind."""
|
|
36
|
-
kind: str
|
|
37
|
-
raw: str # the original argument
|
|
38
|
-
name: str | None = None
|
|
39
|
-
version: str | None = None
|
|
40
|
-
pip_target: str = "" # what pip install gets handed
|
|
41
|
-
extras: dict[str, Any] = field(default_factory=dict)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_SHORT_NAME_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*$")
|
|
45
|
-
_SIM_PLUGIN_PACKAGE_RE = re.compile(
|
|
15
|
+
_PACKAGE_SPEC_RE = re.compile(
|
|
46
16
|
r"^(sim-plugin-[A-Za-z0-9][A-Za-z0-9_.-]*)(?:\[[A-Za-z0-9_,.-]+\])?"
|
|
47
17
|
r"(?:\s*(?:==|!=|~=|>=|<=|>|<)\s*[A-Za-z0-9.*+!_.-]+)?$"
|
|
48
18
|
)
|
|
49
|
-
|
|
19
|
+
_SHORT_NAME_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*$")
|
|
50
20
|
|
|
51
21
|
|
|
52
|
-
def
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
22
|
+
def _install_migration_message(source: str | None = None) -> str:
|
|
23
|
+
base = (
|
|
24
|
+
"sim plugin install is retired.\n\n"
|
|
25
|
+
"Add plugins with uv instead:\n"
|
|
26
|
+
" uv add sim-cli-core <plugin-package-spec>\n"
|
|
27
|
+
" uv run sim plugin sync-skills --target .agents/skills --copy\n"
|
|
28
|
+
" uv run sim check <solver>"
|
|
59
29
|
)
|
|
60
30
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if s.startswith(("http://", "https://")):
|
|
93
|
-
if s.endswith(".whl"):
|
|
94
|
-
return ResolvedSource(kind="wheel-url", raw=s, pip_target=s)
|
|
95
|
-
if s.endswith(".tar.gz") or s.endswith(".tar.bz2"):
|
|
96
|
-
return ResolvedSource(kind="sdist-url", raw=s, pip_target=s)
|
|
97
|
-
# Generic URL: treat as wheel-url and let pip complain.
|
|
98
|
-
return ResolvedSource(kind="wheel-url", raw=s, pip_target=s)
|
|
99
|
-
|
|
100
|
-
package_match = _SIM_PLUGIN_PACKAGE_RE.match(s)
|
|
101
|
-
if package_match:
|
|
102
|
-
version_match = _VERSION_PIN_RE.search(s)
|
|
103
|
-
version = version_match.group(1).strip() if version_match else None
|
|
104
|
-
return ResolvedSource(
|
|
105
|
-
kind="package-spec",
|
|
106
|
-
raw=s,
|
|
107
|
-
name=package_match.group(1),
|
|
108
|
-
version=version,
|
|
109
|
-
pip_target=s,
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
if _SHORT_NAME_RE.match(s):
|
|
113
|
-
raise ValueError(_short_name_error(s))
|
|
114
|
-
|
|
115
|
-
raise ValueError(f"could not classify install source: {source!r}")
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
# ── pip invocation ──────────────────────────────────────────────────────────
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
def _pip_install(target: str, *, editable: bool = False, upgrade: bool = False,
|
|
122
|
-
extra_args: list[str] | None = None,
|
|
123
|
-
python: str | None = None) -> subprocess.CompletedProcess:
|
|
124
|
-
"""Run ``pip install`` (or ``uv pip install`` if uv is on PATH).
|
|
125
|
-
|
|
126
|
-
``python`` lets the caller pin which interpreter receives the install.
|
|
127
|
-
Defaults to ``sys.executable`` (the interpreter running ``sim``), which
|
|
128
|
-
is the right choice in 90% of cases. The canary verification proved
|
|
129
|
-
that without an explicit pin, ``uv pip install`` resolves the active
|
|
130
|
-
venv via ``$VIRTUAL_ENV`` / ``$CONDA_PREFIX`` / cwd discovery, which
|
|
131
|
-
can target the *wrong* interpreter when the user's terminal has no
|
|
132
|
-
venv activated.
|
|
133
|
-
"""
|
|
134
|
-
use_uv = shutil.which("uv") is not None
|
|
135
|
-
|
|
136
|
-
target_python = python or sys.executable
|
|
137
|
-
|
|
138
|
-
cmd: list[str]
|
|
139
|
-
if use_uv:
|
|
140
|
-
cmd = ["uv", "pip", "install", "--python", target_python]
|
|
141
|
-
else:
|
|
142
|
-
cmd = [target_python, "-m", "pip", "install"]
|
|
143
|
-
|
|
144
|
-
if upgrade:
|
|
145
|
-
cmd.append("--upgrade")
|
|
146
|
-
if editable:
|
|
147
|
-
cmd.append("-e")
|
|
148
|
-
if extra_args:
|
|
149
|
-
cmd.extend(extra_args)
|
|
150
|
-
cmd.append(target)
|
|
151
|
-
|
|
152
|
-
return subprocess.run(cmd, capture_output=True, text=True)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
# ── Top-level install ──────────────────────────────────────────────────────
|
|
31
|
+
if source:
|
|
32
|
+
match = _PACKAGE_SPEC_RE.match(source.strip())
|
|
33
|
+
if match:
|
|
34
|
+
return (
|
|
35
|
+
f"{base}\n\n"
|
|
36
|
+
f"For this package spec, run:\n"
|
|
37
|
+
f" uv add sim-cli-core {source.strip()}"
|
|
38
|
+
)
|
|
39
|
+
if _SHORT_NAME_RE.match(source.strip()):
|
|
40
|
+
return (
|
|
41
|
+
f"{base}\n\n"
|
|
42
|
+
"Short solver names are not package specs. Find the package spec in "
|
|
43
|
+
"docs.svdailab.com/plugin-index or sim-plugin-index, then run:\n"
|
|
44
|
+
" uv add sim-cli-core <plugin-package-spec>"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return base
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _uninstall_migration_message(name: str | None = None) -> str:
|
|
51
|
+
package = None
|
|
52
|
+
if name:
|
|
53
|
+
clean = name.strip()
|
|
54
|
+
package = clean if clean.startswith("sim-plugin-") else f"sim-plugin-{clean}"
|
|
55
|
+
command = f" uv remove {package}" if package else " uv remove <plugin-package-spec>"
|
|
56
|
+
return (
|
|
57
|
+
"sim plugin uninstall is retired.\n\n"
|
|
58
|
+
"Remove plugin packages with uv instead:\n"
|
|
59
|
+
f"{command}\n"
|
|
60
|
+
" uv run sim plugin sync-skills --target .agents/skills --copy"
|
|
61
|
+
)
|
|
156
62
|
|
|
157
63
|
|
|
158
64
|
@dataclass
|
|
@@ -175,7 +81,7 @@ class InstallReport:
|
|
|
175
81
|
"source_kind": self.source_kind,
|
|
176
82
|
"pip_target": self.pip_target,
|
|
177
83
|
"pip_returncode": self.pip_returncode,
|
|
178
|
-
"pip_stdout": self.pip_stdout[-2000:],
|
|
84
|
+
"pip_stdout": self.pip_stdout[-2000:],
|
|
179
85
|
"pip_stderr": self.pip_stderr[-2000:],
|
|
180
86
|
"sync_skills": self.sync_skills,
|
|
181
87
|
"error_code": self.error_code,
|
|
@@ -194,63 +100,19 @@ def install_plugin(
|
|
|
194
100
|
python: str | None = None,
|
|
195
101
|
extra_index_urls: list[str] | None = None,
|
|
196
102
|
) -> InstallReport:
|
|
197
|
-
"""
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
pip non-zero, sync failure). Catches and reports cleanly so the CLI
|
|
201
|
-
layer can render either JSON or human output without try/except.
|
|
202
|
-
|
|
203
|
-
``python`` overrides the install-target interpreter. Defaults to
|
|
204
|
-
``sys.executable`` (the interpreter running ``sim``).
|
|
205
|
-
"""
|
|
206
|
-
try:
|
|
207
|
-
resolved = resolve_source(source, offline=offline)
|
|
208
|
-
except (ValueError, FileNotFoundError) as e:
|
|
209
|
-
return InstallReport(
|
|
210
|
-
ok=False, name=None, source_kind="invalid", pip_target=source,
|
|
211
|
-
pip_returncode=-1, pip_stdout="", pip_stderr="",
|
|
212
|
-
error_code="PLUGIN_NOT_FOUND",
|
|
213
|
-
message=str(e),
|
|
214
|
-
)
|
|
215
|
-
|
|
216
|
-
extra_args: list[str] = []
|
|
217
|
-
for extra_index_url in extra_index_urls or []:
|
|
218
|
-
extra_args.extend(["--extra-index-url", extra_index_url])
|
|
219
|
-
|
|
220
|
-
proc = _pip_install(
|
|
221
|
-
resolved.pip_target,
|
|
222
|
-
editable=editable,
|
|
223
|
-
upgrade=upgrade,
|
|
224
|
-
python=python,
|
|
225
|
-
extra_args=extra_args or None,
|
|
226
|
-
)
|
|
227
|
-
ok = proc.returncode == 0
|
|
228
|
-
|
|
229
|
-
if not ok:
|
|
230
|
-
return InstallReport(
|
|
231
|
-
ok=False, name=resolved.name, source_kind=resolved.kind,
|
|
232
|
-
pip_target=resolved.pip_target,
|
|
233
|
-
pip_returncode=proc.returncode,
|
|
234
|
-
pip_stdout=proc.stdout, pip_stderr=proc.stderr,
|
|
235
|
-
error_code="PLUGIN_INSTALL_FAILED",
|
|
236
|
-
message=f"pip install returned {proc.returncode}",
|
|
237
|
-
)
|
|
238
|
-
|
|
239
|
-
sync_result: dict[str, Any] | None = None
|
|
240
|
-
if not skip_sync:
|
|
241
|
-
try:
|
|
242
|
-
from sim.plugins import sync_skills_to
|
|
243
|
-
target = sync_target or _default_skills_target()
|
|
244
|
-
sync_result = sync_skills_to(target)
|
|
245
|
-
except Exception as e: # noqa: BLE001 — sync is best-effort
|
|
246
|
-
sync_result = {"ok": False, "message": f"{type(e).__name__}: {e}"}
|
|
247
|
-
|
|
103
|
+
"""Return migration guidance without invoking pip or uv pip."""
|
|
104
|
+
_ = (editable, upgrade, offline, sync_target, skip_sync, python, extra_index_urls)
|
|
105
|
+
match = _PACKAGE_SPEC_RE.match(source.strip())
|
|
248
106
|
return InstallReport(
|
|
249
|
-
ok=
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
107
|
+
ok=False,
|
|
108
|
+
name=match.group(1) if match else None,
|
|
109
|
+
source_kind="retired",
|
|
110
|
+
pip_target=source,
|
|
111
|
+
pip_returncode=-1,
|
|
112
|
+
pip_stdout="",
|
|
113
|
+
pip_stderr="",
|
|
114
|
+
error_code="PLUGIN_INSTALL_RETIRED",
|
|
115
|
+
message=_install_migration_message(source),
|
|
254
116
|
)
|
|
255
117
|
|
|
256
118
|
|
|
@@ -266,63 +128,22 @@ def _default_skills_target() -> Path:
|
|
|
266
128
|
return Path.home() / ".claude" / "skills"
|
|
267
129
|
|
|
268
130
|
|
|
269
|
-
# ── Uninstall ───────────────────────────────────────────────────────────────
|
|
270
|
-
|
|
271
|
-
|
|
272
131
|
def uninstall_plugin(name: str, *, sync: bool = True,
|
|
273
|
-
|
|
274
|
-
"""
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
rows = {p.name: p for p in list_installed_plugins()}
|
|
284
|
-
if name not in rows:
|
|
285
|
-
return {"ok": False, "error_code": "PLUGIN_NOT_FOUND",
|
|
286
|
-
"message": f"unknown plugin: {name!r}"}
|
|
287
|
-
if rows[name].builtin:
|
|
288
|
-
return {"ok": False, "error_code": "PLUGIN_INSTALL_FAILED",
|
|
289
|
-
"message": "cannot uninstall a built-in driver — wait for v1.0 cut "
|
|
290
|
-
"or remove from sim-cli's _BUILTIN_REGISTRY."}
|
|
291
|
-
|
|
292
|
-
package = rows[name].package or f"sim-plugin-{name}"
|
|
293
|
-
target_python = python or sys.executable
|
|
294
|
-
use_uv = shutil.which("uv") is not None
|
|
295
|
-
cmd = (["uv", "pip", "uninstall", "--python", target_python, package] if use_uv
|
|
296
|
-
else [target_python, "-m", "pip", "uninstall", "-y", package])
|
|
297
|
-
proc = subprocess.run(cmd, capture_output=True, text=True)
|
|
298
|
-
|
|
299
|
-
if proc.returncode != 0:
|
|
300
|
-
return {"ok": False, "error_code": "PLUGIN_INSTALL_FAILED",
|
|
301
|
-
"message": f"pip uninstall returned {proc.returncode}",
|
|
302
|
-
"pip_stderr": proc.stderr[-1000:]}
|
|
303
|
-
|
|
304
|
-
# Remove the on-disk skill copy if present.
|
|
305
|
-
if sync:
|
|
306
|
-
target = _default_skills_target() / name
|
|
307
|
-
if target.is_symlink():
|
|
308
|
-
target.unlink()
|
|
309
|
-
elif target.is_dir():
|
|
310
|
-
shutil.rmtree(target)
|
|
311
|
-
return {"ok": True, "package": package, "name": name}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
# ── Bundle ──────────────────────────────────────────────────────────────────
|
|
132
|
+
python: str | None = None) -> dict[str, Any]:
|
|
133
|
+
"""Return migration guidance without invoking pip or uv pip."""
|
|
134
|
+
_ = (sync, python)
|
|
135
|
+
return {
|
|
136
|
+
"ok": False,
|
|
137
|
+
"name": name,
|
|
138
|
+
"error_code": "PLUGIN_INSTALL_RETIRED",
|
|
139
|
+
"message": _uninstall_migration_message(name),
|
|
140
|
+
}
|
|
315
141
|
|
|
316
142
|
|
|
317
143
|
def bundle_plugins(names: list[str], output_dir: Path, *,
|
|
318
|
-
|
|
319
|
-
"""
|
|
320
|
-
|
|
321
|
-
Use the discovery catalogue to find plugins, then download explicit wheel
|
|
322
|
-
URLs or install exact package specs. The catalogue itself is not an
|
|
323
|
-
install-time resolver.
|
|
324
|
-
"""
|
|
325
|
-
_ = (names, output_dir, index_url)
|
|
144
|
+
index_url: str | None = None) -> dict[str, Any]:
|
|
145
|
+
"""Return migration guidance for the removed bundle flow."""
|
|
146
|
+
_ = index_url
|
|
326
147
|
return {
|
|
327
148
|
"ok": False,
|
|
328
149
|
"output": str(output_dir),
|
|
@@ -330,11 +151,11 @@ def bundle_plugins(names: list[str], output_dir: Path, *,
|
|
|
330
151
|
"errors": [
|
|
331
152
|
{
|
|
332
153
|
"name": name,
|
|
154
|
+
"error_code": "PLUGIN_INSTALL_RETIRED",
|
|
333
155
|
"error": (
|
|
334
|
-
"bundle
|
|
335
|
-
"sim plugin
|
|
336
|
-
"
|
|
337
|
-
"package specs"
|
|
156
|
+
"sim plugin bundle is retired. Add plugin packages with "
|
|
157
|
+
"uv add sim-cli-core <plugin-package-spec> in the target "
|
|
158
|
+
"uv project instead."
|
|
338
159
|
),
|
|
339
160
|
}
|
|
340
161
|
for name in names
|
|
@@ -343,10 +164,9 @@ def bundle_plugins(names: list[str], output_dir: Path, *,
|
|
|
343
164
|
|
|
344
165
|
|
|
345
166
|
__all__ = [
|
|
346
|
-
"ResolvedSource",
|
|
347
167
|
"InstallReport",
|
|
348
|
-
"resolve_source",
|
|
349
168
|
"install_plugin",
|
|
350
169
|
"uninstall_plugin",
|
|
351
170
|
"bundle_plugins",
|
|
171
|
+
"_default_skills_target",
|
|
352
172
|
]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sim-cli
|
|
3
|
+
description: Cross-solver operating discipline for sim-cli sessions — input classification, acceptance semantics, and escalation rules that apply to every solver. Use alongside the solver's own plugin skill, which is self-contained for solver-specific work; this skill carries only the shared rules.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# sim-cli
|
|
7
|
+
|
|
8
|
+
You are driving a solver through the **sim-cli** runtime. This skill carries
|
|
9
|
+
the **cross-solver discipline** — the rules that hold for every sim-cli
|
|
10
|
+
session, regardless of which solver you drive.
|
|
11
|
+
|
|
12
|
+
The solver's **plugin skill** is self-contained for solver-specific work:
|
|
13
|
+
solver hard constraints, dependency chains, snippets, workflows, SDK/solver
|
|
14
|
+
notes. It does not depend on loading this skill — but it should stay
|
|
15
|
+
consistent with the discipline below. If a rule applies to more than one
|
|
16
|
+
solver, it belongs here, not in a plugin skill.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Execution models
|
|
21
|
+
|
|
22
|
+
The plugin skill tells you which model the solver uses:
|
|
23
|
+
|
|
24
|
+
| Model | Used by | Lifecycle |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| **Persistent session** | Drivers that hold a live process open | `connect → exec × N → inspect → disconnect` |
|
|
27
|
+
| **One-shot batch** | Drivers that run one script/deck and exit | `run → parse_output → evaluate` |
|
|
28
|
+
|
|
29
|
+
**The loop, either model:** classify inputs and get the missing Category A
|
|
30
|
+
values from the user (including the acceptance criterion) → start the session
|
|
31
|
+
(`sim connect`, or nothing for one-shot) → Step-0 version probe
|
|
32
|
+
(`sim inspect session.versions`) → execute one bounded step at a time,
|
|
33
|
+
inspecting `last.result` between steps → evaluate against the acceptance
|
|
34
|
+
criterion → `sim disconnect`. On any failure, stop and report — do not
|
|
35
|
+
silently retry.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Hard constraints (every sim-cli session)
|
|
40
|
+
|
|
41
|
+
1. **Never invent Category A defaults.** Physical decisions — geometry,
|
|
42
|
+
materials, boundary conditions, the acceptance criterion — must come from
|
|
43
|
+
the user. "Just use defaults" / "just run it" does not override this;
|
|
44
|
+
treat it as a missing input and ask.
|
|
45
|
+
2. **Step-0 version probe is mandatory.** After `sim connect` (persistent) or
|
|
46
|
+
before `sim run` (one-shot), call `sim inspect session.versions` and use
|
|
47
|
+
the returned `profile` / `active_sdk_layer` / `active_solver_layer` to pick
|
|
48
|
+
the right files in the plugin skill. If `profile` is empty, unknown, or
|
|
49
|
+
deprecated — **stop**.
|
|
50
|
+
3. **Acceptance ≠ exit code.** A `sim run` / `sim exec` can return `ok=true`
|
|
51
|
+
and still be physically wrong. Always validate against an outcome-based,
|
|
52
|
+
bounded, measurable criterion — not "the solver ran".
|
|
53
|
+
4. **Never silently retry a failed step.** Report `stderr`, `stdout`, and
|
|
54
|
+
`run_count` / completion state; let the user decide the next move.
|
|
55
|
+
5. **Reference example values are not defaults.** Values in any `examples/`
|
|
56
|
+
directory describe a specific published test case. Offer them explicitly
|
|
57
|
+
if useful, but wait for the user's confirmation before adopting them.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Input classification
|
|
62
|
+
|
|
63
|
+
Every task starts with: which inputs must the user supply, which may I
|
|
64
|
+
default, which can I derive from the files in front of me?
|
|
65
|
+
|
|
66
|
+
| Category | Rule | Examples |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| **A — physical decisions** | **Must ask if absent.** Non-negotiable. | Geometry, materials, boundary/initial conditions, physics-model choices, the acceptance criterion |
|
|
69
|
+
| **B — operational** | **May default — must disclose.** Affects runtime/convenience, not what the simulation represents. | `--processors`, `--ui-mode`, `--workspace`, smoke-test iteration counts, log verbosity |
|
|
70
|
+
| **C — file-derivable** | **Infer from the actual files** via a diagnostic `sim exec` — not from a similar example. Confirm if a downstream decision depends on it. | Mesh cell count, boundary names/types, fields present in a result file, material IDs |
|
|
71
|
+
|
|
72
|
+
Do not start until every Category A field has an explicit value from the user.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Where `sim serve` runs (Windows session-context foot-gun)
|
|
77
|
+
|
|
78
|
+
If you reach a remote `sim` host via `sim --host <host>` or `SIM_HOST`, **how
|
|
79
|
+
the operator started `sim serve` changes which drivers actually work.** This
|
|
80
|
+
is purely a Windows concern — Linux and macOS don't isolate display sessions
|
|
81
|
+
the same way.
|
|
82
|
+
|
|
83
|
+
| `sim serve` started from… | Headless / CLI drivers | GUI-capable drivers |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| Logged-in Windows desktop (Windows Terminal / RDP / Task Scheduler "run only when user is logged on" + interactive) | ✅ works | ✅ works — windows are visible; `gui` can find / click / screenshot them |
|
|
86
|
+
| SSH session (`ssh <host>` then `sim serve …`) | ✅ works | ❌ silent breakage — windows launch in a non-interactive session with no display surface; `gui` finds zero windows, screenshots come back black |
|
|
87
|
+
|
|
88
|
+
If the host advertises `tools: ["gui"]` but `gui.find(...)` returns nothing
|
|
89
|
+
for windows you have strong reason to believe exist, **do not retry** —
|
|
90
|
+
surface "the server may have been started from a non-interactive session" and
|
|
91
|
+
ask the operator to restart `sim serve` from a desktop session. The agent
|
|
92
|
+
never starts `sim serve` itself.
|
|
93
|
+
|
|
94
|
+
See [`gui/SKILL.md`](gui/SKILL.md) for the full GUI actuation API.
|