Skip to content

Commit 5c36062

Browse files
Harden workspace manifest validation and search caching
1 parent 40cec8c commit 5c36062

35 files changed

Lines changed: 2645 additions & 211 deletions

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,17 @@ Current workspace source taxonomy:
281281
- `repo-level adoption` lives under normal `repos/...`
282282
- `core service` lives under `tools/<name>/` with durable state in `shared/<name>/<user>/` and disposable state in `cache/<name>/<user>/`
283283

284-
External skill catalogs such as [`openai/skills`](https://github.com/openai/skills) and upstream design catalogs such as [`VoltAgent/awesome-design-md`](https://github.com/VoltAgent/awesome-design-md) should be treated as optional reviewed sources, not vendored workspace dependencies.
284+
External skill catalogs such as [`openai/skills`](https://github.com/openai/skills), the canonical [`google-labs-code/design.md`](https://github.com/google-labs-code/design.md) spec/tooling, and example catalogs such as [`VoltAgent/awesome-design-md`](https://github.com/VoltAgent/awesome-design-md) should be treated as optional reviewed sources, not vendored workspace dependencies.
285285

286286
- install only the specific skills that solve a real workflow need
287287
- prefer local skill installation via Codex tooling such as `$skill-installer`
288288
- for repo-level Codex discoverability, prefer tracked `.codex/skills/` and keep `.agents/skills/` only when repo-local compatibility mirroring helps
289289
- keep workspace-wide reusable skill sources in `shared/skills/` and starter templates in `tools/templates/skills/`
290-
- keep the managed VoltAgent `DESIGN.md` catalog as an optional ability under `repos/abilities/voltagent-awesome-design-md` and copy only the specific `DESIGN.md` files a repo actually needs
290+
- treat `google-labs-code/design.md` as the canonical repo-level `DESIGN.md` standard and use `tools/scripts/design-md.sh` to initialize, lint, and diff repo-owned `DESIGN.md` files
291+
- keep repo-root `DESIGN.md` optional and per-repo, recommended mainly for UI-heavy repos rather than the whole workspace
292+
- keep the managed VoltAgent `DESIGN.md` catalog as an optional example ability under `repos/abilities/voltagent-awesome-design-md` and copy only the specific example files a repo actually needs
291293
- use `tools/scripts/capture-site-reference.sh` when a repo needs a conservative `httrack`-based public-site reference capture plus a repo-local acquisition note under `ref/httrack/`
292-
- use `tools/scripts/use-design-md.sh` when you want a stable local mirror under `cache/design-md/catalog/` or need to copy one `DESIGN.md` into a repo root quickly
294+
- use `tools/scripts/use-design-md.sh` only for the VoltAgent example catalog mirror under `cache/design-md/catalog/`
293295
- keep third-party orchestration layers and generated agent setup local-only unless there is a strong reason to publish them
294296
- do not add the whole upstream skill catalog to `repos/`, `tools/`, or as a submodule unless there is a very specific maintenance reason
295297

docs/06-cross-agent-skills-and-mcp.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,21 @@ Treat upstream skill catalogs such as [`openai/skills`](https://github.com/opena
5252
- keep `.agents/skills/` only as an optional compatibility mirror when needed
5353
- keep shared reusable source material in `shared/skills/` and `tools/templates/skills/`
5454

55-
Treat upstream design catalogs such as [`VoltAgent/awesome-design-md`](https://github.com/VoltAgent/awesome-design-md) similarly:
55+
Treat repo-level `DESIGN.md` in two layers:
5656

57-
- classify it as an optional workspace `ability`
57+
- use [`google-labs-code/design.md`](https://github.com/google-labs-code/design.md) as the canonical workspace standard for repo-owned `DESIGN.md` files
58+
- keep repo-root `DESIGN.md` optional and per-repo, recommended mainly for UI-heavy repos
59+
- initialize, lint, and diff those files through `tools/scripts/design-md.sh`
60+
- keep one repo's `DESIGN.md` local to that repo instead of inventing a shared cross-repo design file
61+
62+
Treat upstream example catalogs such as [`VoltAgent/awesome-design-md`](https://github.com/VoltAgent/awesome-design-md) similarly:
63+
64+
- classify the catalog as an optional workspace `ability`
5865
- keep the managed catalog as a standalone repo under `repos/abilities/voltagent-awesome-design-md`
5966
- refresh it with `tools/scripts/manage-workspace-capabilities.sh update --run voltagent-awesome-design-md` when you want newer `DESIGN.md` files
60-
- copy only the specific `DESIGN.md` files a repo needs into that repo instead of making the catalog a shared runtime dependency
67+
- use it as example source material only, and copy only the specific `DESIGN.md` files a repo needs into that repo instead of making the catalog a shared runtime dependency
6168

62-
The reviewed update flow now uses one classification-aware lifecycle: snapshot sources such as `openai/skills` and `openai/codex` stay under `tools/ref/`, optional abilities such as `VoltAgent/awesome-design-md` live under `repos/abilities/`, and core workspace services live under `tools/`.
69+
The reviewed update flow now uses one classification-aware lifecycle: snapshot sources such as `openai/skills` and `openai/codex` stay under `tools/ref/`, optional abilities such as `google-labs-code/design.md` and `VoltAgent/awesome-design-md` live under `repos/abilities/`, and core workspace services live under `tools/`.
6370

6471
Third-party orchestration layers that generate `AGENTS.md`, skills folders, or MCP config should remain optional local tooling by default rather than becoming the canonical workspace layout.
6572

docs/09-new-repo-baseline.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ This is not meant to force every repo into one shape. The goal is to keep each r
3737
When useful, add small explicit metadata instead of hidden assumptions:
3838

3939
- `.workspace/project.json` for runtime mode, launch command, preview URL, or notes
40+
- `DESIGN.md` at the repo root when the repo has meaningful UI or design-system work and needs a tracked visual language reference
4041
- `.workspace/agent-stack.json` when the repo intentionally supports tracked multi-tool agent hints such as OMX-ready or OpenCode-ready setup
4142
- `README.md` for repo purpose, setup, run instructions, preview notes, and cover block
4243
- `docs/cover.png` as the default repo-local cover path, even if it starts as a placeholder
@@ -76,9 +77,10 @@ Recommended intake order:
7677
4. Create `README.md` if it is missing, or tighten the current one if it exists but does not explain setup and preview.
7778
5. Add a runnable launcher command file so the repo can be started without remembering the shell incantation.
7879
6. Add a repo-local cover image reference in the README, even if the image is a placeholder at first.
79-
7. Add `.workspace/project.json` only when runtime behavior is not obvious from the repo files.
80-
8. Add repo-level `AGENTS.md`, `HANDOVER.md`, or repo-local skills only when they solve a real repo-specific need.
81-
9. If README, HANDOVER, or durable setup docs were created or materially updated, run `tools/bin/workspace-memory save-repo <repo-path-or-name>` so the shared memory layer captures the repo state, related workspace docs, and the current Codex thread in one closeout step.
80+
7. Add repo-root `DESIGN.md` only when the repo would benefit from tracked UI or design-system guidance; do not add it mechanically to every repo.
81+
8. Add `.workspace/project.json` only when runtime behavior is not obvious from the repo files.
82+
9. Add repo-level `AGENTS.md`, `HANDOVER.md`, or repo-local skills only when they solve a real repo-specific need.
83+
10. If README, HANDOVER, `DESIGN.md`, or other durable setup docs were created or materially updated, run `tools/bin/workspace-memory save-repo <repo-path-or-name>` so the shared memory layer captures the repo state, related workspace docs, and the current Codex thread in one closeout step.
8284

8385
For MemPalace target metadata, prefer `.workspace/mempalace/` inside the repo rather than dropping `mempalace.yaml` or `entities.json` at the repo root.
8486

@@ -94,6 +96,8 @@ Use a placeholder image first if a real preview capture is not ready yet. Keepin
9496

9597
The starter files in `tools/templates/repo-docs/` are the default template source for this intake step.
9698

99+
For UI-heavy repos that need tracked design-system context, the starter source for a repo-local `DESIGN.md` now lives in `tools/templates/design-md/`, and the canonical wrapper is `tools/scripts/design-md.sh`.
100+
97101
## Implementation batches
98102

99103
Use batches when a repo has enough pending work that a future chat should be able to pick up one complete slice at a time.

docs/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2026-04-22
4+
5+
- Added `tools/scripts/design-md.sh` as the canonical repo-level `DESIGN.md` wrapper for starter-template init, `@google/design.md` lint/diff, and optional delegation to the VoltAgent example catalog.
6+
- Added `tools/templates/design-md/` with a Google-spec-aligned starter `DESIGN.md` template so UI-heavy repos can adopt repo-root design context without inventing a shared workspace-wide design file.
7+
- Registered `google-labs-code/design.md` as the canonical optional workspace ability, while explicitly retaining `VoltAgent/awesome-design-md` as the optional example catalog path.
8+
- Updated [README](../README.md), [docs/README](README.md), [06-cross-agent-skills-and-mcp](06-cross-agent-skills-and-mcp.md), and [09-new-repo-baseline](09-new-repo-baseline.md) so `DESIGN.md` is documented as an opt-in per-repo surface, recommended for UI-heavy repos only.
9+
- Added lightweight Workspace Hub detection for repo-root `DESIGN.md` presence so repo details can surface it without introducing a new manifest layer.
10+
311
## 2026-04-17
412

513
- Added `tools/scripts/workspace-port-allocator.sh` and rewired the workspace-level launchers under `tools/local/commands/` to reserve ports through `cache/runtime/ports/`, reducing same-time launcher collisions while keeping hosts fixed on `127.0.0.1` and falling forward to the next open port in each repo's range.

docs/HANDOVER.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,50 @@ The workspace launcher baseline is now:
159159

160160
This is intended to reduce same-time launcher collisions without making local URLs unpredictable.
161161

162+
## `DESIGN.md` capability note (2026-04-22)
163+
164+
The workspace now has a canonical per-repo `DESIGN.md` path.
165+
166+
Current stance:
167+
168+
- treat [`google-labs-code/design.md`](https://github.com/google-labs-code/design.md) as the canonical `DESIGN.md` standard for this workspace
169+
- keep repo-root `DESIGN.md` optional and per-repo, recommended mainly for UI-heavy repos
170+
- use `tools/scripts/design-md.sh` for the repo-owned workflow:
171+
- `init` copies the tracked starter template into repo-root `DESIGN.md`
172+
- `lint` runs `npx -y @google/design.md lint`
173+
- `diff` runs `npx -y @google/design.md diff`
174+
- `examples ...` delegates to the existing VoltAgent-backed example catalog flow
175+
- keep `tools/scripts/use-design-md.sh` as the optional VoltAgent example-catalog wrapper, not as the canonical authoring workflow
176+
- keep copied or authored `DESIGN.md` files inside the individual repo that owns them rather than inventing one shared workspace-wide design file
177+
178+
Tracked surfaces added in this slice:
179+
180+
- `tools/scripts/design-md.sh`
181+
- `tools/templates/design-md/`
182+
- `tools/manifests/workspace-capabilities.json` entry for `google-labs-code/design.md`
183+
- Workspace Hub repo-details detection for repo-root `DESIGN.md`
184+
185+
Verification completed in this slice:
186+
187+
- `sh -n tools/scripts/design-md.sh tools/scripts/use-design-md.sh`
188+
- `pnpm --dir "repos/workspace-hub" typecheck`
189+
- targeted `workspace-hub` tests covering the new wrapper, template flow, and repo detection
190+
- live smoke of the real CLI:
191+
- `tools/scripts/design-md.sh init <tmpdir>`
192+
- `tools/scripts/design-md.sh lint <tmpdir>` returned `0` errors and `0` warnings on the starter template
193+
- `tools/scripts/design-md.sh diff <tmpdir> <tmpdir>/DESIGN-v2.md` reported the expected token change
194+
- a deliberately invalid color fixture produced a structured lint error
195+
196+
Public docs now aligned for this feature:
197+
198+
- `README.md`
199+
- `docs/README.md`
200+
- `docs/CHANGELOG.md`
201+
- `docs/06-cross-agent-skills-and-mcp.md`
202+
- `docs/09-new-repo-baseline.md`
203+
204+
Repo-local `repos/workspace-hub/README.md` did not need a matching public-doc update for this slice because the change there is limited to lightweight repo-details detection rather than a new end-user Hub workflow surface.
205+
162206
## Release verification status
163207

164208
The stable release gate has already been exercised successfully:

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ Useful maintenance scripts:
8585
- `tools/scripts/run-with-workspace-env.sh` runs a command with the shared workspace environment, including the shared Playwright browser cache path.
8686
- `tools/scripts/setup-workspace-profile.sh` provides a guided, non-destructive profile check for `core`, `hub`, `mixed-stack`, `wordpress`, `agent-enhanced`, `workflow-state`, `spec-driven`, and `ui-previews`.
8787
- `tools/scripts/manage-workspace-capabilities.sh` lists, installs, updates, enables, disables, or uninstalls tracked workspace abilities and core services, with dry-run mode by default.
88+
- `tools/scripts/design-md.sh` is the canonical repo-level `DESIGN.md` wrapper for starter-template init, `@google/design.md` lint/diff, and example-catalog delegation.
8889
- `tools/scripts/update-github-refs.sh` remains the compatibility wrapper for update-only reviewed GitHub-ref flows and delegates to the capability lifecycle command.
8990
- `tools/scripts/capture-site-reference.sh` previews or runs an `httrack` capture for a public-site reference repo, using conservative same-domain defaults and writing capture notes under repo-local `ref/httrack/`.
9091
- `tools/scripts/workspace-port-allocator.sh` centralizes workspace launcher port reservations under `cache/runtime/ports/`, so concurrent launchers can keep `127.0.0.1` stable and step to the next open port without colliding.
91-
- `tools/scripts/use-design-md.sh` mirrors the managed VoltAgent `DESIGN.md` catalog ability into `cache/design-md/catalog/`, lists available site ids, and can copy a selected `DESIGN.md` into a repo root.
92+
- `tools/scripts/use-design-md.sh` mirrors the managed VoltAgent example `DESIGN.md` catalog ability into `cache/design-md/catalog/`, lists available site ids, and can copy a selected example `DESIGN.md` into a repo root.
9293
- `tools/scripts/sync-reference-snapshots.sh` previews or refreshes ignored upstream reference snapshots under `tools/ref/`, with dry-run mode by default.
9394
- `tools/scripts/sync-codex-skills.sh` previews or syncs tracked workspace skill sources into repo `.codex/skills/` folders plus optional `.agents/skills/` compatibility mirrors, with dry-run mode by default.
9495
- `tools/scripts/trim-git-repos.sh` performs safe Git maintenance across `repos/` by cleaning `.git` sync noise, expiring older reflog entries, and running `git gc` with a conservative prune window.
@@ -103,6 +104,7 @@ Useful template locations:
103104

104105
- `tools/templates/skills/` holds starter skill packs, execution-mode conventions, and a selective install-profile example.
105106
- `tools/templates/repo-docs/` holds a starter repo `README.md` template plus a placeholder cover image for new repo intake.
107+
- `tools/templates/design-md/` holds the canonical repo-level `DESIGN.md` starter template and notes for UI-heavy repos that want tracked design-system context.
106108
- `tools/templates/codex/` holds starter material for official repo-local `.codex/` setup.
107109
- `tools/templates/opencode/` holds starter material for optional `.opencode/` setup plus mixed-tool agent presets.
108110
- `tools/templates/mcp/` holds the official MCP v1 profile and server examples, env templates, generic `read-only` versus `mutating` starter examples, and stdio/logging hygiene notes.

repos/workspace-hub/server/core-service-runtime.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type {
1111
WorkspaceCoreServiceCommandId,
1212
} from '../src/types/workspace.ts'
1313
import { publishWorkspaceEvent } from './live-events.ts'
14+
import { invalidateWorkspaceSearchIndex } from './workspace-search.ts'
1415

1516
type ManagedServiceRuntime = {
1617
child: ChildProcess
@@ -139,7 +140,7 @@ export async function startCoreService(service: WorkspaceCoreService) {
139140
throw new Error(`${service.name} is already running.`)
140141
}
141142

142-
const child = spawn(service.runtimeCommand, [], {
143+
const child = spawn(service.runtimeCommandArgs[0], service.runtimeCommandArgs.slice(1), {
143144
cwd: service.repoPresent ? service.repoPath : undefined,
144145
env: process.env,
145146
stdio: ['ignore', 'pipe', 'pipe'],
@@ -236,7 +237,7 @@ export async function runCoreServiceInstall(service: WorkspaceCoreService) {
236237
throw new Error(`${service.name} install is already running.`)
237238
}
238239

239-
const child = spawn(service.installCommand, [], {
240+
const child = spawn(service.installCommandArgs[0], service.installCommandArgs.slice(1), {
240241
cwd: service.repoPresent ? service.repoPath : undefined,
241242
env: process.env,
242243
stdio: ['ignore', 'pipe', 'pipe'],
@@ -284,6 +285,7 @@ export async function runCoreServiceInstall(service: WorkspaceCoreService) {
284285
status: record.snapshot.status,
285286
type: 'service',
286287
})
288+
invalidateWorkspaceSearchIndex('core-service-install')
287289
})
288290

289291
publishWorkspaceEvent({
@@ -295,7 +297,7 @@ export async function runCoreServiceInstall(service: WorkspaceCoreService) {
295297
}
296298

297299
export async function runCoreServiceSync(service: WorkspaceCoreService) {
298-
await execFileAsync(service.syncCommand, [], {
300+
await execFileAsync(service.syncCommandArgs[0], service.syncCommandArgs.slice(1), {
299301
cwd: service.repoPresent ? service.repoPath : undefined,
300302
env: process.env,
301303
maxBuffer: 1024 * 512,
@@ -308,6 +310,7 @@ export async function runCoreServiceSync(service: WorkspaceCoreService) {
308310
status: 'ready',
309311
type: 'service',
310312
})
313+
invalidateWorkspaceSearchIndex('core-service-sync')
311314
}
312315

313316
type CoreServiceCommandOptions = {

0 commit comments

Comments
 (0)