feat(exposure): 完全移除 acr push 暴露 consent 閘 (Arcrun#13 P1)

leo 2026-06-29 拍板:arcrun 是給 AI 用的系統,push/暴露不再需要人類確認。
- 刪 cypher-executor/src/lib/exposure-consent.ts(server 閘,MCP push 的真正擋點)
- 刪 cli/src/lib/exposure-warning.ts(CLI 互動 + 非 TTY 拒絕)
- recipes.ts / webhooks-named.ts:移除 checkExposureConsent 403 閘,直接放行
- recipe.ts / push.ts:移除 obtainExposureConsent 呼叫,不再 prompt/拒絕
- init-seed / seed-api-recipes:移除種子層級 consent
- exposure_consent 欄位降為向後相容(讀舊 record 不報錯,不再寫入/檢查)
不補審計線索、不做替代防護(leo:先拿掉,出問題再設置)。
tsc 全綠(cypher-executor + cli)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
uncle6me-web
2026-06-29 20:58:32 +08:00
parent 43948d9247
commit c1a06df68f
9 changed files with 20 additions and 280 deletions
+5 -17
View File
@@ -16,8 +16,6 @@
import { Hono } from 'hono';
import type { Bindings } from '../types';
import { deriveRecipeHash } from '../lib/hash';
import { checkExposureConsent, resolveConsentForRecord } from '../lib/exposure-consent';
import type { ExposureConsent } from '../lib/exposure-consent';
export const recipesRouter = new Hono<{ Bindings: Bindings }>();
@@ -46,9 +44,9 @@ export interface RecipeDefinition {
key: string;
inject_as: string;
}>;
// 資料外流警示:recipe 定義一個資料去向(endpoint)。push 需人類明示同意(法律憑證)。
// SDD: data-exfil-warning §7(公私一視同仁)
exposure_consent?: ExposureConsent;
// 暴露 consent 閘已移除(leo 2026-06-29 拍板,Arcrun#13):arcrun 是給 AI 用的系統,
// 不再對 push/暴露要求人類確認。此欄位保留只為向後相容舊 KV record(讀到不報錯,不再寫入/檢查)。
exposure_consent?: unknown;
created_at: number;
updated_at: number;
}
@@ -104,11 +102,7 @@ recipesRouter.post('/recipes', async (c) => {
// 讀取順序:先 UUID 模型(installed→uuid),fallback 舊 keymigration 前的種子)。
const existing = await resolveRecipe(canonicalId, c.env.RECIPES);
// 資料外流警示:recipe 定義資料去向(endpoint)。首次 push 需人類明示同意(公私一視同仁)
const consentError = checkExposureConsent(body.exposure_consent, existing?.exposure_consent);
if (consentError !== null) {
return c.json({ success: false, error: consentError, requires: 'exposure_consent' }, 403);
}
// 暴露 consent 閘已移除(leo 2026-06-29Arcrun#13):直接 push,不攔
const recipe: RecipeDefinition = {
uuid: existing?.uuid ?? crypto.randomUUID(),
@@ -124,7 +118,6 @@ recipesRouter.post('/recipes', async (c) => {
body: body.body,
auth_service: body.auth_service,
credentials_required: body.credentials_required,
exposure_consent: resolveConsentForRecord(body.exposure_consent, existing?.exposure_consent),
created_at: existing?.created_at ?? now,
updated_at: now,
};
@@ -162,11 +155,7 @@ recipesRouter.post('/recipes/submit', async (c) => {
const hashId = await deriveRecipeHash(canonicalId);
const now = Date.now();
// 公共庫投稿一定是暴露 → 需明示同意(無同意直接擋)。投稿是新版本,不沿用既有同意
const consentError = checkExposureConsent(body.exposure_consent, undefined);
if (consentError !== null) {
return c.json({ success: false, error: consentError, requires: 'exposure_consent' }, 403);
}
// 暴露 consent 閘已移除(leo 2026-06-29Arcrun#13):公共庫投稿不再需要人類確認
// app-store 模型:**領新 uuid = 新增作者版本**,不覆蓋既有 canonical(§7.5.5)。
const recipe: RecipeDefinition = {
@@ -183,7 +172,6 @@ recipesRouter.post('/recipes/submit', async (c) => {
body: body.body,
auth_service: body.auth_service,
credentials_required: body.credentials_required,
exposure_consent: resolveConsentForRecord(body.exposure_consent, undefined),
created_at: now,
updated_at: now,
};