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,81 @@
|
|
|
1
|
+
"""Runtime workspace kit install commands."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
|
|
7
|
+
from multi_agent_brief.runtime_assets import (
|
|
8
|
+
RuntimeAssetInstallError,
|
|
9
|
+
install_runtime_kit,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def register(subparsers: argparse._SubParsersAction) -> None:
|
|
14
|
+
runtime_parser = subparsers.add_parser(
|
|
15
|
+
"runtime",
|
|
16
|
+
help="Install runtime-discoverable workspace assets.",
|
|
17
|
+
)
|
|
18
|
+
actions = runtime_parser.add_subparsers(dest="runtime_action", required=True)
|
|
19
|
+
|
|
20
|
+
install = actions.add_parser(
|
|
21
|
+
"install",
|
|
22
|
+
help="Install OpenCode/Claude Code/Codex runtime kit files into a workspace.",
|
|
23
|
+
)
|
|
24
|
+
install.add_argument(
|
|
25
|
+
"--workspace",
|
|
26
|
+
required=True,
|
|
27
|
+
help="MABW workspace directory.",
|
|
28
|
+
)
|
|
29
|
+
install.add_argument(
|
|
30
|
+
"--runtime",
|
|
31
|
+
required=True,
|
|
32
|
+
choices=("opencode", "claude", "codex", "all"),
|
|
33
|
+
help="Runtime kit to install.",
|
|
34
|
+
)
|
|
35
|
+
install.add_argument(
|
|
36
|
+
"--repo-workdir",
|
|
37
|
+
help=(
|
|
38
|
+
"MABW source repository root. Required when the package install "
|
|
39
|
+
"cannot discover source-clone runtime assets."
|
|
40
|
+
),
|
|
41
|
+
)
|
|
42
|
+
install.add_argument(
|
|
43
|
+
"--force",
|
|
44
|
+
action="store_true",
|
|
45
|
+
help="Overwrite existing non-MABW runtime kit files.",
|
|
46
|
+
)
|
|
47
|
+
install.add_argument(
|
|
48
|
+
"--dry-run",
|
|
49
|
+
action="store_true",
|
|
50
|
+
help="Print planned writes without changing files.",
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def handle(args: argparse.Namespace) -> int:
|
|
55
|
+
if args.runtime_action == "install":
|
|
56
|
+
try:
|
|
57
|
+
result = install_runtime_kit(
|
|
58
|
+
workspace=args.workspace,
|
|
59
|
+
runtime=args.runtime,
|
|
60
|
+
repo_workdir=getattr(args, "repo_workdir", None),
|
|
61
|
+
force=bool(getattr(args, "force", False)),
|
|
62
|
+
dry_run=bool(getattr(args, "dry_run", False)),
|
|
63
|
+
)
|
|
64
|
+
except RuntimeAssetInstallError as exc:
|
|
65
|
+
print(f"[runtime install] {exc}")
|
|
66
|
+
return 1
|
|
67
|
+
verb = "would write" if result["dry_run"] else "wrote"
|
|
68
|
+
for path in result["written"]:
|
|
69
|
+
print(f"[runtime install] {verb} {path}")
|
|
70
|
+
status = "Planned" if result["dry_run"] else "Installed"
|
|
71
|
+
print(
|
|
72
|
+
f"[runtime install] {status} workspace runtime kit "
|
|
73
|
+
f"for {result['runtime']} ({result['count']} files)."
|
|
74
|
+
)
|
|
75
|
+
if result["runtime"] in {"codex", "all"}:
|
|
76
|
+
print(
|
|
77
|
+
"[runtime install] Codex note: open and trust this workspace in Codex "
|
|
78
|
+
"so project .codex/config.toml and custom agents are loaded."
|
|
79
|
+
)
|
|
80
|
+
return 0
|
|
81
|
+
return 1
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"""secrets — deterministic workspace secret import helpers."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import hashlib
|
|
7
|
+
import json
|
|
8
|
+
import os
|
|
9
|
+
import re
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
from multi_agent_brief.core.env import KNOWN_WORKSPACE_ENV_KEYS, _parse_env_line
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
_SAFE_ENV_KEY_RE = re.compile(r"^[A-Z][A-Z0-9_]*$")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class SecretImportError(Exception):
|
|
19
|
+
"""Raised when workspace secret import cannot complete safely."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def register(subparsers: argparse._SubParsersAction) -> None:
|
|
23
|
+
"""Register the secrets subcommand group."""
|
|
24
|
+
secrets_parser = subparsers.add_parser(
|
|
25
|
+
"secrets",
|
|
26
|
+
help="Safely import allowlisted secrets into a workspace .env file.",
|
|
27
|
+
)
|
|
28
|
+
secrets_sub = secrets_parser.add_subparsers(
|
|
29
|
+
dest="secrets_action",
|
|
30
|
+
required=True,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
import_parser = secrets_sub.add_parser(
|
|
34
|
+
"import",
|
|
35
|
+
help="Import allowlisted keys from a private env file into workspace .env.",
|
|
36
|
+
)
|
|
37
|
+
import_parser.add_argument(
|
|
38
|
+
"--workspace",
|
|
39
|
+
required=True,
|
|
40
|
+
help="Workspace directory whose .env file should be written.",
|
|
41
|
+
)
|
|
42
|
+
import_parser.add_argument(
|
|
43
|
+
"--from",
|
|
44
|
+
dest="from_path",
|
|
45
|
+
required=True,
|
|
46
|
+
help="Private env file to read, for example ~/.env.",
|
|
47
|
+
)
|
|
48
|
+
import_parser.add_argument(
|
|
49
|
+
"--keys",
|
|
50
|
+
nargs="+",
|
|
51
|
+
required=True,
|
|
52
|
+
help="Allowlisted env keys to import, for example TAVILY_API_KEY.",
|
|
53
|
+
)
|
|
54
|
+
import_parser.add_argument(
|
|
55
|
+
"--json",
|
|
56
|
+
action="store_true",
|
|
57
|
+
help="Emit redacted machine-readable import results.",
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def handle(args: argparse.Namespace) -> int:
|
|
62
|
+
"""Dispatch secrets subcommands."""
|
|
63
|
+
if args.secrets_action == "import":
|
|
64
|
+
return _handle_import(args)
|
|
65
|
+
return 1
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _handle_import(args: argparse.Namespace) -> int:
|
|
69
|
+
try:
|
|
70
|
+
result = import_workspace_secrets(
|
|
71
|
+
workspace=Path(args.workspace).expanduser(),
|
|
72
|
+
source=Path(args.from_path).expanduser(),
|
|
73
|
+
keys=list(args.keys),
|
|
74
|
+
)
|
|
75
|
+
except SecretImportError as exc:
|
|
76
|
+
payload = {"ok": False, "error": str(exc)}
|
|
77
|
+
if getattr(args, "json", False):
|
|
78
|
+
print(json.dumps(payload, ensure_ascii=False, sort_keys=True))
|
|
79
|
+
else:
|
|
80
|
+
print(f"[secrets] error: {exc}")
|
|
81
|
+
return 1
|
|
82
|
+
|
|
83
|
+
if getattr(args, "json", False):
|
|
84
|
+
print(json.dumps(
|
|
85
|
+
{
|
|
86
|
+
"ok": True,
|
|
87
|
+
"workspace_env": result["workspace_env"],
|
|
88
|
+
"keys": result["keys"],
|
|
89
|
+
},
|
|
90
|
+
ensure_ascii=False,
|
|
91
|
+
sort_keys=True,
|
|
92
|
+
))
|
|
93
|
+
return 0
|
|
94
|
+
|
|
95
|
+
for item in result["keys"]:
|
|
96
|
+
status = item["status"]
|
|
97
|
+
prefix = item.get("sha256_prefix", "")
|
|
98
|
+
prefix_part = f" sha256_prefix={prefix}" if prefix else ""
|
|
99
|
+
print(f"{item['key']}={status}{prefix_part}")
|
|
100
|
+
return 0
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def import_workspace_secrets(
|
|
104
|
+
*,
|
|
105
|
+
workspace: Path,
|
|
106
|
+
source: Path,
|
|
107
|
+
keys: list[str],
|
|
108
|
+
) -> dict[str, object]:
|
|
109
|
+
"""Import requested known keys from source env into workspace .env."""
|
|
110
|
+
requested = _normalize_keys(keys)
|
|
111
|
+
if not requested:
|
|
112
|
+
raise SecretImportError("at least one key is required")
|
|
113
|
+
unknown = [key for key in requested if key not in KNOWN_WORKSPACE_ENV_KEYS]
|
|
114
|
+
if unknown:
|
|
115
|
+
raise SecretImportError(f"unsupported secret key(s): {', '.join(unknown)}")
|
|
116
|
+
|
|
117
|
+
if not source.exists():
|
|
118
|
+
raise SecretImportError(f"source env file not found: {source}")
|
|
119
|
+
if not source.is_file():
|
|
120
|
+
raise SecretImportError(f"source env path is not a file: {source}")
|
|
121
|
+
|
|
122
|
+
source_values = _read_known_env_values(source)
|
|
123
|
+
missing = [key for key in requested if not source_values.get(key)]
|
|
124
|
+
if missing:
|
|
125
|
+
raise SecretImportError(
|
|
126
|
+
f"requested key(s) missing from source env: {', '.join(missing)}"
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
_require_existing_workspace(workspace)
|
|
130
|
+
target = workspace / ".env"
|
|
131
|
+
_write_workspace_env(target, {key: source_values[key] for key in requested})
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
"workspace_env": str(target),
|
|
135
|
+
"keys": [
|
|
136
|
+
{
|
|
137
|
+
"key": key,
|
|
138
|
+
"status": "present",
|
|
139
|
+
"sha256_prefix": hashlib.sha256(
|
|
140
|
+
source_values[key].encode("utf-8")
|
|
141
|
+
).hexdigest()[:12],
|
|
142
|
+
}
|
|
143
|
+
for key in requested
|
|
144
|
+
],
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def _require_existing_workspace(workspace: Path) -> None:
|
|
149
|
+
if not workspace.exists():
|
|
150
|
+
raise SecretImportError(
|
|
151
|
+
f"workspace not found: {workspace}. Run briefloop new or multi-agent-brief init first."
|
|
152
|
+
)
|
|
153
|
+
if not workspace.is_dir():
|
|
154
|
+
raise SecretImportError(f"workspace path is not a directory: {workspace}")
|
|
155
|
+
markers = [
|
|
156
|
+
workspace / "config.yaml",
|
|
157
|
+
workspace / "output" / "intermediate" / "runtime_manifest.json",
|
|
158
|
+
]
|
|
159
|
+
if not any(marker.exists() for marker in markers):
|
|
160
|
+
raise SecretImportError(
|
|
161
|
+
f"not a BriefLoop workspace: {workspace}. Expected config.yaml or runtime manifest."
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def _normalize_keys(keys: list[str]) -> list[str]:
|
|
166
|
+
normalized: list[str] = []
|
|
167
|
+
seen: set[str] = set()
|
|
168
|
+
for raw in keys:
|
|
169
|
+
key = str(raw or "").strip()
|
|
170
|
+
if not key:
|
|
171
|
+
continue
|
|
172
|
+
if not _SAFE_ENV_KEY_RE.match(key):
|
|
173
|
+
raise SecretImportError(f"invalid secret key name: {key}")
|
|
174
|
+
if key not in seen:
|
|
175
|
+
normalized.append(key)
|
|
176
|
+
seen.add(key)
|
|
177
|
+
return normalized
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def _read_known_env_values(path: Path) -> dict[str, str]:
|
|
181
|
+
try:
|
|
182
|
+
lines = path.read_text(encoding="utf-8").splitlines()
|
|
183
|
+
except OSError as exc:
|
|
184
|
+
raise SecretImportError(f"unable to read source env file: {path}") from exc
|
|
185
|
+
values: dict[str, str] = {}
|
|
186
|
+
for line in lines:
|
|
187
|
+
parsed = _parse_env_line(line)
|
|
188
|
+
if not parsed:
|
|
189
|
+
continue
|
|
190
|
+
key, value = parsed
|
|
191
|
+
if value:
|
|
192
|
+
values[key] = value
|
|
193
|
+
return values
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def _write_workspace_env(path: Path, values: dict[str, str]) -> None:
|
|
197
|
+
existing_lines: list[str] = []
|
|
198
|
+
if path.exists():
|
|
199
|
+
try:
|
|
200
|
+
existing_lines = path.read_text(encoding="utf-8").splitlines()
|
|
201
|
+
except OSError as exc:
|
|
202
|
+
raise SecretImportError(f"unable to read workspace env file: {path}") from exc
|
|
203
|
+
|
|
204
|
+
updated_lines: list[str] = []
|
|
205
|
+
replaced: set[str] = set()
|
|
206
|
+
for line in existing_lines:
|
|
207
|
+
parsed = _parse_env_line(line)
|
|
208
|
+
if parsed and parsed[0] in values:
|
|
209
|
+
key = parsed[0]
|
|
210
|
+
updated_lines.append(f"{key}={_quote_env_value(values[key])}")
|
|
211
|
+
replaced.add(key)
|
|
212
|
+
else:
|
|
213
|
+
updated_lines.append(line)
|
|
214
|
+
|
|
215
|
+
for key in values:
|
|
216
|
+
if key not in replaced:
|
|
217
|
+
updated_lines.append(f"{key}={_quote_env_value(values[key])}")
|
|
218
|
+
|
|
219
|
+
try:
|
|
220
|
+
path.write_text("\n".join(updated_lines).rstrip() + "\n", encoding="utf-8")
|
|
221
|
+
os.chmod(path, 0o600)
|
|
222
|
+
except OSError as exc:
|
|
223
|
+
raise SecretImportError(f"unable to write workspace env file: {path}") from exc
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def _quote_env_value(value: str) -> str:
|
|
227
|
+
if not value:
|
|
228
|
+
return ""
|
|
229
|
+
if re.search(r"\s|#|['\"]", value):
|
|
230
|
+
escaped = value.replace("\\", "\\\\").replace('"', '\\"')
|
|
231
|
+
return f'"{escaped}"'
|
|
232
|
+
return value
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""Semantic support proposal adjudication CLI."""
|
|
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.errors import RuntimeStateError
|
|
10
|
+
from multi_agent_brief.orchestrator.runtime_state.semantic_support_acceptance import (
|
|
11
|
+
bind_semantic_assessment_checked_inputs_transaction,
|
|
12
|
+
record_semantic_support_adjudication,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def register(subparsers: argparse._SubParsersAction) -> None:
|
|
17
|
+
parser = subparsers.add_parser(
|
|
18
|
+
"semantic-support",
|
|
19
|
+
help="Record human adjudication for Semantic Support Auditor proposals.",
|
|
20
|
+
)
|
|
21
|
+
actions = parser.add_subparsers(dest="semantic_support_action", required=True)
|
|
22
|
+
|
|
23
|
+
bind = actions.add_parser(
|
|
24
|
+
"bind",
|
|
25
|
+
help="Seal semantic_assessment_report.json checked_inputs once before human adjudication.",
|
|
26
|
+
)
|
|
27
|
+
bind.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
28
|
+
bind.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
29
|
+
|
|
30
|
+
adjudicate = actions.add_parser(
|
|
31
|
+
"adjudicate",
|
|
32
|
+
help="Record a human accept/reject decision for one semantic support proposal.",
|
|
33
|
+
)
|
|
34
|
+
adjudicate.add_argument("--workspace", required=True, help="Path to workspace directory.")
|
|
35
|
+
adjudicate.add_argument("--proposal-id", required=True, help="Semantic assessment proposal row id.")
|
|
36
|
+
adjudicate.add_argument(
|
|
37
|
+
"--decision",
|
|
38
|
+
required=True,
|
|
39
|
+
choices=("accept", "reject"),
|
|
40
|
+
help="Human decision for this proposal.",
|
|
41
|
+
)
|
|
42
|
+
adjudicate.add_argument("--reason", required=True, help="Short human rationale.")
|
|
43
|
+
adjudicate.add_argument("--by", default="human", help="Human/operator label.")
|
|
44
|
+
adjudicate.add_argument("--json", action="store_true", help="Emit machine-readable JSON.")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def handle(args: argparse.Namespace) -> int:
|
|
48
|
+
action = getattr(args, "semantic_support_action", "")
|
|
49
|
+
try:
|
|
50
|
+
if action == "bind":
|
|
51
|
+
payload = bind_semantic_assessment_checked_inputs_transaction(workspace=args.workspace)
|
|
52
|
+
_print_payload("semantic-support bind", payload, as_json=getattr(args, "json", False))
|
|
53
|
+
return 0
|
|
54
|
+
if action == "adjudicate":
|
|
55
|
+
payload = record_semantic_support_adjudication(
|
|
56
|
+
workspace=args.workspace,
|
|
57
|
+
proposal_id=args.proposal_id,
|
|
58
|
+
decision=args.decision,
|
|
59
|
+
reason=args.reason,
|
|
60
|
+
actor_id=getattr(args, "by", "human"),
|
|
61
|
+
)
|
|
62
|
+
_print_payload("semantic-support adjudicate", payload, as_json=getattr(args, "json", False))
|
|
63
|
+
return 0
|
|
64
|
+
except (RuntimeStateError, OSError, json.JSONDecodeError) as exc:
|
|
65
|
+
payload = exc.to_dict() if isinstance(exc, RuntimeStateError) else {"ok": False, "error": str(exc)}
|
|
66
|
+
_print_payload("semantic-support", payload, as_json=getattr(args, "json", False))
|
|
67
|
+
return 1
|
|
68
|
+
raise AssertionError(f"Unhandled semantic-support action: {action}")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _print_payload(label: str, payload: dict[str, Any], *, as_json: bool) -> None:
|
|
72
|
+
if as_json:
|
|
73
|
+
print(json.dumps(payload, ensure_ascii=False, indent=2, sort_keys=True))
|
|
74
|
+
return
|
|
75
|
+
print(label)
|
|
76
|
+
for key, value in payload.items():
|
|
77
|
+
if isinstance(value, (dict, list)):
|
|
78
|
+
print(f"{key}: {json.dumps(value, ensure_ascii=False, sort_keys=True)}")
|
|
79
|
+
else:
|
|
80
|
+
print(f"{key}: {value}")
|