|
1 | 1 | // Coverage for bootstrap routing across canonical and effective workspaces. |
2 | 2 | import { describe, expect, it, vi } from "vitest"; |
3 | | -import { |
4 | | -hasBootstrapFileContent, |
5 | | -resolveBootstrapContextTargets, |
6 | | -resolveAttemptWorkspaceBootstrapRouting, |
7 | | -} from "./attempt-bootstrap-routing.js"; |
| 3 | +import { resolveAttemptWorkspaceBootstrapRouting } from "./attempt-bootstrap-routing.js"; |
8 | 4 | |
9 | 5 | describe("runEmbeddedAttempt bootstrap routing", () => { |
10 | 6 | it("resolves bootstrap pending from the canonical workspace instead of a copied sandbox", async () => { |
@@ -100,34 +96,27 @@ describe("runEmbeddedAttempt bootstrap routing", () => {
|
100 | 96 | expect(routing.includeBootstrapInRuntimeContext).toBe(false); |
101 | 97 | }); |
102 | 98 | |
103 | | -it("does not treat empty hook-provided BOOTSTRAP.md as pending bootstrap context", () => { |
104 | | -expect( |
105 | | -hasBootstrapFileContent([ |
| 99 | +it("does not treat empty hook-provided BOOTSTRAP.md as pending bootstrap context", async () => { |
| 100 | +const routing = await resolveAttemptWorkspaceBootstrapRouting({ |
| 101 | +isWorkspaceBootstrapPending: vi.fn(async () => false), |
| 102 | +bootstrapFiles: [ |
106 | 103 | { |
107 | 104 | name: "BOOTSTRAP.md", |
108 | 105 | path: "/tmp/openclaw-workspace/BOOTSTRAP.md", |
109 | 106 | content: " ", |
110 | 107 | missing: false, |
111 | 108 | }, |
112 | | -]), |
113 | | -).toBe(false); |
114 | | -}); |
115 | | - |
116 | | -it("keeps BOOTSTRAP.md in Project Context for full bootstrap turns", () => { |
117 | | -expect(resolveBootstrapContextTargets({ bootstrapMode: "full" })).toEqual({ |
118 | | -includeBootstrapInSystemContext: true, |
119 | | -includeBootstrapInRuntimeContext: false, |
| 109 | +], |
| 110 | +trigger: "user", |
| 111 | +isPrimaryRun: true, |
| 112 | +isCanonicalWorkspace: true, |
| 113 | +effectiveWorkspace: "/tmp/openclaw-workspace", |
| 114 | +resolvedWorkspace: "/tmp/openclaw-workspace", |
| 115 | +hasBootstrapFileAccess: true, |
120 | 116 | }); |
121 | | -}); |
122 | 117 | |
123 | | -it("excludes BOOTSTRAP.md from every context outside full bootstrap turns", () => { |
124 | | -expect(resolveBootstrapContextTargets({ bootstrapMode: "limited" })).toEqual({ |
125 | | -includeBootstrapInSystemContext: false, |
126 | | -includeBootstrapInRuntimeContext: false, |
127 | | -}); |
128 | | -expect(resolveBootstrapContextTargets({ bootstrapMode: "none" })).toEqual({ |
129 | | -includeBootstrapInSystemContext: false, |
130 | | -includeBootstrapInRuntimeContext: false, |
131 | | -}); |
| 118 | +expect(routing.bootstrapMode).toBe("none"); |
| 119 | +expect(routing.includeBootstrapInSystemContext).toBe(false); |
| 120 | +expect(routing.includeBootstrapInRuntimeContext).toBe(false); |
132 | 121 | }); |
133 | 122 | }); |