Skip to content

Commit 6df8e01

Browse files
author
DavidQ
committed
Rename Workspace V2 session terminology to toolState across code, schemas, UI, tests, and docs - PR_26124_012-rename-session-to-toolstate - v2
1 parent ad90357 commit 6df8e01

3 files changed

Lines changed: 209 additions & 145 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# PR_26124_012 Tool-State Terminology Rename Report
2+
3+
## Scope
4+
- Runtime/UI: `tools/workspace-v2/index.js`, `tools/workspace-v2/index.html`
5+
- Schema contract touchpoints: `tools/schemas/workspace.manifest.schema.json` (verification)
6+
- Active Workspace V2 tests: `tests/ui/workspace-v2.asset-manager.spec.js`, `tests/playwright/workspace-v2.validation.spec.js`, `tests/playwright/tool-validation/workspace-v2.tool-validation.spec.js`
7+
8+
## Required rename terms searched
9+
- `savedSessions`
10+
- `activeSession`
11+
- `sessionId`
12+
- `Session Library`
13+
- `Workspace Session`
14+
- `Create Session + Launch`
15+
- `New Session`
16+
- `Load Fixture`
17+
- `session payload`
18+
- `saved session`
19+
- `active session`
20+
21+
## Implementation summary
22+
- Standardized Workspace V2 non-browser session terminology to tool-state language in runtime/UI and active Playwright-facing surfaces.
23+
- Updated remaining non-browser runtime strings and identifiers in `tools/workspace-v2/index.js` (for example: activation messages, merge result validation token, fixture load messages, library error text).
24+
- Updated Playwright tool-validation helper naming from session-oriented helpers to tool-state-oriented helpers.
25+
26+
## Search results
27+
28+
### Active Workspace V2 contract/UI/test surface
29+
Command run:
30+
- `rg -n "savedSessions|activeSession|sessionId|Session Library|Workspace Session|Create Session \+ Launch|New Session|Load Fixture|session payload|saved session|active session" tools/workspace-v2/index.js tools/workspace-v2/index.html tools/schemas/workspace.manifest.schema.json tests/ui/workspace-v2.asset-manager.spec.js tests/playwright/workspace-v2.validation.spec.js tests/playwright/tool-validation/workspace-v2.tool-validation.spec.js`
31+
32+
Result:
33+
- `0` matches
34+
35+
### Remaining `session` wording (intentional)
36+
Command run:
37+
- `rg -n "session|Session|workspaceSession" tools/workspace-v2/index.js tools/workspace-v2/index.html tests/ui/workspace-v2.asset-manager.spec.js tests/playwright/tool-validation/workspace-v2.tool-validation.spec.js`
38+
39+
Remaining categories:
40+
1. Browser storage concepts (`sessionStorage`, `Session Storage`, `Clear Session Storage`)
41+
- Reason: these are browser/runtime storage APIs, not Workspace V2 saved/resumable tool-state naming.
42+
2. Legacy-shape rejection assertion (`workspaceSession` key check in UI test)
43+
- Reason: retained as an explicit negative assertion to ensure old/invalid manifest shape is rejected.
44+
45+
### Historical docs/tests outside active contract surface
46+
Commands run:
47+
- `rg -n "Session Library|Workspace Session|savedSessions|activeSession|session payload|saved session|active session|Create Session \+ Launch|Load Fixture|New Session" docs/dev/reports --glob "PR_*"`
48+
- `rg -n "Session Library|Workspace Session|savedSessions|activeSession|session payload|saved session|active session|sessionId" tests/runtime --glob "V2*.test.mjs"`
49+
50+
Result counts:
51+
- `docs/dev/reports`: `123` matches
52+
- `tests/runtime/V2*.test.mjs`: `164` matches
53+
54+
Reason for keeping these in this PR:
55+
- They are historical evidence artifacts and legacy targeted-runtime assertions from prior PRs.
56+
- Renaming those files/messages would rewrite historical report context and expand this PR beyond the runtime/UI/contract rename lane.
57+
58+
## Validation
59+
- `node --check tools/workspace-v2/index.js` -> PASS
60+
- `npm run test:workspace-v2` -> PASS (`19 passed, 0 failed`)
61+
62+
## Full samples smoke test
63+
- Skipped.
64+
- Reason: scope is Workspace V2 terminology and active Workspace V2 Playwright coverage only; no shared sample framework changes were made.

