refactor(permission-system): simplify policy and autoreview flow

This commit is contained in:
云服务部-叶林立
2026-09-03 02:01:06 +08:00
parent 180da95ab7
commit 6e7effa792
112 changed files with 911 additions and 10346 deletions
+8 -8
View File
@@ -75,8 +75,8 @@ export interface PermissionQuery {
/**
* Query the permission policy for a surface and value.
*
* @param surface - Permission surface: "bash", "read", "mcp", "skill",
* "external_directory", etc.
* @param surface - Permission surface such as "bash", "read", "mcp",
* "skill", or "path".
* @param value - The value to evaluate: command string, tool name, skill
* name, or path. Omit or pass `undefined` for a
* surface-level query.
@@ -134,7 +134,7 @@ export interface PermissionsService extends PermissionQuery {
* Register a custom access-intent extractor for a specific tool name.
*
* The extractor declares the filesystem path a tool will access so the
* cross-cutting `path` and `external_directory` gates can see it. Use it for
* cross-cutting `path` gate can see it. Use it for
* tools whose path lives under a non-standard key — built-in file tools and
* any tool exposing `input.path` (plus MCP via `input.arguments.path`) are
* already covered by convention without registration.
@@ -163,11 +163,11 @@ export interface PermissionsService extends PermissionQuery {
* handler so registration is robust to load order and survives `/reload`.
*
* Registration alone grants **no authority**: the link decides nothing until
* the operator names it in the `authorizerChain` config (opt-in activation),
* and the chain owner caps every verdict with the bounded-delegation
* checkpoint (an `allow` on an excluded surface downgrades to `defer`). Only
* one link may be registered per name — a second call for the same name
* throws. The returned disposer unregisters the link.
* the operator names it in `authorizerChain` (opt-in activation). Once named,
* its `allow` or `deny` verdict is final for any ordinary-policy `ask`, including
* `path`; `defer` advances to the next link or terminal. Only one link may be
* registered per name — a second call throws. The returned disposer unregisters
* the link.
*
* @param name - Operator-facing link name referenced from `authorizerChain`.
* @param authorize - The link's decision callback