ephemeris-cli 0.0.0-stage → 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.
package/README.md CHANGED
@@ -1,3 +1,181 @@
1
- # Temporary Holding Version
1
+ # Ephemeris CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Prepare numeric data, obtain a forecast, describe it deterministically, and plot the saved result through one Ephemeris interface. Node.js 22+; no Python, Gnomon installation, skill pack, browser, or plotting application required. PNG export uses the packaged @resvg/resvg-js renderer and bundled DejaVu Sans font; npm installs the platform dependency. SVG export remains pure JavaScript.
4
+
5
+ Version 0.4.0 is maintained in the dedicated Ephemeris CLI repository. It is not published to npm. Tests and demonstrations use synthetic local services; no live forecasting quality is established.
6
+
7
+ ## Install and discover
8
+
9
+ ```bash
10
+ # From this repository:
11
+ npm install --global .
12
+ ephemeris --help
13
+ ephemeris forecast --help
14
+ ephemeris forecast run --help
15
+ ephemeris schema forecast
16
+
17
+ # Alternatively, without installing:
18
+ node bin/ephemeris.js --help
19
+ ```
20
+
21
+ Every executable command has an offline operating guide: purpose, input semantics, examples, output meaning, effects, recovery, and interpretation limits. [The reference](docs/cli-reference.md) is generated from those same definitions. Help instructs agents to ask for missing units, business definitions, and assumptions, and to preserve unknowns rather than guess.
22
+
23
+ ## Inspect real data explicitly
24
+
25
+ ```bash
26
+ ephemeris data inspect --input sales.csv \
27
+ --time-column date --value-column sales --frequency D \
28
+ --unit units --measurement period_total --timezone UTC \
29
+ --target-description 'Observed sales' --output inspected.json
30
+ ```
31
+
32
+ Supported inputs: CSV/TSV with headers, JSON arrays of row objects, and JSONL. Choose columns explicitly. Optional `--series-column` groups independent series. Source order is retained. Inputs are bounded to 8 MiB and 100,000 rows.
33
+
34
+ The snapshot includes selected history and original timestamp strings, source/content hashes, supplied metadata, coverage, frequency evidence, missing periods, duplicates, invalid/missing values, and zeros. Inspect `series[].report.ready_for_forecast`; inspection success alone does not establish readiness or model suitability. Nothing is sorted, filled, resampled, deduplicated, or repaired. Fix the original source explicitly and inspect again.
35
+
36
+ Supported local time grids are whole-second subdaily, daily, weekly, and month-start. Unknown/unsupported calendars are reported as unverified. Datetimes must be ISO; date-only input remains date-only. Named-zone calendar forecasts may use sampling steps if reliable future dates cannot be projected. Explicit future timestamps can be supplied with raw request context and must continue the validated history grid. Missing timestamps mean unknown coverage/missing periods, not zero missing periods.
37
+
38
+ Supplied units, timezone, target description, and measurement semantics are preserved. `period_total`, `period_average`, and `point_in_time` are distinct. Observed sales are not necessarily underlying demand. Zero observations do not establish stockouts, lost demand, or causal explanations.
39
+
40
+ ## Prepare, then submit
41
+
42
+ ```bash
43
+ # No credentials, inference, or network access:
44
+ ephemeris forecast run --input inspected.json \
45
+ --horizon 7 --quantiles 0.1,0.5,0.9 \
46
+ --dry-run --output prepared.json
47
+ ```
48
+
49
+ For multi-series snapshots, choose `--series ID`. `--mode`, `--model`, `--horizon`, `--quantiles`, and `--context-len` override corresponding request fields. Snapshot mode defaults to route; raw API JSON requires mode. The API defaults horizon to 64 and context_len to 256. Horizon counts sampling steps, not necessarily calendar days. Use live `models list` for deployment-specific limits and capabilities.
50
+
51
+ Set `EPHEMERIS_API_KEY` using your secret manager or environment. For an interactive Bash session:
52
+
53
+ ```bash
54
+ read -rsp 'Ephemeris API key: ' EPHEMERIS_API_KEY
55
+ export EPHEMERIS_API_KEY
56
+ ephemeris auth status --verify
57
+ ephemeris models list
58
+
59
+ # This operation submits paid inference:
60
+ ephemeris forecast run --input prepared.json \
61
+ --idempotency-key sales-run-001 --output forecast.json
62
+ ```
63
+
64
+ Create a key in the [Ephemeris dashboard](https://ephemeris.cascade.industries/dashboard/api-keys). Keys are never accepted as CLI arguments or stored in artifacts. API credentials require HTTPS except on loopback development endpoints. `--base-url`/`EPHEMERIS_BASE_URL` chooses an origin, without `/api/v1`; redirects are not followed.
65
+
66
+ Raw public API requests also work. They differ from raw Paracast:
67
+
68
+ ```json
69
+ {
70
+ "mode": "route",
71
+ "series": [{"values": [100,101,99,103,104,102,105,107], "freq": "H"}],
72
+ "horizon": 24,
73
+ "quantiles": [0.1,0.5,0.9]
74
+ }
75
+ ```
76
+
77
+ Use `--input -` for stdin. `--context context.json` supplies local per-series timestamps, units, measurement semantics, identifiers, target descriptions, future-input roles, and scenario assumptions; it is never sent to the API. Narrative assumptions do not change the numeric forecast. See `forecast run --help` for the complete context contract. Frozen snapshots/prepared requests already fix their context and reject a second context file.
78
+
79
+ The CLI deliberately rejects unknown request fields so local metadata cannot accidentally be sent to the service. Covariates are numeric API inputs: past channels align with history; future channels match horizon and require named past histories. `context.series[].future_covariate_roles` distinguishes `known_future`, `scenario_assumption`, and `unspecified`. Labels are caller assertions, not independently verified availability.
80
+
81
+ ## Reuse the saved artifact
82
+
83
+ ```bash
84
+ ephemeris forecast describe --input forecast.json --output description.json
85
+ ephemeris forecast plot --input forecast.json --output forecast.png
86
+ # Scalable export, with every submitted observation visible:
87
+ ephemeris forecast plot --input forecast.json --output forecast.svg --history all
88
+ ```
89
+
90
+ Both commands are offline and deterministic. Missing labels do not require paid inference: copy the artifact to a new file, correct only caller-supplied local context metadata, keep the request/response unchanged, and rerun describe/plot. Timestamps still have to pass the grid checks; there is no separate annotation command. They do not run inference or change the saved artifact. For multi-series/multivariate results choose `--series-index` and `--variate-index` explicitly.
91
+
92
+ The forecast artifact is versioned and contains the exact submitted request, complete submitted history, request hash, response, billing, request IDs, retry key, local context, and derived time axis. It discloses that service/model context caps may truncate the history actually used. Treat artifacts as data-bearing files. [Artifact contracts and Gnomon ownership](docs/contracts-and-ownership.md) describe the boundaries.
93
+
94
+ Description reports saved billing amounts in millicredits and exact decimal credits: 1000 mc = 1 credit, so 100 mc is 0.1 credits. This is not a current balance check. Missing future inputs mean not supplied, not assumed zero or no future events. A forecast jump or constant-width band alone does not demonstrate forecast quality.
95
+
96
+ Description names the last observed value as its comparison baseline and documents every calculation. Missing medians are not interpolated; horizon-wide aggregates remain null when incomplete. A sum of marginal medians is available only for declared period totals and is explicitly not a cumulative-distribution median or interval. Observed statistics use all submitted history.
97
+
98
+ PNG and SVG plots include observed history, a forecast boundary, marginal median, and labeled quantile bands. Missing values break lines; crossed/missing bands are omitted and counted. Dates are used only when grounded in a supported grid; otherwise the x-axis is sampling steps. No external assets or scripts are embedded. The default view shows the most recent max(24, 2*horizon) observations, capped by available history, so long histories do not squeeze the forecast into a few pixels. The chart discloses shown/total counts; full history remains in the artifact. Use --history N or --history all to change only the view. --format png|svg can select output explicitly; filename extensions must match. With no extension or stdout, SVG remains the default; PNG stdout is binary and requires a pipe.
99
+
100
+ Quantile bands do not establish calibrated coverage or accuracy. Marginal quantiles alone cannot provide cumulative-total uncertainty, path-dependent probabilities, or actual-peak distributions. Neither description nor plotting invents causes, confidence estimates, trading decisions, or inventory recommendations.
101
+
102
+ ## Recovery and persistence
103
+
104
+ Every operation is explicit. Only `forecast run` submits inference. Model/account discovery reads the existing public API. There is no unsupported feedback endpoint, background scheduling, actual ingestion, or local tracking engine.
105
+
106
+ A private `ephemeris.submission` v1 receipt is saved and synced to disk **before submission**, and its path and retry key are printed to stderr. For `--output forecast.json`, the default is `forecast.json.submission.json`; stdout submissions use `.ephemeris/submissions/<uuid>.json` in the current directory. `--receipt NEW_PATH` selects another path. A receipt write failure prevents the paid call. The receipt preserves the exact prepared request, full history/local context, origin, request hash, and key without credentials. Keep it private; it remains after success or failure and is never overwritten. Its `completion_unknown` status is not evidence that the server completed or even received the request. Archive/delete receipts explicitly when no longer needed. After a timeout/interruption, the outcome may be unknown. Use `--resume` to recover from the receipt even if you lose stderr or edit the original input. It reuses the original origin, request, and key; generating a fresh key can create a second paid forecast. The CLI never automatically retries. Server idempotency retention rules remain authoritative.
107
+
108
+ ```bash
109
+ ephemeris forecast run --resume forecast.json.submission.json --output recovered.json
110
+ # Offline inspection before recovery:
111
+ ephemeris forecast run --resume forecast.json.submission.json --dry-run
112
+ ```
113
+
114
+ Resume ignores EPHEMERIS_BASE_URL and rejects overrides of the origin, input, context, model, horizon, quantiles, or key. Only resume trusted receipts: the request hash detects edits, not forgery. Expired server idempotency records can result in a new charge; indefinite replay is not guaranteed.
115
+
116
+ Output paths are reserved before paid submission; existing files are never overwritten. Files are created privately (`0600` where supported). If a paid result cannot be written, the CLI attempts to output the complete artifact on stdout and exits 8. Save stdout or retry the same request/key. A later malformed-response, description, or plotting error leaves the original artifact intact.
117
+
118
+ Success output is JSON, or PNG/SVG for plotting. Diagnostics/errors are JSON Lines on stderr. `--output -` selects stdout. `--timeout` is 1–3600 seconds (default 300). Exit codes:
119
+
120
+ | Code | Meaning |
121
+ | --- | --- |
122
+ | 0 | Operation completed; inspection may still report not ready |
123
+ | 2 | Invalid input/arguments/configuration or unusable saved shape |
124
+ | 3 | Authentication/permission problem |
125
+ | 4 | Insufficient credits |
126
+ | 5 | Conflict/rate limit; inspect error and Retry-After |
127
+ | 6 | Network, timeout, or service failure |
128
+ | 7 | Other API/protocol failure |
129
+ | 8 | Local file/output failure, including a broken output pipe |
130
+ | 130 | Interrupted in-flight request |
131
+
132
+ ## Local demonstration and checks
133
+
134
+ ```bash
135
+ # Uses synthetic observations and a local mock server; no live inference/charge.
136
+ # Supply a NEW directory:
137
+ npm run demo -- /tmp/ephemeris-demo
138
+
139
+ npm test
140
+ npm run docs:check
141
+ npm run schemas:check
142
+ npm run eval:smoke
143
+ npm pack --dry-run
144
+ ```
145
+
146
+ The demo writes CSV, inspection snapshot, prepared request, forecast artifact, description, SVG, PNG, and the durable submission receipt. `examples/daily-sales.csv` and `examples/hourly.json` contain synthetic demonstration data, not real customer history.
147
+
148
+ Tests cover malformed files, missing data, DST/time alignment, multivariate shapes, context separation, numerical interpretation, SVG escaping/gaps, auth, retry recovery, and simulated disk-write failure. The [evaluation harness](evals/README.md) contains nine help-first scenarios. Its scripted adapter validates the harness and CLI, not unfamiliar-model usability. Actual agent trials and qualitative reviews are recorded separately under [evals/results](evals/results); see the [usability audit](docs/usability-audit.md). mechanical success does not establish that every explanation is correct or that the CLI works for every model. No live forecast-quality claim is made.
149
+
150
+ Schemas work offline:
151
+
152
+ ```bash
153
+ ephemeris schema forecast --kind request
154
+ ephemeris schema forecast --kind prepared
155
+ ephemeris schema forecast --kind artifact
156
+ ephemeris schema forecast --kind data
157
+ ephemeris schema forecast --kind submission
158
+ ```
159
+
160
+ Developer drift checks against adjacent repositories:
161
+
162
+ ```bash
163
+ npm run check:api -- /root/paracast-web/public/openapi-m1.json
164
+ python3 scripts/gnomon-fixtures.py /root/Gnomon --check
165
+ ```
166
+
167
+ Gnomon/Python is required only for regenerating/checking developer conformance fixtures, never for installed customer commands. Hosted Gnomon integration is a future option; an artifact import path does not currently exist. Historical evaluation, actual ingestion, and outcome review should use Gnomon in the next phase.
168
+
169
+ ## Release status
170
+
171
+ 0.3 adds durable submission receipts, receipt-based recovery, PNG export, readable recent-history views, actionable argument errors, and executable self-contained help examples. PNG adds a packaged renderer dependency.
172
+
173
+ 0.2 changed forecast output from raw API JSON to a versioned artifact; the response is at `/response`. `forecast --input ...` remains a compatibility spelling for `forecast run`. JSON schema/semantic versions are independent of the npm version.
174
+
175
+ Publication and paid live inference are separate actions. Before publishing, settle package ownership/licensing, run actual agent acceptance trials, and make a separately authorized live API check. The generated reference is ready to host, but no website, package, or repository is published by CI.
176
+
177
+ ## Version diagnostics
178
+
179
+ `ephemeris --version` prints the installed package version. `ephemeris version` (also `ephemeris version --json`) returns component, package version, nullable source build commit and supported local artifact schema versions. It works offline and never checks npm or the hosted service. Packed clean builds have a source commit; source checkouts or unverified builds report null. The hosted MCP's `get_version` reports its independent deployment version; it cannot inspect your local CLI or bridge.
180
+
181
+ The CLI currently carries no open-source license grant (`UNLICENSED`); public npm availability does not itself grant one. Third-party asset licenses remain in assets/.
@@ -0,0 +1,78 @@
1
+ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2
+ Upstream-Name: DejaVu fonts
3
+ Upstream-Author: Stepan Roh <src@users.sourceforge.net> (original author),
4
+ see /usr/share/doc/fonts-dejavu-core/AUTHORS for full list
5
+ Source: https://dejavu-fonts.github.io/
6
+
7
+ Files: *
8
+ Copyright: Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved.
9
+ Bitstream Vera is a trademark of Bitstream, Inc.
10
+ DejaVu changes are in public domain.
11
+ License: bitstream-vera
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of the fonts accompanying this license ("Fonts") and associated
14
+ documentation files (the "Font Software"), to reproduce and distribute the
15
+ Font Software, including without limitation the rights to use, copy, merge,
16
+ publish, distribute, and/or sell copies of the Font Software, and to permit
17
+ persons to whom the Font Software is furnished to do so, subject to the
18
+ following conditions:
19
+ .
20
+ The above copyright and trademark notices and this permission notice shall
21
+ be included in all copies of one or more of the Font Software typefaces.
22
+ .
23
+ The Font Software may be modified, altered, or added to, and in particular
24
+ the designs of glyphs or characters in the Fonts may be modified and
25
+ additional glyphs or characters may be added to the Fonts, only if the fonts
26
+ are renamed to names not containing either the words "Bitstream" or the word
27
+ "Vera".
28
+ .
29
+ This License becomes null and void to the extent applicable to Fonts or Font
30
+ Software that has been modified and is distributed under the "Bitstream
31
+ Vera" names.
32
+ .
33
+ The Font Software may be sold as part of a larger software package but no
34
+ copy of one or more of the Font Software typefaces may be sold by itself.
35
+ .
36
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
37
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
38
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
39
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
40
+ FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
41
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
42
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
43
+ THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
44
+ FONT SOFTWARE.
45
+ .
46
+ Except as contained in this notice, the names of Gnome, the Gnome
47
+ Foundation, and Bitstream Inc., shall not be used in advertising or
48
+ otherwise to promote the sale, use or other dealings in this Font Software
49
+ without prior written authorization from the Gnome Foundation or Bitstream
50
+ Inc., respectively. For further information, contact: fonts at gnome dot
51
+ org.
52
+
53
+ Files: debian/*
54
+ Copyright: (C) 2005-2006 Peter Cernak <pce@users.sourceforge.net>
55
+ (C) 2006-2011 Davide Viti <zinosat@tiscali.it>
56
+ (C) 2011-2013 Christian Perrier <bubulle@debian.org>
57
+ (C) 2013 Fabian Greffrath <fabian+debian@greffrath.com>
58
+ License: GPL-2+
59
+ This program is free software; you can redistribute it
60
+ and/or modify it under the terms of the GNU General Public
61
+ License as published by the Free Software Foundation; either
62
+ version 2 of the License, or (at your option) any later
63
+ version.
64
+ .
65
+ This program is distributed in the hope that it will be
66
+ useful, but WITHOUT ANY WARRANTY; without even the implied
67
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
68
+ PURPOSE. See the GNU General Public License for more
69
+ details.
70
+ .
71
+ You should have received a copy of the GNU General Public
72
+ License along with this package; if not, write to the Free
73
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
74
+ Boston, MA 02110-1301 USA
75
+ .
76
+ On Debian systems, the full text of the GNU General Public
77
+ License version 2 can be found in the file
78
+ /usr/share/common-licenses/GPL-2'.
Binary file
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { main } from '../src/cli.js';
3
+
4
+ // The awaited writer reports broken pipes as output failure (exit 8), including
5
+ // paid-result recovery instructions. Do not turn a lost artifact into success.
6
+ process.stdout.on('error', () => {});
7
+ process.exitCode = await main(process.argv.slice(2));
@@ -0,0 +1,4 @@
1
+ {
2
+ "version": "0.4.0",
3
+ "commit": "5567777c156757427a664b7a5aad7685190247f3"
4
+ }