margin-core 0.1.3__tar.gz → 0.1.4__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 (56) hide show
  1. {margin_core-0.1.3 → margin_core-0.1.4}/.gitignore +3 -0
  2. {margin_core-0.1.3 → margin_core-0.1.4}/CHANGELOG.md +6 -1
  3. {margin_core-0.1.3 → margin_core-0.1.4}/PKG-INFO +1 -1
  4. {margin_core-0.1.3 → margin_core-0.1.4}/pyproject.toml +1 -1
  5. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/__init__.py +1 -1
  6. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/agent.py +2 -1
  7. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/models.py +6 -1
  8. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_core_skeleton.py +1 -1
  9. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_questions.py +17 -0
  10. {margin_core-0.1.3 → margin_core-0.1.4}/LICENSE +0 -0
  11. {margin_core-0.1.3 → margin_core-0.1.4}/README.md +0 -0
  12. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/_fs.py +0 -0
  13. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/config.py +0 -0
  14. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/errors.py +0 -0
  15. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/inputs.py +0 -0
  16. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/__init__.py +0 -0
  17. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/_chat_completions.py +0 -0
  18. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/_http.py +0 -0
  19. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/anthropic.py +0 -0
  20. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/base.py +0 -0
  21. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/catalog.py +0 -0
  22. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/factory.py +0 -0
  23. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/local.py +0 -0
  24. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/mock.py +0 -0
  25. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/openai.py +0 -0
  26. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/pricing.py +0 -0
  27. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/__init__.py +0 -0
  28. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/base.py +0 -0
  29. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/filters.py +0 -0
  30. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/git.py +0 -0
  31. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/github.py +0 -0
  32. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/local.py +0 -0
  33. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/logging.py +0 -0
  34. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/py.typed +0 -0
  35. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/registry.py +0 -0
  36. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/reporting/__init__.py +0 -0
  37. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/reporting/json_report.py +0 -0
  38. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/reporting/markdown_report.py +0 -0
  39. {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/runner.py +0 -0
  40. {margin_core-0.1.3 → margin_core-0.1.4}/tests/conftest.py +0 -0
  41. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_agent.py +0 -0
  42. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_config.py +0 -0
  43. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_filters.py +0 -0
  44. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_github_loader.py +0 -0
  45. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_history_scope.py +0 -0
  46. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_inputs.py +0 -0
  47. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_llm.py +0 -0
  48. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_llm_session.py +0 -0
  49. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_local_llm.py +0 -0
  50. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_local_loader.py +0 -0
  51. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_models.py +0 -0
  52. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_preclone_check.py +0 -0
  53. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_registry.py +0 -0
  54. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_reporting.py +0 -0
  55. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_security.py +0 -0
  56. {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_user_settings.py +0 -0
@@ -80,3 +80,6 @@ CLAUDE.md
80
80
 
81
81
  # the web UI bundled into margin-api at release time (scripts/build_release.py)
82
82
  packages/api/src/margin_api/ui/
83
+
84
+ # local agent plugins and state
85
+ .agents/
@@ -4,7 +4,12 @@ All notable changes to this package are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
- ## [Unreleased]
7
+ ## [0.1.4] - 2026-11-20
8
+
9
+ ### Fixed
10
+ - An answer with several choices reads as one list: sentence labels lose their full stop and
11
+ are kept apart with semicolons when they have commas of their own. The "Not confirmed"
12
+ warning no longer ends in two full stops.
8
13
 
9
14
  ## [0.1.3] - 2026-11-02
10
15
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: margin-core
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: The shared core of margin: the agent contract, results with evidence, model clients and code loaders.
5
5
  Project-URL: Homepage, https://github.com/Waddah0-0/margin
6
6
  Project-URL: Source, https://github.com/Waddah0-0/margin/tree/main/packages/core
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "margin-core"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "The shared core of margin: the agent contract, results with evidence, model clients and code loaders."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -45,7 +45,7 @@ from margin_core.models import (
45
45
  from margin_core.registry import AgentRegistry, default_registry, get_agent, list_agents
46
46
  from margin_core.runner import run_agent
47
47
 
48
- __version__ = "0.1.3"
48
+ __version__ = "0.1.4"
49
49
 
50
50
  __all__ = [
51
51
  "AgentInfo",
@@ -174,7 +174,8 @@ class RunContext:
174
174
  answer = Answer.of(question, question.check(question.default), "default")
175
175
  answers[question.id] = answer
176
176
  if question.default is not None:
177
- self.warn(f"Not confirmed: {question.prompt} Assumed: {answer.label}.")
177
+ end = "" if answer.label.endswith((".", "!", "?")) else "."
178
+ self.warn(f"Not confirmed: {question.prompt} Assumed: {answer.label}{end}")
178
179
 
179
180
  ordered = {q.id: answers[q.id] for q in batch.questions}
180
181
  self.answers.extend(ordered.values())
@@ -166,7 +166,12 @@ class Question(_StrictModel):
166
166
  for v in values:
167
167
  choice = self._choice(v)
168
168
  labels.append(choice.label if choice is not None else str(v))
169
- return ", ".join(labels)
169
+ if len(labels) == 1:
170
+ return labels[0]
171
+ # several answers: a label that is a whole sentence loses its full stop, and labels
172
+ # that have commas of their own are kept apart with semicolons
173
+ labels = [label.rstrip(".") for label in labels]
174
+ return ("; " if any("," in label for label in labels) else ", ").join(labels)
170
175
 
171
176
 
172
177
  class Answer(_StrictModel):
@@ -2,4 +2,4 @@ from margin_core import __version__
2
2
 
3
3
 
4
4
  def test_core_version() -> None:
5
- assert __version__ == "0.1.3"
5
+ assert __version__ == "0.1.4"
@@ -96,6 +96,23 @@ def test_other_text_is_accepted_only_when_allowed() -> None:
96
96
  assert grain.describe("order line") == "order line"
97
97
 
98
98
 
99
+ def test_several_answers_read_as_one_list() -> None:
100
+ pick = Question(
101
+ id="pick", prompt="Which?", kind="multi_choice", default=["a", "b"],
102
+ choices=[
103
+ Choice(value="a", label="North is the largest region, with 31% of revenue."),
104
+ Choice(value="b", label="Juice grew 12%."),
105
+ Choice(value="c", label="Tea"),
106
+ Choice(value="d", label="Coffee"),
107
+ ],
108
+ ) # fmt: skip
109
+ assert pick.describe(["a", "b"]) == (
110
+ "North is the largest region, with 31% of revenue; Juice grew 12%"
111
+ )
112
+ assert pick.describe(["c", "d"]) == "Tea, Coffee"
113
+ assert pick.describe(["b"]) == "Juice grew 12%."
114
+
115
+
99
116
  def test_resolve_fills_defaults_and_lists_every_problem() -> None:
100
117
  batch = QuestionBatch(title="Check", questions=[FORMAT, COLUMNS, CONTEXT])
101
118
  answers = batch.resolve({"date_format": "dmy"}, "user")
File without changes
File without changes