daecore 0.3.0__py3-none-any.whl

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 (1051) hide show
  1. _daecore_entry.py +2145 -0
  2. daecore/__init__.py +22 -0
  3. daecore/__main__.py +21 -0
  4. daecore/_atomic_file.py +153 -0
  5. daecore/_durable_file.py +75 -0
  6. daecore/_error_mode.py +24 -0
  7. daecore/_exclusive_lock.py +521 -0
  8. daecore/_handover.py +548 -0
  9. daecore/_release/core.lock +4 -0
  10. daecore/_release/handover.lock +47 -0
  11. daecore/_release/overlay-cuda.lock +126 -0
  12. daecore/_release/overlay-metal.lock +6 -0
  13. daecore/_release/overlay-vulkan.lock +6 -0
  14. daecore/_release/python-version +1 -0
  15. daecore/_release/runtime.lock +1633 -0
  16. daecore/_release/tools.lock +20 -0
  17. daecore/_survey_store.py +156 -0
  18. daecore/_version.py +10 -0
  19. daecore/_windows_directory.py +69 -0
  20. daecore/agent_use/__init__.py +1 -0
  21. daecore/agent_use/capabilities.py +680 -0
  22. daecore/agent_use/constitution.py +185 -0
  23. daecore/agent_use/features.py +40 -0
  24. daecore/approval.py +150 -0
  25. daecore/artifact_cleanup.py +136 -0
  26. daecore/artifact_observation.py +278 -0
  27. daecore/assurance/__init__.py +1 -0
  28. daecore/assurance/access.py +54 -0
  29. daecore/assurance/campaign.py +267 -0
  30. daecore/assurance/catalog.py +235 -0
  31. daecore/assurance/census.py +67 -0
  32. daecore/assurance/contracts.py +212 -0
  33. daecore/assurance/control.py +90 -0
  34. daecore/assurance/control_provider.py +40 -0
  35. daecore/assurance/declarations.py +32 -0
  36. daecore/assurance/diagnostics.py +144 -0
  37. daecore/assurance/events.py +586 -0
  38. daecore/assurance/integrity/__init__.py +5 -0
  39. daecore/assurance/integrity/breach.py +309 -0
  40. daecore/assurance/integrity/proof.py +512 -0
  41. daecore/assurance/integrity/transparency.py +249 -0
  42. daecore/assurance/intent.py +367 -0
  43. daecore/assurance/ledger/__init__.py +445 -0
  44. daecore/assurance/ledger/_chain.py +169 -0
  45. daecore/assurance/ledger/_checkpoints.py +131 -0
  46. daecore/assurance/ledger/_heartbeats.py +290 -0
  47. daecore/assurance/ledger/_projections.py +390 -0
  48. daecore/assurance/ledger/_records.py +224 -0
  49. daecore/assurance/monitoring.py +784 -0
  50. daecore/assurance/providers.py +208 -0
  51. daecore/assurance/repair/__init__.py +1 -0
  52. daecore/assurance/repair/contracts.py +255 -0
  53. daecore/assurance/repair/engine.py +639 -0
  54. daecore/assurance/repair/registry.py +199 -0
  55. daecore/assurance/schema.py +174 -0
  56. daecore/assurance_runtime/__init__.py +1 -0
  57. daecore/assurance_runtime/authority.py +98 -0
  58. daecore/assurance_runtime/builtin.py +252 -0
  59. daecore/assurance_runtime/census.py +56 -0
  60. daecore/assurance_runtime/provider_set.py +337 -0
  61. daecore/assurance_runtime/repair.py +155 -0
  62. daecore/backup/__init__.py +1 -0
  63. daecore/backup/assurance.py +68 -0
  64. daecore/backup/checkpoint/__init__.py +1 -0
  65. daecore/backup/checkpoint/contracts.py +301 -0
  66. daecore/backup/checkpoint/engine.py +1048 -0
  67. daecore/backup/checkpoint/inspection.py +352 -0
  68. daecore/backup/checkpoint/inventory.py +255 -0
  69. daecore/backup/checkpoint/provider.py +347 -0
  70. daecore/backup/checkpoint/restore.py +1009 -0
  71. daecore/backup/checkpoint/verify.py +772 -0
  72. daecore/backup/core.py +244 -0
  73. daecore/chunk_identity.py +131 -0
  74. daecore/chunking/__init__.py +1 -0
  75. daecore/chunking/_packing_fit.py +217 -0
  76. daecore/chunking/contract.py +20 -0
  77. daecore/chunking/counter.py +173 -0
  78. daecore/chunking/geometry.py +35 -0
  79. daecore/chunking/import_packer.py +218 -0
  80. daecore/chunking/packer.py +300 -0
  81. daecore/chunking/record_packer.py +272 -0
  82. daecore/chunking/structural.py +87 -0
  83. daecore/classifier/__init__.py +1 -0
  84. daecore/classifier/agent_contract.py +113 -0
  85. daecore/classifier/facets.py +18 -0
  86. daecore/classifier/inputs.py +85 -0
  87. daecore/classifier/installation.py +127 -0
  88. daecore/classifier/labels.py +283 -0
  89. daecore/cli/__init__.py +19 -0
  90. daecore/cli/__main__.py +9 -0
  91. daecore/cli/client_names.py +34 -0
  92. daecore/cli/commands/__init__.py +1 -0
  93. daecore/cli/commands/add.py +327 -0
  94. daecore/cli/commands/doctor.py +153 -0
  95. daecore/cli/commands/drift.py +66 -0
  96. daecore/cli/commands/forget.py +443 -0
  97. daecore/cli/commands/lifecycle.py +452 -0
  98. daecore/cli/commands/memory/__init__.py +1 -0
  99. daecore/cli/commands/memory/backup.py +592 -0
  100. daecore/cli/commands/memory/common.py +35 -0
  101. daecore/cli/commands/memory/health.py +260 -0
  102. daecore/cli/commands/memory/reclassify.py +194 -0
  103. daecore/cli/commands/memory/remember.py +287 -0
  104. daecore/cli/commands/memory/transfer.py +301 -0
  105. daecore/cli/commands/memory/verbs.py +468 -0
  106. daecore/cli/commands/memory/word_index.py +61 -0
  107. daecore/cli/commands/models.py +210 -0
  108. daecore/cli/commands/relocate.py +366 -0
  109. daecore/cli/commands/remove.py +148 -0
  110. daecore/cli/commands/restart.py +338 -0
  111. daecore/cli/commands/retrieval/__init__.py +1 -0
  112. daecore/cli/commands/retrieval/inspection.py +285 -0
  113. daecore/cli/commands/retrieval/refresh.py +519 -0
  114. daecore/cli/commands/retrieval/refresh_offline.py +135 -0
  115. daecore/cli/commands/retrieval/refresh_reporting.py +445 -0
  116. daecore/cli/commands/retrieval/refresh_targets.py +99 -0
  117. daecore/cli/commands/retrieval/search.py +295 -0
  118. daecore/cli/commands/serve.py +35 -0
  119. daecore/cli/commands/setup.py +581 -0
  120. daecore/cli/commands/sources.py +352 -0
  121. daecore/cli/commands/status.py +767 -0
  122. daecore/cli/commands/sync.py +683 -0
  123. daecore/cli/commands/update.py +813 -0
  124. daecore/cli/common.py +88 -0
  125. daecore/cli/content_output.py +21 -0
  126. daecore/cli/data.py +37 -0
  127. daecore/cli/dispatch.py +503 -0
  128. daecore/cli/entry.py +274 -0
  129. daecore/cli/handlers.py +62 -0
  130. daecore/cli/help_screens.py +120 -0
  131. daecore/cli/machine.py +155 -0
  132. daecore/cli/model_repair.py +112 -0
  133. daecore/cli/old_folder.py +21 -0
  134. daecore/cli/parser/__init__.py +1 -0
  135. daecore/cli/parser/builder.py +87 -0
  136. daecore/cli/parser/groups.py +119 -0
  137. daecore/cli/parser/suggest.py +79 -0
  138. daecore/cli/parser/surface.py +353 -0
  139. daecore/cli/parser/verbs.py +404 -0
  140. daecore/cli/parser/visibility.py +200 -0
  141. daecore/cli/results.py +123 -0
  142. daecore/cli/source_output.py +90 -0
  143. daecore/cli/update_currency.py +203 -0
  144. daecore/cli/update_profile.py +110 -0
  145. daecore/cli/update_receipt.py +256 -0
  146. daecore/cli/update_reconcile.py +164 -0
  147. daecore/cli/version_notice.py +137 -0
  148. daecore/command_help.py +281 -0
  149. daecore/config/__init__.py +159 -0
  150. daecore/config/application.py +334 -0
  151. daecore/config/assurance.py +91 -0
  152. daecore/config/authority.py +580 -0
  153. daecore/config/authority_store.py +177 -0
  154. daecore/config/changes.py +112 -0
  155. daecore/config/loader.py +533 -0
  156. daecore/config/schema.py +373 -0
  157. daecore/config/settings.py +121 -0
  158. daecore/config/source_parsing.py +111 -0
  159. daecore/corpus_pause.py +269 -0
  160. daecore/cpu_capacity.py +27 -0
  161. daecore/daemon/__init__.py +1 -0
  162. daecore/daemon/_version_util.py +25 -0
  163. daecore/daemon/activation.py +376 -0
  164. daecore/daemon/assurance.py +132 -0
  165. daecore/daemon/assurance_provider.py +1160 -0
  166. daecore/daemon/attachments.py +470 -0
  167. daecore/daemon/automatic_recovery.py +192 -0
  168. daecore/daemon/candidate_checks.py +213 -0
  169. daecore/daemon/classifier_setup.py +186 -0
  170. daecore/daemon/disable.py +250 -0
  171. daecore/daemon/drain.py +247 -0
  172. daecore/daemon/drift_state.py +262 -0
  173. daecore/daemon/embedding_transition.py +153 -0
  174. daecore/daemon/fence.py +807 -0
  175. daecore/daemon/frozen_read_window.py +165 -0
  176. daecore/daemon/handover_steps.py +69 -0
  177. daecore/daemon/identity.py +149 -0
  178. daecore/daemon/labeler.py +611 -0
  179. daecore/daemon/maintenance/__init__.py +1 -0
  180. daecore/daemon/maintenance/_manifest_errors.py +13 -0
  181. daecore/daemon/maintenance/_manifest_rules.py +322 -0
  182. daecore/daemon/maintenance/_manifest_validation.py +266 -0
  183. daecore/daemon/maintenance/adjudication.py +282 -0
  184. daecore/daemon/maintenance/completion.py +238 -0
  185. daecore/daemon/maintenance/decisions.py +498 -0
  186. daecore/daemon/maintenance/events.py +122 -0
  187. daecore/daemon/maintenance/identity.py +402 -0
  188. daecore/daemon/maintenance/intent.py +309 -0
  189. daecore/daemon/maintenance/manifest.py +504 -0
  190. daecore/daemon/maintenance/pause_fields.py +84 -0
  191. daecore/daemon/maintenance/records.py +144 -0
  192. daecore/daemon/maintenance/status.py +262 -0
  193. daecore/daemon/maintenance/verification.py +137 -0
  194. daecore/daemon/maintenance_client.py +346 -0
  195. daecore/daemon/operation_hooks.py +115 -0
  196. daecore/daemon/pidfile.py +270 -0
  197. daecore/daemon/profile_setup.py +144 -0
  198. daecore/daemon/quiescence.py +294 -0
  199. daecore/daemon/recovery.py +432 -0
  200. daecore/daemon/refresh.py +150 -0
  201. daecore/daemon/refresh_recovery.py +193 -0
  202. daecore/daemon/release_notices.py +388 -0
  203. daecore/daemon/relocation/__init__.py +1 -0
  204. daecore/daemon/relocation/_backup.py +232 -0
  205. daecore/daemon/relocation/capacity.py +85 -0
  206. daecore/daemon/relocation/coordinator.py +907 -0
  207. daecore/daemon/relocation/copy.py +425 -0
  208. daecore/daemon/relocation/last_move.py +127 -0
  209. daecore/daemon/relocation/recovery.py +345 -0
  210. daecore/daemon/relocation/retirement.py +593 -0
  211. daecore/daemon/relocation/state.py +511 -0
  212. daecore/daemon/replacement.py +226 -0
  213. daecore/daemon/retrieval_client.py +335 -0
  214. daecore/daemon/runtime/__init__.py +557 -0
  215. daecore/daemon/runtime/_console_wrapper.py +114 -0
  216. daecore/daemon/runtime/_currency.py +160 -0
  217. daecore/daemon/runtime/_custody.py +40 -0
  218. daecore/daemon/runtime/_relay.py +190 -0
  219. daecore/daemon/runtime/_relocation.py +144 -0
  220. daecore/daemon/runtime/_seed_launcher.py +460 -0
  221. daecore/daemon/runtime/packages.py +196 -0
  222. daecore/daemon/runtime_change.py +165 -0
  223. daecore/daemon/runtime_install.py +262 -0
  224. daecore/daemon/runtime_retirement.py +430 -0
  225. daecore/daemon/runtime_switch.py +210 -0
  226. daecore/daemon/scheduler.py +308 -0
  227. daecore/daemon/spawn_guard.py +507 -0
  228. daecore/daemon/spawning.py +641 -0
  229. daecore/daemon/status.py +307 -0
  230. daecore/daemon/sync_policy.py +251 -0
  231. daecore/daemon/ticket_auth.py +162 -0
  232. daecore/daemon/tls.py +62 -0
  233. daecore/daemon/trust.py +456 -0
  234. daecore/daemon/uninstall_transaction.py +959 -0
  235. daecore/daemon/update/__init__.py +1 -0
  236. daecore/daemon/update/artifacts.py +779 -0
  237. daecore/daemon/update/completion.py +190 -0
  238. daecore/daemon/update/convergence.py +302 -0
  239. daecore/daemon/update/dispatch.py +155 -0
  240. daecore/daemon/update/journal.py +245 -0
  241. daecore/daemon/update/model_evidence.py +153 -0
  242. daecore/daemon/update/ownership.py +171 -0
  243. daecore/daemon/update/preimage.py +93 -0
  244. daecore/daemon/update/progress.py +55 -0
  245. daecore/daemon/update/proof.py +242 -0
  246. daecore/daemon/update/protocol.py +135 -0
  247. daecore/daemon/update/recovery.py +81 -0
  248. daecore/daemon/update/rollback.py +91 -0
  249. daecore/daemon/update/state.py +334 -0
  250. daecore/daemon/update/transaction.py +325 -0
  251. daecore/daemon/version_policy.py +29 -0
  252. daecore/daemon_lock.py +92 -0
  253. daecore/daemon_process/__init__.py +1 -0
  254. daecore/daemon_process/convergence.py +138 -0
  255. daecore/daemon_process/database_observation.py +157 -0
  256. daecore/daemon_process/name_observation.py +217 -0
  257. daecore/daemon_process/notes.py +14 -0
  258. daecore/daemon_process/resource_observation.py +167 -0
  259. daecore/daemon_process/serve.py +464 -0
  260. daecore/daemon_process/services.py +532 -0
  261. daecore/daemon_process/start.py +618 -0
  262. daecore/daemon_process/stop.py +219 -0
  263. daecore/daemon_process/watch.py +139 -0
  264. daecore/data/rerank_calibration.json +65 -0
  265. daecore/decoder_activation.py +87 -0
  266. daecore/decoder_installation.py +369 -0
  267. daecore/decoder_tree.py +138 -0
  268. daecore/digests.py +14 -0
  269. daecore/disk_capacity.py +128 -0
  270. daecore/doctor/__init__.py +1 -0
  271. daecore/doctor/contracts.py +351 -0
  272. daecore/doctor/guidance.py +246 -0
  273. daecore/doctor/identity.py +190 -0
  274. daecore/doctor/render.py +750 -0
  275. daecore/doctor/results.py +42 -0
  276. daecore/doctor/runner.py +800 -0
  277. daecore/doctor/session.py +245 -0
  278. daecore/doctor/store.py +190 -0
  279. daecore/document_extraction/__init__.py +64 -0
  280. daecore/document_extraction/entry.py +81 -0
  281. daecore/document_extraction/frames.py +60 -0
  282. daecore/document_extraction/level.py +281 -0
  283. daecore/document_extraction/level_probe.py +331 -0
  284. daecore/document_extraction/limits.py +53 -0
  285. daecore/document_extraction/office.py +531 -0
  286. daecore/document_extraction/posix_launcher.py +53 -0
  287. daecore/document_extraction/posix_policy.py +146 -0
  288. daecore/document_extraction/probe_entry.py +144 -0
  289. daecore/document_extraction/providers.py +613 -0
  290. daecore/document_extraction/registry_storage.py +46 -0
  291. daecore/document_extraction/result.py +84 -0
  292. daecore/document_extraction/session.py +338 -0
  293. daecore/document_extraction/warmup.zip +0 -0
  294. daecore/document_extraction/windows_access.py +239 -0
  295. daecore/document_extraction/windows_launcher.py +150 -0
  296. daecore/document_extraction/windows_probe_owner.py +35 -0
  297. daecore/document_extraction/worker.py +114 -0
  298. daecore/document_formats.py +72 -0
  299. daecore/documents/__init__.py +1 -0
  300. daecore/documents/_html.py +98 -0
  301. daecore/documents/_json_syntax.py +143 -0
  302. daecore/documents/_line_units.py +57 -0
  303. daecore/documents/_markdown.py +208 -0
  304. daecore/documents/_raw_positions.py +118 -0
  305. daecore/documents/_reader_metadata.py +16 -0
  306. daecore/documents/_record_input.py +30 -0
  307. daecore/documents/_slug_table.py +137 -0
  308. daecore/documents/_text_input.py +12 -0
  309. daecore/documents/csv_reader.py +155 -0
  310. daecore/documents/csv_records.py +40 -0
  311. daecore/documents/excerpts.py +174 -0
  312. daecore/documents/fidelity.py +178 -0
  313. daecore/documents/hygiene.py +202 -0
  314. daecore/documents/identity.py +49 -0
  315. daecore/documents/import_markdown.py +63 -0
  316. daecore/documents/json_reader.py +161 -0
  317. daecore/documents/links.py +672 -0
  318. daecore/documents/locators.py +713 -0
  319. daecore/documents/markdown_reader.py +161 -0
  320. daecore/documents/markup_reader.py +218 -0
  321. daecore/documents/model.py +245 -0
  322. daecore/documents/native.py +549 -0
  323. daecore/documents/outline.py +404 -0
  324. daecore/documents/plaintext_reader.py +57 -0
  325. daecore/documents/ranges.py +281 -0
  326. daecore/documents/readers.py +85 -0
  327. daecore/documents/record_units.py +61 -0
  328. daecore/documents/resolution.py +553 -0
  329. daecore/documents/sections.py +20 -0
  330. daecore/documents/slugs.py +36 -0
  331. daecore/documents/source_maps.py +49 -0
  332. daecore/documents/text.py +141 -0
  333. daecore/eligibility.py +1139 -0
  334. daecore/enablement.py +411 -0
  335. daecore/entry.py +138 -0
  336. daecore/envconf.py +419 -0
  337. daecore/evidence_dates.py +108 -0
  338. daecore/evidence_identity.py +515 -0
  339. daecore/exception_text.py +67 -0
  340. daecore/exit_codes.py +24 -0
  341. daecore/file_hash.py +17 -0
  342. daecore/file_probe.py +139 -0
  343. daecore/file_read.py +257 -0
  344. daecore/file_status.py +65 -0
  345. daecore/file_watch.py +247 -0
  346. daecore/filesystem_walk.py +703 -0
  347. daecore/health_readiness.py +130 -0
  348. daecore/held_lock.py +188 -0
  349. daecore/home_pointer.py +205 -0
  350. daecore/ignore_policy.py +1102 -0
  351. daecore/inference/__init__.py +1 -0
  352. daecore/inference/_execution_state.py +327 -0
  353. daecore/inference/_memory_state.py +148 -0
  354. daecore/inference/accelerator.py +505 -0
  355. daecore/inference/assurance.py +123 -0
  356. daecore/inference/assurance_provider.py +613 -0
  357. daecore/inference/batch_geometry.py +419 -0
  358. daecore/inference/device_memory.py +551 -0
  359. daecore/inference/execution.py +800 -0
  360. daecore/inference/failures.py +474 -0
  361. daecore/inference/hardware.py +241 -0
  362. daecore/inference/memory_budget.py +539 -0
  363. daecore/inference/model/__init__.py +1 -0
  364. daecore/inference/model/_file_identity.py +35 -0
  365. daecore/inference/model/_locking.py +62 -0
  366. daecore/inference/model/assets.py +1172 -0
  367. daecore/inference/model/blob_store.py +209 -0
  368. daecore/inference/model/cache/__init__.py +426 -0
  369. daecore/inference/model/cache/_collection.py +272 -0
  370. daecore/inference/model/cache/_leases.py +241 -0
  371. daecore/inference/model/cache/_observation.py +173 -0
  372. daecore/inference/model/cache/_pool.py +176 -0
  373. daecore/inference/model/cache/_records.py +311 -0
  374. daecore/inference/model/cache/_storage.py +232 -0
  375. daecore/inference/model/cache/_types.py +116 -0
  376. daecore/inference/model/registry.py +330 -0
  377. daecore/inference/model_fallback.py +227 -0
  378. daecore/inference/model_preparation.py +592 -0
  379. daecore/inference/model_progress.py +210 -0
  380. daecore/inference/model_status.py +407 -0
  381. daecore/inference/passage_geometry.py +215 -0
  382. daecore/inference/placement.py +352 -0
  383. daecore/inference/probe.py +119 -0
  384. daecore/inference/profile/__init__.py +393 -0
  385. daecore/inference/profile/circuit.py +262 -0
  386. daecore/inference/profile/contracts.py +188 -0
  387. daecore/inference/profile/incidents.py +502 -0
  388. daecore/inference/profile/registry.py +264 -0
  389. daecore/inference/profile/resolve.py +177 -0
  390. daecore/inference/profile/state.py +861 -0
  391. daecore/inference/providers.py +231 -0
  392. daecore/inference/residency.py +124 -0
  393. daecore/inference/role_health.py +139 -0
  394. daecore/inference/roles/__init__.py +1 -0
  395. daecore/inference/roles/classifier.py +1155 -0
  396. daecore/inference/roles/classifier_artifacts.py +799 -0
  397. daecore/inference/roles/embedding.py +337 -0
  398. daecore/inference/roles/lora_reranker.py +1098 -0
  399. daecore/inference/sequence_budget.py +254 -0
  400. daecore/inference/sessions/__init__.py +1 -0
  401. daecore/inference/sessions/_recovery.py +346 -0
  402. daecore/inference/sessions/_worker_client.py +387 -0
  403. daecore/inference/sessions/_worker_protocol.py +140 -0
  404. daecore/inference/sessions/_worker_transport.py +357 -0
  405. daecore/inference/sessions/locked_session.py +149 -0
  406. daecore/inference/sessions/model_worker.py +828 -0
  407. daecore/inference/system.py +72 -0
  408. daecore/inference/webgpu.py +89 -0
  409. daecore/input_budget.py +154 -0
  410. daecore/json_records.py +45 -0
  411. daecore/lifecycle_gate.py +657 -0
  412. daecore/link_contract.py +48 -0
  413. daecore/live_output.py +27 -0
  414. daecore/local_zone.py +143 -0
  415. daecore/memory/__init__.py +1 -0
  416. daecore/memory/_correction_inspection.py +161 -0
  417. daecore/memory/_inspection_contract.py +110 -0
  418. daecore/memory/_memory_inspection.py +368 -0
  419. daecore/memory/_source_inspection.py +269 -0
  420. daecore/memory/action_preflight.py +378 -0
  421. daecore/memory/annotation_writes.py +206 -0
  422. daecore/memory/assurance.py +151 -0
  423. daecore/memory/assurance_provider.py +719 -0
  424. daecore/memory/canonical/__init__.py +1 -0
  425. daecore/memory/canonical/_erasure.py +461 -0
  426. daecore/memory/canonical/_erasure_proofs.py +290 -0
  427. daecore/memory/canonical/_erasure_records.py +273 -0
  428. daecore/memory/canonical/_erasure_schema.py +521 -0
  429. daecore/memory/canonical/_facet_labels.py +195 -0
  430. daecore/memory/canonical/_history_reads.py +218 -0
  431. daecore/memory/canonical/_imported_files.py +207 -0
  432. daecore/memory/canonical/_mirrors.py +195 -0
  433. daecore/memory/canonical/_name_history.py +716 -0
  434. daecore/memory/canonical/_projection.py +63 -0
  435. daecore/memory/canonical/_record_reads.py +584 -0
  436. daecore/memory/canonical/_returns.py +277 -0
  437. daecore/memory/canonical/_revisions.py +208 -0
  438. daecore/memory/canonical/_rows.py +421 -0
  439. daecore/memory/canonical/_transfer.py +317 -0
  440. daecore/memory/canonical/access_lock.py +275 -0
  441. daecore/memory/canonical/admission.py +59 -0
  442. daecore/memory/canonical/citation_index.py +169 -0
  443. daecore/memory/canonical/connections.py +557 -0
  444. daecore/memory/canonical/correction_erasure.py +156 -0
  445. daecore/memory/canonical/correction_integrity.py +176 -0
  446. daecore/memory/canonical/correction_reads.py +812 -0
  447. daecore/memory/canonical/correction_references.py +187 -0
  448. daecore/memory/canonical/correction_row_data.py +176 -0
  449. daecore/memory/canonical/correction_rows.py +842 -0
  450. daecore/memory/canonical/correction_schema.py +144 -0
  451. daecore/memory/canonical/correction_transfer.py +227 -0
  452. daecore/memory/canonical/correction_winners.py +113 -0
  453. daecore/memory/canonical/database.py +1096 -0
  454. daecore/memory/canonical/erasure_ledger.py +857 -0
  455. daecore/memory/canonical/errors.py +149 -0
  456. daecore/memory/canonical/imported_file_schema.py +124 -0
  457. daecore/memory/canonical/location.py +57 -0
  458. daecore/memory/canonical/mirror_evidence.py +82 -0
  459. daecore/memory/canonical/name_schema.py +196 -0
  460. daecore/memory/canonical/project_links.py +138 -0
  461. daecore/memory/canonical/query_projection.py +272 -0
  462. daecore/memory/canonical/recall_returns.py +154 -0
  463. daecore/memory/canonical/record_holds.py +329 -0
  464. daecore/memory/canonical/reference_cleanup.py +801 -0
  465. daecore/memory/canonical/reference_index.py +146 -0
  466. daecore/memory/canonical/retry_outcome_schema.py +85 -0
  467. daecore/memory/canonical/retry_outcomes.py +586 -0
  468. daecore/memory/canonical/store_schema.py +931 -0
  469. daecore/memory/canonical/word_index.py +89 -0
  470. daecore/memory/citation_lookup.py +150 -0
  471. daecore/memory/citation_resolution.py +288 -0
  472. daecore/memory/citation_updates.py +207 -0
  473. daecore/memory/citation_upkeep.py +381 -0
  474. daecore/memory/consent.py +537 -0
  475. daecore/memory/correction.py +668 -0
  476. daecore/memory/correction_blockers.py +191 -0
  477. daecore/memory/correction_citations.py +172 -0
  478. daecore/memory/correction_dates.py +81 -0
  479. daecore/memory/correction_dependencies.py +420 -0
  480. daecore/memory/correction_errors.py +61 -0
  481. daecore/memory/correction_request.py +428 -0
  482. daecore/memory/correction_state.py +231 -0
  483. daecore/memory/correction_undo.py +566 -0
  484. daecore/memory/erasure_selection.py +387 -0
  485. daecore/memory/evidence_inspection.py +228 -0
  486. daecore/memory/exclusion_recovery.py +40 -0
  487. daecore/memory/filter_request.py +433 -0
  488. daecore/memory/filter_sql.py +363 -0
  489. daecore/memory/filtering.py +239 -0
  490. daecore/memory/forget.py +656 -0
  491. daecore/memory/index_projection.py +695 -0
  492. daecore/memory/inventory.py +103 -0
  493. daecore/memory/mirrored_documents.py +308 -0
  494. daecore/memory/name_files.py +210 -0
  495. daecore/memory/name_round.py +56 -0
  496. daecore/memory/name_state.py +766 -0
  497. daecore/memory/name_support.py +502 -0
  498. daecore/memory/native_folders.py +206 -0
  499. daecore/memory/native_import/__init__.py +137 -0
  500. daecore/memory/native_import/claude.py +400 -0
  501. daecore/memory/native_import/codex.py +58 -0
  502. daecore/memory/native_import/consented_routes.py +157 -0
  503. daecore/memory/native_import/contracts.py +161 -0
  504. daecore/memory/native_import/discovery.py +62 -0
  505. daecore/memory/native_import/folder_scan.py +178 -0
  506. daecore/memory/native_import/import_pass.py +342 -0
  507. daecore/memory/native_import/mapping.py +585 -0
  508. daecore/memory/native_import/reconcile.py +197 -0
  509. daecore/memory/native_import/store_rules.py +100 -0
  510. daecore/memory/native_providers.py +185 -0
  511. daecore/memory/policy.py +76 -0
  512. daecore/memory/projection_outbox.py +626 -0
  513. daecore/memory/publication.py +173 -0
  514. daecore/memory/read_facts.py +346 -0
  515. daecore/memory/records/__init__.py +1 -0
  516. daecore/memory/records/annotations.py +144 -0
  517. daecore/memory/records/authoring.py +107 -0
  518. daecore/memory/records/authorship.py +170 -0
  519. daecore/memory/records/cancellation.py +586 -0
  520. daecore/memory/records/citation_changes.py +90 -0
  521. daecore/memory/records/citations.py +890 -0
  522. daecore/memory/records/continuity_provenance.py +187 -0
  523. daecore/memory/records/contracts.py +214 -0
  524. daecore/memory/records/coordinates.py +119 -0
  525. daecore/memory/records/correction_history/__init__.py +5 -0
  526. daecore/memory/records/correction_history/contracts.py +19 -0
  527. daecore/memory/records/correction_history/derivation.py +437 -0
  528. daecore/memory/records/correction_history/erasure.py +107 -0
  529. daecore/memory/records/correction_history/naming.py +106 -0
  530. daecore/memory/records/correction_history/operations.py +219 -0
  531. daecore/memory/records/correction_history/recording.py +114 -0
  532. daecore/memory/records/correction_history/reference_fields.py +21 -0
  533. daecore/memory/records/correction_history/snapshots.py +46 -0
  534. daecore/memory/records/correction_history/undone_effects.py +101 -0
  535. daecore/memory/records/correction_history/validation.py +149 -0
  536. daecore/memory/records/exclusion_identity.py +54 -0
  537. daecore/memory/records/exclusions.py +350 -0
  538. daecore/memory/records/metadata.py +118 -0
  539. daecore/memory/records/origin_rights.py +197 -0
  540. daecore/memory/records/remember.py +68 -0
  541. daecore/memory/records/retirement.py +185 -0
  542. daecore/memory/records/revisions.py +135 -0
  543. daecore/memory/records/schema.py +428 -0
  544. daecore/memory/records/succession.py +287 -0
  545. daecore/memory/records/validation.py +226 -0
  546. daecore/memory/reference.py +172 -0
  547. daecore/memory/review_queues.py +116 -0
  548. daecore/memory/search.py +154 -0
  549. daecore/memory/store.py +903 -0
  550. daecore/memory/support.py +35 -0
  551. daecore/memory/support_reads.py +57 -0
  552. daecore/memory/writes.py +390 -0
  553. daecore/model_ids.py +6 -0
  554. daecore/name_coverage.py +266 -0
  555. daecore/name_presence.py +192 -0
  556. daecore/named_references.py +277 -0
  557. daecore/observability/__init__.py +1 -0
  558. daecore/observability/assurance.py +66 -0
  559. daecore/observability/assurance_provider.py +337 -0
  560. daecore/observability/crash_log.py +37 -0
  561. daecore/observability/event_log.py +229 -0
  562. daecore/observability/mcp_connections.py +274 -0
  563. daecore/observability/operation_status.py +101 -0
  564. daecore/observability/profile_io.py +42 -0
  565. daecore/observability/query_log.py +284 -0
  566. daecore/observability/rolling.py +224 -0
  567. daecore/observability/rotate.py +264 -0
  568. daecore/observability/semconv.py +1273 -0
  569. daecore/observability/telemetry_seal.py +310 -0
  570. daecore/observability/usage.py +225 -0
  571. daecore/operation_files/__init__.py +1103 -0
  572. daecore/operation_files/_coordination.py +283 -0
  573. daecore/operation_files/_files.py +316 -0
  574. daecore/operation_files/_records.py +204 -0
  575. daecore/operation_files/_types.py +30 -0
  576. daecore/operations/__init__.py +1 -0
  577. daecore/operations/admission.py +534 -0
  578. daecore/operations/barriers.py +81 -0
  579. daecore/operations/context.py +366 -0
  580. daecore/operations/contract.py +220 -0
  581. daecore/operations/errors.py +44 -0
  582. daecore/operations/frozen_read.py +101 -0
  583. daecore/operations/lease.py +340 -0
  584. daecore/operations/recovery.py +221 -0
  585. daecore/operations/recovery_contracts.py +214 -0
  586. daecore/operations/registry.py +1343 -0
  587. daecore/operations/rollback_snapshot.py +423 -0
  588. daecore/operations/runtime.py +281 -0
  589. daecore/operations/trace.py +121 -0
  590. daecore/operations/tree_snapshot.py +270 -0
  591. daecore/package_build.py +305 -0
  592. daecore/package_install.py +282 -0
  593. daecore/path_lock.py +168 -0
  594. daecore/paths.py +299 -0
  595. daecore/private_files.py +557 -0
  596. daecore/read_posture.py +52 -0
  597. daecore/read_vocabulary.py +227 -0
  598. daecore/reconcile.py +298 -0
  599. daecore/relay.py +8557 -0
  600. daecore/relay_support/__init__.py +1 -0
  601. daecore/relay_support/conversation.py +314 -0
  602. daecore/relay_support/custody.py +242 -0
  603. daecore/relay_support/diagnostics.py +114 -0
  604. daecore/relay_support/environment.py +65 -0
  605. daecore/relay_support/forwarding.py +248 -0
  606. daecore/relay_support/handshake.py +239 -0
  607. daecore/relay_support/home_location.py +215 -0
  608. daecore/relay_support/home_rename.py +188 -0
  609. daecore/relay_support/http_transport.py +451 -0
  610. daecore/relay_support/identity.py +672 -0
  611. daecore/relay_support/jsonrpc.py +167 -0
  612. daecore/relay_support/pinned_http.py +252 -0
  613. daecore/relay_support/processes.py +245 -0
  614. daecore/relay_support/protocol.py +742 -0
  615. daecore/relay_support/readiness.py +267 -0
  616. daecore/relay_support/relay_state.py +331 -0
  617. daecore/relay_support/runtime_selection.py +357 -0
  618. daecore/relay_support/spawn_broker.py +462 -0
  619. daecore/relay_support/spawn_process.py +249 -0
  620. daecore/relay_support/spawn_records.py +176 -0
  621. daecore/relay_support/spawn_tracking.py +647 -0
  622. daecore/relay_support/startup.py +744 -0
  623. daecore/relay_support/startup_files.py +178 -0
  624. daecore/relay_support/transport.py +510 -0
  625. daecore/release_install.py +481 -0
  626. daecore/request_deadline.py +173 -0
  627. daecore/resources/__init__.py +98 -0
  628. daecore/resources/_disk.py +463 -0
  629. daecore/resources/artifacts.py +134 -0
  630. daecore/retrieval/__init__.py +1 -0
  631. daecore/retrieval/_contract_primitives.py +105 -0
  632. daecore/retrieval/_evidence_validation.py +271 -0
  633. daecore/retrieval/_request_validation.py +101 -0
  634. daecore/retrieval/_response_validation.py +251 -0
  635. daecore/retrieval/assurance.py +103 -0
  636. daecore/retrieval/assurance_provider.py +573 -0
  637. daecore/retrieval/build/__init__.py +1 -0
  638. daecore/retrieval/build/cancellation.py +79 -0
  639. daecore/retrieval/build/candidate.py +159 -0
  640. daecore/retrieval/build/capture.py +159 -0
  641. daecore/retrieval/build/contract.py +199 -0
  642. daecore/retrieval/build/global_build.py +135 -0
  643. daecore/retrieval/build/identity.py +229 -0
  644. daecore/retrieval/build/ledger_candidate.py +1036 -0
  645. daecore/retrieval/build/ledger_publication.py +256 -0
  646. daecore/retrieval/build/ledger_rows.py +143 -0
  647. daecore/retrieval/build/memory.py +246 -0
  648. daecore/retrieval/build/metrics.py +131 -0
  649. daecore/retrieval/build/pipeline.py +401 -0
  650. daecore/retrieval/build/precommit.py +122 -0
  651. daecore/retrieval/build/residency.py +163 -0
  652. daecore/retrieval/build/results.py +98 -0
  653. daecore/retrieval/build/source.py +36 -0
  654. daecore/retrieval/build/source_selection.py +81 -0
  655. daecore/retrieval/build/state.py +843 -0
  656. daecore/retrieval/build/vectors.py +262 -0
  657. daecore/retrieval/build/workspace_progress.py +160 -0
  658. daecore/retrieval/candidate_cache.py +191 -0
  659. daecore/retrieval/capacity.py +90 -0
  660. daecore/retrieval/channel_fusion.py +73 -0
  661. daecore/retrieval/context_composer.py +413 -0
  662. daecore/retrieval/contracts.py +216 -0
  663. daecore/retrieval/corpus_date.py +545 -0
  664. daecore/retrieval/dense.py +1055 -0
  665. daecore/retrieval/document_projection.py +121 -0
  666. daecore/retrieval/embedders.py +221 -0
  667. daecore/retrieval/evidence.py +82 -0
  668. daecore/retrieval/file_ingest.py +587 -0
  669. daecore/retrieval/file_passages.py +125 -0
  670. daecore/retrieval/file_turns.py +435 -0
  671. daecore/retrieval/freshness.py +104 -0
  672. daecore/retrieval/index_state.py +56 -0
  673. daecore/retrieval/ingest_governor.py +127 -0
  674. daecore/retrieval/lexical.py +137 -0
  675. daecore/retrieval/name_history.py +306 -0
  676. daecore/retrieval/name_moves.py +161 -0
  677. daecore/retrieval/name_scan.py +357 -0
  678. daecore/retrieval/packed_files.py +427 -0
  679. daecore/retrieval/prefix_selection.py +266 -0
  680. daecore/retrieval/presentation.py +162 -0
  681. daecore/retrieval/query_cache.py +193 -0
  682. daecore/retrieval/rebuild.py +625 -0
  683. daecore/retrieval/reranking.py +492 -0
  684. daecore/retrieval/resource_budget.py +101 -0
  685. daecore/retrieval/resource_posture.py +213 -0
  686. daecore/retrieval/result_rows.py +193 -0
  687. daecore/retrieval/searcher.py +1172 -0
  688. daecore/retrieval/selection.py +161 -0
  689. daecore/retrieval/survey_storage.py +26 -0
  690. daecore/retrieval/sweep.py +1075 -0
  691. daecore/retrieval/watch_specs.py +70 -0
  692. daecore/retrieval/workspace_resolution.py +55 -0
  693. daecore/retrieval/workspace_withdrawal.py +231 -0
  694. daecore/runtime_contracts.py +80 -0
  695. daecore/runtime_enrollment.py +82 -0
  696. daecore/runtime_use.py +565 -0
  697. daecore/schema_versions.py +83 -0
  698. daecore/scripts/__init__.py +10 -0
  699. daecore/scripts/mcp_launcher.py +485 -0
  700. daecore/security/__init__.py +9 -0
  701. daecore/security/key_material/__init__.py +1139 -0
  702. daecore/security/key_material/_derivation.py +152 -0
  703. daecore/security/key_material/_dpapi.py +222 -0
  704. daecore/security/key_material/_errors.py +24 -0
  705. daecore/security/key_material/_machine.py +78 -0
  706. daecore/security/key_material/_os_keychain.py +191 -0
  707. daecore/security/key_material/_records.py +234 -0
  708. daecore/security/key_material/_registry.py +81 -0
  709. daecore/security/lock_state.py +55 -0
  710. daecore/security/posture.py +475 -0
  711. daecore/sentinel/__init__.py +1 -0
  712. daecore/sentinel/frontmatter.py +37 -0
  713. daecore/sentinel/hashing.py +50 -0
  714. daecore/sentinel/header.py +73 -0
  715. daecore/sentinel/marker.py +74 -0
  716. daecore/sentinel/ownership.py +34 -0
  717. daecore/sentinel/types.py +46 -0
  718. daecore/server/__init__.py +1 -0
  719. daecore/server/_embedding_handoff.py +96 -0
  720. daecore/server/_packet_render.py +239 -0
  721. daecore/server/_read_packets.py +314 -0
  722. daecore/server/_recall_packet.py +239 -0
  723. daecore/server/_utils.py +38 -0
  724. daecore/server/_write_packets.py +155 -0
  725. daecore/server/application.py +271 -0
  726. daecore/server/attachments.py +214 -0
  727. daecore/server/attribution.py +217 -0
  728. daecore/server/auth_gate.py +297 -0
  729. daecore/server/boot.py +317 -0
  730. daecore/server/boot_profile.py +66 -0
  731. daecore/server/candidate_check.py +68 -0
  732. daecore/server/change_queue.py +881 -0
  733. daecore/server/config_observer.py +688 -0
  734. daecore/server/content_access.py +521 -0
  735. daecore/server/corpus_mutation.py +260 -0
  736. daecore/server/frozen_reads.py +364 -0
  737. daecore/server/health.py +537 -0
  738. daecore/server/http/__init__.py +1 -0
  739. daecore/server/http/admin.py +187 -0
  740. daecore/server/http/admission.py +83 -0
  741. daecore/server/http/builder.py +66 -0
  742. daecore/server/http/middleware.py +258 -0
  743. daecore/server/http/retrieval.py +227 -0
  744. daecore/server/http/routes.py +98 -0
  745. daecore/server/index_rebuilds.py +289 -0
  746. daecore/server/lifecycle.py +1017 -0
  747. daecore/server/maintenance.py +317 -0
  748. daecore/server/memory_projection.py +157 -0
  749. daecore/server/model_health.py +209 -0
  750. daecore/server/model_residency.py +349 -0
  751. daecore/server/mutations.py +287 -0
  752. daecore/server/native_sync.py +331 -0
  753. daecore/server/next_calls.py +93 -0
  754. daecore/server/notices.py +137 -0
  755. daecore/server/observer_lifetime.py +374 -0
  756. daecore/server/packet_contracts.py +865 -0
  757. daecore/server/packets.py +345 -0
  758. daecore/server/proof_process.py +165 -0
  759. daecore/server/publication.py +231 -0
  760. daecore/server/rate_limit.py +179 -0
  761. daecore/server/readiness.py +497 -0
  762. daecore/server/reads/__init__.py +1 -0
  763. daecore/server/reads/_exact_documents.py +200 -0
  764. daecore/server/reads/_exact_lanes.py +278 -0
  765. daecore/server/reads/_exact_memory_facts.py +270 -0
  766. daecore/server/reads/_exact_paging.py +310 -0
  767. daecore/server/reads/_exact_passage_counts.py +193 -0
  768. daecore/server/reads/_exact_population.py +425 -0
  769. daecore/server/reads/_exact_reports.py +347 -0
  770. daecore/server/reads/_exact_request.py +212 -0
  771. daecore/server/reads/_exact_snapshot.py +325 -0
  772. daecore/server/reads/_exact_statistics.py +395 -0
  773. daecore/server/reads/_exact_types.py +273 -0
  774. daecore/server/reads/attribution.py +26 -0
  775. daecore/server/reads/browse.py +146 -0
  776. daecore/server/reads/browse_links.py +275 -0
  777. daecore/server/reads/bucket_listing.py +345 -0
  778. daecore/server/reads/clamps.py +20 -0
  779. daecore/server/reads/continuations.py +151 -0
  780. daecore/server/reads/dating.py +127 -0
  781. daecore/server/reads/degradation.py +123 -0
  782. daecore/server/reads/exact.py +58 -0
  783. daecore/server/reads/execution.py +869 -0
  784. daecore/server/reads/inspection.py +35 -0
  785. daecore/server/reads/inspection_pages.py +315 -0
  786. daecore/server/reads/link_graph.py +453 -0
  787. daecore/server/reads/link_items.py +301 -0
  788. daecore/server/reads/link_presentation.py +173 -0
  789. daecore/server/reads/link_report.py +172 -0
  790. daecore/server/reads/link_rows.py +415 -0
  791. daecore/server/reads/link_upkeep.py +145 -0
  792. daecore/server/reads/link_walks.py +754 -0
  793. daecore/server/reads/links.py +518 -0
  794. daecore/server/reads/pagination.py +148 -0
  795. daecore/server/reads/recall.py +210 -0
  796. daecore/server/reads/recall_links.py +198 -0
  797. daecore/server/reads/recall_log.py +105 -0
  798. daecore/server/reads/recall_pages.py +251 -0
  799. daecore/server/reads/recent_context.py +475 -0
  800. daecore/server/reads/retries.py +34 -0
  801. daecore/server/reads/write_reply.py +189 -0
  802. daecore/server/recall_handoff.py +176 -0
  803. daecore/server/recall_returns.py +129 -0
  804. daecore/server/refusals.py +191 -0
  805. daecore/server/rendering.py +466 -0
  806. daecore/server/reply_contracts.py +567 -0
  807. daecore/server/reply_views.py +496 -0
  808. daecore/server/response_write.py +333 -0
  809. daecore/server/result_catalog.py +226 -0
  810. daecore/server/review_health.py +195 -0
  811. daecore/server/scoping.py +221 -0
  812. daecore/server/tool_audit.py +340 -0
  813. daecore/server/tool_codes.py +29 -0
  814. daecore/server/tool_inventory.py +79 -0
  815. daecore/server/tool_requests.py +319 -0
  816. daecore/server/tool_runtime.py +884 -0
  817. daecore/server/tools/__init__.py +1 -0
  818. daecore/server/tools/_arguments.py +304 -0
  819. daecore/server/tools/_evidence.py +351 -0
  820. daecore/server/tools/_mutation_replies.py +82 -0
  821. daecore/server/tools/_variants.py +92 -0
  822. daecore/server/tools/admin.py +469 -0
  823. daecore/server/tools/annotation.py +275 -0
  824. daecore/server/tools/browse.py +353 -0
  825. daecore/server/tools/correction.py +385 -0
  826. daecore/server/tools/explore.py +217 -0
  827. daecore/server/tools/inspect.py +386 -0
  828. daecore/server/tools/memory.py +414 -0
  829. daecore/server/tools/recall.py +567 -0
  830. daecore/server/transport.py +156 -0
  831. daecore/server/update_window.py +217 -0
  832. daecore/server/warmup.py +293 -0
  833. daecore/server/watch_events.py +287 -0
  834. daecore/server/watch_queues.py +436 -0
  835. daecore/server/watch_routing.py +286 -0
  836. daecore/server/watcher.py +957 -0
  837. daecore/server/work.py +128 -0
  838. daecore/server/workspace_lifecycle.py +320 -0
  839. daecore/setup/__init__.py +37 -0
  840. daecore/setup/_application.py +353 -0
  841. daecore/setup/_contracts.py +84 -0
  842. daecore/setup/_planning.py +502 -0
  843. daecore/setup/_uninstall_removal.py +493 -0
  844. daecore/setup/_uninstall_runtime.py +123 -0
  845. daecore/setup/assurance.py +90 -0
  846. daecore/setup/assurance_provider.py +399 -0
  847. daecore/setup/bootstrap/__init__.py +280 -0
  848. daecore/setup/bootstrap/_acceleration.py +138 -0
  849. daecore/setup/bootstrap/_activation_receipts.py +115 -0
  850. daecore/setup/bootstrap/_plan_actions.py +221 -0
  851. daecore/setup/bootstrap/apply.py +555 -0
  852. daecore/setup/bootstrap/doctor.py +147 -0
  853. daecore/setup/bootstrap/fs_safety.py +93 -0
  854. daecore/setup/bootstrap/native_memory.py +457 -0
  855. daecore/setup/bootstrap/planning.py +708 -0
  856. daecore/setup/bootstrap/readiness.py +459 -0
  857. daecore/setup/bootstrap/receipt.py +85 -0
  858. daecore/setup/bootstrap/types.py +273 -0
  859. daecore/setup/bootstrap/wizard.py +389 -0
  860. daecore/setup/cli.py +222 -0
  861. daecore/setup/config.py +19 -0
  862. daecore/setup/detection.py +39 -0
  863. daecore/setup/execute.py +270 -0
  864. daecore/setup/guide.py +40 -0
  865. daecore/setup/hosts.py +674 -0
  866. daecore/setup/interaction.py +415 -0
  867. daecore/setup/merge/__init__.py +1 -0
  868. daecore/setup/merge/_json_patch_identity.py +178 -0
  869. daecore/setup/merge/_json_patch_operations.py +284 -0
  870. daecore/setup/merge/_json_patch_ownership.py +378 -0
  871. daecore/setup/merge/_json_patch_values.py +95 -0
  872. daecore/setup/merge/_publish.py +96 -0
  873. daecore/setup/merge/_toml_edit.py +416 -0
  874. daecore/setup/merge/_toml_structure.py +273 -0
  875. daecore/setup/merge/json_patch.py +324 -0
  876. daecore/setup/merge/jsonc.py +211 -0
  877. daecore/setup/merge/markdown_section.py +267 -0
  878. daecore/setup/merge/skill_file.py +41 -0
  879. daecore/setup/merge/syntax.py +146 -0
  880. daecore/setup/merge/toml_block.py +307 -0
  881. daecore/setup/merge/types.py +129 -0
  882. daecore/setup/merge/whole_file_sentinel.py +248 -0
  883. daecore/setup/merge/yaml_text.py +300 -0
  884. daecore/setup/plan.py +322 -0
  885. daecore/setup/plan_file.py +83 -0
  886. daecore/setup/record.py +224 -0
  887. daecore/setup/refresh_snapshot.py +361 -0
  888. daecore/setup/render.py +447 -0
  889. daecore/setup/templates/antigravity/continuity.md +8 -0
  890. daecore/setup/templates/antigravity/mcp.json.patch +19 -0
  891. daecore/setup/templates/claude-code/mcp.json.patch +22 -0
  892. daecore/setup/templates/codex/config.toml.patch +64 -0
  893. daecore/setup/templates/constitution-section.md.tmpl +3 -0
  894. daecore/setup/templates/copilot/mcp-config.json.patch +24 -0
  895. daecore/setup/templates/cursor/continuity.md +7 -0
  896. daecore/setup/templates/cursor/daecore-continuity.js +31 -0
  897. daecore/setup/templates/cursor/hooks.json.patch +24 -0
  898. daecore/setup/templates/cursor/mcp.json.patch +22 -0
  899. daecore/setup/templates/devin/continuity.md +8 -0
  900. daecore/setup/templates/devin/mcp.json.patch +20 -0
  901. daecore/setup/templates/hermes/config.yaml.patch +19 -0
  902. daecore/setup/templates/opencode/config.json.patch +28 -0
  903. daecore/setup/templates/skill/SKILL.md +38 -0
  904. daecore/setup/templates/skill/references/connect-any-host.md +84 -0
  905. daecore/setup/templates/skill/references/diagnose.md +62 -0
  906. daecore/setup/templates/skill/references/maintain.md +63 -0
  907. daecore/setup/uninstall.py +1298 -0
  908. daecore/setup/uninstall_execution.py +536 -0
  909. daecore/setup/uninstall_types.py +41 -0
  910. daecore/source_build.py +143 -0
  911. daecore/source_capture.py +117 -0
  912. daecore/source_identity.py +12 -0
  913. daecore/sqlite_identity.py +257 -0
  914. daecore/sqlite_space.py +153 -0
  915. daecore/stage_timings.py +119 -0
  916. daecore/status/__init__.py +1 -0
  917. daecore/status/inventory.py +192 -0
  918. daecore/status/memory_health.py +235 -0
  919. daecore/status/process_memory.py +141 -0
  920. daecore/status/snapshot.py +482 -0
  921. daecore/status/source_review.py +154 -0
  922. daecore/status/sources.py +271 -0
  923. daecore/status/watch.py +70 -0
  924. daecore/storage/__init__.py +3 -0
  925. daecore/storage/assurance.py +93 -0
  926. daecore/storage/assurance_provider.py +306 -0
  927. daecore/storage/database/__init__.py +71 -0
  928. daecore/storage/database/encrypted.py +451 -0
  929. daecore/storage/database/fs_probe.py +135 -0
  930. daecore/storage/database/fs_safety.py +576 -0
  931. daecore/storage/database/read_pool.py +94 -0
  932. daecore/storage/encrypted_meta_schema.py +374 -0
  933. daecore/storage/encrypted_snapshot.py +249 -0
  934. daecore/storage/index/__init__.py +3 -0
  935. daecore/storage/index/_diagnostic_moves.py +135 -0
  936. daecore/storage/index/_diagnostic_records.py +208 -0
  937. daecore/storage/index/chunk_projection.py +405 -0
  938. daecore/storage/index/citation_reading.py +510 -0
  939. daecore/storage/index/connections.py +269 -0
  940. daecore/storage/index/diagnostics.py +554 -0
  941. daecore/storage/index/document_reads.py +467 -0
  942. daecore/storage/index/document_schema.py +395 -0
  943. daecore/storage/index/document_visibility.py +77 -0
  944. daecore/storage/index/document_writers.py +474 -0
  945. daecore/storage/index/errors.py +46 -0
  946. daecore/storage/index/file_ledger.py +713 -0
  947. daecore/storage/index/generations.py +970 -0
  948. daecore/storage/index/hygiene_review.py +380 -0
  949. daecore/storage/index/key.py +130 -0
  950. daecore/storage/index/lexical.py +429 -0
  951. daecore/storage/index/link_revisions.py +87 -0
  952. daecore/storage/index/link_view.py +518 -0
  953. daecore/storage/index/memory_links.py +274 -0
  954. daecore/storage/index/metadata.py +65 -0
  955. daecore/storage/index/model_policy.py +69 -0
  956. daecore/storage/index/name_inventory.py +275 -0
  957. daecore/storage/index/payloads.py +513 -0
  958. daecore/storage/index/pointer.py +181 -0
  959. daecore/storage/index/profiles.py +581 -0
  960. daecore/storage/index/publication_undo.py +240 -0
  961. daecore/storage/index/schema.py +374 -0
  962. daecore/storage/index/search_atoms.py +782 -0
  963. daecore/storage/index/shared_generations.py +485 -0
  964. daecore/storage/index/shared_objects.py +831 -0
  965. daecore/storage/index/snapshots.py +118 -0
  966. daecore/storage/index/text_match.py +379 -0
  967. daecore/storage/index/vector_encoding.py +122 -0
  968. daecore/storage/integrity.py +222 -0
  969. daecore/storage/janitor/__init__.py +149 -0
  970. daecore/storage/janitor/_artifacts.py +426 -0
  971. daecore/storage/janitor/_audit.py +345 -0
  972. daecore/storage/meta_store.py +360 -0
  973. daecore/storage/native.py +51 -0
  974. daecore/subprocesses.py +404 -0
  975. daecore/sync/__init__.py +6 -0
  976. daecore/sync/catchup.py +203 -0
  977. daecore/sync/consent.py +905 -0
  978. daecore/sync/discovery.py +521 -0
  979. daecore/sync/full_scan.py +95 -0
  980. daecore/sync/identity.py +74 -0
  981. daecore/sync/recorded_sources.py +111 -0
  982. daecore/sync/result.py +86 -0
  983. daecore/sync/snapshot.py +586 -0
  984. daecore/templates/__init__.py +2 -0
  985. daecore/templates/global-config.toml +121 -0
  986. daecore/term/__init__.py +88 -0
  987. daecore/term/_brand.py +77 -0
  988. daecore/term/_console.py +96 -0
  989. daecore/term/_errors.py +62 -0
  990. daecore/term/_prompt.py +162 -0
  991. daecore/term/_questionary.py +62 -0
  992. daecore/term/_references.py +69 -0
  993. daecore/term/capabilities.py +153 -0
  994. daecore/term/lifecycle.py +917 -0
  995. daecore/term/live_region.py +260 -0
  996. daecore/term/loader.py +118 -0
  997. daecore/term/progress.py +958 -0
  998. daecore/term/prompts.py +58 -0
  999. daecore/term/rendering.py +971 -0
  1000. daecore/term/safety.py +13 -0
  1001. daecore/term/verb_help.py +207 -0
  1002. daecore/term/wizard.py +86 -0
  1003. daecore/testing/__init__.py +13 -0
  1004. daecore/testing/crashpoints.py +81 -0
  1005. daecore/testing/launch.py +97 -0
  1006. daecore/text_decoding.py +68 -0
  1007. daecore/time_utils.py +430 -0
  1008. daecore/tokenizer_assets.py +39 -0
  1009. daecore/transfer/__init__.py +1 -0
  1010. daecore/transfer/_eff_wordlist.py +661 -0
  1011. daecore/transfer/_verify.py +169 -0
  1012. daecore/transfer/capacity.py +87 -0
  1013. daecore/transfer/citations.py +253 -0
  1014. daecore/transfer/classification.py +189 -0
  1015. daecore/transfer/completion.py +155 -0
  1016. daecore/transfer/contracts.py +280 -0
  1017. daecore/transfer/convert.py +500 -0
  1018. daecore/transfer/event_policy.py +85 -0
  1019. daecore/transfer/export.py +163 -0
  1020. daecore/transfer/export_file.py +371 -0
  1021. daecore/transfer/export_payload.py +222 -0
  1022. daecore/transfer/import_flow.py +278 -0
  1023. daecore/transfer/import_job.py +296 -0
  1024. daecore/transfer/journal.py +96 -0
  1025. daecore/transfer/members.py +792 -0
  1026. daecore/transfer/publication.py +584 -0
  1027. daecore/transfer/publish.py +306 -0
  1028. daecore/transfer/receipt.py +120 -0
  1029. daecore/transfer/recovery.py +228 -0
  1030. daecore/transfer/snapshot.py +950 -0
  1031. daecore/transfer/verification.py +64 -0
  1032. daecore/tree_copy.py +178 -0
  1033. daecore/workspace/__init__.py +1 -0
  1034. daecore/workspace/availability.py +192 -0
  1035. daecore/workspace/config_transaction.py +772 -0
  1036. daecore/workspace/filesystem.py +269 -0
  1037. daecore/workspace/identity.py +327 -0
  1038. daecore/workspace/intake.py +669 -0
  1039. daecore/workspace/probes.py +221 -0
  1040. daecore/workspace/project_links.py +252 -0
  1041. daecore/workspace/project_membership.py +35 -0
  1042. daecore/workspace/reattach.py +446 -0
  1043. daecore/workspace/recovery.py +25 -0
  1044. daecore/workspace/registry.py +645 -0
  1045. daecore/workspace/scope.py +507 -0
  1046. daecore-0.3.0.dist-info/METADATA +285 -0
  1047. daecore-0.3.0.dist-info/RECORD +1051 -0
  1048. daecore-0.3.0.dist-info/WHEEL +4 -0
  1049. daecore-0.3.0.dist-info/entry_points.txt +3 -0
  1050. daecore-0.3.0.dist-info/licenses/LICENSE +201 -0
  1051. daecore-0.3.0.dist-info/licenses/NOTICE +99 -0
