typeclaw 0.48.10 → 0.48.12
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/package.json +2 -2
- package/scripts/apparmor/typeclaw-bwrap +43 -0
- package/scripts/verify-apparmor-signals.sh +161 -0
- package/scripts/verify-mask-fd-sandbox.sh +86 -16
- package/src/agent/index.ts +11 -1
- package/src/agent/live-subagents.ts +98 -0
- package/src/agent/session-origin.ts +5 -1
- package/src/agent/tools/channel-reply.ts +30 -2
- package/src/agent/tools/channel-send.ts +19 -2
- package/src/agent/tools/spawn-subagent.ts +37 -1
- package/src/bundled-plugins/github-cli-auth/gh-command.ts +7 -1
- package/src/bundled-plugins/github-cli-auth/index.ts +2 -1
- package/src/bundled-plugins/github-cli-auth/review-checkout.ts +9 -1
- package/src/bundled-plugins/memory/dreaming.ts +21 -6
- package/src/channels/adapters/github/inbound.ts +195 -25
- package/src/channels/adapters/github/index.ts +16 -18
- package/src/channels/adapters/github/reconcile-cooldown-store.ts +15 -1
- package/src/channels/adapters/github/recover-failed-deliveries.ts +7 -2
- package/src/channels/adapters/github/review-submitter.ts +28 -0
- package/src/channels/adapters/kakaotalk-channel-resolver.ts +86 -16
- package/src/channels/adapters/kakaotalk.ts +7 -8
- package/src/channels/adapters/teams-classify.ts +21 -0
- package/src/channels/adapters/teams-edit.ts +2 -1
- package/src/channels/adapters/teams-format.ts +16 -0
- package/src/channels/adapters/teams.ts +12 -5
- package/src/channels/github-repo.ts +11 -0
- package/src/channels/github-review-verdict-coordinator.ts +179 -29
- package/src/channels/github-verdict-activity.ts +10 -6
- package/src/channels/manager.ts +9 -0
- package/src/channels/persistence.ts +28 -2
- package/src/channels/router.ts +284 -61
- package/src/channels/schema.ts +18 -0
- package/src/channels/types.ts +1 -0
- package/src/cli/compose.ts +3 -3
- package/src/cli/docker-preflight.ts +8 -4
- package/src/cli/restart.ts +89 -23
- package/src/cli/start.ts +68 -16
- package/src/cli/status.ts +38 -6
- package/src/cli/stop.ts +5 -2
- package/src/compose/stop.ts +5 -4
- package/src/config/config.ts +9 -1
- package/src/container/build-cache.ts +807 -0
- package/src/container/compose-project.ts +4 -0
- package/src/container/docker-app.ts +74 -0
- package/src/container/log-archive.ts +33 -5
- package/src/container/memory-limit.ts +80 -0
- package/src/container/memory-oversubscription.ts +125 -0
- package/src/container/restart.ts +6 -1
- package/src/container/shared.ts +43 -16
- package/src/container/start.ts +313 -77
- package/src/container/stop.ts +19 -13
- package/src/container/verify-running.ts +12 -0
- package/src/cron/scheduler.ts +12 -4
- package/src/doctor/apparmor.ts +101 -0
- package/src/doctor/bounded-exec.ts +14 -0
- package/src/doctor/checks.ts +42 -15
- package/src/doctor/index.ts +14 -2
- package/src/doctor/plugin-bridge.ts +15 -3
- package/src/hostd/paths.ts +4 -0
- package/src/init/dockerfile.ts +7 -6
- package/src/init/windows-dev-link.ts +34 -2
- package/src/run/index.ts +17 -0
- package/src/run/resource-sample.ts +171 -0
- package/src/sandbox/availability.ts +7 -5
- package/src/sandbox/index.ts +8 -1
- package/src/sandbox/session-tmp.ts +26 -1
- package/src/skills/typeclaw-channel-github/SKILL.md +4 -2
- package/typeclaw.schema.json +7 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { readdirSync, readFileSync, statfsSync } from 'node:fs'
|
|
2
|
+
|
|
3
|
+
const BYTES_PER_MB = 1024 * 1024
|
|
4
|
+
|
|
5
|
+
export type ResourceSample = {
|
|
6
|
+
rssBytes: number
|
|
7
|
+
shmUsedBytes: number | null
|
|
8
|
+
shmTotalBytes: number | null
|
|
9
|
+
detachedProcesses: number | null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Processes reparented to PID 1 inside the container: anything the agent
|
|
13
|
+
// detached on purpose (a tmux server, a background dev server) plus anything
|
|
14
|
+
// left behind by a call that died. This count is the cheapest signal that
|
|
15
|
+
// something is accumulating across a container's life, and unlike
|
|
16
|
+
// /proc/<pid>/environ it is readable regardless of the per-tool sandbox's child
|
|
17
|
+
// user namespace — /proc/<pid>/stat is world-readable, environ is not.
|
|
18
|
+
export function countDetachedProcesses(procRoot = '/proc', selfPid = process.pid): number | null {
|
|
19
|
+
let entries: string[]
|
|
20
|
+
try {
|
|
21
|
+
entries = readdirSync(procRoot)
|
|
22
|
+
} catch {
|
|
23
|
+
return null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let count = 0
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
if (!/^\d+$/.test(entry)) continue
|
|
29
|
+
const pid = Number(entry)
|
|
30
|
+
// PID 1 is the init shim itself, never its own orphan.
|
|
31
|
+
if (pid === 1) continue
|
|
32
|
+
// The agent runtime is itself a child of the init shim: the container runs
|
|
33
|
+
// with `--init` and the entrypoint execs Bun, so the agent normally sits at
|
|
34
|
+
// PID 2 with PPID 1. Counting it would give every clean container a
|
|
35
|
+
// permanent floor of 1 and bury the first real orphan in the noise.
|
|
36
|
+
if (pid === selfPid) continue
|
|
37
|
+
let raw: string
|
|
38
|
+
try {
|
|
39
|
+
raw = readFileSync(`${procRoot}/${entry}/stat`, 'utf8')
|
|
40
|
+
} catch {
|
|
41
|
+
// The process exited between readdir and read. Normal, not an error.
|
|
42
|
+
continue
|
|
43
|
+
}
|
|
44
|
+
if (parsePpidFromStat(raw) === 1) count++
|
|
45
|
+
}
|
|
46
|
+
return count
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// `/proc/<pid>/stat` is `pid (comm) state ppid ...`, and `comm` is the raw
|
|
50
|
+
// executable name — it can contain spaces AND parentheses, so neither a plain
|
|
51
|
+
// whitespace split nor a search for the FIRST ')' is correct. The kernel's own
|
|
52
|
+
// documented parse is to seek the LAST ')' and read fields after it, which is
|
|
53
|
+
// what this does: field 0 is state, field 1 is ppid.
|
|
54
|
+
export function parsePpidFromStat(raw: string): number | null {
|
|
55
|
+
const close = raw.lastIndexOf(')')
|
|
56
|
+
if (close < 0) return null
|
|
57
|
+
const fields = raw
|
|
58
|
+
.slice(close + 1)
|
|
59
|
+
.trim()
|
|
60
|
+
.split(/\s+/)
|
|
61
|
+
const ppid = Number(fields[1])
|
|
62
|
+
return Number.isInteger(ppid) && ppid >= 0 ? ppid : null
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function readShmUsage(path = '/dev/shm'): { usedBytes: number; totalBytes: number } | null {
|
|
66
|
+
try {
|
|
67
|
+
const fs = statfsSync(path)
|
|
68
|
+
const totalBytes = fs.blocks * fs.bsize
|
|
69
|
+
const usedBytes = (fs.blocks - fs.bfree) * fs.bsize
|
|
70
|
+
return { usedBytes, totalBytes }
|
|
71
|
+
} catch {
|
|
72
|
+
return null
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function collectResourceSample(
|
|
77
|
+
options: { procRoot?: string; shmPath?: string; selfPid?: number } = {},
|
|
78
|
+
): ResourceSample {
|
|
79
|
+
const shm = readShmUsage(options.shmPath)
|
|
80
|
+
return {
|
|
81
|
+
rssBytes: process.memoryUsage().rss,
|
|
82
|
+
shmUsedBytes: shm?.usedBytes ?? null,
|
|
83
|
+
shmTotalBytes: shm?.totalBytes ?? null,
|
|
84
|
+
detachedProcesses: countDetachedProcesses(options.procRoot, options.selfPid),
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function formatResourceSample(sample: ResourceSample): string {
|
|
89
|
+
const mb = (bytes: number | null): string => (bytes === null ? '?' : String(Math.round(bytes / BYTES_PER_MB)))
|
|
90
|
+
return [
|
|
91
|
+
`rss_mb=${mb(sample.rssBytes)}`,
|
|
92
|
+
`shm_used_mb=${mb(sample.shmUsedBytes)}`,
|
|
93
|
+
`shm_total_mb=${mb(sample.shmTotalBytes)}`,
|
|
94
|
+
`detached_procs=${sample.detachedProcesses ?? '?'}`,
|
|
95
|
+
].join(' ')
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type SampleWatermark = {
|
|
99
|
+
rssBytes: number
|
|
100
|
+
shmUsedBytes: number
|
|
101
|
+
detachedProcesses: number
|
|
102
|
+
emittedAt: number
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Emit on growth, not on a clock.
|
|
106
|
+
//
|
|
107
|
+
// A steady heartbeat drowns the signal in identical lines and still misses the
|
|
108
|
+
// moment a number moved, while emitting every sample makes a 14-day log mostly
|
|
109
|
+
// noise. A leak is precisely a sequence of new high-water marks, so emitting
|
|
110
|
+
// only when one is set — with a margin so ordinary churn stays quiet — turns the
|
|
111
|
+
// log into the growth curve an OOM post-mortem actually needs. The periodic
|
|
112
|
+
// floor keeps a flat container from going completely silent, which is itself
|
|
113
|
+
// evidence.
|
|
114
|
+
export const RSS_GROWTH_MARGIN_BYTES = 128 * BYTES_PER_MB
|
|
115
|
+
export const SHM_GROWTH_MARGIN_BYTES = 64 * BYTES_PER_MB
|
|
116
|
+
export const HEARTBEAT_MS = 30 * 60 * 1000
|
|
117
|
+
|
|
118
|
+
export function shouldEmitSample(previous: SampleWatermark | null, sample: ResourceSample, now: number): boolean {
|
|
119
|
+
if (previous === null) return true
|
|
120
|
+
if (now - previous.emittedAt >= HEARTBEAT_MS) return true
|
|
121
|
+
if (sample.rssBytes >= previous.rssBytes + RSS_GROWTH_MARGIN_BYTES) return true
|
|
122
|
+
if ((sample.shmUsedBytes ?? 0) >= previous.shmUsedBytes + SHM_GROWTH_MARGIN_BYTES) return true
|
|
123
|
+
if ((sample.detachedProcesses ?? 0) > previous.detachedProcesses) return true
|
|
124
|
+
return false
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function nextWatermark(previous: SampleWatermark | null, sample: ResourceSample, now: number): SampleWatermark {
|
|
128
|
+
return {
|
|
129
|
+
rssBytes: Math.max(previous?.rssBytes ?? 0, sample.rssBytes),
|
|
130
|
+
shmUsedBytes: Math.max(previous?.shmUsedBytes ?? 0, sample.shmUsedBytes ?? 0),
|
|
131
|
+
detachedProcesses: Math.max(previous?.detachedProcesses ?? 0, sample.detachedProcesses ?? 0),
|
|
132
|
+
emittedAt: now,
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export const SAMPLE_INTERVAL_MS = 60_000
|
|
137
|
+
|
|
138
|
+
export type ResourceSamplerOptions = {
|
|
139
|
+
intervalMs?: number
|
|
140
|
+
collect?: () => ResourceSample
|
|
141
|
+
emit?: (line: string) => void
|
|
142
|
+
now?: () => number
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Returns a stop function rather than running forever so the caller owns the
|
|
146
|
+
// lifetime. `unref` keeps a container that is otherwise done from being held
|
|
147
|
+
// open by the sampler alone.
|
|
148
|
+
export function startResourceSampler(options: ResourceSamplerOptions = {}): () => void {
|
|
149
|
+
const intervalMs = options.intervalMs ?? SAMPLE_INTERVAL_MS
|
|
150
|
+
const collect = options.collect ?? (() => collectResourceSample())
|
|
151
|
+
const emit = options.emit ?? ((line: string) => console.info(line))
|
|
152
|
+
const now = options.now ?? (() => Date.now())
|
|
153
|
+
|
|
154
|
+
let watermark: SampleWatermark | null = null
|
|
155
|
+
const tick = (): void => {
|
|
156
|
+
try {
|
|
157
|
+
const sample = collect()
|
|
158
|
+
const at = now()
|
|
159
|
+
if (!shouldEmitSample(watermark, sample, at)) return
|
|
160
|
+
watermark = nextWatermark(watermark, sample, at)
|
|
161
|
+
emit(`[resource-sample] ${formatResourceSample(sample)}`)
|
|
162
|
+
} catch (err) {
|
|
163
|
+
// A sampler must never be able to take the agent down.
|
|
164
|
+
emit(`[resource-sample] failed: ${err instanceof Error ? err.message : String(err)}`)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const timer = setInterval(tick, intervalMs)
|
|
169
|
+
timer.unref?.()
|
|
170
|
+
return () => clearInterval(timer)
|
|
171
|
+
}
|
|
@@ -64,11 +64,13 @@ export function _resetBwrapAvailabilityCacheForTests(): void {
|
|
|
64
64
|
// --mount --mount-proc`, which mounts a fresh procfs in a new PID namespace.
|
|
65
65
|
// That mount needs REAL CAP_SYS_ADMIN. `typeclaw start` grants the container
|
|
66
66
|
// `--cap-add=SYS_ADMIN` when sandbox.realProc is on, but the grant is a no-op
|
|
67
|
-
// on runtimes that virtualize or strip caps:
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
67
|
+
// on runtimes that virtualize or strip caps: the production entrypoint's
|
|
68
|
+
// non-root UID (empty cap set), rootless Docker (userns-capped caps),
|
|
69
|
+
// gVisor/runsc (caps never reach the host kernel), and Docker Desktop Enhanced
|
|
70
|
+
// Container Isolation (intercepts mount). AppArmor hosts need the configured
|
|
71
|
+
// host-loaded profile before bwrap reaches this strategy probe; selecting
|
|
72
|
+
// apparmor=unconfined alone is insufficient on stock Ubuntu 23.10+. On
|
|
73
|
+
// unsupported runtimes `unshare` fails fast with "Operation not permitted"
|
|
72
74
|
// before bwrap runs. Probing once at the first sandboxed bash call lets the
|
|
73
75
|
// consumer fall back to the '--tmpfs /proc' strategy instead of failing every
|
|
74
76
|
// low-trust bash call — restoring the pre-realProc behavior on unsupported
|
package/src/sandbox/index.ts
CHANGED
|
@@ -46,7 +46,14 @@ export {
|
|
|
46
46
|
verifyPrivilegedSandboxRuntime,
|
|
47
47
|
type PrivilegedSandboxRuntime,
|
|
48
48
|
} from './privileged-runtime'
|
|
49
|
-
export {
|
|
49
|
+
export {
|
|
50
|
+
ensureSessionTmpDir,
|
|
51
|
+
isUnderTmp,
|
|
52
|
+
mapVirtualTmpPath,
|
|
53
|
+
SESSION_TMP_ROOT,
|
|
54
|
+
enterSubagentTmpScope,
|
|
55
|
+
sessionTmpDir,
|
|
56
|
+
} from './session-tmp'
|
|
50
57
|
export {
|
|
51
58
|
DEPENDENCY_BIN_SANDBOX_DIR,
|
|
52
59
|
DEPENDENCY_BIN_SANDBOX_PATH,
|
|
@@ -15,8 +15,33 @@ const { isAbsolute, join, relative, resolve } = posix
|
|
|
15
15
|
// anything into the project surface.
|
|
16
16
|
export const SESSION_TMP_ROOT = '/tmp/typeclaw-session'
|
|
17
17
|
|
|
18
|
+
// A subagent tree shares one scratch dir: its top-level subagent's. Runtime-
|
|
19
|
+
// owned scratch (a reviewer checkout) is handed to child subagents by `/tmp`
|
|
20
|
+
// path, and a child with its own `/tmp` cannot resolve it. The scope is anchored
|
|
21
|
+
// BELOW the spawning channel/TUI/cron session on purpose: that session persists
|
|
22
|
+
// across turns and speakers, so subagent artifacts must never land in its
|
|
23
|
+
// scratch. Unrelated sessions stay isolated. Each entry is resolved to its
|
|
24
|
+
// anchor at registration, so releasing an intermediate parent never re-routes a
|
|
25
|
+
// still-running grandchild.
|
|
26
|
+
const subagentTmpScopes = new Map<string, { scope: string; refs: number }>()
|
|
27
|
+
|
|
18
28
|
export function sessionTmpDir(sessionId: string): string {
|
|
19
|
-
return join(SESSION_TMP_ROOT, sessionId)
|
|
29
|
+
return join(SESSION_TMP_ROOT, subagentTmpScopes.get(sessionId)?.scope ?? sessionId)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function enterSubagentTmpScope(sessionId: string, parentSessionId: string): () => void {
|
|
33
|
+
const existing = subagentTmpScopes.get(sessionId)
|
|
34
|
+
const scope = existing?.scope ?? subagentTmpScopes.get(parentSessionId)?.scope ?? sessionId
|
|
35
|
+
subagentTmpScopes.set(sessionId, { scope, refs: (existing?.refs ?? 0) + 1 })
|
|
36
|
+
let released = false
|
|
37
|
+
return () => {
|
|
38
|
+
if (released) return
|
|
39
|
+
released = true
|
|
40
|
+
const entry = subagentTmpScopes.get(sessionId)
|
|
41
|
+
if (entry === undefined) return
|
|
42
|
+
if (entry.refs <= 1) subagentTmpScopes.delete(sessionId)
|
|
43
|
+
else entry.refs -= 1
|
|
44
|
+
}
|
|
20
45
|
}
|
|
21
46
|
|
|
22
47
|
export async function ensureSessionTmpDir(sessionId: string): Promise<string> {
|
|
@@ -117,7 +117,7 @@ The `reviewer` subagent is the analyst; you are the integration layer between it
|
|
|
117
117
|
|
|
118
118
|
**The reviewer's `<review>` block is the only source of the verdict and the findings.** You do not review the PR yourself. Between spawning the reviewer and reading its result you do **no analysis of this PR** — do not run `gh pr diff`, do not read the changed files to form an opinion, do not draft a verdict. The reviewer runs on the `deep` model precisely so this judgment is not yours to make on the parent model. If you analyze the diff and post your own assessment while the reviewer is still running, you will post one verdict now and the reviewer's (often different) verdict when it completes — **two contradictory reviews on the same PR**, the exact failure this flow exists to prevent. Wait for the reviewer; post what it returns; nothing before that.
|
|
119
119
|
|
|
120
|
-
**Reply-triggered re-review carrier rule.** Obey the session-origin carrier status before delegating. If you are not the carrier, do not spawn a reviewer or publish findings anywhere;
|
|
120
|
+
**Reply-triggered re-review carrier rule.** Obey the session-origin carrier status before delegating. If you are not the carrier, do not spawn a reviewer or publish findings anywhere; stay silent with `skip_response` while waiting, then close out only your own thread once the carrier's verdict lands. A "waiting for the verdict" status comment is process narration, not useful review feedback.
|
|
121
121
|
|
|
122
122
|
**HARD RULE — a review with actionable findings is a formal review, never a flat comment.** If the reviewer returns **one or more** actionable findings (`blocker`/`concern`/`nit`), the ONLY acceptable way to deliver them is a formal review via `POST /pulls/<N>/reviews` (step 4) — `REQUEST_CHANGES`, `COMMENT`, or `APPROVE` per the verdict, with the line-anchored findings in `comments[]`. You may **never** flatten those findings into a `channel_reply` or a top-level issue comment, **even when** the `gh api` call fails. A 422 means an anchor is wrong (almost always a `line` not in the diff): re-anchor it or move that one finding into the top-level review `body`, then resubmit the formal review — do **not** abandon the formal review and post prose instead. A flat "## Review … two blockers" comment is a bug, not a fallback: it strands the findings without line anchors and is the exact failure this rule exists to prevent. The flat/issue-comment path is reserved for the **zero-actionable-findings** branch only (see below). **Narrow exception:** when `post_github_review` finds that this bot's identical `CHANGES_REQUESTED` verdict is already effective, the tool itself converts the redundant submission into one substantive root PR comment while the existing formal block remains authoritative. This is a successful tool-managed fallback, not permission to replace a failed or invalid formal review manually. **That conversion fires at most once per pull request per head.** If another session already landed it — a sibling thread session of the same PR is the usual case — your call is denied outright instead, and the denial says the prior verdict is still live. That denial is final: the findings for this head have already been published by the sibling, so **stand down and close out only your own thread**. Do not re-post them as a `channel_reply`, a top-level comment, or a reply in your thread; the HARD RULE above applies with full force to this case. If you genuinely cannot land a formal review after fixing anchors, say so plainly and post nothing that claims a review happened — silence beats a false receipt.
|
|
123
123
|
|
|
@@ -189,7 +189,7 @@ The `reviewer` subagent is the analyst; you are the integration layer between it
|
|
|
189
189
|
|
|
190
190
|
**Operator approval policy.** If the inbound carries a note that PR approval is disabled (`channels.github.review.approve: false` — the adapter appends "Operator policy: PR approval is disabled for this agent" to the message), you must **not** submit an `APPROVE`. Map an `approve` verdict to `COMMENT` instead: post the same `<summary>` and all inline `comments[]` as a `COMMENT` review, just without the formal approval. `request-changes` and `comment` verdicts are unaffected (they never approve). Absent that note, approval is enabled and the table above applies unchanged.
|
|
191
191
|
|
|
192
|
-
**Re-review.** On a reply-triggered re-review round, obey the session-origin carrier status. If you are **not** the carrier, do not spawn a reviewer
|
|
192
|
+
**Re-review.** On a reply-triggered re-review round, obey the session-origin carrier status. If you are **not** the carrier, do not spawn a reviewer or publish findings anywhere; stay silent with `skip_response` while waiting, then close out only your own thread in one participant-facing message once the carrier's verdict lands. Never narrate the carrier, round, session, verdict registration, or sticky state into the PR. If step 1 established this is a re-review (an unresolved blocking obligation of yours — a formal `CHANGES_REQUESTED` **or** an unretracted flat-comment blocker), the result MUST clear or re-assert that block. The only top-level-comment exception is the tool-managed duplicate fallback described above: the existing identical `CHANGES_REQUESTED` already re-asserts the formal block, so the new summary/findings may be added as one root comment without posting another blocking review — once per head. If a sibling session already landed that comment, your attempt is denied and the block stands re-asserted by both the formal review and the sibling's comment; discharge your obligation by closing out your own thread, not by publishing again. The clearing mechanics depend on which form the prior block took:
|
|
193
193
|
- **Prior block was a formal `CHANGES_REQUESTED`.** It is sticky: **only** a fresh `APPROVE` from you, or a dismissal of your prior review, clears it. A plain issue comment does **not** clear it, and — critically — **neither does a `COMMENT` review.**
|
|
194
194
|
- **Prior block was a flat comment** (no formal `CHANGES_REQUESTED` exists). There is no sticky GitHub state to clear, but the obligation is still yours to discharge as a **formal** review so the verdict finally lands as review state: submit `APPROVE` (resolved, approval enabled) or `REQUEST_CHANGES` (not resolved). Do not discharge a flat-comment block with another flat comment — that re-strands the verdict, the original bug.
|
|
195
195
|
|
|
@@ -242,6 +242,8 @@ The bundled `agent-browser` is **not** for PR reviews — `gh api` is faster and
|
|
|
242
242
|
|
|
243
243
|
A review you posted leaves inline comment threads open on the PR. When one of **your** threads is addressed — the author pushed a fix, or replied that they handled it — close it out by **resolving the thread**. Leaving it open after the concern is settled reads as if you never noticed; a resolved thread is the signal that the loop is closed.
|
|
244
244
|
|
|
245
|
+
**No process narration.** A PR participant needs the technical outcome, not your coordination machinery. While another carrier is working, stay silent with `skip_response`; do not post that you are waiting or will clean up later. Once actionable, use one participant-facing message: acknowledge and resolve if addressed, or state the specific technical reason it remains open.
|
|
246
|
+
|
|
245
247
|
**The base principle: whoever opened the thread closes it.** Resolve only threads whose root comment **you** authored. Never resolve a human reviewer's thread on your behalf — that erases their open question. The thread you can resolve is the one you started; the inbound that brings you here is a **review-thread reply on `pr:N` with `thread` set**, replying inside a thread you opened.
|
|
246
248
|
|
|
247
249
|
> **Thread cleanup is not the same as discharging a PR-level block.** Resolving an inline thread closes that one thread; it carries **no** review state and does **not** clear a PR-level blocking obligation (a sticky `CHANGES_REQUESTED`, or a flat blocker you authored on the PR conversation). Those are two separate duties. If triage #1 found a live PR-level block, that inbound is a **re-review** and the PR review flow wins over this section — you owe a formal `APPROVE`/`REQUEST_CHANGES`, and resolving threads (or a chat ✅) must **not** be your final response. Reach this section only for a thread-scoped reply on a PR where you owe no PR-level verdict (triage #1 came back clean). When in doubt, re-run triage #1 first.
|
package/typeclaw.schema.json
CHANGED
|
@@ -1020,6 +1020,7 @@
|
|
|
1020
1020
|
"discussion_comment.created",
|
|
1021
1021
|
"issues.opened",
|
|
1022
1022
|
"pull_request.opened",
|
|
1023
|
+
"pull_request.converted_to_draft",
|
|
1023
1024
|
"pull_request.ready_for_review",
|
|
1024
1025
|
"pull_request.review_requested",
|
|
1025
1026
|
"pull_request.review_request_removed",
|
|
@@ -2567,12 +2568,18 @@
|
|
|
2567
2568
|
},
|
|
2568
2569
|
"sandbox": {
|
|
2569
2570
|
"default": {
|
|
2571
|
+
"apparmorProfile": "unconfined",
|
|
2570
2572
|
"realProc": false,
|
|
2571
2573
|
"writablePaths": [],
|
|
2572
2574
|
"symlinks": []
|
|
2573
2575
|
},
|
|
2574
2576
|
"type": "object",
|
|
2575
2577
|
"properties": {
|
|
2578
|
+
"apparmorProfile": {
|
|
2579
|
+
"default": "unconfined",
|
|
2580
|
+
"type": "string",
|
|
2581
|
+
"pattern": "^[A-Za-z0-9_.-]+$"
|
|
2582
|
+
},
|
|
2576
2583
|
"realProc": {
|
|
2577
2584
|
"default": false,
|
|
2578
2585
|
"type": "boolean"
|