Repository navigation
Closed
Closed
Copy link
Description
Why
For #58 + #147 to deliver real "git-native workspace" parity with Bruno, the workspace state needs to live as per-entity files, not as opaque bundles. Today:
- Environments live as one big JSON blob (
bowire_environments_shared→ single file when persisted). Renaming one env or editing two of its vars produces a single-line diff that touches the whole blob. - Collections same shape —
collections.jsonis a bundle. - Scripts (pre / post / assertion) are embedded as strings inside the method or collection JSON. Multi-line code as JSON-escaped strings is unreviewable.
Bruno's .bru model: each request is its own file (Login.bru), syntax-highlighted natively, diff-friendly, mergeable across PRs. We need the same shape.
Proposal — per-entity files under the workspace root
<workspaceRoot>/
workspace.json # manifest (name, color, settings, schema version)
environments/
staging.json # one file per env; filename = name
production.json
globals.json # globals stays a single file (no per-key benefit)
collections/
payments/
collection.json # collection metadata
Login.req.json # one file per request
RefundFlow.req.json
pre-request.js # collection-scope pre-script
post-response.js
scripts/
Auth.Login.pre.js # service.method scope
Pets.GetById.post.js
Pets.GetById.assert.js
recordings/ # already per-recording dir from #144
<recordingId>/
flows/
payments-refund.flow.json
trash/
environments/... # mirrors the live shape
Format choices
- Pretty-printed JSON with deterministic key ordering (already done elsewhere).
- Filenames mirror entity names, sanitised for path-safe characters. Renames in the UI rename the file.
- Scripts as
.jsfiles, not JSON-escaped strings. Tools (editors, linters, code-review) work natively. - Trailing newline on every file so git doesn't flag "no newline at end of file".
- Stable IDs still live inside each entity for cross-references (e.g.
step.serviceId); filenames are operator-visible identity.
Migration
- One-shot migration on first load when a workspace's
storageRootis set (or when the operator explicitly runs the migration viabowire workspace migrate-format). - Reads the legacy bundles, splits into per-file shape, leaves the bundles next to a
.legacysuffix so a downgrade can still read them. - Marker
workspace-format-version: 2on the manifest prevents re-running.
Acceptance
- Environments stored one file per env under
environments/. - Globals stay as a single
globals.json(justified — no per-key benefit). - Collections become a directory:
collection.jsonfor metadata +<requestName>.req.jsonper request. - Pre / post / assertion scripts saved as
.jsfiles (one per service.method or per collection). - Renaming an entity renames its file.
- Deletes move the file to
trash/<entity-type>/<name>withdeletedAtmetadata for the Uniform delete affordances on every list sidebar (single / multi-select / all) #143 trash bin. - Manifest carries
workspaceFormatVersion; migration runs once + marks done. - Round-trip: read → write → diff produces zero bytes of change.
Composes with
- Workspace: complete the Git-native story (.bww file) #58 — closes the recording / flow migration items; this issue completes the picture for envs / collections / scripts.
- Git-backed workspace storage — composes with #144 storage modes + #58 #147 — defines
storageRoot; this issue defines the file shape inside it. - Pre-/post-scripts with a protocol-typed sandbox #126 — pre/post scripts as a typed feature; per-file format is the storage side.
- Uniform delete affordances on every list sidebar (single / multi-select / all) #143 — trash bin paths follow the same per-entity layout.
Out of scope
.toml, YAML, or proprietary.bru-style DSL — JSON stays the format. The benefit is per-entity, not the syntax.- Symlink resolution / extends-other-workspace — too niche for v1.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(workspace): #147-#151 Phase 1 — storageRoot resolver + 'bowire w…
thomas-stegemann commentedon Jun 13, 2026
Phase 1 shipped in eb2bf1c — see #196 for the Phase 2 acceptance:
Phase 2 (runtime wiring of storageRoot in the workbench, full per-entity reader/writer with bundle→per-entity migration, FS-watch SSE + reconcile UI, secret-file merge at resolve time, .bowire.lock concurrent-writer guard) lives in #196 → v2.1.
feat(workspace): #196 Phase 2.1 — Kuestenlogik.Bowire.Workspace.Git s…