@@ -0,0 +1,890 @@
1
+ """Canonical citations: the typed relationships an owned memory asserts.
2
+
3
+ A citation is one assertion by an owned memory body that a specific record
4
+ supports it. The record keeps its current citation set materialized beside an
5
+ opaque revision token, and every change lands as one replayable
6
+ ``citations_changed`` event, so checkpoint replay reproduces exactly the set
7
+ the store serves. The graph projection reads those events; it is never a
8
+ second authority for membership.
9
+
10
+ Endpoint binding follows the cited words. An owned target binds its stored
11
+ incarnation and content revision. A document target -- a corpus passage, an
12
+ indexed file or heading, or a mirrored memory record, whose file is its note
13
+ file -- stores a locator instead: the file, the heading holding the cited
14
+ words, the quoted words with a little context, and fingerprints of the file
15
+ and of the cited scope. A locator is written once, when the agent cites, and
16
+ is never rewritten; reads judge whether its words still hold.
17
+ """
18
+ from __future__ import annotations
19
+
20
+ import hashlib
21
+ import json
22
+ from collections.abc import Sequence
23
+ from dataclasses import dataclass, field
24
+ from typing import Any, Literal
25
+
26
+ from daecore.documents.identity import heading_id
27
+ from daecore.documents.locators import (
28
+ DocumentLocator,
29
+ LocatorError,
30
+ locate_citation,
31
+ locate_records_file,
32
+ locator_from_binding,
33
+ quote_spans,
34
+ )
35
+ from daecore.documents.outline import DocumentOutline
36
+ from daecore.evidence_identity import (
37
+ EvidenceIdentityError,
38
+ EvidenceKind,
39
+ derive,
40
+ parse_lookup,
41
+ require_canonical_kind,
42
+ )
43
+ from daecore.memory.records.contracts import (
44
+ REVISION_TOKEN_WIDTH,
45
+ MemoryEventType,
46
+ is_revision_token,
47
+ )
48
+ from daecore.time_utils import format_time, parse_time
49
+
50
+ CITATION_RELATION = 'cites'
51
+ EDGE_IDENTITY_SCHEMA = 'edge.v1'
52
+ CITATIONS_PER_RECORD_MAX = 32
53
+ CITATION_DELTA_MAX = 32
54
+ CITATION_QUOTE_MAX_CHARS = 512
55
+ CITATION_ENTRY_FIELDS = frozenset({
56
+ 'edge_id', 'target_id', 'target_binding', 'source_quote', 'source_span',
57
+ 'target_quote', 'target_span', 'at',
58
+ })
59
+ _RECORD_BINDING_FIELDS = frozenset({'incarnation_id', 'content_revision'})
60
+ _CITATION_INPUT_FIELDS = frozenset({'target_id', 'target_path', 'source_quote', 'target_quote'})
61
+ # The longest path a citation may name, as a file system takes it.
62
+ CITATION_PATH_MAX_CHARS = 1024
63
+ CITATIONS_EVENT_FIELDS = frozenset({
64
+ 'operation', 'added', 'removed', 'reasserted', 'client', 'model',
65
+ 'session', 'correction_id', 'previous_revision', 'revision',
66
+ })
67
+ # Every way a citation set changes: a write that supplies them, a
68
+ # reaffirmation, an explicit edit, a correction citing its winner, and the
69
+ # inverse a revert applies.
70
+ CITATION_OPERATIONS = frozenset({'create', 'reaffirm', 'readopt', 'update', 'correction', 'revert'})
71
+ _CITED_KINDS = (
72
+ EvidenceKind.MEMORY, EvidenceKind.IMPORTED, EvidenceKind.CORPUS, EvidenceKind.DOCUMENT,
73
+ )
74
+ _QUOTE_REQUIRED = (
75
+ 'a citation of a document, a passage or an imported memory needs target_quote: the phrase or sentence this '
76
+ 'claim rests on, copied as the document writes it; a citation saved without one cannot be renewed: edit '
77
+ 'it, naming its target again with a target_quote'
78
+ )
79
+ _NOTHING_TO_QUOTE = (
80
+ "this passage holds only lines the file's reader wrote, such as a page heading, so it has no words to quote "
81
+ 'and cannot be cited; cite its file or one of its headings with a target_quote'
82
+ )
83
+
84
+
85
+ class CitationError(ValueError):
86
+ """A citation request cannot be recorded as asked; ``code`` is stable.
87
+
88
+ ``retryable`` marks a failure of the lookup rather than of the request:
89
+ the same request may succeed once the index can be read again.
90
+ ``memory_id`` names a memory the refusal is about, such as a retired one.
91
+ """
92
+
93
+ def __init__(self, code: str, message: str, *, retryable: bool = False, memory_id: str | None = None,
94
+ field: str | None = None) -> None:
95
+ super().__init__(message)
96
+ self.code = code
97
+ self.retryable = retryable
98
+ self.memory_id = memory_id
99
+ self.field = field
100
+
101
+
102
+ class CitationRevertConflict(CitationError):
103
+ """A correction's citation delta has no safe inverse in the retained history."""
104
+
105
+ def __init__(self, message: str) -> None:
106
+ super().__init__('citation_revert_conflict', message)
107
+
108
+
109
+ @dataclass(frozen=True)
110
+ class CitationInput:
111
+ """One normalized citation request: a target and optional exact quotes."""
112
+
113
+ target_id: str | None
114
+ source_quote: str | None = None
115
+ target_quote: str | None = None
116
+ # Where the request wrote it, such as `citations[0]`; absent for a citation the server builds.
117
+ entry: str | None = field(default=None, compare=False)
118
+ # A workspace file path naming the target instead of ``target_id``, read as a link root is.
119
+ target_path: str | None = None
120
+ # For a renewal: the locator the citation was bound under; its words are sought again only where it names.
121
+ renewing: DocumentLocator | None = None
122
+
123
+
124
+ @dataclass(frozen=True)
125
+ class WatchedFile:
126
+ """A workspace file a citation names by path that no index holds.
127
+
128
+ It is never a citation and is never stored: the code-name watch reads the
129
+ names in a memory's text, so a write accepts it only when that text names
130
+ it (``named``), and it stays watched while the text does. ``state`` is what
131
+ the last completed scans say of the copies the text names.
132
+ """
133
+
134
+ named: bool
135
+ state: Literal['present', 'not_seen', 'unknown']
136
+
137
+
138
+ @dataclass(frozen=True)
139
+ class DocumentTarget:
140
+ """Where a document citation's words are placed.
141
+
142
+ ``outline`` is the file's outline, or None for a records file, which keeps
143
+ no text. ``entry`` names the cited heading (0 is the whole file), where the
144
+ citation's quote is sought. A passage target, an indexed passage or an imported
145
+ memory, carries ``passage``, where it lies in the file as UTF-8 byte
146
+ offsets: the citation's scope and any quote stay inside that passage.
147
+ An indexed passage also carries ``runs``, the ranges of its own text, and a
148
+ quote's words must lie on them; a passage holding only lines its decoder
149
+ wrote has none, so no quote binds to it. ``renewing``, for a renewal, is
150
+ the locator the citation was bound under: its words are sought again only
151
+ where it names, and the citation then names the heading holding them.
152
+ """
153
+
154
+ scope: str
155
+ path: str
156
+ outline: DocumentOutline | None
157
+ input_digest: str
158
+ entry: int | None = None
159
+ passage: tuple[int, int] | None = None
160
+ runs: tuple[tuple[int, int], ...] | None = None
161
+ renewing: DocumentLocator | None = None
162
+
163
+
164
+ @dataclass(frozen=True)
165
+ class CitationTarget:
166
+ """One resolved, currently available citation target.
167
+
168
+ An owned memory carries its ``binding``. A document target carries its
169
+ ``document``; its binding is the locator one citation's words produce.
170
+ """
171
+
172
+ id: str
173
+ content: str
174
+ binding: dict[str, Any] | None = None
175
+ document: DocumentTarget | None = None
176
+
177
+
178
+ def _sha256(text: str) -> str:
179
+ return hashlib.sha256(text.encode('utf-8')).hexdigest()
180
+
181
+
182
+ def _canonical(value: Any) -> str:
183
+ return json.dumps(value, sort_keys=True, separators=(',', ':'), ensure_ascii=False)
184
+
185
+
186
+ # --------------------------------------------------------------------------
187
+ # Public input normalization
188
+ # --------------------------------------------------------------------------
189
+
190
+
191
+ def _normalize_quote(raw: object, *, name: str) -> str | None:
192
+ if raw is None:
193
+ return None
194
+ if not isinstance(raw, str):
195
+ raise CitationError('invalid_request', f'{name} must be a string or null', field=name)
196
+ if not raw.strip():
197
+ raise CitationError('invalid_request', f'{name} must not be empty', field=name)
198
+ if len(raw) > CITATION_QUOTE_MAX_CHARS:
199
+ raise CitationError(
200
+ 'invalid_request',
201
+ f'{name} must be at most {CITATION_QUOTE_MAX_CHARS} characters', field=name,
202
+ )
203
+ return raw
204
+
205
+
206
+ def normalize_citation_inputs(raw: object, *, field: str = 'citations') -> tuple[CitationInput, ...]:
207
+ """Validate one public citation list, named ``field``, before any lookup.
208
+
209
+ A refusal names the list and the entry's position, never the text sent.
210
+ """
211
+ if raw is None:
212
+ return ()
213
+ if not isinstance(raw, list):
214
+ raise CitationError('invalid_request', f'{field} must be a list of citation objects', field=field)
215
+ if len(raw) > CITATION_DELTA_MAX:
216
+ raise CitationError(
217
+ 'citation_limit',
218
+ f'{field} takes at most {CITATION_DELTA_MAX} citations in one request',
219
+ )
220
+ inputs: list[CitationInput] = []
221
+ for index, item in enumerate(raw):
222
+ entry = f'{field}[{index}]'
223
+ if not isinstance(item, dict):
224
+ raise CitationError('invalid_request', f'{entry} must be a citation object', field=entry)
225
+ unknown = set(item) - _CITATION_INPUT_FIELDS
226
+ if unknown:
227
+ raise CitationError(
228
+ 'invalid_request',
229
+ f'{entry} carries unknown field(s): ' + ', '.join(sorted(map(str, unknown))), field=entry,
230
+ )
231
+ quotes = dict(source_quote=_normalize_quote(item.get('source_quote'), name=f'{entry}.source_quote'),
232
+ target_quote=_normalize_quote(item.get('target_quote'), name=f'{entry}.target_quote'))
233
+ if ('target_id' in item) == ('target_path' in item):
234
+ raise CitationError('invalid_request', f'{entry} gives exactly one of target_id and target_path',
235
+ field=entry)
236
+ if 'target_path' in item:
237
+ path = item['target_path']
238
+ if not isinstance(path, str) or not path.strip() or len(path) > CITATION_PATH_MAX_CHARS:
239
+ raise CitationError('invalid_request', f'{entry}.target_path must be a file path of at most '
240
+ f'{CITATION_PATH_MAX_CHARS} characters', field=f'{entry}.target_path')
241
+ inputs.append(CitationInput(None, entry=entry, target_path=path.strip(), **quotes))
242
+ continue
243
+ target = item.get('target_id')
244
+ if not isinstance(target, str) or not target.strip():
245
+ raise CitationError('invalid_request', f'{entry}.target_id must be a non-empty string',
246
+ field=f'{entry}.target_id')
247
+ try:
248
+ parsed = parse_lookup(target.strip())
249
+ except EvidenceIdentityError as exc:
250
+ raise CitationError(exc.code, f'{entry}.target_id: {exc}') from exc
251
+ if parsed.kind not in _CITED_KINDS:
252
+ raise CitationError(
253
+ 'invalid_id',
254
+ f'{entry}.target_id {parsed.text} is {parsed.kind.label} and cannot be cited; '
255
+ 'cite a memory, a corpus passage or a document',
256
+ )
257
+ inputs.append(CitationInput(target_id=parsed.text, entry=entry, **quotes))
258
+ return tuple(inputs)
259
+
260
+
261
+ # --------------------------------------------------------------------------
262
+ # Quote resolution and target binding
263
+ # --------------------------------------------------------------------------
264
+
265
+
266
+ def quote_span(text: str, quote: str, *, role: str, within: str) -> list[int]:
267
+ """Resolve one quote to the half-open UTF-8 byte span of its only match in
268
+ ``text``, which ``within`` names in a refusal. The whitespace between its
269
+ words may differ from the text's."""
270
+ found = list(quote_spans(text, quote))
271
+ if not found:
272
+ raise CitationError('quote_not_found', (
273
+ f'{role} does not occur in {within}; quote its words as written there '
274
+ '(spacing and line breaks may differ)'
275
+ ))
276
+ if len(found) > 1:
277
+ # The text may be the agent's own, so the refusal names offsets, not words.
278
+ starts = [str(start) for start, _ in found[:3]]
279
+ listed = starts[0] if len(starts) == 1 else ', '.join(starts[:-1]) + ' and ' + starts[-1]
280
+ raise CitationError('ambiguous_quote', (
281
+ f'{role} occurs {len(found)} times in {within}, at character offsets {listed}'
282
+ f'{" among others" if len(found) > 3 else ""}; quote more of the surrounding words so it occurs once'
283
+ ))
284
+ start, end = found[0]
285
+ prefix = len(text[:start].encode('utf-8'))
286
+ return [prefix, prefix + len(text[start:end].encode('utf-8'))]
287
+
288
+
289
+ def cites_document(entry: dict[str, Any]) -> bool:
290
+ """Whether a citation entry points into a document through a locator,
291
+ rather than binding an owned memory's revision."""
292
+ return set(entry['target_binding']) != _RECORD_BINDING_FIELDS
293
+
294
+
295
+ def record_citations(record: Any) -> tuple[tuple[str, dict[str, Any]], ...]:
296
+ """Every citation a record's body makes, each with its owner, ``body``: the one
297
+ place a citation is made."""
298
+
299
+ return tuple(('body', entry) for entry in record.citations)
300
+
301
+
302
+ def record_binding(record: Any) -> dict[str, str]:
303
+ """The lifetime binding of one cited owned memory.
304
+
305
+ An owned body is a statement this installation made: citing it binds that
306
+ exact revision, so a correction forces the citation to be re-judged. A
307
+ mirrored record is not a statement but a reflection of a file somebody
308
+ else owns, so it is cited through a locator into that file instead.
309
+ """
310
+ if not record.is_owned:
311
+ raise ValueError(f'{record.id} is mirrored memory, cited through a locator into its file')
312
+ return {
313
+ 'incarnation_id': str(record.incarnation_id),
314
+ 'content_revision': str(record.correction_revision_identity),
315
+ }
316
+
317
+
318
+ def _bind(
319
+ target: CitationTarget, target_quote: str | None,
320
+ ) -> tuple[CitationTarget, list[int] | None, str | None]:
321
+ """The target as one citation binds it, the span of its quoted words and
322
+ the quote it keeps.
323
+
324
+ An owned memory's words are placed in its body. A document citation's
325
+ words are placed in its file, whose locator becomes the binding, and are
326
+ kept as the file writes them. A document citation must quote the words it
327
+ rests on, because without them any edit to its whole section or file would
328
+ flag it; a records file keeps no text to quote and is cited whole.
329
+ """
330
+ if target.document is None:
331
+ span = (quote_span(target.content, target_quote, role='target_quote', within='the cited memory')
332
+ if target_quote is not None else None)
333
+ return target, span, target_quote
334
+ document = target.document
335
+ if document.outline is not None and target_quote is None:
336
+ nothing_to_quote = document.runs is not None and not document.runs
337
+ raise CitationError('quote_required', _NOTHING_TO_QUOTE if nothing_to_quote else _QUOTE_REQUIRED,
338
+ field='target_quote')
339
+ try:
340
+ if document.outline is None:
341
+ locator = locate_records_file(
342
+ scope=document.scope, path=document.path,
343
+ input_digest=bytes.fromhex(document.input_digest), quote=target_quote,
344
+ )
345
+ else:
346
+ locator = locate_citation(
347
+ document.outline, scope=document.scope, path=document.path,
348
+ quote=target_quote, entry=document.entry, passage=document.passage, runs=document.runs,
349
+ renewing=document.renewing,
350
+ )
351
+ except LocatorError as exc:
352
+ if exc.code == 'quote_not_found' and next(quote_spans(target.content, target_quote), None) is not None:
353
+ where = "the passage's own words" if document.passage is not None else 'the document'
354
+ raise CitationError(exc.code, (
355
+ f'target_quote is in the passage as recall shows it but not in {where}: the title '
356
+ 'and heading lines shown before a passage are display text, a table header or code fence it '
357
+ "repeats is a copy, quoted where the document writes it, and a line the file's reader wrote, "
358
+ "such as a page heading or a page's links, is not the file's words at all; quote the "
359
+ 'words as the document writes them'
360
+ )) from exc
361
+ raise CitationError(exc.code, str(exc), field=exc.field) from exc
362
+ bound_id = target.id
363
+ if document.renewing is not None:
364
+ # A renewal names the heading now holding the words, so a passage it renews never reads as the whole file.
365
+ heading = locator.heading
366
+ bound_id = heading_id(document.scope, document.path, heading.path if heading else (),
367
+ heading.duplicate if heading else 0)
368
+ bound = CitationTarget(id=bound_id, content=target.content, binding=locator.to_binding())
369
+ return bound, list(locator.span) if locator.span is not None else None, locator.quote
370
+
371
+
372
+ def _binding_identity(target: CitationTarget, *, target_quote: str | None) -> str:
373
+ """What names a bound target across re-chunking, re-syncs and rebuilds.
374
+
375
+ An owned memory is named by its incarnation. A document citation is named
376
+ by its locator's file and cited heading or words, never by an occurrence
377
+ id or a fingerprint, so re-citing unchanged words is the same citation. A
378
+ citation of an imported memory is also named by that memory, so two
379
+ memories of one section cited by the same words are two citations.
380
+ """
381
+ binding = target.binding or {}
382
+ if set(binding) == _RECORD_BINDING_FIELDS:
383
+ return f'{target.id}\nincarnation={binding["incarnation_id"]}'
384
+ words = locator_from_binding(binding, quote=target_quote, span=None).durable_identity
385
+ return f'{target.id}\n{words}' if target.id.startswith('imp_') else words
386
+
387
+
388
+ def _edge_identity(
389
+ source: str,
390
+ *,
391
+ target: CitationTarget,
392
+ source_quote: str | None,
393
+ target_quote: str | None,
394
+ ) -> str:
395
+ preimage = _canonical({
396
+ 'format': EDGE_IDENTITY_SCHEMA,
397
+ 'relation': CITATION_RELATION,
398
+ 'source': source,
399
+ 'target': _binding_identity(target, target_quote=target_quote),
400
+ 'source_quote': source_quote,
401
+ 'target_quote': target_quote,
402
+ })
403
+ return derive(EvidenceKind.EDGE, preimage)
404
+
405
+
406
+ def edge_identity(
407
+ *,
408
+ source_id: str,
409
+ source_incarnation_id: str,
410
+ target: CitationTarget,
411
+ source_quote: str | None,
412
+ target_quote: str | None,
413
+ ) -> str:
414
+ """One deterministic identity for one citation a memory body asserts."""
415
+ return _edge_identity(
416
+ f'record:{source_id}\nincarnation={source_incarnation_id}',
417
+ target=target, source_quote=source_quote, target_quote=target_quote,
418
+ )
419
+
420
+
421
+ def build_citation_entry(
422
+ *,
423
+ source_record: Any,
424
+ target: CitationTarget,
425
+ source_quote: str | None,
426
+ target_quote: str | None,
427
+ now: Any,
428
+ ) -> dict[str, Any]:
429
+ """Bind the target, then mint one materialized citation entry for a body and its edge.
430
+
431
+ A refusal names the citation by its target, so the agent knows which one
432
+ to fix.
433
+ """
434
+ if target.id == source_record.id:
435
+ raise CitationError('self_citation', 'a memory cannot cite itself')
436
+ try:
437
+ bound, target_span, target_quote = _bind(target, target_quote)
438
+ source_span = (
439
+ quote_span(source_record.content, source_quote, role='source_quote', within="the memory's body")
440
+ if source_quote is not None else None
441
+ )
442
+ except CitationError as exc:
443
+ raise CitationError(exc.code, f'the citation of {target.id}: {exc}', retryable=exc.retryable,
444
+ memory_id=exc.memory_id, field=exc.field) from exc
445
+ return {
446
+ 'edge_id': edge_identity(source_id=source_record.id, source_incarnation_id=str(source_record.incarnation_id),
447
+ target=bound, source_quote=source_quote, target_quote=target_quote),
448
+ 'target_id': bound.id,
449
+ 'target_binding': dict(bound.binding),
450
+ 'source_quote': source_quote,
451
+ 'source_span': source_span,
452
+ 'target_quote': target_quote,
453
+ 'target_span': target_span,
454
+ 'at': format_time(now),
455
+ }
456
+
457
+
458
+ def rebind_citation_entry(entry: dict[str, Any], *, source_record: Any) -> dict[str, Any] | None:
459
+ """Carry one body citation onto another memory, its target binding unchanged.
460
+
461
+ The target is not judged again, so a citation whose target has changed
462
+ since still reads ``modified``. The source span is recomputed and the edge
463
+ re-minted for the new owner. A citation bound to quoted words carries only
464
+ when the new body holds them exactly once; otherwise it has nothing to stay
465
+ bound to, and None says it does not carry.
466
+ """
467
+ source_quote = entry.get('source_quote')
468
+ source_span = None
469
+ if source_quote is not None:
470
+ try:
471
+ source_span = quote_span(source_record.content, source_quote, role='source_quote',
472
+ within="the replacement's body")
473
+ except CitationError:
474
+ return None
475
+ target = CitationTarget(id=entry['target_id'], content='', binding=dict(entry['target_binding']))
476
+ return {
477
+ **entry,
478
+ 'edge_id': edge_identity(
479
+ source_id=source_record.id, source_incarnation_id=str(source_record.incarnation_id),
480
+ target=target, source_quote=source_quote, target_quote=entry.get('target_quote'),
481
+ ),
482
+ 'source_quote': source_quote,
483
+ 'source_span': source_span,
484
+ }
485
+
486
+
487
+ # --------------------------------------------------------------------------
488
+ # Durable shape
489
+ # --------------------------------------------------------------------------
490
+
491
+
492
+ def _valid_citation_quote(quote):
493
+ return type(quote) is str and bool(quote.strip()) and len(quote) <= CITATION_QUOTE_MAX_CHARS
494
+
495
+
496
+ def _valid_byte_span(span):
497
+ if not isinstance(span, list) or len(span) != 2:
498
+ return False
499
+ if any(type(value) is not int or value < 0 for value in span):
500
+ return False
501
+ return span[0] < span[1]
502
+
503
+
504
+ def _valid_record_binding(binding):
505
+ if not isinstance(binding, dict) or set(binding) != _RECORD_BINDING_FIELDS:
506
+ return False
507
+ return all(isinstance(value, str) and bool(value) for value in binding.values())
508
+
509
+
510
+ def _validate_quoted_span(quote, span, *, quote_key, span_key):
511
+ if quote is None:
512
+ if span is not None:
513
+ raise ValueError(f'{span_key} requires {quote_key}')
514
+ return
515
+ if not _valid_citation_quote(quote):
516
+ raise ValueError(f'{quote_key} must be non-empty text of at most {CITATION_QUOTE_MAX_CHARS} characters')
517
+ if not _valid_byte_span(span):
518
+ raise ValueError(f'{span_key} must be a half-open byte span [start, end]')
519
+
520
+
521
+ def _validate_target_binding(entry, target):
522
+ binding = entry['target_binding']
523
+ if target.kind is EvidenceKind.MEMORY:
524
+ if not _valid_record_binding(binding):
525
+ raise ValueError('citation target_binding does not match the target kind')
526
+ return
527
+ # Every other target is a document, bound by its locator.
528
+ try:
529
+ locator_from_binding(binding, quote=entry['target_quote'], span=entry['target_span'])
530
+ except ValueError as exc:
531
+ raise ValueError(f'citation target_binding is not a document locator: {exc}') from exc
532
+
533
+
534
+ def _require_citation_time(at):
535
+ parsed_at = parse_time(at) if isinstance(at, str) and at else None
536
+ if parsed_at is None or format_time(parsed_at) != at:
537
+ raise ValueError('citation timestamp must use the canonical UTC format')
538
+
539
+
540
+ def _validate_citation_entry(entry, record_id: str):
541
+ if not isinstance(entry, dict) or set(entry) != CITATION_ENTRY_FIELDS:
542
+ raise ValueError(
543
+ 'citation entry must contain exactly edge_id, target_id, target_binding, '
544
+ 'source_quote, source_span, target_quote, target_span, and at'
545
+ )
546
+ require_canonical_kind(entry['edge_id'], EvidenceKind.EDGE, operation='durable citation storage')
547
+ target = require_canonical_kind(
548
+ entry['target_id'], _CITED_KINDS, operation='durable citation storage',
549
+ )
550
+ if target.text == record_id:
551
+ raise ValueError('a citation cannot target its own record')
552
+ for quote_key, span_key in (('source_quote', 'source_span'), ('target_quote', 'target_span')):
553
+ _validate_quoted_span(entry[quote_key], entry[span_key], quote_key=quote_key, span_key=span_key)
554
+ _validate_target_binding(entry, target)
555
+ _require_citation_time(entry['at'])
556
+
557
+
558
+ def validate_citation_entries(raw: object, *, record_id: str) -> list[dict[str, Any]]:
559
+ """Enforce the closed citation entry shape wherever it is durably embedded.
560
+
561
+ ``record_id`` names the citing body, which no entry may target.
562
+ """
563
+ if not isinstance(raw, list):
564
+ raise ValueError('citations must be a list')
565
+ if len(raw) > CITATIONS_PER_RECORD_MAX:
566
+ raise ValueError(f'citations must contain at most {CITATIONS_PER_RECORD_MAX} entries')
567
+ edge_ids: set[str] = set()
568
+ for entry in raw:
569
+ _validate_citation_entry(entry, record_id)
570
+ if entry['edge_id'] in edge_ids:
571
+ raise ValueError('one citation edge cannot appear more than once on a record')
572
+ edge_ids.add(entry['edge_id'])
573
+ return [dict(entry) for entry in raw]
574
+
575
+
576
+ def validate_citations_revision(raw: object) -> str | None:
577
+ if raw is None:
578
+ return None
579
+ if not is_revision_token(raw):
580
+ raise ValueError('citations_revision must be a 32-character hexadecimal token')
581
+ return raw
582
+
583
+
584
+ def refuse_retired_targets(entries: Sequence[dict[str, Any]], retired: frozenset[str]) -> None:
585
+ """Refuse citing a record the same correction retires.
586
+
587
+ Targets resolve against committed rows, which still show a correction's
588
+ own targets as current, so this rule is what makes them uncitable. The
589
+ pre-check and the commit both apply it, so a caller is refused before a
590
+ replacement is minted rather than after.
591
+ """
592
+ for entry in entries:
593
+ if entry['target_id'] in retired:
594
+ raise CitationError(
595
+ 'replacement_cites_target',
596
+ f"{entry['target_id']} is retired by this correction and cannot be cited",
597
+ )
598
+
599
+
600
+ def refuse_held_retired_targets(record: Any, retired: frozenset[str]) -> None:
601
+ """Refuse a correction whose reused replacement already cites a record it retires.
602
+
603
+ A reused replacement keeps its citations, so one naming a retired target
604
+ would read gone from the commit on while only restating the lineage the
605
+ correction records. The owner removes it first.
606
+ """
607
+ for entry in record.citations:
608
+ if entry['target_id'] in retired:
609
+ raise CitationError(
610
+ 'replacement_cites_target',
611
+ f"{record.id} already cites {entry['target_id']}, which this correction retires; "
612
+ f"remove citation {entry['edge_id']} with update_citations, then correct again",
613
+ )
614
+
615
+
616
+ def validate_citations_event_metadata(raw: object, *, record_id: str) -> dict[str, Any]:
617
+ """Enforce the closed delta shape of one ``citations_changed`` event.
618
+
619
+ Replay rebuilds the served set from these events, so the delta an event
620
+ carries is held to exactly the shape the set itself must satisfy. An
621
+ event that cannot replay is refused at the boundary rather than
622
+ surfacing later as an integrity fault.
623
+ """
624
+ from daecore.memory.records.authoring import MODEL_ATTRIBUTION_KEY, validate_event_attribution
625
+
626
+ if not isinstance(raw, dict) or set(raw) - {MODEL_ATTRIBUTION_KEY} != CITATIONS_EVENT_FIELDS:
627
+ raise ValueError(
628
+ 'citations_changed event metadata must contain exactly '
629
+ + ', '.join(sorted(CITATIONS_EVENT_FIELDS))
630
+ )
631
+ if raw['operation'] not in CITATION_OPERATIONS:
632
+ raise ValueError(
633
+ 'citations_changed operation must be one of ' + ', '.join(sorted(CITATION_OPERATIONS))
634
+ )
635
+ validate_citation_entries(raw['added'], record_id=record_id)
636
+ for name in ('removed', 'reasserted'):
637
+ if not isinstance(raw[name], list) or len(raw[name]) > CITATIONS_PER_RECORD_MAX:
638
+ raise ValueError(
639
+ f'citations_changed {name} must be a list of at most '
640
+ f'{CITATIONS_PER_RECORD_MAX} citation identities'
641
+ )
642
+ for edge_id in raw[name]:
643
+ require_canonical_kind(edge_id, EvidenceKind.EDGE, operation='durable citation storage')
644
+ for name in ('previous_revision', 'revision'):
645
+ if not is_revision_token(raw[name]):
646
+ raise ValueError(f'citations_changed {name} must be a 32-character hexadecimal token')
647
+ if raw['correction_id'] is not None:
648
+ require_canonical_kind(
649
+ raw['correction_id'], EvidenceKind.CORRECTION, operation='durable citation storage',
650
+ )
651
+ for name in ('client', 'model', 'session'):
652
+ value = raw[name]
653
+ if value is not None and (type(value) is not str or not value.strip()):
654
+ raise ValueError(f'citations_changed {name} must be null or non-empty text')
655
+ validate_event_attribution(raw)
656
+ return dict(raw)
657
+
658
+
659
+ # --------------------------------------------------------------------------
660
+ # Revision chain and replay
661
+ # --------------------------------------------------------------------------
662
+
663
+
664
+ def initial_citations_revision(incarnation_id: str) -> str:
665
+ """The token of an empty, never-edited citation set for one incarnation."""
666
+ return _sha256(f'citations.v1\n{incarnation_id}')[:REVISION_TOKEN_WIDTH]
667
+
668
+
669
+ def citations_revision_for(record: Any) -> str:
670
+ return record.citations_revision or initial_citations_revision(str(record.incarnation_id))
671
+
672
+
673
+ def _delta_payload(
674
+ *,
675
+ operation: str,
676
+ added: list[dict[str, Any]],
677
+ removed: list[str],
678
+ reasserted: list[str],
679
+ attribution: dict[str, str | None],
680
+ correction_id: str | None,
681
+ ) -> dict[str, Any]:
682
+ return {
683
+ 'operation': operation,
684
+ 'added': [dict(entry) for entry in added],
685
+ 'removed': list(removed),
686
+ 'reasserted': list(reasserted),
687
+ **attribution,
688
+ 'correction_id': correction_id,
689
+ }
690
+
691
+
692
+ def next_citations_revision(previous: str, delta: dict[str, Any]) -> str:
693
+ """Advance the chain: every change, including a reassertion, moves it."""
694
+ return _sha256(f'citations.v1\n{previous}\n{_canonical(delta)}')[:REVISION_TOKEN_WIDTH]
695
+
696
+
697
+ def _same_assertion(first: dict[str, Any], second: dict[str, Any]) -> bool:
698
+ """Reassertion time can differ; endpoint bindings and locators must agree."""
699
+ return {key: value for key, value in first.items() if key != 'at'} == {
700
+ key: value for key, value in second.items() if key != 'at'
701
+ }
702
+
703
+
704
+ class _CitationHistory:
705
+ """Own a record's ordered citation history and the proofs built from it.
706
+
707
+ Ordinary reduction tolerates incomplete additions and reports a broken
708
+ chain. Inversion consumes checked deltas, and proves the current state only
709
+ when canceling the selected effects can change materialized assertions.
710
+ Those two policies share ordering and delta application, not validation.
711
+ """
712
+
713
+ def __init__(self, events, incarnation_id):
714
+ self._events = events
715
+ self._incarnation_id = incarnation_id
716
+ self._order()
717
+
718
+ def _order(self):
719
+ self._by_previous = {}
720
+ total = 0
721
+ for event in self._events:
722
+ if event.event_type is not MemoryEventType.CITATIONS_CHANGED:
723
+ continue
724
+ total += 1
725
+ self._by_previous.setdefault((event.metadata or {}).get('previous_revision'), []).append(event)
726
+ self._ordered = []
727
+ self._revision = initial_citations_revision(self._incarnation_id)
728
+ self._consistent = True
729
+ while (event := self._next_event()) is not None:
730
+ self._ordered.append(event)
731
+ next_token = (event.metadata or {}).get('revision')
732
+ if not is_revision_token(next_token):
733
+ self._consistent = False
734
+ break
735
+ self._revision = next_token
736
+ if len(self._ordered) != total:
737
+ self._consistent = False
738
+
739
+ def _next_event(self):
740
+ candidates = self._by_previous.pop(self._revision, [])
741
+ if not candidates:
742
+ return None
743
+ if len(candidates) > 1:
744
+ self._consistent = False
745
+ candidates.sort(key=lambda event: (event.created_at, event.event_id))
746
+ return candidates[0]
747
+
748
+ @staticmethod
749
+ def _apply(entries, added, removed):
750
+ for edge in removed:
751
+ entries.pop(edge, None)
752
+ entries.update(added)
753
+
754
+ def _replay(self):
755
+ entries = {}
756
+ for event in self._ordered:
757
+ metadata = event.metadata or {}
758
+ added = {entry['edge_id']: dict(entry) for entry in metadata.get('added') or []
759
+ if isinstance(entry, dict) and isinstance(entry.get('edge_id'), str)}
760
+ self._apply(entries, added, (str(edge) for edge in metadata.get('removed') or []))
761
+ return list(entries.values())
762
+
763
+ def reduced(self):
764
+ return self._replay(), self._revision, self._consistent
765
+
766
+ def _require_effects(self, record, effect_ids):
767
+ if not self._consistent or not effect_ids <= {event.event_id for event in self._ordered}:
768
+ self._refuse_inverse(record)
769
+
770
+ @staticmethod
771
+ def _refuse_inverse(record):
772
+ raise CitationRevertConflict(
773
+ f'the citation history of {record.id} does not replay to its current set; '
774
+ 'the correction cannot be undone safely',
775
+ )
776
+
777
+ def _scope(self, effect_ids):
778
+ touched, material = set(), False
779
+ for event in self._ordered:
780
+ if event.event_id in effect_ids:
781
+ touched.update(entry['edge_id'] for entry in event.metadata['added'])
782
+ touched.update(event.metadata['removed'])
783
+ touched.update(event.metadata['reasserted'])
784
+ material |= bool(event.metadata['added'] or event.metadata['removed'])
785
+ return touched, material
786
+
787
+ def _needs_replay(self, touched, material, canceled):
788
+ if material:
789
+ return True
790
+ for event in self._ordered:
791
+ if event.event_id not in canceled:
792
+ continue
793
+ changed = {entry['edge_id'] for entry in event.metadata['added']} | set(event.metadata['removed'])
794
+ if touched & changed:
795
+ return True
796
+ return False
797
+
798
+ def _require_current(self, record):
799
+ if self._revision != citations_revision_for(record):
800
+ self._refuse_inverse(record)
801
+ if not citations_match(self._replay(), record.citations):
802
+ self._refuse_inverse(record)
803
+
804
+ def _surviving_assertions(self, canceled, compensating):
805
+ self._canceled = canceled
806
+ self._compensating = compensating
807
+ self._actual, self._desired = {}, {}
808
+ for event in self._ordered:
809
+ self._apply_inverse_event(event)
810
+ return self._actual, self._desired
811
+
812
+ def _apply_inverse_event(self, event):
813
+ metadata = event.metadata
814
+ added = {entry['edge_id']: entry for entry in metadata['added']}
815
+ self._apply(self._actual, added, metadata['removed'])
816
+ if event.event_id in self._canceled:
817
+ return
818
+ if event.event_id in self._compensating:
819
+ return
820
+ self._apply(self._desired, added, metadata['removed'])
821
+ for edge in metadata['reasserted']:
822
+ if edge not in self._actual:
823
+ raise CitationRevertConflict('an independent citation assertion has no retained binding')
824
+ self._desired[edge] = self._actual[edge]
825
+
826
+ def inverse(self, record, effect_ids, undone):
827
+ self._require_effects(record, effect_ids)
828
+ canceled = undone.citations(self._events)
829
+ touched, material = self._scope(effect_ids)
830
+ if not self._needs_replay(touched, material, canceled):
831
+ return [], []
832
+ self._require_current(record)
833
+ actual, desired = self._surviving_assertions(canceled | effect_ids, undone.compensating(self._events))
834
+ restore = [desired[edge] for edge in sorted(touched) if edge in desired and desired[edge] != actual.get(edge)]
835
+ remove = sorted(edge for edge in touched if edge in actual and edge not in desired)
836
+ return restore, remove
837
+
838
+
839
+ def reduce_citations(events: list[Any], *, incarnation_id: str) -> tuple[list[dict[str, Any]], str, bool]:
840
+ """Reduce the retained chain, reporting inconsistency without repairing it."""
841
+ return _CitationHistory(events, incarnation_id).reduced()
842
+
843
+
844
+ def citations_match(first: list[dict[str, Any]], second: list[dict[str, Any]]) -> bool:
845
+ """Equal assertion sets include bindings and locators, not just edge names."""
846
+ return sorted(first, key=lambda entry: entry['edge_id']) == sorted(
847
+ second, key=lambda entry: entry['edge_id'],
848
+ )
849
+
850
+
851
+ def correction_citation_inverse(record: Any, events: list[Any], *, effect_ids: frozenset[str], undone) -> tuple[list, list[str]]:
852
+ """Undo correction-owned effects while retaining independent assertions."""
853
+ if not effect_ids:
854
+ return [], []
855
+ return _CitationHistory(events, str(record.incarnation_id)).inverse(record, effect_ids, undone)
856
+
857
+
858
+ __all__ = [
859
+ 'CITATIONS_PER_RECORD_MAX',
860
+ 'CITATION_DELTA_MAX',
861
+ 'CITATIONS_EVENT_FIELDS',
862
+ 'CITATION_ENTRY_FIELDS',
863
+ 'CITATION_OPERATIONS',
864
+ 'CITATION_QUOTE_MAX_CHARS',
865
+ 'CITATION_RELATION',
866
+ 'CitationError',
867
+ 'CitationInput',
868
+ 'CitationRevertConflict',
869
+ 'CitationTarget',
870
+ 'DocumentTarget',
871
+ 'WatchedFile',
872
+ 'build_citation_entry',
873
+ 'citations_match',
874
+ 'citations_revision_for',
875
+ 'cites_document',
876
+ 'correction_citation_inverse',
877
+ 'edge_identity',
878
+ 'initial_citations_revision',
879
+ 'next_citations_revision',
880
+ 'normalize_citation_inputs',
881
+ 'quote_span',
882
+ 'refuse_held_retired_targets',
883
+ 'refuse_retired_targets',
884
+ 'record_binding',
885
+ 'record_citations',
886
+ 'reduce_citations',
887
+ 'validate_citation_entries',
888
+ 'validate_citations_event_metadata',
889
+ 'validate_citations_revision',
890
+ ]