aethis-cli 0.45.0__tar.gz → 0.46.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 (115) hide show
  1. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/PKG-INFO +1 -1
  2. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/_version.py +1 -1
  3. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/client.py +5 -0
  4. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/publish_cmd.py +10 -0
  5. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/config.py +12 -0
  6. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli.egg-info/PKG-INFO +1 -1
  7. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli.egg-info/SOURCES.txt +1 -0
  8. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/pyproject.toml +1 -1
  9. aethis_cli-0.46.0/tests/test_publish_display_name.py +77 -0
  10. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_source_safeguards.py +3 -1
  11. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/LICENSE +0 -0
  12. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/README.md +0 -0
  13. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/__init__.py +0 -0
  14. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/__main__.py +0 -0
  15. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/_terminal_safe.py +0 -0
  16. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/auth.py +0 -0
  17. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/auth_helpers.py +0 -0
  18. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/auth_providers.py +0 -0
  19. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/__init__.py +0 -0
  20. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/_id_utils.py +0 -0
  21. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/account_cmd.py +0 -0
  22. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/cancel_cmd.py +0 -0
  23. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/decide_cmd.py +0 -0
  24. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/explain_cmd.py +0 -0
  25. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/fields_cmd.py +0 -0
  26. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/generate_cmd.py +0 -0
  27. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/guidance_cmd.py +0 -0
  28. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/init_cmd.py +0 -0
  29. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/login_cmd.py +0 -0
  30. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/mcp_cmd.py +0 -0
  31. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/profile_cmd.py +0 -0
  32. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/projects_cmd.py +0 -0
  33. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/refine_cmd.py +0 -0
  34. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/review_cmd.py +0 -0
  35. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/rulebooks_cmd.py +0 -0
  36. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/rulesets_cmd.py +0 -0
  37. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/status_cmd.py +0 -0
  38. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/test_cmd.py +0 -0
  39. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/update_cmd.py +0 -0
  40. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/usage_cmd.py +0 -0
  41. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/commands/whoami_cmd.py +0 -0
  42. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/contract.py +0 -0
  43. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/decision_view.py +0 -0
  44. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/errors.py +0 -0
  45. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/generation_status.py +0 -0
  46. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/main.py +0 -0
  47. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/output.py +0 -0
  48. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/prompts.py +0 -0
  49. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/py.typed +0 -0
  50. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/render.py +0 -0
  51. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/source_safeguards.py +0 -0
  52. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/source_targets.py +0 -0
  53. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli/update_check.py +0 -0
  54. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli.egg-info/dependency_links.txt +0 -0
  55. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli.egg-info/entry_points.txt +0 -0
  56. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli.egg-info/requires.txt +0 -0
  57. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/aethis_cli.egg-info/top_level.txt +0 -0
  58. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/setup.cfg +0 -0
  59. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_acceptance_contract.py +0 -0
  60. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_account_cmd.py +0 -0
  61. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_auth.py +0 -0
  62. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_auth_providers.py +0 -0
  63. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_cancel_cmd.py +0 -0
  64. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_capability_boundary.py +0 -0
  65. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_client.py +0 -0
  66. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_config.py +0 -0
  67. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_contract_decide.py +0 -0
  68. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_contract_identity_and_sources.py +0 -0
  69. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_contract_request_surface.py +0 -0
  70. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_contract_rulebook_decide.py +0 -0
  71. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_credential_server.py +0 -0
  72. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_credential_url_parser.py +0 -0
  73. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_decide_cmd.py +0 -0
  74. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_documented_commands_run.py +0 -0
  75. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_empty_input_guards.py +0 -0
  76. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_explain_cmd.py +0 -0
  77. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_field_behaviour_metadata_transport.py +0 -0
  78. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_field_dependency_and_identity_transport.py +0 -0
  79. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_field_display_metadata_transport.py +0 -0
  80. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_field_notes_validation.py +0 -0
  81. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_fields_cmd.py +0 -0
  82. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_generate_failure_reporting.py +0 -0
  83. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_generate_fields.py +0 -0
  84. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_generate_no_publish.py +0 -0
  85. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_generate_replace_tests.py +0 -0
  86. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_generation_models.py +0 -0
  87. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_generation_status.py +0 -0
  88. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_guidance_cli.py +0 -0
  89. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_id_utils.py +0 -0
  90. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_init.py +0 -0
  91. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_json_projection_pinning.py +0 -0
  92. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_lazy_auth.py +0 -0
  93. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_login_headless.py +0 -0
  94. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_main.py +0 -0
  95. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_mcp_cmd.py +0 -0
  96. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_output.py +0 -0
  97. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_profiles.py +0 -0
  98. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_project_file_trust.py +0 -0
  99. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_prompts.py +0 -0
  100. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_publish_force.py +0 -0
  101. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_publish_rulebook_flags.py +0 -0
  102. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_publish_source_targets.py +0 -0
  103. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_release_tooling.py +0 -0
  104. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_render.py +0 -0
  105. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_review_cmd.py +0 -0
  106. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_rulebooks_cmd.py +0 -0
  107. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_rulesets_b1b_lifecycle.py +0 -0
  108. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_spacecraft_example_pin.py +0 -0
  109. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_status_cmd.py +0 -0
  110. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_transport_error_rendering.py +0 -0
  111. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_update_check.py +0 -0
  112. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_update_cmd.py +0 -0
  113. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_usage.py +0 -0
  114. {aethis_cli-0.45.0 → aethis_cli-0.46.0}/tests/test_value_space_transport.py +0 -0
  115. {aethis_cli-0.45.0 → aethis_cli-0.46.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.45.0
3
+ Version: 0.46.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
@@ -1,3 +1,3 @@
1
1
  """Version info — updated per release."""
2
2
 
3
- __version__ = "0.45.0"
3
+ __version__ = "0.46.0"
@@ -550,10 +550,15 @@ class AethisClient:
550
550
  rulebook_id: str | None = None,
551
551
  ruleset_name: str | None = None,
552
552
  source_targets: dict[str, dict] | None = None,
553
+ name: str | None = None,
553
554
  ) -> dict:
