Skip to content

feat(web): project Pi trust state in snapshots - #360

Open
seekskyworld wants to merge 1 commit into
openpi-dev:mainfrom
seekskyworld:feat/issue-343-trust-snapshot
Open

feat(web): project Pi trust state in snapshots#360
seekskyworld wants to merge 1 commit into
openpi-dev:mainfrom
seekskyworld:feat/issue-343-trust-snapshot

Conversation

@seekskyworld

Copy link
Copy Markdown

Problem

Implements the snapshot portion of #343. Web clients could not distinguish the active workspace trust state before invoking operations.

Value

The browser can show whether the current workspace is trusted without owning or persisting a second permission policy.

Approach

Read Pi SettingsManager trust state through the Web runtime, map it to bounded trusted/untrusted/unknown values, and include it in the existing runtime snapshot projection. Unbound or unreadable state fails closed to unknown.

Validation

  • npx tsc --noEmit
  • node --test --experimental-strip-types tests/web/protocol.test.ts tests/web/pi-adapter.test.ts tests/web/pi-runtime.test.ts (44 passed)
  • git diff --check

Impact

  • User-visible behavior: snapshot consumers receive trust status for display.
  • Model-visible context/tools: none.
  • Runtime/lifecycle: reads Pi-owned trust state only.
  • Persisted config/data: none.
  • Compatibility/risk: optional controller field preserves existing test doubles; approval actions remain a separate follow-up.

Signed-off-by: seekskyworld <djh1813553759@gmail.com>

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请让给 #392

runtime.trust 来自 Pi isProjectTrusted(),缺了 fail-closed 成 unknown,方向对。但把 restricted/undecided 压成 untrusted,字段也不如 #392 完整,而且没有测试。

请关掉,改合 #392。Node 24 的 tests/web/cli.test.ts 红也请先分清是不是共享抖动。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants