psyclaw 0.27.22 → 0.28.0
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.
- package/README.md +11 -5
- package/dist/apps/panel/index.html +2 -2
- package/dist/src/adapters/pi/extension.js +225 -92
- package/dist/src/adapters/pi/extension.js.map +1 -1
- package/dist/src/agents/import.js +44 -32
- package/dist/src/agents/import.js.map +1 -1
- package/dist/src/analysis/hooks.d.ts +1 -0
- package/dist/src/analysis/hooks.js +20 -1
- package/dist/src/analysis/hooks.js.map +1 -1
- package/dist/src/ars/bridge.d.ts +20 -0
- package/dist/src/ars/bridge.js +132 -0
- package/dist/src/ars/bridge.js.map +1 -0
- package/dist/src/ars/contracts.d.ts +55 -0
- package/dist/src/ars/contracts.js +2 -0
- package/dist/src/ars/contracts.js.map +1 -0
- package/dist/src/ars/panel-plan.d.ts +4 -0
- package/dist/src/ars/panel-plan.js +11 -0
- package/dist/src/ars/panel-plan.js.map +1 -0
- package/dist/src/ars/pi-panel-executor.d.ts +30 -0
- package/dist/src/ars/pi-panel-executor.js +140 -0
- package/dist/src/ars/pi-panel-executor.js.map +1 -0
- package/dist/src/ars/profile.d.ts +36 -0
- package/dist/src/ars/profile.js +119 -0
- package/dist/src/ars/profile.js.map +1 -0
- package/dist/src/ars/re-review.d.ts +22 -0
- package/dist/src/ars/re-review.js +172 -0
- package/dist/src/ars/re-review.js.map +1 -0
- package/dist/src/branding.d.ts +2 -4
- package/dist/src/branding.js +3 -5
- package/dist/src/branding.js.map +1 -1
- package/dist/src/bundled-tools.d.ts +3 -0
- package/dist/src/bundled-tools.js +21 -0
- package/dist/src/bundled-tools.js.map +1 -0
- package/dist/src/chat.js +6 -5
- package/dist/src/chat.js.map +1 -1
- package/dist/src/creation/contracts.d.ts +38 -0
- package/dist/src/creation/contracts.js +2 -0
- package/dist/src/creation/contracts.js.map +1 -0
- package/dist/src/creation/service.d.ts +7 -0
- package/dist/src/creation/service.js +196 -0
- package/dist/src/creation/service.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +10 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/install/installer.js +32 -10
- package/dist/src/install/installer.js.map +1 -1
- package/dist/src/orchestration/personas.d.ts +15 -0
- package/dist/src/orchestration/personas.js +51 -0
- package/dist/src/orchestration/personas.js.map +1 -0
- package/dist/src/orchestration/pi-executor.d.ts +1 -0
- package/dist/src/orchestration/pi-executor.js +1 -1
- package/dist/src/orchestration/pi-executor.js.map +1 -1
- package/dist/src/panel/extension.js +29 -8
- package/dist/src/panel/extension.js.map +1 -1
- package/dist/src/panel/server.js +14 -5
- package/dist/src/panel/server.js.map +1 -1
- package/dist/src/project/paths.d.ts +3 -0
- package/dist/src/project/paths.js +7 -0
- package/dist/src/project/paths.js.map +1 -1
- package/dist/src/rules/user-rules.d.ts +8 -0
- package/dist/src/rules/user-rules.js +36 -0
- package/dist/src/rules/user-rules.js.map +1 -0
- package/dist/src/skills/contracts.d.ts +4 -4
- package/dist/src/skills/recommended.js +1 -1
- package/dist/src/skills/registry.js +49 -28
- package/dist/src/skills/registry.js.map +1 -1
- package/dist/src/style/cli-ui.js +0 -1
- package/dist/src/style/cli-ui.js.map +1 -1
- package/package.json +14 -3
- package/scripts/rebrand-pi.mjs +6 -0
- package/skills/recommended/catalog.json +2 -11
- package/vendor/ars/.claude/CLAUDE.md +371 -0
- package/vendor/ars/.command-invariants.toml +24 -0
- package/vendor/ars/CITATION.cff +35 -0
- package/vendor/ars/LICENSE +417 -0
- package/vendor/ars/MODE_REGISTRY.md +76 -0
- package/vendor/ars/NOTICE.md +26 -0
- package/vendor/ars/POSITIONING.md +99 -0
- package/vendor/ars/PSYCLAW_SOURCE.json +10 -0
- package/vendor/ars/README.md +751 -0
- package/vendor/ars/SECURITY.md +52 -0
- package/vendor/ars/THIRD_PARTY.md +70 -0
- package/vendor/ars/academic-paper/SKILL.md +542 -0
- package/vendor/ars/academic-paper/agents/abstract_bilingual_agent.md +171 -0
- package/vendor/ars/academic-paper/agents/argument_builder_agent.md +276 -0
- package/vendor/ars/academic-paper/agents/citation_compliance_agent.md +422 -0
- package/vendor/ars/academic-paper/agents/draft_writer_agent.md +656 -0
- package/vendor/ars/academic-paper/agents/formatter_agent.md +999 -0
- package/vendor/ars/academic-paper/agents/intake_agent.md +393 -0
- package/vendor/ars/academic-paper/agents/literature_strategist_agent.md +626 -0
- package/vendor/ars/academic-paper/agents/peer_reviewer_agent.md +516 -0
- package/vendor/ars/academic-paper/agents/revision_coach_agent.md +334 -0
- package/vendor/ars/academic-paper/agents/socratic_mentor_agent.md +527 -0
- package/vendor/ars/academic-paper/agents/structure_architect_agent.md +401 -0
- package/vendor/ars/academic-paper/agents/visualization_agent.md +441 -0
- package/vendor/ars/academic-paper/examples/chinese_paper_example.md +278 -0
- package/vendor/ars/academic-paper/examples/clinical_citation_verification_checklist.md +95 -0
- package/vendor/ars/academic-paper/examples/clinical_epistemic_status_example.md +100 -0
- package/vendor/ars/academic-paper/examples/commitment_ledger_example.md +147 -0
- package/vendor/ars/academic-paper/examples/imrad_hei_example.md +234 -0
- package/vendor/ars/academic-paper/examples/literature_review_example.md +260 -0
- package/vendor/ars/academic-paper/examples/plan_mode_guided_writing.md +600 -0
- package/vendor/ars/academic-paper/examples/revision_mode_example.md +344 -0
- package/vendor/ars/academic-paper/examples/revision_recovery_example.md +506 -0
- package/vendor/ars/academic-paper/examples/version_family_reconciliation_example.md +89 -0
- package/vendor/ars/academic-paper/references/abstract_writing_guide.md +169 -0
- package/vendor/ars/academic-paper/references/academic_writing_style.md +188 -0
- package/vendor/ars/academic-paper/references/anti_leakage_protocol.md +83 -0
- package/vendor/ars/academic-paper/references/apa7_chinese_citation_guide.md +364 -0
- package/vendor/ars/academic-paper/references/apa7_extended_guide.md +198 -0
- package/vendor/ars/academic-paper/references/changelog.md +11 -0
- package/vendor/ars/academic-paper/references/citation_format_switcher.md +228 -0
- package/vendor/ars/academic-paper/references/committee_correspondence_protocol.md +158 -0
- package/vendor/ars/academic-paper/references/credit_authorship_guide.md +308 -0
- package/vendor/ars/academic-paper/references/disclosure_mode_protocol.md +478 -0
- package/vendor/ars/academic-paper/references/domain_evidence_profiles.md +38 -0
- package/vendor/ars/academic-paper/references/failure_paths.md +349 -0
- package/vendor/ars/academic-paper/references/funding_statement_guide.md +319 -0
- package/vendor/ars/academic-paper/references/hei_domain_glossary.md +169 -0
- package/vendor/ars/academic-paper/references/intro_title_rhetoric_guide.md +114 -0
- package/vendor/ars/academic-paper/references/journal_submission_guide.md +249 -0
- package/vendor/ars/academic-paper/references/latex_template_reference.md +378 -0
- package/vendor/ars/academic-paper/references/mode_selection_guide.md +378 -0
- package/vendor/ars/academic-paper/references/paper_structure_patterns.md +330 -0
- package/vendor/ars/academic-paper/references/plan_mode_protocol.md +112 -0
- package/vendor/ars/academic-paper/references/policy_anchor_disclosure_protocol.md +200 -0
- package/vendor/ars/academic-paper/references/policy_anchor_table.md +157 -0
- package/vendor/ars/academic-paper/references/revision_patch_protocol.md +173 -0
- package/vendor/ars/academic-paper/references/statistical_visualization_standards.md +750 -0
- package/vendor/ars/academic-paper/references/venue_disclosure_policies.md +259 -0
- package/vendor/ars/academic-paper/references/vlm_figure_verification.md +126 -0
- package/vendor/ars/academic-paper/references/workflow_phase_details.md +135 -0
- package/vendor/ars/academic-paper/references/writing_judgment_framework.md +59 -0
- package/vendor/ars/academic-paper/references/writing_quality_check.md +173 -0
- package/vendor/ars/academic-paper/templates/bilingual_abstract_template.md +78 -0
- package/vendor/ars/academic-paper/templates/case_study_template.md +129 -0
- package/vendor/ars/academic-paper/templates/conference_paper_template.md +108 -0
- package/vendor/ars/academic-paper/templates/credit_statement_template.md +132 -0
- package/vendor/ars/academic-paper/templates/funding_statement_template.md +290 -0
- package/vendor/ars/academic-paper/templates/imrad_template.md +183 -0
- package/vendor/ars/academic-paper/templates/latex_article_template.tex +199 -0
- package/vendor/ars/academic-paper/templates/literature_review_template.md +135 -0
- package/vendor/ars/academic-paper/templates/policy_brief_template.md +139 -0
- package/vendor/ars/academic-paper/templates/revision_tracking_template.md +199 -0
- package/vendor/ars/academic-paper/templates/theoretical_paper_template.md +119 -0
- package/vendor/ars/academic-paper-reviewer/SKILL.md +491 -0
- package/vendor/ars/academic-paper-reviewer/agents/devils_advocate_reviewer_agent.md +443 -0
- package/vendor/ars/academic-paper-reviewer/agents/domain_reviewer_agent.md +412 -0
- package/vendor/ars/academic-paper-reviewer/agents/editorial_synthesizer_agent.md +478 -0
- package/vendor/ars/academic-paper-reviewer/agents/eic_agent.md +339 -0
- package/vendor/ars/academic-paper-reviewer/agents/field_analyst_agent.md +221 -0
- package/vendor/ars/academic-paper-reviewer/agents/methodology_reviewer_agent.md +449 -0
- package/vendor/ars/academic-paper-reviewer/agents/perspective_reviewer_agent.md +427 -0
- package/vendor/ars/academic-paper-reviewer/examples/hei_paper_review_example.md +391 -0
- package/vendor/ars/academic-paper-reviewer/examples/interdisciplinary_review_example.md +299 -0
- package/vendor/ars/academic-paper-reviewer/examples/subclaim_decomposition_example.md +80 -0
- package/vendor/ars/academic-paper-reviewer/references/calibration_mode_protocol.md +256 -0
- package/vendor/ars/academic-paper-reviewer/references/changelog.md +10 -0
- package/vendor/ars/academic-paper-reviewer/references/editorial_decision_standards.md +236 -0
- package/vendor/ars/academic-paper-reviewer/references/guided_mode_protocol.md +34 -0
- package/vendor/ars/academic-paper-reviewer/references/integration_guide.md +15 -0
- package/vendor/ars/academic-paper-reviewer/references/quality_rubrics.md +84 -0
- package/vendor/ars/academic-paper-reviewer/references/re_review_mode_protocol.md +340 -0
- package/vendor/ars/academic-paper-reviewer/references/review_criteria_framework.md +98 -0
- package/vendor/ars/academic-paper-reviewer/references/review_panel_provenance_protocol.md +197 -0
- package/vendor/ars/academic-paper-reviewer/references/review_quality_thinking.md +58 -0
- package/vendor/ars/academic-paper-reviewer/references/reviewer_sprint_prompt_source.md +324 -0
- package/vendor/ars/academic-paper-reviewer/references/sprint_contract_protocol.md +296 -0
- package/vendor/ars/academic-paper-reviewer/references/statistical_reporting_standards.md +505 -0
- package/vendor/ars/academic-paper-reviewer/references/top_journals_by_field.md +206 -0
- package/vendor/ars/academic-paper-reviewer/templates/editorial_decision_template.md +235 -0
- package/vendor/ars/academic-paper-reviewer/templates/peer_review_report_template.md +305 -0
- package/vendor/ars/academic-paper-reviewer/templates/revision_response_template.md +248 -0
- package/vendor/ars/academic-pipeline/SKILL.md +736 -0
- package/vendor/ars/academic-pipeline/agents/claim_ref_alignment_audit_agent.md +382 -0
- package/vendor/ars/academic-pipeline/agents/collaboration_depth_agent.md +164 -0
- package/vendor/ars/academic-pipeline/agents/integrity_verification_agent.md +870 -0
- package/vendor/ars/academic-pipeline/agents/pipeline_orchestrator_agent.md +1379 -0
- package/vendor/ars/academic-pipeline/agents/state_tracker_agent.md +622 -0
- package/vendor/ars/academic-pipeline/examples/full_pipeline_example.md +482 -0
- package/vendor/ars/academic-pipeline/examples/integrity_failure_recovery.md +389 -0
- package/vendor/ars/academic-pipeline/examples/mid_entry_example.md +414 -0
- package/vendor/ars/academic-pipeline/references/adapters/.gitkeep +0 -0
- package/vendor/ars/academic-pipeline/references/adapters/overview.md +153 -0
- package/vendor/ars/academic-pipeline/references/ai_research_failure_modes.md +185 -0
- package/vendor/ars/academic-pipeline/references/changelog.md +14 -0
- package/vendor/ars/academic-pipeline/references/claim_audit_calibration_protocol.md +175 -0
- package/vendor/ars/academic-pipeline/references/claim_verification_protocol.md +282 -0
- package/vendor/ars/academic-pipeline/references/external_review_protocol.md +131 -0
- package/vendor/ars/academic-pipeline/references/integrity_review_protocol.md +110 -0
- package/vendor/ars/academic-pipeline/references/literature_corpus_consumers.md +193 -0
- package/vendor/ars/academic-pipeline/references/mode_advisor.md +135 -0
- package/vendor/ars/academic-pipeline/references/passport_as_reset_boundary.md +132 -0
- package/vendor/ars/academic-pipeline/references/pipeline_state_machine.md +405 -0
- package/vendor/ars/academic-pipeline/references/plagiarism_detection_protocol.md +239 -0
- package/vendor/ars/academic-pipeline/references/process_summary_protocol.md +209 -0
- package/vendor/ars/academic-pipeline/references/progress_dashboard_template.md +38 -0
- package/vendor/ars/academic-pipeline/references/reinforcement_content.md +15 -0
- package/vendor/ars/academic-pipeline/references/reproducibility_audit.md +55 -0
- package/vendor/ars/academic-pipeline/references/score_trajectory_protocol.md +78 -0
- package/vendor/ars/academic-pipeline/references/team_collaboration_protocol.md +261 -0
- package/vendor/ars/academic-pipeline/references/two_stage_review_protocol.md +27 -0
- package/vendor/ars/academic-pipeline/templates/pipeline_status_template.md +146 -0
- package/vendor/ars/agents/report_compiler_agent.md +341 -0
- package/vendor/ars/agents/research_architect_agent.md +298 -0
- package/vendor/ars/agents/synthesis_agent.md +356 -0
- package/vendor/ars/commands/ars-3w.md +10 -0
- package/vendor/ars/commands/ars-abstract.md +10 -0
- package/vendor/ars/commands/ars-cache-invalidate.md +20 -0
- package/vendor/ars/commands/ars-citation-check.md +10 -0
- package/vendor/ars/commands/ars-disclosure.md +10 -0
- package/vendor/ars/commands/ars-format-convert.md +10 -0
- package/vendor/ars/commands/ars-full.md +9 -0
- package/vendor/ars/commands/ars-lit-review.md +12 -0
- package/vendor/ars/commands/ars-mark-read.md +18 -0
- package/vendor/ars/commands/ars-outline.md +10 -0
- package/vendor/ars/commands/ars-plan.md +10 -0
- package/vendor/ars/commands/ars-rebuttal-audit.md +12 -0
- package/vendor/ars/commands/ars-reviewer.md +9 -0
- package/vendor/ars/commands/ars-revision-coach.md +9 -0
- package/vendor/ars/commands/ars-revision.md +10 -0
- package/vendor/ars/commands/ars-unmark-read.md +16 -0
- package/vendor/ars/deep-research/SKILL.md +600 -0
- package/vendor/ars/deep-research/agents/bibliography_agent.md +473 -0
- package/vendor/ars/deep-research/agents/devils_advocate_agent.md +192 -0
- package/vendor/ars/deep-research/agents/editor_in_chief_agent.md +167 -0
- package/vendor/ars/deep-research/agents/ethics_review_agent.md +267 -0
- package/vendor/ars/deep-research/agents/meta_analysis_agent.md +325 -0
- package/vendor/ars/deep-research/agents/monitoring_agent.md +209 -0
- package/vendor/ars/deep-research/agents/report_compiler_agent.md +341 -0
- package/vendor/ars/deep-research/agents/research_architect_agent.md +298 -0
- package/vendor/ars/deep-research/agents/research_question_agent.md +216 -0
- package/vendor/ars/deep-research/agents/risk_of_bias_agent.md +231 -0
- package/vendor/ars/deep-research/agents/socratic_mentor_agent.md +764 -0
- package/vendor/ars/deep-research/agents/source_verification_agent.md +219 -0
- package/vendor/ars/deep-research/agents/synthesis_agent.md +356 -0
- package/vendor/ars/deep-research/agents/timeline_extraction_agent.md +99 -0
- package/vendor/ars/deep-research/examples/exploratory_research.md +157 -0
- package/vendor/ars/deep-research/examples/fact_check_mode.md +173 -0
- package/vendor/ars/deep-research/examples/handoff_to_paper.md +318 -0
- package/vendor/ars/deep-research/examples/idea_diversity_coverage_gap_advisory.md +64 -0
- package/vendor/ars/deep-research/examples/policy_analysis.md +161 -0
- package/vendor/ars/deep-research/examples/review_mode.md +253 -0
- package/vendor/ars/deep-research/examples/socratic_guided_research.md +331 -0
- package/vendor/ars/deep-research/examples/systematic_review.md +133 -0
- package/vendor/ars/deep-research/references/apa7_style_guide.md +162 -0
- package/vendor/ars/deep-research/references/argumentation_reasoning_framework.md +68 -0
- package/vendor/ars/deep-research/references/arxiv_api_protocol.md +76 -0
- package/vendor/ars/deep-research/references/changelog.md +22 -0
- package/vendor/ars/deep-research/references/chinese_literature_api_protocol.md +317 -0
- package/vendor/ars/deep-research/references/cross_agent_quality_definitions.md +14 -0
- package/vendor/ars/deep-research/references/crossref_api_protocol.md +84 -0
- package/vendor/ars/deep-research/references/equator_reporting_guidelines.md +482 -0
- package/vendor/ars/deep-research/references/ethics_checklist.md +282 -0
- package/vendor/ars/deep-research/references/failure_paths.md +355 -0
- package/vendor/ars/deep-research/references/interdisciplinary_bridges.md +292 -0
- package/vendor/ars/deep-research/references/irb_decision_tree.md +315 -0
- package/vendor/ars/deep-research/references/literature_monitoring_strategies.md +263 -0
- package/vendor/ars/deep-research/references/logical_fallacies.md +192 -0
- package/vendor/ars/deep-research/references/methodology_patterns.md +462 -0
- package/vendor/ars/deep-research/references/mode_selection_guide.md +331 -0
- package/vendor/ars/deep-research/references/openalex_api_protocol.md +82 -0
- package/vendor/ars/deep-research/references/preregistration_guide.md +324 -0
- package/vendor/ars/deep-research/references/semantic_scholar_api_protocol.md +107 -0
- package/vendor/ars/deep-research/references/socratic_mode_protocol.md +99 -0
- package/vendor/ars/deep-research/references/socratic_questioning_framework.md +232 -0
- package/vendor/ars/deep-research/references/source_quality_hierarchy.md +188 -0
- package/vendor/ars/deep-research/references/systematic_review_protocol.md +95 -0
- package/vendor/ars/deep-research/references/systematic_review_toolkit.md +353 -0
- package/vendor/ars/deep-research/templates/evidence_assessment_template.md +127 -0
- package/vendor/ars/deep-research/templates/literature_matrix_template.md +85 -0
- package/vendor/ars/deep-research/templates/preregistration_template.md +318 -0
- package/vendor/ars/deep-research/templates/prisma_protocol_template.md +248 -0
- package/vendor/ars/deep-research/templates/prisma_report_template.md +415 -0
- package/vendor/ars/deep-research/templates/research_brief_template.md +93 -0
- package/vendor/ars/package.json +24 -0
- package/vendor/ars/pi/README.md +161 -0
- package/vendor/ars/pi/package.json +26 -0
- package/vendor/ars/pi/wrapper.js +193 -0
- package/vendor/ars/pi/wrapper.test.mjs +201 -0
- package/vendor/ars/pyproject.toml +2 -0
- package/vendor/ars/requirements-pdf-content-classifier.txt +5 -0
- package/vendor/ars/scripts/_block_parser.py +396 -0
- package/vendor/ars/scripts/_ci_pytest_manifest.toml +661 -0
- package/vendor/ars/scripts/_claim_audit_constants.py +268 -0
- package/vendor/ars/scripts/_e4_evidence.py +110 -0
- package/vendor/ars/scripts/_eval_threshold_gate.py +73 -0
- package/vendor/ars/scripts/_markdown_lint_util.py +224 -0
- package/vendor/ars/scripts/_next_verified_at_ms.py +176 -0
- package/vendor/ars/scripts/_passport_yaml.py +53 -0
- package/vendor/ars/scripts/_skill_lint.py +254 -0
- package/vendor/ars/scripts/_text_similarity.py +141 -0
- package/vendor/ars/scripts/adapters/README.md +89 -0
- package/vendor/ars/scripts/adapters/_common.py +209 -0
- package/vendor/ars/scripts/adapters/examples/folder_scan/expected_passport.yaml +25 -0
- package/vendor/ars/scripts/adapters/examples/folder_scan/expected_rejection_log.yaml +18 -0
- package/vendor/ars/scripts/adapters/examples/folder_scan/input_fixture/Chen2024_AIAssessment.pdf +0 -0
- package/vendor/ars/scripts/adapters/examples/folder_scan/input_fixture/Wang_2023_formative_feedback.pdf +0 -0
- package/vendor/ars/scripts/adapters/examples/folder_scan/input_fixture/paper1.pdf +0 -0
- package/vendor/ars/scripts/adapters/examples/folder_scan/input_fixture//344/270/255/346/226/207/346/252/224/345/220/215_2024.pdf +0 -0
- package/vendor/ars/scripts/adapters/examples/obsidian/expected_passport.yaml +40 -0
- package/vendor/ars/scripts/adapters/examples/obsidian/expected_rejection_log.yaml +13 -0
- package/vendor/ars/scripts/adapters/examples/obsidian/input_fixture/vault/.gitkeep +0 -0
- package/vendor/ars/scripts/adapters/examples/obsidian/input_fixture/vault/.obsidian/app.json +1 -0
- package/vendor/ars/scripts/adapters/examples/obsidian/input_fixture/vault/_templates/tmpl.md +7 -0
- package/vendor/ars/scripts/adapters/examples/obsidian/input_fixture/vault/chen2024ai.md +13 -0
- package/vendor/ars/scripts/adapters/examples/obsidian/input_fixture/vault/invalid.md +1 -0
- package/vendor/ars/scripts/adapters/examples/obsidian/input_fixture/vault/wang2023formative.md +10 -0
- package/vendor/ars/scripts/adapters/examples/zotero/expected_passport.yaml +34 -0
- package/vendor/ars/scripts/adapters/examples/zotero/expected_rejection_log.yaml +34 -0
- package/vendor/ars/scripts/adapters/examples/zotero/input_fixture/.gitkeep +0 -0
- package/vendor/ars/scripts/adapters/examples/zotero/input_fixture/export.json +43 -0
- package/vendor/ars/scripts/adapters/folder_scan.py +214 -0
- package/vendor/ars/scripts/adapters/obsidian.py +336 -0
- package/vendor/ars/scripts/adapters/tests/.gitkeep +0 -0
- package/vendor/ars/scripts/adapters/tests/conftest.py +77 -0
- package/vendor/ars/scripts/adapters/tests/test_check_corpus_consumer_protocol.py +632 -0
- package/vendor/ars/scripts/adapters/tests/test_check_literature_corpus_schema.py +631 -0
- package/vendor/ars/scripts/adapters/tests/test_common.py +365 -0
- package/vendor/ars/scripts/adapters/tests/test_conftest.py +96 -0
- package/vendor/ars/scripts/adapters/tests/test_folder_scan.py +260 -0
- package/vendor/ars/scripts/adapters/tests/test_literature_corpus_entry_schema.py +745 -0
- package/vendor/ars/scripts/adapters/tests/test_obsidian.py +357 -0
- package/vendor/ars/scripts/adapters/tests/test_rejection_log_schema.py +271 -0
- package/vendor/ars/scripts/adapters/tests/test_sync_adapter_docs.py +88 -0
- package/vendor/ars/scripts/adapters/tests/test_zotero.py +454 -0
- package/vendor/ars/scripts/adapters/zotero.py +318 -0
- package/vendor/ars/scripts/adjudication_activity.py +1592 -0
- package/vendor/ars/scripts/announce-ars-loaded.sh +144 -0
- package/vendor/ars/scripts/ars_anchorize_draft.py +170 -0
- package/vendor/ars/scripts/ars_apply_revision_patch.py +912 -0
- package/vendor/ars/scripts/ars_cache_invalidate.py +40 -0
- package/vendor/ars/scripts/ars_mark_read.py +521 -0
- package/vendor/ars/scripts/ars_phase_scope_manifest.json +33 -0
- package/vendor/ars/scripts/ars_update_check.sh +215 -0
- package/vendor/ars/scripts/ars_write_scope_guard.py +506 -0
- package/vendor/ars/scripts/arxiv_client.py +222 -0
- package/vendor/ars/scripts/audit_snapshot.py +572 -0
- package/vendor/ars/scripts/bibliographic_integrity_signals.py +800 -0
- package/vendor/ars/scripts/bootstrap_timeline_yaml.py +146 -0
- package/vendor/ars/scripts/build_claim_standing_candidate_ledger.py +1238 -0
- package/vendor/ars/scripts/build_claim_standing_query_plan.py +643 -0
- package/vendor/ars/scripts/build_content_coverage_advisory.py +1205 -0
- package/vendor/ars/scripts/build_cross_document_consistency_advisory.py +2332 -0
- package/vendor/ars/scripts/build_review_pathway_rule_trace.py +830 -0
- package/vendor/ars/scripts/build_submission_packet_manifest.py +2310 -0
- package/vendor/ars/scripts/check_215_field_norm.py +173 -0
- package/vendor/ars/scripts/check_216_surface_form.py +250 -0
- package/vendor/ars/scripts/check_268_nested_commitment_ledger.py +180 -0
- package/vendor/ars/scripts/check_390_revision_patch_discipline.py +296 -0
- package/vendor/ars/scripts/check_392_citation_verification_intake.py +126 -0
- package/vendor/ars/scripts/check_394_submission_policy.py +178 -0
- package/vendor/ars/scripts/check_439_format_profile.py +307 -0
- package/vendor/ars/scripts/check_619_disclosure_closeout.py +237 -0
- package/vendor/ars/scripts/check_630_codex_subscription_transport.py +456 -0
- package/vendor/ars/scripts/check_669_review_pathway_rule_trace.py +662 -0
- package/vendor/ars/scripts/check_670_revision_roadmap_integration.py +518 -0
- package/vendor/ars/scripts/check_673_adjudication_activity.py +684 -0
- package/vendor/ars/scripts/check_684_review_criteria_binding.py +557 -0
- package/vendor/ars/scripts/check_agents_mirror_sync.py +115 -0
- package/vendor/ars/scripts/check_audit_artifact_consistency.py +2313 -0
- package/vendor/ars/scripts/check_benchmark_report.py +79 -0
- package/vendor/ars/scripts/check_bibliographic_integrity_signals.py +831 -0
- package/vendor/ars/scripts/check_calibration_tiers.py +235 -0
- package/vendor/ars/scripts/check_changelog_covers_merges.py +289 -0
- package/vendor/ars/scripts/check_ci_pytest_manifest.py +204 -0
- package/vendor/ars/scripts/check_claim_audit_consistency.py +1664 -0
- package/vendor/ars/scripts/check_claim_standing_candidate_ledger_integration.py +500 -0
- package/vendor/ars/scripts/check_claim_standing_freshness.py +253 -0
- package/vendor/ars/scripts/check_claim_standing_transmissions.py +449 -0
- package/vendor/ars/scripts/check_collaboration_depth_rubric.py +180 -0
- package/vendor/ars/scripts/check_command_frontmatter_name.py +116 -0
- package/vendor/ars/scripts/check_committee_correspondence.py +333 -0
- package/vendor/ars/scripts/check_compliance_report.py +108 -0
- package/vendor/ars/scripts/check_content_coverage_advisory_integration.py +796 -0
- package/vendor/ars/scripts/check_control_availability.py +172 -0
- package/vendor/ars/scripts/check_corpus_consumer_protocol.py +404 -0
- package/vendor/ars/scripts/check_cross_document_consistency_advisory_integration.py +1191 -0
- package/vendor/ars/scripts/check_cross_model_handoff_contract.py +234 -0
- package/vendor/ars/scripts/check_cross_model_verification_sync.py +261 -0
- package/vendor/ars/scripts/check_data_access_level.py +131 -0
- package/vendor/ars/scripts/check_data_flows.py +252 -0
- package/vendor/ars/scripts/check_decision_contract.py +464 -0
- package/vendor/ars/scripts/check_degradation_registry.py +326 -0
- package/vendor/ars/scripts/check_distribution_surface_claims.py +226 -0
- package/vendor/ars/scripts/check_domain_evidence_profile.py +538 -0
- package/vendor/ars/scripts/check_e4_promotion.py +195 -0
- package/vendor/ars/scripts/check_evals_gold_set.py +279 -0
- package/vendor/ars/scripts/check_evidence_row_integration.py +396 -0
- package/vendor/ars/scripts/check_experiment_provenance.py +117 -0
- package/vendor/ars/scripts/check_field_norm_severity.py +144 -0
- package/vendor/ars/scripts/check_firm_rules_sync.py +375 -0
- package/vendor/ars/scripts/check_heldout_measurement_report.py +1179 -0
- package/vendor/ars/scripts/check_human_subjects_output_contract.py +139 -0
- package/vendor/ars/scripts/check_human_subjects_reference_migration.py +844 -0
- package/vendor/ars/scripts/check_indirect_prompt_injection_no_call.py +328 -0
- package/vendor/ars/scripts/check_instruction_data_boundary.py +236 -0
- package/vendor/ars/scripts/check_judge_prompt_version.py +125 -0
- package/vendor/ars/scripts/check_literature_corpus_schema.py +402 -0
- package/vendor/ars/scripts/check_model_tiering.py +223 -0
- package/vendor/ars/scripts/check_panel_synthesis.py +1331 -0
- package/vendor/ars/scripts/check_passport_reset_contract.py +214 -0
- package/vendor/ars/scripts/check_pattern_eval_manifest.py +422 -0
- package/vendor/ars/scripts/check_persuasion_invariance_fixtures.py +637 -0
- package/vendor/ars/scripts/check_phase_conformance.py +2180 -0
- package/vendor/ars/scripts/check_pipeline_boundary_semantics.py +600 -0
- package/vendor/ars/scripts/check_pipeline_integrity.py +340 -0
- package/vendor/ars/scripts/check_policy_anchor_protocol.py +159 -0
- package/vendor/ars/scripts/check_policy_anchor_table.py +286 -0
- package/vendor/ars/scripts/check_preprint_venues_consistency.py +123 -0
- package/vendor/ars/scripts/check_prisma_trAIce_freshness.py +84 -0
- package/vendor/ars/scripts/check_promotion_bakeoff_preregistration.py +1303 -0
- package/vendor/ars/scripts/check_ranking_lift.py +323 -0
- package/vendor/ars/scripts/check_re_review_synthesis.py +2719 -0
- package/vendor/ars/scripts/check_receipt_enum_sync.py +203 -0
- package/vendor/ars/scripts/check_repro_lock.py +85 -0
- package/vendor/ars/scripts/check_review_pathway_output.py +276 -0
- package/vendor/ars/scripts/check_reviewer_data_fences.py +224 -0
- package/vendor/ars/scripts/check_reviewer_finding_contract.py +783 -0
- package/vendor/ars/scripts/check_reviewer_role_label.py +447 -0
- package/vendor/ars/scripts/check_reviewer_scoring_honesty.py +292 -0
- package/vendor/ars/scripts/check_reviewer_sprint_prompt_sync.py +409 -0
- package/vendor/ars/scripts/check_revision_claim_drift_suite_v2.py +1622 -0
- package/vendor/ars/scripts/check_revision_token_conservation.py +263 -0
- package/vendor/ars/scripts/check_risk_register.py +280 -0
- package/vendor/ars/scripts/check_role_scoped_contract.py +702 -0
- package/vendor/ars/scripts/check_rq_framing_patterns.py +184 -0
- package/vendor/ars/scripts/check_rubric_weight_consistency.py +32 -0
- package/vendor/ars/scripts/check_seeded_defect_fixtures.py +425 -0
- package/vendor/ars/scripts/check_setup_cross_model_parity.py +139 -0
- package/vendor/ars/scripts/check_spec_consistency.py +1249 -0
- package/vendor/ars/scripts/check_sprint_contract.py +371 -0
- package/vendor/ars/scripts/check_stage_capability_matrix.py +784 -0
- package/vendor/ars/scripts/check_submission_packet_manifest_integration.py +358 -0
- package/vendor/ars/scripts/check_surface_form_parity.py +445 -0
- package/vendor/ars/scripts/check_task_type.py +22 -0
- package/vendor/ars/scripts/check_tools_allowlist.py +538 -0
- package/vendor/ars/scripts/check_tortured_phrase_screening_integration.py +1974 -0
- package/vendor/ars/scripts/check_v3_10_134_write_scope.py +286 -0
- package/vendor/ars/scripts/check_v3_10_policy.py +656 -0
- package/vendor/ars/scripts/check_v3_6_6_ab_manifest.py +364 -0
- package/vendor/ars/scripts/check_v3_6_7_pattern_protection.py +1366 -0
- package/vendor/ars/scripts/check_v3_6_8_audit_scope_block.py +464 -0
- package/vendor/ars/scripts/check_v3_6_8_cite_provenance_pipeline.py +231 -0
- package/vendor/ars/scripts/check_v3_6_8_frontmatter_trust_schema.py +248 -0
- package/vendor/ars/scripts/check_v3_6_8_mark_read_commands.py +79 -0
- package/vendor/ars/scripts/check_v3_6_8_pattern_protection.py +941 -0
- package/vendor/ars/scripts/check_v3_7_3_three_layer_citation.py +318 -0
- package/vendor/ars/scripts/check_v3_8_annotation_literal_sync.py +228 -0
- package/vendor/ars/scripts/check_v3_9_0_triangulation.py +366 -0
- package/vendor/ars/scripts/check_v3_9_2_phase_boundary.py +270 -0
- package/vendor/ars/scripts/check_v3_9_4_temporal_verification.py +139 -0
- package/vendor/ars/scripts/check_venue_disclosure_policies.py +63 -0
- package/vendor/ars/scripts/check_version_consistency.py +826 -0
- package/vendor/ars/scripts/check_workflow_classification.py +223 -0
- package/vendor/ars/scripts/chinese_literature_client.py +1938 -0
- package/vendor/ars/scripts/citation_verification_summary.py +85 -0
- package/vendor/ars/scripts/claim_audit_calibration.py +517 -0
- package/vendor/ars/scripts/claim_audit_finalizer.py +456 -0
- package/vendor/ars/scripts/claim_audit_pipeline.py +1594 -0
- package/vendor/ars/scripts/claim_registry_coverage.py +493 -0
- package/vendor/ars/scripts/claim_standing_discovery.py +784 -0
- package/vendor/ars/scripts/claim_standing_stance_runner.py +758 -0
- package/vendor/ars/scripts/claim_standing_stance_scorer.py +239 -0
- package/vendor/ars/scripts/claim_strength_drift_disposition.py +666 -0
- package/vendor/ars/scripts/contamination_signals.py +689 -0
- package/vendor/ars/scripts/corpus_consumer_manifest.json +19 -0
- package/vendor/ars/scripts/cross_model_codex_transport.py +1374 -0
- package/vendor/ars/scripts/cross_model_codex_verify.sh +6 -0
- package/vendor/ars/scripts/cross_model_handoff.py +359 -0
- package/vendor/ars/scripts/cross_model_smoke_test.sh +183 -0
- package/vendor/ars/scripts/cross_model_smoke_test_codex.sh +35 -0
- package/vendor/ars/scripts/cross_model_verification/gemini_is_grounded.jq +45 -0
- package/vendor/ars/scripts/cross_model_verification/gemini_sources.jq +45 -0
- package/vendor/ars/scripts/cross_model_verification/normalize_compat_verdict.py +57 -0
- package/vendor/ars/scripts/cross_model_verification/openai_has_completed_web_search.jq +15 -0
- package/vendor/ars/scripts/cross_model_verification/openai_sources.jq +17 -0
- package/vendor/ars/scripts/cross_model_verification/openai_text.jq +11 -0
- package/vendor/ars/scripts/crossref_client.py +225 -0
- package/vendor/ars/scripts/dispatch_e4_panel.py +2731 -0
- package/vendor/ars/scripts/evidence_rows.py +2043 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/author_stage3.json +32 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/author_stage3_input.json +27 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/author_stage3_prime.json +32 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/author_stage3_prime_input.json +27 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/compliance_override.json +50 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/compliance_override_action.json +14 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/compliance_pass.json +44 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/explicit_user_request_log.json +26 -0
- package/vendor/ars/scripts/fixtures/adjudication_activity/mandatory_checkpoint_log.json +116 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/README.md +56 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/negative/a1_pass_with_p1/2026-04-30T15-22-04Z-d8f3.audit_artifact_entry.json +24 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/negative/a1_pass_with_p1/2026-04-30T15-22-04Z-d8f3.jsonl +4 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/negative/a1_pass_with_p1/2026-04-30T15-22-04Z-d8f3.meta.json +43 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/negative/a1_pass_with_p1/2026-04-30T15-22-04Z-d8f3.verdict.yaml +19 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/negative/a7_orphan_completion/2026-04-30T15-22-04Z-d8f3.jsonl +3 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/positive/persisted_minor/2026-04-30T15-22-04Z-d8f3.audit_artifact_entry.json +26 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/positive/persisted_minor/2026-04-30T15-22-04Z-d8f3.jsonl +4 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/positive/persisted_minor/2026-04-30T15-22-04Z-d8f3.meta.json +43 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/positive/persisted_minor/2026-04-30T15-22-04Z-d8f3.verdict.yaml +19 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/positive/proposal_pass/2026-04-30T15-22-04Z-d8f3.audit_artifact_entry.json +24 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/positive/proposal_pass/2026-04-30T15-22-04Z-d8f3.jsonl +4 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/positive/proposal_pass/2026-04-30T15-22-04Z-d8f3.meta.json +43 -0
- package/vendor/ars/scripts/fixtures/audit_artifact_consistency/positive/proposal_pass/2026-04-30T15-22-04Z-d8f3.verdict.yaml +12 -0
- package/vendor/ars/scripts/fixtures/bibliographic_integrity_signals/retraction.json +46 -0
- package/vendor/ars/scripts/fixtures/bibliographic_integrity_signals/retraction_check_attestation.json +44 -0
- package/vendor/ars/scripts/fixtures/bibliographic_integrity_signals/tortured_phrase.json +44 -0
- package/vendor/ars/scripts/fixtures/bibliographic_integrity_signals/tortured_phrase_v1_2_abstract_missing.json +107 -0
- package/vendor/ars/scripts/fixtures/bibliographic_integrity_signals/tortured_phrase_v1_2_detected.json +124 -0
- package/vendor/ars/scripts/fixtures/check_evals_gold_set/clean/expected_outcomes.json +77 -0
- package/vendor/ars/scripts/fixtures/check_evals_gold_set/clean/manifest.yaml +37 -0
- package/vendor/ars/scripts/fixtures/check_evals_gold_set/clean/tuples/001-valid-doi-test.json +20 -0
- package/vendor/ars/scripts/fixtures/check_evals_gold_set/clean/tuples/002-valid-arxiv-test.json +19 -0
- package/vendor/ars/scripts/fixtures/check_evals_gold_set/clean/tuples/003-fabricated-test.json +20 -0
- package/vendor/ars/scripts/fixtures/claim_audit_calibration/gold_set.json +344 -0
- package/vendor/ars/scripts/fixtures/claim_standing_candidate_ledger/query_plan.json +108 -0
- package/vendor/ars/scripts/fixtures/claim_standing_candidate_ledger/retrieval_input.json +179 -0
- package/vendor/ars/scripts/fixtures/committee_correspondence/16fd83f6aec7/concern_tracker.json +129 -0
- package/vendor/ars/scripts/fixtures/committee_correspondence/16fd83f6aec7/response_skeleton.md +19 -0
- package/vendor/ars/scripts/fixtures/committee_correspondence/16fd83f6aec7/source_letter.txt +9 -0
- package/vendor/ars/scripts/fixtures/content_coverage_advisory/base_draft.json +48 -0
- package/vendor/ars/scripts/fixtures/content_coverage_advisory/base_inventory.json +38 -0
- package/vendor/ars/scripts/fixtures/content_coverage_advisory/packet/consent.txt +1 -0
- package/vendor/ars/scripts/fixtures/content_coverage_advisory/session_sources.json +3 -0
- package/vendor/ars/scripts/fixtures/cross_document_consistency/README.md +6 -0
- package/vendor/ars/scripts/fixtures/cross_document_consistency/accepted_draft.md +35 -0
- package/vendor/ars/scripts/fixtures/cross_document_consistency/cases.json +75 -0
- package/vendor/ars/scripts/fixtures/cross_document_consistency/preregistration.md +5 -0
- package/vendor/ars/scripts/fixtures/cross_model_codex_transport/forbidden_event.jsonl +4 -0
- package/vendor/ars/scripts/fixtures/cross_model_codex_transport/grounded_verified.jsonl +3 -0
- package/vendor/ars/scripts/fixtures/cross_model_codex_transport/malformed.jsonl +3 -0
- package/vendor/ars/scripts/fixtures/cross_model_codex_transport/missing_search.jsonl +2 -0
- package/vendor/ars/scripts/fixtures/cross_model_codex_transport/multiple_finals.jsonl +4 -0
- package/vendor/ars/scripts/fixtures/cross_model_codex_transport/not_found.jsonl +3 -0
- package/vendor/ars/scripts/fixtures/cross_model_codex_transport/unbound_source.jsonl +3 -0
- package/vendor/ars/scripts/fixtures/cross_model_codex_transport/wrong_search_shape.jsonl +3 -0
- package/vendor/ars/scripts/fixtures/evidence_rows/phase_e_inputs.json +114 -0
- package/vendor/ars/scripts/fixtures/evidence_rows/session_sources.json +5 -0
- package/vendor/ars/scripts/fixtures/human_subjects_authority/cross-border-us-tw-gdpr.json +71 -0
- package/vendor/ars/scripts/fixtures/human_subjects_authority/gdpr-member-state-unresolved.json +62 -0
- package/vendor/ars/scripts/fixtures/human_subjects_authority/missing-data-axis.json +45 -0
- package/vendor/ars/scripts/fixtures/human_subjects_authority/no-profile.json +33 -0
- package/vendor/ars/scripts/fixtures/human_subjects_authority/tw-gdpr-two-axis.json +74 -0
- package/vendor/ars/scripts/fixtures/human_subjects_authority/us-gdpr-two-axis.json +74 -0
- package/vendor/ars/scripts/fixtures/review_pathway_rule_trace/lint-near-misses.json +72 -0
- package/vendor/ars/scripts/fixtures/review_pathway_rule_trace/no-profile-request.json +18 -0
- package/vendor/ars/scripts/fixtures/review_pathway_rule_trace/tw-candidates-request.json +63 -0
- package/vendor/ars/scripts/fixtures/review_pathway_rule_trace/us-candidates-request.json +77 -0
- package/vendor/ars/scripts/fixtures/review_target_context/exact-declaration.json +24 -0
- package/vendor/ars/scripts/fixtures/review_target_context/field-general-declaration.json +24 -0
- package/vendor/ars/scripts/fixtures/review_target_context/msr-2027-technical-full-declaration.json +24 -0
- package/vendor/ars/scripts/fixtures/review_target_context/synthetic-registry.json +92 -0
- package/vendor/ars/scripts/fixtures/revision_claim_drift_v2/README.md +21 -0
- package/vendor/ars/scripts/fixtures/revision_claim_drift_v2/subject_context_attested_only.json +55 -0
- package/vendor/ars/scripts/fixtures/revision_claim_drift_v2/subject_context_machine_supported.json +49 -0
- package/vendor/ars/scripts/fixtures/revision_claim_drift_v2/subject_context_not_isolated.json +56 -0
- package/vendor/ars/scripts/fixtures/revision_claim_drift_v2/subject_context_unknown.json +49 -0
- package/vendor/ars/scripts/fixtures/submission_package/clean/paper.md +16 -0
- package/vendor/ars/scripts/fixtures/submission_package/clean/references.bib +13 -0
- package/vendor/ars/scripts/fixtures/submission_package/fallback_authoryear/paper.md +11 -0
- package/vendor/ars/scripts/fixtures/submission_package/fallback_authoryear/references.bib +13 -0
- package/vendor/ars/scripts/fixtures/submission_package/fallback_latex/paper.tex +9 -0
- package/vendor/ars/scripts/fixtures/submission_package/fallback_latex/references.bib +13 -0
- package/vendor/ars/scripts/fixtures/submission_package/marker_no_join/paper.md +7 -0
- package/vendor/ars/scripts/fixtures/submission_package/orphan_intext/paper.md +8 -0
- package/vendor/ars/scripts/fixtures/submission_package/orphan_intext/references.bib +6 -0
- package/vendor/ars/scripts/fixtures/submission_package/passports/corpus_only.yaml +9 -0
- package/vendor/ars/scripts/fixtures/submission_package/passports/summary_join.yaml +16 -0
- package/vendor/ars/scripts/fixtures/submission_package/profiles/full.yaml +15 -0
- package/vendor/ars/scripts/fixtures/submission_package/profiles/tight.yaml +15 -0
- package/vendor/ars/scripts/fixtures/submission_package/summary_join/paper.md +7 -0
- package/vendor/ars/scripts/fixtures/submission_package/uncited_reference/paper.md +9 -0
- package/vendor/ars/scripts/fixtures/submission_package/uncited_reference/references.bib +13 -0
- package/vendor/ars/scripts/fixtures/submission_package/venue_clean/paper.md +26 -0
- package/vendor/ars/scripts/fixtures/submission_package/venue_clean/references.bib +13 -0
- package/vendor/ars/scripts/fixtures/submission_package/venue_violations/paper.md +20 -0
- package/vendor/ars/scripts/fixtures/submission_package/venue_violations/references.bib +13 -0
- package/vendor/ars/scripts/fixtures/submission_packet_manifest/base_inventory.json +101 -0
- package/vendor/ars/scripts/fixtures/submission_packet_manifest/packet/consent-materials.txt +3 -0
- package/vendor/ars/scripts/fixtures/submission_packet_manifest/packet/training-certificate.txt +2 -0
- package/vendor/ars/scripts/fixtures/submission_packet_manifest/packet/tw-consent-materials.txt +3 -0
- package/vendor/ars/scripts/fixtures/tortured_phrase_screening/corpus_input.yaml +30 -0
- package/vendor/ars/scripts/fixtures/tortured_phrase_screening/own_draft.md +36 -0
- package/vendor/ars/scripts/fixtures/tortured_phrase_screening/own_draft.tex +21 -0
- package/vendor/ars/scripts/fixtures/tortured_phrase_screening/seed_expectations.json +218 -0
- package/vendor/ars/scripts/fixtures/tortured_phrase_screening/snapshot.json +164 -0
- package/vendor/ars/scripts/fixtures/tortured_phrase_screening/snapshot_manifest.json +29 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/README.md +55 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/arxiv/empty_feed.xml +10 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/arxiv/error_5xx.html +7 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/arxiv/id_hit.xml +26 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/README.md +69 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/cnki_landing_page.html +13 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/error_5xx.html +2 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esearch_coordinate_ambiguous.json +16 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esearch_coordinate_hit.json +16 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esearch_coordinate_zero.json +14 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esearch_coverage_hit.json +15 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esearch_coverage_zero.json +13 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esummary_hit.json +43 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esummary_issn_mismatch.json +31 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esummary_no_doi.json +31 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esummary_unknown_ra.json +34 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/esummary_year_mismatch.json +31 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/handle_absent.json +4 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/handle_exists.json +16 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/handle_internal_error.json +4 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/istic_csl_hit.json +25 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/istic_csl_other_title.json +18 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/ra_cnki.json +6 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/ra_crossref.json +6 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/ra_istic.json +6 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/chinese_literature/ra_unknown_prefix.json +6 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/crossref/doi_hit.json +24 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/crossref/error_5xx.html +7 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/crossref/title_search_miss.json +15 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/openalex/doi_hit.json +29 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/openalex/error_5xx.json +4 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/openalex/title_search_miss.json +11 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/semantic_scholar/doi_hit.json +14 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/semantic_scholar/error_5xx.json +3 -0
- package/vendor/ars/scripts/fixtures/transport_bodies/semantic_scholar/title_search_miss.json +5 -0
- package/vendor/ars/scripts/human_read_attestation_resolver.py +467 -0
- package/vendor/ars/scripts/ideation_diversity_assignment_gate.py +430 -0
- package/vendor/ars/scripts/inquiry_branch_ledger.py +2540 -0
- package/vendor/ars/scripts/legacy/ars_apply_revision_patch_v1_0.py +715 -0
- package/vendor/ars/scripts/legacy/check_re_review_synthesis_v1_0.py +2215 -0
- package/vendor/ars/scripts/migrate_literature_corpus_to_v3_10.py +223 -0
- package/vendor/ars/scripts/migrate_literature_corpus_to_v3_7_3.py +277 -0
- package/vendor/ars/scripts/migrate_literature_corpus_to_v3_9_0.py +304 -0
- package/vendor/ars/scripts/model_tiering_manifest.json +46 -0
- package/vendor/ars/scripts/openalex_client.py +232 -0
- package/vendor/ars/scripts/parse_audit_verdict.py +802 -0
- package/vendor/ars/scripts/pdf_content_classifier_worker.py +176 -0
- package/vendor/ars/scripts/pdf_read_preflight.py +1455 -0
- package/vendor/ars/scripts/policy_anchor_disclosure_referee.py +354 -0
- package/vendor/ars/scripts/recompute_receipts.py +1414 -0
- package/vendor/ars/scripts/render_claim_standing_view.py +374 -0
- package/vendor/ars/scripts/render_eval_comment.py +130 -0
- package/vendor/ars/scripts/render_harness_retirement_issue.py +167 -0
- package/vendor/ars/scripts/repro_lock_validation.py +90 -0
- package/vendor/ars/scripts/research_workflow_profile.py +1079 -0
- package/vendor/ars/scripts/resolve_human_subjects_authority.py +1158 -0
- package/vendor/ars/scripts/resolve_review_target_context.py +683 -0
- package/vendor/ars/scripts/resume_e4_record.py +509 -0
- package/vendor/ars/scripts/retraction_status.py +484 -0
- package/vendor/ars/scripts/review_criteria_binding.py +889 -0
- package/vendor/ars/scripts/review_panel_provenance.py +744 -0
- package/vendor/ars/scripts/revision_roadmap.py +1967 -0
- package/vendor/ars/scripts/run_ci_pytest_manifest.py +116 -0
- package/vendor/ars/scripts/run_codex_audit.sh +1191 -0
- package/vendor/ars/scripts/run_evals.py +513 -0
- package/vendor/ars/scripts/run_ideation_diversity_no_call.py +3505 -0
- package/vendor/ars/scripts/run_indirect_prompt_injection_no_call.py +3330 -0
- package/vendor/ars/scripts/run_indirect_prompt_injection_probe.py +399 -0
- package/vendor/ars/scripts/run_review_criteria_constructive_value.py +1895 -0
- package/vendor/ars/scripts/run_role_topology_utility_dry_run.py +606 -0
- package/vendor/ars/scripts/score_review_criteria_constructive_value.py +617 -0
- package/vendor/ars/scripts/semantic_scholar_client.py +291 -0
- package/vendor/ars/scripts/slr_lineage.py +59 -0
- package/vendor/ars/scripts/sync_adapter_docs.py +118 -0
- package/vendor/ars/scripts/temporal_integrity_audit.py +840 -0
- package/vendor/ars/scripts/test_431_exact_or_bust.py +253 -0
- package/vendor/ars/scripts/test__eval_threshold_gate.py +125 -0
- package/vendor/ars/scripts/test__markdown_lint_util.py +129 -0
- package/vendor/ars/scripts/test__next_verified_at_ms.py +256 -0
- package/vendor/ars/scripts/test_adjacent_framing_probe_lint.py +171 -0
- package/vendor/ars/scripts/test_adjudication_activity.py +1515 -0
- package/vendor/ars/scripts/test_ars_anchorize_draft.py +178 -0
- package/vendor/ars/scripts/test_ars_apply_revision_patch.py +1335 -0
- package/vendor/ars/scripts/test_ars_cache_invalidate.py +51 -0
- package/vendor/ars/scripts/test_ars_mark_read.py +910 -0
- package/vendor/ars/scripts/test_ars_update_check.py +816 -0
- package/vendor/ars/scripts/test_ars_write_scope_guard.py +790 -0
- package/vendor/ars/scripts/test_arxiv_client.py +374 -0
- package/vendor/ars/scripts/test_audit_schemas.py +560 -0
- package/vendor/ars/scripts/test_audit_snapshot_render_section_0.py +105 -0
- package/vendor/ars/scripts/test_block_parser.py +259 -0
- package/vendor/ars/scripts/test_bootstrap_timeline_yaml.py +148 -0
- package/vendor/ars/scripts/test_build_claim_standing_candidate_ledger.py +1203 -0
- package/vendor/ars/scripts/test_build_claim_standing_query_plan.py +791 -0
- package/vendor/ars/scripts/test_build_submission_packet_manifest.py +2644 -0
- package/vendor/ars/scripts/test_check_215_field_norm.py +238 -0
- package/vendor/ars/scripts/test_check_216_surface_form.py +341 -0
- package/vendor/ars/scripts/test_check_268_nested_commitment_ledger.py +194 -0
- package/vendor/ars/scripts/test_check_390_revision_patch_discipline.py +279 -0
- package/vendor/ars/scripts/test_check_392_citation_verification_intake.py +144 -0
- package/vendor/ars/scripts/test_check_394_submission_policy.py +200 -0
- package/vendor/ars/scripts/test_check_439_format_profile.py +252 -0
- package/vendor/ars/scripts/test_check_619_disclosure_closeout.py +158 -0
- package/vendor/ars/scripts/test_check_630_codex_subscription_transport.py +245 -0
- package/vendor/ars/scripts/test_check_669_review_pathway_rule_trace.py +304 -0
- package/vendor/ars/scripts/test_check_670_revision_roadmap_integration.py +260 -0
- package/vendor/ars/scripts/test_check_673_adjudication_activity.py +367 -0
- package/vendor/ars/scripts/test_check_684_review_criteria_binding.py +274 -0
- package/vendor/ars/scripts/test_check_agents_mirror_sync.py +137 -0
- package/vendor/ars/scripts/test_check_audit_artifact_consistency.py +2133 -0
- package/vendor/ars/scripts/test_check_benchmark_report.py +117 -0
- package/vendor/ars/scripts/test_check_bibliographic_integrity_signals.py +609 -0
- package/vendor/ars/scripts/test_check_calibration_tiers.py +376 -0
- package/vendor/ars/scripts/test_check_changelog_covers_merges.py +509 -0
- package/vendor/ars/scripts/test_check_ci_pytest_manifest.py +425 -0
- package/vendor/ars/scripts/test_check_claim_standing_candidate_ledger_integration.py +256 -0
- package/vendor/ars/scripts/test_check_claim_standing_freshness.py +277 -0
- package/vendor/ars/scripts/test_check_collaboration_depth_rubric.py +239 -0
- package/vendor/ars/scripts/test_check_command_frontmatter_name.py +178 -0
- package/vendor/ars/scripts/test_check_committee_correspondence.py +298 -0
- package/vendor/ars/scripts/test_check_compliance_report.py +381 -0
- package/vendor/ars/scripts/test_check_content_coverage_advisory_integration.py +308 -0
- package/vendor/ars/scripts/test_check_control_availability.py +361 -0
- package/vendor/ars/scripts/test_check_cross_document_consistency_advisory_integration.py +698 -0
- package/vendor/ars/scripts/test_check_cross_model_handoff_contract.py +301 -0
- package/vendor/ars/scripts/test_check_cross_model_verification_sync.py +203 -0
- package/vendor/ars/scripts/test_check_data_access_level.py +227 -0
- package/vendor/ars/scripts/test_check_data_flows.py +382 -0
- package/vendor/ars/scripts/test_check_decision_contract.py +387 -0
- package/vendor/ars/scripts/test_check_degradation_registry.py +270 -0
- package/vendor/ars/scripts/test_check_distribution_surface_claims.py +225 -0
- package/vendor/ars/scripts/test_check_domain_evidence_profile.py +439 -0
- package/vendor/ars/scripts/test_check_e4_promotion.py +163 -0
- package/vendor/ars/scripts/test_check_evals_gold_set.py +312 -0
- package/vendor/ars/scripts/test_check_evidence_row_integration.py +187 -0
- package/vendor/ars/scripts/test_check_field_norm_severity.py +173 -0
- package/vendor/ars/scripts/test_check_firm_rules_sync.py +342 -0
- package/vendor/ars/scripts/test_check_heldout_measurement_report.py +1508 -0
- package/vendor/ars/scripts/test_check_human_subjects_output_contract.py +129 -0
- package/vendor/ars/scripts/test_check_human_subjects_reference_migration.py +756 -0
- package/vendor/ars/scripts/test_check_instruction_data_boundary.py +204 -0
- package/vendor/ars/scripts/test_check_judge_prompt_version.py +90 -0
- package/vendor/ars/scripts/test_check_model_tiering.py +236 -0
- package/vendor/ars/scripts/test_check_panel_synthesis.py +1658 -0
- package/vendor/ars/scripts/test_check_passport_reset_contract.py +249 -0
- package/vendor/ars/scripts/test_check_pattern_eval_manifest.py +381 -0
- package/vendor/ars/scripts/test_check_persuasion_invariance_fixtures.py +591 -0
- package/vendor/ars/scripts/test_check_phase_conformance.py +4366 -0
- package/vendor/ars/scripts/test_check_pipeline_boundary_semantics.py +931 -0
- package/vendor/ars/scripts/test_check_pipeline_integrity.py +243 -0
- package/vendor/ars/scripts/test_check_policy_anchor_protocol.py +236 -0
- package/vendor/ars/scripts/test_check_policy_anchor_table.py +295 -0
- package/vendor/ars/scripts/test_check_prisma_trAIce_freshness.py +68 -0
- package/vendor/ars/scripts/test_check_promotion_bakeoff_preregistration.py +799 -0
- package/vendor/ars/scripts/test_check_ranking_lift.py +377 -0
- package/vendor/ars/scripts/test_check_re_review_synthesis.py +3398 -0
- package/vendor/ars/scripts/test_check_receipt_enum_sync.py +176 -0
- package/vendor/ars/scripts/test_check_repro_lock.py +107 -0
- package/vendor/ars/scripts/test_check_reviewer_data_fences.py +334 -0
- package/vendor/ars/scripts/test_check_reviewer_finding_contract.py +1107 -0
- package/vendor/ars/scripts/test_check_reviewer_role_label.py +491 -0
- package/vendor/ars/scripts/test_check_reviewer_scoring_honesty.py +222 -0
- package/vendor/ars/scripts/test_check_reviewer_sprint_prompt_sync.py +373 -0
- package/vendor/ars/scripts/test_check_revision_claim_drift_suite_v2.py +1925 -0
- package/vendor/ars/scripts/test_check_revision_token_conservation.py +398 -0
- package/vendor/ars/scripts/test_check_risk_register.py +336 -0
- package/vendor/ars/scripts/test_check_role_scoped_contract.py +1104 -0
- package/vendor/ars/scripts/test_check_rq_framing_patterns.py +110 -0
- package/vendor/ars/scripts/test_check_rubric_weight_consistency.py +32 -0
- package/vendor/ars/scripts/test_check_seeded_defect_fixtures.py +392 -0
- package/vendor/ars/scripts/test_check_setup_cross_model_parity.py +121 -0
- package/vendor/ars/scripts/test_check_spec_consistency.py +1081 -0
- package/vendor/ars/scripts/test_check_sprint_contract.py +458 -0
- package/vendor/ars/scripts/test_check_stage_capability_matrix.py +698 -0
- package/vendor/ars/scripts/test_check_submission_packet_manifest_integration.py +177 -0
- package/vendor/ars/scripts/test_check_surface_form_parity.py +417 -0
- package/vendor/ars/scripts/test_check_task_type.py +116 -0
- package/vendor/ars/scripts/test_check_tools_allowlist.py +835 -0
- package/vendor/ars/scripts/test_check_tortured_phrase_screening_integration.py +1306 -0
- package/vendor/ars/scripts/test_check_v3_10_134_write_scope.py +251 -0
- package/vendor/ars/scripts/test_check_v3_10_policy.py +547 -0
- package/vendor/ars/scripts/test_check_v3_6_7_pattern_protection.py +960 -0
- package/vendor/ars/scripts/test_check_v3_6_8_audit_scope_block.py +1000 -0
- package/vendor/ars/scripts/test_check_v3_6_8_cite_provenance_pipeline.py +454 -0
- package/vendor/ars/scripts/test_check_v3_6_8_frontmatter_trust_schema.py +581 -0
- package/vendor/ars/scripts/test_check_v3_6_8_mark_read_commands.py +120 -0
- package/vendor/ars/scripts/test_check_v3_6_8_pattern_protection.py +1138 -0
- package/vendor/ars/scripts/test_check_v3_7_3_three_layer_citation.py +566 -0
- package/vendor/ars/scripts/test_check_v3_8_annotation_literal_sync.py +262 -0
- package/vendor/ars/scripts/test_check_v3_9_0_triangulation.py +321 -0
- package/vendor/ars/scripts/test_check_v3_9_2_phase_boundary.py +190 -0
- package/vendor/ars/scripts/test_check_v3_9_4_temporal_verification.py +471 -0
- package/vendor/ars/scripts/test_check_version_consistency.py +1462 -0
- package/vendor/ars/scripts/test_check_workflow_classification.py +225 -0
- package/vendor/ars/scripts/test_chinese_literature_client.py +1889 -0
- package/vendor/ars/scripts/test_citation_existence_policy.py +480 -0
- package/vendor/ars/scripts/test_citation_verification_summary.py +342 -0
- package/vendor/ars/scripts/test_claim_audit_calibration.py +882 -0
- package/vendor/ars/scripts/test_claim_audit_finalizer.py +979 -0
- package/vendor/ars/scripts/test_claim_audit_pipeline.py +2398 -0
- package/vendor/ars/scripts/test_claim_audit_schema.py +1778 -0
- package/vendor/ars/scripts/test_claim_intent_manifest.py +666 -0
- package/vendor/ars/scripts/test_claim_registry_coverage.py +246 -0
- package/vendor/ars/scripts/test_claim_standing_discovery.py +579 -0
- package/vendor/ars/scripts/test_claim_standing_pipeline_wiring.py +290 -0
- package/vendor/ars/scripts/test_claim_standing_stance_assets.py +399 -0
- package/vendor/ars/scripts/test_claim_standing_stance_contracts.py +383 -0
- package/vendor/ars/scripts/test_claim_standing_stance_runner.py +349 -0
- package/vendor/ars/scripts/test_claim_standing_transmissions.py +605 -0
- package/vendor/ars/scripts/test_claim_strength_drift_disposition.py +517 -0
- package/vendor/ars/scripts/test_claim_verification_coverage_contract.py +104 -0
- package/vendor/ars/scripts/test_contamination_signals.py +1086 -0
- package/vendor/ars/scripts/test_content_coverage_advisory.py +1767 -0
- package/vendor/ars/scripts/test_cross_document_consistency_advisory.py +1270 -0
- package/vendor/ars/scripts/test_cross_model_codex_transport.py +1152 -0
- package/vendor/ars/scripts/test_cross_model_handoff.py +571 -0
- package/vendor/ars/scripts/test_cross_model_verification_guards.py +792 -0
- package/vendor/ars/scripts/test_crossref_client.py +393 -0
- package/vendor/ars/scripts/test_dispatch_e4_panel.py +4235 -0
- package/vendor/ars/scripts/test_e2e_claim_audit.py +540 -0
- package/vendor/ars/scripts/test_eval_harness_workflow.py +140 -0
- package/vendor/ars/scripts/test_evals_citation_extraction.py +150 -0
- package/vendor/ars/scripts/test_evals_lift_report_schema.py +108 -0
- package/vendor/ars/scripts/test_evidence_rows.py +2593 -0
- package/vendor/ars/scripts/test_experiment_provenance.py +915 -0
- package/vendor/ars/scripts/test_human_read_attestation_resolver.py +477 -0
- package/vendor/ars/scripts/test_ideation_diversity_assignment_gate.py +615 -0
- package/vendor/ars/scripts/test_indirect_prompt_injection_behavior_probe.py +250 -0
- package/vendor/ars/scripts/test_inquiry_branch_ledger.py +2296 -0
- package/vendor/ars/scripts/test_migrate_literature_corpus_to_v3_10.py +248 -0
- package/vendor/ars/scripts/test_migrate_literature_corpus_to_v3_7_3.py +545 -0
- package/vendor/ars/scripts/test_migrate_literature_corpus_to_v3_9_0.py +497 -0
- package/vendor/ars/scripts/test_normalize_compat_verdict.py +149 -0
- package/vendor/ars/scripts/test_openalex_client.py +490 -0
- package/vendor/ars/scripts/test_passport_yaml.py +104 -0
- package/vendor/ars/scripts/test_pattern_eval_runtime.py +1295 -0
- package/vendor/ars/scripts/test_pdf_read_preflight.py +1943 -0
- package/vendor/ars/scripts/test_policy_anchor_disclosure.py +666 -0
- package/vendor/ars/scripts/test_reading_probe_lint.py +218 -0
- package/vendor/ars/scripts/test_recompute_receipts.py +778 -0
- package/vendor/ars/scripts/test_render_claim_standing_view.py +192 -0
- package/vendor/ars/scripts/test_render_eval_comment.py +162 -0
- package/vendor/ars/scripts/test_render_harness_retirement_issue.py +110 -0
- package/vendor/ars/scripts/test_repro_lock_validation_drift.py +100 -0
- package/vendor/ars/scripts/test_research_workflow_profile.py +734 -0
- package/vendor/ars/scripts/test_resolve_human_subjects_authority.py +1219 -0
- package/vendor/ars/scripts/test_resolve_review_target_context.py +703 -0
- package/vendor/ars/scripts/test_resume_e4_record.py +315 -0
- package/vendor/ars/scripts/test_retraction_status.py +456 -0
- package/vendor/ars/scripts/test_review_criteria_binding.py +629 -0
- package/vendor/ars/scripts/test_review_panel_provenance.py +565 -0
- package/vendor/ars/scripts/test_review_pathway_rule_trace.py +821 -0
- package/vendor/ars/scripts/test_revision_roadmap.py +1255 -0
- package/vendor/ars/scripts/test_run_ci_pytest_manifest.py +186 -0
- package/vendor/ars/scripts/test_run_codex_audit_e2e.py +369 -0
- package/vendor/ars/scripts/test_run_evals.py +430 -0
- package/vendor/ars/scripts/test_run_guard_launcher.py +500 -0
- package/vendor/ars/scripts/test_run_ideation_diversity_no_call.py +1833 -0
- package/vendor/ars/scripts/test_run_indirect_prompt_injection_no_call.py +1889 -0
- package/vendor/ars/scripts/test_run_review_criteria_constructive_value.py +586 -0
- package/vendor/ars/scripts/test_run_role_topology_utility_dry_run.py +428 -0
- package/vendor/ars/scripts/test_score_review_criteria_constructive_value.py +340 -0
- package/vendor/ars/scripts/test_semantic_scholar_client.py +554 -0
- package/vendor/ars/scripts/test_slr_lineage_emission.py +230 -0
- package/vendor/ars/scripts/test_socratic_rq_non_generation_contract.py +173 -0
- package/vendor/ars/scripts/test_temporal_integrity_audit.py +438 -0
- package/vendor/ars/scripts/test_text_similarity.py +95 -0
- package/vendor/ars/scripts/test_title_fuzzy_false_positive.py +111 -0
- package/vendor/ars/scripts/test_tortured_phrase_screening.py +2959 -0
- package/vendor/ars/scripts/test_transport_fixture_citation_gate.py +338 -0
- package/vendor/ars/scripts/test_uncited_assertion.py +558 -0
- package/vendor/ars/scripts/test_v3_6_7_phase_6_6.py +1279 -0
- package/vendor/ars/scripts/test_validate_compliance_fixtures.py +36 -0
- package/vendor/ars/scripts/test_validate_ideation_diversity_assets.py +230 -0
- package/vendor/ars/scripts/test_venue_disclosure_contract.py +755 -0
- package/vendor/ars/scripts/test_verification_cache.py +280 -0
- package/vendor/ars/scripts/test_verification_gate.py +461 -0
- package/vendor/ars/scripts/test_verify_passport_cli.py +123 -0
- package/vendor/ars/scripts/test_verify_submission_package.py +1407 -0
- package/vendor/ars/scripts/test_version_records_schema.py +211 -0
- package/vendor/ars/scripts/tortured_phrase_screening.py +3502 -0
- package/vendor/ars/scripts/uncited_assertion_detector.py +254 -0
- package/vendor/ars/scripts/v3_6_7_inversion_manifest.json +9 -0
- package/vendor/ars/scripts/v3_6_8_inversion_manifest.json +10 -0
- package/vendor/ars/scripts/validate_claim_standing_stance_assets.py +249 -0
- package/vendor/ars/scripts/validate_compliance_fixtures.py +56 -0
- package/vendor/ars/scripts/validate_ideation_diversity_assets.py +303 -0
- package/vendor/ars/scripts/venue_disclosure_contract_harness.py +837 -0
- package/vendor/ars/scripts/verification_cache.py +276 -0
- package/vendor/ars/scripts/verification_gate/__init__.py +345 -0
- package/vendor/ars/scripts/verify_passport.py +133 -0
- package/vendor/ars/scripts/verify_submission_package.py +1657 -0
- package/vendor/ars/shared/agents/compliance_agent.md +136 -0
- package/vendor/ars/shared/artifact_reproducibility_pattern.md +173 -0
- package/vendor/ars/shared/benchmark_report.schema.json +81 -0
- package/vendor/ars/shared/benchmark_report_pattern.md +180 -0
- package/vendor/ars/shared/bibliographic_integrity_signals.md +142 -0
- package/vendor/ars/shared/collaboration_depth_rubric.md +154 -0
- package/vendor/ars/shared/compliance_checkpoint_protocol.md +162 -0
- package/vendor/ars/shared/compliance_report.schema.json +187 -0
- package/vendor/ars/shared/contracts/README.md +938 -0
- package/vendor/ars/shared/contracts/activity/adjudication_activity_input.schema.json +555 -0
- package/vendor/ars/shared/contracts/activity/adjudication_activity_store.schema.json +560 -0
- package/vendor/ars/shared/contracts/audit/audit_jsonl.schema.json +128 -0
- package/vendor/ars/shared/contracts/audit/audit_sidecar.schema.json +169 -0
- package/vendor/ars/shared/contracts/audit/audit_verdict.schema.json +133 -0
- package/vendor/ars/shared/contracts/audit/cross_document_consistency_advisory.schema.json +480 -0
- package/vendor/ars/shared/contracts/audit/cross_document_consistency_advisory_draft.schema.json +564 -0
- package/vendor/ars/shared/contracts/audit/cross_document_source_manifest.schema.json +202 -0
- package/vendor/ars/shared/contracts/audit/tortured_phrase_advisory.schema.json +1362 -0
- package/vendor/ars/shared/contracts/audit/tortured_phrase_snapshot.schema.json +208 -0
- package/vendor/ars/shared/contracts/audit/tortured_phrase_snapshot_manifest.schema.json +335 -0
- package/vendor/ars/shared/contracts/capability/stage_capability_matrix.json +434 -0
- package/vendor/ars/shared/contracts/claim_standing/candidate_ledger.schema.json +705 -0
- package/vendor/ars/shared/contracts/claim_standing/query_plan.schema.json +389 -0
- package/vendor/ars/shared/contracts/claim_standing/query_plan_v1_1.schema.json +782 -0
- package/vendor/ars/shared/contracts/claim_standing/retrieval_input.schema.json +440 -0
- package/vendor/ars/shared/contracts/claim_standing/stance_record.schema.json +460 -0
- package/vendor/ars/shared/contracts/claim_standing/transmission_ledger.schema.json +282 -0
- package/vendor/ars/shared/contracts/cross_model/codex_citation_receipt.schema.json +157 -0
- package/vendor/ars/shared/contracts/cross_model/codex_citation_request.schema.json +23 -0
- package/vendor/ars/shared/contracts/cross_model/promotion_bakeoff_sealed_commitment.schema.json +55 -0
- package/vendor/ars/shared/contracts/cross_model/promotion_bakeoff_sealed_reveal.schema.json +50 -0
- package/vendor/ars/shared/contracts/degradation_registry.json +428 -0
- package/vendor/ars/shared/contracts/evaluator/full.json +126 -0
- package/vendor/ars/shared/contracts/evidence/claim_registry.schema.json +50 -0
- package/vendor/ars/shared/contracts/evidence/claim_registry_coverage_report.schema.json +79 -0
- package/vendor/ars/shared/contracts/evidence/evidence_row.schema.json +504 -0
- package/vendor/ars/shared/contracts/evidence/evidence_row_v1_1.schema.json +364 -0
- package/vendor/ars/shared/contracts/evidence/evidence_row_v1_2.schema.json +714 -0
- package/vendor/ars/shared/contracts/evidence/evidence_row_v1_3.schema.json +524 -0
- package/vendor/ars/shared/contracts/human_subjects/authority_profile_registry.schema.json +497 -0
- package/vendor/ars/shared/contracts/human_subjects/committee_correspondence.schema.json +253 -0
- package/vendor/ars/shared/contracts/human_subjects/content_coverage_advisory.schema.json +620 -0
- package/vendor/ars/shared/contracts/human_subjects/irb_context_record.schema.json +329 -0
- package/vendor/ars/shared/contracts/human_subjects/resolved_authority_context.schema.json +347 -0
- package/vendor/ars/shared/contracts/human_subjects/review_pathway_rule_trace.schema.json +265 -0
- package/vendor/ars/shared/contracts/human_subjects/review_pathway_trace_request.schema.json +127 -0
- package/vendor/ars/shared/contracts/human_subjects/submission_packet_inventory.schema.json +240 -0
- package/vendor/ars/shared/contracts/human_subjects/submission_packet_manifest.schema.json +999 -0
- package/vendor/ars/shared/contracts/passport/audit_artifact_entry.schema.json +266 -0
- package/vendor/ars/shared/contracts/passport/bibliographic_integrity_signal.schema.json +1676 -0
- package/vendor/ars/shared/contracts/passport/citation_provenance.schema.json +107 -0
- package/vendor/ars/shared/contracts/passport/citation_verification_summary.schema.json +164 -0
- package/vendor/ars/shared/contracts/passport/claim_audit_result.schema.json +124 -0
- package/vendor/ars/shared/contracts/passport/claim_drift.schema.json +58 -0
- package/vendor/ars/shared/contracts/passport/claim_intent_manifest.schema.json +107 -0
- package/vendor/ars/shared/contracts/passport/constraint_violation.schema.json +65 -0
- package/vendor/ars/shared/contracts/passport/experiment_alignment_result.schema.json +69 -0
- package/vendor/ars/shared/contracts/passport/experiment_provenance_entry.schema.json +169 -0
- package/vendor/ars/shared/contracts/passport/human_read_log.schema.json +86 -0
- package/vendor/ars/shared/contracts/passport/inquiry_ledger_ref.schema.json +22 -0
- package/vendor/ars/shared/contracts/passport/literature_corpus_entry.schema.json +650 -0
- package/vendor/ars/shared/contracts/passport/preregistration_artifact.schema.json +132 -0
- package/vendor/ars/shared/contracts/passport/rejection_log.schema.json +89 -0
- package/vendor/ars/shared/contracts/passport/reset_ledger_entry.schema.json +158 -0
- package/vendor/ars/shared/contracts/passport/temporal_audit_results.schema.json +208 -0
- package/vendor/ars/shared/contracts/passport/terminal_policies.schema.json +50 -0
- package/vendor/ars/shared/contracts/passport/timeline.schema.json +102 -0
- package/vendor/ars/shared/contracts/passport/uncited_assertion.schema.json +56 -0
- package/vendor/ars/shared/contracts/passport/uncited_audit_failure.schema.json +72 -0
- package/vendor/ars/shared/contracts/passport/user_attested_read_resolution.schema.json +87 -0
- package/vendor/ars/shared/contracts/passport/version_records.schema.json +138 -0
- package/vendor/ars/shared/contracts/patch/block_manifest.schema.json +45 -0
- package/vendor/ars/shared/contracts/patch/legacy/v1_0/revision_patch.schema.json +110 -0
- package/vendor/ars/shared/contracts/patch/revision_patch.schema.json +250 -0
- package/vendor/ars/shared/contracts/pdf/pdf_content_classifier_diagnostic.schema.json +39 -0
- package/vendor/ars/shared/contracts/pdf/pdf_content_classifier_worker.schema.json +88 -0
- package/vendor/ars/shared/contracts/pdf/pdf_read_preflight.schema.json +227 -0
- package/vendor/ars/shared/contracts/re_review/input_manifest.schema.json +161 -0
- package/vendor/ars/shared/contracts/re_review/legacy/v1_0/input_manifest.schema.json +134 -0
- package/vendor/ars/shared/contracts/re_review/legacy/v1_0/precommitment.schema.json +193 -0
- package/vendor/ars/shared/contracts/re_review/legacy/v1_0/traceability.schema.json +841 -0
- package/vendor/ars/shared/contracts/re_review/legacy/v1_0/verdict_record.schema.json +244 -0
- package/vendor/ars/shared/contracts/re_review/precommitment.schema.json +193 -0
- package/vendor/ars/shared/contracts/re_review/traceability.schema.json +916 -0
- package/vendor/ars/shared/contracts/re_review/verdict_record.schema.json +245 -0
- package/vendor/ars/shared/contracts/research_workflow/inquiry_branch_ledger.schema.json +449 -0
- package/vendor/ars/shared/contracts/research_workflow/research_workflow_profile.schema.json +222 -0
- package/vendor/ars/shared/contracts/research_workflow/research_workflow_profile_selection_receipt.schema.json +111 -0
- package/vendor/ars/shared/contracts/review_target/constructive_review_findings.schema.json +172 -0
- package/vendor/ars/shared/contracts/review_target/criteria_registry.schema.json +97 -0
- package/vendor/ars/shared/contracts/review_target/review_criteria_binding_manifest.schema.json +235 -0
- package/vendor/ars/shared/contracts/review_target/review_criteria_source_receipt.schema.json +158 -0
- package/vendor/ars/shared/contracts/review_target/review_target_context.schema.json +106 -0
- package/vendor/ars/shared/contracts/review_target/review_target_declaration.schema.json +118 -0
- package/vendor/ars/shared/contracts/reviewer/full.json +114 -0
- package/vendor/ars/shared/contracts/reviewer/methodology_focus.json +75 -0
- package/vendor/ars/shared/contracts/reviewer/review_panel_provenance.schema.json +263 -0
- package/vendor/ars/shared/contracts/reviewer/review_panel_provenance_carrier.schema.json +122 -0
- package/vendor/ars/shared/contracts/reviewer/review_panel_provenance_input.schema.json +120 -0
- package/vendor/ars/shared/contracts/revision/author_adjudication.schema.json +251 -0
- package/vendor/ars/shared/contracts/revision/author_adjudication_input.schema.json +25 -0
- package/vendor/ars/shared/contracts/revision/claim_strength_drift_disposition.schema.json +97 -0
- package/vendor/ars/shared/contracts/revision/claim_strength_drift_disposition_input.schema.json +80 -0
- package/vendor/ars/shared/contracts/revision/claim_strength_drift_findings.schema.json +139 -0
- package/vendor/ars/shared/contracts/revision/claim_surface_manifest.schema.json +99 -0
- package/vendor/ars/shared/contracts/revision/integrity_correction_authorization.schema.json +140 -0
- package/vendor/ars/shared/contracts/revision/integrity_correction_authorization_input.schema.json +28 -0
- package/vendor/ars/shared/contracts/revision/integrity_correction_list.schema.json +48 -0
- package/vendor/ars/shared/contracts/revision/integrity_pass_receipt.schema.json +16 -0
- package/vendor/ars/shared/contracts/revision/revision_evidence_bundle.schema.json +134 -0
- package/vendor/ars/shared/contracts/revision/revision_roadmap.schema.json +334 -0
- package/vendor/ars/shared/contracts/submission/format_profile.example.yaml +33 -0
- package/vendor/ars/shared/contracts/submission/format_profile.schema.json +102 -0
- package/vendor/ars/shared/contracts/submission/submission_verification_report.schema.json +233 -0
- package/vendor/ars/shared/contracts/submission/venue_profile.schema.json +114 -0
- package/vendor/ars/shared/contracts/writer/full.json +87 -0
- package/vendor/ars/shared/cross_model_verification.md +714 -0
- package/vendor/ars/shared/evals_lift_report.schema.json +141 -0
- package/vendor/ars/shared/ground_truth_isolation_pattern.md +275 -0
- package/vendor/ars/shared/handoff_schemas.md +1209 -0
- package/vendor/ars/shared/human_subjects_authority_registry.json +1278 -0
- package/vendor/ars/shared/mode_spectrum.md +57 -0
- package/vendor/ars/shared/model_tiering.md +83 -0
- package/vendor/ars/shared/policy_data/nature_policy.md +56 -0
- package/vendor/ars/shared/prisma_trAIce_protocol.md +157 -0
- package/vendor/ars/shared/raise_framework.md +129 -0
- package/vendor/ars/shared/references/authority_content_coverage_advisory_protocol.md +275 -0
- package/vendor/ars/shared/references/claim_standing_candidate_ledger_protocol.md +66 -0
- package/vendor/ars/shared/references/claim_strength_ladder.md +93 -0
- package/vendor/ars/shared/references/cross_document_consistency_advisory_protocol.md +263 -0
- package/vendor/ars/shared/references/evidence_row_protocol.md +260 -0
- package/vendor/ars/shared/references/firm_rules.md +90 -0
- package/vendor/ars/shared/references/human_subjects_authority_protocol.md +274 -0
- package/vendor/ars/shared/references/intent_clarification_protocol.md +168 -0
- package/vendor/ars/shared/references/irb_terminology_glossary.md +229 -0
- package/vendor/ars/shared/references/protected_hedging_phrases.md +118 -0
- package/vendor/ars/shared/references/psychometric_terminology_glossary.md +109 -0
- package/vendor/ars/shared/references/review_criteria_consumer_protocol.md +238 -0
- package/vendor/ars/shared/references/review_pathway_rule_trace_protocol.md +166 -0
- package/vendor/ars/shared/references/submission_packet_manifest_protocol.md +292 -0
- package/vendor/ars/shared/references/word_count_conventions.md +124 -0
- package/vendor/ars/shared/research_workflow_profiles/field_general.json +1 -0
- package/vendor/ars/shared/review_criteria_registry.json +207 -0
- package/vendor/ars/shared/review_criteria_sources/msr-2027-technical-papers.2026-08-24.json +46 -0
- package/vendor/ars/shared/review_criteria_sources/sigsoft-empirical-standards.2026-08-24.json +31 -0
- package/vendor/ars/shared/sprint_contract.schema.json +482 -0
- package/vendor/ars/shared/style_calibration_protocol.md +151 -0
- package/vendor/ars/shared/templates/codex_audit_multifile_template.md +263 -0
- package/vendor/ars/tools/release-discipline/.toolkit-version +1 -0
- package/vendor/ars/tools/release-discipline/README.md +4 -0
- package/vendor/ars/tools/release-discipline/scripts/_release_doc_alignment_schema.py +1011 -0
- package/vendor/ars/tools/release-discipline/scripts/check_command_invariants.py +497 -0
- package/vendor/ars/tools/release-discipline/scripts/check_release_doc_alignment.py +263 -0
- package/vendor/ars/tools/release-discipline/scripts/sync-toolkit.sh +147 -0
- package/vendor/windows/NOTICE.md +12 -0
- package/vendor/windows/arm64/fd.exe +0 -0
- package/vendor/windows/arm64/licenses/fd/LICENSE-APACHE +201 -0
- package/vendor/windows/arm64/licenses/fd/LICENSE-MIT +21 -0
- package/vendor/windows/arm64/licenses/ripgrep/COPYING +3 -0
- package/vendor/windows/arm64/licenses/ripgrep/LICENSE-MIT +21 -0
- package/vendor/windows/arm64/licenses/ripgrep/UNLICENSE +24 -0
- package/vendor/windows/arm64/rg.exe +0 -0
- package/vendor/windows/x64/fd.exe +0 -0
- package/vendor/windows/x64/licenses/fd/LICENSE-APACHE +201 -0
- package/vendor/windows/x64/licenses/fd/LICENSE-MIT +21 -0
- package/vendor/windows/x64/licenses/ripgrep/COPYING +3 -0
- package/vendor/windows/x64/licenses/ripgrep/LICENSE-MIT +21 -0
- package/vendor/windows/x64/licenses/ripgrep/UNLICENSE +24 -0
- package/vendor/windows/x64/rg.exe +0 -0
|
@@ -0,0 +1,1515 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Hermetic black-box and library tests for #673 adjudication activity."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import copy
|
|
6
|
+
import fcntl
|
|
7
|
+
import hashlib
|
|
8
|
+
import json
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from collections.abc import Callable
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
import jsonschema
|
|
14
|
+
import pytest
|
|
15
|
+
|
|
16
|
+
from scripts import adjudication_activity as activity
|
|
17
|
+
from scripts import check_re_review_synthesis as re_review
|
|
18
|
+
from scripts.test_check_re_review_synthesis import emit, scenario_g2d
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
REPO = Path(__file__).resolve().parents[1]
|
|
22
|
+
FIXTURES = REPO / "scripts/fixtures/adjudication_activity"
|
|
23
|
+
INPUT_SCHEMA = REPO / "shared/contracts/activity/adjudication_activity_input.schema.json"
|
|
24
|
+
STORE_SCHEMA = REPO / "shared/contracts/activity/adjudication_activity_store.schema.json"
|
|
25
|
+
STORE_ID = "ADJ-ACTIVITY-STORE-focused-tests"
|
|
26
|
+
LIMITATION = (
|
|
27
|
+
"This records explicit adjudication activity only. It cannot determine correctness, "
|
|
28
|
+
"attentiveness, engagement, or whether human ownership is real; genuine agreement and "
|
|
29
|
+
"non-review can produce the same history."
|
|
30
|
+
)
|
|
31
|
+
ADVISORY = "This series is advisory only; it never gates, blocks, scores, or changes any verdict."
|
|
32
|
+
COVERAGE = (
|
|
33
|
+
"Coverage: only successfully retained records in this explicitly selected store are "
|
|
34
|
+
"shown; runs without this store selection or whose append failed are not represented."
|
|
35
|
+
)
|
|
36
|
+
STAGES = (
|
|
37
|
+
"pipeline_stage_1",
|
|
38
|
+
"pipeline_stage_2",
|
|
39
|
+
"pipeline_stage_2_5",
|
|
40
|
+
"pipeline_stage_3",
|
|
41
|
+
"pipeline_stage_3_prime",
|
|
42
|
+
"pipeline_stage_4",
|
|
43
|
+
"pipeline_stage_4_prime",
|
|
44
|
+
"pipeline_stage_4_5",
|
|
45
|
+
"pipeline_stage_5",
|
|
46
|
+
"pipeline_stage_6",
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _load(path: Path) -> dict[str, Any]:
|
|
51
|
+
return json.loads(path.read_text(encoding="utf-8"))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _write(path: Path, value: Any) -> None:
|
|
55
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
56
|
+
path.write_bytes(activity.canonical_bytes(value) + b"\n")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _independent_digest(domain: bytes, value: Any) -> str:
|
|
60
|
+
canonical = json.dumps(
|
|
61
|
+
value, sort_keys=True, separators=(",", ":"), ensure_ascii=False
|
|
62
|
+
).encode("utf-8")
|
|
63
|
+
return hashlib.sha256(domain + canonical).hexdigest()
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _independent_interaction(run_id: str, interaction_id: str) -> str:
|
|
67
|
+
return _independent_digest(
|
|
68
|
+
b"ars.adjudication-activity.interaction/1.0\0",
|
|
69
|
+
{"run_id": run_id, "interaction_id": interaction_id},
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _copy_fixture(root: Path, name: str) -> str:
|
|
74
|
+
destination = root / "sources" / name
|
|
75
|
+
destination.parent.mkdir(parents=True, exist_ok=True)
|
|
76
|
+
destination.write_bytes((FIXTURES / name).read_bytes())
|
|
77
|
+
return destination.relative_to(root).as_posix()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _artifact(
|
|
81
|
+
artifact_id: str,
|
|
82
|
+
role: str,
|
|
83
|
+
group_id: str,
|
|
84
|
+
relative_path: str,
|
|
85
|
+
stage: str | None = None,
|
|
86
|
+
) -> dict[str, Any]:
|
|
87
|
+
return {
|
|
88
|
+
"artifact_id": artifact_id,
|
|
89
|
+
"artifact_role": role,
|
|
90
|
+
"artifact_group_id": group_id,
|
|
91
|
+
"artifact_group_stage": stage,
|
|
92
|
+
"relative_path": relative_path,
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def _empty_rows(capture_state: str = "not_applicable") -> list[dict[str, Any]]:
|
|
97
|
+
reason = (
|
|
98
|
+
"not_applicable_for_run"
|
|
99
|
+
if capture_state == "not_applicable"
|
|
100
|
+
else "source_not_provided"
|
|
101
|
+
)
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
"source_family": family,
|
|
105
|
+
"capture_state": capture_state,
|
|
106
|
+
"reason_code": reason,
|
|
107
|
+
"artifacts": [],
|
|
108
|
+
}
|
|
109
|
+
for family in activity.SOURCE_FAMILIES
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _terminal_state(
|
|
114
|
+
root: Path,
|
|
115
|
+
run_id: str,
|
|
116
|
+
*,
|
|
117
|
+
pipeline_state: str = "completed",
|
|
118
|
+
current_stage: str = "6",
|
|
119
|
+
status: str = "completed",
|
|
120
|
+
extra_completed: tuple[str, ...] = (),
|
|
121
|
+
) -> Path:
|
|
122
|
+
stages = {current_stage: {"status": status}}
|
|
123
|
+
stages.update({stage: {"status": "completed"} for stage in extra_completed})
|
|
124
|
+
state = {
|
|
125
|
+
"run_id": run_id,
|
|
126
|
+
"pipeline_state": pipeline_state,
|
|
127
|
+
"current_stage": current_stage,
|
|
128
|
+
"stages": stages,
|
|
129
|
+
}
|
|
130
|
+
path = root / "state" / f"{run_id}.json"
|
|
131
|
+
_write(path, state)
|
|
132
|
+
return path
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _call(capsys: pytest.CaptureFixture[str], *argv: str) -> tuple[int, str, str]:
|
|
136
|
+
code = activity.main(list(argv))
|
|
137
|
+
captured = capsys.readouterr()
|
|
138
|
+
return code, captured.out, captured.err
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def _seal_and_build(
|
|
142
|
+
capsys: pytest.CaptureFixture[str],
|
|
143
|
+
root: Path,
|
|
144
|
+
state: Path,
|
|
145
|
+
rows: list[dict[str, Any]],
|
|
146
|
+
*,
|
|
147
|
+
output_name: str = "input.json",
|
|
148
|
+
) -> Path:
|
|
149
|
+
activity.seal_terminal_inventory(state, root, rows)
|
|
150
|
+
output = root / output_name
|
|
151
|
+
code, stdout, stderr = _call(
|
|
152
|
+
capsys,
|
|
153
|
+
"build-input",
|
|
154
|
+
"--state",
|
|
155
|
+
str(state),
|
|
156
|
+
"--artifact-root",
|
|
157
|
+
str(root),
|
|
158
|
+
"--store-id",
|
|
159
|
+
STORE_ID,
|
|
160
|
+
"--output",
|
|
161
|
+
str(output),
|
|
162
|
+
)
|
|
163
|
+
assert code == 0, stderr
|
|
164
|
+
assert stdout.startswith("[ARS-ADJUDICATION-ACTIVITY] built_input run_id=")
|
|
165
|
+
return output
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def _append(
|
|
169
|
+
capsys: pytest.CaptureFixture[str], root: Path, store: Path, manifest: Path
|
|
170
|
+
) -> tuple[int, str, str]:
|
|
171
|
+
return _call(
|
|
172
|
+
capsys,
|
|
173
|
+
"append-run",
|
|
174
|
+
"--store",
|
|
175
|
+
str(store),
|
|
176
|
+
"--artifact-root",
|
|
177
|
+
str(root),
|
|
178
|
+
"--input",
|
|
179
|
+
str(manifest),
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def _make_re_review_chain(root: Path) -> tuple[str, str, str, str]:
|
|
184
|
+
generated = root / "generated_re_review"
|
|
185
|
+
generated.mkdir()
|
|
186
|
+
emit(generated, scenario_g2d(False))
|
|
187
|
+
manifest = _load(generated / "manifest.json")
|
|
188
|
+
precommitment = _load(generated / "precommitment.json")
|
|
189
|
+
verdict = _load(generated / "verdict_record.json")
|
|
190
|
+
traceability = _load(generated / "traceability.json")
|
|
191
|
+
|
|
192
|
+
traceability["dissent_adjudications"][0]["adjudicator"] = "user"
|
|
193
|
+
reapplication = traceability["reapplications"][0]
|
|
194
|
+
reapplication["reapplied_verdict"] = "NOT_ADDRESSED"
|
|
195
|
+
reapplication.pop("cannot_verify_reason")
|
|
196
|
+
anchor = {
|
|
197
|
+
"anchor": 'text: §6 "procedure evidence"',
|
|
198
|
+
"anchor_artifact": "manuscript",
|
|
199
|
+
}
|
|
200
|
+
reapplication["evidence_anchor"] = [anchor]
|
|
201
|
+
traceability["adjustments"] = [
|
|
202
|
+
{
|
|
203
|
+
"adjustment_id": "ADJ-1",
|
|
204
|
+
"item_id": "REV-001",
|
|
205
|
+
"from_verdict": "FULLY_ADDRESSED",
|
|
206
|
+
"to_verdict": "NOT_ADDRESSED",
|
|
207
|
+
"basis": "cross_model_adjudication",
|
|
208
|
+
"evidence_anchor": [anchor],
|
|
209
|
+
"rationale": reapplication["rationale"],
|
|
210
|
+
"source_ref": "reapplication:RAP-1",
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
first_row = traceability["rows"][0]
|
|
214
|
+
first_row.update(
|
|
215
|
+
{
|
|
216
|
+
"verified": "NO",
|
|
217
|
+
"status": "NOT_ADDRESSED",
|
|
218
|
+
"final_verdict": "NOT_ADDRESSED",
|
|
219
|
+
"adjustment_id": "ADJ-1",
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
traceability["decision_inputs"]["per_item"][0]["final_verdict"] = "NOT_ADDRESSED"
|
|
223
|
+
|
|
224
|
+
precommitment["input_manifest_hash"] = re_review.canonical_hash(manifest)
|
|
225
|
+
verdict["precommitment_hash"] = re_review.canonical_hash(precommitment)
|
|
226
|
+
traceability["verdict_record_hash"] = re_review.canonical_hash(verdict)
|
|
227
|
+
_write(generated / "manifest.json", manifest)
|
|
228
|
+
_write(generated / "precommitment.json", precommitment)
|
|
229
|
+
_write(generated / "verdict_record.json", verdict)
|
|
230
|
+
_write(generated / "traceability.json", traceability)
|
|
231
|
+
|
|
232
|
+
for name in ("input_manifest", "precommitment", "verdict_record", "traceability"):
|
|
233
|
+
schema = REPO / "shared/contracts/re_review" / f"{name}.schema.json"
|
|
234
|
+
artifact_name = "manifest" if name == "input_manifest" else name
|
|
235
|
+
jsonschema.Draft202012Validator(_load(schema)).validate(
|
|
236
|
+
_load(generated / f"{artifact_name}.json")
|
|
237
|
+
)
|
|
238
|
+
return tuple(
|
|
239
|
+
(generated / name).relative_to(root).as_posix()
|
|
240
|
+
for name in (
|
|
241
|
+
"manifest.json",
|
|
242
|
+
"precommitment.json",
|
|
243
|
+
"verdict_record.json",
|
|
244
|
+
"traceability.json",
|
|
245
|
+
)
|
|
246
|
+
) # type: ignore[return-value]
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def _all_event_rows(root: Path) -> list[dict[str, Any]]:
|
|
250
|
+
author_paths = [
|
|
251
|
+
_copy_fixture(root, "author_stage3_input.json"),
|
|
252
|
+
_copy_fixture(root, "author_stage3.json"),
|
|
253
|
+
_copy_fixture(root, "author_stage3_prime_input.json"),
|
|
254
|
+
_copy_fixture(root, "author_stage3_prime.json"),
|
|
255
|
+
]
|
|
256
|
+
override_report = _copy_fixture(root, "compliance_override.json")
|
|
257
|
+
override_action = _copy_fixture(root, "compliance_override_action.json")
|
|
258
|
+
pass_report = _copy_fixture(root, "compliance_pass.json")
|
|
259
|
+
explicit_log = _copy_fixture(root, "explicit_user_request_log.json")
|
|
260
|
+
mandatory_log = _copy_fixture(root, "mandatory_checkpoint_log.json")
|
|
261
|
+
manifest, precommitment, verdict, traceability = _make_re_review_chain(root)
|
|
262
|
+
return [
|
|
263
|
+
{
|
|
264
|
+
"source_family": "revision_author_adjudication",
|
|
265
|
+
"capture_state": "captured",
|
|
266
|
+
"reason_code": None,
|
|
267
|
+
"artifacts": [
|
|
268
|
+
_artifact("author-input-3", "author_adjudication_input", "SOURCE-GROUP-author-3", author_paths[0], "pipeline_stage_3"),
|
|
269
|
+
_artifact("author-output-3", "author_adjudication", "SOURCE-GROUP-author-3", author_paths[1], "pipeline_stage_3"),
|
|
270
|
+
_artifact("author-input-3p", "author_adjudication_input", "SOURCE-GROUP-author-3p", author_paths[2], "pipeline_stage_3_prime"),
|
|
271
|
+
_artifact("author-output-3p", "author_adjudication", "SOURCE-GROUP-author-3p", author_paths[3], "pipeline_stage_3_prime"),
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"source_family": "compliance_report",
|
|
276
|
+
"capture_state": "captured",
|
|
277
|
+
"reason_code": None,
|
|
278
|
+
"artifacts": [
|
|
279
|
+
_artifact("compliance-override-report", "compliance_report", "SOURCE-GROUP-compliance-1", override_report),
|
|
280
|
+
_artifact("compliance-override-action", "compliance_override_action_receipt", "SOURCE-GROUP-compliance-1", override_action),
|
|
281
|
+
_artifact("compliance-pass-a", "compliance_report", "SOURCE-GROUP-compliance-2", pass_report),
|
|
282
|
+
_artifact("compliance-pass-b", "compliance_report", "SOURCE-GROUP-compliance-3", pass_report),
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"source_family": "re_review_traceability",
|
|
287
|
+
"capture_state": "captured",
|
|
288
|
+
"reason_code": None,
|
|
289
|
+
"artifacts": [
|
|
290
|
+
_artifact("rereview-manifest", "input_manifest", "SOURCE-GROUP-rereview", manifest),
|
|
291
|
+
_artifact("rereview-precommitment", "precommitment", "SOURCE-GROUP-rereview", precommitment),
|
|
292
|
+
_artifact("rereview-verdict", "verdict_record", "SOURCE-GROUP-rereview", verdict),
|
|
293
|
+
_artifact("rereview-traceability", "traceability", "SOURCE-GROUP-rereview", traceability),
|
|
294
|
+
],
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"source_family": "explicit_user_request",
|
|
298
|
+
"capture_state": "captured",
|
|
299
|
+
"reason_code": None,
|
|
300
|
+
"artifacts": [
|
|
301
|
+
_artifact("explicit-log", "explicit_user_request_log", "SOURCE-GROUP-explicit", explicit_log)
|
|
302
|
+
],
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"source_family": "mandatory_checkpoint_response",
|
|
306
|
+
"capture_state": "captured",
|
|
307
|
+
"reason_code": None,
|
|
308
|
+
"artifacts": [
|
|
309
|
+
_artifact("mandatory-log", "mandatory_checkpoint_response_log", "SOURCE-GROUP-mandatory", mandatory_log)
|
|
310
|
+
],
|
|
311
|
+
},
|
|
312
|
+
]
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
def _compliance_rows(
|
|
316
|
+
root: Path,
|
|
317
|
+
run_id: str,
|
|
318
|
+
mutate_action: Callable[[dict[str, Any]], None] | None = None,
|
|
319
|
+
) -> list[dict[str, Any]]:
|
|
320
|
+
report_path = _copy_fixture(root, "compliance_override.json")
|
|
321
|
+
action = _load(FIXTURES / "compliance_override_action.json")
|
|
322
|
+
action["run_id"] = run_id
|
|
323
|
+
action["interaction_sha256"] = _independent_interaction(
|
|
324
|
+
run_id, action["interaction_id"]
|
|
325
|
+
)
|
|
326
|
+
action["report_sha256"] = hashlib.sha256((root / report_path).read_bytes()).hexdigest()
|
|
327
|
+
if mutate_action is not None:
|
|
328
|
+
mutate_action(action)
|
|
329
|
+
action_path = root / "sources" / "compliance-action-dynamic.json"
|
|
330
|
+
_write(action_path, action)
|
|
331
|
+
rows = _empty_rows()
|
|
332
|
+
rows[1] = {
|
|
333
|
+
"source_family": "compliance_report",
|
|
334
|
+
"capture_state": "captured",
|
|
335
|
+
"reason_code": None,
|
|
336
|
+
"artifacts": [
|
|
337
|
+
_artifact(
|
|
338
|
+
"compliance-report",
|
|
339
|
+
"compliance_report",
|
|
340
|
+
"SOURCE-GROUP-compliance",
|
|
341
|
+
report_path,
|
|
342
|
+
),
|
|
343
|
+
_artifact(
|
|
344
|
+
"compliance-action",
|
|
345
|
+
"compliance_override_action_receipt",
|
|
346
|
+
"SOURCE-GROUP-compliance",
|
|
347
|
+
action_path.relative_to(root).as_posix(),
|
|
348
|
+
),
|
|
349
|
+
],
|
|
350
|
+
}
|
|
351
|
+
return rows
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def _single_log_rows(
|
|
355
|
+
root: Path,
|
|
356
|
+
run_id: str,
|
|
357
|
+
*,
|
|
358
|
+
mandatory: bool,
|
|
359
|
+
mutate_record: Callable[[dict[str, Any]], None] | None = None,
|
|
360
|
+
) -> list[dict[str, Any]]:
|
|
361
|
+
interaction_id = "USER-LOG-1"
|
|
362
|
+
common = {
|
|
363
|
+
"actor_role": "user",
|
|
364
|
+
"source": "explicit_session_user_action",
|
|
365
|
+
"stage": "pipeline_stage_3",
|
|
366
|
+
"interaction_id": interaction_id,
|
|
367
|
+
"interaction_sha256": _independent_interaction(run_id, interaction_id),
|
|
368
|
+
}
|
|
369
|
+
if mandatory:
|
|
370
|
+
record = {
|
|
371
|
+
**common,
|
|
372
|
+
"response_id": "RESPONSE-1",
|
|
373
|
+
"checkpoint_id": "checkpoint-1",
|
|
374
|
+
"checkpoint_type": "MANDATORY",
|
|
375
|
+
"disposition": "pause",
|
|
376
|
+
}
|
|
377
|
+
version = "adjudication-mandatory-checkpoint-log/1.0"
|
|
378
|
+
family_index = 4
|
|
379
|
+
family = "mandatory_checkpoint_response"
|
|
380
|
+
role = "mandatory_checkpoint_response_log"
|
|
381
|
+
else:
|
|
382
|
+
record = {
|
|
383
|
+
**common,
|
|
384
|
+
"request_id": "REQUEST-1",
|
|
385
|
+
"action": "justify_finding",
|
|
386
|
+
"finding_id": "REV-001",
|
|
387
|
+
}
|
|
388
|
+
version = "adjudication-explicit-user-request-log/1.0"
|
|
389
|
+
family_index = 3
|
|
390
|
+
family = "explicit_user_request"
|
|
391
|
+
role = "explicit_user_request_log"
|
|
392
|
+
if mutate_record is not None:
|
|
393
|
+
mutate_record(record)
|
|
394
|
+
log_path = root / "sources" / f"{family}-dynamic.json"
|
|
395
|
+
_write(
|
|
396
|
+
log_path,
|
|
397
|
+
{"schema_version": version, "run_id": run_id, "records": [record]},
|
|
398
|
+
)
|
|
399
|
+
rows = _empty_rows()
|
|
400
|
+
rows[family_index] = {
|
|
401
|
+
"source_family": family,
|
|
402
|
+
"capture_state": "captured",
|
|
403
|
+
"reason_code": None,
|
|
404
|
+
"artifacts": [
|
|
405
|
+
_artifact(
|
|
406
|
+
"action-log",
|
|
407
|
+
role,
|
|
408
|
+
f"SOURCE-GROUP-{'mandatory' if mandatory else 'explicit'}",
|
|
409
|
+
log_path.relative_to(root).as_posix(),
|
|
410
|
+
)
|
|
411
|
+
],
|
|
412
|
+
}
|
|
413
|
+
return rows
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
def _re_review_rows(
|
|
417
|
+
root: Path,
|
|
418
|
+
mutate: Callable[[dict[str, Any], dict[str, Any]], None],
|
|
419
|
+
) -> list[dict[str, Any]]:
|
|
420
|
+
paths = _make_re_review_chain(root)
|
|
421
|
+
verdict_path = root / paths[2]
|
|
422
|
+
trace_path = root / paths[3]
|
|
423
|
+
verdict = _load(verdict_path)
|
|
424
|
+
trace = _load(trace_path)
|
|
425
|
+
mutate(verdict, trace)
|
|
426
|
+
trace["verdict_record_hash"] = re_review.canonical_hash(verdict)
|
|
427
|
+
_write(verdict_path, verdict)
|
|
428
|
+
_write(trace_path, trace)
|
|
429
|
+
rows = _empty_rows()
|
|
430
|
+
rows[2] = {
|
|
431
|
+
"source_family": "re_review_traceability",
|
|
432
|
+
"capture_state": "captured",
|
|
433
|
+
"reason_code": None,
|
|
434
|
+
"artifacts": [
|
|
435
|
+
_artifact("rereview-manifest", "input_manifest", "SOURCE-GROUP-rereview", paths[0]),
|
|
436
|
+
_artifact("rereview-precommitment", "precommitment", "SOURCE-GROUP-rereview", paths[1]),
|
|
437
|
+
_artifact("rereview-verdict", "verdict_record", "SOURCE-GROUP-rereview", paths[2]),
|
|
438
|
+
_artifact("rereview-trace", "traceability", "SOURCE-GROUP-rereview", paths[3]),
|
|
439
|
+
],
|
|
440
|
+
}
|
|
441
|
+
return rows
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
def _recompute_record(run: dict[str, Any]) -> None:
|
|
445
|
+
preimage = {key: value for key, value in run.items() if key != "record_sha256"}
|
|
446
|
+
run["record_sha256"] = _independent_digest(
|
|
447
|
+
b"ars.adjudication-activity.run/1.0\0", preimage
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
def test_contract_schemas_and_closed_positive_negative_payloads() -> None:
|
|
452
|
+
input_schema = _load(INPUT_SCHEMA)
|
|
453
|
+
store_schema = _load(STORE_SCHEMA)
|
|
454
|
+
jsonschema.Draft202012Validator.check_schema(input_schema)
|
|
455
|
+
jsonschema.Draft202012Validator.check_schema(store_schema)
|
|
456
|
+
|
|
457
|
+
input_payload = {
|
|
458
|
+
"schema_version": "adjudication-activity-input/1.0",
|
|
459
|
+
"store_id": STORE_ID,
|
|
460
|
+
"run_id": "run-schema",
|
|
461
|
+
"terminal_state": "completed",
|
|
462
|
+
"terminal_stage": "pipeline_stage_6",
|
|
463
|
+
"terminal_receipt": {
|
|
464
|
+
"artifact_id": "pipeline-state-terminal-receipt",
|
|
465
|
+
"relative_path": "state/run-schema.json",
|
|
466
|
+
"sha256": "0" * 64,
|
|
467
|
+
"run_id": "run-schema",
|
|
468
|
+
"pipeline_state": "completed",
|
|
469
|
+
"current_stage": "pipeline_stage_6",
|
|
470
|
+
"current_stage_status": "completed",
|
|
471
|
+
},
|
|
472
|
+
"sources": _empty_rows(),
|
|
473
|
+
"data_minimization": copy.deepcopy(activity.DATA_MINIMIZATION),
|
|
474
|
+
}
|
|
475
|
+
jsonschema.Draft202012Validator(input_schema).validate(input_payload)
|
|
476
|
+
poisoned = copy.deepcopy(input_payload)
|
|
477
|
+
poisoned["events"] = []
|
|
478
|
+
assert list(jsonschema.Draft202012Validator(input_schema).iter_errors(poisoned))
|
|
479
|
+
|
|
480
|
+
empty_store = {
|
|
481
|
+
"schema_version": "adjudication-activity-store/1.0",
|
|
482
|
+
"store_id": STORE_ID,
|
|
483
|
+
"revision": 0,
|
|
484
|
+
"next_sequence": 1,
|
|
485
|
+
"runs": [],
|
|
486
|
+
"data_minimization": copy.deepcopy(activity.DATA_MINIMIZATION),
|
|
487
|
+
}
|
|
488
|
+
jsonschema.Draft202012Validator(store_schema).validate(empty_store)
|
|
489
|
+
poisoned_store = copy.deepcopy(empty_store)
|
|
490
|
+
poisoned_store["score"] = 100
|
|
491
|
+
assert list(jsonschema.Draft202012Validator(store_schema).iter_errors(poisoned_store))
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
def test_init_build_append_validate_render_and_exact_retry_no_write(
|
|
495
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
496
|
+
) -> None:
|
|
497
|
+
root = tmp_path / "artifacts"
|
|
498
|
+
state = _terminal_state(root, "run-zero")
|
|
499
|
+
manifest = _seal_and_build(capsys, root, state, _empty_rows("unavailable"))
|
|
500
|
+
store = tmp_path / "activity.json"
|
|
501
|
+
|
|
502
|
+
code, stdout, stderr = _call(capsys, "init-store", "--store", str(store), "--store-id", STORE_ID)
|
|
503
|
+
assert (code, stderr) == (0, "")
|
|
504
|
+
assert stdout == f'[ARS-ADJUDICATION-ACTIVITY] initialized store_id="{STORE_ID}"; revision=0; next_sequence=1\n'
|
|
505
|
+
code, stdout, stderr = _append(capsys, root, store, manifest)
|
|
506
|
+
assert (code, stderr) == (0, "")
|
|
507
|
+
assert "append_sequence=1; revision=1" in stdout
|
|
508
|
+
before = store.read_bytes()
|
|
509
|
+
code, stdout, stderr = _append(capsys, root, store, manifest)
|
|
510
|
+
assert (code, stderr) == (0, "")
|
|
511
|
+
assert "already_appended" in stdout
|
|
512
|
+
assert store.read_bytes() == before
|
|
513
|
+
|
|
514
|
+
code, stdout, stderr = _call(capsys, "validate", "--store", str(store))
|
|
515
|
+
assert (code, stderr) == (0, "")
|
|
516
|
+
assert "retained_runs=1; revision=1; next_sequence=2" in stdout
|
|
517
|
+
code, stdout, stderr = _call(capsys, "render", "--store", str(store))
|
|
518
|
+
assert (code, stderr) == (0, "")
|
|
519
|
+
lines = stdout.splitlines()
|
|
520
|
+
assert lines[0] == (
|
|
521
|
+
"[ARS-ADJUDICATION-ACTIVITY INSUFFICIENT_HISTORY] "
|
|
522
|
+
"selected_retained_eligible_run_count=1; minimum_required=2; requested_window=10."
|
|
523
|
+
)
|
|
524
|
+
assert lines[-3:] == [COVERAGE, LIMITATION, ADVISORY]
|
|
525
|
+
assert "unavailable_source_count=5 (denominator: 5 source families)" in stdout
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
def test_all_seven_event_types_occurrence_digest_dedup_and_repeated_hashes(
|
|
529
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
530
|
+
) -> None:
|
|
531
|
+
root = tmp_path / "artifacts"
|
|
532
|
+
state = _terminal_state(root, "run-all-events", extra_completed=("3", "3p"))
|
|
533
|
+
manifest = _seal_and_build(capsys, root, state, _all_event_rows(root))
|
|
534
|
+
store = tmp_path / "activity.json"
|
|
535
|
+
code, _stdout, stderr = _append(capsys, root, store, manifest)
|
|
536
|
+
assert code == 0, stderr
|
|
537
|
+
payload = _load(store)
|
|
538
|
+
run = payload["runs"][0]
|
|
539
|
+
events = [event for source in run["sources"] for event in source["events"]]
|
|
540
|
+
assert {event["event_type"] for event in events} == {
|
|
541
|
+
"author_triage_wont_address",
|
|
542
|
+
"author_triage_not_on_point",
|
|
543
|
+
"compliance_block_override",
|
|
544
|
+
"re_review_verdict_changed",
|
|
545
|
+
"finding_justification_requested",
|
|
546
|
+
"finding_redo_requested",
|
|
547
|
+
"mandatory_checkpoint_non_proceed",
|
|
548
|
+
}
|
|
549
|
+
author_events = run["sources"][0]["events"]
|
|
550
|
+
assert author_events[0]["interaction_sha256"] == _independent_interaction(
|
|
551
|
+
"run-all-events", "AUTHOR-EVENT-ONE"
|
|
552
|
+
)
|
|
553
|
+
assert author_events[1]["interaction_sha256"] == _independent_interaction(
|
|
554
|
+
"run-all-events", "AUTHOR-EVENT-TWO"
|
|
555
|
+
)
|
|
556
|
+
assert author_events[0]["interaction_sha256"] != author_events[1]["interaction_sha256"]
|
|
557
|
+
assert run["sources"][1]["artifact_sha256s"][2] == run["sources"][1]["artifact_sha256s"][3]
|
|
558
|
+
shared = _independent_interaction("run-all-events", "USER-REQUEST-SHARED")
|
|
559
|
+
assert sum(event["interaction_sha256"] == shared for event in events) == 1
|
|
560
|
+
assert any(
|
|
561
|
+
event["event_type"] == "finding_justification_requested"
|
|
562
|
+
and event["interaction_sha256"] == shared
|
|
563
|
+
for event in events
|
|
564
|
+
)
|
|
565
|
+
assert not any(
|
|
566
|
+
event["event_type"] == "mandatory_checkpoint_non_proceed"
|
|
567
|
+
and event["stage"] == "pipeline_stage_3"
|
|
568
|
+
for event in events
|
|
569
|
+
)
|
|
570
|
+
assert {event["stage"] for event in run["sources"][4]["events"]} == set(STAGES) - {
|
|
571
|
+
"pipeline_stage_1",
|
|
572
|
+
"pipeline_stage_3",
|
|
573
|
+
"pipeline_stage_4_5",
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
expected_input_digest = _independent_digest(
|
|
577
|
+
b"ars.adjudication-activity.input/1.0\0", _load(manifest)
|
|
578
|
+
)
|
|
579
|
+
assert run["input_receipt_sha256"] == expected_input_digest
|
|
580
|
+
record_without_digest = {
|
|
581
|
+
key: value for key, value in run.items() if key != "record_sha256"
|
|
582
|
+
}
|
|
583
|
+
assert run["record_sha256"] == _independent_digest(
|
|
584
|
+
b"ars.adjudication-activity.run/1.0\0", record_without_digest
|
|
585
|
+
)
|
|
586
|
+
first_author_source_record = {
|
|
587
|
+
"item_id": "REV-001",
|
|
588
|
+
"author_event_id": "AUTHOR-EVENT-ONE",
|
|
589
|
+
"author_triage": "wont_address",
|
|
590
|
+
"input_sha256": "a" * 64,
|
|
591
|
+
"interaction_sha256": author_events[0]["interaction_sha256"],
|
|
592
|
+
}
|
|
593
|
+
assert author_events[0]["source_event_sha256"] == _independent_digest(
|
|
594
|
+
b"ars.adjudication-activity.source-event/1.0\0",
|
|
595
|
+
{
|
|
596
|
+
"source_family": "revision_author_adjudication",
|
|
597
|
+
"source_record": first_author_source_record,
|
|
598
|
+
},
|
|
599
|
+
)
|
|
600
|
+
expected_event_digest = _independent_digest(
|
|
601
|
+
b"ars.adjudication-activity.event-id/1.0\0",
|
|
602
|
+
{
|
|
603
|
+
"run_id": "run-all-events",
|
|
604
|
+
"source_family": "revision_author_adjudication",
|
|
605
|
+
"event_type": author_events[0]["event_type"],
|
|
606
|
+
"stage": author_events[0]["stage"],
|
|
607
|
+
"disposition": author_events[0]["disposition"],
|
|
608
|
+
"interaction_sha256": author_events[0]["interaction_sha256"],
|
|
609
|
+
"source_event_sha256": author_events[0]["source_event_sha256"],
|
|
610
|
+
},
|
|
611
|
+
)
|
|
612
|
+
assert author_events[0]["event_id"] == f"ACTIVITY-EVENT-{expected_event_digest}"
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
def test_terminal_inventory_is_exact_authority_and_conflicting_retry_fails(
|
|
616
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
617
|
+
) -> None:
|
|
618
|
+
root = tmp_path / "artifacts"
|
|
619
|
+
state = _terminal_state(root, "run-authority")
|
|
620
|
+
manifest = _seal_and_build(capsys, root, state, _empty_rows())
|
|
621
|
+
store = tmp_path / "activity.json"
|
|
622
|
+
assert _append(capsys, root, store, manifest)[0] == 0
|
|
623
|
+
|
|
624
|
+
forged_root = tmp_path / "forged-root"
|
|
625
|
+
forged_state = _terminal_state(forged_root, "run-forged-authority")
|
|
626
|
+
valid_forged_base = _seal_and_build(
|
|
627
|
+
capsys, forged_root, forged_state, _empty_rows()
|
|
628
|
+
)
|
|
629
|
+
forged = _load(valid_forged_base)
|
|
630
|
+
forged["sources"][0] = {
|
|
631
|
+
"source_family": "revision_author_adjudication",
|
|
632
|
+
"capture_state": "unavailable",
|
|
633
|
+
"reason_code": "source_not_provided",
|
|
634
|
+
"artifacts": [],
|
|
635
|
+
}
|
|
636
|
+
forged_path = forged_root / "forged-input.json"
|
|
637
|
+
_write(forged_path, forged)
|
|
638
|
+
before = store.read_bytes()
|
|
639
|
+
code, stdout, stderr = _append(capsys, forged_root, store, forged_path)
|
|
640
|
+
assert code == 3
|
|
641
|
+
assert stdout == ""
|
|
642
|
+
assert "ERROR:INPUT" in stderr
|
|
643
|
+
assert store.read_bytes() == before
|
|
644
|
+
|
|
645
|
+
second_root = tmp_path / "second-root"
|
|
646
|
+
second_state = _terminal_state(second_root, "run-authority")
|
|
647
|
+
conflicting = _seal_and_build(
|
|
648
|
+
capsys,
|
|
649
|
+
second_root,
|
|
650
|
+
second_state,
|
|
651
|
+
_empty_rows("unavailable"),
|
|
652
|
+
output_name="different-input.json",
|
|
653
|
+
)
|
|
654
|
+
code, stdout, stderr = _append(capsys, second_root, store, conflicting)
|
|
655
|
+
assert code == 5
|
|
656
|
+
assert stdout == ""
|
|
657
|
+
assert "ERROR:CONFLICT" in stderr
|
|
658
|
+
assert store.read_bytes() == before
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
def test_delete_gap_range_delete_and_delete_store_recovery(
|
|
662
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
663
|
+
) -> None:
|
|
664
|
+
store = tmp_path / "activity.json"
|
|
665
|
+
roots: list[Path] = []
|
|
666
|
+
for ordinal in range(1, 4):
|
|
667
|
+
root = tmp_path / f"root-{ordinal}"
|
|
668
|
+
roots.append(root)
|
|
669
|
+
state = _terminal_state(
|
|
670
|
+
root,
|
|
671
|
+
f"run-{ordinal}",
|
|
672
|
+
pipeline_state="aborted" if ordinal == 2 else "completed",
|
|
673
|
+
current_stage="4p" if ordinal == 2 else "6",
|
|
674
|
+
status="blocked" if ordinal == 2 else "completed",
|
|
675
|
+
)
|
|
676
|
+
manifest = _seal_and_build(capsys, root, state, _empty_rows())
|
|
677
|
+
assert _append(capsys, root, store, manifest)[0] == 0
|
|
678
|
+
|
|
679
|
+
raw_hash = hashlib.sha256(store.read_bytes()).hexdigest()
|
|
680
|
+
before = store.read_bytes()
|
|
681
|
+
code, stdout, stderr = _call(
|
|
682
|
+
capsys,
|
|
683
|
+
"delete-runs",
|
|
684
|
+
"--store",
|
|
685
|
+
str(store),
|
|
686
|
+
"--store-id",
|
|
687
|
+
STORE_ID,
|
|
688
|
+
"--expect-store-sha256",
|
|
689
|
+
"0" * 64,
|
|
690
|
+
"--run-id",
|
|
691
|
+
"run-2",
|
|
692
|
+
)
|
|
693
|
+
assert code == 6
|
|
694
|
+
assert stdout == ""
|
|
695
|
+
assert "ERROR:DELETE_CONFIRMATION" in stderr
|
|
696
|
+
assert store.read_bytes() == before
|
|
697
|
+
code, stdout, stderr = _call(
|
|
698
|
+
capsys,
|
|
699
|
+
"delete-runs",
|
|
700
|
+
"--store",
|
|
701
|
+
str(store),
|
|
702
|
+
"--store-id",
|
|
703
|
+
STORE_ID,
|
|
704
|
+
"--expect-store-sha256",
|
|
705
|
+
raw_hash,
|
|
706
|
+
"--run-id",
|
|
707
|
+
"run-2",
|
|
708
|
+
)
|
|
709
|
+
assert (code, stderr) == (0, "")
|
|
710
|
+
assert "deleted_runs=1; revision=4; next_sequence=4" in stdout
|
|
711
|
+
assert [run["append_sequence"] for run in _load(store)["runs"]] == [1, 3]
|
|
712
|
+
|
|
713
|
+
raw_hash = hashlib.sha256(store.read_bytes()).hexdigest()
|
|
714
|
+
code, _stdout, stderr = _call(
|
|
715
|
+
capsys,
|
|
716
|
+
"delete-runs",
|
|
717
|
+
"--store",
|
|
718
|
+
str(store),
|
|
719
|
+
"--store-id",
|
|
720
|
+
STORE_ID,
|
|
721
|
+
"--expect-store-sha256",
|
|
722
|
+
raw_hash,
|
|
723
|
+
"--sequence-range",
|
|
724
|
+
"1:3",
|
|
725
|
+
)
|
|
726
|
+
assert code == 0, stderr
|
|
727
|
+
assert _load(store)["next_sequence"] == 4
|
|
728
|
+
store.write_bytes(b'{"corrupt":true}\n')
|
|
729
|
+
corrupt_hash = hashlib.sha256(store.read_bytes()).hexdigest()
|
|
730
|
+
code, stdout, stderr = _call(
|
|
731
|
+
capsys,
|
|
732
|
+
"delete-store",
|
|
733
|
+
"--store",
|
|
734
|
+
str(store),
|
|
735
|
+
"--store-id",
|
|
736
|
+
STORE_ID,
|
|
737
|
+
"--expect-store-sha256",
|
|
738
|
+
corrupt_hash,
|
|
739
|
+
"--confirm",
|
|
740
|
+
"WRONG-TOKEN",
|
|
741
|
+
)
|
|
742
|
+
assert code == 6
|
|
743
|
+
assert stdout == ""
|
|
744
|
+
assert "ERROR:DELETE_CONFIRMATION" in stderr
|
|
745
|
+
assert store.exists()
|
|
746
|
+
code, stdout, stderr = _call(
|
|
747
|
+
capsys,
|
|
748
|
+
"delete-store",
|
|
749
|
+
"--store",
|
|
750
|
+
str(store),
|
|
751
|
+
"--store-id",
|
|
752
|
+
STORE_ID,
|
|
753
|
+
"--expect-store-sha256",
|
|
754
|
+
corrupt_hash,
|
|
755
|
+
"--confirm",
|
|
756
|
+
"DELETE-ADJUDICATION-ACTIVITY-STORE",
|
|
757
|
+
)
|
|
758
|
+
assert (code, stderr) == (0, "")
|
|
759
|
+
assert stdout == "[ARS-ADJUDICATION-ACTIVITY] deleted_store=true\n"
|
|
760
|
+
assert not store.exists()
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
@pytest.mark.parametrize("window", ["1", "51"])
|
|
764
|
+
def test_renderer_rejects_out_of_range_window(
|
|
765
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str], window: str
|
|
766
|
+
) -> None:
|
|
767
|
+
store = tmp_path / "activity.json"
|
|
768
|
+
code, _stdout, _stderr = _call(
|
|
769
|
+
capsys, "init-store", "--store", str(store), "--store-id", STORE_ID
|
|
770
|
+
)
|
|
771
|
+
assert code == 0
|
|
772
|
+
code, stdout, stderr = _call(
|
|
773
|
+
capsys, "render", "--store", str(store), "--window", window
|
|
774
|
+
)
|
|
775
|
+
assert code == 2
|
|
776
|
+
assert stdout == ""
|
|
777
|
+
assert "ERROR:USAGE" in stderr
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
def test_build_input_rejects_caller_sources_and_input_cap_is_fail_closed(
|
|
781
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
782
|
+
) -> None:
|
|
783
|
+
root = tmp_path / "artifacts"
|
|
784
|
+
state = _terminal_state(root, "run-no-caller-authority")
|
|
785
|
+
output = root / "input.json"
|
|
786
|
+
code, stdout, stderr = _call(
|
|
787
|
+
capsys,
|
|
788
|
+
"build-input",
|
|
789
|
+
"--state",
|
|
790
|
+
str(state),
|
|
791
|
+
"--artifact-root",
|
|
792
|
+
str(root),
|
|
793
|
+
"--store-id",
|
|
794
|
+
STORE_ID,
|
|
795
|
+
"--output",
|
|
796
|
+
str(output),
|
|
797
|
+
"--source-sha256",
|
|
798
|
+
"0" * 64,
|
|
799
|
+
)
|
|
800
|
+
assert code == 2
|
|
801
|
+
assert stdout == ""
|
|
802
|
+
assert "ERROR:USAGE" in stderr
|
|
803
|
+
assert not output.exists()
|
|
804
|
+
|
|
805
|
+
oversized = root / "oversized-input.json"
|
|
806
|
+
oversized.write_bytes(b" " * ((1 << 20) + 1))
|
|
807
|
+
store = tmp_path / "activity.json"
|
|
808
|
+
code, stdout, stderr = _append(capsys, root, store, oversized)
|
|
809
|
+
assert code == 5
|
|
810
|
+
assert stdout == ""
|
|
811
|
+
assert "ERROR:CAP" in stderr
|
|
812
|
+
assert not store.exists()
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
@pytest.mark.parametrize(
|
|
816
|
+
"corrupt",
|
|
817
|
+
[
|
|
818
|
+
b'{"schema_version":"adjudication-activity-store/1.0","schema_version":"duplicate"}\n',
|
|
819
|
+
b"\xef\xbb\xbf{}\n",
|
|
820
|
+
b"{} trailing\n",
|
|
821
|
+
b'{"float":1.5}\n',
|
|
822
|
+
],
|
|
823
|
+
)
|
|
824
|
+
def test_store_corruption_fails_closed(
|
|
825
|
+
tmp_path: Path,
|
|
826
|
+
capsys: pytest.CaptureFixture[str],
|
|
827
|
+
corrupt: bytes,
|
|
828
|
+
) -> None:
|
|
829
|
+
store = tmp_path / "activity.json"
|
|
830
|
+
store.write_bytes(corrupt)
|
|
831
|
+
code, stdout, stderr = _call(capsys, "validate", "--store", str(store))
|
|
832
|
+
assert code == 4
|
|
833
|
+
assert stdout == ""
|
|
834
|
+
assert "ERROR:STORE" in stderr
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
def test_symlink_artifact_and_lock_contention_fail_without_mutation(
|
|
838
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
839
|
+
) -> None:
|
|
840
|
+
root = tmp_path / "artifacts"
|
|
841
|
+
target = root / "target.json"
|
|
842
|
+
_write(target, {"fixture": True})
|
|
843
|
+
link = root / "link.json"
|
|
844
|
+
link.symlink_to(target)
|
|
845
|
+
rows = _empty_rows()
|
|
846
|
+
rows[3] = {
|
|
847
|
+
"source_family": "explicit_user_request",
|
|
848
|
+
"capture_state": "captured",
|
|
849
|
+
"reason_code": None,
|
|
850
|
+
"artifacts": [
|
|
851
|
+
_artifact("explicit-log", "explicit_user_request_log", "SOURCE-GROUP-explicit", "link.json")
|
|
852
|
+
],
|
|
853
|
+
}
|
|
854
|
+
state = _terminal_state(root, "run-path")
|
|
855
|
+
state_before = state.read_bytes()
|
|
856
|
+
with pytest.raises(activity.ActivityError, match="symlink"):
|
|
857
|
+
activity.seal_terminal_inventory(state, root, rows)
|
|
858
|
+
assert state.read_bytes() == state_before
|
|
859
|
+
|
|
860
|
+
store = tmp_path / "activity.json"
|
|
861
|
+
assert _call(capsys, "init-store", "--store", str(store), "--store-id", STORE_ID)[0] == 0
|
|
862
|
+
before = store.read_bytes()
|
|
863
|
+
lock_path = store.with_name(store.name + ".lock")
|
|
864
|
+
with lock_path.open("r+b") as lock_file:
|
|
865
|
+
fcntl.flock(lock_file.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
866
|
+
code, stdout, stderr = _call(capsys, "validate", "--store", str(store))
|
|
867
|
+
assert code == 7
|
|
868
|
+
assert stdout == ""
|
|
869
|
+
assert "ERROR:LOCK" in stderr
|
|
870
|
+
assert store.read_bytes() == before
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
def test_captured_zero_compliance_report_only_is_valid(
|
|
874
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
875
|
+
) -> None:
|
|
876
|
+
root = tmp_path / "artifacts"
|
|
877
|
+
pass_report = _copy_fixture(root, "compliance_pass.json")
|
|
878
|
+
rows = _empty_rows()
|
|
879
|
+
rows[1] = {
|
|
880
|
+
"source_family": "compliance_report",
|
|
881
|
+
"capture_state": "captured",
|
|
882
|
+
"reason_code": None,
|
|
883
|
+
"artifacts": [
|
|
884
|
+
_artifact("report-only", "compliance_report", "SOURCE-GROUP-pass", pass_report)
|
|
885
|
+
],
|
|
886
|
+
}
|
|
887
|
+
state = _terminal_state(root, "run-captured-zero")
|
|
888
|
+
manifest = _seal_and_build(capsys, root, state, rows)
|
|
889
|
+
store = tmp_path / "activity.json"
|
|
890
|
+
code, _stdout, stderr = _append(capsys, root, store, manifest)
|
|
891
|
+
assert code == 0, stderr
|
|
892
|
+
compliance = _load(store)["runs"][0]["sources"][1]
|
|
893
|
+
assert compliance["capture_state"] == "captured"
|
|
894
|
+
assert compliance["events"] == []
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
def test_nonqualifying_compliance_receipt_pair_is_rejected(
|
|
898
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
899
|
+
) -> None:
|
|
900
|
+
root = tmp_path / "artifacts"
|
|
901
|
+
pass_report = _copy_fixture(root, "compliance_pass.json")
|
|
902
|
+
action = _load(FIXTURES / "compliance_override_action.json")
|
|
903
|
+
action["report_sha256"] = hashlib.sha256((root / pass_report).read_bytes()).hexdigest()
|
|
904
|
+
action_path = root / "sources" / "bad-paired-action.json"
|
|
905
|
+
_write(action_path, action)
|
|
906
|
+
rows = _empty_rows()
|
|
907
|
+
rows[1] = {
|
|
908
|
+
"source_family": "compliance_report",
|
|
909
|
+
"capture_state": "captured",
|
|
910
|
+
"reason_code": None,
|
|
911
|
+
"artifacts": [
|
|
912
|
+
_artifact("plain-report", "compliance_report", "SOURCE-GROUP-bad-pair", pass_report),
|
|
913
|
+
_artifact(
|
|
914
|
+
"forbidden-action",
|
|
915
|
+
"compliance_override_action_receipt",
|
|
916
|
+
"SOURCE-GROUP-bad-pair",
|
|
917
|
+
action_path.relative_to(root).as_posix(),
|
|
918
|
+
),
|
|
919
|
+
],
|
|
920
|
+
}
|
|
921
|
+
state = _terminal_state(root, "run-bad-pair")
|
|
922
|
+
activity.seal_terminal_inventory(state, root, rows)
|
|
923
|
+
manifest = root / "input.json"
|
|
924
|
+
store = tmp_path / "activity.json"
|
|
925
|
+
code, stdout, stderr = _call(
|
|
926
|
+
capsys,
|
|
927
|
+
"build-input",
|
|
928
|
+
"--state",
|
|
929
|
+
str(state),
|
|
930
|
+
"--artifact-root",
|
|
931
|
+
str(root),
|
|
932
|
+
"--store-id",
|
|
933
|
+
STORE_ID,
|
|
934
|
+
"--output",
|
|
935
|
+
str(manifest),
|
|
936
|
+
)
|
|
937
|
+
assert code == 3
|
|
938
|
+
assert stdout == ""
|
|
939
|
+
assert "ERROR:SOURCE" in stderr
|
|
940
|
+
assert not store.exists()
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
def test_exact_retry_ignores_deleted_source_and_terminal_bytes_without_write(
|
|
944
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
945
|
+
) -> None:
|
|
946
|
+
root = tmp_path / "artifacts"
|
|
947
|
+
pass_report = _copy_fixture(root, "compliance_pass.json")
|
|
948
|
+
rows = _empty_rows()
|
|
949
|
+
rows[1] = {
|
|
950
|
+
"source_family": "compliance_report",
|
|
951
|
+
"capture_state": "captured",
|
|
952
|
+
"reason_code": None,
|
|
953
|
+
"artifacts": [
|
|
954
|
+
_artifact(
|
|
955
|
+
"report-only",
|
|
956
|
+
"compliance_report",
|
|
957
|
+
"SOURCE-GROUP-pass",
|
|
958
|
+
pass_report,
|
|
959
|
+
)
|
|
960
|
+
],
|
|
961
|
+
}
|
|
962
|
+
state = _terminal_state(root, "run-retry-deleted")
|
|
963
|
+
manifest = _seal_and_build(capsys, root, state, rows)
|
|
964
|
+
store = tmp_path / "activity.json"
|
|
965
|
+
assert _append(capsys, root, store, manifest)[0] == 0
|
|
966
|
+
before_bytes = store.read_bytes()
|
|
967
|
+
before_mtime = store.stat().st_mtime_ns
|
|
968
|
+
|
|
969
|
+
(root / pass_report).unlink()
|
|
970
|
+
state.unlink()
|
|
971
|
+
code, stdout, stderr = _append(capsys, root, store, manifest)
|
|
972
|
+
assert (code, stderr) == (0, "")
|
|
973
|
+
assert "already_appended" in stdout
|
|
974
|
+
assert store.read_bytes() == before_bytes
|
|
975
|
+
assert store.stat().st_mtime_ns == before_mtime
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
def test_short_write_is_completed_and_zero_write_fails_cleanly(
|
|
979
|
+
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
980
|
+
) -> None:
|
|
981
|
+
payload = b"short-write-fixture" * 64
|
|
982
|
+
short_path = tmp_path / "short.bin"
|
|
983
|
+
original_write = activity.os.write
|
|
984
|
+
|
|
985
|
+
def short_write(fd: int, data: bytes | memoryview) -> int:
|
|
986
|
+
return original_write(fd, data[: max(1, len(data) // 2)])
|
|
987
|
+
|
|
988
|
+
monkeypatch.setattr(activity.os, "write", short_write)
|
|
989
|
+
activity._atomic_create(short_path, payload)
|
|
990
|
+
assert short_path.read_bytes() == payload
|
|
991
|
+
|
|
992
|
+
zero_path = tmp_path / "zero.bin"
|
|
993
|
+
monkeypatch.setattr(activity.os, "write", lambda _fd, _data: 0)
|
|
994
|
+
with pytest.raises(activity.ActivityError) as caught:
|
|
995
|
+
activity._atomic_create(zero_path, payload)
|
|
996
|
+
assert caught.value.code == "WRITE"
|
|
997
|
+
assert not zero_path.exists()
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
def test_short_read_is_reassembled(
|
|
1001
|
+
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
1002
|
+
) -> None:
|
|
1003
|
+
payload = b"short-read-fixture" * 64
|
|
1004
|
+
path = tmp_path / "read.bin"
|
|
1005
|
+
path.write_bytes(payload)
|
|
1006
|
+
original_read = activity.os.read
|
|
1007
|
+
|
|
1008
|
+
def short_read(fd: int, count: int) -> bytes:
|
|
1009
|
+
return original_read(fd, max(1, count // 2))
|
|
1010
|
+
|
|
1011
|
+
monkeypatch.setattr(activity.os, "read", short_read)
|
|
1012
|
+
assert activity._read_limited(path, len(payload), code="INPUT") == payload
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
def test_noncanonical_valid_object_delete_store_recovery(
|
|
1016
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1017
|
+
) -> None:
|
|
1018
|
+
store = tmp_path / "activity.json"
|
|
1019
|
+
store.write_bytes(b'{ "z": 1, "a": 2 }\n')
|
|
1020
|
+
raw_hash = hashlib.sha256(store.read_bytes()).hexdigest()
|
|
1021
|
+
code, stdout, stderr = _call(
|
|
1022
|
+
capsys,
|
|
1023
|
+
"delete-store",
|
|
1024
|
+
"--store",
|
|
1025
|
+
str(store),
|
|
1026
|
+
"--store-id",
|
|
1027
|
+
STORE_ID,
|
|
1028
|
+
"--expect-store-sha256",
|
|
1029
|
+
raw_hash,
|
|
1030
|
+
"--confirm",
|
|
1031
|
+
"DELETE-ADJUDICATION-ACTIVITY-STORE",
|
|
1032
|
+
)
|
|
1033
|
+
assert (code, stderr) == (0, "")
|
|
1034
|
+
assert stdout == "[ARS-ADJUDICATION-ACTIVITY] deleted_store=true\n"
|
|
1035
|
+
assert not store.exists()
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
@pytest.mark.parametrize(
|
|
1039
|
+
"mutation",
|
|
1040
|
+
[
|
|
1041
|
+
lambda action: action.__setitem__("override_ordinal", True),
|
|
1042
|
+
lambda action: action.__setitem__("scope", [["M4"]]),
|
|
1043
|
+
],
|
|
1044
|
+
ids=("boolean-ordinal", "unhashable-scope"),
|
|
1045
|
+
)
|
|
1046
|
+
def test_compliance_bad_ordinal_or_scope_is_bounded_source_error(
|
|
1047
|
+
tmp_path: Path,
|
|
1048
|
+
capsys: pytest.CaptureFixture[str],
|
|
1049
|
+
mutation: Callable[[dict[str, Any]], None],
|
|
1050
|
+
) -> None:
|
|
1051
|
+
root = tmp_path / "artifacts"
|
|
1052
|
+
run_id = "run-compliance-edge"
|
|
1053
|
+
state = _terminal_state(root, run_id)
|
|
1054
|
+
activity.seal_terminal_inventory(
|
|
1055
|
+
state, root, _compliance_rows(root, run_id, mutation)
|
|
1056
|
+
)
|
|
1057
|
+
output = root / "input.json"
|
|
1058
|
+
code, stdout, stderr = _call(
|
|
1059
|
+
capsys,
|
|
1060
|
+
"build-input",
|
|
1061
|
+
"--state",
|
|
1062
|
+
str(state),
|
|
1063
|
+
"--artifact-root",
|
|
1064
|
+
str(root),
|
|
1065
|
+
"--store-id",
|
|
1066
|
+
STORE_ID,
|
|
1067
|
+
"--output",
|
|
1068
|
+
str(output),
|
|
1069
|
+
)
|
|
1070
|
+
assert code == 3
|
|
1071
|
+
assert stdout == ""
|
|
1072
|
+
assert "ERROR:SOURCE" in stderr
|
|
1073
|
+
assert "Traceback" not in stderr
|
|
1074
|
+
assert len(stderr.rstrip("\n").splitlines()) == 1
|
|
1075
|
+
assert len(stderr.rstrip("\n")) <= 560
|
|
1076
|
+
assert not output.exists()
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
@pytest.mark.parametrize("mandatory", [False, True], ids=("finding-id", "checkpoint-id"))
|
|
1080
|
+
def test_129_character_finding_or_checkpoint_id_is_rejected(
|
|
1081
|
+
tmp_path: Path,
|
|
1082
|
+
capsys: pytest.CaptureFixture[str],
|
|
1083
|
+
mandatory: bool,
|
|
1084
|
+
) -> None:
|
|
1085
|
+
root = tmp_path / "artifacts"
|
|
1086
|
+
run_id = f"run-long-{'checkpoint' if mandatory else 'finding'}"
|
|
1087
|
+
|
|
1088
|
+
def mutate(record: dict[str, Any]) -> None:
|
|
1089
|
+
record["checkpoint_id" if mandatory else "finding_id"] = "X" * 129
|
|
1090
|
+
|
|
1091
|
+
state = _terminal_state(root, run_id)
|
|
1092
|
+
activity.seal_terminal_inventory(
|
|
1093
|
+
state,
|
|
1094
|
+
root,
|
|
1095
|
+
_single_log_rows(root, run_id, mandatory=mandatory, mutate_record=mutate),
|
|
1096
|
+
)
|
|
1097
|
+
output = root / "input.json"
|
|
1098
|
+
code, stdout, stderr = _call(
|
|
1099
|
+
capsys,
|
|
1100
|
+
"build-input",
|
|
1101
|
+
"--state",
|
|
1102
|
+
str(state),
|
|
1103
|
+
"--artifact-root",
|
|
1104
|
+
str(root),
|
|
1105
|
+
"--store-id",
|
|
1106
|
+
STORE_ID,
|
|
1107
|
+
"--output",
|
|
1108
|
+
str(output),
|
|
1109
|
+
)
|
|
1110
|
+
assert code == 3
|
|
1111
|
+
assert stdout == ""
|
|
1112
|
+
assert "ERROR:SOURCE" in stderr
|
|
1113
|
+
assert not output.exists()
|
|
1114
|
+
|
|
1115
|
+
|
|
1116
|
+
def test_explicit_and_mandatory_raw_record_aggregate_4097_is_rejected(
|
|
1117
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1118
|
+
) -> None:
|
|
1119
|
+
root = tmp_path / "artifacts"
|
|
1120
|
+
run_id = "run-aggregate-4097"
|
|
1121
|
+
explicit_id = "EXPLICIT-1"
|
|
1122
|
+
explicit = {
|
|
1123
|
+
"schema_version": "adjudication-explicit-user-request-log/1.0",
|
|
1124
|
+
"run_id": run_id,
|
|
1125
|
+
"records": [
|
|
1126
|
+
{
|
|
1127
|
+
"request_id": "REQUEST-1",
|
|
1128
|
+
"actor_role": "user",
|
|
1129
|
+
"source": "explicit_session_user_action",
|
|
1130
|
+
"action": "justify_finding",
|
|
1131
|
+
"stage": "pipeline_stage_3",
|
|
1132
|
+
"finding_id": "REV-001",
|
|
1133
|
+
"interaction_id": explicit_id,
|
|
1134
|
+
"interaction_sha256": _independent_interaction(run_id, explicit_id),
|
|
1135
|
+
}
|
|
1136
|
+
],
|
|
1137
|
+
}
|
|
1138
|
+
mandatory_records = []
|
|
1139
|
+
for ordinal in range(4096):
|
|
1140
|
+
interaction_id = f"MANDATORY-{ordinal}"
|
|
1141
|
+
mandatory_records.append(
|
|
1142
|
+
{
|
|
1143
|
+
"response_id": f"RESPONSE-{ordinal}",
|
|
1144
|
+
"checkpoint_id": f"CHECKPOINT-{ordinal}",
|
|
1145
|
+
"checkpoint_type": "MANDATORY",
|
|
1146
|
+
"actor_role": "user",
|
|
1147
|
+
"source": "explicit_session_user_action",
|
|
1148
|
+
"stage": "pipeline_stage_4_5",
|
|
1149
|
+
"disposition": "proceed",
|
|
1150
|
+
"interaction_id": interaction_id,
|
|
1151
|
+
"interaction_sha256": _independent_interaction(run_id, interaction_id),
|
|
1152
|
+
}
|
|
1153
|
+
)
|
|
1154
|
+
mandatory = {
|
|
1155
|
+
"schema_version": "adjudication-mandatory-checkpoint-log/1.0",
|
|
1156
|
+
"run_id": run_id,
|
|
1157
|
+
"records": mandatory_records,
|
|
1158
|
+
}
|
|
1159
|
+
explicit_path = root / "sources" / "explicit-4097.json"
|
|
1160
|
+
mandatory_path = root / "sources" / "mandatory-4097.json"
|
|
1161
|
+
_write(explicit_path, explicit)
|
|
1162
|
+
_write(mandatory_path, mandatory)
|
|
1163
|
+
rows = _empty_rows()
|
|
1164
|
+
rows[3] = {
|
|
1165
|
+
"source_family": "explicit_user_request",
|
|
1166
|
+
"capture_state": "captured",
|
|
1167
|
+
"reason_code": None,
|
|
1168
|
+
"artifacts": [
|
|
1169
|
+
_artifact(
|
|
1170
|
+
"explicit-log",
|
|
1171
|
+
"explicit_user_request_log",
|
|
1172
|
+
"SOURCE-GROUP-explicit",
|
|
1173
|
+
explicit_path.relative_to(root).as_posix(),
|
|
1174
|
+
)
|
|
1175
|
+
],
|
|
1176
|
+
}
|
|
1177
|
+
rows[4] = {
|
|
1178
|
+
"source_family": "mandatory_checkpoint_response",
|
|
1179
|
+
"capture_state": "captured",
|
|
1180
|
+
"reason_code": None,
|
|
1181
|
+
"artifacts": [
|
|
1182
|
+
_artifact(
|
|
1183
|
+
"mandatory-log",
|
|
1184
|
+
"mandatory_checkpoint_response_log",
|
|
1185
|
+
"SOURCE-GROUP-mandatory",
|
|
1186
|
+
mandatory_path.relative_to(root).as_posix(),
|
|
1187
|
+
)
|
|
1188
|
+
],
|
|
1189
|
+
}
|
|
1190
|
+
state = _terminal_state(root, run_id)
|
|
1191
|
+
activity.seal_terminal_inventory(state, root, rows)
|
|
1192
|
+
output = root / "input.json"
|
|
1193
|
+
code, stdout, stderr = _call(
|
|
1194
|
+
capsys,
|
|
1195
|
+
"build-input",
|
|
1196
|
+
"--state",
|
|
1197
|
+
str(state),
|
|
1198
|
+
"--artifact-root",
|
|
1199
|
+
str(root),
|
|
1200
|
+
"--store-id",
|
|
1201
|
+
STORE_ID,
|
|
1202
|
+
"--output",
|
|
1203
|
+
str(output),
|
|
1204
|
+
)
|
|
1205
|
+
assert code == 5
|
|
1206
|
+
assert stdout == ""
|
|
1207
|
+
assert "ERROR:CAP" in stderr
|
|
1208
|
+
assert not output.exists()
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
def test_lone_surrogate_is_bounded_store_error(
|
|
1212
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1213
|
+
) -> None:
|
|
1214
|
+
store = tmp_path / "activity.json"
|
|
1215
|
+
store.write_bytes(b'{"surrogate":"\\ud800"}\n')
|
|
1216
|
+
code, stdout, stderr = _call(capsys, "validate", "--store", str(store))
|
|
1217
|
+
assert code == 4
|
|
1218
|
+
assert stdout == ""
|
|
1219
|
+
assert "ERROR:STORE" in stderr
|
|
1220
|
+
assert "Traceback" not in stderr
|
|
1221
|
+
assert len(stderr.rstrip("\n").splitlines()) == 1
|
|
1222
|
+
assert len(stderr.rstrip("\n")) <= 560
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
def test_author_store_three_hashes_is_rejected(
|
|
1226
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1227
|
+
) -> None:
|
|
1228
|
+
root = tmp_path / "artifacts"
|
|
1229
|
+
paths = [
|
|
1230
|
+
_copy_fixture(root, "author_stage3_input.json"),
|
|
1231
|
+
_copy_fixture(root, "author_stage3.json"),
|
|
1232
|
+
]
|
|
1233
|
+
rows = _empty_rows()
|
|
1234
|
+
rows[0] = {
|
|
1235
|
+
"source_family": "revision_author_adjudication",
|
|
1236
|
+
"capture_state": "captured",
|
|
1237
|
+
"reason_code": None,
|
|
1238
|
+
"artifacts": [
|
|
1239
|
+
_artifact("author-input", "author_adjudication_input", "SOURCE-GROUP-author", paths[0], "pipeline_stage_3"),
|
|
1240
|
+
_artifact("author-output", "author_adjudication", "SOURCE-GROUP-author", paths[1], "pipeline_stage_3"),
|
|
1241
|
+
],
|
|
1242
|
+
}
|
|
1243
|
+
state = _terminal_state(root, "run-author-three-hashes", extra_completed=("3",))
|
|
1244
|
+
manifest = _seal_and_build(capsys, root, state, rows)
|
|
1245
|
+
store = tmp_path / "activity.json"
|
|
1246
|
+
assert _append(capsys, root, store, manifest)[0] == 0
|
|
1247
|
+
payload = _load(store)
|
|
1248
|
+
hashes = payload["runs"][0]["sources"][0]["artifact_sha256s"]
|
|
1249
|
+
hashes.append(hashes[-1])
|
|
1250
|
+
_recompute_record(payload["runs"][0])
|
|
1251
|
+
_write(store, payload)
|
|
1252
|
+
code, stdout, stderr = _call(capsys, "validate", "--store", str(store))
|
|
1253
|
+
assert code == 4
|
|
1254
|
+
assert stdout == ""
|
|
1255
|
+
assert "ERROR:STORE" in stderr
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
def test_store_next_sequence_cannot_exceed_revision_plus_one(
|
|
1259
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1260
|
+
) -> None:
|
|
1261
|
+
root = tmp_path / "artifacts"
|
|
1262
|
+
state = _terminal_state(root, "run-next-sequence")
|
|
1263
|
+
manifest = _seal_and_build(capsys, root, state, _empty_rows())
|
|
1264
|
+
store = tmp_path / "activity.json"
|
|
1265
|
+
assert _append(capsys, root, store, manifest)[0] == 0
|
|
1266
|
+
payload = _load(store)
|
|
1267
|
+
assert payload["revision"] == 1
|
|
1268
|
+
payload["next_sequence"] = 3
|
|
1269
|
+
_write(store, payload)
|
|
1270
|
+
code, stdout, stderr = _call(capsys, "validate", "--store", str(store))
|
|
1271
|
+
assert code == 4
|
|
1272
|
+
assert stdout == ""
|
|
1273
|
+
assert "ERROR:STORE" in stderr
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
def _assert_re_review_mutation_rejected(
|
|
1277
|
+
tmp_path: Path,
|
|
1278
|
+
capsys: pytest.CaptureFixture[str],
|
|
1279
|
+
mutation: Callable[[dict[str, Any], dict[str, Any]], None],
|
|
1280
|
+
) -> None:
|
|
1281
|
+
root = tmp_path / "artifacts"
|
|
1282
|
+
state = _terminal_state(root, "run-rereview-negative")
|
|
1283
|
+
rows = _re_review_rows(root, mutation)
|
|
1284
|
+
activity.seal_terminal_inventory(state, root, rows)
|
|
1285
|
+
output = root / "input.json"
|
|
1286
|
+
code, stdout, stderr = _call(
|
|
1287
|
+
capsys,
|
|
1288
|
+
"build-input",
|
|
1289
|
+
"--state",
|
|
1290
|
+
str(state),
|
|
1291
|
+
"--artifact-root",
|
|
1292
|
+
str(root),
|
|
1293
|
+
"--store-id",
|
|
1294
|
+
STORE_ID,
|
|
1295
|
+
"--output",
|
|
1296
|
+
str(output),
|
|
1297
|
+
)
|
|
1298
|
+
assert code == 3
|
|
1299
|
+
assert stdout == ""
|
|
1300
|
+
assert "ERROR:SOURCE" in stderr
|
|
1301
|
+
assert not output.exists()
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
def test_re_review_no_change_adjustment_is_rejected(
|
|
1305
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1306
|
+
) -> None:
|
|
1307
|
+
def mutate(_verdict: dict[str, Any], trace: dict[str, Any]) -> None:
|
|
1308
|
+
reapplication = trace["reapplications"][0]
|
|
1309
|
+
reapplication["reapplied_verdict"] = "FULLY_ADDRESSED"
|
|
1310
|
+
adjustment = trace["adjustments"][0]
|
|
1311
|
+
adjustment["from_verdict"] = "FULLY_ADDRESSED"
|
|
1312
|
+
adjustment["to_verdict"] = "FULLY_ADDRESSED"
|
|
1313
|
+
trace["rows"][0].update(
|
|
1314
|
+
{"verified": "YES", "status": "FULLY_ADDRESSED", "final_verdict": "FULLY_ADDRESSED"}
|
|
1315
|
+
)
|
|
1316
|
+
|
|
1317
|
+
_assert_re_review_mutation_rejected(tmp_path, capsys, mutate)
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
def test_re_review_adjustment_endpoints_must_mirror_reapplication(
|
|
1321
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1322
|
+
) -> None:
|
|
1323
|
+
def mutate(_verdict: dict[str, Any], trace: dict[str, Any]) -> None:
|
|
1324
|
+
trace["adjustments"][0]["from_verdict"] = "PARTIALLY_ADDRESSED"
|
|
1325
|
+
|
|
1326
|
+
_assert_re_review_mutation_rejected(tmp_path, capsys, mutate)
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
def test_re_review_reapplication_and_adjustment_are_single_use(
|
|
1330
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1331
|
+
) -> None:
|
|
1332
|
+
def mutate(verdict: dict[str, Any], trace: dict[str, Any]) -> None:
|
|
1333
|
+
second_dissent = copy.deepcopy(verdict["dissents"][0])
|
|
1334
|
+
second_dissent["dissent_id"] = "DIS-2"
|
|
1335
|
+
verdict["dissents"].append(second_dissent)
|
|
1336
|
+
second_adjudication = copy.deepcopy(trace["dissent_adjudications"][0])
|
|
1337
|
+
second_adjudication["dissent_id"] = "DIS-2"
|
|
1338
|
+
trace["dissent_adjudications"].append(second_adjudication)
|
|
1339
|
+
trace["reapplications"][0]["answer_refs"].append("adjudication:DIS-2")
|
|
1340
|
+
|
|
1341
|
+
_assert_re_review_mutation_rejected(tmp_path, capsys, mutate)
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
def test_seal_rejects_invalid_artifact_id_without_state_write(tmp_path: Path) -> None:
|
|
1345
|
+
root = tmp_path / "artifacts"
|
|
1346
|
+
report = _copy_fixture(root, "compliance_pass.json")
|
|
1347
|
+
rows = _empty_rows()
|
|
1348
|
+
rows[1] = {
|
|
1349
|
+
"source_family": "compliance_report",
|
|
1350
|
+
"capture_state": "captured",
|
|
1351
|
+
"reason_code": None,
|
|
1352
|
+
"artifacts": [
|
|
1353
|
+
_artifact(
|
|
1354
|
+
"invalid artifact id",
|
|
1355
|
+
"compliance_report",
|
|
1356
|
+
"SOURCE-GROUP-invalid-id",
|
|
1357
|
+
report,
|
|
1358
|
+
)
|
|
1359
|
+
],
|
|
1360
|
+
}
|
|
1361
|
+
state = _terminal_state(root, "run-invalid-artifact-id")
|
|
1362
|
+
before = state.read_bytes()
|
|
1363
|
+
with pytest.raises(activity.ActivityError) as caught:
|
|
1364
|
+
activity.seal_terminal_inventory(state, root, rows)
|
|
1365
|
+
assert caught.value.code == "SOURCE"
|
|
1366
|
+
assert state.read_bytes() == before
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
def test_renderer_empty_one_two_full_golden_and_mixed_denominators(
|
|
1370
|
+
tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
|
1371
|
+
) -> None:
|
|
1372
|
+
store = tmp_path / "activity.json"
|
|
1373
|
+
assert _call(
|
|
1374
|
+
capsys, "init-store", "--store", str(store), "--store-id", STORE_ID
|
|
1375
|
+
)[0] == 0
|
|
1376
|
+
code, stdout, stderr = _call(capsys, "render", "--store", str(store))
|
|
1377
|
+
assert (code, stderr) == (0, "")
|
|
1378
|
+
assert stdout == "\n".join(
|
|
1379
|
+
[
|
|
1380
|
+
"[ARS-ADJUDICATION-ACTIVITY INSUFFICIENT_HISTORY] selected_retained_eligible_run_count=0; minimum_required=2; requested_window=10.",
|
|
1381
|
+
"[ARS-ADJUDICATION-ACTIVITY COUNTS] adjudication_count=0 (denominator: 0 retained eligible terminal run records); overturn_count=0 (denominator: 0 recorded adjudications); unavailable_run_count=0 (denominator: 0 retained eligible terminal run records).",
|
|
1382
|
+
COVERAGE,
|
|
1383
|
+
LIMITATION,
|
|
1384
|
+
ADVISORY,
|
|
1385
|
+
"",
|
|
1386
|
+
]
|
|
1387
|
+
)
|
|
1388
|
+
|
|
1389
|
+
root_one = tmp_path / "root-one"
|
|
1390
|
+
pass_report = _copy_fixture(root_one, "compliance_pass.json")
|
|
1391
|
+
mixed_rows = _empty_rows()
|
|
1392
|
+
mixed_rows[0] = {
|
|
1393
|
+
"source_family": "revision_author_adjudication",
|
|
1394
|
+
"capture_state": "unavailable",
|
|
1395
|
+
"reason_code": "source_not_provided",
|
|
1396
|
+
"artifacts": [],
|
|
1397
|
+
}
|
|
1398
|
+
mixed_rows[1] = {
|
|
1399
|
+
"source_family": "compliance_report",
|
|
1400
|
+
"capture_state": "captured",
|
|
1401
|
+
"reason_code": None,
|
|
1402
|
+
"artifacts": [
|
|
1403
|
+
_artifact("report-only", "compliance_report", "SOURCE-GROUP-pass", pass_report)
|
|
1404
|
+
],
|
|
1405
|
+
}
|
|
1406
|
+
state_one = _terminal_state(root_one, "run-mixed-zero")
|
|
1407
|
+
manifest_one = _seal_and_build(capsys, root_one, state_one, mixed_rows)
|
|
1408
|
+
assert _append(capsys, root_one, store, manifest_one)[0] == 0
|
|
1409
|
+
code, stdout, stderr = _call(capsys, "render", "--store", str(store))
|
|
1410
|
+
assert (code, stderr) == (0, "")
|
|
1411
|
+
assert stdout == "\n".join(
|
|
1412
|
+
[
|
|
1413
|
+
"[ARS-ADJUDICATION-ACTIVITY INSUFFICIENT_HISTORY] selected_retained_eligible_run_count=1; minimum_required=2; requested_window=10.",
|
|
1414
|
+
"[ARS-ADJUDICATION-ACTIVITY COUNTS] adjudication_count=0 (denominator: 1 retained eligible terminal run records); overturn_count=0 (denominator: 0 recorded adjudications); unavailable_run_count=1 (denominator: 1 retained eligible terminal run records).",
|
|
1415
|
+
'sequence=1; run_id="run-mixed-zero"; terminal_state=completed; adjudication_count=0 (denominator: 1 retained eligible terminal run record); overturn_count=0 (denominator: 0 recorded adjudications); unavailable_source_count=1 (denominator: 5 source families).',
|
|
1416
|
+
COVERAGE,
|
|
1417
|
+
LIMITATION,
|
|
1418
|
+
ADVISORY,
|
|
1419
|
+
"",
|
|
1420
|
+
]
|
|
1421
|
+
)
|
|
1422
|
+
|
|
1423
|
+
root_two = tmp_path / "root-two"
|
|
1424
|
+
state_two = _terminal_state(root_two, "run-not-applicable")
|
|
1425
|
+
manifest_two = _seal_and_build(capsys, root_two, state_two, _empty_rows())
|
|
1426
|
+
assert _append(capsys, root_two, store, manifest_two)[0] == 0
|
|
1427
|
+
code, stdout, stderr = _call(capsys, "render", "--store", str(store))
|
|
1428
|
+
assert (code, stderr) == (0, "")
|
|
1429
|
+
assert stdout == "\n".join(
|
|
1430
|
+
[
|
|
1431
|
+
"[ARS-ADJUDICATION-ACTIVITY] selected_retained_eligible_run_count=2; requested_window=10; adjudication_count=0 (denominator: 2 retained eligible terminal run records); overturn_count=0 (denominator: 0 recorded adjudications); unavailable_run_count=1 (denominator: 2 retained eligible terminal run records).",
|
|
1432
|
+
'sequence=1; run_id="run-mixed-zero"; terminal_state=completed; adjudication_count=0 (denominator: 1 retained eligible terminal run record); overturn_count=0 (denominator: 0 recorded adjudications); unavailable_source_count=1 (denominator: 5 source families).',
|
|
1433
|
+
'sequence=2; run_id="run-not-applicable"; terminal_state=completed; adjudication_count=0 (denominator: 1 retained eligible terminal run record); overturn_count=0 (denominator: 0 recorded adjudications); unavailable_source_count=0 (denominator: 5 source families).',
|
|
1434
|
+
COVERAGE,
|
|
1435
|
+
LIMITATION,
|
|
1436
|
+
ADVISORY,
|
|
1437
|
+
"",
|
|
1438
|
+
]
|
|
1439
|
+
)
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
@pytest.mark.parametrize(
|
|
1443
|
+
("pipeline_state", "raw_stage", "status"),
|
|
1444
|
+
[("completed", "6", "skipped")]
|
|
1445
|
+
+ [("aborted", raw_stage, "blocked") for raw_stage in activity.RAW_TO_STAGE],
|
|
1446
|
+
)
|
|
1447
|
+
def test_completed_stage6_skipped_and_every_aborted_stage_replay(
|
|
1448
|
+
tmp_path: Path,
|
|
1449
|
+
capsys: pytest.CaptureFixture[str],
|
|
1450
|
+
pipeline_state: str,
|
|
1451
|
+
raw_stage: str,
|
|
1452
|
+
status: str,
|
|
1453
|
+
) -> None:
|
|
1454
|
+
safe_stage = raw_stage.replace(".", "_")
|
|
1455
|
+
root = tmp_path / "artifacts"
|
|
1456
|
+
run_id = f"run-{pipeline_state}-{safe_stage}"
|
|
1457
|
+
state = _terminal_state(
|
|
1458
|
+
root,
|
|
1459
|
+
run_id,
|
|
1460
|
+
pipeline_state=pipeline_state,
|
|
1461
|
+
current_stage=raw_stage,
|
|
1462
|
+
status=status,
|
|
1463
|
+
)
|
|
1464
|
+
manifest = _seal_and_build(capsys, root, state, _empty_rows())
|
|
1465
|
+
store = tmp_path / "activity.json"
|
|
1466
|
+
code, _stdout, stderr = _append(capsys, root, store, manifest)
|
|
1467
|
+
assert code == 0, stderr
|
|
1468
|
+
run = _load(store)["runs"][0]
|
|
1469
|
+
assert run["terminal_state"] == pipeline_state
|
|
1470
|
+
assert run["terminal_stage"] == activity.RAW_TO_STAGE[raw_stage]
|
|
1471
|
+
|
|
1472
|
+
|
|
1473
|
+
def test_delete_store_identity_swap_is_detected_before_unlink(
|
|
1474
|
+
tmp_path: Path,
|
|
1475
|
+
capsys: pytest.CaptureFixture[str],
|
|
1476
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
1477
|
+
) -> None:
|
|
1478
|
+
store = tmp_path / "activity.json"
|
|
1479
|
+
assert _call(
|
|
1480
|
+
capsys, "init-store", "--store", str(store), "--store-id", STORE_ID
|
|
1481
|
+
)[0] == 0
|
|
1482
|
+
original_hash = hashlib.sha256(store.read_bytes()).hexdigest()
|
|
1483
|
+
replacement = tmp_path / "replacement.json"
|
|
1484
|
+
replacement_bytes = b'{"replacement":true}\n'
|
|
1485
|
+
replacement.write_bytes(replacement_bytes)
|
|
1486
|
+
displaced = tmp_path / "displaced-original.json"
|
|
1487
|
+
original_assert = activity._assert_identity
|
|
1488
|
+
swapped = False
|
|
1489
|
+
|
|
1490
|
+
def swap_then_assert(path: Path, expected: tuple[int, int, int]) -> None:
|
|
1491
|
+
nonlocal swapped
|
|
1492
|
+
if not swapped:
|
|
1493
|
+
path.replace(displaced)
|
|
1494
|
+
replacement.replace(path)
|
|
1495
|
+
swapped = True
|
|
1496
|
+
original_assert(path, expected)
|
|
1497
|
+
|
|
1498
|
+
monkeypatch.setattr(activity, "_assert_identity", swap_then_assert)
|
|
1499
|
+
code, stdout, stderr = _call(
|
|
1500
|
+
capsys,
|
|
1501
|
+
"delete-store",
|
|
1502
|
+
"--store",
|
|
1503
|
+
str(store),
|
|
1504
|
+
"--store-id",
|
|
1505
|
+
STORE_ID,
|
|
1506
|
+
"--expect-store-sha256",
|
|
1507
|
+
original_hash,
|
|
1508
|
+
"--confirm",
|
|
1509
|
+
"DELETE-ADJUDICATION-ACTIVITY-STORE",
|
|
1510
|
+
)
|
|
1511
|
+
assert code == 5
|
|
1512
|
+
assert stdout == ""
|
|
1513
|
+
assert "ERROR:CONFLICT" in stderr
|
|
1514
|
+
assert store.read_bytes() == replacement_bytes
|
|
1515
|
+
assert displaced.exists()
|