fix(analyst): let analyst read workspace memory and steer it to workspace skills
HK
21m ago+218+218+012345678901234567890123456789-20-20-01234567890123456789
Issue for this PR
Closes #1569
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
In a linked project, analyst could not answer read-only questions like "what are our conventions?": every memory tool was denied, the identity section named a save tool it lacked, and every reply had to go through answer_commit.
- Analyst may now read, reload and audit workspace memory. Write, delete and extract stay denied; data-explorer is unchanged. A reload syncs like every session's first load (it can drop a local copy of a block the workspace archived) but cannot create or edit memory.
- The team-memory line names only the memory tools this agent and request keep. The line and tool removal share one rule, LLM.removedTools (agent permission plus tools switched off on the request). Full access keeps today's text; read-only points at the read tool; write-only drops the read-first hint; neither gets no line.
- The analyst prompt loads a matching skill by the listing's source precedence (workspace and project skills included), answers convention questions in plain text, and still finishes data questions through answer_commit.
- An empty memory read no longer suggests the write tool, for any agent.
- Docs: both analyst pages (agent modes and the agents reference) list the new memory, audit-log and skill access.
Small extras beyond the issue: the write-only case is reachable only through user config, and the docs lines.
Before and after
| Area | Before | After |
|---|---|---|
| Analyst memory tools | All denied (read, reload, audit, write, delete, extract) | Read, reload and audit allowed; write, delete and extract still denied |
| Team-memory line in the identity section | Named a save tool analyst could not use | Names only the memory tools the agent and request keep (none, read-only, write-only or full) |
| Empty memory read | Suggested the write tool to every agent | No write-tool suggestion |
| Skill choice in the analyst prompt | No steer toward workspace or project skills | Loads a matching skill by the listing's source precedence, workspace and project skills included |
| Convention questions ("what are our conventions?") | Forced through answer_commit, often with no useful answer | Answered in plain text |
| Data questions | Finish through answer_commit | Unchanged, still finish through answer_commit |
| data-explorer agent | Memory tools denied | Unchanged |
| Docs | Analyst pages did not mention memory or skills | Agent modes page and agents reference list the new access, including the local audit log and what a reload changes |
Follow-ups (existing behaviour, not changed here)
Both issues below came up in review. Each was reported in the issue tracker as a separate bug for follow-up, and neither is fixed in this PR.
| # | Issue | Affects | Suggested fix | Review thread |
|---|---|---|---|---|
| 1 | altimate_memory_audit reads only this checkout's local audit log. It does not show changes teammates made directly in workspace memory. | Every agent allowed the tool (builder before this PR, analyst too now) | Add a workspace-wide audit source, or rename the tool and describe it as a local log | r4325949555 |
| 2 | With tool retrieval on (ALTIMATE_TOOL_RETRIEVAL=1, off by default), retrieval can drop a memory tool after the team-memory line has named it. Before this PR the line named both tools for every agent. | Every agent with memory tools, only when retrieval is on | Build the line from the tool set left after retrieval, or always keep the named memory tools in retrieval | r4325949572 |
How did you verify your code works?
- Tests: analyst permission matrix, all four read/write cases of the identity line, a cached outcome rendered per agent, the shared removal rule, and a prompt-loop test tying the identity section to the tools sent to the model.
- Reverting each fix makes its new test fail.
- Typecheck clean; affected suites pass.
- Not done: a live analyst run against a linked workspace (provider returned 402), so the prompt's effect on model choices is checked only at the unit level.
Cost side effects
None. About 110 more tokens in the analyst system prompt and three more tool definitions. No new model calls, queries or resources that grow with user data.
Screenshots / recordings
N/A, no UI change.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
- I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"
🤖 Generated with Claude Code
Summary by CodeRabbit
- New Features
- Analyst agents can read, refresh, and audit workspace memory while delegating memory-saving requests to Builder.
- Analyst responses can use relevant workspace and project skills to answer questions about team conventions.
- Workspace guidance now reflects each agent’s available memory capabilities.
- Memory lookup results provide clearer messaging when no memory is available.
- Documentation
- Updated Analyst capability and configuration documentation.
- Tests
- Added coverage for memory permissions, skill visibility, prompt behavior, and tool filtering.