matrx-records 0.1.1__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 (146) hide show
  1. matrx_records-0.1.1/.gitignore +345 -0
  2. matrx_records-0.1.1/PKG-INFO +121 -0
  3. matrx_records-0.1.1/README.md +94 -0
  4. matrx_records-0.1.1/matrx_records/__init__.py +49 -0
  5. matrx_records-0.1.1/matrx_records/agent/__init__.py +0 -0
  6. matrx_records-0.1.1/matrx_records/agent/args.py +1722 -0
  7. matrx_records-0.1.1/matrx_records/agent/cache.py +318 -0
  8. matrx_records-0.1.1/matrx_records/agent/context.py +124 -0
  9. matrx_records-0.1.1/matrx_records/agent/dataset_arm.py +475 -0
  10. matrx_records-0.1.1/matrx_records/agent/decisions.py +263 -0
  11. matrx_records-0.1.1/matrx_records/agent/definition.py +414 -0
  12. matrx_records-0.1.1/matrx_records/agent/guidance.py +241 -0
  13. matrx_records-0.1.1/matrx_records/agent/masking.py +106 -0
  14. matrx_records-0.1.1/matrx_records/agent/picklist_arm.py +194 -0
  15. matrx_records-0.1.1/matrx_records/agent/split.py +787 -0
  16. matrx_records-0.1.1/matrx_records/agent/tool.py +2070 -0
  17. matrx_records-0.1.1/matrx_records/big_values.py +785 -0
  18. matrx_records-0.1.1/matrx_records/build_gate.py +186 -0
  19. matrx_records-0.1.1/matrx_records/enrich/__init__.py +33 -0
  20. matrx_records-0.1.1/matrx_records/enrich/runner.py +277 -0
  21. matrx_records-0.1.1/matrx_records/enrich/store.py +326 -0
  22. matrx_records-0.1.1/matrx_records/errors.py +271 -0
  23. matrx_records-0.1.1/matrx_records/field_types.py +422 -0
  24. matrx_records-0.1.1/matrx_records/held.py +344 -0
  25. matrx_records-0.1.1/matrx_records/knobs.py +121 -0
  26. matrx_records-0.1.1/matrx_records/merge/__init__.py +109 -0
  27. matrx_records-0.1.1/matrx_records/merge/context_bridge.py +366 -0
  28. matrx_records-0.1.1/matrx_records/merge/declaration.py +258 -0
  29. matrx_records-0.1.1/matrx_records/merge/graph.py +146 -0
  30. matrx_records-0.1.1/matrx_records/merge/provenance.py +162 -0
  31. matrx_records-0.1.1/matrx_records/merge/record_scope.py +269 -0
  32. matrx_records-0.1.1/matrx_records/merge/resolver.py +1210 -0
  33. matrx_records-0.1.1/matrx_records/merge/sink.py +204 -0
  34. matrx_records-0.1.1/matrx_records/merge/store_binding.py +583 -0
  35. matrx_records-0.1.1/matrx_records/merge/trail.py +93 -0
  36. matrx_records-0.1.1/matrx_records/merge/transforms.py +302 -0
  37. matrx_records-0.1.1/matrx_records/movers/__init__.py +60 -0
  38. matrx_records-0.1.1/matrx_records/movers/bags.py +299 -0
  39. matrx_records-0.1.1/matrx_records/movers/base.py +1171 -0
  40. matrx_records-0.1.1/matrx_records/movers/census.py +330 -0
  41. matrx_records-0.1.1/matrx_records/movers/cms_field_schema.py +84 -0
  42. matrx_records-0.1.1/matrx_records/movers/common.py +216 -0
  43. matrx_records-0.1.1/matrx_records/movers/plan.py +445 -0
  44. matrx_records-0.1.1/matrx_records/movers/refile_whole_values.py +173 -0
  45. matrx_records-0.1.1/matrx_records/movers/report.py +180 -0
  46. matrx_records-0.1.1/matrx_records/movers/runner.py +187 -0
  47. matrx_records-0.1.1/matrx_records/movers/source.py +158 -0
  48. matrx_records-0.1.1/matrx_records/movers/typemap.py +378 -0
  49. matrx_records-0.1.1/matrx_records/nodes/__init__.py +0 -0
  50. matrx_records-0.1.1/matrx_records/nodes/records_nodes.py +1574 -0
  51. matrx_records-0.1.1/matrx_records/principal.py +381 -0
  52. matrx_records-0.1.1/matrx_records/record_changes.py +223 -0
  53. matrx_records-0.1.1/matrx_records/server/__init__.py +51 -0
  54. matrx_records-0.1.1/matrx_records/server/enumeration.py +320 -0
  55. matrx_records-0.1.1/matrx_records/server/gateway.py +555 -0
  56. matrx_records-0.1.1/matrx_records/store/__init__.py +43 -0
  57. matrx_records-0.1.1/matrx_records/store/client.py +6979 -0
  58. matrx_records-0.1.1/matrx_records/store/reach.py +158 -0
  59. matrx_records-0.1.1/matrx_records/store/relation_words.py +235 -0
  60. matrx_records-0.1.1/matrx_records/store/scopes.py +872 -0
  61. matrx_records-0.1.1/pyproject.toml +58 -0
  62. matrx_records-0.1.1/tests/__init__.py +0 -0
  63. matrx_records-0.1.1/tests/auth_lock_sampler.py +178 -0
  64. matrx_records-0.1.1/tests/conftest.py +750 -0
  65. matrx_records-0.1.1/tests/fixture_org.py +560 -0
  66. matrx_records-0.1.1/tests/fixtures/records_definition_before_lean.json +1621 -0
  67. matrx_records-0.1.1/tests/test_a_board_on_an_existing_table_asks_first.py +88 -0
  68. matrx_records-0.1.1/tests/test_a_copied_table_is_written_where_its_switch_says.py +171 -0
  69. matrx_records-0.1.1/tests/test_a_delete_and_a_new_table_wait_too.py +370 -0
  70. matrx_records-0.1.1/tests/test_a_filtered_read_reads_the_whole_table.py +100 -0
  71. matrx_records-0.1.1/tests/test_a_forged_trigger_id_never_skips_the_hold.py +459 -0
  72. matrx_records-0.1.1/tests/test_a_held_change_is_one_sentence_and_the_job_goes_on.py +26 -0
  73. matrx_records-0.1.1/tests/test_a_held_dataset_write_is_held_not_an_error.py +121 -0
  74. matrx_records-0.1.1/tests/test_a_legacy_boolean_becomes_a_checkbox.py +136 -0
  75. matrx_records-0.1.1/tests/test_a_list_can_say_what_its_rows_are.py +48 -0
  76. matrx_records-0.1.1/tests/test_a_record_graph_lands_or_nothing_does.py +642 -0
  77. matrx_records-0.1.1/tests/test_a_record_graph_lands_or_nothing_does_red.py +199 -0
  78. matrx_records-0.1.1/tests/test_a_record_read_says_when_the_row_was_made.py +65 -0
  79. matrx_records-0.1.1/tests/test_a_refusals_detail_reaches_the_agent_as_data.py +49 -0
  80. matrx_records-0.1.1/tests/test_a_refused_queue_says_the_stores_words.py +55 -0
  81. matrx_records-0.1.1/tests/test_a_related_row_named_by_its_words_is_measured_by_its_id.py +51 -0
  82. matrx_records-0.1.1/tests/test_a_runs_first_steps_read_the_change_as_its_owner.py +278 -0
  83. matrx_records-0.1.1/tests/test_a_scope_cell_kept_as_a_file_is_never_handed_cut.py +143 -0
  84. matrx_records-0.1.1/tests/test_a_session_names_its_conversation_to_the_store.py +79 -0
  85. matrx_records-0.1.1/tests/test_a_table_is_found_and_ensured_by_the_store.py +54 -0
  86. matrx_records-0.1.1/tests/test_a_table_named_by_its_name_is_found_in_one_call.py +96 -0
  87. matrx_records-0.1.1/tests/test_a_text_of_any_size_simply_saves.py +343 -0
  88. matrx_records-0.1.1/tests/test_a_wait_is_a_row_a_person_can_answer.py +407 -0
  89. matrx_records-0.1.1/tests/test_a_wait_is_a_row_a_person_can_answer_red.py +219 -0
  90. matrx_records-0.1.1/tests/test_a_wait_on_a_synced_tables_rows_is_refused_not_filed.py +117 -0
  91. matrx_records-0.1.1/tests/test_a_workflow_step_never_eats_another_consumers_change.py +199 -0
  92. matrx_records-0.1.1/tests/test_a_workflows_own_rule_writes_as_its_owner.py +169 -0
  93. matrx_records-0.1.1/tests/test_agent_reads_span_organizations.py +195 -0
  94. matrx_records-0.1.1/tests/test_an_agent_does_the_whole_job_with_the_lean_records_tool.py +473 -0
  95. matrx_records-0.1.1/tests/test_an_agent_nobody_asks_writes_for_its_person.py +97 -0
  96. matrx_records-0.1.1/tests/test_an_agents_declaration_lands_or_refuses.py +188 -0
  97. matrx_records-0.1.1/tests/test_an_agents_outputs_table_waits_behind_include_app_tables.py +69 -0
  98. matrx_records-0.1.1/tests/test_an_aggregate_never_answers_null_as_success.py +90 -0
  99. matrx_records-0.1.1/tests/test_an_answer_about_a_table_says_what_its_import_left_out.py +82 -0
  100. matrx_records-0.1.1/tests/test_an_output_lands_through_the_chain_door.py +122 -0
  101. matrx_records-0.1.1/tests/test_boot_assertion_against_the_branch.py +161 -0
  102. matrx_records-0.1.1/tests/test_checklist_propose_against_the_store.py +273 -0
  103. matrx_records-0.1.1/tests/test_client_lane_fixes_against_the_store.py +492 -0
  104. matrx_records-0.1.1/tests/test_context_items_are_fields.py +264 -0
  105. matrx_records-0.1.1/tests/test_copy_again_puts_back_the_maker_the_owner_stamp_took.py +107 -0
  106. matrx_records-0.1.1/tests/test_dashboard_propose_against_the_store.py +291 -0
  107. matrx_records-0.1.1/tests/test_data_table_nodes_work_in_the_store.py +168 -0
  108. matrx_records-0.1.1/tests/test_dataset_tool_on_a_moved_table.py +303 -0
  109. matrx_records-0.1.1/tests/test_document_propose_against_the_store.py +326 -0
  110. matrx_records-0.1.1/tests/test_document_propose_against_the_store_red.py +144 -0
  111. matrx_records-0.1.1/tests/test_eight_verbs_against_the_branch.py +379 -0
  112. matrx_records-0.1.1/tests/test_enrich_due_sends_record_ids_as_a_uuid_array.py +35 -0
  113. matrx_records-0.1.1/tests/test_every_refusal_is_announced_before_the_call.py +140 -0
  114. matrx_records-0.1.1/tests/test_every_verb_declares_how_it_is_decided.py +236 -0
  115. matrx_records-0.1.1/tests/test_kind_records_go_through_the_door.py +125 -0
  116. matrx_records-0.1.1/tests/test_movers_against_the_main_database.py +158 -0
  117. matrx_records-0.1.1/tests/test_no_source_lists_tables_to_match_a_slug_or_name.py +82 -0
  118. matrx_records-0.1.1/tests/test_nodes_against_the_branch.py +365 -0
  119. matrx_records-0.1.1/tests/test_off_switch_covers_the_served_surface.py +265 -0
  120. matrx_records-0.1.1/tests/test_one_call_per_intent.py +281 -0
  121. matrx_records-0.1.1/tests/test_one_door_answers_a_whole_turns_context.py +568 -0
  122. matrx_records-0.1.1/tests/test_one_request_asks_each_scope_door_once.py +237 -0
  123. matrx_records-0.1.1/tests/test_picklist_tool_works_in_the_store.py +150 -0
  124. matrx_records-0.1.1/tests/test_pipeline_propose_against_the_store.py +230 -0
  125. matrx_records-0.1.1/tests/test_reach_across_organizations.py +53 -0
  126. matrx_records-0.1.1/tests/test_records_package_boundary.py +164 -0
  127. matrx_records-0.1.1/tests/test_records_split_experiment.py +201 -0
  128. matrx_records-0.1.1/tests/test_records_tool_against_the_branch.py +236 -0
  129. matrx_records-0.1.1/tests/test_references_resolve_from_the_store.py +106 -0
  130. matrx_records-0.1.1/tests/test_refile_gives_each_record_its_own_name.py +35 -0
  131. matrx_records-0.1.1/tests/test_relation_words_on_the_server.py +242 -0
  132. matrx_records-0.1.1/tests/test_server_paths_against_the_store.py +186 -0
  133. matrx_records-0.1.1/tests/test_sheet_import_lands_in_the_store.py +131 -0
  134. matrx_records-0.1.1/tests/test_the_advertised_verbs_are_verbs_this_build_accepts.py +117 -0
  135. matrx_records-0.1.1/tests/test_the_approval_policy_is_one_organizations_knob.py +394 -0
  136. matrx_records-0.1.1/tests/test_the_approval_policy_is_one_organizations_knob_red.py +162 -0
  137. matrx_records-0.1.1/tests/test_the_contract_row_is_generated_from_the_code.py +146 -0
  138. matrx_records-0.1.1/tests/test_the_ramp_is_per_source.py +219 -0
  139. matrx_records-0.1.1/tests/test_the_schema_is_small_and_the_guide_carries_the_rest.py +110 -0
  140. matrx_records-0.1.1/tests/test_the_scope_reader_speaks_the_old_nouns.py +78 -0
  141. matrx_records-0.1.1/tests/test_the_table_list_says_who_keeps_each_table.py +150 -0
  142. matrx_records-0.1.1/tests/test_the_tool_is_reachable_by_an_agent.py +175 -0
  143. matrx_records-0.1.1/tests/test_tool_definitions_stay_inside_their_budget.py +254 -0
  144. matrx_records-0.1.1/tests/test_twelve_examples_against_the_branch.py +889 -0
  145. matrx_records-0.1.1/tests/test_who_changed_it_against_the_store.py +226 -0
  146. matrx_records-0.1.1/tests/test_whole_values_are_read_at_once.py +67 -0
