Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Launch the e2e suite from a hook, only after the feature review approves

Jeromecfe0c4612419
diff --git a/.claude/agents/orchestrator.md b/.claude/agents/orchestrator.md
index 607aa991..f9391b50 100644
--- a/.claude/agents/orchestrator.md
+++ b/.claude/agents/orchestrator.md
@@ -499,9 +499,9 @@ Agent({
After feature-review passes, confirm the integrated feature RUNS before promotion / handoff. Two parts, both reported in the handoff:
- **Demo smoke** (when the diff changes UI under `src/components/`): dispatch the quality-reviewer with `MODE: feature-smoke` (foreground, `run_in_background: false`) to drive the feature's key user flows in demo mode via the Playwright MCP and report PASS/FAIL. Runs for any UI change; needs no Supabase.
-- **Supabase e2e** (conditional): if the diff changed `e2e/**` OR touches behavior the specs assert (`src/components/**` / `supabase/**`), run `Bash("E2E_SMOKE_SRC=<WORKTREE_BASE>/_session bash $CLAUDE_PROJECT_DIR/.claude/scripts/e2e-smoke.sh")`. `E2E_SMOKE_SRC` MUST point at the `_session` worktree (on `session/<SESSION_SHORT_ID>`, node_modules provisioned) so the suite runs the INTEGRATED FEATURE's code + specs, NOT the base-branch checkout (`$REPO`) - without it the smoke is only a base-branch baseline and never exercises the feature. Per-ticket validation does NOT run e2e (e2e is end-of-feature only), so this is the one place the e2e specs actually run. It uses an ISOLATED, slot-leased Supabase instance and tears it down (guaranteed via `trap`). Exit 0 = passed OR gracefully skipped (it prints `SKIP: ...` when there is no free slot / too little RAM / the stack cannot start); exit 1 = the suite FAILED.
+- **e2e suite**: you do NOT launch it, and `bash-guard` refuses the command if you try. The `e2e-on-feature-review` SubagentStop hook runs it for you, on the integrated `_session` worktree, and ONLY when the feature review above APPROVED (it keys off the reviewer's own `FEATURE-quality-reviewer` verdict flag), so a `BLOCKED` review never pays for the suite. It uses an ISOLATED, slot-leased Supabase instance and tears it down. Read the outcome from `<session_dir>/e2e-result.json` (`status`: `passed` | `skipped` | `failed`, plus the last 40 output lines) after the reviewer returns; the same outcome is appended to `harness-progress.log`. A missing file means the hook did not run the suite (no session worktree, or the review did not approve).
-A smoke FAIL is surfaced (like a feature-review finding; it may drive a bounded fix), never silently swallowed. A skip is fine (deferred to a human `make test-e2e-ci`, the headless target; `make test-e2e` opens the Playwright UI and needs a display). `#technical-harness` runs feature-smoke before its stop and reports the result; it does not promote.
+A smoke FAIL, or `status: "failed"` in `e2e-result.json`, is surfaced (like a feature-review finding; it may drive a bounded fix), never silently swallowed. A skip is fine (deferred to a human `make test-e2e-ci`, the headless target; `make test-e2e` opens the Playwright UI and needs a display). `#technical-harness` runs feature-smoke before its stop and reports the result; it does not promote.
**`PERSONA: technical` → stop here.** Every reconciled ticket is already on `session/<SESSION_SHORT_ID>`. Do NOT promote and do NOT run POST-DEV: emit the raw per-ticket report (statuses, branches, SHAs, verdicts, ADR paths), run the `pending-deploys.mjs` detection for information only (add "schema changes detected — migration needed on merge" when non-empty), name the session branch for `/harness-diff`, and enter STATE DONE. The rest of this Promotion block is skipped.
diff --git a/.claude/agents/quality-reviewer.md b/.claude/agents/quality-reviewer.md
index cadafc87..a535d9c6 100644
--- a/.claude/agents/quality-reviewer.md
+++ b/.claude/agents/quality-reviewer.md
@@ -88,6 +88,21 @@ mistake would be most costly. Rules:
items (style, naming, things the hooks already catch).
- `Hotspots for human review: none identified` is a valid, complete section.
+**Record your verdict flag (required, do this BEFORE emitting the contract line).** The
+end-of-feature e2e suite is launched by a hook on your stop, and it keys off this flag, so a
+`BLOCKED` review never pays for a 10-minute suite. Write it yourself with a single Bash call:
+a post-stop transcript read races the flush and silently drops the verdict. The flag dir is
+`${TICKETS_DIR}/reviews`, and the key is the literal `FEATURE` (this pass has no `TASK_ID`):
+
+- APPROVED:
+ ```bash
+ RD="${TICKETS_DIR}/reviews" && mkdir -p "$RD" && touch "$RD/FEATURE-quality-reviewer"
+ ```
+- BLOCKED:
+ ```bash
+ RD="${TICKETS_DIR}/reviews" && rm -f "$RD/FEATURE-quality-reviewer"
+ ```
+
OUTPUT CONTRACT (text, no `SendMessage`), last line exactly one of:
- `APPROVED`: no imperative findings. Put any non-blocking notes (nits, cleanliness, ponytail
`net: -N lines`) and the Hotspots section ABOVE the line; the orchestrator forwards them to the
diff --git a/.claude/hooks/bash-guard.mjs b/.claude/hooks/bash-guard.mjs
index ab971998..44eee25b 100755
--- a/.claude/hooks/bash-guard.mjs
+++ b/.claude/hooks/bash-guard.mjs
@@ -86,15 +86,6 @@ if (isOrchestrator(agent || ctx.agentType)) {
}
}
-// Validation rules — gated subagents only: the validation hooks already run
-// these; manual runs burn budget and can hang (vitest headed without CI=true).
-// Resolve identity the same robust way as the guard-state rule above: prefer the
-// payload agent_type, fall back to the CLAUDE_AGENT_NAME-derived ctx.agentType,
-// and match via the suffix-aware predicates — so a `developer-TASK-001` runtime
-// name (or an empty agent_type) is still gated, not silently waved through.
-const who = agent || ctx.agentType || "";
-if (!isDeveloper(who) && !isQualityReviewer(who)) process.exit(0);
-
const runsTypecheck = (c) =>
/(make\s+typecheck|npm\s+run\s+typecheck|npx\s+tsc(\s|$)|tsc\s+--noEmit)/.test(
c,
@@ -107,7 +98,8 @@ const runsUnitTests = (c) =>
/(npm\s+run\s+test(:unit)?(:[a-z]+)?|npm\s+test\b|npx\s+vitest|make\s+test(-unit)?(-[a-z]+)?)/.test(
c,
);
-const runsE2eTests = (c) => /(npx\s+playwright\s+test|make\s+test-e2e)/.test(c);
+const runsE2eTests = (c) =>
+ /(npx\s+playwright\s+test|make\s+test-e2e|e2e-smoke\.sh)/.test(c);
const runsLint = (c) => /(make\s+lint\b|npm\s+run\s+lint\b)/.test(c);
const runsBuild = (c) =>
/(npx\s+vite\s+build|npm\s+run\s+build\b|make\s+build\b)/.test(c);
@@ -127,7 +119,7 @@ const CATEGORY_RULES = {
],
e2e: [
runsE2eTests,
- "e2e tests: per-ticket validation does NOT run playwright (a ticket can be mid-feature). The orchestrator runs the suite once at end-of-feature, on the integrated session worktree via e2e-smoke.sh. Write the spec, don't run it.",
+ "e2e tests: NO agent launches the suite, not even the orchestrator. The e2e-on-feature-review hook runs it once, on the integrated session worktree, only after the feature review APPROVED, and writes <session_dir>/e2e-result.json. Write the spec, read the result, don't run it.",
],
lint: [
runsLint,
@@ -165,6 +157,26 @@ try {
activeCategories = new Set(Object.keys(CATEGORY_RULES));
}
+// e2e is the one category gated for EVERY caller, not just the two agents below:
+// launching the suite is a hook's job (e2e-on-feature-review.mjs), so an orchestrator
+// or a main-session Bash call must be refused too. Still config-driven — drop "e2e"
+// from validation.extraForbidden and this stops applying, like any other category.
+if (activeCategories.has("e2e") && runsE2eTests(cmd)) {
+ ctx.block({
+ reason: `Validation command forbidden: ${CATEGORY_RULES.e2e[1]} See .claude/rules/validation-commands.md.`,
+ log: `e2e any-caller cmd=${cmd.slice(0, 120)}`,
+ });
+}
+
+// Validation rules — gated subagents only: the validation hooks already run
+// these; manual runs burn budget and can hang (vitest headed without CI=true).
+// Resolve identity the same robust way as the guard-state rule above: prefer the
+// payload agent_type, fall back to the CLAUDE_AGENT_NAME-derived ctx.agentType,
+// and match via the suffix-aware predicates — so a `developer-TASK-001` runtime
+// name (or an empty agent_type) is still gated, not silently waved through.
+const who = agent || ctx.agentType || "";
+if (!isDeveloper(who) && !isQualityReviewer(who)) process.exit(0);
+
const VALIDATION_RULES = [...activeCategories]
.map((c) => CATEGORY_RULES[c])
.filter(Boolean);
diff --git a/.claude/hooks/e2e-on-feature-review.mjs b/.claude/hooks/e2e-on-feature-review.mjs
new file mode 100644
index 00000000..e5aa0a25
--- /dev/null
+++ b/.claude/hooks/e2e-on-feature-review.mjs
@@ -0,0 +1,101 @@
+#!/usr/bin/env node
+// SubagentStop(quality-reviewer) — the ONLY place the e2e suite is launched.
+//
+// It fires for the end-of-feature `MODE: feature-review` dispatch and ONLY when that
+// review APPROVED, so a BLOCKED review that sends the work back to a developer never
+// pays for a 10-minute suite. The gate is the reviewer's own verdict FLAG, not the
+// verdict text: at SubagentStop `last_assistant_message` is absent in this runtime and
+// the transcript is often unflushed (see record-review-verdict.mjs), so parsing the
+// verdict here would return UNKNOWN. The flag is written synchronously by the reviewer
+// itself before it stops, which is why the wave flow already trusts it.
+//
+// The suite runs on the INTEGRATED session worktree (never $REPO, which sits on the
+// base branch), via the deploy adapter's e2e-smoke.sh: isolated slot-leased Supabase,
+// guaranteed teardown, graceful SKIP when the host cannot hold a stack.
+//
+// The result cannot be handed to the stopping reviewer (fixing e2e is not its job), so
+// it lands in <session_dir>/e2e-result.json plus the progress log, and the orchestrator
+// reads it after the review returns. This hook never blocks a stop.
+
+import { existsSync, readFileSync, writeFileSync } from "node:fs";
+import { join } from "node:path";
+import { createHookContext } from "./lib/context.mjs";
+import { readAgentMeta } from "./lib/agent-meta.mjs";
+import { appendProgress } from "./lib/progress-log.mjs";
+import { bash } from "./lib/process.mjs";
+import { reviewFlag } from "./lib/reviews.mjs";
+import { sessionWorktreePath } from "./lib/topology.mjs";
+
+const FEATURE_REVIEW_KEY = "FEATURE";
+const E2E_TIMEOUT_MS = 15 * 60 * 1000;
+
+// Mirrors reviews.mjs: on a managed launcher the orchestrator's <session_dir> is
+// CHAT_SESSION_DIR, not the recomputed /tmp/<repo>/<id> path, so the result file has to
+// land where the orchestrator will actually look for it.
+const e2eResultPath = (ctx) =>
+ join(process.env.CHAT_SESSION_DIR || ctx.sessionDir, "e2e-result.json");
+
+const classify = (status, output) =>
+ status !== 0 ? "failed" : /^SKIP:/m.test(output) ? "skipped" : "passed";
+
+function isFeatureReview(input) {
+ const meta = readAgentMeta(input);
+ if (meta && /feature-review/i.test(meta.description)) return true;
+ const tp = input.agent_transcript_path || input.transcript_path;
+ if (!tp || !existsSync(tp)) return false;
+ try {
+ return /MODE:\s*feature-review/.test(readFileSync(tp, "utf8"));
+ } catch {
+ return false;
+ }
+}
+
+const input = JSON.parse(readFileSync(0, "utf8"));
+const ctx = createHookContext(input, "e2e-on-feature-review");
+
+if (!isFeatureReview(input)) process.exit(0);
+
+const flag = reviewFlag(ctx, FEATURE_REVIEW_KEY, "quality-reviewer");
+if (!existsSync(flag)) {
+ ctx.accept("feature-review not APPROVED -> e2e not launched");
+}
+
+const src = sessionWorktreePath(ctx);
+const script = join(ctx.repo, ".claude", "scripts", "e2e-smoke.sh");
+if (!existsSync(src))
+ ctx.accept(`no session worktree at ${src} -> e2e skipped`);
+if (!existsSync(script)) ctx.accept(`no ${script} -> e2e skipped`);
+
+appendProgress(
+ ctx.sessionDir,
+ "[e2e] suite starting on the session worktree...",
+);
+
+const r = bash(`E2E_SMOKE_SRC='${src}' bash '${script}' 2>&1`, {
+ cwd: ctx.repo,
+ timeout: E2E_TIMEOUT_MS,
+});
+const output = String(r.stdout || "");
+const status = classify(r.status, output);
+
+try {
+ writeFileSync(
+ e2eResultPath(ctx),
+ JSON.stringify(
+ {
+ kind: "e2e-result",
+ status,
+ source: src,
+ finishedAt: new Date().toISOString(),
+ output: output.split("\n").slice(-40).join("\n"),
+ },
+ null,
+ 2,
+ ),
+ );
+} catch {
+ // best-effort: the progress line and the hook log still record the outcome
+}
+
+appendProgress(ctx.sessionDir, `[e2e] suite ${status}`);
+ctx.accept(`e2e ${status} src=${src}`);
diff --git a/.claude/hooks/test/bash-guard.test.mjs b/.claude/hooks/test/bash-guard.test.mjs
index 002383b5..9b0a051c 100644
--- a/.claude/hooks/test/bash-guard.test.mjs
+++ b/.claude/hooks/test/bash-guard.test.mjs
@@ -72,12 +72,21 @@ describe("bash-guard hook", () => {
expect(isBlocked(runHook("merger", "npx playwright codegen"))).toBe(true);
});
- test("plain playwright test from main session → allowed (headless default)", () => {
- const r = runHook("", "npx playwright test");
+ test("headless playwright subcommand from main session → allowed", () => {
+ const r = runHook("", "npx playwright show-report");
expect(r.status).toBe(0);
expect(isBlocked(r)).toBe(false);
});
+ // `npx playwright test` IS refused, but by the e2e rule below (no agent launches
+ // the suite), never for a missing --headless flag the CLI cannot even accept.
+ test("plain playwright test is refused for e2e, not for headlessness", () => {
+ const r = runHook("", "npx playwright test");
+ expect(isBlocked(r)).toBe(true);
+ expect(r.stdout).toContain("e2e-on-feature-review");
+ expect(r.stdout).not.toContain("--headed");
+ });
+
test("playwright screenshot from merger → allowed (headless default)", () => {
const r = runHook(
"merger",
@@ -127,6 +136,48 @@ describe("bash-guard hook", () => {
expect(isBlocked(r)).toBe(false);
});
+ // e2e is the one category scoped to EVERY caller: launching the suite is the
+ // e2e-on-feature-review hook's job, so no agent may do it by hand.
+ describe("e2e is blocked for every caller", () => {
+ const e2eCases = [
+ ["orchestrator", "npx playwright test"],
+ [
+ "orchestrator",
+ "E2E_SMOKE_SRC=/tmp/wt/_session bash .claude/scripts/e2e-smoke.sh",
+ ],
+ ["merger", "make test-e2e"],
+ ["", "make test-e2e-ci"],
+ ];
+
+ test.each(e2eCases)("%s running '%s' → blocked", (agent, command) => {
+ const r = runHook(agent, command);
+ expect(r.status).toBe(0);
+ expect(isBlocked(r)).toBe(true);
+ });
+
+ test("dropping e2e from the config unblocks it again", () => {
+ const noE2e = {
+ validation: {
+ steps: [
+ {
+ id: "typecheck",
+ kind: "typecheck",
+ command: "npm run typecheck",
+ },
+ ],
+ extraForbidden: [],
+ },
+ roles: { developer: { model: "sonnet" } },
+ };
+ const r = runHookWithConfig(
+ "orchestrator",
+ "npx playwright test",
+ noE2e,
+ );
+ expect(isBlocked(r)).toBe(false);
+ });
+ });
+
test("main session running validation command → allowed", () => {
const r = runHook("", "npx vitest run");
expect(isBlocked(r)).toBe(false);
diff --git a/.claude/hooks/test/e2e-on-feature-review.test.mjs b/.claude/hooks/test/e2e-on-feature-review.test.mjs
new file mode 100644
index 00000000..c46250f6
--- /dev/null
+++ b/.claude/hooks/test/e2e-on-feature-review.test.mjs
@@ -0,0 +1,144 @@
+import { spawnSync } from "node:child_process";
+import {
+ existsSync,
+ mkdirSync,
+ mkdtempSync,
+ readFileSync,
+ rmSync,
+ writeFileSync,
+} from "node:fs";
+import { tmpdir } from "node:os";
+import { dirname, join } from "node:path";
+import { fileURLToPath } from "node:url";
+import { afterEach, beforeEach, describe, expect, test } from "vitest";
+import { sanitizePath } from "../lib/paths.mjs";
+
+const HERE = dirname(fileURLToPath(import.meta.url));
+const HOOK = join(HERE, "..", "e2e-on-feature-review.mjs");
+const SESSION_ID = "e2e-hook-1111-2222-3333-444455556666";
+
+let TMP, APP_DIR, TMP_ROOT, sessionDir, env;
+
+// e2e-smoke.sh stubs, one per outcome the hook has to classify.
+const SMOKE = {
+ pass: '#!/usr/bin/env bash\necho "e2e-smoke: suite exit=0"\nexit 0\n',
+ skip: '#!/usr/bin/env bash\necho "SKIP: all 5 e2e slots busy; try again later."\nexit 0\n',
+ fail: '#!/usr/bin/env bash\necho "1 failed"\nexit 1\n',
+ record:
+ '#!/usr/bin/env bash\necho "$E2E_SMOKE_SRC" > "$(dirname "$0")/../../ran-with-src"\nexit 0\n',
+};
+
+const writeSmoke = (body) => {
+ const dir = join(APP_DIR, ".claude", "scripts");
+ mkdirSync(dir, { recursive: true });
+ const p = join(dir, "e2e-smoke.sh");
+ writeFileSync(p, body, { mode: 0o755 });
+};
+
+const approve = () => {
+ const dir = join(sessionDir, "reviews");
+ mkdirSync(dir, { recursive: true });
+ writeFileSync(join(dir, "FEATURE-quality-reviewer"), "");
+};
+
+// The runtime hands SubagentStop a transcript path; readAgentMeta reads the sibling
+// <transcript>.meta.json written at spawn, which is what identifies the dispatch.
+const transcriptWithMeta = (description) => {
+ const tp = join(TMP, `agent-${Math.random().toString(36).slice(2)}.jsonl`);
+ writeFileSync(tp, "");
+ writeFileSync(
+ tp.replace(/\.jsonl$/, ".meta.json"),
+ JSON.stringify({ agentType: "quality-reviewer", description }),
+ );
+ return tp;
+};
+
+const run = (transcriptPath) =>
+ spawnSync("node", [HOOK], {
+ input: JSON.stringify({
+ session_id: SESSION_ID,
+ hook_event_name: "SubagentStop",
+ transcript_path: transcriptPath,
+ }),
+ env,
+ encoding: "utf8",
+ });
+
+const result = () => {
+ const p = join(sessionDir, "e2e-result.json");
+ return existsSync(p) ? JSON.parse(readFileSync(p, "utf8")) : null;
+};
+
+beforeEach(() => {
+ TMP = mkdtempSync(join(tmpdir(), "e2e-on-review-"));
+ APP_DIR = join(TMP, "app");
+ TMP_ROOT = join(TMP, "scratch");
+ sessionDir = join(TMP_ROOT, sanitizePath(APP_DIR), SESSION_ID);
+ mkdirSync(join(sessionDir, "_session"), { recursive: true });
+ env = { ...process.env, APP_DIR, HARNESS_TMP_ROOT: TMP_ROOT };
+ delete env.CHAT_SESSION_DIR;
+ delete env.CLAUDE_AGENT_NAME;
+ delete env.CLAUDE_PROJECT_DIR;
+});
+
+afterEach(() => rmSync(TMP, { recursive: true, force: true }));
+
+describe("e2e-on-feature-review", () => {
+ test("does not launch the suite for a per-ticket review stop", () => {
+ writeSmoke(SMOKE.record);
+ approve();
+ const r = run(transcriptWithMeta("Review TASK-003 implementation"));
+ expect(r.status).toBe(0);
+ expect(existsSync(join(APP_DIR, "ran-with-src"))).toBe(false);
+ expect(result()).toBe(null);
+ });
+
+ test("does not launch the suite when the feature review did not approve", () => {
+ writeSmoke(SMOKE.record);
+ const r = run(transcriptWithMeta("Feature-review: add deal importance"));
+ expect(r.status).toBe(0);
+ expect(existsSync(join(APP_DIR, "ran-with-src"))).toBe(false);
+ expect(result()).toBe(null);
+ });
+
+ test("launches the suite on the session worktree once the feature review approved", () => {
+ writeSmoke(SMOKE.record);
+ approve();
+ const r = run(transcriptWithMeta("Feature-review: add deal importance"));
+ expect(r.status).toBe(0);
+ const ranWith = readFileSync(join(APP_DIR, "ran-with-src"), "utf8").trim();
+ expect(ranWith).toBe(join(sessionDir, "_session"));
+ });
+
+ test("records a passing suite", () => {
+ writeSmoke(SMOKE.pass);
+ approve();
+ run(transcriptWithMeta("Feature-review: x"));
+ expect(result().status).toBe("passed");
+ });
+
+ test("records a graceful skip as skipped, not failed", () => {
+ writeSmoke(SMOKE.skip);
+ approve();
+ run(transcriptWithMeta("Feature-review: x"));
+ expect(result().status).toBe("skipped");
+ });
+
+ test("records a failing suite without blocking the reviewer's stop", () => {
+ writeSmoke(SMOKE.fail);
+ approve();
+ const r = run(transcriptWithMeta("Feature-review: x"));
+ expect(r.status).toBe(0);
+ expect(result().status).toBe("failed");
+ expect(result().output).toContain("1 failed");
+ });
+
+ test("skips gracefully when the session worktree is absent", () => {
+ writeSmoke(SMOKE.record);
+ approve();
+ rmSync(join(sessionDir, "_session"), { recursive: true, force: true });
+ const r = run(transcriptWithMeta("Feature-review: x"));
+ expect(r.status).toBe(0);
+ expect(existsSync(join(APP_DIR, "ran-with-src"))).toBe(false);
+ });
+});
diff --git a/.claude/rules/validation-commands.md b/.claude/rules/validation-commands.md
index 81d21003..a8aac08e 100644
--- a/.claude/rules/validation-commands.md
+++ b/.claude/rules/validation-commands.md
@@ -15,10 +15,16 @@ guard, so they can never drift:
green stop returns control to the orchestrator.
**e2e is NOT in this chain**: a ticket can legitimately be mid-feature, and the
chain's `cwd:"repo"` steps run in the base-branch checkout, so a per-stop e2e run
- only ever tested code the ticket had not touched. The suite runs once at
- end-of-feature on the integrated `_session` worktree, via
- `.claude/scripts/e2e-smoke.sh` (isolated slot-leased Supabase), driven by the
- orchestrator.
+ only ever tested code the ticket had not touched.
+- `e2e-on-feature-review.mjs` (SubagentStop, `quality-reviewer`) is the ONLY place
+ the e2e suite is launched. It fires on the `MODE: feature-review` stop, and only
+ when that review APPROVED (it keys off the reviewer's own
+ `FEATURE-quality-reviewer` flag, not a transcript read), then runs
+ `.claude/scripts/e2e-smoke.sh` on the integrated `_session` worktree with an
+ isolated slot-leased Supabase. The outcome lands in
+ `<session_dir>/e2e-result.json` for the orchestrator to read. **No agent launches
+ the suite, the orchestrator included**, and `bash-guard` enforces that for every
+ caller.
- `bash-guard.mjs` (PreToolUse Bash) blocks `developer` / `quality-reviewer` from
running those same commands manually, plus `validation.extraForbidden` (build,
e2e). The forbidden set is DERIVED from `validation.steps`, not hardcoded here.
diff --git a/.claude/rules/worktree-scope.md b/.claude/rules/worktree-scope.md
index 4abaaaa5..d0f5c2f3 100644
--- a/.claude/rules/worktree-scope.md
+++ b/.claude/rules/worktree-scope.md
@@ -31,6 +31,7 @@ Each session owns an integration branch `session/<SESSION_SHORT_ID>` (forked fro
| `<WORKTREE_PATH>/**` (i.e. `<WORKTREE_BASE>/TASK-XXX/`) | ✅ | ✅ | ✅ |
| `${TICKETS_DIR}/TASK-XXX.json` (per-session folder passed in your prompt) | ✅ (ticket source of truth) | ⚠️ merger writes the `status` field — no other writes | — |
| `${TICKETS_DIR}/reviews/<TASK-XXX>-quality-reviewer` (`reviews/` sibling of the ticket file) | ✅ | ⚠️ quality-reviewer ONLY, and ONLY its own ticket's flag: `touch` on APPROVED / `rm -f` on REJECTED (records its verdict; see quality-reviewer.md). No other agent, no other file under `reviews/`. | — |
+| `${TICKETS_DIR}/reviews/FEATURE-quality-reviewer` | ✅ | ⚠️ quality-reviewer in `MODE: feature-review` ONLY: `touch` on APPROVED / `rm -f` on BLOCKED. This flag is what gates the end-of-feature e2e hook. | — |
| `$REPO/adr/**` | ✅ (learn from past structural decisions) | ❌ (developer writes ADRs inside the worktree at `<WORKTREE_PATH>/adr/`; the merger ships them to `$REPO/adr/`) | — |
| `~/.claude/**` (`$CLAUDE_CONFIG_DIR`) | ✅ (skills, rules) | ❌ | — |
diff --git a/.claude/settings.json b/.claude/settings.json
index 2cc9bfa9..7de73b81 100644
--- a/.claude/settings.json
+++ b/.claude/settings.json
@@ -221,6 +221,12 @@
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/record-review-verdict.mjs",
"timeout": 15
+ },
+ {
+ "type": "command",
+ "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/e2e-on-feature-review.mjs",
+ "timeout": 900,
+ "statusMessage": "Running the end-of-feature e2e suite..."
}
]
},