Skip to content

Commit 271a9d9

Browse files
committed
refactor(cli): rename 'obol dataset' to 'obol sell data'
Moves the seller-side dataset command group under 'obol sell' as 'data' (with 'dataset' kept as an alias). 'obol buy dataset' is unchanged. Updates help/error strings, the monetize-dataset guide, the dataset-anonymize skill, and the hf-surface smoke flow.
1 parent d52747a commit 271a9d9

6 files changed

Lines changed: 35 additions & 34 deletions

File tree

cmd/obol/dataset.go

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package main
22

3-
// obol dataset — owner side of a versioned, membership-gated dataset offer.
3+
// obol sell data — owner side of a versioned, membership-gated dataset offer.
44
//
5-
// obol dataset from <bundle-dir> --name <id> ingest a bundle as a new
6-
// signed version (creates v1).
7-
// obol dataset version <id> --bundle <dir> append the next signed version.
8-
// obol dataset publish <id> host the artifact server on
9-
// this machine + a Cloudflare
10-
// tunnel; gate every byte.
11-
// obol dataset approve <user-code> admit a worker (membership).
12-
// obol dataset verify <id> walk the signed version chain.
13-
// obol dataset status <id> versions + members.
5+
// obol sell data from <bundle-dir> --name <id> ingest a bundle as a new
6+
// signed version (creates v1).
7+
// obol sell data version <id> --bundle <dir> append the next signed version.
8+
// obol sell data publish <id> host the artifact server on
9+
// this machine + a Cloudflare
10+
// tunnel; gate every byte.
11+
// obol sell data approve <user-code> admit a worker (membership).
12+
// obol sell data verify <id> walk the signed version chain.
13+
// obol sell data status <id> versions + members.
1414
//
1515
// The artifact server is the host gateway (same spirit as `obol sell
1616
// inference` / `obol research publish`): it runs on the owner's machine, never
@@ -47,10 +47,11 @@ type datasetState struct {
4747
OwnerToken string `json:"owner_token"`
4848
}
4949