@@ -0,0 +1,345 @@
1
+ *.pyc
2
+ secrets/
3
+ ignore/
4
+ temp/
5
+ logs/
6
+ # The broad `logs/` rule above is for RUNTIME log output, but it also matched
7
+ # the dashboard's SOURCE directory and silently swallowed an entire feature's
8
+ # files (only the pre-existing index.tsx stayed tracked), breaking the prod
9
+ # Docker build with "Could not resolve ./structured-tab". Re-include the source.
10
+ !apps/dashboard/src/features/logs/
11
+ !apps/dashboard/src/features/logs/**
12
+ todo
13
+ text_notes/
14
+ aidream/secrets/2.env
15
+ automation_matrix/matrix_processing/temp/*
16
+ cd
17
+ # Byte-compiled / optimized / DLL files
18
+ __pycache__/
19
+ *.py[cod]
20
+ *$py.class
21
+
22
+ # C extensions
23
+ *.so
24
+ .venv/
25
+
26
+ # Distribution / packaging
27
+ .Python
28
+ build/
29
+ develop-eggs/
30
+ dist/
31
+ downloads/
32
+ eggs/
33
+ .eggs/
34
+ lib/
35
+ lib64/
36
+ # The blanket lib/ rule above is from the standard Python .gitignore template
37
+ # and was silently swallowing TS source under the SPA `src/lib/` folders.
38
+ # Re-allow them explicitly so frontend builds don't ship without their lib layer.
39
+ !apps/dashboard/src/lib/
40
+ !apps/dashboard/src/lib/**
41
+ !apps/dashboard/src/features/crawler/lib/
42
+ !apps/dashboard/src/features/crawler/lib/**
43
+ !apps/workflow-studio/src/lib/
44
+ !apps/workflow-studio/src/lib/**
45
+ parts/
46
+ sdist/
47
+ var/
48
+ wheels/
49
+ share/python-wheels/
50
+ *.egg-info/
51
+ .installed.cfg
52
+ *.egg
53
+ MANIFEST
54
+
55
+ # PyInstaller
56
+ # Usually these files are written by a python script from a template
57
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
58
+ *.manifest
59
+ *.spec
60
+
61
+ # Installer logs
62
+ pip-log.txt
63
+ pip-delete-this-directory.txt
64
+
65
+ # Unit test / coverage reports
66
+ ai/tests/clean_response.json
67
+ ai/tests/cx_storage_response.json
68
+ ai/tests/execution_test.py
69
+ ai/tests/final_response.json
70
+ htmlcov/
71
+ .tox/
72
+ .nox/
73
+ .coverage
74
+ .coverage.*
75
+ .cache
76
+ nosetests.xml
77
+ coverage.xml
78
+ *.cover
79
+ *.py,cover
80
+ .hypothesis/
81
+ .pytest_cache/
82
+ cover/
83
+
84
+ # Translations
85
+ *.mo
86
+ *.pot
87
+
88
+ # Django stuff:
89
+ *.log
90
+ local_settings.py
91
+ db.sqlite3
92
+ db.sqlite3-journal
93
+
94
+ # Flask stuff:
95
+ instance/
96
+ .webassets-cache
97
+
98
+ # Scrapy stuff:
99
+ .scrapy
100
+
101
+ # Sphinx documentation
102
+ docs/_build/
103
+
104
+ # PyBuilder
105
+ .pybuilder/
106
+ target/
107
+
108
+ # Jupyter Notebook
109
+ .ipynb_checkpoints
110
+
111
+ # IPython
112
+ profile_default/
113
+ ipython_config.py
114
+
115
+ # pyenv
116
+ # For a library or package, you might want to ignore these files since the code is
117
+ # intended to run in multiple environments; otherwise, check them in:
118
+ # .python-version
119
+
120
+ # pipenv
121
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
122
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
123
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
124
+ # install all needed dependencies.
125
+ #Pipfile.lock
126
+
127
+ # poetry
128
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
129
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
130
+ # commonly ignored for libraries.
131
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
132
+
133
+ # pdm
134
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
135
+ #pdm.lock
136
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
137
+ # in version control.
138
+ # https://pdm.fming.dev/#use-with-ide
139
+ .pdm.toml
140
+
141
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
142
+ __pypackages__/
143
+
144
+ # Celery stuff
145
+ celerybeat-schedule
146
+ celerybeat.pid
147
+
148
+ # SageMath parsed files
149
+ *.sage.py
150
+
151
+ # Environments
152
+ .env
153
+ .env_remote
154
+ .venv
155
+ env/
156
+ venv/
157
+ ENV/
158
+ env.bak/
159
+ venv.bak/
160
+ .env.armanonly
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # random armani files
181
+ /armani_dev/secrets/
182
+ /armani/
183
+ /_armani/
184
+
185
+
186
+
187
+ # pytype static type analyzer
188
+ .pytype/
189
+
190
+ # Cython debug symbols
191
+ cython_debug/
192
+
193
+ .idea/
194
+ .vscode/
195
+ /node_modules/
196
+
197
+ # Frontend pnpm workspace (apps/) — node_modules at the workspace root and any
198
+ # member, plus Vite caches and build output. The unified lockfile (apps/pnpm-lock.yaml)
199
+ # IS committed; everything below is regenerated.
200
+ #
201
+ # 🚨 BOTH SPELLINGS. `node_modules/` with the slash matches a DIRECTORY only, so
202
+ # a SYMLINK named `node_modules` slipped straight past it: five of them — each
203
+ # an absolute path into one machine's checkout — were committed on main and
204
+ # broke `pnpm install --frozen-lockfile` on every CI runner, where the symlink
205
+ # is dangling and pnpm's `mkdir` of it answers ENOENT. Every package release was
206
+ # blocked by it. The bare spelling below matches the symlink too.
207
+ node_modules
208
+ node_modules/
209
+ apps/**/.vite/
210
+ apps/**/dist/
211
+ .vite/
212
+
213
+ dump.rdb
214
+
215
+ frontend/
216
+
217
+ # AME Temp Files and directory structure
218
+ # Ignore all files in the temp directory and its subdirectories
219
+ /temp/**/*
220
+ /tmp/**/*
221
+
222
+ # Allow .gitkeep files to retain directory structure
223
+ !/temp/**/.gitkeep
224
+ !/tmp/**/.gitkeep
225
+
226
+ # Armani
227
+ .history*
228
+ .history/
229
+ /local_data/
230
+ local_reports_data/
231
+ webscraper/quick_scrapes/temp/
232
+ automation_matrix/ai_apis/fireworks/_dev/*
233
+ automation_matrix/ai_apis/fireworks/_dev/fireworks_sample.py
234
+ *.pdf
235
+ *.flac
236
+ *.mp3
237
+ *.wav
238
+ miniconda.sh
239
+ /database/python_sql/temp_data/
240
+ .history*
241
+ .history/
242
+ .history/
243
+
244
+ _dev/
245
+ /_dev/
246
+ requirements_filtered.txt
247
+
248
+ # matrx-dev-tools backups
249
+ .env-backups/
250
+ # Matrx Ship config (contains API key)
251
+ .matrx-ship.json
252
+
253
+ # Matrx config (contains API keys)
254
+ .matrx.json
255
+ .matrx-tools.conf
256
+
257
+ # Claude Code local worktrees and per-user settings
258
+ .claude/worktrees/
259
+ .worktrees/
260
+ .claude/settings.local.json
261
+
262
+ # Append-only snapshots from matrx_utils.update_history (unbounded; do not commit)
263
+ common/utils/data_in_code/data_history.json
264
+ packages/matrx-utils/matrx_utils/data_in_code/data_history.json
265
+
266
+ # Tool-dispatch debug logs — one file per server start, never committed
267
+ .matrx-debug/
268
+ # Per-definition BEFORE snapshots written by a live migration script. They are
269
+ # the recovery record for one machine's run, not repo content — the durable
270
+ # audit trail is the `metadata.migrations` stamp on the row itself.
271
+ .matrx-migrations/
272
+
273
+ # Trial Bench records written on THIS machine — the trial's JSON record, its §8
274
+ # report and the index that finds them (aidream/services/masterworks/bench/index.py,
275
+ # and the runs a product-started trial writes beside it). They are never repo
276
+ # content: a record carries every arm's full text INCLUDING the expert's ground
277
+ # truth, which is material deliberately withheld from the Rulebook, and a trial
278
+ # that matters is published deliberately under common-docs/projects/<its trial>/.
279
+ # Untracked-but-not-ignored meant one `git add -A` away from committing an
280
+ # expert's withheld work.
281
+ .matrx/bench/
282
+
283
+ # macOS Finder metadata
284
+ .DS_Store
285
+ **/.DS_Store
286
+
287
+ # Environment files
288
+ .env
289
+ .env.*
290
+ *.env
291
+ *.env.*
292
+
293
+ # Keep safe templates trackable
294
+ !.env.example
295
+ !.env.sample
296
+ !.env.template
297
+
298
+ # Never commit local OAuth client/token artifacts
299
+ credentials.json
300
+ token*.pickle
301
+ token*.json
302
+ tests_trials/rag_tests/kg_export_output/
303
+
304
+ # Pooler-contamination watch output (machine-local evidence, not source)
305
+ db/evidence/
306
+
307
+ # Pooler contamination evidence — machine-local forensic capture, not source
308
+ db/evidence/
309
+ db/mirror/.env.mirror
310
+ supabase/.temp/
311
+ **/supabase/.temp/
312
+ # Packed npm artifacts. Kept locally for a one-time bootstrap publish; never
313
+ # committed (they are large binaries regenerable with `pnpm pack`).
314
+ apps/shared/*/*.tgz
315
+
316
+ # Guard forcing-function scratch packages. These tests plant real files inside
317
+ # the real tree the guard scans (a temp dir would prove nothing) and delete
318
+ # them in teardown — ignoring them keeps the auto-commit tooling from
319
+ # capturing one mid-run.
320
+ _kind_boundary_scratch*/
321
+ _kind_marker_law_scratch*/
322
+
323
+ # packed npm tarballs are build output, never source (doctrine: typescript-package-standard)
324
+ *.tgz
325
+
326
+ # Peers' kit scratch witnesses. A `.kit-<name>-witness.XXXXXX/` directory is a
327
+ # full COPY of kit/src planted inside the packages tree — three of them held a
328
+ # duplicate `format.ts` on 2026-09-12 — and it sits in the `check:package-twins`
329
+ # scan ROOT. `git ls-files` only reaches TRACKED files, so the guard never saw
330
+ # them; the risk was a broad `git add` committing three formatter twins in one
331
+ # stroke, which is the exact class that guard exists to stop. Ignored, never
332
+ # deleted: they are another agent's evidence.
333
+ apps/shared/.kit-*-witness.*/
334
+
335
+ # Agent worktrees. Extra checkouts of this same repo, never product source.
336
+ # They live at .wt/<slug> (disk-groom). Committing the folder would add a
337
+ # second copy of the entire tree and a symlink into common-docs.
338
+ .wt/
339
+ .matrx/fixer-dispatch.json
340
+ .matrx/fixer-ledger.json
341
+
342
+ # Release streak ledger (scripts/release_repeats.py): per-machine state, never committed
343
+ .matrx/release-repeats.json
344
+ .matrx/release-repeats.json.tmp
345
+ .matrx/fixer-ledger.json
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.5
2
+ Name: matrx-records
3
+ Version: 0.1.1
4
+ Summary: The records server: the eight agent verbs over the custom record store's doors, the merge-field resolver, and the record workflow nodes
5
+ Project-URL: Homepage, https://github.com/AI-Matrix-Engine/aidream-current
6
+ Project-URL: Repository, https://github.com/AI-Matrix-Engine/aidream-current
7
+ Author-email: Matrx <admin@aimatrx.com>
8
+ Maintainer-email: Matrx <admin@aimatrx.com>
9
+ License: MIT
10
+ Keywords: agents,custom-data,matrx,merge-field,records
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Python: >=3.13
17
+ Requires-Dist: matrx-files>=0.2.262
18
+ Requires-Dist: matrx-orm>=3.1.219
19
+ Requires-Dist: matrx-utils>=2.0.64
20
+ Requires-Dist: pydantic>=2.0.0
21
+ Provides-Extra: agent
22
+ Requires-Dist: matrx-ai>=0.5.504; extra == 'agent'
23
+ Requires-Dist: matrx-connect>=0.1.185; extra == 'agent'
24
+ Provides-Extra: graph
25
+ Requires-Dist: matrx-graph>=0.2.263; extra == 'graph'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # matrx-records
29
+
30
+ The **records server**: the record read/write paths, the eight agent verbs and their
31
+ generated tool cache, the merge-field resolver and its provenance writer, and the record
32
+ workflow nodes.
33
+
34
+ It is imported by the app and never imports it. It talks to the database only through
35
+ `matrx-orm`, and only through the `custom.*` store's own doors, under the operating
36
+ person's own principal — there is no agent identity and there are no service roles.
37
+
38
+ ```python
39
+ from matrx_records import Principal, RecordStore
40
+
41
+ store = RecordStore(Principal(user_id=uid, organization_id=org, claims=jwt_claims))
42
+ tables = await store.table_list()
43
+ ```
44
+
45
+ Host wiring is one call at startup:
46
+
47
+ ```python
48
+ from matrx_records import configure_records
49
+ configure_records(database="supabase_automation_matrix", session_factory=my_act_as_user)
50
+ ```
51
+
52
+ ## The scope system, read from the store (SCOPES-READS-SERVER)
53
+
54
+ Every server reader of scopes reads `matrx_records.store.scopes.ScopeReader` — never the old
55
+ `context.*` tables. A scope type is a Table the context system keeps, a scope a Record of it, a
56
+ context item a Field; the reader answers in the old column names:
57
+
58
+ ```python
59
+ from matrx_records.store.scopes import ScopeReader
60
+
61
+ reader = ScopeReader.for_ambient(user_id=uid) # the operating person, or the run's person
62
+ types = await reader.types(org_ids) # lists: the contract RPCs, one statement
63
+ scopes = await reader.scopes(org_ids, type_ids=[tid])
64
+ docs = await reader.scope_documents([org], type_ids=[tid]) # every Record WITH its values
65
+ one = await reader.scopes_by_id([sid]) # by id, in whichever org it opens in
66
+ items = await reader.items(org, [tid]) # Fields, with the old value_type word
67
+ ```
68
+
69
+ Values kept as files are read whole with `ScopeReader.whole_value(scope, key)`.
70
+ The old scope tables are retired (2026-10-05); the store is the only writer, so there is nothing to compare against.
71
+
72
+ ## The server half — routing an existing record path (CUT-N-13)
73
+
74
+ An `aidream` path that reads or writes records asks the gateway, and the gateway decides
75
+ **per caller**: the record store when `custom/system_enabled` resolves on for that
76
+ person's organization, the path's own existing body when it does not.
77
+
78
+ ```python
79
+ from matrx_records.server import route_read
80
+
81
+ rows = await route_read(
82
+ source="context.scopes", # the legacy relation
83
+ match={"id": scope_id},
84
+ legacy=lambda: Scopes.filter(id=scope_id).values("id", "name"),
85
+ )
86
+ ```
87
+
88
+ `legacy` is the OFF arm, so today's behaviour is unchanged while the knob is false and it
89
+ is impossible to route a path without naming what it used to do. **The ramp is per SOURCE:**
90
+ the switch says the organization keeps its data in the store, not that every relation has
91
+ moved, so a source with no Table of its own slug is *not adopted yet* and keeps reading and
92
+ writing today's tables — the `Route` says so, with the remedy. Only a source whose Table
93
+ exists resolves through the store (`RecordsGateway.route_for`; feedback f35b12ec). `attrs=True` when the
94
+ legacy arm hands back model instances; `RecordsGateway.read_joined(...)` for a path whose
95
+ legacy arm is a SQL `JOIN` across two record-bearing relations.
96
+
97
+ Which paths those are is a **query**, never a list:
98
+
99
+ ```python
100
+ from matrx_records.server import the_enumeration
101
+
102
+ for path in await the_enumeration():
103
+ print(path.relative_path, path.sources, path.routed)
104
+ ```
105
+
106
+ It intersects matrx-orm's model registry with `platform.deprecated_relations` (the
107
+ platform's own supersession register) and then reads the repository's import graph.
108
+ `tests/test_server_paths_against_the_store.py` is parametrized over it, so a path nobody
109
+ repointed fails by name and a legacy relation declared tomorrow pulls its paths in with
110
+ no code change.
111
+
112
+ ## The outside door's verbs (TABLE-API-1, 2026-09-29)
113
+
114
+ The table API and the AI Matrx MCP (aidream `services/table_api`) reach the store only through
115
+ these, as the person: `table_read` (a Table's words, Fields and choice options), `record_page`
116
+ (`custom.read_records_page`: filter, search, sort, page, total), `record_headers_of` (version and
117
+ timestamps), `table_of`, `records_holding` (ids per key value, one statement), `record_change_many`
118
+ and `record_upsert` (one transaction; advisory lock on the key; a person's verb, or an agent's
119
+ only with `change_approval` saying nobody is asked) and `record_archive` (a person's archive /
120
+ restore; an agent uses `record_delete`, which asks first).
121
+
@@ -0,0 +1,94 @@
1
+ # matrx-records
2
+
3
+ The **records server**: the record read/write paths, the eight agent verbs and their
4
+ generated tool cache, the merge-field resolver and its provenance writer, and the record
5
+ workflow nodes.
6
+
7
+ It is imported by the app and never imports it. It talks to the database only through
8
+ `matrx-orm`, and only through the `custom.*` store's own doors, under the operating
9
+ person's own principal — there is no agent identity and there are no service roles.
10
+
11
+ ```python
12
+ from matrx_records import Principal, RecordStore
13
+
14
+ store = RecordStore(Principal(user_id=uid, organization_id=org, claims=jwt_claims))
15
+ tables = await store.table_list()
16
+ ```
17
+
18
+ Host wiring is one call at startup:
19
+
20
+ ```python
21
+ from matrx_records import configure_records
22
+ configure_records(database="supabase_automation_matrix", session_factory=my_act_as_user)
23
+ ```
24
+
25
+ ## The scope system, read from the store (SCOPES-READS-SERVER)
26
+
27
+ Every server reader of scopes reads `matrx_records.store.scopes.ScopeReader` — never the old
28
+ `context.*` tables. A scope type is a Table the context system keeps, a scope a Record of it, a
29
+ context item a Field; the reader answers in the old column names:
30
+
31
+ ```python
32
+ from matrx_records.store.scopes import ScopeReader
33
+
34
+ reader = ScopeReader.for_ambient(user_id=uid) # the operating person, or the run's person
35
+ types = await reader.types(org_ids) # lists: the contract RPCs, one statement
36
+ scopes = await reader.scopes(org_ids, type_ids=[tid])
37
+ docs = await reader.scope_documents([org], type_ids=[tid]) # every Record WITH its values
38
+ one = await reader.scopes_by_id([sid]) # by id, in whichever org it opens in
39
+ items = await reader.items(org, [tid]) # Fields, with the old value_type word
40
+ ```
41
+
42
+ Values kept as files are read whole with `ScopeReader.whole_value(scope, key)`.
43
+ The old scope tables are retired (2026-10-05); the store is the only writer, so there is nothing to compare against.
44
+
45
+ ## The server half — routing an existing record path (CUT-N-13)
46
+
47
+ An `aidream` path that reads or writes records asks the gateway, and the gateway decides
48
+ **per caller**: the record store when `custom/system_enabled` resolves on for that
49
+ person's organization, the path's own existing body when it does not.
50
+
51
+ ```python
52
+ from matrx_records.server import route_read
53
+
54
+ rows = await route_read(
55
+ source="context.scopes", # the legacy relation
56
+ match={"id": scope_id},
57
+ legacy=lambda: Scopes.filter(id=scope_id).values("id", "name"),
58
+ )
59
+ ```
60
+
61
+ `legacy` is the OFF arm, so today's behaviour is unchanged while the knob is false and it
62
+ is impossible to route a path without naming what it used to do. **The ramp is per SOURCE:**
63
+ the switch says the organization keeps its data in the store, not that every relation has
64
+ moved, so a source with no Table of its own slug is *not adopted yet* and keeps reading and
65
+ writing today's tables — the `Route` says so, with the remedy. Only a source whose Table
66
+ exists resolves through the store (`RecordsGateway.route_for`; feedback f35b12ec). `attrs=True` when the
67
+ legacy arm hands back model instances; `RecordsGateway.read_joined(...)` for a path whose
68
+ legacy arm is a SQL `JOIN` across two record-bearing relations.
69
+
70
+ Which paths those are is a **query**, never a list:
71
+
72
+ ```python
73
+ from matrx_records.server import the_enumeration
74
+
75
+ for path in await the_enumeration():
76
+ print(path.relative_path, path.sources, path.routed)
77
+ ```
78
+
79
+ It intersects matrx-orm's model registry with `platform.deprecated_relations` (the
80
+ platform's own supersession register) and then reads the repository's import graph.
81
+ `tests/test_server_paths_against_the_store.py` is parametrized over it, so a path nobody
82
+ repointed fails by name and a legacy relation declared tomorrow pulls its paths in with
83
+ no code change.
84
+
85
+ ## The outside door's verbs (TABLE-API-1, 2026-09-29)
86
+
87
+ The table API and the AI Matrx MCP (aidream `services/table_api`) reach the store only through
88
+ these, as the person: `table_read` (a Table's words, Fields and choice options), `record_page`
89
+ (`custom.read_records_page`: filter, search, sort, page, total), `record_headers_of` (version and
90
+ timestamps), `table_of`, `records_holding` (ids per key value, one statement), `record_change_many`
91
+ and `record_upsert` (one transaction; advisory lock on the key; a person's verb, or an agent's
92
+ only with `change_approval` saying nobody is asked) and `record_archive` (a person's archive /
93
+ restore; an agent uses `record_delete`, which asks first).
94
+
@@ -0,0 +1,49 @@
1
+ """matrx-records — the records server.
2
+
3
+ The record read/write paths, the eight agent verbs and their generated tool cache, the
4
+ merge-field resolver and its provenance writer, and the record workflow nodes. Imported
5
+ by the app; it never imports the app (the package paradox — see the repo's CLAUDE.md).
6
+
7
+ THE FOUR THINGS IN HERE, and the one sentence each that says why they are together:
8
+
9
+ ``principal`` / ``errors``
10
+ Whose authority a call runs under, and how the store's own refusal is carried out
11
+ whole instead of being flattened into "write failed".
12
+ ``store``
13
+ The eight verbs — ``table_list``, ``metadata_search``, ``record_read``,
14
+ ``record_write``, ``record_delete``, ``record_aggregate``, ``field_propose``,
15
+ ``table_propose`` — over the store's doors and over nothing else.
16
+ ``agent``
17
+ ONE action-dispatched tool, ``records``, generated from each Table's own structure,
18
+ cached, and invalidated by the registry's structure-change notification.
19
+ ``merge``
20
+ The merge-field resolver: sources, semantic types and modifiers; one DAG, one
21
+ precedence ladder, one memoized triple per turn, one provenance row per value.
22
+
23
+ Nothing here opens a privileged connection or takes an organization from a payload.
24
+ """
25
+
26
+ from matrx_records.errors import StoreRefusal, refusal_from
27
+ from matrx_records.principal import (
28
+ Actor,
29
+ Principal,
30
+ acting_as,
31
+ configure_records,
32
+ records_database,
33
+ )
34
+ from matrx_records.store import RecordStore, RecordView, ResolvedValue
35
+
36
+ __version__ = "0.1.0"
37
+
38
+ __all__ = [
39
+ "Actor",
40
+ "Principal",
41
+ "RecordStore",
42
+ "RecordView",
43
+ "ResolvedValue",
44
+ "StoreRefusal",
45
+ "acting_as",
46
+ "configure_records",
47
+ "records_database",
48
+ "refusal_from",
49
+ ]
File without changes