@bugmole/cli 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/.bugmole.env.example +20 -0
  2. package/LICENSE +7 -0
  3. package/README.md +293 -0
  4. package/TESTING.md +117 -0
  5. package/bugmole.config.yaml +39 -0
  6. package/package.json +85 -0
  7. package/scripts/billing/paypal-setup.mjs +121 -0
  8. package/scripts/bugmole-continue.ts +318 -0
  9. package/scripts/bugmole-init.ts +188 -0
  10. package/scripts/bugmole.cjs +17 -0
  11. package/scripts/bugmole.test.ts +344 -0
  12. package/scripts/bugmole.ts +657 -0
  13. package/scripts/ensure-maestro.cjs +79 -0
  14. package/scripts/ios-tunnel-keeper.sh +45 -0
  15. package/scripts/ios-wda-keeper.sh +66 -0
  16. package/scripts/sync-plan-catalog.d.mts +3 -0
  17. package/scripts/sync-plan-catalog.mjs +16 -0
  18. package/scripts/ui-parity-diff.py +65 -0
  19. package/scripts/ui-parity-requirements.txt +1 -0
  20. package/scripts/verify-manage-to-plans.mts +194 -0
  21. package/spec/app-ui-audit.schema.json +176 -0
  22. package/spec/blockers.yaml +79 -0
  23. package/spec/bugs.index.json +42 -0
  24. package/spec/design-dna.schema.json +38 -0
  25. package/spec/domain_rules.yaml +24 -0
  26. package/spec/flows/flow_manage-to-plans-64c3c61b.yaml +8 -0
  27. package/spec/flows/flow_screen-to-evidence-6c3ab309.yaml +7 -0
  28. package/spec/journey_graph.yaml +126 -0
  29. package/spec/journeys.graph.json +2618 -0
  30. package/spec/plans/dashboard-smoke.flow.yaml +20 -0
  31. package/spec/plans/example.flow.yaml +99 -0
  32. package/spec/plans/flow_api-keys-to-logout-7396cd5d.flow.yaml +33 -0
  33. package/spec/plans/flow_api-keys-to-screen-157e10a6.flow.yaml +33 -0
  34. package/spec/plans/flow_manage-to-audits-176c1eb8.flow.yaml +33 -0
  35. package/spec/plans/flow_manage-to-blockers-633282c8.flow.yaml +112 -0
  36. package/spec/plans/flow_manage-to-devices-ad57e202.flow.yaml +33 -0
  37. package/spec/plans/flow_manage-to-logout-86c54656.flow.yaml +33 -0
  38. package/spec/plans/flow_manage-to-manage-resource-action-6325f99a.flow.yaml +185 -0
  39. package/spec/plans/flow_manage-to-parity-issues-01fa2579.flow.yaml +34 -0
  40. package/spec/plans/flow_manage-to-plans-64c3c61b.flow.yaml +123 -0
  41. package/spec/plans/flow_manage-to-screen-6857f915.flow.yaml +106 -0
  42. package/spec/plans/flow_manage-to-tasks-c5791c95.flow.yaml +33 -0
  43. package/spec/plans/flow_profile-to-screen-6045aa3d.flow.yaml +33 -0
  44. package/spec/plans/flow_register-to-api-auth-login-460a9cc8.flow.yaml +34 -0
  45. package/spec/plans/flow_screen-to-audits-07666356.flow.yaml +33 -0
  46. package/spec/plans/flow_screen-to-blockers-091d258b.flow.yaml +33 -0
  47. package/spec/plans/flow_screen-to-devices-cad72f75.flow.yaml +33 -0
  48. package/spec/plans/flow_screen-to-evidence-6c3ab309.flow.yaml +126 -0
  49. package/spec/plans/flow_screen-to-parity-issues-2218e3ad.flow.yaml +34 -0
  50. package/spec/plans/flow_screen-to-plans-8232a94f.flow.yaml +33 -0
  51. package/spec/plans/flow_screen-to-tasks-540671d1.flow.yaml +33 -0
  52. package/spec/plans/login.flow.yaml +22 -0
  53. package/spec/plans/owner-operations.flow.yaml +20 -0
  54. package/spec/project_config.yaml +55 -0
  55. package/spec/roles.yaml +30 -0
  56. package/spec/schema.md +394 -0
  57. package/spec/test-case-results.schema.json +62 -0
  58. package/spec/test-cases.schema.json +85 -0
  59. package/spec/ui-parity-audit.schema.json +194 -0
  60. package/spec/ui-reverse-engineering.schema.json +94 -0
  61. package/src/billing/plan-catalog.test.ts +46 -0
  62. package/src/billing/plan-catalog.ts +199 -0
  63. package/src/integrations/aws-sigv4.test.ts +42 -0
  64. package/src/integrations/aws-sigv4.ts +72 -0
  65. package/src/integrations/device-farm.ts +155 -0
  66. package/src/integrations/github-app.test.ts +57 -0
  67. package/src/integrations/github-app.ts +143 -0
  68. package/src/integrations/gitlab.ts +81 -0
  69. package/src/integrations/temp-email.test.ts +123 -0
  70. package/src/integrations/temp-email.ts +175 -0
  71. package/src/integrations/testflight-feedback.test.ts +51 -0
  72. package/src/integrations/testflight-feedback.ts +173 -0
  73. package/src/integrations/webdriver-client.ts +131 -0
  74. package/src/mcp/server.test.ts +1220 -0
  75. package/src/mcp/server.ts +3064 -0
  76. package/src/mcp/write-test-cases.test.ts +287 -0
  77. package/src/registry/api-key-client.ts +39 -0
  78. package/src/registry/control-plane-client.ts +212 -0
  79. package/src/registry/migrations/0001_registry.sql +47 -0
  80. package/src/registry/migrations/0002_device_authorizations.sql +23 -0
  81. package/src/registry/migrations/0003_project_environments.sql +25 -0
  82. package/src/registry/migrations/0004_device_authorization_email.sql +1 -0
  83. package/src/registry/migrations/0005_testing_control_plane.sql +55 -0
  84. package/src/registry/migrations/0006_workspaces.sql +36 -0
  85. package/src/registry/migrations/0007_project_apps.sql +26 -0
  86. package/src/registry/migrations/0008_agent_tasks.sql +30 -0
  87. package/src/registry/migrations/0009_journey_revisions.sql +17 -0
  88. package/src/registry/migrations/0010_agent_task_journey.sql +2 -0
  89. package/src/registry/migrations/0011_run_journey_revision.sql +1 -0
  90. package/src/registry/migrations/0012_canonical_flow_execution.sql +10 -0
  91. package/src/registry/migrations/0013_device_sessions.sql +22 -0
  92. package/src/registry/migrations/0014_agent_task_step.sql +1 -0
  93. package/src/registry/migrations/0015_agent_task_attempts.sql +6 -0
  94. package/src/registry/migrations/0016_github_issue_tracker.sql +54 -0
  95. package/src/registry/migrations/0017_run_targets.sql +7 -0
  96. package/src/registry/migrations/0018_run_fix_from.sql +4 -0
  97. package/src/registry/migrations/0019_workspace_flags.sql +9 -0
  98. package/src/registry/migrations/0020_orgs.sql +40 -0
  99. package/src/registry/migrations/0021_billing_core.sql +58 -0
  100. package/src/registry/migrations/0022_cloud_runners.sql +19 -0
  101. package/src/registry/migrations/0023_signup.sql +4 -0
  102. package/src/registry/migrations/0024_billing.sql +67 -0
  103. package/src/registry/migrations/0025_notifications.sql +47 -0
  104. package/src/registry/migrations/0026_repo_bindings.sql +28 -0
  105. package/src/registry/migrations/0027_feedback.sql +29 -0
  106. package/src/registry/migrations/0028_devices.sql +48 -0
  107. package/src/registry/migrations/0029_sso.sql +31 -0
  108. package/src/registry/migrations/0030_workspace_domains.sql +18 -0
  109. package/src/registry/migrations/0031_gitlab_and_teams.sql +45 -0
  110. package/src/registry/migrations/0032_personas.sql +15 -0
  111. package/src/registry/migrations/0033_bugmole_rename.sql +11 -0
  112. package/src/registry/task-scheduling.test.ts +100 -0
  113. package/src/registry/task-scheduling.ts +80 -0
  114. package/src/registry-worker/ai/platform-model.ts +77 -0
  115. package/src/registry-worker/ai/routes.test.ts +88 -0
  116. package/src/registry-worker/ai/routes.ts +90 -0
  117. package/src/registry-worker/artifacts.test.ts +98 -0
  118. package/src/registry-worker/artifacts.ts +85 -0
  119. package/src/registry-worker/billing/billing-core.test.ts +175 -0
  120. package/src/registry-worker/billing/checkout-routes.ts +209 -0
  121. package/src/registry-worker/billing/enforcement.ts +69 -0
  122. package/src/registry-worker/billing/entitlements.ts +108 -0
  123. package/src/registry-worker/billing/ledger.ts +186 -0
  124. package/src/registry-worker/billing/paypal/api.ts +259 -0
  125. package/src/registry-worker/billing/paypal/client.ts +91 -0
  126. package/src/registry-worker/billing/paypal/provider.ts +143 -0
  127. package/src/registry-worker/billing/paypal.test.ts +466 -0
  128. package/src/registry-worker/billing/provider.ts +114 -0
  129. package/src/registry-worker/billing/routes.ts +66 -0
  130. package/src/registry-worker/billing/subscriptions.ts +780 -0
  131. package/src/registry-worker/billing/thresholds.ts +107 -0
  132. package/src/registry-worker/core.ts +308 -0
  133. package/src/registry-worker/devices/devices.test.ts +185 -0
  134. package/src/registry-worker/devices/policy.ts +71 -0
  135. package/src/registry-worker/devices/routes.ts +453 -0
  136. package/src/registry-worker/domains/domains.test.ts +210 -0
  137. package/src/registry-worker/domains/routes.ts +139 -0
  138. package/src/registry-worker/domains.ts +88 -0
  139. package/src/registry-worker/email/sender.ts +75 -0
  140. package/src/registry-worker/env.d.ts +14716 -0
  141. package/src/registry-worker/features.ts +20 -0
  142. package/src/registry-worker/feedback/feedback.test.ts +230 -0
  143. package/src/registry-worker/feedback/format.ts +148 -0
  144. package/src/registry-worker/feedback/routes.ts +386 -0
  145. package/src/registry-worker/flags.ts +39 -0
  146. package/src/registry-worker/github/checks.test.ts +177 -0
  147. package/src/registry-worker/github/checks.ts +374 -0
  148. package/src/registry-worker/gitlab/checks.test.ts +141 -0
  149. package/src/registry-worker/gitlab/checks.ts +349 -0
  150. package/src/registry-worker/hooks.ts +54 -0
  151. package/src/registry-worker/index.ts +2077 -0
  152. package/src/registry-worker/jobs/index.ts +29 -0
  153. package/src/registry-worker/jobs/retention.ts +68 -0
  154. package/src/registry-worker/mcp/mcp.test.ts +355 -0
  155. package/src/registry-worker/mcp/routes.ts +215 -0
  156. package/src/registry-worker/mcp/token.ts +126 -0
  157. package/src/registry-worker/mcp/tools.ts +563 -0
  158. package/src/registry-worker/notifications/alerts.ts +212 -0
  159. package/src/registry-worker/notifications/notifications.test.ts +298 -0
  160. package/src/registry-worker/notifications/outbox.ts +83 -0
  161. package/src/registry-worker/notifications/routes.ts +280 -0
  162. package/src/registry-worker/notifications/secrets.ts +49 -0
  163. package/src/registry-worker/notifications/slack.ts +96 -0
  164. package/src/registry-worker/notifications/teams.ts +46 -0
  165. package/src/registry-worker/org/audit.ts +116 -0
  166. package/src/registry-worker/org/routes.test.ts +163 -0
  167. package/src/registry-worker/org/routes.ts +302 -0
  168. package/src/registry-worker/personas/personas.test.ts +78 -0
  169. package/src/registry-worker/personas/routes.ts +100 -0
  170. package/src/registry-worker/repo-triggers.ts +20 -0
  171. package/src/registry-worker/routes/index.ts +74 -0
  172. package/src/registry-worker/run-events.ts +24 -0
  173. package/src/registry-worker/runner/dispatch.ts +219 -0
  174. package/src/registry-worker/runner/jobs.ts +43 -0
  175. package/src/registry-worker/runner/metering.ts +82 -0
  176. package/src/registry-worker/runner/policy.ts +59 -0
  177. package/src/registry-worker/runner/routes.ts +171 -0
  178. package/src/registry-worker/runner/runner.test.ts +358 -0
  179. package/src/registry-worker/runner/tokens.ts +93 -0
  180. package/src/registry-worker/runs.test.ts +60 -0
  181. package/src/registry-worker/signup/policy.ts +57 -0
  182. package/src/registry-worker/signup/routes.ts +106 -0
  183. package/src/registry-worker/signup/signup.test.ts +81 -0
  184. package/src/registry-worker/sso/aegis.ts +141 -0
  185. package/src/registry-worker/sso/membership.ts +157 -0
  186. package/src/registry-worker/sso/routes.ts +458 -0
  187. package/src/registry-worker/sso/sso.test.ts +344 -0
  188. package/src/registry-worker/testing/d1-shim.ts +180 -0
  189. package/src/registry-worker/testing/harness.ts +137 -0
  190. package/src/runner-worker/index.ts +108 -0
  191. package/src/runtime/ai-analysis.ts +97 -0
  192. package/src/runtime/ai-exploration.test.ts +32 -0
  193. package/src/runtime/ai-exploration.ts +69 -0
  194. package/src/runtime/ai-repair.ts +74 -0
  195. package/src/runtime/ai-work.test.ts +99 -0
  196. package/src/runtime/android-screen-record.test.ts +75 -0
  197. package/src/runtime/android-screen-record.ts +192 -0
  198. package/src/runtime/app-understanding.test.ts +123 -0
  199. package/src/runtime/app-understanding.ts +201 -0
  200. package/src/runtime/appium-driver.test.ts +179 -0
  201. package/src/runtime/appium-driver.ts +295 -0
  202. package/src/runtime/blocker-resolution.test.ts +113 -0
  203. package/src/runtime/blocker-resolution.ts +111 -0
  204. package/src/runtime/browser-matrix.integration.test.ts +212 -0
  205. package/src/runtime/browser-matrix.test.ts +143 -0
  206. package/src/runtime/browser-matrix.ts +200 -0
  207. package/src/runtime/canonical-flow.test.ts +52 -0
  208. package/src/runtime/config-validate.ts +185 -0
  209. package/src/runtime/continuous-execution.ts +291 -0
  210. package/src/runtime/cursor-applescript.ts +573 -0
  211. package/src/runtime/cursor-cli-driver.test.ts +78 -0
  212. package/src/runtime/cursor-cli-driver.ts +156 -0
  213. package/src/runtime/cursor-driver-example.ts +117 -0
  214. package/src/runtime/cursor-driver-index.ts +65 -0
  215. package/src/runtime/cursor-driver-init.ts +277 -0
  216. package/src/runtime/cursor-driver-run.test.ts +15 -0
  217. package/src/runtime/cursor-driver-run.ts +323 -0
  218. package/src/runtime/cursor-driver.ts +332 -0
  219. package/src/runtime/cursor-llm-example.ts +90 -0
  220. package/src/runtime/cursor-llm.ts +206 -0
  221. package/src/runtime/cursor-mcp-monitor.ts +386 -0
  222. package/src/runtime/device-clouds/browserstack.ts +73 -0
  223. package/src/runtime/device-clouds/device-farm.ts +52 -0
  224. package/src/runtime/device-clouds/index.ts +92 -0
  225. package/src/runtime/device-clouds/kobiton.ts +70 -0
  226. package/src/runtime/device-clouds/targets.ts +44 -0
  227. package/src/runtime/device-clouds/types.ts +62 -0
  228. package/src/runtime/diff-proposal.ts +84 -0
  229. package/src/runtime/discovery-task.test.ts +29 -0
  230. package/src/runtime/discovery-task.ts +284 -0
  231. package/src/runtime/driver-recovery.ts +69 -0
  232. package/src/runtime/driver.ts +79 -0
  233. package/src/runtime/environment.test.ts +104 -0
  234. package/src/runtime/environment.ts +137 -0
  235. package/src/runtime/executor.test.ts +509 -0
  236. package/src/runtime/executor.ts +921 -0
  237. package/src/runtime/explorer.test.ts +101 -0
  238. package/src/runtime/explorer.ts +1013 -0
  239. package/src/runtime/failure-analysis.test.ts +111 -0
  240. package/src/runtime/failure-analysis.ts +272 -0
  241. package/src/runtime/fixtures/fake-maestro.sh +36 -0
  242. package/src/runtime/flow-language.test.ts +268 -0
  243. package/src/runtime/flow-language.ts +414 -0
  244. package/src/runtime/init-wizard.ts +354 -0
  245. package/src/runtime/ios-screen-record.test.ts +68 -0
  246. package/src/runtime/ios-screen-record.ts +155 -0
  247. package/src/runtime/journey-editor.ts +452 -0
  248. package/src/runtime/journey-evidence.test.ts +161 -0
  249. package/src/runtime/journey-evidence.ts +180 -0
  250. package/src/runtime/journey-graph.test.ts +257 -0
  251. package/src/runtime/journey-graph.ts +170 -0
  252. package/src/runtime/legacy-names.ts +32 -0
  253. package/src/runtime/llm-example.ts +105 -0
  254. package/src/runtime/llm.ts +527 -0
  255. package/src/runtime/local-browser.test.ts +45 -0
  256. package/src/runtime/local-browser.ts +48 -0
  257. package/src/runtime/local-registry-stub.test.ts +325 -0
  258. package/src/runtime/local-registry-stub.ts +803 -0
  259. package/src/runtime/maestro-driver.test.ts +84 -0
  260. package/src/runtime/maestro-driver.ts +209 -0
  261. package/src/runtime/mole-voice.ts +21 -0
  262. package/src/runtime/nav-crawl.test.ts +100 -0
  263. package/src/runtime/nav-crawl.ts +153 -0
  264. package/src/runtime/pipeline.test.ts +405 -0
  265. package/src/runtime/pipeline.ts +833 -0
  266. package/src/runtime/planner.test.ts +37 -0
  267. package/src/runtime/planner.ts +274 -0
  268. package/src/runtime/platform-ai.ts +76 -0
  269. package/src/runtime/playwright-driver.test.ts +93 -0
  270. package/src/runtime/playwright-driver.ts +620 -0
  271. package/src/runtime/project-spec.ts +140 -0
  272. package/src/runtime/record-run-verdicts.ts +68 -0
  273. package/src/runtime/reporter.test.ts +56 -0
  274. package/src/runtime/reporter.ts +158 -0
  275. package/src/runtime/reset.test.ts +44 -0
  276. package/src/runtime/reset.ts +61 -0
  277. package/src/runtime/reviewer.test.ts +73 -0
  278. package/src/runtime/reviewer.ts +158 -0
  279. package/src/runtime/run-job.ts +136 -0
  280. package/src/runtime/run-once.test.ts +207 -0
  281. package/src/runtime/run-once.ts +168 -0
  282. package/src/runtime/run.ts +132 -0
  283. package/src/runtime/screen-recording.ts +34 -0
  284. package/src/runtime/serve-gateway.test.ts +74 -0
  285. package/src/runtime/serve-gateway.ts +164 -0
  286. package/src/runtime/serve-worker.test.ts +23 -0
  287. package/src/runtime/serve-worker.ts +278 -0
  288. package/src/runtime/site-discovery.test.ts +168 -0
  289. package/src/runtime/site-discovery.ts +308 -0
  290. package/src/runtime/target-runner.ts +144 -0
  291. package/src/runtime/test-case-verdicts.test.ts +94 -0
  292. package/src/runtime/test-case-verdicts.ts +120 -0
  293. package/src/runtime/ui-reverse-engineering/coordinator.test.ts +59 -0
  294. package/src/runtime/ui-reverse-engineering/coordinator.ts +391 -0
  295. package/src/runtime/ui-reverse-engineering/types.ts +197 -0
  296. package/src/runtime/web-suite.test.ts +97 -0
  297. package/src/runtime/web-suite.ts +176 -0
  298. package/src/storage/create-object-store.ts +144 -0
  299. package/src/storage/keys.ts +34 -0
  300. package/src/storage/local-artifact-server.test.ts +314 -0
  301. package/src/storage/local-artifact-server.ts +357 -0
  302. package/src/storage/object-store.test.ts +28 -0
  303. package/src/storage/object-store.ts +101 -0
  304. package/src/storage/registry-object-store.ts +88 -0
  305. package/src/storage/remote-object-store.ts +104 -0
  306. package/src/storage/storage-directory.test.ts +43 -0
  307. package/src/storage/storage-directory.ts +24 -0
  308. package/tsconfig.json +24 -0
@@ -0,0 +1,20 @@
1
+ version: 1
2
+ id: owner-operations
3
+ name: "Journey: owner-operations"
4
+ description: Generated plan for journey owner-operations with actor owner
5
+ suites:
6
+ - id: default
7
+ runs: on_demand
8
+ journeys:
9
+ - id: owner-operations
10
+ actor: owner
11
+ goal: "Complete journey: owner-operations"
12
+ capabilities_required: []
13
+ preconditions:
14
+ - Test tenant / sandbox is active
15
+ - Actor account exists
16
+ steps:
17
+ - action: observe:owner-operations
18
+ proofs:
19
+ - type: dom
20
+ expects: "discovered journey screen: owner-operations"
@@ -0,0 +1,55 @@
1
+ # Project Configuration for Bugmole MCP
2
+
3
+ project:
4
+ workspace_id: "demo-workspace"
5
+ workspace_name: "Demo workspace"
6
+ name: "Arion Rent"
7
+ type: "monorepo"
8
+ base_url: "http://localhost:3010"
9
+ evidence_manifest: "../../qa/browser-evidence.json"
10
+ evidence_screenshots: "../../qa/screenshots"
11
+
12
+ applications:
13
+ - id: "web"
14
+ name: "web"
15
+ default: true
16
+ type: "frontend"
17
+ framework: "Next.js App Router"
18
+ port: 3010
19
+ base_url: "http://localhost:3010"
20
+ start_command: "npm run dev -- -p 3010"
21
+ location: "."
22
+
23
+ startup:
24
+ prerequisites:
25
+ - "Node.js and npm dependencies installed from the workspace root"
26
+ - "Supabase credentials are optional for build, but write flows need a migrated project"
27
+ - "Do not print local .env or service-role values while preparing QA evidence"
28
+
29
+ steps:
30
+ - "npm install"
31
+ - "npm run dev -- -p 3010"
32
+ - "npm test"
33
+ - "Capture browser evidence under qa/screenshots and qa/browser-evidence.json"
34
+
35
+ testing:
36
+ e2e_framework: "Playwright"
37
+ base_url: "http://localhost:3010"
38
+ timeout: 300000
39
+ plan: "../../QA_TEST_PLAN.md"
40
+ evidence: "../../QA_EVIDENCE.md"
41
+ routes:
42
+ - "/"
43
+ - "/book"
44
+ - "/book/requested?bookingCode=QA-123&paymentId=00000000-0000-4000-8000-000000000000"
45
+ - "/book/payments/00000000-0000-4000-8000-000000000000"
46
+ - "/owner#overview"
47
+ - "/owner/reports"
48
+ - "/owner#calendar"
49
+ - "/owner#orders"
50
+ - "/owner#vehicles"
51
+ - "/owner#customers"
52
+ - "/owner#create-booking"
53
+ - "/owner#documents"
54
+ - "/owner#income-expense"
55
+ - "/owner#tracking"
@@ -0,0 +1,30 @@
1
+ roles:
2
+ - name: public_customer
3
+ description: Rental customer accesses the marketing flow, views vehicles, submits a booking request, and views deposit payment instructions.
4
+ permissions:
5
+ - "public_booking:read"
6
+ - "booking_request:create"
7
+ - "payment_instruction:read"
8
+
9
+ - name: owner
10
+ description: Owner or operations staff manages customers, vehicles, bookings, documents, income and expenses, and tracking.
11
+ permissions:
12
+ - "owner_dashboard:read"
13
+ - "customers:*"
14
+ - "vehicles:*"
15
+ - "bookings:*"
16
+ - "documents:*"
17
+ - "finance:read"
18
+ - "tracking:read"
19
+
20
+ - name: system_webhook
21
+ description: Provider webhook caller for payment and OM/GPS tracking callbacks.
22
+ permissions:
23
+ - "payments:webhook"
24
+ - "tracking:webhook"
25
+
26
+ - name: user
27
+ description: Aegis-authenticated Bugmole dashboard user with active workspace and project membership. Signs in through the dashboard OAuth session, views project-scoped QA surfaces, manages their own API keys, opens resource management pages, and views Aegis profile settings.
28
+ permissions:
29
+ - "projects:read"
30
+ - "keys:write"
package/spec/schema.md ADDED
@@ -0,0 +1,394 @@
1
+ # Spec Schema Reference — Bugmole MCP
2
+
3
+ This document defines the **schemas and conventions** for files under `/spec`.
4
+ It is the contract between:
5
+
6
+ - the **planning layer** (journey discovery + plan authoring), and
7
+ - the **execution layer** (Playwright wrapper + evidence).
8
+
9
+ ---
10
+
11
+ ## 1) Global conventions
12
+
13
+ ### 1.1 Versioning
14
+
15
+ Every spec file MUST include:
16
+
17
+ - `version: <integer>` (or `"version": <integer>` for JSON)
18
+
19
+ Increment `version` when:
20
+
21
+ - a breaking schema change happens, or
22
+ - semantics of a field changes.
23
+
24
+ ### 1.2 IDs
25
+
26
+ IDs MUST be:
27
+
28
+ - lowercase
29
+ - words separated by `_` or `.`
30
+ - stable and never reused for different meanings
31
+
32
+ Examples:
33
+
34
+ - `manager`
35
+ - `order.take_payment`
36
+ - `pos.core`
37
+ - `missing_warehouse_blocks_staff`
38
+
39
+ ### 1.3 Evidence and Ground Truth
40
+
41
+ A step is **PASS** only if it produces the required **Proof Tokens**:
42
+
43
+ - DOM
44
+ - Navigation
45
+ - Network
46
+ - State
47
+
48
+ If proofs are missing, the result is **UNKNOWN** (treated as failure until fixed).
49
+
50
+ ### 1.4 Watermarks / safety
51
+
52
+ Any entity created/modified by automation MUST be tagged with:
53
+
54
+ `E2E::<date>::<runId>`
55
+
56
+ Automation may ONLY modify/delete entities that contain the watermark tag.
57
+
58
+ ---
59
+
60
+ ## 2) `spec/roles.yaml`
61
+
62
+ Defines roles (actors) and what they are allowed to do.
63
+
64
+ ### Schema
65
+
66
+ ```yaml
67
+ version: 1
68
+ description: string
69
+
70
+ roles:
71
+ - id: string # unique role ID, e.g., "staff"
72
+ name: string # display name
73
+ description: string
74
+ inherits: string[] # optional; list of role IDs
75
+ capabilities: string[] # list of capability IDs
76
+
77
+ capability_groups: # optional convenience grouping
78
+ <group_name>: string[]
79
+ ```
80
+
81
+ **Notes**
82
+
83
+ - capabilities are referenced by plans under `capabilities_required`.
84
+ - `inherits` means effective capabilities = self + inherited.
85
+
86
+ ---
87
+
88
+ ## 3) `spec/domain_rules.yaml`
89
+
90
+ Defines business prerequisites + invariants to generate negative variants and verify system correctness.
91
+
92
+ ### Schema
93
+
94
+ ```yaml
95
+ version: 1
96
+ description: string
97
+
98
+ entities:
99
+ - id: string
100
+ description: string
101
+
102
+ prerequisites:
103
+ - id: string
104
+ name: string
105
+ applies_to:
106
+ - action: string # e.g., "order.add_item"
107
+ requires:
108
+ - entity: string # one of entities[].id
109
+ notes: string
110
+
111
+ policies:
112
+ - id: string
113
+ name: string
114
+ cases:
115
+ - when: string
116
+ staff_behavior: string | null
117
+ manager_behavior: string | null
118
+ default_behavior: string | null
119
+ message: string | null
120
+ requires_audit_log: boolean | null
121
+ allowed_fallbacks: string[] | null
122
+
123
+ invariants:
124
+ - id: string
125
+ name: string
126
+ applies_to:
127
+ - action: string
128
+ requires: # optional gate
129
+ - policy: string | null
130
+ must_hold: string[] # human-readable invariant rules
131
+
132
+ watermarks:
133
+ description: string
134
+ tag_format: string
135
+ scope_rules: string[]
136
+ ```
137
+
138
+ **Notes**
139
+
140
+ - `must_hold` is human-readable; the executor can map to proofs and/or API checks.
141
+ - `policies` define expected behavior when prerequisites fail (block vs warn vs override).
142
+
143
+ ---
144
+
145
+ ## 4) `spec/blockers.yaml`
146
+
147
+ Defines "surprise UI" (dialogs, toasts, overlays) and how to handle them.
148
+
149
+ ### Schema
150
+
151
+ ```yaml
152
+ version: 1
153
+ description: string
154
+
155
+ blockers:
156
+ - id: string
157
+ type: modal | overlay | auth | banner | unknown
158
+ severity: auto_dismiss_safe | auto_wait_safe | auto_retry_safe | escalate_plan_update | hard_stop
159
+ detect:
160
+ any:
161
+ - selector: string | null
162
+ - text: string | null
163
+ resolve:
164
+ steps:
165
+ - try_click:
166
+ any: string[] # selectors or text match directives
167
+ - wait_until_gone:
168
+ timeout_ms: number
169
+ - wait_ms: number
170
+ - capture_evidence: boolean
171
+ - attempt_relogin: boolean
172
+ - hard_stop: boolean
173
+ - if_still_present: { wait_ms: number }
174
+
175
+ hard_stop_conditions:
176
+ - id: string
177
+ description: string
178
+ detect:
179
+ any:
180
+ - selector: string | null
181
+ - text: string | null
182
+ action: hard_stop
183
+ ```
184
+
185
+ **Notes**
186
+
187
+ - `detect.any` is OR logic: if any detection matches, blocker is active.
188
+ - `severity` controls whether the run continues or escalates.
189
+
190
+ ---
191
+
192
+ ## 5) `spec/journeys.graph.json`
193
+
194
+ The living representation of the app as experienced by end-users.
195
+
196
+ ### Schema
197
+
198
+ ```json
199
+ {
200
+ "version": 1,
201
+ "description": "string",
202
+ "nodes": [
203
+ {
204
+ "id": "string",
205
+ "signature": "string",
206
+ "title": "string",
207
+ "tags": ["string"],
208
+ "metadata": {}
209
+ }
210
+ ],
211
+ "edges": [
212
+ {
213
+ "id": "string",
214
+ "from": "node_id",
215
+ "to": "node_id",
216
+ "actor": "role_id",
217
+ "action": "string",
218
+ "params": {},
219
+ "proof_requirements": [{ "type": "dom|navigation|network|state", "expects": "string" }],
220
+ "notes": "string",
221
+ "risk": "low|med|high"
222
+ }
223
+ ],
224
+ "metadata": {
225
+ "screen_signature_spec": ["string"],
226
+ "edge_proof_token_minimums": {
227
+ "default": 1,
228
+ "commit_action": 2
229
+ }
230
+ }
231
+ }
232
+ ```
233
+
234
+ **Notes**
235
+
236
+ - Nodes represent screens/states; edges represent action triggers.
237
+ - Graph is updated by Explorer and used by Planner to generate plans.
238
+ - A canonical flow is the source of truth for its steps, test cases, parity, and bug reports.
239
+ - Only a flow with `stability: stable` and `linkedToGraph: true` participates in the larger app graph.
240
+ - Flow revisions return to `stabilizing` when edited; reused steps reference the source canonical flow instead of being duplicated.
241
+
242
+ ---
243
+
244
+ ## 6) `spec/plans/*.flow.yaml`
245
+
246
+ Human-readable plans that become executable journeys.
247
+
248
+ ### Schema
249
+
250
+ ```yaml
251
+ version: 1
252
+ id: string
253
+ name: string
254
+ description: string
255
+ driver: string # optional registered app-driver; defaults to the configured driver
256
+ platform: web | android | ios
257
+ target: # optional driver target
258
+ base_url: string | null
259
+ app_id: string | null
260
+ device_id: string | null
261
+ serial: string | null
262
+ flow: string | null # driver flow file or generated flow reference
263
+ recovery: # optional bounded recovery policy
264
+ enabled: boolean
265
+ max_attempts: number
266
+ timeout_ms: number
267
+
268
+ suites:
269
+ - id: string
270
+ runs: daily | weekly | on_demand | pr | release_candidate
271
+ journeys:
272
+ - id: string
273
+ actor: string # role id from roles.yaml
274
+ goal: string
275
+ capabilities_required: string[] # capability IDs
276
+ preconditions: string[] # human-readable checks
277
+ steps:
278
+ - action: string # e.g., "order.add_item"
279
+ params: # optional
280
+ any_key: any_value
281
+ expected_outcome: pass | blocked | warn | fail | unknown
282
+ proofs:
283
+ - type: dom | navigation | network | state
284
+ expects: string
285
+ variants: # optional
286
+ - id: string
287
+ actor: string | null
288
+ preconditions: string[]
289
+ steps: [...]
290
+ ```
291
+
292
+ **Notes**
293
+
294
+ - `expected_outcome` defaults to `pass` if omitted.
295
+ - Negative cases use `blocked` or `warn` and still require proofs (e.g., error message visible).
296
+
297
+ ---
298
+
299
+ ## 7) `spec/bugs.index.json`
300
+
301
+ Normalized bug backlog for linking to journeys and generating regression assertions.
302
+
303
+ ### Schema
304
+
305
+ ```json
306
+ {
307
+ "version": 1,
308
+ "description": "string",
309
+ "bugs": [
310
+ {
311
+ "id": "string",
312
+ "title": "string",
313
+ "severity": "P0|P1|P2|P3",
314
+ "status": "open|closed|wontfix|duplicate",
315
+ "actor": "role_id",
316
+ "screen_signature": "string",
317
+ "action": "string",
318
+ "expected": "string",
319
+ "actual": "string",
320
+ "repro_steps": ["string"],
321
+ "regression_assertions": [{ "type": "dom|navigation|network|state", "expects": "string" }],
322
+ "links": {
323
+ "tracker": "string",
324
+ "evidence": ["string"]
325
+ }
326
+ }
327
+ ]
328
+ }
329
+ ```
330
+
331
+ **Notes**
332
+
333
+ - `screen_signature` should match journey graph signatures.
334
+ - `regression_assertions` are merged into relevant plans.
335
+
336
+ ---
337
+
338
+ ## 8) Proof Token "expects" conventions (recommended)
339
+
340
+ To avoid ambiguity, standardize `expects` strings:
341
+
342
+ ### DOM proof examples
343
+
344
+ - `visible:[data-testid='cart-line-item'][text~='Coffee']`
345
+ - `text:[data-testid='payment-status'] == 'PAID'`
346
+ - `count:[data-testid='cart-line-item'] >= 1`
347
+ - `enabled:[data-testid='order-submit'] == true`
348
+
349
+ ### Navigation proof examples
350
+
351
+ - `screen:order`
352
+ - `url:/pos/order`
353
+ - `signature:pos.order@route:/pos/order@root:screen-order`
354
+
355
+ ### Network proof examples
356
+
357
+ - `POST /api/orders status 200`
358
+ - `POST /api/payments status 200`
359
+
360
+ ### State proof examples
361
+
362
+ - `order_id present`
363
+ - `receipt_number present`
364
+ - `inventory_delta(material='beans') == -10`
365
+
366
+ ---
367
+
368
+ ## 9) Suggested directory layout
369
+
370
+ ```
371
+ spec/
372
+ roles.yaml
373
+ domain_rules.yaml
374
+ blockers.yaml
375
+ journeys.graph.json
376
+ app-ui-audit.schema.json
377
+ ui-parity-audit.schema.json
378
+ plans/
379
+ pos.core.flow.yaml
380
+ bugs.index.json
381
+ docs/
382
+ plans/
383
+ SAD.md
384
+ ```
385
+
386
+ ---
387
+
388
+ ## 10) Change control
389
+
390
+ - Plans and schemas should be reviewed like code.
391
+ - Any automated update must produce:
392
+ - diff summary
393
+ - evidence links (trace/video/screenshot/network receipts)
394
+ - risk classification (low/med/high)
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://app.bugmole.com/schemas/test-case-results.schema.json",
4
+ "title": "Bugmole Test Case Results",
5
+ "description": "What a run actually observed for the assumptions in one case set. Assumptions say what should be true; results say what happened. A result is the only thing that moves a case off \"planned\" on the dashboard, so every entry must name a case that exists in that set and say what was observed.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "caseSetId",
11
+ "results"
12
+ ],
13
+ "properties": {
14
+ "schemaVersion": { "const": 1 },
15
+ "caseSetId": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "pattern": "^[a-zA-Z0-9._-]+$",
19
+ "description": "The case set these verdicts judge, as written by bugmole_write_test_cases."
20
+ },
21
+ "journeyRevision": {
22
+ "type": "integer",
23
+ "description": "The journey revision the run judged. Assumptions are rewritten as a journey changes, so results recorded against an older revision are discarded rather than shown as proof of the current one."
24
+ },
25
+ "runId": {
26
+ "type": "string",
27
+ "description": "The run that produced these verdicts, when there is one."
28
+ },
29
+ "recordedAt": {
30
+ "type": "string",
31
+ "format": "date-time"
32
+ },
33
+ "results": {
34
+ "type": "array",
35
+ "minItems": 1,
36
+ "items": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["caseId", "status", "detail"],
40
+ "properties": {
41
+ "caseId": {
42
+ "type": "string",
43
+ "description": "Must be a caseId present in the referenced case set."
44
+ },
45
+ "status": {
46
+ "enum": ["passed", "failed", "blocked", "needs_setup"],
47
+ "description": "\"failed\" means the check ran and the expectation did not hold. \"blocked\" means it could not be run at all. Do not use one for the other: a regression hidden behind a setup problem is how a broken app looks healthy."
48
+ },
49
+ "detail": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "description": "What was actually observed — the status code, the element that was or was not there, the assertion that failed. Required, including for a pass: a verdict nobody can review is not evidence."
53
+ },
54
+ "evidence": {
55
+ "type": "string",
56
+ "description": "Artifact key for the screenshot or capture backing this verdict."
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://app.bugmole.com/schemas/test-cases.schema.json",
4
+ "title": "Bugmole Test Case Assumptions",
5
+ "description": "Candidate test cases derived from a discovered journey. These are assumptions: what the agent believes each step should do, grounded in nodes and edges that actually exist in the journey graph. They are not yet verified — a run is what turns an assumption into evidence.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "caseSetId",
11
+ "journeyId",
12
+ "journeyRevision",
13
+ "cases"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": { "const": 1 },
17
+ "caseSetId": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "pattern": "^[a-zA-Z0-9._-]+$"
21
+ },
22
+ "projectId": { "type": "string" },
23
+ "journeyId": { "type": "string", "minLength": 1 },
24
+ "journeyRevision": { "type": "integer", "minimum": 1 },
25
+ "actor": { "type": "string" },
26
+ "generatedAt": { "type": "string", "format": "date-time" },
27
+ "cases": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["caseId", "title", "nodeId", "intent", "steps", "expected", "confidence"],
33
+ "properties": {
34
+ "caseId": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "pattern": "^[a-zA-Z0-9._-]+$"
38
+ },
39
+ "title": { "type": "string", "minLength": 1 },
40
+ "nodeId": {
41
+ "type": "string",
42
+ "minLength": 1,
43
+ "description": "Must be a node in the referenced journey at that revision."
44
+ },
45
+ "edgeId": {
46
+ "type": "string",
47
+ "minLength": 1,
48
+ "description": "Optional; when present must be an edge in the referenced journey."
49
+ },
50
+ "route": { "type": "string" },
51
+ "intent": {
52
+ "type": "string",
53
+ "minLength": 1,
54
+ "description": "What this case is trying to prove, in one sentence."
55
+ },
56
+ "steps": {
57
+ "type": "array",
58
+ "minItems": 1,
59
+ "items": { "type": "string", "minLength": 1 }
60
+ },
61
+ "expected": {
62
+ "type": "array",
63
+ "minItems": 1,
64
+ "items": { "type": "string", "minLength": 1 },
65
+ "description": "Observable outcomes. Each should be checkable, not a restatement of the step."
66
+ },
67
+ "confidence": {
68
+ "enum": ["high", "medium", "low"],
69
+ "description": "How sure the agent is that this expectation is correct rather than guessed."
70
+ },
71
+ "basis": {
72
+ "type": "array",
73
+ "items": { "type": "string", "minLength": 1 },
74
+ "description": "What this assumption was derived from — source paths, observed controls, domain rules. An assumption with no basis should be low confidence."
75
+ },
76
+ "blockedReason": {
77
+ "type": "string",
78
+ "minLength": 1,
79
+ "description": "Set when the case cannot be asserted yet; recorded rather than silently dropped."
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }