mostlyright-data 0.31.44__tar.gz → 0.31.46__tar.gz
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.
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/PKG-INFO +1 -1
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/SKILL.md +34 -9
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/2-brief-two-to-four-questions-each-with-a-recommended-answer.md +7 -2
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/enriching-with-small-models.md +6 -2
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/patterns.md +152 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/sources.md +47 -4
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/recipe_explain.py +12 -1
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/recipe_lint.py +94 -4
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/studio_capabilities.py +6 -1
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/table_search_contract.json +1 -1
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4.py +2 -2
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/.gitignore +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/README.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/pyproject.toml +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/scripts/hatch_build.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/agents/openai.yaml +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/1-open-the-page-and-the-link-to-it-in-the-first-message.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/3-probe-read-a-source-before-committing-to-it.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/4-decide-say-what-you-chose-what-you-refused-and-ask-one-question.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/5-draft-one-recipe-document-one-call.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/6-build-one-run-sized-to-acquire-every-measured-source-whole.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/7-interrogate-ask-the-run-what-it-actually-delivered.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/8-fix-revise-the-document-and-register-it-again.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/9-present-only-what-survived-inspection-with-caveats.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/agent-protocol.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/autonomous-delivery.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/before-the-first-tool-call.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/boundaries.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/cloud-authentication-preflight.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/commands.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/live-run.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/making-a-table-incremental.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/narrating-the-run.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/not-hosted-yet.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/one-install.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/predicting-with-tabular-models.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/prediction-labels.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/preparing-table-search.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/promote.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/readers.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/receipts.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/recipe-test.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/recording-a-stream-venue.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/recovering-an-import-failure.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/reference-pages.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/required-protocol.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/satellite-signals.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/source-credentials.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/the-one-thing-to-say-about-the-skill-itself.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/transforms.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/user-communication-contract.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/writing-a-decision-record.md +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/scripts/write_research_notebook.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/__init__.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/agent_protocol.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/canonical.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/key_seam.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/page_coverage.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/part_check_evidence.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/session_probes.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/skill_assets.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/table_manifest.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/__init__.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/activity.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/backoff.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/categories.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/dataset-categories-v1.json +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/dataset_layout.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/delivery.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/description_shape.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/download.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/enrichment.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/fast_features.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/matching_benchmark.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/probe.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/progress_rate.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/progress_vocabulary.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/recipe.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/recipe_brief.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/recipe_forecast.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/recipe_test.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/refresh_rehearsal.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/release_check.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/research.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/router.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/run_diagnose.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/run_prefix.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/runs.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/session.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/stream.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/stream_venue.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/support.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/table_view.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/transport.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/user_agent.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_artifacts.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_catalog.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_connected.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_connections.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_dataset_covers.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_datasets.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_handoff.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_matching.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_narrative.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_public.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_public_pull.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_query.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_reader.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_runs.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_search.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_search_contract.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_secrets.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_stream.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_tables.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/vocabulary.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/__init__.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/attendance.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/clarification.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/cloud_auth.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/commands/__init__.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/commands/auth.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/commands/clarify.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/commands/login.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/commands/whoami.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/credential_native.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/credential_store.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/credentials.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/login.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/path_kind.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/plain_file.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/remediation.py +0 -0
- {mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/render.py +0 -0
|
@@ -5,14 +5,21 @@ description: Build, inspect, repair and verify datasets using the hosted Mostly
|
|
|
5
5
|
|
|
6
6
|
# Mostly Right Data Build
|
|
7
7
|
|
|
8
|
-
Build the dataset the
|
|
8
|
+
Build the best dataset for the person's goal, verify its contents, and report its actual coverage.
|
|
9
9
|
Use hosted commands with `--json` and returned identifiers. This core workflow governs the
|
|
10
10
|
references. Load the reference for the current stage only, not the entire library before starting.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
Act as the person's data scientist, not as an order taker. Most people know their goal and do
|
|
13
|
+
not know which dataset serves it. The request is the floor, never the ceiling. Work out the
|
|
14
|
+
goal, then design the table a data scientist would want for it. Add the sources that explain
|
|
15
|
+
or complete the requested one and join them. Derive what a rule can settle. Use the small
|
|
16
|
+
models (classify, extract, match) for the judgement no rule can make. Use a prediction where a
|
|
17
|
+
column is known for some rows and wanted for others. Where more data can be joined and then
|
|
18
|
+
classified, plan all of it. Do not wait for the person to name a source, a column or a model.
|
|
19
|
+
Recommend the fuller design in the brief, in the same question form, so it costs no extra turn.
|
|
20
|
+
This holds for a new build and for a request to extend a dataset. A repair, a refresh fix or a
|
|
21
|
+
question about existing data gets exactly what was asked.
|
|
22
|
+
Steps 3, 4, 5, 8 and 10 say where, and
|
|
16
23
|
[enriching with small models](references/enriching-with-small-models.md) says how.
|
|
17
24
|
|
|
18
25
|
For application access, API queries or polling for updates, use `mr-data public api-guide TABLE_ID`. It returns table-specific requests and key setup. Use environment variables for secrets.
|
|
@@ -68,6 +75,7 @@ the source shape that fits.
|
|
|
68
75
|
| API that takes a date range | `window.request` | `lookback_seconds` | [date range](references/patterns.md#api-that-takes-a-date-range) |
|
|
69
76
|
| Many pages behind one index | `public.https.collection@2.0.0` | the gap | [collection](references/patterns.md#many-pages-behind-one-index) |
|
|
70
77
|
| One request per row of another source | a per-row `request`, with `batch` when a `GET` takes a list of ids | the gap | [per-row](references/patterns.md#one-request-per-row-many-ids-per-request) |
|
|
78
|
+
| A SOAP or XML service asked once per row | a keyless per-row `POST` with `body_text` | `content_type`, the gap | [SOAP per-row](references/patterns.md#one-soap-request-per-row) |
|
|
71
79
|
| Bulk dump beside a windowed source | `reference` | `recheck_seconds` | [reference](references/patterns.md#bulk-dump-beside-a-windowed-source) |
|
|
72
80
|
| Live `wss://` feed | a recorded stream | see [Streams](references/recording-a-stream-venue.md) | none |
|
|
73
81
|
| A join of tables this workspace already built, rebuilt when one promotes | `table.version@1.0.0` sources with `refresh: upstream_promoted` and `rebuild` (server 4.38) | one shared `data_classification`, `debounce_seconds` | [table sources](references/sources.md#reading-another-table-of-this-workspace) |
|
|
@@ -137,9 +145,20 @@ step 6. The stage 3 reference holds its rule. Gate 4 is step 6.
|
|
|
137
145
|
[brief reference](references/2-brief-two-to-four-questions-each-with-a-recommended-answer.md).
|
|
138
146
|
In an unattended session use the established brief, record assumptions within its scope,
|
|
139
147
|
and do not wait for an absent person.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
Design for the goal before you ask. Infer the goal from the request and ask about it only
|
|
149
|
+
when two readings would change the table. Run `mr-data models --json` once. Then list what
|
|
150
|
+
the goal needs beyond the literal request: a second or third source to join, columns a rule
|
|
151
|
+
derives, a label or extracted field per row, a prediction. Put that design in the brief form
|
|
152
|
+
as one single-choice scope question. Its recommended option is the full design. The option's
|
|
153
|
+
description names the parts in the person's words, the biggest gain first, within the
|
|
154
|
+
form's length limit. Another option is the request exactly as written. Leave out any part
|
|
155
|
+
that would not serve the goal. When the design adds something to the request, the scope
|
|
156
|
+
question takes one of the form's slots. It can carry the purpose question. When nothing
|
|
157
|
+
would serve the goal better, skip the question and say so in one line. In a host without a question form, write the same choice
|
|
158
|
+
in the brief message. This is part of the one brief, never a second round. When the person
|
|
159
|
+
chooses the request as written, build exactly that. In an unattended session there is no
|
|
160
|
+
one to choose: add the rules, build the request, and record the rest as offers. See
|
|
161
|
+
[enriching](references/enriching-with-small-models.md#where-the-loop-runs). A
|
|
143
162
|
judgement the request already names, such as a label per row, is part of the build.
|
|
144
163
|
|
|
145
164
|
## Research, register, build
|
|
@@ -153,6 +172,11 @@ step 6. The stage 3 reference holds its rule. Gate 4 is step 6.
|
|
|
153
172
|
would summarise, pages or documents holding facts no column holds. Sort each by
|
|
154
173
|
[the ladder](references/enriching-with-small-models.md#the-ladder-a-rule-first-a-model-for-the-rest):
|
|
155
174
|
a rule first, a model for the rest.
|
|
175
|
+
Look also for what is missing from every source in the brief: a public table that shares a
|
|
176
|
+
key, a place or a time with these rows and would explain or complete them. Probe it like any
|
|
177
|
+
other source. A join the chosen design named goes into the first revision if it keeps
|
|
178
|
+
every requested row and the agreed grain. Say so in step 5. A join the person was never
|
|
179
|
+
shown, and any join when they chose the request as written, is an offer at delivery.
|
|
156
180
|
5. State the selected sources, joins, coverage and material limitations. Ask for a decision only
|
|
157
181
|
if existing authorization does not cover it. Read the
|
|
158
182
|
[recipe reference](references/5-draft-one-recipe-document-one-call.md) before authoring fields.
|
|
@@ -164,7 +188,8 @@ step 6. The stage 3 reference holds its rule. Gate 4 is step 6.
|
|
|
164
188
|
rules. If semantic search or JEV interpretation into filters/sorts is explicitly required,
|
|
165
189
|
do not register or queue a recipe that omits it; report the capability limit and wait.
|
|
166
190
|
Do not add search to existing recipes or rebuild existing datasets without an explicit request.
|
|
167
|
-
Put the deterministic derivations found in step 4 into the first revision
|
|
191
|
+
Put the deterministic derivations found in step 4 into the first revision, and the joins
|
|
192
|
+
step 4 allows. Add a classify
|
|
168
193
|
or extract source when the brief asked for that judgement or the person accepted the offer,
|
|
169
194
|
from the binding `mr-data models` lists, and let a rule settle every row it can before the
|
|
170
195
|
model reads the rest ([writing a classify source](references/enriching-with-small-models.md#writing-a-classify-source)).
|
|
@@ -6,14 +6,19 @@ questions (up to four), two to four distinct options per question and one recomm
|
|
|
6
6
|
each. Put the tradeoffs in the option descriptions. If field validation fails, correct the
|
|
7
7
|
fields and retry. The card itself asks the questions. Only hosts without a question form
|
|
8
8
|
use a concise text brief with the same choices and recommendations. If more decisions remain, ask the four that most affect the dataset, including unresolved update behavior.
|
|
9
|
-
|
|
9
|
+
Settle the rest with defaults stated in one short sentence. Ask a second form only for a choice that would make the dataset wrong if guessed. A question with no
|
|
10
10
|
recommendation makes the user do the work; a recommendation with no question decides for them.
|
|
11
11
|
|
|
12
12
|
Resolve the following before dependent work; combine related questions and omit decisions the
|
|
13
13
|
user already supplied. Always include update behavior when it remains unresolved:
|
|
14
14
|
|
|
15
15
|
- **Purpose.** What analysis, decision or downstream use should this support? It settles every
|
|
16
|
-
ambiguous definition below
|
|
16
|
+
ambiguous definition below. Infer it from the request, and ask when two readings would change
|
|
17
|
+
the table. The scope question can carry it.
|
|
18
|
+
- **Scope.** What would a data scientist add for that purpose? Name the sources worth joining,
|
|
19
|
+
the columns a rule derives, and the labels, extracted fields or prediction a model adds.
|
|
20
|
+
Ask one single-choice question. Recommend the full design and offer the request as written
|
|
21
|
+
beside it. Most people know the goal and not the dataset, so do not wait to be asked.
|
|
17
22
|
- **Grain.** What does one row represent — an event, a company, a station-hour, a country-year?
|
|
18
23
|
Resolve raw observations against aggregates, the time frequency, and the geographic detail.
|
|
19
24
|
- **Table shape.** Default to one joined, ML-ready table at the agreed observation or prediction
|
|
@@ -85,8 +85,12 @@ also keep the rows it settled from being sent at all: see [Needs server 4.14](#n
|
|
|
85
85
|
### Where the loop runs
|
|
86
86
|
|
|
87
87
|
1. **Brief (step 3).** Read what the table is for and which judgements the person named. Run
|
|
88
|
-
`mr-data models --json`.
|
|
89
|
-
|
|
88
|
+
`mr-data models --json`. Design the table the goal needs, not only the one the request
|
|
89
|
+
names: sources to join, derived columns, labels, extracted fields, a prediction. Put it in
|
|
90
|
+
the brief form as one single-choice scope question. Recommend the full design. Its
|
|
91
|
+
description names each part and what it adds, in the person's words. Offer the request as
|
|
92
|
+
written as the other option. Ask in the
|
|
93
|
+
same form as the rest of the brief, so the offer costs no extra turn. A judgement the
|
|
90
94
|
brief already asks for ("which reports mention fog", "tag each filing by sector") is part of
|
|
91
95
|
the build, not an offer.
|
|
92
96
|
2. **Probe (step 4).** Read the sampled rows column by column with the ladder: each free-text,
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/patterns.md
RENAMED
|
@@ -29,6 +29,7 @@ table before any full run.
|
|
|
29
29
|
| API that takes a date range | [Date-range window](#api-that-takes-a-date-range) | Yes, by window |
|
|
30
30
|
| Many pages behind one index | [Page collection](#many-pages-behind-one-index) | No. A refresh of a collection returns `RESYNC_REQUIRED` |
|
|
31
31
|
| One request per row of another source | [Per-row request with `batch`](#one-request-per-row-many-ids-per-request) | Yes, through the upstream window |
|
|
32
|
+
| A SOAP or XML service asked once per row | [SOAP per-row request](#one-soap-request-per-row) | No. Its upstream file is `closed` |
|
|
32
33
|
| Bulk dump beside a windowed source | [Reference beside a window](#bulk-dump-beside-a-windowed-source) | Yes. The dump is read again on its own cadence |
|
|
33
34
|
|
|
34
35
|
A live `wss://` feed has no recipe here. Read [Streams](recording-a-stream-venue.md).
|
|
@@ -793,6 +794,157 @@ first. [Authoring a per-row request](sources.md#authoring-a-per-row-request) and
|
|
|
793
794
|
}
|
|
794
795
|
```
|
|
795
796
|
|
|
797
|
+
### One SOAP request per row
|
|
798
|
+
|
|
799
|
+
A keyless per-row `POST` whose `body_text` is a SOAP envelope (Needs server 4.71). Use it only when
|
|
800
|
+
`row_request_text_body` is literal `true` in `studio_capabilities`. The request here asks the Czech
|
|
801
|
+
VAT payer register about each `dic` in an upstream file, and an `xml.tabular` Reader decodes each
|
|
802
|
+
answer. `SOAPAction` is a literal header, and the worker sets `Content-Type` from
|
|
803
|
+
`body_text.content_type`. Each `{dic}` is XML-escaped, so a cell adds no markup. A text body is
|
|
804
|
+
never batched, so the register is asked once per row: 2,000 calls an hour and 10,000 a day are
|
|
805
|
+
its limits, so the source states a 1,800 ms gap, which also keeps it inside 4 calls at once, and
|
|
806
|
+
9,000 fetches a run.
|
|
807
|
+
|
|
808
|
+
`xml.tabular` refuses a selector that matches more than one element, so a payer's repeated
|
|
809
|
+
`zverejneneUcty/ucet` accounts are not columns here. Read them with a second per-row source whose
|
|
810
|
+
`record_selector` ends at `roz:ucet`, carrying `dic`, and pay for its calls too. A saved answer
|
|
811
|
+
is reused for as long as the server holds it; for a flag that changes, read
|
|
812
|
+
[a freshness bound on per-row answers](making-a-table-incremental.md#a-freshness-bound-on-per-row-answers)
|
|
813
|
+
first.
|
|
814
|
+
[Authoring a per-row request](sources.md#a-text-body-for-a-soap-or-xml-service) has the rules.
|
|
815
|
+
|
|
816
|
+
```json
|
|
817
|
+
{
|
|
818
|
+
"dataset": {"id": "00000000-0000-4000-8000-000000000000", "name": "Czech VAT payer status"},
|
|
819
|
+
"question": {"text": "Is each Czech VAT payer in the list reliable, and what is its registered name?"},
|
|
820
|
+
"table": {
|
|
821
|
+
"name": "vat_payer_status",
|
|
822
|
+
"description": "One row per VAT id with the register's reliability flag and name.",
|
|
823
|
+
"grain": ["dic"],
|
|
824
|
+
"columns": [
|
|
825
|
+
{"name": "dic", "type": "string", "nullable": false, "description": "The VAT id without its CZ prefix."},
|
|
826
|
+
{
|
|
827
|
+
"name": "unreliable",
|
|
828
|
+
"type": "boolean",
|
|
829
|
+
"nullable": false,
|
|
830
|
+
"description": "Whether the register lists the payer as unreliable (ANO)."
|
|
831
|
+
},
|
|
832
|
+
{"name": "tax_office", "type": "string", "nullable": true, "description": "The register's tax office number."},
|
|
833
|
+
{"name": "subject_name", "type": "string", "nullable": true, "description": "The registered name."},
|
|
834
|
+
{"name": "city", "type": "string", "nullable": true, "description": "The registered address's town."}
|
|
835
|
+
]
|
|
836
|
+
},
|
|
837
|
+
"sources": [
|
|
838
|
+
{
|
|
839
|
+
"name": "payers",
|
|
840
|
+
"description": "The list of VAT ids to look up.",
|
|
841
|
+
"source_class": "user_url",
|
|
842
|
+
"data_classification": "public",
|
|
843
|
+
"locator": {"kind": "https_url", "display_locator": "https://data.example.cz/vat/payers.csv"},
|
|
844
|
+
"rights_claim": {
|
|
845
|
+
"claimed_basis": "public_domain_asserted",
|
|
846
|
+
"claim_evidence_digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
847
|
+
"claim_note": "Replace with the terms you read and their digest."
|
|
848
|
+
},
|
|
849
|
+
"connector": {
|
|
850
|
+
"adapter_id": "public.https",
|
|
851
|
+
"credential_mode": "none",
|
|
852
|
+
"origin": "https://data.example.cz",
|
|
853
|
+
"parameters": [
|
|
854
|
+
{"name": "reader.family_id", "value": "delimited_text"},
|
|
855
|
+
{"name": "reader.family_version", "value": "2.0.0"},
|
|
856
|
+
{
|
|
857
|
+
"name": "reader.decode_options",
|
|
858
|
+
"value": "{\"columns\":[{\"expected_header\":\"dic\",\"index\":0,\"name\":\"dic\"}],\"delimiter\":\",\",\"doublequote\":true,\"encoding\":\"utf-8\",\"escapechar\":null,\"header\":true,\"quotechar\":\"\\\"\",\"skip_blank_rows\":false,\"skip_rows\":0,\"unselected_columns\":\"require_empty\"}"
|
|
859
|
+
}
|
|
860
|
+
]
|
|
861
|
+
},
|
|
862
|
+
"limits": {"max_source_bytes": 16777216, "max_rows": 9000, "max_requests": 1},
|
|
863
|
+
"closed": true
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"name": "vat_status",
|
|
867
|
+
"description": "The register's answer for each VAT id, one SOAP call each.",
|
|
868
|
+
"source_class": "user_api",
|
|
869
|
+
"data_classification": "public",
|
|
870
|
+
"locator": {
|
|
871
|
+
"kind": "https_url",
|
|
872
|
+
"display_locator": "https://adisrws.mfcr.cz/dpr/axis2/services/rozhraniCRPDPH.rozhraniCRPDPHSOAP"
|
|
873
|
+
},
|
|
874
|
+
"rights_claim": {
|
|
875
|
+
"claimed_basis": "terms_of_service_asserted",
|
|
876
|
+
"claim_evidence_digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
877
|
+
"claim_note": "Replace with the terms you read and their digest."
|
|
878
|
+
},
|
|
879
|
+
"connector": {
|
|
880
|
+
"adapter_id": "public.https.collection@2.0.0",
|
|
881
|
+
"credential_mode": "none",
|
|
882
|
+
"origin": "https://adisrws.mfcr.cz",
|
|
883
|
+
"parameters": [
|
|
884
|
+
{"name": "reader.family_id", "value": "xml.tabular"},
|
|
885
|
+
{"name": "reader.family_version", "value": "1.0.0"},
|
|
886
|
+
{
|
|
887
|
+
"name": "reader.decode_options",
|
|
888
|
+
"value": "{\"columns\":[{\"name\":\"answered_dic\",\"required\":true,\"selector\":\"@dic\"},{\"name\":\"unreliable\",\"required\":true,\"selector\":\"@nespolehlivyPlatce\"},{\"name\":\"tax_office\",\"required\":false,\"selector\":\"@cisloFu\"},{\"name\":\"subject_name\",\"required\":false,\"selector\":\"roz:nazevSubjektu/text()\"},{\"name\":\"city\",\"required\":false,\"selector\":\"roz:adresa/roz:mesto/text()\"}],\"namespaces\":{\"roz\":\"http://adis.mfcr.cz/rozhraniCRPDPH/\",\"soapenv\":\"http://schemas.xmlsoap.org/soap/envelope/\"},\"record_selector\":\"/soapenv:Envelope/soapenv:Body/roz:StatusNespolehlivyPlatceRozsirenyResponse/roz:statusPlatceDPH\"}"
|
|
889
|
+
}
|
|
890
|
+
]
|
|
891
|
+
},
|
|
892
|
+
"limits": {"max_source_bytes": 67108864, "max_rows": 9000, "max_requests": 27000},
|
|
893
|
+
"collection": {
|
|
894
|
+
"discovery": {
|
|
895
|
+
"kind": "source_rows",
|
|
896
|
+
"source": "payers",
|
|
897
|
+
"request": {
|
|
898
|
+
"origin": "https://adisrws.mfcr.cz",
|
|
899
|
+
"method": "POST",
|
|
900
|
+
"path_template": "/dpr/axis2/services/rozhraniCRPDPH.rozhraniCRPDPHSOAP",
|
|
901
|
+
"static_query": [],
|
|
902
|
+
"static_headers": [
|
|
903
|
+
{"name": "SOAPAction", "value": "\"http://adis.mfcr.cz/rozhraniCRPDPH/getStatusNespolehlivyPlatceRozsireny\""}
|
|
904
|
+
],
|
|
905
|
+
"parameters": [{"name": "dic", "type": "string", "required": true}],
|
|
906
|
+
"body_text": {
|
|
907
|
+
"content_type": "text/xml; charset=UTF-8",
|
|
908
|
+
"template": "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:roz=\"http://adis.mfcr.cz/rozhraniCRPDPH/\"><soapenv:Body><roz:StatusNespolehlivyPlatceRozsirenyRequest><roz:dic>{dic}</roz:dic></roz:StatusNespolehlivyPlatceRozsirenyRequest></soapenv:Body></soapenv:Envelope>"
|
|
909
|
+
},
|
|
910
|
+
"carry_columns": ["dic"]
|
|
911
|
+
}
|
|
912
|
+
},
|
|
913
|
+
"pages": {
|
|
914
|
+
"allowed_origins": ["https://adisrws.mfcr.cz"],
|
|
915
|
+
"max_pages": 9000,
|
|
916
|
+
"max_fetches_per_run": 9000,
|
|
917
|
+
"min_interval_milliseconds": 1800,
|
|
918
|
+
"retries": 2,
|
|
919
|
+
"revisit": {"kind": "never"}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
],
|
|
924
|
+
"transform": {
|
|
925
|
+
"engine": "duckdb_sql",
|
|
926
|
+
"steps": [
|
|
927
|
+
{
|
|
928
|
+
"step_id": "vat_payer_status",
|
|
929
|
+
"description": "Read the per-row source alone, type the flag and trim the register's padding.",
|
|
930
|
+
"sql": "select dic, unreliable = 'ANO' as unreliable, tax_office, trim(subject_name) as subject_name, trim(city) as city from vat_status"
|
|
931
|
+
}
|
|
932
|
+
]
|
|
933
|
+
},
|
|
934
|
+
"checks": [
|
|
935
|
+
{
|
|
936
|
+
"check_id": "one_row_per_dic",
|
|
937
|
+
"kind": "key_uniqueness",
|
|
938
|
+
"enforcement": "required",
|
|
939
|
+
"columns": ["dic"],
|
|
940
|
+
"description": "One row per VAT id."
|
|
941
|
+
}
|
|
942
|
+
],
|
|
943
|
+
"units": [],
|
|
944
|
+
"timezone": "UTC"
|
|
945
|
+
}
|
|
946
|
+
```
|
|
947
|
+
|
|
796
948
|
### Bulk dump beside a windowed source
|
|
797
949
|
|
|
798
950
|
A windowed source and a `reference` source in one table. A refresh reuses the reference's sealed
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/sources.md
RENAMED
|
@@ -234,13 +234,15 @@ Write the request by these rules.
|
|
|
234
234
|
|
|
235
235
|
- `origin` is the host the request goes to. `pages.allowed_origins` names it too, and nothing
|
|
236
236
|
else when the request presents a key.
|
|
237
|
-
- `method` is `GET` or `POST`. A `POST` states `body_template`,
|
|
237
|
+
- `method` is `GET` or `POST`. A `POST` states `body_template`, or a keyless `body_text`
|
|
238
|
+
([below](#a-text-body-for-a-soap-or-xml-service)), and a `GET` states neither.
|
|
238
239
|
- Each `{name}` placeholder takes the upstream row's cell in the column of that name.
|
|
239
240
|
- Every placeholder is a declared parameter, and every parameter is used.
|
|
240
241
|
- A literal brace is written twice, `{{` or `}}`. Any other brace is refused. A SPARQL query can
|
|
241
242
|
ride in a query value this way.
|
|
242
243
|
- Every parameter and every entry of `carry_columns` is a column of the upstream source.
|
|
243
|
-
- A header value is a literal. The worker writes `Content-Type` itself.
|
|
244
|
+
- A header value is a literal. The worker writes `Content-Type` itself. A SOAP `SOAPAction`
|
|
245
|
+
with a quoted URL value is a literal header like any other.
|
|
244
246
|
- Every literal the request sends is printable ASCII, with no trailing newline.
|
|
245
247
|
- The body nests at most 32 levels deep.
|
|
246
248
|
- `pages.revisit` is `never` or left out: an answer is reused for as long as the server holds it. A
|
|
@@ -256,7 +258,7 @@ breaks a rule above.
|
|
|
256
258
|
|
|
257
259
|
| `credential_mode` | State | Use it for |
|
|
258
260
|
| --- | --- | --- |
|
|
259
|
-
| `none` | no `credential` and no `auth`. A `GET`, or a `POST` with `body_template` (Needs server 4.49) | a public API that takes no key |
|
|
261
|
+
| `none` | no `credential` and no `auth`. A `GET`, or a `POST` with `body_template` (Needs server 4.49) or `body_text` (Needs server 4.71) | a public API that takes no key |
|
|
260
262
|
| `opaque_reference` | `credential.secret_name` and `request.auth` | a key the user enrolled with `mr-data keys set` |
|
|
261
263
|
| `platform` | no `credential` and no `auth` | an endpoint Mostly Right holds a key for |
|
|
262
264
|
|
|
@@ -296,9 +298,50 @@ at 0 there is no second attempt, so the first answer too large fails the run. Ra
|
|
|
296
298
|
|
|
297
299
|
If the API takes a list of ids in one query parameter, add `request.batch` and send up to 100
|
|
298
300
|
members in one call. It keeps every member id and saved answer. It refuses a POST, a
|
|
299
|
-
`body_template` and a `platform` credential.
|
|
301
|
+
`body_template`, a `body_text` and a `platform` credential.
|
|
300
302
|
[`batch`](making-a-table-incremental.md#batch-many-rows-in-one-request) has the grammar.
|
|
301
303
|
|
|
304
|
+
#### A text body for a SOAP or XML service
|
|
305
|
+
|
|
306
|
+
A SOAP service, or any API that reads an XML or plain-text body, takes a keyless `POST` with
|
|
307
|
+
`body_text` in place of `body_template` (Needs server 4.71). Use it only when
|
|
308
|
+
`row_request_text_body` is literal `true` in `studio_capabilities`. Otherwise the client refuses
|
|
309
|
+
with `THIN_GRAMMAR_NOT_SERVED` and names `request/body_text`, marked `(row_request_text_body)`.
|
|
310
|
+
|
|
311
|
+
```json
|
|
312
|
+
"request": {
|
|
313
|
+
"origin": "https://adisrws.mfcr.cz",
|
|
314
|
+
"method": "POST",
|
|
315
|
+
"path_template": "/dpr/axis2/services/rozhraniCRPDPH.rozhraniCRPDPHSOAP",
|
|
316
|
+
"static_query": [],
|
|
317
|
+
"static_headers": [
|
|
318
|
+
{"name": "SOAPAction", "value": "\"http://adis.mfcr.cz/rozhraniCRPDPH/getStatusNespolehlivyPlatceRozsireny\""}
|
|
319
|
+
],
|
|
320
|
+
"parameters": [{"name": "dic", "type": "string", "required": true}],
|
|
321
|
+
"body_text": {
|
|
322
|
+
"content_type": "text/xml; charset=UTF-8",
|
|
323
|
+
"template": "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:roz=\"http://adis.mfcr.cz/rozhraniCRPDPH/\"><soapenv:Body><roz:StatusNespolehlivyPlatceRozsirenyRequest><roz:dic>{dic}</roz:dic></roz:StatusNespolehlivyPlatceRozsirenyRequest></soapenv:Body></soapenv:Envelope>"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
- `content_type` is `text/xml; charset=UTF-8`, `application/soap+xml; charset=UTF-8` or
|
|
329
|
+
`text/plain; charset=UTF-8`, and nothing else. The worker sends it as `Content-Type`. A SOAP 1.2
|
|
330
|
+
service that needs an `action` parameter in its content type cannot be called this way.
|
|
331
|
+
- `template` is 1 to 8,192 characters, sent as UTF-8. Its placeholders and braces follow the rules
|
|
332
|
+
above. Its own markup is sent as written.
|
|
333
|
+
- In the two XML types each value is XML-escaped (`&`, `<`, `>`, `"` and `'`), so a cell cannot
|
|
334
|
+
add an element. In `text/plain` a value is sent as it is.
|
|
335
|
+
- A row whose value holds a control character other than tab, LF or CR sends nothing.
|
|
336
|
+
- `credential_mode` is `none`. A text body is never sent with a key.
|
|
337
|
+
- A text body states no `batch`, so each row is one call. Size the gap and
|
|
338
|
+
`pages.max_fetches_per_run` to the service's own call limits.
|
|
339
|
+
- Decode the answer with an `xml.tabular` pin whose `namespaces` name the envelope's prefixes.
|
|
340
|
+
`xml.tabular` refuses a selector that matches twice in one record, so read a repeated child
|
|
341
|
+
with a second source whose `record_selector` ends at that child.
|
|
342
|
+
|
|
343
|
+
[One SOAP request per row](patterns.md#one-soap-request-per-row) is a complete recipe.
|
|
344
|
+
|
|
302
345
|
A collection whose calls are paid for is sized from evidence, not from its ceiling. Run
|
|
303
346
|
`mr-data recipe forecast RECIPE_ID --digest DIGEST --json` before any `--full`, and cap
|
|
304
347
|
`pages.max_fetches_per_run` at the suggestion it prints. A cap near the real count refuses a corpus
|
|
@@ -146,6 +146,7 @@ CAPABILITY_NAMES: tuple[str, ...] = (
|
|
|
146
146
|
"keyless_window",
|
|
147
147
|
"keyless_post",
|
|
148
148
|
"table_source_snapshot",
|
|
149
|
+
"row_request_text_body",
|
|
149
150
|
)
|
|
150
151
|
|
|
151
152
|
#: What a Studio that answers 404 or 405 from the explanation routes serves.
|
|
@@ -1387,6 +1388,12 @@ def not_served_detail(missing: Sequence[tuple[str, str]], why: str, *, known: bo
|
|
|
1387
1388
|
"Wait for the server deployment that enables hourly snapshot captures; do not "
|
|
1388
1389
|
"silently change the requested capture interval."
|
|
1389
1390
|
)
|
|
1391
|
+
if any(capability == "row_request_text_body" for _, capability in missing):
|
|
1392
|
+
return (
|
|
1393
|
+
f"not available on this server yet: {listed}. {why}. Nothing was registered. "
|
|
1394
|
+
"Wait for the server deployment that sends a per-row text body (contract 4.71.0); a "
|
|
1395
|
+
"per-row request has no other way to send an XML or plain-text body."
|
|
1396
|
+
)
|
|
1390
1397
|
if any(capability == "table_source_snapshot" for _, capability in missing):
|
|
1391
1398
|
return (
|
|
1392
1399
|
f"not available on this server yet: {listed}. {why}. Nothing was registered. "
|
|
@@ -1449,7 +1456,8 @@ def gated_grammar(document: Mapping[str, Any]) -> list[tuple[str, str]]:
|
|
|
1449
1456
|
request, or a per-row request under ``credential_mode: none``. Its pointer is the method. A
|
|
1450
1457
|
``table.version@1.0.0`` source that states a ``window`` or a ``row_filter`` (4.70.0) needs
|
|
1451
1458
|
``table_source_snapshot``, as Studio's capabilities say: a client that reads false registers
|
|
1452
|
-
no snapshot on a table source.
|
|
1459
|
+
no snapshot on a table source. A per-row request that states ``body_text`` (4.71.0) needs
|
|
1460
|
+
``row_request_text_body``, pointed at that member.
|
|
1453
1461
|
"""
|
|
1454
1462
|
|
|
1455
1463
|
gated: list[tuple[str, str]] = []
|
|
@@ -1527,6 +1535,9 @@ def gated_grammar(document: Mapping[str, Any]) -> list[tuple[str, str]]:
|
|
|
1527
1535
|
and request.get("method") == "POST"
|
|
1528
1536
|
):
|
|
1529
1537
|
gated.append((f"/sources/{index}/collection/discovery/request/method", "keyless_post"))
|
|
1538
|
+
if isinstance(request, Mapping) and "body_text" in request:
|
|
1539
|
+
pointer = f"/sources/{index}/collection/discovery/request/body_text"
|
|
1540
|
+
gated.append((pointer, "row_request_text_body"))
|
|
1530
1541
|
return gated
|
|
1531
1542
|
|
|
1532
1543
|
|
|
@@ -168,6 +168,17 @@ KEYLESS_API_ADAPTER_ID = "public.https.api@1.0.0"
|
|
|
168
168
|
#: credential of the predict binding it names, and sends no per-row request.
|
|
169
169
|
PREDICT_ADAPTER_ID = PREDICT_ADAPTER
|
|
170
170
|
|
|
171
|
+
#: The content types ``recipe.schema.json#/$defs/collection_row_request_body_text`` admits (4.71.0).
|
|
172
|
+
ROW_REQUEST_TEXT_CONTENT_TYPES: frozenset[str] = frozenset(
|
|
173
|
+
{
|
|
174
|
+
"text/xml; charset=UTF-8",
|
|
175
|
+
"application/soap+xml; charset=UTF-8",
|
|
176
|
+
"text/plain; charset=UTF-8",
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
#: The longest ``body_text.template``, in characters.
|
|
180
|
+
ROW_REQUEST_TEXT_MAX_CHARS = 8_192
|
|
181
|
+
|
|
171
182
|
#: One per-row template token, read left to right: an escaped brace, a ``{name}`` placeholder, a
|
|
172
183
|
#: lone brace, or a run of text with no brace. The registration route and the worker read every
|
|
173
184
|
#: per-row template with this same expression, and no per-row template pattern of
|
|
@@ -1361,7 +1372,8 @@ def _row_request_credentials(sources: Any) -> list[Finding]:
|
|
|
1361
1372
|
``auth``, which says how that secret is presented.
|
|
1362
1373
|
- ``none`` states no ``auth``.
|
|
1363
1374
|
|
|
1364
|
-
Whatever the mode, a request sends a GET with no
|
|
1375
|
+
Whatever the mode, a request sends a GET with no body, or a POST with a ``body_template``. A
|
|
1376
|
+
POST under ``none`` may send a ``body_text`` in its place (4.71.0), and no other mode may.
|
|
1365
1377
|
``batch`` stays GET-only, which :func:`_row_request_batch_coherence` holds.
|
|
1366
1378
|
|
|
1367
1379
|
Each is a schema rule, so each finding carries :data:`DOCUMENT_INVALID`. Which binding admits
|
|
@@ -1470,18 +1482,89 @@ def _row_request_credentials(sources: Any) -> list[Finding]:
|
|
|
1470
1482
|
"name one with 'opaque_reference', or drop it",
|
|
1471
1483
|
)
|
|
1472
1484
|
)
|
|
1485
|
+
if request is not None and "body_text" in request:
|
|
1486
|
+
findings.extend(_row_request_body_text(request["body_text"], at=f"{at}/body_text"))
|
|
1487
|
+
if mode != "none":
|
|
1488
|
+
findings.append(
|
|
1489
|
+
Finding(
|
|
1490
|
+
DOCUMENT_INCOHERENT,
|
|
1491
|
+
f"{at}/body_text",
|
|
1492
|
+
"a text body is sent only with credential_mode none",
|
|
1493
|
+
)
|
|
1494
|
+
)
|
|
1473
1495
|
if request is not None:
|
|
1474
|
-
findings.extend(
|
|
1496
|
+
findings.extend(
|
|
1497
|
+
_request_method(request, at=at, subject="A per-row request", text_body=True)
|
|
1498
|
+
)
|
|
1499
|
+
return findings
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
def _row_request_body_text(body: Any, *, at: str) -> list[Finding]:
|
|
1503
|
+
"""A per-row ``body_text``: exactly a closed ``content_type`` and a non-empty ``template``."""
|
|
1504
|
+
|
|
1505
|
+
if not isinstance(body, Mapping):
|
|
1506
|
+
return [Finding(DOCUMENT_INVALID, at, "is not one JSON object")]
|
|
1507
|
+
findings = [
|
|
1508
|
+
Finding(DOCUMENT_INVALID, f"{at}/{_escape(str(member))}", "is not a body_text member")
|
|
1509
|
+
for member in body
|
|
1510
|
+
if member not in ("content_type", "template")
|
|
1511
|
+
]
|
|
1512
|
+
content_type = body.get("content_type")
|
|
1513
|
+
if content_type not in ROW_REQUEST_TEXT_CONTENT_TYPES:
|
|
1514
|
+
findings.append(
|
|
1515
|
+
Finding(
|
|
1516
|
+
DOCUMENT_INVALID,
|
|
1517
|
+
f"{at}/content_type",
|
|
1518
|
+
f"is {content_type!r}, and a text body is sent as one of "
|
|
1519
|
+
f"{', '.join(sorted(ROW_REQUEST_TEXT_CONTENT_TYPES))}",
|
|
1520
|
+
)
|
|
1521
|
+
)
|
|
1522
|
+
template = body.get("template")
|
|
1523
|
+
if (
|
|
1524
|
+
not isinstance(template, str)
|
|
1525
|
+
or not 1 <= len(template) <= ROW_REQUEST_TEXT_MAX_CHARS
|
|
1526
|
+
or any(ord(character) < 0x20 and character not in "\t\n\r" for character in template)
|
|
1527
|
+
):
|
|
1528
|
+
findings.append(
|
|
1529
|
+
Finding(
|
|
1530
|
+
DOCUMENT_INVALID,
|
|
1531
|
+
f"{at}/template",
|
|
1532
|
+
f"must be 1 to {ROW_REQUEST_TEXT_MAX_CHARS} characters with no control "
|
|
1533
|
+
"character but tab, LF and CR",
|
|
1534
|
+
)
|
|
1535
|
+
)
|
|
1475
1536
|
return findings
|
|
1476
1537
|
|
|
1477
1538
|
|
|
1478
|
-
def _request_method(
|
|
1539
|
+
def _request_method(
|
|
1540
|
+
request: Mapping[str, Any], *, at: str, subject: str, text_body: bool = False
|
|
1541
|
+
) -> list[Finding]:
|
|
1479
1542
|
"""The generic request rule: a GET states no ``body_template``, and a POST states one.
|
|
1480
1543
|
|
|
1481
1544
|
``subject`` begins the sentence a wrong method earns. A request that states no method is the
|
|
1482
|
-
schema's missing-member fault, and nothing is read off it here.
|
|
1545
|
+
schema's missing-member fault, and nothing is read off it here. ``text_body`` admits a per-row
|
|
1546
|
+
request's ``body_text`` as a POST's one body in place of ``body_template``.
|
|
1483
1547
|
"""
|
|
1484
1548
|
|
|
1549
|
+
if text_body and "body_text" in request:
|
|
1550
|
+
if "body_template" in request:
|
|
1551
|
+
return [
|
|
1552
|
+
Finding(
|
|
1553
|
+
DOCUMENT_INVALID,
|
|
1554
|
+
f"{at}/body_text",
|
|
1555
|
+
"is stated beside body_template, and a POST sends one body; drop one",
|
|
1556
|
+
)
|
|
1557
|
+
]
|
|
1558
|
+
if request.get("method") != "POST":
|
|
1559
|
+
return [
|
|
1560
|
+
Finding(
|
|
1561
|
+
DOCUMENT_INVALID,
|
|
1562
|
+
f"{at}/body_text",
|
|
1563
|
+
"is stated on a request that is not a POST. Make it a POST, or drop it",
|
|
1564
|
+
)
|
|
1565
|
+
]
|
|
1566
|
+
return []
|
|
1567
|
+
|
|
1485
1568
|
if "method" not in request:
|
|
1486
1569
|
return []
|
|
1487
1570
|
method = request.get("method")
|
|
@@ -1613,6 +1696,9 @@ def _row_request_templates(sources: Any) -> list[Finding]:
|
|
|
1613
1696
|
check(f"{at}/static_query/{position}/value", pair.get("value"))
|
|
1614
1697
|
if "body_template" in request:
|
|
1615
1698
|
walk(f"{at}/body_template", request["body_template"])
|
|
1699
|
+
body_text = request.get("body_text")
|
|
1700
|
+
if isinstance(body_text, Mapping):
|
|
1701
|
+
check(f"{at}/body_text/template", body_text.get("template"))
|
|
1616
1702
|
return findings
|
|
1617
1703
|
|
|
1618
1704
|
|
|
@@ -1731,6 +1817,10 @@ def _request_placeholder_sites(request: Mapping[str, Any], at: str) -> list[tupl
|
|
|
1731
1817
|
|
|
1732
1818
|
if "body_template" in request:
|
|
1733
1819
|
walk(f"{at}/body_template", request["body_template"])
|
|
1820
|
+
body_text = request.get("body_text")
|
|
1821
|
+
if isinstance(body_text, Mapping):
|
|
1822
|
+
pointer = f"{at}/body_text/template"
|
|
1823
|
+
sites.extend((pointer, name) for name in _placeholders(body_text.get("template")))
|
|
1734
1824
|
return sites
|
|
1735
1825
|
|
|
1736
1826
|
|
|
@@ -43,9 +43,12 @@ KEYLESS_POST = "keyless_post"
|
|
|
43
43
|
#: Served by a 4.70.0 API: whether it registers a ``table.version@1.0.0`` source that states a
|
|
44
44
|
#: daily ``window.snapshot`` and a ``row_filter``. An older API omits it.
|
|
45
45
|
TABLE_SOURCE_SNAPSHOT = "table_source_snapshot"
|
|
46
|
+
#: Served by a 4.71.0 API, which lets a keyless per-row POST send a ``body_text``. An older API
|
|
47
|
+
#: omits it.
|
|
48
|
+
ROW_REQUEST_TEXT_BODY = "row_request_text_body"
|
|
46
49
|
#: The capabilities whose grammar an older API's schema refuses with 422 before it can answer.
|
|
47
50
|
SCHEMA_GATED_CAPABILITIES: frozenset[str] = frozenset(
|
|
48
|
-
{KEYLESS_WINDOW, KEYLESS_POST, TABLE_SOURCE_SNAPSHOT}
|
|
51
|
+
{KEYLESS_WINDOW, KEYLESS_POST, TABLE_SOURCE_SNAPSHOT, ROW_REQUEST_TEXT_BODY}
|
|
49
52
|
)
|
|
50
53
|
CAPABILITY_NAMES: tuple[str, ...] = (
|
|
51
54
|
ROW_FILTER,
|
|
@@ -55,6 +58,7 @@ CAPABILITY_NAMES: tuple[str, ...] = (
|
|
|
55
58
|
ROW_REQUEST_BATCH,
|
|
56
59
|
KEYLESS_WINDOW,
|
|
57
60
|
KEYLESS_POST,
|
|
61
|
+
ROW_REQUEST_TEXT_BODY,
|
|
58
62
|
HOURLY_SNAPSHOT_REFRESH,
|
|
59
63
|
TABLE_SOURCE_SNAPSHOT,
|
|
60
64
|
)
|
|
@@ -139,6 +143,7 @@ __all__ = [
|
|
|
139
143
|
"PER_ROW_REVISIT_INTERVAL",
|
|
140
144
|
"ROW_FILTER",
|
|
141
145
|
"ROW_REQUEST_BATCH",
|
|
146
|
+
"ROW_REQUEST_TEXT_BODY",
|
|
142
147
|
"SCHEMA_GATED_CAPABILITIES",
|
|
143
148
|
"SNAPSHOT_REFRESH",
|
|
144
149
|
"TABLE_SOURCE_SNAPSHOT",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "mostlyright-thin-table-search-contract.v1",
|
|
3
|
-
"source_commit": "
|
|
3
|
+
"source_commit": "3bd6bb3b812fbf6bea4777e252f1408a287fef5e",
|
|
4
4
|
"recipe_search_definition": "recipe_search",
|
|
5
5
|
"$defs": {
|
|
6
6
|
"common.safe_integer": {
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4.py
RENAMED
|
@@ -147,8 +147,8 @@ from mostlyright.data_harness.thin.v4_matching import CONTRACT_PATHS as MATCHING
|
|
|
147
147
|
#: ``JOB_INVALID`` outright, which in production was every refresh a collection epoch was offered
|
|
148
148
|
#: for rather than only the collection runs. This package must not reach a Studio older than the
|
|
149
149
|
#: commit it pins; ``docs/V4-WORKER-PROTOCOL.md`` states it beside the layout's own ordering rule.
|
|
150
|
-
PINNED_V4_OPENAPI_SOURCE_SHA256 = "
|
|
151
|
-
PINNED_V4_CONTRACT_VERSION = "4.
|
|
150
|
+
PINNED_V4_OPENAPI_SOURCE_SHA256 = "18ffc34ec04bb718886535374b92e8e65943b945527573d0cf93a66ae2f503fb"
|
|
151
|
+
PINNED_V4_CONTRACT_VERSION = "4.71.0"
|
|
152
152
|
|
|
153
153
|
#: The ``schema_version`` every command body that predates 4.14.0 stamps: ``dataset activity``,
|
|
154
154
|
#: ``table rename``, ``table archive`` and ``dataset archive``. It is the number the 0.25 line
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/agents/openai.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/boundaries.md
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/commands.md
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/live-run.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/one-install.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/promote.md
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/readers.md
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/receipts.md
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/recipe-test.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/skills/mr-data-build/references/transforms.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/__init__.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/agent_protocol.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/canonical.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/key_seam.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/page_coverage.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/session_probes.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/skill_assets.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/table_manifest.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/__init__.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/activity.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/backoff.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/delivery.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/download.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/probe.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/recipe.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/research.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/router.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/runs.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/session.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/stream.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/support.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/transport.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_public.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_query.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_reader.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_runs.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_search.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_stream.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/thin/v4_tables.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/__init__.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/attendance.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/cloud_auth.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/credentials.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/login.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/path_kind.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/plain_file.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/remediation.py
RENAMED
|
File without changes
|
{mostlyright_data-0.31.44 → mostlyright_data-0.31.46}/src/mostlyright/data_harness/ux/render.py
RENAMED
|
File without changes
|