Skip to content

feat(tools): resident-owned visibility, descriptions, and component defaults - #162

Draft
LariTesserae wants to merge 1 commit into
mainfrom
feat/resident-tool-presentation
Draft

LariTesserae wants to merge 1 commit into
mainfrom
feat/resident-tool-presentation

Conversation

@LariTesserae

@LariTesserae LariTesserae commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Residents receive every allowed tool definition even when many are irrelevant to their current work, and shared descriptions cannot be adapted without changing component code. Hiding a definition should preserve the ability to discover and restore it.

Changes

Add opt-in file-backed description/visibility overrides, two resident editing tools, and an agent-scoped generated catalogue. The catalogue groups exact tool names by registered component, includes hidden definitions and schemas, and supplies line offsets for detailed reads. Optional source-bound profiles supply reusable description defaults; resident wording wins, while visibility remains resident-owned.

Preview, inference and maintenance use the same advertised surface. Execution permissions remain independent. Editing uses a sibling lock, atomic replacement and a concurrent-change check; recovery tools stay visible. Native queued tool calls carry the authenticated caller identity through to generated-file reads. Preview metadata is captured with the corresponding request.

Tests

Framework build passes. Targeted presentation/defaults tests: 4 pass / 0 fail. Related workspace text/image/path containment and explicit prose routing tests: 42 pass / 0 fail. Tests cover reset, malformed files, source scoping, absent components, resident precedence, both tool dispatch paths, catalogue ownership and preview consistency.

A compatibility deployment was also checked through normalized previews; this is not evidence that the current upstream branch was deployed unchanged.

Not verified / limitations

Full framework suite and all provider transports were not run. Ordinary-use feedback across models is pending. Catalogue files are virtual and do not appear in ls/glob or ordinary host downloads. Changes affect newly compiled requests, not in-flight streams. Profiles are explicit deployment configuration, not automatic package discovery. File coordination cannot make uncooperative external editors transactional. Parameter-schema description overrides are out of scope.

Companion PRs / merge order

Merge and release this framework change first. The companion connectome-host PR adds recipe configuration and matching debug metadata, and must update its dependency floor and lockfile to that actual release before merge. The Discord wording PR is independent. No personal resident visibility list or conversation data is included.

Companion review links: framework #162, host #135, Discord #32.

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 2/5 Tier: apex

[Medium risk] Adds resident-editable tool visibility and descriptions.

The PR is not yet safe to merge because hiding used tools can disrupt compression, path aliases bypass catalogue protection, and component defaults can remove catalogue discovery.

Findings

  1. P1 Hidden tools disrupt compression ▶
  2. P1 Path aliases bypass catalogue protection ▶
  3. P1 Defaults remove catalogue signposts ▶
  4. P2 Edits can change file permissions ▶
Fix with agent prompt
### Issue 1
src/framework.ts:2047
When a resident hides a tool it used earlier, maintenance now passes only visible tools to the context manager, even though the transcript still contains calls to the hidden tool. The context manager requires those tool definitions for compression, so Anthropic can refuse the compression request. Keep historical tool definitions available to maintenance without advertising hidden tools to the resident.

### Issue 2
src/modules/workspace/index.ts:1092
The generated-file guard matches only the exact path string. If a writable mount has auto-materialization enabled, a write to `board/./tools.md` bypasses a catalogue registered at `board/tools.md` and writes to the same physical location. Reading through the alias can also return stored or physical content instead of the generated catalogue, so the virtual file is neither consistently read-only nor authoritative.

### Issue 3
src/tool-presentation.ts:103
If a `Framework` defaults profile supplies descriptions for both editing tools, those descriptions replace the installed wording, but this branch restores the catalogue path only for resident overrides. A resident with hidden tools then has no guaranteed signpost to discover their names and restore them. Preserve the catalogue instructions for component-default descriptions as well.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 4
src/tool-presentation.ts:136
Creating the temporary file with the original mode does not preserve permissions if the process umask masks some bits. For example, editing a group-writable `0664` file under umask `0022` replaces it with a `0644` file, preventing other group editors from updating shared overrides. Apply the original mode after creating the temporary file.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds opt-in, file-backed tool visibility and descriptions, component description defaults, resident editing tools, and an agent-scoped generated catalogue.

  • Aligns preview, inference, and maintenance with advertised definitions and captures preview presentation metadata.
  • Adds operator documentation and targeted presentation tests.

