mostlyright-data 0.31.25__tar.gz → 0.31.27__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.
Files changed (130) hide show
  1. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/PKG-INFO +1 -1
  2. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/SKILL.md +5 -1
  3. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/commands.md +3 -3
  4. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/enriching-with-small-models.md +14 -1
  5. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/preparing-table-search.md +246 -7
  6. mostlyright_data-0.31.27/skills/mr-data-build/references/satellite-signals.md +486 -0
  7. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/sources.md +2 -1
  8. mostlyright_data-0.31.27/src/mostlyright/data_harness/thin/dataset_layout.py +356 -0
  9. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/enrichment.py +65 -7
  10. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/table_search_contract.json +2 -2
  11. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4.py +2 -2
  12. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_datasets.py +77 -3
  13. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_search.py +281 -37
  14. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_search_contract.py +46 -8
  15. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/vocabulary.py +3 -3
  16. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/render.py +3 -0
  17. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/.gitignore +0 -0
  18. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/README.md +0 -0
  19. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/pyproject.toml +0 -0
  20. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/scripts/hatch_build.py +0 -0
  21. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/agents/openai.yaml +0 -0
  22. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/1-open-the-page-and-the-link-to-it-in-the-first-message.md +0 -0
  23. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/2-brief-two-to-four-questions-each-with-a-recommended-answer.md +0 -0
  24. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/3-probe-read-a-source-before-committing-to-it.md +0 -0
  25. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/4-decide-say-what-you-chose-what-you-refused-and-ask-one-question.md +0 -0
  26. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/5-draft-one-recipe-document-one-call.md +0 -0
  27. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/6-build-one-run-sized-to-acquire-every-measured-source-whole.md +0 -0
  28. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/7-interrogate-ask-the-run-what-it-actually-delivered.md +0 -0
  29. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/8-fix-revise-the-document-and-register-it-again.md +0 -0
  30. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/9-present-only-what-survived-inspection-with-caveats.md +0 -0
  31. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/agent-protocol.md +0 -0
  32. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/autonomous-delivery.md +0 -0
  33. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/before-the-first-tool-call.md +0 -0
  34. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/boundaries.md +0 -0
  35. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/cloud-authentication-preflight.md +0 -0
  36. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/live-run.md +0 -0
  37. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/making-a-table-incremental.md +0 -0
  38. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/narrating-the-run.md +0 -0
  39. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/not-hosted-yet.md +0 -0
  40. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/one-install.md +0 -0
  41. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/patterns.md +0 -0
  42. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/prediction-labels.md +0 -0
  43. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/promote.md +0 -0
  44. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/readers.md +0 -0
  45. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/receipts.md +0 -0
  46. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/recipe-test.md +0 -0
  47. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/recording-a-stream-venue.md +0 -0
  48. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/recovering-an-import-failure.md +0 -0
  49. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/reference-pages.md +0 -0
  50. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/required-protocol.md +0 -0
  51. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/source-credentials.md +0 -0
  52. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/the-one-thing-to-say-about-the-skill-itself.md +0 -0
  53. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/transforms.md +0 -0
  54. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/user-communication-contract.md +0 -0
  55. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/references/writing-a-decision-record.md +0 -0
  56. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/skills/mr-data-build/scripts/write_research_notebook.py +0 -0
  57. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/__init__.py +0 -0
  58. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/agent_protocol.py +0 -0
  59. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/canonical.py +0 -0
  60. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/key_seam.py +0 -0
  61. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/page_coverage.py +0 -0
  62. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/part_check_evidence.py +0 -0
  63. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/session_probes.py +0 -0
  64. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/skill_assets.py +0 -0
  65. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/table_manifest.py +0 -0
  66. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/__init__.py +0 -0
  67. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/activity.py +0 -0
  68. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/backoff.py +0 -0
  69. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/categories.py +0 -0
  70. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/dataset-categories-v1.json +0 -0
  71. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/delivery.py +0 -0
  72. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/description_shape.py +0 -0
  73. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/download.py +0 -0
  74. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/fast_features.py +0 -0
  75. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/matching_benchmark.py +0 -0
  76. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/probe.py +0 -0
  77. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/progress_rate.py +0 -0
  78. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/progress_vocabulary.py +0 -0
  79. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/recipe.py +0 -0
  80. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/recipe_brief.py +0 -0
  81. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/recipe_explain.py +0 -0
  82. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/recipe_forecast.py +0 -0
  83. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/recipe_lint.py +0 -0
  84. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/recipe_test.py +0 -0
  85. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/refresh_rehearsal.py +0 -0
  86. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/release_check.py +0 -0
  87. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/research.py +0 -0
  88. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/router.py +0 -0
  89. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/run_diagnose.py +0 -0
  90. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/run_prefix.py +0 -0
  91. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/runs.py +0 -0
  92. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/session.py +0 -0
  93. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/stream.py +0 -0
  94. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/stream_venue.py +0 -0
  95. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/studio_capabilities.py +0 -0
  96. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/support.py +0 -0
  97. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/table_view.py +0 -0
  98. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/transport.py +0 -0
  99. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/user_agent.py +0 -0
  100. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_artifacts.py +0 -0
  101. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_catalog.py +0 -0
  102. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_connected.py +0 -0
  103. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_connections.py +0 -0
  104. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_dataset_covers.py +0 -0
  105. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_handoff.py +0 -0
  106. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_matching.py +0 -0
  107. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_narrative.py +0 -0
  108. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_public.py +0 -0
  109. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_query.py +0 -0
  110. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_reader.py +0 -0
  111. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_runs.py +0 -0
  112. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_secrets.py +0 -0
  113. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_stream.py +0 -0
  114. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/thin/v4_tables.py +0 -0
  115. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/__init__.py +0 -0
  116. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/attendance.py +0 -0
  117. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/clarification.py +0 -0
  118. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/cloud_auth.py +0 -0
  119. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/commands/__init__.py +0 -0
  120. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/commands/auth.py +0 -0
  121. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/commands/clarify.py +0 -0
  122. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/commands/login.py +0 -0
  123. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/commands/whoami.py +0 -0
  124. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/credential_native.py +0 -0
  125. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/credential_store.py +0 -0
  126. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/credentials.py +0 -0
  127. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/login.py +0 -0
  128. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/path_kind.py +0 -0
  129. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/plain_file.py +0 -0
  130. {mostlyright_data-0.31.25 → mostlyright_data-0.31.27}/src/mostlyright/data_harness/ux/remediation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mostlyright-data
