@kenkaiiii/ggcoder 5.44.3 → 5.46.0

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.
Files changed (56) hide show
  1. package/README.md +3 -1
  2. package/assets/skills/durable/SKILL.md +111 -0
  3. package/assets/skills/durable/references/backups-and-runtime.md +86 -0
  4. package/assets/skills/durable/references/migrations-and-schema.md +79 -0
  5. package/assets/skills/lean/SKILL.md +110 -0
  6. package/assets/skills/lean/references/memory-and-processes.md +97 -0
  7. package/assets/skills/lean/references/playbooks.md +107 -0
  8. package/dist/core/agent-session-verification-gate.test.d.ts +2 -0
  9. package/dist/core/agent-session-verification-gate.test.d.ts.map +1 -0
  10. package/dist/core/agent-session-verification-gate.test.js +135 -0
  11. package/dist/core/agent-session-verification-gate.test.js.map +1 -0
  12. package/dist/core/agent-session.d.ts +2 -0
  13. package/dist/core/agent-session.d.ts.map +1 -1
  14. package/dist/core/agent-session.js +41 -0
  15. package/dist/core/agent-session.js.map +1 -1
  16. package/dist/core/process-manager-wake.test.d.ts +2 -0
  17. package/dist/core/process-manager-wake.test.d.ts.map +1 -0
  18. package/dist/core/process-manager-wake.test.js +96 -0
  19. package/dist/core/process-manager-wake.test.js.map +1 -0
  20. package/dist/core/process-manager.d.ts +39 -1
  21. package/dist/core/process-manager.d.ts.map +1 -1
  22. package/dist/core/process-manager.js +146 -2
  23. package/dist/core/process-manager.js.map +1 -1
  24. package/dist/core/settings-manager.d.ts +1 -0
  25. package/dist/core/settings-manager.d.ts.map +1 -1
  26. package/dist/core/settings-manager.js +5 -0
  27. package/dist/core/settings-manager.js.map +1 -1
  28. package/dist/core/skills.js +1 -1
  29. package/dist/core/skills.js.map +1 -1
  30. package/dist/core/verification-gate.d.ts +55 -0
  31. package/dist/core/verification-gate.d.ts.map +1 -0
  32. package/dist/core/verification-gate.js +188 -0
  33. package/dist/core/verification-gate.js.map +1 -0
  34. package/dist/core/verification-gate.test.d.ts +2 -0
  35. package/dist/core/verification-gate.test.d.ts.map +1 -0
  36. package/dist/core/verification-gate.test.js +102 -0
  37. package/dist/core/verification-gate.test.js.map +1 -0
  38. package/dist/tools/bash.d.ts +4 -0
  39. package/dist/tools/bash.d.ts.map +1 -1
  40. package/dist/tools/bash.js +57 -3
  41. package/dist/tools/bash.js.map +1 -1
  42. package/dist/tools/bash.test.js +37 -0
  43. package/dist/tools/bash.test.js.map +1 -1
  44. package/dist/tools/read-only-bash.d.ts +6 -0
  45. package/dist/tools/read-only-bash.d.ts.map +1 -1
  46. package/dist/tools/read-only-bash.js +168 -9
  47. package/dist/tools/read-only-bash.js.map +1 -1
  48. package/dist/tools/read-only-bash.test.js +49 -0
  49. package/dist/tools/read-only-bash.test.js.map +1 -1
  50. package/dist/tools/skill.js +1 -0
  51. package/dist/tools/skill.js.map +1 -1
  52. package/dist/ui/App.d.ts +3 -0
  53. package/dist/ui/App.d.ts.map +1 -1
  54. package/dist/ui/App.js +35 -1
  55. package/dist/ui/App.js.map +1 -1
  56. package/package.json +4 -4
