ARTEX/db
BaaRai 1f4cb65ca6 feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4)
Storage, flag and request path of the approval gate for asset targets. The
gate itself is not wired into the tool hook yet (steps 1.5 to 1.7): with this
change nothing is extracted, resolved or blocked, whatever the flag says.

Schema and store (1.2)
- tasks.target_gate, conversations.target_gate (default false).
- intercept_pending.target_key and a partial unique index: one open request
  per scope (task or conversation) and host:port.
- target_pins (no foreign keys: a pin outlives its task, its conversation and
  its request row) and target_gate_exemption_log. All DDL is idempotent; no
  CHECK constraints; the cascade on intercept_pending.conversation_id stays.
- db/target_pins.go: pin lookup with port precedence, list, revoke,
  find-or-create of a request, and ResolveTargetRequest, which settles the
  row, supersedes the old pin and writes the new version in one transaction.
- Deleting a task or an archive stub revokes its pins and settles its open
  target requests in the delete transaction. DeleteConversation and
  DeleteConversations revoke the pins of the removed conversations in the
  same transaction as the delete.

Opt-in flag (1.3)
- Per task through the create and metadata-patch paths, per conversation
  through create and patch; exposed in the task DTO. A retest conversation
  takes the flag of the finding's task, never its pins. A spawned task starts
  with the gate off.
- The task flag is atomic and read on every call through TargetScope.Enabled.
  TargetScope now carries the Interceptor that owns the gate.

Request, wait, decide (1.4)
- pendingManager keeps a list of waiters per request; resolve wakes all.
- RequestTargets: find-or-create per target, one card per request, wait on
  channel, poll, context and wait bound. A plain request is never settled by
  a call that leaves. A request merged with an ask is bound to its creating
  call and a timeout never allows it.
- Decide records the approver (subject of the session token) and the remote
  address for every human decision, classic asks included. On a target
  request "allowed" pins the displayed addresses; that is the only writer of
  pins.
- A request raised while the global egress proxy is set says the approval is
  name-only and its pin is stored with name_only_effective.
- Routes: GET/POST .../target-pins and .../target-pins/{pid}/revoke under
  /api/tasks/{id} and /api/conversations/{id}; decision_source=target filter.
- ValidateExemptionHost: an exemption written as an IP literal may be private
  unicast, never loopback, link-local or metadata, unspecified or multicast.
