aethis-cli 0.40.2__tar.gz → 0.42.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 (109) hide show
  1. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/PKG-INFO +9 -1
  2. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/README.md +7 -0
  3. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/_version.py +1 -1
  4. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/client.py +55 -2
  5. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/generate_cmd.py +534 -35
  6. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/refine_cmd.py +10 -0
  7. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/config.py +7 -0
  8. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli.egg-info/PKG-INFO +9 -1
  9. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli.egg-info/SOURCES.txt +2 -0
  10. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli.egg-info/requires.txt +1 -0
  11. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/pyproject.toml +2 -1
  12. aethis_cli-0.42.0/tests/test_acceptance_contract.py +655 -0
  13. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_generate_replace_tests.py +2 -4
  14. aethis_cli-0.42.0/tests/test_generation_models.py +127 -0
  15. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/LICENSE +0 -0
  16. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/__init__.py +0 -0
  17. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/__main__.py +0 -0
  18. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/_terminal_safe.py +0 -0
  19. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/auth.py +0 -0
  20. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/auth_helpers.py +0 -0
  21. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/auth_providers.py +0 -0
  22. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/__init__.py +0 -0
  23. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/_id_utils.py +0 -0
  24. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/account_cmd.py +0 -0
  25. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/cancel_cmd.py +0 -0
  26. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/decide_cmd.py +0 -0
  27. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/explain_cmd.py +0 -0
  28. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/fields_cmd.py +0 -0
  29. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/guidance_cmd.py +0 -0
  30. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/init_cmd.py +0 -0
  31. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/login_cmd.py +0 -0
  32. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/mcp_cmd.py +0 -0
  33. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/profile_cmd.py +0 -0
  34. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/projects_cmd.py +0 -0
  35. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/publish_cmd.py +0 -0
  36. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/review_cmd.py +0 -0
  37. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/rulebooks_cmd.py +0 -0
  38. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/rulesets_cmd.py +0 -0
  39. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/status_cmd.py +0 -0
  40. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/test_cmd.py +0 -0
  41. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/update_cmd.py +0 -0
  42. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/usage_cmd.py +0 -0
  43. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/commands/whoami_cmd.py +0 -0
  44. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/contract.py +0 -0
  45. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/decision_view.py +0 -0
  46. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/errors.py +0 -0
  47. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/generation_status.py +0 -0
  48. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/main.py +0 -0
  49. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/output.py +0 -0
  50. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/prompts.py +0 -0
  51. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/py.typed +0 -0
  52. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/render.py +0 -0
  53. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/source_safeguards.py +0 -0
  54. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/source_targets.py +0 -0
  55. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli/update_check.py +0 -0
  56. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli.egg-info/dependency_links.txt +0 -0
  57. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli.egg-info/entry_points.txt +0 -0
  58. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/aethis_cli.egg-info/top_level.txt +0 -0
  59. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/setup.cfg +0 -0
  60. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_account_cmd.py +0 -0
  61. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_auth.py +0 -0
  62. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_auth_providers.py +0 -0
  63. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_cancel_cmd.py +0 -0
  64. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_capability_boundary.py +0 -0
  65. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_client.py +0 -0
  66. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_config.py +0 -0
  67. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_contract_decide.py +0 -0
  68. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_contract_identity_and_sources.py +0 -0
  69. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_contract_request_surface.py +0 -0
  70. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_contract_rulebook_decide.py +0 -0
  71. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_decide_cmd.py +0 -0
  72. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_documented_commands_run.py +0 -0
  73. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_empty_input_guards.py +0 -0
  74. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_explain_cmd.py +0 -0
  75. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_field_behaviour_metadata_transport.py +0 -0
  76. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_field_display_metadata_transport.py +0 -0
  77. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_fields_cmd.py +0 -0
  78. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_generate_failure_reporting.py +0 -0
  79. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_generate_fields.py +0 -0
  80. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_generate_no_publish.py +0 -0
  81. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_generation_status.py +0 -0
  82. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_guidance_cli.py +0 -0
  83. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_id_utils.py +0 -0
  84. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_init.py +0 -0
  85. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_json_projection_pinning.py +0 -0
  86. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_lazy_auth.py +0 -0
  87. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_login_headless.py +0 -0
  88. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_main.py +0 -0
  89. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_mcp_cmd.py +0 -0
  90. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_output.py +0 -0
  91. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_profiles.py +0 -0
  92. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_prompts.py +0 -0
  93. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_publish_force.py +0 -0
  94. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_publish_rulebook_flags.py +0 -0
  95. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_publish_source_targets.py +0 -0
  96. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_release_tooling.py +0 -0
  97. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_render.py +0 -0
  98. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_review_cmd.py +0 -0
  99. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_rulebooks_cmd.py +0 -0
  100. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_rulesets_b1b_lifecycle.py +0 -0
  101. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_source_safeguards.py +0 -0
  102. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_spacecraft_example_pin.py +0 -0
  103. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_status_cmd.py +0 -0
  104. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_transport_error_rendering.py +0 -0
  105. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_update_check.py +0 -0
  106. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_update_cmd.py +0 -0
  107. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_usage.py +0 -0
  108. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_value_space_transport.py +0 -0
  109. {aethis_cli-0.40.2 → aethis_cli-0.42.0}/tests/test_whoami_cmd.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aethis-cli