@@ -0,0 +1,107 @@
1
+ # Lean — per-stack playbooks
2
+
3
+ Load only the sections the profile triggered. Commands assume a POSIX shell unless noted. Claims sourced on the snapshot date (17 August 2026) carry `SNAPSHOT`; tool versions and thresholds decay — re-verify with web access before asserting as current.
4
+
5
+ ## Web frontend
6
+
7
+ **Targets (official web.dev stable thresholds, measured at p75, mobile and desktop split):**
8
+
9
+ | Metric | Good | Needs improvement | Poor |
10
+ |---|---|---|---|
11
+ | LCP (Largest Contentful Paint) | ≤ 2.5s | ≤ 4.0s | > 4.0s |
12
+ | INP (Interaction to Next Paint) | ≤ 200ms | ≤ 500ms | > 500ms |
13
+ | CLS (Cumulative Layout Shift) | ≤ 0.1 | ≤ 0.25 | > 0.25 |
14
+
15
+ SEO blogs circulate claims of a March 2026 tightening of LCP to 2.0s (`SNAPSHOT` — could not be confirmed on web.dev at snapshot time). Treat 2.0s as an aspiration, not a threshold; verify before quoting either number to a user.
16
+
17
+ **Measure:** Lighthouse (DevTools or `lighthouse https://x --output json` in CI), Chrome DevTools Performance tab for long tasks, Network waterfall for request chains, Coverage tab for shipped-but-unused JS/CSS, `web-vitals` npm package for RUM field data. Lighthouse CI or `size-limit` as the regression gate.
18
+
19
+ **Symptom → usual cause:**
20
+
21
+ | Symptom | Usual causes | Fixes |
22
+ |---|---|---|
23
+ | Slow LCP | Oversized hero image, render-blocking CSS/JS, slow TTFB, web-font swap | AVIF/WebP + `srcset`, explicit dimensions, `fetchpriority="high"` on the LCP image, preload the font + `font-display: swap` (subset it), inline critical CSS / defer the rest, fix server TTFB first if > ~400–600ms — no frontend work survives that |
24
+ | Poor INP | Long tasks (>50ms) on the main thread, expensive handlers, layout thrash, hydration weight | Split long tasks (`scheduler.yield()` where available, else task chunking), debounce expensive input handlers, batch DOM reads before writes, animate only `transform`/`opacity`, move heavy compute to a web worker, ship less JS |
25
+ | High CLS | Images/embeds without dimensions, late banners pushing content, font swap | Width/height or `aspect-ratio` on all media, reserve ad/banner slots (`min-height`), `content-visibility` for below-fold, avoid injecting above existing content |
26
+ | Slow nav | Waterfall fetches, client-side everything, no prefetch | Parallelize with `Promise.all`, prefetch likely-next routes, partial/staged rendering, keep-alive connections |
27
+
28
+ **Sweep list:** code splitting at routes (`React.lazy`/dynamic `import()`), tree-shaking blockers (side-effectful modules, CJS in the graph), image audit (format, dimensions, `loading="lazy"` + `decoding="async"` below fold), font count and subsetting, dependency weight (bundle analyzer: `source-map-explorer`, `rollup-plugin-visualizer`, `webpack-bundle-analyzer`), virtualized long lists, memoization only where the React DevTools Profiler showed a real re-render cost — memo-by-default is perf theater, context split instead of one giant provider, `passive: true` listeners for scroll/touch, debounced resize/search handlers, service worker caching where offline or repeat visits matter.
29
+
30
+ ## Node.js / backend / API
31
+
32
+ **Measure:** `autocannon` or `k6` for load (watch p99, not the average — the average lies), `clinic doctor` / `clinic flame` / `0x` for CPU and event-loop diagnosis, `--inspect` + Chrome DevTools for heap. DB: slow-query log, `EXPLAIN ANALYZE`.
33
+
34
+ **Sweep list:**
35
+
36
+ - **Event-loop blocking:** sync fs/crypto/zlib in request handlers, `JSON.parse` of huge payloads on the hot path, regex backtracking. Move to workers or streams.
37
+ - **N+1 queries:** one join/include/dataloader instead of a loop of queries. The most common backend bottleneck, by far.
38
+ - **Missing indexes:** every frequent filter/sort column; verify with `EXPLAIN ANALYZE` that the plan uses them.
39
+ - **Unpaginated reads:** `SELECT *` on growing tables, `findMany()` without `take`. Cursor pagination for stable ordering.
40
+ - **Connection pools:** sized for the DB's real limit; check for pool exhaustion under load (requests queueing on a connection).
41
+ - **Caching with bounds:** TTL or LRU on expensive derivations; invalidate on write. Cache stampede guard (lock or stale-while-revalidate) when a hot key expires.
42
+ - **Payload:** gzip/brotli on responses, HTTP/2+ or keep-alive, avoid re-serializing the same object per request.
43
+ - **Memory ceiling:** `--max-old-space-size` matched to the container limit so GC pressure shows up as errors you chose, not an OOM kill at a random allocation.
44
+ - **Retries:** capped, with backoff and jitter; unbounded retry loops are a self-inflicted outage plus a memory leak (each attempt holds state).
45
+
46
+ ## Electron
47
+
48
+ Official maintainer guidance (electronjs.org performance tutorial, `SNAPSHOT`): profile, then fix the most resource-hungry thing; repeat. VS Code and Slack got fast exactly this way.
49
+
50
+ **Sweep list:**
51
+
52
+ - **Lazy `require`:** Node modules loaded at startup cost startup forever. Require at first use for heavy/rare paths; defer expensive setup with idle-time initialization.
53
+ - **Price modules before adopting:** `node --cpu-prof --heap-prof -e "require('mod')"` — the canonical example is a "simple" connectivity checker that parsed a 100k-line JSON port list at load. Server-oriented modules are often wrong for desktop.
54
+ - **Never block the main process:** UI jank and dead IPC come from main-process busy work. CPU-heavy work goes to utility processes / worker threads; keep main for orchestration.
55
+ - **Bundle renderer code** (bundler or esbuild) instead of hundreds of module loads at window open.
56
+ - **Window hygiene:** lazy-create `BrowserWindow`s, destroy (not just hide) windows whose content is expensive and rarely revisited, `process.getProcessMemoryInfo()` per process to find which side eats.
57
+ - **Tray/menu/global-shortcut listeners** registered once, removed on app quit; background throttling is default — don't defeat it with busy polling (`powerSaveBlocker` only while genuinely needed).
58
+ - **Startup:** `Menu.setApplicationMenu(null)` when no menu is needed; splash/deferred window show to cut time-to-visible; V8 compile cache for large renderer bundles.
59
+ - Security config (`contextIsolation`, sandbox) is bulletproof's lane — but note sandboxing also shrinks renderer memory; do not weaken it for speed.
60
+
61
+ ## Tauri
62
+
63
+ **Sweep list:**
64
+
65
+ - **Release profile:** in `Cargo.toml` `[profile.release]` — `lto = true` (or `"thin"`), `codegen-units = 1`, `strip = true`; `panic = "abort"` if acceptable. `opt-level = "s"/"z"` trades speed for size — measure which you need.
66
+ - **IPC cost:** every `invoke` serializes with serde — don't shuttle large blobs or big JSON back and forth per keystroke; chunk, delta, or move the work to the Rust side. Watch for per-frame IPC from frontend animation/monitoring loops.
67
+ - **State:** `tauri::State` with `Mutex` held across `.await` serializes everything behind it; scope locks tightly.
68
+ - **Frontend** follows the web section exactly — the webview is a browser; bundle size and long tasks hit the same.
69
+ - **Assets:** embed vs. fetch per asset class; large binaries should not ship inside the binary if they can be fetched/unpacked on demand.
70
+ - **Plugins:** lazy-init heavy plugins; each one is startup cost on the Rust and JS side both.
71
+ - **Measure:** `cargo bloat` / `cargo tree -d` for binary weight and duplicate deps; standard Rust profilers (`perf`, Instruments, `cargo-flamegraph`) for hot paths.
72
+
73
+ ## Mobile
74
+
75
+ **Sweep list:** cold-start path (lazy screen registration, defer non-critical SDK init — analytics can wait), list virtualization (`FlatList`/`RecyclerView`/`LazyColumn` — never render 1000 rows), image assets per density via asset catalogs (not runtime-downscaled full images), main-thread discipline (decode/parse off the main thread), memory-warning handling that actually drops caches.
76
+
77
+ **Measure/leak tools:** Android — Android Studio Profiler, `LeakCanary` for lifecycle leaks, `dumpsys meminfo`; iOS — Instruments Allocations/Leaks, Xcode memory graph debugger. Responding to memory warnings by freeing caches is table stakes on both.
78
+
79
+ ## Native / compiled
80
+
81
+ - **Rust:** leaks are usually `Rc`/`Arc` cycles (switch one direction to `Weak`), `Box::leak`, unbounded channels, or tasks blocked forever holding state. Blocking calls inside async runtime threads stall the executor — use `spawn_blocking`. Measure: `cargo-flamegraph`, `heaptrack`, `pprof` crate. Children must be `wait()`ed — dropping a `Child` does not reap it (see `references/memory-and-processes.md`).
82
+ - **C/C++:** every `malloc`/`new`/`fopen` has an owner that frees/closes on all paths — RAII or scope guards, not discipline. Measure: valgrind memcheck/massif, AddressSanitizer/LeakSanitizer (`-fsanitize=address,leak`), `heaptrack`.
83
+ - **Go:** goroutine leaks — a goroutine blocked on a channel/ctx that never arrives holds everything it captured forever. `pprof` goroutine + heap profiles tell you both. Set `GOMEMLIMIT` in containers; tune `GOGC` only after measuring.
84
+ - **JVM:** bound the heap (`-Xmx`) to the container, watch for unbounded caches and listener registries; `jmap -histo`, async-profiler, JFR for allocation sites.
85
+ - **Games/hot loops:** frame budget is 16.6ms @60 (8.3ms @120) including everything. No per-frame allocation (object pools), no per-frame sync I/O, no GC spikes mid-frame; batch draws; time-slice background work.
86
+
87
+ ## Python
88
+
89
+ Generators/streams instead of list-building for large data; vectorize hot loops (NumPy/pandas — or Polars for large frames) instead of Python-level iteration; never block the asyncio event loop with sync I/O or CPU work (offload to processes); `functools.lru_cache` is bounded — `cached_property` and hand-rolled dict caches are not. Measure: `tracemalloc` for allocation deltas, `memory_profiler` line-level, `py-spy` for live flamegraphs without stopping the process. Watch for reference cycles keeping big objects alive when `gc` is disabled or timing-dependent.
90
+
91
+ ## Data & queries (any stack)
92
+
93
+ `EXPLAIN (ANALYZE)` the slow ones; indexes on frequent filters/sorts — but every index taxes writes, so measure both sides. Batch writes; avoid N single-row inserts inside a transaction per row. Cursor/keyset pagination over offset for deep pages. Slow-query log threshold low enough to catch regressions in CI-like environments. Cache expensive reads with explicit invalidation, not hope.
94
+
95
+ ## Payload & dead weight (all stacks)
96
+
97
+ `SNAPSHOT` (17 Aug 2026): **Knip** is the standard JS/TS dead-code finder — unused files, exports, dependencies, and devDependencies across monorepo workspaces; `depcheck` is the older alternative. CSS: PurgeCSS (or the framework's built-in pruning) against real markup — beware class names built dynamically, which purgers cannot see; guard with a safelist. Shipped-code audit: DevTools Coverage for what the browser actually ran.
98
+
99
+ **Sweep list:** `knip` in CI; duplicate dependencies (`pnpm why <pkg>`, `npm ls <pkg>`) — two versions of one library is double weight; "two of the same job" audit (two icon sets, two date libs, two CSS systems, a utility lib plus hand-rolled copies of its functions); polyfills for browsers no longer supported; debug/symbol payloads shipped in release (strip; source maps to a symbol server, not the bundle); largest-files audit (`du`, bundle analyzer) — the top ten files are usually the whole story; unused assets in repos (images, fonts nobody references).
100
+
101
+ ## Styling consistency (payload view)
102
+
103
+ The rule: **one way to express one visual decision.** Hunt repeated rule blocks that differ by one value, spacing/color literals that duplicate existing design tokens, the same component styled three ways, utility classes wrapped around handwritten CSS doing the same job, dead rules for removed components. Each duplication is bytes today and divergence tomorrow. Kill the copies, keep the token. If resolving it requires a design *decision* (which of three styles is right), that call belongs to evidence-led-ui — coordinate rather than decide unilaterally.
104
+
105
+ ---
106
+
107
+ **Provenance:** snapshot 17 August 2026. Sources: web.dev Web Vitals (stable LCP/INP/CLS thresholds), Electron official performance tutorial (module cost, lazy loading, main-process blocking, profiling guidance), Rust std `process::Child` docs (zombie reaping), Knip documentation and 2026 ecosystem coverage (dead-code standard claim — `SNAPSHOT`), Valgrind/LeakCanary/Instruments/pprof public docs for tool usage. Version-specific flags and thresholds decay fastest; re-verify before asserting.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=agent-session-verification-gate.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-session-verification-gate.test.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-verification-gate.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Session wiring for the verification gate: tool_call_end events must feed the
3
+ * gate (edits/writes on code files, foreground verification commands), and the
4
+ * pre-stop hook must block with the follow-up — once, then escalate, then go
5
+ * silent. Drives the private hook directly, like agent-session-process-gate.
6
+ */
7
+ import { afterEach, beforeEach, describe, expect, it } from "vitest";
8
+ import fs from "node:fs/promises";
9
+ import os from "node:os";
10
+ import path from "node:path";
11
+ import { useFakeHome } from "../test-support/fake-home.js";
12
+ import { ProcessManager } from "./process-manager.js";
13
+ let restoreHome;
14
+ let tmpHome;
15
+ let tmpProject;
16
+ let session;
17
+ const managers = [];
18
+ beforeEach(async () => {
19
+ tmpHome = await fs.mkdtemp(path.join(os.tmpdir(), "gg-verify-gate-home-"));
20
+ tmpProject = await fs.mkdtemp(path.join(os.tmpdir(), "gg-verify-gate-"));
21
+ restoreHome = useFakeHome(tmpHome);
22
+ await fs.mkdir(path.join(tmpHome, ".gg"), { recursive: true });
23
+ await fs.writeFile(path.join(tmpHome, ".gg", "auth.json"), JSON.stringify({
24
+ anthropic: {
25
+ accessToken: "test-token",
26
+ refreshToken: "test-refresh",
27
+ expiresAt: Date.now() + 3_600_000,
28
+ },
29
+ }), "utf-8");
30
+ });
31
+ afterEach(async () => {
32
+ for (const manager of managers.splice(0))
33
+ manager.shutdownAll();
34
+ await session?.dispose();
35
+ session = undefined;
36
+ restoreHome?.();
37
+ await fs.rm(tmpHome, { recursive: true, force: true });
38
+ await fs.rm(tmpProject, { recursive: true, force: true });
39
+ });
40
+ async function makeSession() {
41
+ const { AgentSession: Session } = await import("./agent-session.js");
42
+ session = new Session({
43
+ provider: "anthropic",
44
+ model: "claude-test",
45
+ cwd: tmpProject,
46
+ transient: true,
47
+ systemPrompt: "test",
48
+ // Default selfCorrectionHooks (true) — the gate belongs to that family.
49
+ });
50
+ await session.initialize();
51
+ return session;
52
+ }
53
+ let callSeq = 0;
54
+ async function simulateToolCall(internal, name, args, isError = false) {
55
+ const toolCallId = `call-${++callSeq}`;
56
+ await internal.trackHookEvent({
57
+ type: "tool_call_start",
58
+ toolCallId,
59
+ name,
60
+ args,
61
+ });
62
+ await internal.trackHookEvent({
63
+ type: "tool_call_end",
64
+ toolCallId,
65
+ result: "",
66
+ isError,
67
+ durationMs: 1,
68
+ });
69
+ }
70
+ describe("AgentSession verification gate", () => {
71
+ it("blocks with a follow-up when code was edited but never verified", async () => {
72
+ const internal = await makeSession();
73
+ await simulateToolCall(internal, "bash", { command: "ls" });
74
+ await simulateToolCall(internal, "edit", { file_path: "src/a.ts" });
75
+ await simulateToolCall(internal, "bash", { command: "cat src/a.ts" });
76
+ const followUp = internal.getHookFollowUpMessages();
77
+ expect(followUp).not.toBeNull();
78
+ expect(String(followUp[0].content)).toContain("src/a.ts");
79
+ expect(String(followUp[0].content)).toContain("Run the project's verification");
80
+ });
81
+ it("stops blocking once a verification command runs after the edit", async () => {
82
+ const internal = await makeSession();
83
+ await simulateToolCall(internal, "edit", { file_path: "src/a.ts" });
84
+ await simulateToolCall(internal, "bash", { command: "pnpm vitest run" });
85
+ expect(internal.verificationGate.isOwed()).toBe(false);
86
+ expect(internal.getHookFollowUpMessages()).toBeNull();
87
+ });
88
+ it("ignores edits to non-code files and background verification", async () => {
89
+ const internal = await makeSession();
90
+ await simulateToolCall(internal, "write", { file_path: "README.md" });
91
+ expect(internal.verificationGate.isOwed()).toBe(false);
92
+ await simulateToolCall(internal, "edit", { file_path: "src/a.ts" });
93
+ await simulateToolCall(internal, "bash", {
94
+ command: "npm test",
95
+ run_in_background: true,
96
+ });
97
+ expect(internal.verificationGate.isOwed()).toBe(true); // background ≠ verified
98
+ });
99
+ it("escalates once, then goes silent", async () => {
100
+ const internal = await makeSession();
101
+ await simulateToolCall(internal, "edit", { file_path: "src/a.ts" });
102
+ const demand = internal.getHookFollowUpMessages();
103
+ expect(String(demand[0].content)).not.toContain("unverified");
104
+ const escalation = internal.getHookFollowUpMessages();
105
+ expect(String(escalation[0].content)).toContain("unverified");
106
+ expect(internal.getHookFollowUpMessages()).toBeNull();
107
+ });
108
+ it("counts reading a finished background verification run as verification", async () => {
109
+ const internal = await makeSession();
110
+ const manager = new ProcessManager({ bgDir: path.join(tmpHome, "bg-verify") });
111
+ managers.push(manager);
112
+ internal.processManager = manager;
113
+ // A real short verification-shaped process; it exits non-zero (empty dir),
114
+ // which is fine — the agent SAW the result, that is what counts.
115
+ const started = await manager.start("npm test", tmpProject);
116
+ for (let i = 0; i < 100 && manager.list().find((p) => p.id === started.id)?.exitCode === null; i += 1) {
117
+ await new Promise((resolve) => setTimeout(resolve, 50));
118
+ }
119
+ await simulateToolCall(internal, "edit", { file_path: "src/a.ts" });
120
+ await simulateToolCall(internal, "bash", {
121
+ command: "npm test",
122
+ run_in_background: true,
123
+ });
124
+ expect(internal.verificationGate.isOwed()).toBe(true); // background ≠ verified
125
+ await simulateToolCall(internal, "task_output", { id: started.id });
126
+ expect(internal.verificationGate.isOwed()).toBe(false); // read of the finished run
127
+ });
128
+ it("is disabled by the verificationGateEnabled setting", async () => {
129
+ const internal = await makeSession();
130
+ await internal.settingsManager.set("verificationGateEnabled", false);
131
+ await simulateToolCall(internal, "edit", { file_path: "src/a.ts" });
132
+ expect(internal.getHookFollowUpMessages()).toBeNull();
133
+ });
134
+ });
135
+ //# sourceMappingURL=agent-session-verification-gate.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-session-verification-gate.test.js","sourceRoot":"","sources":["../../src/core/agent-session-verification-gate.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAetD,IAAI,WAAqC,CAAC;AAC1C,IAAI,OAAe,CAAC;AACpB,IAAI,UAAkB,CAAC;AACvB,IAAI,OAAiC,CAAC;AACtC,MA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,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAC;QACrC,MAAM,QAAQ,CAAC,eAAe,CAAC,GAAG,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAErE,MAAM,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;QACpE,MAAM,CAAC,QAAQ,CAAC,uBAAuB,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -226,6 +226,8 @@ export declare class AgentSession {
226
226
  private runStartedAt;
227
227
  /** Gate injections spent this run, capped by MAX_PROCESS_GATE_INJECTIONS. */
228
228
  private processGateInjected;
229
+ /** Verification gate: code edited this run, nothing proved it since. */
230
+ private readonly verificationGate;
229
231
  private compactionOccurred;
230
232
  private lastCompactionCompacted;
231
233
  private compactionRetryAfter;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session.d.ts","sourceRoot":"","sources":["../../src/core/agent-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EAEb,KAAK,aAAa,EAInB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,oBAAoB,EAGrB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAErB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAqC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAM9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,M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GAC1B,OAAO,CAAC,6BAA6B,CAAC;CA2B1C"}
@@ -43,6 +43,7 @@ import { evaluateLoopBreak, buildLoopBreakMessage, CycleDetector, ToolCallProgre
43
43
  import { buildRegroundingMessage } from "./regrounding.js";
44
44
  import { wrapSteeringText, buildNotificationSteeringText, STEERING_PREFIX } from "./steering.js";
45
45
  import { AgentNotificationQueue } from "./agent-notifications.js";
46
+ import { VerificationGate, isCodeFilePath, isVerificationCommand } from "./verification-gate.js";
46
47
  import { findUserSessionPrompt, getUserSessionPrompt } from "./session-preview.js";
47
48
  import { normalizeMessageImages } from "./message-images.js";
48
49
  import crypto from "node:crypto";
@@ -158,6 +159,8 @@ export class AgentSession {
158
159
  runStartedAt = 0;
159
160
  /** Gate injections spent this run, capped by MAX_PROCESS_GATE_INJECTIONS. */
160
161
  processGateInjected = 0;
162
+ /** Verification gate: code edited this run, nothing proved it since. */
163
+ verificationGate = new VerificationGate();
161
164
  compactionOccurred = false;
162
165
  lastCompactionCompacted = false;
163
166
  compactionRetryAfter = 0;
@@ -969,6 +972,7 @@ export class AgentSession {
969
972
  this.regroundingInjected = false;
970
973
  this.runStartedAt = Date.now();
971
974
  this.processGateInjected = 0;
975
+ this.verificationGate.reset();
972
976
  this.compactionOccurred = false;
973
977
  this.originalRequest = originalRequest;
974
978
  }
@@ -1007,6 +1011,31 @@ export class AgentSession {
1007
1011
  const removed = (diff.match(/^-[^-]/gm) ?? []).length;
1008
1012
  this.hookStats.changedLines += added + removed;
1009
1013
  }
1014
+ // Verification-gate bookkeeping: successful code mutations and completed
1015
+ // foreground verification commands, in occurrence order.
1016
+ if (!event.isError && args) {
1017
+ if ((name === "edit" || name === "write") &&
1018
+ isCodeFilePath(String(args.file_path ?? ""))) {
1019
+ this.verificationGate.recordMutation(String(args.file_path));
1020
+ }
1021
+ if (name === "bash" &&
1022
+ !args.run_in_background &&
1023
+ isVerificationCommand(String(args.command ?? ""))) {
1024
+ this.verificationGate.recordVerification();
1025
+ }
1026
+ // Reading the final output of an EXITED background verification run
1027
+ // counts: the process gate forces this read anyway, so without it the
1028
+ // gate would demand a redundant foreground re-run of tests the agent
1029
+ // already watched finish.
1030
+ if (name === "task_output") {
1031
+ const proc = this.processManager
1032
+ ?.list()
1033
+ .find((p) => p.id === args.id);
1034
+ if (proc && proc.exitCode !== null && isVerificationCommand(proc.command)) {
1035
+ this.verificationGate.recordVerification();
1036
+ }
1037
+ }
1038
+ }
1010
1039
  // Tool results are what push the run over the review gate, and they all
1011
1040
  // land before the model writes its candidate final answer — so this is
1012
1041
  // the point where arming still beats the draft's first token.
@@ -1263,6 +1292,18 @@ export class AgentSession {
1263
1292
  });
1264
1293
  return processFollowUp;
1265
1294
  }
1295
+ // Verification gate: code was edited but nothing verified since the last
1296
+ // edit. Above the Ideal review so checks RUN before the read-based review
1297
+ // starts; off for allow-listed sessions that cannot run commands at all.
1298
+ if (this.opts.selfCorrectionHooks !== false &&
1299
+ this.settingsManager.get("verificationGateEnabled") &&
1300
+ (!this.opts.allowedTools || this.opts.allowedTools.includes("bash"))) {
1301
+ const verificationFollowUp = this.verificationGate.followUp();
1302
+ if (verificationFollowUp) {
1303
+ log("INFO", "verification-gate", "Injecting verification follow-up", {});
1304
+ return verificationFollowUp;
1305
+ }
1306
+ }
1266
1307
  if (this.opts.selfCorrectionHooks === false || this.idealReviewSuppressed)
1267
1308
  return null;
1268
1309
  if (this.idealReviewPhase === "reviewing") {