prizmkit 1.1.193 → 1.1.195

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/bin/create-prizmkit.js +43 -12
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/dev-pipeline/.env.example +5 -0
  4. package/bundled/dev-pipeline/README.md +2 -1
  5. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +111 -30
  6. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +44 -3
  7. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +29 -9
  8. package/bundled/dev-pipeline/prizmkit_runtime/config.py +121 -44
  9. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +190 -37
  10. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
  11. package/bundled/dev-pipeline/prizmkit_runtime/iterate.py +2480 -0
  12. package/bundled/dev-pipeline/prizmkit_runtime/paths.py +3 -0
  13. package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +32 -8
  14. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +29 -12
  15. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +13 -5
  16. package/bundled/dev-pipeline/prizmkit_runtime/status.py +166 -0
  17. package/bundled/dev-pipeline/scripts/feature_list_contract.py +964 -0
  18. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +18 -40
  19. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +24 -19
  20. package/bundled/dev-pipeline/scripts/prompt_framework.py +24 -8
  21. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +1 -63
  22. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +8 -6
  23. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +0 -10
  24. package/bundled/dev-pipeline/templates/feature-list-schema.json +8 -6
  25. package/bundled/dev-pipeline/templates/iterate/evaluate-prompt.md +97 -0
  26. package/bundled/dev-pipeline/templates/iterate/evaluation-schema.json +538 -0
  27. package/bundled/dev-pipeline/templates/iterate/headless-plan-prompt.md +66 -0
  28. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +2 -2
  29. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +13 -4
  30. package/bundled/rules/USAGE.md +15 -48
  31. package/bundled/rules/_rules-metadata.json +7 -14
  32. package/bundled/rules/general/coding-baseline.md +23 -0
  33. package/bundled/rules/prizm/prizm-progressive-loading.md +2 -2
  34. package/bundled/skills/_metadata.json +12 -42
  35. package/bundled/skills/app-planner/SKILL.md +2 -2
  36. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -2
  37. package/bundled/skills/app-planner/references/project-state-detection.md +1 -1
  38. package/bundled/skills/app-planner/references/rules-configuration.md +158 -88
  39. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +543 -12
  40. package/bundled/skills/bug-planner/references/verification.md +4 -5
  41. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +20 -14
  42. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +49 -9
  43. package/bundled/skills/feature-pipeline-launcher/SKILL.md +20 -14
  44. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +49 -9
  45. package/bundled/skills/feature-planner/SKILL.md +3 -3
  46. package/bundled/skills/feature-planner/references/browser-interaction.md +9 -29
  47. package/bundled/skills/iterate-pipeline-launcher/SKILL.md +273 -0
  48. package/bundled/skills/iterate-pipeline-launcher/references/configuration.md +105 -0
  49. package/bundled/skills/prizmkit-code-review/SKILL.md +10 -8
  50. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +4 -1
  51. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -1
  52. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +12 -8
  53. package/bundled/skills/prizmkit-implement/SKILL.md +2 -2
  54. package/bundled/skills/prizmkit-init/SKILL.md +10 -10
  55. package/bundled/skills/prizmkit-init/references/brownfield-deep-init.md +81 -0
  56. package/bundled/skills/prizmkit-plan/SKILL.md +2 -1
  57. package/bundled/skills/prizmkit-plan/assets/plan-template.md +2 -0
  58. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +8 -4
  59. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +8 -7
  60. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +33 -16
  61. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +1 -1
  62. package/bundled/skills/prizmkit-retrospective/SKILL.md +29 -12
  63. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +126 -2
  64. package/bundled/skills/prizmkit-retrospective/references/rule-evolution-steps.md +86 -0
  65. package/bundled/skills/prizmkit-test/SKILL.md +2 -1
  66. package/bundled/skills/prizmkit-workflow/SKILL.md +8 -0
  67. package/bundled/skills/prizmkit-workflow/references/cold-start-rules.md +84 -0
  68. package/bundled/templates/project-memory-template.md +3 -3
  69. package/package.json +1 -1
  70. package/src/clean.js +2 -3
  71. package/src/config.js +52 -39
  72. package/src/index.js +29 -111
  73. package/src/prompts.js +20 -87
  74. package/src/runtime-passthrough.js +324 -0
  75. package/src/scaffold.js +41 -294
  76. package/src/upgrade.js +7 -39
  77. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +0 -127
  78. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +0 -124
  79. package/src/external-skills.js +0 -103
@@ -514,7 +514,7 @@ def process_conditional_blocks(content, resume_phase):
514
514
 