2026-11-10 23:05:47 +01:00
..
activity_page_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
asset_dsl.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
asset_intercept.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
asset_intercept_match.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
asset_intercept_match_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
assets.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
assets_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
chat_mentions.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
commands.go fix: prevent OOM when archiving large tasks 2026-08-28 15:25:20 +08:00
companies.go db: report hidden asset count in malformed-ip warning suffix 2026-11-10 15:49:41 +01:00
companies_test.go db: report hidden asset count in malformed-ip warning suffix 2026-11-10 15:49:41 +01:00
company_lock_test.go feat(assets): add editable company and task scopes 2026-08-24 19:29:14 +08:00
company_scope.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
company_scope_consistency_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
company_scope_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
config.go feat(llm): optional custom User-Agent for LLM requests 2026-11-08 17:11:43 +01:00
config_max_tokens_test.go feat(llm): 模型配置新增输出上限,支持 max_completion_tokens 字段名 2026-08-31 12:20:31 -04:00
config_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
constants.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
constraints.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
conversation.go feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
conversation_pin_test.go feat(chat): add conversation pinning and rename controls 2026-08-24 19:29:38 +08:00
customtool_test.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
db.go feat: each test package runs on its own database 2026-10-12 18:43:29 +02:00
db_test.go fix: prevent OOM when archiving large tasks 2026-08-28 15:25:20 +08:00
digest.go feat(digest): 探索图冷节点压缩(cold-digest) 2026-09-09 11:52:15 -04:00
exploration.go feat(engine): intent claim heartbeat, TTL and fencing token (S3c) 2026-11-10 17:45:11 +01:00
exploration_sources.go chore: sync upstream v0.3.6 changes 2026-08-28 14:03:07 +08:00
exploration_sources_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
exploration_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
exploration_tokens_test.go Merge upstream/main into codex/btw-side-question 2026-09-11 08:47:57 +08:00
export_test.go fix(intercept): judge decisions were stored as unknown (prefix case mismatch) 2026-11-09 12:22:46 +01:00
finding_assets.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
finding_assets_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
finding_retests.go feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
finding_retests_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
finding_retests_verification_test.go feat: a completed retest updates the verification state 2026-11-09 21:47:40 +01:00
finding_traffic.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
finding_traffic_archive.go feat: 支持漏洞关联多条流量证据 2026-09-10 13:03:20 +08:00
finding_traffic_archive_test.go feat: 支持漏洞关联多条流量证据 2026-09-10 13:03:20 +08:00
finding_verification.go feat: verified findings backend (S1) 2026-11-09 20:21:27 +01:00
findings.go feat: verification status badge, filter and note in the findings UI 2026-11-09 21:04:12 +01:00
findings_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
intent_admission.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
intent_claim_test.go feat(engine): intent claim heartbeat, TTL and fencing token (S3c) 2026-11-10 17:45:11 +01:00
intent_control_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
intent_delete_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
intercept.go feat: show and filter the decided_by actor in the approval records 2026-11-09 22:35:09 +01:00
intercept_decided_by_test.go feat: show and filter the decided_by actor in the approval records 2026-11-09 22:35:09 +01:00
intercept_detail.go feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
intercept_detail_test.go feat: record which actor decided an intercept approval 2026-11-09 22:17:56 +01:00
intercept_execution.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
intercept_execution_test.go 精简动作审查输入并支持审批来源定位 (#125) 2026-09-15 23:51:37 +08:00
intercept_filter_test.go fix(intercept): judge decisions were stored as unknown (prefix case mismatch) 2026-11-09 12:22:46 +01:00
intercept_seed_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
intercept_source_test.go fix(intercept): judge decisions were stored as unknown (prefix case mismatch) 2026-11-09 12:22:46 +01:00
jsonb_clean_test.go fix(db): side_question checkpoint 入库前剥除 jsonb 不支持的 NUL 转义 2026-09-12 03:00:28 -04:00
lessons.go feat(rsi): evidence-gated lesson library in shadow mode 2026-10-21 14:25:35 +02:00
lessons_test.go feat(rsi): evidence-gated lesson library in shadow mode 2026-10-21 14:25:35 +02:00
llm_records_migrate_test.go feat(llmrec): 录制 LLM 请求/响应 HTTP 原文 2026-08-25 09:40:05 -04:00
llm_usage.go fix: cost ledger charges fresh input only (cache read is part of input tokens) 2026-10-12 08:53:20 +02:00
llmhealth.go feat(llm): add profile failover and pool health 2026-08-24 19:28:18 +08:00
llmretry.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
llmretry_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
logs.go chore: ARTEX 初始化 2026-07-26 04:27:45 -04:00
nkey.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
notification.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
notification_delivery.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
notification_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
schema.sql feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
settings.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
settings_insert_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
side_questions.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
side_questions_test.go fix(btw): 修复长对话上下文预算与旁路输入布局 2026-09-11 00:41:01 +08:00
skill_gaps.go feat(server): capability-gap report from skill misses 2026-10-19 00:33:08 +02:00
skill_usage.go 归档 2026-08-28 12:56:29 +08:00
skill_usage_test.go feat(skills): track usage and missing dependencies 2026-08-24 19:30:14 +08:00
target_pins.go feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
target_pins_test.go feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
task_archive_aggregate_stats.go 归档 2026-08-28 12:56:29 +08:00
task_archives.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
task_archives_restore.go feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
task_archives_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
task_assets.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
task_assets_context.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
task_assets_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02: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_context.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
task_context_lock_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
task_context_unit_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
task_credentials.go feat(tasks): per-task test-account credentials 2026-10-09 14:28:08 +02:00
task_delete_concurrency_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
task_intercept.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
task_list_performance_test.go 修复BUG: 1、当存在较多任务时,系统会发生卡顿,加载对话或者加载界面时候存在明显卡顿,优化性能找出问题 2026-08-28 08:00:36 +08:00
task_metadata_test.go 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
task_outcome.go feat(server): per-task outcome card for RSI baselines 2026-10-19 00:28:27 +02:00
task_queue_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
task_scope.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
task_scope_test.go fix(scope): add_task_scope 支持 host:port 目标,入库前剥端口 2026-08-09 09:09:59 -04:00
task_source_limit_test.go feat(tasks): add runtime controls and inherited context 2026-08-24 19:29:00 +08:00
task_templates.go feat: 任务模板支持预设分类与任务级拦截/允许规则 2026-09-19 09:27:03 -04:00
task_templates_test.go feat(tasks): add categories templates and batch controls 2026-08-24 19:29:46 +08:00
tasks.go feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
tasks_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
testmain_test.go feat: each test package runs on its own database 2026-10-12 18:43:29 +02:00
tool_usage.go 归档 2026-08-28 12:56:29 +08:00
tool_usage_test.go 抽屉优化 2026-08-25 12:05:26 +08:00
tools.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
triggers.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00