554
555
  body: dict = {}
555
556
  if slug is not None:
556
557
  body["slug"] = slug
558
+ # Human-readable ruleset name. Omitted unless given, so the request is
559
+ # unchanged for callers that do not set it.
560
+ if name is not None:
561
+ body["name"] = name
557
562
  if force_unsafe:
558
563
  # Tell the server-side TDD gate (aethis-core 0.11+) to refuse a
559
564
  # publish when stored test cases fail; force_unsafe=True records
@@ -125,6 +125,15 @@ def publish(
125
125
  "namespace is reserved for official rulesets."
126
126
  ),
127
127
  ),
128
+ name: Optional[str] = typer.Option(
129
+ None,
130
+ "--name",
131
+ help=(
132
+ "Human-readable name for this ruleset, shown to end users in "
133
+ "rulebook responses. Overrides an optional 'display_name:' key in "
134
+ "aethis.yaml. When neither is set the engine keeps its default name."
135
+ ),
136
+ ),
128
137
  rulebook: Optional[str] = typer.Option(
129
138
  None,
130
139
  "--rulebook",
@@ -259,6 +268,7 @@ def publish(
259
268
  rulebook_id=rulebook,
260
269
  ruleset_name=ruleset_name,
261
270
  source_targets=wire_targets or None,
271
+ name=name if name is not None else cfg.display_name,
262
272
  )
263
273
  except AethisAPIError as e:
264
274
  error_panel(e)
@@ -64,6 +64,7 @@ class ProjectConfig:
64
64
  config_path: Path = field(default_factory=lambda: Path.cwd())
65
65
  deepseek_key_env: str = "DEEPSEEK_API_KEY"
66
66
  project_base_url: Optional[str] = None # the project file's own value, exactly as written
67
+ display_name: Optional[str] = None # optional human-readable ruleset name, sent on publish
67
68
 
68
69
 
69
70
  def resolve_base_url_with_source() -> tuple[str, str]:
@@ -510,9 +511,20 @@ def load_project_config(path: Optional[Path] = None) -> ProjectConfig:
510
511
  project_id=project_id,
511
512
  config_path=project_dir,
512
513
  project_base_url=project_url,
514
+ display_name=_display_name_value(raw, yaml_path),
513
515
  )
514
516
 
515
517
 
