Skip to content

Make workspace tool outcomes authoritative - #2033

Merged
Aaronontheweb merged 2 commits into
goal/pit-of-success-subagent-disclosurefrom
goal/pit-of-success-workspace-paths
Aug 20, 2026
Merged

Make workspace tool outcomes authoritative#2033
Aaronontheweb merged 2 commits into
goal/pit-of-success-subagent-disclosurefrom
goal/pit-of-success-workspace-paths

Conversation

@Aaronontheweb

@Aaronontheweb Aaronontheweb commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • resolve relative first-party workspace paths from the valid project directory, then session scratch, without using process cwd
  • add call-local typed outcome receipts so only successful canonical file activity updates working context
  • preserve existing scoped and protected-path checks, including traversal, control-character, and symlink boundaries
  • prevent failed file operations and failed project declarations from changing recent files or project scope

This is PR 4 of the make-agent-tools-pit-of-success stack.

Deterministic evaluation evidence

  • Relative workspace paths resolve from a valid project directory, then immutable session scratch; process cwd is never used.
  • A stale project falls back to session scratch once, while an authorized project-based denial does not retry against a broader base.
  • Successful canonical receipts update working context consistently in buffered and streaming flows.
  • Failed read, write, edit, attach, and project-declaration calls do not mutate recent files, project scope, or child instructions.
  • Absolute-path authorization, protected-path denial, traversal, control-character, and symlink boundaries remain enforced.
  • No hosted behavioral run was used as evidence for this PR.

Validation

  • Netclaw.Actors.Tests: 3,493 passed, 2 expected platform skips
  • strict OpenSpec validation
  • header verification
  • Slopwatch: 0 issues
  • git diff check

Assert.True(ok);
Assert.Equal("src/Rect.cs", path);
}
var first = Path.GetFullPath(Path.Combine(Path.GetTempPath(), "receipt-first.txt"));
Assert.Equal("src/Rect.cs", path);
}
var first = Path.GetFullPath(Path.Combine(Path.GetTempPath(), "receipt-first.txt"));
var second = Path.GetFullPath(Path.Combine(Path.GetTempPath(), "receipt-second.txt"));

Assert.True(outputs.TryComplete(new ToolInvocationReceipt(ToolInvocationOutcomeCategory.AccessDenied)));
Assert.False(outputs.TryComplete(Success(
Path.GetFullPath(Path.Combine(Path.GetTempPath(), "late.txt")),
Content = "..."
}
};
var path = Path.GetFullPath(Path.Combine(Path.GetTempPath(), "invalid.txt"));
[Fact]
public async Task Denied_write_reports_no_file_activity()
{
var filePath = Path.Combine(_dir.Path, "denied.txt");
@Aaronontheweb
Aaronontheweb force-pushed the goal/pit-of-success-workspace-paths branch from ff22127 to 30ff8cb Compare August 20, 2026 04:50
@Aaronontheweb
Aaronontheweb force-pushed the goal/pit-of-success-workspace-paths branch from 30ff8cb to 8477814 Compare August 20, 2026 05:33
Comment on lines +384 to +387
var missingPath = Path.Combine(
Path.GetTempPath(),
"netclaw-missing-" + Guid.NewGuid().ToString("N"),
"file.txt");
var publicContext = CreateContext(TrustAudience.Public);

var allowed = policy.TryResolveWritePath("/some/path", publicContext, out _, out var error);
var path = Path.Combine(Path.GetTempPath(), "netclaw-public-denied.txt");
@Aaronontheweb
Aaronontheweb merged commit 522ff36 into dev Aug 20, 2026
23 checks passed
@Aaronontheweb
Aaronontheweb deleted the goal/pit-of-success-workspace-paths branch August 20, 2026 08:29
@Aaronontheweb Aaronontheweb added enhancement New feature or request tools Issues related to agent tools: file_read, web_search, shell_execute, image processing, etc. sessions LLM session actor, turn lifecycle, pipelines security Security-related changes reliability Retries, resilience, graceful degradation labels Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request reliability Retries, resilience, graceful degradation security Security-related changes sessions LLM session actor, turn lifecycle, pipelines tools Issues related to agent tools: file_read, web_search, shell_execute, image processing, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant