fix(news): preserve event scope and bound research context
Select assignment-specific keyword snapshots, improve model-token recall and calendar dates, and reuse supplied originals. Keep extraction boundaries while checking compaction against the final research context.
This commit is contained in:
1 parent
201f22596f
commit
dd50cb7df8
6 files changed
+756
-21
No files matched your search
@@ -195,7 +195,7 @@ async def enable(session: DB):
|
||||
},
|
||||
Assignment,
|
||||
)
|
||||
service.validate_assignment(assigned, fixture, set())
|
||||
service.validate_assignment(assigned, fixture, set(), indexed.model_dump()["keywords"])
|
||||
provider, skill, _ = await service.model_config(
|
||||
session, original_config, "research"
|
||||
)
|
||||
@@ -206,7 +206,19 @@ async def enable(session: DB):
|
||||
"id": 1,
|
||||
"event": {"id": 1, "title": fixture["title"]},
|
||||
"articles": [fixture],
|
||||
"packages": [{"id": 1, "news_id": 1}],
|
||||
"packages": [{
|
||||
"id": 1, "news_id": 1,
|
||||
"scope_quote": assigned.targets[0].quote,
|
||||
"reason": assigned.targets[0].reason,
|
||||
"keywords": [k for k in indexed.model_dump()["keywords"]
|
||||
if k["canonical"] in assigned.targets[0].keyword_canonicals],
|
||||
"keyword_canonicals": assigned.targets[0].keyword_canonicals,
|
||||
"scope_selection": "assignment",
|
||||
"other_scopes": [
|
||||
{"title": t.title, "scope_quote": t.quote, "reason": t.reason}
|
||||
for t in assigned.targets[1:]
|
||||
],
|
||||
}],
|
||||
"package_ids": [1],
|
||||
"previous": None,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user