Reviews (1) · Last reviewed commit: "feat(tools): add resident-owned tool pre..."

Comment thread src/framework.ts
const queued = [...this.agents.values()].flatMap((agent) => {
const cm = agent.getContextManager();
const tools = this.getToolsForAgent(agent.name).filter((tool) => agent.canUseTool(tool.name));
const tools = this.advertisedToolsForAgent(agent.name);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Hidden tools disrupt compression When a resident hides a tool it used earlier, maintenance now passes only visible tools to the context manager, even though the transcript still contains calls to the hidden tool. The context manager requires those tool definitions for compression, so Anthropic can refuse the compression request. Keep historical tool definitions available to maintenance without advertising hidden tools to the resident.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/framework.ts
Line: 2047

Comment:
**Hidden tools disrupt compression** When a resident hides a tool it used earlier, maintenance now passes only visible tools to the context manager, even though the transcript still contains calls to the hidden tool. The context manager requires those tool definitions for compression, so Anthropic can refuse the compression request. Keep historical tool definitions available to maintenance without advertising hidden tools to the resident.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

async handleToolCall(call: ToolCall): Promise<ToolResult> {
try {
const input = call.input as Record<string, unknown>;
const generated = typeof input?.path === 'string' ? this.generatedTextFiles.get(input.path) : undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Path aliases bypass catalogue protection The generated-file guard matches only the exact path string. If a writable mount has auto-materialization enabled, a write to board/./tools.md bypasses a catalogue registered at board/tools.md and writes to the same physical location. Reading through the alias can also return stored or physical content instead of the generated catalogue, so the virtual file is neither consistently read-only nor authoritative.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/modules/workspace/index.ts
Line: 1092

Comment:
**Path aliases bypass catalogue protection** The generated-file guard matches only the exact path string. If a writable mount has auto-materialization enabled, a write to `board/./tools.md` bypasses a catalogue registered at `board/tools.md` and writes to the same physical location. Reading through the alias can also return stored or physical content instead of the generated catalogue, so the virtual file is neither consistently read-only nor authoritative.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread src/tool-presentation.ts
const componentDefault = defaults.get(tool.name);
let description = override?.description ?? componentDefault?.description ?? tool.description;
const descriptionSource = override?.description !== undefined ? this.config.path : componentDefault?.path ?? "installed component";
if (isPresentationTool(tool.name) && override?.description !== undefined)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Defaults remove catalogue signposts If a Framework defaults profile supplies descriptions for both editing tools, those descriptions replace the installed wording, but this branch restores the catalogue path only for resident overrides. A resident with hidden tools then has no guaranteed signpost to discover their names and restore them. Preserve the catalogue instructions for component-default descriptions as well.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/tool-presentation.ts
Line: 103

Comment:
**Defaults remove catalogue signposts** If a `Framework` defaults profile supplies descriptions for both editing tools, those descriptions replace the installed wording, but this branch restores the catalogue path only for resident overrides. A resident with hidden tools then has no guaranteed signpost to discover their names and restore them. Preserve the catalogue instructions for component-default descriptions as well.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread src/tool-presentation.ts
parsePresentation(next);
if (Buffer.byteLength(next)>MAX_BYTES) throw new Error('Presentation exceeds 256 KiB');
temp = this.config.path + '.' + randomUUID() + '.tmp';
writeFileSync(temp,next,{flag:'wx',mode});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Edits can change file permissions Creating the temporary file with the original mode does not preserve permissions if the process umask masks some bits. For example, editing a group-writable 0664 file under umask 0022 replaces it with a 0644 file, preventing other group editors from updating shared overrides. Apply the original mode after creating the temporary file.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/tool-presentation.ts
Line: 136

Comment:
**Edits can change file permissions** Creating the temporary file with the original mode does not preserve permissions if the process umask masks some bits. For example, editing a group-writable `0664` file under umask `0022` replaces it with a `0644` file, preventing other group editors from updating shared overrides. Apply the original mode after creating the temporary file.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

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