amfs-http-server 0.3.47__tar.gz → 0.3.48__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.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: amfs-http-server
3
- Version: 0.3.47
3
+ Version: 0.3.48
4
4
  Summary: AMFS HTTP/REST API server with SSE support
5
5
  License-Expression: Apache-2.0
6
6
  Requires-Python: >=3.11
7
- Requires-Dist: amfs-core>=0.3.39
8
- Requires-Dist: amfs>=0.5.31
7
+ Requires-Dist: amfs-core>=0.3.40
8
+ Requires-Dist: amfs>=0.5.32
9
9
  Requires-Dist: fastapi>=0.115
10
10
  Requires-Dist: httpx>=0.27
11
11
  Requires-Dist: sse-starlette>=2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "amfs-http-server"
3
- version = "0.3.47"
3
+ version = "0.3.48"
4
4
  description = "AMFS HTTP/REST API server with SSE support"
5
5
  requires-python = ">=3.11"
6
6
  license = "Apache-2.0"
@@ -13,7 +13,7 @@ dependencies = [
13
13
  # this tree is what test_dependency_floors forbids.
14
14
  # 0.5.18 for AgentMemory.as_agent, which the agent detail page calls to list
15
15
  # an agent's entries as that agent rather than as the server.
16
- "amfs>=0.5.31",
16
+ "amfs>=0.5.32",
17
17
  # 0.3.23 is real in the silent way: the write path calls
18
18
  # adapter.scope_counts(), which is a default on AdapterABC from 0.3.23. On an
19
19
  # older core the adapters that do not override it — filesystem, S3 — have no
@@ -27,7 +27,7 @@ dependencies = [
27
27
  # unexpected keyword, _scope_block swallows it, and the block disappears —
28
28
  # while an adapter that ignored the argument instead would name another
29
29
  # agent's private keys. Either way the floor is what makes the rule real.
30
- "amfs-core>=0.3.39",
30
+ "amfs-core>=0.3.40",
31
31
  "fastapi>=0.115",
32
32
  # 0.37 is where uvicorn.run() grew timeout_worker_healthcheck, which
33
33
  # main() passes unconditionally; on anything older that is a TypeError
@@ -3339,10 +3339,32 @@ async def retrieve_entries(
3339
3339
  top is not None and not top_rescued and _regime_shifted(top, now=now)
3340
3340
  )
3341
3341
  hit_statuses = [str(e.evidence_status) for e, _, _ in head if e.evidence_status]
3342
+ # The situation-exact record: the lessons among the hits that are
3343
+ # about this task (their situation compared to the declared one, else
3344
+ # found in the task text). They re-order the plan — priors are pooled
3345
+ # over a neighbourhood that can hold two classes with opposite
3346
+ # answers; a lesson names one class.
3347
+ from amfs_core.lessons import applicable_claims as _applicable_claims
3348
+ from amfs_core.lessons import lesson_of as _lesson_of
3349
+
3350
+ # Not the avoided ones: an avoided lesson is one retrieve hid because
3351
+ # it failed on this kind of task, and its status need not say
3352
+ # ``discredited`` yet — a locally falsified "worked" claim must not
3353
+ # promote the action it was falsified on.
3354
+ avoided_keys = {e.entry_key for e in avoided}
3355
+ lesson_rows = []
3356
+ for e in local_pool:
3357
+ if e.entry_key in avoided_keys:
3358
+ continue
3359
+ lesson = _lesson_of(e.value)
3360
+ if lesson is not None:
3361
+ lesson_rows.append(dict(lesson, evidence_status=e.evidence_status))
3362
+ claims = _applicable_claims(lesson_rows, req.query, declared=req.situation)
3342
3363
  recommendation = _recommend(
3343
3364
  priors,
3344
3365
  agent_id=req.agent_id or "",
3345
3366
  candidate_actions=req.candidate_actions,
3367
+ lessons=claims or None,
3346
3368
  top_hit_status=(
3347
3369
  str(top_bd.get("evidence_status") or top.evidence_status)
3348
3370
  if top is not None else None