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.
- _daecore_entry.py +2145 -0
- daecore/__init__.py +22 -0
- daecore/__main__.py +21 -0
- daecore/_atomic_file.py +153 -0
- daecore/_durable_file.py +75 -0
- daecore/_error_mode.py +24 -0
- daecore/_exclusive_lock.py +521 -0
- daecore/_handover.py +548 -0
- daecore/_release/core.lock +4 -0
- daecore/_release/handover.lock +47 -0
- daecore/_release/overlay-cuda.lock +126 -0
- daecore/_release/overlay-metal.lock +6 -0
- daecore/_release/overlay-vulkan.lock +6 -0
- daecore/_release/python-version +1 -0
- daecore/_release/runtime.lock +1633 -0
- daecore/_release/tools.lock +20 -0
- daecore/_survey_store.py +156 -0
- daecore/_version.py +10 -0
- daecore/_windows_directory.py +69 -0
- daecore/agent_use/__init__.py +1 -0
- daecore/agent_use/capabilities.py +680 -0
- daecore/agent_use/constitution.py +185 -0
- daecore/agent_use/features.py +40 -0
- daecore/approval.py +150 -0
- daecore/artifact_cleanup.py +136 -0
- daecore/artifact_observation.py +278 -0
- daecore/assurance/__init__.py +1 -0
- daecore/assurance/access.py +54 -0
- daecore/assurance/campaign.py +267 -0
- daecore/assurance/catalog.py +235 -0
- daecore/assurance/census.py +67 -0
- daecore/assurance/contracts.py +212 -0
- daecore/assurance/control.py +90 -0
- daecore/assurance/control_provider.py +40 -0
- daecore/assurance/declarations.py +32 -0
- daecore/assurance/diagnostics.py +144 -0
- daecore/assurance/events.py +586 -0
- daecore/assurance/integrity/__init__.py +5 -0
- daecore/assurance/integrity/breach.py +309 -0
- daecore/assurance/integrity/proof.py +512 -0
- daecore/assurance/integrity/transparency.py +249 -0
- daecore/assurance/intent.py +367 -0
- daecore/assurance/ledger/__init__.py +445 -0
- daecore/assurance/ledger/_chain.py +169 -0
- daecore/assurance/ledger/_checkpoints.py +131 -0
- daecore/assurance/ledger/_heartbeats.py +290 -0
- daecore/assurance/ledger/_projections.py +390 -0
- daecore/assurance/ledger/_records.py +224 -0
- daecore/assurance/monitoring.py +784 -0
- daecore/assurance/providers.py +208 -0
- daecore/assurance/repair/__init__.py +1 -0
- daecore/assurance/repair/contracts.py +255 -0
- daecore/assurance/repair/engine.py +639 -0
- daecore/assurance/repair/registry.py +199 -0
- daecore/assurance/schema.py +174 -0
- daecore/assurance_runtime/__init__.py +1 -0
- daecore/assurance_runtime/authority.py +98 -0
- daecore/assurance_runtime/builtin.py +252 -0
- daecore/assurance_runtime/census.py +56 -0
- daecore/assurance_runtime/provider_set.py +337 -0
- daecore/assurance_runtime/repair.py +155 -0
- daecore/backup/__init__.py +1 -0
- daecore/backup/assurance.py +68 -0
- daecore/backup/checkpoint/__init__.py +1 -0
- daecore/backup/checkpoint/contracts.py +301 -0
- daecore/backup/checkpoint/engine.py +1048 -0
- daecore/backup/checkpoint/inspection.py +352 -0
- daecore/backup/checkpoint/inventory.py +255 -0
- daecore/backup/checkpoint/provider.py +347 -0
- daecore/backup/checkpoint/restore.py +1009 -0
- daecore/backup/checkpoint/verify.py +772 -0
- daecore/backup/core.py +244 -0
- daecore/chunk_identity.py +131 -0
- daecore/chunking/__init__.py +1 -0
- daecore/chunking/_packing_fit.py +217 -0
- daecore/chunking/contract.py +20 -0
- daecore/chunking/counter.py +173 -0
- daecore/chunking/geometry.py +35 -0
- daecore/chunking/import_packer.py +218 -0
- daecore/chunking/packer.py +300 -0
- daecore/chunking/record_packer.py +272 -0
- daecore/chunking/structural.py +87 -0
- daecore/classifier/__init__.py +1 -0
- daecore/classifier/agent_contract.py +113 -0
- daecore/classifier/facets.py +18 -0
- daecore/classifier/inputs.py +85 -0
- daecore/classifier/installation.py +127 -0
- daecore/classifier/labels.py +283 -0
- daecore/cli/__init__.py +19 -0
- daecore/cli/__main__.py +9 -0
- daecore/cli/client_names.py +34 -0
- daecore/cli/commands/__init__.py +1 -0
- daecore/cli/commands/add.py +327 -0
- daecore/cli/commands/doctor.py +153 -0
- daecore/cli/commands/drift.py +66 -0
- daecore/cli/commands/forget.py +443 -0
- daecore/cli/commands/lifecycle.py +452 -0
- daecore/cli/commands/memory/__init__.py +1 -0
- daecore/cli/commands/memory/backup.py +592 -0
- daecore/cli/commands/memory/common.py +35 -0
- daecore/cli/commands/memory/health.py +260 -0
- daecore/cli/commands/memory/reclassify.py +194 -0
- daecore/cli/commands/memory/remember.py +287 -0
- daecore/cli/commands/memory/transfer.py +301 -0
- daecore/cli/commands/memory/verbs.py +468 -0
- daecore/cli/commands/memory/word_index.py +61 -0
- daecore/cli/commands/models.py +210 -0
- daecore/cli/commands/relocate.py +366 -0
- daecore/cli/commands/remove.py +148 -0
- daecore/cli/commands/restart.py +338 -0
- daecore/cli/commands/retrieval/__init__.py +1 -0
- daecore/cli/commands/retrieval/inspection.py +285 -0
- daecore/cli/commands/retrieval/refresh.py +519 -0
- daecore/cli/commands/retrieval/refresh_offline.py +135 -0
- daecore/cli/commands/retrieval/refresh_reporting.py +445 -0
- daecore/cli/commands/retrieval/refresh_targets.py +99 -0
- daecore/cli/commands/retrieval/search.py +295 -0
- daecore/cli/commands/serve.py +35 -0
- daecore/cli/commands/setup.py +581 -0
- daecore/cli/commands/sources.py +352 -0
- daecore/cli/commands/status.py +767 -0
- daecore/cli/commands/sync.py +683 -0
- daecore/cli/commands/update.py +813 -0
- daecore/cli/common.py +88 -0
- daecore/cli/content_output.py +21 -0
- daecore/cli/data.py +37 -0
- daecore/cli/dispatch.py +503 -0
- daecore/cli/entry.py +274 -0
- daecore/cli/handlers.py +62 -0
- daecore/cli/help_screens.py +120 -0
- daecore/cli/machine.py +155 -0
- daecore/cli/model_repair.py +112 -0
- daecore/cli/old_folder.py +21 -0
- daecore/cli/parser/__init__.py +1 -0
- daecore/cli/parser/builder.py +87 -0
- daecore/cli/parser/groups.py +119 -0
- daecore/cli/parser/suggest.py +79 -0
- daecore/cli/parser/surface.py +353 -0
- daecore/cli/parser/verbs.py +404 -0
- daecore/cli/parser/visibility.py +200 -0
- daecore/cli/results.py +123 -0
- daecore/cli/source_output.py +90 -0
- daecore/cli/update_currency.py +203 -0
- daecore/cli/update_profile.py +110 -0
- daecore/cli/update_receipt.py +256 -0
- daecore/cli/update_reconcile.py +164 -0
- daecore/cli/version_notice.py +137 -0
- daecore/command_help.py +281 -0
- daecore/config/__init__.py +159 -0
- daecore/config/application.py +334 -0
- daecore/config/assurance.py +91 -0
- daecore/config/authority.py +580 -0
- daecore/config/authority_store.py +177 -0
- daecore/config/changes.py +112 -0
- daecore/config/loader.py +533 -0
- daecore/config/schema.py +373 -0
- daecore/config/settings.py +121 -0
- daecore/config/source_parsing.py +111 -0
- daecore/corpus_pause.py +269 -0
- daecore/cpu_capacity.py +27 -0
- daecore/daemon/__init__.py +1 -0
- daecore/daemon/_version_util.py +25 -0
- daecore/daemon/activation.py +376 -0
- daecore/daemon/assurance.py +132 -0
- daecore/daemon/assurance_provider.py +1160 -0
- daecore/daemon/attachments.py +470 -0
- daecore/daemon/automatic_recovery.py +192 -0
- daecore/daemon/candidate_checks.py +213 -0
- daecore/daemon/classifier_setup.py +186 -0
- daecore/daemon/disable.py +250 -0
- daecore/daemon/drain.py +247 -0
- daecore/daemon/drift_state.py +262 -0
- daecore/daemon/embedding_transition.py +153 -0
- daecore/daemon/fence.py +807 -0
- daecore/daemon/frozen_read_window.py +165 -0
- daecore/daemon/handover_steps.py +69 -0
- daecore/daemon/identity.py +149 -0
- daecore/daemon/labeler.py +611 -0
- daecore/daemon/maintenance/__init__.py +1 -0
- daecore/daemon/maintenance/_manifest_errors.py +13 -0
- daecore/daemon/maintenance/_manifest_rules.py +322 -0
- daecore/daemon/maintenance/_manifest_validation.py +266 -0
- daecore/daemon/maintenance/adjudication.py +282 -0
- daecore/daemon/maintenance/completion.py +238 -0
- daecore/daemon/maintenance/decisions.py +498 -0
- daecore/daemon/maintenance/events.py +122 -0
- daecore/daemon/maintenance/identity.py +402 -0
- daecore/daemon/maintenance/intent.py +309 -0
- daecore/daemon/maintenance/manifest.py +504 -0
- daecore/daemon/maintenance/pause_fields.py +84 -0
- daecore/daemon/maintenance/records.py +144 -0
- daecore/daemon/maintenance/status.py +262 -0
- daecore/daemon/maintenance/verification.py +137 -0
- daecore/daemon/maintenance_client.py +346 -0
- daecore/daemon/operation_hooks.py +115 -0
- daecore/daemon/pidfile.py +270 -0
- daecore/daemon/profile_setup.py +144 -0
- daecore/daemon/quiescence.py +294 -0
- daecore/daemon/recovery.py +432 -0
- daecore/daemon/refresh.py +150 -0
- daecore/daemon/refresh_recovery.py +193 -0
- daecore/daemon/release_notices.py +388 -0
- daecore/daemon/relocation/__init__.py +1 -0
- daecore/daemon/relocation/_backup.py +232 -0
- daecore/daemon/relocation/capacity.py +85 -0
- daecore/daemon/relocation/coordinator.py +907 -0
- daecore/daemon/relocation/copy.py +425 -0
- daecore/daemon/relocation/last_move.py +127 -0
- daecore/daemon/relocation/recovery.py +345 -0
- daecore/daemon/relocation/retirement.py +593 -0
- daecore/daemon/relocation/state.py +511 -0
- daecore/daemon/replacement.py +226 -0
- daecore/daemon/retrieval_client.py +335 -0
- daecore/daemon/runtime/__init__.py +557 -0
- daecore/daemon/runtime/_console_wrapper.py +114 -0
- daecore/daemon/runtime/_currency.py +160 -0
- daecore/daemon/runtime/_custody.py +40 -0
- daecore/daemon/runtime/_relay.py +190 -0
- daecore/daemon/runtime/_relocation.py +144 -0
- daecore/daemon/runtime/_seed_launcher.py +460 -0
- daecore/daemon/runtime/packages.py +196 -0
- daecore/daemon/runtime_change.py +165 -0
- daecore/daemon/runtime_install.py +262 -0
- daecore/daemon/runtime_retirement.py +430 -0
- daecore/daemon/runtime_switch.py +210 -0
- daecore/daemon/scheduler.py +308 -0
- daecore/daemon/spawn_guard.py +507 -0
- daecore/daemon/spawning.py +641 -0
- daecore/daemon/status.py +307 -0
- daecore/daemon/sync_policy.py +251 -0
- daecore/daemon/ticket_auth.py +162 -0
- daecore/daemon/tls.py +62 -0
- daecore/daemon/trust.py +456 -0
- daecore/daemon/uninstall_transaction.py +959 -0
- daecore/daemon/update/__init__.py +1 -0
- daecore/daemon/update/artifacts.py +779 -0
- daecore/daemon/update/completion.py +190 -0
- daecore/daemon/update/convergence.py +302 -0
- daecore/daemon/update/dispatch.py +155 -0
- daecore/daemon/update/journal.py +245 -0
- daecore/daemon/update/model_evidence.py +153 -0
- daecore/daemon/update/ownership.py +171 -0
- daecore/daemon/update/preimage.py +93 -0
- daecore/daemon/update/progress.py +55 -0
- daecore/daemon/update/proof.py +242 -0
- daecore/daemon/update/protocol.py +135 -0
- daecore/daemon/update/recovery.py +81 -0
- daecore/daemon/update/rollback.py +91 -0
- daecore/daemon/update/state.py +334 -0
- daecore/daemon/update/transaction.py +325 -0
- daecore/daemon/version_policy.py +29 -0
- daecore/daemon_lock.py +92 -0
- daecore/daemon_process/__init__.py +1 -0
- daecore/daemon_process/convergence.py +138 -0
- daecore/daemon_process/database_observation.py +157 -0
- daecore/daemon_process/name_observation.py +217 -0
- daecore/daemon_process/notes.py +14 -0
- daecore/daemon_process/resource_observation.py +167 -0
- daecore/daemon_process/serve.py +464 -0
- daecore/daemon_process/services.py +532 -0
- daecore/daemon_process/start.py +618 -0
- daecore/daemon_process/stop.py +219 -0
- daecore/daemon_process/watch.py +139 -0
- daecore/data/rerank_calibration.json +65 -0
- daecore/decoder_activation.py +87 -0
- daecore/decoder_installation.py +369 -0
- daecore/decoder_tree.py +138 -0
- daecore/digests.py +14 -0
- daecore/disk_capacity.py +128 -0
- daecore/doctor/__init__.py +1 -0
- daecore/doctor/contracts.py +351 -0
- daecore/doctor/guidance.py +246 -0
- daecore/doctor/identity.py +190 -0
- daecore/doctor/render.py +750 -0
- daecore/doctor/results.py +42 -0
- daecore/doctor/runner.py +800 -0
- daecore/doctor/session.py +245 -0
- daecore/doctor/store.py +190 -0
- daecore/document_extraction/__init__.py +64 -0
- daecore/document_extraction/entry.py +81 -0
- daecore/document_extraction/frames.py +60 -0
- daecore/document_extraction/level.py +281 -0
- daecore/document_extraction/level_probe.py +331 -0
- daecore/document_extraction/limits.py +53 -0
- daecore/document_extraction/office.py +531 -0
- daecore/document_extraction/posix_launcher.py +53 -0
- daecore/document_extraction/posix_policy.py +146 -0
- daecore/document_extraction/probe_entry.py +144 -0
- daecore/document_extraction/providers.py +613 -0
- daecore/document_extraction/registry_storage.py +46 -0
- daecore/document_extraction/result.py +84 -0
- daecore/document_extraction/session.py +338 -0
- daecore/document_extraction/warmup.zip +0 -0
- daecore/document_extraction/windows_access.py +239 -0
- daecore/document_extraction/windows_launcher.py +150 -0
- daecore/document_extraction/windows_probe_owner.py +35 -0
- daecore/document_extraction/worker.py +114 -0
- daecore/document_formats.py +72 -0
- daecore/documents/__init__.py +1 -0
- daecore/documents/_html.py +98 -0
- daecore/documents/_json_syntax.py +143 -0
- daecore/documents/_line_units.py +57 -0
- daecore/documents/_markdown.py +208 -0
- daecore/documents/_raw_positions.py +118 -0
- daecore/documents/_reader_metadata.py +16 -0
- daecore/documents/_record_input.py +30 -0
- daecore/documents/_slug_table.py +137 -0
- daecore/documents/_text_input.py +12 -0
- daecore/documents/csv_reader.py +155 -0
- daecore/documents/csv_records.py +40 -0
- daecore/documents/excerpts.py +174 -0
- daecore/documents/fidelity.py +178 -0
- daecore/documents/hygiene.py +202 -0
- daecore/documents/identity.py +49 -0
- daecore/documents/import_markdown.py +63 -0
- daecore/documents/json_reader.py +161 -0
- daecore/documents/links.py +672 -0
- daecore/documents/locators.py +713 -0
- daecore/documents/markdown_reader.py +161 -0
- daecore/documents/markup_reader.py +218 -0
- daecore/documents/model.py +245 -0
- daecore/documents/native.py +549 -0
- daecore/documents/outline.py +404 -0
- daecore/documents/plaintext_reader.py +57 -0
- daecore/documents/ranges.py +281 -0
- daecore/documents/readers.py +85 -0
- daecore/documents/record_units.py +61 -0
- daecore/documents/resolution.py +553 -0
- daecore/documents/sections.py +20 -0
- daecore/documents/slugs.py +36 -0
- daecore/documents/source_maps.py +49 -0
- daecore/documents/text.py +141 -0
- daecore/eligibility.py +1139 -0
- daecore/enablement.py +411 -0
- daecore/entry.py +138 -0
- daecore/envconf.py +419 -0
- daecore/evidence_dates.py +108 -0
- daecore/evidence_identity.py +515 -0
- daecore/exception_text.py +67 -0
- daecore/exit_codes.py +24 -0
- daecore/file_hash.py +17 -0
- daecore/file_probe.py +139 -0
- daecore/file_read.py +257 -0
- daecore/file_status.py +65 -0
- daecore/file_watch.py +247 -0
- daecore/filesystem_walk.py +703 -0
- daecore/health_readiness.py +130 -0
- daecore/held_lock.py +188 -0
- daecore/home_pointer.py +205 -0
- daecore/ignore_policy.py +1102 -0
- daecore/inference/__init__.py +1 -0
- daecore/inference/_execution_state.py +327 -0
- daecore/inference/_memory_state.py +148 -0
- daecore/inference/accelerator.py +505 -0
- daecore/inference/assurance.py +123 -0
- daecore/inference/assurance_provider.py +613 -0
- daecore/inference/batch_geometry.py +419 -0
- daecore/inference/device_memory.py +551 -0
- daecore/inference/execution.py +800 -0
- daecore/inference/failures.py +474 -0
- daecore/inference/hardware.py +241 -0
- daecore/inference/memory_budget.py +539 -0
- daecore/inference/model/__init__.py +1 -0
- daecore/inference/model/_file_identity.py +35 -0
- daecore/inference/model/_locking.py +62 -0
- daecore/inference/model/assets.py +1172 -0
- daecore/inference/model/blob_store.py +209 -0
- daecore/inference/model/cache/__init__.py +426 -0
- daecore/inference/model/cache/_collection.py +272 -0
- daecore/inference/model/cache/_leases.py +241 -0
- daecore/inference/model/cache/_observation.py +173 -0
- daecore/inference/model/cache/_pool.py +176 -0
- daecore/inference/model/cache/_records.py +311 -0
- daecore/inference/model/cache/_storage.py +232 -0
- daecore/inference/model/cache/_types.py +116 -0
- daecore/inference/model/registry.py +330 -0
- daecore/inference/model_fallback.py +227 -0
- daecore/inference/model_preparation.py +592 -0
- daecore/inference/model_progress.py +210 -0
- daecore/inference/model_status.py +407 -0
- daecore/inference/passage_geometry.py +215 -0
- daecore/inference/placement.py +352 -0
- daecore/inference/probe.py +119 -0
- daecore/inference/profile/__init__.py +393 -0
- daecore/inference/profile/circuit.py +262 -0
- daecore/inference/profile/contracts.py +188 -0
- daecore/inference/profile/incidents.py +502 -0
- daecore/inference/profile/registry.py +264 -0
- daecore/inference/profile/resolve.py +177 -0
- daecore/inference/profile/state.py +861 -0
- daecore/inference/providers.py +231 -0
- daecore/inference/residency.py +124 -0
- daecore/inference/role_health.py +139 -0
- daecore/inference/roles/__init__.py +1 -0
- daecore/inference/roles/classifier.py +1155 -0
- daecore/inference/roles/classifier_artifacts.py +799 -0
- daecore/inference/roles/embedding.py +337 -0
- daecore/inference/roles/lora_reranker.py +1098 -0
- daecore/inference/sequence_budget.py +254 -0
- daecore/inference/sessions/__init__.py +1 -0
- daecore/inference/sessions/_recovery.py +346 -0
- daecore/inference/sessions/_worker_client.py +387 -0
- daecore/inference/sessions/_worker_protocol.py +140 -0
- daecore/inference/sessions/_worker_transport.py +357 -0
- daecore/inference/sessions/locked_session.py +149 -0
- daecore/inference/sessions/model_worker.py +828 -0
- daecore/inference/system.py +72 -0
- daecore/inference/webgpu.py +89 -0
- daecore/input_budget.py +154 -0
- daecore/json_records.py +45 -0
- daecore/lifecycle_gate.py +657 -0
- daecore/link_contract.py +48 -0
- daecore/live_output.py +27 -0
- daecore/local_zone.py +143 -0
- daecore/memory/__init__.py +1 -0
- daecore/memory/_correction_inspection.py +161 -0
- daecore/memory/_inspection_contract.py +110 -0
- daecore/memory/_memory_inspection.py +368 -0
- daecore/memory/_source_inspection.py +269 -0
- daecore/memory/action_preflight.py +378 -0
- daecore/memory/annotation_writes.py +206 -0
- daecore/memory/assurance.py +151 -0
- daecore/memory/assurance_provider.py +719 -0
- daecore/memory/canonical/__init__.py +1 -0
- daecore/memory/canonical/_erasure.py +461 -0
- daecore/memory/canonical/_erasure_proofs.py +290 -0
- daecore/memory/canonical/_erasure_records.py +273 -0
- daecore/memory/canonical/_erasure_schema.py +521 -0
- daecore/memory/canonical/_facet_labels.py +195 -0
- daecore/memory/canonical/_history_reads.py +218 -0
- daecore/memory/canonical/_imported_files.py +207 -0
- daecore/memory/canonical/_mirrors.py +195 -0
- daecore/memory/canonical/_name_history.py +716 -0
- daecore/memory/canonical/_projection.py +63 -0
- daecore/memory/canonical/_record_reads.py +584 -0
- daecore/memory/canonical/_returns.py +277 -0
- daecore/memory/canonical/_revisions.py +208 -0
- daecore/memory/canonical/_rows.py +421 -0
- daecore/memory/canonical/_transfer.py +317 -0
- daecore/memory/canonical/access_lock.py +275 -0
- daecore/memory/canonical/admission.py +59 -0
- daecore/memory/canonical/citation_index.py +169 -0
- daecore/memory/canonical/connections.py +557 -0
- daecore/memory/canonical/correction_erasure.py +156 -0
- daecore/memory/canonical/correction_integrity.py +176 -0
- daecore/memory/canonical/correction_reads.py +812 -0
- daecore/memory/canonical/correction_references.py +187 -0
- daecore/memory/canonical/correction_row_data.py +176 -0
- daecore/memory/canonical/correction_rows.py +842 -0
- daecore/memory/canonical/correction_schema.py +144 -0
- daecore/memory/canonical/correction_transfer.py +227 -0
- daecore/memory/canonical/correction_winners.py +113 -0
- daecore/memory/canonical/database.py +1096 -0
- daecore/memory/canonical/erasure_ledger.py +857 -0
- daecore/memory/canonical/errors.py +149 -0
- daecore/memory/canonical/imported_file_schema.py +124 -0
- daecore/memory/canonical/location.py +57 -0
- daecore/memory/canonical/mirror_evidence.py +82 -0
- daecore/memory/canonical/name_schema.py +196 -0
- daecore/memory/canonical/project_links.py +138 -0
- daecore/memory/canonical/query_projection.py +272 -0
- daecore/memory/canonical/recall_returns.py +154 -0
- daecore/memory/canonical/record_holds.py +329 -0
- daecore/memory/canonical/reference_cleanup.py +801 -0
- daecore/memory/canonical/reference_index.py +146 -0
- daecore/memory/canonical/retry_outcome_schema.py +85 -0
- daecore/memory/canonical/retry_outcomes.py +586 -0
- daecore/memory/canonical/store_schema.py +931 -0
- daecore/memory/canonical/word_index.py +89 -0
- daecore/memory/citation_lookup.py +150 -0
- daecore/memory/citation_resolution.py +288 -0
- daecore/memory/citation_updates.py +207 -0
- daecore/memory/citation_upkeep.py +381 -0
- daecore/memory/consent.py +537 -0
- daecore/memory/correction.py +668 -0
- daecore/memory/correction_blockers.py +191 -0
- daecore/memory/correction_citations.py +172 -0
- daecore/memory/correction_dates.py +81 -0
- daecore/memory/correction_dependencies.py +420 -0
- daecore/memory/correction_errors.py +61 -0
- daecore/memory/correction_request.py +428 -0
- daecore/memory/correction_state.py +231 -0
- daecore/memory/correction_undo.py +566 -0
- daecore/memory/erasure_selection.py +387 -0
- daecore/memory/evidence_inspection.py +228 -0
- daecore/memory/exclusion_recovery.py +40 -0
- daecore/memory/filter_request.py +433 -0
- daecore/memory/filter_sql.py +363 -0
- daecore/memory/filtering.py +239 -0
- daecore/memory/forget.py +656 -0
- daecore/memory/index_projection.py +695 -0
- daecore/memory/inventory.py +103 -0
- daecore/memory/mirrored_documents.py +308 -0
- daecore/memory/name_files.py +210 -0
- daecore/memory/name_round.py +56 -0
- daecore/memory/name_state.py +766 -0
- daecore/memory/name_support.py +502 -0
- daecore/memory/native_folders.py +206 -0
- daecore/memory/native_import/__init__.py +137 -0
- daecore/memory/native_import/claude.py +400 -0
- daecore/memory/native_import/codex.py +58 -0
- daecore/memory/native_import/consented_routes.py +157 -0
- daecore/memory/native_import/contracts.py +161 -0
- daecore/memory/native_import/discovery.py +62 -0
- daecore/memory/native_import/folder_scan.py +178 -0
- daecore/memory/native_import/import_pass.py +342 -0
- daecore/memory/native_import/mapping.py +585 -0
- daecore/memory/native_import/reconcile.py +197 -0
- daecore/memory/native_import/store_rules.py +100 -0
- daecore/memory/native_providers.py +185 -0
- daecore/memory/policy.py +76 -0
- daecore/memory/projection_outbox.py +626 -0
- daecore/memory/publication.py +173 -0
- daecore/memory/read_facts.py +346 -0
- daecore/memory/records/__init__.py +1 -0
- daecore/memory/records/annotations.py +144 -0
- daecore/memory/records/authoring.py +107 -0
- daecore/memory/records/authorship.py +170 -0
- daecore/memory/records/cancellation.py +586 -0
- daecore/memory/records/citation_changes.py +90 -0
- daecore/memory/records/citations.py +890 -0
- daecore/memory/records/continuity_provenance.py +187 -0
- daecore/memory/records/contracts.py +214 -0
- daecore/memory/records/coordinates.py +119 -0
- daecore/memory/records/correction_history/__init__.py +5 -0
- daecore/memory/records/correction_history/contracts.py +19 -0
- daecore/memory/records/correction_history/derivation.py +437 -0
- daecore/memory/records/correction_history/erasure.py +107 -0
- daecore/memory/records/correction_history/naming.py +106 -0
- daecore/memory/records/correction_history/operations.py +219 -0
- daecore/memory/records/correction_history/recording.py +114 -0
- daecore/memory/records/correction_history/reference_fields.py +21 -0
- daecore/memory/records/correction_history/snapshots.py +46 -0
- daecore/memory/records/correction_history/undone_effects.py +101 -0
- daecore/memory/records/correction_history/validation.py +149 -0
- daecore/memory/records/exclusion_identity.py +54 -0
- daecore/memory/records/exclusions.py +350 -0
- daecore/memory/records/metadata.py +118 -0
- daecore/memory/records/origin_rights.py +197 -0
- daecore/memory/records/remember.py +68 -0
- daecore/memory/records/retirement.py +185 -0
- daecore/memory/records/revisions.py +135 -0
- daecore/memory/records/schema.py +428 -0
- daecore/memory/records/succession.py +287 -0
- daecore/memory/records/validation.py +226 -0
- daecore/memory/reference.py +172 -0
- daecore/memory/review_queues.py +116 -0
- daecore/memory/search.py +154 -0
- daecore/memory/store.py +903 -0
- daecore/memory/support.py +35 -0
- daecore/memory/support_reads.py +57 -0
- daecore/memory/writes.py +390 -0
- daecore/model_ids.py +6 -0
- daecore/name_coverage.py +266 -0
- daecore/name_presence.py +192 -0
- daecore/named_references.py +277 -0
- daecore/observability/__init__.py +1 -0
- daecore/observability/assurance.py +66 -0
- daecore/observability/assurance_provider.py +337 -0
- daecore/observability/crash_log.py +37 -0
- daecore/observability/event_log.py +229 -0
- daecore/observability/mcp_connections.py +274 -0
- daecore/observability/operation_status.py +101 -0
- daecore/observability/profile_io.py +42 -0
- daecore/observability/query_log.py +284 -0
- daecore/observability/rolling.py +224 -0
- daecore/observability/rotate.py +264 -0
- daecore/observability/semconv.py +1273 -0
- daecore/observability/telemetry_seal.py +310 -0
- daecore/observability/usage.py +225 -0
- daecore/operation_files/__init__.py +1103 -0
- daecore/operation_files/_coordination.py +283 -0
- daecore/operation_files/_files.py +316 -0
- daecore/operation_files/_records.py +204 -0
- daecore/operation_files/_types.py +30 -0
- daecore/operations/__init__.py +1 -0
- daecore/operations/admission.py +534 -0
- daecore/operations/barriers.py +81 -0
- daecore/operations/context.py +366 -0
- daecore/operations/contract.py +220 -0
- daecore/operations/errors.py +44 -0
- daecore/operations/frozen_read.py +101 -0
- daecore/operations/lease.py +340 -0
- daecore/operations/recovery.py +221 -0
- daecore/operations/recovery_contracts.py +214 -0
- daecore/operations/registry.py +1343 -0
- daecore/operations/rollback_snapshot.py +423 -0
- daecore/operations/runtime.py +281 -0
- daecore/operations/trace.py +121 -0
- daecore/operations/tree_snapshot.py +270 -0
- daecore/package_build.py +305 -0
- daecore/package_install.py +282 -0
- daecore/path_lock.py +168 -0
- daecore/paths.py +299 -0
- daecore/private_files.py +557 -0
- daecore/read_posture.py +52 -0
- daecore/read_vocabulary.py +227 -0
- daecore/reconcile.py +298 -0
- daecore/relay.py +8557 -0
- daecore/relay_support/__init__.py +1 -0
- daecore/relay_support/conversation.py +314 -0
- daecore/relay_support/custody.py +242 -0
- daecore/relay_support/diagnostics.py +114 -0
- daecore/relay_support/environment.py +65 -0
- daecore/relay_support/forwarding.py +248 -0
- daecore/relay_support/handshake.py +239 -0
- daecore/relay_support/home_location.py +215 -0
- daecore/relay_support/home_rename.py +188 -0
- daecore/relay_support/http_transport.py +451 -0
- daecore/relay_support/identity.py +672 -0
- daecore/relay_support/jsonrpc.py +167 -0
- daecore/relay_support/pinned_http.py +252 -0
- daecore/relay_support/processes.py +245 -0
- daecore/relay_support/protocol.py +742 -0
- daecore/relay_support/readiness.py +267 -0
- daecore/relay_support/relay_state.py +331 -0
- daecore/relay_support/runtime_selection.py +357 -0
- daecore/relay_support/spawn_broker.py +462 -0
- daecore/relay_support/spawn_process.py +249 -0
- daecore/relay_support/spawn_records.py +176 -0
- daecore/relay_support/spawn_tracking.py +647 -0
- daecore/relay_support/startup.py +744 -0
- daecore/relay_support/startup_files.py +178 -0
- daecore/relay_support/transport.py +510 -0
- daecore/release_install.py +481 -0
- daecore/request_deadline.py +173 -0
- daecore/resources/__init__.py +98 -0
- daecore/resources/_disk.py +463 -0
- daecore/resources/artifacts.py +134 -0
- daecore/retrieval/__init__.py +1 -0
- daecore/retrieval/_contract_primitives.py +105 -0
- daecore/retrieval/_evidence_validation.py +271 -0
- daecore/retrieval/_request_validation.py +101 -0
- daecore/retrieval/_response_validation.py +251 -0
- daecore/retrieval/assurance.py +103 -0
- daecore/retrieval/assurance_provider.py +573 -0
- daecore/retrieval/build/__init__.py +1 -0
- daecore/retrieval/build/cancellation.py +79 -0
- daecore/retrieval/build/candidate.py +159 -0
- daecore/retrieval/build/capture.py +159 -0
- daecore/retrieval/build/contract.py +199 -0
- daecore/retrieval/build/global_build.py +135 -0
- daecore/retrieval/build/identity.py +229 -0
- daecore/retrieval/build/ledger_candidate.py +1036 -0
- daecore/retrieval/build/ledger_publication.py +256 -0
- daecore/retrieval/build/ledger_rows.py +143 -0
- daecore/retrieval/build/memory.py +246 -0
- daecore/retrieval/build/metrics.py +131 -0
- daecore/retrieval/build/pipeline.py +401 -0
- daecore/retrieval/build/precommit.py +122 -0
- daecore/retrieval/build/residency.py +163 -0
- daecore/retrieval/build/results.py +98 -0
- daecore/retrieval/build/source.py +36 -0
- daecore/retrieval/build/source_selection.py +81 -0
- daecore/retrieval/build/state.py +843 -0
- daecore/retrieval/build/vectors.py +262 -0
- daecore/retrieval/build/workspace_progress.py +160 -0
- daecore/retrieval/candidate_cache.py +191 -0
- daecore/retrieval/capacity.py +90 -0
- daecore/retrieval/channel_fusion.py +73 -0
- daecore/retrieval/context_composer.py +413 -0
- daecore/retrieval/contracts.py +216 -0
- daecore/retrieval/corpus_date.py +545 -0
- daecore/retrieval/dense.py +1055 -0
- daecore/retrieval/document_projection.py +121 -0
- daecore/retrieval/embedders.py +221 -0
- daecore/retrieval/evidence.py +82 -0
- daecore/retrieval/file_ingest.py +587 -0
- daecore/retrieval/file_passages.py +125 -0
- daecore/retrieval/file_turns.py +435 -0
- daecore/retrieval/freshness.py +104 -0
- daecore/retrieval/index_state.py +56 -0
- daecore/retrieval/ingest_governor.py +127 -0
- daecore/retrieval/lexical.py +137 -0
- daecore/retrieval/name_history.py +306 -0
- daecore/retrieval/name_moves.py +161 -0
- daecore/retrieval/name_scan.py +357 -0
- daecore/retrieval/packed_files.py +427 -0
- daecore/retrieval/prefix_selection.py +266 -0
- daecore/retrieval/presentation.py +162 -0
- daecore/retrieval/query_cache.py +193 -0
- daecore/retrieval/rebuild.py +625 -0
- daecore/retrieval/reranking.py +492 -0
- daecore/retrieval/resource_budget.py +101 -0
- daecore/retrieval/resource_posture.py +213 -0
- daecore/retrieval/result_rows.py +193 -0
- daecore/retrieval/searcher.py +1172 -0
- daecore/retrieval/selection.py +161 -0
- daecore/retrieval/survey_storage.py +26 -0
- daecore/retrieval/sweep.py +1075 -0
- daecore/retrieval/watch_specs.py +70 -0
- daecore/retrieval/workspace_resolution.py +55 -0
- daecore/retrieval/workspace_withdrawal.py +231 -0
- daecore/runtime_contracts.py +80 -0
- daecore/runtime_enrollment.py +82 -0
- daecore/runtime_use.py +565 -0
- daecore/schema_versions.py +83 -0
- daecore/scripts/__init__.py +10 -0
- daecore/scripts/mcp_launcher.py +485 -0
- daecore/security/__init__.py +9 -0
- daecore/security/key_material/__init__.py +1139 -0
- daecore/security/key_material/_derivation.py +152 -0
- daecore/security/key_material/_dpapi.py +222 -0
- daecore/security/key_material/_errors.py +24 -0
- daecore/security/key_material/_machine.py +78 -0
- daecore/security/key_material/_os_keychain.py +191 -0
- daecore/security/key_material/_records.py +234 -0
- daecore/security/key_material/_registry.py +81 -0
- daecore/security/lock_state.py +55 -0
- daecore/security/posture.py +475 -0
- daecore/sentinel/__init__.py +1 -0
- daecore/sentinel/frontmatter.py +37 -0
- daecore/sentinel/hashing.py +50 -0
- daecore/sentinel/header.py +73 -0
- daecore/sentinel/marker.py +74 -0
- daecore/sentinel/ownership.py +34 -0
- daecore/sentinel/types.py +46 -0
- daecore/server/__init__.py +1 -0
- daecore/server/_embedding_handoff.py +96 -0
- daecore/server/_packet_render.py +239 -0
- daecore/server/_read_packets.py +314 -0
- daecore/server/_recall_packet.py +239 -0
- daecore/server/_utils.py +38 -0
- daecore/server/_write_packets.py +155 -0
- daecore/server/application.py +271 -0
- daecore/server/attachments.py +214 -0
- daecore/server/attribution.py +217 -0
- daecore/server/auth_gate.py +297 -0
- daecore/server/boot.py +317 -0
- daecore/server/boot_profile.py +66 -0
- daecore/server/candidate_check.py +68 -0
- daecore/server/change_queue.py +881 -0
- daecore/server/config_observer.py +688 -0
- daecore/server/content_access.py +521 -0
- daecore/server/corpus_mutation.py +260 -0
- daecore/server/frozen_reads.py +364 -0
- daecore/server/health.py +537 -0
- daecore/server/http/__init__.py +1 -0
- daecore/server/http/admin.py +187 -0
- daecore/server/http/admission.py +83 -0
- daecore/server/http/builder.py +66 -0
- daecore/server/http/middleware.py +258 -0
- daecore/server/http/retrieval.py +227 -0
- daecore/server/http/routes.py +98 -0
- daecore/server/index_rebuilds.py +289 -0
- daecore/server/lifecycle.py +1017 -0
- daecore/server/maintenance.py +317 -0
- daecore/server/memory_projection.py +157 -0
- daecore/server/model_health.py +209 -0
- daecore/server/model_residency.py +349 -0
- daecore/server/mutations.py +287 -0
- daecore/server/native_sync.py +331 -0
- daecore/server/next_calls.py +93 -0
- daecore/server/notices.py +137 -0
- daecore/server/observer_lifetime.py +374 -0
- daecore/server/packet_contracts.py +865 -0
- daecore/server/packets.py +345 -0
- daecore/server/proof_process.py +165 -0
- daecore/server/publication.py +231 -0
- daecore/server/rate_limit.py +179 -0
- daecore/server/readiness.py +497 -0
- daecore/server/reads/__init__.py +1 -0
- daecore/server/reads/_exact_documents.py +200 -0
- daecore/server/reads/_exact_lanes.py +278 -0
- daecore/server/reads/_exact_memory_facts.py +270 -0
- daecore/server/reads/_exact_paging.py +310 -0
- daecore/server/reads/_exact_passage_counts.py +193 -0
- daecore/server/reads/_exact_population.py +425 -0
- daecore/server/reads/_exact_reports.py +347 -0
- daecore/server/reads/_exact_request.py +212 -0
- daecore/server/reads/_exact_snapshot.py +325 -0
- daecore/server/reads/_exact_statistics.py +395 -0
- daecore/server/reads/_exact_types.py +273 -0
- daecore/server/reads/attribution.py +26 -0
- daecore/server/reads/browse.py +146 -0
- daecore/server/reads/browse_links.py +275 -0
- daecore/server/reads/bucket_listing.py +345 -0
- daecore/server/reads/clamps.py +20 -0
- daecore/server/reads/continuations.py +151 -0
- daecore/server/reads/dating.py +127 -0
- daecore/server/reads/degradation.py +123 -0
- daecore/server/reads/exact.py +58 -0
- daecore/server/reads/execution.py +869 -0
- daecore/server/reads/inspection.py +35 -0
- daecore/server/reads/inspection_pages.py +315 -0
- daecore/server/reads/link_graph.py +453 -0
- daecore/server/reads/link_items.py +301 -0
- daecore/server/reads/link_presentation.py +173 -0
- daecore/server/reads/link_report.py +172 -0
- daecore/server/reads/link_rows.py +415 -0
- daecore/server/reads/link_upkeep.py +145 -0
- daecore/server/reads/link_walks.py +754 -0
- daecore/server/reads/links.py +518 -0
- daecore/server/reads/pagination.py +148 -0
- daecore/server/reads/recall.py +210 -0
- daecore/server/reads/recall_links.py +198 -0
- daecore/server/reads/recall_log.py +105 -0
- daecore/server/reads/recall_pages.py +251 -0
- daecore/server/reads/recent_context.py +475 -0
- daecore/server/reads/retries.py +34 -0
- daecore/server/reads/write_reply.py +189 -0
- daecore/server/recall_handoff.py +176 -0
- daecore/server/recall_returns.py +129 -0
- daecore/server/refusals.py +191 -0
- daecore/server/rendering.py +466 -0
- daecore/server/reply_contracts.py +567 -0
- daecore/server/reply_views.py +496 -0
- daecore/server/response_write.py +333 -0
- daecore/server/result_catalog.py +226 -0
- daecore/server/review_health.py +195 -0
- daecore/server/scoping.py +221 -0
- daecore/server/tool_audit.py +340 -0
- daecore/server/tool_codes.py +29 -0
- daecore/server/tool_inventory.py +79 -0
- daecore/server/tool_requests.py +319 -0
- daecore/server/tool_runtime.py +884 -0
- daecore/server/tools/__init__.py +1 -0
- daecore/server/tools/_arguments.py +304 -0
- daecore/server/tools/_evidence.py +351 -0
- daecore/server/tools/_mutation_replies.py +82 -0
- daecore/server/tools/_variants.py +92 -0
- daecore/server/tools/admin.py +469 -0
- daecore/server/tools/annotation.py +275 -0
- daecore/server/tools/browse.py +353 -0
- daecore/server/tools/correction.py +385 -0
- daecore/server/tools/explore.py +217 -0
- daecore/server/tools/inspect.py +386 -0
- daecore/server/tools/memory.py +414 -0
- daecore/server/tools/recall.py +567 -0
- daecore/server/transport.py +156 -0
- daecore/server/update_window.py +217 -0
- daecore/server/warmup.py +293 -0
- daecore/server/watch_events.py +287 -0
- daecore/server/watch_queues.py +436 -0
- daecore/server/watch_routing.py +286 -0
- daecore/server/watcher.py +957 -0
- daecore/server/work.py +128 -0
- daecore/server/workspace_lifecycle.py +320 -0
- daecore/setup/__init__.py +37 -0
- daecore/setup/_application.py +353 -0
- daecore/setup/_contracts.py +84 -0
- daecore/setup/_planning.py +502 -0
- daecore/setup/_uninstall_removal.py +493 -0
- daecore/setup/_uninstall_runtime.py +123 -0
- daecore/setup/assurance.py +90 -0
- daecore/setup/assurance_provider.py +399 -0
- daecore/setup/bootstrap/__init__.py +280 -0
- daecore/setup/bootstrap/_acceleration.py +138 -0
- daecore/setup/bootstrap/_activation_receipts.py +115 -0
- daecore/setup/bootstrap/_plan_actions.py +221 -0
- daecore/setup/bootstrap/apply.py +555 -0
- daecore/setup/bootstrap/doctor.py +147 -0
- daecore/setup/bootstrap/fs_safety.py +93 -0
- daecore/setup/bootstrap/native_memory.py +457 -0
- daecore/setup/bootstrap/planning.py +708 -0
- daecore/setup/bootstrap/readiness.py +459 -0
- daecore/setup/bootstrap/receipt.py +85 -0
- daecore/setup/bootstrap/types.py +273 -0
- daecore/setup/bootstrap/wizard.py +389 -0
- daecore/setup/cli.py +222 -0
- daecore/setup/config.py +19 -0
- daecore/setup/detection.py +39 -0
- daecore/setup/execute.py +270 -0
- daecore/setup/guide.py +40 -0
- daecore/setup/hosts.py +674 -0
- daecore/setup/interaction.py +415 -0
- daecore/setup/merge/__init__.py +1 -0
- daecore/setup/merge/_json_patch_identity.py +178 -0
- daecore/setup/merge/_json_patch_operations.py +284 -0
- daecore/setup/merge/_json_patch_ownership.py +378 -0
- daecore/setup/merge/_json_patch_values.py +95 -0
- daecore/setup/merge/_publish.py +96 -0
- daecore/setup/merge/_toml_edit.py +416 -0
- daecore/setup/merge/_toml_structure.py +273 -0
- daecore/setup/merge/json_patch.py +324 -0
- daecore/setup/merge/jsonc.py +211 -0
- daecore/setup/merge/markdown_section.py +267 -0
- daecore/setup/merge/skill_file.py +41 -0
- daecore/setup/merge/syntax.py +146 -0
- daecore/setup/merge/toml_block.py +307 -0
- daecore/setup/merge/types.py +129 -0
- daecore/setup/merge/whole_file_sentinel.py +248 -0
- daecore/setup/merge/yaml_text.py +300 -0
- daecore/setup/plan.py +322 -0
- daecore/setup/plan_file.py +83 -0
- daecore/setup/record.py +224 -0
- daecore/setup/refresh_snapshot.py +361 -0
- daecore/setup/render.py +447 -0
- daecore/setup/templates/antigravity/continuity.md +8 -0
- daecore/setup/templates/antigravity/mcp.json.patch +19 -0
- daecore/setup/templates/claude-code/mcp.json.patch +22 -0
- daecore/setup/templates/codex/config.toml.patch +64 -0
- daecore/setup/templates/constitution-section.md.tmpl +3 -0
- daecore/setup/templates/copilot/mcp-config.json.patch +24 -0
- daecore/setup/templates/cursor/continuity.md +7 -0
- daecore/setup/templates/cursor/daecore-continuity.js +31 -0
- daecore/setup/templates/cursor/hooks.json.patch +24 -0
- daecore/setup/templates/cursor/mcp.json.patch +22 -0
- daecore/setup/templates/devin/continuity.md +8 -0
- daecore/setup/templates/devin/mcp.json.patch +20 -0
- daecore/setup/templates/hermes/config.yaml.patch +19 -0
- daecore/setup/templates/opencode/config.json.patch +28 -0
- daecore/setup/templates/skill/SKILL.md +38 -0
- daecore/setup/templates/skill/references/connect-any-host.md +84 -0
- daecore/setup/templates/skill/references/diagnose.md +62 -0
- daecore/setup/templates/skill/references/maintain.md +63 -0
- daecore/setup/uninstall.py +1298 -0
- daecore/setup/uninstall_execution.py +536 -0
- daecore/setup/uninstall_types.py +41 -0
- daecore/source_build.py +143 -0
- daecore/source_capture.py +117 -0
- daecore/source_identity.py +12 -0
- daecore/sqlite_identity.py +257 -0
- daecore/sqlite_space.py +153 -0
- daecore/stage_timings.py +119 -0
- daecore/status/__init__.py +1 -0
- daecore/status/inventory.py +192 -0
- daecore/status/memory_health.py +235 -0
- daecore/status/process_memory.py +141 -0
- daecore/status/snapshot.py +482 -0
- daecore/status/source_review.py +154 -0
- daecore/status/sources.py +271 -0
- daecore/status/watch.py +70 -0
- daecore/storage/__init__.py +3 -0
- daecore/storage/assurance.py +93 -0
- daecore/storage/assurance_provider.py +306 -0
- daecore/storage/database/__init__.py +71 -0
- daecore/storage/database/encrypted.py +451 -0
- daecore/storage/database/fs_probe.py +135 -0
- daecore/storage/database/fs_safety.py +576 -0
- daecore/storage/database/read_pool.py +94 -0
- daecore/storage/encrypted_meta_schema.py +374 -0
- daecore/storage/encrypted_snapshot.py +249 -0
- daecore/storage/index/__init__.py +3 -0
- daecore/storage/index/_diagnostic_moves.py +135 -0
- daecore/storage/index/_diagnostic_records.py +208 -0
- daecore/storage/index/chunk_projection.py +405 -0
- daecore/storage/index/citation_reading.py +510 -0
- daecore/storage/index/connections.py +269 -0
- daecore/storage/index/diagnostics.py +554 -0
- daecore/storage/index/document_reads.py +467 -0
- daecore/storage/index/document_schema.py +395 -0
- daecore/storage/index/document_visibility.py +77 -0
- daecore/storage/index/document_writers.py +474 -0
- daecore/storage/index/errors.py +46 -0
- daecore/storage/index/file_ledger.py +713 -0
- daecore/storage/index/generations.py +970 -0
- daecore/storage/index/hygiene_review.py +380 -0
- daecore/storage/index/key.py +130 -0
- daecore/storage/index/lexical.py +429 -0
- daecore/storage/index/link_revisions.py +87 -0
- daecore/storage/index/link_view.py +518 -0
- daecore/storage/index/memory_links.py +274 -0
- daecore/storage/index/metadata.py +65 -0
- daecore/storage/index/model_policy.py +69 -0
- daecore/storage/index/name_inventory.py +275 -0
- daecore/storage/index/payloads.py +513 -0
- daecore/storage/index/pointer.py +181 -0
- daecore/storage/index/profiles.py +581 -0
- daecore/storage/index/publication_undo.py +240 -0
- daecore/storage/index/schema.py +374 -0
- daecore/storage/index/search_atoms.py +782 -0
- daecore/storage/index/shared_generations.py +485 -0
- daecore/storage/index/shared_objects.py +831 -0
- daecore/storage/index/snapshots.py +118 -0
- daecore/storage/index/text_match.py +379 -0
- daecore/storage/index/vector_encoding.py +122 -0
- daecore/storage/integrity.py +222 -0
- daecore/storage/janitor/__init__.py +149 -0
- daecore/storage/janitor/_artifacts.py +426 -0
- daecore/storage/janitor/_audit.py +345 -0
- daecore/storage/meta_store.py +360 -0
- daecore/storage/native.py +51 -0
- daecore/subprocesses.py +404 -0
- daecore/sync/__init__.py +6 -0
- daecore/sync/catchup.py +203 -0
- daecore/sync/consent.py +905 -0
- daecore/sync/discovery.py +521 -0
- daecore/sync/full_scan.py +95 -0
- daecore/sync/identity.py +74 -0
- daecore/sync/recorded_sources.py +111 -0
- daecore/sync/result.py +86 -0
- daecore/sync/snapshot.py +586 -0
- daecore/templates/__init__.py +2 -0
- daecore/templates/global-config.toml +121 -0
- daecore/term/__init__.py +88 -0
- daecore/term/_brand.py +77 -0
- daecore/term/_console.py +96 -0
- daecore/term/_errors.py +62 -0
- daecore/term/_prompt.py +162 -0
- daecore/term/_questionary.py +62 -0
- daecore/term/_references.py +69 -0
- daecore/term/capabilities.py +153 -0
- daecore/term/lifecycle.py +917 -0
- daecore/term/live_region.py +260 -0
- daecore/term/loader.py +118 -0
- daecore/term/progress.py +958 -0
- daecore/term/prompts.py +58 -0
- daecore/term/rendering.py +971 -0
- daecore/term/safety.py +13 -0
- daecore/term/verb_help.py +207 -0
- daecore/term/wizard.py +86 -0
- daecore/testing/__init__.py +13 -0
- daecore/testing/crashpoints.py +81 -0
- daecore/testing/launch.py +97 -0
- daecore/text_decoding.py +68 -0
- daecore/time_utils.py +430 -0
- daecore/tokenizer_assets.py +39 -0
- daecore/transfer/__init__.py +1 -0
- daecore/transfer/_eff_wordlist.py +661 -0
- daecore/transfer/_verify.py +169 -0
- daecore/transfer/capacity.py +87 -0
- daecore/transfer/citations.py +253 -0
- daecore/transfer/classification.py +189 -0
- daecore/transfer/completion.py +155 -0
- daecore/transfer/contracts.py +280 -0
- daecore/transfer/convert.py +500 -0
- daecore/transfer/event_policy.py +85 -0
- daecore/transfer/export.py +163 -0
- daecore/transfer/export_file.py +371 -0
- daecore/transfer/export_payload.py +222 -0
- daecore/transfer/import_flow.py +278 -0
- daecore/transfer/import_job.py +296 -0
- daecore/transfer/journal.py +96 -0
- daecore/transfer/members.py +792 -0
- daecore/transfer/publication.py +584 -0
- daecore/transfer/publish.py +306 -0
- daecore/transfer/receipt.py +120 -0
- daecore/transfer/recovery.py +228 -0
- daecore/transfer/snapshot.py +950 -0
- daecore/transfer/verification.py +64 -0
- daecore/tree_copy.py +178 -0
- daecore/workspace/__init__.py +1 -0
- daecore/workspace/availability.py +192 -0
- daecore/workspace/config_transaction.py +772 -0
- daecore/workspace/filesystem.py +269 -0
- daecore/workspace/identity.py +327 -0
- daecore/workspace/intake.py +669 -0
- daecore/workspace/probes.py +221 -0
- daecore/workspace/project_links.py +252 -0
- daecore/workspace/project_membership.py +35 -0
- daecore/workspace/reattach.py +446 -0
- daecore/workspace/recovery.py +25 -0
- daecore/workspace/registry.py +645 -0
- daecore/workspace/scope.py +507 -0
- daecore-0.3.0.dist-info/METADATA +285 -0
- daecore-0.3.0.dist-info/RECORD +1051 -0
- daecore-0.3.0.dist-info/WHEEL +4 -0
- daecore-0.3.0.dist-info/entry_points.txt +3 -0
- daecore-0.3.0.dist-info/licenses/LICENSE +201 -0
- daecore-0.3.0.dist-info/licenses/NOTICE +99 -0
daecore/_handover.py
ADDED
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
"""The file a launcher runs to give a release control of an install, update or repair.
|
|
2
|
+
|
|
3
|
+
The launcher stages a release and runs this file on its own Python, so every install meets
|
|
4
|
+
the newest release's code before anything it already holds. Its request is one JSON file,
|
|
5
|
+
and that request and the exit codes are a contract with launchers already on machines:
|
|
6
|
+
a later release may add fields and may not remove or rename one. Exit 0 means finished,
|
|
7
|
+
exit 1 means failed with the reason printed, and any other code passes through.
|
|
8
|
+
|
|
9
|
+
This is the only part of a release that runs on a launcher's Python, which can be any
|
|
10
|
+
version from 3.12 up and holds nothing but uv, so it imports the standard library alone and
|
|
11
|
+
stays valid on 3.12. It fetches the uv and the exact Python this release locks, makes a
|
|
12
|
+
small environment on that Python, and continues there. Nothing it does depends on a runtime
|
|
13
|
+
or a managed Python already being healthy, so it can repair the loss of either.
|
|
14
|
+
|
|
15
|
+
It also owns the install screen: what a person sees before the release's own renderer
|
|
16
|
+
exists. ``release_install`` draws through the same code, and a test keeps it matching
|
|
17
|
+
``daecore.term``.
|
|
18
|
+
"""
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
import json
|
|
22
|
+
import os
|
|
23
|
+
import platform
|
|
24
|
+
import re
|
|
25
|
+
import subprocess
|
|
26
|
+
import sys
|
|
27
|
+
import threading
|
|
28
|
+
import time
|
|
29
|
+
from pathlib import Path
|
|
30
|
+
|
|
31
|
+
_LISTS = Path(__file__).resolve().parent / '_release'
|
|
32
|
+
_CONTINUE = (
|
|
33
|
+
'import sys; sys.path.insert(0, sys.argv[1]); from daecore import release_install; '
|
|
34
|
+
'sys.exit(release_install.main(sys.argv[2]))'
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
#: The platforms this release's locked lists cover, by uv's name for each, as a person reads them.
|
|
38
|
+
#: ``scripts/lock_runtime.py`` locks exactly these.
|
|
39
|
+
PLATFORMS = {
|
|
40
|
+
'x86_64-pc-windows-msvc': 'Windows on x64',
|
|
41
|
+
'x86_64-unknown-linux-gnu': 'Linux on x64 with glibc',
|
|
42
|
+
'aarch64-apple-darwin': 'macOS 15 or later on Apple silicon',
|
|
43
|
+
}
|
|
44
|
+
#: The oldest macOS the locked lists run on.
|
|
45
|
+
MACOS_FLOOR = (15, 0)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class _Failed(RuntimeError):
|
|
49
|
+
"""A step failed; its message says what happened."""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# --- The install screen --------------------------------------------------------------------
|
|
53
|
+
# The look of ``daecore.term``, drawn with the standard library: a bold title, the shared loader
|
|
54
|
+
# beside the work, quiet settled rows, problems with their reasons, and a verdict. These values
|
|
55
|
+
# are copies of the terminal package's; tests/term/test_install_screen.py keeps them equal.
|
|
56
|
+
|
|
57
|
+
DELAY = 1.0
|
|
58
|
+
"""Seconds a wait runs before any loader appears."""
|
|
59
|
+
FRAME_SECONDS = 0.15
|
|
60
|
+
LABEL_COLUMN = 4
|
|
61
|
+
_FRAMES = ('⠐⠔', '⠐⠅', '⠐⠑', '⠀⠕')
|
|
62
|
+
_ASCII = {'✗': 'x', '‒': '-', '·': '-', '—': '--'}
|
|
63
|
+
_CODES = {'bold': '1', 'dim': '2', 'italic': '3', 'red': '31', 'yellow': '33'}
|
|
64
|
+
_VERDICT_MARKS = {'failed': ('✗', 'red'), 'interrupted': ('‒', 'yellow')}
|
|
65
|
+
_VERDICT_WORDS = {'failed': 'Failed', 'interrupted': 'Cancelled'}
|
|
66
|
+
_ANSI = re.compile('\x1b\\[[0-9;]*m')
|
|
67
|
+
_BACKTICKED = re.compile(r'`([^`\n]+)`')
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def fmt_secs(seconds: float) -> str:
|
|
71
|
+
"""A duration as every screen shows it: ``4.2s`` or ``1m 04s``."""
|
|
72
|
+
if seconds >= 60:
|
|
73
|
+
minutes, rest = divmod(int(round(seconds)), 60)
|
|
74
|
+
return f'{minutes}m {rest:02d}s'
|
|
75
|
+
return f'{seconds:.1f}s'
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def version(value: str) -> str:
|
|
79
|
+
"""A version as every screen shows it: ``v0.3.1``."""
|
|
80
|
+
return value if value.startswith('v') else f'v{value}'
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _isatty(stream) -> bool:
|
|
84
|
+
try:
|
|
85
|
+
return bool(stream.isatty())
|
|
86
|
+
except Exception: # noqa: BLE001 - a stream without isatty is not a terminal
|
|
87
|
+
return False
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _color(stream) -> bool:
|
|
91
|
+
if os.environ.get('NO_COLOR'):
|
|
92
|
+
return False
|
|
93
|
+
return os.environ.get('FORCE_COLOR', '').strip().lower() in {'1', 'true', 'yes', 'on'} or _isatty(stream)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def _unicode(stream) -> bool:
|
|
97
|
+
return 'utf' in (getattr(stream, 'encoding', '') or '').lower()
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _glyph(char: str, stream) -> str:
|
|
101
|
+
return char if _unicode(stream) else _ASCII.get(char, char)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def _style(text: str, *names: str, stream) -> str:
|
|
105
|
+
if not names or not _color(stream):
|
|
106
|
+
return text
|
|
107
|
+
return f'\x1b[{";".join(_CODES[name] for name in names)}m{text}\x1b[0m'
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def _marked(text: str, stream) -> str:
|
|
111
|
+
"""Copy with each backticked command bold; without colour the backticks are its mark."""
|
|
112
|
+
if '`' not in text or not _color(stream):
|
|
113
|
+
return text
|
|
114
|
+
return ''.join(_style(part, 'bold', stream=stream) if index % 2 else part
|
|
115
|
+
for index, part in enumerate(_BACKTICKED.split(text)) if part)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _fix(action: str, stream) -> str:
|
|
119
|
+
"""A fix's text: a lone ``daecore`` command is bold, as a person types it."""
|
|
120
|
+
if action.startswith('daecore ') and not re.search(r'[,;`]|\. |\.$', action):
|
|
121
|
+
return _style(action, 'bold', stream=stream)
|
|
122
|
+
return _marked(action, stream)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _width(stream) -> int:
|
|
126
|
+
try:
|
|
127
|
+
columns = os.get_terminal_size(stream.fileno()).columns
|
|
128
|
+
except (AttributeError, OSError, ValueError):
|
|
129
|
+
columns = 80
|
|
130
|
+
return max(24, columns) - 2
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def _enable_vt() -> None:
|
|
134
|
+
"""Let a Windows console read the escape codes the loader repaints with."""
|
|
135
|
+
if os.name != 'nt':
|
|
136
|
+
return
|
|
137
|
+
try:
|
|
138
|
+
import ctypes
|
|
139
|
+
|
|
140
|
+
kernel32 = ctypes.windll.kernel32
|
|
141
|
+
for handle_id in (-11, -12): # stdout, stderr
|
|
142
|
+
handle = kernel32.GetStdHandle(handle_id)
|
|
143
|
+
mode = ctypes.c_uint32()
|
|
144
|
+
if kernel32.GetConsoleMode(handle, ctypes.byref(mode)):
|
|
145
|
+
kernel32.SetConsoleMode(handle, mode.value | 0x0004)
|
|
146
|
+
except Exception: # noqa: BLE001 - colour is cosmetic; the words still print
|
|
147
|
+
pass
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class Screen:
|
|
151
|
+
"""The install code's screen: one title, the loader beside the work, then settled rows.
|
|
152
|
+
|
|
153
|
+
A colour UTF-8 terminal animates the loader on one row. A terminal without animation
|
|
154
|
+
gets one line for a step that runs past its first second; a pipe gets only the rows that
|
|
155
|
+
stay. ``started`` is the command's start, as ``time.time()``, so a later process continues
|
|
156
|
+
the same clock. Drawing never fails the install: a stream that breaks only loses its words.
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
def __init__(self, stream=None, *, errors=None, started: float | None = None, titled: bool = False,
|
|
160
|
+
continued: tuple[str, bool, float | None] | None = None) -> None:
|
|
161
|
+
self.stream = sys.stdout if stream is None else stream
|
|
162
|
+
self.errors = sys.stderr if errors is None else errors
|
|
163
|
+
self.started = time.time() if started is None else float(started)
|
|
164
|
+
self.titled = titled
|
|
165
|
+
# A step an earlier process began: its label, whether its plain line is written, and
|
|
166
|
+
# its start, or None when it began with the command, as the launcher's loader does.
|
|
167
|
+
self._continued = continued
|
|
168
|
+
tty = _isatty(self.stream)
|
|
169
|
+
self.live = tty and _color(self.stream) and _unicode(self.stream)
|
|
170
|
+
self.plain_tty = tty and not self.live
|
|
171
|
+
self._lock = threading.Lock()
|
|
172
|
+
self._step: tuple[str, float] | None = None
|
|
173
|
+
self._written = False
|
|
174
|
+
self._drawn = False
|
|
175
|
+
self._stop = threading.Event()
|
|
176
|
+
self._thread: threading.Thread | None = None
|
|
177
|
+
self._timer: threading.Timer | None = None
|
|
178
|
+
if tty and _color(self.stream):
|
|
179
|
+
_enable_vt()
|
|
180
|
+
|
|
181
|
+
@classmethod
|
|
182
|
+
def resume(cls, state: dict | None) -> Screen:
|
|
183
|
+
"""The screen an earlier process handed over: the launcher's loader, or the handover's screen."""
|
|
184
|
+
state = state if isinstance(state, dict) else {}
|
|
185
|
+
started, label, since = state.get('started'), state.get('label'), state.get('since')
|
|
186
|
+
return cls(started=started if isinstance(started, (int, float)) else None,
|
|
187
|
+
titled=state.get('titled') is True,
|
|
188
|
+
continued=(label, state.get('written') is True,
|
|
189
|
+
since if isinstance(since, (int, float)) else None)
|
|
190
|
+
if isinstance(label, str) else None)
|
|
191
|
+
|
|
192
|
+
def state(self) -> dict:
|
|
193
|
+
"""What the next stage needs to continue this screen: the command's start, whether the
|
|
194
|
+
title shows, and the work in progress with its own start and whether its line is written."""
|
|
195
|
+
state = {'started': self.started, 'titled': self.titled}
|
|
196
|
+
with self._lock:
|
|
197
|
+
if self._step is not None:
|
|
198
|
+
label, since = self._step
|
|
199
|
+
state.update(label=label, since=since, written=self._written)
|
|
200
|
+
return state
|
|
201
|
+
|
|
202
|
+
def _write(self, stream, text: str) -> None:
|
|
203
|
+
try:
|
|
204
|
+
stream.write(text)
|
|
205
|
+
stream.flush()
|
|
206
|
+
except (OSError, ValueError, UnicodeError):
|
|
207
|
+
pass
|
|
208
|
+
|
|
209
|
+
def _elapsed(self, since: float | None = None) -> str:
|
|
210
|
+
return fmt_secs(max(0.0, time.time() - (self.started if since is None else since)))
|
|
211
|
+
|
|
212
|
+
# The title and the work in progress.
|
|
213
|
+
|
|
214
|
+
def title(self, text: str) -> None:
|
|
215
|
+
"""Open the screen with its bold title, once."""
|
|
216
|
+
if self.titled:
|
|
217
|
+
return
|
|
218
|
+
self.clear()
|
|
219
|
+
self.titled = True
|
|
220
|
+
self._write(self.stream, _style(text, 'bold', stream=self.stream) + '\n')
|
|
221
|
+
|
|
222
|
+
def work(self, label: str) -> None:
|
|
223
|
+
"""Show ``label`` as the work in progress, after the command's first second.
|
|
224
|
+
|
|
225
|
+
The step an earlier process began keeps its clock, and its line is never written twice.
|
|
226
|
+
"""
|
|
227
|
+
self.clear()
|
|
228
|
+
continued, self._continued = self._continued, None
|
|
229
|
+
same = continued is not None and continued[0] == label
|
|
230
|
+
since = (self.started if continued[2] is None else continued[2]) if same else time.time()
|
|
231
|
+
with self._lock:
|
|
232
|
+
self._step = (label, since)
|
|
233
|
+
self._written = same and continued[1]
|
|
234
|
+
self._stop = threading.Event()
|
|
235
|
+
if self.live:
|
|
236
|
+
self._thread = threading.Thread(target=self._animate, args=(self._stop,), daemon=True)
|
|
237
|
+
self._thread.start()
|
|
238
|
+
elif self.plain_tty and not self._written:
|
|
239
|
+
# A terminal without animation gets one line, once this step passes its own first second.
|
|
240
|
+
delay = max(0.0, self._step[1] + DELAY - time.time())
|
|
241
|
+
self._timer = threading.Timer(delay, self._plain_line, args=(label,))
|
|
242
|
+
self._timer.daemon = True
|
|
243
|
+
self._timer.start()
|
|
244
|
+
|
|
245
|
+
def _working(self, label: str) -> str:
|
|
246
|
+
return label if label.endswith('...') else label + '...'
|
|
247
|
+
|
|
248
|
+
def _plain_line(self, label: str) -> None:
|
|
249
|
+
with self._lock:
|
|
250
|
+
if self._step is None or self._step[0] != label:
|
|
251
|
+
return
|
|
252
|
+
self._write(self.stream, ' ' * LABEL_COLUMN + self._working(label) + '\n')
|
|
253
|
+
self._written = True
|
|
254
|
+
|
|
255
|
+
def _row(self, now: float) -> str:
|
|
256
|
+
label, since = self._step
|
|
257
|
+
frame = _FRAMES[int(max(0.0, now - (self.started + DELAY)) / FRAME_SECONDS) % len(_FRAMES)]
|
|
258
|
+
lead = ' ' * (LABEL_COLUMN - len(frame) - 1)
|
|
259
|
+
timing = f' {_glyph("·", self.stream)} {fmt_secs(max(0.0, now - since))}'
|
|
260
|
+
row = (lead + _style(frame, 'bold', stream=self.stream) + ' ' + self._working(label)
|
|
261
|
+
+ _style(timing, 'dim', stream=self.stream))
|
|
262
|
+
width = _width(self.stream)
|
|
263
|
+
if len(_ANSI.sub('', row)) > width:
|
|
264
|
+
# A wrapped row could not be repainted in place.
|
|
265
|
+
row = lead + frame + ' ' + (self._working(label) + timing)[:max(1, width - LABEL_COLUMN)]
|
|
266
|
+
return row
|
|
267
|
+
|
|
268
|
+
def _animate(self, stop: threading.Event) -> None:
|
|
269
|
+
while not stop.is_set():
|
|
270
|
+
now = time.time()
|
|
271
|
+
if now >= self.started + DELAY:
|
|
272
|
+
with self._lock:
|
|
273
|
+
if stop.is_set() or self._step is None:
|
|
274
|
+
return
|
|
275
|
+
self._write(self.stream, '\r' + self._row(now) + '\x1b[K')
|
|
276
|
+
self._drawn = True
|
|
277
|
+
stop.wait(FRAME_SECONDS)
|
|
278
|
+
|
|
279
|
+
def clear(self) -> None:
|
|
280
|
+
"""End the work in progress and leave no trace of its row."""
|
|
281
|
+
timer, thread = self._timer, self._thread
|
|
282
|
+
self._timer = self._thread = None
|
|
283
|
+
if timer is not None:
|
|
284
|
+
timer.cancel()
|
|
285
|
+
with self._lock:
|
|
286
|
+
self._stop.set()
|
|
287
|
+
self._step = None
|
|
288
|
+
if self._drawn:
|
|
289
|
+
self._write(self.stream, '\r\x1b[K')
|
|
290
|
+
self._drawn = False
|
|
291
|
+
if thread is not None and thread is not threading.current_thread():
|
|
292
|
+
thread.join(timeout=1.0)
|
|
293
|
+
|
|
294
|
+
def done(self, label: str) -> None:
|
|
295
|
+
"""Settle the work in progress as one quiet row with its time."""
|
|
296
|
+
since = self._step[1] if self._step is not None else self.started
|
|
297
|
+
self.clear()
|
|
298
|
+
timing = _style(f' {_glyph("·", self.stream)} {self._elapsed(since)}', 'dim', stream=self.stream)
|
|
299
|
+
self._write(self.stream, ' ' + label + timing + '\n')
|
|
300
|
+
|
|
301
|
+
# Endings.
|
|
302
|
+
|
|
303
|
+
def problem(self, text: str, reason: str | None = None, *, fix: str | None = None) -> None:
|
|
304
|
+
"""One problem row: its mark and words, the reason beneath and how to fix it."""
|
|
305
|
+
self.clear()
|
|
306
|
+
stream = self.errors
|
|
307
|
+
lines = [f' {_style(_glyph("✗", stream), "red", stream=stream)} {text}']
|
|
308
|
+
lines.extend(' ' + line.rstrip() for line in (reason or '').strip().splitlines())
|
|
309
|
+
if fix:
|
|
310
|
+
lines.append(' ' + _style('fix:', 'italic', stream=stream) + ' ' + _fix(fix, stream))
|
|
311
|
+
self._write(stream, '\n'.join(lines) + '\n')
|
|
312
|
+
|
|
313
|
+
def verdict(self, status: str, note: str | None = None) -> None:
|
|
314
|
+
"""Close the screen: ``✗ Failed`` or ``‒ Cancelled``, the command's time, and what survived."""
|
|
315
|
+
self.clear()
|
|
316
|
+
stream = self.errors
|
|
317
|
+
mark, colour = _VERDICT_MARKS[status]
|
|
318
|
+
line = (_style(_glyph(mark, stream), colour, stream=stream) + ' '
|
|
319
|
+
+ _style(_VERDICT_WORDS[status], 'bold', stream=stream)
|
|
320
|
+
+ _style(f' {_glyph("·", stream)} {self._elapsed()}', 'dim', stream=stream))
|
|
321
|
+
if note:
|
|
322
|
+
line += ' ' + _style(f'{_glyph("—", stream)} ', 'dim', stream=stream) + _style(note, 'dim', stream=stream)
|
|
323
|
+
self._write(stream, '\n' + line + '\n')
|
|
324
|
+
|
|
325
|
+
def failed(self, text: str, reason: str | None = None, *, fix: str | None = None) -> None:
|
|
326
|
+
"""A problem that ends the install: its row, then the verdict when a title opened the screen."""
|
|
327
|
+
self.problem(text, reason, fix=fix)
|
|
328
|
+
if self.titled:
|
|
329
|
+
self.verdict('failed')
|
|
330
|
+
|
|
331
|
+
def cancelled(self, note: str) -> None:
|
|
332
|
+
"""Ctrl-C ended the install's own work: one line saying what survived."""
|
|
333
|
+
self.verdict('interrupted', note)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
# --- What to install, and where it can run --------------------------------------------------
|
|
337
|
+
|
|
338
|
+
def install_title(request: dict, release: str | None = None) -> str:
|
|
339
|
+
"""The title an install opens with, which the new version's own screen continues.
|
|
340
|
+
|
|
341
|
+
It is the one place an install names the version it brings; its rows do not repeat it.
|
|
342
|
+
"""
|
|
343
|
+
if request.get('mode') == 'provision':
|
|
344
|
+
return f'Setting up {request["home"]}'
|
|
345
|
+
artifact = request.get('artifact') or {}
|
|
346
|
+
if artifact.get('kind') == 'source':
|
|
347
|
+
return f'Updating from {artifact["tree"]}'
|
|
348
|
+
return f'Updating to {version(release)}'
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
def this_platform() -> tuple[str, str]:
|
|
352
|
+
"""This machine as uv names a platform, and as a person reads it."""
|
|
353
|
+
machine = platform.machine().lower()
|
|
354
|
+
arch = {'amd64': 'x86_64', 'x86_64': 'x86_64', 'arm64': 'aarch64', 'aarch64': 'aarch64'}.get(machine, machine)
|
|
355
|
+
chip = {'x86_64': 'x64', 'aarch64': 'Arm'}.get(arch, machine or 'an unknown processor')
|
|
356
|
+
if sys.platform == 'win32':
|
|
357
|
+
return f'{arch}-pc-windows-msvc', f'Windows on {chip}'
|
|
358
|
+
if sys.platform == 'darwin':
|
|
359
|
+
return f'{arch}-apple-darwin', 'macOS on Apple silicon' if arch == 'aarch64' else 'macOS on Intel'
|
|
360
|
+
if sys.platform.startswith('linux'):
|
|
361
|
+
glibc = platform.libc_ver()[0] == 'glibc'
|
|
362
|
+
return (f'{arch}-unknown-linux-{"gnu" if glibc else "musl"}',
|
|
363
|
+
f'Linux on {chip} with {"glibc" if glibc else "musl or another C library"}')
|
|
364
|
+
return f'{arch}-{sys.platform}', f'{sys.platform} on {chip}'
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
def platform_refusal() -> tuple[str, str] | None:
|
|
368
|
+
"""Why this release cannot install on this machine, as a problem and its reason, or ``None``."""
|
|
369
|
+
name, described = this_platform()
|
|
370
|
+
where = ', '.join(PLATFORMS.values())
|
|
371
|
+
if name not in PLATFORMS:
|
|
372
|
+
return f'Daecore has no build for {described}', f'It installs on {where}.'
|
|
373
|
+
if sys.platform == 'darwin':
|
|
374
|
+
release = platform.mac_ver()[0]
|
|
375
|
+
try:
|
|
376
|
+
numbers = tuple(int(part) for part in release.split('.')[:2])
|
|
377
|
+
except ValueError:
|
|
378
|
+
numbers = ()
|
|
379
|
+
if numbers and numbers < MACOS_FLOOR:
|
|
380
|
+
return (f"Daecore needs macOS {MACOS_FLOOR[0]} or later",
|
|
381
|
+
f'This Mac runs macOS {release}.')
|
|
382
|
+
return None
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
# --- Preparing the install ------------------------------------------------------------------
|
|
386
|
+
|
|
387
|
+
def _uv(command: list[str], *, cwd: Path, env: dict[str, str] | None = None) -> str:
|
|
388
|
+
"""Run one uv step quietly; its output is shown only when it fails."""
|
|
389
|
+
done = subprocess.run(
|
|
390
|
+
command, cwd=cwd, env=env, stdin=subprocess.DEVNULL, capture_output=True, text=True, encoding='utf-8',
|
|
391
|
+
errors='replace', check=False, creationflags=getattr(subprocess, 'CREATE_NO_WINDOW', 0),
|
|
392
|
+
)
|
|
393
|
+
if done.returncode:
|
|
394
|
+
raise _Failed(done.stderr.strip() or done.stdout.strip() or f'uv {command[1]} exited {done.returncode}')
|
|
395
|
+
return done.stdout
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
def _private_folder(staging: Path) -> Path:
|
|
399
|
+
"""An empty folder to run uv from, so no project's settings around the caller can redirect it."""
|
|
400
|
+
folder = staging / 'handover'
|
|
401
|
+
folder.mkdir()
|
|
402
|
+
(folder / 'uv.toml').write_text('', encoding='utf-8')
|
|
403
|
+
(folder / 'pyproject.toml').write_text(
|
|
404
|
+
'[project]\nname = "daecore-handover"\nversion = "0"\n[tool.uv.workspace]\nmembers = []\n', encoding='utf-8',
|
|
405
|
+
)
|
|
406
|
+
return folder
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
def _locked_uv(request: dict, staging: Path, folder: Path) -> str:
|
|
410
|
+
"""The uv this release was tested with, fetched by whichever uv the launcher holds.
|
|
411
|
+
|
|
412
|
+
uv's list of Python versions is frozen per uv release, so the launcher's uv only ever
|
|
413
|
+
has to fetch this one, which knows the Python the lock names.
|
|
414
|
+
"""
|
|
415
|
+
tools = staging / 'tools'
|
|
416
|
+
_uv([request['uv'], 'pip', 'install', '--python', request['launcher_python'], '--no-deps', '--require-hashes',
|
|
417
|
+
'--only-binary', ':all:', '--target', str(tools), '-r', str(_LISTS / 'tools.lock')], cwd=folder)
|
|
418
|
+
return str(tools / 'bin' / ('uv.exe' if os.name == 'nt' else 'uv'))
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
def _managed_python(uv: str, root: Path, folder: Path) -> str:
|
|
422
|
+
"""Install the exact Python the lock names, in a folder only Daecore uses."""
|
|
423
|
+
wanted = (_LISTS / 'python-version').read_text(encoding='utf-8').strip()
|
|
424
|
+
root.mkdir(parents=True, exist_ok=True)
|
|
425
|
+
env = {**os.environ, 'UV_PYTHON_INSTALL_DIR': str(root)}
|
|
426
|
+
_uv([uv, 'python', 'install', wanted, '--no-bin', '--no-registry'], cwd=folder, env=env)
|
|
427
|
+
return _uv([uv, 'python', 'find', '--python-preference', 'only-managed', '--no-project', wanted],
|
|
428
|
+
cwd=folder, env=env).strip()
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
def _small_environment(uv: str, python: str, staging: Path, folder: Path) -> str:
|
|
432
|
+
"""An environment on the managed Python holding what the rest of the install imports."""
|
|
433
|
+
environment = staging / 'environment'
|
|
434
|
+
_uv([uv, 'venv', '--no-python-downloads', '--python', python, str(environment)], cwd=folder)
|
|
435
|
+
interpreter = str(environment / ('Scripts/python.exe' if os.name == 'nt' else 'bin/python'))
|
|
436
|
+
_uv([uv, 'pip', 'install', '--python', interpreter, '--no-deps', '--require-hashes', '--only-binary', ':all:',
|
|
437
|
+
'-r', str(_LISTS / 'handover.lock')], cwd=folder)
|
|
438
|
+
return interpreter
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
def console_handoff_kwargs() -> dict:
|
|
442
|
+
"""Keep the next stage on this console, or on a windowless host's pipes."""
|
|
443
|
+
if os.name != 'nt':
|
|
444
|
+
return {}
|
|
445
|
+
import ctypes
|
|
446
|
+
|
|
447
|
+
console_window = ctypes.windll.kernel32.GetConsoleWindow
|
|
448
|
+
console_window.restype = ctypes.c_void_p
|
|
449
|
+
if console_window():
|
|
450
|
+
return {'creationflags': 0}
|
|
451
|
+
kwargs = {'creationflags': subprocess.CREATE_NO_WINDOW}
|
|
452
|
+
for name in ('stdin', 'stdout', 'stderr'):
|
|
453
|
+
stream = getattr(sys, name, None)
|
|
454
|
+
try:
|
|
455
|
+
os.fstat(stream.fileno())
|
|
456
|
+
except (AttributeError, OSError, TypeError, ValueError):
|
|
457
|
+
stream = subprocess.DEVNULL
|
|
458
|
+
kwargs[name] = stream
|
|
459
|
+
return kwargs
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
def _wait_for_child(command: list[str], **options) -> int:
|
|
463
|
+
"""Run the next stage on this terminal and return its exit code; an interrupt is the child's to handle.
|
|
464
|
+
|
|
465
|
+
The launcher's ``wait_for_child`` does the same. This file cannot import it, because it
|
|
466
|
+
also runs from a recovery kit under whatever launcher is on the machine.
|
|
467
|
+
"""
|
|
468
|
+
with subprocess.Popen(command, **console_handoff_kwargs(), **options) as child:
|
|
469
|
+
while True:
|
|
470
|
+
try:
|
|
471
|
+
return child.wait()
|
|
472
|
+
except KeyboardInterrupt:
|
|
473
|
+
continue
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
def _surviving_candidate() -> str | None:
|
|
477
|
+
"""The interpreter of the update this recovery kit belongs to, if it is still there.
|
|
478
|
+
|
|
479
|
+
Recovery needs nothing fetched then, which is how a machine with no network finishes.
|
|
480
|
+
"""
|
|
481
|
+
try:
|
|
482
|
+
request = json.loads((Path(__file__).resolve().parents[2] / 'request.json').read_text(encoding='utf-8'))
|
|
483
|
+
interpreter = Path(request['candidate']) / ('Scripts/python.exe' if os.name == 'nt' else 'bin/python')
|
|
484
|
+
except (OSError, ValueError, KeyError, TypeError):
|
|
485
|
+
return None
|
|
486
|
+
return str(interpreter) if interpreter.is_file() else None
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
def _opening(screen: Screen, request: dict) -> None:
|
|
490
|
+
"""What the screen shows while the install is prepared.
|
|
491
|
+
|
|
492
|
+
First run always installs, so it opens with its title. An update shows the loader alone
|
|
493
|
+
until the next stage knows whether there is anything to install.
|
|
494
|
+
"""
|
|
495
|
+
mode = request['mode']
|
|
496
|
+
if mode == 'provision':
|
|
497
|
+
screen.title(install_title(request))
|
|
498
|
+
screen.work('Installing')
|
|
499
|
+
elif mode == 'recover':
|
|
500
|
+
screen.work('Finishing the interrupted update')
|
|
501
|
+
else:
|
|
502
|
+
screen.work('Checking for updates')
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def main(argv: list[str] | None = None) -> int:
|
|
506
|
+
arguments = sys.argv[1:] if argv is None else argv
|
|
507
|
+
request = json.loads(Path(arguments[0]).read_text(encoding='utf-8'))
|
|
508
|
+
staging = Path(request['staging'])
|
|
509
|
+
screen = Screen.resume(request.get('screen'))
|
|
510
|
+
refusal = platform_refusal()
|
|
511
|
+
if refusal is not None:
|
|
512
|
+
screen.problem(*refusal)
|
|
513
|
+
return 1
|
|
514
|
+
interpreter = _surviving_candidate() if request['mode'] == 'recover' else None
|
|
515
|
+
if interpreter is None:
|
|
516
|
+
if not request.get('uv'):
|
|
517
|
+
# Only a recovery kit is run by a launcher that has lost its uv, and its candidate is gone too.
|
|
518
|
+
screen.problem('The uv Daecore installs with is missing', fix='reinstall the Daecore command')
|
|
519
|
+
return 1
|
|
520
|
+
try:
|
|
521
|
+
_opening(screen, request)
|
|
522
|
+
folder = _private_folder(staging)
|
|
523
|
+
uv = _locked_uv(request, staging, folder)
|
|
524
|
+
python = _managed_python(uv, Path(request['python_root']), folder)
|
|
525
|
+
interpreter = _small_environment(uv, python, staging, folder)
|
|
526
|
+
except (_Failed, OSError) as exc:
|
|
527
|
+
screen.failed('Could not prepare the install', str(exc))
|
|
528
|
+
return 1
|
|
529
|
+
except KeyboardInterrupt:
|
|
530
|
+
screen.cancelled('nothing was installed' if request['mode'] == 'provision' else 'nothing changed')
|
|
531
|
+
return 130
|
|
532
|
+
request = {**request, 'uv': uv, 'python': python}
|
|
533
|
+
# The next stage takes over the row, with its clock and line; its loader returns at once,
|
|
534
|
+
# since a second has passed.
|
|
535
|
+
state = screen.state()
|
|
536
|
+
screen.clear()
|
|
537
|
+
continued = staging / 'install-request.json'
|
|
538
|
+
continued.write_text(json.dumps({**request, 'screen': state}), encoding='utf-8')
|
|
539
|
+
package_parent = str(Path(__file__).resolve().parent.parent)
|
|
540
|
+
return _wait_for_child([interpreter, '-I', '-c', _CONTINUE, package_parent, str(continued)])
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
if __name__ == '__main__':
|
|
544
|
+
try:
|
|
545
|
+
raise SystemExit(main())
|
|
546
|
+
except KeyboardInterrupt:
|
|
547
|
+
# Interrupted before the screen existed, or after the next stage had the terminal.
|
|
548
|
+
raise SystemExit(130) from None
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
packaging==26.3 \
|
|
2
|
+
--hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \
|
|
3
|
+
--hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c
|
|
4
|
+
psutil==7.2.2 \
|
|
5
|
+
--hash=sha256:0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 \
|
|
6
|
+
--hash=sha256:076a2d2f923fd4821644f5ba89f059523da90dc9014e85f8e45a5774ca5bc6f9 \
|
|
7
|
+
--hash=sha256:11fe5a4f613759764e79c65cf11ebdf26e33d6dd34336f8a337aa2996d71c841 \
|
|
8
|
+
--hash=sha256:1a571f2330c966c62aeda00dd24620425d4b0cc86881c89861fbc04549e5dc63 \
|
|
9
|
+
--hash=sha256:1a7b04c10f32cc88ab39cbf606e117fd74721c831c98a27dc04578deb0c16979 \
|
|
10
|
+
--hash=sha256:1fa4ecf83bcdf6e6c8f4449aff98eefb5d0604bf88cb883d7da3d8d2d909546a \
|
|
11
|
+
--hash=sha256:2edccc433cbfa046b980b0df0171cd25bcaeb3a68fe9022db0979e7aa74a826b \
|
|
12
|
+
--hash=sha256:7b6d09433a10592ce39b13d7be5a54fbac1d1228ed29abc880fb23df7cb694c9 \
|
|
13
|
+
--hash=sha256:8c233660f575a5a89e6d4cb65d9f938126312bca76d8fe087b947b3a1aaac9ee \
|
|
14
|
+
--hash=sha256:917e891983ca3c1887b4ef36447b1e0873e70c933afc831c6b6da078ba474312 \
|
|
15
|
+
--hash=sha256:ab486563df44c17f5173621c7b198955bd6b613fb87c71c161f827d3fb149a9b \
|
|
16
|
+
--hash=sha256:ae0aefdd8796a7737eccea863f80f81e468a1e4cf14d926bd9b6f5f2d5f90ca9 \
|
|
17
|
+
--hash=sha256:b0726cecd84f9474419d67252add4ac0cd9811b04d61123054b9fb6f57df6e9e \
|
|
18
|
+
--hash=sha256:b58fabe35e80b264a4e3bb23e6b96f9e45a3df7fb7eed419ac0e5947c61e47cc \
|
|
19
|
+
--hash=sha256:c7663d4e37f13e884d13994247449e9f8f574bc4655d509c3b95e9ec9e2b9dc1 \
|
|
20
|
+
--hash=sha256:e452c464a02e7dc7822a05d25db4cde564444a67e58539a00f929c51eddda0cf \
|
|
21
|
+
--hash=sha256:e78c8603dcd9a04c7364f1a3e670cea95d51ee865e4efb3556a3a63adef958ea \
|
|
22
|
+
--hash=sha256:eb7e81434c8d223ec4a219b5fc1c47d0417b12be7ea866e24fb5ad6e84b3d988 \
|
|
23
|
+
--hash=sha256:ed0cace939114f62738d808fdcecd4c869222507e266e574799e9c0faa17d486 \
|
|
24
|
+
--hash=sha256:eed63d3b4d62449571547b60578c5b2c4bcccc5387148db46e0c2313dad0ee00 \
|
|
25
|
+
--hash=sha256:fd04ef36b4a6d599bbdb225dd1d3f51e00105f6d48a28f006da7f9822f2606d8
|
|
26
|
+
pywin32==312 ; sys_platform == 'win32' \
|
|
27
|
+
--hash=sha256:02ebca0f0242b75292e218065004310d6a477407c09fa449bfe4f6022bc0c0fc \
|
|
28
|
+
--hash=sha256:17948aeadbdb091f0ced6ef0841620794e68327b94ee415571c1203594b7215c \
|
|
29
|
+
--hash=sha256:3020656e34f1cf7faeb7bccd2b84653a607c6ff0c55ada85e6487d61716deabd \
|
|
30
|
+
--hash=sha256:59aba5d5940842075343a5ddc6b11f1cdf0d1567fe745290359dfbcc7c2eb831 \
|
|
31
|
+
--hash=sha256:5c1fbe4a937a73ae9297384a3da38518cbc694c68ad8a809b2e19acd350f03ed \
|
|
32
|
+
--hash=sha256:5dbc35d2b5320dc07f25fa31269cfb767471002b17de5eb067d03da68c7cb2db \
|
|
33
|
+
--hash=sha256:6017c58e12f6809fbb0555b75df144c2922a9ffd18e4b9b5afa863b6c1a9d950 \
|
|
34
|
+
--hash=sha256:772235332b5d1024c696f11cea1ae4be7930f0a8b894bb43db14e3f435f1ff7e \
|
|
35
|
+
--hash=sha256:7a27df850933d16a8eabfbaeb73d52b273e2da667f80d70b01a89d1f6828d02c \
|
|
36
|
+
--hash=sha256:9fce94568364e0155e6dfb781ac5d95903be8baf28670632beab1b523f300daa \
|
|
37
|
+
--hash=sha256:a4dd3a848290ef724347b19f301045831d8e802fa4464f491b98b1e0a081432e \
|
|
38
|
+
--hash=sha256:a77a90fbb6881238d2ca9c6fd797b25817f3768fe78d214a90137ff055a75f5b \
|
|
39
|
+
--hash=sha256:a8597d28f267b39074aef51fa593530082b39cbe5a074226096857b1fed2dfb9 \
|
|
40
|
+
--hash=sha256:b2200a054ca6d6625c4842fc56a4976a4b47f96b73dbe5538c3f813a80359f47 \
|
|
41
|
+
--hash=sha256:b457f6d628a47e8a7346ce22acb7e1a46a4a78b52e1d17e1af56871bd19a93bc \
|
|
42
|
+
--hash=sha256:c2f03a0f73f804a13c2735b99392b0cd426bb4f2c4d0178e5ac966a0f21618d5 \
|
|
43
|
+
--hash=sha256:c53e878d15a1c44788082bfe712a905433473aa38f86375b7cf8b45e3acbaaf9 \
|
|
44
|
+
--hash=sha256:d11417d84412f859b722fad0841b3614459ed0047f7542d8362e77884f6b6e8a \
|
|
45
|
+
--hash=sha256:d620900033cc7531e50727c3c8333091df5dd3ffe6d68cdca38c03f5821408d5 \
|
|
46
|
+
--hash=sha256:dab4f65ac9c4e48400a2a0530c46c3c579cd5905ecd11b80692373915269208b \
|
|
47
|
+
--hash=sha256:dc90147579a905b8635e1b0ec6514967dcb07e6e0d9c42f1477feef14cac23bb
|