brain-framework 21.0.1__tar.gz → 21.1.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.
- {brain_framework-21.0.1 → brain_framework-21.1.0}/PKG-INFO +1 -1
- {brain_framework-21.0.1 → brain_framework-21.1.0}/pyproject.toml +1 -1
- {brain_framework-21.0.1 → brain_framework-21.1.0}/pyproject.toml.orig +1 -1
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/__init__.py +1 -1
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/assistants.py +2 -1
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/models.py +7 -2
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/runtime.py +22 -6
- {brain_framework-21.0.1 → brain_framework-21.1.0}/LICENSE +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/README.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/THIRD_PARTY_NOTICES.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/__main__.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/channels.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/cli.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/collect.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/config.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/evaluate.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/graph.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/health.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/history.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/index.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/install.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/links.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/markdown.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/mcp.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/messages.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/ontology.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/pages.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/py.typed +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/records.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/replies.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/retrieve.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/schemas.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/README.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/SKILL.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/references/actions.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/references/context.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/references/handoff.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/scripts/check-handoff.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/scripts/new-action.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/templates/action.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-maintain/SKILL.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-maintain/references/conflicts.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-maintain/references/integrations.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-maintain/references/operations.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-setup/SKILL.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-setup/references/discovery.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-setup/references/import.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-setup/references/scan.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-setup/scripts/inventory.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/SKILL.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/consolidate.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/decisions.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/evidence.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/learn.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/links.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/retrieval.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/review.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/share.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/scripts/evidence.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/scripts/guarded-write.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/templates/concept.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/templates/project.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/starter/AGENTS.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/starter/concepts/index.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/starter/concepts/welcome.md +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/starter/evals/retrieval.yaml +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/starter/gitignore +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/storage.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/update.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/usage.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/validate.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/watch.py +0 -0
- {brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/watch_settings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: brain-framework
|
|
3
|
-
Version: 21.0
|
|
3
|
+
Version: 21.1.0
|
|
4
4
|
Summary: 🧠 Brain Framework: from information to informed actions.
|
|
5
5
|
Keywords: ai,ai-agents,agent-memory,context-engineering,knowledge-management,local-first,mcp,model-context-protocol,python,second-brain
|
|
6
6
|
Author: Médéric Hurier
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# https://packaging.python.org/en/latest/specifications/pyproject-toml/
|
|
2
2
|
[project]
|
|
3
3
|
name = "brain-framework"
|
|
4
|
-
version = "21.0
|
|
4
|
+
version = "21.1.0"
|
|
5
5
|
description = "🧠 Brain Framework: from information to informed actions."
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
requires-python = ">=3.14"
|
|
@@ -48,6 +48,7 @@ from bf.models import (
|
|
|
48
48
|
decode,
|
|
49
49
|
digest,
|
|
50
50
|
encode,
|
|
51
|
+
retried,
|
|
51
52
|
timestamp,
|
|
52
53
|
)
|
|
53
54
|
from bf.replies import ASSISTANT
|
|
@@ -491,7 +492,7 @@ def _execute(store: Store, key: str, runner: Runner) -> dict[str, object]:
|
|
|
491
492
|
key,
|
|
492
493
|
message,
|
|
493
494
|
uncertain=current["state"] == "running" and not isinstance(error, NotStartedError),
|
|
494
|
-
idempotent=work.settings.idempotent,
|
|
495
|
+
idempotent=retried(work.settings.idempotent, work.kind),
|
|
495
496
|
retry=isinstance(error, GateError),
|
|
496
497
|
)
|
|
497
498
|
with suppress(Error, OSError):
|
|
@@ -991,6 +991,11 @@ class AssistantInput(Model):
|
|
|
991
991
|
Invocation = Literal["input", "schedule", "manual", "wake"]
|
|
992
992
|
|
|
993
993
|
|
|
994
|
+
def retried(idempotent: object, kind: str) -> bool:
|
|
995
|
+
"""Whether a failed attempt of a run of this kind retries by itself: `idempotent` is true or lists the kind."""
|
|
996
|
+
return idempotent is True or (isinstance(idempotent, list) and kind in idempotent)
|
|
997
|
+
|
|
998
|
+
|
|
994
999
|
class Gate(Command):
|
|
995
1000
|
"""A deterministic check that runs before the harness and lists the events worth a model run."""
|
|
996
1001
|
|
|
@@ -1140,10 +1145,10 @@ class Assistant(Command):
|
|
|
1140
1145
|
description="Keep this many newest run records in memories/NAME/; older ones are removed after a run. Unset "
|
|
1141
1146
|
"keeps every run.",
|
|
1142
1147
|
)
|
|
1143
|
-
idempotent: bool = Field(
|
|
1148
|
+
idempotent: bool | Annotated[list[Invocation], Field(max_length=4)] = Field(
|
|
1144
1149
|
default=False,
|
|
1145
1150
|
description="Retry failed or interrupted pre-answer harness attempts automatically with backoff instead of "
|
|
1146
|
-
"leaving the job uncertain.",
|
|
1151
|
+
"leaving the job uncertain: true for every run, or the run kinds to retry, such as [schedule, wake].",
|
|
1147
1152
|
)
|
|
1148
1153
|
inputs: Annotated[list[AssistantInput], Field(max_length=32)] = Field(default_factory=list)
|
|
1149
1154
|
post: Name | None = Field(
|
|
@@ -17,7 +17,20 @@ from pydantic import Field, JsonValue, ValidationError, field_validator
|
|
|
17
17
|
|
|
18
18
|
from bf.config import load
|
|
19
19
|
from bf.messages import Message, Outgoing, Receipt
|
|
20
|
-
from bf.models import
|
|
20
|
+
from bf.models import (
|
|
21
|
+
Assistant,
|
|
22
|
+
Error,
|
|
23
|
+
Invocation,
|
|
24
|
+
Model,
|
|
25
|
+
Name,
|
|
26
|
+
Record,
|
|
27
|
+
Send,
|
|
28
|
+
decode,
|
|
29
|
+
digest,
|
|
30
|
+
encode,
|
|
31
|
+
retried,
|
|
32
|
+
timestamp,
|
|
33
|
+
)
|
|
21
34
|
from bf.storage import QUEUE, BusyError, Store, collecting, lock_file, runtime_store
|
|
22
35
|
|
|
23
36
|
DATABASE = QUEUE
|
|
@@ -740,12 +753,15 @@ class Queue:
|
|
|
740
753
|
"""
|
|
741
754
|
with self.connect() as db:
|
|
742
755
|
# No job or delivery has an empty id: an omitted one matches nothing.
|
|
743
|
-
job_row = db.execute(
|
|
744
|
-
"SELECT coalesce(json_extract(payload,'$.settings.idempotent'),0) FROM jobs WHERE id=? AND state='running'",
|
|
745
|
-
(job,),
|
|
746
|
-
).fetchone()
|
|
756
|
+
job_row = db.execute("SELECT payload,kind FROM jobs WHERE id=? AND state='running'", (job,)).fetchone()
|
|
747
757
|
if job_row is not None:
|
|
748
|
-
|
|
758
|
+
# A payload BF cannot read retries nothing: the attempt waits for inspection.
|
|
759
|
+
try:
|
|
760
|
+
payload = decode(job_row[0])
|
|
761
|
+
except Error:
|
|
762
|
+
payload = {}
|
|
763
|
+
settings = payload.get("settings") if isinstance(payload, dict) else None
|
|
764
|
+
if isinstance(settings, dict) and retried(settings.get("idempotent"), job_row[1]):
|
|
749
765
|
outcome, message = self._retry_attempt(db, job, "interrupted harness attempt")
|
|
750
766
|
db.execute(
|
|
751
767
|
"UPDATE jobs SET state=?,error=?,updated=? WHERE id=? AND state='running'",
|
|
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
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/references/actions.md
RENAMED
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/references/context.md
RENAMED
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/references/handoff.md
RENAMED
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/scripts/check-handoff.py
RENAMED
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/scripts/new-action.py
RENAMED
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-action/templates/action.md
RENAMED
|
File without changes
|
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-maintain/references/conflicts.md
RENAMED
|
File without changes
|
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-maintain/references/operations.md
RENAMED
|
File without changes
|
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-setup/references/discovery.md
RENAMED
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-setup/references/import.md
RENAMED
|
File without changes
|
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-setup/scripts/inventory.py
RENAMED
|
File without changes
|
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/consolidate.md
RENAMED
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/decisions.md
RENAMED
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/evidence.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/references/retrieval.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{brain_framework-21.0.1 → brain_framework-21.1.0}/src/bf/skills/bf-use/scripts/guarded-write.py
RENAMED
|
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
|