Skip to content

feat(supervision): attached-session read-only supervision (#410) - #414

Merged
rebuildup merged 1 commit into
409from
410
Nov 23, 2026
Merged

rebuildup merged 1 commit into
409from
410

Conversation

@rebuildup

Copy link
Copy Markdown
Contributor

概要

Epic #407 の consumer 統合 Issue #410。explicit-attached session(Issue #366 contract)が ae-a8n supervision report を read-only で取得できるようにする。stacked on #413(branch 409)。

設計

  • 所有権の昇格なし: report の読み取りは file read + target identity の再検証のみ。lease 取得・monitor 起動・dispatch・mutation は一切行わない。
  • fail closed: attached session の durable state は、session の targetGuard(runOperation が mutating dispatch 前に使うのと同一の revalidateTarget:census / pid・start stamp / version / project、ambiguous・PID reuse・session change・second instance で refuse)を通過している間だけ serve される。guard 失敗・欠落時は durable phase を 漏らさず unavailable(source target-guard、guard の code/detail 付き)を返す — 別の AE instance を記述した stale report を current として見せない。
  • mutation なし: read-only attached session の mutating op は従来どおり sessionPolicy が consent/dispatch 前に refuse(press/recover/rebuild 相当の mutation 権限は supervision が与えない)。refusal の diagnostics には guarded supervision snapshot が乗り、needs-human 状態が構造化情報として surface される。
  • owned-disposable との区別: owned a8n session は自身の lifecycle が staleness を bound するため guard 不要で unguarded read。--session-root/--workdir の dir 直接 read は session object が存在しないため unguarded file read(仕様として明記)。

変更点

  • dev-loop/supervision.mjs: isAttachedSession / attachedTargetGuardVerdict / guardedSupervisionSnapshot 追加
  • MCP: ae_supervision・ae_session・failure diagnostics が session-bound read で guarded path を使用(bounded wait の前後で guard を再検証)
  • devtools-cli: evidence.supervision を guarded snapshot に。UNKNOWN outcome の bounded wait 後に guard を再検証し、失敗時は snapshot を破棄

検証

  • fake/mock レベル: dev-loop supervision 12 件(attached guard 5 件追加)、mcp-server 37 件(attached supervision 4 件追加)、全 green
  • syntax check 144 files pass
  • real host 未検証: 実 AE attach + 実 monitor との end-to-end は未確認。guard の実 census/pid/project 検証は既存 attached-session.test.mjs(26 件 green)で担保

Refs #407, #408, #409, #410

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6340129-6ff4-49b4-8c61-34d5330ccbb5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

#410)

Attached sessions can now read the ae-a8n supervision report through
the same surfaces as owned sessions — without ownership promotion,
mutation permission, or any new dispatch path.

- dev-loop/supervision.mjs: isAttachedSession() detects the Issue
  #366 attached/read-only contract; attachedTargetGuardVerdict()
  re-validates target identity through the SAME targetGuard
  runOperation uses before mutating dispatches (census, pid/start
  stamp, version, project — fail closed on ambiguity, PID reuse,
  session change, second instance); guardedSupervisionSnapshot()
  serves the durable report only while the guard passes, else an
  honest unavailable (source 'target-guard') that never leaks the
  possibly-stale phase.
- MCP: ae_supervision and ae_session use the guarded path for
  session-bound reads (guard checked before AND after any bounded
  wait); failure diagnostics carry the guarded snapshot, so a
  read-only refusal on an attached session still surfaces the
  structured needs-human state.
- devtools-cli: evidence.supervision uses the guarded snapshot;
  the UNKNOWN-outcome bounded wait re-validates the guard afterwards
  and discards the snapshot on failure.
- Explicit --session-root/--workdir dir reads stay unguarded file
  reads by design (no session object exists to prove identity
  against) and are documented as such.
- Mutating ops on read-only attached sessions remain refused by
  sessionPolicy before consent/dispatch — supervision adds the
  structured human-required context, never a permission.

Owned-disposable vs explicit-attached distinction preserved. Fake/
mock evidence only; real-host GUI path remains unverified.
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.

1 participant