feat: persist feature research and versioned alpha assessments

This commit is contained in:
yuxuanhui
2026-09-08 21:52:46 +08:00
parent f89ae211d2
commit eb4850a003
32 changed files with 2003 additions and 20 deletions
+20
View File
@@ -0,0 +1,20 @@
"""Feature plans remain versioned inputs to the shared template research path."""
from fastapi import HTTPException
from .assets import Assets
from .workspace_contracts import AssetWrite
class Features:
def __init__(self, db):
self.assets = Assets(db)
async def to_template(self, asset_id, version):
feature = await self.assets.get(asset_id, version, "feature")
if not feature["content"].get("template"):
raise HTTPException(422, "特征方案尚未定义输出模板")
return await self.assets.save(
AssetWrite(kind="template", content=feature["content"]["template"]),
provenance={"feature": feature},
)