brainlayer 1.5.89__tar.gz → 1.5.90__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.5.89 → brainlayer-1.5.90}/PKG-INFO +1 -1
- {brainlayer-1.5.89 → brainlayer-1.5.90}/pyproject.toml +1 -1
- {brainlayer-1.5.89 → brainlayer-1.5.90}/server.json +2 -2
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/__init__.py +1 -1
- brainlayer-1.5.90/src/brainlayer/_build.py +1 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/backup_daily.py +96 -33
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/drive_credentials.py +16 -7
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/service_supervisor.py +64 -7
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/supervisor_jobs.py +2 -3
- brainlayer-1.5.90/src/brainlayer/t3_linkage_alarm.py +156 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/t3_provenance.py +33 -10
- brainlayer-1.5.89/src/brainlayer/_build.py +0 -1
- brainlayer-1.5.89/src/brainlayer/t3_linkage_alarm.py +0 -110
- {brainlayer-1.5.89 → brainlayer-1.5.90}/.gitignore +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/LICENSE +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/README.md +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/hotlane_brainbar_daemon.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/backup-daily.sh +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/brainlayer-env-run.sh +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/brainlayer.env.example +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.backup-daily.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.daemon.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.decay.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.drain.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.health-check.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.hotlane-brainbar.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.index.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.jsonl-backup.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.log-cap.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.maintenance-nightly.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.maintenance-weekly.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.maintenance.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.observability.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.p0-counter.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.repair-fts.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.t3-ingest.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.throughput-watchdog.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.tier0-watchdog.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.wal-checkpoint.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.brainlayer.watch.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/com.etanhey.brainlayer-fleet-watchdog.plist +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/fleet-watchdog.sh +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/install.sh +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/jsonl-backup.sh +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/launchd/throughput-watchdog.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/release-verify-signatures.sh +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/scripts/tier0-watchdog.sh +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/__main__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/_helpers.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/agent_profiles.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/agent_provenance.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/alarm.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/archive_collapse.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/archive_lifecycle.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/backup_retention_invariant.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/badge_state.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/bitemporal.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/brainbar_activation.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/brainbar_auto_activation.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/brainbar_hybrid_helper.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/brainbar_identity.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/cachedelete_purge.swift +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/calibrate.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/chunk_origin.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/chunk_origin_backfill.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/chunk_origin_wipe.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/chunk_write.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/classify.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/claude_paths.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/cli/__init__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/cli/wizard.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/cli_jobs.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/cli_new.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/cloud_backfill.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/clustering.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/component_jobs.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/config.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/consolidation_plan.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/content_class.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/correction_judge.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/data/agents_registry.yaml +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/data/sandbox_seeds/skill-eval-baseline.json +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/db_shrink.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/decay.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/decay_backfill.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/decay_job.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/dedupe.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/dedupe_merge.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/deploy_drift.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/disk_space.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/doctor.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/drain.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/drain_liveness.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/embeddings.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/engine.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/enrichment_replay.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/__init__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/abcde_enrich_runner.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/abcde_variants.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/abcde_variants.yaml +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/benchmark.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/enrichment_gold.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/enrichment_graders.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/enrichment_judge.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/enrichment_llm_judge.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/enrichment_quality_benchmark.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/experiment_store.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/fixtures/README.md +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/labeling/enrichment-labeler.html +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/phoenix_gate/__init__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/phoenix_gate/__main__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/phoenix_gate/baseline_store.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/phoenix_gate/cli.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/phoenix_gate/models.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/phoenix_gate/phoenix_client.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/phoenix_gate/regression_gate.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/phoenix_gate/triggers.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/eval/pilot_artifact_report.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/fallback_replay.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/git_learning.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/health_check.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/health_facts.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/health_verdict.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/hook_python.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/hooks/__init__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/hooks/indexer.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/hotlane_budget.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/import_sweep.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/index_admission.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/index_budget.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/index_completeness.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/index_new.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/index_watchdog.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/ingest/__init__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/ingest/codex.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/ingest/t3.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/ingest_denylist.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/ingest_guard.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/isolation_proof.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/job_alerts.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/job_lifecycle_health.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/jobs.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/jsonl_backup.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/kg/__init__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/kg_cleanup.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/kg_judge.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/kg_promotion.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/kg_repo.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/kg_review_session.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/kg_session_finish.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/kg_session_harvest.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/launchd_consolidation.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/launchd_install.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/launchd_primitive.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/launchd_revert.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/launcher_policy_reconcile.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/lexical_defense.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/lexical_defense_dictionary.json +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/linkedin_import.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/log_cap.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/maintenance.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/maintenance_calendar.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/maintenance_control.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/__init__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/_format.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/_shared.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/enrich_handler.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/entity_handler.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/palette.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/search_handler.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/store_handler.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp/tags_handler.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp_socket_config.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/mcp_stdio_bridge.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/memory_types.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/migrate.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/migration_custody.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/migration_journal.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/migration_runtime.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/notification_policy.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/observability_backup.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/observability_surface.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/observability_transport.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/p0_longitudinal_count.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/parent_death.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/paths.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pause.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/phonetic.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/__init__.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/agent_enrichment.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/analyze_communication.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/batch_extraction.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/brain_graph.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/chat_tags.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/chunk.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/classify.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/cloud_scrub.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/cluster_sampling.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/code_intelligence.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/correction_detection.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/correction_mining.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/digest.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/enrichment_prompts.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/enrichment_results.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/enrichment_tiers.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/entity_extraction.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/entity_resolution.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/extract.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/extract_claude_desktop.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/extract_corrections.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/extract_markdown.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/extract_whatsapp.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/frustration_mining.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/git_overlay.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/kg_extraction.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/kg_extraction_groq.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/longitudinal_analyzer.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/obsidian_export.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/operation_grouping.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/plan_linking.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/rate_limiter.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/relation_backfill.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/relation_verification.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/sanitize.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/secret_scrub.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/semantic_style.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/sentiment.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/session_history.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/style_embed.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/style_index.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/tag_entity_promotion.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/temporal_chains.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/time_batcher.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/unified_timeline.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/pipeline/write_queue.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/policy_reconcile.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/provenance.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/provenance_autosupersede.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/provenance_integration.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/queue_io.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/queue_merge.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/readonly_snapshot.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/reembed_backfill.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/retired_services.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/runtime_store.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/sandbox_db.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/scoping.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/scrub_at_rest.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/search_fanout.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/search_profile.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/search_repo.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/session_repo.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/setup.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/socket_hygiene.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/source_class_migration.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/spotlight.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/storage.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/store.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/supervisor_adapters.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/supervisor_child.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/supervisor_diagnostics.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/supervisor_guard.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/system_prompt_guard.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/t3_sources.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/tag_normalization.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/taxonomy.json +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/telemetry.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/timestamp_iso.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/types.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/vector_store.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/wal_checkpoint.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/watcher.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/watcher_bridge.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/writer_policy.py +0 -0
- {brainlayer-1.5.89 → brainlayer-1.5.90}/src/brainlayer/writer_telemetry.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: brainlayer
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.90
|
|
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
|
|
@@ -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.5.
|
|
6
|
+
"version": "1.5.90",
|
|
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.5.
|
|
17
|
+
"version": "1.5.90",
|
|
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.5.
|
|
5
|
+
__version__ = "1.5.90"
|
|
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 = "2f87dc7e9646db5fea46235720efb5bacc2bb50a"
|
|
@@ -117,11 +117,12 @@ DEFAULT_BACKUP_TIMEOUT_SECONDS = 8 * 60 * 60
|
|
|
117
117
|
DEFAULT_BACKUP_ATTEMPT_MAX_AGE_SECONDS = 24 * 60 * 60
|
|
118
118
|
DEFAULT_BACKUP_SQLITE_CHECK_TIMEOUT_SECONDS = 0
|
|
119
119
|
# Two minutes tolerates ordinary request latency; the throughput term stretches
|
|
120
|
-
# the deadline for chunks
|
|
120
|
+
# the deadline for chunks at a conservative floor rate without allowing a
|
|
121
121
|
# zero-window connection to occupy the eight-hour backup budget.
|
|
122
122
|
DEFAULT_DRIVE_UPLOAD_DEADLINE_FLOOR_SECONDS = 120.0
|
|
123
|
-
DEFAULT_DRIVE_UPLOAD_MIN_BYTES_PER_SECOND =
|
|
123
|
+
DEFAULT_DRIVE_UPLOAD_MIN_BYTES_PER_SECOND = 32 * 1024
|
|
124
124
|
DEFAULT_DRIVE_UPLOAD_STALL_MAX_ATTEMPTS = 3
|
|
125
|
+
DRIVE_UPLOAD_PROGRESS_INTERVAL_SECONDS = 30.0
|
|
125
126
|
# DB snapshot compression. zstd -T0 -3 measured 2.5-3.7 GB/s at a 0.473 mean ratio on
|
|
126
127
|
# 2 GiB windows of the real 20.7 GB raw snapshot, against 24-99 MB/s and 0.491 for
|
|
127
128
|
# Python gzip -6 (bl-lead backup-rc124-measure.md section 4). gzip stays selectable
|
|
@@ -567,7 +568,11 @@ def _drive_upload_stall_max_attempts() -> int:
|
|
|
567
568
|
return int(value)
|
|
568
569
|
|
|
569
570
|
|
|
570
|
-
class
|
|
571
|
+
class _DriveUploadNeedsProbe(TimeoutError):
|
|
572
|
+
pass
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
class _DriveRequestDeadlineExceeded(_DriveUploadNeedsProbe):
|
|
571
576
|
pass
|
|
572
577
|
|
|
573
578
|
|
|
@@ -625,8 +630,10 @@ def _drive_put_with_deadline(
|
|
|
625
630
|
data: bytes,
|
|
626
631
|
deadline: float,
|
|
627
632
|
policy_callback: Callable[[dict[str, Any]], None] | None = None,
|
|
633
|
+
heartbeat_callback: Callable[[], None] | None = None,
|
|
628
634
|
):
|
|
629
635
|
outcome: queue.Queue[tuple[bool, Any]] = queue.Queue(maxsize=1)
|
|
636
|
+
expires = time.monotonic() + deadline
|
|
630
637
|
|
|
631
638
|
def perform() -> None:
|
|
632
639
|
try:
|
|
@@ -642,11 +649,17 @@ def _drive_put_with_deadline(
|
|
|
642
649
|
outcome.put((False, exc))
|
|
643
650
|
|
|
644
651
|
threading.Thread(target=perform, daemon=True, name="brainlayer-drive-put").start()
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
652
|
+
while True:
|
|
653
|
+
remaining = max(0, expires - time.monotonic())
|
|
654
|
+
try:
|
|
655
|
+
succeeded, value = outcome.get(timeout=min(remaining, DRIVE_UPLOAD_PROGRESS_INTERVAL_SECONDS))
|
|
656
|
+
break
|
|
657
|
+
except queue.Empty as exc:
|
|
658
|
+
if time.monotonic() >= expires:
|
|
659
|
+
session.close()
|
|
660
|
+
raise _DriveRequestDeadlineExceeded(f"Drive PUT exceeded {deadline:.3f}s total deadline") from exc
|
|
661
|
+
if heartbeat_callback is not None:
|
|
662
|
+
heartbeat_callback()
|
|
650
663
|
if succeeded:
|
|
651
664
|
return value
|
|
652
665
|
if isinstance(value, requests.Timeout):
|
|
@@ -2437,11 +2450,12 @@ def upload_file_to_drive_raw(
|
|
|
2437
2450
|
credentials: Any,
|
|
2438
2451
|
*,
|
|
2439
2452
|
machine_id: str,
|
|
2440
|
-
chunk_size: int =
|
|
2453
|
+
chunk_size: int = 64 * 1024 * 1024,
|
|
2441
2454
|
max_attempts: int = 30,
|
|
2442
2455
|
resume_session_url: str | None = None,
|
|
2443
2456
|
progress_callback: Callable[[str, int], None] | None = None,
|
|
2444
2457
|
policy_callback: Callable[[dict[str, Any]], None] | None = None,
|
|
2458
|
+
telemetry_callback: Callable[[dict[str, Any]], None] | None = None,
|
|
2445
2459
|
run_deadline: float | None = None,
|
|
2446
2460
|
) -> dict[str, Any]:
|
|
2447
2461
|
"""Upload unchanged bytes; probe ambiguous writes before retransmitting them."""
|
|
@@ -2476,6 +2490,26 @@ def upload_file_to_drive_raw(
|
|
|
2476
2490
|
probe = resume_session_url is not None
|
|
2477
2491
|
recovering = False
|
|
2478
2492
|
session = requests.Session()
|
|
2493
|
+
started = time.monotonic()
|
|
2494
|
+
rate_base = retries = probes = deadlines = requests_started = bytes_attempted = 0
|
|
2495
|
+
|
|
2496
|
+
def report_progress() -> None:
|
|
2497
|
+
elapsed = time.monotonic() - started
|
|
2498
|
+
if telemetry_callback is not None:
|
|
2499
|
+
telemetry_callback(
|
|
2500
|
+
{
|
|
2501
|
+
"upload_updated_at": dt.datetime.now(dt.UTC).isoformat(),
|
|
2502
|
+
"upload_elapsed_seconds": round(elapsed, 3),
|
|
2503
|
+
"upload_rate_bps": max(0, sent - rate_base) / elapsed if elapsed > 0 else 0.0,
|
|
2504
|
+
"retries": retries,
|
|
2505
|
+
"upload_probes": probes,
|
|
2506
|
+
"upload_deadline_exceeded": deadlines,
|
|
2507
|
+
"upload_requests": requests_started,
|
|
2508
|
+
"upload_bytes_attempted": bytes_attempted,
|
|
2509
|
+
}
|
|
2510
|
+
)
|
|
2511
|
+
if progress_callback is not None:
|
|
2512
|
+
progress_callback(upload_url, sent)
|
|
2479
2513
|
|
|
2480
2514
|
def backoff() -> None:
|
|
2481
2515
|
nonlocal slept
|
|
@@ -2523,10 +2557,10 @@ def upload_file_to_drive_raw(
|
|
|
2523
2557
|
except (*_DRIVE_TRANSIENT_NETWORK_ERRORS, requests.Timeout):
|
|
2524
2558
|
stall_started = time.monotonic() if stall_started is None else stall_started
|
|
2525
2559
|
stalled_attempts += 1
|
|
2560
|
+
retries += 1
|
|
2526
2561
|
backoff()
|
|
2527
2562
|
stalled_attempts, slept, stall_started = 0, 0.0, None
|
|
2528
|
-
|
|
2529
|
-
progress_callback(upload_url, sent)
|
|
2563
|
+
report_progress()
|
|
2530
2564
|
with file_path.open("rb") as handle:
|
|
2531
2565
|
while sent < total or probe:
|
|
2532
2566
|
is_probe = probe
|
|
@@ -2541,6 +2575,9 @@ def upload_file_to_drive_raw(
|
|
|
2541
2575
|
raise RuntimeError("Backup file changed during upload")
|
|
2542
2576
|
content_range = f"bytes {sent}-{sent + len(chunk) - 1}/{total}"
|
|
2543
2577
|
try:
|
|
2578
|
+
requests_started += 1
|
|
2579
|
+
probes += int(is_probe)
|
|
2580
|
+
bytes_attempted += len(chunk)
|
|
2544
2581
|
response = _drive_put_with_deadline(
|
|
2545
2582
|
session,
|
|
2546
2583
|
upload_url,
|
|
@@ -2552,9 +2589,15 @@ def upload_file_to_drive_raw(
|
|
|
2552
2589
|
data=chunk,
|
|
2553
2590
|
deadline=request_deadline(max(deadline_floor, len(chunk) / minimum_rate)),
|
|
2554
2591
|
policy_callback=policy_callback,
|
|
2592
|
+
heartbeat_callback=report_progress,
|
|
2555
2593
|
)
|
|
2556
2594
|
if response.status_code in {200, 201}:
|
|
2557
|
-
|
|
2595
|
+
completed = response.json()
|
|
2596
|
+
sent = total
|
|
2597
|
+
if not bytes_attempted:
|
|
2598
|
+
rate_base = total # A completed resume probe transferred no new file bytes.
|
|
2599
|
+
report_progress()
|
|
2600
|
+
return completed
|
|
2558
2601
|
if is_probe and response.status_code in {404, 410}:
|
|
2559
2602
|
raise DriveSessionExpiredError("Drive upload session expired")
|
|
2560
2603
|
if response.status_code in {429, 500, 502, 503, 504}:
|
|
@@ -2564,9 +2607,7 @@ def upload_file_to_drive_raw(
|
|
|
2564
2607
|
raise RuntimeError(f"Unexpected Drive status {response.status_code}")
|
|
2565
2608
|
uploaded_range = response.headers.get("Range")
|
|
2566
2609
|
if not uploaded_range and sent > 0:
|
|
2567
|
-
raise
|
|
2568
|
-
"Drive omitted Range after a confirmed prefix; query session"
|
|
2569
|
-
)
|
|
2610
|
+
raise _DriveUploadNeedsProbe("Drive omitted Range after a confirmed prefix; query session")
|
|
2570
2611
|
confirmed = int(uploaded_range.rsplit("-", 1)[1]) + 1 if uploaded_range else 0
|
|
2571
2612
|
if confirmed < sent or confirmed > total:
|
|
2572
2613
|
raise RuntimeError(
|
|
@@ -2574,21 +2615,25 @@ def upload_file_to_drive_raw(
|
|
|
2574
2615
|
)
|
|
2575
2616
|
http_attempts = 0
|
|
2576
2617
|
if confirmed > sent:
|
|
2618
|
+
if resume_session_url is not None and not bytes_attempted:
|
|
2619
|
+
rate_base = confirmed # Existing remote bytes are not this invocation's rate.
|
|
2577
2620
|
sent = confirmed
|
|
2578
|
-
|
|
2579
|
-
progress_callback(upload_url, sent)
|
|
2621
|
+
report_progress()
|
|
2580
2622
|
stalled_attempts, slept, stall_started = 0, 0.0, None
|
|
2581
2623
|
print(f"drive upload progress: {sent}/{total} bytes", flush=True)
|
|
2582
2624
|
elif not is_probe or confirmed == total:
|
|
2583
|
-
raise
|
|
2625
|
+
raise _DriveUploadNeedsProbe("Drive upload returned no newly confirmed bytes")
|
|
2584
2626
|
elif recovering:
|
|
2585
2627
|
backoff()
|
|
2586
2628
|
probe, recovering = confirmed == total, False
|
|
2587
2629
|
except BackupTimeoutError:
|
|
2588
2630
|
raise
|
|
2589
|
-
except (
|
|
2631
|
+
except (_DriveUploadNeedsProbe, *_DRIVE_TRANSIENT_NETWORK_ERRORS) as exc:
|
|
2590
2632
|
stall_started = time.monotonic() if stall_started is None else stall_started
|
|
2591
2633
|
stalled_attempts += 1
|
|
2634
|
+
retries += 1
|
|
2635
|
+
deadlines += int(isinstance(exc, _DriveRequestDeadlineExceeded))
|
|
2636
|
+
report_progress()
|
|
2592
2637
|
recovering = True
|
|
2593
2638
|
session.close()
|
|
2594
2639
|
session = requests.Session()
|
|
@@ -2597,6 +2642,8 @@ def upload_file_to_drive_raw(
|
|
|
2597
2642
|
probe = True
|
|
2598
2643
|
except _DriveRetryableHTTPError:
|
|
2599
2644
|
http_attempts += 1
|
|
2645
|
+
retries += 1
|
|
2646
|
+
report_progress()
|
|
2600
2647
|
if http_attempts >= max_attempts:
|
|
2601
2648
|
raise
|
|
2602
2649
|
_sleep(min(60, 2 ** min(http_attempts, 6), request_deadline(60)))
|
|
@@ -3853,20 +3900,18 @@ def run_backup(
|
|
|
3853
3900
|
def record_upload_progress(url: str, confirmed: int) -> None:
|
|
3854
3901
|
nonlocal resume_state
|
|
3855
3902
|
next_state = {"url": url, "folder_id": folder_id, **upload_identity}
|
|
3856
|
-
first = resume_state != next_state
|
|
3857
3903
|
resume_state = next_state
|
|
3858
3904
|
result["bytes_confirmed"] = confirmed
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
)
|
|
3905
|
+
_append_json_log(
|
|
3906
|
+
resolved_log_path,
|
|
3907
|
+
{
|
|
3908
|
+
**result,
|
|
3909
|
+
"resumable_upload": resume_state,
|
|
3910
|
+
"error_code": "drive_upload_interrupted",
|
|
3911
|
+
"upload_in_progress": True,
|
|
3912
|
+
"upload_state": "in_progress",
|
|
3913
|
+
},
|
|
3914
|
+
)
|
|
3870
3915
|
|
|
3871
3916
|
def record_upload_thread_policy(policy: dict[str, Any]) -> None:
|
|
3872
3917
|
result["upload_thread_policy"] = policy
|
|
@@ -3879,6 +3924,7 @@ def run_backup(
|
|
|
3879
3924
|
machine_id=resolved_machine_id,
|
|
3880
3925
|
progress_callback=record_upload_progress,
|
|
3881
3926
|
policy_callback=record_upload_thread_policy,
|
|
3927
|
+
telemetry_callback=result.update,
|
|
3882
3928
|
run_deadline=run_deadline,
|
|
3883
3929
|
**({"resume_session_url": saved_session["url"]} if saved_session else {}),
|
|
3884
3930
|
)
|
|
@@ -3892,6 +3938,7 @@ def run_backup(
|
|
|
3892
3938
|
machine_id=resolved_machine_id,
|
|
3893
3939
|
progress_callback=record_upload_progress,
|
|
3894
3940
|
policy_callback=record_upload_thread_policy,
|
|
3941
|
+
telemetry_callback=result.update,
|
|
3895
3942
|
run_deadline=run_deadline,
|
|
3896
3943
|
)
|
|
3897
3944
|
break
|
|
@@ -4217,7 +4264,23 @@ def _supervise_backup_process(timeout_seconds: int, *, command: list[str] | None
|
|
|
4217
4264
|
signal.signal(shutdown_signal, previous_handler)
|
|
4218
4265
|
|
|
4219
4266
|
|
|
4220
|
-
def
|
|
4267
|
+
def _parse_cli_args(argv: list[str]) -> None:
|
|
4268
|
+
"""Refuse anything but a bare invocation or ``run`` before any backup work (#1438)."""
|
|
4269
|
+
import argparse
|
|
4270
|
+
|
|
4271
|
+
parser = argparse.ArgumentParser(
|
|
4272
|
+
prog="python -m brainlayer.backup_daily",
|
|
4273
|
+
description="Run one BrainLayer database backup: snapshot, verify, upload, prune.",
|
|
4274
|
+
epilog="No arguments also runs a backup; that is how the env-run launchd wrapper, the backup "
|
|
4275
|
+
"supervisor and weekly maintenance invoke it. Configuration comes from BRAINLAYER_* env vars.",
|
|
4276
|
+
)
|
|
4277
|
+
parser.add_argument("verb", nargs="?", choices=("run",), help="run a backup now (explicit form)")
|
|
4278
|
+
parser.parse_args(argv)
|
|
4279
|
+
|
|
4280
|
+
|
|
4281
|
+
def main(argv: list[str] | None = None) -> int:
|
|
4282
|
+
# Library callers pass nothing; only the ``python -m`` entry forwards sys.argv.
|
|
4283
|
+
_parse_cli_args([] if argv is None else argv)
|
|
4221
4284
|
timeout_seconds = _configured_backup_timeout_seconds()
|
|
4222
4285
|
snapshot_phase = os.environ.get("BRAINLAYER_BACKUP_PHASE") == "snapshot"
|
|
4223
4286
|
if snapshot_phase:
|
|
@@ -4248,4 +4311,4 @@ def main() -> int:
|
|
|
4248
4311
|
|
|
4249
4312
|
|
|
4250
4313
|
if __name__ == "__main__":
|
|
4251
|
-
raise SystemExit(main())
|
|
4314
|
+
raise SystemExit(main(sys.argv[1:]))
|
|
@@ -162,6 +162,7 @@ def load_credentials(
|
|
|
162
162
|
_migrate_if_missing(token, legacy)
|
|
163
163
|
token_data = _read_object(token, private=True)
|
|
164
164
|
consented = token_data.get("consented_at")
|
|
165
|
+
expires = None
|
|
165
166
|
if consented:
|
|
166
167
|
try:
|
|
167
168
|
consent_time = dt.datetime.fromisoformat(str(consented).replace("Z", "+00:00")).astimezone(dt.UTC)
|
|
@@ -201,8 +202,15 @@ def load_credentials(
|
|
|
201
202
|
if isinstance(exc, TransportError):
|
|
202
203
|
raise TransportError("Drive token refresh network failure") from None
|
|
203
204
|
if "invalid_grant" in str(exc).lower():
|
|
204
|
-
|
|
205
|
-
|
|
205
|
+
reason = "Drive access expired: Reconnect in BrainBar"
|
|
206
|
+
if expires is not None:
|
|
207
|
+
# Google revoked before our local clock ran out; name our deadline, not theirs.
|
|
208
|
+
reason += (
|
|
209
|
+
f" (Google rejected refresh; local consent deadline {expires.isoformat()}"
|
|
210
|
+
" is not Google's revocation time)"
|
|
211
|
+
)
|
|
212
|
+
_report_consent(alert_reporter, reason)
|
|
213
|
+
raise DriveCredentialError(reason) from None
|
|
206
214
|
raise DriveCredentialError("Drive token refresh failed; run brainlayer backup auth") from None
|
|
207
215
|
if persist_refresh:
|
|
208
216
|
token_data["access_token"] = creds.token
|
|
@@ -248,11 +256,12 @@ def credential_status(*, now: dt.datetime | None = None, **kwargs: Any) -> dict[
|
|
|
248
256
|
return {"state": "invalid", "reason": reason, **timing}
|
|
249
257
|
load_credentials(**kwargs, migrate=False, persist_refresh=False, now=now)
|
|
250
258
|
except TransportError:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
259
|
+
reason = "status checked offline; last known state"
|
|
260
|
+
if days_left is not None and days_left <= 2:
|
|
261
|
+
# Text --status prints only the reason, so name the local consent deadline (never a server time).
|
|
262
|
+
reason = f"{reason}: Drive access expires at {expires.isoformat()}: Reconnect in BrainBar"
|
|
263
|
+
return {"state": "expiring", "reason": reason, **timing}
|
|
264
|
+
return {"state": "valid", "reason": reason, **timing}
|
|
256
265
|
except DriveCredentialError as exc:
|
|
257
266
|
return {"state": "invalid", "reason": str(exc), "expires_at": None, "days_left": None}
|
|
258
267
|
if days_left is not None and days_left <= 2:
|
|
@@ -46,6 +46,7 @@ class Component:
|
|
|
46
46
|
starts: int = field(default=0, init=False)
|
|
47
47
|
failures: int = field(default=0, init=False)
|
|
48
48
|
retry_at: float = field(default=0, init=False)
|
|
49
|
+
retry_wall_at: float | None = field(default=None, init=False)
|
|
49
50
|
error: str = field(default="", init=False)
|
|
50
51
|
started_at: float = field(default=0, init=False)
|
|
51
52
|
cleanup: asyncio.Task | None = field(default=None, init=False)
|
|
@@ -53,6 +54,20 @@ class Component:
|
|
|
53
54
|
last_exit_code: int | None = field(default=None, init=False)
|
|
54
55
|
last_run_at: float | None = field(default=None, init=False)
|
|
55
56
|
cleanup_retry_at: float = field(default=0, init=False)
|
|
57
|
+
delay_reason: str = field(default="", init=False)
|
|
58
|
+
delay_reported_at: float = field(default=0, init=False)
|
|
59
|
+
|
|
60
|
+
def schedule_after(self, delay):
|
|
61
|
+
self.retry_at = time.monotonic() + delay
|
|
62
|
+
self.retry_wall_at = time.time() + delay if self.interval else None
|
|
63
|
+
|
|
64
|
+
def retry_delay(self):
|
|
65
|
+
# Keep retry_at in uptime units for existing callers. The paired wall deadline
|
|
66
|
+
# also makes periodic work due after sleep, when Darwin uptime barely advances.
|
|
67
|
+
delay = self.retry_at - time.monotonic()
|
|
68
|
+
if self.interval and self.retry_wall_at is not None:
|
|
69
|
+
delay = min(delay, self.retry_wall_at - time.time())
|
|
70
|
+
return delay
|
|
56
71
|
|
|
57
72
|
def status(self):
|
|
58
73
|
return dict(
|
|
@@ -69,7 +84,7 @@ class Component:
|
|
|
69
84
|
interval=self.interval,
|
|
70
85
|
last_exit_code=self.last_exit_code,
|
|
71
86
|
last_run_at=self.last_run_at,
|
|
72
|
-
next_run_at=time.time() + max(0, self.
|
|
87
|
+
next_run_at=time.time() + max(0, self.retry_delay())
|
|
73
88
|
if self.interval and self.enabled and not self.paused
|
|
74
89
|
else None,
|
|
75
90
|
)
|
|
@@ -215,7 +230,29 @@ class Supervisor:
|
|
|
215
230
|
def _failed(self, child: Component, error: str):
|
|
216
231
|
child.failures += 1
|
|
217
232
|
child.error = error
|
|
218
|
-
|
|
233
|
+
self._report_interval_delay(child, "startup-failed")
|
|
234
|
+
child.schedule_after(min(300, (child.backoff or self.backoff) * 2 ** min(child.failures - 1, 30)))
|
|
235
|
+
|
|
236
|
+
def _report_interval_delay(self, child, reason):
|
|
237
|
+
if not child.interval:
|
|
238
|
+
return
|
|
239
|
+
now = time.monotonic()
|
|
240
|
+
if child.delay_reason == reason and now - child.delay_reported_at < 60:
|
|
241
|
+
return
|
|
242
|
+
child.delay_reason, child.delay_reported_at = reason, now
|
|
243
|
+
name = next(name for name, component in self.components.items() if component is child)
|
|
244
|
+
delay = max(0, -child.retry_delay()) if child.retry_at else 0
|
|
245
|
+
emit(
|
|
246
|
+
self.diagnostics,
|
|
247
|
+
event="interval-delayed",
|
|
248
|
+
component=name,
|
|
249
|
+
reason=reason,
|
|
250
|
+
delay_s=delay,
|
|
251
|
+
pid=child.process.pid if child.process else None,
|
|
252
|
+
pause_owner=child.pause_owner,
|
|
253
|
+
error=child.error,
|
|
254
|
+
)
|
|
255
|
+
logging.getLogger(__name__).warning("periodic component %s delayed %.1fs: %s", name, delay, reason)
|
|
219
256
|
|
|
220
257
|
def _start(self, child: Component):
|
|
221
258
|
gate = None
|
|
@@ -239,11 +276,13 @@ class Supervisor:
|
|
|
239
276
|
child.starts += 1
|
|
240
277
|
child.started_at, child.error = time.monotonic(), ""
|
|
241
278
|
child.last_run_at = time.time()
|
|
279
|
+
child.delay_reason = ""
|
|
242
280
|
if child.interval:
|
|
243
|
-
child.
|
|
281
|
+
child.schedule_after(child.interval)
|
|
244
282
|
except BlockingIOError:
|
|
283
|
+
self._report_interval_delay(child, "maintenance-lease-held")
|
|
245
284
|
child.error = "maintenance lease held"
|
|
246
|
-
child.
|
|
285
|
+
child.schedule_after(0.5)
|
|
247
286
|
except OSError as exc:
|
|
248
287
|
self._failed(child, str(exc))
|
|
249
288
|
finally:
|
|
@@ -270,6 +309,23 @@ class Supervisor:
|
|
|
270
309
|
self.recovery = asyncio.create_task(self._blocking(self._recover_hold))
|
|
271
310
|
self.recovery_at = time.monotonic() + 1
|
|
272
311
|
for child in self.components.values():
|
|
312
|
+
if child.interval and child.retry_at and child.retry_delay() <= 0:
|
|
313
|
+
if not child.enabled:
|
|
314
|
+
reason = "configured-off"
|
|
315
|
+
elif child.paused:
|
|
316
|
+
reason = "paused"
|
|
317
|
+
elif child.startup is not None and not child.startup.done():
|
|
318
|
+
reason = "startup-pending"
|
|
319
|
+
elif child.cleanup is not None:
|
|
320
|
+
reason = "cleanup-pending"
|
|
321
|
+
elif child.cleanup_retry_at:
|
|
322
|
+
reason = "cleanup-backoff"
|
|
323
|
+
elif child.process is not None and child.process.poll() is None:
|
|
324
|
+
reason = "previous-run-active"
|
|
325
|
+
else:
|
|
326
|
+
reason = "scheduler-gap"
|
|
327
|
+
if reason != "scheduler-gap" or child.retry_delay() <= -1:
|
|
328
|
+
self._report_interval_delay(child, reason)
|
|
273
329
|
if child.startup is not None:
|
|
274
330
|
if not child.startup.done():
|
|
275
331
|
continue
|
|
@@ -298,7 +354,8 @@ class Supervisor:
|
|
|
298
354
|
if child.process and child.process.poll() is not None and child.cleanup is None:
|
|
299
355
|
child.last_exit_code = child.process.returncode
|
|
300
356
|
if child.interval:
|
|
301
|
-
|
|
357
|
+
# Keep the start-based deadline: an exit observed after sleep must
|
|
358
|
+
# not postpone already-overdue work by another whole interval.
|
|
302
359
|
if child.last_exit_code not in {0, 75}:
|
|
303
360
|
child.failures += 1
|
|
304
361
|
child.error = f"exited {child.last_exit_code}"
|
|
@@ -316,7 +373,7 @@ class Supervisor:
|
|
|
316
373
|
):
|
|
317
374
|
child.last_exit_code, child.error = 124, "interval worker timed out"
|
|
318
375
|
child.failures += 1
|
|
319
|
-
child.
|
|
376
|
+
child.schedule_after(child.interval)
|
|
320
377
|
child.cleanup = asyncio.create_task(self._reap(child))
|
|
321
378
|
if (
|
|
322
379
|
not child.interval
|
|
@@ -325,7 +382,7 @@ class Supervisor:
|
|
|
325
382
|
and time.monotonic() - child.started_at >= self.stable_uptime
|
|
326
383
|
):
|
|
327
384
|
child.failures = 0
|
|
328
|
-
if child.enabled and not child.paused and child.process is None and
|
|
385
|
+
if child.enabled and not child.paused and child.process is None and child.retry_delay() <= 0:
|
|
329
386
|
self._schedule_start(child)
|
|
330
387
|
|
|
331
388
|
def _recover_hold(self):
|
|
@@ -13,7 +13,6 @@ import math
|
|
|
13
13
|
import os
|
|
14
14
|
import stat
|
|
15
15
|
import sys
|
|
16
|
-
import time
|
|
17
16
|
from pathlib import Path
|
|
18
17
|
|
|
19
18
|
from .paths import supervisor_socket_path
|
|
@@ -126,7 +125,7 @@ def load_components(path: Path, socket_path: Path) -> dict[str, Component]:
|
|
|
126
125
|
backoff=throttle,
|
|
127
126
|
)
|
|
128
127
|
if interval and not run_at_load:
|
|
129
|
-
child.
|
|
128
|
+
child.schedule_after(interval)
|
|
130
129
|
components[ALIASES[label]] = child
|
|
131
130
|
# Supervisor-only registration: legacy installs ship no second checkpoint schedule.
|
|
132
131
|
source = components.get("observability", next(iter(components.values())))
|
|
@@ -154,7 +153,7 @@ def load_components(path: Path, socket_path: Path) -> dict[str, Component]:
|
|
|
154
153
|
stderr=socket_path.with_name("wal-fallback.err.log"),
|
|
155
154
|
),
|
|
156
155
|
)
|
|
157
|
-
components["wal-checkpoint-fallback"].
|
|
156
|
+
components["wal-checkpoint-fallback"].schedule_after(900)
|
|
158
157
|
return with_brainbar_monitor(components, socket_path)
|
|
159
158
|
|
|
160
159
|
|