3
- Version: 0.31.25
3
+ Version: 0.31.27
4
4
  Summary: Mostly Right hosted CLI for reviewed datasets
5
5
  Project-URL: Homepage, https://mostlyright.md/
6
6
  Project-URL: Documentation, https://mostlyright.md/docs/guides/cli/
@@ -331,7 +331,9 @@ chat, and pass on its answer.
331
331
  tests incremental refresh only, so its refusal does not test a scheduled whole-table rebuild.
332
332
  Download and verify artifacts when the user requested bytes.
333
333
  10. Search is on by default for the dataset's main table. Supporting tables such as lookups and
334
- code lists do not need it. Enable it, inspect search readiness and test meaningful queries against
334
+ code lists do not need it. When each main-table row holds long text people search inside
335
+ (transcripts, filings), the dataset's search runs on a passages table instead
336
+ ([passages table](references/preparing-table-search.md#search-a-dataset-through-a-passages-table)). Enable it, inspect search readiness and test meaningful queries against
335
337
  the observed version as [search preparation](references/preparing-table-search.md) describes.
336
338
  Search preparation runs independently: pending or failed indexing never means the data build
337
339
  failed, and declared metadata alone never proves observed search quality. Before delivery,
@@ -352,6 +354,7 @@ chat, and pass on its answer.
352
354
  | Connector or collection | [Sources](references/sources.md) |
353
355
  | One request per row of another source, such as a decision model scoring each row | [Per-row requests](references/sources.md#authoring-a-per-row-request) |
354
356
  | Which small models this deployment serves, the rule-first ladder, and classify and extract sources | [Enriching with small models](references/enriching-with-small-models.md) |
357
+ | Activity at named places from satellite images: parking, oil storage, construction, plant heat, ships, trucks, water | [Satellite signals](references/satellite-signals.md) |
355
358
  | SQL and joins | [Transforms](references/transforms.md) |
356
359
  | Source credentials | [Credentials](references/source-credentials.md) |
357
360
  | Live stream recording | [Streams](references/recording-a-stream-venue.md) |
@@ -361,6 +364,7 @@ chat, and pass on its answer.
361
364
  | Refresh cadence | [Promotion and cadence](references/promote.md) |
362
365
  | Dataset notes and evidence blocks | [Decision records](references/writing-a-decision-record.md) |
363
366
  | Search configuration, example queries and readiness | [Search preparation](references/preparing-table-search.md) |
367
+ | One search per dataset over long text, through a passages table | [Passages table](references/preparing-table-search.md#search-a-dataset-through-a-passages-table) |
364
368
  | Exact schemas and worked recipes | [Reference index](references/reference-pages.md) |
365
369
 
366
370
  ## Needs server 4.14
@@ -22,7 +22,7 @@ run in full.
22
22
  | `mr-data public` | Read Mostly Right's public dataset catalogue. `public search "QUERY"` ranks published datasets (`--topic`, `--limit` and `--cursor` narrow and page it), `show SLUG` reads one overview, `tables SLUG` lists its table identifiers, `schema TABLE_ID` reads one table's schema, `sample TABLE_ID` prints its published preview rows, `lookup "QUERY"` is the connector search shape and `fetch SLUG` returns the dataset's Markdown document. Those seven need no login. `query TABLE_ID`, with `--body` or `--body-file`, and `download-url TABLE_ID` do need `mr-data login`: they ask Cloud, with the device key, to run one query over a public table and to say how it can be downloaded. Preview rows are not a query, and no table bytes pass through the command. |
23
23
  | `mr-data connected` | `connected list` shows the public datasets connected to this workspace and `connected add SLUG` connects one by its slug. It needs `mr-data login`: both ask Cloud, with the device key, over the routes MCP's `list_connected_datasets` and `connect_dataset` use. |
24
24
  | `mr-data ask` | `ask "QUESTION" [--run RUN_ID ...] [--failure-code CODE]` asks the Mostly Right support agent one question and waits for the answer; `--no-wait` prints the question id at once and `ask status QUESTION_ID` reads it later. It needs `mr-data login` and a workspace the agent is switched on for: while it is off the answer is `THIN_CLOUD_SUPPORT_AGENT_DISABLED`, which is final. The agent may file a problem for the Mostly Right team and prints its reference (`SR-N`). |
25
- | `mr-data dataset` | Bring the dataset page into existence before there is anything on it, then fill it in while somebody watches. `dataset create --name TEXT` mints it and prints the `dataset_id`, unless the user's own request already has an empty dataset open, in which case it answers `open_request_reused` with that `dataset_id` and mints nothing (`--separate` mints a new one for a different dataset); `dataset show ID` reads it back; `dataset set ID --name TEXT --topics "a,b,c" --license ID --description-file F` writes the title, the descriptive tags, the SPDX licence and the description under the version it was read at, retrying once if somebody else wrote first, and an empty `--topics` or `--license` takes that value off the page; send `--name` and `--topics` whenever you send `--description-file`, because a description sent on its own can make the server write a new title and new tags, and read `changed` and `written_by_studio` on the receipt for every field the write moved; a saved write whose public sync fails exits 2 and reports `public_projection_synced: false` — use `dataset sync ID` to retry that sync without writing the dataset again; `dataset note ID --heading H --blocks-file B` writes one cell of the decision record that OUTLIVES every run, and `--list` reads it back; `dataset watch ID` follows the page's own event stream; `dataset activity ID --phase P --message TEXT` says what is happening right now, silently, and is never a chat message and never a cell; `dataset publish ID [--mode public|link|private]` says who can read the dataset — `public` lists it in the public directory and serves it at an address anybody can read, `link` serves it at an unlisted address, `private` takes it back to the workspace — and `dataset publish ID --show` reads that back without changing it; `dataset archive ID --confirm-name TITLE` retires the page and frees its title, deleting nothing. |
25
+ | `mr-data dataset` | Bring the dataset page into existence before there is anything on it, then fill it in while somebody watches. `dataset create --name TEXT` mints it and prints the `dataset_id`, unless the user's own request already has an empty dataset open, in which case it answers `open_request_reused` with that `dataset_id` and mints nothing (`--separate` mints a new one for a different dataset); `dataset show ID` reads it back; `dataset set ID --name TEXT --topics "a,b,c" --license ID --description-file F` writes the title, the descriptive tags, the SPDX licence and the description under the version it was read at, retrying once if somebody else wrote first, and an empty `--topics` or `--license` takes that value off the page; send `--name` and `--topics` whenever you send `--description-file`, because a description sent on its own can make the server write a new title and new tags, and read `changed` and `written_by_studio` on the receipt for every field the write moved; a saved write whose public sync fails exits 2 and reports `public_projection_synced: false` — use `dataset sync ID` to retry that sync without writing the dataset again; `dataset note ID --heading H --blocks-file B` writes one cell of the decision record that OUTLIVES every run, and `--list` reads it back; `dataset watch ID` follows the page's own event stream; `dataset activity ID --phase P --message TEXT` says what is happening right now, silently, and is never a chat message and never a cell; `dataset publish ID [--mode public|link|private]` says who can read the dataset — `public` lists it in the public directory and serves it at an address anybody can read, `link` serves it at an unlisted address, `private` takes it back to the workspace — and `dataset publish ID --show` reads that back without changing it; `dataset layout ID` reads the dataset's layout from Cloud: its sections, `default_table_id` (the table the Data tab opens on), `search_table_id` (the table the dataset's search runs on), the main-table choice and the dataset's tables; `dataset layout ID --set LAYOUT.json` saves `{"version": 1, "default_table_id", "search_table_id", "sections": [{"id", "title", "collapsed", "tables": [{"table_id", "title", "description"}]}]}`, `--dry-run` has Cloud check it and save nothing, replacing a saved layout needs its revision as `--expected-revision`, and a first layout takes `--expected-main-table TABLE_ID|none`, the main-table choice the read printed; a stale one is refused `THIN_DATASET_LAYOUT_LAYOUT_CHANGED`, and it uses the device key; `dataset archive ID --confirm-name TITLE` retires the page and frees its title, deleting nothing. |
26
26
  | `mr-data recipe` | Register one recipe document (dataset, question, table plan, sources, transform, checks and units) in one call, and print the identifiers the server derived. The document is read first and every fault comes back in one refusal, each with the JSON pointer that names it. `--no-lint` sends it as written instead. A recipe that misses a feature that sets how fast a run fetches (a stated `pages.concurrency` under 64, a per-row request open to `batch`, a page walk open to `pagination.parallel`, or a Parquet file open to a ranged read) is refused `THIN_RECIPE_SLOW`, with each feature's pointer and fix, before anything is sent. Apply the fixes, or pass `--accept-slow "REASON"` with one sentence on why the slow path is right for this source. The receipt prints the reason and the features it covered. Registration refuses `THIN_BRIEF_MISSING` when the dataset's record carries no answered question and no delegation, and `THIN_RECIPE_DATASET_UNBOUND` when the document names no `dataset.id`. `--delegated "their words"` writes the delegation onto the dataset and registers in the same command, and clears the first of those two and never the second. `mr-data recipe show ID` reads one back. `mr-data recipe explain FILE` (or a recipe identifier) lists every reason its table can or cannot refresh, each with a rule code and the server's suggested repair, and exits 2 when one blocks it. `mr-data recipe forecast RECIPE_ID` says what one run would ask of each source before it runs, and exits 3 when the run would overrun today's platform quota or one attempt. `--digest` is optional there, and without it the digest the recipe was registered with is forecast. `mr-data recipe readiness --table TABLE_ID --current-only` reads the revision one table runs now. The explanation's `fast_features` names each fast feature the recipe uses or misses, with a one-line fix. [Making a table incremental](making-a-table-incremental.md#the-loop-explain-forecast-run-diagnose) says when to use each. |
27
27
  | `mr-data cover` | Generate and attach one branded 1200×630 dataset cover. Give it the dataset ID and what the image should depict; the server fixes the model, single-color style, curated random palette, dimensions and storage. |
28
28
  | `mr-data run` | Start one run against a registered recipe, named as `--recipe RECIPE_ID`, with `--digest RECIPE_DIGEST` when you want the run to assert which bytes it means. Neither is positional. The digest is the bare hex the registration receipt printed. Left out, the run reads it back from the registered recipe, which is the same value, because a recipe identifier names one revision. A full of a recipe that misses a fetch-speed feature is refused `THIN_RECIPE_SLOW`, as registration is, unless `--accept-slow "REASON"` is passed. Other modes print the missed features and are not refused. The mode is one of six: `sample`, `full`, `refresh`, `backfill`, `compact` and `replay`. Four have a shorthand flag (`--sample`, `--full`, `--refresh`, `--backfill`) and two do not, so write `--mode MODE`, which is accepted for every one of them. A refresh executes only the server's persisted source-action plan, and a plan shape it does not refresh returns `RESYNC_REQUIRED` before acquisition. [Which plans refresh](making-a-table-incremental.md#which-plans-refresh) lists them, and `mr-data recipe explain` says which one a table is. Use `mr-data table resync TABLE_ID --request-id UUID` for an explicit full source reread, retaining that UUID if the response is uncertain. `--backfill` states the exact window with `--window START END`. `--mode replay --sources-from RUN_ID` asks the server to run the registered revision against the RETAINED RAW INPUTS of one named successful run of the same table: nothing is fetched from this computer, nothing is acquired again, the result is compared against that run and never becomes the live version, and it neither asks for nor records an approval. Where the server has replay switched off, or the named run is not successful, not the same table, or no longer retains its inputs, it answers a typed refusal. Report the code rather than retrying in another mode. `--sources-from` on any other mode is refused `THIN_ARGUMENT_INVALID` before anything is sent. `--max-rows` and `--max-source-bytes` bound ONE SOURCE rather than the finished table. `--max-rows` cuts rows after a source is fetched and decoded, so it does not shorten a collection walk. A sample with no clamp is refused: `CLAMPS_REQUIRED` from the server, and `THIN_REQUEST_INVALID` from this client first. A table's first succeeded run goes live, truncated or not, so test on a scratch table as [the probe rule](3-probe-read-a-source-before-committing-to-it.md#the-probe-rule-test-on-a-scratch-table-never-on-the-real-table) says. A large run is held for a size confirmation (not a charge), which `--confirm` settles and whose printed `confirm_command` re-states every argument the request carried. `--approve-full RUN_ID` releases the full an existing legacy sample-first pair is holding once its preview has succeeded, naming either half of the pair. Where the deployment still wants a person at a browser it answers `THIN_INTERACTIVE_HUMAN_REQUIRED` and names the run page. `--retry RUN_ID` resumes a failed or cancelled progressive full from the pages it saved (`resume_capture_run_id` and the ceilings it carried; `retry_of_run_id` as well only when the server admits a named retry). A failure that says the recipe must change is refused before anything is posted. Any other failed run is tried again when its triple carries `room_fault: true`, re-stating that run's own coordinate and ceilings and naming the failed run so the server starts a new attempt, and is refused with the triple and the next step the server's recovery category names when it is not. `room_fault` is the server's `recovery.room_fault` where the server states one. A source that kept refusing (`SOURCE_RATE_LIMITED`, `SOURCE_HTTP_5XX`, `SOURCE_PROXY_BUSY`) is sent anyway: the server admits it 120 seconds after the failure and refuses `RUN_RETRY_TOO_SOON` with a Retry-After before then, so wait that long and run `--retry` again. `--cancel RUN` stops one. |
@@ -30,7 +30,7 @@ run in full.
30
30
  | `mr-data runs` | Report this workspace's own runs: identifier, mode, state and creation time, plus the failure triple of any that failed and whether that failure was the execution room's. `--dataset DATASET_ID` narrows it to one dataset's runs, so "what have I run for this dataset?" is one scoped read, and a value that is not an identifier is refused `THIN_ARGUMENT_INVALID`. `--status` and `--mode` narrow it too and are refused `THIN_ARGUMENT_INVALID` for a word outside the seven states or the six modes; the three combine. The server narrows before it cuts a page, so a filtered page holds the newest runs that match however many runs the workspace has. `--limit` says how many, and pages are followed to reach it; a listing that does not end says how many were read and suggests a smaller `--limit` or a narrower filter. The answer prints `next_cursor`, and `--cursor` continues from it. |
31
31
  | `mr-data watch` | Stream one run's live progress under the durable event type of each stage, resuming across stream cuts. Exits non-zero when the run failed. `mr-data watch RUN_ID RUN_ID ...` follows up to 16 runs at once, prints one line as each ends, and returns once all have finished with one receipt per run (`failed_run_ids`, `refused_run_ids`); it exits 2 when any run failed and 1 when a run could not be watched. `--from-seq` and `--last-event-id` resume one run only. A full run that succeeds carries the same `delivery` block as `mr-data status`, and the multi-run receipt merges every run's steps. |
32
32
  | `mr-data query` | Run one bounded read-only SQL statement over a finished run's own table and print the rows. Name the table `run_table` in the SQL, whatever the recipe called it. Bounded on rows, on answer bytes and on time, and refused by name when a bound is crossed. When no worker can answer, the refusal names `mr-data download RUN_ID` as `fallback_command`, which brings the table here to read locally. The question is asked through Mostly Right Cloud; while its usage paywall is on and the workspace is unsubscribed, each answered query counts toward the person's monthly allowance, and a spent allowance refuses `THIN_USAGE_LIMIT`. A refusal after the question was queued names its `query_id`; running the same command again reads that query back. |
33
- | `mr-data search` | `search VERB` prepares and tests versioned search for a new table through the server; no model or index runs on this computer. The verbs are `inspect`, `sample`, `values`, `propose`, `configure`, `validate`, `add-cases`, `explain`, `preview`, `evaluate`, `estimate`, `build`, `status`, `activate`, `cancel`, `rollback`, `locate` and `try`. `inspect`, `propose` and `validate` also take `--recipe FILE` before registration. `validate --spec` checks a spec and its evaluation cases against the pinned contract without sending anything. `locate` resolves evaluation-case rows to locators, and `try` runs one query against the live search. A build returns promptly with job coordinates, and an operation the server does not serve answers a typed capability error. [Prepare search](preparing-table-search.md) says how it fits a build. |
33
+ | `mr-data search` | `search VERB` prepares and tests versioned search for a new table through the server; no model or index runs on this computer. The verbs are `inspect`, `sample`, `values`, `propose`, `configure`, `validate`, `add-cases`, `explain`, `preview`, `evaluate`, `estimate`, `build`, `status`, `activate`, `cancel`, `rollback`, `locate`, `try` and `query`. `inspect`, `propose` and `validate` also take `--recipe FILE` before registration. `validate --spec` checks a spec and its evaluation cases against the pinned contract without sending anything. A top-level spec member the pinned contract does not name is a warning, and `validate` (with a table or `--recipe`) and `configure` still send the spec to the server. `locate` resolves evaluation-case rows to locators, `try` runs one query against the live search, and `query` searches a table through Cloud's search route as its page does. `try` and `query` keep every member of the answer they do not name (on a collapsed page `matched_via`, `group_size` and `collapsed_by`), and `--group row\|collapse` asks for one row per match or one result per value of the spec's `collapse` column. `--group` and grouped results need a server that serves contract 4.61.0 and takes `group`; an older one answers 400 `invalid_request` to `--group`, so run without it there. A build returns promptly with job coordinates, and an operation the server does not serve answers a typed capability error. [Prepare search](preparing-table-search.md) says how it fits a build. |
34
34
  | `mr-data peek` | Print the columns, their logical types and the first rows of one run's table. The type comes off the run's own column profile where the preview carries none, so `type` is null only for a run that sealed no profile. |
35
35
  | `mr-data receipt` | Print what one run recorded about how it was built: every source it fetched and what those bytes hashed to, the coverage it delivered, and the members of its raw snapshot. |
36
36
  | `mr-data checks` | Report how each check the recipe declared came out — the name, whether it passed, what it found. Exits non-zero when one did not pass. |
@@ -41,7 +41,7 @@ run in full.
41
41
  | `mr-data parts` | List one table version's parts — the identifier, the row count, the byte size and the recorded bounds of each — so a training loader can shard them across workers and read a table no single file should hold. `--version` names a version rather than the live one, and `--from`/`--to` keep only the parts a value range cannot rule out. Nothing is downloaded by listing them; the pattern is under [Reading a table that is made of parts](7-interrogate-ask-the-run-what-it-actually-delivered.md#reading-a-table-that-is-made-of-parts). |
42
42
  | `mr-data diff` | Compare two runs and say what changed. |
43
43
  | `mr-data connections` | List saved workspace connections and their current recipe coordinates; `--dataset ID` filters to connections granted to that dataset. No credential values are returned. |
44
- | `mr-data models` | List the small models a recipe can call on this deployment: each task (classify, extract, match), whether it is served, and each binding's route, pinned model, rate, today's usage and a request body to start from. `models suggest RUN_ID` reads the preview one run sealed and names, column by column, a deterministic derivation or a model call that would improve the table, with whether its model is served. Both read only and spend no model call. [Enriching with small models](enriching-with-small-models.md) says what to do with the answer. |
44
+ | `mr-data models` | List the small models a recipe can call on this deployment: each task (classify, extract, match, and `observe` for satellite signals), whether it is served, and each binding's route, pinned model, rate, today's usage and a request body to start from. `models suggest RUN_ID` reads the preview one run sealed and names, column by column, a deterministic derivation or a model call that would improve the table, with whether its model is served. Both read only and spend no model call. [Enriching with small models](enriching-with-small-models.md) says what to do with the answer. |
45
45
  | `mr-data keys` | Enrol a source credential by name, list the names with their created and rotated times, and delete one. `keys set` reads the value from a file or from standard input and never from the command line; no command prints a value back. |
46
46
  | `mr-data stream` | Record a public `wss://` venue so a build can read it. `stream document register --file F` admits the connector document, `stream registry create --digest D` admits a set of them, `stream probe` listens briefly and seals nothing, `stream capture --seconds N` records a bounded window, and `stream subscribe` keeps recording. `stream subscription {show|pause|resume|stop} ID` retains the legacy full-record interface. `stream subscription quiescence ID` reads the bounded server-computed proof; `pause-cas` and `resume-cas` read its ETag and make one conditional bounded write. An ambiguous CAS failure is not retried until a fresh invocation observes the resource again. `stream status ID` reads a capture or probe, and `stream recordings --document-digest D` names what a build could read and until when. `--seconds` is at most 600. `mr-data run` takes no duration: a build reads sealed batches and is bounded by them. |
47
47
  | `mr-data open` | Mint a single-use, short-lived address that continues this session in a browser at one dashboard path, and print it. `--open` hands it to the platform opener. The credential decides who mints: a device credential — what `mr-data login` stores — mints at Cloud, and a personal access token mints at the server. |
@@ -7,7 +7,7 @@ could be better while you probe, say what you found, and recommend what to add.
7
7
 
8
8
  ### What this deployment serves
9
9
 
10
- Run `mr-data models --json` once per session, before the brief message. It lists three tasks and
10
+ Run `mr-data models --json` once per session, before the brief message. It lists four tasks and
11
11
  whether each is served here, read from the server's platform credential listing.
12
12
 
13
13
  | Task | What it does | Binding |
@@ -15,6 +15,7 @@ whether each is served here, read from the server's platform credential listing.
15
15
  | classify | Labels each row from a text column with yes/no or choice questions: a topic, a category, a sentiment, a flag no keyword rule decides. Each answer carries a probability per label. | `gemini-decisions` (Mostly Right Classify: Gemini Decision 1) first; `classify` (Clef, self-hosted) and `openrouter-decisions` (TypeSafe's Jev) answer the same questions |
16
16
  | extract | Pulls named fields (names, amounts, dates, places) out of page or document text into columns. Every value appears verbatim in the input or is dropped. | `extract` (the extraction model, NuExtract-based) |
17
17
  | match | Links the same entity across tables or within one. | none yet: `planned` |
18
+ | observe | Measures activity at a place from satellite images, one series per place: parking, oil storage, construction, stored vehicles, plant heat, truck traffic, water area, ships, crop health, snow cover. | `sat` ([writing a sat source](#writing-a-sat-source)) |
18
19
 
19
20
  Each served binding comes with its route, its pinned `model`, its rate, today's usage and quota,
20
21
  and a `request_template`. Copy `origin`, `method`, `path_template` and `model` from the listing
@@ -184,6 +185,18 @@ many extracted records, so do not declare page identity alone as a unique contra
184
185
  Each answer is grounded: every value appears verbatim in the input, and `spans` say where. A row
185
186
  whose text states none of the fields returns no record, which is an answer, not a failure.
186
187
 
188
+ ### Writing a sat source
189
+
190
+ A `sat` source takes a place, not a text column. Its upstream is a `closed: true` list of
191
+ places with `lat` and `lon` columns, and the listing's `request_template` sends one request per
192
+ place with a fixed `from` and no `to`. Copy its `pages_template` too: 120 second timeout, 3
193
+ retries and a six-day freshness bound, under a table-level `rebuild` with
194
+ `min_interval_seconds` 604,800, so a weekly rebuild asks each place again. Read the answer's
195
+ `rows` with `json.tabular` 1.1.0, all 13 members required. A place it cannot measure is one
196
+ row whose `status` names why; filter `status = 'ok'` in the transform when the table should
197
+ hold measurements only. [Satellite signals](satellite-signals.md) has the signals, the
198
+ worked recipe, the refusal codes and what never to promise.
199
+
187
200
  ### Saying it
188
201
 
189
202
  Name the model by what it does, not by its binding: "a small classification model reads each
@@ -58,7 +58,9 @@ missing search support only when `error` begins with
58
58
  capability evidence. That includes 401, 403, 429, timeouts and invalid responses. Resolve it.
59
59
 
60
60
  Search is on by default for the dataset's main table, whether or not the brief mentions it.
61
- Supporting tables such as lookups, code lists and dimension tables do not need it. A succeeded
61
+ Supporting tables such as lookups, code lists and dimension tables do not need it. A passages
62
+ table that serves the dataset's search over long text needs it, and the main table then may not
63
+ ([passages table](#search-a-dataset-through-a-passages-table)). A succeeded
62
64
  full run's `delivery` block names the search step whenever the run's table has no search, a
63
65
  search whose build failed included. The server marks no main table, so you judge which one it is.
64
66
  Skip the step for a supporting table, while the capability is missing, or when the table has
@@ -331,8 +333,14 @@ mr-data search validate --recipe recipe.json --json
331
333
 
332
334
  `--spec` alone checks the file against the pinned server contract and sends nothing. `--recipe`
333
335
  checks `table.search` the same way, then asks the server to check it against the declared columns.
334
- `configure` runs the same local check. When the server serves a newer spec member than this client
335
- knows, pass `configure --no-local-check` and let the server decide.
336
+ `configure` runs the same local check. A top-level spec member the pinned contract does not name
337
+ is a warning, listed under `local.spec_warnings`, and the spec still goes to the server, which
338
+ accepts or refuses it. Every other finding stops the command before anything is sent, including
339
+ an unknown member inside a known one such as `planner` or `collapse`.
340
+ `configure --no-local-check` sends a spec even then. `validate --spec` without a table sends
341
+ nothing, so no server judges such a member: the answer is `valid: null` with
342
+ `checked_by_server: false` and the member under `unverified_members`, and it exits 3. Validate
343
+ with a table ID or `--recipe` to settle it.
336
344
  The server also checks the column types: a `multi_value_columns` entry, an `emoji` role and every
337
345
  column of a soft preference set must name a declared string column.
338
346
  The `local` block lists each refusal with a JSON pointer. Repair every diagnostic, then run
@@ -395,7 +403,12 @@ ID, which `mr-data public tables DATASET_SLUG --json` lists. `try` refuses with
395
403
  can lag a new live version by a few minutes. Retry then. A query holds at most 16 words.
396
404
 
397
405
  `try` prints the rows, the applied `plan`, the `planner` report, the `retrieval` mode, the
398
- `corrected` query after a typo fix, the service stage timings and the Cloud timings. `path: scan`
406
+ `corrected` query after a typo fix, the service stage timings and the Cloud timings. Each row is
407
+ flat: `row_id` and the display columns side by side, then any other member the server gave the
408
+ row. A row whose member shares a column's name is printed as the server sent it,
409
+ `{row_id, fields, ...}`. Members of the answer that `try` does not name are kept as sent. Without
410
+ `--json`, `try` and `query` print each row on one line. Grouped results and `--group` are
411
+ described at the end of section 15, with the server they need. `path: scan`
399
412
  means the package did not answer and the fallback scan did. The `note` says why. Fix that before
400
413
  you judge ranking. `try` runs on published tables only, against their live version.
401
414
 
@@ -439,6 +452,11 @@ Fix each miss in the recipe, then run the whole battery again:
439
452
  Keep the battery with the recipe and rerun it after every rebuild. Record the pass count and each
440
453
  known miss in the dataset's verification notes.
441
454
 
455
+ For a [passages table](#search-a-dataset-through-a-passages-table), `search explain` judges the
456
+ plans as above. Also run the battery's paraphrase and topic queries through
457
+ `mr-data search query TABLE_ID --query "..." --json` and judge the results by entity: the calls
458
+ that should answer come back, one result each, and the quoted passage is the one that answers.
459
+
442
460
  ## 12. Write evaluation cases
443
461
 
444
462
  A spec with semantic columns needs evaluation cases before a revision can activate. Each case is
@@ -567,14 +585,235 @@ while someone types, without the planner. `--page-size` is 1 to 100 (default 20)
567
585
  for the number of matching rows. To read the next page, save the answer's `plan` to a file and
568
586
  pass it with `--plan` beside `--cursor NEXT_CURSOR`; a cursor continues one plan.
569
587
 
570
- The answer carries the rows as `{row_id, fields}`, the applied `plan`, the `planner` report, the
571
- `retrieval` mode, `next_cursor`, the `package` it read, which `service` answered, the stage
572
- timings under `service_timings_ms` and Cloud's `Server-Timing` under `cloud_timings_ms`.
588
+ The answer carries the rows as `{row_id, fields}` plus any other member the server gave a row,
589
+ the applied `plan`, the `planner` report, the `retrieval` mode, `next_cursor`, the `package` it
590
+ read, which `service` answered, the stage timings under `service_timings_ms` and Cloud's
591
+ `Server-Timing` under `cloud_timings_ms`. Other members of Cloud's answer are kept as Cloud sent
592
+ them.
573
593
 
574
594
  A table without a ready package is refused with Cloud's `search_unavailable` and a reason:
575
595
  `preparing` (retry after the time it gives), `not_public`, `no_package`, or the server's own reason.
576
596
  A plan or cursor the service refuses answers `invalid_plan` with diagnostics.
577
597
 
598
+ `search query` and `search try` keep every member of the answer they do not name, so a member a
599
+ newer server adds is in `--json` as the server sent it.
600
+
601
+ ### Grouped results
602
+
603
+ **Grouped results need a server that serves contract 4.61.0 and takes the `group` request
604
+ member.** An older one answers `--group` with 400 `invalid_request`, and without the flag it
605
+ returns ungrouped rows. The client says so when a request with `--group` is refused 400: run the
606
+ same command without `--group`.
607
+
608
+ On such a server, a table whose spec declares `collapse`
609
+ ([passages table](#search-a-dataset-through-a-passages-table)) answers one row per group: the best matching row, `group_size` (how many
610
+ ranked rows the group has in the ranked window) and `matched_via` (up to `matched_via_max` of the
611
+ group's other matching rows, each `{row_id, fields}`). The page carries `collapsed_by`, the
612
+ column it was grouped on, and `next_cursor` and `count` are over groups. Without `--group` it
613
+ groups whenever the spec declares `collapse`; `--group row` asks for every matching row on its
614
+ own, and `--group collapse` asks for groups. Without `--json`, a grouped result prints "+N more
615
+ with the same COLUMN" and the first two of the other matches under it. On an older server none
616
+ of this happens: rows come back one per match, with no `collapsed_by`, and `count` counts rows.
617
+
618
+ ## Search a dataset through a passages table
619
+
620
+ **One result per call needs a server that serves contract 4.61.0 and takes `group`** (see
621
+ [grouped results](#grouped-results)). An older one answers 400 `invalid_request` to `--group` and
622
+ returns ungrouped rows without it, so until then the dataset's search answers one result per
623
+ passage. Each step below gives what to do on such a server.
624
+
625
+ Use this when each row of the dataset's main table holds long text that people search inside: an
626
+ earnings call transcript, a filing, a hearing, a report. One embedding per row cannot stand for an
627
+ hour of conversation, so a question about one remark misses the call that holds it. Cut the text
628
+ into passages in a second table, search that table, and group its results back to one result per
629
+ row of the main table. Do not use it for short text: a product description or an abstract fits in
630
+ the main table's own `semantic_columns`.
631
+
632
+ The worked example below has two tables:
633
+
634
+ - `earnings_calls`, the main table: one row per call, key `call_id`, with `company`, `ticker`,
635
+ `call_date` and `fiscal_quarter`.
636
+ - `transcript_passages`: one row per passage, key `passage_id`, carrying `call_id` and the call's
637
+ own columns.
638
+
639
+ ### Cut the passages in SQL
640
+
641
+ A passage is one speaker in one section (prepared remarks or Q&A), about 150 to 250 words. Split a
642
+ long turn into pieces of roughly equal size. Drop the operator's lines and any passage under about
643
+ 20 words: they match many queries and answer none. Carry the entity key and every column of the
644
+ entity people filter or sort on, because a filter or a sort runs on the passage rows and sees only
645
+ the columns a passage carries.
646
+
647
+ This transform reads a `turns` relation (`call_id`, `turn_index`, `section`, `speaker`,
648
+ `speaker_role`, `text`) and the `earnings_calls` columns, for example through a
649
+ `table.version@1.0.0` source ([table sources](sources.md#reading-another-table-of-this-workspace)):
650
+
651
+ ```json
652
+ "transform": {
653
+ "engine": "duckdb_sql",
654
+ "steps": [
655
+ {
656
+ "step_id": "words",
657
+ "sql": "select call_id, turn_index, section, speaker, speaker_role, string_split(regexp_replace(trim(text), '\\s+', ' ', 'g'), ' ') as words from turns where speaker_role is distinct from 'operator' and text is not null"
658
+ },
659
+ {
660
+ "step_id": "sized",
661
+ "sql": "select *, greatest(1, cast(round(len(words) / 200.0) as integer)) as pieces from words"
662
+ },
663
+ {
664
+ "step_id": "pieces",
665
+ "sql": "select call_id, turn_index, section, speaker, speaker_role, piece, array_to_string(list_slice(words, piece * size + 1, (piece + 1) * size), ' ') as passage_text from (select *, cast(ceil(len(words) / pieces) as integer) as size from sized), unnest(range(0, pieces)) as p(piece)"
666
+ },
667
+ {
668
+ "step_id": "passages",
669
+ "sql": "select concat(p.call_id, '-', cast(p.turn_index as varchar), '-', cast(p.piece as varchar)) as passage_id, p.call_id, c.company, c.ticker, c.call_date, c.fiscal_quarter, p.section, p.speaker, p.speaker_role, p.passage_text, len(string_split(p.passage_text, ' ')) as word_count from pieces p join earnings_calls c on c.call_id = p.call_id where len(string_split(p.passage_text, ' ')) >= 20"
670
+ }
671
+ ]
672
+ }
673
+ ```
674
+
675
+ A 450-word turn becomes two passages of 225 words, and a 120-word turn stays one passage. A turn
676
+ with no `speaker_role` is kept. Take the
677
+ operator's `speaker_role` value, and any other boilerplate turn such as a safe-harbour statement,
678
+ from the built table with `mr-data search values TABLE_ID --column speaker_role`, not from this
679
+ example. Run the bounded test of Gate 3 on a scratch table and read the passages before the full.
680
+
681
+ ### Declare the passages table's search
682
+
683
+ ```json
684
+ {
685
+ "schema_version": "table-search-spec.v1",
686
+ "keyword_columns": ["passage_text", "company", "ticker", "speaker"],
687
+ "semantic_columns": ["passage_text"],
688
+ "aliases": [{"phrase": "analyst questions", "column": "section", "operator": "eq", "value": "qa"}],
689
+ "sort_aliases": [{"phrase": "latest", "column": "call_date", "direction": "desc"}],
690
+ "planner": {"enabled": true, "external_context_allowed": false},
691
+ "field_roles": {"identifier": "passage_id", "title": "company", "person": "speaker",
692
+ "date": "call_date", "description": "passage_text"},
693
+ "display_columns": ["passage_id", "call_id", "company", "ticker", "call_date",
694
+ "fiscal_quarter", "speaker", "passage_text"],
695
+ "filterable_columns": ["call_id", "ticker", "call_date", "fiscal_quarter", "section",
696
+ "speaker_role"],
697
+ "sortable_columns": ["call_date"],
698
+ "collapse": {"column": "call_id", "matched_via_max": 3}
699
+ }
700
+ ```
701
+
702
+ - `semantic_columns` holds the passage text alone, so each passage gets one embedding of its own
703
+ words. The keyword columns add the names people type.
704
+ - `collapse.column` is the entity key. The server checks it when it registers a recipe, creates a
705
+ revision or validates a spec: it must be a declared string or integer column that the package
706
+ displays, which means one of `display_columns`, or, when the spec declares no
707
+ `display_columns`, one of `grid_columns`, the identifier role column or a lexical column (the
708
+ title role and `keyword_columns`, or `semantic_columns` when those are empty). This client's
709
+ local check reads the member's shape only, so run `search validate TABLE_ID --spec` or
710
+ `--recipe` to have the column checked. `matched_via_max` (0 to 8) is how many of a call's other
711
+ matching passages each result lists.
712
+ - Adding or changing `collapse` on a revision reuses the built vectors: nothing is re-embedded.
713
+ - Only a version-3 search package answers in groups, and only when the built package displays
714
+ the collapse column. Otherwise the table answers one row per passage, as before.
715
+ - Leave the `popularity` role out unless the brief names one: it also changes what `row_id`
716
+ means (see the evaluation cases below).
717
+ - Set `external_context_allowed` as section 8 says.
718
+
719
+ Validate it as section 9 says. Contract 4.61.0, which this client is pinned to, admits `collapse`
720
+ in a recipe's `table.search` and on a search revision alike. A server before 4.61.0 treats the
721
+ two differently:
722
+
723
+ - On a search revision (`mr-data search configure --spec`) it accepts `collapse` and ignores it.
724
+ - In a recipe's `table.search` its build worker refuses the recipe ("search must be a closed
725
+ table-search-spec.v1 document").
726
+
727
+ So on such a server keep `collapse` out of the recipe and declare it on a revision with
728
+ `search configure --spec`; the answers stay passage rows until the server serves 4.61.0. On a
729
+ 4.61.0 server either place works. Check with `mr-data search query TABLE_ID --query "..." --json`,
730
+ where `TABLE_ID` is the passages table's public ID, or on a private table of this workspace the
731
+ table ID the dataset's Use panel shows. A page the server grouped carries
732
+ `collapsed_by: "call_id"`; a page without it was not grouped.
733
+
734
+ ### Make it the dataset's one search
735
+
736
+ The dataset layout names the table the Data tab opens on (`default_table_id`) and the table the
737
+ dataset's search runs on (`search_table_id`). Read the layout and the table IDs first:
738
+
739
+ ```sh
740
+ mr-data dataset layout DATASET_ID --json
741
+ ```
742
+
743
+ Write the layout with the IDs it lists:
744
+
745
+ ```json
746
+ {
747
+ "version": 1,
748
+ "default_table_id": "EARNINGS_CALLS_TABLE_ID",
749
+ "search_table_id": "TRANSCRIPT_PASSAGES_TABLE_ID",
750
+ "sections": [
751
+ {"id": "calls", "title": "Calls", "collapsed": false,
752
+ "tables": [{"table_id": "EARNINGS_CALLS_TABLE_ID"}]},
753
+ {"id": "passages", "title": "Transcript passages", "collapsed": true,
754
+ "tables": [{"table_id": "TRANSCRIPT_PASSAGES_TABLE_ID",
755
+ "description": "One speaker's passage of a call, about 200 words."}]}
756
+ ]
757
+ }
758
+ ```
759
+
760
+ ```sh
761
+ mr-data dataset layout DATASET_ID --set layout.json --dry-run --json
762
+ mr-data dataset layout DATASET_ID --set layout.json --json
763
+ ```
764
+
765
+ A layout already saved is replaced with `--expected-revision N`, the `layout.revision` the read
766
+ printed. For the first layout, pass `--expected-main-table` with the `chosen_main_table_id` the
767
+ read printed (or `none`), so Cloud refuses the save if the main-table choice changed since you
768
+ read it. `THIN_DATASET_LAYOUT_INVALID_INPUT` on a file that names `search_table_id` most likely
769
+ means this deployment does not take the member yet: save the layout without it and say so in the
770
+ dataset's Sources and decisions note. The main table needs no search of its own when the passages table
771
+ serves the dataset's search.
772
+
773
+ ### Write the evaluation cases
774
+
775
+ Cases name passage rows, and the evaluator runs uncollapsed, by meaning alone. Write paraphrase and
776
+ hard-negative cases as section 12 says, each naming the passage that answers it.
777
+
778
+ On a public table, resolve them with `mr-data search locate PASSAGES_TABLE_ID --public-table
779
+ PUBLIC_ID --id PASSAGE_ID`, with `passage_id` as the identifier role. On a private table `locate`
780
+ cannot read the rows. Then take a locator from the `row_id` of a search answer:
781
+
782
+ 1. Run `mr-data search query TABLE_ID --query "..." --group row --json`. A 4.61.0 server answers
783
+ one row per passage.
784
+ 2. If it is refused 400 `invalid_request`, the server does not take `group` yet and does not
785
+ group: run the same command without `--group`, which answers one row per passage there.
786
+ 3. Without `--group`, a 4.61.0 server groups. A grouped row's `row_id` and each `matched_via`
787
+ entry's `row_id` are passage rows too, but a group lists at most `matched_via_max` others, so
788
+ use `--group row` to see every passage.
789
+
790
+ Use a `row_id` under these conditions:
791
+
792
+ - A result's `row_id` is the search package's row number. When the spec has no `popularity` role,
793
+ the package numbers rows in table order, so `row_id` is the row's position in the sealed
794
+ version, counted from 0 across the parts in part order. With a `popularity` role the package
795
+ numbers rows by popularity, and `row_id` is not a position: do not use it.
796
+ - Convert the position to `[part, row]` with each part's `record_count` from the manifest
797
+ (`mr-data download RUN_ID --kind table_manifest`): subtract the counts in part order until the
798
+ remainder is less than the next part's count. A table of one part has the locator `[0, row_id]`.
799
+ - The answer must come from the sealed version you configure the cases on. Check its
800
+ `table_version_id`, then run `search validate TABLE_ID --version VERSION_ID --spec ... --cases
801
+ ...`, which refuses a locator outside that version.
802
+
803
+ ### What it cannot do
804
+
805
+ - A result is a passage row carrying the call's columns, not a row of `earnings_calls`. Its
806
+ `row_id` and `fields` are the best passage's, and a column the passages do not carry cannot be
807
+ shown, filtered or sorted on.
808
+ - On a 4.61.0 server that groups, `count` counts calls; on an older server it counts passages.
809
+ Aggregates and `group_by` run on passage rows on both.
810
+ - Until the server serves 4.61.0 and takes `group`, results are one per passage, so one call can
811
+ fill a page.
812
+ - Each passage has one embedding. A point made across two passages is found by each part, not as
813
+ one.
814
+ - The embedding build takes longer as the passage count grows, because every passage is
815
+ embedded.
816
+
578
817
  ## Rules
579
818
 
580
819
  - Never emulate search locally, and never claim readiness from a declaration.