@atlassian/chippy 0.0.0-stage → 0.0.1-beta.1

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 (126) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +188 -2
  3. package/bin/chippy.mjs +134 -0
  4. package/bin/pack.mjs +184 -0
  5. package/lib/avalanche.js +2570 -0
  6. package/lib/avalanche.js.map +7 -0
  7. package/lib/bootstrap.d.ts +1 -0
  8. package/lib/bootstrap.js +51 -0
  9. package/lib/bootstrap.js.map +7 -0
  10. package/lib/browser.js +15 -0
  11. package/lib/browser.js.map +7 -0
  12. package/lib/extension/avalanche.es.js +5396 -0
  13. package/lib/extension/avalanche.es.js.map +1 -0
  14. package/lib/extension/chippy-page-bridge.js +1833 -0
  15. package/lib/extension/inspect-react.js +216 -0
  16. package/lib/extension/layout-lab.js +1453 -0
  17. package/lib/extension/panel-dom.js +90 -0
  18. package/lib/extension/resolve-probes.js +342 -0
  19. package/lib/mcp-skill/LICENSE +201 -0
  20. package/lib/mcp-skill/README.md +150 -0
  21. package/lib/mcp-skill/SKILL.md +330 -0
  22. package/lib/mcp-skill/browser-scripts/playwright-probes.js +368 -0
  23. package/lib/mcp-skill/browser-scripts/playwright-session.js +114 -0
  24. package/lib/mcp-skill/extension/avalanche.es.js +5396 -0
  25. package/lib/mcp-skill/extension/avalanche.es.js.map +1 -0
  26. package/lib/mcp-skill/extension/avalanche.iife.js +5397 -0
  27. package/lib/mcp-skill/extension/avalanche.iife.js.map +1 -0
  28. package/lib/mcp-skill/extension/background.js +323 -0
  29. package/lib/mcp-skill/extension/chippy-page-bridge.js +1833 -0
  30. package/lib/mcp-skill/extension/content-script.js +167 -0
  31. package/lib/mcp-skill/extension/devtools-hook-shim.js +68 -0
  32. package/lib/mcp-skill/extension/early-bootstrap.js +47 -0
  33. package/lib/mcp-skill/extension/icon-128.png +0 -0
  34. package/lib/mcp-skill/extension/icon-16.png +0 -0
  35. package/lib/mcp-skill/extension/icon-32.png +0 -0
  36. package/lib/mcp-skill/extension/icon-48.png +0 -0
  37. package/lib/mcp-skill/extension/inspect-react.js +216 -0
  38. package/lib/mcp-skill/extension/layout-lab.js +1453 -0
  39. package/lib/mcp-skill/extension/logo.svg +14 -0
  40. package/lib/mcp-skill/extension/manifest.json +69 -0
  41. package/lib/mcp-skill/extension/panel-dom.js +90 -0
  42. package/lib/mcp-skill/extension/panel-settings.js +191 -0
  43. package/lib/mcp-skill/extension/popup.html +41 -0
  44. package/lib/mcp-skill/extension/popup.js +80 -0
  45. package/lib/mcp-skill/extension/probe-descriptor.js +241 -0
  46. package/lib/mcp-skill/extension/resolve-probes.js +342 -0
  47. package/lib/mcp-skill/package.json +1 -0
  48. package/lib/mcp-skill/references/README.md +56 -0
  49. package/lib/mcp-skill/references/active-stimulus.md +85 -0
  50. package/lib/mcp-skill/references/avalanche-detector.md +731 -0
  51. package/lib/mcp-skill/references/bdd-router.md +310 -0
  52. package/lib/mcp-skill/references/browser-runtime-api.md +193 -0
  53. package/lib/mcp-skill/references/command-output-formats.md +1075 -0
  54. package/lib/mcp-skill/references/command-surface.md +183 -0
  55. package/lib/mcp-skill/references/cynefin.md +99 -0
  56. package/lib/mcp-skill/references/debug-hook.md +161 -0
  57. package/lib/mcp-skill/references/fixing-performance.md +490 -0
  58. package/lib/mcp-skill/references/hook-metrics.md +199 -0
  59. package/lib/mcp-skill/references/hooks-inspection.md +61 -0
  60. package/lib/mcp-skill/references/jira-taxonomy.md +81 -0
  61. package/lib/mcp-skill/references/mcp.md +122 -0
  62. package/lib/mcp-skill/references/mode-a-injection.md +68 -0
  63. package/lib/mcp-skill/references/operating-model.md +128 -0
  64. package/lib/mcp-skill/references/playwright-cli-setup.md +105 -0
  65. package/lib/mcp-skill/references/playwright-probes.md +205 -0
  66. package/lib/mcp-skill/references/procedures.md +545 -0
  67. package/lib/mcp-skill/references/recipes.txt +114 -0
  68. package/lib/mcp-skill/references/stability-render.md +428 -0
  69. package/lib/mcp-skill/references/test-mode-playbook.md +193 -0
  70. package/lib/mcp-skill/references/troubleshooting.md +54 -0
  71. package/lib/mcp-skill/scripts/avalanche-analyze.cjs +495 -0
  72. package/lib/mcp-skill/scripts/build-avalanche-command.js +34 -0
  73. package/lib/mcp-skill/scripts/build-fiber-state-command.js +19 -0
  74. package/lib/mcp-skill/scripts/chippy-helper-server.js +1710 -0
  75. package/lib/mcp-skill/scripts/chippy-mcp.cjs +273 -0
  76. package/lib/mcp-skill/scripts/chippy.sh +1218 -0
  77. package/lib/mcp-skill/scripts/format-probe-result.js +34 -0
  78. package/lib/mcp-skill/scripts/helper-access.js +144 -0
  79. package/lib/mcp-skill/scripts/probe-annotation-channel.js +116 -0
  80. package/lib/mcp-skill/scripts/search-recipes.js +248 -0
  81. package/lib/mcp-skill/snippets/README.md +89 -0
  82. package/lib/mcp-skill/snippets/count-context-consumers.js +40 -0
  83. package/lib/mcp-skill/snippets/find-context-providers.js +38 -0
  84. package/lib/mcp-skill/snippets/find-legacy-context.js +47 -0
  85. package/lib/mcp-skill/snippets/find-prop.js +83 -0
  86. package/lib/mcp-skill/snippets/hook-metrics-sample.js +69 -0
  87. package/lib/mcp-skill/snippets/hook-metrics.js +60 -0
  88. package/lib/mcp-skill/snippets/hook-tracker.js +198 -0
  89. package/lib/mcp-skill/snippets/stability-nudge.js +101 -0
  90. package/lib/package.json +1 -0
  91. package/lib/plugin.js +119 -0
  92. package/lib/plugin.js.map +7 -0
  93. package/lib/storybook/avalanche-panel-model.js +79 -0
  94. package/lib/storybook/brand.jsx +6 -0
  95. package/lib/storybook/connection-fallback.jsx +47 -0
  96. package/lib/storybook/constants.js +15 -0
  97. package/lib/storybook/context-card.jsx +171 -0
  98. package/lib/storybook/manager.jsx +403 -0
  99. package/lib/storybook/preset.js +7 -0
  100. package/lib/storybook/preview.js +263 -0
  101. package/lib/storybook/probe-annotation-editor.jsx +52 -0
  102. package/lib/storybook/probe-intent.js +23 -0
  103. package/lib/storybook/setup.js +93 -0
  104. package/lib/types/avalanche/commit-metrics-adapter.d.ts +76 -0
  105. package/lib/types/avalanche/commit-stats-indices.d.ts +41 -0
  106. package/lib/types/avalanche/commit-surface-ownership.d.ts +9 -0
  107. package/lib/types/avalanche/detector.d.ts +183 -0
  108. package/lib/types/avalanche/interaction-capture.d.ts +25 -0
  109. package/lib/types/avalanche/internals.d.ts +189 -0
  110. package/lib/types/avalanche/report-serializer.d.ts +283 -0
  111. package/lib/types/avalanche/reporter.d.ts +610 -0
  112. package/lib/types/chippy-bridge/fiber-source.d.ts +37 -0
  113. package/lib/types/chippy-bridge/react-renderer.d.ts +49 -0
  114. package/lib/types/chippy-bridge/source-map.d.ts +30 -0
  115. package/lib/types/debug-render/core.d.ts +72 -0
  116. package/lib/types/layout-lab/fiber-boundaries.d.ts +51 -0
  117. package/lib/types/layout-lab/fiber-walk.d.ts +131 -0
  118. package/lib/types/layout-lab/marker-context.d.ts +94 -0
  119. package/lib/types/package/avalanche.d.ts +6 -0
  120. package/lib/types/package/browser.d.ts +10 -0
  121. package/lib/types/package/plugin.d.ts +15 -0
  122. package/lib/types/plugins/atl/commit-metrics-adapter.d.ts +65 -0
  123. package/lib/types/plugins/atl/metrics-slot.d.ts +37 -0
  124. package/lib/types/plugins/index.d.ts +49 -0
  125. package/lib/types/plugins/jira/context-provider.d.ts +36 -0
  126. package/package.json +104 -4