3
- Version: 0.40.2
3
+ Version: 0.42.0
4
4
  Summary: CLI for the Aethis developer API — author, test, and publish rulesets
5
5
  Author-email: Aethis <eng@aethis.ai>
6
6
  License-Expression: MIT
@@ -22,6 +22,7 @@ License-File: LICENSE
22
22
  Requires-Dist: typer>=0.12.0
23
23
  Requires-Dist: rich>=13.5.0
24
24
  Requires-Dist: httpx>=0.27.0
25
+ Requires-Dist: rfc8785>=0.1.4
25
26
  Requires-Dist: pyyaml>=6.0.1
26
27
  Provides-Extra: keyring
27
28
  Requires-Dist: keyring>=25.0.0; extra == "keyring"
@@ -155,6 +156,13 @@ aethis decide -i '{"space.crew.species": "Human", "space.crew.age": 35, "space.c
155
156
 
156
157
  See the example's [README](https://github.com/Aethis-ai/aethis-examples/blob/main/spacecraft-crew-certification/README.md) for what each scenario covers.
157
158
 
159
+ Generation and refinement accept `--model claude-sonnet-5` (the default) or
160
+ `--model deepseek-flash`. For DeepSeek, set `DEEPSEEK_API_KEY`; an alternative
161
+ environment variable name can be configured with `deepseek_key_env` in
162
+ `aethis.yaml`. The DeepSeek credential is sent only with generation.
163
+ This option requires an engine supporting model selection. Live-provider
164
+ validation has passed; the matching engine and CLI releases are still pending.
165
+
158
166
  ## Commands
159
167
 
160
168
  ### Decision (no API key required)
@@ -121,6 +121,13 @@ aethis decide -i '{"space.crew.species": "Human", "space.crew.age": 35, "space.c
121
121
 
122
122
  See the example's [README](https://github.com/Aethis-ai/aethis-examples/blob/main/spacecraft-crew-certification/README.md) for what each scenario covers.
123
123
 
124
+ Generation and refinement accept `--model claude-sonnet-5` (the default) or
125
+ `--model deepseek-flash`. For DeepSeek, set `DEEPSEEK_API_KEY`; an alternative
126
+ environment variable name can be configured with `deepseek_key_env` in
127
+ `aethis.yaml`. The DeepSeek credential is sent only with generation.
128
+ This option requires an engine supporting model selection. Live-provider
129
+ validation has passed; the matching engine and CLI releases are still pending.
130
+
124
131
  ## Commands
125
132
 
126
133
  ### Decision (no API key required)
@@ -1,3 +1,3 @@
1
1
  """Version info — updated per release."""
2
2
 
3
- __version__ = "0.40.2"
3
+ __version__ = "0.42.0"
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from enum import Enum
5
6
  from pathlib import Path
6
7
  from typing import Any, Callable, Optional
7
8
 
@@ -23,6 +24,13 @@ KeyRefreshCallback = Callable[..., str]
23
24
  _UNPROBED = object()
24
25
 
25
26
 
27
+ class GenerationModel(str, Enum):
28
+ """Supported per-generation authoring models."""
29
+
30
+ sonnet = "claude-sonnet-5"
31
+ deepseek = "deepseek-flash"
32
+
33
+
26
34
  class AethisClient:
27
35
  """Synchronous client wrapping all Aethis API endpoints."""
28
36
 
@@ -80,6 +88,7 @@ class AethisClient:
80
88
  # Cached answer to "does this engine accept `replace` on a test-case
81
89
  # upload?" — one probe per client, not one per call.
82
90
  self._test_replace_support: Any = _UNPROBED
91
+ self._test_acceptance_contract_support: Any = _UNPROBED
83
92
  # Cached property names the engine advertises, per schema model — one
84
93
  # probe per model per client, not one per call.
85
94
  self._field_spec_properties: dict[str, Optional[set[str]]] = {}
@@ -278,7 +287,15 @@ class AethisClient:
278
287
  json=body,
279
288
  )
280
289
 
281
- def add_tests(self, project_id: str, test_cases: list[dict], replace: bool = False) -> dict:
290
+ def add_tests(
291
+ self,
292
+ project_id: str,
293
+ test_cases: list[dict],
294
+ replace: bool = False,
295
+ *,
296
+ contract_version: Optional[int] = None,
297
+ expected_review_bindings: Any = _UNPROBED,
298
+ ) -> dict:
282
299
  """Upload golden test cases to a project.
283
300
 
284
301
  ``replace=True`` makes the upload idempotent: the supplied list becomes
@@ -296,6 +313,10 @@ class AethisClient:
296
313
  body: dict = {"test_cases": test_cases}
297
314
  if replace:
298
315
  body["replace"] = True
316
+ if contract_version is not None:
317
+ body["contract_version"] = contract_version
318
+ if expected_review_bindings is not _UNPROBED:
319
+ body["expected_review_bindings"] = expected_review_bindings
299
320
  return self._request(
300
321
  "POST",
301
322
  f"/api/v1/public/projects/{project_id}/tests",
@@ -334,6 +355,26 @@ class AethisClient:
334
355
  self._test_replace_support = answer
335
356
  return answer
336
357
 
358
+ def supports_test_acceptance_contract(self) -> Optional[bool]:
359
+ """Whether this engine advertises every envelope member for contract v1.
360
+
361
+ Contract uploads replace the suite. An older engine may ignore unknown
362
+ keys while honouring ``replace``, which would erase tests and silently
363
+ discard their assertions; therefore an unknown or incomplete schema is
364
+ a hard stop for this path.
365
+ """
366
+ if self._test_acceptance_contract_support is not _UNPROBED:
367
+ return self._test_acceptance_contract_support # type: ignore[return-value]
368
+ try:
369
+ resp = self._client.get("/openapi.json", timeout=15.0)
370
+ schemas = resp.json()["components"]["schemas"] if resp.status_code < 400 else {}
371
+ properties = schemas["AddTestCaseRequest"]["properties"]
372
+ answer: Optional[bool] = {"replace", "contract_version", "expected_review_bindings"}.issubset(properties)
373
+ except (httpx.HTTPError, ValueError, KeyError, TypeError):
374
+ answer = None
375
+ self._test_acceptance_contract_support = answer
376
+ return answer
377
+
337
378
  def _schema_properties(self, model: str) -> Optional[set[str]]:
338
379
  """The property names this engine advertises on ``model``.
339
380
 
@@ -439,6 +480,9 @@ class AethisClient:
439
480
  project_id: str,
440
481
  mode: Optional[str] = None,
441
482
  seed_ruleset_id: Optional[str] = None,
483
+ *,
484
+ model: Optional[GenerationModel] = None,
485
+ deepseek_key: Optional[str] = None,
442
486
  ) -> dict:
443
487
  """Trigger generation. ``mode="refine"`` seeds from the section's active
444
488
  ruleset and makes the minimal edit to fix failing tests; omitting ``mode``
@@ -450,7 +494,16 @@ class AethisClient:
450
494
  body["mode"] = mode
451
495
  if seed_ruleset_id is not None:
452
496
  body["seed_ruleset_id"] = seed_ruleset_id
453
- kwargs = {"json": body} if body else {}
497
+ if model is not None:
498
+ body["model"] = GenerationModel(model).value
499
+ if deepseek_key and model != GenerationModel.deepseek:
500
+ raise ValueError("A DeepSeek key requires model=deepseek-flash")
501
+ kwargs: dict[str, Any] = {"json": body} if body else {}
502
+ if model == GenerationModel.deepseek:
503
+ if self._client.headers.get("X-Anthropic-Key"):
504
+ raise ValueError("Use a client without an Anthropic key for DeepSeek generation")
505
+ if deepseek_key:
506
+ kwargs["headers"] = {"X-DeepSeek-Key": deepseek_key}
454
507
  return self._request("POST", f"/api/v1/public/projects/{project_id}/generate", **kwargs)
455
508
 
456
509
  def get_status(self, project_id: str) -> dict: