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.
- {margin_core-0.1.3 → margin_core-0.1.4}/.gitignore +3 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/CHANGELOG.md +6 -1
- {margin_core-0.1.3 → margin_core-0.1.4}/PKG-INFO +1 -1
- {margin_core-0.1.3 → margin_core-0.1.4}/pyproject.toml +1 -1
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/__init__.py +1 -1
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/agent.py +2 -1
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/models.py +6 -1
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_core_skeleton.py +1 -1
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_questions.py +17 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/LICENSE +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/README.md +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/_fs.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/config.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/errors.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/inputs.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/__init__.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/_chat_completions.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/_http.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/anthropic.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/base.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/catalog.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/factory.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/local.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/mock.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/openai.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/llm/pricing.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/__init__.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/base.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/filters.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/git.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/github.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/loaders/local.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/logging.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/py.typed +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/registry.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/reporting/__init__.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/reporting/json_report.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/reporting/markdown_report.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/src/margin_core/runner.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/conftest.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_agent.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_config.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_filters.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_github_loader.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_history_scope.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_inputs.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_llm.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_llm_session.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_local_llm.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_local_loader.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_models.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_preclone_check.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_registry.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_reporting.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_security.py +0 -0
- {margin_core-0.1.3 → margin_core-0.1.4}/tests/test_user_settings.py +0 -0
|
@@ -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
|
-
## [
|
|
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
|
+
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
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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):
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|