briefloop 0.11.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- briefloop-0.11.12.dist-info/METADATA +473 -0
- briefloop-0.11.12.dist-info/RECORD +424 -0
- briefloop-0.11.12.dist-info/WHEEL +5 -0
- briefloop-0.11.12.dist-info/entry_points.txt +3 -0
- briefloop-0.11.12.dist-info/licenses/LICENSE +22 -0
- briefloop-0.11.12.dist-info/top_level.txt +1 -0
- multi_agent_brief/__init__.py +36 -0
- multi_agent_brief/analysis_blocks/__init__.py +11 -0
- multi_agent_brief/analysis_blocks/builder.py +206 -0
- multi_agent_brief/analysis_blocks/renderer.py +237 -0
- multi_agent_brief/analysis_blocks/schemas.py +52 -0
- multi_agent_brief/analysis_modules/__init__.py +8 -0
- multi_agent_brief/analysis_modules/base.py +87 -0
- multi_agent_brief/analysis_modules/market_competitor/__init__.py +68 -0
- multi_agent_brief/analysis_modules/market_competitor/auditor.py +290 -0
- multi_agent_brief/analysis_modules/market_competitor/config.py +187 -0
- multi_agent_brief/analysis_modules/market_competitor/event_builder.py +226 -0
- multi_agent_brief/analysis_modules/market_competitor/renderer.py +199 -0
- multi_agent_brief/analysis_modules/market_competitor/schemas.py +518 -0
- multi_agent_brief/analysis_modules/policy_regulatory/__init__.py +7 -0
- multi_agent_brief/analysis_modules/policy_regulatory/audit.py +195 -0
- multi_agent_brief/analysis_modules/policy_regulatory/module.py +387 -0
- multi_agent_brief/analysis_modules/policy_regulatory/schemas.py +129 -0
- multi_agent_brief/analysis_modules/registry.py +73 -0
- multi_agent_brief/audience/__init__.py +19 -0
- multi_agent_brief/audience/profiles.py +246 -0
- multi_agent_brief/audience_memory/__init__.py +23 -0
- multi_agent_brief/audience_memory/profile.py +358 -0
- multi_agent_brief/audit/__init__.py +36 -0
- multi_agent_brief/audit/case_applicability.py +181 -0
- multi_agent_brief/audit/deterministic.py +471 -0
- multi_agent_brief/audit/editorial_governance.py +404 -0
- multi_agent_brief/audit/final_quality.py +764 -0
- multi_agent_brief/audit/harness.py +242 -0
- multi_agent_brief/audit/interfaces.py +96 -0
- multi_agent_brief/audit/limitation_hygiene.py +238 -0
- multi_agent_brief/audit/proposal_boundary.py +34 -0
- multi_agent_brief/audit/redaction.py +27 -0
- multi_agent_brief/audit/rule_packs.py +96 -0
- multi_agent_brief/audit/semantic.py +435 -0
- multi_agent_brief/capabilities/__init__.py +22 -0
- multi_agent_brief/capabilities/catalog.py +215 -0
- multi_agent_brief/capabilities/detect.py +199 -0
- multi_agent_brief/capabilities/models.py +60 -0
- multi_agent_brief/capabilities/recommend.py +206 -0
- multi_agent_brief/cli/__init__.py +2 -0
- multi_agent_brief/cli/analysis_commands.py +140 -0
- multi_agent_brief/cli/approval_commands.py +107 -0
- multi_agent_brief/cli/audit_commands.py +59 -0
- multi_agent_brief/cli/capability_commands.py +548 -0
- multi_agent_brief/cli/claude_commands.py +159 -0
- multi_agent_brief/cli/competitors_commands.py +182 -0
- multi_agent_brief/cli/controls_commands.py +137 -0
- multi_agent_brief/cli/deliver_commands.py +942 -0
- multi_agent_brief/cli/eval_cases_commands.py +99 -0
- multi_agent_brief/cli/experiments_commands.py +395 -0
- multi_agent_brief/cli/feedback_commands.py +192 -0
- multi_agent_brief/cli/finalize_commands.py +153 -0
- multi_agent_brief/cli/gates_commands.py +174 -0
- multi_agent_brief/cli/hermes_commands.py +356 -0
- multi_agent_brief/cli/improve_commands.py +224 -0
- multi_agent_brief/cli/init_commands.py +564 -0
- multi_agent_brief/cli/init_wizard.py +1473 -0
- multi_agent_brief/cli/input_commands.py +237 -0
- multi_agent_brief/cli/main.py +288 -0
- multi_agent_brief/cli/onboard_commands.py +193 -0
- multi_agent_brief/cli/product_commands.py +1449 -0
- multi_agent_brief/cli/provenance_commands.py +100 -0
- multi_agent_brief/cli/release_commands.py +68 -0
- multi_agent_brief/cli/repair_commands.py +169 -0
- multi_agent_brief/cli/run_commands.py +292 -0
- multi_agent_brief/cli/runtime_commands.py +81 -0
- multi_agent_brief/cli/secrets_commands.py +232 -0
- multi_agent_brief/cli/semantic_support_commands.py +80 -0
- multi_agent_brief/cli/sources_commands.py +647 -0
- multi_agent_brief/cli/start_commands.py +8 -0
- multi_agent_brief/cli/state_commands.py +446 -0
- multi_agent_brief/cli/status_commands.py +26 -0
- multi_agent_brief/cli/workbuddy_commands.py +103 -0
- multi_agent_brief/configs/artifact_contracts.yaml +514 -0
- multi_agent_brief/configs/orchestrator_contract.yaml +181 -0
- multi_agent_brief/configs/policy_packs/default.yaml +65 -0
- multi_agent_brief/configs/policy_profiles/evidence_extract_default.yaml +58 -0
- multi_agent_brief/configs/policy_profiles/finance_default.yaml +44 -0
- multi_agent_brief/configs/policy_profiles/internet_default.yaml +44 -0
- multi_agent_brief/configs/policy_profiles/manufacturing_default.yaml +33 -0
- multi_agent_brief/configs/policy_profiles/solar_manufacturing_default.yaml +64 -0
- multi_agent_brief/configs/report_packs/evidence_extract.yaml +48 -0
- multi_agent_brief/configs/report_packs/management_monthly.yaml +36 -0
- multi_agent_brief/configs/report_packs/market_weekly.yaml +36 -0
- multi_agent_brief/configs/report_packs/solar_industry_periodic.yaml +50 -0
- multi_agent_brief/configs/report_templates/evidence_extract.yaml +55 -0
- multi_agent_brief/configs/report_templates/management_monthly.yaml +48 -0
- multi_agent_brief/configs/report_templates/market_weekly.yaml +49 -0
- multi_agent_brief/configs/report_templates/solar_industry_periodic.yaml +75 -0
- multi_agent_brief/configs/stage_specs.yaml +180 -0
- multi_agent_brief/contracts/__init__.py +41 -0
- multi_agent_brief/contracts/base.py +99 -0
- multi_agent_brief/contracts/errors.py +41 -0
- multi_agent_brief/contracts/migrations/__init__.py +5 -0
- multi_agent_brief/contracts/migrations/claim_v1_to_v2.py +33 -0
- multi_agent_brief/contracts/registry.py +159 -0
- multi_agent_brief/contracts/role_topology.py +25 -0
- multi_agent_brief/contracts/schemas/__init__.py +35 -0
- multi_agent_brief/contracts/schemas/analysis_pack.py +135 -0
- multi_agent_brief/contracts/schemas/atomic_claim_graph.py +304 -0
- multi_agent_brief/contracts/schemas/audit_report.py +80 -0
- multi_agent_brief/contracts/schemas/candidate_item.py +51 -0
- multi_agent_brief/contracts/schemas/claim.py +197 -0
- multi_agent_brief/contracts/schemas/claim_draft.py +386 -0
- multi_agent_brief/contracts/schemas/claim_support_matrix.py +334 -0
- multi_agent_brief/contracts/schemas/evidence_span_registry.py +270 -0
- multi_agent_brief/contracts/schemas/policy_profile.py +247 -0
- multi_agent_brief/contracts/schemas/report_spec.py +257 -0
- multi_agent_brief/contracts/schemas/semantic_assessment_report.py +480 -0
- multi_agent_brief/contracts/schemas/source_evidence_pack_manifest.py +233 -0
- multi_agent_brief/contracts/schemas/source_item.py +96 -0
- multi_agent_brief/contracts/semantic_assessment_status.py +12 -0
- multi_agent_brief/contracts/source_metadata.py +252 -0
- multi_agent_brief/contracts/target_contract.py +460 -0
- multi_agent_brief/contracts/validator.py +225 -0
- multi_agent_brief/controls/__init__.py +23 -0
- multi_agent_brief/controls/contract.py +106 -0
- multi_agent_brief/controls/switchboard.py +1076 -0
- multi_agent_brief/core/__init__.py +2 -0
- multi_agent_brief/core/citations.py +14 -0
- multi_agent_brief/core/claim_ledger.py +94 -0
- multi_agent_brief/core/config.py +191 -0
- multi_agent_brief/core/env.py +69 -0
- multi_agent_brief/core/previous.py +83 -0
- multi_agent_brief/core/schemas.py +181 -0
- multi_agent_brief/core/selection.py +189 -0
- multi_agent_brief/delivery/__init__.py +6 -0
- multi_agent_brief/delivery/base.py +36 -0
- multi_agent_brief/delivery/feishu.py +204 -0
- multi_agent_brief/delivery/gws.py +237 -0
- multi_agent_brief/evaluation_cases/__init__.py +15 -0
- multi_agent_brief/evaluation_cases/contract.py +429 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/approved_guidance_materialized/workspace/config.yaml +18 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/approved_guidance_materialized/workspace/improvement/ledger.jsonl +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/approved_guidance_materialized/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/approved_guidance_materialized/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/company_event_missing_latest_official_check/workspace/config.yaml +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/company_event_missing_latest_official_check/workspace/sources.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/company_event_missing_latest_official_check/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/control_switchboard_selection_is_not_execution/workspace/config.yaml +12 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/control_switchboard_selection_is_not_execution/workspace/sources.yaml +6 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/control_switchboard_selection_is_not_execution/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/feedback_triage_required/workspace/config.yaml +6 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/feedback_triage_required/workspace/input/human_feedback.md +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/feedback_triage_required/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/feedback_triage_required/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/config.yaml +8 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/output/brief.md +14 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/output/intermediate/audit_report.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/output/intermediate/audited_brief.md +5 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/output/intermediate/candidate_claims.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/output/intermediate/claim_ledger.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/output/intermediate/screened_candidates.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/final_abstract_quality_warning_surface/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/formal_release_missing_human_approval/workspace/config.yaml +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/formal_release_missing_human_approval/workspace/sources.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/formal_release_missing_human_approval/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/guidance_manifestation_not_observable/workspace/config.yaml +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/guidance_manifestation_not_observable/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/guidance_manifestation_not_observable/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/media_only_legal_policy_blocks_research_review/workspace/config.yaml +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/media_only_legal_policy_blocks_research_review/workspace/sources.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/media_only_legal_policy_blocks_research_review/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/mixed_metric_scope_support_blocker/workspace/config.yaml +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/mixed_metric_scope_support_blocker/workspace/sources.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/mixed_metric_scope_support_blocker/workspace/user.md +5 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/config.yaml +6 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/output/intermediate/audited_brief.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/output/intermediate/candidate_claims.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/output/intermediate/claim_ledger.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/output/intermediate/feedback_issues.json +25 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/output/intermediate/repair_plan.json +27 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/output/intermediate/screened_candidates.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/planned_blocking_issue_cannot_continue/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/config.yaml +8 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/output/intermediate/audit_report.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/output/intermediate/audited_brief.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/output/intermediate/candidate_claims.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/output/intermediate/claim_ledger.json +11 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/output/intermediate/quality_gate_report.json +22 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/output/intermediate/screened_candidates.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/provenance_projection_minimal/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_source_appendix/workspace/config.yaml +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_source_appendix/workspace/output/intermediate/audit_report.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_source_appendix/workspace/output/intermediate/audited_brief.md +5 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_source_appendix/workspace/output/intermediate/candidate_claims.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_source_appendix/workspace/output/intermediate/claim_ledger.json +40 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_source_appendix/workspace/output/intermediate/screened_candidates.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_source_appendix/workspace/sources.yaml +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_source_appendix/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/config.yaml +8 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/output/brief.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/output/intermediate/audit_report.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/output/intermediate/audited_brief.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/output/intermediate/candidate_claims.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/output/intermediate/claim_ledger.json +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/output/intermediate/screened_candidates.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reader_facing_target_relevance/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/release_readiness_forged_event_blocker/workspace/config.yaml +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/release_readiness_forged_event_blocker/workspace/output/intermediate/release_readiness_report.json +31 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/release_readiness_forged_event_blocker/workspace/sources.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/release_readiness_forged_event_blocker/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reverted_entry_removed_from_next_snapshot/workspace/config.yaml +18 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reverted_entry_removed_from_next_snapshot/workspace/improvement/ledger.jsonl +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reverted_entry_removed_from_next_snapshot/workspace/improvement/memory.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reverted_entry_removed_from_next_snapshot/workspace/output/intermediate/improvement_memory_snapshot.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reverted_entry_removed_from_next_snapshot/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/reverted_entry_removed_from_next_snapshot/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/config.yaml +12 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/input/sources/source-001.txt +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/brief.md +37 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/delivery/brief.md +37 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/atomic_claim_graph.json +17 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/audit_report.json +5 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/audited_brief.md +37 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/claim_ledger.json +20 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/evidence_span_registry.json +20 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/finalize_report.json +40 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/gates/auditor_quality_gate_report.json +42 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/gates/finalize_quality_gate_report.json +42 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/intermediate/screened_candidates.json +33 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/source_appendix.md +12 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/output/source_appendix_trace.md +10 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/report_spec.yaml +24 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/sources.yaml +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/same_evidence_reader_quality_regression/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/source_evidence_pack_blocks_non_evidence_file/workspace/config.yaml +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/source_evidence_pack_blocks_non_evidence_file/workspace/input/sources/README.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/source_evidence_pack_blocks_non_evidence_file/workspace/output/intermediate/source_evidence_pack_manifest.json +26 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/source_evidence_pack_blocks_non_evidence_file/workspace/sources.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/source_evidence_pack_blocks_non_evidence_file/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/stale_current_claim/workspace/config.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/stale_current_claim/workspace/output/intermediate/audit_report.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/stale_current_claim/workspace/output/intermediate/audited_brief.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/stale_current_claim/workspace/output/intermediate/candidate_claims.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/stale_current_claim/workspace/output/intermediate/claim_ledger.json +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/stale_current_claim/workspace/output/intermediate/screened_candidates.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/stale_current_claim/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/stale_current_claim/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/third_party_price_snapshot_formal_block/workspace/config.yaml +13 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/third_party_price_snapshot_formal_block/workspace/sources.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/third_party_price_snapshot_formal_block/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/trajectory_retry_budget_exhausted/workspace/config.yaml +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/trajectory_retry_budget_exhausted/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/trajectory_retry_budget_exhausted/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unapproved_entry_not_materialized/workspace/config.yaml +18 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unapproved_entry_not_materialized/workspace/improvement/ledger.jsonl +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unapproved_entry_not_materialized/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unapproved_entry_not_materialized/workspace/user.md +4 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unauthorized_institution_branding_blocks_release/workspace/config.yaml +18 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unauthorized_institution_branding_blocks_release/workspace/sources.yaml +9 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unauthorized_institution_branding_blocks_release/workspace/user.md +5 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unsupported_material_fact/workspace/config.yaml +8 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unsupported_material_fact/workspace/output/intermediate/audit_report.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unsupported_material_fact/workspace/output/intermediate/audited_brief.md +8 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unsupported_material_fact/workspace/output/intermediate/candidate_claims.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unsupported_material_fact/workspace/output/intermediate/claim_ledger.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unsupported_material_fact/workspace/output/intermediate/screened_candidates.json +1 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unsupported_material_fact/workspace/sources.yaml +2 -0
- multi_agent_brief/evaluation_cases/fixtures/cases/unsupported_material_fact/workspace/user.md +3 -0
- multi_agent_brief/evaluation_cases/fixtures/manifest.yaml +861 -0
- multi_agent_brief/evaluation_cases/fixtures.py +20 -0
- multi_agent_brief/evaluation_cases/runner.py +1603 -0
- multi_agent_brief/experiments/__init__.py +45 -0
- multi_agent_brief/experiments/experiment_080.py +5835 -0
- multi_agent_brief/experiments/schemas.py +63 -0
- multi_agent_brief/experiments/target_contract.py +10 -0
- multi_agent_brief/feedback/__init__.py +17 -0
- multi_agent_brief/feedback/feedback_contract.py +482 -0
- multi_agent_brief/feedback/feedback_state.py +898 -0
- multi_agent_brief/hermes/__init__.py +25 -0
- multi_agent_brief/hermes/adapter.py +832 -0
- multi_agent_brief/improvement/__init__.py +83 -0
- multi_agent_brief/improvement/contract.py +1114 -0
- multi_agent_brief/improvement/memory.py +451 -0
- multi_agent_brief/improvement/product_definition.py +228 -0
- multi_agent_brief/improvement/state.py +961 -0
- multi_agent_brief/inputs/__init__.py +2 -0
- multi_agent_brief/inputs/classifier.py +322 -0
- multi_agent_brief/inputs/contracts.py +59 -0
- multi_agent_brief/inputs/extractor.py +310 -0
- multi_agent_brief/install/__init__.py +2 -0
- multi_agent_brief/install/writer.py +97 -0
- multi_agent_brief/onboarding/__init__.py +11 -0
- multi_agent_brief/onboarding/io.py +103 -0
- multi_agent_brief/onboarding/mapper.py +484 -0
- multi_agent_brief/onboarding/schema.py +46 -0
- multi_agent_brief/orchestrator/__init__.py +2 -0
- multi_agent_brief/orchestrator/fact_layer_import.py +352 -0
- multi_agent_brief/orchestrator/handoff.py +2209 -0
- multi_agent_brief/orchestrator/role_topology.py +42 -0
- multi_agent_brief/orchestrator/run_archive.py +888 -0
- multi_agent_brief/orchestrator/run_integrity.py +346 -0
- multi_agent_brief/orchestrator/runtime_state/__init__.py +70 -0
- multi_agent_brief/orchestrator/runtime_state/_io.py +167 -0
- multi_agent_brief/orchestrator/runtime_state/_transactions.py +298 -0
- multi_agent_brief/orchestrator/runtime_state/artifact_registry.py +1825 -0
- multi_agent_brief/orchestrator/runtime_state/atomic_claim_graph.py +96 -0
- multi_agent_brief/orchestrator/runtime_state/claim_ledger_freeze.py +510 -0
- multi_agent_brief/orchestrator/runtime_state/claim_metadata_enrichment.py +836 -0
- multi_agent_brief/orchestrator/runtime_state/claim_support_matrix.py +582 -0
- multi_agent_brief/orchestrator/runtime_state/completion_gates.py +672 -0
- multi_agent_brief/orchestrator/runtime_state/contracts_loader.py +66 -0
- multi_agent_brief/orchestrator/runtime_state/decisions.py +239 -0
- multi_agent_brief/orchestrator/runtime_state/errors.py +61 -0
- multi_agent_brief/orchestrator/runtime_state/event_log.py +256 -0
- multi_agent_brief/orchestrator/runtime_state/evidence_span_registry.py +233 -0
- multi_agent_brief/orchestrator/runtime_state/fact_layer.py +755 -0
- multi_agent_brief/orchestrator/runtime_state/identity.py +90 -0
- multi_agent_brief/orchestrator/runtime_state/lifecycle.py +675 -0
- multi_agent_brief/orchestrator/runtime_state/manifest.py +82 -0
- multi_agent_brief/orchestrator/runtime_state/operations.py +224 -0
- multi_agent_brief/orchestrator/runtime_state/paths.py +38 -0
- multi_agent_brief/orchestrator/runtime_state/repair.py +984 -0
- multi_agent_brief/orchestrator/runtime_state/safety_surfaces.py +147 -0
- multi_agent_brief/orchestrator/runtime_state/semantic_assessment_report.py +692 -0
- multi_agent_brief/orchestrator/runtime_state/semantic_support_acceptance.py +683 -0
- multi_agent_brief/orchestrator/runtime_state/source_evidence_pack.py +131 -0
- multi_agent_brief/orchestrator/runtime_state/stage_completion.py +1320 -0
- multi_agent_brief/orchestrator/runtime_state/trajectory.py +200 -0
- multi_agent_brief/orchestrator/runtime_state/workflow.py +350 -0
- multi_agent_brief/orchestrator/source_evidence.py +43 -0
- multi_agent_brief/orchestrator/timing.py +410 -0
- multi_agent_brief/orchestrator_contract.py +96 -0
- multi_agent_brief/outputs/__init__.py +2 -0
- multi_agent_brief/outputs/atomic_reader_projection.py +288 -0
- multi_agent_brief/outputs/docx.py +32 -0
- multi_agent_brief/outputs/finalize.py +1036 -0
- multi_agent_brief/outputs/ib_docx.py +983 -0
- multi_agent_brief/outputs/naming.py +38 -0
- multi_agent_brief/outputs/pdf.py +20 -0
- multi_agent_brief/outputs/reader_final_gate.py +509 -0
- multi_agent_brief/outputs/reader_projection.py +397 -0
- multi_agent_brief/outputs/source_appendix.py +753 -0
- multi_agent_brief/outputs/templates/__init__.py +112 -0
- multi_agent_brief/product/__init__.py +49 -0
- multi_agent_brief/product/bundle_projection.py +686 -0
- multi_agent_brief/product/citation_profile.py +145 -0
- multi_agent_brief/product/guidance_manifestation.py +421 -0
- multi_agent_brief/product/materiality_selection.py +472 -0
- multi_agent_brief/product/policy_gate_adapter.py +116 -0
- multi_agent_brief/product/policy_profile.py +39 -0
- multi_agent_brief/product/policy_projection.py +161 -0
- multi_agent_brief/product/policy_registry.py +83 -0
- multi_agent_brief/product/policy_resolver.py +225 -0
- multi_agent_brief/product/quality_closeout.py +188 -0
- multi_agent_brief/product/quality_panel.py +2217 -0
- multi_agent_brief/product/release_approval.py +1034 -0
- multi_agent_brief/product/report_pack.py +130 -0
- multi_agent_brief/product/report_pack_aliases.py +68 -0
- multi_agent_brief/product/report_registry.py +101 -0
- multi_agent_brief/product/report_spec.py +181 -0
- multi_agent_brief/product/support_wording.py +525 -0
- multi_agent_brief/product/template_conformance.py +516 -0
- multi_agent_brief/product/template_projection.py +123 -0
- multi_agent_brief/product/template_registry.py +244 -0
- multi_agent_brief/product/template_render_plan.py +315 -0
- multi_agent_brief/product/template_renderer.py +224 -0
- multi_agent_brief/product/trajectory_regulation.py +441 -0
- multi_agent_brief/provenance/__init__.py +5 -0
- multi_agent_brief/provenance/builder.py +841 -0
- multi_agent_brief/provenance/contract.py +21 -0
- multi_agent_brief/provenance/io.py +144 -0
- multi_agent_brief/provenance/model.py +110 -0
- multi_agent_brief/provenance/references.py +43 -0
- multi_agent_brief/provenance/validator.py +135 -0
- multi_agent_brief/quality_gates/__init__.py +19 -0
- multi_agent_brief/quality_gates/contract.py +581 -0
- multi_agent_brief/quality_gates/state.py +2498 -0
- multi_agent_brief/repair/__init__.py +5 -0
- multi_agent_brief/repair/router.py +842 -0
- multi_agent_brief/runtime_assets.py +431 -0
- multi_agent_brief/sources/__init__.py +16 -0
- multi_agent_brief/sources/api_filings.py +236 -0
- multi_agent_brief/sources/api_news.py +174 -0
- multi_agent_brief/sources/base.py +142 -0
- multi_agent_brief/sources/cached_package.py +119 -0
- multi_agent_brief/sources/cli_provider.py +263 -0
- multi_agent_brief/sources/coverage.py +336 -0
- multi_agent_brief/sources/decider.py +756 -0
- multi_agent_brief/sources/doctor.py +373 -0
- multi_agent_brief/sources/evidence_pack.py +364 -0
- multi_agent_brief/sources/feishu_provider.py +326 -0
- multi_agent_brief/sources/filing_resolver.py +400 -0
- multi_agent_brief/sources/industry_packs.py +130 -0
- multi_agent_brief/sources/join.py +206 -0
- multi_agent_brief/sources/local_signal.py +81 -0
- multi_agent_brief/sources/local_signal_planner.py +636 -0
- multi_agent_brief/sources/manual.py +259 -0
- multi_agent_brief/sources/mcp_provider.py +309 -0
- multi_agent_brief/sources/mineru_provider.py +601 -0
- multi_agent_brief/sources/normalizer.py +95 -0
- multi_agent_brief/sources/opencli_provider.py +282 -0
- multi_agent_brief/sources/planner.py +178 -0
- multi_agent_brief/sources/registry.py +367 -0
- multi_agent_brief/sources/rss.py +190 -0
- multi_agent_brief/sources/search_backends/__init__.py +31 -0
- multi_agent_brief/sources/search_backends/base.py +51 -0
- multi_agent_brief/sources/search_backends/brave.py +192 -0
- multi_agent_brief/sources/search_backends/capabilities.py +94 -0
- multi_agent_brief/sources/search_backends/exa.py +180 -0
- multi_agent_brief/sources/search_backends/firecrawl.py +164 -0
- multi_agent_brief/sources/search_backends/serper.py +241 -0
- multi_agent_brief/sources/search_backends/tavily.py +124 -0
- multi_agent_brief/sources/sourcehub.py +505 -0
- multi_agent_brief/sources/web_search.py +267 -0
- multi_agent_brief/status.py +966 -0
- multi_agent_brief/tools/__init__.py +3 -0
- multi_agent_brief/tools/draft_cleanup.py +198 -0
- multi_agent_brief/workbuddy/__init__.py +1 -0
- multi_agent_brief/workbuddy/diagnose.py +569 -0
- multi_agent_brief/workbuddy/skill_pack.py +309 -0
- multi_agent_brief/workspace/__init__.py +1 -0
- multi_agent_brief/workspace/init_profile.py +45 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
"""Runtime state CLI commands for the Orchestrator handoff layer."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from multi_agent_brief.orchestrator.runtime_state import (
|
|
10
|
+
RuntimeStateError,
|
|
11
|
+
check_runtime_state,
|
|
12
|
+
complete_finalize_transaction,
|
|
13
|
+
complete_stage_transaction,
|
|
14
|
+
enrich_claim_metadata_transaction,
|
|
15
|
+
freeze_claim_ledger_transaction,
|
|
16
|
+
import_fact_layer_transaction,
|
|
17
|
+
initialize_runtime_state,
|
|
18
|
+
record_decision,
|
|
19
|
+
show_runtime_state,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def register(subparsers: argparse._SubParsersAction) -> None:
|
|
24
|
+
state_parser = subparsers.add_parser(
|
|
25
|
+
"state",
|
|
26
|
+
help="Inspect and update Orchestrator runtime state.",
|
|
27
|
+
)
|
|
28
|
+
actions = state_parser.add_subparsers(dest="state_action", required=True)
|
|
29
|
+
|
|
30
|
+
init_parser = actions.add_parser(
|
|
31
|
+
"init",
|
|
32
|
+
help="Initialize runtime state control files for a workspace.",
|
|
33
|
+
)
|
|
34
|
+
init_parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
35
|
+
init_parser.add_argument(
|
|
36
|
+
"--runtime",
|
|
37
|
+
default="hermes",
|
|
38
|
+
help="Runtime name recorded in runtime_manifest.json (default: hermes).",
|
|
39
|
+
)
|
|
40
|
+
init_parser.add_argument(
|
|
41
|
+
"--repo-workdir",
|
|
42
|
+
help="Repository or packaged contract base (default: auto-detect).",
|
|
43
|
+
)
|
|
44
|
+
init_parser.add_argument(
|
|
45
|
+
"--reset-state",
|
|
46
|
+
action="store_true",
|
|
47
|
+
help="Archive the old event log and create a new runtime run_id.",
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
show_parser = actions.add_parser(
|
|
51
|
+
"show",
|
|
52
|
+
help="Show current runtime state.",
|
|
53
|
+
)
|
|
54
|
+
show_parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
55
|
+
show_parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
56
|
+
|
|
57
|
+
check_parser = actions.add_parser(
|
|
58
|
+
"check",
|
|
59
|
+
help="Refresh artifact registry and stage readiness without running stages.",
|
|
60
|
+
)
|
|
61
|
+
check_parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
62
|
+
check_parser.add_argument(
|
|
63
|
+
"--repo-workdir",
|
|
64
|
+
help="Repository or packaged contract base (default: auto-detect).",
|
|
65
|
+
)
|
|
66
|
+
check_parser.add_argument(
|
|
67
|
+
"--strict",
|
|
68
|
+
action="store_true",
|
|
69
|
+
help="Return non-zero if the current stage is blocked.",
|
|
70
|
+
)
|
|
71
|
+
check_parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
72
|
+
|
|
73
|
+
decide_parser = actions.add_parser(
|
|
74
|
+
"decide",
|
|
75
|
+
help="Record an Orchestrator decision event.",
|
|
76
|
+
)
|
|
77
|
+
decide_parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
78
|
+
decide_parser.add_argument("--stage", required=True, help="Stage id receiving the decision.")
|
|
79
|
+
decide_parser.add_argument("--decision", required=True, help="Orchestrator decision vocabulary value.")
|
|
80
|
+
decide_parser.add_argument("--reason", required=True, help="Short reason summary.")
|
|
81
|
+
decide_parser.add_argument(
|
|
82
|
+
"--repo-workdir",
|
|
83
|
+
help="Repository or packaged contract base (default: auto-detect).",
|
|
84
|
+
)
|
|
85
|
+
decide_parser.add_argument(
|
|
86
|
+
"--actor",
|
|
87
|
+
default="orchestrator",
|
|
88
|
+
choices=("cli", "orchestrator", "runtime", "system"),
|
|
89
|
+
help="Actor recorded in event_log.jsonl.",
|
|
90
|
+
)
|
|
91
|
+
decide_parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
92
|
+
|
|
93
|
+
stage_complete_parser = actions.add_parser(
|
|
94
|
+
"stage-complete",
|
|
95
|
+
help="Validate and record a successful current-stage completion transaction.",
|
|
96
|
+
)
|
|
97
|
+
stage_complete_parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
98
|
+
stage_complete_parser.add_argument("--stage", required=True, help="Current non-finalize stage id to complete.")
|
|
99
|
+
stage_complete_parser.add_argument("--reason", required=True, help="Short completion reason summary.")
|
|
100
|
+
stage_complete_parser.add_argument(
|
|
101
|
+
"--repo-workdir",
|
|
102
|
+
help="Repository or packaged contract base (default: auto-detect).",
|
|
103
|
+
)
|
|
104
|
+
stage_complete_parser.add_argument(
|
|
105
|
+
"--actor",
|
|
106
|
+
default="orchestrator",
|
|
107
|
+
choices=("cli", "orchestrator", "runtime", "system"),
|
|
108
|
+
help="Actor recorded in event_log.jsonl.",
|
|
109
|
+
)
|
|
110
|
+
stage_complete_parser.add_argument(
|
|
111
|
+
"--runtime",
|
|
112
|
+
help="Runtime that completed the stage, recorded as provenance only.",
|
|
113
|
+
)
|
|
114
|
+
stage_complete_parser.add_argument(
|
|
115
|
+
"--model",
|
|
116
|
+
help="Model used for the stage when known, recorded as provenance only.",
|
|
117
|
+
)
|
|
118
|
+
stage_complete_parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
119
|
+
|
|
120
|
+
freeze_claim_ledger_parser = actions.add_parser(
|
|
121
|
+
"freeze-claim-ledger",
|
|
122
|
+
help="Freeze claim_drafts.json into deterministic claim_ledger.json.",
|
|
123
|
+
)
|
|
124
|
+
freeze_claim_ledger_parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
125
|
+
freeze_claim_ledger_parser.add_argument(
|
|
126
|
+
"--repo-workdir",
|
|
127
|
+
help="Repository or packaged contract base (default: auto-detect).",
|
|
128
|
+
)
|
|
129
|
+
freeze_claim_ledger_parser.add_argument(
|
|
130
|
+
"--actor",
|
|
131
|
+
default="cli",
|
|
132
|
+
choices=("cli", "orchestrator", "runtime", "system"),
|
|
133
|
+
help="Actor recorded in event_log.jsonl.",
|
|
134
|
+
)
|
|
135
|
+
freeze_claim_ledger_parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
136
|
+
|
|
137
|
+
enrich_claim_metadata_parser = actions.add_parser(
|
|
138
|
+
"enrich-claim-metadata",
|
|
139
|
+
help="Enrich frozen claim_ledger.json metadata from imported source evidence.",
|
|
140
|
+
)
|
|
141
|
+
enrich_claim_metadata_parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
142
|
+
enrich_claim_metadata_parser.add_argument(
|
|
143
|
+
"--from-source-evidence",
|
|
144
|
+
action="store_true",
|
|
145
|
+
required=True,
|
|
146
|
+
help="Derive metadata only from imported frozen source evidence.",
|
|
147
|
+
)
|
|
148
|
+
enrich_claim_metadata_parser.add_argument(
|
|
149
|
+
"--repo-workdir",
|
|
150
|
+
help="Repository or packaged contract base (default: auto-detect).",
|
|
151
|
+
)
|
|
152
|
+
enrich_claim_metadata_parser.add_argument(
|
|
153
|
+
"--actor",
|
|
154
|
+
default="cli",
|
|
155
|
+
choices=("cli", "orchestrator", "runtime", "system"),
|
|
156
|
+
help="Actor recorded in event_log.jsonl.",
|
|
157
|
+
)
|
|
158
|
+
enrich_claim_metadata_parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
159
|
+
|
|
160
|
+
finalize_complete_parser = actions.add_parser(
|
|
161
|
+
"finalize-complete",
|
|
162
|
+
help="Validate reader-final artifacts and record finalize completion.",
|
|
163
|
+
)
|
|
164
|
+
finalize_complete_parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
165
|
+
finalize_complete_parser.add_argument("--reason", required=True, help="Short completion reason summary.")
|
|
166
|
+
finalize_complete_parser.add_argument(
|
|
167
|
+
"--repo-workdir",
|
|
168
|
+
help="Repository or packaged contract base (default: auto-detect).",
|
|
169
|
+
)
|
|
170
|
+
finalize_complete_parser.add_argument(
|
|
171
|
+
"--actor",
|
|
172
|
+
default="orchestrator",
|
|
173
|
+
choices=("cli", "orchestrator", "runtime", "system"),
|
|
174
|
+
help="Actor recorded in event_log.jsonl.",
|
|
175
|
+
)
|
|
176
|
+
finalize_complete_parser.add_argument(
|
|
177
|
+
"--runtime",
|
|
178
|
+
help="Runtime that completed the finalize stage, recorded as provenance only.",
|
|
179
|
+
)
|
|
180
|
+
finalize_complete_parser.add_argument(
|
|
181
|
+
"--model",
|
|
182
|
+
help="Model used for finalize when known, recorded as provenance only.",
|
|
183
|
+
)
|
|
184
|
+
finalize_complete_parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
185
|
+
|
|
186
|
+
import_fact_layer_parser = actions.add_parser(
|
|
187
|
+
"import-fact-layer",
|
|
188
|
+
help="Import a complete archived frozen fact layer into a new fast-rerun runtime state.",
|
|
189
|
+
)
|
|
190
|
+
import_fact_layer_parser.add_argument("--workspace", required=True, help="Path to target workspace directory.")
|
|
191
|
+
import_fact_layer_parser.add_argument(
|
|
192
|
+
"--archive",
|
|
193
|
+
required=True,
|
|
194
|
+
help="Path to an output/runs/<run_id>/ archive directory or its manifest.json.",
|
|
195
|
+
)
|
|
196
|
+
import_fact_layer_parser.add_argument(
|
|
197
|
+
"--runtime",
|
|
198
|
+
default="hermes",
|
|
199
|
+
help="Runtime name recorded in the new runtime_manifest.json (default: hermes).",
|
|
200
|
+
)
|
|
201
|
+
import_fact_layer_parser.add_argument(
|
|
202
|
+
"--repo-workdir",
|
|
203
|
+
help="Repository or packaged contract base (default: auto-detect).",
|
|
204
|
+
)
|
|
205
|
+
import_fact_layer_parser.add_argument(
|
|
206
|
+
"--actor",
|
|
207
|
+
default="cli",
|
|
208
|
+
choices=("cli", "orchestrator", "runtime", "system"),
|
|
209
|
+
help="Actor recorded in event_log.jsonl.",
|
|
210
|
+
)
|
|
211
|
+
import_fact_layer_parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def handle(args: argparse.Namespace) -> int:
|
|
215
|
+
try:
|
|
216
|
+
if args.state_action == "init":
|
|
217
|
+
state = initialize_runtime_state(
|
|
218
|
+
workspace=args.workspace,
|
|
219
|
+
runtime=args.runtime,
|
|
220
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
221
|
+
reset_state=getattr(args, "reset_state", False),
|
|
222
|
+
)
|
|
223
|
+
_print_human_summary("state init", state)
|
|
224
|
+
return 0
|
|
225
|
+
|
|
226
|
+
if args.state_action == "show":
|
|
227
|
+
state = show_runtime_state(workspace=args.workspace)
|
|
228
|
+
if getattr(args, "json", False):
|
|
229
|
+
print(json.dumps(state, ensure_ascii=False, indent=2, sort_keys=True))
|
|
230
|
+
else:
|
|
231
|
+
_print_human_summary("state show", state)
|
|
232
|
+
return 0
|
|
233
|
+
|
|
234
|
+
if args.state_action == "check":
|
|
235
|
+
state = check_runtime_state(
|
|
236
|
+
workspace=args.workspace,
|
|
237
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
238
|
+
)
|
|
239
|
+
if getattr(args, "json", False):
|
|
240
|
+
print(json.dumps(state, ensure_ascii=False, indent=2, sort_keys=True))
|
|
241
|
+
else:
|
|
242
|
+
_print_human_summary("state check", state)
|
|
243
|
+
return 1 if args.strict and _is_blocked(state) else 0
|
|
244
|
+
|
|
245
|
+
if args.state_action == "decide":
|
|
246
|
+
state = record_decision(
|
|
247
|
+
workspace=args.workspace,
|
|
248
|
+
stage_id=args.stage,
|
|
249
|
+
decision=args.decision,
|
|
250
|
+
reason=args.reason,
|
|
251
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
252
|
+
actor=args.actor,
|
|
253
|
+
)
|
|
254
|
+
if getattr(args, "json", False):
|
|
255
|
+
print(json.dumps(state, ensure_ascii=False, indent=2, sort_keys=True))
|
|
256
|
+
else:
|
|
257
|
+
_print_human_summary("state decide", state)
|
|
258
|
+
return 0
|
|
259
|
+
|
|
260
|
+
if args.state_action == "stage-complete":
|
|
261
|
+
state = complete_stage_transaction(
|
|
262
|
+
workspace=args.workspace,
|
|
263
|
+
stage_id=args.stage,
|
|
264
|
+
reason=args.reason,
|
|
265
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
266
|
+
actor=args.actor,
|
|
267
|
+
runtime=getattr(args, "runtime", None),
|
|
268
|
+
model=getattr(args, "model", None),
|
|
269
|
+
)
|
|
270
|
+
if getattr(args, "json", False):
|
|
271
|
+
print(json.dumps(state, ensure_ascii=False, indent=2, sort_keys=True))
|
|
272
|
+
else:
|
|
273
|
+
_print_human_summary("state stage-complete", state)
|
|
274
|
+
return 0
|
|
275
|
+
|
|
276
|
+
if args.state_action == "freeze-claim-ledger":
|
|
277
|
+
state = freeze_claim_ledger_transaction(
|
|
278
|
+
workspace=args.workspace,
|
|
279
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
280
|
+
actor=getattr(args, "actor", "cli"),
|
|
281
|
+
)
|
|
282
|
+
if getattr(args, "json", False):
|
|
283
|
+
print(json.dumps(state, ensure_ascii=False, indent=2, sort_keys=True))
|
|
284
|
+
else:
|
|
285
|
+
_print_human_summary("state freeze-claim-ledger", state)
|
|
286
|
+
freeze = state.get("claim_ledger_freeze") or (state.get("manifest") or {}).get("claim_ledger_freeze") or {}
|
|
287
|
+
print(f"[state freeze-claim-ledger] claim_count: {freeze.get('claim_count', 0)}")
|
|
288
|
+
print(f"[state freeze-claim-ledger] claim_ledger_sha256: {freeze.get('claim_ledger_sha256', '')}")
|
|
289
|
+
if freeze.get("warnings"):
|
|
290
|
+
print(f"[state freeze-claim-ledger] warning_count: {len(freeze.get('warnings') or [])}")
|
|
291
|
+
return 0
|
|
292
|
+
|
|
293
|
+
if args.state_action == "enrich-claim-metadata":
|
|
294
|
+
state = enrich_claim_metadata_transaction(
|
|
295
|
+
workspace=args.workspace,
|
|
296
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
297
|
+
actor=getattr(args, "actor", "cli"),
|
|
298
|
+
from_source_evidence=getattr(args, "from_source_evidence", False),
|
|
299
|
+
)
|
|
300
|
+
if getattr(args, "json", False):
|
|
301
|
+
print(json.dumps(state, ensure_ascii=False, indent=2, sort_keys=True))
|
|
302
|
+
else:
|
|
303
|
+
_print_human_summary("state enrich-claim-metadata", state)
|
|
304
|
+
enrichment = state.get("claim_ledger_metadata_enrichment") or {}
|
|
305
|
+
print(
|
|
306
|
+
"[state enrich-claim-metadata] enriched_claim_count: "
|
|
307
|
+
f"{enrichment.get('enriched_claim_count', 0)}"
|
|
308
|
+
)
|
|
309
|
+
print(
|
|
310
|
+
"[state enrich-claim-metadata] claim_ledger_sha256: "
|
|
311
|
+
f"{enrichment.get('claim_ledger_sha256', '')}"
|
|
312
|
+
)
|
|
313
|
+
return 0
|
|
314
|
+
|
|
315
|
+
if args.state_action == "finalize-complete":
|
|
316
|
+
state = complete_finalize_transaction(
|
|
317
|
+
workspace=args.workspace,
|
|
318
|
+
reason=args.reason,
|
|
319
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
320
|
+
actor=args.actor,
|
|
321
|
+
runtime=getattr(args, "runtime", None),
|
|
322
|
+
model=getattr(args, "model", None),
|
|
323
|
+
)
|
|
324
|
+
if getattr(args, "json", False):
|
|
325
|
+
print(json.dumps(state, ensure_ascii=False, indent=2, sort_keys=True))
|
|
326
|
+
else:
|
|
327
|
+
_print_human_summary("state finalize-complete", state)
|
|
328
|
+
return 0
|
|
329
|
+
|
|
330
|
+
if args.state_action == "import-fact-layer":
|
|
331
|
+
state = import_fact_layer_transaction(
|
|
332
|
+
workspace=args.workspace,
|
|
333
|
+
archive=args.archive,
|
|
334
|
+
runtime=getattr(args, "runtime", "hermes"),
|
|
335
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
336
|
+
actor=getattr(args, "actor", "cli"),
|
|
337
|
+
)
|
|
338
|
+
if getattr(args, "json", False):
|
|
339
|
+
print(json.dumps(state, ensure_ascii=False, indent=2, sort_keys=True))
|
|
340
|
+
else:
|
|
341
|
+
_print_human_summary("state import-fact-layer", state)
|
|
342
|
+
imported = state.get("fact_layer_import") or {}
|
|
343
|
+
print(f"[state import-fact-layer] imported_file_count: {imported.get('imported_file_count', 0)}")
|
|
344
|
+
print(f"[state import-fact-layer] source_run_id: {imported.get('source_run_id', '')}")
|
|
345
|
+
return 0
|
|
346
|
+
except RuntimeStateError as exc:
|
|
347
|
+
_print_error(exc, as_json=getattr(args, "json", False))
|
|
348
|
+
return 1
|
|
349
|
+
|
|
350
|
+
return 1
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
def _is_blocked(state: dict[str, Any]) -> bool:
|
|
354
|
+
workflow = state.get("workflow_state") or {}
|
|
355
|
+
return bool(workflow.get("blocked"))
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
def _print_human_summary(label: str, state: dict[str, Any]) -> None:
|
|
359
|
+
manifest = state.get("manifest") or {}
|
|
360
|
+
workflow = state.get("workflow_state") or {}
|
|
361
|
+
fact_layer_import = state.get("fact_layer_import") or {}
|
|
362
|
+
print(f"[{label}] run_id: {manifest.get('run_id', '')}")
|
|
363
|
+
print(f"[{label}] current_stage: {workflow.get('current_stage')}")
|
|
364
|
+
print(f"[{label}] blocked: {workflow.get('blocked')}")
|
|
365
|
+
if workflow.get("blocking_reason"):
|
|
366
|
+
print(f"[{label}] reason: {workflow.get('blocking_reason')}")
|
|
367
|
+
print(f"[{label}] runtime_state_files:")
|
|
368
|
+
for key, rel_path in (state.get("runtime_state_files") or {}).items():
|
|
369
|
+
print(f" - {key}: {rel_path}")
|
|
370
|
+
_print_fact_layer_import_summary(label, fact_layer_import)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
def _print_fact_layer_import_summary(label: str, summary: dict[str, Any]) -> None:
|
|
374
|
+
if not summary:
|
|
375
|
+
return
|
|
376
|
+
if summary.get("status") == "missing":
|
|
377
|
+
return
|
|
378
|
+
print(f"[{label}] fact_layer_import: {summary.get('status')}")
|
|
379
|
+
if summary.get("status") == "valid":
|
|
380
|
+
print(f"[{label}] source_run_id: {summary.get('source_run_id', '')}")
|
|
381
|
+
print(f"[{label}] fact_layer_sha256: {summary.get('fact_layer_sha256', '')}")
|
|
382
|
+
print(f"[{label}] timing_comparability: {summary.get('timing_comparability', '')}")
|
|
383
|
+
print(f"[{label}] imported_satisfied_stages:")
|
|
384
|
+
for stage in summary.get("imported_stages") or []:
|
|
385
|
+
print(f" - {stage.get('stage_id')}: {stage.get('display_status')}")
|
|
386
|
+
print(f"[{label}] next_runtime_stage: {summary.get('next_stage')}")
|
|
387
|
+
else:
|
|
388
|
+
for reason in summary.get("errors") or []:
|
|
389
|
+
print(f"[{label}] fact_layer_import_error: {reason}")
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
def _print_error(exc: RuntimeStateError, *, as_json: bool) -> None:
|
|
393
|
+
if as_json:
|
|
394
|
+
print(json.dumps(exc.to_dict(), ensure_ascii=False, indent=2, sort_keys=True))
|
|
395
|
+
else:
|
|
396
|
+
print(f"[state] {exc}")
|
|
397
|
+
_print_error_details(exc)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
def _print_error_details(exc: RuntimeStateError) -> None:
|
|
401
|
+
details = exc.details or {}
|
|
402
|
+
diagnostics = details.get("diagnostics") or []
|
|
403
|
+
if diagnostics:
|
|
404
|
+
print("[state] diagnostics:")
|
|
405
|
+
for item in diagnostics:
|
|
406
|
+
if not isinstance(item, dict):
|
|
407
|
+
continue
|
|
408
|
+
field = item.get("field", "<unknown>")
|
|
409
|
+
error = item.get("error", "")
|
|
410
|
+
print(f" - {field}: {error}")
|
|
411
|
+
allowed_values = item.get("allowed_values")
|
|
412
|
+
if allowed_values:
|
|
413
|
+
print(f" allowed_values: {', '.join(str(value) for value in allowed_values)}")
|
|
414
|
+
forbidden_fields = item.get("forbidden_fields")
|
|
415
|
+
if forbidden_fields:
|
|
416
|
+
print(f" forbidden_fields: {', '.join(str(value) for value in forbidden_fields)}")
|
|
417
|
+
required_fields = item.get("required_fields")
|
|
418
|
+
if required_fields:
|
|
419
|
+
print(f" required_fields: {', '.join(str(value) for value in required_fields)}")
|
|
420
|
+
if item.get("hint"):
|
|
421
|
+
print(f" hint: {item.get('hint')}")
|
|
422
|
+
required_commands = details.get("required_commands") or []
|
|
423
|
+
if required_commands:
|
|
424
|
+
print("[state] required_commands:")
|
|
425
|
+
for command in required_commands:
|
|
426
|
+
print(f" - {command}")
|
|
427
|
+
repair_steps = details.get("repair_steps") or []
|
|
428
|
+
if repair_steps:
|
|
429
|
+
print("[state] repair_steps:")
|
|
430
|
+
for step in repair_steps:
|
|
431
|
+
print(f" - {step}")
|
|
432
|
+
repair_route = details.get("repair_route")
|
|
433
|
+
if not isinstance(repair_route, dict):
|
|
434
|
+
return
|
|
435
|
+
if repair_route.get("ok"):
|
|
436
|
+
print(f"[state] repair_owner: {repair_route.get('repair_owner')}")
|
|
437
|
+
print(f"[state] must_rerun_from: {repair_route.get('must_rerun_from') or 'none'}")
|
|
438
|
+
allowed = repair_route.get("allowed_artifacts") or []
|
|
439
|
+
if allowed:
|
|
440
|
+
print("[state] allowed_artifacts:")
|
|
441
|
+
for artifact in allowed:
|
|
442
|
+
print(f" - {artifact}")
|
|
443
|
+
else:
|
|
444
|
+
message = repair_route.get("message") or repair_route.get("error")
|
|
445
|
+
if message:
|
|
446
|
+
print(f"[state] repair_route_error: {message}")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Read-only workspace status CLI."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
|
|
8
|
+
from multi_agent_brief.status import build_workspace_status, format_workspace_status
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def register(subparsers: argparse._SubParsersAction) -> None:
|
|
12
|
+
parser = subparsers.add_parser(
|
|
13
|
+
"status",
|
|
14
|
+
help="Show a read-only workspace operator dashboard.",
|
|
15
|
+
)
|
|
16
|
+
parser.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
17
|
+
parser.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def handle(args: argparse.Namespace) -> int:
|
|
21
|
+
status = build_workspace_status(args.workspace)
|
|
22
|
+
if getattr(args, "json", False):
|
|
23
|
+
print(json.dumps(status, ensure_ascii=False, indent=2, sort_keys=True))
|
|
24
|
+
else:
|
|
25
|
+
print(format_workspace_status(status))
|
|
26
|
+
return 0 if status.get("ok") else 1
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""WorkBuddy integration commands."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
|
|
8
|
+
from multi_agent_brief.workbuddy.skill_pack import (
|
|
9
|
+
WorkBuddySkillPackError,
|
|
10
|
+
package_workbuddy_skill,
|
|
11
|
+
)
|
|
12
|
+
from multi_agent_brief.workbuddy.diagnose import (
|
|
13
|
+
build_workbuddy_diagnosis,
|
|
14
|
+
format_workbuddy_diagnosis,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def register(subparsers: argparse._SubParsersAction) -> None:
|
|
19
|
+
parser = subparsers.add_parser(
|
|
20
|
+
"workbuddy",
|
|
21
|
+
help="Package source-clone WorkBuddy Skill assets.",
|
|
22
|
+
)
|
|
23
|
+
actions = parser.add_subparsers(dest="workbuddy_action", required=True)
|
|
24
|
+
pack = actions.add_parser(
|
|
25
|
+
"pack-skill",
|
|
26
|
+
help="Generate a local WorkBuddy Skill zip from checked-in source files.",
|
|
27
|
+
)
|
|
28
|
+
pack.add_argument(
|
|
29
|
+
"--output",
|
|
30
|
+
required=True,
|
|
31
|
+
help="Output directory for the generated zip and manifest.",
|
|
32
|
+
)
|
|
33
|
+
pack.add_argument(
|
|
34
|
+
"--repo-workdir",
|
|
35
|
+
help=(
|
|
36
|
+
"BriefLoop source repository root. Required when the installed "
|
|
37
|
+
"package cannot discover source-clone WorkBuddy Skill assets."
|
|
38
|
+
),
|
|
39
|
+
)
|
|
40
|
+
pack.add_argument("--json", action="store_true", help="Emit JSON output.")
|
|
41
|
+
|
|
42
|
+
diagnose = actions.add_parser(
|
|
43
|
+
"diagnose",
|
|
44
|
+
help="Print a read-only WorkBuddy Run Card for a workspace.",
|
|
45
|
+
)
|
|
46
|
+
diagnose.add_argument(
|
|
47
|
+
"--workspace",
|
|
48
|
+
required=True,
|
|
49
|
+
help="BriefLoop workspace directory.",
|
|
50
|
+
)
|
|
51
|
+
diagnose.add_argument("--json", action="store_true", help="Emit JSON output.")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def handle(args: argparse.Namespace) -> int:
|
|
55
|
+
if args.workbuddy_action == "pack-skill":
|
|
56
|
+
try:
|
|
57
|
+
result = package_workbuddy_skill(
|
|
58
|
+
output_dir=args.output,
|
|
59
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
60
|
+
)
|
|
61
|
+
except WorkBuddySkillPackError as exc:
|
|
62
|
+
if getattr(args, "json", False):
|
|
63
|
+
print(
|
|
64
|
+
json.dumps(
|
|
65
|
+
{
|
|
66
|
+
"ok": False,
|
|
67
|
+
"error": str(exc),
|
|
68
|
+
"runtime_effect": "packaging_only",
|
|
69
|
+
},
|
|
70
|
+
indent=2,
|
|
71
|
+
sort_keys=True,
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
else:
|
|
75
|
+
print(f"[workbuddy pack-skill] {exc}")
|
|
76
|
+
return 1
|
|
77
|
+
payload = {
|
|
78
|
+
"ok": True,
|
|
79
|
+
"runtime_effect": "packaging_only",
|
|
80
|
+
"zip_path": str(result.zip_path),
|
|
81
|
+
"manifest_path": str(result.manifest_path),
|
|
82
|
+
"zip_sha256": result.zip_sha256,
|
|
83
|
+
"included_file_count": len(result.included_files),
|
|
84
|
+
}
|
|
85
|
+
if getattr(args, "json", False):
|
|
86
|
+
print(json.dumps(payload, indent=2, sort_keys=True))
|
|
87
|
+
else:
|
|
88
|
+
print(f"[workbuddy pack-skill] wrote {result.zip_path}")
|
|
89
|
+
print(f"[workbuddy pack-skill] wrote {result.manifest_path}")
|
|
90
|
+
print(f"[workbuddy pack-skill] zip_sha256={result.zip_sha256}")
|
|
91
|
+
print(
|
|
92
|
+
"[workbuddy pack-skill] local Skill zip only; "
|
|
93
|
+
"not marketplace-ready and not Python package data."
|
|
94
|
+
)
|
|
95
|
+
return 0
|
|
96
|
+
if args.workbuddy_action == "diagnose":
|
|
97
|
+
payload = build_workbuddy_diagnosis(workspace=args.workspace)
|
|
98
|
+
if getattr(args, "json", False):
|
|
99
|
+
print(json.dumps(payload, indent=2, sort_keys=True))
|
|
100
|
+
else:
|
|
101
|
+
print(format_workbuddy_diagnosis(payload))
|
|
102
|
+
return 0
|
|
103
|
+
return 1
|