Commit Graph

568 Commits

Author SHA1 Message Date
jxxghp
d743df25d5 fix(architecture): sync subscription governance baselines 2026-09-03 12:22:03 +08:00
jxxghp
eefc34076e Merge pull request #6561 from InfinityPacer/codex/subscription-governance-logging 2026-09-03 12:10:13 +08:00
InfinityPacer
af47c1abee feat(subscription): add governance logging summaries 2026-09-03 11:55:51 +08:00
jxxghp
71147c1d96 feat(classification): support multi-source media rules 2026-09-03 11:51:18 +08:00
InfinityPacer
68880dbbf1 优化订阅执行治理与规模性能 (#6557)
* feat(subscription): govern concurrent search and match execution

* refactor(subscription): consume complete candidate snapshots

* refactor(subscription): remove download submission ledger

* feat(subscription): stagger fallback searches without site gaps

* refactor(subscription): remove unused retry capability

* test(subscription): verify complete scale execution

* fix(subscription): surface site search failures

* test(subscription): verify site pressure through search

* test(subscription): use static facade imports

* fix(subscription): preserve completed downloads on shutdown

* fix(subscription): classify execution expiry as failure

* fix(subscription): preserve fallback search staggering

* test(subscription): stabilize unfinished wrapper gate

* fix(subscription): settle expired search returns

* style(subscription): normalize governance imports

* fix(subscription): align governance type contracts

* docs(architecture): sync mypy debt metric

* docs(architecture): sync startup module counts
2026-09-03 11:26:24 +08:00
jxxghp
d94f827ae1 chore(architecture): refresh dependency snapshot 2026-09-02 20:34:53 +08:00
Aqr-K
862ed4d5b8 fix(plugin): 插件 schema 不再回落 public,迁移目录拒绝相对路径
PostgreSQL 下 search_path 留了 public 兜底,插件 schema 里不存在的表名会继续
解析到宿主同名表,一条未限定的 DELETE 就能改到宿主数据;解析根收敛为插件自己的
schema,找不到的表名直接报错。

get_database_migrations() 的合同要求绝对路径,此前只校验目录是否存在,相对路径
会按宿主进程的当前工作目录解析成另一条迁移链,改为直接拒绝。
2026-09-02 02:38:18 -04:00
Aqr-K
a4d38e0f12 fix(plugin): 卸载先停后删、销毁全程持锁,PostgreSQL 会话按插件 schema 解析原生 SQL
卸载编排改为先停插件再删数据:插件的停机钩子取一次自有库句柄就能把刚删除的数据重新
建出来,注册表因此不再需要销毁墓碑,release 恢复为「只释放连接、保留数据」的单一语义。
停止同时注销插件类,其后的删除一律按 force 执行。

destroy_database 的摘句柄、关连接与删载体全部收进同一把锁:原先在锁外删除载体,并发的
get_database 能在间隙注册一个指向同一载体的新句柄,随后的删除会把它一并抹掉。

PostgreSQL 句柄在派生引擎上注册 begin 监听器,按事务执行 SET LOCAL search_path,让
schema_translate_map 覆盖不到的原生 SQL 同样解析到插件自己的 schema;监听器只挂在
OptionEngine 上,宿主引擎与其它插件的连接不受影响。
2026-09-02 02:14:19 -04:00
Aqr-K
d7c5955031 fix(plugin): 插件自有数据库释放与销毁全程容错,并修正建表去重与 schema 命名
release/destroy 统一经 _close_handle 先清线程局部会话再 dispose,两步失败都
只记日志:单个插件的连接池故障不再让 close_database 跳过宿主同步与异步引擎的
释放,release_all_databases 也逐插件隔离。按模型建表对 __table__ 去重,单表
继承的父子类一并声明时不再对同一张表建两次。

卸载编排先删插件数据、后停插件,停机钩子里的 get_database() 会把刚销毁的库
重新建出来:注册表记下已销毁的插件标识,其后的 release 改为再次销毁并清除
标记,ensure 则撤销标记,宿主编排代码不动。PostgreSQL schema 名在归一改写过
标识或超长时追加插件标识哈希并截到 63 字节,My-Plugin、My_Plugin 与
my_plugin 不再折叠到同一个 schema 而在卸载时互相 DROP。

start 的失败分支释放已经建立、却进不了运行态的句柄,整体停止把只登记在
_classes 里的插件一并释放。声明的迁移目录不存在时在建句柄之前抛
FileNotFoundError,不再留下空库;SQLite 迁移 URL 改由引擎渲染;
_get_sqlite_engine 的连接参数下沉到实际使用它的异步分支。
2026-09-02 02:14:19 -04:00
Aqr-K
adf4c84136 chore(architecture): 刷新宿主架构依赖、契约与启动性能基线
dependency-baseline.json 新增 7 个插件数据库模块及其依赖边,boundary_edges
12 个键仍全为空;runtime-contract-baseline.json 新增 app.sdk.database 的
两项 SDK 导出。app.db.session 起在冷启动路径新增 5 个轻量插件框架模块
(不含 alembic,其导入仍收在 ensure_database 内部),同步刷新
startup-performance-baseline.json 的模块计数;架构文档中引用的模块/边数
量同步更新,保持与快照一致。
2026-09-02 02:14:19 -04:00
Aqr-K
626d8217ba feat(plugin): 开放插件自有数据库声明与句柄接口
_PluginBase 新增 get_database_models()/get_database_migrations() 声明钩子
与 get_database() 句柄入口,按类名(含分身)解析插件标识;
app/sdk/database.py 导出 plugin_declarative_base 与 PluginDatabaseHandle。
docs/rules/10-data-and-persistent.md 补充 Plugin-Owned Databases 小节,
说明 db_query/db_update 的自动兜底仍绑定宿主会话、需显式传入插件会话。
2026-09-02 02:14:19 -04:00
jxxghp
d0eddb86eb chore(architecture): refresh dependency baseline 2026-09-02 13:05:50 +08:00
jxxghp
b534bfc9bb docs(architecture): sync ruff metric 2026-09-02 09:20:27 +08:00
jxxghp
535d3adf16 docs(docker): 梳理容器启动流程并清理遗留逻辑 2026-09-02 08:30:19 +08:00
jxxghp
95913dc32a fix: satisfy update architecture contracts 2026-09-02 00:15:35 +08:00
jxxghp
658fa473d8 feat: support staged site resource updates 2026-09-01 23:49:53 +08:00
jxxghp
3b4d7399bf chore(architecture): lower Ruff diagnostic baseline 2026-09-01 18:14:04 +08:00
jxxghp
e433eb5c13 fix(agent): stabilize Windows shell CI checks 2026-09-01 18:04:02 +08:00
jxxghp
68a7614262 Merge pull request #6535 from jxxghp/codex/subscription-governance
Codex/subscription governance
2026-09-01 17:59:19 +08:00
jxxghp
ef0f4f7ef4 feat(agent): improve Windows shell compatibility 2026-09-01 17:51:15 +08:00
jxxghp
857aa813e5 fix(subscribe): satisfy final governance gates 2026-09-01 17:50:08 +08:00
jxxghp
8054fbafe6 docs(subscribe): refresh rebased evidence refs 2026-09-01 17:10:50 +08:00
jxxghp
8de5bf5e78 docs(subscribe): record governance acceptance evidence 2026-09-01 17:09:55 +08:00
jxxghp
e57288b5ea refactor(subscribe): satisfy global governance gates 2026-09-01 17:09:55 +08:00
jxxghp
db5c316756 refactor(subscribe): make download submission idempotent 2026-09-01 17:09:54 +08:00
jxxghp
9c4598c86b test(subscribe): validate joint search governance 2026-09-01 17:09:54 +08:00
jxxghp
bab1d2862e refactor(subscribe): govern fallback site pressure 2026-09-01 17:09:54 +08:00
jxxghp
389131acd6 refactor(subscribe): persist fallback search queue 2026-09-01 17:08:53 +08:00
jxxghp
74f6bb89b5 perf(subscribe): bound candidate routing work 2026-09-01 17:08:53 +08:00
jxxghp
77e4a80286 refactor(subscribe): reuse fresh facts within batch 2026-09-01 17:08:53 +08:00
jxxghp
250b56c523 refactor(subscribe): separate match from reconciliation 2026-09-01 17:08:53 +08:00
jxxghp
04ecfbd7f6 refactor(subscribe): introduce candidate batch index 2026-09-01 17:08:53 +08:00
jxxghp
113ca6da92 test(subscribe): establish governance replay baseline 2026-09-01 17:08:53 +08:00
jxxghp
dc8fcae19c ci: scope rclone vulnerability exception 2026-09-01 16:27:18 +08:00
jxxghp
f5c73dcabc fix(architecture): lower Ruff diagnostic baseline 2026-09-01 12:33:29 +08:00
jxxghp
5e215a45d5 fix(architecture): record verbose callback edge 2026-09-01 12:25:12 +08:00
jxxghp
5948684d6d fix(architecture): record agent sanitizer edge 2026-09-01 12:15:58 +08:00
jxxghp
449ef4b8df fix(agent): show API parameters in verbose mode 2026-09-01 11:57:36 +08:00
jxxghp
41c54d138d refactor(agent): relocate static resources 2026-09-01 11:55:21 +08:00
jxxghp
2f7f2da300 fix(agent): preserve collection totals in truncated results 2026-09-01 10:49:22 +08:00
jxxghp
1850c91b00 docs(agent): close explicit pagination phase 2026-09-01 09:21:47 +08:00
jxxghp
d512f528be refactor(api): make collection pagination explicit 2026-09-01 09:13:56 +08:00
jxxghp
a73714e5e7 feat(agent): add compatible collection pagination 2026-09-01 07:43:55 +08:00
jxxghp
70a0019ae6 docs: refresh transfer architecture baselines 2026-09-01 07:28:17 +08:00
jxxghp
6534eca295 docs: mark agent refactor complete 2026-09-01 02:02:28 +08:00
jxxghp
3106984dfc docs: sync architecture quality metrics 2026-09-01 01:53:25 +08:00
jxxghp
e5722ed987 fix: finalize agent architecture ratchets 2026-09-01 01:46:22 +08:00
jxxghp
28298c485c fix: keep plugin endpoint within complexity budget 2026-09-01 01:29:15 +08:00
jxxghp
6d4d7331d1 refactor: complete agent skill API contracts 2026-09-01 01:19:45 +08:00
jxxghp
6de3053164 fix(ci): refresh dependency architecture snapshot 2026-08-31 18:51:19 +08:00