Skip to content

Git-backed workspaces Phase 2 — Kuestenlogik.Bowire.Workspace.Git runtime + FS-watch + secret merge #196

Closed
5 of 5 issues completed

Description

@thomas-stegemann

Context

Phase 1 (#147-#149-#151) shipped in eb2bf1c: BowireUserContext.GetWorkspacePath(workspaceId, storageRoot?, relative) resolver, bowire workspace init <path> CLI, per-entity layout + .gitignore template with the secret-separation convention. Workbench runtime still routes through ~/.bowire/workspaces/<id>/; this issue tracks the actual swap to the git-backed storage.

Architecture — separate optional NuGet package

The runtime side of the git-backed workspace ships as a dedicated NuGet package, NOT in core Kuestenlogik.Bowire. Embedded hosts MUST be able to opt out: file watchers, per-entity reader/writers, lockfile machinery, and secret-overlay merging are real dependencies that don't belong in every ASP.NET app that mounts Bowire.

Package: Kuestenlogik.Bowire.Workspace.Git

The Workspace.<backend> namespace leaves room for future storage backends (Workspace.S3, Workspace.Sql, …) under the same shape.

Contents:

  • Per-entity file reader/writer (replaces the bundle store when storageRoot is set).
  • FileSystemWatcher + debounced SSE producer on /api/workspace/events.
  • Workspace lockfile (.bowire.lock) machinery for concurrent-writer guard.
  • Secret-overlay merge (<env>.json + <env>.secrets.json).
  • Migration helper (legacy bundle → per-entity layout, surfaced as the CLI's migrate-format).
  • IBowireExtension-style registration so the workbench discovers it when present and falls back to the legacy store cleanly when it isn't.

Core Kuestenlogik.Bowire stays unchanged: the GetWorkspacePath seam is enough for the extension to plug in; without the package referenced, the seam returns the legacy per-user path and no FS-watch / lockfile / secret-merge runs.

Standalone Kuestenlogik.Bowire.Tool references the package so the CLI ships with the git-workspace runtime bundled. Embedded hosts add the package explicitly when they want the surface.

Phase 2 acceptance

  • Package scaffolding — src/Kuestenlogik.Bowire.Workspace.Git/ with the .csproj, IBowireExtension-style registration, MSBuild plumbing to publish a NuGet, and a smoke test that the package loads when referenced + no-ops when not.
  • Git-backed workspace storage — composes with #144 storage modes + #58 #147 — workspace.storageRoot field surfaced in the Workspaces rail settings; setting it routes every per-workspace read/write through the new resolver. Backend endpoints (/api/recordings, /api/collections, /api/workspace) accept ?storageRoot=… next to ?workspaceId=….
  • Per-entity file storage format for git-backed workspaces (envs / collections / scripts) #148 — Per-entity file reader/writer for environments, collections (incl. per-request .req.json files), recordings, scripts, flows. Migration path from the existing bundle store: bowire workspace migrate-format produces the per-entity layout from a legacy folder; the bundle is renamed .legacy for the operator to rm.
  • Workspace CLI — bowire workspace init / export / import / migrate-format #149 — bowire workspace export [--from <wsId>] <path> + bowire workspace import <path>. Round-trips the workspace state without touching ~/.bowire/; useful in CI / scripted setup.
  • Filesystem-watch + reconcile UI for externally-edited workspace files #150 — FileSystemWatcher on the active workspace's storageRoot debounced to 300 ms; emits SSE events on /api/workspace/events (file-changed / file-created / file-deleted). Workbench subscribes and surfaces a "files changed externally — reload?" toast.
  • Secret-file separation + workspace lock file for safe team-shared git workspaces #151 — Reading <env>.json merges <env>.secrets.json overlay (when present) at resolve time so {{API_KEY}} works from either file. Workspace lockfile (.bowire.lock) prevents concurrent writers (workbench + bowire run in the same workspace root); each writer takes the lock for the duration of a transaction, second writer surfaces a friendly "another process is editing this workspace" hint instead of corrupting state.
  • Embedded-mode regression test — adding Kuestenlogik.Bowire to a stock ASP.NET app without the package must not pull System.IO.FileSystemWatcher-class deps and must not start any background watcher.

Composes with

Activity

  1. changed the title [-]Git-backed workspaces Phase 2 — runtime wiring, FS-watch, secret merge, lockfile[/-] [+]Git-backed workspaces Phase 2 — Kuestenlogik.Bowire.Workspace.Git runtime + FS-watch + secret merge[/+] on Jun 13, 2026
  2. added 2 commits that reference this issue on Jun 15, 2026
  3. moved this to Backlog in Bowireon Jun 15, 2026
  4. added 3 commits that reference this issue on Jun 15, 2026
  5. 1 remaining item

  6. thomas-stegemann commented on Jun 16, 2026

    @thomas-stegemann
    MemberAuthor

    All seven acceptance items shipped across five phases:

    Embedded-mode regression test landed alongside Phase 2.4 in WorkspaceGitEventsEndpointTests — proves the endpoint surfaces 501 + 'AddBowireGitWorkspace not called' hint when the runtime is not wired, so stock embedded ASP.NET hosts don't get a silent FileSystemWatcher leak.

    Closes #196.

  7. moved this from Backlog to Done in Bowireon Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions