From bdeca883546f721bec8f0606c61e455adffc3a27 Mon Sep 17 00:00:00 2001 From: yunyingk Date: Fri, 11 Sep 2026 15:04:49 +0800 Subject: [PATCH 1/2] Add staging simulation guide and refine hose integration sync - Add comprehensive reference guide for staging simulation and production rule evolution - Require latest CLI, skill, and plugin versions with self-update instructions in SKILL.md - Deduplicate prod hosecloud integrations by corporationId during corps sync-test - Support key and password fallback in enterprise source config for hose credentials - Add unit and integration tests covering deduplication and source credential compatibility --- skills/seal-use/SKILL.md | 22 ++- .../references/staging-simulation-workflow.md | 157 ++++++++++++++++++ src/cli/commands/corps-bind.test.ts | 79 +++++++++ src/cli/commands/corps.ts | 59 +++++-- 4 files changed, 296 insertions(+), 21 deletions(-) create mode 100644 skills/seal-use/references/staging-simulation-workflow.md diff --git a/skills/seal-use/SKILL.md b/skills/seal-use/SKILL.md index 84cba31..3fc77ae 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -12,17 +12,27 @@ Use the `seal_cli` MCP tool when it is available; pass the command string as its ## Bootstrap & Installation (环境安装与自愈) -If `seal-use` or `seal_cli` is not installed on the system, the Agent should automatically install it via: +Agent 必须确保使用最新版本的 `seal-use` CLI、Skill 与 Agent 插件。在执行任何配置或业务任务前,优先核验版本状态: ```bash -# 国内高速安装(Gitea 镜像源,免代理、秒级完成) +seal-use version +seal-use corps list +``` + +如果 CLI 或 Skill 尚未安装或落后于发布版本,通过以下命令一键安装或升级: + +```bash +# 方式 1:CLI 自更新(已安装时推荐) +seal-use update + +# 方式 2:国内高速一键安装与自愈(Gitea 镜像源,免代理、秒级完成) curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash -# Global / GitHub Direct +# 方式 3:Global / GitHub Direct curl -fsSL https://raw.githubusercontent.com/yunyingk/seal-use/main/scripts/install.sh | bash ``` -After installation, verify with: +安装或升级后,验证系统连通性: ```bash seal-use version seal-use corps list @@ -50,9 +60,12 @@ seal-use corps list - Never treat “Seal 协助/Seal 授权/委托” as a 合思授权入口. They are different links and must use different commands. - In the default stateless mode, every enterprise command requires `--corp `. In stateful mode, omitting `--corp` uses the configured default enterprise and is unsafe for an explicitly named enterprise. - For an explicitly named enterprise, first resolve it with `seal-use corps list`, then pass its exact `corpId` to every command. After creation, verify the returned URL host matches that enterprise's Seal tenant; if the host is the current/default tenant or cannot be verified, do not present the link as the target enterprise's link. +- 生产规则演进必须遵循“生产仅改草稿 -> 一键同步测试企业 -> 真实单据模拟验证 -> 生产发布投产”安全闭环,绝不允许跳过测试环境模拟验证直接在生产企业发布规则版本。 +- 测试环境合思模拟安全隔离:`corps sync-test` 自动将生产企业合思凭证以 `assisted` 模式注入测试企业,名称格式为 `{企业名前缀}(Seal测)`。该配置仅保存在测试 Seal 侧,绝对不执行 `deploy hosecloud sync`,杜绝向生产合思费控推送 EBot 节点或创建外发 webhook。 ## Route By Intent +- 生产规则安全演进、搭配配置与测试模拟闭环: read `references/staging-simulation-workflow.md`. 适用于:用户提出规则变更需求/客诉修复、生产与测试企业搭配接入与 1 对 1 绑定、生产环境仅改草稿隔离风险、`seal-use corps sync-test` 一键同步测试环境(含合思集成免配同步)、测试环境跑真实单据模拟验证、验证通过后才在生产正式发布的完整安全生命周期。 - First install / zero configuration / “how do I connect my enterprise?” / user supplies app credentials, an assistance link, or F12/Network cURL: read `references/enterprise-onboarding.md`. Ask what material the user already has in plain language, then discover all remaining identifiers automatically. - User-facing Seal tenant assistance link (Seal 协助/Seal 授权/委托): resolve the named enterprise first, then run `seal-use delegation create --corp --note ''`; verify the returned hostname is that tenant's Seal hostname. Always provide BOTH a code block (` ```text ... ``` `) AND a hyperlink. - Packaged customer feedback → approval-rule remediation: read `references/customer-feedback-rule-remediation.md`. Use this route for WeChat messages, screenshots, rejection notifications, document numbers, customer complaints, expected approval behavior, rule-only mitigation, exact diffs, or requests to update and publish a rule version. @@ -150,6 +163,7 @@ seal-use tool seal_approval_search --corp --json '{"keywords":["差旅" - `references/hose-enterprise-init.md`: 合思标准密钥的域名、企业与管理员自动发现,以及多候选管理员的安全选择。 - `references/hose-enterprise-deploy.md`: Seal AI 智能审核发布到合思费控(添加/编辑配置、平台自动探测、一键同步与 EBot 节点发布)。 - `references/approval-attachment-trace.md`: 附件/发票/OCR/图片争议的 Langfuse 追踪工作流。 +- `references/staging-simulation-workflow.md`: 生产与测试环境搭配配置、合思集成免配自动同步、单据模拟测试验证与生产规则安全演进闭环指南。 - `references/cli.md`: 完整 CLI 命令清单。 ## Safety diff --git a/skills/seal-use/references/staging-simulation-workflow.md b/skills/seal-use/references/staging-simulation-workflow.md new file mode 100644 index 0000000..4659187 --- /dev/null +++ b/skills/seal-use/references/staging-simulation-workflow.md @@ -0,0 +1,157 @@ +# 生产与测试环境搭配配置、模拟测试与生产规则安全演进指南 (Staging Simulation & Rule Evolution) + +本文档面向 AI Agent 与运维人员,规范从**生产/测试环境搭配接入**、**配置与合思集成自动同步**、**测试环境单据模拟验证**,到**生产规则安全投产**的端到端标准工作流。 + +--- + +## 核心原则 (Core Rules) + +1. **强版本基线 (Latest Version Mandate)**: + - 必须确保运行的是最新版本的 `seal-use` CLI、Skill 与 ZCode/Agent 插件。 + - 在开始引导或执行任何企业操作前,先执行 `seal-use version` 核验。若版本过旧或缺失新特性,优先运行 `seal-use update` 或重新执行安装脚本: + ```bash + # 国内镜像源秒级自愈与升级 + curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash + ``` +2. **测试先行,生产草稿隔离 (Staging-First Evolution)**: + - 生产环境的规则修改**只能以草稿态保存**(`draft`),绝对禁止直接在生产环境发布未经验证的规则版本。 + - 通过 `seal-use corps sync-test` 将生产草稿规则、知识文档与偏好自动同步至绑定的测试企业并在测试环境发布语义版本,用于模拟测试验证。 +3. **合思集成安全隔离 (Hosecloud Zero-Impact Sync)**: + - 测试环境进行合思模拟测试,必须在测试企业中保存合思凭证。 + - `corps sync-test` 会自动读取本地生产 source 凭证并为测试环境配置 `assisted`(辅助)模式的合思集成,名称格式为 `{企业名前缀}(Seal测)`。 + - **严禁向合思执行同步 (`deploy hosecloud sync`)**:测试环境的合思配置只保存在 Seal 端,绝不向合思生产系统推送 EBot 节点或创建真实出站消息,保障生产费控审批流的绝对安全。 + +--- + +## 端到端标准演进闭环 (The 4-Stage Lifecycle) + +```mermaid +flowchart TD + A["Stage 1: 生产与测试环境接入与绑定"] --> B["Stage 2: 生产规则草稿修改 (Draft Only)"] + B --> C["Stage 3: 一键安全同步测试环境 (corps sync-test)"] + C --> D["Stage 4: 测试环境单据模拟验证 (simulation create)"] + D --> E{"验证是否符合预期?"} + E -- 存在偏差/误伤 --> B + E -- 验证通过 --> F["Stage 5: 生产环境正式发布 (rules publish)"] +``` + +--- + +### 第一阶段:生产与测试企业搭配配置 (Pairing & Setup) + +1. **发现并列出已有企业**: + ```bash + seal-use corps list + ``` + 识别生产企业(`sourceType: "hose"` 或 `"seal"`)与测试企业(如专用的测试环境)。 + +2. **如果尚未接入企业**: + - 合思标准凭证接入生产企业:`seal-use corps add-hose --json '{"appKey":"...","appSecurity":"...","domain":"..."}'` + - 或通过协助链接接入:`seal-use corps add-link ` + +3. **环境严格标记与 1 对 1 绑定**: + ```bash + # 1. 明确标记企业环境属性 + seal-use corps mark --env production --confirm + seal-use corps mark --env test --confirm + + # 2. 建立 1 对 1 关联绑定(禁止多层级串联) + seal-use corps bind-test --confirm + ``` + 绑定成功后,执行 `seal-use corps list` 可确认双方已包含 `testCorpId` 与 `prodCorpId` 互斥映射字段。 + +--- + +### 第二阶段:生产环境规则安全修改 (Production Draft Mutation) + +当用户提出审核规则新增、修改或依据客诉反馈进行修复时,Agent 应遵循以下规范: + +1. **锁定目标企业与规则定位**: + ```bash + # 查询生产企业当前生效规则与草稿规则 + seal-use rules list --corp --summary + # 精确读取某条目标规则 + seal-use rules get --corp --code '' + ``` +2. **仅修改草稿(保持生产未发布)**: + - 提取最小修改建议(只改动必要的描述语句,保留 `scope` 与 `strictness`)。 + - 使用规则更新或创建接口修改生产企业草稿: + ```bash + seal-use tool seal_approval_rules_update --corp --json '{"ruleId":"...","description":"..."}' + ``` + - **关键安全底线**:此时**绝不调用** `seal-use rules publish --corp `!生产企业始终停留在草稿态,线上正在进行的审批不受任何干扰。 + +--- + +### 第三阶段:一键安全同步测试环境 (Staging Auto-Sync) + +通过 `corps sync-test` 命令,一键将生产企业的全部变更投影到测试环境: + +1. **预览差异 (`--dry-run`)**: + ```bash + seal-use corps sync-test --dry-run + ``` + 检查输出的 JSON: + - `rulesPlan`:生产草稿规则数、测试待替换规则数。 + - `documentsPlan`:知识库文章的新增、更新与多余清理。 + - `hosecloudSyncPlan`:合思集成注入计划(显示将自动生成的出站名称与 `assisted` 模式)。 + +2. **正式同步与发布 (`--yes`)**: + ```bash + seal-use corps sync-test --yes + ``` + 该命令会在测试企业中全自动完成: + - 更新审核风格与偏好设置; + - 对账知识库文档(覆盖更新已有文档、创建新文档、删除测试环境多余文档); + - 清空测试环境旧草稿规则,灌入生产企业当前草稿规则并重算 code; + - 在测试企业自动发布语义版本(格式形如 `[Prod v22 · #1 -> Test v3]`),并保存本地规则映射快照; + - **自动同步合思集成**: + - 从本地 source 读入 `appKey`/`appSecurity`(兼容 `key`/`password`); + - 截取企业名前缀并附加 `(Seal测)`(严格受控于 13 字符限制,例如 `钰泰半导体(Seal测)`); + - 强制将审批模式设为 `assisted`; + - 自动去重:若生产有多个相同 `corporationId` 的集成(如全自动与辅助),在测试环境自动合并为单条辅助集成; + - **不同步至合思**:仅保存在测试环境 Seal,保证合思生产费控零改动。 + +3. **速查规则映射**: + ```bash + seal-use rules map --corp --version latest + ``` + 查看生产规则 ID/code 与测试规则 ID/code 的对应关系。 + +--- + +### 第四阶段:测试环境模拟验证与投产闭环 (Simulation & Production Release) + +1. **核验测试环境合思集成已就绪**: + ```bash + seal-use simulation integrations --corp + ``` + 确认返回的 `hosecloudIntegrations` 中包含目标企业的测试配置项(如 `钰泰半导体(Seal测)`)。 + +2. **创建模拟测试任务**: + 针对目标真实单据号(或客诉单据)在测试环境发起模拟: + ```bash + seal-use simulation create --corp --mode hosecloud --flow-ids "<单号1>,<单号2>" + ``` + Seal 服务器会自动使用测试环境中保存的合思凭证,直接调用合思 OpenAPI 拉取单据详情,并通过测试环境中刚发布的规则版本执行 AI 预审判断。 + +3. **轮询并检查判定结果**: + ```bash + # 查看状态与进度 + seal-use simulation status --corp + # 等待批次完成 + seal-use simulation wait --corp + # 获取详细判决与命中规则 + seal-use simulation batch-records --corp + ``` + 核对: + - 期望通过的单据是否正确通过; + - 期望拦截或预警的单据是否命中了预期的规则(对照 `rules map`); + - 是否存在规则描述歧义导致的误判。 + +4. **生产环境最终投产 (Final Production Release)**: + 仅当测试环境所有单据的模拟判定结果完全符合预期时,才在生产企业执行正式发布: + ```bash + seal-use tool seal_approval_rules_publish --corp --json '{"versionName":"审核规则 版本N"}' + ``` + 发布后核实版本状态,完成业务安全闭环。 diff --git a/src/cli/commands/corps-bind.test.ts b/src/cli/commands/corps-bind.test.ts index 0dd7435..cd42f39 100644 --- a/src/cli/commands/corps-bind.test.ts +++ b/src/cli/commands/corps-bind.test.ts @@ -686,6 +686,85 @@ describe("sync-test hosecloud integration auto-sync", () => { expect(parsed.hosecloudSync.skipped).toBe(true); expect(parsed.hosecloudSync.reason).toContain("not hose"); }); + + test("deduplicates multiple prod integrations for the same corporationId into one test integration", async () => { + setupHoseTestEnv(); + await runCli(["corps", "bind-test", "hose-prod", "hose-test", "--confirm"]); + + let capturedBody: any; + // Prod has TWO integrations for the same corporationId (e.g. assisted and fully_automatic) + mockHoseSyncRequests({ + prodHosecloudIntegrations: [ + { + type: "hosecloud", + signKey: "prod-assisted-key", + outboundName: "辅助审批", + mode: "assisted", + apiKey: "test-app-key-123", + apiSecret: "test-app-secret-456", + apiOrigin: "wechat", + corporationId: "hose-prod" + }, + { + type: "hosecloud", + signKey: "prod-auto-key", + outboundName: "全自动审批", + mode: "fully_automatic", + apiKey: "test-app-key-123", + apiSecret: "test-app-secret-456", + apiOrigin: "wechat", + corporationId: "hose-prod" + } + ], + onConfigWrite: (isProd, body) => { + if (!isProd) capturedBody = body; + } + }); + + const result = await runCli(["corps", "sync-test", "hose-prod", "--yes"]); + expect(result.isError).toBe(false); + + const parsed = JSON.parse(result.stdout); + // Synced array should contain exactly 1 entry, not 2 + expect(parsed.hosecloudSync.synced).toHaveLength(1); + expect(parsed.hosecloudSync.synced[0].corporationId).toBe("hose-prod"); + + const writtenIntegrations = (capturedBody?.integrations ?? []).filter((i: any) => i.type === "hosecloud"); + expect(writtenIntegrations).toHaveLength(1); + expect(writtenIntegrations[0].mode).toBe("assisted"); + expect(writtenIntegrations[0].apiOrigin).toBe("wechat"); + }); + + test("supports key/password fallback in source config when appKey/appSecurity are omitted", async () => { + const { enterprises } = setupHoseTestEnv(); + // Overwrite hose-prod.json to use key / password instead of appKey / appSecurity + const prodCorpWithKeyPassword = JSON.parse(readFileSync(join(enterprises, "hose-prod.json"), "utf-8")); + delete prodCorpWithKeyPassword.source.appKey; + delete prodCorpWithKeyPassword.source.appSecurity; + prodCorpWithKeyPassword.source.key = "fallback-key-789"; + prodCorpWithKeyPassword.source.password = "fallback-secret-012"; + writeFileSync(join(enterprises, "hose-prod.json"), JSON.stringify(prodCorpWithKeyPassword, null, 2)); + + await runCli(["corps", "bind-test", "hose-prod", "hose-test", "--confirm"]); + + let capturedBody: any; + mockHoseSyncRequests({ + onConfigWrite: (isProd, body) => { + if (!isProd) capturedBody = body; + } + }); + + const result = await runCli(["corps", "sync-test", "hose-prod", "--yes"]); + expect(result.isError).toBe(false); + + const parsed = JSON.parse(result.stdout); + expect(parsed.hosecloudSync.skipped).toBe(false); + expect(parsed.hosecloudSync.synced).toHaveLength(1); + + const writtenIntegration = capturedBody?.integrations?.find((i: any) => i.type === "hosecloud"); + expect(writtenIntegration?.apiKey).toBe("fallback-key-789"); + expect(writtenIntegration?.apiSecret).toBe("fallback-secret-012"); + }); }); describe("corps list & current", () => { diff --git a/src/cli/commands/corps.ts b/src/cli/commands/corps.ts index 365814e..8e3c7b6 100644 --- a/src/cli/commands/corps.ts +++ b/src/cli/commands/corps.ts @@ -452,23 +452,34 @@ export async function handleCorpsCommand(action: string | undefined, maybeName: publishVersionName: versionName, publishTarget: "test" }, - hosecloudSyncPlan: prodCorp.source.type === "hose" ? { - sourceType: "hose", - outboundName: buildTestHosecloudOutboundName(prodCorp.name), - targetMode: "assisted", - integrationsCount: (prodPref.integrations ?? []).filter((i: any) => i.type === "hosecloud").length, - integrations: (prodPref.integrations ?? []) - .filter((i: any) => i.type === "hosecloud") - .map((i: any) => ({ + hosecloudSyncPlan: (() => { + if (prodCorp.source.type !== "hose") { + return { + sourceType: prodCorp.source.type, + skipped: true, + reason: "prod source is not hose; no hosecloud credentials available" + }; + } + const rawHose = (prodPref.integrations ?? []).filter((i: any) => i.type === "hosecloud"); + const seen = new Set(); + const distinct = rawHose.filter((i: any) => { + const cid = i.corporationId ?? prodCorp.id; + if (seen.has(cid)) return false; + seen.add(cid); + return true; + }); + return { + sourceType: "hose", + outboundName: buildTestHosecloudOutboundName(prodCorp.name), + targetMode: "assisted", + integrationsCount: distinct.length, + integrations: distinct.map((i: any) => ({ corporationId: i.corporationId, apiOrigin: i.apiOrigin, customApiUrl: i.customApiUrl })) - } : { - sourceType: prodCorp.source.type, - skipped: true, - reason: "prod source is not hose; no hosecloud credentials available" - }, + }; + })(), productionGuarantees: { prodRulesStayDraft: true, prodVersionPublished: false @@ -743,10 +754,10 @@ async function syncHosecloudIntegrationsToTest( return { skipped: true, reason: "prod source is not hose; no hosecloud credentials available" } } - const appKey = (prodCorp.source as any).appKey as string | undefined - const appSecurity = (prodCorp.source as any).appSecurity as string | undefined + const appKey = (((prodCorp.source as any).appKey ?? (prodCorp.source as any).key) as string | undefined)?.trim() + const appSecurity = (((prodCorp.source as any).appSecurity ?? (prodCorp.source as any).password) as string | undefined)?.trim() if (!appKey || !appSecurity) { - return { skipped: true, reason: "prod hose source missing appKey/appSecurity" } + return { skipped: true, reason: "prod hose source missing appKey/appSecurity (or key/password)" } } const [prodPref, testPref] = await Promise.all([ @@ -759,6 +770,20 @@ async function syncHosecloudIntegrationsToTest( return { skipped: true, reason: "prod Seal enterprise has no hosecloud integrations configured" } } + // Deduplicate prod integrations by corporationId: + // Production enterprises may have multiple integrations (e.g. "assisted" + "fully_automatic") + // with the same corporationId. For the test environment, exactly one assisted integration per + // corporationId is needed. + const seenCorpIds = new Set() + const distinctProdIntegrations: any[] = [] + for (const item of prodIntegrations) { + const cid = item.corporationId ?? prodCorp.id + if (!seenCorpIds.has(cid)) { + seenCorpIds.add(cid) + distinctProdIntegrations.push(item) + } + } + const testIntegrations: any[] = (testPref.integrations ?? []) const testByCorpId = new Map( testIntegrations.filter((i: any) => i.type === "hosecloud").map((i: any) => [i.corporationId, i]) @@ -767,7 +792,7 @@ async function syncHosecloudIntegrationsToTest( const outboundName = buildTestHosecloudOutboundName(prodCorp.name) const synced: HosecloudSyncResult["synced"] = [] - const nextHosecloudIntegrations: any[] = prodIntegrations.map((prodInt: any) => { + const nextHosecloudIntegrations: any[] = distinctProdIntegrations.map((prodInt: any) => { const existing = testByCorpId.get(prodInt.corporationId) const signKey = existing?.signKey ?? randomBytes(6).toString("hex") synced!.push({ From f5bedbbbae9b17b149e59ec5b66a7a7d066ccfdc Mon Sep 17 00:00:00 2001 From: yunyingk Date: Fri, 11 Sep 2026 15:06:22 +0800 Subject: [PATCH 2/2] Refine staging guidance to recommend rather than enforce - Change dogmatic rules to strong recommendations - Emphasize that final decision belongs to the user and direct publish requests must be respected --- skills/seal-use/SKILL.md | 2 +- skills/seal-use/references/staging-simulation-workflow.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/skills/seal-use/SKILL.md b/skills/seal-use/SKILL.md index 3fc77ae..8997ac0 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -60,7 +60,7 @@ seal-use corps list - Never treat “Seal 协助/Seal 授权/委托” as a 合思授权入口. They are different links and must use different commands. - In the default stateless mode, every enterprise command requires `--corp `. In stateful mode, omitting `--corp` uses the configured default enterprise and is unsafe for an explicitly named enterprise. - For an explicitly named enterprise, first resolve it with `seal-use corps list`, then pass its exact `corpId` to every command. After creation, verify the returned URL host matches that enterprise's Seal tenant; if the host is the current/default tenant or cannot be verified, do not present the link as the target enterprise's link. -- 生产规则演进必须遵循“生产仅改草稿 -> 一键同步测试企业 -> 真实单据模拟验证 -> 生产发布投产”安全闭环,绝不允许跳过测试环境模拟验证直接在生产企业发布规则版本。 +- 生产规则变更建议优先遵循“生产改草稿 -> 同步测试企业 -> 真实单据模拟验证 -> 生产发布投产”安全闭环;Agent 应主动提示并建议在测试环境中验证,但最终操作权与决策权在用户手中,绝不代替用户做决定。若用户明确要求直接在生产环境发布,尊重用户意图并严格执行。 - 测试环境合思模拟安全隔离:`corps sync-test` 自动将生产企业合思凭证以 `assisted` 模式注入测试企业,名称格式为 `{企业名前缀}(Seal测)`。该配置仅保存在测试 Seal 侧,绝对不执行 `deploy hosecloud sync`,杜绝向生产合思费控推送 EBot 节点或创建外发 webhook。 ## Route By Intent diff --git a/skills/seal-use/references/staging-simulation-workflow.md b/skills/seal-use/references/staging-simulation-workflow.md index 4659187..bec0f74 100644 --- a/skills/seal-use/references/staging-simulation-workflow.md +++ b/skills/seal-use/references/staging-simulation-workflow.md @@ -13,9 +13,9 @@ # 国内镜像源秒级自愈与升级 curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash ``` -2. **测试先行,生产草稿隔离 (Staging-First Evolution)**: - - 生产环境的规则修改**只能以草稿态保存**(`draft`),绝对禁止直接在生产环境发布未经验证的规则版本。 - - 通过 `seal-use corps sync-test` 将生产草稿规则、知识文档与偏好自动同步至绑定的测试企业并在测试环境发布语义版本,用于模拟测试验证。 +2. **测试先行,优先草稿隔离 (Staging-First Recommendation)**: + - 强烈建议生产环境的规则修改优先以草稿态(`draft`)保存,并通过 `seal-use corps sync-test` 自动同步到绑定的测试企业进行模拟验证。 + - Agent 应主动向用户建议该安全演进闭环,但**绝不替用户做决定**。最终的操作权在用户手中;若用户明确指示直接在生产企业发布,Agent 必须尊重并遵照用户意图执行。 3. **合思集成安全隔离 (Hosecloud Zero-Impact Sync)**: - 测试环境进行合思模拟测试,必须在测试企业中保存合思凭证。 - `corps sync-test` 会自动读取本地生产 source 凭证并为测试环境配置 `assisted`(辅助)模式的合思集成,名称格式为 `{企业名前缀}(Seal测)`。 @@ -79,7 +79,7 @@ flowchart TD ```bash seal-use tool seal_approval_rules_update --corp --json '{"ruleId":"...","description":"..."}' ``` - - **关键安全底线**:此时**绝不调用** `seal-use rules publish --corp `!生产企业始终停留在草稿态,线上正在进行的审批不受任何干扰。 + - **最佳安全建议**:修改草稿后,建议先不调用 `seal-use rules publish --corp `,而是先引导用户同步至测试企业进行单据模拟验证;若用户明确要求直接投产,则严格遵从用户指示执行发布。 ---