ワンクリックで
state-auditor
Protocol for multi-layered state sovereignty auditing, conflict detection, and "Split-Brain" resolution.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Protocol for multi-layered state sovereignty auditing, conflict detection, and "Split-Brain" resolution.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | state_auditor |
| description | Protocol for multi-layered state sovereignty auditing, conflict detection, and "Split-Brain" resolution. |
This skill provides a rigorous framework for identifying, analyzing, and resolving state synchronization conflicts in distributed systems (e.g., VS Code Extension <-> Webview).
The system is divided into three functional layers to ensure absolute state sovereignty and prevent race conditions.
graph TD
subgraph "External Host (Extension)"
Host["Extension Host (Truth)"]
end
subgraph "Webview Sovereign Layer (Head)"
HC["PlaybackController<br/>(Intent ID Latching)"]
SC["SessionController<br/>(IPC Bridge)"]
Store["WebviewStore<br/>(Passive Bucket)"]
end
subgraph "Execution Layer (Workers)"
EG["WebviewAudioEngine<br/>(Unified Synthesis)"]
end
%% IPC sync
Host -- "UI_SYNC (Incoming)" --> SC
SC -- "Passive State" --> Store
%% Intent Flow
UI["React Components"] -- "User Intent" --> HC
HC -- "Command (intentId)" --> EG
%% Event Bubbling
EG -- "Report (intentId)" --> HC
HC -- "Authoritative Patch" --> Store
Every user action follows a guarded lifecycle to prevent "Split-Brain" state reverts.
sequenceDiagram
participant UI as React UI
participant HC as PlaybackController
participant ST as WebviewStore
participant EG as AudioEngine
participant EX as Extension Host
UI->>HC: User clicks "Play"
HC->>HC: Increment activeIntentId (e.g., 42)
HC->>ST: Optimistic UI Lock (isLocked=true)
HC->>EX: postAction(PLAY, intentId=42)
Note over EX,HC: Background Sync Race
EX-->>HC: UI_SYNC (Old State: PAUSED, intentId=41)
HC->>HC: Check activeIntentId
HC-->>ST: DROP (Stale Sync 41 < 42)
EX-->>HC: SYNTHESIS_READY (intentId=42)
HC->>EG: fetchAndPlay(intentId=42)
EG->>HC: onEvent(PLAYING, intentId=42)
HC->>ST: Authoritative Patch (isPlaying=true)
HC->>ST: Release UI Lock (isLocked=false)
if statements or calculations inside data containers (Stores).Create a table for every major state variable. Identify its "Sovereign Owner".
| Variable | Current Owner | Logic Location | Redundancy | Risk |
|---|---|---|---|---|
isPlaying | Engine + Store | Engine play() | Yes (Both) | Sync Race (Extension vs Engine) |
activeUri | Store + UI | UI useEffect | Yes | State Flip-flopping |
For each variable, apply the Tri-Layer Sovereign Test:
Components should be as standalone as possible to prevent "Handshake Deadlocks".
Ensure that every user action is tagged with a unique intentId.
this.activeIntentId++execute(command, intentId)incoming.intentId >= current.intentId.If a "Sync" packet arrives from the secondary source (e.g. the Extension):
intentId or timestamp.When performing an audit, generate an internal report artifact with these sections:
# Dev Cycle Protocol: CDP Shell Sovereignty (v2.5.1)
Protocol for high-density, symmetrical shorthand logging in VS Code extensions.
Protocol for local session metadata persistence in the Virgo extension.
Architectural map and development guidelines for the Virgo extension. Mandatory reference for all agent modifications.
Protocol for high-integrity conversational AI injections and sensory parity in the Virgo extension.
Governance protocol and automated scripts for packaging and publishing the Virgo MCP standalone server to the public NPM registry. Enforces safety gates and clean extraction logic.