@aiaiai-pt/frankctl 0.4.3 → 0.5.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/CHANGELOG.md +30 -0
- package/README.md +44 -5
- package/dist/index.js +282 -273
- package/package.json +1 -1
- package/skills/frank-cli/SKILL.md +55 -6
package/package.json
CHANGED
|
@@ -71,8 +71,11 @@ A pipeline is one multi-document YAML file describing three kinds of object unde
|
|
|
71
71
|
| `Pipeline` | Transform steps (SQL/Python) turning bronze → **silver/gold** |
|
|
72
72
|
| `BackingDataset` | Maps a silver table's columns to **ontology** entity properties |
|
|
73
73
|
|
|
74
|
-
Objects reference each other by `metadata.name`, so one file
|
|
75
|
-
version-controllable. Commit
|
|
74
|
+
Objects reference each other by `metadata.name`, so one file can be self-contained and
|
|
75
|
+
version-controllable. Commit only reviewed, secret-free declarations. Source credentials
|
|
76
|
+
are currently literal `source_config` values: `frankctl` does not expand `${ENV_VAR}` and
|
|
77
|
+
export preserves those values. Keep a secret-bearing Source in an untracked mode-0600
|
|
78
|
+
file and commit its Pipeline/BackingDataset declarations separately.
|
|
76
79
|
|
|
77
80
|
### The loop: scaffold → edit → apply
|
|
78
81
|
|
|
@@ -102,15 +105,34 @@ Datasets → ontology.
|
|
|
102
105
|
frankctl pipelines apply -f pipeline.yaml --wait --timeout 600
|
|
103
106
|
```
|
|
104
107
|
|
|
108
|
+
Use `--json` with `--wait` for one evidence object correlated to the exact Source
|
|
109
|
+
workflow/SyncRun, Dagster/TransformRun, and ontology SyncRun started by this invocation.
|
|
110
|
+
Snapshot IDs are decimal strings so JavaScript cannot round them. `status: skipped`
|
|
111
|
+
means the ontology was already converged and no rows were replayed; use `bd entities`
|
|
112
|
+
for separate target entity readback.
|
|
113
|
+
|
|
105
114
|
### Preflight before you apply
|
|
106
115
|
|
|
107
116
|
| Flag | What it does |
|
|
108
117
|
|------|--------------|
|
|
109
118
|
| `--dry-run` | Client-side parse + cross-ref resolve. Catches malformed YAML and broken references. No server call. |
|
|
110
119
|
| `--dry-run-server` | Server-side preflight against the catalog + DB without persisting. Catches unknown `pattern_id`s, would-be immutable-diff conflicts, and unresolved refs. |
|
|
120
|
+
| `--dry-run-server --live-ontology` | Adds an opt-in, GET-only check of ontology tenant, type, properties, relationships, keys, and declared carrier types. It never changes ontology schema or entities. |
|
|
111
121
|
|
|
112
122
|
Run `--dry-run-server` in CI on every change; run `apply --wait` to promote.
|
|
113
123
|
|
|
124
|
+
`Source.spec.streams` is desired state. Reapply creates or patches declared streams by
|
|
125
|
+
name while preserving IDs, cursors, iterator chunks, counters, and run history. Omitted
|
|
126
|
+
streams are preserved and reported as unmanaged; declare `is_enabled: false` to disable
|
|
127
|
+
one explicitly. When streams are declared, `--wait` executes only their enabled names.
|
|
128
|
+
`spec.max_items_per_chunk` sets an iterator chunk budget; omit it for the connector or
|
|
129
|
+
cluster default and use explicit `null` in a Source PATCH to clear an override.
|
|
130
|
+
|
|
131
|
+
For relationship mappings, add a matching `metadata.dependsOn` entry to the
|
|
132
|
+
BackingDataset and set `spec.sync_mode: manual`. `--wait` topologically orders same-file
|
|
133
|
+
dependencies and requires external dependencies in the same ontology tenant to be
|
|
134
|
+
already `synced`. Cycles and self-referential relationships fail before execution.
|
|
135
|
+
|
|
114
136
|
### Immutable state & when to force
|
|
115
137
|
|
|
116
138
|
Backing Datasets carry operational state (ontology cursor, sync history). If a change
|
|
@@ -126,13 +148,18 @@ Without these, `apply` is fully idempotent.
|
|
|
126
148
|
|
|
127
149
|
### Export existing work back to YAML
|
|
128
150
|
|
|
129
|
-
Already built a pipeline in the UI?
|
|
130
|
-
|
|
151
|
+
Already built a pipeline in the UI? Export it — plus its Sources and Backing Datasets —
|
|
152
|
+
to a private file for review:
|
|
131
153
|
|
|
132
154
|
```bash
|
|
133
|
-
|
|
155
|
+
umask 077
|
|
156
|
+
frankctl pipelines export <pipeline-id> > pipeline.private.yaml
|
|
134
157
|
```
|
|
135
158
|
|
|
159
|
+
The export includes Source configuration and config-only stream declarations but omits
|
|
160
|
+
stream runtime state. Split any secret-bearing Source document out before committing the
|
|
161
|
+
remaining declarations.
|
|
162
|
+
|
|
136
163
|
### Minimal manifest shape
|
|
137
164
|
|
|
138
165
|
```yaml
|
|
@@ -247,9 +274,19 @@ frankctl sources history <id> [--limit N] [--offset N]
|
|
|
247
274
|
frankctl sources streams list <source-id> [--enabled-only]
|
|
248
275
|
frankctl sources streams set <source-id> -f streams.yaml
|
|
249
276
|
frankctl sources streams refresh-schema <source-id> --from-discovery
|
|
277
|
+
frankctl sources streams refresh-schema <source-id> -f discovery-result.yaml
|
|
250
278
|
```
|
|
251
279
|
|
|
252
280
|
`-f` accepts YAML, JSON, or `-` (stdin). `streams set` takes a bare array or `{streams: […]}`.
|
|
281
|
+
Schema refresh consumes a complete discovery snapshot. It changes discovered schema and
|
|
282
|
+
supported modes while preserving namespace/destination routing, operator choices, and
|
|
283
|
+
runtime state; streams absent from a non-empty snapshot are removed as stale.
|
|
284
|
+
|
|
285
|
+
After a successful `full_refresh` + `replace`, `rows_synced` is the current table
|
|
286
|
+
cardinality rather than a lifetime sum. Append and incremental modes remain cumulative.
|
|
287
|
+
A connector-confirmed, fully exhausted zero-row result can atomically replace an existing
|
|
288
|
+
table only for `full_refresh` + `replace`; unknown, partial, failed, append, merge, and
|
|
289
|
+
incremental empties cannot erase it.
|
|
253
290
|
|
|
254
291
|
### Pipelines & Transforms (bronze → silver/gold)
|
|
255
292
|
|
|
@@ -277,12 +314,24 @@ frankctl bd get <id>
|
|
|
277
314
|
frankctl bd create -f bd.yaml
|
|
278
315
|
frankctl bd update <id> -f patch.yaml
|
|
279
316
|
frankctl bd delete <id> --yes # does not delete underlying data
|
|
280
|
-
frankctl bd sync <id>
|
|
317
|
+
frankctl bd sync <id> [--force] [--no-wait] # trigger ontology sync, poll exact run
|
|
281
318
|
frankctl bd entities <id> # read entities back out — confirm values landed
|
|
282
319
|
```
|
|
283
320
|
|
|
284
321
|
`bd entities` closes the authoring loop: it reads the ontology to prove your rows
|
|
285
322
|
actually materialized as entities, not just that the sync reported success.
|
|
323
|
+
`bd sync --force` full-replays through REST even when the snapshot and effective
|
|
324
|
+
mapping spec are unchanged. Normal output includes replay reason, row/snapshot
|
|
325
|
+
evidence, and safe attempted/applied SyncSpec fingerprint prefixes. Human output
|
|
326
|
+
prefers the precision-safe decimal string `snapshot_id_exact`; JSON exposes it
|
|
327
|
+
alongside the legacy numeric `snapshot_id`.
|
|
328
|
+
|
|
329
|
+
For an ordinary sync, the CLI falls back to BackingDataset status polling when
|
|
330
|
+
an older API does not return exact-run evidence, and clearly marks replay
|
|
331
|
+
evidence unavailable. `--force` does not fall back: it checks
|
|
332
|
+
`/api/v1/backing-datasets/capabilities` before mutation and sends no sync POST
|
|
333
|
+
unless version 2, exact-run polling, and force replay are explicitly supported.
|
|
334
|
+
After the POST, it also requires `force_replay: true` confirmation.
|
|
286
335
|
|
|
287
336
|
### Runs
|
|
288
337
|
|