515
515
 
516
516
  def process_template_blocks(content, init_done, browser_interaction=False,
517
- browser_tool="auto"):
517
+ browser_tool="playwright-cli"):
518
518
  """Process init and browser blocks in an explicit custom template."""
519
519
  # Init blocks
520
520
  if init_done:
@@ -544,28 +544,17 @@ def process_template_blocks(content, init_done, browser_interaction=False,
544
544
  pattern = re.escape(browser_open) + r".*?" + re.escape(browser_close) + r"\n?"
545
545
  content = re.sub(pattern, "", content, flags=re.DOTALL)
546
546
 
547
- # Browser tool selection blocks (nested inside browser interaction)
548
- tool_variants = ["PLAYWRIGHT", "OPENCLI", "AUTO"]
549
- # Map browser_tool value to the variant tag name
550
- active_variant = {
551
- "playwright-cli": "PLAYWRIGHT",
552
- "opencli": "OPENCLI",
553
- "auto": "AUTO",
554
- }.get(browser_tool, "AUTO")
555
-
556
- for variant in tool_variants:
557
- tool_open = "{{{{IF_BROWSER_TOOL_{}}}}}".format(variant)
558
- tool_close = "{{{{END_IF_BROWSER_TOOL_{}}}}}".format(variant)
559
- if variant == active_variant and browser_interaction:
560
- # Keep content, remove tags
561
- content = content.replace(tool_open + "\n", "")
562
- content = content.replace(tool_open, "")
563
- content = content.replace(tool_close + "\n", "")
564
- content = content.replace(tool_close, "")
565
- else:
566
- # Remove entire block
567
- pat = re.escape(tool_open) + r".*?" + re.escape(tool_close) + r"\n?"
568
- content = re.sub(pat, "", content, flags=re.DOTALL)
547
+ # Unwrap optional legacy PLAYWRIGHT conditional block when browser verification is enabled
548
+ tool_open = "{{IF_BROWSER_TOOL_PLAYWRIGHT}}"
549
+ tool_close = "{{END_IF_BROWSER_TOOL_PLAYWRIGHT}}"
550
+ if browser_interaction:
551
+ content = content.replace(tool_open + "\n", "")
552
+ content = content.replace(tool_open, "")
553
+ content = content.replace(tool_close + "\n", "")
554
+ content = content.replace(tool_close, "")
555
+ else:
556
+ pat = re.escape(tool_open) + r".*?" + re.escape(tool_close) + r"\n?"
557
+ content = re.sub(pat, "", content, flags=re.DOTALL)
569
558
 
570
559
  return content
571
560
 
@@ -806,7 +795,7 @@ def _canonical_reminders():
806
795
 
807
796
 
808
797
  def assemble_sections(sections_dir, init_done, browser_enabled,
809
- browser_tool="auto"):
798
+ browser_tool="playwright-cli"):
810
799
  """Assemble the canonical prompt sections and configured optional gates."""
811
800
  sections = []
812
801
 
@@ -861,14 +850,8 @@ def assemble_sections(sections_dir, init_done, browser_enabled,
861
850
  load_section(sections_dir, "phase-review-full.md")))
862
851
 
863
852
  if browser_enabled:
864
- if browser_tool == "opencli":
865
- browser_section_file = "phase-browser-verification-opencli.md"
866
- elif browser_tool == "playwright-cli":
867
- browser_section_file = "phase-browser-verification.md"
868
- else:
869
- browser_section_file = "phase-browser-verification-auto.md"
870
853
  sections.append(("phase-browser",
871
- load_section(sections_dir, browser_section_file)))
854
+ load_section(sections_dir, "phase-browser-verification.md")))
872
855
 
873
856
  sections.append(("phase-prizmkit-test",
874
857
  load_section(sections_dir, "phase-prizmkit-test.md")))
@@ -1001,14 +984,9 @@ def build_replacements(args, feature, features, global_context, script_dir):
1001
984
 
1002
985
  # Browser verification is opt-in through a browser_interaction object and
1003
986
  # can always be disabled globally with BROWSER_VERIFY=false.
1004
- browser_enabled, browser_tool, browser_verify_steps, browser_blocking = browser_enabled_from_item(feature)
1005
-
1006
- if browser_tool not in ("playwright-cli", "opencli", "auto"):
1007
- LOGGER.warning(
1008
- "Unknown browser_interaction.tool '%s', defaulting to 'auto'",
1009
- browser_tool,
1010
- )
1011
- browser_tool = "auto"
987
+ browser_enabled, browser_tool, browser_verify_steps, browser_blocking = browser_enabled_from_item(
988
+ feature, logger=LOGGER,
989
+ )
1012
990
 
