Repository navigation
feat(workspace): write scope per member and record kind, and agent sessions bound to one member - #3078
Merged
Conversation
…ssions bound to one member (#2548)
This was referenced Oct 1, 2026
4 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2548
Write scope per member and record kind for each principal class, and agent sessions bound to one member that reload from the repository alone (#2524 D5, D20).
What ships
writeScope(an entry per restricted class:human,agent,runner,service, withmembersand per-kindrecordsverbsnew,amend,review,close) andagents(sessions, each bound to one declared member, optionally listing principals). Validated in code: members exist, names unique, a principal listed by one session at most.packages/core/src/workspace/write-scope.ts: a writer's class comes from role grants in the trust policy at base, read through one function (roleGrants/principalClass); an agent is always bound to its session's member; the workspace's own kinds are in every writer's reach.chant workspace records new|amend|review|closeand the MCP record tools refuse a write outside scope withwrite-scope-memberorwrite-scope-kind, and an undeclared session withagent-unknown. The session comes fromCHANT_AGENT;bynaming a listed principal binds too. The scope is read from the declaration at base, so a working-tree edit can't widen it.chant workspace check --changes <range>gains ascopeblock. Each commit is judged by itsChant-Agenttrailer, its attested principal, or its author, against the declaration, kinds and trust policy at the range's base. A scope finding fails the check whatever the severity. An agent editingchant.workspace.json(in no member) is itself out of scope.chant workspace agent [<name>] [--json](agent.schema.json) prints the session, its member, its scope with verbs per kind, and thespecblock ofrecords --current --json. Served over MCP asworkspace-agent.reason-codes.ts, the write schemas (records-new|amend|review|close,work-evidence),changes.schema.jsonandagent.schema.json, and the boundary roster.writeScope.agentlets agents propose and review decisions only, and an agent sessiondecisionsis bound to the docs member.appanddesign, and an agent records rule over its decision, work, lesson and session kinds; README row added.scope, Agent sessions), MCP page and agent-integration guide, newcli/workspace-agentpage.Acceptance criteria
checkat the enforcement boundary.check --changes).Gates (local)
vitest over every touched module and its importers (70 files),
test/level0-goldens,scripts/typecheck.ts(no regressions),scripts/check-lexicons.ts(no untracked tier-1 failures),lint-docs-sentences(no regressions; the new page's two frontmatter hits are baselined like every page's) andcheck-docs-diataxis.