feat(workspace): turn off `datamate_manager` in projects linked to a workspace

Merged
RA
2mo ago
+1371-98

Issue for this PR

Closes #1430

Type of change

  • New feature

What does this PR do?

In a linked project, integrations come only from the workspace's engine, yet datamate_manager was still offered; with the engine not attached, models used it to save a hosted datamate-<name> entry.

  • Hidden from ToolRegistry.tools() and tool_lookup in a linked project, engine installed or not.
  • Refused when run directly, before any lookup or write (replaces three guards on the datamate key).
  • Prompt notice in every linked session: "datamate" is the older name for a workspace and connecting one is about this link, which nothing here does; then the engine's state, with the install command when missing or too old.
  • Warning, once, for datamate-<name> entries a linked project still loads, naming each file; config never edited. Sent after the catalog: the routing toast replaced it in the TUI's one slot.
  • altimate-setup skill, the one built-in instruction naming the tool: validates with it only when available, else points to /workspace โ†’ Refresh.

Claims

  • C1 Linked with workspace routing on (workspaces enabled, not serve, datamate key not set by managed config), the model's catalog and tool_lookup never contain datamate_manager, for every engine state, and while an unreadable link leaves an engine running.
  • C2 Unlinked, ALTIMATE_DISABLE_WORKSPACE, or altimate serve: catalog and tool behave as on main.
  • C3 Run directly under C1's conditions, every operation returns the refusal with no API call and no config or MCP write; writes recheck under the directory lock; a raced create is deleted again.
  • C4 The notice renders for every settled outcome of a linked session, on every step of the turn, naming the outcome's workspace, never for an unlinked one; a workspace name cannot add lines.
  • C5 The warning fires once per process per directory, workspace and entry set; never edits config; never throws into the turn; published after the catalog.
  • C6 Engine attach and precedence unchanged.

Review rounds: log.

Residuals

  • R1 Link unreadable, no engine running: the tool stays available (link unknown).
  • R2 On the turn it fires, the warning replaces that turn's routing toast.
  • R3 The notice steers, it can't force: models may still run read-only checks (which datamate).
  • R4 Saved datamate-<name> entries still load; they are reported, not disabled.
  • R5 altimate serve is out of scope; the extension case is decided separately.
  • R6 Managed config setting the datamate key turns workspace routing off, as on main, so the tool stays.
  • R7 Two concurrent writes to one datamate-<name> racing a link can restore its older entry (an R4 state).

How did you verify your code works?

  • New tests: refusal per operation and engine state; catalog/lookup matrix; notice per outcome; warning (once, files, config untouched, order, headless). Reverting each fix fails a test.
  • Typecheck, markers clean; CI's full suite green.
  • Live, real linked workspace:
RowResult
Linked, engine missing93 tools, no datamate_manager, notice present
Linked, engine 0.7.321 engine tools, no datamate_manager
Unlinked94 tools, datamate_manager present
"Connect datamate 5, fetch Jira X", no engineexplains, gives install command; no writes
Same, engine installed2 of 3 used the engine; 1 ran a read-only check
Saved datamate-ops entryone warning naming its file; entry unchanged

Screenshots / recordings

TUI warning (name redacted):
older datamate entries warning

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

๐Ÿค– Generated with Claude Code

https://claude.ai/code/session_01HRUhVhg6XwxSKJs1iTufiA

Summary by CodeRabbit

  • New Features

    • Projects linked to an Altimate workspace receive guidance about workspace status and engine availability.
    • Datamate management tools are hidden for linked projects, and attempts to use them are declined without changing project configuration.
    • Existing Datamate entries in linked projects are reported with their configuration file locations when available.
  • Bug Fixes

    • If a workspace link appears during Datamate creation or addition, changes are rolled back where possible; users are informed if cleanup fails.
    • When the Datamate tool is unavailable, credential validation directs users to refresh their workspace.
    • Unlinked projects and projects without workspace support retain normal Datamate tool access.