feat: 报告结构支持检索方向/来源与智能新增,并修复协助卡停轮与宿主跳转
为深度研究报告结构增加检索方向与技能来源、对话式智能新增页与详情排版;澄清中间件在 after_model 可靠结束本轮,避免弱模型出卡后继续生成;任务按钮补充 host 跳转与相关深链能力。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a5a9c952e8
commit
51afebb394
67 files changed
+4511
-699
No files matched your search
+49
@@ -0,0 +1,49 @@
|
||||
"""Add structure_mode to report_structures.
|
||||
|
||||
Per-structure 结构约束: ``fixed`` (固定大纲) vs ``adaptive`` (弹性大纲).
|
||||
Existing rows stay ``adaptive`` so current writing behaviour is unchanged.
|
||||
|
||||
``create_all`` adds the column for brand-new DBs; the startup
|
||||
``_ensure_orm_columns_sync`` sweep adds it to already-existing tables.
|
||||
|
||||
Revision ID: 20260821_01
|
||||
Revises: 20260819_02
|
||||
Create Date: 2026-08-21
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260821_01"
|
||||
down_revision = "20260819_02"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
inspector = inspect(op.get_bind())
|
||||
return any(col["name"] == column_name for col in inspector.get_columns(table_name))
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("report_structures") and not _has_column("report_structures", "structure_mode"):
|
||||
op.add_column(
|
||||
"report_structures",
|
||||
sa.Column("structure_mode", sa.String(length=16), nullable=False, server_default="adaptive"),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_column("report_structures", "structure_mode"):
|
||||
op.drop_column("report_structures", "structure_mode")
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
"""Add retrieval_directions to report_structures.
|
||||
|
||||
Optional 检索方向 list on each 报告结构. Empty / NULL keeps today's
|
||||
collector query-planning; a non-empty list tells material collection to
|
||||
search along those facets.
|
||||
|
||||
ORM: ``ReportStructureRow.retrieval_directions = PortableJSON()``
|
||||
(SQLite/PG native JSON, MySQL TEXT). ``create_all`` adds the column on
|
||||
brand-new DBs; existing tables are patched by startup
|
||||
``_ensure_orm_columns_sync`` (nullable, no server_default required).
|
||||
|
||||
Revision ID: 20260822_01
|
||||
Revises: 20260821_01
|
||||
Create Date: 2026-08-22
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260822_01"
|
||||
down_revision = "20260821_01"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
inspector = inspect(op.get_bind())
|
||||
return any(col["name"] == column_name for col in inspector.get_columns(table_name))
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("report_structures") and not _has_column("report_structures", "retrieval_directions"):
|
||||
op.add_column(
|
||||
"report_structures",
|
||||
sa.Column("retrieval_directions", sa.Text(), nullable=True),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_column("report_structures", "retrieval_directions"):
|
||||
op.drop_column("report_structures", "retrieval_directions")
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
"""Add retrieval_skills to report_structures.
|
||||
|
||||
Optional 检索来源 list of skill names on each 报告结构. Empty / NULL keeps
|
||||
today's collector tools; a non-empty list tells material collection to
|
||||
call those skills.
|
||||
|
||||
ORM: ``ReportStructureRow.retrieval_skills = PortableJSON()``
|
||||
(SQLite/PG native JSON, MySQL TEXT). ``create_all`` adds the column on
|
||||
brand-new DBs; existing tables are patched by startup
|
||||
``_ensure_orm_columns_sync`` (nullable, no server_default required).
|
||||
|
||||
Revision ID: 20260822_02
|
||||
Revises: 20260822_01
|
||||
Create Date: 2026-08-22
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260822_02"
|
||||
down_revision = "20260822_01"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
inspector = inspect(op.get_bind())
|
||||
return any(col["name"] == column_name for col in inspector.get_columns(table_name))
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("report_structures") and not _has_column("report_structures", "retrieval_skills"):
|
||||
op.add_column(
|
||||
"report_structures",
|
||||
sa.Column("retrieval_skills", sa.Text(), nullable=True),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_column("report_structures", "retrieval_skills"):
|
||||
op.drop_column("report_structures", "retrieval_skills")
|
||||
Reference in new issue
Block a user