Skip to content

WO-09: importer desk match + dedupe + --set-desk, liveness-only /health guard, direct-mode Dot edit - #6

Merged
RoseBludd merged 1 commit into
devvy/host-base-timeoutsfrom
devvy/wo-09-import-health-dotedit
Oct 16, 2026
Merged

RoseBludd merged 1 commit into
devvy/host-base-timeoutsfrom
devvy/wo-09-import-health-dotedit

Conversation

@RoseBludd

Copy link
Copy Markdown
Owner

WO-09: three fixes from the d243800 proof run. Base: devvy/host-base-timeouts @ d243800.

1. Memory importer (src/server/memory-scope/import.ts, import-cli.ts)

Reuses the WO-02 importer (#3, via #5) and WorkspaceStore.setDotModel / desk validation from WO-03 (src/server/dot-model.ts, src/shared/dot-model.ts).

  • Desk matching: the Dot's desk field first. If no Dot has that desk, the name is tried next: <name>., <name>, <name>. (desk) (case-insensitive, trailing dot and (desk) optional). The dry run matched 0/16 because host Dots are named oppi. (desk) and none has a desk set.
  • --set-desk (opt-in): on --apply, a matched Dot's desk is set to the seat name, but only if its desk field is empty. The dry run reports setDesk per desk. --help warns that a desk forces desk-key-only calls (CADIS_API_KEY_<DESK>, no fallback).
  • Dedupe: before adding, each memory is compared with the memories already in the same scope (global or that Dot), and with the ones added earlier in the same run. Text is normalized first (trimmed, list marker stripped, whitespace collapsed, lowercased), and exact matches are skipped. Nothing is deleted or rescoped.
  • Report: globals {new, skippedDuplicate}, and for each desk {desk, dotId, dotName, matchedBy, new, skippedDuplicate, truncated, setDesk}, plus unmatchedDesks and otherGlobals.

2. Supervisor /health: decision is to keep it public

Upstream OpenBot @ b6932d3 supervisor/src/index.ts L79/L86 returns only { status: "ok", docker: <boolean> }. That is liveness only, with no version, config, counts or secrets. The compose healthcheck calls it without the token and needs docker, and the port is published on 127.0.0.1 only. So the endpoint stays public.
To keep it that way, deployment/computers/check-supervisor-health.mjs pins the exact handler and the single auth bypass. The image build fails closed (Pinned OpenBot /health contract changed) if upstream adds fields or routes, or widens the bypass. It runs in supervisor.Dockerfile after the existing patches. It reuses the fail-closed pattern from harden-supervisor.mjs / add-extra-binds.mjs, and I checked it against both the raw and the patched upstream index.ts.

3. Dot editor in direct-model mode

Reuses the existing WorkspaceDialog Dot form and Model fieldset (WO-03), and dotSchema from workspace-routes.ts (now exported; name and instructions only, same limits).

  • New direct route PATCH /api/dots/:id, strict {name, instructions}. It keeps permissions, spaces, learning, avatar and project. PUT/DELETE /dots/:id and POST /dots still return 501.
  • In direct mode the dialog shows only Name, Instructions and Model/desk. It saves with PATCH /dots/:id and then PUT /dots/:id/model (saveDirectDot in direct-chat.ts). Character, project folder, space access, permissions, learning and delete stay hidden.
  • App.tsx: the per-Dot edit button and "Edit specialist" are back in direct mode. "Create Dot" stays hidden.

Tests

  • memory-scope.test.ts: name-pattern matching and normalization; dedupe against existing globals; --set-desk dry run/apply, empty fields only.
  • computer-patches.test.js: /health guard accepts upstream and rejects 4 drift cases.
  • dot-model.test.ts: PATCH route validation, field preservation, 404, and 501s still in place.
  • direct-chat.test.tsx: direct-mode dialog render, and a save round-trip through the real routes.

Linux: 243/243 (baseline 237 + 6 new), typecheck and build OK. Lint: same 10 errors as on the base branch, none in changed files. Windows: 239/243; the 4 failures are the known Windows-path ones in host-git and dot-projects.

Importer commands (in the app container)

# dry run
DATABASE_PATH=<opendots.sqlite> node dist/server/server/memory-scope/import-cli.js \
  --seats /mnt/genius_vol_2/opendots/seats --rules /root/oppi-twins/standing-rules.md --set-desk
# apply
DATABASE_PATH=<opendots.sqlite> node dist/server/server/memory-scope/import-cli.js \
  --seats /mnt/genius_vol_2/opendots/seats --rules /root/oppi-twins/standing-rules.md --set-desk --apply

Leave out --set-desk to import memories without setting desks.

No merges and no deploys.

…y supervisor /health, Dot edit in direct-model mode

Importer: match seats to Dots by desk field, then 'name.' / 'name. (desk)'; skip memories already present (normalized content); opt-in --set-desk sets empty desk fields on --apply; report new/skippedDuplicate per desk. Supervisor /health stays public (liveness only) with a build-time guard. Direct mode: PATCH /dots/:id (name, instructions) plus PUT /dots/:id/model from the existing Dot dialog.
@RoseBludd
RoseBludd merged commit fb5f5c8 into devvy/host-base-timeouts Oct 16, 2026
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.

1 participant