pan-wizard 3.35.0 → 3.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3645 -0
- package/README.md +46 -52
- package/agents/pan-conductor.md +2 -3
- package/agents/pan-counterfactual.md +1 -2
- package/agents/pan-debugger.md +14 -3
- package/agents/pan-design-checker.md +1 -2
- package/agents/pan-designer.md +2 -3
- package/agents/pan-document_code.md +1 -2
- package/agents/pan-executor.md +25 -0
- package/agents/pan-hardener.md +4 -3
- package/agents/pan-integration-checker.md +1 -2
- package/agents/pan-knowledge.md +1 -2
- package/agents/pan-meta-reviewer.md +3 -3
- package/agents/pan-optimizer.md +4 -4
- package/agents/pan-phase-researcher.md +80 -475
- package/agents/pan-plan-checker.md +40 -3
- package/agents/pan-planner.md +21 -7
- package/agents/pan-previewer.md +3 -2
- package/agents/pan-project-researcher.md +72 -493
- package/agents/pan-release.md +1 -1
- package/agents/pan-reviewer.md +14 -3
- package/agents/pan-roadmapper.md +12 -7
- package/agents/pan-verifier.md +9 -4
- package/bin/install-lib.cjs +134 -14
- package/bin/install.js +59 -12
- package/commands/pan/army.md +1 -1
- package/commands/pan/autodev.md +76 -0
- package/commands/pan/cost.md +21 -1
- package/commands/pan/exec-phase.md +3 -4
- package/commands/pan/focus-auto.md +14 -7
- package/commands/pan/focus-design.md +4 -5
- package/commands/pan/focus-docs.md +24 -0
- package/commands/pan/learn.md +13 -6
- package/commands/pan/milestone-audit.md +8 -1
- package/commands/pan/milestone-done.md +10 -5
- package/commands/pan/milestone-new.md +2 -2
- package/commands/pan/new-project.md +15 -12
- package/commands/pan/plan-phase.md +15 -9
- package/commands/pan/preview.md +1 -1
- package/commands/pan/quick.md +1 -1
- package/commands/pan/review-deep.md +11 -5
- package/commands/pan/settings.md +6 -0
- package/commands/pan/verify-phase.md +6 -2
- package/docs/AGENTS.md +917 -0
- package/docs/ARCHITECTURE.md +1054 -0
- package/docs/CLI-REFERENCE.md +4582 -0
- package/docs/COMPARISON.md +116 -0
- package/docs/DEVELOPMENT.md +490 -0
- package/docs/ECOSYSTEM-REVIEW-2026-06.md +107 -0
- package/docs/ECOSYSTEM-REVIEW-2026-08.md +349 -0
- package/docs/EXAMPLES.md +584 -0
- package/docs/FAQ.md +254 -0
- package/docs/FIELD-HARVEST-2026-07.md +88 -0
- package/docs/FIELD-REPORT-army-2026-06.md +121 -0
- package/docs/HOOKS.md +638 -0
- package/docs/IMPROVEMENT-TODO.md +246 -0
- package/docs/INTERNALS.md +485 -0
- package/docs/MIGRATION-v2-to-v3.md +258 -0
- package/docs/SECURITY-HARDENING.md +230 -0
- package/docs/SKILLS-ENHANCEMENT-PLAN-V2.md +122 -0
- package/docs/SKILLS-FULL-TEXT.md +9685 -0
- package/docs/SKILLS-REFERENCE.md +1037 -0
- package/docs/TROUBLESHOOTING.md +1084 -0
- package/docs/USER-GUIDE.md +1437 -0
- package/docs/archive/SKILLS-ENHANCEMENT-PLAN.md +230 -0
- package/docs/audits/AUDIT-2026-08-e2e-ROADMAP.md +117 -0
- package/docs/audits/AUDIT-2026-08-e2e-VERIFICATION.md +693 -0
- package/docs/audits/AUDIT-2026-08-e2e.md +1546 -0
- package/docs/audits/OUTSTANDING-2026-08.md +275 -0
- package/docs/audits/STABILITY-TEST-2026-08.md +640 -0
- package/docs/branding/README-brand-draft.md +119 -0
- package/docs/branding/handoff/IMPLEMENTATION.md +205 -0
- package/docs/branding/handoff/README-brand-draft.md +119 -0
- package/docs/branding/handoff/image-prompts.md +46 -0
- package/docs/branding/image-prompts.md +46 -0
- package/docs/branding/nano-banana-prompts.txt +60 -0
- package/docs/context-monitor.md +13 -0
- package/docs/decisions/ADR-0001-strategic-feature-prioritization.md +83 -0
- package/docs/decisions/ADR-0002-copilot-cli-runtime.md +71 -0
- package/docs/decisions/ADR-0003-smart-execution.md +84 -0
- package/docs/decisions/ADR-0004-copilot-cli-interaction.md +89 -0
- package/docs/decisions/ADR-0005-command-naming.md +80 -0
- package/docs/decisions/ADR-0006-focus-commands.md +101 -0
- package/docs/decisions/ADR-0007-ship-v1.md +73 -0
- package/docs/decisions/ADR-0008-map-codebase-mermaid-togaf.md +80 -0
- package/docs/decisions/ADR-0009-production-deployment-checklist.md +68 -0
- package/docs/decisions/ADR-0010-standards-integration.md +79 -0
- package/docs/decisions/ADR-0011-help-commands-rewrite.md +64 -0
- package/docs/decisions/ADR-0012-contributors-attribution-index.md +42 -0
- package/docs/decisions/ADR-0013-strategic-feature-additions.md +53 -0
- package/docs/decisions/ADR-0014-internal-cleanup-code-quality.md +53 -0
- package/docs/decisions/ADR-0015-focus-auto-runner.md +296 -0
- package/docs/decisions/ADR-0016-enhanced-doc-sync.md +54 -0
- package/docs/decisions/ADR-0017-enhanced-focus-design.md +69 -0
- package/docs/decisions/ADR-0018-user-reality-testing.md +84 -0
- package/docs/decisions/ADR-0019-end-to-end-user-acceptance-testing.md +113 -0
- package/docs/decisions/ADR-0020-ai-drift-prevention.md +55 -0
- package/docs/decisions/ADR-0021-codebase-mapper-v2.md +76 -0
- package/docs/decisions/ADR-0022-lifecycle-completeness.md +63 -0
- package/docs/decisions/ADR-0023-opus-4-7-adoption.md +89 -0
- package/docs/decisions/ADR-0024-spec-b-v2-completion.md +137 -0
- package/docs/decisions/ADR-0025-behavioral-guardrails-layer.md +129 -0
- package/docs/decisions/ADR-0026-self-improvement-loop.md +171 -0
- package/docs/decisions/ADR-0027-doc-code-link-graph.md +164 -0
- package/docs/decisions/ADR-0028-unified-agents-skills-target.md +46 -0
- package/docs/decisions/ADR-0029-experiment-evaluator.md +76 -0
- package/docs/decisions/ADR-0030-planning-concurrency.md +37 -0
- package/docs/decisions/ADR-0031-focus-auto-backlog-source.md +47 -0
- package/docs/decisions/ADR-0032-squad-model.md +64 -0
- package/docs/decisions/ADR-0033-army-campaign.md +40 -0
- package/docs/decisions/ADR-0034-scheduled-campaigns.md +57 -0
- package/docs/decisions/ADR-0035-army-hud-dashboard.md +40 -0
- package/docs/decisions/ADR-0036-agentic-memory-architecture.md +106 -0
- package/docs/decisions/ADR-0037-pin-security-agents-to-opus.md +51 -0
- package/docs/decisions/ADR-0038-skill-aligned-decomposition.md +41 -0
- package/docs/decisions/ADR-0039-worktree-as-project-variant.md +37 -0
- package/docs/decisions/ADR-0040-memory-injection-defense.md +55 -0
- package/docs/decisions/ADR-0041-mcp-dual-era-bridge.md +47 -0
- package/docs/decisions/ADR-0042-design-parity-both-flows.md +45 -0
- package/docs/decisions/ADR-0043-addressable-planning-roots.md +56 -0
- package/docs/decisions/ADR-0044-bound-the-cached-context.md +104 -0
- package/docs/decisions/ADR-0045-agent-plugins-bundle.md +76 -0
- package/docs/decisions/ADR-0046-subagent-frontmatter-decisions.md +39 -0
- package/docs/decisions/ADR-0047-pan-harness.md +76 -0
- package/docs/decisions/ADR-0048-one-core-per-project.md +43 -0
- package/docs/decisions/ADR-0049-machine-verdicts-and-findings-ledger.md +116 -0
- package/docs/specs/ai_drift_prevention_featureai.md +286 -0
- package/docs/specs/codebase_mapper_v2_featureai.md +930 -0
- package/docs/specs/command_naming_optimization_featureai.md +930 -0
- package/docs/specs/comp_analysis_markdown_v1.md +149 -0
- package/docs/specs/continuous_autonomous_execution_featureai.md +304 -0
- package/docs/specs/contributors_attribution_index_featureai.md +476 -0
- package/docs/specs/copilot_cli_interaction_featureai.md +868 -0
- package/docs/specs/copilot_cli_runtime_featureai.md +647 -0
- package/docs/specs/custom-skills-assessment.md +461 -0
- package/docs/specs/deployment_audit_findings_featureai.md +243 -0
- package/docs/specs/doc_code_link_graph_featureai.md +253 -0
- package/docs/specs/documentation_alignment_cleanup_featureai.md +69 -0
- package/docs/specs/e2e_visual_testing_featureai.md +615 -0
- package/docs/specs/end_to_end_user_acceptance_testing_featureai.md +810 -0
- package/docs/specs/evidence-loop-plan.md +76 -0
- package/docs/specs/evidence_loop_featureai.md +497 -0
- package/docs/specs/focus-auto-optimize-category.md +449 -0
- package/docs/specs/focus-auto-optimize-superplan.md +188 -0
- package/docs/specs/focus_auto_runner_featureai.md +1102 -0
- package/docs/specs/focus_design_v2_featureai.md +197 -0
- package/docs/specs/focus_sync_v2_featureai.md +202 -0
- package/docs/specs/git_integration_overhaul_featureai.md +326 -0
- package/docs/specs/glm_zai_provider_featureai.md +200 -0
- package/docs/specs/googlecli_adoption_featureai.md +661 -0
- package/docs/specs/help_commands_rewrite_featureai.md +860 -0
- package/docs/specs/industry_analysis_strategic_additions_featureai.md +231 -0
- package/docs/specs/industry_comparison_and_feature_gaps_featureai.md +674 -0
- package/docs/specs/internal_cleanup_code_quality_featureai.md +486 -0
- package/docs/specs/investigations/README.md +31 -0
- package/docs/specs/investigations/digests/2026-09-28.md +47 -0
- package/docs/specs/investigations/digests/2026-10-08.md +62 -0
- package/docs/specs/investigations/digests/2026-10-10.md +61 -0
- package/docs/specs/investigations/features/debugger-red-loop-first.md +55 -0
- package/docs/specs/investigations/features/harness-cross-host-behaviour.md +93 -0
- package/docs/specs/investigations/features/optimize-apply-regression-gate.md +66 -0
- package/docs/specs/investigations/features/reviewer-smell-baseline.md +57 -0
- package/docs/specs/investigations/features/trace-failure-capture.md +69 -0
- package/docs/specs/lifecycle_completeness_featureai.md +754 -0
- package/docs/specs/local-first-ci.md +42 -0
- package/docs/specs/map_codebase_mermaid_togaf_featureai.md +805 -0
- package/docs/specs/market-delta-2026-09-superplan.md +310 -0
- package/docs/specs/market-ideas-2026-09.md +131 -0
- package/docs/specs/market-ideas-2026-10.md +428 -0
- package/docs/specs/market-ideas-ledger.md +177 -0
- package/docs/specs/memory-optimization-2026-10.md +285 -0
- package/docs/specs/multi-track-planning-roots.md +143 -0
- package/docs/specs/multi_model_routing_featureai.md +687 -0
- package/docs/specs/multi_model_routing_superplan.md +197 -0
- package/docs/specs/opus_47_existing_enhancements_featureai.md +247 -0
- package/docs/specs/opus_47_extended_features_featureai.md +363 -0
- package/docs/specs/opus_47_extended_features_v2_featureai.md +397 -0
- package/docs/specs/pan_focus_commands_featureai.md +2336 -0
- package/docs/specs/pan_zcode_mcp_bridge_featureai.md +120 -0
- package/docs/specs/product-excellence-superplan.md +315 -0
- package/docs/specs/product_excellence_program_2026_q4_featureai.md +365 -0
- package/docs/specs/production_deployment_readiness_featureai.md +433 -0
- package/docs/specs/production_readiness_ship_v1_featureai.md +698 -0
- package/docs/specs/real_test_enforcement_featureai.md +213 -0
- package/docs/specs/reality-check-2026-09-superplan.md +362 -0
- package/docs/specs/right-sized-ceremony.md +74 -0
- package/docs/specs/roadmap_and_competition_2026_q4_featureai.md +390 -0
- package/docs/specs/self_improvement_loop_featureai.md +875 -0
- package/docs/specs/skill-aligned-decomposition.md +155 -0
- package/docs/specs/standards_integration_featureai.md +833 -0
- package/docs/specs/testing-system-redesign-2026-09.md +267 -0
- package/docs/specs/user_reality_testing_system_featureai.md +788 -0
- package/docs/specs/watch-triggers.json +22 -0
- package/docs/specs/workflow-integration-redesign.md +742 -0
- package/docs/specs/workflow_state_consistency_featureai.md +183 -0
- package/hooks/dist/pan-context-monitor.js +9 -2
- package/hooks/dist/pan-cost-logger.js +5 -0
- package/hooks/dist/pan-guard.js +28 -5
- package/hooks/dist/pan-stop-guard.js +9 -9
- package/hooks/dist/pan-trace-logger.js +5 -0
- package/package.json +10 -2
- package/pan-wizard-core/bin/lib/agents-md.cjs +57 -8
- package/pan-wizard-core/bin/lib/autodev-report.cjs +180 -0
- package/pan-wizard-core/bin/lib/autodev.cjs +642 -0
- package/pan-wizard-core/bin/lib/ci.cjs +143 -0
- package/pan-wizard-core/bin/lib/commands.cjs +1 -1
- package/pan-wizard-core/bin/lib/config.cjs +41 -5
- package/pan-wizard-core/bin/lib/constants.cjs +27 -1
- package/pan-wizard-core/bin/lib/core.cjs +31 -14
- package/pan-wizard-core/bin/lib/cost.cjs +160 -4
- package/pan-wizard-core/bin/lib/cross-family.cjs +164 -0
- package/pan-wizard-core/bin/lib/debug-cases.cjs +104 -0
- package/pan-wizard-core/bin/lib/doc-lint.cjs +5 -3
- package/pan-wizard-core/bin/lib/failure-class.cjs +81 -0
- package/pan-wizard-core/bin/lib/findings.cjs +148 -9
- package/pan-wizard-core/bin/lib/focus.cjs +1 -1
- package/pan-wizard-core/bin/lib/git.cjs +1 -1
- package/pan-wizard-core/bin/lib/hosts.cjs +88 -0
- package/pan-wizard-core/bin/lib/init.cjs +7 -2
- package/pan-wizard-core/bin/lib/knowledge.cjs +2 -0
- package/pan-wizard-core/bin/lib/merge.cjs +50 -0
- package/pan-wizard-core/bin/lib/mutate.cjs +268 -0
- package/pan-wizard-core/bin/lib/next-action.cjs +112 -0
- package/pan-wizard-core/bin/lib/optimize.cjs +2 -2
- package/pan-wizard-core/bin/lib/phase-gate.cjs +15 -9
- package/pan-wizard-core/bin/lib/phase-remove.cjs +91 -11
- package/pan-wizard-core/bin/lib/phase.cjs +85 -13
- package/pan-wizard-core/bin/lib/plan-lint.cjs +310 -0
- package/pan-wizard-core/bin/lib/preview.cjs +26 -4
- package/pan-wizard-core/bin/lib/requirements-lint.cjs +130 -0
- package/pan-wizard-core/bin/lib/research-lint.cjs +268 -0
- package/pan-wizard-core/bin/lib/review-deep.cjs +14 -22
- package/pan-wizard-core/bin/lib/review-vote.cjs +105 -0
- package/pan-wizard-core/bin/lib/roadmap.cjs +1 -0
- package/pan-wizard-core/bin/lib/runner.cjs +2 -16
- package/pan-wizard-core/bin/lib/sizing.cjs +356 -0
- package/pan-wizard-core/bin/lib/squads.cjs +1 -1
- package/pan-wizard-core/bin/lib/state-write.cjs +247 -0
- package/pan-wizard-core/bin/lib/test-gate.cjs +433 -0
- package/pan-wizard-core/bin/lib/uat.cjs +149 -0
- package/pan-wizard-core/bin/lib/usage.cjs +104 -0
- package/pan-wizard-core/bin/lib/verdict.cjs +26 -3
- package/pan-wizard-core/bin/lib/verify-plan-set.cjs +30 -1
- package/pan-wizard-core/bin/lib/verify-preflight.cjs +2 -2
- package/pan-wizard-core/bin/lib/verify-red.cjs +174 -0
- package/pan-wizard-core/bin/lib/verify-retro.cjs +3 -2
- package/pan-wizard-core/bin/lib/verify-scope.cjs +143 -2
- package/pan-wizard-core/bin/lib/verify.cjs +86 -31
- package/pan-wizard-core/bin/lib/worktree.cjs +70 -0
- package/pan-wizard-core/bin/pan-tools.cjs +257 -28
- package/pan-wizard-core/learnings/universal/autonomous-loop.md +2 -2
- package/pan-wizard-core/mcp/orchestrator.cjs +4 -1
- package/pan-wizard-core/references/continuation-format.md +3 -3
- package/pan-wizard-core/references/design-methodology.md +1 -1
- package/pan-wizard-core/references/guardrails.md +1 -1
- package/pan-wizard-core/references/handoff-decisions.md +1 -1
- package/pan-wizard-core/references/model-profiles.md +2 -3
- package/pan-wizard-core/references/questioning.md +24 -0
- package/pan-wizard-core/references/ui-brand.md +4 -6
- package/pan-wizard-core/references/verdict-contract.md +2 -1
- package/pan-wizard-core/templates/config.json +10 -2
- package/pan-wizard-core/templates/debug.md +1 -0
- package/pan-wizard-core/templates/design.md +5 -4
- package/pan-wizard-core/templates/discovery.md +2 -2
- package/pan-wizard-core/templates/phase-prompt.md +7 -0
- package/pan-wizard-core/templates/requirements.md +9 -0
- package/pan-wizard-core/templates/research.md +10 -0
- package/pan-wizard-core/templates/summary-complex.md +5 -1
- package/pan-wizard-core/templates/summary-minimal.md +4 -0
- package/pan-wizard-core/templates/summary-standard.md +5 -1
- package/pan-wizard-core/templates/summary.md +8 -1
- package/pan-wizard-core/workflows/add-phase.md +4 -6
- package/pan-wizard-core/workflows/assumptions.md +19 -1
- package/pan-wizard-core/workflows/diagnose-issues.md +2 -0
- package/pan-wizard-core/workflows/discuss-phase.md +4 -2
- package/pan-wizard-core/workflows/exec-lean.md +69 -0
- package/pan-wizard-core/workflows/exec-phase.md +79 -15
- package/pan-wizard-core/workflows/execute-plan.md +3 -1
- package/{commands/pan → pan-wizard-core/workflows}/focus-doc-audit.md +13 -29
- package/{commands/pan → pan-wizard-core/workflows}/focus-drift-walking.md +3 -18
- package/{commands/pan → pan-wizard-core/workflows}/focus-exec.md +8 -23
- package/{commands/pan → pan-wizard-core/workflows}/focus-plan.md +6 -20
- package/{commands/pan → pan-wizard-core/workflows}/focus-scan.md +3 -16
- package/{commands/pan → pan-wizard-core/workflows}/focus-sync.md +7 -21
- package/pan-wizard-core/workflows/health.md +6 -0
- package/pan-wizard-core/workflows/help.md +114 -77
- package/pan-wizard-core/workflows/insert-phase.md +4 -6
- package/pan-wizard-core/workflows/learn.md +3 -3
- package/pan-wizard-core/workflows/milestone-audit.md +2 -2
- package/pan-wizard-core/workflows/milestone-new.md +38 -95
- package/pan-wizard-core/workflows/new-project.md +96 -258
- package/pan-wizard-core/workflows/optimize.md +107 -5
- package/pan-wizard-core/workflows/phase-tests.md +10 -0
- package/pan-wizard-core/workflows/plan-phase.md +106 -45
- package/pan-wizard-core/workflows/profile.md +50 -0
- package/pan-wizard-core/workflows/progress.md +10 -0
- package/pan-wizard-core/workflows/quick.md +34 -43
- package/pan-wizard-core/workflows/remove-phase.md +11 -1
- package/pan-wizard-core/workflows/research-phase.md +118 -40
- package/pan-wizard-core/workflows/resume-project.md +18 -2
- package/pan-wizard-core/workflows/settings.md +33 -19
- package/pan-wizard-core/workflows/todo-check.md +6 -2
- package/pan-wizard-core/workflows/transition.md +22 -4
- package/pan-wizard-core/workflows/uat-walkthrough.md +90 -0
- package/pan-wizard-core/workflows/update.md +1 -1
- package/pan-wizard-core/workflows/verify-phase.md +39 -46
- package/scripts/build-agent-plugin.js +35 -15
- package/scripts/build-help.cjs +106 -0
- package/scripts/build-plugin.js +10 -1
- package/scripts/deprecate-old-versions.js +70 -3
- package/scripts/generate-skills-docs.py +1 -1
- package/scripts/git-hooks/pre-push +27 -0
- package/scripts/install-git-hooks.js +7 -5
- package/scripts/install-pre-push.cjs +38 -0
- package/scripts/land.cjs +151 -0
- package/scripts/local-ci.cjs +501 -0
- package/scripts/local-schedule.cjs +277 -0
- package/scripts/mutation-probe.cjs +7 -80
- package/scripts/prompt-lint.cjs +32 -0
- package/scripts/prompt-rules.cjs +156 -0
- package/scripts/run-tests.cjs +7 -1
- package/scripts/test-quality-lint.cjs +3 -3
- package/scripts/test-surface.cjs +175 -6
- package/agents/pan-research-synthesizer.md +0 -246
- package/commands/pan/audit-deployment.md +0 -386
- package/commands/pan/dashboard.md +0 -22
- package/commands/pan/discord.md +0 -19
- package/commands/pan/mcp-bridge.md +0 -143
- package/commands/pan/milestone-cleanup.md +0 -19
- package/commands/pan/milestone-gaps.md +0 -35
- package/commands/pan/optimize.md +0 -115
- package/commands/pan/profile.md +0 -76
- package/commands/pan/research-phase.md +0 -189
- package/pan-wizard-core/bin/lib/bridge.cjs +0 -269
- package/pan-wizard-core/templates/research-project/architecture.md +0 -204
- package/pan-wizard-core/templates/research-project/features.md +0 -147
- package/pan-wizard-core/templates/research-project/pitfalls.md +0 -200
- package/pan-wizard-core/templates/research-project/stack.md +0 -120
- package/pan-wizard-core/templates/research-project/summary.md +0 -170
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
# Feature Spec: E2E Automated Visual Testing — Installed Experience Validation
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
Proposed
|
|
5
|
+
|
|
6
|
+
## Problem Statement
|
|
7
|
+
|
|
8
|
+
PAN Wizard has 1500 unit/integration tests that validate internal mechanics, but **zero tests that verify the installed user experience works as expected**. The gap:
|
|
9
|
+
|
|
10
|
+
| What's Tested | What's NOT Tested |
|
|
11
|
+
|---------------|-------------------|
|
|
12
|
+
| `pan-tools phase add` returns correct JSON | `/pan:new-project` in VSCode triggers correct workflow |
|
|
13
|
+
| Installer copies files to correct paths | Hooks actually fire on SessionStart/PostToolUse |
|
|
14
|
+
| State mutations are atomic | Multi-session continuity (close IDE, reopen, state intact) |
|
|
15
|
+
| JSON output schema is correct | Output matches what the AI agent can parse and act on |
|
|
16
|
+
| 5 runtimes install correctly | Installed commands are discoverable by host tool |
|
|
17
|
+
| Config merging works | User with corrupted .planning/ gets helpful error recovery |
|
|
18
|
+
|
|
19
|
+
**Real failures this would catch:**
|
|
20
|
+
1. Hook script crashes silently on SessionStart (user never knows)
|
|
21
|
+
2. Command frontmatter has invalid `allowed-tools` (Claude Code ignores command)
|
|
22
|
+
3. Workflow `@reference` path resolves wrong after install (subagent gets empty context)
|
|
23
|
+
4. `output()` writes >50KB to tmpfile but caller doesn't handle `@file:` prefix
|
|
24
|
+
5. Phase with unicode name creates directory but roadmap table regex fails to match it
|
|
25
|
+
6. Two concurrent pan-tools invocations corrupt state.md (no file locking)
|
|
26
|
+
|
|
27
|
+
## Proposed Solution
|
|
28
|
+
|
|
29
|
+
### Architecture: 4-Layer E2E Test Pyramid
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Layer 4: Smoke Tests (CI) — 5 tests, <30s
|
|
33
|
+
"Does the installed product boot and respond?"
|
|
34
|
+
|
|
35
|
+
Layer 3: Command Contract Tests — 40+ tests, <60s
|
|
36
|
+
"Does every command produce the expected output schema?"
|
|
37
|
+
|
|
38
|
+
Layer 2: Workflow Simulation Tests — 15+ tests, <90s
|
|
39
|
+
"Does a multi-step user journey produce correct end state?"
|
|
40
|
+
|
|
41
|
+
Layer 1: Feedback Loop Tests — 10+ tests, <60s
|
|
42
|
+
"Does the system respond predictably to errors, edge cases, corruption?"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Layers 1-4 use the existing `createScenarioRunner(runtime)` pattern — zero new dependencies.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Layer 5: Playwright VSCode Integration — 8+ tests, <120s
|
|
49
|
+
"Does the installed product work inside a real VSCode instance?"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Layer 5 uses `@playwright/test` + `@vscode/test-electron` (dev dependencies only).
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Layer 5: Playwright VSCode Integration Tests — "Does It Work In the Real IDE?"
|
|
57
|
+
|
|
58
|
+
**Purpose:** Launch a real VSCode instance with PAN Wizard installed, verify the installed files are visible, openable, and structurally correct inside the actual IDE environment. This is the closest we can get to testing the real user experience without a human.
|
|
59
|
+
|
|
60
|
+
**Dependencies:** `@playwright/test`, `@vscode/test-electron` (devDependencies only — zero runtime impact)
|
|
61
|
+
|
|
62
|
+
### Architecture
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
1. Create temp project folder
|
|
66
|
+
2. git init + configure
|
|
67
|
+
3. Run PAN Wizard installer (node bin/install.js)
|
|
68
|
+
4. Launch VSCode via Playwright's Electron API (_electron.launch())
|
|
69
|
+
5. Interact with VSCode UI: file explorer, quick open, command palette
|
|
70
|
+
6. Assert: files visible, openable, valid content
|
|
71
|
+
7. Close VSCode, cleanup temp folder
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Key Technical Details
|
|
75
|
+
|
|
76
|
+
```javascript
|
|
77
|
+
const { _electron: electron } = require('playwright');
|
|
78
|
+
const { downloadAndUnzipVSCode } = require('@vscode/test-electron');
|
|
79
|
+
|
|
80
|
+
const app = await electron.launch({
|
|
81
|
+
executablePath: await downloadAndUnzipVSCode('stable'),
|
|
82
|
+
args: [
|
|
83
|
+
'--disable-gpu-sandbox', '--no-sandbox',
|
|
84
|
+
'--disable-updates', '--profile-temp',
|
|
85
|
+
'--skip-welcome', '--skip-release-notes',
|
|
86
|
+
'--new-window', tmpDir
|
|
87
|
+
],
|
|
88
|
+
timeout: 60000
|
|
89
|
+
});
|
|
90
|
+
const window = await app.firstWindow();
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### PW-001: VSCode launches with PAN Wizard installed project
|
|
94
|
+
```
|
|
95
|
+
1. Create temp dir, git init, run installer
|
|
96
|
+
2. Launch VSCode on temp dir via Playwright Electron API
|
|
97
|
+
3. Wait for window load (domcontentloaded)
|
|
98
|
+
4. Verify: VSCode window is visible, title contains folder name
|
|
99
|
+
5. Close gracefully
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### PW-002: File explorer shows .claude directory structure
|
|
103
|
+
```
|
|
104
|
+
1. Launch VSCode on installed project
|
|
105
|
+
2. Open file explorer (Ctrl+Shift+E)
|
|
106
|
+
3. Verify: .claude directory visible in explorer tree
|
|
107
|
+
4. Expand .claude → commands → pan
|
|
108
|
+
5. Verify: command files listed (42+ .md files)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### PW-003: PAN Wizard command files are openable
|
|
112
|
+
```
|
|
113
|
+
1. Use Quick Open (Ctrl+P) to search for ".claude/commands/pan/help.md"
|
|
114
|
+
2. Select and open the file
|
|
115
|
+
3. Verify: editor tab opens with content
|
|
116
|
+
4. Verify: file content contains expected sections (frontmatter, description)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### PW-004: Hook files are openable and valid
|
|
120
|
+
```
|
|
121
|
+
1. Quick Open → ".claude/hooks/pan-statusline.js"
|
|
122
|
+
2. Verify: file opens in editor
|
|
123
|
+
3. Verify: no syntax error indicators (red squiggles on first load)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### PW-005: Agent files are discoverable
|
|
127
|
+
```
|
|
128
|
+
1. Quick Open → ".claude/agents/"
|
|
129
|
+
2. Verify: 11+ agent files appear in search results
|
|
130
|
+
3. Open one agent file → verify content has expected structure
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### PW-006: pan-wizard-core files accessible
|
|
134
|
+
```
|
|
135
|
+
1. Quick Open → "pan-wizard-core/bin/pan-tools.cjs"
|
|
136
|
+
2. Verify: file opens
|
|
137
|
+
3. Verify: content includes command dispatcher (switch statement)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### PW-007: .planning directory created after init
|
|
141
|
+
```
|
|
142
|
+
1. Install PAN Wizard, then run `node pan-tools.cjs init new-project --name "Test"` in temp dir
|
|
143
|
+
2. Launch VSCode
|
|
144
|
+
3. Verify: .planning/ visible in file explorer
|
|
145
|
+
4. Verify: state.md, roadmap.md, config.json visible inside .planning/
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### PW-008: Multiple runtime installs produce correct structure
|
|
149
|
+
```
|
|
150
|
+
For claude + copilot:
|
|
151
|
+
1. Install for runtime in separate temp dirs
|
|
152
|
+
2. Launch VSCode on each
|
|
153
|
+
3. Verify: runtime-specific directory (.claude/ vs .github/) visible
|
|
154
|
+
4. Close, cleanup
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Effort:** L | **Files:** `tests/e2e/vscode-integration.spec.mjs`
|
|
158
|
+
|
|
159
|
+
### Known Limitations
|
|
160
|
+
|
|
161
|
+
| Limitation | Impact | Mitigation |
|
|
162
|
+
|-----------|--------|------------|
|
|
163
|
+
| Cannot trigger Claude Code slash commands | Can't test `/pan:*` invocation | CLI contract tests (Layer 3) cover command behavior |
|
|
164
|
+
| Cannot verify Claude Code's command registry | Can't confirm commands are "seen" by Claude | Frontmatter validation tests verify structure |
|
|
165
|
+
| VSCode DOM selectors are internal/unstable | Selectors may break on VSCode updates | Pin VSCode version, use robust locators, accept maintenance cost |
|
|
166
|
+
| Playwright Electron API is experimental | API surface may change | Lock `@playwright/test` version in package.json |
|
|
167
|
+
| CI requires display server on Linux | `xvfb-run` needed for headless | CI config includes xvfb setup |
|
|
168
|
+
| VSCode startup is slow (5-15s) | Tests are slower than CLI tests | Use `beforeAll` to share one VSCode instance across tests |
|
|
169
|
+
| macOS CI needs specific runner | Different runner config | Platform-conditional CI matrix |
|
|
170
|
+
|
|
171
|
+
### What This Layer Does NOT Replace
|
|
172
|
+
|
|
173
|
+
Layer 5 complements but does not replace Layers 1-4:
|
|
174
|
+
- **Layer 3 (Contracts)** tests that command OUTPUT is correct JSON — Playwright can't invoke pan-tools
|
|
175
|
+
- **Layer 2 (Workflows)** tests multi-step CLI sequences — Playwright tests file visibility, not CLI execution
|
|
176
|
+
- **Layer 1 (Feedback)** tests error messages and edge cases — Playwright tests the "visual" installed state
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Layer 4: Smoke Tests — "Does It Boot?"
|
|
181
|
+
|
|
182
|
+
**Purpose:** Fast CI gate. If these fail, nothing else matters.
|
|
183
|
+
|
|
184
|
+
### ST-001: Installed pan-tools responds to `--version`
|
|
185
|
+
```
|
|
186
|
+
Install → run `pan-tools --version` → expect version string matching package.json
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### ST-002: All 42 commands discoverable after install
|
|
190
|
+
```
|
|
191
|
+
Install for claude → list .claude/commands/pan/*.md → count >= 42
|
|
192
|
+
Install for copilot → list .github/skills/pan-*/ → count >= 42
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### ST-003: Hook files are valid JavaScript
|
|
196
|
+
```
|
|
197
|
+
For each hook in hooks/dist/:
|
|
198
|
+
require(hookPath) → does not throw
|
|
199
|
+
typeof module.exports === 'function' || typeof module.exports === 'object'
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### ST-004: pan-tools help includes all top-level commands
|
|
203
|
+
```
|
|
204
|
+
Run `pan-tools help` → output includes: state, phase, roadmap, config, validate, focus, init
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### ST-005: Clean install + `init new-project` succeeds
|
|
208
|
+
```
|
|
209
|
+
Install → run init → .planning/ exists with state.md, roadmap.md, config.json
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Effort:** XS | **Files:** `tests/scenarios/smoke.test.cjs`
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Layer 3: Command Contract Tests — "Does Output Match Contract?"
|
|
217
|
+
|
|
218
|
+
**Purpose:** Verify every command produces a predictable JSON schema that the AI agent can parse. This is the core "visual testing" equivalent — instead of pixel-matching screenshots, we schema-match JSON output.
|
|
219
|
+
|
|
220
|
+
### Approach: Output Schema Snapshots
|
|
221
|
+
|
|
222
|
+
For each of the 94 CLI subcommands, define the expected output contract:
|
|
223
|
+
|
|
224
|
+
```javascript
|
|
225
|
+
const COMMAND_CONTRACTS = {
|
|
226
|
+
'phases list': {
|
|
227
|
+
success_fields: ['directories', 'count'],
|
|
228
|
+
types: { directories: 'array', count: 'number' },
|
|
229
|
+
error_fields: ['error'],
|
|
230
|
+
},
|
|
231
|
+
'state json': {
|
|
232
|
+
success_fields: ['pan_state_version', 'status', 'milestone'],
|
|
233
|
+
types: { status: 'string', pan_state_version: 'string' },
|
|
234
|
+
},
|
|
235
|
+
'focus scan': {
|
|
236
|
+
success_fields: ['items', 'sources', 'total', 'priorities', 'source_todos'],
|
|
237
|
+
types: { items: 'array', total: 'number', source_todos: 'object' },
|
|
238
|
+
},
|
|
239
|
+
'validate health': {
|
|
240
|
+
success_fields: ['status', 'errors', 'warnings', 'info', 'repairable_count'],
|
|
241
|
+
types: { status: 'string', errors: 'array', warnings: 'array' },
|
|
242
|
+
enum_values: { status: ['healthy', 'degraded', 'broken'] },
|
|
243
|
+
},
|
|
244
|
+
// ... 90 more commands
|
|
245
|
+
};
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### CT-001: Every command returns valid JSON (or valid raw string)
|
|
249
|
+
```
|
|
250
|
+
For each command in COMMAND_CONTRACTS:
|
|
251
|
+
Run command with minimal valid args
|
|
252
|
+
Parse output as JSON
|
|
253
|
+
Verify: no parse error, no uncaught exception in stderr
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### CT-002: Success output contains all required fields
|
|
257
|
+
```
|
|
258
|
+
For each command:
|
|
259
|
+
Verify all success_fields present
|
|
260
|
+
Verify field types match (string, number, array, object, boolean)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### CT-003: Error output follows error contract
|
|
264
|
+
```
|
|
265
|
+
For commands that can fail:
|
|
266
|
+
Invoke with invalid args
|
|
267
|
+
Verify output has `error` field (string)
|
|
268
|
+
Verify no stack trace leaked to stdout
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### CT-004: Raw mode output is parseable
|
|
272
|
+
```
|
|
273
|
+
For commands supporting --raw:
|
|
274
|
+
Run with --raw flag
|
|
275
|
+
Verify output is plain text (not JSON-wrapped)
|
|
276
|
+
Verify no JSON braces in output
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### CT-005: Large output uses @file: protocol correctly
|
|
280
|
+
```
|
|
281
|
+
Generate large plan (>50KB output)
|
|
282
|
+
Verify output starts with @file:
|
|
283
|
+
Verify referenced file exists and contains valid JSON
|
|
284
|
+
Verify JSON matches expected schema
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### CT-006: Enum fields contain only valid values
|
|
288
|
+
```
|
|
289
|
+
For commands with enum constraints (status, priority, effort):
|
|
290
|
+
Verify returned values are within allowed set
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Effort:** L | **Files:** `tests/scenarios/command-contracts.test.cjs`, `tests/contracts/schemas.cjs`
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Layer 2: Workflow Simulation Tests — "Does the Journey Work?"
|
|
298
|
+
|
|
299
|
+
**Purpose:** Simulate real multi-step user workflows end-to-end. Each test represents a complete user story.
|
|
300
|
+
|
|
301
|
+
### WF-001: New Project Setup (10-step journey)
|
|
302
|
+
```
|
|
303
|
+
1. init new-project --name "Auth System"
|
|
304
|
+
2. config set model_profile balanced
|
|
305
|
+
3. phase add "database-schema"
|
|
306
|
+
4. phase add "api-endpoints"
|
|
307
|
+
5. phase add "auth-middleware"
|
|
308
|
+
6. state update status "In progress"
|
|
309
|
+
7. state add-decision --summary "Use JWT tokens"
|
|
310
|
+
8. phases list → expect 3 phases
|
|
311
|
+
9. roadmap analyze → expect 3 phases listed
|
|
312
|
+
10. state-snapshot → expect status="In progress", 1 decision
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### WF-002: Phase Lifecycle (plan → execute → verify → complete)
|
|
316
|
+
```
|
|
317
|
+
1. init + add phase
|
|
318
|
+
2. template fill phase-prompt --phase 01
|
|
319
|
+
3. state update current_phase 01
|
|
320
|
+
4. Simulate plan creation (write plan.md to phase dir)
|
|
321
|
+
5. Simulate summary creation (write summary.md)
|
|
322
|
+
6. phase complete 01
|
|
323
|
+
7. Verify: phase marked complete in roadmap, state updated
|
|
324
|
+
8. Verify: auto-commit created (if git repo)
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### WF-003: Focus Workflow (scan → plan → exec cycle)
|
|
328
|
+
```
|
|
329
|
+
1. init + add 5 phases with frontmatter (priority/effort)
|
|
330
|
+
2. focus scan → expect 5 items with priorities
|
|
331
|
+
3. focus plan --mode balanced → expect batch with budget allocation
|
|
332
|
+
4. focus exec --dry-run → expect execution plan
|
|
333
|
+
5. Verify: batch file created in .planning/focus/
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### WF-004: Milestone Lifecycle
|
|
337
|
+
```
|
|
338
|
+
1. init + add 3 phases
|
|
339
|
+
2. Complete all 3 phases
|
|
340
|
+
3. milestone complete --name "v1.0"
|
|
341
|
+
4. Verify: MILESTONES.md updated
|
|
342
|
+
5. Verify: phases archived to milestones/v1.0-phases/
|
|
343
|
+
6. Verify: state.md milestone field updated
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### WF-005: Error Recovery Journey
|
|
347
|
+
```
|
|
348
|
+
1. init project
|
|
349
|
+
2. Manually corrupt state.md (remove closing ---)
|
|
350
|
+
3. Run state json → expect graceful error (not crash)
|
|
351
|
+
4. Run validate health → expect "degraded" or "broken"
|
|
352
|
+
5. Run validate health --repair → expect repair action
|
|
353
|
+
6. Run state json → expect success after repair
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### WF-006: Multi-Runtime Parity
|
|
357
|
+
```
|
|
358
|
+
For each runtime (claude, opencode, gemini, codex, copilot):
|
|
359
|
+
1. Install
|
|
360
|
+
2. Run init
|
|
361
|
+
3. Run phase add
|
|
362
|
+
4. Run state json
|
|
363
|
+
5. Verify: identical JSON output across all runtimes
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### WF-007: Git Integration Journey
|
|
367
|
+
```
|
|
368
|
+
1. git init + configure user
|
|
369
|
+
2. init project (auto git-init should detect existing repo)
|
|
370
|
+
3. Add phase + complete it
|
|
371
|
+
4. Verify: auto-commit created with conventional message
|
|
372
|
+
5. focus auto --init → verify initialized
|
|
373
|
+
6. focus auto --update → verify checkpoint commit
|
|
374
|
+
7. Verify: git log shows expected commit messages
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### WF-008: Focus Sync Detects Real Staleness
|
|
378
|
+
```
|
|
379
|
+
1. Install PAN into temp project
|
|
380
|
+
2. Create README.md with "Has 99 commands and 50 agents"
|
|
381
|
+
3. Create docs/DEVELOPMENT.md with "1000 tests"
|
|
382
|
+
4. Run focus sync --tests 1500
|
|
383
|
+
5. Verify: stale items detected for commands, agents, tests
|
|
384
|
+
6. Verify: DOC_SYNC_FILES all scanned
|
|
385
|
+
7. Verify: COMMAND_RENAME_MAP old names detected if present
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### WF-009: Concurrent Access Safety
|
|
389
|
+
```
|
|
390
|
+
1. init project
|
|
391
|
+
2. Spawn 5 parallel pan-tools invocations:
|
|
392
|
+
- state update status "Active"
|
|
393
|
+
- state add-decision --summary "Decision A"
|
|
394
|
+
- state add-blocker --text "Blocker B"
|
|
395
|
+
- phases list
|
|
396
|
+
- state-snapshot
|
|
397
|
+
3. Verify: no crashes, no corrupted state.md
|
|
398
|
+
4. Verify: all mutations present in final state
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### WF-010: Unicode/Special Character Handling
|
|
402
|
+
```
|
|
403
|
+
1. phase add "Authentifizierung" (German)
|
|
404
|
+
2. phase add "API-endpunkte"
|
|
405
|
+
3. state add-decision --summary "Use UTF-8 encoding"
|
|
406
|
+
4. generate-slug "my feature $100" (dollar sign)
|
|
407
|
+
5. Verify: all operations succeed
|
|
408
|
+
6. Verify: slugs are valid directory names
|
|
409
|
+
7. Verify: state.md content is not corrupted
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
**Effort:** XL | **Files:** `tests/scenarios/workflow-*.test.cjs`
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Layer 1: Feedback Loop Tests — "Does It Respond Predictably?"
|
|
417
|
+
|
|
418
|
+
**Purpose:** Verify the system gives useful, predictable feedback when things go wrong. This is the "visual" test — what does the user see?
|
|
419
|
+
|
|
420
|
+
### FL-001: Missing .planning/ gives actionable error
|
|
421
|
+
```
|
|
422
|
+
Run state json in empty dir → error message mentions "Run /pan:new-project first"
|
|
423
|
+
Run validate health → status: "broken", error mentions ".planning/ not found"
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### FL-002: Invalid command gives helpful suggestion
|
|
427
|
+
```
|
|
428
|
+
Run pan-tools unknown-command → error lists available commands
|
|
429
|
+
Run pan-tools phas list (typo) → error suggests "phase"
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### FL-003: Missing required args gives usage hint
|
|
433
|
+
```
|
|
434
|
+
Run phase add (no name) → error mentions required argument
|
|
435
|
+
Run config set (no key/value) → error shows expected format
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### FL-004: Corrupted JSON config recovers gracefully
|
|
439
|
+
```
|
|
440
|
+
Write invalid JSON to config.json
|
|
441
|
+
Run config get model_profile → returns default (not crash)
|
|
442
|
+
Run validate health → reports config issue as repairable
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### FL-005: Disk-full simulation (write failure)
|
|
446
|
+
```
|
|
447
|
+
Make .planning/ read-only (chmod)
|
|
448
|
+
Run state update status Active → returns error JSON (not crash)
|
|
449
|
+
Verify: error message mentions permission/write failure
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### FL-006: Very large state.md performance
|
|
453
|
+
```
|
|
454
|
+
Generate state.md with 500 decisions, 200 blockers
|
|
455
|
+
Run state json → completes in <2 seconds
|
|
456
|
+
Run state-snapshot → completes in <2 seconds
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
### FL-007: Hook crash isolation
|
|
460
|
+
```
|
|
461
|
+
Install hooks
|
|
462
|
+
Replace hook with throw new Error("boom")
|
|
463
|
+
Run pan-tools command → command still succeeds (hook failure isolated)
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### FL-008: Output never leaks sensitive info
|
|
467
|
+
```
|
|
468
|
+
Set env var PAN_SECRET=hunter2
|
|
469
|
+
Run various commands
|
|
470
|
+
Grep all stdout/stderr for "hunter2" → not found
|
|
471
|
+
Grep all stdout/stderr for absolute home paths → not found (only relative)
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### FL-009: Exit codes are correct
|
|
475
|
+
```
|
|
476
|
+
Successful command → exit code 0
|
|
477
|
+
Failed command (invalid args) → exit code 1
|
|
478
|
+
Command with --help → exit code 0
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### FL-010: JSON output is always valid (no mixed stdout)
|
|
482
|
+
```
|
|
483
|
+
For 20 random commands:
|
|
484
|
+
Capture raw stdout
|
|
485
|
+
Verify: either valid JSON or valid @file: reference
|
|
486
|
+
Verify: no console.log leaks mixed into JSON
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
**Effort:** L | **Files:** `tests/scenarios/feedback-loop.test.cjs`
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
493
|
+
## Implementation Plan
|
|
494
|
+
|
|
495
|
+
### Phase 1: Contracts + Smoke (S, 2 pts)
|
|
496
|
+
- Create `tests/contracts/schemas.cjs` with 20 critical command schemas
|
|
497
|
+
- Create `tests/scenarios/smoke.test.cjs` (5 tests)
|
|
498
|
+
- Add `npm run test:e2e` script
|
|
499
|
+
|
|
500
|
+
### Phase 2: Expand Contracts (M, 4 pts)
|
|
501
|
+
- Expand schemas to all 94 subcommands
|
|
502
|
+
- Create `tests/scenarios/command-contracts.test.cjs` (40+ tests)
|
|
503
|
+
- Add CT-001 through CT-006
|
|
504
|
+
|
|
505
|
+
### Phase 3: Workflow Simulations (L, 10 pts)
|
|
506
|
+
- Create WF-001 through WF-010 (10 test files or sections)
|
|
507
|
+
- Most complex: WF-009 (concurrent), WF-005 (corruption recovery)
|
|
508
|
+
|
|
509
|
+
### Phase 4: Feedback Loop (M, 4 pts)
|
|
510
|
+
- Create FL-001 through FL-010
|
|
511
|
+
- Performance baselines (FL-006)
|
|
512
|
+
- Security assertions (FL-008)
|
|
513
|
+
|
|
514
|
+
### Phase 5: Playwright VSCode Integration (L, 12 pts)
|
|
515
|
+
- Add `@playwright/test` + `@vscode/test-electron` as devDependencies
|
|
516
|
+
- Create `tests/e2e/vscode-helpers.mjs` (launch VSCode, install PAN, cleanup)
|
|
517
|
+
- Create PW-001 through PW-008 (8 tests across 4 spec files)
|
|
518
|
+
- Add `npm run test:vscode` script
|
|
519
|
+
- CI integration: xvfb for Linux, platform-conditional matrix
|
|
520
|
+
|
|
521
|
+
### Total: 70+ node:test + 11 Playwright = 80+ new tests, ~32 pts
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
## Technical Approach
|
|
526
|
+
|
|
527
|
+
### Zero New Dependencies
|
|
528
|
+
All tests use existing infrastructure:
|
|
529
|
+
- `node:test` + `node:assert/strict`
|
|
530
|
+
- `createScenarioRunner(runtime)` from `tests/helpers.cjs`
|
|
531
|
+
- `runPanTools(args, cwd)` for CLI invocation
|
|
532
|
+
- `fs` for file system verification
|
|
533
|
+
- `child_process.execSync` for concurrent spawn tests
|
|
534
|
+
|
|
535
|
+
### Schema Validation Pattern
|
|
536
|
+
```javascript
|
|
537
|
+
function assertSchema(output, schema) {
|
|
538
|
+
const parsed = typeof output === 'string' ? JSON.parse(output) : output;
|
|
539
|
+
for (const [field, type] of Object.entries(schema.types || {})) {
|
|
540
|
+
assert.ok(field in parsed, `missing field: ${field}`);
|
|
541
|
+
assert.equal(typeof parsed[field], type, `${field} should be ${type}`);
|
|
542
|
+
}
|
|
543
|
+
if (schema.enum_values) {
|
|
544
|
+
for (const [field, allowed] of Object.entries(schema.enum_values)) {
|
|
545
|
+
assert.ok(allowed.includes(parsed[field]), `${field}=${parsed[field]} not in ${allowed}`);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### Snapshot Update Workflow
|
|
552
|
+
```bash
|
|
553
|
+
# Generate fresh snapshots from current code
|
|
554
|
+
node tests/contracts/generate-snapshots.js
|
|
555
|
+
|
|
556
|
+
# Review changes in git diff
|
|
557
|
+
git diff tests/contracts/schemas.cjs
|
|
558
|
+
|
|
559
|
+
# If intentional output change: commit new snapshots
|
|
560
|
+
# If unintentional regression: fix the code
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
## Success Criteria
|
|
566
|
+
|
|
567
|
+
| Criterion | Metric |
|
|
568
|
+
|-----------|--------|
|
|
569
|
+
| SC-001 | Smoke tests (5) pass on all 3 CI platforms |
|
|
570
|
+
| SC-002 | Command contracts cover >= 80% of 94 subcommands |
|
|
571
|
+
| SC-003 | All 10 workflow simulations pass |
|
|
572
|
+
| SC-004 | All 10 feedback loop tests pass |
|
|
573
|
+
| SC-005 | Layers 1-4 E2E suite runs in < 120 seconds |
|
|
574
|
+
| SC-006 | Zero new runtime dependencies added (Playwright is devDependency only) |
|
|
575
|
+
| SC-007 | CI pipeline includes `npm run test:e2e` and `npm run test:vscode` |
|
|
576
|
+
| SC-008 | WF-009 (concurrent access) identifies any race conditions |
|
|
577
|
+
| SC-009 | FL-008 (sensitive info) passes with no leaks |
|
|
578
|
+
| SC-010 | Layers 1-4 work on Windows, macOS, and Linux |
|
|
579
|
+
| SC-011 | Playwright tests (Layer 5) launch real VSCode and verify installed files are visible |
|
|
580
|
+
| SC-012 | Playwright tests verify .claude/ structure, commands, agents, and hooks are openable in VSCode |
|
|
581
|
+
| SC-013 | Playwright tests run in < 120 seconds (separate from Layer 1-4 timing) |
|
|
582
|
+
|
|
583
|
+
---
|
|
584
|
+
|
|
585
|
+
## What This Does NOT Cover (Intentional Exclusions)
|
|
586
|
+
|
|
587
|
+
| Exclusion | Reason |
|
|
588
|
+
|-----------|--------|
|
|
589
|
+
| Claude Code slash command invocation | Claude Code's chat webview is an iframe inaccessible to Playwright — no public DOM API for triggering `/pan:*` commands |
|
|
590
|
+
| Claude Code command registry verification | Cannot query whether Claude Code "sees" installed commands — its internal state is not exposed |
|
|
591
|
+
| AI response quality testing | Testing that the AI produces good plans is beyond E2E scope |
|
|
592
|
+
| Network-dependent tests (npm registry) | Flaky in CI, mock instead |
|
|
593
|
+
| Performance benchmarking | Separate concern; FL-006 is a sanity check, not a benchmark suite |
|
|
594
|
+
| Playwright terminal panel interaction | VSCode terminal DOM selectors are internal and fragile — CLI tests (Layers 1-4) cover this |
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
598
|
+
## Risk Assessment
|
|
599
|
+
|
|
600
|
+
| Risk | Impact | Mitigation |
|
|
601
|
+
|------|--------|-----------|
|
|
602
|
+
| Contract schemas drift from code | Tests fail on intentional changes | Snapshot update workflow (generate + review) |
|
|
603
|
+
| Concurrent test (WF-009) is flaky | False failures in CI | Use retry logic, test 3x, fail if any run corrupts |
|
|
604
|
+
| chmod tests don't work on Windows | FL-005 skipped on Windows | Conditional skip with platform check |
|
|
605
|
+
| Large state.md test (FL-006) slow | CI timeout | Set explicit timeout, keep data < 1MB |
|
|
606
|
+
| Schema coverage incomplete | False confidence | Track coverage % in CI output |
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
## Links
|
|
611
|
+
- ADR-0018: User Reality Testing System (existing scenario infrastructure)
|
|
612
|
+
- Spec: `docs/specs/user_reality_testing_system_featureai.md`
|
|
613
|
+
- Test helpers: `tests/helpers.cjs`
|
|
614
|
+
- Existing scenarios: `tests/scenarios/*.test.cjs`
|
|
615
|
+
- CI: `.github/workflows/ci.yml`
|