feat(sdk): scope-compiler + mount-registry for workspace: auth (partial #308) - #329
Conversation
…al) (#308) Initial slice: mount-registry + scope-compiler + tests. Compiles workspace: declarations into path-scoped descriptors. Preflight mount reachability and worker-session scope threading remain as follow-ups; opening PR to land the compiler foundation.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
maintainability lens — FAILMaintainability review — PR #329I've read AGENTS.md, the RFC gate-8 references, and confirmed both new modules have zero in-tree consumers. Blocker
Concerns
Notes
REVIEW_FAILED |
history lens — PASSBlockers: none. PR #329 passes the HISTORY lens as an explicitly scoped compiler foundation.
Concerns: scope-compiler.ts, lines 82–95 permits compilation without mount facts. The documented follow-up must supply trusted capabilities and enforce refusals before worker execution. That remaining integration work is not a regression in this diff. Notes: AGENTS.md, RFC-0001, NEXT, DIRECTIVES, and relevant DRIVE-LOG history informed this review. The RFC-linked legacy charter was unavailable locally. No test or CI pass is asserted. REVIEW_PASSED |
structure lens — MISSING |
|
🎯 review-swarm: FAILED (M:fail H:pass S:missing) Lens transcripts posted as sibling comments above. |
) Consumes the scope-compiler and mount-registry from #329. Flow-header declarations compile against the nearest relayfile.mounts.json; preflight refuses with scope_syntax_invalid / mount_unknown / scope_ungrantable before any token is minted. Walker parity extended for the three new kinds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82 Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82
) (#359) * feat(sdk): wire workspace:/tools.fs: scope-compiler into preflight (#308) Consumes the scope-compiler and mount-registry from #329. Flow-header declarations compile against the nearest relayfile.mounts.json; preflight refuses with scope_syntax_invalid / mount_unknown / scope_ungrantable before any token is minted. Walker parity extended for the three new kinds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82 Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82 * test(sdk): extend verb-field-lint FLOW_FIELDS pin for workspace, tools The scope-compiler wiring in this PR adds workspace and tools to FLOW_FIELDS; update the pinned expectation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82 Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82 --------- Co-authored-by: kjgbot <kjgbot@agentrelay.dev>
Partial towards #308. Ships the compiler foundation:
packages/sdk/src/scope-compiler.ts— compilesworkspace:/tools:declarations into path-scoped descriptorspackages/sdk/src/mount-registry.ts— mount name → path mappackages/sdk/tests/scope-compiler.test.ts— unit testsFollow-up (separate PR)
mount_unknown/scope_syntax_invalid/scope_ungrantableend-to-endWritten by codex agent
spec-H-authon finn-mini; final commit at head of feat/spec-H-auth-scope. Committed + pushed from lead machine.Test plan
🤖 Generated with Claude Code
Note
Medium Risk
Introduces permission parsing and mount validation logic that will gate filesystem access; behavior is tested but not yet integrated into runtime enforcement paths.
Overview
Adds the first slice of workspace/filesystem scope auth for relay flows: a pure compiler plus a local mount manifest reader, with Vitest coverage. This is foundation only (partial #308); preflight probes and worker threading are explicitly deferred.
compileScopesturnsworkspace/tools.fs(and per-step overrides) into structuredmount/path: readonly|readwrite|appenddescriptors. It rejects malformed or traversing paths, optionally checks grants against aMountRegistry, and returns structured refusals (scope_syntax_invalid,mount_unknown,scope_ungrantable) while still listing parsed declarations. Inputs aresnapshotJsonValue-snapshotted so getters cannot run during compilation.readMountRegistrywalks upward from a start directory to load the nearestrelayfile.mounts.json(version 1); missing file yields{}, invalid JSON/schema throws (fail closed). Child manifests replace outer ones—they are not merged.Reviewed by Cursor Bugbot for commit 300fadc. Bugbot is set up for automated code reviews on this repo. Configure here.