tests/playwright/tool-validation/workspace-v2.tool-validation.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function parseAuditToolList() {
2525
return uniqueTools;
2626
}
2727

28-
function readFixtureSession(toolId) {
28+
function readFixtureToolState(toolId) {
2929
const fixturePath = path.join(fixtureRoot, `${toolId}.json`);
3030
const fixture = JSON.parse(fs.readFileSync(fixturePath, "utf8"));
3131
return {
@@ -79,7 +79,7 @@ async function importWorkspaceManifest(page, manifest) {
7979
});
8080
}
8181

82-
async function seedSessionAndOpenTool(page, baseUrl, toolId, hostContextId, toolStateContext) {
82+
async function seedToolStateAndOpenTool(page, baseUrl, toolId, hostContextId, toolStateContext) {
8383
await page.goto(`${baseUrl}/tools/workspace-v2/index.html`);
8484
await page.evaluate(({ hostContextId: id, toolStateContext: payload }) => {
8585
window.sessionStorage.setItem(id, JSON.stringify(payload));
@@ -142,7 +142,7 @@ test("@workspace-v2 tool validation list includes all audited tools", async () =
142142
test("@workspace-v2 valid workspace manifest payloadJson imports", async ({ page }) => {
143143
const server = await startRepoServer();
144144
try {
145-
const fixture = readFixtureSession("asset-manager-v2");
145+
const fixture = readFixtureToolState("asset-manager-v2");
146146
const manifest = buildWorkspaceManifest(fixture.toolStateContext, `${fixture.hostContextId}-workspace-valid`);
147147
await page.goto(`${server.baseUrl}/tools/workspace-v2/index.html`);
148148
await importWorkspaceManifest(page, manifest);
@@ -155,7 +155,7 @@ test("@workspace-v2 valid workspace manifest payloadJson imports", async ({ page
155155
test("@workspace-v2 invalid workspace manifest payloadJson is rejected", async ({ page }) => {
156156
const server = await startRepoServer();
157157
try {
158-
const fixture = readFixtureSession("asset-manager-v2");
158+
const fixture = readFixtureToolState("asset-manager-v2");
159159
const manifest = buildWorkspaceManifest(fixture.toolStateContext, `${fixture.hostContextId}-workspace-invalid`);
160160
manifest.tools["workspace-v2"].activeToolState.payloadJson = null;
161161
await page.goto(`${server.baseUrl}/tools/workspace-v2/index.html`);
@@ -175,8 +175,8 @@ for (const toolId of toolIds) {
175175
test(`@${toolId} valid payloadJson renders`, async ({ page }) => {
176176
const server = await startRepoServer();
177177
try {
178-
const fixture = readFixtureSession(toolId);
179-
await seedSessionAndOpenTool(
178+
const fixture = readFixtureToolState(toolId);
179+
await seedToolStateAndOpenTool(
180180
page,
181181
server.baseUrl,
182182
toolId,
@@ -194,10 +194,10 @@ for (const toolId of toolIds) {
194194
test(`@${toolId} invalid payloadJson is rejected without partial render`, async ({ page }) => {
195195
const server = await startRepoServer();
196196
try {
197-
const fixture = readFixtureSession(toolId);
197+
const fixture = readFixtureToolState(toolId);
198198
const invalidToolState = cloneJson(fixture.toolStateContext);
199199
invalidToolState.payloadJson = null;
200-
await seedSessionAndOpenTool(
200+
await seedToolStateAndOpenTool(
201201
page,
202202
server.baseUrl,
203203
toolId,

0 commit comments

Comments
 (0)