brainlayer 1.6.16__tar.gz → 1.6.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {brainlayer-1.6.16 → brainlayer-1.6.18}/PKG-INFO +1 -1
- {brainlayer-1.6.16 → brainlayer-1.6.18}/pyproject.toml +2 -1
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/brainbar-update.sh +4 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.maintenance.plist +2 -2
- {brainlayer-1.6.16 → brainlayer-1.6.18}/server.json +2 -2
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/__init__.py +1 -1
- brainlayer-1.6.18/src/brainlayer/_build.py +1 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/backup_daily.py +234 -14
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/backup_heavy_gate.py +78 -24
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/cli/__init__.py +4 -0
- brainlayer-1.6.18/src/brainlayer/cli_drive_archive.py +112 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/consolidation_plan.py +1 -1
- brainlayer-1.6.18/src/brainlayer/drive_archive.py +2320 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/maintenance_calendar.py +6 -1
- brainlayer-1.6.18/src/brainlayer/pipeline/__init__.py +60 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/secret_scrub.py +79 -2
- brainlayer-1.6.18/src/brainlayer/scrub_cli.py +311 -0
- brainlayer-1.6.16/src/brainlayer/_build.py +0 -1
- brainlayer-1.6.16/src/brainlayer/pipeline/__init__.py +0 -55
- {brainlayer-1.6.16 → brainlayer-1.6.18}/.gitignore +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/LICENSE +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/README.md +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/brainlayer-version-check.sh +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/hotlane_brainbar_daemon.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/backup-daily.sh +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/brainlayer-env-run.sh +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/brainlayer.env.example +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.backup-daily.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.daemon.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.decay.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.drain.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.health-check.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.hotlane-brainbar.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.index.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.jsonl-backup.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.log-cap.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.maintenance-nightly.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.maintenance-weekly.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.observability.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.p0-counter.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.repair-fts.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.t3-audit.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.t3-ingest.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.throughput-watchdog.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.tier0-watchdog.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.wal-checkpoint.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.brainlayer.watch.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/com.etanhey.brainlayer-fleet-watchdog.plist +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/fleet-watchdog.sh +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/install.sh +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/jsonl-backup.sh +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/launchd/throughput-watchdog.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/release-verify-signatures.sh +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/scripts/tier0-watchdog.sh +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/__main__.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/_helpers.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/agent_census.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/agent_profiles.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/agent_provenance.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/agy_attribution.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/alarm.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/archive_collapse.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/archive_lifecycle.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/backup_clone.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/backup_retention.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/backup_retention_invariant.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/backup_retention_observation.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/backup_sleep.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/badge_state.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/bitemporal.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/brainbar_activation.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/brainbar_auto_activation.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/brainbar_hybrid_helper.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/brainbar_identity.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/cachedelete_purge.swift +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/calibrate.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/chunk_origin.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/chunk_origin_backfill.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/chunk_origin_wipe.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/chunk_write.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/classify.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/claude_paths.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/cli/wizard.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/cli_jobs.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/cli_new.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/cloud_backfill.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/clustering.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/codex_zst.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/component_jobs.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/config.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/content_class.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/content_hash_repair.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/correction_judge.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/data/agents_registry.yaml +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/data/sandbox_seeds/skill-eval-baseline.json +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/db_shrink.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/decay.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/decay_backfill.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/decay_job.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/dedupe.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/dedupe_merge.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/deploy_drift.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/disk_space.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/doctor.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/drain.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/drain_liveness.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/drive_credentials.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/embeddings.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/engine.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/enrichment_replay.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/__init__.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/abcde_enrich_runner.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/abcde_variants.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/abcde_variants.yaml +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/benchmark.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/enrichment_gold.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/enrichment_graders.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/enrichment_judge.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/enrichment_llm_judge.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/enrichment_quality_benchmark.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/experiment_store.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/fixtures/README.md +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/labeling/enrichment-labeler.html +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/phoenix_gate/__init__.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/phoenix_gate/__main__.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/phoenix_gate/baseline_store.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/phoenix_gate/cli.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/phoenix_gate/models.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/phoenix_gate/phoenix_client.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/phoenix_gate/regression_gate.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/phoenix_gate/triggers.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/eval/pilot_artifact_report.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/fallback_replay.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/git_learning.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/health_check.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/health_facts.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/health_verdict.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/hook_python.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/hooks/__init__.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/hooks/indexer.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/hotlane_budget.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/import_sweep.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/index_admission.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/index_budget.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/index_completeness.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/index_new.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/index_watchdog.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest/__init__.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest/codex.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest/codex_manifest.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest/t3.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest/t3_audit.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest/t3_bookmark.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest/t3_ownership.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest_denylist.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/ingest_guard.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/isolation_proof.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/job_alerts.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/job_lifecycle_health.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/jobs.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/jsonl_backup.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/kg/__init__.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/kg_cleanup.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/kg_judge.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/kg_promotion.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/kg_repo.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/kg_review_session.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/kg_session_finish.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/kg_session_harvest.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/launchd_consolidation.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/launchd_install.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/launchd_primitive.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/launchd_revert.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/launcher_policy_reconcile.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/lexical_defense.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/lexical_defense_dictionary.json +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/linkedin_import.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/log_cap.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/maintenance.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/maintenance_control.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/maintenance_upload_recovery.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/__init__.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/_format.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/_shared.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/enrich_handler.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/entity_handler.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/palette.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/search_handler.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/store_handler.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp/tags_handler.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp_socket_config.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/mcp_stdio_bridge.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/memory_types.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/migrate.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/migration_custody.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/migration_journal.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/migration_runtime.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/notification_policy.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/observability_backup.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/observability_indexes.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/observability_surface.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/observability_transport.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/p0_longitudinal_count.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/parent_death.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/paths.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pause.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/phonetic.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/agent_enrichment.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/analyze_communication.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/batch_extraction.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/brain_graph.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/chat_tags.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/chunk.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/classify.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/cloud_scrub.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/cluster_sampling.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/code_intelligence.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/correction_detection.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/correction_mining.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/digest.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/enrichment_prompts.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/enrichment_results.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/enrichment_tiers.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/entity_extraction.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/entity_resolution.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/extract.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/extract_claude_desktop.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/extract_corrections.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/extract_markdown.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/extract_whatsapp.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/frustration_mining.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/git_overlay.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/kg_extraction.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/kg_extraction_groq.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/longitudinal_analyzer.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/obsidian_export.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/operation_grouping.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/plan_linking.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/rate_limiter.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/relation_backfill.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/relation_verification.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/sanitize.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/semantic_style.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/sentiment.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/session_history.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/style_embed.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/style_index.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/tag_entity_promotion.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/temporal_chains.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/time_batcher.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/unified_timeline.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/pipeline/write_queue.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/policy_reconcile.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/provenance.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/provenance_autosupersede.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/provenance_integration.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/queue_io.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/queue_merge.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/queued_messages.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/readonly_snapshot.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/reembed_backfill.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/retired_services.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/runtime_store.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/sandbox_db.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/schema_ddl_ledger.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/scoping.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/script_copy_refresh.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/scrub_at_rest.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/search_fanout.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/search_profile.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/search_repo.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/search_response.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/service_supervisor.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/session_repo.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/setup.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/socket_hygiene.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/source_class_migration.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/source_visibility.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/spotlight.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/storage.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/store.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/supervisor_adapters.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/supervisor_child.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/supervisor_diagnostics.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/supervisor_guard.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/supervisor_jobs.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/system_prompt_guard.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/t3_linkage_alarm.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/t3_provenance.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/t3_sources.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/t3_thread_tables.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/tag_normalization.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/taxonomy.json +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/telemetry.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/timestamp_iso.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/types.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/vector_store.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/wal_checkpoint.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/watcher.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/watcher_bridge.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/writer_policy.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/writer_telemetry.py +0 -0
- {brainlayer-1.6.16 → brainlayer-1.6.18}/src/brainlayer/zstd_stream.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: brainlayer
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.18
|
|
4
4
|
Summary: Persistent local memory for AI agents — 16 BrainBar MCP tools, semantic search, knowledge graph, SQLite
|
|
5
5
|
Project-URL: Homepage, https://brainlayer.etanheyman.com
|
|
6
6
|
Project-URL: Repository, https://github.com/EtanHey/brainlayer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "brainlayer"
|
|
3
|
-
version = "1.6.
|
|
3
|
+
version = "1.6.18"
|
|
4
4
|
description = "Persistent local memory for AI agents — 16 BrainBar MCP tools, semantic search, knowledge graph, SQLite"
|
|
5
5
|
license = {text = "Apache-2.0"}
|
|
6
6
|
readme = "README.md"
|
|
@@ -99,6 +99,7 @@ Issues = "https://github.com/EtanHey/brainlayer/issues"
|
|
|
99
99
|
|
|
100
100
|
[project.scripts]
|
|
101
101
|
brainlayer = "brainlayer.cli:app"
|
|
102
|
+
brainlayer-scrub = "brainlayer.scrub_cli:main"
|
|
102
103
|
brainlayer-mcp-stdio-bridge = "brainlayer.mcp_stdio_bridge:main"
|
|
103
104
|
|
|
104
105
|
[build-system]
|
|
@@ -320,6 +320,10 @@ state "$STEP"
|
|
|
320
320
|
[ "$("$PLIST" -c 'Print :CFBundleShortVersionString' "$APP/Contents/Info.plist")" = "$V" ]
|
|
321
321
|
# activate --verify above performs the real MCP handshake, not a socket-presence test.
|
|
322
322
|
state success
|
|
323
|
+
# LaunchServices can discover the moved bundle even under Backups.noindex.
|
|
324
|
+
# Keep the rollback bundle and remove only its registration after success.
|
|
325
|
+
LSREGISTER=${BRAINBAR_LSREGISTER:-/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister}
|
|
326
|
+
"$LSREGISTER" -u "$BACKUP" || echo "Could not unregister $BACKUP from LaunchServices" >&2
|
|
323
327
|
# Prune only a backup explicitly recorded by a previous successful invocation.
|
|
324
328
|
if [ -f "$ROOT/last-backup" ]; then
|
|
325
329
|
previous_backup=$(cat "$ROOT/last-backup")
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.etanhey/brainlayer",
|
|
4
4
|
"title": "BrainLayer",
|
|
5
5
|
"description": "Persistent local memory for AI agents \u2014 semantic search, knowledge graph, and 16 BrainBar MCP tools with ToolAnnotations over SQLite.",
|
|
6
|
-
"version": "1.6.
|
|
6
|
+
"version": "1.6.18",
|
|
7
7
|
"websiteUrl": "https://brainlayer.etanheyman.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/EtanHey/brainlayer",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"registryType": "pypi",
|
|
15
15
|
"registryBaseUrl": "https://pypi.org",
|
|
16
16
|
"identifier": "brainlayer",
|
|
17
|
-
"version": "1.6.
|
|
17
|
+
"version": "1.6.18",
|
|
18
18
|
"runtimeHint": "pipx",
|
|
19
19
|
"transport": {
|
|
20
20
|
"type": "stdio"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
__version__ = "1.6.
|
|
5
|
+
__version__ = "1.6.18"
|
|
6
6
|
# Git sha the distributed package was built from; stamped by the release build, None in a source tree.
|
|
7
7
|
# scripts/sprint_gate.py reads it in "keg" mode to prove the served package is the code under test.
|
|
8
8
|
# No runtime `str | None` annotation: launchd/install.sh imports this under /usr/bin/python3 (3.9).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BUILD_SHA = "ac61f8fe28322b3857e0372c9e1270aaedbe77b9"
|
|
@@ -3581,7 +3581,22 @@ def _recent_verified_backup_for_reuse(
|
|
|
3581
3581
|
return None
|
|
3582
3582
|
|
|
3583
3583
|
|
|
3584
|
-
def
|
|
3584
|
+
def _file_proof_identity(info: os.stat_result) -> tuple[int, ...]:
|
|
3585
|
+
return info.st_dev, info.st_ino, info.st_size, info.st_mtime_ns, info.st_ctime_ns
|
|
3586
|
+
|
|
3587
|
+
|
|
3588
|
+
@functools.lru_cache(maxsize=128)
|
|
3589
|
+
def _rotation_upload_identity(path: Path, identity: tuple[int, ...]) -> dict[str, Any]:
|
|
3590
|
+
"""Memoize only unchanged bytes across this process's admission retries."""
|
|
3591
|
+
if _file_proof_identity(path.lstat()) != identity:
|
|
3592
|
+
raise OSError("Local snapshot changed before hash")
|
|
3593
|
+
artifact = _upload_identity(path)
|
|
3594
|
+
if _file_proof_identity(path.lstat()) != identity:
|
|
3595
|
+
raise OSError("Local snapshot changed during hash")
|
|
3596
|
+
return artifact
|
|
3597
|
+
|
|
3598
|
+
|
|
3599
|
+
def _local_snapshot_intact(receipt: Mapping[str, Any], *, cache_identity: bool = False) -> bool:
|
|
3585
3600
|
"""The durable #1387 proof is bound to these exact bytes, not a dated filename."""
|
|
3586
3601
|
try:
|
|
3587
3602
|
path = Path(receipt["snapshot"])
|
|
@@ -3594,7 +3609,12 @@ def _local_snapshot_intact(receipt: Mapping[str, Any]) -> bool:
|
|
|
3594
3609
|
# Cheap disproof first: a missing record or a size change can never equal the hash (#1385).
|
|
3595
3610
|
and isinstance(artifact, dict)
|
|
3596
3611
|
and artifact.get("size") == path.stat().st_size
|
|
3597
|
-
and artifact
|
|
3612
|
+
and artifact
|
|
3613
|
+
== (
|
|
3614
|
+
_rotation_upload_identity(path, _file_proof_identity(path.lstat()))
|
|
3615
|
+
if cache_identity
|
|
3616
|
+
else _upload_identity(path)
|
|
3617
|
+
)
|
|
3598
3618
|
)
|
|
3599
3619
|
except (OSError, KeyError, TypeError, ValueError):
|
|
3600
3620
|
return False
|
|
@@ -3697,6 +3717,103 @@ def _local_retention_deferred(context: Mapping[str, Any], error: Exception) -> N
|
|
|
3697
3717
|
context["retention_alert_error"] = _redact_upload_secrets(str(exc))
|
|
3698
3718
|
|
|
3699
3719
|
|
|
3720
|
+
def _early_rotation_local_candidate(receipt: Mapping[str, Any], context: Mapping[str, Any], staging: Path) -> bool:
|
|
3721
|
+
"""Cheap necessary conditions; the sweep still proves the current bytes."""
|
|
3722
|
+
path = Path(receipt["snapshot"])
|
|
3723
|
+
artifact = receipt.get("local_artifact")
|
|
3724
|
+
return (
|
|
3725
|
+
all(receipt.get(k) == context.get(k) for k in ("db", "machine_id", "drive_folder", "backup_log_provenance"))
|
|
3726
|
+
and path.parent.resolve() == staging.resolve()
|
|
3727
|
+
and _parse_snapshot_date(path.name) is not None
|
|
3728
|
+
and path.name == f"{path.name[:10]}{_snapshot_suffix(path.name)}"
|
|
3729
|
+
and receipt.get("local_integrity") == "ok"
|
|
3730
|
+
and receipt.get("local_integrity_pragma") == "integrity_check"
|
|
3731
|
+
and not receipt.get("verification_error")
|
|
3732
|
+
and receipt.get("drive_md5_match") is not False
|
|
3733
|
+
and receipt.get("local_removed") is not True
|
|
3734
|
+
and receipt.get("upload_state") not in {"abandoned", "superseded"}
|
|
3735
|
+
and not (receipt.get("uploaded") is True and receipt.get("verified") is not True)
|
|
3736
|
+
and receipt.get("local_verified") is True
|
|
3737
|
+
and not path.is_symlink()
|
|
3738
|
+
and path.is_file()
|
|
3739
|
+
and path.stat().st_nlink == 1
|
|
3740
|
+
and isinstance(artifact, dict)
|
|
3741
|
+
and artifact.get("size") == path.stat().st_size
|
|
3742
|
+
)
|
|
3743
|
+
|
|
3744
|
+
|
|
3745
|
+
def _archive_rotation_reclaimable(staging: Path) -> int:
|
|
3746
|
+
"""Receipt-only upper bound: no listing or payload hash when rotation cannot admit.
|
|
3747
|
+
|
|
3748
|
+
A fresh listing and current hashes remain mandatory before any deletion. This
|
|
3749
|
+
optimistic bound can overestimate reclaim (APFS sharing or missing live proof),
|
|
3750
|
+
so admission must always remeasure after the sweep.
|
|
3751
|
+
"""
|
|
3752
|
+
from .backup_retention import local_keep_names
|
|
3753
|
+
|
|
3754
|
+
if not staging.is_dir() or staging.is_symlink():
|
|
3755
|
+
return 0
|
|
3756
|
+
log = _backup_log_path(None, db_path=get_db_path())
|
|
3757
|
+
if not log.exists():
|
|
3758
|
+
return 0
|
|
3759
|
+
protected, pin_reason = _weekly_pin_protection(staging)
|
|
3760
|
+
if pin_reason == "pin_unreadable":
|
|
3761
|
+
return 0
|
|
3762
|
+
try:
|
|
3763
|
+
machine = resolve_machine_id()
|
|
3764
|
+
except InvalidMachineIdError:
|
|
3765
|
+
return 0 # An unidentifiable machine cannot authorize reclaim; report the real disk shortfall.
|
|
3766
|
+
context = dict(
|
|
3767
|
+
db=str(get_db_path()),
|
|
3768
|
+
machine_id=machine,
|
|
3769
|
+
drive_folder="/".join(default_drive_folder_parts(machine)),
|
|
3770
|
+
backup_log_provenance=_backup_log_provenance(),
|
|
3771
|
+
)
|
|
3772
|
+
try:
|
|
3773
|
+
receipts = _read_backup_receipts(log, strict=True)
|
|
3774
|
+
except ValueError:
|
|
3775
|
+
return 0 # An unreadable retention journal cannot authorize reclaim.
|
|
3776
|
+
latest = {
|
|
3777
|
+
r["snapshot"]: r for r in receipts if r.get("event") != "local_sweep" and isinstance(r.get("snapshot"), str)
|
|
3778
|
+
}
|
|
3779
|
+
verified = {}
|
|
3780
|
+
cohort = set()
|
|
3781
|
+
for receipt in latest.values():
|
|
3782
|
+
path = Path(receipt["snapshot"])
|
|
3783
|
+
if _early_rotation_local_candidate(receipt, context, staging):
|
|
3784
|
+
cohort.add(path.name)
|
|
3785
|
+
drive = receipt.get("drive_file")
|
|
3786
|
+
if (
|
|
3787
|
+
receipt.get("db") == context["db"]
|
|
3788
|
+
and path.parent.resolve() == staging.resolve()
|
|
3789
|
+
and not path.is_symlink()
|
|
3790
|
+
and path.is_file()
|
|
3791
|
+
and receipt.get("uploaded") is True
|
|
3792
|
+
and receipt.get("verified") is True
|
|
3793
|
+
and _archive_drive_md5_matches(receipt)
|
|
3794
|
+
and isinstance(drive, dict)
|
|
3795
|
+
and isinstance(drive.get("id"), str)
|
|
3796
|
+
and drive.get("name") == path.name
|
|
3797
|
+
and str(drive.get("size")) == str(path.stat().st_size)
|
|
3798
|
+
):
|
|
3799
|
+
verified[path.name] = path
|
|
3800
|
+
cohort.add(path.name)
|
|
3801
|
+
keep = local_keep_names(cohort, cohort, keep_latest=_local_retention_keep())
|
|
3802
|
+
reclaimable = 0
|
|
3803
|
+
for name, path in verified.items():
|
|
3804
|
+
day = _parse_snapshot_date(name)
|
|
3805
|
+
if (
|
|
3806
|
+
name not in keep
|
|
3807
|
+
and name not in protected
|
|
3808
|
+
and day is not None
|
|
3809
|
+
and day < local_backup_date()
|
|
3810
|
+
and name == f"{day.isoformat()}{_snapshot_suffix(name)}"
|
|
3811
|
+
and path.resolve() != Path(context["db"]).resolve()
|
|
3812
|
+
):
|
|
3813
|
+
reclaimable += path.lstat().st_blocks * 512
|
|
3814
|
+
return reclaimable
|
|
3815
|
+
|
|
3816
|
+
|
|
3700
3817
|
def _sweep_verified_local_archives(
|
|
3701
3818
|
log_path: Path,
|
|
3702
3819
|
staging_dir: Path,
|
|
@@ -3705,6 +3822,9 @@ def _sweep_verified_local_archives(
|
|
|
3705
3822
|
remove_local: bool,
|
|
3706
3823
|
live_files: list[Mapping[str, Any]] | None = None,
|
|
3707
3824
|
folder_id: str | None = None,
|
|
3825
|
+
before_upload: bool = False,
|
|
3826
|
+
minimum_reclaim_bytes: int = 0,
|
|
3827
|
+
failed_proofs: set[tuple] | None = None,
|
|
3708
3828
|
) -> list[str]:
|
|
3709
3829
|
"""Local-only cleanup requires this same snapshot live in a fresh Drive listing."""
|
|
3710
3830
|
if live_files is None or folder_id is None or not isinstance(context.get("machine_id"), str):
|
|
@@ -3752,11 +3872,21 @@ def _sweep_verified_local_archives(
|
|
|
3752
3872
|
and r["drive_file"].get("name") == Path(r["snapshot"]).name
|
|
3753
3873
|
and str(r["drive_file"].get("size")) == str(Path(r["snapshot"]).stat().st_size)
|
|
3754
3874
|
}
|
|
3755
|
-
|
|
3875
|
+
cohort = set(verified_names)
|
|
3876
|
+
if before_upload:
|
|
3877
|
+
# Only intact, integrity-checked local bytes can replace a retained slot.
|
|
3878
|
+
# They never authorize deletion of an archive without its own live Drive proof.
|
|
3879
|
+
for receipt in latest.values():
|
|
3880
|
+
path = Path(receipt["snapshot"])
|
|
3881
|
+
if _early_rotation_local_candidate(receipt, context, staging_dir) and _local_snapshot_intact(
|
|
3882
|
+
receipt, cache_identity=True
|
|
3883
|
+
):
|
|
3884
|
+
cohort.add(path.name)
|
|
3885
|
+
keep = local_keep_names(cohort, cohort, keep_latest=_local_retention_keep())
|
|
3756
3886
|
except (ValueError, OSError, subprocess.SubprocessError) as exc:
|
|
3757
3887
|
_local_retention_deferred(context, exc)
|
|
3758
3888
|
return []
|
|
3759
|
-
|
|
3889
|
+
planned: list[tuple[Path, str | None, os.stat_result | None]] = []
|
|
3760
3890
|
for receipt in latest.values():
|
|
3761
3891
|
path = Path(receipt["snapshot"])
|
|
3762
3892
|
day = _parse_snapshot_date(path.name)
|
|
@@ -3794,27 +3924,49 @@ def _sweep_verified_local_archives(
|
|
|
3794
3924
|
if path.name in keep
|
|
3795
3925
|
else None
|
|
3796
3926
|
)
|
|
3927
|
+
before_hash = None
|
|
3797
3928
|
if reason is None:
|
|
3798
3929
|
try:
|
|
3799
3930
|
before_hash = path.stat(follow_symlinks=False)
|
|
3800
|
-
|
|
3931
|
+
proof_key = ("archive_rotation", str(path), *_file_proof_identity(before_hash))
|
|
3932
|
+
if failed_proofs is not None and proof_key in failed_proofs:
|
|
3933
|
+
reason = "proof_previously_failed"
|
|
3934
|
+
elif _md5_file(path) != drive["md5Checksum"]:
|
|
3801
3935
|
reason = "md5_current_mismatch"
|
|
3802
3936
|
else:
|
|
3803
3937
|
after_hash = path.stat(follow_symlinks=False)
|
|
3804
3938
|
|
|
3805
|
-
|
|
3806
|
-
return st.st_dev, st.st_ino, st.st_size, st.st_mtime_ns, st.st_ctime_ns
|
|
3807
|
-
|
|
3808
|
-
if identity(before_hash) != identity(after_hash):
|
|
3939
|
+
if _file_proof_identity(before_hash) != _file_proof_identity(after_hash):
|
|
3809
3940
|
reason = "local_identity_changed"
|
|
3810
|
-
|
|
3811
|
-
|
|
3941
|
+
if reason is not None and failed_proofs is not None:
|
|
3942
|
+
failed_proofs.add(proof_key)
|
|
3812
3943
|
except OSError as exc:
|
|
3813
3944
|
print(f"Cannot delete local archive {path}: {exc}", flush=True)
|
|
3814
3945
|
reason = "delete_failed"
|
|
3815
|
-
|
|
3816
|
-
|
|
3946
|
+
planned.append((path, reason, before_hash))
|
|
3947
|
+
# The cheap admission estimate is optimistic. A missing live proof, changed
|
|
3948
|
+
# hash or narrower keep cohort must not cause a partial, futile rotation.
|
|
3949
|
+
reclaimable = sum(info.st_blocks * 512 for _, reason, info in planned if reason is None and info is not None)
|
|
3950
|
+
if reclaimable < minimum_reclaim_bytes:
|
|
3951
|
+
if failed_proofs is not None:
|
|
3952
|
+
failed_proofs.update(
|
|
3953
|
+
("archive_rotation", str(path), *_file_proof_identity(info))
|
|
3954
|
+
for path, reason, info in planned
|
|
3955
|
+
if reason is None and info is not None
|
|
3956
|
+
)
|
|
3957
|
+
return []
|
|
3958
|
+
removed = []
|
|
3959
|
+
for path, reason, info in planned:
|
|
3960
|
+
if reason is None:
|
|
3961
|
+
try:
|
|
3962
|
+
if info is None or _file_proof_identity(path.lstat()) != _file_proof_identity(info):
|
|
3963
|
+
reason = "local_identity_changed"
|
|
3964
|
+
else:
|
|
3965
|
+
path.unlink()
|
|
3817
3966
|
removed.append(path.name)
|
|
3967
|
+
except OSError as exc:
|
|
3968
|
+
print(f"Cannot delete local archive {path}: {exc}", flush=True)
|
|
3969
|
+
reason = "delete_failed"
|
|
3818
3970
|
# Local housekeeping cannot grant/revoke Drive verification or refresh last-backup status.
|
|
3819
3971
|
update = {
|
|
3820
3972
|
"event": "local_sweep",
|
|
@@ -3828,6 +3980,70 @@ def _sweep_verified_local_archives(
|
|
|
3828
3980
|
return removed
|
|
3829
3981
|
|
|
3830
3982
|
|
|
3983
|
+
def _rotate_verified_archives_before_upload(
|
|
3984
|
+
staging_dir: Path,
|
|
3985
|
+
*,
|
|
3986
|
+
minimum_reclaim_bytes: int = 0,
|
|
3987
|
+
deadline: float | None = None,
|
|
3988
|
+
failed_proofs: set[tuple] | None = None,
|
|
3989
|
+
) -> list[str]:
|
|
3990
|
+
"""Resolve only the current machine's existing Drive folder under staging custody."""
|
|
3991
|
+
from .backup_heavy_gate import BackupGateDeferred
|
|
3992
|
+
|
|
3993
|
+
def check_deadline():
|
|
3994
|
+
if deadline is not None and time.monotonic() >= deadline:
|
|
3995
|
+
raise BackupGateDeferred("backup deferred: admission deadline elapsed during Drive rotation")
|
|
3996
|
+
|
|
3997
|
+
if not staging_dir.is_dir() or staging_dir.is_symlink():
|
|
3998
|
+
return []
|
|
3999
|
+
fd = os.open(staging_dir / ".backup.lock", os.O_CREAT | os.O_RDWR | os.O_NOFOLLOW, 0o600)
|
|
4000
|
+
context: dict[str, Any] = {"db": str(get_db_path())}
|
|
4001
|
+
try:
|
|
4002
|
+
try:
|
|
4003
|
+
fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
4004
|
+
except BlockingIOError:
|
|
4005
|
+
return []
|
|
4006
|
+
machine = resolve_machine_id()
|
|
4007
|
+
parts = default_drive_folder_parts(machine)
|
|
4008
|
+
context.update(machine_id=machine, drive_folder="/".join(parts), backup_log_provenance=_backup_log_provenance())
|
|
4009
|
+
log = _backup_log_path(None, db_path=get_db_path())
|
|
4010
|
+
if not log.exists():
|
|
4011
|
+
return []
|
|
4012
|
+
# Validate local policy and the journal before any network request.
|
|
4013
|
+
_local_retention_keep()
|
|
4014
|
+
_read_backup_receipts(log, strict=True)
|
|
4015
|
+
if _weekly_pin_protection(staging_dir)[1] == "pin_unreadable":
|
|
4016
|
+
raise ValueError("Cannot read weekly pin; retaining all local archives")
|
|
4017
|
+
check_deadline()
|
|
4018
|
+
service = build_drive_service()
|
|
4019
|
+
check_deadline()
|
|
4020
|
+
folders = _find_drive_folder_ids(service, parts)
|
|
4021
|
+
check_deadline()
|
|
4022
|
+
if len(folders) != 1:
|
|
4023
|
+
raise ValueError("Cannot establish one existing machine backup folder")
|
|
4024
|
+
live = _list_drive_backup_files(service, folders[0])
|
|
4025
|
+
check_deadline()
|
|
4026
|
+
_assert_backup_owners(live, folder_id=folders[0], machine_id=machine)
|
|
4027
|
+
return _sweep_verified_local_archives(
|
|
4028
|
+
log,
|
|
4029
|
+
staging_dir,
|
|
4030
|
+
context,
|
|
4031
|
+
remove_local=True,
|
|
4032
|
+
live_files=live,
|
|
4033
|
+
folder_id=folders[0],
|
|
4034
|
+
before_upload=True,
|
|
4035
|
+
minimum_reclaim_bytes=minimum_reclaim_bytes,
|
|
4036
|
+
failed_proofs=failed_proofs,
|
|
4037
|
+
)
|
|
4038
|
+
except (BackupStoppedError, BackupTimeoutError, BackupGateDeferred):
|
|
4039
|
+
raise
|
|
4040
|
+
except Exception as exc:
|
|
4041
|
+
_local_retention_deferred(context, exc)
|
|
4042
|
+
return []
|
|
4043
|
+
finally:
|
|
4044
|
+
os.close(fd)
|
|
4045
|
+
|
|
4046
|
+
|
|
3831
4047
|
def _reclaim_superseded_local(log_path: Path, result: dict[str, Any], staging_dir: Path) -> None:
|
|
3832
4048
|
"""Close an abandoned upload's alert after new proof, retaining its local bytes."""
|
|
3833
4049
|
if result.get("uploaded") is not True or result.get("verified") is not True:
|
|
@@ -3946,6 +4162,10 @@ def _serialized_backup_run(func: Callable[..., dict[str, Any]]) -> Callable[...,
|
|
|
3946
4162
|
time.sleep(min(0.05, remaining))
|
|
3947
4163
|
except BlockingIOError as exc:
|
|
3948
4164
|
error = f"backup already running in {staging_dir}"
|
|
4165
|
+
if bound.arguments.get("phase", "all") == "upload":
|
|
4166
|
+
from .backup_heavy_gate import BackupGateDeferred
|
|
4167
|
+
|
|
4168
|
+
raise BackupGateDeferred(f"backup upload deferred: staging busy in {staging_dir}") from exc
|
|
3949
4169
|
resolved_db_path = bound.arguments.get("db_path") or get_db_path()
|
|
3950
4170
|
_append_json_log(
|
|
3951
4171
|
_backup_log_path(bound.arguments.get("log_path"), db_path=resolved_db_path),
|
|
@@ -5221,7 +5441,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
5221
5441
|
except Exception:
|
|
5222
5442
|
report(key, "Database backup failed; check the backup log")
|
|
5223
5443
|
raise
|
|
5224
|
-
if code != BACKUP_DEFERRED_EXIT_CODE
|
|
5444
|
+
if code != BACKUP_DEFERRED_EXIT_CODE: # A child's admission deferral is not a failure.
|
|
5225
5445
|
report(key, None if code == 0 else "Database backup failed; check the backup log")
|
|
5226
5446
|
return code
|
|
5227
5447
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import fcntl
|
|
5
6
|
import math
|
|
6
7
|
import os
|
|
7
8
|
import re
|
|
@@ -70,7 +71,7 @@ def _pressure_reason(swap_limit: float, load_limit: float) -> str | None:
|
|
|
70
71
|
return None
|
|
71
72
|
|
|
72
73
|
|
|
73
|
-
def _disk_reason(host: str, failed_proofs: set[tuple] | None = None) -> str | None:
|
|
74
|
+
def _disk_reason(host: str, failed_proofs: set[tuple] | None = None, *, deadline: float | None = None) -> str | None:
|
|
74
75
|
"""Measure first; prove and reclaim dated raws only when that could admit, then measure again.
|
|
75
76
|
|
|
76
77
|
`failed_proofs` is the gate's per-process memo of raw/archive identities whose proof failed,
|
|
@@ -104,28 +105,50 @@ def _disk_reason(host: str, failed_proofs: set[tuple] | None = None) -> str | No
|
|
|
104
105
|
while not volume_path.exists():
|
|
105
106
|
volume_path = volume_path.parent
|
|
106
107
|
|
|
107
|
-
def measure() -> tuple[list[tuple[Path, int]], int, int]:
|
|
108
|
+
def measure() -> tuple[list[tuple[Path, int]], int, int, int, int]:
|
|
108
109
|
reserves = backup._clone_growth_reserves(staging, 0)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
allocation = peak + sum(size for _, size in reserves)
|
|
111
|
+
required = allocation + math.ceil(floor_gib * 1024**3)
|
|
112
|
+
space = backup.disk_space.measure_disk_space(volume_path, include_available=sys.platform == "darwin")
|
|
113
|
+
free = space.free_now_bytes
|
|
114
|
+
available = space.available_bytes if sys.platform == "darwin" else free
|
|
115
|
+
raw_required = allocation if sys.platform == "darwin" else 0
|
|
116
|
+
return reserves, required, raw_required, free, available
|
|
117
|
+
|
|
118
|
+
reserves, required, raw_required, free, available = measure()
|
|
119
|
+
if available < required or free < raw_required:
|
|
115
120
|
# Upper bound of what reclaiming the dated raws can return: each raw's COW reserve plus
|
|
116
121
|
# its allocated blocks (a byte copy frees them; a clone shares them and frees less).
|
|
117
122
|
reclaimable = sum(size + path.lstat().st_blocks * 512 for path, size in reserves if path.parent == staging)
|
|
118
|
-
if
|
|
119
|
-
|
|
123
|
+
if (
|
|
124
|
+
available + reclaimable >= required
|
|
125
|
+
and free + reclaimable >= raw_required
|
|
126
|
+
and backup._reclaim_verified_raws_before_admission(staging, failed_proofs)
|
|
127
|
+
):
|
|
128
|
+
reserves, required, raw_required, free, available = measure()
|
|
129
|
+
if phase == "upload" and (available < required or free < raw_required):
|
|
130
|
+
reclaimable = backup._archive_rotation_reclaimable(staging)
|
|
131
|
+
if (
|
|
132
|
+
available + reclaimable >= required
|
|
133
|
+
and free + reclaimable >= raw_required
|
|
134
|
+
and backup._rotate_verified_archives_before_upload(
|
|
135
|
+
staging,
|
|
136
|
+
minimum_reclaim_bytes=max(required - available, raw_required - free),
|
|
137
|
+
deadline=deadline,
|
|
138
|
+
failed_proofs=failed_proofs,
|
|
139
|
+
)
|
|
120
140
|
):
|
|
121
|
-
reserves, required, free = measure()
|
|
141
|
+
reserves, required, raw_required, free, available = measure()
|
|
142
|
+
except (BackupGateDeferred, backup.BackupTimeoutError):
|
|
143
|
+
raise
|
|
122
144
|
except (OSError, RuntimeError, ValueError) as exc:
|
|
123
145
|
return f"disk space measurement unavailable: {type(exc).__name__}"
|
|
124
|
-
if free <
|
|
146
|
+
if available < required or free < raw_required:
|
|
125
147
|
reserved = ", ".join(f"{path.relative_to(staging)}={size / 1024**3:.3f} GiB" for path, size in reserves)
|
|
126
148
|
return (
|
|
127
|
-
f"disk space needs {required / 1024**3:.3f} GiB, has {
|
|
128
|
-
f"
|
|
149
|
+
f"disk space needs {required / 1024**3:.3f} GiB, has {available / 1024**3:.3f} GiB available; "
|
|
150
|
+
f"free-now {free / 1024**3:.3f} GiB (raw needs {raw_required / 1024**3:.3f} GiB); "
|
|
151
|
+
f"peak plus {floor_gib:g} GiB host floor" + (f"; retained COW reserves: {reserved}" if reserved else "")
|
|
129
152
|
)
|
|
130
153
|
return None
|
|
131
154
|
|
|
@@ -165,6 +188,26 @@ def _upload_peak_bytes(staging: Path, *, full: bool) -> int:
|
|
|
165
188
|
return max(extra, default=0) + backup.MIN_RAW_FREE_BYTES + backup.COPY_CHUNK_BYTES
|
|
166
189
|
|
|
167
190
|
|
|
191
|
+
def _upload_staging_reason() -> str | None:
|
|
192
|
+
"""Probe staging custody without launching a child that would fail and alert."""
|
|
193
|
+
from . import backup_daily as backup
|
|
194
|
+
|
|
195
|
+
staging = Path(os.environ.get("BRAINLAYER_BACKUP_STAGING_DIR", str(backup.DEFAULT_STAGING_DIR))).expanduser()
|
|
196
|
+
try:
|
|
197
|
+
if not staging.exists():
|
|
198
|
+
return None
|
|
199
|
+
fd = os.open(staging / ".backup.lock", os.O_CREAT | os.O_RDWR | os.O_NOFOLLOW, 0o600)
|
|
200
|
+
try:
|
|
201
|
+
fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
202
|
+
finally:
|
|
203
|
+
os.close(fd)
|
|
204
|
+
except BlockingIOError:
|
|
205
|
+
return "staging busy"
|
|
206
|
+
except OSError as exc:
|
|
207
|
+
return f"staging lock unavailable: {type(exc).__name__}"
|
|
208
|
+
return None
|
|
209
|
+
|
|
210
|
+
|
|
168
211
|
def expected_phase_seconds() -> float:
|
|
169
212
|
phase = os.environ.get("BRAINLAYER_BACKUP_PHASE", "all")
|
|
170
213
|
defaults = {"snapshot": 2400, "upload": 1800, "all": 4200}
|
|
@@ -272,12 +315,21 @@ def backup_heavy_gate(*, deadline: float | None = None, job_key: str = "backup-d
|
|
|
272
315
|
host = _host()
|
|
273
316
|
except (ValueError, OSError, subprocess.SubprocessError) as exc:
|
|
274
317
|
raise BackupGateDeferred(f"backup heavy-work gate host detection failed: {type(exc).__name__}") from exc
|
|
275
|
-
|
|
276
|
-
|
|
318
|
+
upload = os.environ.get("BRAINLAYER_BACKUP_PHASE", "all") == "upload"
|
|
319
|
+
lock = (
|
|
320
|
+
Path(os.environ.get("BRAINLAYER_BACKUP_UPLOAD_LOCK_PATH", str(Path.home() / ".brainlayer-backup-upload.lock")))
|
|
321
|
+
if upload
|
|
322
|
+
else Path(os.environ.get("BRAINLAYER_BACKUP_HEAVY_LOCK_PATH", str(Path.home() / f".{host}-heavy.lock")))
|
|
323
|
+
)
|
|
324
|
+
log = (
|
|
325
|
+
Path(os.environ.get("BRAINLAYER_BACKUP_UPLOAD_LOG_PATH", str(lock.with_suffix(".log"))))
|
|
326
|
+
if upload
|
|
327
|
+
else Path(os.environ.get("BRAINLAYER_BACKUP_HEAVY_LOG_PATH", str(Path.home() / f".{host}-heavy.log")))
|
|
328
|
+
)
|
|
277
329
|
window = _number("WINDOW_SECONDS", 6 * 3600)
|
|
278
330
|
retry = _number("RETRY_SECONDS", 600)
|
|
279
|
-
swap_limit = _number("SWAP_GIB", 9)
|
|
280
|
-
load_limit = _number("LOAD", 12)
|
|
331
|
+
swap_limit = _number("SWAP_GIB", 9) if not upload else 0
|
|
332
|
+
load_limit = _number("LOAD", 12) if not upload else 0
|
|
281
333
|
started = time.monotonic()
|
|
282
334
|
since = datetime.now().astimezone().isoformat(timespec="seconds")
|
|
283
335
|
pressure_window_end = started + window
|
|
@@ -288,7 +340,7 @@ def backup_heavy_gate(*, deadline: float | None = None, job_key: str = "backup-d
|
|
|
288
340
|
waited = False
|
|
289
341
|
previous = {}
|
|
290
342
|
failed_proofs: set[tuple] = set() # Raw/archive identities whose reclaim proof failed this gate run.
|
|
291
|
-
reservation = _M1Reservation(lock, job_key) if host == "m1" else None
|
|
343
|
+
reservation = _M1Reservation(lock, job_key) if host == "m1" and not upload else None
|
|
292
344
|
|
|
293
345
|
def stopped(signum, _frame):
|
|
294
346
|
raise SystemExit(128 + signum)
|
|
@@ -308,8 +360,9 @@ def backup_heavy_gate(*, deadline: float | None = None, job_key: str = "backup-d
|
|
|
308
360
|
reason = reservation.check() if reservation is not None else None
|
|
309
361
|
reason = (
|
|
310
362
|
reason
|
|
311
|
-
or (None if past_window else _pressure_reason(swap_limit, load_limit))
|
|
312
|
-
or _disk_reason(host, failed_proofs)
|
|
363
|
+
or (None if upload or past_window else _pressure_reason(swap_limit, load_limit))
|
|
364
|
+
or _disk_reason(host, failed_proofs, deadline=deadline)
|
|
365
|
+
or (_upload_staging_reason() if upload else None)
|
|
313
366
|
)
|
|
314
367
|
if reason is not None and reservation is not None:
|
|
315
368
|
reservation.release()
|
|
@@ -319,7 +372,7 @@ def backup_heavy_gate(*, deadline: float | None = None, job_key: str = "backup-d
|
|
|
319
372
|
try:
|
|
320
373
|
lock.mkdir()
|
|
321
374
|
except FileExistsError:
|
|
322
|
-
reason = "heavy lock held by another lane (never cleared by backup)"
|
|
375
|
+
reason = f"{'upload' if upload else 'heavy'} lock held by another lane (never cleared by backup)"
|
|
323
376
|
if reservation is not None:
|
|
324
377
|
reason = reservation.check(publish=True) or reason
|
|
325
378
|
else:
|
|
@@ -327,8 +380,9 @@ def backup_heavy_gate(*, deadline: float | None = None, job_key: str = "backup-d
|
|
|
327
380
|
reason = reservation.check() if reservation is not None else None
|
|
328
381
|
reason = (
|
|
329
382
|
reason
|
|
330
|
-
or (None if past_window else _pressure_reason(swap_limit, load_limit))
|
|
331
|
-
or _disk_reason(host, failed_proofs)
|
|
383
|
+
or (None if upload or past_window else _pressure_reason(swap_limit, load_limit))
|
|
384
|
+
or _disk_reason(host, failed_proofs, deadline=deadline)
|
|
385
|
+
or (_upload_staging_reason() if upload else None)
|
|
332
386
|
)
|
|
333
387
|
if reason is None and time.monotonic() < expires:
|
|
334
388
|
if reservation is not None:
|
|
@@ -58,6 +58,10 @@ from ..cli_jobs import register as register_jobs_commands
|
|
|
58
58
|
|
|
59
59
|
register_jobs_commands(app, jobs_app)
|
|
60
60
|
|
|
61
|
+
from ..cli_drive_archive import register as register_drive_archive_commands
|
|
62
|
+
|
|
63
|
+
register_drive_archive_commands(app)
|
|
64
|
+
|
|
61
65
|
|
|
62
66
|
@app.command("disk")
|
|
63
67
|
def disk_command(
|