Skip to content

xpd time-series

Use xpd time-series to examine time series and decide how to group them before fitting a model. The bare command lists findings and a checklist for each measured series and group. Without measured series, the checklist asks about the scorer and exogenous drivers for the pipeline. Use --format json for finding IDs and measurements, or --since <commit> to compare finding counts. With --since HEAD and no tracked edits, the comparison uses the parent of HEAD so the most recent fix is visible.

Terminal window
xpd time-series [OPTIONS] [PATHS]...
xpd time-series <COMMAND>
Subcommand What it does
xpd time-series start Start a run: record the commit it starts from, the paths, line count, checks and optional benchmark of the project
xpd time-series plan Record the plan of a round: the fixes in order, and the findings that are right as they are
xpd time-series approve Record that the user said yes to a fix that changes what callers or users see
xpd time-series gate Gate a fix that is committed: run the checks, time --bench when set, count lines and compare the findings with the commit before it. Exit 1 when the fix is not kept
xpd time-series drop Record that a fix was given up, after its files were restored
xpd time-series status Print the run and the stage that comes next
xpd time-series finish End the run: compare findings, line count and benchmark timing with the start commit. Exit 1 while a fix is open or a new finding has no reason
Argument What it does
<PATHS>... Files or directories (directories respect .gitignore)
Option Default What it does
--kind <KIND> List only the findings of these kinds, separated by commas. Repeatable. Values: analytic-forecast-horizon, arch-ignored-argument, arch-rejected-number, arch-unknown-option, arch-unseeded-draws, fit-output-in-loop, forecast-per-origin, opt-bandwidth-as-bandwidth, reindex-is-default, removed-in-arch, rescaled-units, results-before-compute, unscaled-returns, intervals-without-calibration, mase-without-train-df, random-time-split, mape-on-intermittent, fitted-values-without-fitted, mintrace-without-insample, indptr-missing-zero, ungrouped-lag, gap-unsafe-lag, missing-future-exog, removed-tsa-arguments, deprecated-var-seed, time-before-entity-index, panel-ols-without-effects, panel-default-covariance, clustered-without-clusters, cov-option-without-cov-type, too-many-effects, not-a-time-series, incoherent-group, dtw-conflicting-constraints, dtw-mismatched-constraint, soft-dtw-negative-gamma, kmeans-unseeded-random-state, kmeans-metric-params-mismatch, dbscan-unnormalized-softdtw, scaler-inverse-per-timeseries, imputer-constant-missing-value.
--limit <LIMIT> 20 The most findings to list of each kind, strongest first. 0 lists every finding.
--since <COMMIT> Count the findings at this commit too, and print each count beside the count of today.
--group-by <GROUP_BY> none Group findings and checklist items by owning module or shared cause. Values: none (Keep the default flat per-kind listing), module (Group findings and checklist items by owning module path), cause (Group related findings by shared kind and anchor files).
--packet <N> Emit one 1-indexed deterministic context-budgeted review packet for the Nth cluster.
--budget-lines <LINES> 300 Maximum source lines included across excerpts inside a --packet view.
--all-modules Include checklist review items for every surveyed module, not only modules with findings.
--format <FORMAT> Output format. Default: text on a terminal, json otherwise. Values: text, json.
--adapter <ADAPTER> A Python adapter file or a shell command that emits time series facts.
--questions Print the facts and questions catalog without scanning files.

Pass --adapter series.py when a Python file has a series() function returning a pandas or Polars frame, a path to CSV, TSV, JSON or Parquet, or a dictionary of columns. Supply unique_id, ds, y, and any metadata used to describe groups. Use {"data": frame, "periods": {"store-a": [7, 365]}, "hierarchy": {"total": ["store-a", "store-b"]}} to declare periods in cadence steps and parent relationships. The project's Python needs NumPy, pandas, statsmodels and scikit-learn. Parquet also needs a reader such as PyArrow.

A command adapter prints the same JSON as the Python runner. Its series array has one object per unique_id with a boolean is_time_series, and it can supply groups and clusters arrays. The bare list reports adapter errors alongside static findings. A recorded run requires its adapter to succeed.

Stage Command
Start xpd time-series start <paths> --check "<command>" --adapter series.py
List xpd time-series <paths> --adapter series.py --format json
Plan xpd time-series plan plan.json
Approve an interface change xpd time-series approve <fix-id>
Gate a committed fix xpd time-series gate <fix-id>
Drop an abandoned fix xpd time-series drop <fix-id> --reason "<reason>"
Resume xpd time-series status
Finish xpd time-series finish

The journal lives in .git/xpd-time-series.json, or in .git/xpd-ledger.sqlite in durable mode. Finish refuses an open fix, an unexplained new finding, or an unanswered item. A claim with fewer than two observed cycles needs an na answer explaining which claim was dropped.

Terminal window
$ xpd time-series --questions --format json | jq -c '{facts: (.facts | length), questions: (.questions | length)}'
{"facts":14,"questions":12}
Code Meaning
0 The list or recorded stage succeeded.
1 A gate rejected the fix, or finish found an open fix or unresolved checklist items or findings.
2 The stage could not run, for example because its adapter failed.