ARTEX/server
Autumn-27 43ff830d91 fix(assets): 企业归属重算不再被单行非法 ip 打挂,并明确告知是哪些资产
assets.ip 是自由文本(Agent 的 insert_assets 和资产 API 都可能写进主机名),
而 db/companies.go 的 IP/CIDR 归属匹配裸转 a.ip::inet。只要表里有一行不是
合法 IP,PostgreSQL 就抛 22P02 中断整条语句,连带同事务的新增/修改企业资产
范围、删除企业全部失败回滚。这个裸转从项目初始化提交就存在。

- schema.sql 新增 try_inet(text):非法值返回 NULL 而不是抛错。没用
  pg_input_is_valid 是因为那要 PG16+,这里要兼容更老的存量库。
- 四处 IP/CIDR 匹配统一改用 try_inet。原先 task_scope.go 和
  task_assets_context.go 用的正则 a.ip !~ '[^0-9a-fA-F:.]' 只检查字符集,
  abc.def 这类全 hex 字母的主机名照样漏过去后炸,一并换掉。
- 跳过不能是静默的:重算会统计并抽样列出这些资产(id + 取值),说明它们不会
  被网段规则归属。信息通过企业范围接口新增的 warnings 字段返回并在前端以
  长停留 toast 展示,同时无条件写入服务端日志,覆盖没有前端响应的路径
  (删除企业、scopesentry 同步、Agent 写入)。
- warnings 与 errors 分开:errors 仍只表示本次提交里不合法的行,既有数据
  问题不该被记到用户这次输入头上。

验证: 干净库上 go test -p 1 ./... 仅剩 1 个既有失败(TestCompanyScopeInvalid,
与本改动无关,stash 后同样失败);改动前在含真实数据的库上有 14 个失败,现已
全部通过。go build / vet / gofmt / tsc / biome 均通过。
2026-08-24 10:16:17 -04:00
..
assembly.go feat(skills): track usage and missing dependencies 2026-08-24 19:30:14 +08:00
assembly_test.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
assets.go fix(assets): 企业归属重算不再被单行非法 ip 打挂,并明确告知是哪些资产 2026-08-24 10:16:17 -04:00
assets_scope_test.go feat(assets): add editable company and task scopes 2026-08-24 19:29:14 +08:00
auth.go fix(security): jwt.key 移出可浏览工作区(存项目根,自动从 data 迁移) 2026-08-11 10:56:39 -04:00
broadcast.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
chatupload.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
commands.go feat(metrics): add persistent LLM usage analytics 2026-08-24 19:30:07 +08:00
constraints_api.go 同步 2026-08-24 14:14:15 +08:00
conversations.go feat(chat): add conversation pinning and rename controls 2026-08-24 19:29:38 +08:00
core_test.go feat(api): integrate task workflows and mock contracts 2026-08-24 19:31:16 +08:00
customtool.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
customtool_test.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
dto.go feat(api): integrate task workflows and mock contracts 2026-08-24 19:31:16 +08:00
engine.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
engine_cancelcause_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
engine_llm_calls_test.go feat(llm): add profile failover and pool health 2026-08-24 19:28:18 +08:00
engine_timeout.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
findings_groups.go feat(findings): group findings and add deepen workflows 2026-08-24 19:29:24 +08:00
findings_groups_test.go feat(findings): group findings and add deepen workflows 2026-08-24 19:29:24 +08:00
goals.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
goals_api.go 同步 2026-08-24 14:14:15 +08:00
goals_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
inheritance_api_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
inheritance_dto_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
intercept.go 同步 2026-08-24 14:14:15 +08:00
llmpool.go feat(llm): add profile failover and pool health 2026-08-24 19:28:18 +08:00
llmpool_test.go feat(llm): add profile failover and pool health 2026-08-24 19:28:18 +08:00
logsink.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
manager.go feat(tasks): 任务列表支持批量修改分类 2026-08-24 09:16:44 -04:00
manager_delete_files_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
manager_lifecycle_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
mcpdiscover.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
mgmt_test.go fix(security): jwt.key 移出可浏览工作区(存项目根,自动从 data 迁移) 2026-08-11 10:56:39 -04:00
orchestration.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
platform_tools.go refactor(asset): delete_assets_by_host 改为平台工具(默认绑 Auto) 2026-08-09 04:49:57 -04:00
platform_tools_test.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
prompt_vars_test.go 同步 2026-08-24 14:14:15 +08:00
scheduler.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
server.go feat(tasks): 任务列表支持批量修改分类 2026-08-24 09:16:44 -04:00
server_mgmt.go feat(api): integrate task workflows and mock contracts 2026-08-24 19:31:16 +08:00
skill_usage.go feat(skills): track usage and missing dependencies 2026-08-24 19:30:14 +08:00
sync_scopesentry.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
task_admission_test.go 同步 2026-08-24 14:14:15 +08:00
task_assets.go feat(assets): add editable company and task scopes 2026-08-24 19:29:14 +08:00
task_categories.go feat(tasks): 任务列表支持批量修改分类 2026-08-24 09:16:44 -04:00
task_categories_test.go feat(tasks): 任务列表支持批量修改分类 2026-08-24 09:16:44 -04:00
task_control.go feat(tasks): 任务列表支持批量修改分类 2026-08-24 09:16:44 -04:00
task_control_routes_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
task_delete_barrier_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
task_llm.go 同步 2026-08-24 14:14:15 +08:00
task_llm_test.go 同步 2026-08-24 14:14:15 +08:00
task_resolution.go 同步 2026-08-24 14:14:15 +08:00
task_templates.go feat(tasks): add categories templates and batch controls 2026-08-24 19:29:46 +08:00
task_templates_test.go feat(tasks): add categories templates and batch controls 2026-08-24 19:29:46 +08:00
testmain_test.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
tools_wire_test.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
triggers.go feat(trigger): 新增"任务创建"触发机制(on_task_create) 2026-08-09 02:19:29 -04:00
webui_embed.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
webui_stub.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
workspace.go feat(workspace): 新增工作空间文件管理器(针对 workDir) 2026-08-09 01:01:19 -04:00