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,472 @@
|
|
|
1
|
+
"""Read-only materiality-aware selection diagnostic projection.
|
|
2
|
+
|
|
3
|
+
This module checks whether screened-out candidates match explicit configured
|
|
4
|
+
materiality or focus terms. It does not infer semantic importance, mutate
|
|
5
|
+
screening output, resurrect candidates, run gates, or approve delivery.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
import re
|
|
12
|
+
from collections import Counter
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import Any, Mapping
|
|
15
|
+
|
|
16
|
+
import yaml
|
|
17
|
+
|
|
18
|
+
from multi_agent_brief.product.policy_projection import project_workspace_policy_profile
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
MATERIALITY_SELECTION_SCHEMA_VERSION = "briefloop.materiality_selection.v1"
|
|
22
|
+
MATERIALITY_SELECTION_BOUNDARY = (
|
|
23
|
+
"materiality_selection_projection_only_not_screening_mutation_or_semantic_importance_judgment"
|
|
24
|
+
)
|
|
25
|
+
MATERIALITY_SELECTION_RUNTIME_EFFECT = "none"
|
|
26
|
+
MATERIALITY_SELECTION_STATUSES = {
|
|
27
|
+
"missing_screened_candidates",
|
|
28
|
+
"invalid_screened_candidates",
|
|
29
|
+
"legacy_not_interpreted",
|
|
30
|
+
"no_materiality_policy",
|
|
31
|
+
"checked",
|
|
32
|
+
}
|
|
33
|
+
MATERIALITY_SELECTION_NON_GOALS = {
|
|
34
|
+
"semantic_importance_judgment",
|
|
35
|
+
"screening_mutation",
|
|
36
|
+
"claim_ledger_mutation",
|
|
37
|
+
"candidate_resurrection",
|
|
38
|
+
"gate_decision",
|
|
39
|
+
"delivery_approval",
|
|
40
|
+
"release_authority",
|
|
41
|
+
}
|
|
42
|
+
MATERIALITY_SELECTION_ACTIONS = {
|
|
43
|
+
"review_materiality_exclusions",
|
|
44
|
+
"request_human_review",
|
|
45
|
+
}
|
|
46
|
+
MATERIALITY_SELECTION_SUMMARY_COUNT_FIELDS = {
|
|
47
|
+
"finding_count",
|
|
48
|
+
"capacity_capped_materiality_count",
|
|
49
|
+
"scope_narrowed_materiality_count",
|
|
50
|
+
"weak_relevance_materiality_count",
|
|
51
|
+
"human_review_recommended_count",
|
|
52
|
+
"warning_count",
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
_INTERMEDIATE = Path("output/intermediate")
|
|
56
|
+
_CAPACITY_REASON_CODES = {"capacity_capped"}
|
|
57
|
+
_SCOPE_REASON_CODES = {"off_focus", "outside_scope", "weak_relevance"}
|
|
58
|
+
_INTERPRETED_REASON_CODES = _CAPACITY_REASON_CODES | _SCOPE_REASON_CODES
|
|
59
|
+
_FORBIDDEN_AUTHORITY_KEYS = {
|
|
60
|
+
"approve_delivery",
|
|
61
|
+
"approved_for_delivery",
|
|
62
|
+
"claim_ledger_mutation",
|
|
63
|
+
"delivery_approval",
|
|
64
|
+
"gate_decision",
|
|
65
|
+
"quality_score",
|
|
66
|
+
"release_authority",
|
|
67
|
+
"screening_mutation",
|
|
68
|
+
"semantic_importance_score",
|
|
69
|
+
"state_transition",
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def project_workspace_materiality_selection(
|
|
74
|
+
workspace: str | Path,
|
|
75
|
+
*,
|
|
76
|
+
policy_profile: Mapping[str, Any] | None = None,
|
|
77
|
+
) -> dict[str, Any]:
|
|
78
|
+
"""Project materiality-aware screening diagnostics without side effects."""
|
|
79
|
+
|
|
80
|
+
ws = Path(workspace).expanduser().resolve()
|
|
81
|
+
policy_projection = (
|
|
82
|
+
dict(policy_profile)
|
|
83
|
+
if isinstance(policy_profile, Mapping)
|
|
84
|
+
else project_workspace_policy_profile(ws)
|
|
85
|
+
)
|
|
86
|
+
materiality_terms = _policy_materiality_terms(policy_projection)
|
|
87
|
+
must_watch_terms = _workspace_focus_terms(ws)
|
|
88
|
+
screened_path = ws / _INTERMEDIATE / "screened_candidates.json"
|
|
89
|
+
base = _base_projection(
|
|
90
|
+
policy_profile=policy_projection,
|
|
91
|
+
materiality_terms=materiality_terms,
|
|
92
|
+
must_watch_terms=must_watch_terms,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
if not screened_path.exists():
|
|
96
|
+
return {
|
|
97
|
+
**base,
|
|
98
|
+
"status": "missing_screened_candidates",
|
|
99
|
+
"reason": "screened_candidates_missing",
|
|
100
|
+
"screened_candidates_present": False,
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
screened = json.loads(screened_path.read_text(encoding="utf-8"))
|
|
105
|
+
except (OSError, UnicodeDecodeError, json.JSONDecodeError) as exc:
|
|
106
|
+
return {
|
|
107
|
+
**base,
|
|
108
|
+
"status": "invalid_screened_candidates",
|
|
109
|
+
"reason": f"screened_candidates_unreadable:{type(exc).__name__}",
|
|
110
|
+
"screened_candidates_present": True,
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
validation_reason = _screened_candidates_validation_reason(screened)
|
|
114
|
+
if validation_reason:
|
|
115
|
+
return {
|
|
116
|
+
**base,
|
|
117
|
+
"status": "invalid_screened_candidates",
|
|
118
|
+
"reason": validation_reason,
|
|
119
|
+
"screened_candidates_present": True,
|
|
120
|
+
}
|
|
121
|
+
if isinstance(screened, list):
|
|
122
|
+
return {
|
|
123
|
+
**base,
|
|
124
|
+
"status": "legacy_not_interpreted",
|
|
125
|
+
"reason": "legacy_list_shape_has_no_discard_buckets",
|
|
126
|
+
"screened_candidates_present": True,
|
|
127
|
+
}
|
|
128
|
+
if not isinstance(screened, dict):
|
|
129
|
+
return {
|
|
130
|
+
**base,
|
|
131
|
+
"status": "invalid_screened_candidates",
|
|
132
|
+
"reason": "screened_candidates_not_object_or_list",
|
|
133
|
+
"screened_candidates_present": True,
|
|
134
|
+
}
|
|
135
|
+
selected = screened.get("selected")
|
|
136
|
+
if not isinstance(selected, list):
|
|
137
|
+
return {
|
|
138
|
+
**base,
|
|
139
|
+
"status": "invalid_screened_candidates",
|
|
140
|
+
"reason": "screened_candidates_selected_missing",
|
|
141
|
+
"screened_candidates_present": True,
|
|
142
|
+
}
|
|
143
|
+
discarded = _discarded_candidates(screened)
|
|
144
|
+
if not materiality_terms and not must_watch_terms:
|
|
145
|
+
return {
|
|
146
|
+
**base,
|
|
147
|
+
"status": "no_materiality_policy",
|
|
148
|
+
"reason": "no_policy_materiality_or_focus_terms",
|
|
149
|
+
"screened_candidates_present": True,
|
|
150
|
+
"selected_count": len(selected),
|
|
151
|
+
"discarded_count": len(discarded),
|
|
152
|
+
"summary_counts": _summary_counts([]),
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
findings: list[dict[str, Any]] = []
|
|
156
|
+
for item in discarded:
|
|
157
|
+
finding = _candidate_finding(
|
|
158
|
+
item,
|
|
159
|
+
materiality_terms=materiality_terms,
|
|
160
|
+
must_watch_terms=must_watch_terms,
|
|
161
|
+
)
|
|
162
|
+
if finding:
|
|
163
|
+
findings.append({**finding, "finding_id": f"MATSEL-{len(findings)+1:03d}"})
|
|
164
|
+
|
|
165
|
+
return {
|
|
166
|
+
**base,
|
|
167
|
+
"status": "checked",
|
|
168
|
+
"screened_candidates_present": True,
|
|
169
|
+
"selected_count": len(selected),
|
|
170
|
+
"discarded_count": len(discarded),
|
|
171
|
+
"findings": findings,
|
|
172
|
+
"summary_counts": _summary_counts(findings),
|
|
173
|
+
"recommended_actions": _recommended_actions(findings),
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def validate_materiality_selection_payload(payload: Any) -> str | None:
|
|
178
|
+
if not isinstance(payload, dict):
|
|
179
|
+
return "materiality_selection_schema_error:not_object"
|
|
180
|
+
if _contains_forbidden_authority_key(payload):
|
|
181
|
+
return "materiality_selection_schema_error:authority_field"
|
|
182
|
+
if payload.get("schema_version") != MATERIALITY_SELECTION_SCHEMA_VERSION:
|
|
183
|
+
return "materiality_selection_schema_error:schema_version"
|
|
184
|
+
if payload.get("boundary") != MATERIALITY_SELECTION_BOUNDARY:
|
|
185
|
+
return "materiality_selection_schema_error:boundary"
|
|
186
|
+
if payload.get("runtime_effect") != MATERIALITY_SELECTION_RUNTIME_EFFECT:
|
|
187
|
+
return "materiality_selection_schema_error:runtime_effect"
|
|
188
|
+
if payload.get("read_only") is not True:
|
|
189
|
+
return "materiality_selection_schema_error:read_only"
|
|
190
|
+
if payload.get("status") not in MATERIALITY_SELECTION_STATUSES:
|
|
191
|
+
return "materiality_selection_schema_error:status"
|
|
192
|
+
for field in ("materiality_terms", "must_watch_terms", "findings", "recommended_actions", "non_goals"):
|
|
193
|
+
if not isinstance(payload.get(field), list):
|
|
194
|
+
return f"materiality_selection_schema_error:{field}"
|
|
195
|
+
if not MATERIALITY_SELECTION_NON_GOALS.issubset({str(item) for item in payload.get("non_goals", [])}):
|
|
196
|
+
return "materiality_selection_schema_error:non_goals"
|
|
197
|
+
summary = payload.get("summary_counts")
|
|
198
|
+
if not isinstance(summary, dict):
|
|
199
|
+
return "materiality_selection_schema_error:summary_counts"
|
|
200
|
+
for field in MATERIALITY_SELECTION_SUMMARY_COUNT_FIELDS:
|
|
201
|
+
if not isinstance(summary.get(field), int) or summary.get(field, 0) < 0:
|
|
202
|
+
return f"materiality_selection_schema_error:summary_counts.{field}"
|
|
203
|
+
for field in ("selected_count", "discarded_count"):
|
|
204
|
+
if field in payload and (not isinstance(payload.get(field), int) or payload.get(field, 0) < 0):
|
|
205
|
+
return f"materiality_selection_schema_error:{field}"
|
|
206
|
+
for finding in payload.get("findings", []):
|
|
207
|
+
if not isinstance(finding, dict):
|
|
208
|
+
return "materiality_selection_schema_error:findings"
|
|
209
|
+
if _text(finding.get("severity")) not in {"warning", "human_review"}:
|
|
210
|
+
return "materiality_selection_schema_error:findings.severity"
|
|
211
|
+
if _text(finding.get("bucket")) not in {"excluded", "deprioritized"}:
|
|
212
|
+
return "materiality_selection_schema_error:findings.bucket"
|
|
213
|
+
for action in payload.get("recommended_actions", []):
|
|
214
|
+
if not isinstance(action, dict):
|
|
215
|
+
return "materiality_selection_schema_error:recommended_actions"
|
|
216
|
+
if _text(action.get("action")) not in MATERIALITY_SELECTION_ACTIONS:
|
|
217
|
+
return "materiality_selection_schema_error:recommended_actions.action"
|
|
218
|
+
return None
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def _base_projection(
|
|
222
|
+
*,
|
|
223
|
+
policy_profile: Mapping[str, Any],
|
|
224
|
+
materiality_terms: list[str],
|
|
225
|
+
must_watch_terms: list[str],
|
|
226
|
+
) -> dict[str, Any]:
|
|
227
|
+
return {
|
|
228
|
+
"schema_version": MATERIALITY_SELECTION_SCHEMA_VERSION,
|
|
229
|
+
"read_only": True,
|
|
230
|
+
"runtime_effect": MATERIALITY_SELECTION_RUNTIME_EFFECT,
|
|
231
|
+
"boundary": MATERIALITY_SELECTION_BOUNDARY,
|
|
232
|
+
"semantic_boundary": "deterministic_keyword_match_from_config_only",
|
|
233
|
+
"policy_profile_status": _text(policy_profile.get("status")) or "unknown",
|
|
234
|
+
"resolved_policy_profile": _text(policy_profile.get("resolved_policy_profile")) or None,
|
|
235
|
+
"screened_candidates_present": False,
|
|
236
|
+
"selected_count": 0,
|
|
237
|
+
"discarded_count": 0,
|
|
238
|
+
"materiality_terms": materiality_terms,
|
|
239
|
+
"must_watch_terms": must_watch_terms,
|
|
240
|
+
"capacity_reason_codes": sorted(_CAPACITY_REASON_CODES),
|
|
241
|
+
"scope_reason_codes": sorted(_SCOPE_REASON_CODES),
|
|
242
|
+
"findings": [],
|
|
243
|
+
"summary_counts": _summary_counts([]),
|
|
244
|
+
"recommended_actions": [],
|
|
245
|
+
"non_goals": sorted(MATERIALITY_SELECTION_NON_GOALS),
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def _policy_materiality_terms(policy_projection: Mapping[str, Any]) -> list[str]:
|
|
250
|
+
if policy_projection.get("status") != "resolved":
|
|
251
|
+
return []
|
|
252
|
+
profile = policy_projection.get("profile") if isinstance(policy_projection.get("profile"), Mapping) else {}
|
|
253
|
+
claim_policy = profile.get("claim_policy") if isinstance(profile.get("claim_policy"), Mapping) else {}
|
|
254
|
+
return _string_list(claim_policy.get("materiality_terms"))
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def _workspace_focus_terms(workspace: Path) -> list[str]:
|
|
258
|
+
config_path = workspace / "config.yaml"
|
|
259
|
+
try:
|
|
260
|
+
config = yaml.safe_load(config_path.read_text(encoding="utf-8")) or {}
|
|
261
|
+
except (OSError, UnicodeDecodeError, yaml.YAMLError):
|
|
262
|
+
return []
|
|
263
|
+
if not isinstance(config, dict):
|
|
264
|
+
return []
|
|
265
|
+
focus = config.get("focus") if isinstance(config.get("focus"), Mapping) else {}
|
|
266
|
+
return _string_list(focus.get("areas"))
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def _screened_candidates_validation_reason(payload: Any) -> str | None:
|
|
270
|
+
from multi_agent_brief.orchestrator.runtime_state.artifact_registry import (
|
|
271
|
+
ARTIFACT_VALID,
|
|
272
|
+
_validate_screened_candidates_payload,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
status, validation_result = _validate_screened_candidates_payload(payload)
|
|
276
|
+
if status == ARTIFACT_VALID:
|
|
277
|
+
return None
|
|
278
|
+
return validation_result
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def _discarded_candidates(payload: Mapping[str, Any]) -> list[dict[str, Any]]:
|
|
282
|
+
result: list[dict[str, Any]] = []
|
|
283
|
+
for bucket in ("excluded", "deprioritized"):
|
|
284
|
+
entries = payload.get(bucket)
|
|
285
|
+
if not isinstance(entries, list):
|
|
286
|
+
continue
|
|
287
|
+
for entry in entries:
|
|
288
|
+
if isinstance(entry, dict):
|
|
289
|
+
result.append({**entry, "_screening_bucket": bucket})
|
|
290
|
+
return result
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
def _candidate_finding(
|
|
294
|
+
candidate: Mapping[str, Any],
|
|
295
|
+
*,
|
|
296
|
+
materiality_terms: list[str],
|
|
297
|
+
must_watch_terms: list[str],
|
|
298
|
+
) -> dict[str, Any] | None:
|
|
299
|
+
reason_code = _reason_code(candidate)
|
|
300
|
+
if reason_code not in _INTERPRETED_REASON_CODES:
|
|
301
|
+
return None
|
|
302
|
+
text = _candidate_text(candidate)
|
|
303
|
+
materiality_matches = _matched_terms(text, materiality_terms)
|
|
304
|
+
must_watch_matches = _matched_terms(text, must_watch_terms)
|
|
305
|
+
if not materiality_matches and not must_watch_matches:
|
|
306
|
+
return None
|
|
307
|
+
human_review = bool(must_watch_matches) or reason_code in _CAPACITY_REASON_CODES
|
|
308
|
+
return {
|
|
309
|
+
"candidate_id": _first_text(candidate, "candidate_id") or None,
|
|
310
|
+
"bucket": _text(candidate.get("_screening_bucket")) or "excluded",
|
|
311
|
+
"reason_code": reason_code,
|
|
312
|
+
"severity": "human_review" if human_review else "warning",
|
|
313
|
+
"matched_materiality_terms": materiality_matches,
|
|
314
|
+
"matched_must_watch_terms": must_watch_matches,
|
|
315
|
+
"statement": _first_text(candidate, "statement", "claim") or None,
|
|
316
|
+
"source_id": _first_text(candidate, "source_id") or None,
|
|
317
|
+
"explanation": _first_text(
|
|
318
|
+
candidate,
|
|
319
|
+
"explanation",
|
|
320
|
+
"short_explanation",
|
|
321
|
+
"screening_explanation",
|
|
322
|
+
"reason_explanation",
|
|
323
|
+
"screening_reason",
|
|
324
|
+
"excluded_reason",
|
|
325
|
+
"deprioritized_reason",
|
|
326
|
+
)
|
|
327
|
+
or None,
|
|
328
|
+
"recommendation": (
|
|
329
|
+
"Review this excluded/deprioritized candidate before finalizing selection; "
|
|
330
|
+
"it matched configured materiality or focus terms but was dropped by capacity/scope screening."
|
|
331
|
+
),
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
def _summary_counts(findings: list[dict[str, Any]]) -> dict[str, int]:
|
|
336
|
+
reasons = Counter(_text(item.get("reason_code")) for item in findings)
|
|
337
|
+
severities = Counter(_text(item.get("severity")) for item in findings)
|
|
338
|
+
return {
|
|
339
|
+
"finding_count": len(findings),
|
|
340
|
+
"capacity_capped_materiality_count": reasons.get("capacity_capped", 0),
|
|
341
|
+
"scope_narrowed_materiality_count": reasons.get("off_focus", 0) + reasons.get("outside_scope", 0),
|
|
342
|
+
"weak_relevance_materiality_count": reasons.get("weak_relevance", 0),
|
|
343
|
+
"human_review_recommended_count": severities.get("human_review", 0),
|
|
344
|
+
"warning_count": severities.get("warning", 0),
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def _recommended_actions(findings: list[dict[str, Any]]) -> list[dict[str, str]]:
|
|
349
|
+
counts = _summary_counts(findings)
|
|
350
|
+
if counts["human_review_recommended_count"] > 0:
|
|
351
|
+
return [{
|
|
352
|
+
"action": "request_human_review",
|
|
353
|
+
"reason": "materiality_or_focus_candidate_excluded_by_capacity_or_scope",
|
|
354
|
+
}]
|
|
355
|
+
if counts["warning_count"] > 0:
|
|
356
|
+
return [{
|
|
357
|
+
"action": "review_materiality_exclusions",
|
|
358
|
+
"reason": "materiality_or_focus_candidate_deprioritized",
|
|
359
|
+
}]
|
|
360
|
+
return []
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
def _candidate_text(candidate: Mapping[str, Any]) -> str:
|
|
364
|
+
parts: list[str] = []
|
|
365
|
+
for key in (
|
|
366
|
+
"candidate_id",
|
|
367
|
+
"statement",
|
|
368
|
+
"claim",
|
|
369
|
+
"evidence_text",
|
|
370
|
+
"topic",
|
|
371
|
+
"title",
|
|
372
|
+
"source_title",
|
|
373
|
+
"source_name",
|
|
374
|
+
):
|
|
375
|
+
value = candidate.get(key)
|
|
376
|
+
if isinstance(value, str) and value.strip():
|
|
377
|
+
parts.append(value.strip())
|
|
378
|
+
metadata = candidate.get("metadata")
|
|
379
|
+
if isinstance(metadata, Mapping):
|
|
380
|
+
for key in ("topic", "materiality", "priority", "tags"):
|
|
381
|
+
value = metadata.get(key)
|
|
382
|
+
if isinstance(value, str) and value.strip():
|
|
383
|
+
parts.append(value.strip())
|
|
384
|
+
elif isinstance(value, list):
|
|
385
|
+
parts.extend(str(item).strip() for item in value if str(item).strip())
|
|
386
|
+
return "\n".join(parts)
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def _matched_terms(text: str, terms: list[str]) -> list[str]:
|
|
390
|
+
normalized_text = _normalize_for_match(text)
|
|
391
|
+
matches: list[str] = []
|
|
392
|
+
for term in terms:
|
|
393
|
+
normalized_term = _normalize_for_match(term)
|
|
394
|
+
if not normalized_term:
|
|
395
|
+
continue
|
|
396
|
+
if normalized_term in normalized_text and term not in matches:
|
|
397
|
+
matches.append(term)
|
|
398
|
+
return matches
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
def _reason_code(candidate: Mapping[str, Any]) -> str:
|
|
402
|
+
for key in ("reason_code", "screening_reason_code", "excluded_reason_code", "deprioritized_reason_code", "reason"):
|
|
403
|
+
value = candidate.get(key)
|
|
404
|
+
normalized = _normalize_reason_code(value)
|
|
405
|
+
if normalized:
|
|
406
|
+
return normalized
|
|
407
|
+
return ""
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
def _normalize_reason_code(value: Any) -> str:
|
|
411
|
+
raw = _text(value).lower()
|
|
412
|
+
if not raw:
|
|
413
|
+
return ""
|
|
414
|
+
normalized = re.sub(r"[^a-z0-9]+", "_", raw).strip("_")
|
|
415
|
+
aliases = {
|
|
416
|
+
"capacity": "capacity_capped",
|
|
417
|
+
"capacity_cap": "capacity_capped",
|
|
418
|
+
"cap": "capacity_capped",
|
|
419
|
+
"duplicate": "duplicate_source",
|
|
420
|
+
"off_topic": "off_focus",
|
|
421
|
+
"outside_focus": "off_focus",
|
|
422
|
+
"weak_relevance": "weak_relevance",
|
|
423
|
+
"low_relevance": "weak_relevance",
|
|
424
|
+
}
|
|
425
|
+
return aliases.get(normalized, normalized)
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
def _first_text(mapping: Mapping[str, Any], *keys: str) -> str:
|
|
429
|
+
for key in keys:
|
|
430
|
+
value = mapping.get(key)
|
|
431
|
+
if isinstance(value, str) and value.strip():
|
|
432
|
+
return value.strip()
|
|
433
|
+
return ""
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
def _string_list(value: Any) -> list[str]:
|
|
437
|
+
if not isinstance(value, list):
|
|
438
|
+
return []
|
|
439
|
+
result: list[str] = []
|
|
440
|
+
seen: set[str] = set()
|
|
441
|
+
for item in value:
|
|
442
|
+
text = _text(item)
|
|
443
|
+
if not text:
|
|
444
|
+
continue
|
|
445
|
+
key = text.casefold()
|
|
446
|
+
if key in seen:
|
|
447
|
+
continue
|
|
448
|
+
seen.add(key)
|
|
449
|
+
result.append(text)
|
|
450
|
+
return result
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
def _normalize_for_match(value: str) -> str:
|
|
454
|
+
return re.sub(r"\s+", " ", value.casefold()).strip()
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
def _text(value: Any) -> str:
|
|
458
|
+
if isinstance(value, str):
|
|
459
|
+
return value.strip()
|
|
460
|
+
return ""
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
def _contains_forbidden_authority_key(value: Any) -> bool:
|
|
464
|
+
if isinstance(value, Mapping):
|
|
465
|
+
for key, item in value.items():
|
|
466
|
+
if str(key) in _FORBIDDEN_AUTHORITY_KEYS:
|
|
467
|
+
return True
|
|
468
|
+
if _contains_forbidden_authority_key(item):
|
|
469
|
+
return True
|
|
470
|
+
elif isinstance(value, list):
|
|
471
|
+
return any(_contains_forbidden_authority_key(item) for item in value)
|
|
472
|
+
return False
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"""Deterministic gate adapter for product-layer PolicyProfiles."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from multi_agent_brief.product.policy_projection import project_workspace_policy_profile
|
|
9
|
+
from multi_agent_brief.product.policy_registry import PolicyProfileRegistry
|
|
10
|
+
|
|
11
|
+
POLICY_GATE_ADAPTER_BOUNDARY = "product_policy_profile_deterministic_gate_adapter"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def resolve_workspace_policy_gate_adapter(workspace: str | Path) -> dict[str, Any]:
|
|
15
|
+
"""Resolve deterministic gate knobs for a workspace.
|
|
16
|
+
|
|
17
|
+
The adapter may only tighten existing deterministic checks. It must not
|
|
18
|
+
create a second gate engine, make compliance/truth claims, or bypass the
|
|
19
|
+
Claim Ledger / quality gate / human delivery spine.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
projection = project_workspace_policy_profile(workspace)
|
|
23
|
+
if projection.get("status") != "resolved":
|
|
24
|
+
return {
|
|
25
|
+
"status": projection.get("status") or "not_available",
|
|
26
|
+
"boundary": POLICY_GATE_ADAPTER_BOUNDARY,
|
|
27
|
+
"runtime_effect": "none",
|
|
28
|
+
"projection_status": projection.get("status"),
|
|
29
|
+
"reason": projection.get("reason") or "policy_profile_not_resolved",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
profile_id = projection.get("resolved_policy_profile")
|
|
33
|
+
if not isinstance(profile_id, str) or not profile_id.strip():
|
|
34
|
+
return {
|
|
35
|
+
"status": "not_resolved",
|
|
36
|
+
"boundary": POLICY_GATE_ADAPTER_BOUNDARY,
|
|
37
|
+
"runtime_effect": "none",
|
|
38
|
+
"projection_status": projection.get("status"),
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
registry = PolicyProfileRegistry.from_package()
|
|
42
|
+
profile = registry.get(profile_id.strip())
|
|
43
|
+
if profile is None:
|
|
44
|
+
return {
|
|
45
|
+
"status": "unknown_policy_profile",
|
|
46
|
+
"boundary": POLICY_GATE_ADAPTER_BOUNDARY,
|
|
47
|
+
"runtime_effect": "none",
|
|
48
|
+
"projection_status": projection.get("status"),
|
|
49
|
+
"policy_profile_id": profile_id.strip(),
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
payload = dict(profile.payload)
|
|
53
|
+
source_policy = payload.get("source_policy") if isinstance(payload.get("source_policy"), dict) else {}
|
|
54
|
+
wording_policy = payload.get("wording_policy") if isinstance(payload.get("wording_policy"), dict) else {}
|
|
55
|
+
gate_policy = payload.get("gate_policy") if isinstance(payload.get("gate_policy"), dict) else {}
|
|
56
|
+
metadata = payload.get("metadata") if isinstance(payload.get("metadata"), dict) else {}
|
|
57
|
+
return {
|
|
58
|
+
"status": "applied",
|
|
59
|
+
"boundary": POLICY_GATE_ADAPTER_BOUNDARY,
|
|
60
|
+
"runtime_effect": "tighten_existing_deterministic_gates_only",
|
|
61
|
+
"policy_profile_id": profile_id.strip(),
|
|
62
|
+
"source": projection.get("source"),
|
|
63
|
+
"policy_profile_sha256": projection.get("policy_profile_sha256"),
|
|
64
|
+
"gate_policy": {
|
|
65
|
+
key: str(value).strip()
|
|
66
|
+
for key, value in gate_policy.items()
|
|
67
|
+
if isinstance(key, str) and isinstance(value, str) and value.strip()
|
|
68
|
+
},
|
|
69
|
+
"source_policy": {
|
|
70
|
+
"freshness_days_by_tier": dict(source_policy.get("freshness_days_by_tier") or {}),
|
|
71
|
+
},
|
|
72
|
+
"wording_policy": {
|
|
73
|
+
"forbidden_phrases": _stable_strings(wording_policy.get("forbidden_phrases")),
|
|
74
|
+
},
|
|
75
|
+
"adapter_scope": [
|
|
76
|
+
"quality_gates.strictness",
|
|
77
|
+
"reader_final_gate.forbidden_phrases",
|
|
78
|
+
],
|
|
79
|
+
"non_claims": list(metadata.get("non_claims") or []),
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def policy_gate_is_strict(adapter: dict[str, Any] | None, gate_id: str, *, cli_strict: bool = False) -> bool:
|
|
84
|
+
if cli_strict:
|
|
85
|
+
return True
|
|
86
|
+
if not isinstance(adapter, dict) or adapter.get("status") != "applied":
|
|
87
|
+
return False
|
|
88
|
+
gate_policy = adapter.get("gate_policy")
|
|
89
|
+
if not isinstance(gate_policy, dict):
|
|
90
|
+
return False
|
|
91
|
+
return gate_policy.get(gate_id) == "strict"
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def policy_forbidden_phrases(adapter: dict[str, Any] | None) -> tuple[str, ...]:
|
|
95
|
+
if not isinstance(adapter, dict) or adapter.get("status") != "applied":
|
|
96
|
+
return ()
|
|
97
|
+
wording_policy = adapter.get("wording_policy")
|
|
98
|
+
if not isinstance(wording_policy, dict):
|
|
99
|
+
return ()
|
|
100
|
+
return tuple(_stable_strings(wording_policy.get("forbidden_phrases")))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def _stable_strings(value: Any) -> list[str]:
|
|
104
|
+
if not isinstance(value, list):
|
|
105
|
+
return []
|
|
106
|
+
seen: set[str] = set()
|
|
107
|
+
result: list[str] = []
|
|
108
|
+
for item in value:
|
|
109
|
+
if not isinstance(item, str):
|
|
110
|
+
continue
|
|
111
|
+
text = " ".join(item.split()).strip()
|
|
112
|
+
key = text.lower()
|
|
113
|
+
if text and key not in seen:
|
|
114
|
+
seen.add(key)
|
|
115
|
+
result.append(text)
|
|
116
|
+
return result
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Experimental product-layer PolicyProfile config contract."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any, Mapping
|
|
8
|
+
|
|
9
|
+
from multi_agent_brief.contracts.errors import FieldViolation
|
|
10
|
+
from multi_agent_brief.contracts.schemas.policy_profile import PolicyProfileContract
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class PolicyProfile:
|
|
15
|
+
profile_id: str
|
|
16
|
+
industry: str
|
|
17
|
+
source_path: str
|
|
18
|
+
payload: Mapping[str, Any]
|
|
19
|
+
|
|
20
|
+
@classmethod
|
|
21
|
+
def from_payload(cls, payload: Mapping[str, Any], *, source_path: str | Path) -> "PolicyProfile":
|
|
22
|
+
return cls(
|
|
23
|
+
profile_id=str(payload.get("policy_profile_id", "")),
|
|
24
|
+
industry=str(payload.get("industry", "")),
|
|
25
|
+
source_path=str(source_path),
|
|
26
|
+
payload=payload,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
def to_summary(self) -> dict[str, str]:
|
|
30
|
+
return {
|
|
31
|
+
"policy_profile_id": self.profile_id,
|
|
32
|
+
"industry": self.industry,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def validate_policy_profile_payload(payload: Mapping[str, Any]) -> list[FieldViolation]:
|
|
37
|
+
if not isinstance(payload, dict):
|
|
38
|
+
return [FieldViolation(field="<root>", error="must be an object")]
|
|
39
|
+
return PolicyProfileContract.validate(dict(payload))
|