Преглед изворни кода

test(web): follow the settled-loader startup audit

Loader settlement no longer rejects on a failed optional entry, so the Auto
rollback scenario reads the conflict from the startup audit. Refresh the Auto
denial golden for the merged composer chrome.
Chinesezjc пре 1 недеља
родитељ
комит
1de37ddc2b

+ 8 - 4
apps/web/tests/shipped-composition.e2e.ts

@@ -13,7 +13,7 @@ import { LlmAdapter, ToolCallId } from '@deepseek-ai/dsh-llm'
 import type { GenerateOptions, LlmResolvedModelInfo, StreamChunk } from '@deepseek-ai/dsh-llm'
 import type { GenerateOptions, LlmResolvedModelInfo, StreamChunk } from '@deepseek-ai/dsh-llm'
 import { canonicalPath, writableRoots } from '@deepseek-ai/dsh-sandbox'
 import { canonicalPath, writableRoots } from '@deepseek-ai/dsh-sandbox'
 import { SESSION_FORMAT_VERSION, SessionId, type SessionEvent } from '@deepseek-ai/dsh-session'
 import { SESSION_FORMAT_VERSION, SessionId, type SessionEvent } from '@deepseek-ai/dsh-session'
-import { composeEntries, loadOverlayPatches } from '@deepseek-ai/dsh-app-boot'
+import { auditStartupEntries, composeEntries, loadOverlayPatches } from '@deepseek-ai/dsh-app-boot'
 // These imports carry the tools/sandboxPolicy/approval Context merges.
 // These imports carry the tools/sandboxPolicy/approval Context merges.
 import { RUN_CODE_NAME } from '@deepseek-ai/dsh-tools'
 import { RUN_CODE_NAME } from '@deepseek-ai/dsh-tools'
 import type {} from '@deepseek-ai/dsh-sandbox-policy'
 import type {} from '@deepseek-ai/dsh-sandbox-policy'
@@ -1005,9 +1005,13 @@ it('rolls back a failed shipped Auto initialization before publishing or interce
   // not an Auto reviewer or a supported host composition.
   // not an Auto reviewer or a supported host composition.
   const stopUnsupportedConflict = ctx.permissionPresets.registerAuto(() => {})
   const stopUnsupportedConflict = ctx.permissionPresets.registerAuto(() => {})
   try {
   try {
-    await expect(
-      autoEntry.update({ disabled: false }).then(() => ctx.loader.await()),
-    ).rejects.toThrow('preset "auto" is already registered')
+    // A failed optional entry settles the Loader without rejecting it and
+    // reports through the startup audit, which is where the conflict surfaces.
+    const warnings: string[] = []
+    await autoEntry.update({ disabled: false })
+    await ctx.loader.await()
+    await auditStartupEntries(ctx, 'web e2e scaffold', (line) => { warnings.push(line) })
+    expect(warnings.join('\n')).toContain('preset "auto" is already registered')
 
 
     const handle = await ctx.agents.create({
     const handle = await ctx.agents.create({
       sessionId: SessionId('shipped-auto-init-rollback'),
       sessionId: SessionId('shipped-auto-init-rollback'),

+ 3 - 9
snapshots/web/auto-review-denial/ui.expected.md

@@ -26,9 +26,7 @@
   - img
   - img
   - text: Bash Rejected by Auto review
   - text: Bash Rejected by Auto review
 - textbox "Message or run a task, / commands, @ files or sessions"
 - textbox "Message or run a task, / commands, @ files or sessions"
-- button "Commands":
-  - img
-- button "Add attachment":
+- button "Add files or run commands":
   - img
   - img
 - 'button "Access mode, current: Auto review EXP"':
 - 'button "Access mode, current: Auto review EXP"':
   - text: Auto review
   - text: Auto review
@@ -73,9 +71,7 @@
 - text: "OUT Tool was not executed. Reason: ptc raw reason"
 - text: "OUT Tool was not executed. Reason: ptc raw reason"
 - button "Inspect"
 - button "Inspect"
 - textbox "Message or run a task, / commands, @ files or sessions"
 - textbox "Message or run a task, / commands, @ files or sessions"
-- button "Commands":
-  - img
-- button "Add attachment":
+- button "Add files or run commands":
   - img
   - img
 - 'button "Access mode, current: Auto review EXP"':
 - 'button "Access mode, current: Auto review EXP"':
   - text: Auto review
   - text: Auto review
@@ -143,9 +139,7 @@
     - tab "Timing"
     - tab "Timing"
   - tabpanel "Result": "AutoReviewDeniedError: AUTO_REVIEW_DENIED Error: Auto review rejected tool \"bash\"; its body was not executed"
   - tabpanel "Result": "AutoReviewDeniedError: AUTO_REVIEW_DENIED Error: Auto review rejected tool \"bash\"; its body was not executed"
 - textbox "Message or run a task, / commands, @ files or sessions"
 - textbox "Message or run a task, / commands, @ files or sessions"
-- button "Commands":
-  - img
-- button "Add attachment":
+- button "Add files or run commands":
   - img
   - img
 - 'button "Access mode, current: Auto review EXP"':
 - 'button "Access mode, current: Auto review EXP"':
   - text: Auto review
   - text: Auto review