@@ -0,0 +1,85 @@
1
+ # Active Stimulus — Page Click, Fiber Invoke, Stability Nudge
2
+
3
+ Active-stimulus commands deliberately change the running page so Chippy can observe the result. They are for reproduction, verification, and observability — never for patching behavior in place instead of editing source.
4
+
5
+ ## Debug replay preflight
6
+
7
+ `explain-component`, `describe-component`, and `inspect-fiber-structure` are read-oriented commands, but their dispatcher-based debug replay may execute component and hook bodies. Replay does not schedule an application update; render-time side effects can still run.
8
+
9
+ Before any of these commands:
10
+
11
+ 1. Name the exact component/fiber target.
12
+ 2. Disclose the render-time execution boundary.
13
+ 3. If that execution is unsafe or cannot be accepted, use `probe-hooks-summary` / `inspect-fiber-hooks-summary`, props, and owners instead; report that custom-hook ancestry was not replayed.
14
+ 4. After replay, read `replayStatus` and `warnings`; when replay is unavailable, treat the result as fiber-only evidence.
15
+
16
+ ## Commands
17
+
18
+ - `page-click <clientId> <selector|probeId|fiberId>` — click exactly one DOM target.
19
+ - `fiber-prop-contract <clientId> <fiberId> <propName>` — inspect a prop's callable shape without invoking it.
20
+ - `fiber-invoke <clientId> <fiberId> <propName> [--args JSON]` — invoke exactly one already-understood function prop from `memoizedProps`.
21
+ - `fiber-schedule-update <clientId> <fiberId> [--ownerIndex N]` — force exactly one re-render on a fiber via the DevTools renderer's `scheduleUpdate`. Works on any component (function, hookless, memo, forwardRef, class) and mutates no hook/prop. The capability behind `stability-nudge`.
22
+ - `eval-page <clientId> stability-nudge ...` — synthetic single-fiber stimulus (the procedure that composes `fiber-schedule-update` with probe/testId resolution).
23
+
24
+ ## Anchor contract
25
+
26
+ Before running an active stimulus, state all three:
27
+
28
+ 1. **Exact target** — the one DOM node, one probe target, one fiber, or one hook anchor you intend to stimulate.
29
+ 2. **Exact stimulus** — what Chippy will do (`click`, invoke `onClick`, schedule one render on a target fiber, etc.).
30
+ 3. **Pollution boundary** — what state may become changed, ambiguous, or no longer representative afterward.
31
+
32
+ If any of the three are missing, do not stimulate yet.
33
+
34
+ ## `page-click`
35
+
36
+ Use when the target behavior is best represented by a browser click on the rendered DOM.
37
+
38
+ Rules:
39
+ - selector must resolve to **exactly one** element; ambiguous selectors refuse
40
+ - probe target uses the resolved probe DOM node
41
+ - fiber target uses the first DOM-backed node reachable from that remembered fiber
42
+ - no multi-click mode
43
+
44
+ Pollution:
45
+ - all page state reachable from the click handler may change
46
+ - focus, selection, open/closed UI state, and network activity may change
47
+ - subsequent probe reads are about the post-click page, not the pre-click page
48
+
49
+ ## `fiber-invoke`
50
+
51
+ Use when the final application boundary matters more than browser mechanics — for example invoking `onClick`, `onChange`, or a callback prop directly to tap the product system without reproducing browser ceremony.
52
+
53
+ Rules:
54
+ - target fiber is explicit (`fiberId` only)
55
+ - run `fiber-prop-contract` first to inspect `fn.length`, function name/source preview, prop names, and source hints
56
+ - read the component/owner source to determine the real callback contract
57
+ - prop must exist on `memoizedProps`
58
+ - prop must be a function
59
+ - arguments are explicit JSON only; do not infer them from prop names
60
+
61
+ Pollution:
62
+ - component/app state may change without matching browser focus, pointer, or default-event semantics
63
+ - side effects triggered by the callback still run
64
+ - this proves application behavior, not browser behavior
65
+
66
+ ## Choosing between them
67
+
68
+ Prefer `page-click` when:
69
+ - browser semantics matter
70
+ - the handler depends on actual DOM click wiring
71
+ - you want the closest equivalent to a user click
72
+
73
+ Prefer `fiber-invoke` when:
74
+ - the browser ceremony is irrelevant noise
75
+ - the real question is whether the app callback changes state correctly
76
+ - you want a small white-box repro that taps directly into the final system
77
+
78
+ ## Never
79
+
80
+ - never use active stimulus before finishing Observe/Define
81
+ - never hide that the page was mutated
82
+ - never treat post-stimulus state as if it were pristine baseline state
83
+ - never use `fiber-invoke` to claim browser behavior was proven
84
+ - never invoke a function prop before understanding its contract from `fiber-prop-contract` and source inspection
85
+ - never synthesize callback arguments from prop names alone