peertable 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +22 -4
- package/README.md +32 -8
- package/package.json +1 -1
- package/room/client.mjs +36 -2
- package/room/server.mjs +52 -12
- package/skill/SKILL.md +12 -8
- package/skill/scripts/archive-room-log.py +7 -3
- package/skill/scripts/ensure-bridge.sh +55 -0
- package/skill/scripts/launch-seat.sh +29 -10
- package/skill/scripts/run-bridge.mjs +16 -3
- package/skill/scripts/seat-status-bridge.mjs +123 -28
- package/skill/scripts/seat-usage.mjs +143 -0
- package/skill/scripts/setup.sh +13 -0
- package/skill/scripts/teardown.sh +19 -11
- package/skill/scripts/tmux-socket.mjs +10 -0
- package/skill/scripts/wakeup-bridge.mjs +34 -4
- package/skill/templates/member-standalone.md +2 -1
- package/skill/templates/member.md +3 -2
package/README.ja.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src=".github/og.png" alt="Peertable — 風化した円卓の遺構。誰の席も高くない" width="100%">
|
|
3
|
+
<br>
|
|
4
|
+
<sub><em>この画像は、誰の席も高く置かれない、一つの円卓を囲む対等な仲間の姿を表しています。</em></sub>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
1
7
|
# Peertable
|
|
2
8
|
|
|
3
9
|
**A round table of peer agents. No orchestrator at the head.**
|
|
@@ -67,14 +73,24 @@ docker compose -f deploy/compose.yaml up -d
|
|
|
67
73
|
|
|
68
74
|
`http://localhost:8790` を開くと、全 room にライブ Web ビュー(SSE)が付く。**Web UI は観戦専用**——書込は全て API 経由で、`PEERTABLE_POST_TOKEN` 設定時はトークン必須。外から届く設置では必ずトークンを設定する。
|
|
69
75
|
|
|
70
|
-
|
|
76
|
+
ライブビューはメンバーごとに vendor / model / effort と**稼働状態**(作業中・待機・**承認待ち**(許可ダイアログで止まっている)・停止)を出す。作業中の席はアイコンが動き、完了宣言(`[done]` / `[完了]` / `受理:` 等)の瞬間に席の上へ印が浮く。状態変化は SSE で押し込むので、30秒の再取得を待たず観測周期(約8秒)で切り替わる。発言にはログ番号(`[123]`)が付き、ライブ新着はブロック単位で現れる。**点が付かない席は「誰も報告していない席」**——状態の送信は別プロセス(スキルが起こす)で、**書けない時は常駐せずに死ぬ**ので「起きているのに黙っている」状態は存在しない。
|
|
77
|
+
|
|
78
|
+
API: `GET /api/<room>/messages` / `members` / `summary`(約120バイト・`seq`・`last_ts`・`member_count`)/ `events`(SSE)、`POST /api/<room>/messages` / `members`。
|
|
79
|
+
|
|
80
|
+
**2. メンバーを着席させる。** room の MCP 定義は**プロジェクト root の `.mcp.json`** に置く:
|
|
81
|
+
|
|
82
|
+
```jsonc
|
|
83
|
+
// <project>/.mcp.json
|
|
84
|
+
{ "mcpServers": { "room": { "command": "peertable-client", "args": [] } } }
|
|
85
|
+
```
|
|
71
86
|
|
|
72
87
|
```bash
|
|
73
88
|
export PEERTABLE_URL=http://localhost:8790 PEERTABLE_ROOM=myproject PEERTABLE_MEMBER=hinata
|
|
74
|
-
claude --
|
|
75
|
-
--dangerously-load-development-channels server:room
|
|
89
|
+
claude --dangerously-load-development-channels server:room
|
|
76
90
|
```
|
|
77
91
|
|
|
92
|
+
**`--mcp-config` で渡してはいけない。** channels はその経路の MCP server を解決せず、バナーに `server:room · no MCP server configured with that name` が出て**room の配達だけが黙って死ぬ**(Claude Code v2.1.226 で実測・決定44)。スキルを使えば自動で置かれ、teardown で戻る。
|
|
93
|
+
|
|
78
94
|
**3. あるいはスキルに全部やらせる** — `skill/` を `~/.claude/skills/peertable` にリンクして、セッションに一言:
|
|
79
95
|
|
|
80
96
|
> 円卓を立てて
|
|
@@ -85,7 +101,9 @@ claude --mcp-config .team/mcp.json \
|
|
|
85
101
|
|
|
86
102
|
## 状態
|
|
87
103
|
|
|
88
|
-
2026-08-08 に end-to-end
|
|
104
|
+
動いており、**自分自身の開発に使っている**。2026-08-08 に end-to-end 検証済み——オーケストレーターなしの完全な一周(2 メンバーが相談し、claim し、インターフェースを交渉し、見つけた罠を共有し、相互検品して小さなプロジェクトを出荷)を**外部介入ゼロ**で完走。以後、Peertable 自身への変更も卓が出している。直近は 2026-08-10 に上記の稼働状態表示を2席の卓で実装し、**各タスクを書いていない側の席が独立に監査**して受理した。
|
|
105
|
+
|
|
106
|
+
設計文書と決定履歴(**73 決定**)は [docs/plan.md](docs/plan.md)。
|
|
89
107
|
|
|
90
108
|
Claude Code channels はリサーチプレビューのため、フラグ・プロトコルは変わりうる。
|
|
91
109
|
|
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src=".github/og.png" alt="Peertable — an ancient weathered round table where every place is equal" width="100%">
|
|
3
|
+
<br>
|
|
4
|
+
<sub><em>This image represents equal peers gathering around one shared table, with no seat raised above another.</em></sub>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
1
7
|
# Peertable
|
|
2
8
|
|
|
3
9
|
**A round table of peer agents. No orchestrator at the head.**
|
|
@@ -76,9 +82,15 @@ Standalone gives up machine-guaranteed scheduling across tasks — nothing else.
|
|
|
76
82
|
|
|
77
83
|
```
|
|
78
84
|
room/ room server (zero-dependency Node) + per-session MCP channel client
|
|
79
|
-
skill/ "peertable" skill for Claude Code: setup / disband (teardown) of a full table
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
skill/ "peertable" skill for Claude Code: setup / disband (teardown) of a full table,
|
|
86
|
+
plus the seat launcher and the wake-up / seat-state / run bridges
|
|
87
|
+
deploy/ compose + Caddy snippet for running the room server as a resident service
|
|
88
|
+
docs/ plan.md — the living design document & decision log (Japanese),
|
|
89
|
+
plus one plan_*.md per campaign
|
|
90
|
+
evidence/ per-task completion evidence referenced by the Lattice plan store
|
|
91
|
+
experiments/ verification harnesses — one per pitfall we actually hit, each pinning the
|
|
92
|
+
behaviour so it cannot silently regress (channels, Lattice concurrency, the full
|
|
93
|
+
loop, pane-state classification, token resolution, teardown, …)
|
|
82
94
|
```
|
|
83
95
|
|
|
84
96
|
## Quick start
|
|
@@ -97,15 +109,25 @@ docker compose -f deploy/compose.yaml up -d
|
|
|
97
109
|
|
|
98
110
|
Open `http://localhost:8790` — every room gets a live web view (SSE). **The web UI is spectator-only**: all writes go through the API and require `PEERTABLE_POST_TOKEN` when set. Set the token whenever the server is reachable from outside.
|
|
99
111
|
|
|
100
|
-
**
|
|
112
|
+
The live view shows, per member: vendor / model / reasoning effort, and a **working state** — 作業中 (busy) · 待機 (idle) · 承認待ち (blocked on a permission prompt) · 停止 (dead). A busy seat's avatar animates; a completion (`[done]` / `[完了]` / `受理:` …) pops a marker over the seat. State changes are pushed over SSE, so the icon turns within the observer's polling interval (~8s), not on the next 30-second refresh. Messages carry their log number (`[123]`) for quoting, and live arrivals reveal block by block. **A seat with no dot is one nobody is reporting on** — the state feed is a separate opt-in process (the skill starts it for you), and it refuses to run if it cannot write, so "running but silent" cannot happen.
|
|
113
|
+
|
|
114
|
+
Endpoints: `GET /api/<room>/messages` · `GET /api/<room>/members` · `GET /api/<room>/summary` (≈120 bytes: `seq`, `last_ts`, `member_count`) · `GET /api/<room>/events` (SSE) · `POST /api/<room>/messages` · `POST /api/<room>/members`.
|
|
115
|
+
|
|
116
|
+
**2. Seat a member session.** The room MCP definition must live in the **project-root `.mcp.json`**:
|
|
117
|
+
|
|
118
|
+
```jsonc
|
|
119
|
+
// <project>/.mcp.json
|
|
120
|
+
{ "mcpServers": { "room": { "command": "peertable-client", "args": [] } } }
|
|
121
|
+
```
|
|
101
122
|
|
|
102
123
|
```bash
|
|
103
124
|
export PEERTABLE_URL=http://localhost:8790 PEERTABLE_ROOM=myproject PEERTABLE_MEMBER=hinata
|
|
104
|
-
claude --
|
|
105
|
-
--dangerously-load-development-channels server:room
|
|
125
|
+
claude --dangerously-load-development-channels server:room
|
|
106
126
|
```
|
|
107
127
|
|
|
108
|
-
|
|
128
|
+
**Do not pass it via `--mcp-config`.** Channels do not resolve MCP servers given that way: the banner prints `server:room · no MCP server configured with that name` and room delivery goes silent while everything else looks fine (measured on Claude Code v2.1.226; decision 44 in [docs/plan.md](docs/plan.md)). The skill handles this for you and reverts the file on teardown.
|
|
129
|
+
|
|
130
|
+
The member gets four tools — `post`, `read_unread`, `read_log`, `members` — and a channel that wakes it whenever teammates address it. (`--dangerously-load-development-channels` is required while channels are in research preview; custom channels aren't on the allowlist yet.)
|
|
109
131
|
|
|
110
132
|
**3. Or let the skill do all of it** — link `skill/` as `~/.claude/skills/peertable`, then tell your session:
|
|
111
133
|
|
|
@@ -115,7 +137,9 @@ It interviews you, names the members, scaffolds `.team/` (charter + roles, isola
|
|
|
115
137
|
|
|
116
138
|
## Status
|
|
117
139
|
|
|
118
|
-
Working, verified end-to-end on 2026-08-08
|
|
140
|
+
Working, and used to build itself. First verified end-to-end on 2026-08-08 with a full no-orchestrator loop: two members consulted, claimed, negotiated an interface, shared a discovered pitfall, cross-reviewed and shipped a small project with **zero external intervention**. Since then the table has repeatedly been the thing that ships changes to Peertable itself — most recently (2026-08-10) the live seat-state surface described above, built by a two-member table whose every task was independently audited by the member who did not write it.
|
|
141
|
+
|
|
142
|
+
The design document and decision log (**73 decisions**, in Japanese) live in [docs/plan.md](docs/plan.md).
|
|
119
143
|
|
|
120
144
|
Depends on Claude Code **channels**, currently a research preview — flags and protocol may change.
|
|
121
145
|
|
package/package.json
CHANGED
package/room/client.mjs
CHANGED
|
@@ -5,12 +5,13 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js'
|
|
|
5
5
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
6
6
|
import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js'
|
|
7
7
|
import { existsSync, readFileSync } from 'node:fs'
|
|
8
|
+
import { execFileSync } from 'node:child_process'
|
|
8
9
|
import { dirname, join } from 'node:path'
|
|
9
10
|
import { fileURLToPath } from 'node:url'
|
|
10
11
|
|
|
11
12
|
// client.mjs 側のハードコード版数。package.json の version と一致していることを
|
|
12
13
|
// diagnostics の version_consistency が見る(2 つの版数源の drift 検出。決定45)
|
|
13
|
-
const MCP_VERSION = '0.3.
|
|
14
|
+
const MCP_VERSION = '0.3.8'
|
|
14
15
|
const PKG_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
15
16
|
|
|
16
17
|
const USAGE = `usage:
|
|
@@ -121,10 +122,38 @@ await mcp.connect(new StdioServerTransport())
|
|
|
121
122
|
// 素性(vendor/model/effort)は launch-seat.sh が env へ入れる。**登録のたびに載せる**——
|
|
122
123
|
// 登録は client の起動ごとに繰り返し起きるので、1回きりの経路に置くと
|
|
123
124
|
// member の状態が失われた時に二度と戻らない(server 側は渡された欄だけ更新する upsert)
|
|
125
|
+
function observeSelf() {
|
|
126
|
+
if (!process.env.TMUX) {
|
|
127
|
+
process.stderr.write('peertable-client: observe unavailable: TMUX 不在\n')
|
|
128
|
+
return null
|
|
129
|
+
}
|
|
130
|
+
if (!process.env.TMUX_PANE) {
|
|
131
|
+
process.stderr.write('peertable-client: observe unavailable: TMUX_PANE 不在\n')
|
|
132
|
+
return null
|
|
133
|
+
}
|
|
134
|
+
const socket = process.env.TMUX.split(',')[0]
|
|
135
|
+
if (!socket) {
|
|
136
|
+
process.stderr.write('peertable-client: observe unavailable: TMUX の socket が空\n')
|
|
137
|
+
return null
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
const target = execFileSync('tmux', ['-S', socket, 'display-message', '-p', '-t', process.env.TMUX_PANE, '#S'], {
|
|
141
|
+
encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'],
|
|
142
|
+
}).trim()
|
|
143
|
+
if (!target) throw new Error('session 名が空')
|
|
144
|
+
return { tmux_socket: socket, tmux_target: target }
|
|
145
|
+
} catch (error) {
|
|
146
|
+
process.stderr.write(`peertable-client: observe unavailable: ${error.message}\n`)
|
|
147
|
+
return null
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const observe = observeSelf()
|
|
124
152
|
const IDENTITY = Object.fromEntries(Object.entries({
|
|
125
153
|
vendor: process.env.PEERTABLE_VENDOR,
|
|
126
154
|
model: process.env.PEERTABLE_MODEL,
|
|
127
155
|
effort: process.env.PEERTABLE_EFFORT,
|
|
156
|
+
observe,
|
|
128
157
|
}).filter(([, v]) => v))
|
|
129
158
|
await fetch(api('members'), { method: 'POST', headers, body: JSON.stringify({ name: ME, ...IDENTITY }) })
|
|
130
159
|
{
|
|
@@ -144,7 +173,12 @@ async function subscribe() {
|
|
|
144
173
|
while ((i = buf.indexOf('\n\n')) >= 0) {
|
|
145
174
|
const frame = buf.slice(0, i)
|
|
146
175
|
buf = buf.slice(i + 2)
|
|
147
|
-
const
|
|
176
|
+
const lines = frame.split('\n')
|
|
177
|
+
// 名前付きイベント(ping/member等)はチャット発言ではない。明示的に読み飛ばす——
|
|
178
|
+
// 現状は relevant() が宛先無しの payload を弾いて偶然安全なだけで、将来のイベント追加が
|
|
179
|
+
// 席を起こす経路を open のままにしない
|
|
180
|
+
if (lines.some(l => l.startsWith('event: '))) continue
|
|
181
|
+
const data = lines.filter(l => l.startsWith('data: ')).map(l => l.slice(6)).join('')
|
|
148
182
|
if (!data) continue
|
|
149
183
|
const m = JSON.parse(data)
|
|
150
184
|
if (!relevant(m)) continue
|
package/room/server.mjs
CHANGED
|
@@ -25,12 +25,17 @@ function loadRoom(name, create = false) {
|
|
|
25
25
|
const dir = join(DATA, name)
|
|
26
26
|
if (create) mkdirSync(dir, { recursive: true })
|
|
27
27
|
const logPath = join(dir, 'log.jsonl')
|
|
28
|
-
const
|
|
28
|
+
const lines = existsSync(logPath) ? readFileSync(logPath, 'utf8').split('\n').filter(Boolean) : []
|
|
29
|
+
const seq = lines.length
|
|
30
|
+
// last_ts は summary 用。末尾行を1回 parse するだけ(既にこの読み出しで行数を数えているので追加I/Oはゼロ)。
|
|
31
|
+
// 壊れた末尾行で throw すると loadRoom は全エンドポイントの入口なので巻き添えで死ぬ→null に落とす
|
|
32
|
+
let lastTs = null
|
|
33
|
+
if (lines.length) { try { lastTs = JSON.parse(lines.at(-1)).ts ?? null } catch { lastTs = null } }
|
|
29
34
|
const membersPath = join(dir, 'members.json')
|
|
30
35
|
// members の値は `{ joined_at, …任意欄 }`。旧形式(値が ISO 文字列)もそのまま読める
|
|
31
36
|
const stored = existsSync(membersPath) ? Object.entries(JSON.parse(readFileSync(membersPath, 'utf8'))) : []
|
|
32
37
|
const members = new Map(stored.map(([n, v]) => [n, typeof v === 'string' ? { joined_at: v } : v]))
|
|
33
|
-
const room = { name, dir, logPath, membersPath, seq, members, streams: new Set() }
|
|
38
|
+
const room = { name, dir, logPath, membersPath, seq, last_ts: lastTs, members, streams: new Set() }
|
|
34
39
|
rooms.set(name, room)
|
|
35
40
|
return room
|
|
36
41
|
}
|
|
@@ -73,6 +78,15 @@ function normalizeAudience(to, toNames) {
|
|
|
73
78
|
return { to: null, to_names: names }
|
|
74
79
|
}
|
|
75
80
|
|
|
81
|
+
// SSE の member イベントで押し込む欄。閲覧者が気づく欄だけに絞る(POST /members 参照)
|
|
82
|
+
const MEMBER_EVENT_FIELDS = ['status', 'busy_since', 'vendor', 'model', 'effort']
|
|
83
|
+
|
|
84
|
+
// room ログへは書かない・system 発言も出さない稼働状態の push。post() とは別の経路
|
|
85
|
+
function emitMember(room, name, meta) {
|
|
86
|
+
const chunk = `event: member\ndata: ${JSON.stringify({ name, ...meta })}\n\n`
|
|
87
|
+
for (const res of room.streams) res.write(chunk)
|
|
88
|
+
}
|
|
89
|
+
|
|
76
90
|
function post(room, from, to, body, toNames = null) {
|
|
77
91
|
const msg = {
|
|
78
92
|
seq: ++room.seq, ts: new Date().toISOString(), from, body,
|
|
@@ -80,6 +94,7 @@ function post(room, from, to, body, toNames = null) {
|
|
|
80
94
|
...(toNames ? { to_names: toNames } : {}),
|
|
81
95
|
}
|
|
82
96
|
appendFileSync(room.logPath, JSON.stringify(msg) + '\n')
|
|
97
|
+
room.last_ts = msg.ts // 正本へ書けてから更新する
|
|
83
98
|
const chunk = `data: ${JSON.stringify(msg)}\n\n`
|
|
84
99
|
for (const res of room.streams) res.write(chunk)
|
|
85
100
|
return msg
|
|
@@ -110,6 +125,11 @@ http.createServer(async (req, res) => {
|
|
|
110
125
|
capabilities: { member_observation_v1: true },
|
|
111
126
|
}, CORS)
|
|
112
127
|
|
|
128
|
+
if (req.method === 'GET' && rest === 'summary')
|
|
129
|
+
return json(res, 200, {
|
|
130
|
+
schema: 'peertable.summary.v1', room: room.name, seq: room.seq, last_ts: room.last_ts, member_count: room.members.size,
|
|
131
|
+
}, CORS)
|
|
132
|
+
|
|
113
133
|
if (req.method === 'GET' && rest === 'events') {
|
|
114
134
|
res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', Connection: 'keep-alive', ...CORS })
|
|
115
135
|
res.write(`: connected seq=${room.seq}\n\n`)
|
|
@@ -142,11 +162,16 @@ http.createServer(async (req, res) => {
|
|
|
142
162
|
// **渡された欄だけ更新し、渡されなかった欄は既存を保つ**——席の client は `{name}` だけで
|
|
143
163
|
// 登録するので、これが無いと再接続のたびに素性が消える。`joined_at` は最初の登録を保つ。
|
|
144
164
|
const known = room.members.get(name)
|
|
145
|
-
|
|
165
|
+
const merged = { joined_at: known?.joined_at ?? new Date().toISOString(), ...known, ...meta }
|
|
166
|
+
room.members.set(name, merged)
|
|
146
167
|
saveMembers(room)
|
|
147
168
|
// **system 発言は本当に新規の時だけ**。欄の更新で「参加した」を流すと、状態を数秒ごとに
|
|
148
169
|
// 送る消費者が卓の全席を起こし続ける(既存メンバーへの再 POST で実測・room [285])
|
|
149
170
|
if (!known) post(room, 'system', name, `${name} が参加した`)
|
|
171
|
+
// 閲覧者が気づく欄が変わった時だけ member イベントを流す。status_at(心拍のたび必ず変わる)と
|
|
172
|
+
// pane_token_hint(作業中に刻み変わる)は対象外——含めると数秒ごとに再描画が走り稼働アニメがちらつく
|
|
173
|
+
else if (MEMBER_EVENT_FIELDS.some(f => known[f] !== merged[f]))
|
|
174
|
+
emitMember(room, name, merged)
|
|
150
175
|
return json(res, 200, { ok: true })
|
|
151
176
|
}
|
|
152
177
|
if (req.method === 'DELETE' && seg[2] === 'members' && seg[3]) {
|
|
@@ -184,8 +209,8 @@ const FAVICON = `<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://
|
|
|
184
209
|
// 発言者ごとの色は名前ハッシュ(--h)から作る。彩度・明度だけテーマで持ち替えれば dark/light 両方が成立する
|
|
185
210
|
const STYLE = `
|
|
186
211
|
*{box-sizing:border-box}
|
|
187
|
-
:root{color-scheme:light dark;--fg:#1a1a1a;--bg:#f7f6f3;--surface:#fff;--line:#e4e2dc;--accent:#1d4ed8;--dim:#8a877f;--sat:55%;--lum:45%;--name:32%;--tint:96%;--edge:82%;--busy:#1f9d55;--idle:#b9b6ae;--dead:#d03b3b}
|
|
188
|
-
@media(prefers-color-scheme:dark){:root{--fg:#e8e6e0;--bg:#141418;--surface:#1e1e24;--line:#2c2c33;--accent:#7aa2ff;--dim:#8b8892;--sat:48%;--lum:56%;--name:75%;--tint:18%;--edge:32%;--busy:#3ecf7e;--idle:#4d4b52;--dead:#ff6b6b}}
|
|
212
|
+
:root{color-scheme:light dark;--fg:#1a1a1a;--bg:#f7f6f3;--surface:#fff;--line:#e4e2dc;--accent:#1d4ed8;--dim:#8a877f;--sat:55%;--lum:45%;--name:32%;--tint:96%;--edge:82%;--busy:#1f9d55;--idle:#b9b6ae;--dead:#d03b3b;--blocked:#d97706}
|
|
213
|
+
@media(prefers-color-scheme:dark){:root{--fg:#e8e6e0;--bg:#141418;--surface:#1e1e24;--line:#2c2c33;--accent:#7aa2ff;--dim:#8b8892;--sat:48%;--lum:56%;--name:75%;--tint:18%;--edge:32%;--busy:#3ecf7e;--idle:#4d4b52;--dead:#ff6b6b;--blocked:#f0a63a}}
|
|
189
214
|
body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;font-size:14px;line-height:1.65;color:var(--fg);background:var(--bg)}
|
|
190
215
|
a{color:var(--accent)}
|
|
191
216
|
.brand{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:650;letter-spacing:.01em}
|
|
@@ -205,6 +230,7 @@ const UI = room => `<!doctype html><html lang="ja"><head><meta charset="utf-8"><
|
|
|
205
230
|
.chip .st.busy{background:var(--busy)}
|
|
206
231
|
.chip .st.idle{background:var(--idle)}
|
|
207
232
|
.chip .st.dead{background:var(--dead)}
|
|
233
|
+
.chip .st.blocked{background:var(--blocked)}
|
|
208
234
|
.chip .st.unknown{background:transparent;box-shadow:inset 0 0 0 1.5px var(--dim)}
|
|
209
235
|
.metapop{position:fixed;z-index:20;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px 10px;font-size:12px;box-shadow:0 6px 20px rgba(0,0,0,.18);max-width:70vw}
|
|
210
236
|
.metapop .metaname{font-weight:600;margin-bottom:2px}
|
|
@@ -217,8 +243,10 @@ const UI = room => `<!doctype html><html lang="ja"><head><meta charset="utf-8"><
|
|
|
217
243
|
.chip.is-busy .av{animation:seat-working 1.15s ease-in-out infinite;box-shadow:0 0 0 2px color-mix(in srgb,var(--busy) 38%,transparent)}
|
|
218
244
|
.chip.is-busy.pulse .av{animation:seat-working 1.15s ease-in-out infinite,pulse 1.6s ease-out 2}
|
|
219
245
|
.chip.is-busy .st{animation:seat-beat .8s ease-in-out infinite alternate}
|
|
246
|
+
.chip.is-blocked .av{animation:seat-blocked 2.2s ease-in-out infinite}
|
|
220
247
|
@keyframes seat-working{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-2px) rotate(2deg)}}
|
|
221
248
|
@keyframes seat-beat{from{transform:scale(.78);opacity:.7}to{transform:scale(1.28);opacity:1}}
|
|
249
|
+
@keyframes seat-blocked{0%,100%{opacity:1}50%{opacity:.5}}
|
|
222
250
|
.victory{position:fixed;z-index:30;left:var(--victory-x);top:var(--victory-y);pointer-events:none;color:var(--busy);font-size:13px;font-weight:800;letter-spacing:.03em;text-shadow:0 1px 0 var(--surface);animation:victory-rise 1.45s cubic-bezier(.18,.8,.3,1) both}
|
|
223
251
|
@keyframes victory-rise{0%{opacity:0;transform:translate(-50%,8px) scale(.75)}18%{opacity:1;transform:translate(-50%,-7px) scale(1.08)}72%{opacity:1;transform:translate(-50%,-15px) scale(1)}100%{opacity:0;transform:translate(-50%,-27px) scale(.92)}}
|
|
224
252
|
@keyframes pulse{from{box-shadow:0 0 0 0 hsl(var(--h) var(--sat) var(--lum)/.6)}to{box-shadow:0 0 0 9px hsl(var(--h) var(--sat) var(--lum)/0)}}
|
|
@@ -227,7 +255,10 @@ const UI = room => `<!doctype html><html lang="ja"><head><meta charset="utf-8"><
|
|
|
227
255
|
.msg.flow,.sys.flow{animation:message-flow .36s cubic-bezier(.22,1,.36,1) both}
|
|
228
256
|
@keyframes message-flow{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
|
|
229
257
|
@media (prefers-reduced-motion:reduce){.msg.flow,.sys.flow{animation:none}}
|
|
230
|
-
@media (prefers-reduced-motion:reduce){.chip.is-busy .av,.chip.is-busy .st,.victory{animation:none}}
|
|
258
|
+
@media (prefers-reduced-motion:reduce){.chip.is-busy .av,.chip.is-busy .st,.chip.is-blocked .av,.victory{animation:none}}
|
|
259
|
+
.bubble.reveal>*{animation:block-in .32s cubic-bezier(.22,1,.36,1) both}
|
|
260
|
+
@keyframes block-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
|
|
261
|
+
@media (prefers-reduced-motion:reduce){.bubble.reveal>*{animation:none}}
|
|
231
262
|
.msg.cont{margin-top:-8px}.msg.cont .av{visibility:hidden;height:0}.msg.cont .meta{display:none}
|
|
232
263
|
.msg .body{min-width:0;max-width:100%}
|
|
233
264
|
.meta{display:flex;align-items:baseline;gap:7px;flex-wrap:wrap;margin:0 0 3px 2px;font-size:12px}
|
|
@@ -353,17 +384,19 @@ async function refreshMembers(){
|
|
|
353
384
|
for(const m of r.members){
|
|
354
385
|
const c=el('span','chip'+(m.name===recent?' recent':''))
|
|
355
386
|
c.style.setProperty('--h',hue(m.name));c.dataset.name=m.name
|
|
356
|
-
//
|
|
357
|
-
|
|
387
|
+
// 素性は任意欄。名乗っていない席は行ごと出ない(空欄を「不明」として見せない)。
|
|
388
|
+
// vendor/model/effort を1行へ畳む(launch-seat.sh:108 の着席ログと読み口を揃える。effort の語は出さない)
|
|
389
|
+
const idParts=[m.vendor,m.model,m.effort].filter(Boolean)
|
|
390
|
+
const meta=[idParts.length?idParts.join(' / '):null].filter(Boolean)
|
|
358
391
|
// 稼働状態は**報告が新しい時だけ**採る。途絶えたら unknown へ落とす——古い状態を出し続けるのが
|
|
359
392
|
// いちばん悪い(動いていない席を「動いている」と見せる)。閾値は bridge の心拍30秒の3倍
|
|
360
393
|
const age=m.status_at?Date.now()-Date.parse(m.status_at):Infinity
|
|
361
394
|
const st=(m.status&&age<STATUS_STALE_MS)?m.status:(m.status?'unknown':null)
|
|
362
395
|
if(st)c.classList.add('is-'+st)
|
|
363
|
-
if(st)meta.push('状態 '+({busy:'作業中',idle:'待機',dead:'停止',unknown:'
|
|
396
|
+
if(st)meta.push('状態 '+({busy:'作業中',idle:'待機',dead:'停止',blocked:'承認待ち',unknown:'不明(報告が途絶えている)'}[st]??st))
|
|
364
397
|
const usage=[]
|
|
365
398
|
const busyAge=m.busy_since?Date.now()-Date.parse(m.busy_since):NaN
|
|
366
|
-
if(st==='busy'&&Number.isFinite(busyAge)&&busyAge>=0)usage.push('継続 '+elapsed(busyAge))
|
|
399
|
+
if((st==='busy'||st==='blocked')&&Number.isFinite(busyAge)&&busyAge>=0)usage.push('継続 '+elapsed(busyAge))
|
|
367
400
|
if(Number.isSafeInteger(m.pane_token_hint)&&m.pane_token_hint>=0)usage.push(compactCount(m.pane_token_hint)+' tokens')
|
|
368
401
|
if(usage.length)meta.push('消費目安 '+usage.join(' / ')+'(pane観測)')
|
|
369
402
|
c.title=m.name+'(参加 '+new Date(m.joined_at).toLocaleString()+')'+(meta.length?'\\n'+meta.join('\\n'):'')
|
|
@@ -418,14 +451,19 @@ function celebrate(name){
|
|
|
418
451
|
}
|
|
419
452
|
const BEAT=${HEARTBEAT_MS}
|
|
420
453
|
const STATUS_STALE_MS=90000 // 稼働状態の鮮度。これを過ぎた報告は unknown(bridge 心拍30秒の3倍)
|
|
421
|
-
let lastSeq=0,lastBeat=Date.now(),es=null,emptyEl=null,firstLoad=true,catching=false
|
|
454
|
+
let lastSeq=0,lastBeat=Date.now(),es=null,emptyEl=null,firstLoad=true,catching=false,memberDebounce=null
|
|
422
455
|
// seq で二重描画を弾く。張り直し後の追いつきと SSE の新着が重なっても同じ発言は1回しか出ない
|
|
423
456
|
function apply(m,live=false){
|
|
424
457
|
if(m.seq<=lastSeq)return false
|
|
425
458
|
lastSeq=m.seq
|
|
426
459
|
if(emptyEl){emptyEl.remove();emptyEl=null}
|
|
427
460
|
const row=render(m)
|
|
428
|
-
if(live)
|
|
461
|
+
if(live){
|
|
462
|
+
row.classList.add('flow')
|
|
463
|
+
// ライブ新着だけ、バブル内の各ブロックへ順に出現アニメを当てる。実際の生成とは同期しない単なる演出
|
|
464
|
+
const bub=row.querySelector('.bubble')
|
|
465
|
+
if(bub){bub.classList.add('reveal');[...bub.children].forEach((c,i)=>{c.style.animationDelay=(Math.min(i,8)*90)+'ms'})}
|
|
466
|
+
}
|
|
429
467
|
if(m.from!=='system')recent=m.from
|
|
430
468
|
return true
|
|
431
469
|
}
|
|
@@ -451,6 +489,8 @@ function connect(){
|
|
|
451
489
|
// 心拍は room の最新 seq を積んでくる。繋がったまま取りこぼした(=途絶しないので watchdog が気づけない)
|
|
452
490
|
// 場合は、この差分だけが手掛かりになる
|
|
453
491
|
es.addEventListener('ping',e=>{lastBeat=Date.now();if(Number(e.data)>lastSeq)catchUp()})
|
|
492
|
+
// 稼働状態・素性の変化。既存の refreshMembers() を150msデバウンスで呼ぶ(部分更新は実装しない)
|
|
493
|
+
es.addEventListener('member',()=>{clearTimeout(memberDebounce);memberDebounce=setTimeout(refreshMembers,150)})
|
|
454
494
|
es.onmessage=e=>{
|
|
455
495
|
lastBeat=Date.now()
|
|
456
496
|
const m=JSON.parse(e.data),stick=nearBottom()
|
package/skill/SKILL.md
CHANGED
|
@@ -29,7 +29,7 @@ description: 任意プロジェクトに Peertable チーム(対等メンバ
|
|
|
29
29
|
|
|
30
30
|
手順は **聞き取り → script → 着任指示** の3段である。scripts が機械部分を全部持つので、AI が手で tmux を組み立てることはしない。
|
|
31
31
|
|
|
32
|
-
1. **聞き取り**: 対象プロジェクトのパス / **工程正本(`Lattice 併用`=既定 / `単独`)** / メンバー数とモデル・effort(モデル既定: Sonnet
|
|
32
|
+
1. **聞き取り**: 対象プロジェクトのパス / **工程正本(`Lattice 併用`=既定 / `単独`)** / メンバー数とモデル・effort(モデル既定: Sonnet。**effort は既定値を置かない——席ごとに必ず決める**。`launch-seat.sh` の effort は必須引数で、未指定は着席前に非ゼロ終了する。モデル選定は作業の性質——設計か確定実装か——を軸にする。決定49)/ 初期タスク群(何を作るか)/ room 名(既定: プロジェクトのディレクトリ名)/ **公開URL基底**(Lattice 併用のみ。外部ペインに書く URL。クオ環境は `https://peertable.kitepon.dev`。未指定なら room サーバーの URL がそのまま入る=LAN URL は Lattice を外から見た時に開けない)
|
|
33
33
|
- **メンバー数の既定**: Lattice 併用なら plan compile 結果の幅(`max_frontier_width`)に合わせる(実測: 幅3→3人、第2 campaign で幅4→4人目追加)。frontier より多い席は最初から遊ぶ。単独モードには frontier が無いので既定の根拠も無く、聞き取りで決める
|
|
34
34
|
- **運用中の席数の標準は「ready+activeな実装ToDo数」(決定68)**: 起動時の幅は計画値、この式は生きた実測値で、campaignが進めば自然に縮む。標準を上回った席は親が縮退する。監査・受入は実装席が兼ねる(決定67)ので監査要員を席数に数えない。claimできるToDoが無い席は仕事を発明せず(依頼されていない監査・照会・自主レビュー禁止)、待機宣言して黙るか親に畳まれる
|
|
35
35
|
- **モードの選び分け**: タスク間に依存があり並列境界の機械保証が要るなら Lattice 併用。依存の無い小規模作業で、対象プロジェクトに Lattice を持ち込みたくないなら単独。単独で失うのは task 間スケジューリングの機械保証だけで、円卓の核(room・憲章・宣言による協力)は変わらない(決定47)
|
|
@@ -41,22 +41,25 @@ description: 任意プロジェクトに Peertable チーム(対等メンバ
|
|
|
41
41
|
4. **Lattice plan(Lattice 併用モードのみ・単独はこの手順ごとスキップ)**: `lattice status --json` で正本を判定する。`uninitialized` なら聞き取ったタスクを JSON へ落として `scripts/make-plan-input.mjs <tasks.json> --project <project>` で `plan create` 入力を生成し、`lattice plan create --input .lattice/plan-create.json` を打つ。初期化済みなら `todo migrate` の作法(Lattice 正典)に従う。設計メモは各タスクに必ず書く
|
|
42
42
|
- `make-plan-input.mjs` が digest 計算と `hard_dependencies` の `(from,to)` 昇順ソートを持つ(**手書きで2回踏んだ罠**。順序が崩れると `INPUT_INVALID / pointer:"/"` としか言われない)。`project_id` の既定は project ディレクトリ名で、`external-pane.mjs` が書く `project.json` の既定と一致させてある——**両者がずれると Lattice が identity 検証で落ちる**
|
|
43
43
|
- 単独モードのタスク正本は手順3で生成した `.team/tasks.md` だけである。状態(誰が持っているか・何が終わったか)は持たせない——claim と完了は room の宣言だけが正(決定48 の延長)。ミニタスクトラッカーを別途作らない(決定36)
|
|
44
|
-
5. **メンバー起動**: メンバーごとに `scripts/launch-seat.sh <project> <name> <model>
|
|
44
|
+
5. **メンバー起動**: メンバーごとに `scripts/launch-seat.sh <project> <name> <model> <claude|codex> <effort> [着任指示]` を実行する。**vendor・effort とも必須引数**(未指定は usage を出して非ゼロ終了。既定値をコードへ埋めない——席を立てる時に決める)。tmux 作成(aiterm と同じソケットなので、立った席はそのまま `pty_read`/`pty_send` で読める)→ env 注入 → 起動 → 既知ダイアログ通過 → 着席確認まで1回で行き、着席しなければ最後の画面を出して非ゼロで落ちる(黙って進まない)
|
|
45
45
|
- 起動前に `pty_list` で既存の `peer-*` 席を確認する(前の卓の残骸を99席実測したことがある)。同名の席は launch-seat.sh が落としてから立て直す
|
|
46
46
|
- 着任指示を第6引数に渡すと着席後に送る。文面: 「あなたは「<日本語名>」。.team/roles/member.md を読んで着任し、作業ループを開始せよ。全タスク完了の宣言まで自律的に続けること。」
|
|
47
47
|
- 席が読む env は script が組み立てる(`PEERTABLE_URL` / `PEERTABLE_ROOM` / `PEERTABLE_MEMBER` / `PEERTABLE_POST_TOKEN`、Lattice 併用なら `PEERTABLE_PLAN` と actor 3点)。**channels は `--mcp-config` の MCP server を解決しない**(実測 2026-08-08・Claude Code v2.1.226・決定44)ため、room の MCP 定義は setup.sh が project root へ置く `.mcp.json` が正。project に既存 `.mcp.json` があった場合 setup.sh は上書きせず警告を出すので、AI が手動 merge して teardown で復元する
|
|
48
48
|
- **Codex 席**(`vendor=codex`): Codex には channels が無いので、room は `-c` 上書きの stdio MCP として差す(`mcp_servers.room.command="peertable-client"` と `mcp_servers.room.env={…}`)。**env は closed mode で親環境を継がない**ので `PATH` を含む全変数を明示列挙する。effortはmember metadataだけでなく`model_reasoning_effort`へも同じ値を渡す。モデル名は ChatGPT アカウントで使える slug を渡す(`~/.codex/config.toml` の `model` が既定値の参考。使えない slug は起動後の最初のターンで 400 になって初めて分かる)。Codex 席を混ぜたら**必ず起床ブリッジを立てる**(下記)——立てないと room の新着で起きない
|
|
49
|
-
6. **起床ブリッジ(Codex 席がある時だけ)**: `
|
|
49
|
+
6. **起床ブリッジ(Codex 席がある時だけ)**: `scripts/ensure-bridge.sh <project> wakeup <codex席名>…`。room の SSE を購読し、明示的にその席宛の新着(自分の発言は除く)だけを tmux へ素送信して起こす。ensure は専用 tmux session で起動し、bridge の `ready_at` を待つ。確認できなければログ末尾を出して非ゼロで終わる。**Codex はターン実行中でも素送信を受け付け、その文言をそのターンの中で読む**(実測)ので idle 待ちはしない。停止は `node scripts/wakeup-bridge.mjs <project> --stop`(teardown.sh が自動で行う)
|
|
50
50
|
- **黙って止まらないための三段**(決定58 の受信側の作法): ①75秒なにも届かなければ自分から切って繋ぎ直す ②繋ぎ直したら `?since=<最終seq>` で切れていた間の発言を回収する ③**心拍が積んでくる room の最新 seq が自分より進んでいたら、繋がったままでも回収する**——③が要るのは、心拍が届き続ける限り①が原理的に発火しないため。**server 側の心拍(`event: ping`・25秒周期)が前提**なので、古い room サーバーへ繋ぐと①だけが効く形になる
|
|
51
51
|
- ログは `.team/wakeup-bridge.log`。**0件でも0件と出す**ので、起こせているか・取りこぼしていないかはログを見れば分かる。再現ハーネスは `experiments/bridge-catchup-repro.mjs`
|
|
52
52
|
|
|
53
|
-
6.5
|
|
54
|
-
-
|
|
53
|
+
6.5 **席の稼働状態ブリッジ(setup.sh が自動で起こす)**: 手順3の scaffold が `ensure-bridge.sh <project> seat-status` で起こすので、**AI が手で叩く段は無い**。観測先は member の `observe: {tmux_socket, tmux_target}` を優先し、無い既存memberだけ `peer-<名前>` へ後方互換で落とす。socket は明示env → aiterm POSIX既定 → 検証済み`/tmp/aiterm-*.sock`1本 → 既定パスの順で解決し、bashからは`tmux-socket.mjs`を呼ぶ。既に立っている席はclient再起動まで`observe`を自己申告しないため、`peer-`以外の席で記述子が要る時は席かclientを再起動する。WSLではbridgeが読む**WSL側**の版が正で、Windows側だけの更新では直らない。
|
|
54
|
+
- **setup が起こし、teardown が止める(対称)。** 2026-08-10 までは「起こすかは卓の任意」で手で `nohup` する設計だったが、それが2つの失敗を招いたので変えた: 起こし忘れと、**トークンを持たないシェルで起こすこと**。後者は実害が出た——`~/.config/peertable.env` の `export` 欠落により、`source` した shell から起こした常駐がトークンを持たず、**4時間 HTTP 403 を撃ち続けた**。参加者一覧には点が1つも出ず、**「起こしていない」と見分けがつかなかった**
|
|
55
|
+
- **書込トークンは起こす側の env に依存しない。** ブリッジ自身が `launch-seat.sh:25-27` と同じ規則で解決する(env が先・無ければ `~/.config/peertable.env` を読む。`export` の有無を問わない)。同じ規則を `run-bridge.mjs` も使う
|
|
56
|
+
- **書けない常駐は生まれない。** 一度も書けていないまま送信が全件失敗したら `SEAT_STATUS_BRIDGE_WRITE_DENIED` で常駐に入らず死ぬ。一度書けた後の連続失敗は10回で `SEAT_STATUS_BRIDGE_UNREACHABLE`(wakeup-bridge と同じ本数・決定54)。**席がまだ立っていない tick は失敗に数えない**ので、setup 直後に起こしても死なない
|
|
57
|
+
- 止め忘れると `.team/` と一緒に pid 記録が消えて **`--stop` でも止められない常駐**が残る(teardown が自動で止めるので通常経路では起きない)
|
|
55
58
|
|
|
56
59
|
6.7 **effort変更(本人要請→親実行)**: 本人は親だけへ`[effort変更依頼] <level>`を明示DMする。親は席がidleなのを確認して`skill/scripts/change-effort.sh <project> <member> <level> [parent_name]`を実行する。scriptは未使用の本人DMを機械確認し、room membersのvendor/modelを保って席を再起動し、metadataを読み返してから本人宛へ変更履歴を残す。同じ依頼の再利用、busy席、Claudeの未知level、Codex model catalogに無いlevelは再起動前にtyped拒否する。新設定での起動失敗時は旧effortで1回だけ明示rollbackし、両方失敗なら手動復旧が必要だと非0で出す。
|
|
57
60
|
- **会話contextは引き継がない**。本人は作業を安全に中断できる時だけ依頼し、再起動後はrole・工程正本・roomログから再着任する。変更できたのに履歴記録だけ失敗した場合も成功へ丸めず、`EFFORT_CHANGE_CHANGED_BUT_HISTORY_FAILED`で現在状態を明示する
|
|
58
61
|
|
|
59
|
-
7. **親の着卓**(このセッション): `scripts/parent-join.sh <project> [name] [model] [effort]` で member
|
|
62
|
+
7. **親の着卓**(このセッション): `scripts/parent-join.sh <project> [name] [model] [effort]` で member 登録を行う。**`effort` は任意のまま据え置く**——席は `launch-seat.sh` が `--effort` で実際に設定するので「渡した値=実挙動」だが、親は既に走っているセッションで自分の effort を機械的に知る経路が無く、推測して載せると画面が嘘をつく。**bell宛DM番犬**を Monitor で張る(形は下記「親の operating notes」の番犬仕様)。broadcastのkickoffは廃止済み。以後の post も API 直(同 notes)
|
|
60
63
|
8. **起動確認**: room の members に全員いる / 最初の claim が room に流れる(Lattice 併用モードはそれが Lattice へ到達している=`lattice todo status --json` の active に出ることも確認する。単独モードは room の claim 宣言だけが到達の証拠)/ Web UI で観測できる、をチェックして報告する
|
|
61
64
|
|
|
62
65
|
## teardown
|
|
@@ -95,7 +98,7 @@ description: 任意プロジェクトに Peertable チーム(対等メンバ
|
|
|
95
98
|
- **席の作法の正本は `templates/member.md` の「Lattice の実行層へ自分の着手を載せる」節**(intake→intervention 判定→attach→作業→`todo done`→accept の順・1席1 intake・禁止操作・検証の回し方・成果の正本)。ここに二重化しない
|
|
96
99
|
- **席は自分の pid を装置へ渡す(attach)。** その pid は `.team/seats/<名前>.json`(`launch-seat.sh` が着席直後に書く)が持ち、席は読んで `schema` を足すだけで attach input になる。**raw argv を保存しない**——Codex 起動の argv には `PEERTABLE_POST_TOKEN` が載るので、保存すれば秘密の複製になる(2026-08-09 実測)。持つのは digest だけ
|
|
97
100
|
- **run-bridge は可視化の中継であって、必須経路ではない**(決定63)。落ちていても席は自分で intake / attach / accept を打てるし、介入も `lattice run intake intervention --run <ref> --task <id>` で自分で読める。**見えなくなるだけ**である
|
|
98
|
-
- **ブリッジの起動**: `
|
|
101
|
+
- **ブリッジの起動**: `scripts/ensure-bridge.sh <project> run [--lattice <path>]`。停止は `node scripts/run-bridge.mjs <project> --stop`(**teardown.sh が自動で行う**)。**spool dir も席名も取らない**(配車をしないので要らない。渡すと typed error で落ちる)。ADR 0157 の作法(pid 記録・起動時に前の記録を掃除・SIGTERM→SIGKILL)はそのまま
|
|
99
102
|
- `--lattice <path>` は release 前の source tree を実測する時に使う。**PATH の install は version 表示が同じでも未 publish の schema を読めない**(2026-08-09 に卓で3件実測)
|
|
100
103
|
- bridge が返すのは2つだけで**どちらも読み取り**: `[run] <run-id> intake=[…] accepted=[…] hold=[…] closed=…`(変化時だけ)と、`hold` になった intake をその作業を始めた席宛へ返す `[介入]`
|
|
101
104
|
|
|
@@ -170,7 +173,8 @@ witness をどう生成するかは**対象 project 側の作法に従う**(La
|
|
|
170
173
|
- **再着卓の契機は Monitor stream の終了通知**(2026-08-08 実測。1日に2回——引き継ぎ時と障害復旧後)。親の側には「途絶した」と教えてくれるものが他に無いので、**Monitor が終わったら再着卓の手順に入る**と決めておく
|
|
171
174
|
- **順序の要点は「room と工程正本を読み終えるまで発言しない」**。読む前に喋ると、自分が行き違いを作る側になる(実例あり)
|
|
172
175
|
- **やらないこと**: 復帰の挨拶で席を起こさない。作業の再確認を席へ聞いて回らない——**現在地は上の1〜2で取れる**ので、聞くのは席の時間を奪うだけである
|
|
173
|
-
- **宛先の規律**: postはメンバー名または必要なメンバー名の配列だけを受理し、broadcast shortcutはtyped拒否する。channels/起床ブリッジが起こすのも明示宛先だけ。roomログは宛先に関係なく全員がpull
|
|
176
|
+
- **宛先の規律**: postはメンバー名または必要なメンバー名の配列だけを受理し、broadcast shortcutはtyped拒否する。channels/起床ブリッジが起こすのも明示宛先だけ。roomログは宛先に関係なく全員がpullで読める(§16)ので、宛先は秘匿ではなく「今起こす必要がある相手」を表す
|
|
177
|
+
- **親(bell)宛DMを受理してよいのは決定71の3種だけ**: ①done報告・監査受理要請、②オーナー承認gateに関わる物件、③親・オーナーにしか解けないblocker・裁定依頼(`[effort変更依頼]`はこれに該当)。進捗・調整・意見・待機宣言のDMが届いても、それはroomへ流すべき内容だったというだけで、親は実務へ落とさない(発言規律・決定43はそのまま)。同じ基準は席同士のDMにも及ぶ——**同報・返答不要の情報共有目的の複数宛先は禁止**で、判断基準は「この宛先は受け取って何をする?」に答えられるかである
|
|
174
178
|
- **発言規律(決定43・正典 §3.4)**: 親の room 発言は ①監査結果の事実(受理/異議。「次はこうせよ」を続けない)②承認 gate の状態 ③オーナー裁定の伝達(必ず「オーナー裁定」と明示)の3種だけ。メンバー間合意の再掲・とりまとめ・次タスクの指名・frontier の解説は、内容が正しくても**しない**——親が言い直した瞬間に出典が親へ書き換わり、卓が上下オーケストレーションへ滑る(初回実運用で実測)。裁定依頼が来たら自分で判断せず、オーナー宛の議題として運ぶ
|
|
175
179
|
- 督促の検出源は room の報告途絶と Lattice 工程表の乖離。**単独円卓モードでは工程表が無いので、検出源は `.team/tasks.md` の議題と room ログの照合だけになる**——完走の判定も同じで、全議題に完了報告が揃ったことを親が room ログで確認し、散会を宣言する(この確認と宣言が単独モードの done gate である)
|
|
176
180
|
- **席の縮退も親の進行権能**(散会と同じ性質。決定51): frontier が細って遊休席が出たら親が畳む。順序を守る——①対象席へ名指しで通告 ②本人に WIP と未報告の作業が無いことを確認する(本人が「まだ持っている」と言えば畳まない。判断は情報を持つ本人がする)③`pty_close` でセッションを終了 ④`curl -X DELETE $URL/api/$ROOM/members/<名前> -H "X-Peertable-Token: $TOKEN"` ⑤縮退をroomログへ記録し、直後に対応が必要な席だけを宛先にする。**先に member を消すと本人が最後の報告を出せない**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
usage:
|
|
5
5
|
archive-room-log.py <server_url> <room> <out.md> ログを書き出す
|
|
6
|
-
archive-room-log.py --members <server_url> <room> member
|
|
6
|
+
archive-room-log.py --members [--json] <server_url> <room> member を出す(席を畳む相手)
|
|
7
7
|
|
|
8
8
|
本文は投稿時の Markdown をそのまま置く(引用ブロックで包むと表とコードが崩れる)。
|
|
9
9
|
本文の無い発言(過去に本文なし POST が着地した分)は、欠落と分かる形で残す——
|
|
@@ -21,9 +21,13 @@ def fetch(url, path):
|
|
|
21
21
|
|
|
22
22
|
def main(argv):
|
|
23
23
|
if argv[:1] == ["--members"]:
|
|
24
|
-
|
|
24
|
+
as_json = argv[1:2] == ["--json"]
|
|
25
|
+
url, room = argv[2:4] if as_json else argv[1:3]
|
|
25
26
|
members = fetch(url, f"/api/{room}/members")["members"]
|
|
26
|
-
|
|
27
|
+
if as_json:
|
|
28
|
+
print(json.dumps([{"name": m["name"], "observe": m.get("observe")} for m in members]))
|
|
29
|
+
else:
|
|
30
|
+
print(" ".join(m["name"] for m in members))
|
|
27
31
|
return 0
|
|
28
32
|
|
|
29
33
|
url, room, out = argv[0], argv[1], argv[2]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# bridge を tmux に常駐させ、最初の ready_at まで待つ薄い supervisor。
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
proj="$1"; name="$2"; shift 2
|
|
6
|
+
case "$name" in seat-status) script="seat-status-bridge.mjs" ;; wakeup) script="wakeup-bridge.mjs" ;; run) script="run-bridge.mjs" ;; *) echo "usage: ensure-bridge.sh <project> <seat-status|wakeup|run> [args...]" >&2; exit 1 ;; esac
|
|
7
|
+
team="$proj/.team"; record="$team/$name-bridge.json"; log="$team/$name-bridge.log"
|
|
8
|
+
force=false
|
|
9
|
+
if [ "${1:-}" = "--force" ]; then force=true; shift; fi
|
|
10
|
+
if [ $# -eq 0 ] && [ -f "$record" ]; then
|
|
11
|
+
saved=()
|
|
12
|
+
while IFS= read -r arg; do saved+=("$arg"); done < <(node -e 'const x=require(process.argv[1]); for (const a of x.args||[]) console.log(a)' "$record")
|
|
13
|
+
set -- "${saved[@]}"
|
|
14
|
+
fi
|
|
15
|
+
if [ -f "$record" ]; then
|
|
16
|
+
pid=$(node -e 'try{process.stdout.write(String(require(process.argv[1]).pid||""))}catch{}' "$record")
|
|
17
|
+
if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then exit 0; fi
|
|
18
|
+
if ! "$force" && grep -q 'WRITE_DENIED' "$log" 2>/dev/null; then echo "${name}-bridge: 前回はWRITE_DENIEDで終了。--forceを指定すること" >&2; exit 1; fi
|
|
19
|
+
fi
|
|
20
|
+
sock=$(node "$(dirname "$0")/tmux-socket.mjs")
|
|
21
|
+
room=$(node -e 'process.stdout.write(require(process.argv[1]).room)' "$team/setup-state.json")
|
|
22
|
+
session="peertable-${name}-${room}"
|
|
23
|
+
# **死んだ記録をここで消す。** 残すと下の loop が前回の `ready_at` を読んで、
|
|
24
|
+
# 新しい bridge が1バイトも動いていない段階で success を返す——「起動していないのに
|
|
25
|
+
# 起動したと言う」=この supervisor が塞ぐはずの穴そのものになる。
|
|
26
|
+
rm -f "$record"
|
|
27
|
+
: > "$log"
|
|
28
|
+
# **手渡された env を常駐へ渡す。** 新しい session が継ぐのは tmux *server* の環境であって
|
|
29
|
+
# 呼び出し元 client の環境ではないので、素で起こすと `PEERTABLE_TMUX_SOCKET` の手渡しが黙って消え、
|
|
30
|
+
# 常駐が別の socket(本番の既定)を観測しにいく(2026-08-11 実測)。決定73 と同じ形の裏返しである。
|
|
31
|
+
env_prefix=""
|
|
32
|
+
for v in PEERTABLE_TMUX_SOCKET PEERTABLE_POST_TOKEN PEERTABLE_URL; do
|
|
33
|
+
eval "val=\${$v:-}"
|
|
34
|
+
[ -n "$val" ] && env_prefix="$env_prefix $v=$(printf '%q' "$val")"
|
|
35
|
+
done
|
|
36
|
+
# **session が在るだけでは常駐が生きている証拠にならない**(中の node だけ死んで殻が残る)。
|
|
37
|
+
# 上で pid 生存を確かめて here まで来た=生きていないので、殻は畳んでから立て直す。
|
|
38
|
+
tmux -S "$sock" kill-session -t "$session" 2>/dev/null || true
|
|
39
|
+
tmux -S "$sock" new-session -d -s "$session" "env${env_prefix} node $(dirname "$0")/$script $(printf '%q ' "$proj" "$@") >> $(printf '%q' "$log") 2>&1"
|
|
40
|
+
for _ in $(seq 1 30); do
|
|
41
|
+
if [ -f "$record" ] && node -e 'process.exit(require(process.argv[1]).ready_at?0:1)' "$record"; then
|
|
42
|
+
# **末尾は本物の改行にする。** `"\\n"` と書くと JS がリテラルの `\`+`n` を足し、
|
|
43
|
+
# record が JSON として壊れる——`--stop` も次回起動も `JSON.parse` で落ちて、
|
|
44
|
+
# 「止められない・建て直せない常駐」ができる(2026-08-11 実測)。一時 file→rename で原子的に。
|
|
45
|
+
node -e 'const fs=require("fs");const p=process.argv[1],a=process.argv.slice(2);
|
|
46
|
+
const t=`${p}.${process.pid}.tmp`;
|
|
47
|
+
fs.writeFileSync(t,JSON.stringify({...JSON.parse(fs.readFileSync(p,"utf8")),args:a})+"\n");
|
|
48
|
+
fs.renameSync(t,p)' "$record" "$@"
|
|
49
|
+
exit 0
|
|
50
|
+
fi
|
|
51
|
+
sleep .5
|
|
52
|
+
done
|
|
53
|
+
echo "${name}-bridge: ready_at を待てなかった。ログ末尾:" >&2
|
|
54
|
+
tail -n 20 "$log" >&2 || true
|
|
55
|
+
exit 1
|