@atlassian/chippy 0.0.0-stage → 0.0.1-beta.2
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/LICENSE +201 -0
- package/README.md +276 -2
- package/bin/chippy.mjs +92 -0
- package/bin/pack.mjs +204 -0
- package/bin/skill-dir.mjs +15 -0
- package/lib/avalanche.js +2601 -0
- package/lib/avalanche.js.map +7 -0
- package/lib/bootstrap.d.ts +1 -0
- package/lib/bootstrap.js +70 -0
- package/lib/bootstrap.js.map +7 -0
- package/lib/browser.js +15 -0
- package/lib/browser.js.map +7 -0
- package/lib/extension/avalanche.es.js +5535 -0
- package/lib/extension/avalanche.es.js.map +1 -0
- package/lib/extension/chippy-page-bridge.js +1953 -0
- package/lib/extension/inspect-react.js +216 -0
- package/lib/extension/layout-lab.js +1453 -0
- package/lib/extension/panel-dom.js +90 -0
- package/lib/extension/resolve-probes.js +342 -0
- package/lib/mcp-skill/LICENSE +201 -0
- package/lib/mcp-skill/README.md +148 -0
- package/lib/mcp-skill/SKILL.md +335 -0
- package/lib/mcp-skill/browser-scripts/playwright-probes.js +368 -0
- package/lib/mcp-skill/browser-scripts/playwright-session.js +114 -0
- package/lib/mcp-skill/extension/armed-reload-startup.js +83 -0
- package/lib/mcp-skill/extension/avalanche.es.js +5535 -0
- package/lib/mcp-skill/extension/avalanche.es.js.map +1 -0
- package/lib/mcp-skill/extension/avalanche.iife.js +5536 -0
- package/lib/mcp-skill/extension/avalanche.iife.js.map +1 -0
- package/lib/mcp-skill/extension/background.js +325 -0
- package/lib/mcp-skill/extension/chippy-page-bridge.js +1953 -0
- package/lib/mcp-skill/extension/content-script.js +190 -0
- package/lib/mcp-skill/extension/devtools-hook-shim.js +85 -0
- package/lib/mcp-skill/extension/early-bootstrap.js +49 -0
- package/lib/mcp-skill/extension/icon-128.png +0 -0
- package/lib/mcp-skill/extension/icon-16.png +0 -0
- package/lib/mcp-skill/extension/icon-32.png +0 -0
- package/lib/mcp-skill/extension/icon-48.png +0 -0
- package/lib/mcp-skill/extension/inspect-react.js +216 -0
- package/lib/mcp-skill/extension/layout-lab.js +1453 -0
- package/lib/mcp-skill/extension/logo.svg +14 -0
- package/lib/mcp-skill/extension/manifest.json +69 -0
- package/lib/mcp-skill/extension/panel-dom.js +90 -0
- package/lib/mcp-skill/extension/panel-settings.js +173 -0
- package/lib/mcp-skill/extension/popup.html +41 -0
- package/lib/mcp-skill/extension/popup.js +80 -0
- package/lib/mcp-skill/extension/probe-descriptor.js +241 -0
- package/lib/mcp-skill/extension/resolve-probes.js +342 -0
- package/lib/mcp-skill/extension/startup-handoff.js +30 -0
- package/lib/mcp-skill/package.json +1 -0
- package/lib/mcp-skill/references/README.md +56 -0
- package/lib/mcp-skill/references/active-stimulus.md +85 -0
- package/lib/mcp-skill/references/avalanche-detector.md +731 -0
- package/lib/mcp-skill/references/bdd-router.md +310 -0
- package/lib/mcp-skill/references/browser-runtime-api.md +193 -0
- package/lib/mcp-skill/references/command-output-formats.md +1085 -0
- package/lib/mcp-skill/references/command-surface.md +183 -0
- package/lib/mcp-skill/references/cynefin.md +99 -0
- package/lib/mcp-skill/references/debug-hook.md +161 -0
- package/lib/mcp-skill/references/fixing-performance.md +490 -0
- package/lib/mcp-skill/references/hook-metrics.md +199 -0
- package/lib/mcp-skill/references/hooks-inspection.md +61 -0
- package/lib/mcp-skill/references/jira-taxonomy.md +81 -0
- package/lib/mcp-skill/references/mcp.md +122 -0
- package/lib/mcp-skill/references/mode-a-injection.md +102 -0
- package/lib/mcp-skill/references/operating-model.md +128 -0
- package/lib/mcp-skill/references/playwright-cli-setup.md +105 -0
- package/lib/mcp-skill/references/playwright-probes.md +205 -0
- package/lib/mcp-skill/references/procedures.md +545 -0
- package/lib/mcp-skill/references/recipes.txt +114 -0
- package/lib/mcp-skill/references/stability-render.md +428 -0
- package/lib/mcp-skill/references/test-mode-playbook.md +194 -0
- package/lib/mcp-skill/references/troubleshooting.md +59 -0
- package/lib/mcp-skill/scripts/avalanche-analyze.cjs +495 -0
- package/lib/mcp-skill/scripts/build-avalanche-command.js +34 -0
- package/lib/mcp-skill/scripts/build-fiber-state-command.js +19 -0
- package/lib/mcp-skill/scripts/chippy-helper-server.js +1768 -0
- package/lib/mcp-skill/scripts/chippy-mcp.cjs +273 -0
- package/lib/mcp-skill/scripts/chippy.sh +1252 -0
- package/lib/mcp-skill/scripts/format-probe-result.js +34 -0
- package/lib/mcp-skill/scripts/helper-access.js +158 -0
- package/lib/mcp-skill/scripts/helper-proxy.js +87 -0
- package/lib/mcp-skill/scripts/page-socket-trust.js +81 -0
- package/lib/mcp-skill/scripts/probe-annotation-channel.js +116 -0
- package/lib/mcp-skill/scripts/search-recipes.js +248 -0
- package/lib/mcp-skill/snippets/README.md +89 -0
- package/lib/mcp-skill/snippets/count-context-consumers.js +40 -0
- package/lib/mcp-skill/snippets/find-context-providers.js +38 -0
- package/lib/mcp-skill/snippets/find-legacy-context.js +47 -0
- package/lib/mcp-skill/snippets/find-prop.js +83 -0
- package/lib/mcp-skill/snippets/hook-metrics-sample.js +69 -0
- package/lib/mcp-skill/snippets/hook-metrics.js +60 -0
- package/lib/mcp-skill/snippets/hook-tracker.js +198 -0
- package/lib/mcp-skill/snippets/stability-nudge.js +101 -0
- package/lib/package.json +1 -0
- package/lib/plugin.js +119 -0
- package/lib/plugin.js.map +7 -0
- package/lib/storybook/avalanche-panel-model.js +79 -0
- package/lib/storybook/brand.jsx +6 -0
- package/lib/storybook/connection-fallback.jsx +47 -0
- package/lib/storybook/constants.js +15 -0
- package/lib/storybook/context-card.jsx +171 -0
- package/lib/storybook/manager-owner.js +42 -0
- package/lib/storybook/manager.jsx +425 -0
- package/lib/storybook/preset.js +7 -0
- package/lib/storybook/preview.js +298 -0
- package/lib/storybook/probe-annotation-editor.jsx +52 -0
- package/lib/storybook/probe-intent.js +23 -0
- package/lib/storybook/setup.js +104 -0
- package/lib/types/avalanche/commit-metrics-adapter.d.ts +76 -0
- package/lib/types/avalanche/commit-stats-indices.d.ts +41 -0
- package/lib/types/avalanche/commit-surface-ownership.d.ts +9 -0
- package/lib/types/avalanche/detector.d.ts +183 -0
- package/lib/types/avalanche/interaction-capture.d.ts +25 -0
- package/lib/types/avalanche/internals.d.ts +189 -0
- package/lib/types/avalanche/report-serializer.d.ts +283 -0
- package/lib/types/avalanche/reporter.d.ts +610 -0
- package/lib/types/chippy-bridge/fiber-source.d.ts +48 -0
- package/lib/types/chippy-bridge/react-renderer.d.ts +74 -0
- package/lib/types/chippy-bridge/recorded-source.d.ts +44 -0
- package/lib/types/chippy-bridge/source-map.d.ts +30 -0
- package/lib/types/debug-render/core.d.ts +78 -0
- package/lib/types/layout-lab/fiber-boundaries.d.ts +51 -0
- package/lib/types/layout-lab/fiber-walk.d.ts +131 -0
- package/lib/types/layout-lab/marker-context.d.ts +94 -0
- package/lib/types/package/avalanche.d.ts +6 -0
- package/lib/types/package/browser.d.ts +10 -0
- package/lib/types/package/plugin.d.ts +15 -0
- package/lib/types/plugins/atl/commit-metrics-adapter.d.ts +65 -0
- package/lib/types/plugins/atl/metrics-slot.d.ts +37 -0
- package/lib/types/plugins/index.d.ts +49 -0
- package/lib/types/plugins/jira/context-provider.d.ts +36 -0
- package/package.json +106 -4
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
# Chippy Procedures — Ceremonies, Procedures, Plays
|
|
2
|
+
|
|
3
|
+
The P-01..P-20 procedures turn routed Chippy cases into executable evidence and verification chains. Use one after [bdd-router](bdd-router.md) selects it.
|
|
4
|
+
|
|
5
|
+
Canonical phase contracts and apply gate live in [operating-model](operating-model.md). This file only defines executable procedure chains.
|
|
6
|
+
|
|
7
|
+
## Procedures
|
|
8
|
+
|
|
9
|
+
Named workflows that compose documented Chippy commands into repeatable chains. The command contract lives in the main [SKILL.md](../SKILL.md#command-surface).
|
|
10
|
+
|
|
11
|
+
### P-01 · Verify Runtime (Ceremony — every turn)
|
|
12
|
+
|
|
13
|
+
**When:** Before any probe, fiber, or avalanche action. Every single turn.
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
health → pages → request-snapshot <clientId>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
1. `health` — helper alive?
|
|
20
|
+
2. `pages` — which page? Pick by URL, title, integration identity, and `latestSnapshotAt`. If two pages still match closely, ask which one is in scope.
|
|
21
|
+
3. `request-snapshot <clientId>` — fresh state from the live page.
|
|
22
|
+
4. Extract `clientId`. Never reuse stale clientId across turns.
|
|
23
|
+
|
|
24
|
+
**Done when:** clientId is confirmed fresh. Snapshot timestamp is current.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
### P-02 · Trace Element to Source (Core Procedure)
|
|
29
|
+
|
|
30
|
+
**When:** User points at something visible and asks "what is this?" / "why does this show X?".
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
probe-dom → probe-owners → probe-props/probe-prop-value → open file at source.fileName:lineNumber
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
1. `probe-dom <clientId> <probeId>` — identify exact element, text, tag, source.
|
|
37
|
+
2. `probe-owners <clientId> <probeId>` — walk owner chain; read propNames at each level.
|
|
38
|
+
3. `probe-prop-value <clientId> <probeId> <propName> [ownerIndex]` — find which owner carries the value.
|
|
39
|
+
4. Open `source.fileName` at `lineNumber`. Read it. No grep.
|
|
40
|
+
5. If the task is to walk the React fiber path, use `probe-parents <clientId> <probeId>` for the `fiber.return` parent chain. If starting from a remembered fiber, run the [debug replay preflight](active-stimulus.md#debug-replay-preflight) only when `explain-component` is needed, then use `inspect-fiber-parents <clientId> <fiberId>`. Use `probe-owners` only on debug builds where `_debugOwner` exists; it is not a production-build route.
|
|
41
|
+
6. If large component (`hookCount > 50`): run the [debug replay preflight](active-stimulus.md#debug-replay-preflight), then `explain-component`; use `describe-component` only if needed.
|
|
42
|
+
7. State finding in reporting format (📏 probe resolved to…).
|
|
43
|
+
|
|
44
|
+
**Done when:** component + file + line + prop forwarding hop all named.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### P-03 · Inspect Large Component (Procedure)
|
|
49
|
+
|
|
50
|
+
**When:** `hookCount > 50`, `parents > 50`, or `matchedStyles > 20` on a probed component.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
explain-component → (if needed) describe-component → probe-prop-value / inspect-fiber-structure
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Replay preflight:** before step 1, follow the [debug replay preflight](active-stimulus.md#debug-replay-preflight). Name the target and disclose that the three structure commands can execute component and hook bodies without scheduling an application update. If render-time execution is unsafe or cannot be accepted for this target, use the fiber-only `probe-hooks-summary` / `inspect-fiber-hooks-summary`, props, and owners commands instead, and report that custom-hook ancestry was not replayed.
|
|
57
|
+
|
|
58
|
+
1. `explain-component <clientId> <probeId|fiberId|name>` — compact overview. It may run dispatcher-based debug replay, so inspect `replayStatus` and `warnings`; replay executes component and hook bodies without scheduling an application update.
|
|
59
|
+
2. Form a concrete question from the map.
|
|
60
|
+
3. If needed: `describe-component <clientId> <fiberIdOrName>` — full custom-hook tree. It has the same replay execution boundary as step 1.
|
|
61
|
+
4. Answer the concrete question with `probe-prop-value` or `inspect-fiber-structure <clientId> <fiberId> <hookIndex>`. Structure inspection may also replay; check its `replayStatus` and `warnings`.
|
|
62
|
+
|
|
63
|
+
**Done when:** concrete question answered with source evidence.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### P-04 · Runtime Performance Investigation (Play)
|
|
68
|
+
|
|
69
|
+
**When:** User reports lag, jank, slow click, slow scroll — on an already-open page.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
avalanche-arm → [user/harness interacts] → avalanche-status → avalanche-hot-sources → avalanche-commit-list → avalanche-commit-peek
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
1. `avalanche-arm <clientId> <origin>` — arm on live page, NO reload.
|
|
76
|
+
2. Ask user to perform the slow interaction (or replay via Playwright).
|
|
77
|
+
3. `avalanche-status <clientId>` — confirm commits captured.
|
|
78
|
+
4. `avalanche-hot-sources <clientId> 20` — quick triage.
|
|
79
|
+
5. `avalanche-commit-list <clientId> 15 collateral` — rank commits.
|
|
80
|
+
6. `avalanche-commit-peek <clientId> <commitId> stats,sources,atl 6 40` — inspect the peak commit.
|
|
81
|
+
7. If the selected route needs `renderedByCommit`, `isSelfSource`, `propChanges`, or `trasherCounts`, run `avalanche-recapture <clientId> full`, reproduce the identical interaction once, then repeat status → commit-list → `avalanche-commit-peek ... stats,sources,rendered`. Never request those fields from the initial default `sources` capture.
|
|
82
|
+
8. Classify: source / hotspot / collateral / mount / context wave.
|
|
83
|
+
9. Trace source via probe-owners or find-fibers.
|
|
84
|
+
10. Propose fix. Verify with fresh capture after edit.
|
|
85
|
+
|
|
86
|
+
**NEVER:** reload for runtime perf. Use `avalanche-arm` only.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### P-05 · Load Performance Investigation (Play)
|
|
91
|
+
|
|
92
|
+
**When:** User says "page is slow to load" / "initial paint is slow" / "first load takes too long".
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
reload-with-avalanche → avalanche-status → avalanche-hot-sources → avalanche-commit-list → avalanche-commit-peek
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
1. `reload-with-avalanche <clientId> <origin> 0 15000 5000` — arms, reloads, waits settle.
|
|
99
|
+
2. `avalanche-status <clientId>` — confirm integrationMode, commitCount.
|
|
100
|
+
3. `avalanche-hot-sources <clientId> 20` — top sources across load window.
|
|
101
|
+
4. `avalanche-commit-list <clientId> 15 collateral` — identify main wave.
|
|
102
|
+
5. `avalanche-commit-peek` — inspect before / during / after windows.
|
|
103
|
+
6. Classify per avalanche-detector reading rules (read broad → narrow).
|
|
104
|
+
7. Trace source. Propose fix. Re-run `reload-with-avalanche` to verify.
|
|
105
|
+
|
|
106
|
+
**NEVER:** use `reload-with-avalanche` for runtime/interaction perf.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### P-06 · Stability Render — Subtree Grade (Play)
|
|
111
|
+
|
|
112
|
+
**When:** "Does this component re-render when it shouldn't?" / after a fix, verify no regression / suspect unstable memo.
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
verify runtime → recapture full mode → schedule one fiber render → settle 1s → status + commit-list + commit-peek → classify
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
1. `health` → `pages` → `request-snapshot` (P-01).
|
|
119
|
+
2. `avalanche-recapture <clientId> full` — install a clean full-mode capture so `renderedByCommit` and `trasherCounts` are available.
|
|
120
|
+
3. Schedule exactly one target render:
|
|
121
|
+
- DOM/probe anchor: `eval-page <clientId> stability-nudge --testId <data-testid>` (or `--probeId`).
|
|
122
|
+
- current fiber token from `find-fibers`: `fiber-schedule-update <clientId> <fiberId>`.
|
|
123
|
+
4. `sleep 1` — settle.
|
|
124
|
+
5. `avalanche-status <clientId>` — read `commitCount` and confirm the capture is installed and active.
|
|
125
|
+
6. `avalanche-commit-list <clientId> 20 collateral` — enumerate every commit in this fresh nudge window and record its `commitId`.
|
|
126
|
+
7. For every listed commit: `avalanche-commit-peek <clientId> <commitId> stats,sources,rendered 3 50` — this is the mandatory source for `componentRenders`, collateral, `sourcesByCommit`, `renderedByCommit`, `propChanges`, and `trasherCounts`.
|
|
127
|
+
8. `avalanche-hot-sources <clientId> 12` — rank the source families after the bounded detail is present.
|
|
128
|
+
9. Classify using the verdict-to-signal table below. If no row matches, return to the real interaction capture and report a bounded result instead of forcing a verdict.
|
|
129
|
+
10. For leak: walk the top commit's collateral entries top → bottom → first collateral without memo or with defeated memo.
|
|
130
|
+
11. For trasher: find the same source with non-zero `trasherCounts` in at least two commit-peek results → trace the recorded hook via `avalanche-debug-hook <clientId> <sourceId> <hookIndex>`.
|
|
131
|
+
12. For unclear hook role: switch to P-07 (debug-hook).
|
|
132
|
+
13. If Observe classified the case as Complex and the proof packet would use `confidence: likely`, repeat steps 2–12 with the identical target, scheduling command, label, settle window, and read commands. The verdict and causal signature must repeat before Apply is eligible.
|
|
133
|
+
14. Build P-15. If the user requested a change and P-16 passes, apply one fix and run P-12 with the same nudge. Otherwise report the proof packet. Compare commitCount / renders / collateral / `trasherCounts` only after an authorized edit.
|
|
134
|
+
|
|
135
|
+
### P-06 verdict ↔ JSON signature
|
|
136
|
+
|
|
137
|
+
Maps the four verdicts to the exact Avalanche fields that produce them. Read `commit-peek include=stats,sources,rendered` after the nudge.
|
|
138
|
+
|
|
139
|
+
| Verdict | `commitCount` after nudge | `sourcesByCommit` pattern | `renderedByCommit` pattern | Next play |
|
|
140
|
+
|---|---|---|---|---|
|
|
141
|
+
| **clean** | 1 | nudged sourceId only (or empty) | nudged target only; every `trasherCounts` field is zero | None — invariant holds |
|
|
142
|
+
| **leak** | 1 | nudged sourceId only | high collateral count under target; `propChanges` empty on collateral entries (cascade from non-memoized children) | step 10 — find collateral without memo |
|
|
143
|
+
| **leak+cascade** | >1 | same sourceId repeats across commits | `isSelfSource: true` on the same sourceId; `propChanges` empty | P-07 on the self-source's hook |
|
|
144
|
+
| **trasher** | ≥2 | the same component source persists across commits | non-zero `trasherCounts` on that component in at least two commits | step 11 — `debug-hook` the recorded amplifier hook |
|
|
145
|
+
|
|
146
|
+
If `renderedByCommit` is empty: detector was armed with `detectionMode: 'sources'` or `'stats'`. Re-arm with `detectionMode: 'full'` before reading verdict signatures that require it.
|
|
147
|
+
|
|
148
|
+
Verdicts are mutually exclusive: persistent non-zero `trasherCounts` takes precedence. Without that signal, repeated self-source commits are `leak+cascade`; a different source alone is not a trasher.
|
|
149
|
+
|
|
150
|
+
**Anchor contract:** target one current composite fiber and schedule one extra render. No hook or prop is mutated. The extra commit and any render-time side effects or effects in that subtree are the pollution boundary.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### P-07 · Hook Interrogation (Procedure)
|
|
155
|
+
|
|
156
|
+
**When:** Avalanche or stability-render surfaced a `sourceId` + changed `hookIndex`. Hook role is unclear.
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
avalanche-recapture → reproduce trigger → avalanche-hot-sources → avalanche-debug-hook
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
1. Confirm `sourceId` and `hookIndex` from prior capture.
|
|
163
|
+
2. If fibers not retained: `avalanche-recapture <clientId>` → reproduce the original trigger → re-read hot-sources.
|
|
164
|
+
3. `avalanche-debug-hook <clientId> <sourceId> <hookIndex> 3`.
|
|
165
|
+
4. Read `target.primitive` first — routes to remediation branch entirely.
|
|
166
|
+
5. Read `target.value`, `parents`, `debugValues`, `neighborhood`.
|
|
167
|
+
6. Match to root-cause table (SyncExternalStore / State / Reducer / Memo / Callback / Effect / Context).
|
|
168
|
+
7. If existing labels are insufficient, open the known component source and match the primitive against hook call order and neighboring hooks. If it remains ambiguous, report the exact localization gap; do not edit source during Prove.
|
|
169
|
+
8. Name the evidence-backed remediation branch. Return to fixing-performance for fix-layer choice.
|
|
170
|
+
|
|
171
|
+
**NEVER:** use debug-hook to find a source from scratch (use avalanche-hot-sources for that).
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### P-08 · Context Wave Investigation (Procedure)
|
|
176
|
+
|
|
177
|
+
**When:** `contextUpdates` high in commit stats / "context is re-rendering too much".
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
avalanche-commit-list contextUpdates → commit-peek stats,sources,atl → find-context-providers → unique provider fiber → direct schedule-update
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
1. `avalanche-commit-list <clientId> 15 contextUpdates` — identify context-heavy commits.
|
|
184
|
+
2. `avalanche-commit-peek <clientId> <commitId> stats,sources,atl` — read contextUpdates field.
|
|
185
|
+
3. `eval-page <clientId> find-context-providers [--name regex]` — find provider fibers.
|
|
186
|
+
4. `eval-page <clientId> count-context-consumers --name <regex>` — blast radius.
|
|
187
|
+
5. Resolve a current provider fiber before entering P-06:
|
|
188
|
+
- use the provider sample's `name` and `source.fileName` with `find-fibers --name <exact-name> [--file <escaped-file>] --max 5`;
|
|
189
|
+
- require one match whose source and owner agree with the provider sample; narrow the name/file filters if several remain;
|
|
190
|
+
- if no unique current fiber can be established, report the targeting gap rather than nudging an ancestor;
|
|
191
|
+
- run P-06 with `fiber-schedule-update <clientId> <fiberId>` on that provider composite. Does its value identity churn when the provider itself re-renders?
|
|
192
|
+
6. If `SyncExternalStore`: use debug-hook (P-07) to check selector identity.
|
|
193
|
+
7. Build P-15. If the user requested a change and P-16 passes, choose the proven layer: memoize the provider value, split context, or narrow the selector. Then run P-12 with the same capture.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### P-09 · Large Capture — Paginated Analysis (Ceremony)
|
|
198
|
+
|
|
199
|
+
**When:** 100+ commits, multi-wave capture, shell output truncates.
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
avalanche-save → avalanche-offline summary → commit-list (multiple sort keys) → delegate ranges to subagents
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
1. `avalanche-save <clientId> .chippy-captures/run.json`.
|
|
206
|
+
2. `avalanche-offline .../run.json summary` — meta, total commits.
|
|
207
|
+
3. `avalanche-offline .../run.json commit-list 30 collateral` + `repeats` + `contextUpdates` — build timeline.
|
|
208
|
+
4. Identify waves by question: setup / main wave / continuation / noise.
|
|
209
|
+
5. Per wave: `avalanche-offline commit-peek` on selected commit ids — reduce to stats+sources+atl.
|
|
210
|
+
6. Delegate each range to a subagent with **one concrete pre-stated question**.
|
|
211
|
+
7. Collect compact findings. Join in main context. Rebuild crime scene: setup → main wave → noise.
|
|
212
|
+
8. Prefer one upstream fix over many local patches if multiple slices share one root.
|
|
213
|
+
|
|
214
|
+
**Rule:** No question = no subagent. No raw exports to subagents.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### P-10 · Source Trace — Fiber Path (Procedure)
|
|
219
|
+
|
|
220
|
+
**When:** Probe or find-fibers returned a fiber; need to trace where a value comes from without a live probe.
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
find-fibers → describe-component → inspect-fiber-structure → open file
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
1. `find-fibers <clientId> --name <ComponentName>` (or `--testid`, `--prop`, `--text`).
|
|
227
|
+
2. Run the [debug replay preflight](active-stimulus.md#debug-replay-preflight) for that exact fiber. If replay is unsafe or cannot be accepted, stay on fiber-only hook summaries/props/owners and report the ancestry limit.
|
|
228
|
+
3. For complex fiber (`hookCount > 50`): `describe-component <clientId> <fiberId>` — full hook tree.
|
|
229
|
+
4. `inspect-fiber-structure <clientId> <fiberId> <hookIndex> 3` — one hook + neighbors.
|
|
230
|
+
5. Open `source.fileName` at `lineNumber`. Read it.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### P-11 · Production / Minified Page (Ceremony)
|
|
235
|
+
|
|
236
|
+
**When:** Neither `_debugSource` nor a usable React 19 `_debugStack` source is available, and component names are minified.
|
|
237
|
+
|
|
238
|
+
1. Fall back to `data-testid`, `nearestTestId` on marker.
|
|
239
|
+
2. Use `componentStack` entries as owner chain; walk leaf → root.
|
|
240
|
+
3. Load `jira-taxonomy.md` for Jira-like wrappers; filter noise before ranking.
|
|
241
|
+
4. Use `probe-parents` for the `fiber.return` parent chain. Use `probe-owners` only when `_debugOwner` data is present; it may be empty in production.
|
|
242
|
+
5. Be explicit: "source precision is weaker; component name may be minified."
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
### P-12 · Edit & Verify Cycle (Ceremony)
|
|
247
|
+
|
|
248
|
+
**When:** After any code change.
|
|
249
|
+
|
|
250
|
+
1. Edit source in workspace.
|
|
251
|
+
2. Wait for HMR or trigger reload.
|
|
252
|
+
3. Run `pages` again and select the current page by URL, title, integration identity, and recency. Never carry the old `clientId` through HMR, navigation, or reload without re-resolving it. If Mode A reloaded, repeat its required runtime load and explicit detector install before measurement.
|
|
253
|
+
4. `request-snapshot <currentClientId>` — fresh state from the re-resolved page.
|
|
254
|
+
5. Re-establish every evidence identity in the current page realm:
|
|
255
|
+
- probe anchor: confirm the probe still resolves; reload may clear it, so re-place the same probe before continuing if necessary;
|
|
256
|
+
- fiber anchor: run `find-fibers` again and use the new current `fiberId`;
|
|
257
|
+
- Avalanche `sourceId + hookIndex`: start the required fresh capture, reproduce the trigger, and identify the source/hook again from the new commit evidence;
|
|
258
|
+
- test-id anchor: resolve it again through the current page before stimulation.
|
|
259
|
+
6. Re-run the same probe/avalanche/stability commands that diagnosed the issue, using only the refreshed identities.
|
|
260
|
+
7. Compare structured output (not screenshots).
|
|
261
|
+
8. Report: same signals improved? Residual signals? New signals?
|
|
262
|
+
|
|
263
|
+
**NEVER:** mark complete before the same measurement moved.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### P-13 · Automated Loop — Browser Harness (Play)
|
|
268
|
+
|
|
269
|
+
**When:** Task is repeatable, scripted, or runs in CI. No human driving browser.
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
open page → inject runtime → connect → install Avalanche → interact → read structured output → maybe Apply → verify
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
1. Install the devtools-hook shim with `addInitScript` before navigation, then navigate to the story or app URL.
|
|
276
|
+
2. Load the runtimes through one Mode A variant: packaged `installHelpers(..., { init: true })` before navigation, or post-navigation `inject.mjs` (preferred) / `inject.js` followed by `avalanche.iife.js`.
|
|
277
|
+
3. Confirm the page in `chippy.sh pages` — match by URL + dev client.
|
|
278
|
+
4. Run `avalanche-install <clientId>` before any Avalanche capture; runtime loading alone does not install the detector in Mode A.
|
|
279
|
+
5. For a post-install interaction capture, run `avalanche-clear <clientId>` and then trigger the interaction. Do not use helper origin-arming in Mode A. After reload, repeat the applicable runtime loading, client resolution, and detector install; boot commits before install remain unavailable.
|
|
280
|
+
6. Playwright performs the interaction.
|
|
281
|
+
7. Poll for stable state (interval 100–250ms, budget 5–15s).
|
|
282
|
+
8. Read structured output (probe, Avalanche, eval-page) and build P-15.
|
|
283
|
+
9. If the user requested a change and P-16 passes, edit source; otherwise stop with the proof packet.
|
|
284
|
+
10. After an edit, HMR or reload, repeat required injection/install steps, and verify with the same commands and timing window (P-12).
|
|
285
|
+
|
|
286
|
+
**Key rules:**
|
|
287
|
+
- devtools-hook shim must be `addInitScript` BEFORE `page.goto`.
|
|
288
|
+
- `inject.mjs` loads the Avalanche runtime; classic `inject.js` requires separate `avalanche.iife.js` injection.
|
|
289
|
+
- Mode A always requires `avalanche-install` before capture, whichever bootstrap loaded the runtime.
|
|
290
|
+
- Missing `__AVALANCHE__` = missing bundle injection, not a logic bug.
|
|
291
|
+
- `commitCount: 0` with `integrationMode: "none"` after a reproduced interaction = detector install was skipped or no post-install commit occurred.
|
|
292
|
+
- `window.__CHIPPY` + client in `pages` = connection success. `__chippyPageBridge` is NOT a top-level success signal.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
### P-14 · Essence Discovery (Observe + Define Play)
|
|
297
|
+
|
|
298
|
+
**When:** The task is vague, points at behavior, or asks "why" before a fix is requested.
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
runtime anchor → first signal → case definition → invariant → possible roles → proof plan
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
1. Identify the **anchor** from observation:
|
|
305
|
+
- visible element → probe id / nearestTestId / exact DOM text
|
|
306
|
+
- interaction → exact gesture + page state + first measured signal
|
|
307
|
+
- load issue → URL + reload window + first load signal
|
|
308
|
+
- component question → fiber name/testId/source from live tree
|
|
309
|
+
2. State the **observation** using the [observation contract](operating-model.md#observation-contract).
|
|
310
|
+
3. State the **case** in one sentence using the [case definition contract](operating-model.md#case-definition-contract).
|
|
311
|
+
4. Name the **invariant**:
|
|
312
|
+
- data invariant: displayed value should derive from X
|
|
313
|
+
- ownership invariant: prop should be created by Y, not presentation fallback
|
|
314
|
+
- render invariant: subtree should update once, not cascade
|
|
315
|
+
- identity invariant: provider/selector/memo should remain stable for equal data
|
|
316
|
+
- lifecycle invariant: effect should attach only when semantic dependency changes
|
|
317
|
+
5. Name plausible **roles** without choosing one yet:
|
|
318
|
+
- value source / forwarder / fallback / renderer
|
|
319
|
+
- update source / collateral / boundary / provider / store / mount
|
|
320
|
+
6. Select a proof plan:
|
|
321
|
+
- value/ownership → P-02
|
|
322
|
+
- component internals → P-03/P-10
|
|
323
|
+
- runtime perf → P-04
|
|
324
|
+
- load perf → P-05
|
|
325
|
+
- stability/identity → P-06
|
|
326
|
+
- hook primitive → P-07
|
|
327
|
+
- context/store → P-08
|
|
328
|
+
|
|
329
|
+
**Done when:** Chippy has observed the anchor and can say what essence is being investigated before naming cause.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
### P-15 · Proof Packet Assembly (Prove Ceremony)
|
|
334
|
+
|
|
335
|
+
**When:** Evidence has been gathered but the conclusion is not yet ready to apply.
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
normalize evidence → classify role → state confidence → name next gap
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
1. Gather the raw facts already observed:
|
|
342
|
+
- runtime: `pages`, snapshot, probe, avalanche status
|
|
343
|
+
- structure: owners, parents, hook tree, component stack
|
|
344
|
+
- source: file, line, render block, dep array, provider value, selector, key
|
|
345
|
+
- signal: prop value, hook primitive/value, commitStats, contextUpdates, hot source rank
|
|
346
|
+
2. Map facts to one role:
|
|
347
|
+
- **source** — initiates update or creates value
|
|
348
|
+
- **forwarder** — passes value but does not create it
|
|
349
|
+
- **boundary** — should have pruned but did not
|
|
350
|
+
- **collateral** — rendered due to upstream cause
|
|
351
|
+
- **provider/store** — broadcasts or subscribes broadly
|
|
352
|
+
- **mount/remount** — type/key/conditional tree replacement
|
|
353
|
+
- **unknown** — evidence insufficient
|
|
354
|
+
3. Assign confidence:
|
|
355
|
+
- `confirmed` — runtime + source agree, no unresolved hop
|
|
356
|
+
- `likely` — runtime + source align but one non-critical hop remains
|
|
357
|
+
- `partial` — only a segment is proven
|
|
358
|
+
4. Name exact next gap:
|
|
359
|
+
- missing owner hop, missing hook primitive, missing provider value diff, missing before/after capture, etc.
|
|
360
|
+
5. Apply the [per-domain confidence rule](operating-model.md#per-domain-confidence-rule). Clear and Complicated cases require `confirmed`; repeatable Complex experiments may use `likely`; `partial` never passes. If the current domain's threshold is not met, route to the next proof procedure.
|
|
361
|
+
|
|
362
|
+
**Done when:** conclusion is explicit and falsifiable.
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
### P-16 · Fix Gate (Apply Decision Ceremony)
|
|
367
|
+
|
|
368
|
+
**When:** User asks for a fix or a proof packet suggests an edit.
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
proof packet → apply gate → fix layer → verification command → edit plan
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
1. Check the Apply Gate from [operating-model](operating-model.md):
|
|
375
|
+
- Definition exists.
|
|
376
|
+
- Evidence exists.
|
|
377
|
+
- Fix layer exists.
|
|
378
|
+
- Verification command exists.
|
|
379
|
+
2. If any gate is missing: return to Prove, do not edit.
|
|
380
|
+
3. Choose fix layer:
|
|
381
|
+
- **Above source** — stop creating unstable value / narrow dependency / prevent trigger
|
|
382
|
+
- **At boundary** — memoize, split boundary, stabilize prop crossing
|
|
383
|
+
- **Below source** — consumer reads too broadly, selector too wide, effect semantic dep wrong
|
|
384
|
+
4. State edit intent in plain language:
|
|
385
|
+
- what changes
|
|
386
|
+
- why this layer is correct
|
|
387
|
+
- what signal should move after edit
|
|
388
|
+
5. Apply only if the user requested implementation or confirms.
|
|
389
|
+
6. Verify with P-12 using the same measurement.
|
|
390
|
+
|
|
391
|
+
**Done when:** edit is either authorized and verified, or explicitly deferred.
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
### P-17 · Unstable Dependency Chain Play
|
|
396
|
+
|
|
397
|
+
**When:** Avalanche/stability/debug-hook shows Memo/Callback/Effect churn, or the StabilityChain pattern appears.
|
|
398
|
+
|
|
399
|
+
```
|
|
400
|
+
observe churn → define lifecycle/identity invariant → trace dep boundary → find semantic dependency → maybe fix in order
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
1. Observe the bottom symptom first:
|
|
404
|
+
- effect re-attaches / cleanup runs repeatedly
|
|
405
|
+
- state dispatch follows effect
|
|
406
|
+
- hook primitive is Effect/LayoutEffect or State/Reducer
|
|
407
|
+
2. Define the invariant from that observation: effect/callback should depend on semantic data, not incidental object/function identity.
|
|
408
|
+
3. Trace one step upstream:
|
|
409
|
+
- effect depends on callback?
|
|
410
|
+
- callback depends on object/array/function?
|
|
411
|
+
- object created inline by parent?
|
|
412
|
+
4. Name the actual semantic dependency:
|
|
413
|
+
- e.g. `opts.mode`, not `opts`; `id`, not `item`; `query`, not `params` object.
|
|
414
|
+
5. Fix order:
|
|
415
|
+
1. Effect correctness first — prevent lifecycle re-fire on incidental identity.
|
|
416
|
+
2. Callback/memo stability second — prevent avoidable downstream identity flips.
|
|
417
|
+
3. Upstream object stabilization third — defense in depth.
|
|
418
|
+
6. Verify after each step with P-06 or P-12.
|
|
419
|
+
|
|
420
|
+
**Done when:** the invariant is restored and the same capture/nudge proves fewer waves or stable lifecycle.
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
### P-18 · Remount / Key / Tree Replacement Play
|
|
425
|
+
|
|
426
|
+
**Distinguishing legitimate remount from accidental:**
|
|
427
|
+
- legitimate: parent branch identity changed (route changed, key bound to a domain id that actually changed, conditional flip, modal opened)
|
|
428
|
+
- accidental: parent branch identity is stable but key or component type is not (literal `key={Math.random()}`, `key={Symbol()}`, inline component type re-created each render)
|
|
429
|
+
- look for these key forms specifically: `Math.random()`, `Symbol()`, `new <Class>()`, fresh object/array reference each render
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
**When:** Avalanche shows high mount work during interaction or a subtree loses state.
|
|
434
|
+
|
|
435
|
+
```
|
|
436
|
+
observe mount/reset signal → define persistence invariant → trace key/type/conditional boundary → apply only after boundary named
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
1. Observe mount/reset signal:
|
|
440
|
+
- `componentMountWorkCount` high
|
|
441
|
+
- repeated new fibers in commit window
|
|
442
|
+
- local state resets or effects attach as mount
|
|
443
|
+
2. Define invariant from observation: the subtree should persist across this interaction.
|
|
444
|
+
3. Trace boundary:
|
|
445
|
+
- probe/fiber parent chain
|
|
446
|
+
- inspect keys on repeated list items
|
|
447
|
+
- inspect conditional branches that replace component type
|
|
448
|
+
- inspect route/layout wrapper changes
|
|
449
|
+
4. Classify:
|
|
450
|
+
- unstable key
|
|
451
|
+
- component type created inline
|
|
452
|
+
- conditional tree replacement
|
|
453
|
+
- legitimate mount (data/page actually changed)
|
|
454
|
+
5. Apply gate:
|
|
455
|
+
- fix only after exact boundary and source line are named.
|
|
456
|
+
|
|
457
|
+
**Done when:** mount cause is confirmed or declared legitimate.
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
### P-19 · Store Selector Essence Play
|
|
462
|
+
|
|
463
|
+
**When:** `SyncExternalStore`, Redux/Relay/SweetState container, or store restart signal appears.
|
|
464
|
+
|
|
465
|
+
```
|
|
466
|
+
observe consumed data → define subscription invariant → prove subscribed data → compare width → maybe narrow or stabilize selector
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
1. Observe consumed data:
|
|
470
|
+
- `probe-dom` + source read: what fields are rendered?
|
|
471
|
+
- `probe-props` / hook output: what values enter the component?
|
|
472
|
+
2. Define invariant from observation: consumer should subscribe only to data it renders or semantically needs.
|
|
473
|
+
3. Prove subscribed data:
|
|
474
|
+
- `avalanche-debug-hook` target primitive `SyncExternalStore`
|
|
475
|
+
- `target.value` and debugValues if present
|
|
476
|
+
- container/source from `jira-taxonomy` if Jira page
|
|
477
|
+
4. Compare width:
|
|
478
|
+
- subscribed object wider than consumed fields → over-broad selector
|
|
479
|
+
- selector returns new object/array equal by value → identity churn
|
|
480
|
+
- store writes unrelated fields frequently → store mutation rate issue
|
|
481
|
+
5. Apply gate:
|
|
482
|
+
- narrow selector, return primitives, memoize selector output, or split store only after consumed vs subscribed data is proven.
|
|
483
|
+
6. Verify with same capture/nudge: fewer store restarts/collateral, same visible output.
|
|
484
|
+
|
|
485
|
+
**Done when:** consumed fields and subscribed fields are both named.
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
### P-20 · Noise Reduction Maneuver (Play)
|
|
490
|
+
|
|
491
|
+
**When:** unrelated work hides the target signal and Chippy needs a narrower branch to measure.
|
|
492
|
+
|
|
493
|
+
```
|
|
494
|
+
observe target + unrelated branch → define target invariant → prune or shallow unrelated branch → repeat same measurement → read clearer signal → return to real fix
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
1. Observe both sides first:
|
|
498
|
+
- name the **target branch** that must remain measurable
|
|
499
|
+
- name the **unrelated branch** creating noise
|
|
500
|
+
- prove the same capture currently mixes both signals
|
|
501
|
+
2. Define the invariant:
|
|
502
|
+
- what target behavior must still be visible after the maneuver?
|
|
503
|
+
- what measurement will be repeated unchanged?
|
|
504
|
+
3. Pick the smallest safe cut:
|
|
505
|
+
- **prune** an unrelated sibling branch entirely
|
|
506
|
+
- **shallow** rendering below a named component with an early return / placeholder
|
|
507
|
+
- prefer Storybook or local fixtures over a living product page
|
|
508
|
+
4. If the user authorized diagnostic source mutation, build P-15 and pass P-16 before editing. Otherwise move the target to a cleaner harness. For an authorized temporary edit:
|
|
509
|
+
- comment out branch
|
|
510
|
+
- add early return
|
|
511
|
+
- keep the target branch intact
|
|
512
|
+
|
|
513
|
+
Concrete maneuver examples:
|
|
514
|
+
- prune right-nav/sidebar so content branch can be measured alone
|
|
515
|
+
- early-return `null` from a sibling panel that keeps re-rendering on the same interaction
|
|
516
|
+
- shallow below a named component by returning a placeholder instead of the full subtree
|
|
517
|
+
- move the target into Storybook/local harness first if the living app mixes too many unrelated branches
|
|
518
|
+
5. Re-run the **same** measurement:
|
|
519
|
+
- same interaction or same stability-render nudge
|
|
520
|
+
- same capture window and same comparison fields
|
|
521
|
+
6. Read the reduced tree:
|
|
522
|
+
- target signal clearer or smaller
|
|
523
|
+
- unrelated branch work materially reduced
|
|
524
|
+
7. Return to the real fix:
|
|
525
|
+
- revert the maneuver or replace it with the actual source/boundary fix
|
|
526
|
+
|
|
527
|
+
The temporary cut and its reversion are both source changes. Keep the exact diff and reversion plan in the proof packet.
|
|
528
|
+
|
|
529
|
+
Outputs:
|
|
530
|
+
- target branch name
|
|
531
|
+
- pruned/shallowed branch name
|
|
532
|
+
- exact temporary edit location
|
|
533
|
+
- before/after signal comparison
|
|
534
|
+
- next real fix layer
|
|
535
|
+
|
|
536
|
+
**Anchor contract:**
|
|
537
|
+
- target branch must remain measurable in the same capture after the cut
|
|
538
|
+
- cuts can only **prune** or **shallow** siblings, cousins, or descendants of the target
|
|
539
|
+
- ancestors cannot be pruned in the same tree — they hold the target; removing them removes the target
|
|
540
|
+
- if the only available noise is in an ancestor, this is no longer a noise-reduction maneuver in the same tree; it is a **change of harness** (move the target into Storybook or a local fixture — see R-03A)
|
|
541
|
+
- same capture must show target and unrelated work mixed before doing the maneuver
|
|
542
|
+
|
|
543
|
+
**Done when:** the maneuver reveals a cleaner target signal without changing the target invariant.
|
|
544
|
+
|
|
545
|
+
---
|