Repository navigation
Activate Doxvelt collections inside DSH workspaces - #48
Conversation
j2msReginaldBot
left a comment
There was a problem hiding this comment.
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, thenbun 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; |
There was a problem hiding this comment.
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-fixturerequest returns the generic 500workspace-operation-failed. Saved, activation, collection and play requests all fail, in every workspace listed after the stale one. - The
system-prompt/assemblehook 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`; |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
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
.doxveltdirectory. 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:
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.