Task Workflow Strict Instruction Contract This file is strict implementation instruction, not loose guidance and not optional reference material. This is the canonical workflow for task execution. It is not one possible way to do the task; it is the required way. If the Agent reads this skill, it must execute it exactly as written, in order, to the letter. Required behavior: - Do not reinterpret the steps. - Do not reorder the steps. - Do not skip the steps. - Do not replace the steps with a simpler approach. - Do not make assumptions that override this file. - Do not treat broad similarity,…

| head -1`\n\t\t],\n\t\t{ encoding: 'utf8' }\n\t);\n\tconst path = found.stdout.trim();\n\treturn path && existsSync(path) ? path : null;\n}\n\nfunction preflightPlaywrightBrowsers(cwd, env, commands) {\n\tif (!commands.some((command) => /\\bplaywright\\b/.test(command))) {\n\t\treturn;\n\t}\n\n\tif (!env.PLAYWRIGHT_BROWSERS_PATH) {\n\t\treturn;\n\t}\n\n\tconst browsersJsonPath = findBrowsersJson(cwd);\n\tif (!browsersJsonPath) {\n\t\tconsole.log('[lifecycle] Playwright browsers.json not found; skipping browser preflight');\n\t\treturn;\n\t}\n\n\tconst data = JSON.parse(readFileSync(browsersJsonPath, 'utf8'));\n\tconst required = data.browsers.filter(\n\t\t(browser) => browser.name === 'chromium' || browser.name === 'chromium-headless-shell'\n\t);\n\tconst missing = [];\n\tfor (const browser of required) {\n\t\tconst dir = join(env.PLAYWRIGHT_BROWSERS_PATH, browserDirectoryName(browser.name, browser.revision));\n\t\tif (!existsSync(dir)) {\n\t\t\tmissing.push(dir);\n\t\t}\n\t}\n\n\tif (missing.length > 0) {\n\t\tthrow new Error(\n\t\t\t[\n\t\t\t\t`Playwright browser preflight failed for PLAYWRIGHT_BROWSERS_PATH=${env.PLAYWRIGHT_BROWSERS_PATH}.`,\n\t\t\t\t`Expected browser directories from ${browsersJsonPath}:`,\n\t\t\t\t...missing.map((item) => `- ${item}`),\n\t\t\t\t'Do not run playwright install in this workflow. Use the project-pinned Playwright version that matches the sandbox image, or update the image/browser cache intentionally.'\n\t\t\t].join('\\n')\n\t\t);\n\t}\n\n\tconsole.log(`[lifecycle] Playwright browser preflight passed at ${env.PLAYWRIGHT_BROWSERS_PATH}`);\n}\n\nasync function probeReady(url, readyText) {\n\tconst controller = new AbortController();\n\tconst timer = setTimeout(() => controller.abort(), 2500);\n\ttry {\n\t\tconst response = await fetch(url, { signal: controller.signal });\n\t\tif (!response.ok) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!readyText) {\n\t\t\treturn true;\n\t\t}\n\t\tconst text = await response.text();\n\t\treturn text.includes(readyText);\n\t} catch {\n\t\treturn false;\n\t} finally {\n\t\tclearTimeout(timer);\n\t}\n}\n\nfunction killProcessGroup(pid, signal) {\n\ttry {\n\t\tprocess.kill(-pid, signal);\n\t\treturn true;\n\t} catch {\n\t\ttry {\n\t\t\tprocess.kill(pid, signal);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\nfunction spawnLogged(command, options) {\n\tmkdirSync(dirname(options.logPath), { recursive: true });\n\tconst log = createWriteStream(options.logPath, { flags: 'w' });\n\tconst child = spawn('bash', ['-lc', command], {\n\t\tcwd: options.cwd,\n\t\tenv: options.env,\n\t\tdetached: true,\n\t\tstdio: ['ignore', 'pipe', 'pipe']\n\t});\n\tchild.stdout.pipe(log, { end: false });\n\tchild.stderr.pipe(log, { end: false });\n\tchild.stdout.pipe(process.stdout, { end: false });\n\tchild.stderr.pipe(process.stderr, { end: false });\n\tchild.once('close', () => log.end());\n\treturn child;\n}\n\nasync function runCommand(command, options) {\n\tconst child = spawnLogged(command, options);\n\tlet timedOut = false;\n\tconst timeout = setTimeout(() => {\n\t\ttimedOut = true;\n\t\tkillProcessGroup(child.pid, 'SIGTERM');\n\t\tsetTimeout(() => killProcessGroup(child.pid, 'SIGKILL'), 2000).unref();\n\t}, options.timeoutMs);\n\n\tconst exitCode = await new Promise((resolve) => {\n\t\tchild.once('close', (code, signal) => resolve(code ?? (signal ? 128 : 1)));\n\t});\n\tclearTimeout(timeout);\n\n\tif (timedOut) {\n\t\tthrow new Error(`Command timed out after ${options.timeoutMs}ms; output preserved at ${options.logPath}`);\n\t}\n\tif (exitCode !== 0) {\n\t\tthrow new Error(`Command failed with exit ${exitCode}; output preserved at ${options.logPath}`);\n\t}\n}\n\nasync function startServer(args, env, runtimeDir) {\n\tif (!args.server) {\n\t\treturn null;\n\t}\n\n\tif (!args.readyUrl) {\n\t\tthrow new Error('--ready-url is required with --server');\n\t}\n\n\tif (!args.forceRestart && (await probeReady(args.readyUrl, args.readyText))) {\n\t\tconsole.log(`[lifecycle] Reusing healthy server at ${args.readyUrl}`);\n\t\treturn null;\n\t}\n\n\tconst logPath = resolve(runtimeDir, 'server.log');\n\tconst pidPath = resolve(runtimeDir, 'server.pid');\n\tconst child = spawnLogged(args.server, { cwd: args.cwd, env, logPath });\n\twriteFileSync(pidPath, `${child.pid}\\n`);\n\n\tconst deadline = Date.now() + args.readyTimeoutMs;\n\twhile (Date.now() \u003c deadline) {\n\t\tif (await probeReady(args.readyUrl, args.readyText)) {\n\t\t\tconsole.log(`[lifecycle] Server ready at ${args.readyUrl}; pid=${child.pid}; log=${logPath}`);\n\t\t\treturn child.pid;\n\t\t}\n\n\t\tif (child.exitCode !== null) {\n\t\t\tthrow new Error(`Server exited before readiness; log preserved at ${logPath}`);\n\t\t}\n\n\t\tawait delay(250);\n\t}\n\n\tkillProcessGroup(child.pid, 'SIGTERM');\n\tthrow new Error(`Server was not ready within ${args.readyTimeoutMs}ms; log preserved at ${logPath}`);\n}\n\nconst args = parseArgs(process.argv.slice(2));\nif (args.help) {\n\tprintUsage();\n\tprocess.exit(0);\n}\nconst cwd = resolve(args.cwd);\nconst runtimeDir = resolve(cwd, args.runtimeDir);\nmkdirSync(runtimeDir, { recursive: true });\nconst env = buildEnv(args);\n\npreflightPlaywrightBrowsers(cwd, env, args.runs);\n\nlet startedPid = null;\ntry {\n\tlet setupIndex = 0;\n\tfor (const command of args.setups) {\n\t\tsetupIndex += 1;\n\t\tconst logPath = resolve(runtimeDir, `setup-${String(setupIndex).padStart(2, '0')}.log`);\n\t\tconsole.log(`[lifecycle] Running setup ${setupIndex}: ${command}`);\n\t\tawait runCommand(command, { cwd, env, logPath, timeoutMs: args.setupTimeoutMs });\n\t}\n\tstartedPid = await startServer({ ...args, cwd }, env, runtimeDir);\n\tlet index = 0;\n\tfor (const command of args.runs) {\n\t\tindex += 1;\n\t\tconst logPath = resolve(runtimeDir, `run-${String(index).padStart(2, '0')}.log`);\n\t\tconsole.log(`[lifecycle] Running command ${index}: ${command}`);\n\t\tawait runCommand(command, { cwd, env, logPath, timeoutMs: args.commandTimeoutMs });\n\t}\n\tconsole.log('[lifecycle] Completed successfully');\n} finally {\n\tif (startedPid && !args.keepServer) {\n\t\tkillProcessGroup(startedPid, 'SIGTERM');\n\t\tawait delay(500);\n\t\tkillProcessGroup(startedPid, 'SIGKILL');\n\t\tconsole.log(`[lifecycle] Stopped server pid=${startedPid}`);\n\t}\n}\n","content_type":"text/javascript; charset=utf-8","language":"javascript","size":12008,"content_sha256":"57ac901c579c30991143a11de57fb0bacfe2af9e82c409c35aa8fbd6ccc65f75"},{"filename":"assets/scripts/server-probe.mjs","content":"#!/usr/bin/env node\nimport { spawn } from 'node:child_process';\nimport { createWriteStream, mkdirSync, writeFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { setTimeout as delay } from 'node:timers/promises';\n\nfunction printUsage() {\n\tconsole.log(`Usage:\n node task-workflow/scripts/server-probe.mjs \\\\\n --server \"PORT=4444 node build/server/start.js\" \\\\\n --ready-url \"http://127.0.0.1:4444/health\" \\\\\n --run \"curl -fsS http://127.0.0.1:4444/health\"\n\nCommon options:\n --run \"command\" Run bounded probe command after readiness; repeatable.\n --env NAME=value Add an environment variable; repeatable.\n --ready-text \"text\" Require response body text during readiness polling.\n --ready-timeout-ms 20000 Startup readiness timeout. Max 30000 without reason.\n --slow-start-reason \"reason\" Required if readiness timeout exceeds 30000.\n --command-timeout-ms 60000 Per-run command timeout.\n\nUse this helper for pre-Phase-5 API/runtime probes. It captures the server PID,\nwaits for readiness, preserves logs, and cleans up only the captured process.`);\n}\n\nfunction parsePositiveInt(value, label) {\n\tconst parsed = Number(value);\n\tif (!Number.isInteger(parsed) || parsed \u003c= 0) {\n\t\tthrow new Error(`${label} must be a positive integer`);\n\t}\n\treturn parsed;\n}\n\nfunction parseArgs(argv) {\n\tconst args = {\n\t\truns: [],\n\t\tenv: [],\n\t\tcwd: process.cwd(),\n\t\truntimeDir: 'task-workflow/runtime',\n\t\treadyTimeoutMs: 20000,\n\t\tcommandTimeoutMs: 60000\n\t};\n\n\tfor (let index = 0; index \u003c argv.length; index += 1) {\n\t\tconst arg = argv[index];\n\t\tconst next = () => {\n\t\t\tindex += 1;\n\t\t\tif (index >= argv.length) {\n\t\t\t\tthrow new Error(`${arg} requires a value`);\n\t\t\t}\n\t\t\treturn argv[index];\n\t\t};\n\n\t\tif (arg === '--cwd') {\n\t\t\targs.cwd = next();\n\t\t} else if (arg === '--server') {\n\t\t\targs.server = next();\n\t\t} else if (arg === '--ready-url') {\n\t\t\targs.readyUrl = next();\n\t\t} else if (arg === '--ready-text') {\n\t\t\targs.readyText = next();\n\t\t} else if (arg === '--run') {\n\t\t\targs.runs.push(next());\n\t\t} else if (arg === '--env') {\n\t\t\targs.env.push(next());\n\t\t} else if (arg === '--runtime-dir') {\n\t\t\targs.runtimeDir = next();\n\t\t} else if (arg === '--ready-timeout-ms') {\n\t\t\targs.readyTimeoutMs = parsePositiveInt(next(), '--ready-timeout-ms');\n\t\t} else if (arg === '--command-timeout-ms') {\n\t\t\targs.commandTimeoutMs = parsePositiveInt(next(), '--command-timeout-ms');\n\t\t} else if (arg === '--slow-start-reason') {\n\t\t\targs.slowStartReason = next();\n\t\t} else if (arg === '--help' || arg === '-h') {\n\t\t\targs.help = true;\n\t\t} else {\n\t\t\tthrow new Error(`Unknown argument: ${arg}`);\n\t\t}\n\t}\n\n\tif (args.help) {\n\t\treturn args;\n\t}\n\n\tif (!args.server) {\n\t\tthrow new Error('--server is required');\n\t}\n\tif (!args.readyUrl) {\n\t\tthrow new Error('--ready-url is required');\n\t}\n\tif (args.readyTimeoutMs > 30000 && !args.slowStartReason?.trim()) {\n\t\tthrow new Error('--ready-timeout-ms may exceed 30000 only with --slow-start-reason');\n\t}\n\n\treturn args;\n}\n\nfunction buildEnv(args) {\n\tconst env = { ...process.env };\n\n\tif (args.readyUrl && !env.TARGET_URL) {\n\t\tconst url = new URL(args.readyUrl);\n\t\tenv.TARGET_URL = `${url.protocol}//${url.host}`;\n\t}\n\n\tfor (const entry of args.env) {\n\t\tconst separatorIndex = entry.indexOf('=');\n\t\tif (separatorIndex \u003c= 0) {\n\t\t\tthrow new Error(`Invalid --env value: ${entry}`);\n\t\t}\n\n\t\tenv[entry.slice(0, separatorIndex)] = entry.slice(separatorIndex + 1);\n\t}\n\n\treturn env;\n}\n\nasync function probeReady(url, readyText) {\n\tconst controller = new AbortController();\n\tconst timer = setTimeout(() => controller.abort(), 1500);\n\ttry {\n\t\tconst response = await fetch(url, { signal: controller.signal });\n\t\tif (!response.ok) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!readyText) {\n\t\t\treturn true;\n\t\t}\n\t\tconst text = await response.text();\n\t\treturn text.includes(readyText);\n\t} catch {\n\t\treturn false;\n\t} finally {\n\t\tclearTimeout(timer);\n\t}\n}\n\nfunction killProcessGroup(pid, signal) {\n\ttry {\n\t\tprocess.kill(-pid, signal);\n\t\treturn true;\n\t} catch {\n\t\ttry {\n\t\t\tprocess.kill(pid, signal);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\nfunction spawnLogged(command, options) {\n\tmkdirSync(dirname(options.logPath), { recursive: true });\n\tconst log = createWriteStream(options.logPath, { flags: 'w' });\n\tconst child = spawn('bash', ['-lc', command], {\n\t\tcwd: options.cwd,\n\t\tenv: options.env,\n\t\tdetached: true,\n\t\tstdio: ['ignore', 'pipe', 'pipe']\n\t});\n\tchild.stdout.pipe(log, { end: false });\n\tchild.stderr.pipe(log, { end: false });\n\tchild.stdout.pipe(process.stdout, { end: false });\n\tchild.stderr.pipe(process.stderr, { end: false });\n\tchild.once('close', () => log.end());\n\treturn child;\n}\n\nasync function runCommand(command, options) {\n\tconst child = spawnLogged(command, options);\n\tlet timedOut = false;\n\tconst timeout = setTimeout(() => {\n\t\ttimedOut = true;\n\t\tkillProcessGroup(child.pid, 'SIGTERM');\n\t\tsetTimeout(() => killProcessGroup(child.pid, 'SIGKILL'), 2000).unref();\n\t}, options.timeoutMs);\n\n\tconst exitCode = await new Promise((resolve) => {\n\t\tchild.once('close', (code, signal) => resolve(code ?? (signal ? 128 : 1)));\n\t});\n\tclearTimeout(timeout);\n\n\tif (timedOut) {\n\t\tthrow new Error(`Command timed out after ${options.timeoutMs}ms; output preserved at ${options.logPath}`);\n\t}\n\tif (exitCode !== 0) {\n\t\tthrow new Error(`Command failed with exit ${exitCode}; output preserved at ${options.logPath}`);\n\t}\n}\n\nasync function startServer(args, env, runtimeDir) {\n\tif (await probeReady(args.readyUrl, args.readyText)) {\n\t\tthrow new Error(\n\t\t\t`Ready URL already responds before startup: ${args.readyUrl}. Use a task-owned port or stop the known PID outside this helper.`\n\t\t);\n\t}\n\n\tconst logPath = resolve(runtimeDir, 'server-probe.log');\n\tconst pidPath = resolve(runtimeDir, 'server-probe.pid');\n\tconst child = spawnLogged(args.server, { cwd: args.cwd, env, logPath });\n\twriteFileSync(pidPath, `${child.pid}\\n`);\n\n\tconst deadline = Date.now() + args.readyTimeoutMs;\n\twhile (Date.now() \u003c deadline) {\n\t\tif (await probeReady(args.readyUrl, args.readyText)) {\n\t\t\tconsole.log(`[server-probe] Server ready at ${args.readyUrl}; pid=${child.pid}; log=${logPath}`);\n\t\t\treturn { pid: child.pid, logPath };\n\t\t}\n\n\t\tif (child.exitCode !== null) {\n\t\t\tthrow new Error(`Server exited before readiness; log preserved at ${logPath}`);\n\t\t}\n\n\t\tawait delay(250);\n\t}\n\n\tkillProcessGroup(child.pid, 'SIGTERM');\n\tawait delay(500);\n\tkillProcessGroup(child.pid, 'SIGKILL');\n\tthrow new Error(`Server was not ready within ${args.readyTimeoutMs}ms; log preserved at ${logPath}`);\n}\n\nconst args = parseArgs(process.argv.slice(2));\nif (args.help) {\n\tprintUsage();\n\tprocess.exit(0);\n}\nconst cwd = resolve(args.cwd);\nconst runtimeDir = resolve(cwd, args.runtimeDir);\nmkdirSync(runtimeDir, { recursive: true });\nconst env = buildEnv(args);\n\nlet startedPid = null;\ntry {\n\tconst server = await startServer({ ...args, cwd }, env, runtimeDir);\n\tstartedPid = server.pid;\n\tlet index = 0;\n\tfor (const command of args.runs) {\n\t\tindex += 1;\n\t\tconst logPath = resolve(runtimeDir, `server-probe-run-${String(index).padStart(2, '0')}.log`);\n\t\tconsole.log(`[server-probe] Running command ${index}: ${command}`);\n\t\tawait runCommand(command, { cwd, env, logPath, timeoutMs: args.commandTimeoutMs });\n\t}\n\tconsole.log('[server-probe] Completed successfully');\n} finally {\n\tif (startedPid) {\n\t\tkillProcessGroup(startedPid, 'SIGTERM');\n\t\tawait delay(500);\n\t\tkillProcessGroup(startedPid, 'SIGKILL');\n\t\tconsole.log(`[server-probe] Stopped server pid=${startedPid}`);\n\t}\n}\n","content_type":"text/javascript; charset=utf-8","language":"javascript","size":7482,"content_sha256":"004263be54d724c94353b1d0e608633465841e2e3120ddf62f5bf55816a6e288"},{"filename":"assets/templates/open-gaps.md","content":"# Open Gaps\n\n## Ledger Rules\n\n- Allowed statuses: `Open`, `Resolved`, `Closed`, `Reclassified non-critical`, `None`.\n- A gap cannot remain `Open` after the phase named in its owner or next-action field has passed.\n- Phase 7 fails if any critical gap is still `Open`, stale, or contradicted by another phase artifact.\n- When a later phase fixes or defends a gap, update this file in that same phase.\n- `Pending` is a template placeholder, not a valid ledger status after Phase 0.\n- If there are no gaps, use `None currently recorded` rows.\n\n## Critical Gaps\n\n| Gap | Phase found | Status | Owner/next action | Evidence |\n| --- | --- | --- | --- | --- |\n| None currently recorded | Phase 0 | None | Recheck every phase | Fresh ledger; replace this row immediately when a critical gap is found |\n\n## Non-Critical Gaps\n\n| Gap | Phase found | Status | Defense/next action | Evidence |\n| --- | --- | --- | --- | --- |\n| None currently recorded | Phase 0 | None | Recheck every phase | Fresh ledger; replace this row immediately when a non-critical gap is found |\n\n## Resolved Gaps\n\n| Gap | Resolved in phase | Fix | Evidence |\n| --- | --- | --- | --- |\n| None currently recorded | Phase 0 | None | No resolved gaps yet |\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":1215,"content_sha256":"c3cb4783d190a8eecf1e7a5689f36bb9b4238d01cf82abe6ea7b2035814c2417"},{"filename":"assets/templates/phase-0-artifact-reset.md","content":"# Phase 0 - Artifact Reset And Scaffolding\n\n## Task Source\n\n| Field | Value |\n| --- | --- |\n| Repo root | Pending |\n| Task file/source | Pending |\n| Started at | Pending |\n| Skill version/path | Pending |\n\n## Reset Evidence\n\n| Required item | Status | Evidence |\n| --- | --- | --- |\n| Previous task's `task-workflow/` directory removed, not reused | Pending | Pending |\n| Required artifact files created from templates | Pending | Pending |\n| `task-workflow/CURRENT_PHASE.txt` created | Pending | Pending |\n| `task-workflow/progress.md` created from template | Pending | Pending |\n| Progress ledger hard resume rule recorded | Pending | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers initialized | Pending | Pending |\n| `task-workflow/playwright/` created | Pending | Pending |\n| `task-workflow/screenshots/` created | Pending | Pending |\n| `task-workflow/scripts/` created | Pending | Pending |\n| `task-workflow/runtime/` created | Pending | Pending |\n| `task-workflow/scripts/playwright-lifecycle.mjs` copied from skill asset | Pending | Pending |\n| `task-workflow/scripts/server-probe.mjs` copied from skill asset | Pending | Pending |\n| Phase 0 was limited to workflow artifact reset/scaffolding | Pending | Pending |\n| Pre-implementation workspace state recorded before Phase 0 gate | Pending | Pending |\n\n## Gate\n\n| Metric | Required | Actual |\n| --- | --- | --- |\n| Score | 10/10 | 0/10 |\n| Critical items | all pass | Pending |\n| Marker before promotion | `phase-0-artifact-reset` | Pending |\n| Marker after promotion | `phase-1-task-research` | Pending |\n| Managed Playwright lifecycle helper copied and readable | yes | Pending |\n| Managed server probe helper copied and readable | yes | Pending |\n| `progress.md` updated for Phase 1 resume | yes | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers current | yes | Pending |\n| Promotion lock verified before marker advance | yes | Pending |\n\nDecision: Fail\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":1958,"content_sha256":"9cb80b7b07b85042ea0102a30c48ed441eacb2ce22f830b64a2cc587967fb589"},{"filename":"assets/templates/phase-1-task-research.md","content":"# Phase 1 - Task Intake And Codebase Research\n\n## Task Understanding\n\n| Item | Notes |\n| --- | --- |\n| User-visible goal | Pending |\n| Technical goal | Pending |\n| In scope | Pending |\n| Out of scope | Pending |\n| Assumptions | Pending |\n| Risks | Pending |\n\n## Instructions And Docs Read\n\nReference-input rule: all files in this section are read-only unless the task explicitly asks to edit that exact file. This is especially strict for `.tasks/task.md`, `.tasks/domain.md`, `.tasks/files/`, and selected skill files under `.agents/skills/`. Do not rewrite, normalize, consolidate, clean up, trim, or reformat them. Record conflicts or stale content as gaps instead of editing the reference input.\n\n| Source | Why relevant | Notes |\n| --- | --- | --- |\n| `AGENTS.md` | Required binding development instructions for this repo | Pending |\n| `.tasks/domain.md` | MITB domain, brand, and product behavior | Pending |\n| `.tasks/files/` inventory | Required task attachment/supporting-file discovery | Pending |\n| Every task attachment/supporting file in `.tasks/files/`, repo-relative | Required task-provided evidence; read or inspect before planning | Pending |\n| Other repo-local domain files, repo-relative | Additional domain constraints and product behavior when relevant | Pending |\n| Selected relevant skill files from `.agents/skills/` only, repo-relative | Additional task-specific process or quality rules | Pending |\n| Other relevant docs, repo-relative | Architecture or workflow context | Pending |\n\n## Development Rules Extracted From `AGENTS.md`\n\nRecord the task-relevant rules before planning. Include required docs, architecture boundaries, type-safety rules, test expectations, UX rules, commands, prohibited patterns, and completion requirements that apply to this task.\n\n| Rule area | Applicable instruction | How the plan will follow it |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\n## Task Files Read\n\nRead or inspect every task attachment/supporting file in `.tasks/files/` before planning. For binary/media files, record the inspection method and what it showed. Do not mark this complete from a directory listing alone.\n\n| Task file | Read/inspection method | What it contributes to the task | Used in plan? |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Relevant Skill Selection\n\nDo not bulk-read every available skill file. Skills are stored under `.agents/skills/`; list only the skills selected for this task and the reason each one was relevant.\n\n| Skill file | Why relevant to this task | Read? | Notes for resume |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Codebase Research\n\n| Area | Files/directories inspected | Existing pattern to reuse | Findings |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Ordered Implementation Plan\n\n| Order | Step | Files/areas | Expected proof |\n| --- | --- | --- | --- |\n| 1 | Pending | Pending | Pending |\n\n## Verification And Test Plan\n\n| Verification area | Planned command or method | Expected proof |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\n## Gate\n\n| Metric | Required | Actual |\n| --- | --- | --- |\n| Score | >= 28/30 | 0/30 |\n| Critical research items | all pass | Pending |\n| Root `AGENTS.md` read first | yes | Pending |\n| Task-relevant `AGENTS.md` development rules extracted before planning | yes | Pending |\n| `.tasks/domain.md` read | yes | Pending |\n| `.tasks/files/` enumerated, even if empty | yes | Pending |\n| Every task attachment/supporting file in `.tasks/files/` read or inspected before planning | yes | Pending |\n| Relevant local skill files from `.agents/skills/` selected, read, and cited with repo-relative paths | yes | Pending |\n| Irrelevant skill files in `.agents/skills/` were not bulk-read | yes | Pending |\n| Reference inputs remained read-only, especially `.tasks/*` | yes | Pending |\n| Plan cites concrete files | yes | Pending |\n| Ambiguities resolved, closed, or recorded in `open-gaps.md` | yes | Pending |\n| Phase 1 stayed within research, planning, and artifact updates | yes | Pending |\n| Verification plan recorded | yes | Pending |\n| Plan follows extracted `AGENTS.md` development rules | yes | Pending |\n| `progress.md` summarizes Phase 1, selected skill files, and next Phase 2 action | yes | Pending |\n| `progress.md` Refs list `AGENTS.md`, `.tasks/task.md`, `.tasks/domain.md`, relevant task attachments/supporting files from `.tasks/files/`, and selected relevant skills | yes | Pending |\n| `progress.md` points to Phase 1 artifact for researched files and planned edit targets | yes | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers are current | yes | Pending |\n| Marker promoted after Phase 1 pass | `phase-2-execution` | Pending |\n| Promotion lock verified before marker advance | yes | Pending |\n\nDecision: Fail\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4855,"content_sha256":"ea6736e42ba3944f9f526bd41b43d12a56768a22dd3a7351dd150b0953f29242"},{"filename":"assets/templates/phase-2-execution.md","content":"# Phase 2 - Primary Execution\n\n## Phase Start Checkpoint\n\nRecord this section before scoring the Phase 2 gate. Source edits may begin only after `CURRENT_PHASE.txt` says `phase-2-execution`.\n\n| Required item | Status | Evidence |\n| --- | --- | --- |\n| `CURRENT_PHASE.txt` set to `phase-2-execution` before source edits | Pending | Pending |\n| Phase 0 and Phase 1 artifacts re-opened and passing | Pending | Pending |\n| Implementation files unchanged while marker was `phase-0-artifact-reset` or `phase-1-task-research` | Pending | Pending |\n\n## Execution Log\n\nUpdate this table immediately after each small work packet. Do not leave this table all `Pending` after source files have been edited.\n\n| Planned step | Status | Files changed | Evidence |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Work Packet Discipline\n\n| Required rule | Status | Evidence |\n| --- | --- | --- |\n| Execution log updated after each completed or in-progress packet before starting the next packet | Pending | Pending |\n| `progress.md` updated after each meaningful work packet and before promotion | Pending | Pending |\n| `progress.md` Current Phase Pointers updated after each meaningful packet | Pending | Pending |\n| `progress.md` points to this Phase 2 artifact for full edited-file details | Pending | Pending |\n| Execution log has active packet evidence before broad verification or app launch | Pending | Pending |\n| Any skipped or deferred packet was recorded in `open-gaps.md` immediately | Pending | Pending |\n| Gate-relevant writes were read back or verified in diff before relying on them | Pending | Pending |\n| Failed/invalid/uncertain write results were repaired before continuing | Pending | Pending |\n| Narrow implementation unblock commands, if used, cite the concrete blocker and result | Pending | Pending |\n| Any discovered unit/E2E/browser verification need was handed to the owning later phase or gap ledger | Pending | Pending |\n| Pre-Phase-5 API/runtime server probes used `task-workflow/scripts/server-probe.mjs`, or none were needed | Pending | Pending |\n| Foreground command cleanup or bounded-command result recorded | Pending | Pending |\n\n## Production Database Safety\n\nProduction/live workspace databases, especially `.dbs/database.db`, are not scratch files. Deleting, resetting, reseeding, truncating, manipulating, or corrupting them can destroy user work and can cause the user to lose his job. The only allowed production/live DB action is the repo's required app migration command for a real schema change. If this phase creates or changes a migration, the repo's app migration command must run against the production/live default DB after the migration exists. No other production/live DB action is allowed.\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Any command touching DB/data state was reviewed before running | Pending | Pending |\n| Production/live DB paths, including `.dbs/database.db` or equivalent default user-data DB, were not deleted/reset/seeded/truncated/used as fixtures | Pending | Pending |\n| Production/live DB action, if any, was only the repo's required app migration command for a real schema change | Pending | Pending |\n| Migration files/scripts created or changed? If yes, app migration command ran against production/live default DB after creation | Pending | Pending |\n| Migration command, if any, records target DB/source, reason, output, and no seed/reset/test cleanup mixed into it | Pending | Pending |\n| No manual query, data manipulation, direct SQLite, seed, reset, fixture, data repair, cleanup, delete, or truncate touched production/live DB | Pending | Pending |\n| Test/fixture DB work, if any, used isolated repo-owned test config rather than production/live DB | Pending | Pending |\n\n## Plan Changes\n\n| Change | Reason | Evidence |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\n## Checks During Execution\n\nPhase 2 evidence must stay strict, but routine check, lint, build, unit/Vitest, E2E, Playwright, and combined check commands such as `pnpm run check` belong to later owning phases after the connected-place sweep. Record only narrow non-test checks that were needed to unblock or prove a specific implementation packet.\n\n| Check | Result | Notes |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\n## Gate\n\n| Metric | Required | Actual |\n| --- | --- | --- |\n| Score | >= 34/40 | 0/40 |\n| Critical execution items | all pass | Pending |\n| Phase start marker proof recorded | yes | Pending |\n| Planned required work done or tracked | yes | Pending |\n| Execution log was updated incrementally during implementation | yes | Pending |\n| Gate-relevant writes have readback or diff evidence | yes | Pending |\n| Failed write/tool results repaired with readback evidence | yes | Pending |\n| Narrow implementation unblock commands, if any, have blocker/result evidence | yes | Pending |\n| Unit/E2E/browser verification needs discovered during implementation are handed to owning later phases | yes | Pending |\n| Production/live database safety evidence is recorded and clean | yes | Pending |\n| Foreground command cleanup or bounded-command result recorded | yes | Pending |\n| Final implementation packet sweep recorded | yes | Pending |\n| `open-gaps.md` finalized with real rows or explicit none rows | yes | Pending |\n| `progress.md` current and points to Phase 3 next action | yes | Pending |\n| `progress.md` Current Phase Pointers current | yes | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers current | yes | Pending |\n| Promotion lock verified before marker advance | yes | Pending |\n\nDecision: Fail\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":5624,"content_sha256":"1601ebf999dabfb91c8fe12cec341c53a502d6b25f11f6e4924cf9767bcde78c"},{"filename":"assets/templates/phase-3-second-execution.md","content":"# Phase 3 - Second Execution, Integrity, And Check/Lint Validation\n\n## Second-Pass Review\n\n| Review area | Finding | Action taken | Evidence |\n| --- | --- | --- | --- |\n| Task alignment | Pending | Pending | Pending |\n| Missing routes/actions | Pending | Pending | Pending |\n| Data/state wiring | Pending | Pending | Pending |\n| Error/runtime behavior | Pending | Pending | Pending |\n| Associated UI consistency | Pending | Pending | Pending |\n| Associated API/service/schema coverage | Pending | Pending | Pending |\n| Docs and phase-boundary gaps | Pending | Pending | Pending |\n\n## Implementation Integrity Review\n\n| Area | Status | Evidence |\n| --- | --- | --- |\n| Imports and symbols | Pending | Pending |\n| Route/action wiring | Pending | Pending |\n| Schema/data shapes | Pending | Pending |\n| State transitions | Pending | Pending |\n| Extracted `AGENTS.md` development rules followed | Pending | Pending |\n| Unrelated edits avoided | Pending | Pending |\n| Type safety and narrow assertions | Pending | Pending |\n| Tooling warnings from changed code resolved or defended | Pending | Pending |\n\n## Console And Logging Review\n\nChanged app/server source must not keep `console.*`. Temporary `console.*` may be used only during Phase 5 interactive testing when it directly helps debug browser/runtime behavior by reading console output. Remove those logs after the issue is understood and before Phase 5 reruns, Phase 3 re-passes, or Phase 7 signs off. If lasting logging is needed, use the repo-approved logging or telemetry path recorded from `AGENTS.md` and relevant docs.\n\n| Area inspected | Console usage found? | Temporary Phase 5 debug only? | Removed or replaced evidence |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Gap Closure\n\n| Gap | Status | Fix/defense | Evidence |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Production Database Safety\n\nProduction/live workspace databases, especially `.dbs/database.db`, are not scratch files. Deleting, resetting, reseeding, truncating, manipulating, or corrupting them can destroy user work and can cause the user to lose his job. The only allowed production/live DB action is the repo's required app migration command for a real schema change. If Phase 2 or Phase 3 created or changed a migration, the repo's app migration command must run against the production/live default DB before this phase passes. No other production/live DB action is allowed.\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Connected data/migration work reviewed for production/live DB safety | Pending | Pending |\n| Production/live DB paths, including `.dbs/database.db` or equivalent default user-data DB, were not deleted/reset/seeded/truncated/used as fixtures | Pending | Pending |\n| Production/live DB action, if any, was only the repo's required app migration command for a real schema change | Pending | Pending |\n| Migration files/scripts created or changed in Phase 2 or Phase 3? If yes, app migration command ran against production/live default DB before Phase 3 pass | Pending | Pending |\n| Migration command, if any, records target DB/source, reason, output, and no seed/reset/test cleanup mixed into it | Pending | Pending |\n| No manual query, data manipulation, direct SQLite, seed, reset, fixture, data repair, cleanup, delete, or truncate touched production/live DB | Pending | Pending |\n| Check/build validation did not depend on modifying production/live user data outside legitimate migrations | Pending | Pending |\n\n## Ordered Static And Build Checkpoint\n\nRun this checkpoint after the second-pass connected-place review and any Phase 3 repairs. Use the repo's native commands. If the repo has no separate command for an item, record the repo-specific reason. If a command fails, inspect enough output to identify visible issue groups, fix every locally-fixable group as a batch, then rerun that same command before moving to the next row. If a temporary full-output log is needed for large output, delete it after extracting issue groups.\n\n| Step | Command | First result and visible issue groups | Batch fix evidence | Temp full-output log deleted? | Rerun/final result |\n| --- | --- | --- | --- | --- | --- |\n| Check (`pnpm run check` or repo equivalent) | Pending | Pending | Pending | Pending | Pending |\n| Focused lint (`pnpm run lint` or repo equivalent, only when useful) | Pending | Pending | Pending | Pending | Pending |\n| Build, when separate from check | Pending | Pending | Pending | Pending | Pending |\n\n## Reusable Build Evidence\n\nRecord the passing build output so later phases can reuse it instead of rebuilding. Rebuild only if code, config, package/dependency files, migrations/build inputs, generated assets, stale output, or incompatible verification tooling invalidates this evidence.\n\n| Item | Evidence |\n| --- | --- |\n| Passing build command and output/log path | Pending |\n| Last source/config/build-input change before build | Pending |\n| Later phases may reuse this build? | Pending |\n| Conditions that would require rebuild | Pending |\n\n## Downstream Coverage Handoff\n\nPhase 3 is an inspection, integrity, and check/lint validation pass. Record coverage questions for the owning later phase instead of deciding them here.\n\n| Item | Evidence |\n| --- | --- |\n| Unit-test questions or needs, if any, were recorded for Phase 4 | Pending |\n| E2E questions or needs, if any, were recorded for Phase 6 | Pending |\n| Any early coverage artifacts or command output were handed to the owning phase decision | Pending |\n\n## Gate\n\n| Metric | Required | Actual |\n| --- | --- | --- |\n| Score | >= 26/32 | 0/32 |\n| Critical second-pass items | all pass | Pending |\n| Associated UI/API/data surfaces reviewed for consistency | yes | Pending |\n| Related surfaces fixed or explicitly defended | yes | Pending |\n| Implementation integrity review completed and clean | yes | Pending |\n| Production/live database safety evidence is recorded and clean | yes | Pending |\n| Logging review completed with repo-approved logging/telemetry evidence | yes | Pending |\n| Ordered check, focused lint if used, and build checkpoint passed or missing commands have repo-specific evidence | yes | Pending |\n| Command failures grouped, locally-fixable groups fixed as a batch, and temporary full-output logs deleted before rerunning | yes | Pending |\n| Reusable build evidence recorded | yes | Pending |\n| Downstream unit/E2E coverage handoff recorded where relevant | yes | Pending |\n| Critical gaps resolved, closed, or reclassified with evidence | yes | Pending |\n| Remaining non-critical gaps defended | yes | Pending |\n| `open-gaps.md` finalized with real rows or explicit none rows | yes | Pending |\n| `progress.md` current and points to Phase 4 next action | yes | Pending |\n| `progress.md` points to this Phase 3 artifact for second-pass repair details | yes | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers current | yes | Pending |\n| Promotion lock verified before marker advance | yes | Pending |\n\nDecision: Fail\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7051,"content_sha256":"afc65305bc14bc6998b4789856fb01135abad95339160bbaaf3646f0dacfccfe"},{"filename":"assets/templates/phase-4-unit-coverage.md","content":"# Phase 4 - Unit Test Coverage Decision And Verification\n\n## Phase 3 Evidence Review\n\nRe-open Phase 3 ordered check/lint/build and integrity evidence first. Do not rerun check, lint, or build here when Phase 3 evidence is current. If later code/config/package/build-input changes invalidated Phase 3, return to Phase 3 and rerun from the first invalidated command. Starting Phase 4/5/6/7, preparing E2E, or doing final signoff is not an invalidation reason.\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Phase 3 check/lint/build evidence re-opened | Pending | Pending |\n| Phase 3 implementation integrity evidence re-opened | Pending | Pending |\n| Phase 3 evidence still current, or returned to Phase 3 for invalidated command | Pending | Pending |\n| Phase 3 invalidation decision recorded before unit coverage work | Pending | Pending |\n\n## Unit Coverage Decision Matrix\n\nUse this order for each changed behavior: decide whether unit-level coverage is warranted; inspect connected existing tests; remove unnecessary existing tests; update connected existing tests when they can carry the warranted coverage; add a new minimal test only when no existing test can carry a warranted core behavior; otherwise record `N/A`.\n\nSmall fixes, visual-only changes, copy/color/style changes, spacing/layout tuning, simple button wiring, and incidental UI behavior normally require no unit-level test. Unit tests belong to stable core behavior: shared logic, contracts, permissions, critical state machines, parsers, calculations, data transforms, central stores, or reusable components whose behavior must stay strict.\n\n> Strict default: `N/A`, update existing, or remove/simplify existing. A new unit test is an exception and must earn its maintenance cost.\n\n| Behavior/area | Unit-level coverage warranted? | Core/stable risk being protected | Existing related tests inspected | Remove/simplify existing? | Update existing? | Add new? | Decision and minimal/core reason |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Existing Unit Test Actions\n\nRecord each connected existing unit, service, component, or integration-style test and the action taken. Existing-test actions come before any new-test decision. Existing tests created by older agents are not grandfathered; passing status alone is not a reason to preserve them.\n\n| Existing test file/area | Connected behavior | Old/excess/agent-created? | Action: remove/simplify/update/preserve/unrelated | Reason | Evidence that file was read |\n| --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Old Or Excess Unit Test Pruning Audit\n\nUse this section for connected tests that may be unnecessary, obsolete, duplicated, convoluted, brittle, or non-core/non-complex. If none are found, record the search/read evidence and `None found`.\n\n| Candidate test | Why it might be unnecessary or excessive | Decision: remove/simplify/update/preserve | Why preservation is correct, if preserved | Diff/readback evidence |\n| --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending |\n\n## New Unit Test Burden Ledger\n\nComplete one row for every new unit test file or case. If no new unit test is added, record `N/A` with the existing-test/update/remove evidence that made new coverage unnecessary.\n\n| New test file/case | Stable/core risk protected | Existing tests read first | Why existing update/remove/`N/A` was insufficient | Minimal assertions only? | Cheaper proof rejected | Bulk check: merged/reduced? |\n| --- | --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Unit Test Changes\n\n| Action | Test file | Existing-first outcome | Burden-ledger row or `N/A` | Why this action is warranted and minimal | Diff/readback evidence |\n| --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Unit Test Runs\n\nRecord exact bounded unit-level test commands when tests are warranted. If output is long, cite a repo-local log file and copy the final pass/fail lines exactly. If no unit command is warranted, record `N/A` and the coverage-decision evidence.\n\n| Command | Scope: N/A/targeted/connected/final-sanity-full/exception-full | Why this scope or why no unit command is warranted | Previous related failure | Changed or new evidence before rerun | Result | Exact output or repo-local log path with final lines | Next action |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Removed-Test Audit\n\nUse this section whenever tests are removed. A removal is valid only when the test is unnecessary, obsolete, convoluted, brittle, or protects non-core/non-complex behavior, and useful core coverage is preserved or explicitly no longer needed.\n\n| Removed test | Removal reason | Useful coverage preserved? | Diff/readback evidence |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Failure And Rerun Discipline\n\n| Command | Failure or risk | Fix/diagnostic before rerun | Rerun outcome |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Coverage Gaps\n\n| Gap | Reason | Risk | Owner/next action |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Command And Write Safety\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Gate-relevant test edits/removals have readback or diff evidence | Pending | Pending |\n| Failed/invalid/uncertain write or command results were repaired before continuing | Pending | Pending |\n| Test watcher or interactive command cleanup recorded, if applicable | Pending | Pending |\n\n## Gate\n\n| Metric | Required | Actual |\n| --- | --- | --- |\n| Score | >= 28/30 | 0/30 |\n| Critical unit-test coverage items | all pass | Pending |\n| Phase 3 check/build and integrity evidence current, or returned to Phase 3 for invalidation | yes | Pending |\n| Unit coverage decision matrix recorded, including `N/A` when no unit-level test is warranted | yes | Pending |\n| Existing connected unit-level tests inspected before remove/update/add decisions | yes | Pending |\n| Unit tests removed, updated, added, or skipped according to the existing-first decision order | yes | Pending |\n| Old/excess connected tests removed, simplified, updated, or explicitly defended | yes | Pending |\n| New unit tests, if any, have a complete burden ledger | yes | Pending |\n| Test bulk causing max-lines/helper/fixture churn was reduced or explicitly justified per test | yes | Pending |\n| Removed tests have rationale and readback/diff evidence | yes | Pending |\n| Warranted unit commands pass, no unit command was warranted, or unrelated failure evidenced | yes | Pending |\n| Exact command output recorded when a unit command was required; otherwise `N/A` decision recorded | yes | Pending |\n| Identified unnecessary, obsolete, convoluted, brittle, or non-core/non-complex unit tests were removed or defended | yes | Pending |\n| Broad/full unit command, if any, has final-sanity/explicit-exception reason | yes | Pending |\n| Repeated unit commands have material change, stale-output, or diagnostic reasons | yes | Pending |\n| Open gaps for unit coverage updated | yes | Pending |\n| `open-gaps.md` finalized with real rows or explicit none rows | yes | Pending |\n| Command/write safety passed | yes | Pending |\n| `progress.md` current and points to Phase 5 next action | yes | Pending |\n| `progress.md` points to this Phase 4 artifact for unit coverage details | yes | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers current | yes | Pending |\n| Promotion lock verified before marker advance | yes | Pending |\n\nDecision: Fail\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7802,"content_sha256":"82a98ce9ff5efa29dabaaff2b2b434246fd32be03da2cabfe14281ce96ef087d"},{"filename":"assets/templates/phase-5-playwright-verification.md","content":"# Phase 5 - Interactive Playwright Verification\n\n## App Launch\n\n| Field | Value |\n| --- | --- |\n| Launch command | Pending |\n| Lifecycle helper command | Pending |\n| First app/browser command lifecycle owner | Pending |\n| URL | Pending |\n| Playwright scripts | Pending |\n| Server PID | Pending |\n| Server log | Pending |\n| Readiness proof | Pending |\n| Runtime command logs | Pending |\n| Browser preflight result | Pending |\n| Initial command timeout | Pending |\n| Timeout/quiet-run triage, if any | Pending |\n\n## Phase 3 Build Reuse\n\nReuse the Phase 3 passing build unless code, config, package/dependency files, migrations/build inputs, generated assets, stale output, or incompatible verification tooling invalidated it after Phase 3. Do not rebuild only because Phase 5 is starting or a server command needs a production bundle.\n\n| Item | Evidence |\n| --- | --- |\n| Phase 3 build evidence reviewed | Pending |\n| Reused Phase 3 build or rebuild reason | Pending |\n| If rebuilt, command/log and invalidating change | Pending |\n\n## Server And Command Discipline\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Correct lifecycle owner recorded before command: helper by default; repo `webServer` or manual fallback only with reason/diagnostics made before the command | Pending | Pending |\n| First browser/app-server run established lifecycle ownership before testing, with no reliance on an assumed existing server | Pending | Pending |\n| App server started by the recorded lifecycle owner, not as an unbounded foreground command | Pending | Pending |\n| Server readiness checked by the recorded lifecycle owner before browser interaction | Pending | Pending |\n| Browser preflight passed, or mismatch failed early without `playwright install` | Pending | Pending |\n| Playwright scripts run as bounded helper commands | Pending | Pending |\n| Runtime logs preserved under `task-workflow/runtime/` | Pending | Pending |\n| Pre-server setup, if needed, ran through lifecycle `--setup` or justified repo/fallback setup without manual chain bundling | Pending | Pending |\n| Repo E2E/end-to-end config owned test DB paths for helper/setup/server/run commands | Pending | Pending |\n| Playwright/custom fixture writes used repo-owned test DB paths | Pending | Pending |\n| Fetch/stale DB/stale build/wrong-port issues were diagnosed through lifecycle logs/readiness before any fallback | Pending | Pending |\n| First-run targeted script/probe used `15000`-`20000` ms timeout, or task-specific reason for a different first timeout is recorded | Pending | Pending |\n| Longer timeout, if used, followed timer-only/no-useful-output failure plus helper-log/readiness/URL/DB-fixture/server-log/browser-console/network/page-state triage | Pending | Pending |\n| Useful failure evidence was diagnosed directly instead of retried with a larger timeout | Pending | Pending |\n| Manual fallback, if used, captured PID/log/readiness/cleanup evidence under `task-workflow/runtime/`; otherwise N/A | Pending | Pending |\n| Background server cleaned up by helper or explicitly handed to next bounded command | Pending | Pending |\n| Cleanup method recorded and bounded | Pending | Pending |\n\n## Production Database Safety\n\nProduction/live workspace databases, especially `.dbs/database.db`, are not scratch files. Deleting, resetting, reseeding, truncating, manipulating, or corrupting them can destroy user work and can cause the user to lose his job. Phase 5 may use only isolated test/E2E state proved by repo-owned config. The production/live DB may not be touched for Playwright setup, fixture setup, seed, reset, debug, cleanup, manual queries, direct SQLite, data repair, or any data manipulation.\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Every setup/server/run command that mentions DB/data state was reviewed before running | Pending | Pending |\n| Production/live DB paths, including `.dbs/database.db` or equivalent default user-data DB, were not deleted/reset/seeded/truncated/migrated/opened with write risk | Pending | Pending |\n| Playwright fixture/setup data used isolated repo-owned test/E2E config, not production/live DB | Pending | Pending |\n| No raw `rm`, `sqlite3`, seed, reset, fixture, cleanup, or direct DB command targeted production/live DB | Pending | Pending |\n| No manual query, data manipulation, data repair, delete, or truncate touched production/live DB | Pending | Pending |\n| If the task created/changed a migration, Phase 2/3 artifact already records production/live app migration evidence; Phase 5 did not rerun it as test setup | Pending | Pending |\n\n## Phase 5 Coverage Plan\n\nPhase 5 is the main user-facing verification phase. Use multiple focused Playwright scripts, probes, viewport passes, screenshots, or clean reruns when needed to prove changed flows and UI correctness. The limit is relevance to the changed or adjacent surfaces, not the smallest possible number of browser checks.\n\n| Coverage area | Planned script/probe/viewport evidence | Why this is needed for the changed UX | Scope boundary so this does not become a broad unrelated audit |\n| --- | --- | --- | --- |\n| Main changed user flow | Pending | Pending | Pending |\n| Relevant bad case or non-ideal user action | Pending | Pending | Pending |\n| Surrounding shared UI or adjacent workflow | Pending | Pending | Pending |\n| Responsive/visual correctness | Pending | Pending | Pending |\n\n## Stage 1 - Functional Behavior\n\nProve the changed behavior works through real user interaction. Keep this stage focused on the changed surface and directly related nearby behavior.\n\n| Flow/route/state | User action sequence | Expected user-visible result | Script/evidence | Result/fix |\n| --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending |\n\n## Stage 1 - Relevant User-Perspective Stress Coverage\n\nExercise relevant non-ideal behavior a real user could do while using the changed feature: invalid inputs, cancel/close paths, repeated clicks where relevant, out-of-order actions, navigation away/back, empty states, and nearby controls.\n\n| Scenario | User action | Expected user-visible result | Script/evidence | Result/fix |\n| --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending |\n\n## Surrounding Feature Smoke\n\nCheck nearby UI/features sharing the changed surface so the task did not break unrelated but adjacent behavior.\n\n| Surrounding feature | Why at risk | Script/evidence | Result |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Stage 2 - Responsive UI And Visual Quality\n\nVerify the main changed flow and affected nearby UI on mobile, tablet, desktop, standard `1920x1080`, and large `2560x1440` desktop when UI changed. Responsive quality is a first-class Phase 5 pass condition, equal to the task's functional behavior working. Check for broken, cramped, overlapping, clipped, ill-placed, unreadable, unusable, or non-responsive UI; also check navigation access, tap/click targets, dialogs/menus, accidental horizontal scroll, controls outside the viewport, screenshots, and whether normal desktop/1080p has excessive dead space. Some whitespace is fine. `2560x1440` may have some extra whitespace, but not broad empty regions that make the UI feel unfinished. Large empty areas are acceptable on 4K/ultrawide only when the layout is intentionally constrained and still coherent.\n\n| Viewport | Flow/area | Overlap/cramped/clipped/readability result | Responsive/nav/tap/dialog result | Screenshot/evidence | Fix/rerun |\n| --- | --- | --- | --- | --- | --- |\n| Mobile, e.g. 390x844 | Pending | Pending | Pending | Pending | Pending |\n| Tablet, e.g. 768x1024 | Pending | Pending | Pending | Pending | Pending |\n| Desktop, e.g. 1440x900 | Pending | Pending | Pending | Pending | Pending |\n| Standard desktop, 1920x1080 | Pending | Pending | Pending | Pending | Pending |\n| Large desktop, 2560x1440 | Pending | Pending | Pending | Pending | Pending |\n\n## Screenshot Existence Audit\n\nEvery screenshot path cited anywhere in this artifact must exist when the Phase 5 gate is scored. Verify cited paths with a bounded file-read/listing command and record the proof here.\n\n| Screenshot path cited | Existence proof command/output | Result |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\n## Issues Found And Fixed\n\n| Issue | Fix | Evidence |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\n## Timeout And Quiet-Run Triage\n\nRecord every timed-out, quiet, or longer-timeout Playwright/helper run. A longer rerun is allowed only after a timer-only/no-useful-output failure and clean triage proving the app and script are valid to rerun.\n\n| Command | Timeout | Result/useful evidence? | Triage checked: helper logs, readiness, URL, not-found/error state, DB/fixture, server log, browser console, network/page state | Rerun/fix decision |\n| --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending |\n\n## Fixed Wait Review\n\nInspect the Playwright scripts used in this phase and any E2E tests created so far.\n\nRecord:\n\n- files inspected\n- whether any fixed waits were found\n- deterministic waits/assertions used instead\n\nThis review is zero-tolerance. If any fixed wait is present, Phase 5 fails. Remove every fixed wait, replace it with deterministic Playwright waits/assertions such as `locator.waitFor`, `expect(locator)...`, `waitForURL`, `waitForResponse`, or persisted-state assertions, rerun the script/test, and review the files again before passing.\n\nDo not justify fixed waits as stabilization, mutation timing, dialog close, navigation timing, screenshot timing, animation timing, or followed-by-assertion helpers. There is no allowed fixed-wait list.\n\n| Command result | Fixed wait count | Disposition |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\nIf matches were found and removed, record the replacement proof here.\n\n| Removed file:line | Replacement wait/assertion | Rerun evidence |\n| --- | --- | --- |\n| None found yet | N/A | Replace this row if the audit finds and removes matches |\n\n## Gate\n\n| Metric | Required | Actual |\n| --- | --- | --- |\n| Score | >= 44/50 | 0/50 |\n| Critical Playwright items | all pass | Pending |\n| Phase 5 coverage plan proves the run was thorough enough for changed user-facing flows and UI | yes | Pending |\n| Stage 1 main touched/implied flows covered | yes | Pending |\n| Stage 1 relevant bad cases and non-ideal user behavior covered | yes | Pending |\n| Surrounding feature smoke completed | yes | Pending |\n| Stage 2 mobile/tablet/desktop/1080p/2560px responsive UI verified when UI changed | yes | Pending |\n| Stage 2 responsive UI quality passes as a first-class guarantee alongside task functionality | yes | Pending |\n| Broken/cramped/overlapping/clipped/ill-placed/unusable/non-responsive UI issues resolved or defended | yes | Pending |\n| Screenshot paths exist | yes | Pending |\n| Screenshot existence audit completed for every cited path | yes | Pending |\n| Phase 3 build reused, or rebuild reason and output recorded | yes | Pending |\n| Production/live database safety evidence is recorded and clean | yes | Pending |\n| Critical UI/runtime issues resolved or defended | yes | Pending |\n| Phase 5 failures routed to the earliest affected phase, then Phase 3 check/lint evidence and Phase 4 unit coverage were re-passed before rechecking | yes | Pending |\n| Open gaps for interactive verification updated | yes | Pending |\n| `open-gaps.md` finalized with real rows or explicit none rows | yes | Pending |\n| Audited Playwright/E2E files use deterministic waits/assertions | yes | Pending |\n| Fixed wait review completed and clean | yes | Pending |\n| Server/command discipline passed | yes | Pending |\n| Repo-owned test database configuration evidence recorded | yes | Pending |\n| Correct lifecycle owner managed startup/readiness/cleanup | yes | Pending |\n| First app/browser command established lifecycle ownership before testing | yes | Pending |\n| First-run targeted script/probe timeout was `15000`-`20000` ms or justified | yes | Pending |\n| Longer timeout, if used, has timer-only/no-useful-output failure plus clean triage evidence | yes | Pending |\n| Timeout/quiet-run triage recorded for every timed-out, quiet, or longer-rerun command | yes | Pending |\n| Lifecycle fallback, if used, has recorded helper diagnostics and ownership evidence | yes | Pending |\n| Browser preflight/lifecycle evidence recorded | yes | Pending |\n| Cleanup method recorded and bounded | yes | Pending |\n| `progress.md` current and points to Phase 6 next action | yes | Pending |\n| `progress.md` points to this Phase 5 artifact for Playwright scripts, screenshots, logs, and repair details | yes | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers current | yes | Pending |\n| Promotion lock verified before marker advance | yes | Pending |\n\nDecision: Fail\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":12825,"content_sha256":"ccddb98221382bb00d1edb46353806540fa80f7853aa0ff7a8e082ead4d59569"},{"filename":"assets/templates/phase-6-e2e-verification.md","content":"# Phase 6 - E2E Coverage Decision And Verification\n\n## E2E Coverage Decision Matrix\n\nUse this order for each changed workflow: decide whether E2E is warranted; inspect connected existing E2E; remove unnecessary existing E2E; update connected existing E2E when it can carry the warranted workflow; add a new minimal E2E only when no existing E2E can carry a warranted core/complex workflow; otherwise record `N/A`.\n\n> Strict default: no new E2E. A smoke checklist or reviewer expectation is not enough; the artifact must prove durable E2E risk and existing-first failure.\n\n| Behavior/path | E2E warranted? | Critical/core workflow risk | Existing E2E inspected | Remove/simplify existing? | Update existing? | Add new? | Decision and minimal/core reason |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Minimal Coverage Rationale\n\nSmall fixes, visual-only changes, copy/color/style changes, spacing/layout tuning, simple button wiring, isolated logic, and incidental UI behavior normally require no new or updated E2E. E2E is warranted only for critical user workflows, complex multi-step flows, persistence/navigation boundaries, permission boundaries, or high-risk regressions. Unit-level coverage decisions belong to Phase 4, not Phase 6.\n\n| Change type/risk | Why E2E is or is not warranted | Phase 4 unit decision cited if relevant | Evidence |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Existing E2E Review\n\nInspect connected existing E2E tests for every changed workflow before choosing an action. Remove unnecessary E2E first, then update an existing flow when the task changes or extends that flow. Add a new E2E test only for a core workflow or when existing coverage cannot cleanly express the warranted path. Existing tests created by older agents are not grandfathered; passing status alone is not a reason to preserve them.\n\n| Existing test file/flow | Connected workflow | Old/excess/agent-created? | Action: remove/simplify/update/preserve/unrelated | Reason | Evidence that file was read |\n| --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Old Or Excess E2E Pruning Audit\n\nUse this section for connected E2E tests that may be unnecessary, obsolete, duplicated, brittle, convoluted, or non-core/non-complex. If none are found, record the search/read evidence and `None found`.\n\n| Candidate E2E | Why it might be unnecessary or excessive | Decision: remove/simplify/update/preserve | Critical-flow coverage after decision | Diff/readback evidence |\n| --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending |\n\n## New E2E Burden Ledger\n\nComplete one row for every new E2E file or case. If no new E2E is added, record `N/A` with the existing-E2E/update/remove evidence that made new coverage unnecessary.\n\n| New E2E file/case | Critical/core workflow protected | Existing E2E read first | Why existing update/remove/`N/A` was insufficient | Minimal user path only? | Cheaper proof rejected | Bulk check: merged/reduced? |\n| --- | --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending | Pending |\n\n## E2E Test Changes\n\nRecord every E2E add, update, removal, or explicit skip. Removed tests need a reason, readback/diff evidence, and a note about any remaining critical-flow coverage.\n\n| Test file | Action: added/updated/removed/skipped | Existing-first outcome | Burden-ledger row or `N/A` | Why this action is warranted and minimal | Diff/readback or command evidence | Critical-flow coverage after change |\n| --- | --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Functional Assertion Quality\n\nE2E tests should prove actual core task functionality, not superficial styling or existence. Prefer assertions for user-visible outcomes, persisted state, navigation results, validation behavior, permissions, or end-to-end data flow. Avoid primary assertions about color, CSS class, incidental copy, or a button merely existing unless the task itself is specifically about that behavior and is critical enough for E2E.\n\n| Test file | Functional outcome proved | User-visible/persisted assertion | Superficial checks avoided? |\n| --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending |\n\n## Test Runs\n\nRecord the exact bounded E2E command and its exact output when an E2E command is warranted. If output is long, write it to a repo-local log file and cite that file here, plus the final pass/fail lines copied exactly into the artifact. If no E2E is warranted, record `N/A` and the coverage-decision evidence.\n\n| Command | Timeout | Lifecycle helper/repo `webServer`/setup evidence | Result | Exact output or repo-local log path with final lines | Follow-up |\n| --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Phase 3 Build Reuse\n\nReuse the Phase 3 passing build unless code, config, package/dependency files, migrations/build inputs, generated assets, stale output, or incompatible verification tooling invalidated it after Phase 3. Do not rebuild only because Phase 6 is starting, E2E needs a production bundle, or final confidence would feel safer.\n\n| Item | Evidence |\n| --- | --- |\n| Phase 3 build evidence reviewed | Pending |\n| Reused Phase 3 build or rebuild reason | Pending |\n| If rebuilt, command/log and invalidating change | Pending |\n\n## Test Selection And Retry Ledger\n\nRecord every meaningful E2E command, including reruns. Use the smallest useful scope first. List the connected specs covered. Never run the unfiltered full E2E suite unless the task explicitly asks for full E2E or a concrete written repo instruction names full E2E/all-spec execution for this exact task. A repo having one large E2E file, a Playwright `webServer`, or generic \"run tests\" guidance is not enough. If no E2E is warranted, record `N/A` and do not run an E2E command.\n\n| Command | Scope: targeted/connected-multi-spec/explicit-full | Why this scope and connected specs covered; exact full-suite requirement if explicit-full | Previous related failure | Changed or new evidence before rerun | Timeout/quiet-run triage before longer rerun | Outcome | Next action |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending | Pending | Pending | Pending |\n\n## Server And Command Discipline\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Correct lifecycle owner recorded before command: helper by default; repo `webServer` or manual fallback only with reason/diagnostics made before the command | Pending | Pending |\n| First E2E command established lifecycle ownership before testing, with no reliance on an assumed existing server | Pending | Pending |\n| Existing repo E2E command was run through helper `--run`, or repo `webServer` ownership exception was recorded before native Playwright | Pending | Pending |\n| Test server, if needed, started by the helper with PID/log, or by a justified repo `webServer`/fallback owner | Pending | Pending |\n| Server readiness, if needed, checked by the recorded lifecycle owner before E2E execution | Pending | Pending |\n| Browser preflight passed, or mismatch failed early without `playwright install` | Pending | Pending |\n| Tests run as bounded commands, not watchers | Pending | Pending |\n| Runtime logs preserved under `task-workflow/runtime/` | Pending | Pending |\n| Pre-server setup, if needed, ran through lifecycle `--setup` or justified repo/fallback setup | Pending | Pending |\n| Repo E2E/end-to-end config owned test DB paths for helper/setup/server/run commands | Pending | Pending |\n| E2E/end-to-end fixture setup, reset, migration, SQLite access, or custom scripts used repo-owned test DB paths | Pending | Pending |\n| DB/setup/server lifecycle reused across related E2E commands unless code, test, config, fixture, migration, build input, or lifecycle diagnostics invalidated it | Pending | Pending |\n| Fetch/stale DB/stale build/wrong-port issues were diagnosed through lifecycle logs/readiness before any fallback | Pending | Pending |\n| First-run targeted E2E used timeout at or below `30000` ms, or task-specific reason for a different first timeout is recorded | Pending | Pending |\n| Longer timeout, if used, followed timer-only/no-useful-output failure plus helper-log/readiness/URL/DB-fixture/server-log/browser-console/network/page-state triage | Pending | Pending |\n| Useful failure evidence was diagnosed directly instead of retried with a larger timeout | Pending | Pending |\n| Manual fallback, if used, captured PID/log/readiness/cleanup evidence under `task-workflow/runtime/`; otherwise N/A | Pending | Pending |\n| Background server cleaned up after tests | Pending | Pending |\n| Cleanup method recorded and bounded | Pending | Pending |\n\n## Production Database Safety\n\nProduction/live workspace databases, especially `.dbs/database.db`, are not scratch files. Deleting, resetting, reseeding, truncating, manipulating, or corrupting them can destroy user work and can cause the user to lose his job. Phase 6 may use only isolated test/E2E state proved by repo-owned config. The production/live DB may not be touched for E2E setup, fixture setup, seed, reset, debug, cleanup, manual queries, direct SQLite, data repair, or any data manipulation.\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Every setup/server/run command that mentions DB/data state was reviewed before running | Pending | Pending |\n| Production/live DB paths, including `.dbs/database.db` or equivalent default user-data DB, were not deleted/reset/seeded/truncated/migrated/opened with write risk | Pending | Pending |\n| E2E fixture/setup data used isolated repo-owned test/E2E config, not production/live DB | Pending | Pending |\n| No raw `rm`, `sqlite3`, seed, reset, fixture, cleanup, or direct DB command targeted production/live DB | Pending | Pending |\n| No manual query, data manipulation, data repair, delete, or truncate touched production/live DB | Pending | Pending |\n| If the task created/changed a migration, Phase 2/3 artifact already records production/live app migration evidence; Phase 6 did not rerun it as test setup | Pending | Pending |\n\n## Fixed Wait Review\n\nInspect the Playwright scripts and E2E tests used in this phase.\n\nRecord:\n\n- files inspected\n- whether any fixed waits were found\n- deterministic waits/assertions used instead\n\nThis review is zero-tolerance. If any fixed wait is present, Phase 6 fails. Remove every fixed wait, replace it with deterministic Playwright waits/assertions such as `locator.waitFor`, `expect(locator)...`, `waitForURL`, `waitForResponse`, or persisted-state assertions, rerun the script/test, and review the files again before passing.\n\nDo not justify fixed waits as stabilization, mutation timing, dialog close, navigation timing, screenshot timing, animation timing, or followed-by-assertion helpers. There is no allowed fixed-wait list.\n\n| Command result | Fixed wait count | Disposition |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\nIf matches were found and removed, record the replacement proof here.\n\n| Removed file:line | Replacement wait/assertion | Rerun evidence |\n| --- | --- | --- |\n| None found yet | N/A | Replace this row if the audit finds and removes matches |\n\n## Coverage Gaps\n\n| Gap | Reason | Risk |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\n## Timeout And Quiet-Run Triage\n\nRecord every timed-out, quiet, or longer-timeout E2E/helper run. A longer rerun is allowed only after a timer-only/no-useful-output failure and clean triage proving the app and spec are valid to rerun.\n\n| Command | Timeout | Result/useful evidence? | Triage checked: helper logs, readiness, URL, not-found/error state, DB/fixture, server log, browser console, network/page state | Rerun/fix decision |\n| --- | --- | --- | --- | --- |\n| Pending | Pending | Pending | Pending | Pending |\n\n## E2E Quality Review\n\n| Check | Status | Evidence |\n| --- | --- | --- |\n| Existing E2E tests preserved, updated, removed, or defended | Pending | Pending |\n| Connected existing E2E tests inspected before remove/update/add/`N/A` decisions | Pending | Pending |\n| Existing E2E flow updated or removed when warranted behavior belongs there or old coverage is no longer useful | Pending | Pending |\n| Old/excess connected E2E tests removed, simplified, updated, or explicitly defended | Pending | Pending |\n| New E2E tests, if any, have a complete burden ledger | Pending | Pending |\n| New E2E bulk was merged/reduced or explicitly justified per case | Pending | Pending |\n| New E2E test added only when the workflow was core/complex and no existing flow could cover it | Pending | Pending |\n| Removed E2E tests have rationale, diff/readback evidence, and remaining critical-flow coverage notes | Pending | Pending |\n| Identified unnecessary, obsolete, brittle, convoluted, or non-core/non-complex E2E tests were removed or defended | Pending | Pending |\n| Exact command output recorded for required E2E runs, or `N/A` coverage-decision/removal evidence recorded | Pending | Pending |\n| New/updated tests assert user-visible or persisted state when tests were warranted | Pending | Pending |\n| New/updated E2E tests prove real core task functionality | Pending | Pending |\n| Superficial color/class/existence-only checks avoided | Pending | Pending |\n| Tests avoid brittle implementation details | Pending | Pending |\n| Fixed wait review completed and clean | Pending | Pending |\n| Coverage gaps reflected in `open-gaps.md` | Pending | Pending |\n| Server/command discipline passed | Pending | Pending |\n| Correct lifecycle owner managed startup/readiness/cleanup | Pending | Pending |\n| First E2E command established lifecycle ownership before testing | Pending | Pending |\n| Browser preflight/lifecycle evidence recorded | Pending | Pending |\n| Test selection and retry ledger complete | Pending | Pending |\n| Connected-spec ledger covers each E2E command; explicit full-suite command cites task request or concrete exact-task repo requirement | Pending | Pending |\n| Full E2E rerun, if used after targeted/connected E2E passed, cites related code/test/config/fixture/migration/build-input invalidation | Pending | Pending |\n| Suspected pre-existing/order-dependent failures were diagnosed with narrow evidence before any broader command was considered | Pending | Pending |\n| Repeated E2E commands have material change, stale-output, or diagnostic reasons | Pending | Pending |\n| First-run targeted E2E timeout was at or below `30000` ms or justified | Pending | Pending |\n| Longer timeout, if used, has timer-only/no-useful-output failure plus clean triage evidence | Pending | Pending |\n| Timeout/quiet-run triage recorded for every timed-out, quiet, or longer-rerun command | Pending | Pending |\n| Cleanup method recorded and bounded | Pending | Pending |\n\n## Gate\n\n| Metric | Required | Actual |\n| --- | --- | --- |\n| Score | >= 24/30 | 0/30 |\n| Critical E2E items, or defended `N/A` decision | all pass | Pending |\n| E2E coverage decision recorded, including `N/A` when no E2E is warranted | yes | Pending |\n| Connected existing E2E tests inspected before remove/update/add/`N/A` decisions | yes | Pending |\n| Existing E2E coverage updated or removed when warranted by the coverage decision | yes | Pending |\n| New E2E tests added only when existing tests cannot cleanly cover a core/complex workflow | yes | Pending |\n| Old/excess connected E2E tests removed, simplified, updated, or explicitly defended | yes | Pending |\n| New E2E tests, if any, have a complete burden ledger | yes | Pending |\n| New E2E bulk was merged/reduced or explicitly justified per case | yes | Pending |\n| Removed E2E tests have rationale, diff/readback evidence, and remaining critical-flow coverage notes | yes | Pending |\n| New/affected critical behavior covered or defended | yes | Pending |\n| Tests assert meaningful functional outcomes | yes | Pending |\n| Superficial/flaky one-off checks avoided | yes | Pending |\n| Required tests pass, no E2E was warranted, or unrelated failure evidenced | yes | Pending |\n| Exact E2E command output recorded in artifact or cited repo-local log when a command was required; otherwise `N/A` decision/removal evidence recorded | yes | Pending |\n| Phase 3 build reused, or rebuild reason and output recorded | yes | Pending |\n| Open gaps for E2E coverage updated | yes | Pending |\n| `open-gaps.md` finalized with real rows or explicit none rows | yes | Pending |\n| E2E quality review passed | yes | Pending |\n| Test selection and retry ledger complete | yes | Pending |\n| E2E command scope matches the coverage decision or an exact full-E2E requirement | yes | Pending |\n| Repeated E2E commands have material change, stale-output, or diagnostic reasons | yes | Pending |\n| Fixed wait review completed and clean | yes | Pending |\n| Server/command discipline passed | yes | Pending |\n| Production/live database safety evidence is recorded and clean | yes | Pending |\n| Repo-owned test database configuration evidence recorded | yes | Pending |\n| Correct lifecycle owner managed startup/readiness/cleanup | yes | Pending |\n| First E2E command established lifecycle ownership before testing | yes | Pending |\n| Existing repo E2E ran through lifecycle helper by default, or native Playwright exception was recorded before command | yes | Pending |\n| First-run targeted E2E timeout was at or below `30000` ms or justified | yes | Pending |\n| Longer timeout, if used, has timer-only/no-useful-output failure plus clean triage evidence | yes | Pending |\n| Timeout/quiet-run triage recorded for every timed-out, quiet, or longer-rerun command | yes | Pending |\n| Lifecycle fallback, if used, has recorded helper diagnostics and ownership evidence | yes | Pending |\n| DB/setup/server lifecycle reuse or invalidation reason recorded | yes | Pending |\n| Browser preflight/lifecycle evidence recorded | yes | Pending |\n| Cleanup method recorded and bounded | yes | Pending |\n| `progress.md` current and points to Phase 7 next action | yes | Pending |\n| `progress.md` points to this Phase 6 artifact for E2E files and repair details | yes | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers current | yes | Pending |\n| Promotion lock verified before marker advance | yes | Pending |\n\nDecision: Fail\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":18447,"content_sha256":"5660faef8e25b10ccf5ada0197fcd830da00f4c79f6b05fc9a4edb461526cbc4"},{"filename":"assets/templates/phase-7-final-signoff.md","content":"# Phase 7 - Final Audit And Signoff\n\n## Phase Gate Recap\n\n| Phase | Artifact | Score | Decision | Still current |\n| --- | --- | --- | --- | --- |\n| 0 | `task-workflow/phase-0-artifact-reset.md` | Pending | Fail | Pending |\n| 1 | `task-workflow/phase-1-task-research.md` | Pending | Fail | Pending |\n| 2 | `task-workflow/phase-2-execution.md` | Pending | Fail | Pending |\n| 3 | `task-workflow/phase-3-second-execution.md` | Pending | Fail | Pending |\n| 4 | `task-workflow/phase-4-unit-coverage.md` | Pending | Fail | Pending |\n| 5 | `task-workflow/phase-5-playwright-verification.md` | Pending | Fail | Pending |\n| 6 | `task-workflow/phase-6-e2e-verification.md` | Pending | Fail | Pending |\n\n## Final Diff Review\n\n| Area | Files | Summary |\n| --- | --- | --- |\n| Pending | Pending | Pending |\n\n## Final Verification\n\n| Proof | Evidence |\n| --- | --- |\n| Final checks current after last code change, verified from owning-phase evidence without rerun unless missing/stale/invalidated | Pending |\n| Open critical gaps resolved | Pending |\n| Stale/deferred open gaps reconciled | Pending |\n| Extracted `AGENTS.md` development rules followed | Pending |\n| Phase 3 implementation integrity and static-check evidence is current | Pending |\n| Phase 4 unit coverage decision is current: add, update, remove, or defended `N/A` | Pending |\n| Phase 4 old/excess unit-test pruning audit and new-test burden ledger, if tests were added, are present | Pending |\n| Phase 4 unit command output, defended `N/A`, or removed-test rationale and diff/readback evidence is present | Pending |\n| Phase 6 E2E coverage decision is current: add, update, remove, or defended `N/A` | Pending |\n| Phase 6 old/excess E2E pruning audit and new-E2E burden ledger, if E2E was added, are present | Pending |\n| Phase 6 E2E command output, defended `N/A`, or removed-test rationale and diff/readback evidence is present | Pending |\n| Phase 6 E2E command scope matches the coverage decision or an exact full-E2E requirement | Pending |\n| Phase 6 E2E reruns have material change, stale-output, or diagnostic reasons | Pending |\n| Rerun ledger records material reasons for repeated commands | Pending |\n| Phase 5/6 correct lifecycle-owner evidence current | Pending |\n| Phase 5/6 reused DB/setup/server lifecycle across related verification commands unless invalidated by changed state or lifecycle diagnostics | Pending |\n| Phase 5/6 timeout values and timeout/quiet-run triage evidence current | Pending |\n| Phase 5 responsive-quality evidence current and first-class when UI changed | Pending |\n| Phase 5 UI-quality issues are resolved or defended with responsive evidence | Pending |\n| Phase 5/6 browser preflight and lifecycle evidence current | Pending |\n| Runtime logs cited for managed server or verification commands where output is too long | Pending |\n| Changed app/server logging review is current after Phase 5 | Pending |\n| Task summary accurate | Pending |\n| `progress.md` agrees with Phase 7 and has no remaining local action | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers identify where final gate, verification, log, and test details live | Pending |\n\n## MITB Task Completion Command\n\nRun this only after all prior Phase 7 audit checks are clean. Prefer the exact `Completed:` command from `.tasks/task.md`; otherwise use the exact command supplied in the prompt. Do not synthesize project/task identifiers when the task file or prompt provides them. If any Phase 7 audit check fails, do not run this command; loop back to the earliest failing phase first. Treat this as the final external task action. Phase 7 must verify existing owning-phase evidence for checks, tests, builds, server probes, browser probes, and verification commands; run one only if the owning phase missed it, the evidence is missing/incomplete/stale, or later changes invalidated it.\n\n| Item | Evidence |\n| --- | --- |\n| Completion command source | Pending |\n| Exact completed command | Pending |\n| Command run after Phase 7 audit checks passed | Pending |\n| Command result/output | Pending |\n\n## Open Gaps Audit\n\n| Gap table | Remaining open items | Stale or contradicted? | Evidence |\n| --- | --- | --- | --- |\n| Critical Gaps | Pending | Pending | Pending |\n| Non-Critical Gaps | Pending | Pending | Pending |\n| Placeholder rows | Pending | Pending | Pending |\n\n## Artifact Integrity Review\n\nRe-open every required phase artifact. Do not infer pass status from memory or from this recap table.\n\n| Artifact | Exists? | Decision and score pass? | Required evidence complete? | Contradictions? | Evidence |\n| --- | --- | --- | --- | --- | --- |\n| `task-workflow/phase-0-artifact-reset.md` | Pending | Pending | Pending | Pending | Pending |\n| `task-workflow/phase-1-task-research.md` | Pending | Pending | Pending | Pending | Pending |\n| `task-workflow/phase-2-execution.md` | Pending | Pending | Pending | Pending | Pending |\n| `task-workflow/phase-3-second-execution.md` | Pending | Pending | Pending | Pending | Pending |\n| `task-workflow/phase-4-unit-coverage.md` | Pending | Pending | Pending | Pending | Pending |\n| `task-workflow/phase-5-playwright-verification.md` | Pending | Pending | Pending | Pending | Pending |\n| `task-workflow/phase-6-e2e-verification.md` | Pending | Pending | Pending | Pending | Pending |\n| `task-workflow/progress.md` | Pending | Current and consistent | Final action ready | Pending | Pending |\n\n## Fixed Wait Review Recap\n\n| Source | Review present? | Current after last edit? | Deterministic waits confirmed? | Evidence |\n| --- | --- | --- | --- | --- |\n| Phase 5 interactive scripts | Pending | Pending | Pending | Pending |\n| Phase 6 E2E files | Pending | Pending | Pending | Pending |\n\n## Verification Evidence Recap\n\n| Evidence type | Required proof | Present and current? | Evidence |\n| --- | --- | --- | --- |\n| Phase 5 screenshots | Every screenshot path cited in Phase 5 exists | Pending | Pending |\n| Phase 5 responsive quality | Required viewports include mobile, tablet, desktop, standard `1920x1080`, and large `2560x1440` when UI changed; evidence shows responsive quality passed as a first-class guarantee with no broken UI, excessive 1080p dead space, or unfinished-looking 2560px empty regions | Pending | Pending |\n| Phase 4 unit evidence | Unit coverage decision records remove/update/add/`N/A`; old/excess pruning audit is complete; every new test has a burden-ledger row; exact command output is recorded when a command was required; removed tests include rationale and diff/readback evidence | Pending | Pending |\n| Phase 6 E2E evidence | E2E coverage decision records remove/update/add/`N/A`; old/excess pruning audit is complete; every new E2E has a burden-ledger row; exact E2E command output is recorded when a command was required; removed E2E tests include rationale and diff/readback evidence | Pending | Pending |\n| Coverage selection and retry evidence | Phase 4 unit ledger and Phase 6 E2E ledger separately explain scope, `N/A` decisions, removals, rerun basis, outcomes, and next actions | Pending | Pending |\n| Managed lifecycle evidence | Phase 5/6 records the correct lifecycle owner: helper by default, repo Playwright `webServer` or manual fallback only with reason/diagnostics; readiness, browser preflight, cleanup, and runtime logs are cited | Pending | Pending |\n| DB/setup/server reuse evidence | Phase 5/6 does not repeatedly reset DB, rerun migrate/seed, or restart the server between related E2E commands without an invalidating state change or lifecycle diagnostic | Pending | Pending |\n| Timeout/quiet-run triage evidence | Phase 5/6 records timeout values and triage for every timed-out, quiet, or longer-rerun Playwright/E2E command; no longer timeout is used without timer-only/no-useful-output failure plus clean state triage | Pending | Pending |\n| Browser preflight | Phase 5/6 browser preflight and lifecycle evidence is current | Pending | Pending |\n| Changed app/server logging | Changed logging uses the repo-approved logging or telemetry path after Phase 5 | Pending | Pending |\n\n## Quality Scorecard\n\n| Category | Required | Actual | Evidence |\n| --- | --- | --- | --- |\n| Functional result | >= 8/10 | 0/10 | Pending |\n| Skill compliance/artifact integrity | >= 8/10 | 0/10 | Pending |\n| Code quality/maintainability | >= 8/10 | 0/10 | Pending |\n| Test quality | >= 8/10 | 0/10 | Pending |\n| Development-instruction compliance | >= 8/10 | 0/10 | Pending |\n| Overall result | >= 8/10 | 0/10 | Pending |\n\n## Gate\n\n| Metric | Required | Actual |\n| --- | --- | --- |\n| Score | 20/20 | 0/20 |\n| All previous gates passed | yes | Pending |\n| Artifacts auditable | yes | Pending |\n| Critical gaps resolved, closed, or reclassified with evidence | yes | Pending |\n| Open gaps reconciled with phase artifacts | yes | Pending |\n| Gap ledger finalized with real rows or explicit none rows | yes | Pending |\n| Fixed wait reviews current and clean | yes | Pending |\n| Phase 5 cited screenshots exist | yes | Pending |\n| Phase 5 responsive-quality evidence current and first-class when UI changed | yes | Pending |\n| Phase 5 UI-quality issues resolved or defended with responsive evidence | yes | Pending |\n| Phase 4 unit-test command output recorded when a command was required, defended `N/A` recorded when none was warranted, or removed-test rationale and diff/readback evidence recorded | yes | Pending |\n| Phase 6 E2E command output recorded when a command was required, defended `N/A` recorded when none was warranted, or removed-test rationale and diff/readback evidence recorded | yes | Pending |\n| Phase 4/6 old-excess test pruning audits are complete and new-test burden ledgers exist when tests were added | yes | Pending |\n| Phase 3 implementation integrity and static-check evidence current | yes | Pending |\n| Phase 7 did not rerun checks/builds/tests/Playwright/E2E unless owning-phase evidence was missing, incomplete, stale, or invalidated | yes | Pending |\n| Phase 4 unit coverage ledger current | yes | Pending |\n| Phase 6 E2E coverage ledger current | yes | Pending |\n| Phase 6 E2E command scope matches coverage decision or exact full-E2E requirement | yes | Pending |\n| Phase 6 E2E reruns have material change, stale-output, or diagnostic reasons | yes | Pending |\n| Rerun ledger records material reasons for repeated commands | yes | Pending |\n| Phase 5/6 correct lifecycle-owner evidence recorded | yes | Pending |\n| Phase 5/6 DB/setup/server lifecycle reuse or invalidation reason recorded | yes | Pending |\n| Phase 5/6 timeout/quiet-run triage evidence recorded for every timed-out, quiet, or longer-rerun Playwright/E2E command | yes | Pending |\n| Longer Playwright/E2E timeout, if used, has timer-only failure and clean-state triage evidence | yes | Pending |\n| Browser preflight/lifecycle evidence recorded for Phase 5/6 | yes | Pending |\n| Artifact integrity review completed and clean | yes | Pending |\n| Quality scorecard all >= 8/10 | yes | Pending |\n| Extracted `AGENTS.md` development rules verified | yes | Pending |\n| Changed logging uses repo-approved logging or telemetry path after Phase 5 | yes | Pending |\n| Verification current | yes | Pending |\n| MITB completed command run after clean final audit | yes | Pending |\n| `progress.md` final state agrees with Phase 7 | yes | Pending |\n| `progress.md` Current Phase Pointers final state is current | yes | Pending |\n| `progress.md` Phase Artifact Index and Artifact Pointers final state is current | yes | Pending |\n| Promotion lock verified before final signoff | yes | Pending |\n\nDecision: Fail\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":11548,"content_sha256":"5e73a0b4743aef60e613609d44ff5da7750a17227287a2c5ed9749505e2636c8"},{"filename":"assets/templates/progress.md","content":"# Progress Ledger\n\nThis file is the compact resume state for the task. Hard rule: re-read it after every compaction, resume, retry, reconnect, or new coding session before continuing work.\n\n## Resume Instructions\n\n- Use this file and `CURRENT_PHASE.txt` to identify current status after compaction, resume, retry, reconnect, or new coding session; then re-read `SKILL.md`, `open-gaps.md`, the current phase artifact, and the current phase reference before choosing the next action.\n- When `CURRENT_PHASE.txt` changes, re-read the required current phase reference before doing any work in the new phase.\n- Re-read the refs below after compaction, resume, retry, reconnect, or new coding session; keep paths repo-relative and update this section when Phase 1 selects task-relevant skill files.\n- Treat refs as read-only unless the task explicitly asks to edit that exact reference file. This is especially strict for `.tasks/task.md`, `.tasks/domain.md`, `.tasks/files/`, and selected skill files under `.agents/skills/`.\n- If this file disagrees with phase artifacts, trust the earliest failing phase artifact and repair this file.\n\n## Refs\n\nThese are starting refs. Edit notes as the task clarifies which files are relevant.\n\n| Ref | Path | Use | Notes |\n| --- | --- | --- | --- |\n| Repo instructions | `AGENTS.md` | Binding development instructions for this repo | Read in Phase 1 and after compaction/resume; extract task-relevant rules before planning |\n| Task file | `.tasks/task.md` | Canonical task body and completion command source | Read in Phase 1 and after compaction/resume |\n| Domain file | `.tasks/domain.md` | Domain, brand, and product context | Read in Phase 1 and after compaction/resume |\n| Task files folder | `.tasks/files/` | Task attachments and supporting inputs | Enumerate in Phase 1; read or inspect every task attachment/supporting file before planning |\n| Task attachments/supporting files | Pending | Task-provided files that must influence the plan | Replace with repo-relative file paths after Phase 1 reads or inspects them |\n| Skill files folder | `.agents/skills/` | Available skill files; select only relevant skill files | Do not bulk-read irrelevant skill files |\n\n## Resume Pointer\n\n| Field | Value |\n| --- | --- |\n| Current phase | Pending |\n| Current phase artifact | Pending |\n| Current phase reference | Pending |\n| Earliest failing phase, if any | Pending |\n| Last completed gate | Pending |\n| Next local action | Pending |\n| External blocker, if any | Pending |\n| Last updated | Pending |\n\n## Task Snapshot\n\n| Item | Summary |\n| --- | --- |\n| Task goal | Pending |\n| Target repo | Pending |\n| Key constraints | Pending |\n| Current implementation direction | Pending |\n| MITB task completion command | Pending |\n\n## Current Phase Pointers\n\nKeep this section compact. Do not copy full file inventories from phase artifacts. Point to the phase artifact for details and list only high-signal active files needed to resume immediately.\n\n| Pointer | Path or value | Why it matters |\n| --- | --- | --- |\n| Current phase artifact | Pending | Detailed evidence and file lists for the current phase |\n| Current phase reference | Pending | Detailed process to follow now |\n| Key active files | Pending | Only files needed to resume the next local action quickly |\n| Last command or verification proof | Pending | Latest useful proof, not full logs |\n\n## Phase Artifact Index\n\nUpdate status and notes only. Full evidence belongs in each phase artifact.\n\n| Phase | Status | Phase artifact | Phase reference | Compact note |\n| --- | --- | --- | --- | --- |\n| 0 - Artifact reset | Pending | `task-workflow/phase-0-artifact-reset.md` | `references/phase-0-1-startup-research.md` | Pending |\n| 1 - Research | Pending | `task-workflow/phase-1-task-research.md` | `references/phase-0-1-startup-research.md` | Pending |\n| 2 - Primary execution | Pending | `task-workflow/phase-2-execution.md` | `references/phase-2-4-execution-integrity.md` | Pending |\n| 3 - Second execution and check/lint validation | Pending | `task-workflow/phase-3-second-execution.md` | `references/phase-2-4-execution-integrity.md` | Pending |\n| 4 - Unit coverage | Pending | `task-workflow/phase-4-unit-coverage.md` | `references/phase-2-4-execution-integrity.md` | Pending |\n| 5 - Playwright verification | Pending | `task-workflow/phase-5-playwright-verification.md` | `references/phase-5-7-verification-signoff.md`; `references/playwright-interactive.md` | Pending |\n| 6 - E2E coverage | Pending | `task-workflow/phase-6-e2e-verification.md` | `references/phase-5-7-verification-signoff.md` | Pending |\n| 7 - Final signoff | Pending | `task-workflow/phase-7-final-signoff.md` | `references/phase-5-7-verification-signoff.md` | Pending |\n\n## Artifact Pointers\n\nKeep pointers only. Do not duplicate detailed lists already recorded in phase artifacts.\n\n| Artifact group | Path(s) | Details live in | Status / notes |\n| --- | --- | --- | --- |\n| Resume and gap files | `task-workflow/CURRENT_PHASE.txt`; `task-workflow/open-gaps.md`; `task-workflow/progress.md` | current marker, gap ledger, this resume index | Pending |\n| Phase artifacts | See Phase Artifact Index | phase-owned gate files | Pending |\n| Playwright evidence | `task-workflow/playwright/`; `task-workflow/screenshots/` | `task-workflow/phase-5-playwright-verification.md` | Pending |\n| Managed Playwright lifecycle helper | `task-workflow/scripts/playwright-lifecycle.mjs`; `task-workflow/runtime/` | `task-workflow/phase-5-playwright-verification.md`; `task-workflow/phase-6-e2e-verification.md`; `task-workflow/phase-7-final-signoff.md` | Pending |\n| Managed server probe helper | `task-workflow/scripts/server-probe.mjs`; `task-workflow/runtime/` | `task-workflow/phase-2-execution.md`; `task-workflow/phase-3-second-execution.md` when a narrow runtime probe is required | Pending |\n| Check/build checkpoint | repo-native check/lint/build output or `task-workflow/runtime/` logs | `task-workflow/phase-3-second-execution.md` | Pending |\n| Production/live DB safety | DB/migration/setup evidence in execution and verification artifacts | `task-workflow/phase-2-execution.md`; `task-workflow/phase-3-second-execution.md`; `task-workflow/phase-5-playwright-verification.md`; `task-workflow/phase-6-e2e-verification.md` | Pending |\n| Unit evidence | `task-workflow/runtime/` or exact pasted command output | `task-workflow/phase-4-unit-coverage.md` | Pending |\n| E2E evidence | `task-workflow/runtime/` or exact pasted command output | `task-workflow/phase-6-e2e-verification.md` | Pending |\n| Task completion evidence | `.tasks/task.md`; `/workspace/mitb/task_complete.mjs` | `task-workflow/phase-7-final-signoff.md` | Pending |\n\n## Resume Rules\n\n- After compaction, resume, retry, reconnect, or new coding session, use this file and `CURRENT_PHASE.txt` to identify current status, then re-read `SKILL.md`, `open-gaps.md`, the current phase artifact, and the current phase reference.\n- After any phase promotion or marker change, read the required phase reference from the Phase Artifact Index before starting work in that phase.\n- After compaction, resume, retry, reconnect, or new coding session, also re-read the repo-relative files listed in `Refs`, including `AGENTS.md`, `.tasks/task.md`, `.tasks/domain.md`, relevant task attachments/supporting files from `.tasks/files/`, and only the relevant skill files selected from `.agents/skills/` in Phase 1.\n- If this file and `CURRENT_PHASE.txt` disagree, inspect the phase artifacts and continue from the earliest failing phase.\n- Use Current Phase Pointers and Phase Artifact Index to find the detailed phase artifact and reference before choosing the next action.\n- Use Artifact Pointers only to locate artifact groups; read the owning phase artifact for details.\n- This file is a summary and resume map, not proof by itself. Phase artifacts and gate decisions remain the proof.\n- Do not produce a final response while this file says any phase is `Pending`, `Fail`, `In progress`, or locally repairable.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":8024,"content_sha256":"bf7626df3cc0d5dd9b7704763eef31369d02559678e442fc91851ee4e95bcb0d"},{"filename":"references/phase-0-1-startup-research.md","content":"# Startup And Research\n\nUse this reference for Phase 0 and Phase 1.\n\nThese phases establish the task workspace and produce the accepted implementation plan. They are internal gates, not user confirmation points. When a gate passes, continue automatically. When a gate fails, repair the phase and rerun the gate automatically.\n\nThis is a looped gate workstream: Phase 0 and Phase 1 are not complete until their artifacts pass their gates. A failing score, missing evidence, stale placeholder, or blocked promotion means stay in the same phase, repair the work, update the artifact, rescore, and repeat. Do not stop or ask the user to continue when a local repair is available.\n\n## Startup Authority\n\n\u003cstartup_authority>\n\nThe artifact trail is the source of truth for the run.\n\nPhase 0 exists so a new task never inherits stale proof from an older task. The agent owns artifact creation directly by copying templates from `assets/templates/` and the managed lifecycle helpers from `assets/scripts/`; no scaffold script is required.\n\n`task-workflow/progress.md` is the compact resume ledger. It must be reset with the rest of `task-workflow/`, copied from template, and updated in Phase 0 before promotion. Hard rule: after compaction or resume, use `progress.md` and `CURRENT_PHASE.txt` to identify current status, then read `SKILL.md`, `open-gaps.md`, the current phase artifact, and the required current phase reference before choosing the next action.\n\nAt every phase start or promotion, read the required reference file or files for the new `CURRENT_PHASE.txt` marker before doing phase work. Phase 0 and Phase 1 both use this reference.\n\n### MITB Inputs\n\nWhen running in MITB, use repo-relative inputs from the target repo:\n\n- task body: `.tasks/task.md`\n- domain and brand context: `.tasks/domain.md`\n- attached task files: `.tasks/files/`\n- available skill files: `.agents/skills/`\n- workflow skill: `.agents/skills/task-workflow/SKILL.md`\n\n### Required Reads\n\n`AGENTS.md` is the target repo's binding development-instructions file. It controls project-specific architecture, type safety, test expectations, UX standards, commands, code style, docs, prohibited patterns, and completion rules. Extract the task-relevant rules from it before planning, and read any docs it explicitly requires for the task.\n\nPhase 1 must enumerate `.tasks/files/` even when it is empty and read or inspect every task attachment/supporting file before planning. Available skill files are stored under `.agents/skills/`: select and read only relevant skill `SKILL.md` files from `.agents/skills/`. Do not bulk-read every skill file under `.agents/skills/`.\n\n### Read-Only Inputs\n\nThe Phase 1 inputs are read-only. `AGENTS.md`, `.tasks/task.md`, `.tasks/domain.md`, `.tasks/files/`, selected skill files under `.agents/skills/`, and other reference files must be read, cited, and summarized only. Do not write to them. Do not rewrite, normalize, consolidate, trim, clean up, reformat, or \"fix\" these files. This is especially strict for files under `.tasks/`: they are canonical MITB task inputs, not workflow artifacts. If they conflict or look stale, record the issue in the Phase 1 artifact or `open-gaps.md` and keep going from the safest interpretation.\n\n### Source-Edit Boundary\n\nDo not inspect implementation files in app, server, tests, packages, src, or equivalent source directories before Phase 0 artifacts exist.\nDo not edit implementation files before Phase 1 passes.\nDo not generate build outputs, route typegen, databases, migrations, or source artifacts before Phase 1 passes.\nDo not edit implementation files after Phase 1 passes until `task-workflow/CURRENT_PHASE.txt` says `phase-2-execution`.\nWhen filling phase artifacts, keep evidence auditable. If a template row is condensed, the same semantic evidence must still be present.\n\n\u003c/startup_authority>\n\n## Phase 0: Artifact Reset And Scaffolding\n\nPhase 0 is the first action after reading `SKILL.md`.\n\n1. Identify the target repo root.\n2. Delete only the existing `task-workflow/` directory in the target repo. Treat it as stale previous-task state; do not reuse old artifacts for the new task.\n3. Recreate:\n - `task-workflow/`\n - `task-workflow/playwright/`\n - `task-workflow/screenshots/`\n - `task-workflow/scripts/`\n - `task-workflow/runtime/`\n - `task-workflow/CURRENT_PHASE.txt`\n4. Copy the templates from `assets/templates/` into `task-workflow/`:\n - `progress.md`\n - `phase-0-artifact-reset.md`\n - `phase-1-task-research.md`\n - `phase-2-execution.md`\n - `phase-3-second-execution.md`\n - `phase-4-unit-coverage.md`\n - `phase-5-playwright-verification.md`\n - `phase-6-e2e-verification.md`\n - `phase-7-final-signoff.md`\n - `open-gaps.md`\n5. Copy managed helper assets into `task-workflow/scripts/`:\n - `assets/scripts/playwright-lifecycle.mjs` to `task-workflow/scripts/playwright-lifecycle.mjs`\n - `assets/scripts/server-probe.mjs` to `task-workflow/scripts/server-probe.mjs`\n6. Set `task-workflow/CURRENT_PHASE.txt` to `phase-0-artifact-reset`.\n7. Fill `task-workflow/phase-0-artifact-reset.md` with:\n - repo root\n - task file or task source\n - skill path\n - reset evidence\n - copied template evidence\n - copied lifecycle helper evidence\n - marker before promotion: `phase-0-artifact-reset`\n - confirmation that no implementation files were edited\n8. Fill `task-workflow/progress.md` with the task source, current phase, Phase 0 reset summary, seeded Resume Instructions, seeded Refs for `AGENTS.md`, `.tasks/task.md`, `.tasks/domain.md`, `.tasks/files/`, the task attachment location, the `.agents/skills/` location, Current Phase Pointers, Phase Artifact Index, Artifact Pointers, and next local action.\n9. After every other Phase 0 gate row passes, set `task-workflow/CURRENT_PHASE.txt` to `phase-1-task-research`.\n10. Re-read this required reference for Phase 1 before doing Phase 1 work.\n11. Update `task-workflow/progress.md` so current phase, current phase reference, and next local action match Phase 1.\n12. Re-open `task-workflow/phase-0-artifact-reset.md`, record marker after promotion as `phase-1-task-research`, then mark the Phase 0 decision.\n\n## Phase 0 Score\n\nScore `task-workflow/phase-0-artifact-reset.md` against `10` items:\n\n- `2` previous-task artifact reset items\n- `4` required artifact and resume-ledger items, including the phase marker, progress ledger, and hard resume rule\n- `2` required directory creation items\n- `1` task and repo identity item\n- `1` no-source-edit discipline item\n\nCritical failures:\n\n- any implementation file edited before Phase 0 passes\n- any build output, route typegen, database, migration, test output, or source artifact generated before Phase 1 passes\n- old previous-task `task-workflow/` reused instead of reset\n- missing required artifact file\n- missing `task-workflow/scripts/playwright-lifecycle.mjs`\n- missing `task-workflow/scripts/server-probe.mjs`\n- missing or stale `task-workflow/progress.md`\n- Phase 0 artifact does not record the progress-ledger hard resume rule\n- copied templates replaced by loose prose\n- `CURRENT_PHASE.txt` missing or wrong after the gate\n\nPass gate:\n\n- score is `10/10`\n- all required artifacts exist\n- old previous-task workflow artifacts were cleared\n- no app/source files were edited\n- marker before promotion was `phase-0-artifact-reset`\n- marker after promotion is `phase-1-task-research`\n\nIf this gate fails, stay in Phase 0.\n\n## Phase 1: Task Intake And Codebase Research\n\n1. Set `task-workflow/CURRENT_PHASE.txt` to `phase-1-task-research`.\n2. Read the complete task body. In MITB, `.tasks/task.md` is the canonical task workspace and may include completion commands; read it even if the prompt also includes the task text.\n3. Immediately read the target repo root `AGENTS.md` as binding development instructions. Extract task-relevant rules for architecture, type safety, tests, UX, commands, code style, docs, prohibited patterns, and completion.\n4. Read `.tasks/domain.md`. This is the MITB domain and brand context. Also discover and read other repo-local domain files only when they are relevant to the task.\n5. Enumerate `.tasks/files/`, even if it is empty.\n6. Read or inspect every task attachment/supporting file in `.tasks/files/` before planning. For binary or media files, use the appropriate local inspection method and record what was learned; do not treat a directory listing as reading the file.\n7. Discover available skill files from the prompt's Skills section and `.agents/skills/`.\n8. Select only task-relevant skills. Use the task description, domain file, prompt-provided skill descriptions, and filenames or directory names inside `.agents/skills/` to choose candidates. If metadata is needed, inspect lightweight metadata for candidates, then read only selected relevant skill `SKILL.md` files from `.agents/skills/`.\n9. Do not bulk-read every skill body under `.agents/skills/`. Irrelevant skills waste context and can pollute the task plan.\n10. Keep every instruction, task, domain, task-file, attachment, and selected skill reference read-only. If an apparent correction is needed, record it as a gap; do not edit the reference file.\n11. Record every task attachment/supporting file read or inspected, every selected relevant skill file, and the reason each was relevant in `task-workflow/phase-1-task-research.md`.\n12. Read any other docs or local instructions required by `AGENTS.md` or the task domain.\n13. Cite target repo instruction, domain, task file, task files folder, task attachments, and selected local skill files with repo-relative paths only. Do not depend on the task file to list them, and do not record sandbox-specific absolute paths for these files.\n14. Inspect the existing codebase before planning edits.\n15. Identify the affected routes, components, services, schemas, stores, tests, scripts, config, and docs.\n16. Record the exact files and patterns that should be reused.\n17. Record assumptions, constraints, non-goals, and risks.\n18. Write an ordered implementation plan.\n19. Write the verification and test plan.\n20. Do not edit implementation files before this phase gate passes.\n21. Update `task-workflow/progress.md` with the compact task summary, repo instructions read, domain/context files read, task attachments/supporting files read, selected relevant skill files, implementation direction, verification plan, risks, current phase artifact/reference pointers, only high-signal active files if needed, and next local action.\n22. Update the Refs section in `task-workflow/progress.md` so future compaction/resume reads `AGENTS.md`, `.tasks/task.md`, `.tasks/domain.md`, relevant task attachments/supporting files from `.tasks/files/`, and only the relevant skill files selected from `.agents/skills/` in Phase 1.\n23. After every Phase 1 gate requirement passes, set `task-workflow/CURRENT_PHASE.txt` to `phase-2-execution`.\n24. Re-read `references/phase-2-4-execution-integrity.md` before doing Phase 2 work.\n25. Update `task-workflow/progress.md` so current phase, current phase reference, and next local action match Phase 2.\n26. Record that Phase 2 was promoted only after Phase 1 passed and the required Phase 2 reference was loaded.\n\n## Research Surface\n\nResearch must be specific enough that another agent could execute from the artifact alone.\n\nRecord:\n\n- task goal and user-visible outcome\n- technical goal\n- in-scope and out-of-scope work\n- repo instructions and docs read\n- task-relevant development rules extracted from `AGENTS.md`\n- repo-local domain files read, including `.tasks/domain.md`\n- every task attachment/supporting file from `.tasks/files/` read or inspected, with what it contributed to the plan\n- selected relevant local skill files from `.agents/skills/` read, with reasons for selection\n- repo-relative paths for target repo instruction, task, domain, task attachments/supporting files, and selected skill files\n- affected architecture\n- existing repo patterns to reuse\n- files or directories inspected\n- implementation plan in execution order\n- verification and test plan\n- risks, assumptions, and unresolved questions\n\nThe Phase 1 artifact is not notes after the fact. It is the plan that controls Phase 2.\n\n## Phase 1 Score\n\nScore `task-workflow/phase-1-task-research.md` against `30` items:\n\n- `6` task understanding items\n- `6` instruction and documentation items\n- `8` codebase research items\n- `6` ordered implementation plan items\n- `4` risk and verification-plan items\n\nCritical failures:\n\n- task body not read completely\n- root `AGENTS.md` not read and cited\n- task-relevant `AGENTS.md` development rules not extracted before planning\n- `task-workflow/progress.md` not updated with enough context, current phase pointers, phase artifact index, and artifact pointers to resume Phase 2 after compaction\n- `.tasks/domain.md` not read and cited\n- relevant repo-local domain files or relevant local skill files from `.agents/skills/` not read and cited\n- `.tasks/files/` not enumerated, even if empty\n- any task attachment/supporting file in `.tasks/files/` not read or inspected before planning\n- irrelevant skill files in `.agents/skills/` bulk-read instead of selecting only task-relevant skills\n- selected relevant skill files from `.agents/skills/` are not recorded in `task-workflow/progress.md` for compaction/resume reread\n- `AGENTS.md`, `.tasks/task.md`, `.tasks/domain.md`, `.tasks/files/`, selected skill files under `.agents/skills/`, or other reference inputs edited without an explicit task requirement to edit that exact file\n- `task-workflow/progress.md` does not point to the Phase 1 artifact for researched files and planned edit targets\n- target repo instruction/task/domain/task-file/skill files recorded only as sandbox absolute paths instead of repo-relative paths\n- codebase not inspected before implementation planning\n- plan does not cite concrete files or directories\n- planned work ignores tests, verification, or docs when they are required by the task\n- planned work violates or omits applicable `AGENTS.md` development rules\n- implementation files edited before Phase 1 passes\n- implementation files edited while `CURRENT_PHASE.txt` still says `phase-1-task-research`\n- Phase 1 artifact omits the task understanding, instructions/docs read, codebase research, implementation plan, or verification plan while claiming pass\n\nPass gate:\n\n- score is at least `28/30`\n- every critical research item passes\n- the plan cites concrete files or directories\n- `AGENTS.md`, `.tasks/task.md`, `.tasks/domain.md`, every task attachment/supporting file in `.tasks/files/`, relevant repo-local domain files, and selected relevant local skill files from `.agents/skills/` are read or inspected and cited with repo-relative paths\n- task-relevant development rules from `AGENTS.md` are recorded and reflected in the plan\n- reference inputs, especially `.tasks/*`, remain unchanged unless the task explicitly required editing that exact reference file\n- `task-workflow/progress.md` lists `AGENTS.md`, `.tasks/task.md`, `.tasks/domain.md`, relevant task attachments/supporting files from `.tasks/files/`, and selected relevant skill files from `.agents/skills/` for reread after compaction\n- `task-workflow/progress.md` points to the Phase 1 artifact for researched files/directories and planned edit targets\n- the plan distinguishes implementation, tests, docs, and verification work\n- no known ambiguity remains unhandled\n- `CURRENT_PHASE.txt` is promoted to `phase-2-execution` only after Phase 1 passes\n\nIf this gate fails, stay in Phase 1.\n\n## Promotion Rule\n\nPhase 2 is blocked until Phase 1 passes in writing.\n\nBefore setting `task-workflow/CURRENT_PHASE.txt` to `phase-2-execution`, re-open:\n\n- `task-workflow/phase-0-artifact-reset.md`\n- `task-workflow/phase-1-task-research.md`\n- `task-workflow/progress.md`\n\nBoth phase artifacts must show `Decision: Pass`, passing scores, all critical items passing, and no placeholder `Pending` rows in required evidence or gate sections. `progress.md` must identify Phase 2 as the current phase, summarize Phase 0 and Phase 1, brief the created artifact files, and state the next local action.\n\nAfter this promotion, Phase 2 implementation is allowed only because the marker now says `phase-2-execution`. If any source file changes while the current marker still says `phase-1-task-research`, the run has failed.\n\nDo not stop after research to ask whether to continue. The gate exists so the agent can continue autonomously once the research artifact is strong enough.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":16528,"content_sha256":"55aa8698cd621815846f26d2136448422decb68e2ba0a7cf95cc819335addc1e"},{"filename":"references/phase-2-4-execution-integrity.md","content":"# Execution, Integrity, Check/Lint Validation, And Unit Coverage\n\nUse this reference for Phase 2, Phase 3, and Phase 4.\n\nThese phases turn the accepted research plan into working code, then force a second implementation/integrity pass, check/lint validation, and a dedicated unit-test coverage decision before browser verification begins. They are internal gates, not user confirmation points. When a gate passes, continue automatically. When a gate fails, fix the work and rerun the gate automatically. Do not end an OpenCode turn while Phase 2, Phase 3, or Phase 4 is unblocked and the current phase artifact still says `Decision: Fail`.\n\nThis is a looped gate workstream: Phase 2, Phase 3, and Phase 4 are not complete until their artifacts pass their gates. A failing score, missing evidence, broken check/lint evidence, stale gap, placeholder row, weak implementation, or weak unit-test decision means stay in the same phase, repair the work, update the artifact, rescore, and repeat. Do not stop or ask the user to continue when a local repair is available.\n\n## Implementation Authority\n\nImplementation authority is:\n\n1. the task body\n2. target repo instructions, especially the task-relevant development rules extracted from `AGENTS.md`\n3. Phase 1 research and implementation plan\n4. existing repo contracts, route patterns, service boundaries, components, and unit-test structure\n\nIf implementation discovers that the Phase 1 plan is wrong, record the plan change in the current phase artifact and cite the file or runtime evidence that forced the change. Return to Phase 1 only when the original research is no longer adequate.\n\n## Gap Ledger Invariant\n\n`task-workflow/open-gaps.md` is part of every Phase 2, Phase 3, and Phase 4 gate.\n\n- Record required work that is skipped, blocked, deferred, or discovered late.\n- Give every gap a status, owner or next phase, and evidence.\n- When a later phase closes a gap, update `open-gaps.md` in that same phase. Do not leave the gap `Open` and only claim resolution in the phase artifact.\n- Template placeholder rows such as `Pending | Pending | Pending` are not valid ledger evidence after Phase 0. Replace them with real gap rows or explicit `None currently recorded` rows.\n- Before promotion, re-open `open-gaps.md` and verify that no critical gap remains open and no passed phase is listed as the next action for an open gap.\n\n## Progress Ledger Invariant\n\n`task-workflow/progress.md` is part of every Phase 2, Phase 3, and Phase 4 resume path.\n\n- After compaction, resume, retry, reconnect, or new coding session, use `progress.md` and `CURRENT_PHASE.txt` to identify current status, then re-read the main `SKILL.md`, `open-gaps.md`, the current phase artifact, and the required current phase reference before choosing the next action.\n- At every Phase 2, Phase 3, or Phase 4 start or promotion, re-read this reference before doing phase work.\n- Keep it current after each meaningful Phase 2 work packet, Phase 3 gap-closure pass, Phase 4 check/fix loop, blocker, gate result, and phase promotion.\n- It must summarize enough context from earlier phases to continue without conversation memory: task goal, key repo instructions, implementation direction, active work queue, latest checks, and next local action.\n- Its Current Phase Pointers must identify the current phase artifact, current reference, next local action, and only high-signal active files needed to resume immediately.\n- Its Phase Artifact Index and Artifact Pointers must point to the phase-owned artifacts where detailed researched-file, edited-file, check/log, and test evidence lives.\n- If `progress.md` says a later phase than the earliest failing phase artifact, the phase artifact wins. Correct `CURRENT_PHASE.txt` and `progress.md`, then continue from the earliest failing phase.\n\n## Code And Phase Boundary Discipline\n\n\u003ccode_phase_boundary_discipline>\n\nFollow the target repo's code rules and the task-relevant development rules extracted from `AGENTS.md`. Do not make the task pass by weakening code quality.\n\n### Do\n\n- Prefer existing contracts, schemas, route patterns, services, and local test structure when a test phase actually owns coverage work.\n- Avoid broad unsafe type assertions such as `as never`, `as any`, or equivalent type erasure unless a narrow repo-specific boundary genuinely requires it and the artifact explains why.\n- Do not silence lint, type, or runtime warnings introduced by this task.\n\n### Phase Ownership\n\n- Phase 2 owns implementation work. Defer unit, E2E, and browser verification work to the owning later phases.\n- Phase 3 owns connected-place repair, implementation integrity review, and check/lint/build. Record unit/E2E coverage questions for the owning later phase.\n- Phase 4 owns unit-test coverage decisions. It may add, update, remove, or skip unit/service/component/integration-style tests and must record why.\n- Phase 6 owns E2E coverage decisions. Do not move E2E remove/update/add work into Phase 2, Phase 3, or Phase 4.\n- If coverage work happens before its owning phase, treat it as early evidence to be reconciled. Carry the diff and command output into Phase 4 or Phase 6; do not fail the workflow solely because the evidence was produced early.\n\n\u003c/code_phase_boundary_discipline>\n\n## Tool And Command Discipline\n\n\u003ctool_command_discipline>\n\nThese phases must not stall on unbounded tools.\n\n### File And Command Safety\n\n- After every gate-relevant file write or patch, read back the target file or inspect the diff before relying on the change.\n- If a write, patch, generated file, or command result is invalid, partial, missing, or uncertain, repair that exact issue before starting the next packet.\n- Use bounded commands for checks and tests. If a command appears hung or idle, stop it, record the evidence, and continue with the next local recovery path.\n- Protect production/live workspace databases as job-critical user data. `.dbs/database.db`, repo default user-data DB paths, and any equivalent live app database are not fixtures or scratch files. Deleting, resetting, reseeding, truncating, manipulating, or corrupting them can destroy user work and can cause the user to lose his job.\n- The only allowed production/live database action is the app's required migration command for a real schema change. Record the migration reason, command, target DB/source, and result as phase evidence. This does not permit working on `.dbs/database.db` or any production/live DB. Do not run manual queries, seed, reset, fixture setup, test setup, Playwright, E2E, direct SQLite, data repair, delete, truncate, cleanup, or any data manipulation against production/live DB.\n- If Phase 2 or Phase 3 creates or changes a migration, apply it to the production/live default DB with the repo's app migration command once after the migration exists and before Phase 3 passes. This is mandatory because the user uses the completed app immediately; an unapplied migration means the implementation is not actually delivered. Rerun only if the migration changed after the prior run or the prior migration run failed/incomplete.\n- If a command mentions `db`, `database`, `sqlite`, `migrate`, `seed`, `fixture`, `reset`, `.dbs`, `rm`, `truncate`, or similar data-state words, prove the target is either the legitimate migration target or an isolated repo-owned test DB before running it. If the target is unknown, assumed safe, or production/live for non-migration work, do not run it.\n- Do not run long-lived dev servers, watchers, or interactive CLIs in the foreground as the active command. If a server is needed before Phase 5 for an API/runtime probe, use `task-workflow/scripts/server-probe.mjs`. Server readiness is usually 5-10 seconds; use 15-20 seconds as the normal budget and 30 seconds as the maximum startup-readiness limit. Do not use a 120 second readiness budget for server startup.\n- Use this helper shape for manual API/runtime probes. Pass a foreground server command; do not add `&`, `nohup`, `disown`, process-name cleanup, or fixed sleeps around it.\n\n```bash\nnode task-workflow/scripts/server-probe.mjs \\\n\t--server \"PORT=8080 node build/server/start.js\" \\\n\t--ready-url \"http://127.0.0.1:8080/health\" \\\n\t--ready-timeout-ms 20000 \\\n\t--run \"curl -fsS http://127.0.0.1:8080/health\"\n```\n\n- `server-probe.mjs` captures the server PID, writes `task-workflow/runtime/server-probe.pid`, preserves server output in `task-workflow/runtime/server-probe.log`, runs each `--run` command only after readiness, writes run logs as `task-workflow/runtime/server-probe-run-*.log`, and stops only the captured PID/process group.\n- If server readiness is not proven before the timeout, treat startup as failed, cite the helper's log evidence, and retry only with a corrected helper invocation or implementation change. If the helper reports that the ready URL already responds before startup, do not kill unknown processes; pick a task-owned port or stop the exact known PID outside the helper with evidence. Broad process-name cleanup is only for explicit sandbox-owned recovery when PID/port cleanup is impossible and the artifact records why.\n\n### Phase-Owned Commands\n\n- Phase 2 may run narrow non-test checks only when needed to unblock implementation or prove a specific work packet. Defer routine check, lint, build, unit/Vitest, E2E, Playwright, and repo combined check commands such as `pnpm run check` to owning later phases. If a compile/type issue blocks the current packet, `pnpm run check` or an equivalent combined static command is allowed only with blocker/result evidence. Keep Phase 2 evidence strict through artifact updates, readback, diff review, targeted search, and any narrow non-test unblock command that was actually needed.\n- Phase 3 owns the normal ordered check/build checkpoint after the implementation, connected-place sweep, and integrity review: run the repo's full check command first, use lint only as a focused static/backend diagnostic when useful or when the repo defines it as the static command, then run build if build is separate from check. Each command must run only after the prior command is passing unless the target repo combines them in one documented command.\n- Phase 4 owns unit-test commands. Phase 5 owns interactive browser verification. Phase 6 owns E2E coverage decisions. If Phase 2 or Phase 3 discovers unit/E2E/browser work may be needed, record it for the owning phase and continue the ordered gates.\n\n\u003c/tool_command_discipline>\n\n## Unit Test Coverage Discipline\n\n\u003cunit_test_coverage_discipline>\n\nPhase 4 owns the final unit-level remove/update/add/skip decision for Phase 2-4 work.\n\n### Decision Order\n\n- Use this decision order for every changed behavior: decide whether unit-level coverage is warranted; inspect connected existing tests; remove unnecessary existing tests; update connected existing tests when they can carry warranted coverage; add a new minimal test only when no existing test can carry a warranted core behavior; otherwise record `N/A`.\n- If the change is small, visual-only, incidental, or adequately proven by Phase 3 check/lint evidence and Phase 5 browser verification, record `N/A` and do not create a test.\n- Unit tests belong to stable core behavior: shared logic, contracts, permissions, critical state machines, parsers, calculations, data transforms, central stores, or reusable components whose behavior must stay strict.\n- Do not add unit tests for every simple component, incidental click, styling change, copy change, color change, spacing/layout tune, or one-off branch.\n\n> Strict default: `N/A`, update existing, or remove/simplify existing is preferred over adding tests. A new unit test is an exception that must earn its maintenance cost.\n\n### Existing-First Hygiene\n\n- Inspect existing unit/service/component/integration-style tests that touch the changed behavior. Decide whether each should be removed, updated, preserved, or left unrelated before any new-test decision.\n- Remove existing tests when they are unnecessary, obsolete, duplicated, convoluted, brittle, or protect non-core/non-complex behavior. Record why removal improves the test suite and preserve useful coverage elsewhere only when the behavior remains core.\n- Existing tests created by older agents are not protected by age or by passing status. If they are connected to the current work and fail the minimal/core test standard, remove, merge, or simplify them before adding new tests.\n\n### New Unit Test Burden Ledger\n\nBefore adding any new unit test file or case, record a burden ledger entry in `task-workflow/phase-4-unit-coverage.md`.\n\n| Required proof | Meaning |\n| --- | --- |\n| Stable/core risk | The behavior is a durable contract, parser, transform, permission, state machine, central store, or reusable component behavior that should fail loudly when broken. |\n| Existing-test inventory | Specific connected test files were read, not merely searched. |\n| Existing-first rejection | The artifact explains why updating, removing, or preserving existing tests cannot carry the warranted assertion. |\n| Minimal assertion set | Each new assertion protects a distinct required behavior; incidental rendering, text existence, styling, and one-off branches are excluded. |\n| Bulk check | If more than one new unit file, more than three new cases, or any helper/fixture/test-file split is introduced, the artifact itemizes why each remains necessary after reduction. |\n\nIf the ledger is missing or generic, do not add the test. If added tests cause max-lines, fixture churn, helper churn, slow broad commands, or repeated reruns, return to the ledger and reduce or remove tests before continuing.\n\n### Minimal Command Rules\n\n- Prefer the smallest useful unit-level command that proves the warranted coverage decision. Avoid broad unit directory globs unless the artifact explains why a connected unit area must run together.\n- A broad/full unit or Vitest suite may be used only as one final sanity check after warranted targeted and connected unit-level tests pass, or when the target repo explicitly requires it for this exact task, the task explicitly asks for it, global/shared infrastructure changed, or targeted/connected output is incomplete or stale.\n- Do not start with a full unit/Vitest suite unless the target repo explicitly requires it for this exact task or the artifact records a concrete global/shared reason that makes targeted-first impossible.\n- If a full unit/Vitest suite is justified and fails, inspect the failure and rerun the smallest failing or affected command. Do not immediately rerun the full suite.\n- Record every meaningful unit-level command in the Phase 4 artifact with its scope, why that scope was selected, any previous related failure, what changed since that failure, outcome, and next action. If no unit command is warranted, record `N/A` and the reason.\n- Do not rerun tests only for confidence. Rerun when related implementation changed, the test changed, config/environment changed, previous output was incomplete/stale, or the next run gathers a narrower diagnostic needed to fix a real failure.\n- Before rerunning the exact same failing command, record what changed since the previous run or what new evidence the rerun will collect. If nothing changed and the previous output is complete, inspect logs/state/output first, then change the implementation, test, command scope, or diagnostic strategy before running again.\n- When a failure appears pre-existing, order-dependent, or unrelated, keep the command scope narrow. Use the failing test/spec, logs, DOM/state, trace, screenshot, or persisted data evidence to prove the classification; do not run a full suite just to discover the global state.\n- If a command timed out or returned partial output, preserve or cite the useful output before choosing the next command.\n\n\u003c/unit_test_coverage_discipline>\n\n## Ordered Static And Build Checkpoint\n\n\u003cordered_static_build_checkpoint>\n\nPhase 3 is the default checkpoint for the repo's check command, focused lint when useful, and build.\n\n### Do\n\n- Complete Phase 2 implementation packets first, including only warranted docs edits, while preserving packet-level evidence.\n- In Phase 3, inspect connected places first. If the task changed a contract, data shape, route, component, store, permission, migration, fixture, test helper, or shared UI pattern, find the connected callers/surfaces and update or defend them before check/build validation.\n- Run the repo's full check command first, usually `pnpm run check`. Use `pnpm run lint` only as a focused static/backend diagnostic or when the repo documents lint as the static command. Run build only when the repo has a separate build requirement not already covered by check. Record the repo command mapping instead of inventing duplicate commands.\n- When a command fails, inspect enough output to identify every visible issue group by file, contract, or root cause. Do not rely on truncated `tail`/`head` output as the only evidence if it can hide issue groups. If output is too large, use focused searches, reporter options, or a temporary full-output log; delete any temporary full-output log after extracting issue groups. Record issue groups, fixes, and rerun reason in the artifact, not large pasted logs.\n- Use targeted diagnostics or narrow fix checks only to prove a specific issue group. Before rerunning the same broad check, lint, or build command, fix every locally-fixable issue group visible from the prior broad output. Do not fix one line or one file and rerun the broad command while other visible related groups remain unhandled.\n- After check passes, move to any focused lint/build command that is still required. After build passes, record the reusable build evidence: command, output/log path, and the source/config/package/build inputs it depends on.\n\n### Reuse And Invalidation\n\n- Later phases reuse the Phase 3 build result unless code, config, package/dependency files, migrations/build inputs, or generated assets changed after that build, or unless the previous output is missing, partial, stale, or incompatible with the verification command. Do not run a later build as phase preparation, final confirmation, or because E2E is starting; use the recorded Phase 3 build output.\n- If a later phase changes code, return to the earliest affected phase, update artifacts, and rerun the relevant ordered command from the first invalidated point. Do not rerun build only for confidence when the Phase 3 build evidence is still current.\n\n\u003c/ordered_static_build_checkpoint>\n\n## Execution Order\n\nFollow the ordered implementation plan from `task-workflow/phase-1-task-research.md`.\n\nIf the task touches multiple layers, prefer this order unless the repo architecture demands a different one:\n\n1. contracts and schema changes\n2. persistence or data access changes\n3. service or API route changes\n4. frontend data access and state wiring\n5. route/page/component implementation\n6. docs required by changed behavior\n\nRecord deviations in the phase artifact. Do not backfill the checklist after coding without evidence.\n\nDuring Phase 2, artifact updates are incremental, not end-of-phase cleanup. Do not batch the whole implementation and then fill `phase-2-execution.md` later.\n\n## Turn Continuity During Execution\n\nAfter every edit, search, command, check/lint run, migration command, or unit-test command in Phase 2, Phase 3, or Phase 4:\n\n1. Re-check `task-workflow/CURRENT_PHASE.txt`.\n2. Re-open the current phase artifact.\n3. If the current phase artifact still says `Decision: Fail`, still has `Pending` gate evidence, or still has score `0/...`, immediately perform the next local repair, command, or artifact update.\n4. Do not return control to the user with a narrative checkpoint while the next local workflow action is available.\n\nExamples of invalid turn endings:\n\n- ending after \"check passes\" while any required lint/build, artifact scoring, or promotion remains\n- ending after writing route files while Phase 2 execution log is still blank\n- ending after Phase 3 check/lint validation while Phase 4 gate rows still say `Pending`\n- ending with Phase 2/3/4 artifact score `0/...`\n\nThe run may only stop in this workstream if Phase 4 has passed and the marker has advanced to Phase 5, or if a real external blocker is recorded with evidence.\n\n## Phase 2 Work Packet Discipline\n\nPhase 2 must be executed as small auditable work packets.\n\nOne work packet is at most:\n\n- one ordered implementation-plan row, or\n- one cohesive file group such as contracts, schema+migration, query+service pair, route registration, one route page, or one implementation check/fix loop.\n\nAfter each packet:\n\n1. Update `task-workflow/phase-2-execution.md` immediately.\n2. Update `task-workflow/progress.md` with the packet summary, current phase pointers, any high-signal active files needed for immediate resume, and next local action.\n3. Mark the relevant execution-log row `Done`, `In progress`, `Blocked`, or `Moved to gap`.\n4. Cite concrete files changed.\n5. Cite readback, diff evidence, targeted search, or a narrow non-test unblock command proving the packet's state. Defer routine check, lint, build, unit tests, E2E, and Playwright verification to their owning later phases unless a compile/type command was needed to unblock that specific packet.\n6. Update `task-workflow/open-gaps.md` immediately if the packet leaves work open.\n7. If any write or command failed, repair it and read back the affected file before continuing.\n8. Then continue to the next packet.\n\nDo not start frontend route work while backend/schema/service packets are complete but still recorded as `Pending`.\nDo not start Phase 4 or Phase 6 test work while implementation packets are complete but still recorded as `Pending`.\nDo not run broad verification or launch the app while the Phase 2 execution log still has only template-default `Pending` rows.\nDo not create E2E tests or standalone Playwright verification scripts while Phase 2 is still failing.\n\nIf source files have been edited and `phase-2-execution.md` still has a blank or all-`Pending` execution log, the next action must be updating the Phase 2 artifact, not more coding.\n\n## Phase 2: Primary Execution\n\n1. Set `task-workflow/CURRENT_PHASE.txt` to `phase-2-execution`.\n2. Re-open `task-workflow/CURRENT_PHASE.txt` and confirm it says `phase-2-execution` before editing implementation files.\n3. Confirm this reference is loaded as the required current phase reference before Phase 2 work starts.\n4. Keep the Phase 2 start checkpoint section in `task-workflow/phase-2-execution.md`; fill it before scoring the Phase 2 gate.\n5. Execute the Phase 1 plan in order, one auditable work packet at a time.\n6. Keep changes scoped to the task.\n7. Reuse existing contracts, patterns, components, services, and route shapes.\n8. Update docs when the task logically changes documentation.\n9. Do not write, update, remove, or run unit/Vitest, E2E, or Playwright tests in Phase 2.\n10. Immediately after each packet, record the completed or in-progress implementation step with file evidence before starting the next packet.\n11. Record any skipped, blocked, or deferred step in `task-workflow/open-gaps.md`.\n12. Replace `open-gaps.md` placeholder rows with real rows or explicit `None currently recorded` rows before scoring the gate.\n13. Update `task-workflow/progress.md` before scoring and before promotion, pointing to `task-workflow/phase-2-execution.md` for the full edited-file list and keeping only high-signal active files in progress.\n14. Do not run final signoff from this phase.\n15. After the Phase 2 gate passes, set `task-workflow/CURRENT_PHASE.txt` to `phase-3-second-execution`.\n16. Re-read this reference before doing Phase 3 work.\n17. Update `task-workflow/progress.md` so current phase, current phase reference, and next local action match Phase 3.\n\n## Phase 2 Score\n\nScore `task-workflow/phase-2-execution.md` against `40` items:\n\n- `10` implementation-plan completion items\n- `8` repo-pattern reuse items\n- `8` behavior and data wiring items\n- `6` docs and phase-boundary items\n- `4` scope-control items\n- `4` artifact evidence items\n\nCritical failures:\n\n- implementation files changed while `CURRENT_PHASE.txt` still says `phase-0-artifact-reset` or `phase-1-task-research`\n- Phase 2 gate passes while the phase start checkpoint is missing or still pending\n- Phase 2 source files are edited while the execution log remains blank or all `Pending`\n- Phase 2 work progresses while `task-workflow/progress.md` still has template-default `Pending` rows for the current phase, active work queue, or next local action\n- multiple implementation packets are completed while their execution-log rows still say `Pending`\n- failed or uncertain write/edit result is ignored instead of repaired and read back\n- long-lived command, watcher, or dev server is left running in the foreground until the session stalls\n- Phase 2 runs `pnpm run check` or an equivalent combined check/build command without a concrete compile/type blocker recorded before the command\n- required planned step missing without an open-gap entry\n- implementation bypasses existing repo contracts or boundaries without evidence\n- visible task behavior left fake or placeholder\n- broken import, undefined symbol, or unfinished marker remains\n- changed files do not match the researched plan and no plan-change evidence exists\n- broad unsafe casts or warning suppression introduced without a narrow evidence-backed reason\n\nPass gate:\n\n- score is at least `34/40`\n- every critical execution item passes\n- all planned required steps are done or explicitly moved to open gaps with a reason\n- changed files match the researched plan or the artifact explains why the plan changed\n- no obvious placeholder, dead code, broken import, or unfinished task marker remains\n- all gate-relevant writes have readback or diff evidence\n- no unbounded foreground server/watcher command is still running\n\nIf this gate fails, stay in Phase 2.\n\nA failing Phase 2 artifact is not a stopping state. Fix the implementation or artifact evidence, rerun the Phase 2 gate, and continue only after the artifact records a real pass.\n\n## Phase 3: Second Execution, Integrity, And Check/Lint Validation\n\n1. Set `task-workflow/CURRENT_PHASE.txt` to `phase-3-second-execution`.\n2. Confirm this reference is loaded as the required current phase reference before Phase 3 work starts.\n3. Re-read the task, Phase 1 plan, Phase 2 artifact, and open gaps.\n4. Review the implementation as if continuing someone else's work.\n5. Find missing routes, missing actions, weak wiring, incomplete state, fragile data flow, stale docs, and accidental scope creep.\n6. Review associated surfaces for consistency. If a UI element was changed in one place, find similar UI elements and update or explicitly defend consistency. If an API/service/schema change enables one flow, verify other callers, routes, mutations, queries, permissions, and docs that share that contract are covered.\n7. Review code integrity: imports, symbols, route/action wiring, schema/data shapes, state transitions, extracted `AGENTS.md` rules, unrelated edit risk, unsafe casts, warnings, and lasting `console.*`.\n8. Use code inspection, artifact review, targeted search, and narrow file/state checks for the second pass. Do not write, update, remove, or run unit/Vitest or E2E tests in Phase 3.\n9. Close every gap that can be closed from local context.\n10. Run the ordered check/build checkpoint: repo check, focused lint when useful, and build when separate. For each failure, identify visible issue groups, fix every locally-fixable group together, and rerun that same command before moving to the next command. If a temporary full-output log was needed to triage a large failure, delete it after extracting issue groups.\n11. Record reusable build evidence after a passing build, including when later phases may reuse it and what would invalidate it.\n12. Update `task-workflow/open-gaps.md` after each gap is closed or defended.\n13. Update `task-workflow/progress.md` with the second-pass findings, associated-surface review, integrity review, ordered check results, reusable build evidence, gap state, a pointer to `task-workflow/phase-3-second-execution.md` for repair-file details, and next local action.\n14. Record a second-pass diff review with file evidence.\n15. After the Phase 3 gate passes, set `task-workflow/CURRENT_PHASE.txt` to `phase-4-unit-coverage`.\n16. Re-read this reference before doing Phase 4 work.\n17. Update `task-workflow/progress.md` so current phase, current phase reference, and next local action match Phase 4.\n\nPhase 3 is mandatory. It is not a polish pass that can be skipped because Phase 2 seemed complete.\n\n## Phase 3 Score\n\nScore `task-workflow/phase-3-second-execution.md` against `30` items:\n\n- `8` task-alignment review items\n- `6` route/action/data wiring review items\n- `5` missing behavior and edge-flow items\n- `5` associated-surface consistency items\n- `3` docs and phase-boundary items\n- `3` gap-ledger quality items\n\nCritical failures:\n\n- critical open gap remains unresolved\n- second-pass artifact only repeats Phase 2 claims without independent review\n- a missing task requirement is found and not fixed or recorded\n- associated UI/API/data surfaces were not reviewed for consistency after a related change\n- a related surface was found inconsistent and neither fixed nor defended with evidence\n- Phase 3 passed without current check, focused lint if used, and build evidence, or without a recorded repo-specific reason one of those commands does not exist\n- Phase 3 reran check, lint, or build before all visible locally-fixable issue groups from the prior output were handled\n- Phase 3 kept a temporary full-output check/build log after extracting issue groups, or relied only on truncated output while issue groups may have been hidden\n- Phase 3 failed to record reusable build evidence after a passing build\n- Phase 3 failed to record implementation integrity review evidence\n- changed app/server source still contains `console.*` outside the active Phase 5 debug loop\n- remaining gap has no reason, owner, or next action\n\nPass gate:\n\n- score is at least `24/30`\n- every critical second-pass item passes\n- no unresolved critical gap remains\n- associated UI/API/data surfaces have been reviewed, fixed where needed, or explicitly defended\n- implementation integrity review is recorded and clean\n- check, focused lint if used, and build have passed in order, or missing commands have repo-specific evidence\n- reusable build evidence and invalidation conditions are recorded\n- every remaining non-critical gap has a concrete reason and owner\n- `task-workflow/open-gaps.md` is current after the second pass\n- implementation still matches the task scope\n\nIf this gate fails, stay in Phase 3.\n\nA failing Phase 3 artifact is not a stopping state. Continue the second-pass review, close or properly record gaps, rerun the gate, and continue only after the artifact records a real pass.\n\n## Phase 4: Unit Test Coverage Decision And Verification\n\n1. Set `task-workflow/CURRENT_PHASE.txt` to `phase-4-unit-coverage`.\n2. Confirm this reference is loaded as the required current phase reference before Phase 4 work starts.\n3. Re-open Phase 3 ordered check/build and integrity evidence. Confirm it is current. If code, config, package/dependency files, migrations/build inputs, or generated assets changed after Phase 3, return to Phase 3 and rerun the invalidated sequence from the first affected point. Do not rerun check, lint, or build inside Phase 4 when Phase 3 evidence is current.\n4. For each changed behavior, decide whether unit-level coverage is warranted. Use `N/A` when no unit-level test is needed.\n5. Inspect existing unit, service, component, and integration-style tests that touch the changed behavior, nearby contracts, central logic, or modified components.\n6. Remove, merge, or simplify existing tests when they are unnecessary, obsolete, duplicated, convoluted, brittle, or protect non-core/non-complex behavior. This includes tests added by older agents. Record the removal reason and diff/readback evidence. Preserve useful assertions elsewhere only when the behavior is still core.\n7. Update existing tests when they already own warranted behavior and still provide useful coverage.\n8. Add tests only when coverage is warranted, the behavior is stable/core, no existing test can carry it, and the New Unit Test Burden Ledger proves every new file/case is minimal.\n9. Run only the warranted unit-level commands. Use the smallest useful targeted command first. Use broad/full unit or Vitest only as a final sanity or explicit exception with an artifact reason.\n10. Inspect failures and fix root causes. Before rerunning the same command, record what changed or what new diagnostic evidence the rerun will collect.\n11. Record the coverage decision matrix, existing tests inspected, old-agent/excess-test pruning decision, tests removed, tests updated, tests added, new-test burden ledger, command output or `N/A`, failure/fix/rerun evidence, and remaining unit coverage gaps.\n12. Update `task-workflow/open-gaps.md` for any remaining unit-test coverage gap.\n13. Update `task-workflow/progress.md` with the unit coverage decision, command results, removed-test rationale, a pointer to `task-workflow/phase-4-unit-coverage.md` for details, and next local action.\n14. Confirm no unit test command or watcher remains running in the foreground from Phase 4.\n15. After the Phase 4 gate passes, set `task-workflow/CURRENT_PHASE.txt` to `phase-5-playwright-verification`.\n16. Read `references/phase-5-7-verification-signoff.md` and `references/playwright-interactive.md` before doing Phase 5 work.\n17. Update `task-workflow/progress.md` so current phase, current phase references, and next local action match Phase 5.\n\n## Phase 4 Score\n\nScore `task-workflow/phase-4-unit-coverage.md` against `30` items:\n\n- `8` unit coverage decision items\n- `6` existing-test review items\n- `6` remove/update/add quality items\n- `5` command execution or `N/A` evidence items\n- `5` artifact/gap evidence items\n\nCritical failures:\n\n- unit coverage decision matrix is missing, vague, out of order, or not tied to changed behavior and risk\n- connected existing-test inspection/action evidence is missing before a new unit test is added\n- new unit test was added when a connected existing test could have been updated instead\n- new unit test was added without a complete burden ledger proving stable/core risk, existing-test inventory, existing-first rejection, minimal assertions, and bulk reduction\n- new unit test added for small fixes, visual-only changes, incidental UI behavior, trivial button wiring, or non-core/non-complex behavior without a concrete risk reason\n- existing useful test deleted without preserving still-core coverage or defending why the behavior is no longer core\n- unnecessary, obsolete, duplicated, convoluted, brittle, or non-core/non-complex tests remain after Phase 4 identifies them as removable\n- connected old agent-created tests are preserved without a remove/update/preserve decision and reason\n- test bulk causes max-lines, helper churn, fixture churn, slow broad commands, or repeated reruns and the artifact does not re-evaluate/reduce the added tests\n- test removal lacks reason, diff/readback evidence, or effect on remaining coverage\n- warranted unit-level test was not run\n- unit command failure caused by this task remains unfixed\n- artifact records a pass for a required unit command without exact command output or cited repo-local log\n- broad/full unit or Vitest command is run before warranted targeted/connected unit-level tests, repeated after a clean pass, or run without a concrete artifact reason\n- check, lint, or build is rerun in Phase 4 while Phase 3 evidence is current and no invalidating change is recorded\n- tests are rerun only for confidence, or the same failing test command is rerun blindly without a material change, output-staleness, or diagnostic justification\n- test command, server, or watcher is left running without bounded cleanup\n- file edits that matter to the gate have no readback or diff evidence\n\nPass gate:\n\n- score is at least `28/30`\n- every critical unit-test coverage item passes\n- Phase 3 ordered check/lint/build evidence is current, or invalidated commands were rerun from the first affected point\n- unit coverage decision matrix is recorded, including `N/A` when no unit-level test is warranted\n- existing relevant unit-level tests were inspected before remove/update/add decisions\n- unit tests were removed, updated, added, or skipped according to the existing-first coverage decision\n- new unit tests, if any, have a complete burden ledger and minimal assertion proof\n- connected old or excessive tests were removed, simplified, updated, or explicitly defended\n- removed tests have a recorded rationale and readback/diff evidence\n- warranted unit commands pass, no unit command was warranted, or unrelated failures are evidenced\n- no unbounded foreground unit command remains active\n\nIf this gate fails, stay in Phase 4.\n\nA failing Phase 4 artifact is not a stopping state. If the unit coverage decision is weak, warranted tests fail, unnecessary tests remain, gap-ledger rows are stale, or gate rows are still `Pending`, fix the tests or artifact evidence, rerun the relevant unit command when warranted, rescore, and keep looping. Do not produce a final response from Phase 4 unless an external blocker has been fully recorded with evidence and cannot be solved locally.\n\n## Promotion Rule\n\nPhase 5 is blocked until Phase 4 passes in writing.\n\nBefore setting `task-workflow/CURRENT_PHASE.txt` to any later phase marker, re-open all prior phase artifacts through the current phase.\n\nPromotion requirements:\n\n- every prior phase artifact has `Decision: Pass`\n- the current phase artifact has `Decision: Pass`\n- every required score meets its threshold\n- all critical items pass\n- no required evidence table is still a template placeholder\n- no required gate row still says `Pending`\n- `task-workflow/open-gaps.md` has no placeholder `Pending` rows\n- `task-workflow/open-gaps.md` has no stale open gap owned by a passed phase\n- no critical gap remains open\n- `task-workflow/progress.md` matches the next phase and contains a current next local action\n\nIf any artifact fails this check, do not advance the marker. Set `task-workflow/CURRENT_PHASE.txt` to the earliest failing phase and continue there.\n\nCheck/lint validation is necessary but not sufficient. A green build does not replace interactive Playwright verification.\n\nDo not stop after Phase 2, Phase 3, or Phase 4 to summarize progress or wait for approval. The written gates decide whether to continue, rework, or return to an earlier phase without user intervention.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":38812,"content_sha256":"109b97186ffc5a0adc00848a08d785bbf08a77fa2130f4762ae2ca1afadc052a"},{"filename":"references/phase-5-7-verification-signoff.md","content":"# Verification And Signoff\n\nUse this reference for Phase 5, Phase 6, and Phase 7.\n\nThese phases prove the implementation through real browser interaction, the Phase 6 E2E coverage decision, and final artifact audit. They are internal verification gates, not user confirmation points.\n\nThis is a looped gate workstream: Phase 5, Phase 6, and Phase 7 are not complete until their artifacts pass their gates. A failing score, missing evidence, browser issue, weak test, stale gap, placeholder row, or incomplete final audit means stay in or return to the failing phase, repair the work, update the artifact, rescore, and repeat. Do not stop or ask the user to continue when a local repair is available.\n\n## Verification Authority\n\nVerification authority is:\n\n1. the task body\n2. Phase 1 implementation and verification plan\n3. changed files and behavior from Phase 2 and Phase 3\n4. Phase 4 unit-test coverage results\n5. real browser behavior observed through standalone Playwright scripts\n6. Phase 4 unit-test evidence and Phase 6 E2E evidence when a phase-owned coverage decision says durable coverage is warranted\n\nCheck/lint validation, builds, and tests are not substitutes for interactive Playwright verification.\nInteractive Playwright verification is not a reason to create regression tests when the Phase 4 or Phase 6 coverage decision says durable tests are not warranted.\n\n## Open Gaps Reconciliation\n\n`task-workflow/open-gaps.md` is a gate artifact during verification.\n\n- Phase 5 must resolve or update gaps about browser/runtime/manual verification.\n- Phase 6 must resolve or update gaps about E2E coverage proof.\n- Phase 7 must compare `open-gaps.md` against Phase 4, Phase 5, and Phase 6 artifacts. If a phase says a gap was fixed but `open-gaps.md` still lists it as `Open`, Phase 7 fails.\n- Critical gaps must be `Resolved`, `Closed`, or explicitly reclassified with evidence before signoff. They cannot remain `Open`.\n- Template placeholder rows such as `Pending | Pending | Pending` are not clean ledger evidence. Replace them with real gap rows or explicit `None currently recorded` rows before any verification gate passes.\n\n## Progress Ledger Reconciliation\n\n`task-workflow/progress.md` must stay current through verification and signoff.\n\n- After compaction, resume, retry, reconnect, or new coding session, use `progress.md` and `CURRENT_PHASE.txt` to identify current status, then re-read the main `SKILL.md`, `open-gaps.md`, the current phase artifact, and the required current phase reference before choosing the next verification action.\n- At every Phase 5, Phase 6, or Phase 7 start or promotion, re-read the required reference file or files for the current phase before doing phase work.\n- Update it after each Phase 5 browser issue/fix/rerun, Phase 6 E2E coverage decision or E2E run, Phase 7 audit result, blocker, gate pass/fail, and promotion.\n- It must summarize latest browser evidence, Phase 4 unit evidence, Phase 6 E2E evidence, fixed-wait review state, open gaps, current phase, earliest failing phase, and next local action.\n- Its Current Phase Pointers must identify the current phase artifact, current reference, next local action, and only high-signal active files needed to resume immediately.\n- Its Artifact Pointers must point to the phase-owned artifacts where unit evidence, Playwright scripts, screenshots, runtime logs, E2E files, and verification repair details live.\n- Phase 7 cannot pass if `progress.md` says any phase remains pending, in progress, failing, or locally repairable.\n\n## Verification Quality Discipline\n\n\u003cverification_quality_discipline>\n\nInteractive scripts and E2E tests must wait on user-visible state or app signals.\n\n### Do\n\n- Prefer role/text locators, URL assertions, network-visible state, persisted data checks, and `expect` retries.\n- Do not use fixed waits such as `waitForTimeout`, `setTimeout`, or `sleep(...)` in `task-workflow/playwright` or `tests/e2e`.\n- Do not use fixed waits as \"stabilization\", \"mutation timing\", \"dialog close\", \"navigation timing\", \"screenshot timing\", \"animation timing\", or \"followed by assertion\" helpers. These labels do not make a fixed wait acceptable.\n- Phase 5 and Phase 6 must inspect their interactive scripts and E2E tests before scoring the gate.\n- Record the files inspected and whether they contain any fixed waits.\n\n### Gate Rule\n\n- If any fixed wait is present, the phase fails. Remove every fixed wait, replace it with a deterministic Playwright wait/assertion, rerun the affected script/test, and review the files again before passing.\n- Remove debug-only Playwright scripts or include them in the fixed-wait review. Debug scripts under `task-workflow/playwright` are part of the verification surface.\n- A click, form submit, fill action, mutation trigger, screenshot timing note, or \"dialog animation\" note is not assertion/state-wait evidence.\n- Acceptable proof must cite a concrete post-action wait/assertion such as `locator.waitFor(...)`, `expect(locator).toBeVisible()`, `expect(locator).toContainText(...)`, `waitForURL(...)`, `waitForResponse(...)`, or a persisted-state assertion.\n- The review is zero-tolerance: Phase 5, Phase 6, and Phase 7 pass only when the artifact states that inspected verification files contain no fixed waits and cites deterministic waits/assertions used instead.\n\n\u003c/verification_quality_discipline>\n\n## Server And Command Discipline\n\n\u003cserver_command_discipline>\n\nVerification phases must not stall on foreground servers or watchers.\n\n### Lifecycle Ownership\n\n- Default to `task-workflow/scripts/playwright-lifecycle.mjs` for Playwright scripts, browser probes, app-server startup, readiness, Playwright browser preflight, bounded command execution, output capture, and cleanup.\n- The first Phase 5 browser command or Phase 6 Playwright/E2E command that needs a running app must establish lifecycle ownership before the browser/test runs. Do not point a script at an assumed existing `127.0.0.1` server first and then treat `fetch failed`, redirects, not-found data, stale DB state, stale build output, or wrong-port behavior as evidence for manual server management.\n- In Phase 6, existing repo E2E tests still run through the helper by default: put `pnpm exec playwright test ...` inside the helper's `--run` while the helper owns setup, server startup, readiness, browser preflight, output capture, and cleanup.\n- Use native Playwright with repo `webServer` ownership only when the helper cannot own the server for that exact command, such as a repo config that cannot target an already-running helper server and cannot have `webServer` bypassed for the selected spec. Record that reason before running the native command. A repo merely having a Playwright config, `webServer`, global setup, or existing E2E file is not enough.\n- The helper runs each `--setup` command before server startup with bounded timeout and `task-workflow/runtime/setup-*.log`, starts the app server in the background, records `task-workflow/runtime/server.pid`, writes `task-workflow/runtime/server.log`, polls the supplied readiness URL, runs each `--run` command with bounded timeout and `task-workflow/runtime/run-*.log`, and stops the server process group after the run unless `--keep-server` is explicitly used and justified.\n- Before choosing Phase 5 or Phase 6 setup/server commands, discover the repo's expected verification lifecycle from `AGENTS.md`, `package.json`, README/docs, Playwright config, and `tests/e2e` helpers. The expected pattern is a repo-owned setup command that prepares isolated E2E/test state and deterministic seed data, plus a repo-owned server command that starts the app against that isolated state. Use those commands when present. In older repos without named scripts, simulate the same pattern with the smallest repo-owned/test-only commands and record the mapping before running them.\n\n### Database And Server Safety\n\n- Database file paths are not a lifecycle-helper option. Do not set `E2E_DATABASE_FILE_PATH`, `DATABASE_PATH`, `DB_PATH`, or any similar database file/path variable with helper `--env`, `--setup`, `--server`, `--run`, native Playwright commands, or custom scripts. Do not change the repo's internal E2E/end-to-end database file path. Use the target repo's checked-in E2E/end-to-end database config or already-materialized environment. `.dbs/database.db` is the live workspace/production database, not a test database; production databases must never be used for testing. Any Playwright/E2E/end-to-end fixture write, reset, migration, seed, direct SQLite access, inspection-with-write-risk, cleanup, debugging, manual query, or data manipulation against `.dbs/database.db` is a critical failure.\n- Treat production/live database safety as job-critical. Deleting, resetting, reseeding, truncating, or corrupting the production database can destroy user work and can cause the user to lose his job. This is not an acceptable verification risk, even in a sandbox, because the workflow trains agents to touch live user data.\n- The only allowed production/live database action is the app's required migration command for a real schema change. This does not permit working on `.dbs/database.db` or any production/live DB. If the task creates or changes a migration, that migration must already have been run against the production/live default DB in the owning implementation/static-check phase, recorded as migration evidence, and not mixed with seed/reset/fixture/test cleanup. Verification phases may use only isolated test/E2E database state proved by repo-owned config.\n- Before any Phase 5 or Phase 6 command that mentions `db`, `database`, `sqlite`, `migrate`, `seed`, `fixture`, `reset`, `.dbs`, `rm`, `truncate`, or similar data-state words, record the target database path/source in the phase artifact. If the target is production/live, unknown, or only assumed safe, do not run the command.\n- Do not assume a backgrounded process started successfully just because the command returned. A server is ready only after the helper records a successful readiness result.\n- Do not compose manual server cleanup, fixed sleep, DB-delete, server-start, and Playwright command chains in Phase 5 or Phase 6. Put pre-server setup such as isolated test DB reset, test migration, test seed, or test fixture preparation into lifecycle `--setup \"...\"` for helper-owned runs. Treat setup plus server startup as reusable for the current verification batch: prefer one helper-owned run with the needed script/spec commands, or rerun setup only after code, migrations, fixtures, DB state, build inputs, or the prior setup output changed. Do not repeatedly delete/recreate the DB or restart the server before each targeted script/spec just because another E2E command is next. If cleanup is needed, do it as a separate recorded recovery step before the helper run, then run the helper alone. If the helper times out or produces no useful output, treat that as lifecycle/setup evidence, inspect `task-workflow/runtime/server.log`, `task-workflow/runtime/setup-*.log`, readiness output, and `task-workflow/runtime/run-*.log`, then change the setup, server command, ready URL, test command, fixture, or diagnostic before rerunning. If the helper fails once or twice with a diagnosed lifecycle/tooling issue after a corrected invocation, record the helper logs and switch to the smallest fallback that can prove the task: repo Playwright `webServer`, explicit PID/port cleanup, or manual server management with captured PID/log/readiness/cleanup evidence.\n- Do not run `playwright install`, `playwright install chromium`, or equivalent browser downloads during task verification. The helper sets `PLAYWRIGHT_BROWSERS_PATH=/ms-playwright` when present and fails early when the project Playwright version does not match the sandbox browser cache.\n- Do not leave `pnpm dev`, `npm run dev`, `vite`, `next dev`, test watchers, or similar long-lived commands as the active foreground tool call.\n- If the server or test command hangs, stop it, capture the log/error evidence, update the current phase artifact or `open-gaps.md`, and continue with the smallest local recovery path.\n- If the server appears stale, wrong, or on the wrong port, diagnose through the lifecycle owner: helper runtime logs/readiness first, then repo Playwright `webServer` output/config only for commands where `webServer` owns lifecycle. If a build or DB fixture changed, restart by rerunning the lifecycle owner with the corrected `--setup` or server command. Do not switch to broad process cleanup unless PID/port cleanup is impossible and the artifact records the recovery reason.\n- If manual fallback is genuinely needed, keep ownership explicit: write the PID/log path under `task-workflow/runtime/`, prove readiness with a bounded check, and clean up the captured PID/process group. Do not use `nohup`, `disown`, or a background server without PID/readiness evidence as the normal fallback.\n- Bash readiness polling inside the lifecycle helper is acceptable. The fixed-wait ban applies to Playwright scripts and E2E tests under `task-workflow/playwright` or `tests/e2e`, not the helper's bounded readiness loop.\n\n\u003c/server_command_discipline>\n\n## Playwright Failure Triage\n\nWhen a Phase 5 script or Phase 6 targeted spec fails, diagnose the failure type before rerunning.\n\n- If a selector/action/assertion times out, first prove the page is in the expected state: URL, no not-found/error screen, required DB or fixture record exists, server log has no route/runtime error, and browser console has no fatal error. Do not rerun the same script while the page state is wrong; fix setup, seed, route, or app state first.\n- If the helper times out, exits with no useful output, or appears hung, inspect helper setup/server/run logs and readiness evidence before rerunning. The next run must change setup, server command, ready URL, test command, fixture, timeout reason, or diagnostic output.\n- If the page state is correct and the assertion is valid, fix implementation or test code, then rerun the smallest affected script/spec.\n- Timeout increases are not a retry strategy. Start with the smallest practical timeout: `15000`-`20000` ms for Phase 5 launch/page-state/custom-script probes and up to `30000` ms for first-run Phase 6 targeted E2E where Playwright runner startup adds overhead. If the run fails with any useful error, assertion output, not-found state, console/runtime error, route error, fixture/DB miss, or helper diagnostic, use that evidence to diagnose; do not retry with a larger timeout. A larger timeout is allowed only when the first run ended only because the timer expired with no useful response or explanation, and only after helper logs, readiness, URL, not-found/error state, required DB/fixture records, server runtime logs, browser console, and network/page state prove the app and test are in the correct state to run. Only then may one rerun use `60000` ms, and never more than `120000` ms for one targeted script/spec. If a single targeted run needs more than two minutes, split the verifier or diagnose lifecycle, setup, fixture, page-state, console, network, or test-design failure instead of increasing the timeout.\n- Record the timeout value, result, whether useful failure evidence existed, triage checks, and any longer-rerun reason in the current Phase 5 or Phase 6 artifact. A phase cannot pass with only a narrative claim that the run was slow or quiet.\n\nExample helper shape:\n\n```bash\nnode task-workflow/scripts/playwright-lifecycle.mjs \\\n --setup \"pnpm run prepare:e2e\" \\\n --server \"pnpm run start:e2e\" \\\n --ready-url \"http://127.0.0.1:4444\" \\\n --run \"node task-workflow/playwright/verify-main-flow.mjs\" \\\n --command-timeout-ms 20000\n```\n\nFor E2E:\n\n```bash\nnode task-workflow/scripts/playwright-lifecycle.mjs \\\n --setup \"pnpm run prepare:e2e\" \\\n --server \"pnpm run start:e2e\" \\\n --ready-url \"http://127.0.0.1:4444\" \\\n --run \"pnpm exec playwright test tests/e2e/changed-flow.spec.ts --reporter=line\" \\\n --command-timeout-ms 30000\n```\n\n`prepare:e2e` and `start:e2e` are example names for the expected repo-owned isolated setup/server pattern. Use those exact commands when the repo provides them. In older repos, map the example to equivalent repo-owned commands or task-local setup that preserves the same isolation. Do not copy these examples with a raw production `db:migrate`, `seed`, `rm .dbs/database.db`, or any command that writes the live/default database.\n\n## Phase 5: Interactive Playwright Verification\n\nPhase 5 has two required evidence stages:\n\n| Stage | Must prove | Scope |\n| --- | --- | --- |\n| Stage 1 | the changed behavior works through real user interaction | primary changed route, touched controls, relevant bad cases, nearby shared UI |\n| Stage 2 | the UI is visually sound and responsive | no broken, cramped, overlapping, clipped, ill-placed, unreadable, unusable, or non-responsive affected UI |\n\n> Phase 5 is intentionally thorough. The Phase 4/Phase 6 test-minimality rules restrict durable automated tests; they do not weaken interactive browser verification. Use as many focused Playwright scripts, probes, viewport passes, screenshots, and clean reruns as needed to prove the changed user experience is functionally correct and visually sound. The constraint is relevance and lifecycle discipline, not fewest checks.\n\n1. Set `task-workflow/CURRENT_PHASE.txt` to `phase-5-playwright-verification`.\n2. Read `references/playwright-interactive.md`.\n3. Confirm `references/phase-5-7-verification-signoff.md` and `references/playwright-interactive.md` are loaded as the required current phase references before Phase 5 work starts.\n4. Confirm `task-workflow/scripts/playwright-lifecycle.mjs` exists and is readable.\n5. Write standalone Playwright scripts under `task-workflow/playwright/`. Multiple scripts are acceptable when they keep the evidence clearer, separate functional and responsive concerns, or isolate failure triage.\n6. Run the scripts through `task-workflow/scripts/playwright-lifecycle.mjs` with the repo's normal local app command, a readiness URL, bounded command timeout, runtime logs, and production/live database safety proof. First-run Phase 5 script/probe timeout should be `15000`-`20000` ms.\n7. Stage 1 - functional behavior: drive the changed feature through real user interactions and prove the task behavior works. Verify primary routes, forms, buttons, menus, dialogs, tables, navigation, save flows, and error states touched or implied by the task.\n8. In Stage 1, exercise only the relevant bad cases and non-ideal user behavior: invalid submissions, empty states, cancel/close paths, repeated clicks where relevant, out-of-order actions, navigating away/back, and nearby controls a real user could click while using the feature.\n9. In Stage 1, smoke-test surrounding UI/features that share the changed surface, such as adjacent navigation, list/detail transitions, filters/search, dialogs, menus, sidebars, and nearby actions that could be accidentally broken by the implementation.\n10. Stage 2 - UI and responsive quality: verify the affected UI is not broken, cramped, overlapping, clipped, ill-placed, unreadable, unusable, or non-responsive. Check mobile, tablet, desktop, standard `1920x1080`, and large `2560x1440` desktop viewports when the task changes UI. Treat this as equal to proving the task's functional changes work: Phase 5 fails if either Stage 1 behavior or Stage 2 UI quality is broken. Standard desktop/1080p screens must not have excessive dead space that makes the app look abandoned or sparse. `2560x1440` may have some extra whitespace, but not broad empty regions that make the UI feel unfinished. 4K/ultrawide whitespace is acceptable when the layout is intentionally constrained and still coherent.\n11. Keep Phase 5 scripts focused on proving the changed behavior and affected UI quality. Do not turn Phase 5 into a broad app audit unrelated to the changed surface.\n12. Capture screenshots under `task-workflow/screenshots/` for the main changed flows and responsive evidence.\n13. Verify every screenshot path cited in the Phase 5 artifact exists before scoring the gate. Record the file-existence command/readback proof in `task-workflow/phase-5-playwright-verification.md`.\n14. If Phase 5 finds a broken flow, bad-case failure, surrounding-feature regression, missing screenshot file, or responsive/UI-quality issue, Phase 5 fails. Record it in the artifact and `open-gaps.md`, return to the earliest affected phase, usually Phase 2 for source fixes, then re-pass Phase 3 check/lint evidence and Phase 4 unit coverage before re-entering Phase 5.\n15. Fix discovered issues and rerun the scripts from clean Node.js processes through the lifecycle helper. Use a longer timeout only after a timer-only/no-useful-output failure and recorded clean triage proves the app and test are valid to rerun.\n16. Review the interactive scripts and E2E tests created so far for fixed waits and record the files inspected plus the result.\n17. Update `task-workflow/open-gaps.md` for every browser/runtime/manual-verification gap closed, defended, or still open.\n18. Update `task-workflow/progress.md` with browser evidence summary, a pointer to `task-workflow/phase-5-playwright-verification.md` for Playwright/screenshot/log details, fixed-wait review state, open gaps, and next local action.\n19. Replace all `open-gaps.md` placeholder rows with real rows or explicit `None currently recorded` rows.\n20. Record Stage 1 functional behavior coverage, Stage 2 UI/responsive quality coverage, relevant bad-case coverage, surrounding-feature smoke, screenshots, screenshot existence proof, lifecycle helper command, readiness proof, runtime log paths, production/live database non-use proof, timeout/quiet-run triage, cleanup result, issues, fixes, open-gap status, and fixed-wait review evidence.\n21. After the Phase 5 gate passes, set `task-workflow/CURRENT_PHASE.txt` to `phase-6-e2e-verification`.\n22. Re-read `references/phase-5-7-verification-signoff.md` before doing Phase 6 work.\n23. Update `task-workflow/progress.md` so current phase, current phase reference, and next local action match Phase 6.\n\n## Required Interactive Evidence\n\nThe artifact must cite real evidence for the two Phase 5 stages:\n\n- launch command and local URL\n- lifecycle helper command\n- readiness proof and runtime log path\n- proof that no command used, deleted, reset, seeded, migrated, inspected-with-write-risk, or directly modified the production/live database\n- Playwright script path\n- Stage 1 route or state exercised\n- Stage 1 interaction performed\n- Stage 1 expected user-visible result\n- Stage 1 bad case, non-ideal user action, or surrounding feature checked when relevant\n- Stage 2 viewport checked, including dimensions such as mobile, tablet, desktop, `1920x1080`, or `2560x1440`\n- Stage 2 UI quality result for overlap, cramped layout, clipping, placement, readability, usability, responsiveness, navigation access, tap/click targets, dialogs/menus, horizontal scroll, controls outside the viewport, and desktop dead-space\n- screenshot path when visual proof matters\n- screenshot existence proof for every screenshot path cited\n- issue found\n- fix made\n- rerun result\n\nScreenshots alone do not prove controls work. A control that matters to the task must be clicked, filled, selected, submitted, or otherwise exercised with real browser input.\n\nPhase 5 is not a happy-path-only check, but it is scoped to the changed surface. Think like a real user who may click nearby controls, enter invalid data, abandon a flow, resize the viewport, use the feature on mobile, or do steps in an unexpected order. If that breaks the task flow or affected nearby UI, fix it before Phase 5 passes.\n\n## Phase 5 Score\n\nScore `task-workflow/phase-5-playwright-verification.md` against `50` items:\n\n- `8` app launch and script discipline items\n- `8` Stage 1 functional route/state coverage items\n- `8` Stage 1 interaction and relevant bad-case coverage items\n- `8` surrounding feature smoke items\n- `8` Stage 2 responsive mobile/tablet/desktop/1080p/2560px UI-quality items\n- `5` screenshot/evidence items\n- `5` fix-and-rerun items\n\nCritical failures:\n\n- standalone Playwright script not created\n- app not launched through the repo's local command\n- app server launched as an unbounded foreground command\n- lifecycle helper not used for Phase 5 app startup and script execution, except after recorded helper failure and a justified fallback\n- first app/browser command ran against an assumed existing server instead of establishing helper/repo lifecycle ownership\n- manual cleanup, fixed `sleep`, DB-delete, or server-start command chain used instead of the lifecycle helper before a diagnosed helper failure\n- any Phase 5 command deletes, resets, reseeds, truncates, migrates, directly opens with write risk, or modifies the production/live workspace database, including `.dbs/database.db` or equivalent default user-data DB\n- Phase 5 artifact lacks proof that DB/fixture/setup commands targeted only isolated repo-owned test/E2E state\n- production/live DB access is treated as harmless because the run is a sandbox, because the file is local, or because the command appears under `task-workflow/`\n- first-run targeted Phase 5 Playwright script/probe uses a timeout above `20000` ms without a task-specific artifact reason\n- Phase 5 timeout is increased after useful failure evidence, or after timer-only/no-output failure without recorded helper-log/readiness/URL/DB-fixture/server-log/browser-console/network/page-state triage proving the app and script are valid to rerun\n- timeout/quiet-run triage is missing from the Phase 5 artifact after any timed-out, quiet, or longer-rerun command\n- `playwright install` or equivalent browser download attempted during verification\n- server PID/log/readiness proof not recorded\n- Stage 1 main touched route or flow not exercised\n- Phase 5 reduced to a shallow smoke check when changed user-facing behavior or UI required real interaction, bad-case, surrounding-feature, or responsive evidence\n- Stage 1 relevant bad cases and non-ideal user actions not exercised for the changed flow\n- surrounding UI/features sharing the changed surface not smoke-tested\n- Stage 2 mobile, tablet, desktop, standard `1920x1080`, and large `2560x1440` responsive behavior not checked for the affected UI when UI changed\n- critical Stage 2 UI issue remains unresolved, such as cramped layout, overlapping controls, clipped content, ill-placed controls, inaccessible controls, broken navigation, unreadable text, unusable dialogs/menus, accidental horizontal scrolling, controls outside the viewport, excessive dead space on normal desktop/1080p screens, or broad unfinished-looking empty regions at `2560x1440`\n- screenshot path cited but file does not exist\n- screenshot paths are cited without file-existence proof in the artifact\n- discovered critical UI/runtime issue remains unresolved\n- Phase 5-discovered issue was not routed back to the earliest affected phase, then through Phase 3 check/lint evidence and Phase 4 unit coverage before rechecking\n- script uses DOM shortcuts as a substitute for normal user interaction\n- script contains any fixed wait in the audited files\n- fixed-wait review not recorded\n- fixed-wait review finds any occurrence in `task-workflow/playwright` or `tests/e2e`\n- browser-verification gaps remain stale in `task-workflow/open-gaps.md`\n- `task-workflow/open-gaps.md` still contains template placeholder rows\n\nPass gate:\n\n- score is at least `44/50`\n- every critical Playwright item passes\n- Stage 1 proves every main touched or implied user flow with interactive evidence\n- Stage 1 proves relevant bad cases, non-ideal user actions, and surrounding features with interactive evidence\n- Phase 5 coverage plan explains the focused scripts/probes/viewports used and why they are enough for the changed user-facing scope\n- Stage 2 verifies mobile, tablet, desktop, standard `1920x1080`, and large `2560x1440` responsive behavior for the affected UI when UI changed\n- Stage 2 UI quality passes as a first-class guarantee alongside the task's functional behavior\n- screenshots cited in the artifact exist\n- screenshot existence proof is recorded for every screenshot path cited\n- no unresolved critical UI/runtime issue remains\n- browser-verification gaps in `task-workflow/open-gaps.md` are resolved, updated, or defended\n- fixed-wait review is recorded and clean\n- `task-workflow/open-gaps.md` has no placeholder `Pending` rows\n- any background server started for the phase is cleaned up or explicitly handed to the next bounded command\n- production/live database safety proof is recorded and clean\n\nIf this gate fails, stay in Phase 5.\n\n## Phase 6: E2E Coverage Decision And Verification\n\n1. Set `task-workflow/CURRENT_PHASE.txt` to `phase-6-e2e-verification`.\n2. Confirm this reference is loaded as the required current phase reference before Phase 6 work starts.\n3. For each changed workflow, decide whether E2E coverage is warranted. E2E is warranted only for a critical user workflow, complex multi-step flow, persistence/navigation boundary, permission boundary, or high-risk regression. Small fixes, visual-only changes, copy/color/style changes, spacing/layout tuning, simple button wiring, and incidental UI behavior normally require no new or updated E2E. Default to `N/A`, update existing, or remove/simplify existing E2E unless the artifact proves a durable E2E risk.\n4. Inspect connected existing E2E tests for every changed workflow before choosing remove, update, add, or `N/A`. Identify whether the changed feature belongs in an existing flow, regression suite, or user journey.\n5. Remove, merge, or simplify existing E2E tests when they are unnecessary, obsolete, duplicated, brittle, convoluted, or protect non-core/non-complex flows. This includes tests added by older agents. Record why removal improves the E2E suite and preserve useful critical-flow coverage elsewhere only when still needed.\n6. Update an existing E2E test first when the warranted behavior extends an existing workflow or could affect existing functionality already covered there.\n7. Add a new E2E test only when the task introduces or changes a core workflow that cannot be cleanly covered by an existing E2E test and the New E2E Burden Ledger proves every new case is necessary.\n8. Do not use E2E to cover isolated non-UI logic. Record E2E `N/A` for that path and cite the Phase 4 unit-test decision when relevant.\n9. Select the smallest useful E2E command that proves only the warranted E2E coverage. Start with new, changed, or directly connected E2E specs and maintain a connected-spec ledger. Never run the unfiltered full E2E suite unless the task explicitly asks for full E2E or a concrete written repo instruction names full E2E/all-spec execution for this exact task; \"target repo instructions\" must name full E2E or an equivalent all-spec command, not merely say to run tests. If warranted targeted or multi-spec commands already ran the connected specs and no related code, test, config, fixture, migration, or build input changed, that is the evidence; do not add a full E2E run for final confidence, final signoff, state discovery, or reviewer-satisfaction.\n10. Record every meaningful E2E command with its scope, why that scope was selected, any previous related failure, what changed since that failure, outcome, and next action.\n11. Do not rerun E2E tests only for confidence. Rerun when related implementation changed, the E2E test changed, config/environment changed, previous output was incomplete/stale, or the next run gathers a narrower diagnostic needed to fix a real failure.\n12. Before rerunning the exact same failing E2E command, record what changed since the previous run or what new evidence the rerun will collect. If nothing changed and the previous output is complete, inspect logs, DOM/state, traces, screenshots, or persisted data first, then change the implementation, E2E test, command scope, or diagnostic strategy before running again.\n13. When E2E tests are warranted, run the existing, updated, new, and connected tests needed to prove existing functionality still works and the new additions work with it. Use `task-workflow/scripts/playwright-lifecycle.mjs` as the default lifecycle owner for Playwright and app-server startup, including existing repo E2E specs. Put the native E2E command inside helper `--run`. Use native Playwright with repo `webServer` only when the helper cannot own the server for that exact command, or after the helper has failed once or twice with recorded diagnostics. Before setup/server selection, discover the repo's expected isolated verification setup and server commands. If setup is required before a helper-owned server starts, pass it with `--setup` instead of chaining setup, server start, and test execution in one shell command. First-run targeted Phase 6 E2E timeout should be at most `30000` ms. Keep one setup/server lifecycle for the related verification batch when the DB/build/server inputs remain valid; do not reset DB, rerun migrations/seed, or restart the server between targeted specs unless the previous run changed or invalidated isolated test/E2E state. Never reset, seed, inspect, or migrate the production/live database for E2E. When a failing E2E run suggests stale DB, stale server, wrong build, redirect, missing fixture data, not-found page state, selector timeout, or no useful helper output, inspect helper run/server/setup logs plus page state before rerunning through the same lifecycle owner. Use a longer timeout only after a timer-only/no-useful-output failure and recorded clean triage proves the app and test are valid to rerun.\n14. Fix failures and rerun with the smallest command that can prove the fix.\n15. Record the exact command output for every required E2E run. If output is long, write it to a repo-local log file, cite that path, and copy the final pass/fail lines exactly into `task-workflow/phase-6-e2e-verification.md`. If no E2E is warranted, record `N/A` with the coverage-decision evidence instead of command output.\n16. Review the interactive scripts and any E2E tests used in this phase for fixed waits and record the files inspected plus the result. If no E2E test was used, record `N/A` for E2E test inspection.\n17. Update `task-workflow/open-gaps.md` for every E2E coverage gap closed, defended, or still open.\n18. Update `task-workflow/progress.md` with a pointer to `task-workflow/phase-6-e2e-verification.md` for E2E-file and E2E-repair details, removed-test rationale, command results summary, fixed-wait review state, coverage gaps, artifact pointer updates, and next local action.\n19. Replace all `open-gaps.md` placeholder rows with real rows or explicit `None currently recorded` rows.\n20. Record the E2E coverage decision matrix, connected existing E2E tests inspected for every changed workflow, old-agent/excess-E2E pruning decision, E2E tests removed, E2E tests updated, E2E tests added, New E2E Burden Ledger, commands, exact command output evidence, production/live database non-use proof, outcomes, E2E-selection/retry evidence, fixed-wait review evidence, and remaining coverage gaps. If no E2E is warranted, record `N/A` with the reason and do not create an E2E test.\n21. After the Phase 6 gate passes, set `task-workflow/CURRENT_PHASE.txt` to `phase-7-final-signoff`.\n22. Re-read `references/phase-5-7-verification-signoff.md` before doing Phase 7 work.\n23. Update `task-workflow/progress.md` so current phase, current phase reference, and next local action match Phase 7.\n\n## E2E Coverage Decision\n\n\u003ce2e_coverage_decision>\n\nPrefer no E2E change unless durable E2E coverage is warranted. Use this decision order for every changed workflow: decide whether E2E is warranted; inspect connected existing E2E; remove unnecessary existing E2E; update connected existing E2E when it can carry the warranted workflow; add a new minimal E2E only when no existing E2E can carry a warranted core/complex workflow; otherwise record `N/A`.\n\n> Strict default: no new E2E. A task-provided smoke checklist is not automatic permission to add a new E2E file; first decide whether the checklist is already covered by existing E2E, Phase 5 Playwright evidence, or a smaller update to an existing flow.\n\n### Decision Order\n\n| Step | Action |\n| --- | --- |\n| 1 | decide whether E2E is warranted for a core, critical, complex, persistence, navigation, permission, or high-risk workflow |\n| 2 | inspect connected existing E2E tests before adding anything new |\n| 3 | remove unnecessary, obsolete, duplicated, brittle, convoluted, or non-core/non-complex E2E tests |\n| 4 | update an existing E2E test when it already owns the workflow |\n| 5 | add one minimal new E2E test only when existing coverage cannot carry a warranted workflow |\n| 6 | record `N/A` when E2E is not warranted |\n\n### New E2E Burden Ledger\n\nBefore adding any new E2E file or case, record a burden ledger entry in `task-workflow/phase-6-e2e-verification.md`.\n\n| Required proof | Meaning |\n| --- | --- |\n| Critical/core workflow | The case protects a real user journey, persistence/navigation boundary, permission boundary, or high-risk regression. |\n| Existing-E2E inventory | Specific connected E2E specs were read, not merely searched. |\n| Existing-first rejection | The artifact explains why updating, removing, or preserving an existing E2E cannot carry the warranted path. |\n| Minimal path | The case proves the fewest user steps needed for the durable risk; visual, incidental, copy, class, and existence-only assertions are excluded. |\n| Bulk check | More than one new E2E case or any new E2E file requires per-case proof that cases cannot be merged or moved into an existing spec. |\n\nIf this ledger is missing, generic, or says the test was added because it \"locks behavior\", \"matches the smoke checklist\", \"adds confidence\", or \"reviewer may expect it\", the E2E is not warranted.\n\n### Command Scope\n\nWhen E2E is warranted, choose the smallest E2E proof that protects the behavior:\n\n- targeted E2E for one affected critical or complex user flow\n- new, changed, or directly connected E2E specs only by default\n- multi-spec E2E only when multiple changed or adjacent flows must be protected together\n- full Playwright E2E only when the task explicitly asks for full E2E or a concrete written repo instruction names full E2E/all-spec execution for this exact task; do not run it for confidence, final signoff, reviewer-satisfaction, state discovery, suspected pre-existing/order-dependent failures, because many specs appear relevant, or because the repo has one E2E spec file containing many tests. Diagnose those cases with the narrow failing spec/test plus logs, DOM/state, trace, screenshot, or persisted data evidence.\n- remove an existing E2E test when it is unnecessary, obsolete, duplicated, brittle, convoluted, or protects a non-core/non-complex flow; old agent-created tests are not grandfathered\n- update an existing E2E test when warranted behavior modifies or extends an existing user workflow\n- add a new E2E test only for a genuinely core workflow or when existing E2E coverage cannot cleanly express the warranted path\n- E2E tests for user-visible multi-step flows\n\n### Assertion Quality\n\nE2E coverage must protect actual core task functionality. Prefer assertions that prove a user-visible outcome, persisted state, navigation result, saved record, validation behavior, permission behavior, or end-to-end data flow. Avoid tests whose main value is checking superficial styling, color, class names, incidental copy, or whether a button exists without proving a critical workflow works.\n\nWhen updating an existing E2E test, keep its original regression value. The updated test must prove existing functionality still works and that the new or changed behavior integrates with that flow.\n\nDo not add flaky one-off assertions just to claim coverage. A useful E2E test should fail when the task's real user workflow breaks and should remain stable when harmless styling or layout details change.\n\nIf no E2E coverage is warranted, record the reason. If warranted coverage is not practical, record the reason, risk, and remaining manual proof. Do not use either exception for convenience.\n\n\u003c/e2e_coverage_decision>\n\n## Phase 6 Score\n\nScore `task-workflow/phase-6-e2e-verification.md` against `30` items:\n\n- `8` coverage-decision items\n- `8` meaningful functional assertion items\n- `6` E2E execution or `N/A` coverage-decision items\n- `4` failure-fix/rerun items\n- `4` coverage-gap documentation items\n\nCritical failures:\n\n- changed critical/core workflow has no E2E coverage and no defensible reason\n- connected existing-E2E inspection/action evidence is missing before a new E2E test is added\n- new E2E test added when an existing E2E flow should have been updated instead\n- new E2E test added without a complete burden ledger proving critical/core workflow, existing-E2E inventory, existing-first rejection, minimal path, and bulk reduction\n- existing functionality affected by the task is not protected by the updated or affected E2E run\n- new/updated tests do not prove actual task functionality, persisted state, navigation result, validation behavior, or end-to-end data flow\n- tests are primarily superficial checks such as color, CSS class, incidental copy, or button existence without proving feature behavior\n- E2E test added for a small, visual-only, incidental, or non-core change without a concrete risk reason\n- unnecessary, obsolete, duplicated, brittle, convoluted, or non-core/non-complex E2E test remains after Phase 6 identifies it as removable\n- connected old agent-created E2E tests are preserved without a remove/update/preserve decision and reason\n- E2E removal lacks reason, diff/readback evidence, or effect on remaining critical-flow coverage\n- tests depend on brittle implementation details instead of user-visible or persisted outcomes\n- warranted E2E test added but not run\n- Playwright/E2E command bypasses `task-workflow/scripts/playwright-lifecycle.mjs` before a diagnosed helper failure or a recorded pre-command reason that repo `webServer` ownership is required for that exact command\n- first E2E command depends on an assumed existing server instead of establishing helper/repo lifecycle ownership\n- Playwright/E2E command uses manual cleanup, fixed `sleep`, DB-delete, or server-start command chains instead of lifecycle `--setup` plus managed server/run steps before a diagnosed helper failure\n- any Playwright/E2E/script/helper command sets `E2E_DATABASE_FILE_PATH`, `DATABASE_PATH`, `DB_PATH`, or any similar database file/path override instead of using repo-owned E2E/end-to-end config\n- any Playwright/E2E/end-to-end fixture setup, reset, seed, migration, direct SQLite access, cleanup, inspection-with-write-risk, or custom script points at `.dbs/database.db` or any equivalent production/live default user-data DB\n- reviewer or artifact treats a database-path violation as ignorable because it appears in `task-workflow/`, is \"only local\", or is \"only sandbox\"; workflow artifacts that mutate sandbox state are runtime-critical and train agents to destroy live data\n- any production/live database write occurs outside the app's required migration command for a real schema change, in the owning phase, with explicit migration evidence\n- first-run targeted Phase 6 E2E uses a timeout above `30000` ms without a task-specific artifact reason\n- Phase 6 timeout is increased after useful failure evidence, or after timer-only/no-output failure without recorded helper-log/readiness/URL/DB-fixture/server-log/browser-console/network/page-state triage proving the app and spec are valid to rerun\n- timeout/quiet-run triage is missing from the Phase 6 artifact after any timed-out, quiet, or longer-rerun command\n- unfiltered full Playwright/E2E suite is run without an explicit task request for full E2E or a concrete written repo instruction naming full E2E/all-spec execution for this exact task\n- unfiltered full Playwright/E2E suite is run after targeted/connected E2E already passed and no related code, test, config, fixture, migration, or build input changed\n- repeated DB reset/migrate/seed or server restart is used between related E2E commands without a recorded invalidating state change or lifecycle diagnostic\n- E2E tests are rerun only for confidence, or the same failing E2E command is rerun blindly without material implementation, test, config, environment, output-staleness, or diagnostic reason\n- `playwright install` or equivalent browser download attempted during E2E verification\n- relevant E2E failure caused by this task remains unresolved\n- artifact records a pass for a required E2E run without command evidence\n- artifact records a pass for a required E2E run with only a described or documented result and no exact command output or cited repo-local log containing exact output\n- existing E2E tests deleted without replacement critical-flow coverage or written defense\n- audited Playwright or E2E files contain any fixed wait\n- fixed-wait review not recorded\n- fixed-wait review finds any occurrence in `task-workflow/playwright` or `tests/e2e`\n- E2E coverage gaps remain stale in `task-workflow/open-gaps.md`\n- `task-workflow/open-gaps.md` still contains template placeholder rows\n\nPass gate:\n\n- score is at least `24/30`\n- every critical E2E item passes, or no E2E command was warranted and the `N/A` decision is defended\n- E2E coverage decision is recorded, including `N/A` when no E2E is warranted\n- connected existing E2E tests were inspected before remove/update/add/`N/A` decisions\n- existing E2E tests are updated or removed when warranted by the coverage decision\n- new E2E tests are added only when existing coverage cannot cleanly cover the core/complex workflow\n- new E2E tests, if any, have a complete burden ledger and minimal path proof\n- connected old or excessive E2E tests were removed, simplified, updated, or explicitly defended\n- new or affected critical behavior has E2E coverage or a documented reason why not\n- tests assert meaningful functional outcomes rather than superficial style or existence checks\n- required E2E runs pass, no E2E was warranted, or remaining failures are unrelated and evidenced\n- E2E command selection and retry evidence is recorded\n- exact E2E command output is recorded in the artifact or in a cited repo-local log file when a command was required; otherwise the `N/A` decision is recorded\n- E2E coverage gaps in `task-workflow/open-gaps.md` are resolved, updated, or defended\n- fixed-wait review is recorded and clean\n- `task-workflow/open-gaps.md` has no placeholder `Pending` rows\n\nIf this gate fails, stay in Phase 6.\n\n## Phase 7: Final Audit And Signoff\n\n1. Set `task-workflow/CURRENT_PHASE.txt` to `phase-7-final-signoff`.\n2. Confirm this reference is loaded as the required current phase reference before Phase 7 work starts.\n3. Re-read every phase artifact.\n4. Confirm every previous gate passed and remains current.\n5. Confirm `task-workflow/open-gaps.md` has no unresolved critical gap.\n6. Confirm no open gap is stale or contradicted by Phase 5, Phase 6, or test evidence.\n7. Confirm `task-workflow/open-gaps.md` has no placeholder `Pending` rows.\n8. Re-read `task-workflow/progress.md` and confirm it matches `CURRENT_PHASE.txt`, every phase decision, the gap ledger, Current Phase Pointers, Phase Artifact Index, Artifact Pointers, and the next local action.\n9. Re-read the fixed-wait review evidence from Phase 5 and Phase 6, re-open the inspected verification files if they changed, and confirm the review is still current.\n10. Re-read the screenshot existence audit from Phase 5 and verify every screenshot path cited in Phase 5 still exists.\n11. Re-read Phase 4 unit-test evidence and Phase 6 E2E evidence. Confirm each phase records its remove/update/add/`N/A` decision, old/excess test pruning audit, new-test burden ledger when tests were added, exact command output when a command was required, and removal rationale plus diff/readback evidence when tests were removed.\n12. Inspect changed app/server source for `console.*` again. Temporary `console.*` used to debug Phase 5 browser/runtime behavior must be removed before Phase 7 signs off; lasting logging must use the repo-approved logging or telemetry path.\n13. Record an artifact integrity review by re-opening each phase artifact and checking its decision, score, required evidence, timeout/quiet-run triage where applicable, and consistency with `CURRENT_PHASE.txt`, `progress.md`, and `open-gaps.md`.\n14. Review the final diff.\n15. Treat Phase 7 as evidence validation for missed work, not as a command rerun phase. Re-run only commands whose owning phase missed the required command, whose earlier proof is missing/incomplete/stale, whose earlier proof was invalidated by later edits or changed test/config state, or whose rerun is explicitly required for this exact task by the task or repo instructions. If unit evidence is missing or invalidated, return to Phase 4; if E2E evidence is missing or invalidated, return to Phase 6. Do not rerun checks, builds, tests, Playwright, or E2E when the owning-phase evidence is current, and do not add full unit/Vitest or full Playwright runs only to feel more confident.\n16. Score the final result in all quality categories.\n17. Confirm the final implementation follows the task-relevant development rules extracted from `AGENTS.md`.\n18. Confirm task completion summary is accurate.\n19. Locate the required MITB completed command. Prefer the exact `Completed:` command in `.tasks/task.md`; otherwise use the exact command supplied in the prompt. The expected MITB shape is `node /workspace/mitb/task_complete.mjs --projectId \"\u003cprojectId>\" --taskId \"\u003ctaskId>\" --status completed --summary \"\u003csummary>\"`.\n20. If any Phase 7 audit check fails, do not run the completed command. Set `task-workflow/CURRENT_PHASE.txt` to the earliest failing phase, repair the work, update evidence, rescore, loop forward through the gates, and re-enter Phase 7.\n21. Run the completed command only after every prior Phase 7 audit check is clean. Record the exact command and result in `task-workflow/phase-7-final-signoff.md` and `task-workflow/progress.md`.\n22. Treat the completed command as the final external task action. Before task completion, verify that required check, lint, build, unit test, E2E test, app server, server probe, browser probe, and verification evidence already exists in the owning phase artifacts, or loop back to the owning phase only for missing, incomplete, stale, or invalidated evidence.\n23. Do not synthesize project/task identifiers when `.tasks/task.md` or the prompt already provides the command.\n24. Update `task-workflow/progress.md` so the last completed gate is Phase 7, the Current Phase Pointers, Phase Artifact Index, and Artifact Pointers are current, task-completion evidence is recorded, and the only next action is final response.\n25. Sign off only when the artifact proves the whole workflow passed and the completed command has run successfully.\n\n## Final Audit Checklist\n\nConfirm:\n\n- every phase artifact exists\n- every previous phase decision is `Pass`\n- every gate score still satisfies its threshold\n- required evidence tables remain intact\n- artifact integrity review passes for every phase artifact\n- no artifact is mostly template placeholders\n- `task-workflow/progress.md` matches Phase 7, has no pending current action, and does not contradict any phase artifact\n- no critical open gap remains\n- no stale open gap remains\n- no `open-gaps.md` placeholder row remains\n- Phase 5 and Phase 6 fixed-wait reviews are present and current\n- every screenshot path cited in Phase 5 exists and has recorded existence proof\n- Phase 4 records exact unit-test command output, defended `N/A`, or removed-test rationale and diff/readback evidence\n- Phase 6 records exact E2E command output, defended `N/A`, or removed-test rationale and diff/readback evidence\n- Phase 4 and Phase 6 record old/excess test pruning audits and new-test burden ledgers when tests were added\n- changed app/server source contains no `console.*` after Phase 5\n- final diff matches the task scope\n- final implementation follows the task-relevant development rules extracted from `AGENTS.md`\n- final quality scorecard is at least `8/10` in every category\n- final verification is current after the last source edit\n- MITB completed command from `.tasks/task.md` or the prompt was run after every Phase 7 audit check passed\n- final response can cite changed files, commands/tests run, and final gate status\n\n## Phase 7 Score\n\nScore `task-workflow/phase-7-final-signoff.md` against `20` items:\n\n- `6` previous-gate-currentness items\n- `4` artifact integrity items\n- `4` final diff review items\n- `4` final verification-currentness items\n- `2` final summary and MITB completion-command items\n\nCritical failures:\n\n- any previous phase gate failed or stale\n- critical open gap remains\n- stale open gap remains after the phase that claimed to resolve it\n- `task-workflow/open-gaps.md` still contains template placeholder rows\n- fixed-wait reviews are missing, stale, non-clean, or contradicted by files under `task-workflow/playwright` or `tests/e2e`\n- Phase 5 cites screenshot paths that do not exist or lack recorded existence proof\n- Phase 4 lacks unit-test command output evidence, defended `N/A`, or removed-test rationale and diff/readback evidence\n- Phase 6 lacks E2E command output evidence, defended `N/A`, or removed-test rationale and diff/readback evidence\n- changed app/server logging review is missing or contradicts repo-approved logging/telemetry rules\n- artifact integrity review is missing, incomplete, or records a failing decision, failing score, missing artifact, placeholder gate evidence, or contradiction between artifacts\n- Phase 5 or Phase 6 had a timed-out, quiet, or longer-rerun Playwright/E2E command without recorded timeout value and triage evidence\n- final implementation violates or fails to verify an extracted `AGENTS.md` development rule\n- any final quality category is below `8/10`\n- final source edit happened after last relevant verification\n- final artifact mostly repeats claims without evidence\n- MITB completed command was not run after every Phase 7 audit check passed\n- MITB completed command was run before previous phase gates and final audit checks passed\n- Phase 7 found a failing check but did not loop back to the earliest failing phase before task completion\n- task completion command was synthesized incorrectly when `.tasks/task.md` or the prompt provided the exact command\n\nPass gate:\n\n- score is `20/20`\n- all previous phase gates passed\n- all required artifacts exist and remain auditable\n- artifact integrity review is recorded and passes for every phase artifact\n- final implementation follows the extracted `AGENTS.md` development rules\n- no unresolved critical gap remains\n- no stale open gap remains\n- no open-gap placeholder row remains\n- fixed-wait reviews are present and current\n- every screenshot cited in Phase 5 exists\n- unit-test command output, defended `N/A`, or removed-test rationale and diff/readback evidence is present for Phase 4\n- E2E command output, defended `N/A`, or removed-test rationale and diff/readback evidence is present for Phase 6\n- changed app/server logging review is current after Phase 5\n- every final quality category is at least `8/10`\n- final checks and tests are current after the last code change\n- MITB completed command was run successfully after all prior final-audit checks passed\n- final summary cites the main files changed and verification performed\n\nIf this gate fails, return to the failing earlier phase.\n\n## Promotion Rule\n\nThe task is complete only when Phase 7 passes.\n\nBefore setting `task-workflow/CURRENT_PHASE.txt` to any later verification or signoff marker, re-open all prior phase artifacts through the current phase.\n\nPromotion requirements:\n\n- every prior phase artifact has `Decision: Pass`\n- the current phase artifact has `Decision: Pass`\n- every required score meets its threshold\n- all critical items pass\n- no required evidence table is still a template placeholder\n- no required gate row still says `Pending`\n- `task-workflow/open-gaps.md` has no placeholder `Pending` rows\n- `task-workflow/open-gaps.md` has no critical or stale open gap\n- fixed-wait review requirements are satisfied for Phase 5 and Phase 6 before final signoff\n- screenshot existence proof is satisfied for Phase 5 before final signoff\n- unit-test command output, defended `N/A`, or removed-test rationale and diff/readback evidence is satisfied for Phase 4 before final signoff\n- E2E command output, defended `N/A`, or removed-test rationale and diff/readback evidence is satisfied for Phase 6 before final signoff\n- changed app/server logging review is current after Phase 5\n- artifact integrity review is recorded and clean\n- verification evidence is current after the last source edit\n- `task-workflow/progress.md` is current and agrees with Phase 7 signoff\n- MITB completed command has run successfully after the final audit checks passed\n\nIf any artifact fails this check, do not advance the marker. Set `task-workflow/CURRENT_PHASE.txt` to the earliest failing phase and continue there.\n\nDo not ask the user whether to continue between Phase 5, Phase 6, and Phase 7. The gates decide whether to continue, rework, or return to an earlier phase.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":57471,"content_sha256":"a854e2642daf0840c74fdb45e0305255049a60b7f229d211e134a8a51e43cfb9"},{"filename":"references/playwright-interactive.md","content":"# Interactive Playwright Verification\n\nUse this reference in Phase 5.\n\n`Playwright` means standalone Node.js scripts that open the local app, drive the browser with real input, and save screenshots. It does not mean the repo's normal E2E test suite.\n\n## Rules\n\n\u003cinteractive_playwright_rules>\n\n### Lifecycle Rules\n\n- Run Phase 5 browser scripts through `task-workflow/scripts/playwright-lifecycle.mjs`.\n- The first browser script run must establish lifecycle ownership. Do not run a script against an assumed existing local server and then treat `fetch failed`, redirects, stale data, or stale build output as a reason to manually start or kill servers.\n- Use the lifecycle helper as the default owner for Playwright/app-server startup, including repo E2E commands when Phase 6 runs them. Put `pnpm exec playwright test ...` inside helper `--run` by default. Use repo Playwright `webServer` ownership only when the helper cannot own the server for that exact command, and record the reason before running it.\n- Discover the repo's expected verification lifecycle from `AGENTS.md`, `package.json`, README/docs, Playwright config, and `tests/e2e` helpers before choosing commands. The expected pattern is a repo-owned setup command that prepares isolated E2E/test state and deterministic seed data, plus a repo-owned server command that starts the app against that isolated state.\n- Pass the repo-owned verification server command to the lifecycle helper with `--server` when it exists. If the repo has no named server command for that pattern, use the normal local command only after proving it will run against isolated E2E/test state, not production/live data.\n- Do not manually combine server cleanup, server start, sleeps, DB cleanup, and script execution in one shell command.\n- Put only isolated repo-owned test/E2E setup such as test DB reset, test migration, or test seed into lifecycle `--setup \"...\"`; it is bounded and logged before the server starts. Never put production/live DB reset, seed, cleanup, direct SQLite, or verification-only migration in Phase 5 setup.\n- Do not set database file/path env vars through helper `--env`, setup, server, or run commands. Do not change the repo's internal E2E/end-to-end database file path. Use the repo's existing E2E/end-to-end database configuration. `.dbs/database.db` is the live workspace/production database; production databases must never be used for testing or fixture setup. Deleting or corrupting live user data can cause the user to lose his job.\n- If cleanup is needed, do it as a separate recorded recovery step before the helper run, then run the helper alone.\n\n### Failure Triage Rules\n\n- If a selector/action/assertion times out, first prove the page is in the expected state: URL, no not-found/error screen, required DB or fixture record exists, server log has no route/runtime error, and browser console has no fatal error. Do not rerun the same script while the page state is wrong; fix setup, seed, route, or app state first.\n- If the helper times out or produces no useful output, inspect helper setup/server/run logs and readiness evidence before rerunning. The next run must change setup, server command, ready URL, test command, fixture, timeout reason, or diagnostic output.\n- If the helper fails once or twice with a diagnosed lifecycle/tooling issue after a corrected invocation, record the helper logs and switch to the smallest fallback that can prove the task: repo Playwright `webServer`, explicit PID/port cleanup, or manual server management.\n- If the server appears stale, wrong, or on the wrong port, inspect helper runtime logs/readiness output first; use repo Playwright `webServer` output only for commands where `webServer` owns lifecycle. Put only isolated test DB reset, test migration, test seed, or fixture setup in helper `--setup`, then restart through the lifecycle owner instead of switching to broad process cleanup.\n- If manual fallback is unavoidable, keep PID ownership: capture the server PID/log path under `task-workflow/runtime/`, prove readiness, and clean up only that PID/process group. Do not use `nohup`, `disown`, or untracked background servers as the normal fallback.\n- Do not run `playwright install` or any browser download command. The lifecycle helper sets `PLAYWRIGHT_BROWSERS_PATH=/ms-playwright` when the cache exists and fails early on a revision mismatch.\n\n### Script Authoring Rules\n\n- Prefer `127.0.0.1` over `localhost`.\n- Write scripts under `task-workflow/playwright/`.\n- Save screenshots under `task-workflow/screenshots/`.\n- Run scripts from clean Node.js processes after each meaningful fix.\n- Use normal input APIs such as `click`, `fill`, `press`, `selectOption`, and route navigation.\n- Do not use screenshots alone as proof when a visible control needs interaction proof.\n- Do not use `page.evaluate(...)` as a substitute for normal user interaction unless inspecting state that cannot be observed otherwise.\n\n\u003c/interactive_playwright_rules>\n\n## Lifecycle Helper Pattern\n\n```bash\nnode task-workflow/scripts/playwright-lifecycle.mjs \\\n\t--setup \"pnpm run prepare:e2e\" \\\n\t--server \"pnpm run start:e2e\" \\\n\t--ready-url \"http://127.0.0.1:4444\" \\\n\t--run \"node task-workflow/playwright/verify-main-flow.mjs\" \\\n\t--command-timeout-ms 20000\n```\n\n`prepare:e2e` and `start:e2e` are example names for the expected repo-owned isolated setup/server pattern. Use those exact commands when the repo provides them. In older repos, map the example to equivalent repo-owned commands or task-local setup that preserves the same isolation. Do not copy this example with raw production `db:migrate`, `seed`, `rm .dbs/database.db`, or any command that writes the live/default database. The helper writes server and command logs under `task-workflow/runtime/`. Cite those paths in the Phase 5 artifact when output is too long to paste directly.\n\nTimeout increases are not a retry strategy. Start with the smallest practical timeout: `15000`-`20000` ms for Phase 5 launch/page-state/custom-script probes and up to `30000` ms for first-run Phase 6 targeted E2E where Playwright runner startup adds overhead. If the run fails with any useful error, assertion output, not-found state, console/runtime error, route error, fixture/DB miss, or helper diagnostic, use that evidence to diagnose; do not retry with a larger timeout. A larger timeout is allowed only when the first run ended only because the timer expired with no useful response or explanation, and only after helper logs, readiness, URL, not-found/error state, required DB/fixture records, server runtime logs, browser console, and network/page state prove the app and test are in the correct state to run. Only then may one rerun use `60000` ms, and never more than `120000` ms for one targeted script/spec. Record timeout values, quiet-run evidence, triage checks, and longer-rerun reasons in the current phase artifact. If one targeted run needs more than two minutes, split the verifier or diagnose lifecycle, setup, fixture, page-state, console, network, or test-design failure before increasing timeout.\n\n## Minimal Script Pattern\n\n```js\nimport { chromium } from 'playwright';\n\nconst targetUrl = process.env.TARGET_URL ?? 'http://127.0.0.1:4444';\nconst browser = await chromium.launch({ headless: true });\nconst context = await browser.newContext({\n\tviewport: { width: 1440, height: 960 }\n});\nconst page = await context.newPage();\n\ntry {\n\tawait page.goto(targetUrl, { waitUntil: 'domcontentloaded' });\n\tawait page.screenshot({ path: 'task-workflow/screenshots/home-desktop.png', type: 'png' });\n} finally {\n\tawait context.close().catch(() => {});\n\tawait browser.close().catch(() => {});\n}\n```\n\n## Mobile Pattern\n\n```js\nconst context = await browser.newContext({\n\tviewport: { width: 390, height: 844 },\n\tisMobile: true,\n\thasTouch: true\n});\n```\n\n## Required Coverage\n\nCover all routes, states, and interactions touched or implied by the task:\n\n- primary navigation\n- create/edit/delete flows\n- save/cancel flows\n- forms and validation\n- menus, dialogs, drawers, tabs, and filters\n- table/list row actions\n- loading, empty, error, and success states when relevant\n- responsive visual quality for mobile, tablet, desktop, standard `1920x1080`, and large `2560x1440` desktop when the task changes UI\n- no broken UI at required viewports: overlapping controls, clipped content, unreadable text, inaccessible navigation, unusable menus/dialogs, accidental horizontal scrolling, or controls outside the viewport\n- no excessive dead space on normal desktop/1080p screens. `2560x1440` may have some extra whitespace, but not broad empty regions that make the UI feel unfinished. Large empty regions are acceptable on 4K/ultrawide only when the content width is intentionally constrained and the screen still looks designed.\n\n## What Does Not Count\n\n- opening the app without interacting\n- taking only one screenshot\n- testing only mobile, only one desktop size, or skipping `1920x1080`/`2560x1440` when the task changes layout/UI\n- relying on stale browser state\n- relying only on unit/E2E test runner output\n- recording paths that do not exist\n- ignoring console/runtime errors discovered during verification\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":9175,"content_sha256":"a25240714699845f1a98f19479746df0c505543a187ffa402917c55bf41a37cf"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Task Workflow","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Strict Instruction Contract","type":"text"}]},{"type":"paragraph","content":[{"text":"This file is strict implementation instruction, not loose guidance and not optional reference material.","type":"text"}]},{"type":"paragraph","content":[{"text":"This is the canonical workflow for task execution. It is not one possible way to do the task; it is the required way.","type":"text"}]},{"type":"paragraph","content":[{"text":"If the Agent reads this skill, it must execute it exactly as written, in order, to the letter.","type":"text"}]},{"type":"paragraph","content":[{"text":"Required behavior:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not reinterpret the steps.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not reorder the steps.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not skip the steps.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not replace the steps with a simpler approach.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not make assumptions that override this file.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not treat broad similarity, intuition, or prior habits as permission to deviate.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If the Agent is uncertain, it must resolve that uncertainty inside the workflow defined here and not invent its own workflow. If the skill says to perform a step, gate, checklist, review, or loop, that step is mandatory. If the skill says a later phase is blocked, the Agent must treat it as blocked. If the Agent cannot prove a phase passed in the required artifact, it must treat that phase as failed.","type":"text"}]},{"type":"paragraph","content":[{"text":"There is no successful stopping point before Phase 7. Stopping early can directly harm the user because they may depend on the completed workflow for job-critical work. It is a do-or-die situation: the user can be harmed if the run has not reached Phase 7 correctly, and the user can lose his job if the Agent stops early, signs off weak work, skips a gate, or damages live data. Treat premature stopping, partial signoff, live-data damage, or \"mostly done\" summaries as a serious failure of duty.","type":"text"}]},{"type":"paragraph","content":[{"text":"The first filesystem action in the target repo must be Phase 0 artifact reset and scaffolding.","type":"text"}]},{"type":"paragraph","content":[{"text":"Before ","type":"text"},{"text":"task-workflow/phase-0-artifact-reset.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" exists, the Agent may only:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"identify the target repo root","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"read this ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"read the task file","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"create or replace ","type":"text"},{"text":"task-workflow/","type":"text","marks":[{"type":"code_inline"}]},{"text":" artifacts from templates","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Before Phase 1 passes, the Agent must not edit or generate implementation files, build outputs, databases, route types, migrations, tests, package files, or source files.","type":"text"}]},{"type":"paragraph","content":[{"text":"Production and live workspace databases, especially ","type":"text"},{"text":".dbs/database.db","type":"text","marks":[{"type":"code_inline"}]},{"text":", are do-or-die user data. Deleting, resetting, reseeding, truncating, inspecting with ad hoc writes, or modifying them outside the app's legitimate migration command can destroy user work and can cause the user to lose his job. The only permitted production/live DB action is the repo's required app migration command for a real schema change. That exception does not permit \"working on\" the production DB: no manual query, data manipulation, seed, reset, fixture load, data repair, cleanup, delete, truncate, direct SQLite command, or debug mutation is allowed.","type":"text"}]},{"type":"paragraph","content":[{"text":"After Phase 1 passes and before any implementation edit, the Agent must set ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" to ","type":"text"},{"text":"phase-2-execution","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" still says ","type":"text"},{"text":"phase-0-artifact-reset","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"phase-1-task-research","type":"text","marks":[{"type":"code_inline"}]},{"text":", implementation files must remain unchanged.","type":"text"}]},{"type":"paragraph","content":[{"text":"If implementation files, generated app files, build outputs, or database files are changed before Phase 0 artifacts exist and Phase 1 passes, the run has failed and must be restarted from a clean fixture.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Idea","type":"text"}]},{"type":"paragraph","content":[{"text":"Re-read this ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" after every compaction before continuing work. Re-load the phase references and current task artifacts too. Do not rely on conversational memory.","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill is a gated execution protocol, not a loose set of suggestions. It turns a task into a repeatable, artifact-driven workflow. The target app must be implemented from the task, target repo, and local codebase evidence, then proven through Phase 3 check/lint evidence, Phase 4 unit-test coverage decision, Phase 5 interactive Playwright verification, Phase 6 E2E coverage decision, and final audit.","type":"text"}]},{"type":"paragraph","content":[{"text":"Assume this skill may run fully autonomously and may be compacted mid-run. No human is expected to watch the run line by line. The artifact files are therefore the enforcement system. A phase is not complete because the Agent feels confident. A phase is complete only when its required artifact shows a real passing score and all critical items pass.","type":"text"}]},{"type":"paragraph","content":[{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" is the compact resume ledger. It must summarize the task, current phase, completed phase context, active work queue, verification state, and next local action. Hard rule: after compaction, resume, retry, reconnect, or new coding session, read it and ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" before doing any new work. Keep it current as work proceeds; it is the first file that should restore enough context to continue without conversation memory.","type":"text"}]},{"type":"paragraph","content":[{"text":"Never promote work from one phase to the next on optimism, partial evidence, a green build alone, or broad product similarity.","type":"text"}]},{"type":"paragraph","content":[{"text":"The workflow is intentionally looped. A failed gate means the Agent must rework that phase, update evidence, rerun the needed checks or verification, rescore the gate, and repeat until the gate passes. Quality gates are not reports to the user; they are control points that force more work before promotion.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"MITB Workspace Inputs","type":"text"}]},{"type":"paragraph","content":[{"text":"When running in a MITB sandbox, use these repo-relative workspace inputs:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"workflow skill: ","type":"text"},{"text":".agents/skills/task-workflow/SKILL.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task body: ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"domain and brand context: ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"attached task files: ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"available skill files: ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" is the target repo's binding development-instructions file. It defines project-specific rules for architecture, type safety, tests, UX, commands, code style, docs, prohibited patterns, and completion. Phase 1 must extract the task-relevant rules from ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" before planning edits, including any required docs it points to. Later gates must verify the implementation follows those extracted rules.","type":"text"}]},{"type":"paragraph","content":[{"text":"Phase 1 must read ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":". It must enumerate ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":" even when the folder is empty, then read or inspect every task attachment/supporting file in that folder before planning.","type":"text"}]},{"type":"paragraph","content":[{"text":"Available skills are kept under ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":". Discover available skills from the prompt's Skills section and ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":", then read only the selected skill ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" files relevant to the current task. Do not bulk-read every skill file in ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"paragraph","content":[{"text":"All Phase 1 input/reference files are read-only. This includes ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", every file under ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":", and every selected skill file under ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":". Treat files under ","type":"text"},{"text":".tasks/","type":"text","marks":[{"type":"code_inline"}]},{"text":" as canonical task inputs, not editable workspace artifacts. Do not rewrite, normalize, consolidate, clean up, trim, reformat, or \"fix\" these files unless the task explicitly asks to update that exact reference file. If a reference file appears inconsistent, record the ambiguity in ","type":"text"},{"text":"task-workflow/phase-1-task-research.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":"; never resolve it by editing the reference input.","type":"text"}]},{"type":"paragraph","content":[{"text":"Record every ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":" attachment/supporting file read or inspected, plus every selected skill path and why it was relevant, in ","type":"text"},{"text":"task-workflow/phase-1-task-research.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":". After compaction or resume, re-read the selected relevant skill files listed in ","type":"text"},{"text":"progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" along with ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", and the relevant ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":" attachments/supporting files recorded in Phase 1.","type":"text"}]},{"type":"paragraph","content":[{"text":"In MITB, ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" or the prompt always provides the task completion command. Phase 7 must run the exact completed command only after every Phase 7 audit check passes. If any Phase 7 audit check fails, do not run task completion. Return to the earliest failing phase, repair the work, update evidence, rescore that phase, loop forward through the gates, and then re-enter Phase 7.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Mandatory Process Shape","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003cmandatory_process_shape>","type":"text"}]},{"type":"paragraph","content":[{"text":"This workflow shape is not optional:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Clear old workflow artifacts for this repo and copy fresh artifact templates.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read the task, root ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", every task attachment/supporting file in ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":", only relevant available skill files from ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":", and relevant project docs. Extract the task-relevant development rules from ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" before planning. These instruction, task, domain, attachment, and skill-reference files are read-only unless the task explicitly asks to edit them.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Research the codebase and record the implementation plan.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Execute the primary implementation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Execute a second gap-closure pass.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run second-pass integrity review and repo check/lint validation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Make the unit-test coverage decision: add, update, remove, or explicitly skip unit tests.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify interactively with standalone Playwright scripts.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Make the E2E coverage decision: add, update, remove, or explicitly skip E2E tests.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Recheck every phase artifact and sign off only when all gates pass.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If the work skips one of those phase boundaries, the run is off track.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase Ownership Matrix","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Owns","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required evidence","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 0","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"artifact reset and scaffold","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"fresh artifacts, helper scripts, marker, no source edits","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 1","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"task intake and research","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"task/domain/attachments/AGENTS/selected skills read, codebase research, implementation plan","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 2","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"primary implementation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"scoped work packets, file evidence, readback/diff/search proof","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 3","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"second execution, integrity, check/lint validation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"connected-surface review, repo check, focused lint when useful, build, reusable build evidence","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 4","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"unit-test coverage decision","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"add/update/remove/skip decision, existing-test inspection, minimal unit command or ","type":"text"},{"text":"N/A","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 5","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"interactive Playwright verification","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Stage 1 behavior proof, Stage 2 UI/responsive proof, screenshots, lifecycle evidence","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 6","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"E2E coverage decision","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"add/update/remove/skip decision, connected E2E inspection, minimal E2E command or ","type":"text"},{"text":"N/A","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 7","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"final audit and signoff","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"artifact integrity review, current evidence, MITB completion command after audit","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"\u003c/mandatory_process_shape>","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Looped Gate Contract","type":"text"}]},{"type":"paragraph","content":[{"text":"Every phase follows the same loop:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Re-read the required reference file or files for the phase from the Phase Reference Map.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Perform the phase work.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Update the phase artifact with concrete evidence.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Score the phase against its gate.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the gate fails, stay in the same phase, repair the failing work or missing evidence, and repeat this loop.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the gate passes, write the promotion-lock evidence, advance ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":", and immediately start the next phase.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"This loop is mandatory for Phase 0, Phase 1, Phase 2, Phase 3, Phase 4, Phase 5, Phase 6, and Phase 7.","type":"text"}]},{"type":"paragraph","content":[{"text":"Do not lower a gate threshold to escape the loop. Do not summarize failure as progress when the next local repair is available. Do not wait for the user to tell you to continue when the phase can be repaired locally. Do not move forward with a weak artifact because the implementation \"probably works\".","type":"text"}]},{"type":"paragraph","content":[{"text":"The only acceptable end state is Phase 7 passed with every earlier phase still passing. The only acceptable non-Phase-7 stop is a real external blocker that cannot be solved locally and is fully recorded in the current phase artifact and ","type":"text"},{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Autonomous Run Contract","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003cautonomous_run_contract>","type":"text"}]},{"type":"paragraph","content":[{"text":"Treat these rules as always active.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Gate And Artifact Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every phase must end with an objective gate.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every gate must be recorded in the phase-owned artifact file.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every gate must have both a numeric threshold and critical-item pass requirement.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If a gate fails, remain in that phase and keep iterating.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"A failed gate means \"repair and loop\", not \"stop and report\".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Successful gates must immediately promote to the next phase when the next phase is locally available.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" is only a resume pointer. It is not proof that earlier phases passed.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" is the compact resume ledger. It is not proof that gates passed, but it must stay current enough to resume the run after compaction.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"After every phase start, meaningful Phase 2 work packet, phase gate result, blocker discovery, and phase promotion, update ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" with the current phase, earliest failing phase if any, last completed gate, next local action, and a compact summary of relevant context.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Keep the ","type":"text"},{"text":"Current Phase Pointers","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"Phase Artifact Index","type":"text","marks":[{"type":"code_inline"}]},{"text":", and ","type":"text"},{"text":"Artifact Pointers","type":"text","marks":[{"type":"code_inline"}]},{"text":" in ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" current. They must point to the current phase artifact, current phase reference, and high-signal active files only. Do not duplicate full researched-file, edited-file, Playwright, screenshot, log, or test inventories from phase artifacts into ","type":"text"},{"text":"progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"After compaction, resume, retry, reconnect, or new coding session, re-read this ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":", the current phase artifact, ","type":"text"},{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", and the required current phase reference file or files before choosing the next action. If they disagree, inspect the phase artifacts and continue from the earliest failing phase.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"A phase may advance the current phase marker only after its phase-owned artifact has ","type":"text"},{"text":"Decision: Pass","type":"text","marks":[{"type":"code_inline"}]},{"text":", a passing score, all critical items passing, and no placeholder ","type":"text"},{"text":"Pending","type":"text","marks":[{"type":"code_inline"}]},{"text":" rows in the gate or required evidence sections.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The current phase marker must be written before work belonging to that phase begins. The marker is not merely cleanup after phase work.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Before writing the next phase marker, re-open the current phase artifact and verify the promotion lock in writing inside that artifact.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Immediately after writing a new phase marker, read the required reference file or files for that new phase before doing any work in that phase.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" points past the earliest failing phase artifact, artifact gates win. Correct ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" back to the earliest failing phase and continue there.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"When filling artifact templates, preserve auditable evidence for every required semantic category. Exact row wording may be condensed only if the same evidence remains clear and scorable.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" is a gate artifact. A later phase may not claim a gap is resolved unless the gap ledger is updated in the same phase.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"A gap cannot remain ","type":"text"},{"text":"Open","type":"text","marks":[{"type":"code_inline"}]},{"text":" after the phase named in its owner or next-action field has passed. If the later phase completed the work, move the gap to ","type":"text"},{"text":"Resolved Gaps","type":"text","marks":[{"type":"code_inline"}]},{"text":"; if the gap is not real, reclassify or close it with evidence.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" must not contain template placeholder rows such as ","type":"text"},{"text":"Pending","type":"text","marks":[{"type":"code_inline"}]},{"text":" after Phase 0. If there are no gaps, replace placeholder rows with explicit ","type":"text"},{"text":"None currently recorded","type":"text","marks":[{"type":"code_inline"}]},{"text":" rows.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 7 cannot pass while any critical gap remains ","type":"text"},{"text":"Open","type":"text","marks":[{"type":"code_inline"}]},{"text":", stale, or contradicted by another phase artifact.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Verification File Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 5 and Phase 6 must review the interactive scripts and E2E tests for fixed waits before passing.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"A fixed wait in ","type":"text"},{"text":"task-workflow/playwright","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"tests/e2e","type":"text","marks":[{"type":"code_inline"}]},{"text":" is a gate failure. Do not justify it. Replace it with deterministic Playwright waits/assertions such as ","type":"text"},{"text":"locator.waitFor(...)","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"expect(locator)...","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"waitForURL(...)","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"waitForResponse(...)","type":"text","marks":[{"type":"code_inline"}]},{"text":", or persisted-state assertions, then rerun verification.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 5, Phase 6, and Phase 7 may pass only when their artifacts document that the inspected verification files contain no fixed waits and cite the deterministic waits/assertions used instead.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If later work reveals missing evidence from an earlier phase, return to that earlier phase, repair it, and re-pass the gate.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Write And Command Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"After every file write, patch, generated-file creation, or artifact update that matters to a gate, perform a readback check before relying on it. Use ","type":"text"},{"text":"sed","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"rg","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"ls","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"git diff","type":"text","marks":[{"type":"code_inline"}]},{"text":", or the repo's normal inspection command to prove the file exists and contains the intended change.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If a write/edit tool reports an invalid write, missing file, failed patch, partial output, or uncertain result, stop that work packet, repair the write with a supported edit method, read it back, and only then continue. Do not proceed as if a failed write happened.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Commands must be bounded. Do not leave long-lived servers, watchers, or interactive commands running in the foreground as the active tool call.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Production/live workspace databases must never be used as test or verification state. In this skill, \"production database\" means ","type":"text"},{"text":".dbs/database.db","type":"text","marks":[{"type":"code_inline"}]},{"text":", any repo-declared live/default user-data database, or any database path used by the normal app outside an isolated test/E2E config. The only allowed action on ","type":"text"},{"text":".dbs/database.db","type":"text","marks":[{"type":"code_inline"}]},{"text":" or any production/live database is the repo's required application migration command for a real schema change, run in the phase that owns that migration and recorded as migration evidence. This is a narrow migration-execution exception, not permission to work on the production DB. If the task creates or changes a migration, running the repo's app migration command against the production/live default DB is mandatory after the migration exists and before Phase 3 promotes; the user uses the completed app immediately, so unapplied migrations make the delivered change invisible or broken. No other production/live DB action is allowed: no manual query, data manipulation, seed, reset, fixture, Playwright, E2E, probe, debugging, cleanup, ","type":"text"},{"text":"rm","type":"text","marks":[{"type":"code_inline"}]},{"text":", truncate, direct SQLite, custom data repair, or data inspection with write risk. If the command might touch production data and the artifact cannot prove it is the repo migration command for a real schema change or an isolated test DB operation, do not run it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Outside Phase 5 and Phase 6, if a temporary dev server is needed for an API/runtime probe, use ","type":"text"},{"text":"task-workflow/scripts/server-probe.mjs","type":"text","marks":[{"type":"code_inline"}]},{"text":". It owns PID capture, readiness, bounded probe commands, runtime logs, and PID-only cleanup. Server readiness is usually 5-10 seconds; use 15-20 seconds as the normal budget and 30 seconds as the maximum startup-readiness limit. Broad process-name cleanup is only for explicit sandbox-owned recovery when PID/port cleanup is impossible and the artifact records why.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"In Phase 5 and Phase 6, the first browser, Playwright, or E2E command that needs a running app must establish lifecycle ownership through ","type":"text"},{"text":"task-workflow/scripts/playwright-lifecycle.mjs","type":"text","marks":[{"type":"code_inline"}]},{"text":" by default. Do not run against an assumed existing server first and then infer that ","type":"text"},{"text":"fetch failed","type":"text","marks":[{"type":"code_inline"}]},{"text":", stale data, redirects, or wrong build output means manual server management is needed.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Existing repo E2E tests are not a reason to bypass the helper. Run ","type":"text"},{"text":"pnpm exec playwright test ...","type":"text","marks":[{"type":"code_inline"}]},{"text":" through the helper's ","type":"text"},{"text":"--run","type":"text","marks":[{"type":"code_inline"}]},{"text":" by default. Use native Playwright with repo ","type":"text"},{"text":"webServer","type":"text","marks":[{"type":"code_inline"}]},{"text":" ownership only when the helper cannot own the server for that exact command after a diagnosed reason, and record that reason before running it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The helper's ","type":"text"},{"text":"--env","type":"text","marks":[{"type":"code_inline"}]},{"text":" is not a database-path override mechanism. Never set ","type":"text"},{"text":"E2E_DATABASE_FILE_PATH","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"DATABASE_PATH","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"DB_PATH","type":"text","marks":[{"type":"code_inline"}]},{"text":", or any similar database file/path variable in helper, setup, server, or run commands. The agent must not change the repo's internal E2E/end-to-end database file path. Test database paths must come from the repo's checked-in E2E/end-to-end config or the already-materialized environment. ","type":"text"},{"text":".dbs/database.db","type":"text","marks":[{"type":"code_inline"}]},{"text":" is the live workspace/production database; production databases must never be used for testing. Using ","type":"text"},{"text":".dbs/database.db","type":"text","marks":[{"type":"code_inline"}]},{"text":" for Playwright, E2E, fixtures, seed, reset, inspection, cleanup, or debugging is a critical failure even if it appears only in ","type":"text"},{"text":"task-workflow/","type":"text","marks":[{"type":"code_inline"}]},{"text":". The user can lose his job if this database is deleted or corrupted.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Expected verification lifecycle pattern: discover the repo-owned setup and server commands from ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"package.json","type":"text","marks":[{"type":"code_inline"}]},{"text":", README/docs, Playwright config, and ","type":"text"},{"text":"tests/e2e","type":"text","marks":[{"type":"code_inline"}]},{"text":" helpers before running Phase 5 or Phase 6. Prefer a repo-owned setup command that prepares isolated E2E/test state by resetting only the test DB, applying test-targeted migrations, and seeding deterministic verification data, plus a repo-owned server command that starts the app against that isolated state. If the target repo has no named scripts for this pattern, simulate the same pattern with the smallest repo-owned/test-only commands and record the mapping before running them; never replace the pattern with production DB writes, raw DB path overrides, or manual cleanup chains.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not compose manual server cleanup, fixed sleep, DB-delete, server-start, and Playwright command chains in Phase 5 or Phase 6. Put pre-server setup such as isolated test DB reset, test migration, test seed, or test database preparation into lifecycle ","type":"text"},{"text":"--setup \"...\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" for helper-owned runs. Treat setup plus server startup as reusable for the current verification batch: prefer one helper-owned run with the needed script/spec commands, or rerun setup only after code, migrations, fixtures, DB state, build inputs, or the prior setup output changed. Do not repeatedly delete/recreate the DB or restart the server before each targeted script/spec just because another E2E command is next. If cleanup is needed, do it as a separate recorded recovery step before the helper run, then run the helper alone. If server state, database state, port ownership, or build freshness looks wrong, diagnose through the current lifecycle owner logs/readiness first and rerun through that owner after any code/setup fix. If the helper times out or produces no useful output, treat that as lifecycle/setup evidence, inspect ","type":"text"},{"text":"task-workflow/runtime/server.log","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"task-workflow/runtime/setup-*.log","type":"text","marks":[{"type":"code_inline"}]},{"text":", readiness output, and ","type":"text"},{"text":"task-workflow/runtime/run-*.log","type":"text","marks":[{"type":"code_inline"}]},{"text":", then change the setup, server command, ready URL, test command, fixture, or diagnostic before rerunning. If the helper fails once or twice with a diagnosed lifecycle/tooling issue after a corrected invocation, record the helper logs and switch to the smallest fallback that can prove the task: repo Playwright ","type":"text"},{"text":"webServer","type":"text","marks":[{"type":"code_inline"}]},{"text":", explicit PID/port cleanup, or manual server management with captured PID/log/readiness/cleanup evidence. Broad process-name cleanup is only a recorded sandbox recovery after PID/port cleanup is impossible.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not run ","type":"text"},{"text":"playwright install","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"playwright install chromium","type":"text","marks":[{"type":"code_inline"}]},{"text":", or equivalent browser downloads during task verification. The managed lifecycle helper sets ","type":"text"},{"text":"PLAYWRIGHT_BROWSERS_PATH=/ms-playwright","type":"text","marks":[{"type":"code_inline"}]},{"text":" when available and fails early if the project Playwright version does not match the sandbox browser cache.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase-Owned Command Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 2 completes implementation packets with strict artifact, readback, diff, search, and narrow unblock-command evidence. Defer routine check, lint, build, unit/Vitest, E2E, Playwright, and repo combined check commands such as ","type":"text"},{"text":"pnpm run check","type":"text","marks":[{"type":"code_inline"}]},{"text":" to their owning later phases unless a concrete compile/type issue blocks the current packet and is recorded before the command.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 3 reviews connected places, closes missed implementation gaps, performs implementation integrity review, then owns the ordered check/build checkpoint: repo check, focused lint when useful, and build when the repo has a separate build. Use targeted diagnostics or narrow fix checks only to prove a specific issue group. When a broad check/build command fails, inspect enough output to identify visible issue groups, fix every locally-fixable group before rerunning that broad command, and record only the groups/fixes/rerun reason. Do not rerun a broad command after each tiny fix when other visible issue groups remain. Do not keep huge command logs unless a temporary log is needed for triage; delete temporary full-output logs after extracting issue groups. Record unit/E2E coverage questions for the owning later phase.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 4 owns unit-test coverage. It decides whether unit, service, component, or integration-style coverage is warranted; then adds, updates, removes, or explicitly skips that coverage. It may remove existing unit tests when they protect non-core, non-complex, obsolete, or convoluted behavior and the artifact explains why removal improves the test suite. Phase 4 does not rerun check, lint, or build when Phase 3 evidence is current.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Later phases reuse Phase 3 build evidence unless code, config, dependency/build inputs, migrations, generated assets, stale output, or incompatible verification tooling invalidates it. Do not rebuild in Phase 4, Phase 5, Phase 6, or Phase 7 only to prepare, reconfirm, or feel safe.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 6 owns E2E coverage. It decides whether E2E coverage is warranted; then adds, updates, removes, or explicitly skips that coverage. It may remove existing E2E tests when they protect non-core, non-complex, obsolete, brittle, or convoluted behavior and the artifact explains why removal improves the test suite.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If unit, E2E, or browser work happens before its owning phase, do not fail the task solely for that timing. Carry the artifact, diff, and command output into the owning phase and make the owning phase's remove/update/add/skip decision current before promotion.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Minimal Test And Rerun Rules","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Tests are production code. Extra tests are not harmless evidence; they are maintenance load, false confidence risk, and future workflow drag.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"Phase 4 and Phase 6 must treat test work as a pruning and minimal-coverage decision, not as a \"more tests is safer\" step.","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Rule","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required behavior","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Existing tests are not grandfathered","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"If an older agent added unnecessary, obsolete, brittle, convoluted, duplicated, or non-core tests, the owning phase must remove or simplify them when they are connected to the current changed behavior.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"New tests are exceptions","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add a new test only after proving the behavior is stable/core and no connected existing test can carry the warranted assertion cleanly.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Passing extra tests is not quality evidence","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"A large passing count does not improve the gate. The gate values necessary coverage, useful assertions, and removal of bad tests.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Test bulk is a warning","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"If added tests cause max-lines, fixture churn, helper churn, slow commands, broad reruns, or new maintenance structure, stop and re-evaluate whether the tests should be merged, reduced, updated in place, or removed. Do not solve self-created test bulk by adding more structure unless the artifact proves every test remains necessary.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Every new test needs a burden ledger","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"For each new unit or E2E test case/file, record the core risk, the connected existing tests inspected, why update/remove/","type":"text"},{"text":"N/A","type":"text","marks":[{"type":"code_inline"}]},{"text":" was insufficient, why the assertion is minimal, and what cheaper proof was rejected.","type":"text"}]}]}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Keep tests minimal. Prefer the fewest tests that protect core behavior or critical workflows. Too many tests for incidental behavior are a codebase problem, not a quality signal.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For E2E, run only new, changed, or directly connected specs that are warranted by the Phase 6 decision. Never run the unfiltered full E2E suite unless the task explicitly asks for full E2E or a concrete written repo instruction names full E2E/all-spec execution for this exact task; a repo having a Playwright suite, ","type":"text"},{"text":"webServer","type":"text","marks":[{"type":"code_inline"}]},{"text":", or \"run tests\" script is not enough. After warranted targeted or connected E2E evidence passes and no related code, test, config, fixture, migration, or build input changed, do not add a full E2E run as final confidence, final signoff, state discovery, or reviewer-satisfaction evidence.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For a single targeted Playwright script or E2E spec, timeout increases are not a retry strategy. Start with the smallest practical timeout: ","type":"text"},{"text":"15000","type":"text","marks":[{"type":"code_inline"}]},{"text":"-","type":"text"},{"text":"20000","type":"text","marks":[{"type":"code_inline"}]},{"text":" ms for Phase 5 launch/page-state/custom-script probes and up to ","type":"text"},{"text":"30000","type":"text","marks":[{"type":"code_inline"}]},{"text":" ms for first-run Phase 6 targeted E2E where Playwright runner startup adds overhead. If the run fails with any useful error, assertion output, not-found state, console/runtime error, route error, fixture/DB miss, or helper diagnostic, use that evidence to diagnose; do not retry with a larger timeout. A larger timeout is allowed only when the first run ended only because the timer expired with no useful response or explanation, and only after helper logs, readiness, URL, not-found/error state, required DB/fixture records, server runtime logs, browser console, and network/page state prove the app and test are in the correct state to run. Only then may one rerun use ","type":"text"},{"text":"60000","type":"text","marks":[{"type":"code_inline"}]},{"text":" ms, and never more than ","type":"text"},{"text":"120000","type":"text","marks":[{"type":"code_inline"}]},{"text":" ms for one targeted script/spec. If a single targeted run needs more than two minutes, stop increasing timeouts; split the verifier or diagnose lifecycle, setup, fixture, page-state, console, network, or test-design failure first.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not rerun tests only for confidence. Rerun when quality evidence can change: related implementation changed, the test changed, config/environment changed, previous output was incomplete/stale, or the next run gathers a narrower diagnostic needed to fix a real failure.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Before rerunning an identical failing test command, record what changed since the previous run or what new evidence the rerun will collect. If nothing changed and the prior output is complete, inspect logs, DOM/state, traces, screenshots, or persisted data first, then change the implementation, test, command scope, or diagnostic strategy before running again. A suspected pre-existing or order-dependent failure is not a reason to broaden to a full suite; prove it with the narrow failing spec/test plus logs/state/trace evidence, then fix it if it is in scope or record it as an unrelated defended gap.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 5 and Phase 6 artifacts must record timeout values and any quiet-run/timeout triage before the gate can pass. A first-run targeted Playwright command longer than the Phase 5/Phase 6 budgets, or any longer rerun without recorded timer-only failure plus clean state triage, is a gate failure.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If a command appears hung or idle and the next workflow action is locally available, stop the command, record the evidence in the current phase artifact or gap ledger, and continue with the bounded recovery path.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Continuation Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every phase gate is an internal control point, not a user confirmation checkpoint.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If a phase gate passes, continue directly into the next phase without asking whether to continue.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If a phase gate fails, rework the phase, rerun the gate, and keep looping without asking the user for permission to continue.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The purpose of the gate, redo, verification, and rework loop is to remove the need for user confirmation during execution and let the Agent complete the run autonomously.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"A failed phase artifact is a repair ticket, not a stopping point. Do not leave a phase with ","type":"text"},{"text":"Decision: Fail","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"Score: 0/...","type":"text","marks":[{"type":"code_inline"}]},{"text":", pending gate rows, or unresolved locally-fixable warnings and then produce a final response.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If a dependency, launch detail, or local setup issue blocks progress, resolve it with the most direct logical solution that preserves the workflow and continue.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not lower the skill's strictness, skip gates, or change direction because of an environment issue that can be solved inside the target repo or sandbox.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not stop after any phase to summarize progress and ask whether to continue.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not stop after implementation, build, lint, tests, Playwright verification, or E2E work if any later phase is still unpassed and locally available.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not assume the user will catch a shortcut. The Agent must prevent the shortcut itself.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"\u003c/autonomous_run_contract>","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Final Response Guard","type":"text"}]},{"type":"paragraph","content":[{"text":"Before producing any final response, stopping message, or ending an OpenCode turn with control returned to the user, run this guard against the artifact files:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" must be ","type":"text"},{"text":"phase-7-final-signoff","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" must say the current phase is ","type":"text"},{"text":"phase-7-final-signoff","type":"text","marks":[{"type":"code_inline"}]},{"text":", the last completed gate is Phase 7, and there is no next local action except final response.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" must include current phase pointers, a phase artifact index, and artifact pointers that identify where detailed evidence lives.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" must not duplicate full file inventories from phase artifacts; it may list only high-signal active files needed for immediate resume.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" must list the repo-relative instruction/context files to re-read after compaction, including ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", relevant task attachments/supporting files from ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":", and only the relevant available skill files from ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":" selected in Phase 1.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every required phase artifact must have ","type":"text"},{"text":"Decision: Pass","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every required score must meet its threshold.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Every gate row must contain concrete evidence instead of ","type":"text"},{"text":"Pending","type":"text","marks":[{"type":"code_inline"}]},{"text":" or template defaults.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" must have no critical open gaps, no stale open gaps owned by passed phases, and no placeholder rows.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 5, Phase 6, and Phase 7 must record fixed-wait review evidence showing the inspected verification files contain no fixed waits.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 5 and Phase 7 must record screenshot existence proof for every screenshot path cited in Phase 5.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"When Phase 4 requires a unit command or Phase 6 requires an E2E command, that phase and Phase 7 must record the exact command output or a repo-local log file containing the exact output plus the final pass/fail lines. When no unit/E2E test is warranted, the owning phase and Phase 7 must record the ","type":"text"},{"text":"N/A","type":"text","marks":[{"type":"code_inline"}]},{"text":" coverage decision. When tests are removed, the owning phase and Phase 7 must record the removal reason and diff/readback evidence.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 5, Phase 6, and Phase 7 must record timeout values and timeout/quiet-run triage evidence for every timed-out, quiet, or longer-rerun Playwright/E2E command.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 3 and Phase 7 must verify changed app/server source contains no lasting ","type":"text"},{"text":"console.*","type":"text","marks":[{"type":"code_inline"}]},{"text":". Temporary ","type":"text"},{"text":"console.*","type":"text","marks":[{"type":"code_inline"}]},{"text":" is allowed only during Phase 5 interactive testing when it directly helps debug browser/runtime behavior by reading console output, and it must be removed before the Phase 5 rerun, Phase 3 re-pass, or Phase 7 signoff.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 7 final quality scorecard must be at least ","type":"text"},{"text":"8/10","type":"text","marks":[{"type":"code_inline"}]},{"text":" in every category.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 7 must record an artifact integrity review that re-opens every phase artifact and verifies the artifact exists, its decision is ","type":"text"},{"text":"Pass","type":"text","marks":[{"type":"code_inline"}]},{"text":", its score meets threshold, required evidence rows are complete, and it does not contradict ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", or ","type":"text"},{"text":"open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The MITB completed command from ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" or the prompt must run only after all Phase 7 audit checks pass. Treat it as the final external task action: plan and run all checks, tests, builds, server probes, and verification commands before task completion. If any Phase 7 check fails before completion, the agent must loop back to the earliest failing phase and must not call task completion.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If any item fails and the problem can be solved locally, continue the workflow from the earliest failing phase. Do not answer as if the task is complete. If an actual external blocker prevents completion, record the blocker in the current phase artifact and ","type":"text"},{"text":"open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", including commands run, files inspected, why local recovery cannot solve it, and the smallest next action.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"OpenCode Turn Continuity Guard","type":"text"}]},{"type":"paragraph","content":[{"text":"When running inside OpenCode or another tool-driven coding session, the Agent must not end its assistant turn just because a command finished, a check passed, lint started, files were edited, or a phase artifact is temporarily failing.","type":"text"}]},{"type":"paragraph","content":[{"text":"After every tool result, before returning control to the user, check:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Is ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" earlier than ","type":"text"},{"text":"phase-7-final-signoff","type":"text","marks":[{"type":"code_inline"}]},{"text":"?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Does any required phase artifact still say ","type":"text"},{"text":"Decision: Fail","type":"text","marks":[{"type":"code_inline"}]},{"text":"?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Does the current phase gate still contain ","type":"text"},{"text":"Pending","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"0/...","type":"text","marks":[{"type":"code_inline"}]},{"text":", or missing evidence?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Is the next required workflow action locally available?","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If the answer to any of the first three is yes and the next action is locally available, immediately continue with that next action in the same run. Do not stop at a narrative checkpoint such as \"now run lint\", \"check passes\", \"next I will update the artifact\", or \"remaining work is...\".","type":"text"}]},{"type":"paragraph","content":[{"text":"The only valid stopping states are:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 7 passed and the final response guard passed.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"A real external blocker is fully recorded in the current artifact and ","type":"text"},{"text":"open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If the session is long, keep the phase artifacts current and continue dispatching the next tool/action. Do not rely on the user to type \"continue\" to finish an unblocked phase.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Critical Output Invariant","type":"text"}]},{"type":"paragraph","content":[{"text":"These are hard constraints:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The target app must be a real interactive app, not a static mockup.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The implementation must be authored in the target repo as real routes, layouts, components, state, styling, backend contracts, services, queries, migrations, and tests when required by Phase 4 or Phase 6 coverage decisions.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Primary pages or views must be implemented as real router routes or repo-native route modules, not as an in-memory page-state switch inside one large component.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Visible controls required or implied by the task must become real target controls with matching states and persisted behavior when persistence is required.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Backend/data work must follow the repo's existing service, contract, query, and persistence boundaries.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Frontend runtime code must not import server-only runtime modules.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reusable UI styling belongs in shared primitives, component-local styling, or existing design tokens, not fake global one-off component classes.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 3 check/lint evidence, Phase 4 unit-test work, Phase 5 interactive Playwright verification, and Phase 6 E2E work are separate gates. None is a substitute for another.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The Agent must review the app part by part, route by route, state by state, and flow by flow.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If a critical visible action, route, data mutation, or verification path remains fake, broken, or unreviewed, the run has not passed.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Existing tests must not be deleted merely to make the new task pass. If obsolete tests are removed, replace their useful coverage or document why the old coverage no longer applies.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Type assertions, broad casts, and warning suppression are not acceptable substitutes for correct contracts and narrowed types.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Final signoff must score at least ","type":"text"},{"text":"8/10","type":"text","marks":[{"type":"code_inline"}]},{"text":" in each quality category: functional result, skill compliance/artifact integrity, code quality/maintainability, test quality, and overall result.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Reference Loading Rules","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003creference_loading_rules>","type":"text"}]},{"type":"paragraph","content":[{"text":"Do not load every reference file by default.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Compaction And Resume Reload Rule","type":"text"}]},{"type":"paragraph","content":[{"text":"After compaction, resume, retry, reconnect, or a new coding session, use ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" to identify the current status, then re-read:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"this main ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"the current phase artifact","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"the required reference file or files for the current phase from the Phase Reference Map","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"the repo-relative instruction/context files listed in ","type":"text"},{"text":"progress.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"Do not rely on conversation memory after compaction. ","type":"text"},{"text":"progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" identify where the run is, but they do not replace the main skill, current phase reference, current phase artifact, or gap ledger. The run may continue only after those files have been reloaded.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase Start Reference Rule","type":"text"}]},{"type":"paragraph","content":[{"text":"Every time a phase starts, including immediately after a phase promotion, read the required reference file or files for that new phase before doing phase work.","type":"text"}]},{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" changes, the next local action is to load the reference file or files named for the new marker in the Phase Reference Map. Phase work before that read is invalid.","type":"text"}]},{"type":"paragraph","content":[{"text":"On a fresh run:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read this ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Start Phase 0.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load only ","type":"text"},{"text":"references/phase-0-1-startup-research.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"After compaction, resume, retry, reconnect, or new coding session:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Re-read this ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read the current phase artifact and ","type":"text"},{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Re-read the instruction/context files listed in ","type":"text"},{"text":"progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", including ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", the relevant attachments/supporting files recorded from ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":", and only the selected relevant skill files from ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":", and the phase artifacts disagree, continue from the earliest failing phase artifact.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load only the reference file that owns the current phase.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load ","type":"text"},{"text":"references/playwright-interactive.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" only when the current phase reference requires interactive Playwright work.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Phase reference map:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Current phase marker","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Reference to load","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"missing ","type":"text"},{"text":"task-workflow/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-0-1-startup-research.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"phase-0-artifact-reset","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-0-1-startup-research.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"phase-1-task-research","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-0-1-startup-research.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"phase-2-execution","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-2-4-execution-integrity.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"phase-3-second-execution","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-2-4-execution-integrity.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"phase-4-unit-coverage","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-2-4-execution-integrity.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"phase-5-playwright-verification","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-5-7-verification-signoff.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"references/playwright-interactive.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"phase-6-e2e-verification","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-5-7-verification-signoff.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"phase-7-final-signoff","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/phase-5-7-verification-signoff.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"paragraph","content":[{"text":"The phase references are grouped by connected workstream, not one file per phase. This matches the reference skill pattern: ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" holds the strict global protocol and the reference files hold detailed process for the current workstream.","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003c/reference_loading_rules>","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Operating Modes","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003coperating_modes>","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Validation Mode","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this when improving or testing the skill itself.","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use a throwaway target repo copy.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Preserve all workflow artifacts.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Judge repeatability across fresh runs.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the same failure repeats, improve the reusable skill before running again.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Delivery Mode","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this when the user wants the real target app or task completed.","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Work inside the provided target repo.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Treat the task file as the source of truth.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not sign off until every gate in this file and the phase references has passed in writing.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"\u003c/operating_modes>","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Required Artifacts","type":"text"}]},{"type":"paragraph","content":[{"text":"These are mandatory:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/phase-0-artifact-reset.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/phase-1-task-research.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/phase-2-execution.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/phase-3-second-execution.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/phase-4-unit-coverage.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/phase-5-playwright-verification.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/phase-6-e2e-verification.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/phase-7-final-signoff.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/playwright/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/screenshots/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/scripts/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/scripts/playwright-lifecycle.mjs","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/scripts/server-probe.mjs","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"task-workflow/runtime/","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"The templates in ","type":"text"},{"text":"assets/templates/","type":"text","marks":[{"type":"code_inline"}]},{"text":" are enforcement artifacts. Copy their structure directly. If a required table is replaced by prose or stripped down until rows are no longer auditable, the run fails.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Multi-Phase Protocol","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003cmulti_phase_protocol>","type":"text"}]},{"type":"paragraph","content":[{"text":"Follow the phases in order:","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 0: Artifact Reset And Scaffolding","type":"text"}]},{"type":"paragraph","content":[{"text":"Delete the previous task's ","type":"text"},{"text":"task-workflow/","type":"text","marks":[{"type":"code_inline"}]},{"text":" artifacts, recreate the required artifact files from templates, and prove no implementation files were edited.","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed process: ","type":"text"},{"text":"references/phase-0-1-startup-research.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 1: Task Intake And Codebase Research","type":"text"}]},{"type":"paragraph","content":[{"text":"Read the task, root ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", every task attachment/supporting file in ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":", only relevant available skill files from ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":", relevant docs, and codebase. Treat ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" as binding development instructions; extract its task-relevant rules before planning. These are reference inputs: read and cite them, but do not edit them. Record task understanding, development rules, task files read or inspected, selected skills, affected files, patterns to reuse, risks, and an ordered implementation plan.","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed process: ","type":"text"},{"text":"references/phase-0-1-startup-research.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 2: Primary Execution","type":"text"}]},{"type":"paragraph","content":[{"text":"Execute the researched plan in order, keep changes scoped, and record implementation evidence.","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed process: ","type":"text"},{"text":"references/phase-2-4-execution-integrity.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 3: Second Execution, Integrity, And Check/Lint Validation","type":"text"}]},{"type":"paragraph","content":[{"text":"Review the implementation as a continuation pass, close missing or weak work, propagate consistency to associated UI/API/data surfaces, run implementation integrity review, and complete the ordered check/build checkpoint. Do not write or run unit/Vitest or E2E tests in Phase 3.","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed process: ","type":"text"},{"text":"references/phase-2-4-execution-integrity.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 4: Unit Test Coverage Decision And Verification","type":"text"}]},{"type":"paragraph","content":[{"text":"Decide whether unit, service, component, or integration-style tests are needed. Add, update, remove, or explicitly skip that coverage, then run only the warranted unit-level commands. Remove tests that are unnecessary, obsolete, convoluted, or protecting non-core/non-complex behavior.","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed process: ","type":"text"},{"text":"references/phase-2-4-execution-integrity.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 5: Interactive Playwright Verification","type":"text"}]},{"type":"paragraph","content":[{"text":"Use standalone interactive Playwright scripts in two stages. Stage 1 proves the changed behavior works through real user interaction. Stage 2 verifies UI quality: no broken, cramped, overlapping, clipped, ill-placed, or non-responsive UI on the affected surfaces. Treat responsive design as a first-class Phase 5 guarantee, equal to proving the task's functional changes work. Some whitespace is fine, but standard desktop viewports such as ","type":"text"},{"text":"1920x1080","type":"text","marks":[{"type":"code_inline"}]},{"text":" must not look broken, clipped, overlapped, unusable, or excessively sparse. Large desktop viewports such as ","type":"text"},{"text":"2560x1440","type":"text","marks":[{"type":"code_inline"}]},{"text":" may have some extra whitespace, but not broad empty regions that make the UI feel unfinished. Very large 4K/ultrawide whitespace is acceptable when the layout is intentionally constrained and still coherent.","type":"text"}]},{"type":"paragraph","content":[{"text":"The Phase 4/Phase 6 test-minimality rules do not shrink Phase 5. Phase 5 is the main user-facing verification phase and may take the time needed to cover changed flows, relevant bad cases, surrounding UI, responsive breakpoints, screenshots, and visual correctness. Use multiple focused Playwright scripts, probes, viewport passes, or reruns when needed to prove the affected user experience is correct; keep them scoped to the changed and adjacent surfaces, but do not reduce Phase 5 to a shallow smoke check.","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed process: ","type":"text"},{"text":"references/phase-5-7-verification-signoff.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"references/playwright-interactive.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 6: E2E Coverage Decision And Verification","type":"text"}]},{"type":"paragraph","content":[{"text":"Make the E2E coverage decision. Review existing E2E coverage first, update it when a warranted core flow already belongs there, add new E2E tests only for critical or complex workflows that cannot be cleanly covered by existing tests, remove unwanted E2E tests that protect non-core/non-complex or convoluted flows, and avoid E2E for small, visual-only, or incidental UI changes.","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed process: ","type":"text"},{"text":"references/phase-5-7-verification-signoff.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase 7: Final Audit And Signoff","type":"text"}]},{"type":"paragraph","content":[{"text":"Re-read every artifact, confirm all previous gates still pass after the last edit, review the final diff, run the required MITB completed command only after all Phase 7 audit checks pass, and sign off only if the artifact trail proves completion.","type":"text"}]},{"type":"paragraph","content":[{"text":"Phase 7 is an evidence validator for missed work, not a validation rerun phase. If a required check, build, test, Playwright run, E2E run, or other phase-owned command was already completed correctly in its owning phase and the evidence is current, Phase 7 must only verify that evidence. Rerun a command only when the owning phase missed the required command, the recorded evidence is missing/incomplete/stale, or later changes invalidated it; otherwise never rerun checks, builds, tests, Playwright, or E2E in Phase 7.","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed process: ","type":"text"},{"text":"references/phase-5-7-verification-signoff.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"paragraph","content":[{"text":"The phase references are not optional expansion material. They are the detailed execution instructions for the current workstream.","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003c/multi_phase_protocol>","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Disallowed Shortcuts And Automatic Fails","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003cautomatic_fails>","type":"text"}]},{"type":"paragraph","content":[{"text":"These automatically fail the run:","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Phase Boundary And Artifact Fails","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"editing app/source files before Phase 1 passes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"editing app/source files before Phase 0 artifacts exist","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"editing implementation/source files while ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" still says ","type":"text"},{"text":"phase-0-artifact-reset","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"phase-1-task-research","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"passing Phase 2 while ","type":"text"},{"text":"task-workflow/phase-2-execution.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" does not record that the marker was set to ","type":"text"},{"text":"phase-2-execution","type":"text","marks":[{"type":"code_inline"}]},{"text":" before source edits","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"skipping artifact reset","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"failing to copy the artifact templates before implementation work","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"failing to create, read after compaction, or keep ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" current enough to resume the run","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"after compaction, retry, reconnect, or a new coding session, continuing work before using ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" to identify status, then re-reading ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", the current phase artifact, ","type":"text"},{"text":"open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", and the required current phase reference file or files","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"after a phase marker changes, starting work in the new phase before reading the required reference file or files for that phase","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"failing to record and re-read the selected repo-relative instruction/context files in ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", including ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", relevant task attachments/supporting files from ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":", and relevant available skill files from ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"reading ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" only as context instead of extracting and following the task-relevant development rules it defines","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"editing ","type":"text"},{"text":".tasks/task.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/domain.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":", selected skill files under ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":", or ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" without the user/task explicitly requesting an edit to that exact reference file","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"leaving the ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" Current Phase Pointers, Phase Artifact Index, or Artifact Pointers stale, missing, or contradicting phase artifacts","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"using ","type":"text"},{"text":"task-workflow/progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" as a duplicate file inventory instead of pointing to the owning phase artifacts for details","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"omitting required semantic evidence from a phase artifact while claiming that phase passed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"advancing ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" while the current or any previous phase artifact still says ","type":"text"},{"text":"Decision: Fail","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"advancing ","type":"text"},{"text":"task-workflow/CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" while the current or any previous phase artifact still has placeholder ","type":"text"},{"text":"Pending","type":"text","marks":[{"type":"code_inline"}]},{"text":" gate evidence","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"leaving artifact templates mostly blank while claiming success","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"passing Phase 5 while any screenshot path cited in the artifact is missing or not verified with existence proof","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"passing Phase 6 while required E2E runs are only described and the exact command output is not recorded in the artifact or in a cited repo-local log file","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running Phase 5 or Phase 6 Playwright/E2E commands without the correct lifecycle owner recorded: helper by default, repo Playwright ","type":"text"},{"text":"webServer","type":"text","marks":[{"type":"code_inline"}]},{"text":" or manual fallback only with a recorded reason/diagnostic made before the command","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"deleting, resetting, reseeding, truncating, directly modifying, or using the production/live workspace database as test/verification state; this includes ","type":"text"},{"text":".dbs/database.db","type":"text","marks":[{"type":"code_inline"}]},{"text":", repo default user-data DB paths, and any equivalent live DB path","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running any production/live DB action other than the repo's required app migration command for a real schema change; prohibited actions include manual queries, data manipulation, seed, reset, fixture, Playwright, E2E, debug, cleanup, direct SQLite, custom data repair, delete, or truncate against ","type":"text"},{"text":".dbs/database.db","type":"text","marks":[{"type":"code_inline"}]},{"text":" or any equivalent live DB path","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running a production database migration except as the app's required migration for a real schema change, in the owning phase, with explicit migration evidence","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"passing Phase 3 after creating or changing a migration without applying it through the repo's app migration command against the production/live default DB and recording the target, command, reason, and output","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Test Hygiene And Coverage Fails","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"adding or requiring unit tests for small fixes, minor UI adjustments, copy changes, color/style changes, spacing/layout tuning, or simple button wiring without a concrete core-behavior or risk reason","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"adding unit tests for trivial component branches, incidental button clicks, visual-only changes, or one-off UI behavior instead of reserving unit tests for core stable behavior","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"keeping unnecessary, obsolete, convoluted, or non-core/non-complex unit tests after Phase 4 identifies them as removable","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"adding unit tests without a per-test necessity ledger proving existing tests could not be updated, the behavior is stable/core, and every new assertion is minimal","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"preserving old agent-created unit tests as \"already there\" when connected evidence shows they are unnecessary, duplicated, brittle, convoluted, or non-core/non-complex","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"adding enough unit tests to require test-file splitting, helper churn, fixture churn, or broad reruns without first reducing or removing unnecessary test coverage and recording why the remaining bulk is necessary","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"adding a new E2E test for behavior that is not a critical/core workflow, not a complex flow, or can be cleanly covered by updating existing E2E coverage","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"keeping unnecessary, obsolete, brittle, convoluted, or non-core/non-complex E2E tests after Phase 6 identifies them as removable","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"adding E2E tests without a per-test necessity ledger proving existing E2E could not be updated, the workflow is critical/core or complex enough for E2E, and every new assertion is minimal","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"preserving old agent-created E2E tests as \"already there\" when connected evidence shows they are unnecessary, duplicated, brittle, convoluted, or non-core/non-complex","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"starting with a broad/full unit or Vitest suite in Phase 4 before the warranted targeted/connected unit-level tests, when any are warranted, have passed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running the full unit/Vitest suite more than once without a concrete artifact reason from target repo instructions, changed global/shared infrastructure, or incomplete/stale output","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running broad/full unit or Vitest without Phase 4 artifact evidence that warranted targeted/connected tests already passed and this is the one final sanity check, or that the task/repo/global change explicitly requires the broader scope","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running routine check, lint, or build after every small Phase 2 edit instead of preserving packet evidence and using Phase 3 as the ordered check/build checkpoint","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running repo combined check commands such as ","type":"text"},{"text":"pnpm run check","type":"text","marks":[{"type":"code_inline"}]},{"text":" in Phase 2 without a concrete compile/type blocker recorded before the command","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"rerunning check, lint, or build before all visible locally-fixable issue groups from the prior output are fixed; truncated ","type":"text"},{"text":"tail","type":"text","marks":[{"type":"code_inline"}]},{"text":"/","type":"text"},{"text":"head","type":"text","marks":[{"type":"code_inline"}]},{"text":" output alone is not enough if it hides issue groups, and temporary full-output logs must be deleted after extraction","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"rerunning build in Phase 4, Phase 5, Phase 6, or Phase 7 when Phase 3 build evidence is current and no invalidating change is recorded","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Playwright And E2E Command Fails","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running native ","type":"text"},{"text":"pnpm exec playwright test ...","type":"text","marks":[{"type":"code_inline"}]},{"text":" in Phase 6 instead of running it through ","type":"text"},{"text":"task-workflow/scripts/playwright-lifecycle.mjs --run ...","type":"text","marks":[{"type":"code_inline"}]},{"text":", unless repo ","type":"text"},{"text":"webServer","type":"text","marks":[{"type":"code_inline"}]},{"text":" ownership is required and recorded before the command","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running the unfiltered full Playwright/E2E suite when the task did not explicitly ask for full E2E and no concrete written repo instruction names full E2E/all-spec execution for this exact task","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running ","type":"text"},{"text":"rm","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"seed","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"migrate","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"sqlite3","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"tsx server/db/seed","type":"text","marks":[{"type":"code_inline"}]},{"text":", fixture setup, or any DB cleanup command from Phase 5/6 unless the artifact first proves the command targets an isolated repo-owned test/E2E database and not production/live user data","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"starting a first-run targeted Phase 5 Playwright script above ","type":"text"},{"text":"20000","type":"text","marks":[{"type":"code_inline"}]},{"text":" ms or a first-run targeted Phase 6 E2E above ","type":"text"},{"text":"30000","type":"text","marks":[{"type":"code_inline"}]},{"text":" ms without a task-specific artifact reason","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"increasing a Playwright/E2E timeout after any useful failure evidence, or increasing it after a timer-only/no-output failure without recorded helper-log/readiness/URL/DB-fixture/server-log/browser-console/network/page-state triage proving the app and test are valid to rerun","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"rerunning tests only for confidence, or blindly rerunning the same failing test command without recording a material implementation, test, config, environment, output-staleness, or diagnostic reason","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running ","type":"text"},{"text":"playwright install","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"playwright install chromium","type":"text","marks":[{"type":"code_inline"}]},{"text":", or equivalent browser downloads during task verification instead of using the sandbox browser cache or recording the helper's browser-preflight mismatch","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Continuity And Evidence Fails","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"passing Phase 3 or Phase 7 while changed app/server source still contains ","type":"text"},{"text":"console.*","type":"text","marks":[{"type":"code_inline"}]},{"text":" outside the active Phase 5 debug loop","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"producing a final response or stopping summary while ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" is before ","type":"text"},{"text":"phase-7-final-signoff","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"producing a final response or stopping summary while any required artifact still says ","type":"text"},{"text":"Decision: Fail","type":"text","marks":[{"type":"code_inline"}]},{"text":", has a failing score, or contains pending gate evidence","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ending an OpenCode turn mid-phase while the next workflow action is locally available","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"editing Phase 2 source files while ","type":"text"},{"text":"task-workflow/phase-2-execution.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" execution log remains blank or all ","type":"text"},{"text":"Pending","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"completing multiple Phase 2 implementation packets before updating their execution-log rows with file evidence","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"replacing evidence tables with prose","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"skipping the second execution pass","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"treating Phase 3 check/lint evidence as a substitute for Phase 4 unit-test coverage decisions, Phase 5 interactive Playwright verification, or Phase 6 E2E coverage decisions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"treating Playwright verification as a substitute for warranted Phase 4 or Phase 6 test work","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running Phase 5 interactive Playwright verification or Phase 6 E2E coverage work as a substitute for completing the Phase 2 gate","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"leaving a long-lived dev server, watcher, or interactive command in the foreground until the session stalls","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"relying on a file write or patch without readback evidence when the file matters to a gate","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"continuing after a failed, invalid, or uncertain write result without repairing and rereading the target file","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Final Signoff Fails","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"signing off while critical open gaps remain","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"signing off while ","type":"text"},{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" contains stale open gaps that a passed later phase claims to have resolved","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"signing off while ","type":"text"},{"text":"task-workflow/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" still contains template placeholder rows such as ","type":"text"},{"text":"Pending","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"passing Phase 5, Phase 6, or Phase 7 without recorded fixed-wait review evidence","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"passing Phase 5, Phase 6, or Phase 7 while fixed waits remain in ","type":"text"},{"text":"task-workflow/playwright","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"tests/e2e","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"passing Phase 7 without a recorded artifact integrity review of every phase artifact","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"signing off while any final quality scorecard category is below ","type":"text"},{"text":"8/10","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"deleting existing tests without equivalent replacement coverage or a written artifact defense","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"using broad unsafe casts or warning suppression to bypass the type system without a narrow evidence-backed reason","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"relying on conversation memory after compaction instead of using ","type":"text"},{"text":"progress.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"CURRENT_PHASE.txt","type":"text","marks":[{"type":"code_inline"}]},{"text":" for status and re-reading this skill, required phase reference files, and artifacts","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"failing to enumerate ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":" even when it is empty","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"failing to read or inspect every task attachment/supporting file in ","type":"text"},{"text":".tasks/files/","type":"text","marks":[{"type":"code_inline"}]},{"text":" before Phase 1 planning","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"bulk-reading every skill file in ","type":"text"},{"text":".agents/skills/","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead of selecting and reading only task-relevant skills","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"planning, implementing, verifying, or signing off work that violates the extracted ","type":"text"},{"text":"AGENTS.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" development rules","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"running a MITB task completion command before all Phase 7 audit checks pass","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"failing to loop back to the earliest failing phase when any Phase 7 audit check fails","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"failing to run the required MITB completed command after all Phase 7 audit checks pass","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"asking the user whether to continue between phases when the next phase is unblocked","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"\u003c/automatic_fails>","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Reference Map","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/phase-0-1-startup-research.md","type":"text","marks":[{"type":"code_inline"}]},{"text":": artifact reset, template copying, task intake, and codebase research.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/phase-2-4-execution-integrity.md","type":"text","marks":[{"type":"code_inline"}]},{"text":": primary execution, second execution, gap closure, and integrity checks.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/phase-5-7-verification-signoff.md","type":"text","marks":[{"type":"code_inline"}]},{"text":": interactive Playwright verification, E2E coverage decisions, and final audit.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/playwright-interactive.md","type":"text","marks":[{"type":"code_inline"}]},{"text":": how this skill uses standalone interactive Playwright scripts.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/phase-0-artifact-reset.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/phase-1-task-research.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/phase-2-execution.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/phase-3-second-execution.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/phase-4-unit-coverage.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/phase-5-playwright-verification.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/phase-6-e2e-verification.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/phase-7-final-signoff.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/progress.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/templates/open-gaps.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/scripts/playwright-lifecycle.mjs","type":"text","marks":[{"type":"code_inline"}]},{"text":": managed server/readiness/Playwright execution helper copied into ","type":"text"},{"text":"task-workflow/scripts/","type":"text","marks":[{"type":"code_inline"}]},{"text":" during Phase 0.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"assets/scripts/server-probe.mjs","type":"text","marks":[{"type":"code_inline"}]},{"text":": managed API/runtime server probe helper copied into ","type":"text"},{"text":"task-workflow/scripts/","type":"text","marks":[{"type":"code_inline"}]},{"text":" during Phase 0 for pre-Phase-5 server checks.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Non-Negotiables","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use the phase gates exactly.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Keep the artifacts auditable.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Return to earlier phases when evidence is weak.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not edit source files before Phase 0 and Phase 1 gates pass.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not sign off before interactive Playwright verification and regression test gates pass.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Completion Standard","type":"text"}]},{"type":"paragraph","content":[{"text":"The task is complete only when Phase 7 passes. If the task cannot be completed, the final artifact must identify the exact blocking condition, the phase where it occurred, commands run, files inspected, and the smallest next action needed.","type":"text"}]}]},"metadata":{"date":"2026-11-02","name":"task-workflow","author":"@skillopedia","source":{"stars":2,"repo_name":"skills","origin_url":"https://github.com/customware-ai/skills/blob/HEAD/skills/task-workflow/SKILL.md","repo_owner":"customware-ai","body_sha256":"058aa884d80ee7fe9e64023f1de57bcd275db7504d67819afeab06e61bf926c2","cluster_key":"595127244d32299276fdf57b88ec21fa4aa25d73782bdce9ab4866e0072fdc87","clean_bundle":{"format":"clean-skill-bundle-v1","source":"customware-ai/skills/skills/task-workflow/SKILL.md","text_bytes":221195,"source_commit":"a80393a5ce8a1953e727780424f257a63620d7b5","skills_sh_rank":8617,"attachment_count":17,"text_attachments":17,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"skills/task-workflow/SKILL.md","import_metadata":{"date":"2026-11-02","author":"@skillopedia","version":"v1","category":"general","category_label":"General"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"general","import_tag":"skills-sh-top20k-2026-11","description":"Canonical workflow for a task. Read and follow strictly end to end while working on the task."}},"renderedAt":1793671126608}

Task Workflow Strict Instruction Contract This file is strict implementation instruction, not loose guidance and not optional reference material. This is the canonical workflow for task execution. It is not one possible way to do the task; it is the required way. If the Agent reads this skill, it must execute it exactly as written, in order, to the letter. Required behavior: - Do not reinterpret the steps. - Do not reorder the steps. - Do not skip the steps. - Do not replace the steps with a simpler approach. - Do not make assumptions that override this file. - Do not treat broad similarity,…