Autumn-27
4756bb1c45
feat(intent): 意图删除支持假删除/真删除两种模式
...
删除入口区分两种模式(待领/运行中/已暂停的意图均可删除):
- 假删除(默认):意图置 state='deleted'、删除原因记入新字段 delete_reason,
保留节点与全部产出/血缘,不再在图上另挂 fact。
- 真删除:物理删除意图及「仅由它支撑」的独占子孙(沿 yields/derived_from
级联到叶子),避免孤立数据;共享节点、目标、任务根事实保留。被删意图先做
token rollup 并清理 activity/副会话,被删 finding 先删 findings 行。
两种模式都照常用 cancelled 触发通知 planner(带删除前捕获的意图摘要 + 原因),
planner 文案不再声称原因挂为事实。
- DB: 新增 SoftDeleteIntent、重写 CancelIntent 为深度独占级联;schema 加
delete_reason 列与 intent 的 deleted 状态(含旧库迁移)。
- 前端: 删除对话框加模式切换与动态说明,状态徽章/图标新增「已删除」,
播报板展开展示删除原因。
2026-09-17 12:52:57 -04:00
RuoJi6
04d25eb133
精简动作审查输入并支持审批来源定位 ( #125 )
...
* fix: 精简审查背景并区分人工消息与调度输入
* fix: 模型审查仅提交当前调用与选定背景
* feat: 审批来源定位原会话并移除 Worker 审查背景
2026-09-15 23:51:37 +08:00
RuoJi6
1a388e3e9e
feat: support legacy SSE MCP servers ( #117 )
2026-09-15 00:56:16 +08:00
Autumn-27
25b82f2544
fix(mcp): http 传输支持跳过 TLS 证书校验(自签证书)
...
MCP server 走 HTTPS 且用自签证书时,客户端 TLS 校验失败,报
"tls: failed to verify certificate" 无法连接。
mcp_servers 增加 insecure 开关(默认 false),置 true 时远程 MCP
客户端使用 InsecureSkipVerify 的 transport。stdio 传输不受影响。
- mcphttp.New 增加 insecure 参数
- db: MCPServer.Insecure 字段 + schema 加列(补 ALTER 兼容旧库)
- create_mcp/update_mcp 工具与前端 http 配置项增加勾选框
Closes #108
2026-09-11 11:37:56 -04:00
ji ruo
272004c2e4
Merge upstream/main into codex/btw-side-question
...
同步官方 main 的任务会话与 spawn_task 更新,保留 /btw 旁路上下文能力。
2026-09-11 08:47:57 +08:00
Autumn-27
ee3eb22433
feat(agent): 任务内主 Agent 支持多会话,可切换且上下文可重置
...
主 Agent 会话原为一个任务恒定单例,对话历史随 transcript 只增不减、
上下文越滚越大。现引入会话分段(seq):新建会话切一个干净的 transcript
段,任务的图谱/资产/目标共享保留,旧段以只读历史随时切回查看。
- db: 新增 main_sessions 表与 activity.main_seg 列(ALTER ADD COLUMN
IF NOT EXISTS 兼容旧库);ActivitySessionFilter 按段过滤(段 0 兼容
旧 NULL 行);新增 CurrentMainSeg/ListMainSessions/NewMainSession;
per-session token 统计按 main:<seg> 分段
- agent: MainAgent.Chat 增加 mainSeg,transcript SessionID 分段
(段 0 保留旧名 exp<id>-main 兼容既有对话)
- server: parseActivitySession 支持 main:<seq>;chat handler 每轮
stamp 当前段;新增 GET main-sessions / POST main-session/new
- web: 主 Agent 分组渲染多段会话,支持新建(轻确认)、切换、旧段只读
2026-09-10 12:56:59 -04:00
ji ruo
2930c4b915
Merge origin/main into codex/btw-side-question
...
合入 main 的 norma v0.3.7、会话分组与流量证据更新,保留 /btw 快照和输入布局。同步自动放行、关闭流量绑定的测试断言,并等待归档测试夹具的旁路后台退出。
2026-09-11 00:54:51 +08:00
ji ruo
d893861d00
fix(btw): 修复长对话上下文预算与旁路输入布局
2026-09-11 00:41:01 +08:00
Autumn-27
e8efce605c
Merge PR #102 : feat: 支持漏洞关联多条流量证据
...
冲突解决:
- db/schema.sql: 复测表(#103 )与流量证据表(#102 )均为追加,两者保留
- server/server.go: 启动序列同时保留 seedFindingRetester 与 evidence GC
- web/src/lib/types.ts: InterceptAudit/InterceptDetail(#101 ) 与流量证据类型(#102 )并存
- findings/detail/page.tsx: 去掉 #103 带入的重复 import,仅保留 FindingRetestPanel
- chat/page.tsx: 保留 #103 的 Spinner import
2026-09-10 10:04:53 -04:00
Autumn-27
071d87896d
Merge PR #103 : feat: 支持会话级漏洞复测与运行状态展示
2026-09-10 10:02:39 -04:00
ji ruo
555539bc8e
feat(agent): 支持持久化 /btw 旁路提问
2026-09-10 21:42:25 +08:00
ji ruo
82c1ed9cbb
feat: 支持会话级漏洞复测与运行状态展示
2026-09-10 16:06:08 +08:00
ji ruo
9ad323dc4c
feat(intercept): 增加审批记录详情与执行审计
2026-09-10 15:10:50 +08:00
ji ruo
ec4ef35fff
feat: 支持漏洞关联多条流量证据
2026-09-10 13:03:20 +08:00
Autumn-27
a50bf02428
feat(llm): 五层重试的次数与间隔可配
...
一次模型调用的失败由内到外经过五层重试:建连(SDK)、空响应(SDK)、同 provider
安全窗口、轮询熔断、意图重跑。此前五层的次数与间隔全是写死的常量,遇到脾气各异
的中转站只能改代码。现在都能在 LLM 页配置,不配就是原来的默认值。
配置语义五层统一(db.RetryRule):次数 0=内置默认 / -1=关掉这层 / >0=该值;
间隔 0=原本的指数退避 / >0=改用固定间隔。0 被"未配置"占用,故关闭用 -1。
写库前夹紧到 次数 [-1,20]、间隔 [0,1h],DB 另有 CHECK 兜底。
粒度按层的性质分:前三层跟着端点走,可在每个模型配置里逐字段覆盖全局默认(只钉
间隔的仍继承全局次数);熔断与意图重跑是进程级语义,只有全局一份。
生效路径:①②是 provider 构建参数,保存后重建缓存;③随每次 hooks.current()
解析,故障转移换配置时重试节奏跟着换;④在失败路径上每次都要读,由 applyRetryPolicy
推给 llmpool.Registry;⑤每条意图收尾读一次。全部热生效,无需重启。
连接测试刻意不带这些参数——它有 30s 硬超时,叠上用户配的重试只会把本来能用的
端点测成超时失败。
norma 升 v0.3.5(llm.Config 新增 RetryInterval / EmptyResponseRetries /
EmptyResponseInterval)。旧库升级后行为逐字节不变:新列默认 0,settings 键不
存在即全默认。设计见 docs/LLM重试设计.md。
2026-09-09 13:35:04 -04:00
Autumn-27
4f088e519b
feat(digest): 探索图冷节点压缩(cold-digest)
...
把老且长期不活跃的意图/事实折叠成 digest 节点进 graph_overview 展示,
原始节点永久保留、按 id 可完整还原(存储无损、只压呈现、折叠可逆)。
- 数据模型:KindDigest 节点 + RelCovers 边(真相源);新列 content_version、
cold_since_round(节点级)、round_no(任务级 planner 轮次);均带旧库迁移。
- 纯算法(coldgraph.go):冷热判定(逆向可达 + 任一活分支即热) + R=6 轮防抖 +
连通分量分组(§3) + §3.1 同父兄弟归组(救"热 hub+扁平死叶") + §5.3 签名。
- 后台压缩(compaction.go):minor 折未覆盖冷块(tiered)、major 回源重压合并碎片;
签名幂等复用 body;提交时活跃度复核(绝不覆盖已复活节点);60s 冷却 + 互斥。
- 概览折叠(§6):recent_* 剔除已折成员 + 渲染时复活检查;cold_digests + 按资产
索引 cold_index(§6.2);expand_digest/expand_index 还原;covered_members 反查
悬空血缘 id;60 兜底截断均衡保 live。
- planner 每轮 OnPlannerRound 维护戳记并触发后台压缩,绝不上热路径。
纯算法单测覆盖 §附/§3.1/§2.3/§5.3;已对 437 节点真实图验证:热 86、冷候选 324、
§3.1 分组 47 块 + 14 孤立冷点(对齐设计文档实测校验)。
2026-09-09 11:52:15 -04:00
Autumn-27
4319fe413f
feat(llm): 每个 LLM 配置支持自定义会话头
...
新增 session_header_key:非空时每次 LLM 请求带上该 HTTP 头,头值为当前
运行的 session id(chat 会话=conv-<id>,worker=exp<x>-worker-i<intent>
等)。用于某些按 session-id 头做提示缓存/粘性路由的网关。
实现:在已有的 quotaAwareTransport 里从请求 context 读取 session id
(transcript.WithSessionID 挂上的)并注入,无需改 norma;同一共享 provider
也能按会话发出不同头值。DB 加 session_header_key 列(带旧库迁移),前端
LLM 配置弹窗新增输入框。
2026-09-07 11:21:50 -04:00
Autumn-27
7cc467c159
feat(llm): 模型配置新增输出上限,支持 max_completion_tokens 字段名
...
llm_profiles 加两列:max_tokens(单次回复输出上限,0=不发送该字段,由服务端
默认值决定)与 max_tokens_field(上限发哪个键)。后者仅对 format=openai 生效:
空(默认)= max_tokens;'max_completion_tokens' = 新键。OpenAI 推理模型
(o 系列/GPT-5)拒收 max_tokens、只认新键,而多数兼容网关反过来只认旧键,
故做成显式开关而非自动推断。anthropic 与 openai-responses 自带字段名,
存下来只会误导,保存时一并清空。
顺带补上一处从未接通的链路:planner/worker/chat/mainagent/goals 五个
agentcore.Options 都没设过 MaxTokens,恒为 0——openai 系因 omitempty 压根
不发上限,anthropic 走 norma 的 8192 兜底。光加配置项而不接这条线,用户在
后台填了数字也不会生效,故本次一并接通,取值与 streaming 一样按 profile
每轮解析,故障转移切换后下一轮即生效。
task_llm.go 里 nonStreaming() 的来源优先级(agent 绑定 → 任务链激活 profile
→ 全局)抽成共用的 activeCfg(),避免 maxTokens() 再抄一份同样的三级回退。
norma 升到 v0.3.3(该版本提供 Config.MaxTokensField)。go.mod 只动 norma 这
一行:仓库此前未 tidy 过,跑 go mod tidy 会顺带升 x/crypto、x/net 等一批无关
依赖,不混进本次改动。
迁移:新列走 ADD COLUMN IF NOT EXISTS + 默认 0/'',旧库升级后行为完全不变;
CHECK 约束限定取值,每次启动先删后建保持幂等。
2026-08-31 12:20:31 -04:00
Autumn-27
23cfb9ed4e
feat(findings): 发现页新增「按资产」视图
...
左侧资产树 + 右侧该子树下的发现,与另外两个视图共用同一张表和同一批筛选。
后端
- db/finding_assets.go:按当前筛选构建资产树。只收有发现的资产,祖先链逐层
补齐(endpoint→service→subdomain/ip→root_domain),父子优先级与
BuildCoverageGraph 同源;计数沿祖先链去重累加,一条发现挂多个资产不会让
父节点重复计数
- FindingFilter 加 AssetScope:选中节点=选中整棵子树,解析成资产 id 集合后
下推 SQL,列表 / 分组 / 导出三个入口共用,导出「当前筛选」自动带上
- 「未关联资产」同时收 asset_ids 为空与指向已删资产的发现,与树上桶的口径
一致(只判空数组会让桶上的数字大于点开后的条数)
- findingFilterFromQuery 统一四处的筛选解析;新增 GIN 索引
idx_findings_asset_ids,按资产反查发现不再全表扫
前端
- 树默认展开一层,支持过滤(匹配项自动展开)、面包屑下钻、手动刷新
- 每层只显示相对上一层的增量:子域名去根域名后缀、服务显示 `https :443`、
接口只留路径。完整值在 title 与面包屑,搜索仍按完整值匹配
- 不轮询:进入视图 / 改筛选 / 页内改动发现 / 点刷新时才查
- 节点超上限时整层丢弃接口/服务并提示,计数已在上层不会丢
2026-08-31 10:58:32 -04:00
Autumn-27
21656cc2e3
fix: restore changes dropped by the upstream sync merge
...
The manual v0.3.6 sync (22132a4 ) was incomplete, and the follow-up merge
(d803ae2 ) resolved conflicts in favour of that copy, silently reverting three
shipped changes. main is already an ancestor of this branch, so re-merging
cannot bring them back; restore them explicitly.
- schema.sql: re-add the idempotent llm_profiles_format_check migration.
CREATE TABLE IF NOT EXISTS leaves an existing table alone, so databases
created before openai-responses kept the old two-value CHECK and rejected
every openai-responses profile.
- orchestration.go: re-add the reseedPlannerPrompt/reseedWorkerPrompt calls,
dropped by a comment-alignment hunk while the functions stayed behind as
dead code. Without them existing installs never receive the quantified
acceptance check or the negative-conclusion evidence threshold.
- CHANGELOG.md: restore the 0.3.6 entries, the @neouks credit and the correct
norma version range.
Also close three recovery gaps in the new cold-archive path:
- traffic: write the staging journal even when no legacy host directory
exists. Modern installs keep traffic in SQLite only, so a crash between the
PostgreSQL commit and the SQLite commit left the archived task's exclusive
traffic in the hot store with nothing for recovery to act on.
- recoverTaskArchiveStages: treat a missing journal.json as a discardable
directory instead of an error, which used to set recoveryFailed and stop the
archive worker from starting for the rest of the process lifetime.
- stageTaskArchiveFiles: replay the journal's renames when resuming an
existing staging root. The journal is written before the first rename, so
its presence did not guarantee a complete payload, and a resumed round could
package an archive missing transcripts or workspace files.
2026-08-29 01:37:46 -04:00
pphua
0ec45bb45d
fix: prevent OOM when archiving large tasks
2026-08-28 15:25:20 +08:00
pphua
d803ae2b11
merge: sync official main into PR branch
2026-08-28 14:14:41 +08:00
pphua
22132a4d21
chore: sync upstream v0.3.6 changes
2026-08-28 14:03:07 +08:00
pphua
9da521ee4e
归档
2026-08-28 12:56:29 +08:00
pphua
594436fddd
修复BUG: 1、当存在较多任务时,系统会发生卡顿,加载对话或者加载界面时候存在明显卡顿,优化性能找出问题
2026-08-28 08:00:36 +08:00
Autumn-27
12541a6dec
feat(llm): 支持 OpenAI Responses API 格式的 LLM 配置
...
依赖升级到 norma v0.3.1(新增 FormatOpenAIResponses + reasoning_content 回传
修复)。每个 LLM profile 现在可选第三种格式 openai-responses,打
POST /v1/responses,与 Chat Completions / Anthropic 并列。
- agent.Config:ConfigFrom / FromEnv / Provider() 支持 openai-responses
(BaseURL 归一化去 /responses 尾巴,默认 model gpt-5)
- server:saveLLMConfig 放开二元 format 归一;模型列表端点复用 OpenAI
/models(Responses 模型列表仍在 /v1/models)
- db: llm_profiles 的 format CHECK 约束加入 openai-responses,并幂等迁移
(DROP + ADD CONSTRAINT)补旧库
- web: 格式下拉新增「OpenAI (Responses API)」,类型与回显同步
流式/非流式两条路都走新 adapter;输出、token 统计、操作统计、LLM 录制
四条链路复用中性层,无需改动。
2026-08-25 11:39:24 -04:00
Autumn-27
587ba422b4
feat(llm): 每个 LLM 配置支持流式/非流式切换(默认流式)
...
依赖 norma v0.3.0 的 Provider.Complete。为每个 llm_profile 增加 streaming
开关:开(默认)走流式 SSE;关走真·非流式(stream:false、一次性返回完整
JSON),可绕开部分网关糟糕的 SSE 实现(空帧、思考字段丢帧),代价是失去
运行中的实时进度与实时 token 计数。
- agent.Config.Stream → agentcore.Options.NonStreaming = !Stream;worker /
planner / mainagent / chat / goals 经 SetNonStreaming resolver 注入,任务
路由按当前激活 profile 动态取值
- llmpool.Pool / llmrec.Recorder / taskLLMRuntime 三个 Provider 包装均实现
Complete(分别带故障转移 / 录制 / 同 provider 重试与额度 failover),使
输出、token 统计、操作统计、LLM 录制四条链路在非流式下保持兼容
- db: llm_profiles 新增 streaming 列 + ALTER 补旧库(默认 true,旧配置无感)
- 系统 → LLM 配置表单增加「流式输出」开关
2026-08-25 10:49:47 -04:00
pphua
86eb67ea0a
1、将排序做到border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted里,无需单独做个button 2、指定重命名使用ICO,无需使用菜单
2026-08-25 14:56:15 +08:00
pphua
48e85b33d6
Merge tag 'v0.3.4'
2026-08-25 12:18:24 +08:00
pphua
d968727460
抽屉优化
2026-08-25 12:05:26 +08:00
Autumn-27
9e98407528
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
pphua
ec971c63d2
feat(api): integrate task workflows and mock contracts
2026-08-24 19:31:16 +08:00
pphua
58f23a2773
同步
2026-08-24 14:14:15 +08:00
Autumn-27
8092167ae5
feat: finding 增加详细报告字段 report(Markdown),详情页证据下方渲染
...
- findings 表加 report 列(TEXT 默认空,schema + ALTER 补旧库)
- 仅 GetFinding 查 report,列表/分页不带以免 payload 膨胀;FindingDTO.report omitempty
- 详情页「概览」证据卡下方新增「详细报告」卡,复用 <Markdown> 组件渲染,空时占位提示
- 前端 Finding.report? 类型;mock 单条 GET 返回 report、列表剥掉,并给 f-12 加示例报告
- 字段先留空,后续由写入方填充;db 测试补 report 往返断言
next build 通过。
2026-08-18 11:52:34 -04:00
Autumn-27
ff3d41ea35
feat: 漏洞新增 severity=critical(严重) 与 name(漏洞名称)字段
...
severity 严重级:
- report_finding 工具 severity 说明改为 critical|high|medium|low
- DB 排序 CASE、report 报告 sevRank、FindingStats 增加 critical
- 前端 Severity 类型、status.ts 新增 rose 色调(实心高强调,视觉高于高危)、
发现页严重度筛选/统计卡、任务发现 Tab 排序、dashboard 汇总均加入严重
name 漏洞名称:
- findings 表加 name 列(schema + ALTER TABLE ADD COLUMN IF NOT EXISTS 补旧库)
- report_finding 工具新增 name 入参(非必填),写入 node payload 与独立 findings 行
- DBFinding/AddFinding/AddStandaloneFinding、FindingDTO、findingPayload、report 全链路透传
- 发现列表页与任务发现 Tab 展示 name,为空时回退 vulnclass;vulnclass 移到展开详情「类型」
- report 报告标题优先 name,回退 vulnclass
无 CHECK 约束,旧库仅需补 name 列;critical/name 均向后兼容。
db 测试补充 critical 排序/统计与 name 往返断言。
2026-08-18 11:21:08 -04:00
Autumn-27
7b3eec2166
feat: 发现处置状态扩展为 8 个
...
在 待处理/误报/忽略/已处理 基础上新增:
- in_progress 处理中(已受理、修复/验证中)
- confirmed 已确认(真实漏洞未修复)
- duplicate 重复
- risk_accepted 风险接受(确认存在但业务接受)
改动:db 常量 + ValidFindingStatus 白名单、schema 注释、status.ts 色板/文案、
types.ts 联合类型、两处下拉的 FINDING_STATUSES(下拉与状态筛选自动带出)。
状态无 CHECK 约束,旧库无需迁移。
2026-08-18 10:37:13 -04:00
Autumn-27
05f0b69469
feat: finding 增加处置状态(待处理/误报/忽略/已处理)+ 发现列表页改版
...
- findings 表新增 status 列(默认 pending),schema.sql 同步 ALTER TABLE 补旧库
- 新增 PATCH /api/exploration/findings/{id} 更新处置状态,server 侧白名单校验
- FindingDTO 增加 status/finding_id/assets(后端预渲染资产 label)
- 任务内发现节点通过 node_id 关联独立 findings 行,复用同一处置状态
- 发现列表页:漏洞名称(类型主 + 摘要小字)、新增资产列与状态列(可下拉修改)、状态筛选与待处理统计
- 任务详情发现 Tab 同步展示/编辑处置状态与绑定资产
2026-08-18 09:46:46 -04:00
Autumn-27
80fcf528dc
feat: 提示词新增全局变量 DataDir + 触发合并/种子意图默认值调整
...
- prompt: 新增全局运行时变量 {{.DataDir}}(服务端数据根目录 s.m.dir),
与 {{.Now}} 一样对所有 agent(planner/worker/mainagent/goals/chat 及自定义)可用;
各 Vars 结构体加 DataDir 字段并在渲染时填入根 workDir,globalPromptVars 登记以便
校验/UI 变量列表/预览识别(纯运行时变量,不入库,无需迁移)。
- trigger_merge_mode 默认 by_task→all(schema/config/后端兜底/前端初值同步)。
- seed_first_intent 默认 true→false(走标准先规划再执行);spawn_task 不再暴露该参数,
工具建任务一律 false。
2026-08-15 00:19:14 -04:00
Autumn-27
47ba58bda6
feat(planner): finding 当场唤醒 + planner N 秒心跳触发(任务参数,默认5min)
...
触发机制补两条(见 docs/planner-trigger-impl-plan.md):
1) finding 当场唤醒:worker 飞行中 report_finding 落库即唤醒本任务 planner,
不再等 worker 整趟收工才反应。
- worker.Execute 加 notify 入参并 SetNotify(补上 worker toolset 之前缺失的接线)
- addFinding 写 KindFinding 成功后调 notify(只对 finding,不对 fact)
- engine 两处 worker.Execute 调用传 t.Notify
2) planner N 秒心跳:距上轮规划结束/任务开始满 N 秒且期间无触发 → 触发一轮,
兜底卡死 + 唤醒去监督飞行中的 worker(steer/kill) + 周期复查。
- plannerLoop 重构为 runRound 闭包 + 三臂 select(ctx/notify/heartbeat)
- 心跳在 loop 入口臂 = 从任务 start 计时(覆盖 seed 跳过首轮),每轮结束重臂
- 新增任务参数 plan_heartbeat_seconds,下限=默认=300(5min),低于自动抬到300
- DB 迁移:schema.sql 加列 + ALTER ADD COLUMN IF NOT EXISTS 补旧库
- 全链路接线:db.CreateTask/manager/server HTTP/orchestration spawn_task
- 前端:api.createTask 传参 + 建任务表单新增"planner 心跳(分钟)"字段
2026-08-12 11:18:07 -04:00
Autumn-27
c84bba477f
feat(agent): 支持为每个 agent 绑定 LLM 配置(agent 级默认模型)
...
按优先级 Agent 绑定 > 任务/会话指定 > 全局激活 解析每个 agent 运行的模型,
使 planner/worker/goals/mainagent/自定义 agent 可各自走不同 profile(如 plan 用
强模型、work 用弱模型)。未绑定时行为与原先完全一致。
- db: Agent 增 llm_profile_id + SetAgentLLMProfile;schema 幂等兜底 ALTER
- server: 新增 effectiveProfileForAgent/providerForProfile/providerForAgent;
buildPlannerWorker 让 planner/worker 各自解析 provider;provider 按 profile id
缓存以共享限速器;goals/会话链同步走绑定;绑定变更热重载
- api: agent 配置接口收 llm_profile_id(三态) + 返回可选 profile 列表
- web: agent 编辑器「配置与提示词」页新增「默认模型」下拉
2026-08-11 12:15:38 -04:00
Autumn-27
79493d5a4a
feat(activity): 任务会话历史反向分页 + SSE 可靠性整改
...
后端:
- ActivityPage(会话过滤 main/plan/intent + before 反向分页)、ActivityMaxID
(任务级快照游标)、ListByKindPage(Intent 列表分页,突破固定 300 上限)
- 新增 GET /api/exploration/activity/history(items/snapshot_cursor/
earliest_cursor/has_more);snapshot_cursor 为任务级游标
- streamActivity:一次 2000 → 循环补偿追平;输出标准 SSE id 行;支持
Last-Event-ID;补偿查询错误记录日志并关闭连接
- intents 支持分页形态(?before/?page → {items,has_more}),无参数保持旧裸数组
- 新增 idx_act_worker(exploration_id, worker, id) 支撑 Main/Plan 反向翻页
(schema.sql 幂等,旧库启动自动补建,无迁移)
前端:
- sessions-tab 单一 allActivity → 分会话缓存;首屏只加载 Main 最新页并据其
快照游标建唯一任务级 SSE;Plan/Worker 点击懒加载
- 统一 mergeBySeq 合并去重;未激活会话只维护 lastTs/unread;向上滚动分页
加载旧历史并保持滚动位置;每会话内存上限裁剪
- 按 session_key 写各自缓存 + 每 key 请求令牌防会话切换串数据;SSE 连接状态
可见、加载失败可重试,异常不再静默为"暂无消息"
- api 新增 activityHistory / intentsPage
测试:db/activity_page_test.go 覆盖多 Agent 过滤、反向翻页无重复无遗漏、
快照游标、Intent 超页分页(已对真实 PostgreSQL 通过)
2026-08-11 09:13:12 -04:00
Autumn-27 and Claude Opus 4.8
4cf622593a
feat(trigger): 新增"任务创建"触发机制(on_task_create)
...
自定义 agent 触发条件从 5 种扩展到 6 种,新增任务被创建时触发。
用 tasks.id 单调水位线 + scheduler_state 防重复,重启不补触发;
触发消息完整分行给出任务ID/描述/目标。DB 加列并带 ALTER 迁移。
Co-Authored-By: Claude Opus 4.8 <[email protected] >
2026-08-09 02:19:29 -04:00
Autumn-27 and Claude Opus 5
aeadd0d48b
feat(coverage): 资产测试覆盖度(task_scope 范围 + fact 派生已测)
...
按 docs/任务覆盖度设计-最终版.md 实现(轻量版,粗估供 agent 参考):
- 新表 task_scope(覆盖度分母 + per-task 授权边界):CREATE TABLE IF NOT EXISTS 进
schema.sql,随 db.go 每次启动 Exec,旧库自动生效。
- db/task_scope.go:AddAutoScope(insertAssets 按资产类型保守入范围)、AddAgentScope
(add_task_scope 工具:company/root_domain/subdomain/ip/cidr)、ListTaskScope、
TaskCoverage(范围内资产中被 fact 节点锚定过的占比 + backlog 取样)。
- insertAssets 顶层循环按 worker 显式插入的资产类型自动入范围(source=auto);
side-effect 派生的资产不触发(钩子在 handler 顶层、派生在 db 层内部),范围不盲目扩大。
- add_task_scope 工具绑 planner,随 BuiltinToolSeeds 播种(新库/旧库皆 seed)。
- graph_overview 注入 coverage(denominator/tested/backlog_sample + 粗估提示)供 planner 参考。
- HTTP:GET /api/tasks/{id}/coverage、/scope;任务总览页覆盖度卡(含 backlog)。
- 修 toolcatalog_test(record_fact 绑定断言,早前 mainagent 加 recordFact 后未同步)。
验证:go build / vet / agent test / 前端 tsc 均通过。注:DB 层 SQL 尚未经 live Postgres 运行验证。
Co-Authored-By: Claude Opus 5 (1M context) <[email protected] >
2026-08-08 09:09:38 -04:00
Autumn-27 and Claude Opus 4.8
6d8fa5bc48
feat(agent): 触发后处理可配置(运行模式/合并模式/并发上限) + 修复抽屉内下拉误关
...
每个自定义 agent 可配置触发后如何调度运行:
- 运行模式 serial|parallel:串行排队一次一个 / 每次触发各自并发一个会话
- 合并模式 by_task|all|none(仅 serial):同任务合并 / 全部合并成一条 / 不合并
- parallel 带每 agent 最大并发上限(0=不限),超限排队等空位
实现:
- DB: agents 加 trigger_run_mode/trigger_merge_mode/trigger_max_parallel 三列
(schema + 幂等 ALTER 迁移,已发版补旧库);Agent 结构/scan/SetAgentTriggerBehavior
- 调度重构: triggerRun bool → triggerActive 计数 + triggerCfg 缓存;
StartTriggeredRun 走 pumpLocked/runAndPump 统一泵模型,nextTriggerRun 按合并模式
取(新增 mergeAllRuns);并发安全(session 按 conv-id 隔离,已确认)
- config 接口暴露/接收三字段;max_turns 改可选指针,避免触发 tab 部分 patch 清零
- 前端: 触发 tab 顶部加运行/合并模式下拉 + 最大并发输入,改动即存
修复: 抽屉(Sheet)内 Select 下拉 portal 到抽屉外,点选项/点别处被当成点击外部
误关抽屉。SelectContent 改 position=popper,并给 SheetContent 加 onInteractOutside
守卫(按 e.detail.originalEvent.target 判定弹层内点击则不关)。
Co-Authored-By: Claude Opus 4.8 <[email protected] >
2026-08-08 04:23:09 -04:00
Autumn-27 and Claude Opus 4.8
f9716269ea
feat(agent): 触发器新增「工具调用」条件 + 定时触发改为复选框展开
...
- 定时触发统一为前置复选框,勾选后展开「每 N 秒」+ 消息(与其它条件一致)
- 新增工具调用触发(P3 第 5 种条件):
- 选中系统工具列表(至少一个),任务执行中这些工具每次调用完成即触发 agent
- 触发消息带上任务 id/描述/目标 + 工具名 + 入参 + 返回内容(各截断 1500 字)
- 只读任务执行的 activity,触发跑的会话写 conversation_activities,天然无自触发循环
- DB: agent_triggers 加 on_tool_call/tool_call_message/tool_names 三列;
已发版,附幂等 ALTER TABLE ADD COLUMN IF NOT EXISTS 供旧库升级补列
- scheduler: 新增 last_toolcall_id 水位线(首启 seed) + fireToolCalls,以 tool_result
为水位、回连 tool_use 取入参,按选中工具集合匹配后触发
Co-Authored-By: Claude Opus 4.8 <[email protected] >
2026-08-08 02:59:07 -04:00
Autumn-27 and Claude Opus 4.8
0ef8561411
chore: ARTEX 初始化
...
ARTEX — AI 自主渗透测试系统(Go 后端 + Next.js 前端,单二进制内嵌)。
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected] >
2026-07-26 04:27:45 -04:00