rein-agentic-kit 2.2.0__tar.gz → 2.3.0__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.
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/PKG-INFO +6 -3
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/README.md +5 -2
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/.claude-plugin/plugin.json +1 -1
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/.codex-plugin/plugin.json +1 -1
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/bin/rein +1 -1
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/flow.config.example.json +4 -2
- rein_agentic_kit-2.3.0/plugins/rein/lib/failure_triage.py +223 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/gate_run.py +2 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/quick_driver.py +17 -8
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/quota.py +18 -2
- rein_agentic_kit-2.3.0/plugins/rein/lib/run_events.py +159 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/ship.py +204 -56
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/ship_decide.py +117 -26
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/ship_state.py +33 -1
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/token_report.py +196 -23
- rein_agentic_kit-2.3.0/plugins/rein/lib/usage_report.py +978 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/pyproject.toml +1 -1
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/rein_agentic_kit.egg-info/PKG-INFO +6 -3
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/rein_agentic_kit.egg-info/SOURCES.txt +4 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_check_evidence.py +9 -2
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_failure_triage.py +6 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_model_policy.py +11 -10
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_python39_compat.py +1 -1
- rein_agentic_kit-2.3.0/tests/test_run_stability.py +715 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship.py +12 -2
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_tiers.py +2 -2
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_token_report.py +10 -4
- rein_agentic_kit-2.3.0/tests/test_usage_report.py +1223 -0
- rein_agentic_kit-2.2.0/plugins/rein/lib/failure_triage.py +0 -135
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/LICENSE +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/ENTRY.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/IMPACT.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/NATIVE-CLOSURE.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/PROVIDERS.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/SHIP-WATCH.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/__init__.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/affected.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/angular_impact.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/delivery.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/detect.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/evidence.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/gate.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/gate_cache.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/gate_env.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/gate_execution.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/gate_log.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/guard.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/impact.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/integration_ready.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/launch_profile.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/migrate_config.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/orca_client.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/plan.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/plan_check.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/quick.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/quick_inbox.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/roles.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/routing.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/serve.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/ship_answer.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/ship_done.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/ship_watch.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/startup_dialog.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/tmproot.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/verify.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/lib/worker_leases.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/answer/IMPACT.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/answer/PROVIDERS.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/answer/SKILL.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/quick/IMPACT.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/quick/PROVIDERS.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/quick/SKILL.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-audit/IMPACT.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-audit/PROVIDERS.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-audit/SKILL.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-discover/IMPACT.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-discover/PROVIDERS.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-discover/SKILL.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-plan/IMPACT.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-plan/PROVIDERS.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-plan/SKILL.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-role/IMPACT.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-role/PROVIDERS.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/rein-role/SKILL.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/ship/IMPACT.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/ship/PROVIDERS.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/plugins/rein/skills/ship/SKILL.md +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/rein_agentic_kit.egg-info/dependency_links.txt +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/rein_agentic_kit.egg-info/entry_points.txt +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/rein_agentic_kit.egg-info/top_level.txt +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/setup.cfg +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_affected.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_angular_impact.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_baseline.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_baseline_cli.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_blocked_launch.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_capability_scope.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_capacity_wait.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_claimable.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_cli_presentation.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_cli_resolution.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_delivery.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_detect.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_discovery_v2.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_doctor_cli.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_downgrade_expiry.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_failed_start.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_fix_verification.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_cache.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_cleanup.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_cli.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_decision.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_env.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_execution.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_log.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_prepare.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_run.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_scope.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_tiers.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_gate_timeouts.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_graph_index.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_guard.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_guard_attribution.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_guard_fail_closed.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_guard_outside.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_guard_robust.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_guard_strict_read.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_hook_tracker_snapshot.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_host_workers.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_impact.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_impact_eval_oracle.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_integration_ready.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_launch_profile.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_migrate_config.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_mise_runner.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_monorepo.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_native_done.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_native_skills.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_orca_client.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_owner_decisions.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_packaging.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_plan.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_plan_check_decision.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_plan_check_repos.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_plan_self_check.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick_cli.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick_close_record.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick_driver.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick_env.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick_inbox.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick_record_lock.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick_report.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quick_resend.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quota.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quota_evolution.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_quota_guard_freshness.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_readme_is_current.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_regenerable.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_reserved_names.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_resume_old_state.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_review_artifact.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_review_fixes.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_roles.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_round2.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_round3.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_round4.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_round5.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_round6.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_routing.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_routing_v2.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_run_duration.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_serve_probe.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_setup_tabs.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_agent_flag.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_async_gates.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_decide.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_done.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_env.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_hunt.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_inbox.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_resilience.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_state.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_ux.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_ship_watch.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_single_subproject.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_skill_budget.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_skill_names.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_stalled_worker.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_startup_dialog.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_task_base.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_temp_root.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_v2_surface.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_verification_reuse.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_verify_commands.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_verify_plan.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_verify_policy.py +0 -0
- {rein_agentic_kit-2.2.0 → rein_agentic_kit-2.3.0}/tests/test_version_lock.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rein-agentic-kit
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Rein — keep your Claude Code agents lean and in control. Token-lean, stack-aware agentic dev flow.
|
|
5
5
|
Author: Luis Farfan
|
|
6
6
|
License: MIT
|
|
@@ -300,8 +300,11 @@ Keep these limits in mind:
|
|
|
300
300
|
valid data arrives, but cannot guarantee that the source refreshes or that
|
|
301
301
|
enough capacity remains to finish a task.
|
|
302
302
|
|
|
303
|
-
To see
|
|
304
|
-
|
|
303
|
+
To see how you work and what to change, run `rein token-report --sessions --days 7`. It
|
|
304
|
+
reads local Claude Code transcripts (native sessions too) and REIN's own records, shows totals
|
|
305
|
+
with no conversation content, and gives recommendations with their evidence and how certain
|
|
306
|
+
they are. It sends nothing. You can [save a baseline, compare windows](docs/reference.md#how-you-use-rein-and-what-to-change)
|
|
307
|
+
and turn a finding into [an experiment](docs/laboratory.md).
|
|
305
308
|
The [latest measurement](docs/research/2026-11-29-native-first/RESULTS.md) also fixes an
|
|
306
309
|
earlier double count. `ledger` and `baseline` keep run history. Token reports read Claude Code transcripts; they are not complete
|
|
307
310
|
accounting for all Codex sessions. Historical studies are linked from the research
|
|
@@ -280,8 +280,11 @@ Keep these limits in mind:
|
|
|
280
280
|
valid data arrives, but cannot guarantee that the source refreshes or that
|
|
281
281
|
enough capacity remains to finish a task.
|
|
282
282
|
|
|
283
|
-
To see
|
|
284
|
-
|
|
283
|
+
To see how you work and what to change, run `rein token-report --sessions --days 7`. It
|
|
284
|
+
reads local Claude Code transcripts (native sessions too) and REIN's own records, shows totals
|
|
285
|
+
with no conversation content, and gives recommendations with their evidence and how certain
|
|
286
|
+
they are. It sends nothing. You can [save a baseline, compare windows](docs/reference.md#how-you-use-rein-and-what-to-change)
|
|
287
|
+
and turn a finding into [an experiment](docs/laboratory.md).
|
|
285
288
|
The [latest measurement](docs/research/2026-11-29-native-first/RESULTS.md) also fixes an
|
|
286
289
|
earlier double count. `ledger` and `baseline` keep run history. Token reports read Claude Code transcripts; they are not complete
|
|
287
290
|
accounting for all Codex sessions. Historical studies are linked from the research
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rein",
|
|
3
3
|
"description": "Rein \u2014 keep your Claude Code agents lean and in control. A deterministic plan / ship / audit method on top of Orca: fresh workers, gated tasks, independent review, and real per-model token measurement.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Luis Farfan"
|
|
7
7
|
},
|
|
@@ -46,8 +46,10 @@
|
|
|
46
46
|
"largeChangeFiles": 25,
|
|
47
47
|
"riskyPaths": ["**/auth/**", "**/payments/**", "**/migrations/**"],
|
|
48
48
|
"auditExclude": [],
|
|
49
|
-
"$models": "Optional. Authorized choices per responsibility, in order of preference, as \"agent/model\" (agents: claude, codex, antigravity). implement: workers (Claude still yields above claudeWeeklyThreshold when another entry exists). escalate: a task whose code
|
|
50
|
-
"models": {}
|
|
49
|
+
"$models": "Optional. Authorized choices per responsibility, in order of preference, as \"agent/model\" (agents: claude, codex, antigravity). implement: workers (Claude still yields above claudeWeeklyThreshold when another entry exists). escalate: a task whose same code defect came back after a repair, only with measured capacity, never for infrastructure or an unreadable failure. audit: normal reviews. auditRisky: risky or large changes (and quick audits). A responsibility left out keeps the built-in routing. A malformed value launches nothing. Example: {\"implement\": [\"claude/sonnet\", \"codex/<model>\"], \"escalate\": [\"claude/opus\"], \"auditRisky\": [\"claude/opus\"]}",
|
|
50
|
+
"models": {},
|
|
51
|
+
"$requireReportedModel": "true = refuse a launch whose model Orca does not report, or is not an authorized one (quick then launches nothing). Any other non-boolean value launches nothing.",
|
|
52
|
+
"requireReportedModel": false
|
|
51
53
|
},
|
|
52
54
|
|
|
53
55
|
"gate": {
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"""What a red task's failure says before Rein spends another worker on it. Pure: no I/O.
|
|
2
|
+
|
|
3
|
+
Measured on 53 real `rein ship` runs (docs/research/2026-10-26-arquitectura): a fresh worker met
|
|
4
|
+
exactly the failure its predecessor had met 26 times in a row -- mostly the guard's "wrote outside
|
|
5
|
+
its worktree" about a commit in another checkout, which no new worker can undo -- and one task took
|
|
6
|
+
18 dispatches. The failure text a retry was given carried ANSI colour codes in 74% of test failures.
|
|
7
|
+
|
|
8
|
+
`clean` is the text a worker or the owner reads; `signature` is what two failures are compared by
|
|
9
|
+
(the same failure, whatever the run-specific ids, shas, timings and temp paths in it); `hint` is
|
|
10
|
+
the one line that tells the owner what a fresh worker cannot do about it.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import hashlib
|
|
16
|
+
import itertools
|
|
17
|
+
import re
|
|
18
|
+
|
|
19
|
+
_ANSI = re.compile(r"\x1b\[[0-?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-_]")
|
|
20
|
+
# What changes between two runs of the same failure and says nothing about it.
|
|
21
|
+
_VOLATILE = [
|
|
22
|
+
(re.compile(r"(?:/private)?/var/folders/\S+|/tmp/\S+"), "<tmp>"),
|
|
23
|
+
(re.compile(r"\b(?:ctx|task|run|msg|delivery|term|gate)_[0-9a-f-]{6,}\b"), "<id>"),
|
|
24
|
+
(re.compile(r"\b[0-9a-f]{7,40}\b"), "<sha>"),
|
|
25
|
+
(re.compile(r"\b\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?Z?\b"), "<time>"),
|
|
26
|
+
(re.compile(r"\b\d+(?:\.\d+)?\s*(?:ms|s|sec|seconds|min)\b"), "<dur>"),
|
|
27
|
+
(re.compile(r"\(\d+:\d{2}:\d{2}\)"), "<dur>"),
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def clean(text: str) -> str:
|
|
32
|
+
"""`text` without terminal escape sequences or carriage-return redraws."""
|
|
33
|
+
out = _ANSI.sub("", text or "")
|
|
34
|
+
# A progress line redrawn with \r keeps only what it last showed; a \r that ends the line (CRLF, as
|
|
35
|
+
# any terminal writes it) redraws nothing.
|
|
36
|
+
return "\n".join(line.rstrip("\r").rsplit("\r", 1)[-1] for line in out.split("\n"))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def normalize(text: str) -> str:
|
|
40
|
+
out = clean(text)
|
|
41
|
+
for rx, token in _VOLATILE:
|
|
42
|
+
out = rx.sub(token, out)
|
|
43
|
+
return "\n".join(" ".join(line.split()) for line in out.splitlines() if line.strip())
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def signature(text: str) -> str:
|
|
47
|
+
"""Equal for two failures that only differ in ids, shas, timings or temp paths; "" for none."""
|
|
48
|
+
norm = normalize(text)
|
|
49
|
+
return hashlib.sha1(norm.encode("utf-8")).hexdigest()[:16] if norm else ""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# What the environment said, not the code: a dropped or refused connection, a busy port, no Docker,
|
|
53
|
+
# no name resolution, a full disk.
|
|
54
|
+
_INFRA = re.compile(r"rejected SSL upgrade|ConnectionRefusedError|Connection refused|[Cc]onnection reset|"
|
|
55
|
+
r"connection was closed in the middle|too many clients|could not connect to server|"
|
|
56
|
+
r"Cannot connect to the Docker daemon|address already in use|"
|
|
57
|
+
r"\b(?:ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOTFOUND|EAI_AGAIN|ENOSPC|EMFILE|EADDRINUSE)\b|"
|
|
58
|
+
r"name resolution|Could not resolve host|TLS handshake timeout|i/o timeout|"
|
|
59
|
+
r"No space left on device|Too many open files|Read-only file system|no such host|"
|
|
60
|
+
r"nodename nor servname|Can't reach database server|DockerException|docker daemon|"
|
|
61
|
+
r"certificate verify failed|SSLCertVerificationError|NoCredentialsError|"
|
|
62
|
+
r"Unable to locate credentials|fetch failed|HTTP\w*Error:? 50[234]")
|
|
63
|
+
# The check did not finish judging: out of memory (the host's or the code's fault, nobody can say).
|
|
64
|
+
_STARVED = re.compile(r"heap out of memory|Cannot allocate memory|\bENOMEM\b|\bMemoryError\b")
|
|
65
|
+
_KILLED = (127, 134, 137, 139, 143) # the tool is missing, or a signal ended it (negative codes too)
|
|
66
|
+
INFRA_LINES = 3
|
|
67
|
+
# A pytest summary line: `FAILED tests/x.py::test_y - AssertionError` or `ERROR tests/x.py`.
|
|
68
|
+
_FAILED_TEST = re.compile(r"^(?:FAILED|ERROR) ((?!\()\S+)", re.M) # never unittest's `FAILED (failures=1)`
|
|
69
|
+
# An unmet assertion, as a test runner prints it: the only thing a test's output can prove about the
|
|
70
|
+
# code. Any exception may be a broken setup's (a missing variable, another runtime version).
|
|
71
|
+
_ASSERTION = (r"\b(?:AssertionError|AssertionFailedError|ComparisonFailure)\b|"
|
|
72
|
+
r"\bexpected:? ?<.*but was|\b[Aa]ssertion `.{0,200}\bfailed\b")
|
|
73
|
+
_DEFECT = re.compile(_ASSERTION + r"|^(?:E\s+)?assert\b|^\s*Expected\b[^:\n]{0,60}:.*\n\s*Received\b[^:\n]{0,60}:|"
|
|
74
|
+
r"^\s*- Expected\s*\n\s*\+ Received|"
|
|
75
|
+
r"^\s+\w+_test\.go:\d+:.*(?:\bgot\b.*\bwant\b|\bwant\b.*\bgot\b)", re.M)
|
|
76
|
+
# A pytest summary line that names a test together with its unmet assertion.
|
|
77
|
+
_ASSERTED_TEST = re.compile(r"^FAILED (\S+::\S+) - (?:assert\b|AssertionError\b)", re.M)
|
|
78
|
+
# What else is left of an infrastructure failure once its own lines are set aside.
|
|
79
|
+
_ERROR = re.compile(r"\b[A-Z]\w*(?:Error|Exception)\b|^E\s+assert\b", re.M)
|
|
80
|
+
STATIC = ("lint", "typecheck", "build") # only a known tool's diagnostic proves these red
|
|
81
|
+
# One finding about a source line, in the exact format of a known tool: tsc, ruff/flake8/pylint, mypy,
|
|
82
|
+
# pyright, an eslint item with its rule, rustc, and Go's own compile errors. Any other "file:line:
|
|
83
|
+
# text" may be a warning, a stack frame, a missing tool or a dependency.
|
|
84
|
+
_DIAGNOSTIC = re.compile(
|
|
85
|
+
r"\.[cm]?tsx?(?:\(\d+,\d+\):|:\d+:\d+ -) error TS\d+:|\.pyi?:\d+:\d+: [A-Z]{1,4}\d{2,4}\b|"
|
|
86
|
+
r"\.pyi?:\d+(?::\d+)?: error: .*\[[a-z-]+\]$|\.pyi?:\d+:\d+ - error: .*\(report\w+\)$|"
|
|
87
|
+
r"^\s+\d+:\d+\s+error\s+\S.*\s{2,}[@\w/-]+$|^error\[E\d{4}\]:|"
|
|
88
|
+
r"\.go:\d+:\d+: (?:undefined: |cannot use |declared and not used|missing return|syntax error|invalid operation|"
|
|
89
|
+
r"not enough arguments|too many arguments|assignment mismatch|\S+ (?:declared|imported) and not used)")
|
|
90
|
+
# A missing dependency or its types, a tool's own configuration or crash, someone else's code, another
|
|
91
|
+
# toolchain. One such line and no diagnostic of that check is proof: the rest may only follow from it.
|
|
92
|
+
_SETUP = re.compile(r"node_modules(?!/\.bin/)|site-packages|\.cargo/registry|/pkg/mod/|"
|
|
93
|
+
r"\bTS(?:2307|2580|2582|2591|2593|2688|2792|2875|7016|7026)\b|Do you need to install|"
|
|
94
|
+
r": (?:E902|[EF]0401|E0611|F0\d{3})\b|\[import[a-z-]*\]$|\(reportMissing\w+\)$|"
|
|
95
|
+
r"\[E0(?:432|433|46[0-3]|514|519)\]|incompatible version of rustc|found crate|"
|
|
96
|
+
r"Unable to resolve|Resolve error|Parsing error|Definition for rule|no-unresolved|"
|
|
97
|
+
r"Cannot find (?:module|package)|ModuleNotFoundError|ERR_MODULE_NOT_FOUND|"
|
|
98
|
+
r"requires [Gg]o\b|go\.sum|no required module|is not in (?:std|GOROOT)", re.M)
|
|
99
|
+
|
|
100
|
+
_RED_SLOT = re.compile(r"^(\w+) \[failed\]", re.M)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def kind(text: str) -> str:
|
|
104
|
+
"""outside | hook | infra | test | other: which part of Rein said no."""
|
|
105
|
+
t = clean(text)
|
|
106
|
+
if "wrote outside its worktree" in t:
|
|
107
|
+
return "outside"
|
|
108
|
+
if "pre-commit hook only after the hook rewrites" in t or "commit-msg hook" in t:
|
|
109
|
+
return "hook"
|
|
110
|
+
if _INFRA.search(t):
|
|
111
|
+
return "infra"
|
|
112
|
+
if re.search(r"^(?:test|testIntegration|lint|typecheck|build) \[", t, re.M):
|
|
113
|
+
return "test"
|
|
114
|
+
return "other"
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def failing_tests(text: str) -> list:
|
|
118
|
+
"""The test ids a pytest summary names as failed or errored, sorted; [] when it names none."""
|
|
119
|
+
return sorted(set(_FAILED_TEST.findall(clean(text))))
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def red_slots(text: str) -> set:
|
|
123
|
+
"""The gate slots a gate report names as failed: `lint [failed] exit=1 $ ...` -> {"lint"}."""
|
|
124
|
+
return set(_RED_SLOT.findall(clean(text)))
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def defect_ids(slot: str, error_lines, output_head=()) -> list:
|
|
128
|
+
"""What one check that proved the code red is recognised by next time: the tests whose unmet
|
|
129
|
+
assertion it shows, and its whole failure. Never a test that failed some other way."""
|
|
130
|
+
errors, head = (clean("\n".join(str(x) for x in lines or ())) for lines in (error_lines, output_head))
|
|
131
|
+
body = errors if errors.strip() else head
|
|
132
|
+
return sorted({"%s %s" % (slot, t) for t in _ASSERTED_TEST.findall(body)}) + ["%s =%s" % (slot, signature(body))]
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def infra_lines(text: str) -> list:
|
|
136
|
+
"""The first lines of a WHOLE capture that show an environment failure: an excerpt may leave them out."""
|
|
137
|
+
found = (line.strip()[:200] for line in clean(text or "").splitlines()
|
|
138
|
+
if _INFRA.search(line) or _STARVED.search(line))
|
|
139
|
+
return list(itertools.islice(found, INFRA_LINES))
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def capture_evidence(text: str) -> dict:
|
|
143
|
+
"""What a check's WHOLE output shows and its excerpt may leave out: the report fields `infraLines`
|
|
144
|
+
and `setupTrouble`, which `check_kind` takes as `infra_seen` and `setup_seen`."""
|
|
145
|
+
return {"infraLines": infra_lines(text), "setupTrouble": bool(_SETUP.search(clean(text or "")))}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def check_kind(slot: str, outcome: str, error_lines, output_head=(), infra_seen=(), exit_code=None,
|
|
149
|
+
setup_seen=False) -> str:
|
|
150
|
+
"""code | infra | unclear | blocked | timeout | unproven | unreadable: what one red check says.
|
|
151
|
+
|
|
152
|
+
Every argument comes from that check's structured result, so its output can only show an
|
|
153
|
+
environment failure inside it, never stand for another check. `infra_seen` and `setup_seen`
|
|
154
|
+
are the `capture_evidence` of its whole output. `code` needs positive evidence, in any slot; `unproven` is a red check whose cause
|
|
155
|
+
nobody can read (a worker may look at it, but it proves no defect). An environment failure beside
|
|
156
|
+
other errors or outside the failure's own lines, a killed check and one that says nothing are
|
|
157
|
+
`unclear`: only the owner can tell."""
|
|
158
|
+
if outcome != "failed":
|
|
159
|
+
return {"timeout": "timeout", "not_invocable": "blocked", "inconclusive": "blocked",
|
|
160
|
+
"proves_nothing": "unproven"}.get(outcome, "unreadable")
|
|
161
|
+
errors, head, seen = (clean("\n".join(str(x) for x in lines or ()))
|
|
162
|
+
for lines in (error_lines, output_head, infra_seen))
|
|
163
|
+
body = errors if errors.strip() else head
|
|
164
|
+
if not body.strip() or isinstance(exit_code, int) and (exit_code < 0 or exit_code in _KILLED):
|
|
165
|
+
return "unclear"
|
|
166
|
+
lines = body.splitlines()
|
|
167
|
+
proof = [x for x in lines if slot in STATIC and _DIAGNOSTIC.search(x)]
|
|
168
|
+
broken = setup_seen or any(_SETUP.search(x) for x in lines)
|
|
169
|
+
# A diagnostic may quote anything ('"ECONNREFUSED"'): only the other lines show the environment.
|
|
170
|
+
others = [x for x in lines if x not in proof]
|
|
171
|
+
if any(_STARVED.search(x) for x in others):
|
|
172
|
+
return "unclear"
|
|
173
|
+
if not any(_INFRA.search(x) for x in others):
|
|
174
|
+
if proof and not broken:
|
|
175
|
+
return "code" # no connection or disk failure elsewhere makes a compiler name a wrong line
|
|
176
|
+
if _INFRA.search(head) or seen.strip():
|
|
177
|
+
return "unclear"
|
|
178
|
+
return "code" if slot not in STATIC and _DEFECT.search(body) else "unproven"
|
|
179
|
+
rest = "\n".join(x for x in others if not _INFRA.search(x))
|
|
180
|
+
return "unclear" if proof or _ERROR.search(rest) or _DEFECT.search(rest) else "infra"
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
NO_VERDICT = ("infra", "unclear", "blocked", "unreadable")
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def is_blocked(reason: str, checks=None) -> bool:
|
|
187
|
+
"""No check proved the code red and at least one could not judge it: no worker is started.
|
|
188
|
+
|
|
189
|
+
`checks` are the `check_kind`s of the verdict, plus "policy" when the guard rejected the
|
|
190
|
+
change. None (a verdict saved or built without them) is judged by its text. A Verification that
|
|
191
|
+
timed out or proved nothing stays red; a gate slot that timed out is a setup problem (exit 126),
|
|
192
|
+
which asks the owner anyway."""
|
|
193
|
+
if checks is None:
|
|
194
|
+
return kind(reason) == "infra" and "Rein's guard rejected" not in clean(reason)
|
|
195
|
+
return not {"policy", "code"} & set(checks) and bool(set(NO_VERDICT) & set(checks))
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def is_infra(checks=None) -> bool:
|
|
199
|
+
"""Every red check failed on the environment alone: running them again is all there is to do."""
|
|
200
|
+
return bool(checks) and set(checks) == {"infra"}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def is_code(checks=None) -> bool:
|
|
204
|
+
"""A structured result proved the code red, and the guard did not reject the change."""
|
|
205
|
+
checks = checks or ()
|
|
206
|
+
return "code" in checks and "policy" not in checks
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def hint(text: str) -> str:
|
|
210
|
+
"""What the owner can do that a fresh worker cannot, for the kind of `text`."""
|
|
211
|
+
k = kind(text)
|
|
212
|
+
if k == "outside":
|
|
213
|
+
return ("A new worker cannot undo a change in another checkout. If it is your own or another "
|
|
214
|
+
"session's work, `rein accept-outside --path <abs path>` or `--commit <sha>` records that, "
|
|
215
|
+
"then retry; if a worker wrote it, revert it there yourself, then retry.")
|
|
216
|
+
if k == "hook":
|
|
217
|
+
return ("The repo's own git hook rewrites files on commit; check that hook, or let the next worker "
|
|
218
|
+
"amend its commit with the hook's fix (retry).")
|
|
219
|
+
if k == "infra":
|
|
220
|
+
return "The environment failed (a connection, a port, Docker), not the change: fix it, then retry."
|
|
221
|
+
if k == "test":
|
|
222
|
+
return "Two workers in a row could not make this check pass the same way; look at the failure before retrying."
|
|
223
|
+
return "Look at the failure before retrying."
|
|
@@ -22,6 +22,7 @@ import time
|
|
|
22
22
|
from typing import Callable
|
|
23
23
|
|
|
24
24
|
import affected as _affected
|
|
25
|
+
import failure_triage as _triage
|
|
25
26
|
import gate_cache as _cache
|
|
26
27
|
import gate_execution as _execution
|
|
27
28
|
import verify as _verify
|
|
@@ -264,6 +265,7 @@ def run_steps(root: str, steps: list, timeout_for: Callable[[str, str], float],
|
|
|
264
265
|
entry["budgetSeconds"] = budget
|
|
265
266
|
if res.outcome != _verify.OUTCOME_OK:
|
|
266
267
|
entry["errorLines"] = _verify.failure_lines(res.output)
|
|
268
|
+
entry.update(_triage.capture_evidence(res.output)) # the excerpt may leave it out
|
|
267
269
|
if fail_fast:
|
|
268
270
|
stopped_by = slot
|
|
269
271
|
else:
|
|
@@ -339,6 +339,10 @@ def start_quick(
|
|
|
339
339
|
for line in cfg.models_errors:
|
|
340
340
|
say(line)
|
|
341
341
|
return 2
|
|
342
|
+
if cfg.require_reported_model:
|
|
343
|
+
say("ship.requireReportedModel is on, and Orca does not report which model a Quick implementer runs: "
|
|
344
|
+
"nothing was launched. Work natively, or use `rein ship`")
|
|
345
|
+
return 2
|
|
342
346
|
preferred = cfg.models.get("implement") or ()
|
|
343
347
|
if not agent:
|
|
344
348
|
agent, model = quota.choose_implementer(
|
|
@@ -449,7 +453,7 @@ def start_quick(
|
|
|
449
453
|
|
|
450
454
|
# 6. Report
|
|
451
455
|
say("agent: %s" % agent)
|
|
452
|
-
say("model: %s" % model)
|
|
456
|
+
say("model: %s (requested; Orca does not report which one a Quick implementer runs)" % model)
|
|
453
457
|
say("workspace: %s" % workspace)
|
|
454
458
|
if handle:
|
|
455
459
|
say("tab: %s" % handle)
|
|
@@ -677,7 +681,8 @@ def _main_checkout(workspace: str) -> str:
|
|
|
677
681
|
|
|
678
682
|
def _audit(workspace: str, record: dict, changed: list, limits: dict, client: OrcaClient,
|
|
679
683
|
clock: Callable[[], float], say: Callable[[str], None], accept_outside: bool = False,
|
|
680
|
-
brake_percent: float = 90.0, task_base: str = "", models: dict | None = None
|
|
684
|
+
brake_percent: float = 90.0, task_base: str = "", models: dict | None = None,
|
|
685
|
+
strict: bool = False) -> int:
|
|
681
686
|
"""One audit round over `changed`; the exit code of `done` (0 approved)."""
|
|
682
687
|
name = os.path.basename(workspace)
|
|
683
688
|
change = "quick-" + name
|
|
@@ -712,13 +717,16 @@ def _audit(workspace: str, record: dict, changed: list, limits: dict, client: Or
|
|
|
712
717
|
dispatch_id = oc.dispatch_id_of(started)
|
|
713
718
|
launch = oc.effective_launch_of(started)
|
|
714
719
|
agent, model = str(launch.get("agent") or pick[0]), str(launch.get("model") or "")
|
|
715
|
-
if not quota.authorized(allowed, agent, model):
|
|
720
|
+
if not quota.authorized(allowed or ([pick] if strict else []), agent, model, strict):
|
|
716
721
|
_stop_worker(client, dispatch_id, say)
|
|
717
|
-
say("Orca launched %s/%s for the audit,
|
|
718
|
-
"verdict is taken" % (agent, model or "?"))
|
|
722
|
+
say("Orca launched %s/%s for the audit, %s: stopped, and no "
|
|
723
|
+
"verdict is taken" % (agent, model or "?", ship.refusal(strict, model)))
|
|
719
724
|
return 126
|
|
720
|
-
|
|
721
|
-
|
|
725
|
+
first = next((models[n][0] for n in ("auditRisky", "audit") if (models or {}).get(n)), quota.OPUS)
|
|
726
|
+
say("audit round %d started on %s/%s (%s); %s%s; waiting up to %d minutes"
|
|
727
|
+
% (rounds + 1, agent, model or pick[1], dispatch_id,
|
|
728
|
+
ship.audit_words("risky:%s" % ("preferred" if tuple(pick) == tuple(first) else "alternative")),
|
|
729
|
+
"" if model else "; model not verified: Orca did not report it", AUDIT_WAIT_SECONDS // 60))
|
|
722
730
|
|
|
723
731
|
previous = _install_handler(_stop_on_signal(client, dispatch_id, say))
|
|
724
732
|
try:
|
|
@@ -1065,7 +1073,8 @@ def done_quick(*, cwd: str = ".", client: OrcaClient, run=verify.run_one,
|
|
|
1065
1073
|
try:
|
|
1066
1074
|
options = {"task_base": handoff_base} if handoff_base else {}
|
|
1067
1075
|
status = _audit(workspace, record, changed, limits, client, clock, say, accept_outside,
|
|
1068
|
-
brake_percent=cfg.brake_percent, models=policy.models,
|
|
1076
|
+
brake_percent=cfg.brake_percent, models=policy.models,
|
|
1077
|
+
strict=policy.require_reported_model, **options)
|
|
1069
1078
|
return _hand_off(workspace, handoff_base, change, say) if status == 0 else status
|
|
1070
1079
|
except OrcaError as error:
|
|
1071
1080
|
return _failed(say, error)
|
|
@@ -68,13 +68,29 @@ def _same_model(agent: str, a: str, b: str) -> bool:
|
|
|
68
68
|
short.isalpha() and full.startswith("claude-%s-" % short) for short, full in ((a, b), (b, a))))
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
def authorized(allowed, agent: str, model: str) -> bool:
|
|
71
|
+
def authorized(allowed, agent: str, model: str, strict: bool = False) -> bool:
|
|
72
72
|
"""May `agent`/`model` (what Orca launched) run under `allowed`, the list its launch was chosen
|
|
73
73
|
from? An empty list restricts nothing. An unknown agent never passes a restriction; a model
|
|
74
|
-
Orca does not report is judged by its agent
|
|
74
|
+
Orca does not report is judged by its agent, and never passes when `strict`."""
|
|
75
|
+
if strict and not model:
|
|
76
|
+
return False
|
|
75
77
|
return not allowed or any(agent == a and (not model or _same_model(a, model, m)) for a, m in allowed)
|
|
76
78
|
|
|
77
79
|
|
|
80
|
+
def identity(requested: str, agent: str, model: str) -> str:
|
|
81
|
+
"""How far what Orca says it launched confirms `requested` ("agent/model"): "reported",
|
|
82
|
+
"substituted", or "unverified" when it names no model. A launch Orca reports is what it
|
|
83
|
+
configured, not what the provider served: only a transcript shows that."""
|
|
84
|
+
wanted, _, name = requested.partition("/")
|
|
85
|
+
if not name:
|
|
86
|
+
return "unverified" # a launch saved before requests were kept
|
|
87
|
+
if agent and agent != wanted:
|
|
88
|
+
return "substituted"
|
|
89
|
+
if not model:
|
|
90
|
+
return "unverified"
|
|
91
|
+
return "reported" if _same_model(wanted, model, name) else "substituted"
|
|
92
|
+
|
|
93
|
+
|
|
78
94
|
WINDOWS = ("session", "weekly")
|
|
79
95
|
_ALWAYS = ("claude", "codex")
|
|
80
96
|
MAX_OBSERVATION_AGE_SECONDS = 15 * 60
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"""What a `rein ship` run did, kept after its state is archived, so `rein token-report --sessions`
|
|
2
|
+
can explain how REIN is used.
|
|
3
|
+
|
|
4
|
+
One JSONL file per run in `~/.claude/rein/ship-events/` ($REIN_EVENTS_DIR moves it; REIN_EVENTS=0
|
|
5
|
+
writes nothing). Only significant changes are recorded, never a poll, and only by code that runs
|
|
6
|
+
anyway: no model turn is spent on it. Nothing here names a project, a path, a task, a person or an
|
|
7
|
+
account, and no prompt, output or answer is kept: ids are hashed, and every other value is a number
|
|
8
|
+
or comes from REIN's own vocabulary. Nothing is sent anywhere. The files stay until `rein
|
|
9
|
+
token-report --prune DAYS --yes` deletes the old ones."""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import hashlib
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
import re
|
|
17
|
+
|
|
18
|
+
import failure_triage as _triage
|
|
19
|
+
import quota as _quota
|
|
20
|
+
|
|
21
|
+
VERSION = 1
|
|
22
|
+
MODES = 0o600
|
|
23
|
+
VERDICTS = ("APPROVED", "CHANGES_REQUESTED", "NO_VERDICT") # the episode file may hold anything
|
|
24
|
+
_CLAUDE = re.compile(r"(?:claude-)?(?:opus|sonnet|haiku|fable)(?:-\d{1,2}){0,2}(?:-20\d{6})?")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def events_dir() -> str:
|
|
28
|
+
return os.environ.get("REIN_EVENTS_DIR") or os.path.expanduser("~/.claude/rein/ship-events")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _opaque(*parts) -> str:
|
|
32
|
+
return hashlib.sha256("\0".join(map(str, parts)).encode("utf-8")).hexdigest()[:12]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def append(run_id: str, at: float, events: list) -> None:
|
|
36
|
+
"""Add one line per event; a record that cannot be written never affects the run."""
|
|
37
|
+
if not events or not run_id or os.environ.get("REIN_EVENTS") == "0":
|
|
38
|
+
return
|
|
39
|
+
run = _opaque(run_id)
|
|
40
|
+
try:
|
|
41
|
+
lines = "".join(json.dumps(dict(
|
|
42
|
+
e, v=VERSION, at=at, run=run, **({"task": _opaque(run_id, e["task"])} if e.get("task") else {})),
|
|
43
|
+
sort_keys=True) + "\n" for e in events)
|
|
44
|
+
os.makedirs(events_dir(), exist_ok=True)
|
|
45
|
+
fd = os.open(os.path.join(events_dir(), run + ".jsonl"), os.O_WRONLY | os.O_APPEND | os.O_CREAT, MODES)
|
|
46
|
+
with os.fdopen(fd, "a", encoding="utf-8") as fh:
|
|
47
|
+
fh.write(lines)
|
|
48
|
+
except (OSError, TypeError, ValueError):
|
|
49
|
+
pass
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def width(tasks) -> int:
|
|
53
|
+
"""The most tasks that could ever run at once: one per repo, and only those whose dependencies
|
|
54
|
+
are done (counted by dependency level, so it is exact for a layered plan)."""
|
|
55
|
+
tasks = {t.id: t for t in tasks}
|
|
56
|
+
level: dict = {}
|
|
57
|
+
|
|
58
|
+
def depth(tid, seen=()):
|
|
59
|
+
if tid not in level:
|
|
60
|
+
deps = [d for d in tasks[tid].deps if d in tasks and d not in seen]
|
|
61
|
+
level[tid] = 1 + max((depth(d, seen + (tid,)) for d in deps), default=0)
|
|
62
|
+
return level[tid]
|
|
63
|
+
|
|
64
|
+
repos: dict = {}
|
|
65
|
+
for tid in tasks:
|
|
66
|
+
repos.setdefault(depth(tid), set()).add(tasks[tid].repo)
|
|
67
|
+
return max((len(r) for r in repos.values()), default=0)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def started(state, resumed: bool, rein: str) -> dict:
|
|
71
|
+
tasks = [t for t in state.tasks.values() if not t.id.startswith(("AUDIT", "GATE"))]
|
|
72
|
+
return {"event": "start", "tasks": len(tasks), "repos": len({t.repo for t in tasks}),
|
|
73
|
+
"edges": sum(len(t.deps) for t in tasks), "width": width(tasks), "resumed": resumed, "rein": rein}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def launched(role: str, task: str, requested: str, reported: str, identity: str, escalated: bool = False,
|
|
77
|
+
attempt: int = 1) -> dict:
|
|
78
|
+
return {"event": "launch", "role": role, "task": task, "requested": _public(requested),
|
|
79
|
+
"reported": _public(reported), "identity": identity, "escalated": escalated, "attempt": attempt}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def finished(done: int, tasks: int, audit: str, delivery: str, usage) -> dict:
|
|
83
|
+
"""`usage`: the run's quota.usage_delta, per provider and window; None where it can't be told."""
|
|
84
|
+
quota = {p: {w: v for w, v in used.items() if w in _quota.WINDOWS}
|
|
85
|
+
for p, used in (usage or {}).items() if p in _quota.DEFAULT_MODELS}
|
|
86
|
+
return {"event": "finish", "done": done, "tasks": tasks, "audit": audit, "delivery": delivery, "quota": quota}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def _public(name: str) -> str:
|
|
90
|
+
"""`agent/model` when REIN knows both; any other name ("other") may hold a customer or an account."""
|
|
91
|
+
agent, _, model = name.partition("/")
|
|
92
|
+
if not agent:
|
|
93
|
+
return ""
|
|
94
|
+
if agent not in _quota.DEFAULT_MODELS:
|
|
95
|
+
agent, model = "other", model and "other"
|
|
96
|
+
elif model and model != _quota.DEFAULT_MODELS[agent] and not (agent == "claude" and _CLAUDE.fullmatch(model)):
|
|
97
|
+
model = "other"
|
|
98
|
+
return "%s/%s" % (agent, model)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def _audit(round_: int, verdict, blocking, basis: str) -> dict:
|
|
102
|
+
return {"event": "audit", "round": round_, "verdict": verdict if verdict in VERDICTS else "other",
|
|
103
|
+
"blocking": blocking if isinstance(blocking, int) else 0, "basis": basis}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def _outcome(event) -> str:
|
|
107
|
+
if event.admission_waiting:
|
|
108
|
+
return "waiting"
|
|
109
|
+
if event.exit_code == 0:
|
|
110
|
+
return "green"
|
|
111
|
+
return "blocked" if event.exit_code == 126 or _triage.is_blocked(event.reason, event.checks) else "red"
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _check(event, scope: str, task: str, then: str) -> dict:
|
|
115
|
+
return {"event": "check", "scope": scope, "task": task, "outcome": _outcome(event),
|
|
116
|
+
"kinds": sorted(set(event.checks or ())), "next": then,
|
|
117
|
+
"seconds": None if event.seconds is None else round(event.seconds, 1)}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def _task_next(task) -> str:
|
|
121
|
+
if task.status == "pending":
|
|
122
|
+
return "escalate" if task.needs_stronger else "worker"
|
|
123
|
+
return {"gating": "rerun", "waiting": "wait", "gated": "ask", "failed": "ask"}.get(task.status, "none")
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def of(old, event, new, now: float) -> list:
|
|
127
|
+
"""The events one `decide(old, event) -> new` step stands for; [] when it changed nothing."""
|
|
128
|
+
name = type(event).__name__
|
|
129
|
+
if name == "GateVerdict":
|
|
130
|
+
before, after = old.tasks.get(event.task_id), new.tasks.get(event.task_id)
|
|
131
|
+
if before is None or before.status != "gating" or before == after:
|
|
132
|
+
return []
|
|
133
|
+
if event.admission_waiting and before.admission_wait:
|
|
134
|
+
return [] # still the same wait
|
|
135
|
+
return [_check(event, "task", event.task_id, _task_next(after))]
|
|
136
|
+
if name == "RepoGateVerdict":
|
|
137
|
+
if old.repo_gates.get(event.repo) != "running" or old == new and event.exit_code:
|
|
138
|
+
return []
|
|
139
|
+
if event.admission_waiting and old.repo_waits.get(event.repo):
|
|
140
|
+
return []
|
|
141
|
+
then = {"passed": "none", "running": "rerun", "waiting": "wait", "failed": "worker"}
|
|
142
|
+
return [_check(event, "repo", event.repo, then.get(new.repo_gates.get(event.repo), "ask"))]
|
|
143
|
+
if name == "WorkerDone" and event.outcome != "succeeded":
|
|
144
|
+
for tid, before in old.tasks.items():
|
|
145
|
+
if before.dispatch_id == event.dispatch_id and before != new.tasks[tid]:
|
|
146
|
+
return [{"event": "worker_failed", "task": tid, "next": _task_next(new.tasks[tid])}]
|
|
147
|
+
if name == "AuditVerdict" and old.phase == "auditing":
|
|
148
|
+
if event.guard:
|
|
149
|
+
return [] # held: it counts once the owner accepts it
|
|
150
|
+
return [_audit(old.audit_rounds + 1, event.verdict, event.blocking, old.audit_basis)]
|
|
151
|
+
if name == "GateResolved" and event.gate_id in old.gates and event.gate_id not in new.gates:
|
|
152
|
+
gate = old.gates[event.gate_id]
|
|
153
|
+
asked = gate.get("opened_at")
|
|
154
|
+
held = old.pending_verdict if gate.get("kind") == "audit_guard" and event.resolution == "accept" \
|
|
155
|
+
and old.phase == "auditing" else {}
|
|
156
|
+
return ([] if gate.get("auto") else [{
|
|
157
|
+
"event": "answer", "kind": gate.get("kind"), "waited": round(now - asked, 1) if asked else None}]) + (
|
|
158
|
+
[_audit(old.audit_rounds + 1, held.get("verdict"), held.get("blocking"), old.audit_basis)] if held else [])
|
|
159
|
+
return []
|