50-
func datasetCommand(cfg *config.Config) *cli.Command {
50+
func sellDataCommand(cfg *config.Config) *cli.Command {
5151
return &cli.Command{
52-
Name: "dataset",
53-
Usage: "Publish and sell versioned, membership-gated datasets",
52+
Name: "data",
53+
Aliases: []string{"dataset"},
54+
Usage: "Publish and sell versioned, membership-gated datasets",
5455
Commands: []*cli.Command{
5556
datasetFromCommand(cfg),
5657
datasetVersionCommand(cfg),
@@ -70,7 +71,7 @@ func datasetFromCommand(cfg *config.Config) *cli.Command {
7071
Flags: []cli.Flag{&cli.StringFlag{Name: "name", Usage: "Dataset id", Required: true}},
7172
Action: func(_ context.Context, cmd *cli.Command) error {
7273
if cmd.NArg() != 1 {
73-
return fmt.Errorf("bundle directory required: obol dataset from <bundle-dir> --name <id>")
74+
return fmt.Errorf("bundle directory required: obol sell data from <bundle-dir> --name <id>")
7475
}
7576
return appendDatasetVersion(cfg, cmd, strings.TrimSpace(cmd.String("name")), cmd.Args().First())
7677
},
@@ -85,11 +86,11 @@ func datasetVersionCommand(cfg *config.Config) *cli.Command {
8586
Flags: []cli.Flag{&cli.StringFlag{Name: "bundle", Usage: "New bundle directory", Required: true}},
8687
Action: func(_ context.Context, cmd *cli.Command) error {
8788
if cmd.NArg() != 1 {
88-
return fmt.Errorf("dataset id required: obol dataset version <id> --bundle <dir>")
89+
return fmt.Errorf("dataset id required: obol sell data version <id> --bundle <dir>")
8990
}
9091
id := strings.TrimSpace(cmd.Args().First())
9192
if _, err := os.Stat(datasetStorePath(cfg, id)); err != nil {
92-
return fmt.Errorf("dataset %q not found — create it with 'obol dataset from'", id)
93+
return fmt.Errorf("dataset %q not found — create it with 'obol sell data from'", id)
9394
}
9495
return appendDatasetVersion(cfg, cmd, id, cmd.String("bundle"))
9596
},
@@ -144,7 +145,7 @@ func appendDatasetVersion(cfg *config.Config, cmd *cli.Command, id, bundleDir st
144145
u.Infof("File hash: %s", v.FileHash)
145146
u.Infof("Size: %d bytes", v.Size)
146147
u.Infof("Owner: %s", signer.SignerID())
147-
u.Dim("Publish it with: obol dataset publish " + id)
148+
u.Dim("Publish it with: obol sell data publish " + id)
148149
return nil
149150
}
150151

@@ -164,7 +165,7 @@ func datasetPublishCommand(cfg *config.Config) *cli.Command {
164165
Action: func(ctx context.Context, cmd *cli.Command) error {
165166
u := getUI(cmd)
166167
if cmd.NArg() != 1 {
167-
return fmt.Errorf("dataset id required: obol dataset publish <id>")
168+
return fmt.Errorf("dataset id required: obol sell data publish <id>")
168169
}
169170
id := strings.TrimSpace(cmd.Args().First())
170171

@@ -180,7 +181,7 @@ func datasetPublishCommand(cfg *config.Config) *cli.Command {
180181
return err
181182
}
182183
if len(st.Versions) == 0 {
183-
return fmt.Errorf("dataset %q has no versions — run 'obol dataset from' first", id)
184+
return fmt.Errorf("dataset %q has no versions — run 'obol sell data from' first", id)
184185
}
185186
// Never serve a chain we cannot verify against the owner key: a
186187
// tampered persisted store must fail closed, not be published.
@@ -302,7 +303,7 @@ func datasetApproveCommand(cfg *config.Config) *cli.Command {
302303
Action: func(ctx context.Context, cmd *cli.Command) error {
303304
u := getUI(cmd)
304305
if cmd.NArg() != 1 {
305-
return fmt.Errorf("user code required: obol dataset approve <user-code>")
306+
return fmt.Errorf("user code required: obol sell data approve <user-code>")
306307
}
307308
st, err := loadDatasetState(cfg, cmd.String("dataset"))
308309
if err != nil {
@@ -332,7 +333,7 @@ func datasetVerifyCommand(cfg *config.Config) *cli.Command {
332333
Action: func(_ context.Context, cmd *cli.Command) error {
333334
u := getUI(cmd)
334335
if cmd.NArg() != 1 {
335-
return fmt.Errorf("dataset id required: obol dataset verify <id>")
336+
return fmt.Errorf("dataset id required: obol sell data verify <id>")
336337
}
337338
id := strings.TrimSpace(cmd.Args().First())
338339
key, err := dataset.LoadOrCreateKey(datasetKeyPath(cfg, id))
@@ -363,7 +364,7 @@ func datasetStatusCommand(cfg *config.Config) *cli.Command {
363364
Action: func(ctx context.Context, cmd *cli.Command) error {
364365
u := getUI(cmd)
365366
if cmd.NArg() != 1 {
366-
return fmt.Errorf("dataset id required: obol dataset status <id>")
367+
return fmt.Errorf("dataset id required: obol sell data status <id>")
367368
}
368369
id := strings.TrimSpace(cmd.Args().First())
369370
st, err := dataset.NewStore(datasetStorePath(cfg, id)).Load()

cmd/obol/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ GLOBAL OPTIONS:{{template "visibleFlagTemplate" .}}{{end}}
330330
bountyCommand(cfg),
331331
smokeCommand(cfg),
332332
researchCommand(cfg),
333-
datasetCommand(cfg),
334333
modelCommand(cfg),
335334
{
336335
Name: "app",

cmd/obol/sell.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func sellCommand(cfg *config.Config) *cli.Command {
6767
sellIdentityCommand(cfg),
6868
sellInfoCommand(cfg),
6969
sellResumeCommand(cfg),
70+
sellDataCommand(cfg),
7071
},
7172
}
7273
}

docs/guides/monetize-dataset.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ the `dataset-anonymize` skill.
3535
## 2. Record a signed version
3636

3737
```bash
38-
obol dataset from my-bundle --name pi-sessions
38+
obol sell data from my-bundle --name pi-sessions
3939
```
4040

4141
This reads the bundle, computes the artifact's whole-file SHA-256, and appends
4242
a **signed** `DatasetVersion` (v1) to the dataset's version log — chained to
4343
its predecessor, signed by your owner key (the address buyers pin). Append a new
44-
snapshot later with `obol dataset version pi-sessions --bundle my-bundle-v2`.
44+
snapshot later with `obol sell data version pi-sessions --bundle my-bundle-v2`.
4545

4646
Walk the chain offline at any time:
4747

4848
```bash
49-
obol dataset verify pi-sessions # rejects any reorder/tamper/middle-removal
49+
obol sell data verify pi-sessions # rejects any reorder/tamper/middle-removal
5050
```
5151

5252
## 3. Publish (host + tunnel + gate)
5353

5454
```bash
55-
obol dataset publish pi-sessions --membership invite
55+
obol sell data publish pi-sessions --membership invite
5656
```
5757

5858
Starts the artifact server on your machine and a Cloudflare tunnel. **Bytes
@@ -64,7 +64,7 @@ alike.
6464
Two ways a caller holds a member token:
6565

6666
- **Pre-approved worker** — joins via device-auth; you run
67-
`obol dataset approve <user-code>`. Gets full (head) access.
67+
`obol sell data approve <user-code>`. Gets full (head) access.
6868
- **Anonymous market buyer** — pays the priced offer; the edge x402 verifier
6969
proves the settled payment, and the server mints a token scoped to exactly
7070
the version paid for (`/join/paid`). Payment *is* the approval; the dataset

flows/hf-surface-smoke.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@ fi
7777
HASH=$(shasum -a 256 "$BUNDLE/sft.jsonl" | awk '{print $1}')
7878
printf '{"hash":"%s","files":["sft.jsonl"]}\n' "$HASH" > "$BUNDLE/manifest.json"
7979

80-
if "$OBOL_BIN" dataset from "$BUNDLE" --name "$DS_ID" >/dev/null 2>&1 \
81-
&& "$OBOL_BIN" dataset verify "$DS_ID" 2>&1 | grep -q 'Chain valid'; then
80+
if "$OBOL_BIN" sell data from "$BUNDLE" --name "$DS_ID" >/dev/null 2>&1 \
81+
&& "$OBOL_BIN" sell data verify "$DS_ID" 2>&1 | grep -q 'Chain valid'; then
8282
pass "1b sign + verify — signed version chain valid"
8383
else
8484
fail "1b sign+verify" "version not recorded or chain invalid"
8585
fi
8686

8787
MANIFEST_HASH=$(python3 -c "import json;print(json.load(open('$OBOL_CONFIG_DIR/dataset-serve/$DS_ID.store.json'))['versions'][0]['manifestHash'])")
8888

89-
"$OBOL_BIN" dataset publish "$DS_ID" --membership open --port "$DS_PORT" --no-tunnel >/dev/null 2>&1 &
89+
"$OBOL_BIN" sell data publish "$DS_ID" --membership open --port "$DS_PORT" --no-tunnel >/dev/null 2>&1 &
9090
curl -sf --retry 25 --retry-connrefused --retry-delay 1 "http://127.0.0.1:$DS_PORT/healthz" >/dev/null
9191
OWNER=$(python3 -c "import json;print(json.load(open('$OBOL_CONFIG_DIR/dataset-serve/$DS_ID.state.json'))['owner_token'])" 2>/dev/null)
9292

internal/embed/skills/dataset-anonymize/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: dataset-anonymize
3-
description: Anonymize a dataset's JSONL (PII detection + masking) before publishing or selling it with `obol dataset`. Pluggable detector — built-in regex redactor by default, or a BYO Hugging Face token-classification model.
3+
description: Anonymize a dataset's JSONL (PII detection + masking) before publishing or selling it with `obol sell data`. Pluggable detector — built-in regex redactor by default, or a BYO Hugging Face token-classification model.
44
---
55

66
# dataset-anonymize
@@ -38,8 +38,8 @@ export OBOL_ANONYMIZER_MODEL="<org>/<pii-token-classification-model>"
3838
python3 scripts/anonymize.py input.jsonl anonymized.jsonl --report
3939

4040
# Then ingest the anonymized bundle and publish it:
41-
obol dataset from <bundle-dir-with-anonymized.jsonl> --name my-dataset
42-
obol dataset publish my-dataset
41+
obol sell data from <bundle-dir-with-anonymized.jsonl> --name my-dataset
42+
obol sell data publish my-dataset
4343
```
4444

4545
Each input line is a JSON object; the script masks string values under

0 commit comments

Comments
 (0)