refactor(harness): extract retained workspace scope owners (SAP-3091) - #909
Conversation
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (31)
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 |
gwitwer
left a comment
There was a problem hiding this comment.
Approving. Compared the moved bodies against the originals: identical logic, identifier renames only. WorkspaceScopeSummary export repointed with an unchanged shape; the @shared alias is updated consistently across tsconfig, vite and vitest; the removed test cases are exactly the ones re-homed into the three new files.
Primary change type
Problem and motivation
Workspace identity, allowed-root resolution and per-agent invocation types were still owned by mixed legacy graph modules. Deleting those modules directly would remove contracts used by current Studio discovery and Canvas.
Summary and scope
Extract workspace scope types and local identity helpers into shared/workspace-scope.ts, the catalog into core/workspace-scope-catalog.ts, and containment helpers into core/workspace-path.ts. Move AgentInvocationMode to Canvas ownership. Repoint live imports, browser aliases and the existing public type export; temporary legacy re-exports keep this boundary buildable.
Related work
Related issue or discussion: SAP-3091. Part of the authorized cleanup stack above #892 and #893, targeting
main. Human review follows the complete stack. Implementation and PR creation do not authorize merging or releasing it.Validation
Verification on the cumulative implementation at
cab477b5(each earlier boundary also passed its affected build/typecheck and focused checks):The root test failure reproduces on unchanged prior code; it is not treated as a green root run. The final retirement record includes artifact hashes, request-observation scope and all local limitations.
Browser checks used installed Google Chrome, isolated TMPDIR and E2E_PORT=5497; the override changes only the executable, temporary output/report paths and Vite invocation. The package's 195 Harness runtime/assets match the clean build byte-for-byte. Its saved-map check records legacy read/refresh/navigation requests 0/0/0, direct removed routes 404/404/404, and unchanged map/history.
The first AppImage run failed session-create with a preexisting PROJECT_SESSION_SCOPE_UNAVAILABLE retention race; the identical artifact passed an isolated rerun. The initial failure and unchanged source ancestry are preserved in the record, with a separate follow-up test/fix outline. This cleanup does not fix that race. Signed macOS installer/upgrade evidence remains the SAP-3086 release gate.
Tests and documentation
Moved retained catalog, local-key and source-containment cases to their new owners and added path-boundary coverage. All 154 focused cases across 11 files passed at this boundary, including project preferences/catalog, per-agent Canvas, discovery freshness, rescan and wiring. Public @sapiom/agent PackageInventory source and export are unchanged.
Compatibility and release impact
Security
AI assistance
Codex implemented the cleanup and test/doc migrations, traced retained callers, and checked the resulting diffs. Automated checks above and independent read-only review provide implementation evidence; maintainer review is still required.
Checklist
CONTRIBUTING.md, and this contribution follows the direct-PR or issue-first policy.