Skip to content

Activate Doxvelt collections inside DSH workspaces - #48

Merged
MichaelSchmidle merged 3 commits into
mainfrom
codex/dsh-workspace-collections
Nov 8, 2026
Merged

MichaelSchmidle merged 3 commits into
mainfrom
codex/dsh-workspace-collections

Conversation

@MichaelSchmidle

@MichaelSchmidle MichaelSchmidle commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

DSH workspaces can activate Doxvelt, author reusable worlds, scenarios, characters and formats as local Markdown files, and create dated episodes in normal chats. Each story pins its selected source and keeps its data under the workspace's .doxvelt directory. Ordinary authoring chats retain their harness behavior and receive scoped file-format guidance in activated workspaces. The bundle uses DSH's model catalog and credentials, compact # audience routing, native segmented controls for binary choices, and consistent control-label sizing.

Scene headings organize the player's transcript and persist with story paths; they do not enter character context or reflection source. Source publication is atomic and revision-checked. Story creation has stable retry identity and reports saved stories with pending dating separately. The Windows installer uses the supported desktop plugin manager. Reverie's protocol remains version 1.

Review follow-up: unavailable workspace registry entries no longer block live workspaces; a missing active folder or unregistered chat still fails safely. JSON-quoted object names decode correctly, including quotes and backslashes, while legacy literal strings remain readable. Regression tests cover host operations, authoring guidance, collection pickers and pinned story content. The installed desktop copy is updated to the same commit and its isolated checks pass.

Validation:

  • Linux CI passes on 1717984: https://github.com/doxvelt/engine/actions/runs/42502337231.
  • 23 targeted compiler, DSH host and workspace checks pass on the review-fix commit, including regressions for both findings; lint, typecheck and smoke pass. Linux CI also validates the full suite and production UI build.
  • The installed DSH 0.2.2-rc.1 native desktop host passes isolated activation, inline object creation, episode date, manual and scripted generated play, native Reverie 0.2.0 memorization, continued play, a full host restart without re-reflection, and four viewport sizes.
  • The stock DSH browser suite passes keyboard completion, routing, actor configurations, generation recovery, saved-turn corrections, native memory, story-path switching and closed-episode correction checks. The existing launcher suite also passes.
  • Installation in the normal desktop profile is verified, and its actual desktop window exposes workspace activation. These normal-profile checks did not activate a real collection or change real stories or memories. A desktop screenshot could not be captured; controls were checked through the accessibility tree.
  • The prior full Windows run passed 461 of 481 tests. The same 20 failures reproduce on unchanged source: SQLite cleanup/lock behavior, symbolic-link privileges and Windows signal semantics.

No paid model was called. Live provider quality and compatibility remain unverified; scripted model callbacks were used. Intra-turn audience differentiation remains deferred. This is a draft for independent review; no merge is requested automatically.

@j2msReginaldBot j2msReginaldBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed fb402ca against main 28859eb. I found no defect in story pinning, retry identity, revision-checked publication, or scene-heading isolation from actor context. Two findings are inline. The first should be fixed before merge if DSH can keep a workspace whose folder no longer exists.

Verification at this head on Linux, Node 24.22.0 and Bun 1.3.13:

  • bun install --frozen-lockfile, then bun run check: lint, typecheck, 479 tests passed with 2 skipped, and smoke passed.
  • I reproduced both findings with small scripts against this revision. They are described in the inline comments.
  • I did not run the DSH desktop, browser or Windows installer suites. I did not exercise install-dsh.ps1.

if (!session.header.cwd) throw new WorkspaceCollectionError('workspace-required', 'Choose a DSH workspace first.', 409);
const root = await realpath(session.header.cwd);
for (const workspace of ctx.workspaceRegistry.list()) {
if (await realpath(workspace.path) === root) return root;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any missing registered workspace breaks Doxvelt in every workspace. realpath(workspace.path) throws ENOENT for a registered workspace whose folder was deleted, moved, or is on an unmounted drive. That error leaves the loop before later entries are checked.

Reproduction: call registeredSessionWorkspace with a registry of [{ path: <deleted dir> }, { path: <live dir> }] and a session whose cwd is the live dir. It throws ENOENT instead of returning the live root.

Impact:

  • Every /api/doxvelt-fixture request returns the generic 500 workspace-operation-failed. Saved, activation, collection and play requests all fail, in every workspace listed after the stale one.
  • The system-prompt/assemble hook swallows the error, so authoring chats silently lose the Doxvelt guidance.

This depends on whether DSH's registry can hold paths that no longer exist. I did not confirm that against DSH itself, but nothing here protects against it. Suggested fix: treat a failed realpath on a registry entry as a non-match and continue, and add a test with a stale entry.

typeof input.body !== "string" || input.body.length > 500_000)
throw new WorkspaceCollectionError("invalid-object", "Enter a name and Markdown description.");
const filename = input.kind === "character" ? `entities/${input.id}/IDENTITY.md` : `${sourceKinds[input.kind]}/${input.id}.md`;
const text = `---\nid: ${input.id}\nname: ${JSON.stringify(input.name.trim())}\n${input.kind === "character" ? "kind: agent\nvisibility: public\n" : ""}---\n\n${input.body}\n`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object names containing " or \ come back with literal backslashes. The name is written with JSON.stringify, but parseFrontmatter's stripQuotes only removes the outer quotes and does not unescape the contents.

Reproduction: createCollectionObject(dir, { kind: "world", id: "harbor", name: 'The "Old" Harbor \\ North', body: "…" }), then workspaceCollection(dir).worlds. The returned name is the string The \"Old\" Harbor \\ North instead of The "Old" Harbor \ North.

That name then appears in pickers and is pinned into new stories' compiled revisions.

Suggested fix: either reject " and \ in names, or emit a form the simple parser reads back exactly. For example, use single quotes when the name has no '. Add a round-trip test for the chosen behavior.

@j2msReginaldBot j2msReginaldBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-reviewed 1717984. Both earlier findings are fixed and no blocking issues remain.

  • Stale registry entries: a registry entry whose path cannot be resolved now counts as a non-match. A live workspace listed after a missing one resolves correctly. A chat whose own folder is missing still fails, and the new host test covers both cases.
  • Escaped names: names containing quotes and backslashes now round-trip through pickers and the compiled revision pinned for a new story. My earlier reproduction now returns The "Old" Harbor \ North.

Non-blocking note: the fix changes how all double-quoted frontmatter values are read, not just names written by Doxvelt. A legacy value is now decoded only when it happens to be valid JSON. For example, "C:\new\temp" becomes a newline and a tab, while "C:\Users\Mara" stays literal. That matches YAML's double-quoted escapes, and no frontmatter in this repository is affected. Hand-written sources that relied on the old literal reading could change silently in newly started stories; stories already started keep their pinned compiled source.

Verification at this head on Linux, Node 24.22.0: bun run check passed lint, typecheck, 482 tests with 2 skipped, and smoke. Both earlier reproductions now pass. I did not run the desktop, browser or Windows suites.

@MichaelSchmidle
MichaelSchmidle marked this pull request as ready for review November 8, 2026 17:02
@MichaelSchmidle
MichaelSchmidle merged commit dd91b53 into main Nov 8, 2026
1 check passed
@MichaelSchmidle
MichaelSchmidle deleted the codex/dsh-workspace-collections branch November 8, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants