@oqtopus-team/pi-qdash 0.1.3 → 0.1.5

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.
@@ -15,15 +15,16 @@ Use the pi-qdash tools instead of scraping the UI or hand-writing auth headers.
15
15
  - `qdash_get_chip_metrics`, `qdash_list_chip_qubits`, `qdash_list_chip_couplings`
16
16
  - `qdash_list_cryostats`, `qdash_list_cooldowns`
17
17
  - `qdash_get_cooldown_wiring`, `qdash_wiring_insights`, `qdash_list_cooldown_wiring_events`
18
- - `qdash_get_timeseries`, `qdash_plot_timeseries`
18
+ - `qdash_get_timeseries`, `qdash_plot_timeseries`, `qdash_inspect_timeseries_csv`, `qdash_compare_timeseries`
19
19
  - `qdash_list_task_results`, `qdash_get_task_result`
20
20
  - `qdash_list_issues`
21
21
  - `qdash_list_flows`, `qdash_get_flow`
22
22
  - `qdash_list_executions`, `qdash_get_execution`
23
23
  - `qdash_list_ai_reviews`, `qdash_get_provenance_stats`
24
24
  - `qdash_list_forum_posts`, `qdash_get_forum_post`, `qdash_list_forum_replies`
25
- - `qdash_get_figure`, `qdash_get_task_figures`, `qdash_recent_calibration_figure`, `qdash_analyze_figure_json`
25
+ - `qdash_get_figure`, `qdash_get_task_figures`, `qdash_recent_calibration_figure`, `qdash_analyze_figure_json`, `qdash_build_qcal_evidence`
26
26
  - `qdash_create_forum_evidence_reply` for confirmed evidence curation replies with visible task figures
27
+ - `qdash_preview_forum_image_reply`, then `qdash_create_forum_image_reply` for confirmed uploads of locally generated analysis images
27
28
  3. Use harness overview tools for status and triage:
28
29
  - `qdash_investigate` for natural-language requests to investigate or compare recent calibration, target history, figures, failures, issues, and Forum context
29
30
  - `qdash_compare_calibration` for read-only before/after comparison of repeated target calibration results
@@ -64,6 +65,8 @@ Use these commands to make pi behave like a QDash-specific harness with persiste
64
65
  /qdash-use-chip [chip_id]
65
66
  /qdash-use-target qid <qid> | coupling <coupling_id>
66
67
  /qdash-use-agent-session <session_id>
68
+ /qdash-investigation-setup [json]
69
+ /qdash-clear-investigation
67
70
  /qdash-context
68
71
  /qdash-dashboard [limit]
69
72
  /qdash-wiring-insights
@@ -73,6 +76,29 @@ Use these commands to make pi behave like a QDash-specific harness with persiste
73
76
 
74
77
  Prefer the current context when the user has already selected a profile/chip/session. Tools use that context when parameters are omitted.
75
78
 
79
+ ## Generic timeseries comparison
80
+
81
+ Use `qdash_compare_timeseries` when the investigation needs to align multiple
82
+ QDash metrics/targets, local CSV sensor logs, or both. For repeated calls, use
83
+ `/qdash-investigation-setup` to store the arbitrary series mappings, window,
84
+ timezone, and transform defaults; explicit tool arguments override the preset.
85
+ Do not assume a specific
86
+ CSV layout, metric name, target, unit, timestamp format, or timezone:
87
+
88
+ 1. Inspect unknown CSV headers, numeric coverage, and optional time cadence with
89
+ `qdash_inspect_timeseries_csv` first.
90
+ 2. Supply `timeColumn`, one or more `valueColumns`, and optional exact-match
91
+ `filters`; use `scale`/`offset` only for explicit unit conversion.
92
+ 3. For timestamps without a zone, require an explicit
93
+ `timezoneOffsetMinutes` (JST is `540`) rather than relying on the host clock.
94
+ 4. Start with raw/no-transform comparison, then state any smoothing,
95
+ interpolation, detrending, normalization, and period-search settings.
96
+ 5. Report overlap duration, source point counts, aligned point count, number of
97
+ observed cycles, correlations, phases, and explained fractions together.
98
+ 6. Treat correlation and shared periodicity as evidence of association. Do not
99
+ claim direct causality without intervention, longer observation, or evidence
100
+ that excludes a common driver.
101
+
76
102
  For cryostat wiring requests, start with `qdash_get_cooldown_wiring`. Pass `cooldownId` when the user names one; otherwise pass `cryoId`, or omit both to resolve the active/newest cooldown from the current/default chip. Prefer the compact `wiring.markdown`; request raw blocks only when structural or embedded BlockNote data is necessary, and request history when investigating wiring changes. Set `includeInsights` or call `qdash_wiring_insights` when the user asks what is characteristic, unusual, or worth checking in attenuation; summarize control/readout totals and affected qubits/MUXes instead of dumping the raw table.
77
103
 
78
104
  ## Configuration
@@ -94,10 +120,11 @@ When the user wants to preserve an investigated observation in QDash forum/notes
94
120
  2. Summarize the observation as evidence, not as an automatic calibration decision.
95
121
  3. Prefer replying to an existing target/coupling forum thread when one exists.
96
122
  4. Use `qdash_create_forum_evidence_reply` for task-result evidence so figures are embedded as QDash UI image blocks (`/api/executions/figure?path=...`) and visible in the forum.
97
- 5. Include task and execution QDash Web URLs in the reply.
98
- 6. When mentioning history or trends, include links to representative historical task results.
99
- 7. Mark agent-authored evidence with a footer such as `— 🤖 by pi-qdash`.
100
- 8. Ask for confirmation before creating/updating the forum post.
123
+ 5. For locally generated analysis images, call `qdash_preview_forum_image_reply` first, show the exact paths and reply text, then use `qdash_create_forum_image_reply` only after explicit confirmation. Supported images are PNG, JPEG, GIF, and WebP up to 5 MB each.
124
+ 6. Include task and execution QDash Web URLs in the reply when applicable.
125
+ 7. When mentioning history or trends, include links to representative historical task results.
126
+ 8. Mark agent-authored evidence with a footer such as `— 🤖 by pi-qdash`.
127
+ 9. Ask for confirmation before uploading images or creating/updating the forum post.
101
128
 
102
129
  ## Safety
103
130
 
@@ -108,4 +135,5 @@ When the user wants to preserve an investigated observation in QDash forum/notes
108
135
  - Use `qdash_compare_calibration` when the user asks what changed between recent calibration experiments; treat differences as evidence, not automatic approval to commit/apply parameters.
109
136
  - Use `qdash_recent_calibration_figure` when the user asks to see recent experiment images without a task ID.
110
137
  - Use `qdash_analyze_figure_json` for read-only numeric summaries of Plotly JSON calibration figures; keep domain-specific interpretation in the matching skill.
138
+ - Use `qdash_build_qcal_evidence` when the user wants to evaluate a QDash calibration task with pi-qcal. It only converts QDash data into provider-neutral `CalibrationEvidence`; pass `details.evidence` to `qcal_evaluate_bundle` for the actual evaluation.
111
139
  - Prefer summarizing large responses with counts, IDs, time ranges, and notable values.
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: qdash-timeseries-diagnosis
3
+ description: Diagnose common-mode drift, shared periodicity, phase relationships, and possible environmental coupling across arbitrary QDash metrics and external sensor CSV logs. Use when calibration metrics oscillate, drift together, appear delayed or anti-correlated, or may be influenced by cryostat/environmental cycles.
4
+ ---
5
+
6
+ # QDash Timeseries Diagnosis
7
+
8
+ Use this skill for evidence-based multi-timeseries investigation. Keep the
9
+ measurement schema and physical interpretation separate: the comparison tool
10
+ extracts mechanical evidence, while this skill guides conclusions and next
11
+ checks.
12
+
13
+ ## Principles
14
+
15
+ - Do not hard-code metric names, targets, sensors, units, CSV columns, periods,
16
+ or timezone assumptions.
17
+ - Preserve both raw and transformed results. A visually clean transformed plot
18
+ must not replace the raw evidence.
19
+ - Correlation, shared periodicity, and phase alignment establish association,
20
+ not causal direction.
21
+ - Consider a shared driver when multiple targets and an environmental sensor
22
+ move together. The sensor itself may be a proxy for an unmeasured actuator,
23
+ vibration, electrical noise, magnetic noise, or control cycle.
24
+ - Count observed cycles, not raw sample points, when judging periodic evidence.
25
+
26
+ ## Workflow
27
+
28
+ ### 1. Fix the investigation scope
29
+
30
+ Record the reusable scope with `/qdash-investigation-setup` when multiple
31
+ comparison passes are expected. The JSON context accepts arbitrary QDash
32
+ series, CSV mappings, window/timezone, and transform defaults. Record:
33
+
34
+ - QDash profile and chip
35
+ - metrics and target IDs
36
+ - tags
37
+ - start/end timestamps
38
+ - timezone for every source
39
+ - expected cadence and units
40
+ - local CSV path, time column, value columns, and any row filters
41
+
42
+ For timestamps without an explicit zone, require a declared offset. Never infer
43
+ a timezone from the host machine.
44
+
45
+ ### 2. Inspect source integrity
46
+
47
+ Before comparing, use `qdash_inspect_timeseries_csv` for local files whose
48
+ schema or time encoding is not already established. Then:
49
+
50
+ - verify first/last timestamps and overlap
51
+ - check source point counts and cadence
52
+ - identify duplicate timestamps, missing intervals, and long gaps
53
+ - verify scale and offset conversions
54
+ - ensure labels are unique
55
+
56
+ Do not bridge long outages. Set `maxInterpolationGapMinutes` explicitly when the
57
+ default is unsuitable for the slowest source.
58
+
59
+ ### 3. Establish a raw baseline
60
+
61
+ Call `qdash_compare_timeseries` first with:
62
+
63
+ - no smoothing
64
+ - no detrending
65
+ - no normalization
66
+ - no period search unless a period was specified independently
67
+
68
+ Report ranges, units, overlap, and raw correlation. Different units are fine for
69
+ correlation, but do not visually overlay incomparable scales without separate
70
+ axes or normalization.
71
+
72
+ ### 4. Compare oscillatory components
73
+
74
+ When looking for common cycles, rerun with explicit settings such as:
75
+
76
+ - a smoothing window justified by source cadence
77
+ - `detrend: linear` when slow drift would dominate
78
+ - `normalize: zscore` for shape/phase comparison
79
+ - a period-search range chosen from prior evidence or a broad physically
80
+ plausible interval
81
+
82
+ Report all transform settings with the result. Compare:
83
+
84
+ - full transformed correlation
85
+ - selected shared period
86
+ - per-series periodic explained fraction
87
+ - pairwise phase differences
88
+ - observed cycle count
89
+
90
+ A near-0° phase difference indicates in-phase periodic components. A near-180°
91
+ difference indicates anti-phase components. Intermediate phase may represent a
92
+ delay, but phase alone does not identify response direction.
93
+
94
+ ### 5. Grade the evidence conservatively
95
+
96
+ Use qualitative language:
97
+
98
+ - **weak**: unstable period/phase, low explained fraction, or fewer than about
99
+ three observed cycles
100
+ - **suggestive**: similar periods with plausible phase but short observation or
101
+ substantial residual variation
102
+ - **strong association**: repeated common period and stable phase across
103
+ multiple targets/sensors, with substantial explained fractions
104
+ - **causal evidence**: requires intervention, independently controlled input,
105
+ repeated response, or evidence excluding plausible shared drivers
106
+
107
+ These are reasoning categories, not fixed acceptance thresholds. Explain which
108
+ facts support the chosen category.
109
+
110
+ ### 6. Test alternatives
111
+
112
+ For apparent environmental or cryostat coupling, distinguish:
113
+
114
+ 1. the measured sensor variable directly affecting the metric
115
+ 2. a controller/refrigerator cycle affecting both
116
+ 3. periodic measurement or scheduling artifacts
117
+ 4. timestamp offset or resampling artifacts
118
+ 5. target-local behavior coincidentally near the same frequency
119
+
120
+ Check additional targets in different control/readout groups and, when
121
+ available, actuator state, compressor/pulse-tube, vibration, rack temperature,
122
+ magnetic field, pressure, and control-system logs.
123
+
124
+ ### 7. Recommend discriminating measurements
125
+
126
+ Prefer measurements that separate hypotheses:
127
+
128
+ - extend observation to cover at least 8–10 candidate cycles
129
+ - preserve the same cadence and synchronized clocks
130
+ - record actuator/controller state in addition to sensor output
131
+ - test multiple targets and control/readout groups
132
+ - perform a safe controlled setpoint or operating-state change when authorized
133
+ - compare lag/phase stability across independent runs
134
+
135
+ Do not initiate operational changes without an explicit plan and user
136
+ confirmation.
137
+
138
+ ## Reporting template
139
+
140
+ Include:
141
+
142
+ 1. sources and exact time window
143
+ 2. timezone and unit conversions
144
+ 3. raw-data integrity and overlap
145
+ 4. transformation settings
146
+ 5. raw/transformed correlations
147
+ 6. shared period, phase, explained fraction, and observed cycles
148
+ 7. strongest association statement
149
+ 8. causal alternatives still open
150
+ 9. next measurement that best discriminates those alternatives