518
+ def _display_name_value(raw: dict, yaml_path: Path) -> Optional[str]:
519
+ """The optional ``display_name`` key: a non-empty string, or absent."""
520
+ value = raw.get("display_name")
521
+ if value is None:
522
+ return None
523
+ if not isinstance(value, str) or not value.strip():
524
+ raise ConfigError(f"'display_name' in {yaml_path} must be a non-empty string.")
525
+ return value.strip()
526
+
527
+
516
528
  _ENV_REFUSED = (
517
529
  "{where} names a non-default key variable that you have not designated, so it was not read. Environment "
518
530
  "variables are read as keys only if you name them yourself: set {setting} to the variable name in your own "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aethis-cli
3
- Version: 0.45.0
3
+ Version: 0.46.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
@@ -93,6 +93,7 @@ tests/test_output.py
93
93
  tests/test_profiles.py
94
94
  tests/test_project_file_trust.py
95
95
  tests/test_prompts.py
96
+ tests/test_publish_display_name.py
96
97
  tests/test_publish_force.py
97
98
  tests/test_publish_rulebook_flags.py
98
99
  tests/test_publish_source_targets.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aethis-cli"
3
- version = "0.45.0"
3
+ version = "0.46.0"
4
4
  description = "CLI for the Aethis developer API — author, test, and publish rulesets"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -0,0 +1,77 @@
1
+ """`aethis publish --name` and the optional `display_name:` key in aethis.yaml.
2
+
3
+ Both set the human-readable ruleset name sent on publish. Absent => the
4
+ request is byte-identical to before.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from unittest.mock import MagicMock, patch
10
+
11
+ from typer.testing import CliRunner
12
+
13
+
14
+ def _invoke(args):
15
+ from aethis_cli.main import app
16
+
17
+ return CliRunner().invoke(app, args, catch_exceptions=False, env={})
18
+
19
+
20
+ def _project(tmp_path, extra=""):
21
+ (tmp_path / "aethis.yaml").write_text("project: test-project\napi_key_env: AETHIS_API_KEY\n" + extra)
22
+ (tmp_path / ".aethis").mkdir()
23
+ (tmp_path / ".aethis" / "state.json").write_text('{"project_id": "proj_test"}')
24
+
25
+
26
+ def _run(tmp_path, monkeypatch, args, extra=""):
27
+ monkeypatch.chdir(tmp_path)
28
+ monkeypatch.setenv("AETHIS_API_KEY", "ak_test")
29
+ _project(tmp_path, extra)
30
+ client = MagicMock()
31
+ client.run_tests.return_value = {"passed": 1, "failed": 0, "errors": 0, "total": 1}
32
+ client.publish.return_value = {"ruleset_id": "rs_x"}
33
+ with patch("aethis_cli.client.AethisClient", return_value=client):
34
+ result = _invoke(["publish", *args])
35
+ assert result.exit_code == 0, result.output
36
+ return client.publish.call_args.kwargs
37
+
38
+
39
+ def test_name_flag_is_sent(tmp_path, monkeypatch):
40
+ assert _run(tmp_path, monkeypatch, ["--name", "Life in the UK"])["name"] == "Life in the UK"
41
+
42
+
43
+ def test_display_name_key_is_sent(tmp_path, monkeypatch):
44
+ kw = _run(tmp_path, monkeypatch, [], extra="display_name: English language\n")
45
+ assert kw["name"] == "English language"
46
+
47
+
48
+ def test_flag_overrides_yaml(tmp_path, monkeypatch):
49
+ kw = _run(tmp_path, monkeypatch, ["--name", "Flag"], extra="display_name: Yaml\n")
50
+ assert kw["name"] == "Flag"
51
+
52
+
53
+ def test_absent_means_no_name(tmp_path, monkeypatch):
54
+ assert _run(tmp_path, monkeypatch, [])["name"] is None
55
+
56
+
57
+ def _body(**kw):
58
+ from aethis_cli.client import AethisClient
59
+
60
+ captured: dict = {}
61
+
62
+ class _Stub(AethisClient):
63
+ def _request(self, method, path, **k):
64
+ captured["kwargs"] = k
65
+ return {}
66
+
67
+ _Stub(base_url="http://test.invalid", api_key="ak_test").publish("proj_x", **kw)
68
+ return captured["kwargs"]
69
+
70
+
71
+ def test_client_sends_name_in_body():
72
+ assert _body(name="Personal information")["json"] == {"name": "Personal information"}
73
+
74
+
75
+ def test_client_body_unchanged_without_name():
76
+ assert "json" not in _body()
77
+ assert _body(slug="a/b")["json"] == {"slug": "a/b"}
@@ -178,7 +178,9 @@ def test_warning_text_is_never_parsed_as_markup(capsys):
178
178
 
179
179
 
180
180
  def _publish(publish_response: dict) -> str:
181
- cfg = SimpleNamespace(base_url="http://engine.test", project_id="proj_test", config_path="/tmp/.aethis")
181
+ cfg = SimpleNamespace(
182
+ base_url="http://engine.test", project_id="proj_test", config_path="/tmp/.aethis", display_name=None
183
+ )
182
184
  client = MagicMock()
183
185
  client.run_tests.return_value = {"passed": 1, "total": 1, "failed": 0, "errors": 0, "results": []}
184
186
  client.publish.return_value = publish_response
File without changes
File without changes
File without changes