1013
991
  # Auto-detect test commands from project structure
1014
992
  test_cmd = detect_test_commands(project_root)
@@ -1086,7 +1064,7 @@ def build_replacements(args, feature, features, global_context, script_dir):
1086
1064
 
1087
1065
 
1088
1066
  def render_template(template_content, replacements, resume_phase,
1089
- browser_enabled=False, browser_tool="auto"):
1067
+ browser_enabled=False, browser_tool="playwright-cli"):
1090
1068
  """Render the template by processing conditionals and replacing placeholders."""
1091
1069
  # Step 1: Process fresh_start/resume conditional blocks
1092
1070
  content = process_conditional_blocks(template_content, resume_phase)
@@ -307,7 +307,9 @@ def build_replacements(args, bug, global_context, script_dir):
307
307
  fix_scope = affected_modules[0] if affected_modules else (bug.get("title", "unknown").split()[0].lower() if bug.get("title") else "unknown")
308
308
  verification_type = bug.get("verification_type", "automated")
309
309
 
310
- browser_enabled, browser_tool, browser_verify_steps, browser_blocking = browser_enabled_from_item(bug)
310
+ browser_enabled, browser_tool, browser_verify_steps, browser_blocking = browser_enabled_from_item(
311
+ bug, logger=LOGGER,
312
+ )
311
313
  dev_port = detect_dev_server_port(project_root)
312
314
  dev_url = "http://localhost:{}".format(dev_port) if dev_port.isdigit() else "<UNKNOWN_DETECT_FROM_PROJECT_CONFIG>"
313
315
 
@@ -355,7 +357,7 @@ def build_replacements(args, bug, global_context, script_dir):
355
357
  return replacements
356
358
 
357
359
 
358
- def process_conditional_blocks(content, bug):
360
+ def process_conditional_blocks(content, bug, browser_enabled=None):
359
361
  """Handle legacy conditional blocks based on verification_type and browser_interaction."""
360
362
  vtype = bug.get("verification_type", "automated")
361
363
  is_manual_or_hybrid = vtype in ("manual", "hybrid")
@@ -367,7 +369,8 @@ def process_conditional_blocks(content, bug):
367
369
  else:
368
370
  content = re.sub(r"\{\{IF_VERIFICATION_MANUAL_OR_HYBRID\}\}.*?\{\{END_IF_VERIFICATION_MANUAL_OR_HYBRID\}\}\n?", "", content, flags=re.DOTALL)
369
371
 
370
- browser_enabled, browser_tool, _steps, _blocking = browser_enabled_from_item(bug)
372
+ if browser_enabled is None:
373
+ browser_enabled, _browser_tool, _steps, _blocking = browser_enabled_from_item(bug, logger=LOGGER)
371
374
  browser_open = "{{IF_BROWSER_INTERACTION}}"
372
375
  browser_close = "{{END_IF_BROWSER_INTERACTION}}"
373
376
  if browser_enabled:
@@ -376,21 +379,27 @@ def process_conditional_blocks(content, bug):
376
379
  else:
377
380
  content = re.sub(re.escape(browser_open) + r".*?" + re.escape(browser_close) + r"\n?", "", content, flags=re.DOTALL)
378
381
 
379
- active_variant = {"playwright-cli": "PLAYWRIGHT", "opencli": "OPENCLI", "auto": "AUTO"}.get(browser_tool, "AUTO")
380
- for variant in ("PLAYWRIGHT", "OPENCLI", "AUTO"):
381
- tool_open = "{{{{IF_BROWSER_TOOL_{}}}}}".format(variant)
382
- tool_close = "{{{{END_IF_BROWSER_TOOL_{}}}}}".format(variant)
383
- if variant == active_variant and browser_enabled:
384
- content = content.replace(tool_open + "\n", "").replace(tool_open, "")
385
- content = content.replace(tool_close + "\n", "").replace(tool_close, "")
386
- else:
387
- content = re.sub(re.escape(tool_open) + r".*?" + re.escape(tool_close) + r"\n?", "", content, flags=re.DOTALL)
382
+ tool_open = "{{IF_BROWSER_TOOL_PLAYWRIGHT}}"
383
+ tool_close = "{{END_IF_BROWSER_TOOL_PLAYWRIGHT}}"
384
+ if browser_enabled:
385
+ content = content.replace(tool_open + "\n", "").replace(tool_open, "")
386
+ content = content.replace(tool_close + "\n", "").replace(tool_close, "")
387
+ else:
388
+ content = re.sub(re.escape(tool_open) + r".*?" + re.escape(tool_close) + r"\n?", "", content, flags=re.DOTALL)
388
389
  return content
389
390
 
390
391
 
391
392
  def render_template(template_content, replacements, bug):
392
393
  """Render the legacy template by processing conditionals and placeholders."""
393
- return replace_placeholders(process_conditional_blocks(template_content, bug), replacements)
394
+ browser_enabled = (
395
+ replacements.get("{{BROWSER_ENABLED}}") == "true"
396
+ if "{{BROWSER_ENABLED}}" in replacements
397
+ else None
398
+ )
399
+ return replace_placeholders(
400
+ process_conditional_blocks(template_content, bug, browser_enabled=browser_enabled),
401
+ replacements,
402
+ )
394
403
 
395
404
 
396
405
  def _bugfix_header():
@@ -401,7 +410,7 @@ def _bugfix_header():
401
410
  )
402
411
 
403
412
 
404
- def assemble_bugfix_sections(sections_dir, browser_enabled, manual_gate, browser_tool="auto"):
413
+ def assemble_bugfix_sections(sections_dir, browser_enabled, manual_gate, browser_tool="playwright-cli"):
405
414
  sections = [
406
415
  ("header", _bugfix_header()),
407
416
  ("bugfix-session-context", load_section(sections_dir, "bugfix-session-context.md")),
@@ -419,11 +428,7 @@ def assemble_bugfix_sections(sections_dir, browser_enabled, manual_gate, browser
419
428
  ("bugfix-phase-review", load_section(sections_dir, "bugfix-phase-review.md")),
420
429
  ])
421
430
  if browser_enabled:
422
- browser_section_file = {
423
- "playwright-cli": "phase-browser-verification.md",
424
- "opencli": "phase-browser-verification-opencli.md",
425
- }.get(browser_tool, "phase-browser-verification-auto.md")
426
- sections.append(("phase-browser", load_section(sections_dir, browser_section_file)))
431
+ sections.append(("phase-browser", load_section(sections_dir, "phase-browser-verification.md")))
427
432
  if manual_gate:
428
433
  sections.append(("bugfix-manual-gate", load_section(sections_dir, "bugfix-phase-manual-verification.md")))
429
434
  sections.extend([
@@ -6,6 +6,7 @@ so feature and bugfix prompts do not drift.
6
6
  """
7
7
 
8
8
  import glob
9
+ import logging
9
10
  import os
10
11
  import re
11
12
  import sys
@@ -24,6 +25,7 @@ from prizmkit_runtime.test_result import valid_test_artifact_pair # noqa: E402
24
25
 
25
26
 
26
27
  MAX_OUTER_REPAIR_ROUNDS = 3
28
+ _LOGGER = logging.getLogger(__name__)
27
29
 
28
30
 
29
31
  def route_pipeline_repair(stage_result, repair_scope=None, repair_round=0, *, production_changed=False):
@@ -548,26 +550,40 @@ def detect_dev_server_port(project_root):
548
550
  return unknown
549
551
 
550
552
 
551
- def browser_enabled_from_item(item):
552
- """Return browser enabled/tool/steps with explicit opt-in semantics."""
553
+ def browser_enabled_from_item(item, logger=None):
554
+ """Return browser enabled/tool/steps/blocking with explicit opt-in semantics.
555
+
556
+ Legacy ``browser_interaction.tool`` values (``"auto"`` or ``"opencli"``) are
557
+ normalized to ``"playwright-cli"`` with a logged deprecation warning so
558
+ pre-existing task lists still execute cleanly.
559
+ """
553
560
  browser_interaction = item.get("browser_interaction") if isinstance(item, dict) else None
554
561
  env_value = os.environ.get("BROWSER_VERIFY", "").lower()
555
562
  if env_value == "false":
556
- return False, "auto", "", False
563
+ return False, "playwright-cli", "", False
557
564
 
558
565
  enabled = False
559
- tool = "auto"
566
+ tool = "playwright-cli"
560
567
  blocking = False
561
568
  steps = []
569
+ active_logger = logger or _LOGGER
562
570
 
563
571
  if isinstance(browser_interaction, dict):
564
572
  enabled = True
565
- tool = browser_interaction.get("tool", "auto")
573
+ raw_tool = browser_interaction.get("tool")
566
574
  blocking = bool(browser_interaction.get("blocking", False))
567
575
  steps = browser_interaction.get("verify_steps", []) or []
568
-
569
- if tool not in ("playwright-cli", "opencli", "auto"):
570
- tool = "auto"
576
+ if raw_tool in ("auto", "opencli"):
577
+ active_logger.warning(
578
+ "Deprecated browser_interaction.tool '%s' is no longer supported; "
579
+ "normalizing to 'playwright-cli'",
580
+ raw_tool,
581
+ )
582
+ elif raw_tool is not None and raw_tool != "playwright-cli":
583
+ active_logger.warning(
584
+ "Unknown browser_interaction.tool '%s'; normalizing to 'playwright-cli'",
585
+ raw_tool,
586
+ )
571
587
 
572
588
  if steps:
573
589
  rendered_steps = "\n".join(
@@ -247,7 +247,6 @@ You MUST execute this phase. Do NOT skip it.
247
247
 
248
248
  **Browser Tool**: {{BROWSER_TOOL}}
249
249
 
250
- {{IF_BROWSER_TOOL_PLAYWRIGHT}}
251
250
  **Using: playwright-cli**
252
251
 
253
252
  **CRITICAL CONSTRAINT — playwright-cli ONLY, NO Playwright MCP**:
@@ -311,74 +310,13 @@ Construct your verification workflow based on: (1) the playwright-cli skill docu
311
310
  1. Close the playwright-cli browser: `playwright-cli close`
312
311
  2. Kill the dev server process: `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
313
312
  3. Verify port is released: `{{RUNTIME_HELPER_CMD}} port check {{DEV_PORT}}`
314
- {{END_IF_BROWSER_TOOL_PLAYWRIGHT}}
315
- {{IF_BROWSER_TOOL_OPENCLI}}
316
- **Using: opencli** (reuses Chrome logged-in sessions)
317
-
318
- **CRITICAL CONSTRAINT — opencli browser ONLY**:
319
- - You MUST use `opencli browser` for ALL browser interactions in this phase
320
- - All browser actions go through `opencli browser <command>` via the shell/terminal command tool
321
-
322
- **Step 0 — OpenCLI Readiness Check (BLOCKING)**:
323
-
324
- 0a. Check if `opencli` is installed:
325
- ```bash
326
- {{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version
327
- ```
328
- If `NOT_INSTALLED`: `npm install -g @jackwener/opencli@latest`. If installation fails, log `## Browser Verification: SKIPPED — opencli installation failed` and proceed.
329
-
330
- 0b. Verify Browser Bridge: `opencli doctor`. If fails, log skip and proceed.
331
-
332
- 0c. Learn usage: `opencli browser --help`
333
-
334
- **Step 1 — Start Dev Server**:
335
- 1. Determine `DEV_PORT` from the pipeline value (`{{DEV_PORT}}`) or project config; do not guess.
336
- 2. Verify port available: `{{RUNTIME_HELPER_CMD}} port check <DEV_PORT>`
337
- 3. Start server: `{{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>`
338
- 4. Wait for ready: `{{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:<DEV_PORT> --timeout 30 --interval 2`
339
- 5. Open: `opencli browser open http://localhost:<DEV_PORT>`; then inspect: `opencli browser state`
340
-
341
- **Step 2 — Verification**:
342
-
343
- Use `opencli browser state` to discover elements with `[N]` indices, then verify:
344
- {{BROWSER_VERIFY_STEPS}}
345
-
346
- Run page-changing commands sequentially, then run `opencli browser state` to refresh indices.
347
-
348
- **Step 3 — Cleanup**:
349
- 1. `opencli browser close`
350
- 2. `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
351
- 3. `{{RUNTIME_HELPER_CMD}} port check {{DEV_PORT}}`
352
- {{END_IF_BROWSER_TOOL_OPENCLI}}
353
- {{IF_BROWSER_TOOL_AUTO}}
354
- **Tool Selection**: Choose the best browser tool at runtime.
355
-
356
- **Step 0 — Detect available tools**:
357
- ```bash
358
- {{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
359
- {{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version
360
- ```
361
- If opencli is installed, run `opencli doctor`. If it fails, mark OpenCLI unusable and choose playwright-cli or skip browser verification.
362
-
363
- **Decision table**:
364
- | Condition | Tool |
365
- |-----------|------|
366
- | Only playwright-cli available | playwright-cli |
367
- | Only opencli available (doctor passes) | opencli |
368
- | Both — local dev server, forms, components | playwright-cli |
369
- | Both — needs real login state (OAuth/SSO) | opencli |
370
- | Both — third-party integration verification | opencli |
371
- | Neither available | Install playwright-cli as default |
372
-
373
- Then follow the corresponding tool's workflow above (Steps 1-3).
374
- {{END_IF_BROWSER_TOOL_AUTO}}
375
313
 
376
314
  **Step 4 — Reporting**:
377
315
 
378
316
  Append results to `context-snapshot.md`:
379
317
  ```
380
318
  ## Browser Verification
381
- Tool: <playwright-cli or opencli>
319
+ Tool: playwright-cli
382
320
  URL: http://localhost:{{DEV_PORT}}
383
321
  Dev Server Command: <actual command used>
384
322
  Tool version: <version>
@@ -202,17 +202,19 @@
202
202
  },
203
203
  "browser_interaction": {
204
204
  "type": "object",
205
- "description": "Browser verification config for bugs reproducible via UI. Supports playwright-cli and opencli. AI auto-detects dev server command, URL, and port from project config at runtime.",
205
+ "description": "Browser verification config for bugs reproducible via UI using playwright-cli. AI auto-detects dev server command, URL, and port from project config at runtime.",
206
206
  "properties": {
207
207
  "tool": {
208
208
  "type": "string",
209
209
  "enum": [
210
- "playwright-cli",
211
- "opencli",
212
- "auto"
210
+ "playwright-cli"
213
211
  ],
214
- "default": "auto",
215
- "description": "Browser tool to use. 'auto' (default) = AI chooses at runtime. 'playwright-cli' = local dev server verification in isolated browser. 'opencli' = reuses Chrome logged-in session, ideal for verifying bugs related to third-party integrations or OAuth flows."
212
+ "default": "playwright-cli",
213
+ "description": "Browser tool to use. Always uses 'playwright-cli' for local dev server verification in an isolated browser."
214
+ },
215
+ "blocking": {
216
+ "type": "boolean",
217
+ "description": "Whether browser verification failure blocks commit. Defaults to false when omitted."
216
218
  },
217
219
  "verify_steps": {
218
220
  "type": "array",
@@ -85,17 +85,7 @@ You are the **bug fix session agent**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}".
85
85
 
86
86
  The bug may be reproducible via the UI. Use this single browser protocol for planning, implementation, review, and final reporting:
87
87
 
88
- {{IF_BROWSER_TOOL_AUTO}}
89
- - **Browser Tool**: Auto-select at runtime based on error type and dev server configuration
90
- {{END_IF_BROWSER_TOOL_AUTO}}
91
-
92
- {{IF_BROWSER_TOOL_PLAYWRIGHT}}
93
88
  - **Browser Tool**: playwright-cli (local isolated browser against dev server)
94
- {{END_IF_BROWSER_TOOL_PLAYWRIGHT}}
95
-
96
- {{IF_BROWSER_TOOL_OPENCLI}}
97
- - **Browser Tool**: opencli (Chrome session with existing login context — ideal for OAuth/third-party integrations)
98
- {{END_IF_BROWSER_TOOL_OPENCLI}}
99
89
 
100
90
  **Browser Verification Goals**:
101
91
  {{BROWSER_VERIFY_STEPS}}
@@ -128,17 +128,19 @@
128
128
  },
129
129
  "browser_interaction": {
130
130
  "type": "object",
131
- "description": "Browser verification config for features with UI. Supports playwright-cli and opencli. AI auto-detects dev server command, URL, and port from project config at runtime.",
131
+ "description": "Browser verification config for features with UI using playwright-cli. AI auto-detects dev server command, URL, and port from project config at runtime.",
132
132
  "properties": {
133
133
  "tool": {
134
134
  "type": "string",
135
135
  "enum": [
136
- "playwright-cli",
137
- "opencli",
138
- "auto"
136
+ "playwright-cli"
139
137
  ],
140
- "default": "auto",
141
- "description": "Browser tool to use. 'auto' (default) = AI chooses at runtime. 'playwright-cli' = local dev server verification in isolated browser. 'opencli' = reuses Chrome logged-in session, ideal for verifying third-party integrations or OAuth flows."
138
+ "default": "playwright-cli",
139
+ "description": "Browser tool to use. Always uses 'playwright-cli' for local dev server verification in an isolated browser."
140
+ },
141
+ "blocking": {
142
+ "type": "boolean",
143
+ "description": "Whether browser verification failure blocks commit. Defaults to false when omitted."
142
144
  },
143
145
  "verify_steps": {
144
146
  "type": "array",
@@ -0,0 +1,97 @@
1
+ # Autonomous Product Evaluation — Phase A (Read-Only)
2
+
3
+ You are evaluating the shipped product in a **fresh, non-interactive, read-only session**.
4
+ Your sole deliverable is one valid JSON document written to `{{OUTPUT_PATH}}` conforming strictly to `{{SCHEMA_PATH}}`.
5
+
6
+ ## Hard Execution Boundaries
7
+
8
+ 1. **Read-Only Repository Isolation**:
9
+ - Do NOT create, edit, delete, rename, stage, or commit any project source file, test file, configuration file, documentation file, or `.prizmkit/plans/feature-list.json`.
10
+ - The ONLY writable paths in this session are `{{OUTPUT_PATH}}` and temporary walkthrough artifacts inside `{{ROUND_DIR}}` (for example a dev-server PID file or walkthrough screenshots).
11
+ - Modifying any repository file outside `.prizmkit/state/` causes an immediate fail-closed `STOP_EVAL_DIRTY_WORKSPACE` abort.
12
+ 2. **Non-Interactive Session**:
13
+ - Do NOT ask questions or wait for human responses.
14
+ - Do NOT invoke interactive planning or launcher skills.
15
+ 3. **Evidence Honesty & Anti-Padding**:
16
+ - Stopping cleanly when core user journeys are already solid is a successful outcome.
17
+ - NEVER manufacture filler improvements, cosmetics, or low-value churn merely to keep running.
18
+
19
+ ## Project Context & Focus
20
+
21
+ - **Project Root**: `{{PROJECT_ROOT}}`
22
+ - **Output Path**: `{{OUTPUT_PATH}}`
23
+ - **Evaluation Schema**: `{{SCHEMA_PATH}}`
24
+ - **Round Scratch Dir**: `{{ROUND_DIR}}`
25
+ - **Focus Scope**: {{FOCUS_SECTION}}
26
+
27
+ ### Progressive Context Loading
28
+
29
+ {{PRIZM_CONTEXT_HINT}}
30
+
31
+ - Read `.prizmkit/prizm-docs/root.prizm` first when present, then load only relevant module index and detail docs needed to understand shipped user-facing flows.
32
+ - If `.prizmkit/plans/project-brief.md` exists, treat it as **claims of intent**: when brief claims conflict with shipped code, **shipped code wins**.
33
+
34
+ ### Historical Iteration Ledger (for Gate 1 Deduplication)
35
+
36
+ {{LEDGER_SUMMARY}}
37
+
38
+ ## Stage 1 (Upper Half): Evidence-Grounded Candidate Discovery
39
+
40
+ Execute these discovery steps in order:
41
+
42
+ 1. **Identify Product Shape First**:
43
+ - Classify the shipped product into 1 or 2 shapes (`product_shapes`): `web_saas`, `cli_devtool`, `mobile`, `api_sdk`, or `internal_ops` (supporting dual shapes such as `["web_saas", "api_sdk"]`).
44
+ 2. **Walk the Codebase as a User-Facing Artifact**:
45
+ - Trace the real shipped user experience across routes and navigation, screen components and empty/loading states, primary CTAs and their actual handlers, forms and validation paths, API error codes and user-facing messages, auth/plan/quota gates, and core data-model nouns.
46
+ - Strictly **banned**:
47
+ - Do NOT invent one feature per code folder or module.
48
+ - Do NOT copy generic competitor feature checklists.
49
+ - Do NOT turn unchecked items from `project-brief.md` directly into tasks without current code or user-journey pain evidence.
50
+ 3. **Optional Live Walkthrough Upgrade (`playwright-cli` Only)**:
51
+ - For runnable web/UI targets where a safe local dev server or configured local URL is available, optionally upgrade key findings from `inference` to first-class `fact` evidence via `playwright-cli` (never use Playwright MCP tools):
52
+ - Check availability: `{{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version`
53
+ - Detect the project's actual dev server start command and port from project config without hardcoding ports.
54
+ - Check port readiness: `{{RUNTIME_HELPER_CMD}} port check <PORT>`
55
+ - Start server with PID tracking inside `{{ROUND_DIR}}`: `{{RUNTIME_HELPER_CMD}} process start --pid-file {{ROUND_DIR}}/eval-dev-server.pid -- <start-command>`
56
+ - Wait until ready: `{{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:<PORT> --timeout 30 --interval 2`
57
+ - Inspect real UI flows via `playwright-cli open`, `playwright-cli snapshot`, and interactive verification steps.
58
+ - **Mandatory Cleanup** (even if walkthrough fails): run `playwright-cli close`, then `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-eval-dev-server.pid>`, then confirm port release with `{{RUNTIME_HELPER_CMD}} port check <PORT>`.
59
+ - Set `evidence_mode: "live_walkthrough"`, `walkthrough_notes.target_attempted: true`, and `walkthrough_notes.server_cleanup_confirmed: true` only when live walkthrough succeeded and cleanup completed cleanly.
60
+ - If no runnable target or browser tool is safely available, do NOT fabricate walkthrough observations: evaluate honestly from source/runtime evidence and set `evidence_mode: "source_only"`.
61
+ 4. **Apply the Six High-Signal Pain Lenses**:
62
+ - `stall`: user gets stuck with no clear next action, missing prerequisite feedback, or dead-end flow.
63
+ - `hollow_success`: UI/CLI reports success while data was not persisted, action silently no-oped, or result disappeared.
64
+ - `trust_and_control`: destructive/irreversible actions lack confirmation/undo, silent failures hide state, or permissions/boundaries are unclear.
65
+ - `power_and_limits`: core workflows break on realistic scale, pagination, filtering, export, or error recovery boundaries.
66
+ - `failure`: concrete runtime error paths, unhandled invalid input, broken handlers, or crashing core journeys.
67
+ - `second_use`: returning-user friction ("Second use / Come back later": state loss across reloads, missing resume/history, broken repeat workflows).
68
+ 5. **Isolate Divergent Wishes**:
69
+ - Classify exploratory ideas under `adjacent_wish`, `seeing_others`, `time_and_ritual`, or `stretch_idea`.
70
+ - Divergent wishes MUST NEVER enter `approved_candidates`. Route them to `requires_user_confirm` (only if high strategic value warrants user choice) or `rejected_candidates`.
71
+ 6. **Assign Explicit Three-Tier Evidence Labels**:
72
+ - `fact`: directly verified from shipped code, failing execution, or live walkthrough observation (cite exact file paths/symbols or observed walkthrough output in `evidence`).
73
+ - `inference`: plausible gap inferred indirectly without direct reproduction.
74
+ - `taste`: subjective polish, aesthetic preference, or product-direction opinion.
75
+
76
+ ## Stage 2 (Lower Half): Four Mandatory Convergence & Stop Gates
77
+
78
+ Evaluate every discovered candidate through all four gates and record `gate_results`:
79
+
80
+ - **Gate 1 — Scope Alignment & Historical Dedupe (`gate1_scope_dedupe`)**:
81
+ - Verify alignment with the shipped product's core purpose, brief scope, and active focus.
82
+ - Reject duplicates of completed work, already-rejected candidates, or previously deferred items from the historical ledger unless new factual breakage emerged.
83
+ - **Gate 2 — Fact-Evidence Admission (`gate2_fact_admission`)**:
84
+ - Autonomous implementation admits ONLY `fact`-backed core loop breaks and real user-visible pain from the 6 high-signal pain lenses.
85
+ - Reject pure `taste`, unverified `inference`, and user-invisible internal refactors/cleanups.
86
+ - **Gate 3 — Blast-Radius Escalation (`gate3_blast_radius`)**:
87
+ - Flag high-risk changes using `blast_radius_flags`: `schema_migration`, `heavy_dependency`, `paid_external_api`, `breaking_contract`, `major_ia_redesign`, `over_3_features`.
88
+ - Any candidate with `blast_radius: "high"`, any non-empty `blast_radius_flags`, `evidence_tier: "taste"`, or a divergent-wish lens MUST NOT be marked `auto_safe` or placed in `approved_candidates`; escalate worthwhile user choices to `requires_user_confirm`.
89
+ - **Gate 4 — Final Verdict (`verdict`)**:
90
+ - `CONTINUE_WITH_CANDIDATES`: 1 to 3 contract-bounded, `fact`-backed, `auto_safe` high-signal pain candidates in `approved_candidates`.
91
+ - `PAUSE_FOR_USER_CONFIRM`: 0 `approved_candidates`, and at least 1 valuable high-blast-radius or `taste` proposal in `requires_user_confirm` needing user sign-off before coding.
92
+ - `STOP_GOAL_REACHED`: 0 `approved_candidates`; core journeys are solid and verified goals are met.
93
+ - `STOP_NO_HIGH_VALUE`: 0 `approved_candidates`; only marginal tweaks or out-of-scope polish remain.
94
+
95
+ ## Output Requirement
96
+
97
+ Write valid JSON matching `{{SCHEMA_PATH}}` (`schema_version: "prizmkit-iterate-evaluation-v1"`) to `{{OUTPUT_PATH}}` and stop.