mednotes-opencode 0.1.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/.opencode/agents/med-chat-triager.md +204 -0
- package/.opencode/agents/med-flashcard-maker.md +63 -0
- package/.opencode/agents/med-knowledge-architect.md +230 -0
- package/.opencode/agents/med-link-graph-curator.md +177 -0
- package/.opencode/agents/med-publish-guard.md +62 -0
- package/.opencode/commands/flashcards.md +25 -0
- package/.opencode/commands/mednotes/create.md +25 -0
- package/.opencode/commands/mednotes/enrich.md +27 -0
- package/.opencode/commands/mednotes/fix-wiki.md +27 -0
- package/.opencode/commands/mednotes/history.md +22 -0
- package/.opencode/commands/mednotes/link-body.md +25 -0
- package/.opencode/commands/mednotes/link-related.md +27 -0
- package/.opencode/commands/mednotes/link.md +27 -0
- package/.opencode/commands/mednotes/pdf-library.md +27 -0
- package/.opencode/commands/mednotes/process-chats.md +23 -0
- package/.opencode/commands/mednotes/setup.md +21 -0
- package/.opencode/commands/mednotes/status.md +27 -0
- package/.opencode/commands/mednotes/telemetry.md +27 -0
- package/.opencode/commands/report.md +26 -0
- package/.opencode/mednotes/AGENTS.md +57 -0
- package/.opencode/mednotes/agents/med-chat-triager.md +197 -0
- package/.opencode/mednotes/agents/med-flashcard-maker.md +56 -0
- package/.opencode/mednotes/agents/med-knowledge-architect.md +224 -0
- package/.opencode/mednotes/agents/med-link-graph-curator.md +171 -0
- package/.opencode/mednotes/agents/med-publish-guard.md +55 -0
- package/.opencode/mednotes/contracts/.gitkeep +1 -0
- package/.opencode/mednotes/contracts/agents.json +116 -0
- package/.opencode/mednotes/contracts/opencode-plugin.json +70 -0
- package/.opencode/mednotes/docs/agent-prompt-hardening.md +567 -0
- package/.opencode/mednotes/docs/agent-role-contracts.md +94 -0
- package/.opencode/mednotes/docs/anki-mcp-twenty-rules.md +214 -0
- package/.opencode/mednotes/docs/anki-templates/README.md +39 -0
- package/.opencode/mednotes/docs/anki-templates/cloze.back.html +23 -0
- package/.opencode/mednotes/docs/anki-templates/cloze.front.html +14 -0
- package/.opencode/mednotes/docs/anki-templates/qa.back.html +24 -0
- package/.opencode/mednotes/docs/anki-templates/qa.front.html +14 -0
- package/.opencode/mednotes/docs/anki-templates/style.css +182 -0
- package/.opencode/mednotes/docs/atomicity-splitting-policy.md +113 -0
- package/.opencode/mednotes/docs/extension-docs.md +40 -0
- package/.opencode/mednotes/docs/flashcard-ingestion.md +278 -0
- package/.opencode/mednotes/docs/knowledge-architect.md +208 -0
- package/.opencode/mednotes/docs/merge-policy.md +110 -0
- package/.opencode/mednotes/docs/public-vocabulary.md +104 -0
- package/.opencode/mednotes/docs/semantic-linker.md +141 -0
- package/.opencode/mednotes/docs/taxonomy-policy.md +90 -0
- package/.opencode/mednotes/docs/triage-policy.md +187 -0
- package/.opencode/mednotes/docs/vault-version-control.md +758 -0
- package/.opencode/mednotes/docs/vocabulary-db-recovery.md +58 -0
- package/.opencode/mednotes/docs/workflow-output-contract.md +779 -0
- package/.opencode/mednotes/hooks/hooks.json +79 -0
- package/.opencode/mednotes/package-lock.json +6361 -0
- package/.opencode/mednotes/package.json +15 -0
- package/.opencode/mednotes/pyproject.toml +48 -0
- package/.opencode/mednotes/scripts/bootstrap_windows_python_uv.cmd +13 -0
- package/.opencode/mednotes/scripts/bootstrap_windows_python_uv.ps1 +172 -0
- package/.opencode/mednotes/scripts/enrich_notes.py +23 -0
- package/.opencode/mednotes/scripts/full_reset_windows_python_uv.cmd +13 -0
- package/.opencode/mednotes/scripts/hooks/antigravity_hook_status.mjs +212 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/adapters/antigravity.mjs +169 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/adapters/harness_payload.mjs +103 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/adapters/opencode_plugin.mjs +341 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/adapters/opencode_user_config_sync.mjs +177 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/anki_preflight.mjs +214 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/cli.mjs +143 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/diagnostics.mjs +11 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/domain/agent_directive_core.mjs +160 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/fsm_directive.mjs +1470 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/hook_errors.mjs +120 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/retention.mjs +114 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/runtime.mjs +174 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/telemetry_capture.mjs +511 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/vault_guard.mjs +624 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook.mjs +5 -0
- package/.opencode/mednotes/scripts/mednotes/_runtime_paths.py +24 -0
- package/.opencode/mednotes/scripts/mednotes/anki_model_validator.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/capture_extension_diff.py +1562 -0
- package/.opencode/mednotes/scripts/mednotes/feedback_report.py +16 -0
- package/.opencode/mednotes/scripts/mednotes/flashcard_index.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/flashcard_pipeline.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/flashcard_report.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/flashcard_sources.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/obsidian/README.md +6 -0
- package/.opencode/mednotes/scripts/mednotes/obsidian_note_utils.py +20 -0
- package/.opencode/mednotes/scripts/mednotes/pdf_library/cli.py +16 -0
- package/.opencode/mednotes/scripts/mednotes/project_fsm.py +229 -0
- package/.opencode/mednotes/scripts/mednotes/setup_telemetry_email.py +404 -0
- package/.opencode/mednotes/scripts/mednotes/sync_anki_twenty_rules.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/sync_opencode_user_config.py +36 -0
- package/.opencode/mednotes/scripts/mednotes/wiki/cli.py +20 -0
- package/.opencode/mednotes/scripts/mednotes/wiki_graph.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/wiki_tree.py +134 -0
- package/.opencode/mednotes/scripts/reset_windows_python_uv.ps1 +625 -0
- package/.opencode/mednotes/scripts/run_python.mjs +109 -0
- package/.opencode/mednotes/scripts/vault/vault_commit.ps1 +19 -0
- package/.opencode/mednotes/scripts/vault/vault_commit.sh +18 -0
- package/.opencode/mednotes/scripts/vault/vault_git.ps1 +19 -0
- package/.opencode/mednotes/scripts/vault/vault_git.py +3107 -0
- package/.opencode/mednotes/scripts/vault/vault_git.sh +18 -0
- package/.opencode/mednotes/scripts/vault/vault_precommit.ps1 +19 -0
- package/.opencode/mednotes/scripts/vault/vault_precommit.sh +18 -0
- package/.opencode/mednotes/skills/THIRD_PARTY_NOTICES.md +45 -0
- package/.opencode/mednotes/skills/create-medical-flashcards/SKILL.md +113 -0
- package/.opencode/mednotes/skills/create-medical-note/SKILL.md +90 -0
- package/.opencode/mednotes/skills/enrich-medical-note/SKILL.md +120 -0
- package/.opencode/mednotes/skills/fix-medical-wiki/SKILL.md +559 -0
- package/.opencode/mednotes/skills/link-medical-wiki/SKILL.md +224 -0
- package/.opencode/mednotes/skills/obsidian-cli/SKILL.md +118 -0
- package/.opencode/mednotes/skills/obsidian-markdown/SKILL.md +207 -0
- package/.opencode/mednotes/skills/obsidian-markdown/references/CALLOUTS.md +58 -0
- package/.opencode/mednotes/skills/obsidian-markdown/references/EMBEDS.md +63 -0
- package/.opencode/mednotes/skills/obsidian-markdown/references/PROPERTIES.md +61 -0
- package/.opencode/mednotes/skills/obsidian-ops/SKILL.md +136 -0
- package/.opencode/mednotes/skills/pdf-library/SKILL.md +45 -0
- package/.opencode/mednotes/skills/process-medical-chats/SKILL.md +246 -0
- package/.opencode/mednotes/skills/workflow-report/SKILL.md +100 -0
- package/.opencode/mednotes/src/mednotes/__init__.py +5 -0
- package/.opencode/mednotes/src/mednotes/domains/__init__.py +5 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/README.md +26 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/__init__.py +2 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/build_demo_apkg.py +177 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/contracts.py +385 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/flashcards_machine.py +522 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/fsm.py +817 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/index.py +630 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/install_models.py +445 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/model.py +359 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/obsidian_links.py +135 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/obsidian_note_utils.py +546 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/pipeline.py +580 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/report.py +510 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/sources.py +682 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/sync_rules.py +184 -0
- package/.opencode/mednotes/src/mednotes/domains/history/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/history/history_fsm.py +852 -0
- package/.opencode/mednotes/src/mednotes/domains/history/history_machine.py +453 -0
- package/.opencode/mednotes/src/mednotes/domains/setup/__init__.py +7 -0
- package/.opencode/mednotes/src/mednotes/domains/setup/setup_fsm.py +808 -0
- package/.opencode/mednotes/src/mednotes/domains/setup/setup_machine.py +973 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/README.md +64 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/api.py +668 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/batch_state.py +102 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/atomicity/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/atomicity/atomicity.py +877 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/body_link/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/body_link/body_linker.py +1562 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/effects/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/effects/effect_adapters.py +949 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/effects/fix_wiki_runtime_adapters.py +433 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/graph/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/graph/coverage.py +413 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/graph/graph.py +396 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/graph/graph_fixes.py +161 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/hygiene/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/hygiene/hygiene.py +483 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/__init__.py +2 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/anchors.py +185 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/__init__.py +0 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/cache.py +223 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/config.py +131 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/download.py +224 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/frontmatter.py +59 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/insert.py +227 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/local_import.py +54 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/sources/__init__.py +42 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/sources/web_profiles.py +99 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/sources/web_search.py +203 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/sources/wikimedia.py +102 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/markdown/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/markdown/markdown_db_adapter.mjs +434 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/markdown/markdown_node_runtime.py +274 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/markdown/markdown_query.py +227 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/artifacts.py +605 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/canonical_merge.py +277 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/markdown_zones.py +85 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/meaning_planner.py +307 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_iter.py +67 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_merge.py +278 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_plan.py +409 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_policy.py +22 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/__init__.py +79 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/fixes.py +264 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/frontmatter.py +435 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/models.py +208 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/prompts.py +37 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/tables.py +236 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/validate.py +404 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/provenance.py +478 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/raw_chats.py +273 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/sources_backfill.py +235 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/__init__.py +10 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/anchors.py +16 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/captions.py +47 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/cli.py +179 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/cloud.py +52 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/config.py +196 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/context_packets.py +76 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/db.py +81 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/doctor.py +102 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/figure_ids.py +42 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/ingest.py +326 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/insert.py +316 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/mentions.py +57 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/ocr.py +71 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/paths.py +35 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/pdf_engine.py +77 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/schema.py +155 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/search.py +188 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/tui/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/tui/app.py +89 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/tui/image_backend.py +29 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/tui/state.py +65 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/publish/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/publish/publish.py +1139 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/publish/publish_receipts.py +365 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/publish/publish_recovery.py +240 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/agent_behavior_corpus.py +2069 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/agent_report_validation.py +4448 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/agent_run_audit.py +852 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/architect_prompt_eval.py +341 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/body_linker_eval.py +240 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/curator_output_validation.py +175 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/curator_prompt_eval.py +865 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/triager_prompt_eval.py +1295 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/related_notes/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/related_notes/related_notes.py +1920 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/related_notes/related_notes_headless.py +1186 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/plan_attestation.py +148 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/specialist_receipts.py +360 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/specialist_runtime.py +52 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/specialist_task_runner.py +2470 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/style/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/style/style.py +1952 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/subagents/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/subagents/agents.py +1767 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/alias_projection.py +331 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/link_terms.py +151 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/llm_disambiguation.py +182 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/__init__.py +116 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/audit.py +201 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/migration.py +314 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/normalize.py +72 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/policy.py +135 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/resolve.py +413 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/schema.py +157 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/status.py +137 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_bootstrap.py +509 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_curator_batch.py +1115 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_ingestion.py +632 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_map.py +930 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_recovery.py +1388 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/cli.py +6665 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/common.py +69 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/config.py +210 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/__init__.py +74 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/agent_report.py +242 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/agent_run_audit.py +196 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/agents.py +601 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/curator.py +256 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/effect_payloads.py +519 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/happy_path.py +190 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/link_git.py +110 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/link_runtime_artifact.py +52 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/note_plan.py +75 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/paths.py +114 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/public_report.py +53 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/publish.py +111 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/raw_coverage.py +217 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/related_notes.py +136 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/related_notes_headless.py +153 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/related_notes_runtime.py +395 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/schema_registry.py +637 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/specialist.py +432 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/status.py +62 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/style_rewrite.py +568 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/vocabulary_ingestion.py +223 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/workflow_blockers.py +510 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/workflow_guardrails.py +637 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/workflow_outcomes.py +121 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/workflow_receipts.py +100 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/__main__.py +4 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/cli.py +275 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/__init__.py +2 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/candidates.py +193 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/cli.py +189 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/gemini.py +220 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/inputs.py +120 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/models.py +34 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/parsing.py +48 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/prompts.py +216 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/quality.py +54 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/reporting.py +24 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/runner.py +433 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/utils.py +39 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/vault_guard_bridge.py +17 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_context_packets.py +454 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_decision_projection.py +133 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_effects.py +1260 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_fsm.py +2768 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_machine.py +1588 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_plan.py +306 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_primary_objective.py +316 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_problem.py +153 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_receipt_evidence.py +306 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_states.py +290 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_user_report.py +342 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/health.py +6332 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_fsm.py +1119 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_git.py +638 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_machine.py +1106 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_retry_governance.py +374 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_runtime_result.py +485 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_triggers.py +183 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/linking.py +2758 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/reference_repair.py +718 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/related_notes_fsm.py +1855 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link_related/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link_related/link_related_machine.py +834 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/process_chats_fsm.py +1592 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/process_chats_machine.py +3097 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/process_chats_primary_objective.py +28 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/process_chats_runtime_result.py +185 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/performance.py +97 -0
- package/.opencode/mednotes/src/mednotes/kernel/__init__.py +6 -0
- package/.opencode/mednotes/src/mednotes/kernel/agent_directive.py +336 -0
- package/.opencode/mednotes/src/mednotes/kernel/base.py +51 -0
- package/.opencode/mednotes/src/mednotes/kernel/blockers.py +39 -0
- package/.opencode/mednotes/src/mednotes/kernel/effect_executor.py +55 -0
- package/.opencode/mednotes/src/mednotes/kernel/effect_intent.py +69 -0
- package/.opencode/mednotes/src/mednotes/kernel/effects.py +160 -0
- package/.opencode/mednotes/src/mednotes/kernel/errors.py +38 -0
- package/.opencode/mednotes/src/mednotes/kernel/fsm_event.py +35 -0
- package/.opencode/mednotes/src/mednotes/kernel/fsm_model.py +55 -0
- package/.opencode/mednotes/src/mednotes/kernel/fsm_transition_result.py +75 -0
- package/.opencode/mednotes/src/mednotes/kernel/guardrails.py +188 -0
- package/.opencode/mednotes/src/mednotes/kernel/progress.py +319 -0
- package/.opencode/mednotes/src/mednotes/kernel/public_report.py +346 -0
- package/.opencode/mednotes/src/mednotes/kernel/state_machine.py +164 -0
- package/.opencode/mednotes/src/mednotes/kernel/workflow.py +619 -0
- package/.opencode/mednotes/src/mednotes/platform/__init__.py +5 -0
- package/.opencode/mednotes/src/mednotes/platform/backup_policy.py +382 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/__init__.py +62 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/cli.py +275 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/contracts.py +83 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/core.py +4168 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/integrity.py +989 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/operational_contract.py +2293 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/telemetry.py +875 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/telemetry_config.py +65 -0
- package/.opencode/mednotes/src/mednotes/platform/opencode_runtime_config.py +182 -0
- package/.opencode/mednotes/src/mednotes/platform/paths/__init__.py +1560 -0
- package/.opencode/mednotes/src/mednotes/platform/secrets.py +89 -0
- package/.opencode/mednotes/src/mednotes/platform/user_config.py +103 -0
- package/.opencode/mednotes/src/mednotes/platform/vault_guard.py +214 -0
- package/.opencode/mednotes/uv.lock +932 -0
- package/.opencode/mednotes.generated.json +395 -0
- package/.opencode/opencode.json +31 -0
- package/.opencode/plugins/mednotes-fsm.mjs +7 -0
- package/.opencode/plugins/mednotes_hook/adapters/antigravity.mjs +169 -0
- package/.opencode/plugins/mednotes_hook/adapters/harness_payload.mjs +103 -0
- package/.opencode/plugins/mednotes_hook/adapters/opencode_plugin.mjs +341 -0
- package/.opencode/plugins/mednotes_hook/adapters/opencode_user_config_sync.mjs +177 -0
- package/.opencode/plugins/mednotes_hook/anki_preflight.mjs +214 -0
- package/.opencode/plugins/mednotes_hook/cli.mjs +143 -0
- package/.opencode/plugins/mednotes_hook/diagnostics.mjs +11 -0
- package/.opencode/plugins/mednotes_hook/domain/agent_directive_core.mjs +160 -0
- package/.opencode/plugins/mednotes_hook/fsm_directive.mjs +1470 -0
- package/.opencode/plugins/mednotes_hook/hook_errors.mjs +120 -0
- package/.opencode/plugins/mednotes_hook/retention.mjs +114 -0
- package/.opencode/plugins/mednotes_hook/runtime.mjs +174 -0
- package/.opencode/plugins/mednotes_hook/telemetry_capture.mjs +511 -0
- package/.opencode/plugins/mednotes_hook/vault_guard.mjs +624 -0
- package/AGENTS.md +57 -0
- package/README.md +194 -0
- package/adapters/antigravity/agents.json +80 -0
- package/adapters/antigravity/templates/med-chat-triager.md +214 -0
- package/adapters/antigravity/templates/med-flashcard-maker.md +72 -0
- package/adapters/antigravity/templates/med-knowledge-architect.md +241 -0
- package/adapters/antigravity/templates/med-link-graph-curator.md +187 -0
- package/adapters/antigravity/templates/med-publish-guard.md +71 -0
- package/adapters/gemini-cli/gemini-extension.json +14 -0
- package/adapters/gemini-cli/package.json +15 -0
- package/adapters/gemini-cli/pyproject.toml +48 -0
- package/bin/mednotes-opencode.mjs +155 -0
- package/contracts/agents.json +116 -0
- package/core/agents/med-chat-triager.md +197 -0
- package/core/agents/med-flashcard-maker.md +56 -0
- package/core/agents/med-knowledge-architect.md +224 -0
- package/core/agents/med-link-graph-curator.md +171 -0
- package/core/agents/med-publish-guard.md +55 -0
- package/core/commands/flashcards.toml +22 -0
- package/core/commands/mednotes/create.toml +22 -0
- package/core/commands/mednotes/enrich.toml +24 -0
- package/core/commands/mednotes/fix-wiki.toml +24 -0
- package/core/commands/mednotes/history.toml +19 -0
- package/core/commands/mednotes/link-body.toml +22 -0
- package/core/commands/mednotes/link-related.toml +24 -0
- package/core/commands/mednotes/link.toml +24 -0
- package/core/commands/mednotes/pdf-library.toml +24 -0
- package/core/commands/mednotes/process-chats.toml +20 -0
- package/core/commands/mednotes/setup.toml +18 -0
- package/core/commands/mednotes/status.toml +24 -0
- package/core/commands/mednotes/telemetry.toml +24 -0
- package/core/commands/report.toml +23 -0
- package/core/skills/THIRD_PARTY_NOTICES.md +45 -0
- package/core/skills/create-medical-flashcards/SKILL.md +113 -0
- package/core/skills/create-medical-note/SKILL.md +90 -0
- package/core/skills/enrich-medical-note/SKILL.md +120 -0
- package/core/skills/fix-medical-wiki/SKILL.md +559 -0
- package/core/skills/link-medical-wiki/SKILL.md +224 -0
- package/core/skills/obsidian-cli/SKILL.md +118 -0
- package/core/skills/obsidian-markdown/SKILL.md +207 -0
- package/core/skills/obsidian-markdown/references/CALLOUTS.md +58 -0
- package/core/skills/obsidian-markdown/references/EMBEDS.md +63 -0
- package/core/skills/obsidian-markdown/references/PROPERTIES.md +61 -0
- package/core/skills/obsidian-ops/SKILL.md +136 -0
- package/core/skills/pdf-library/SKILL.md +45 -0
- package/core/skills/process-medical-chats/SKILL.md +246 -0
- package/core/skills/workflow-report/SKILL.md +100 -0
- package/package.json +45 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
"""Registry for workflow blocker decisions."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from mednotes.domains.wiki.contracts.workflow_outcomes import DecisionEvidence, DecisionKind, WorkflowDecision
|
|
5
|
+
from mednotes.kernel.blockers import BlockerEntryModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BlockerRegistryError(KeyError):
|
|
9
|
+
"""Raised when workflow code emits an unregistered blocker."""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
BlockerEntry = BlockerEntryModel
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _entry(
|
|
16
|
+
code: str,
|
|
17
|
+
*,
|
|
18
|
+
owner_phase: str,
|
|
19
|
+
decision: DecisionKind,
|
|
20
|
+
safe: bool,
|
|
21
|
+
human_packet: bool = False,
|
|
22
|
+
public_label: str,
|
|
23
|
+
public_explanation: str,
|
|
24
|
+
developer_explanation: str,
|
|
25
|
+
test_fixture: str,
|
|
26
|
+
) -> BlockerEntry:
|
|
27
|
+
return BlockerEntryModel(
|
|
28
|
+
code=code,
|
|
29
|
+
owner_phase=owner_phase,
|
|
30
|
+
default_decision=decision,
|
|
31
|
+
safe_to_continue_batch=safe,
|
|
32
|
+
requires_human_packet=human_packet,
|
|
33
|
+
public_label=public_label,
|
|
34
|
+
public_explanation=public_explanation,
|
|
35
|
+
developer_explanation=developer_explanation,
|
|
36
|
+
test_fixture=test_fixture,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _entries(
|
|
41
|
+
codes: list[str],
|
|
42
|
+
*,
|
|
43
|
+
owner_phase: str,
|
|
44
|
+
decision: DecisionKind,
|
|
45
|
+
safe: bool,
|
|
46
|
+
human_packet: bool = False,
|
|
47
|
+
public_label: str,
|
|
48
|
+
public_explanation: str,
|
|
49
|
+
developer_explanation: str,
|
|
50
|
+
test_fixture: str,
|
|
51
|
+
) -> dict[str, BlockerEntry]:
|
|
52
|
+
return {
|
|
53
|
+
code: _entry(
|
|
54
|
+
code,
|
|
55
|
+
owner_phase=owner_phase,
|
|
56
|
+
decision=decision,
|
|
57
|
+
safe=safe,
|
|
58
|
+
human_packet=human_packet,
|
|
59
|
+
public_label=public_label,
|
|
60
|
+
public_explanation=public_explanation,
|
|
61
|
+
developer_explanation=developer_explanation,
|
|
62
|
+
test_fixture=test_fixture,
|
|
63
|
+
)
|
|
64
|
+
for code in codes
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
BLOCKER_REGISTRY: dict[str, BlockerEntry] = {}
|
|
69
|
+
|
|
70
|
+
BLOCKER_REGISTRY.update(
|
|
71
|
+
_entries(
|
|
72
|
+
[
|
|
73
|
+
"canonical_merge_required",
|
|
74
|
+
"human_decision_required",
|
|
75
|
+
"human_decision_required.ambiguous_canonical_target",
|
|
76
|
+
"image_metadata_conflict",
|
|
77
|
+
"taxonomy_resolution_required",
|
|
78
|
+
],
|
|
79
|
+
owner_phase="human_decision",
|
|
80
|
+
decision="ask_human",
|
|
81
|
+
safe=False,
|
|
82
|
+
human_packet=True,
|
|
83
|
+
public_label="Decisao humana necessaria",
|
|
84
|
+
public_explanation="A escolha altera organizacao editorial ou evidencia e precisa de contexto humano.",
|
|
85
|
+
developer_explanation="Human route allowed only with typed human_decision_packet and rejected automation evidence.",
|
|
86
|
+
test_fixture="tests/test_workflow_outcomes.py",
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
BLOCKER_REGISTRY.update(
|
|
91
|
+
_entries(
|
|
92
|
+
[
|
|
93
|
+
"anki_model_validation_failed",
|
|
94
|
+
"config_encoding_invalid",
|
|
95
|
+
"flashcards_prepare_blocked",
|
|
96
|
+
"flashcards_source_stale",
|
|
97
|
+
"invalid_flashcard_candidate_batch",
|
|
98
|
+
"invalid_obsidian_deeplink",
|
|
99
|
+
"markdown_index_missing",
|
|
100
|
+
"markdown_index_stale",
|
|
101
|
+
"markdown_runtime_missing",
|
|
102
|
+
"markdown_runtime_stale",
|
|
103
|
+
"node_runtime_missing",
|
|
104
|
+
"node_runtime_stale",
|
|
105
|
+
"restore_conflict",
|
|
106
|
+
"stale_restore_point",
|
|
107
|
+
"alias_projection.stale_note_hash",
|
|
108
|
+
"alias_projection.blocked_operations",
|
|
109
|
+
"alias_projection.invalid_plan_schema",
|
|
110
|
+
"alias_projection_blocked",
|
|
111
|
+
"agent_behavior_report_would_overwrite_baseline",
|
|
112
|
+
"agent_final_report_contract_violation",
|
|
113
|
+
"atomicity_split_required",
|
|
114
|
+
"apply_curator_batch_validation_error",
|
|
115
|
+
"batch_state_mismatch",
|
|
116
|
+
"coverage_invalid",
|
|
117
|
+
"coverage_path_missing",
|
|
118
|
+
"contextual_alias_disambiguation_failed",
|
|
119
|
+
"curator_output_hash_mismatch",
|
|
120
|
+
"curator_output_manifest.missing_sha256",
|
|
121
|
+
"curator_prompt_eval.blocked",
|
|
122
|
+
"curator_prompt_eval.inconsistent_report",
|
|
123
|
+
"curator_prompt_eval.invalid_status",
|
|
124
|
+
"curator_prompt_eval.needs_review",
|
|
125
|
+
"curator_prompt_eval_options_conflict",
|
|
126
|
+
"curator_prompt_eval_required",
|
|
127
|
+
"curator_prompt_eval_skip_not_allowed",
|
|
128
|
+
"deferred_work_item_blocked",
|
|
129
|
+
"deferred_work_item_not_pending",
|
|
130
|
+
"deferred_work_item_read_failed",
|
|
131
|
+
"deferred_work_item_source_mismatch",
|
|
132
|
+
"deferred_work_item_stale",
|
|
133
|
+
"deferred_work_item_update_failed",
|
|
134
|
+
"deferred_work_item_update_missed",
|
|
135
|
+
"diagnosis_blocked",
|
|
136
|
+
"diagnosis_blocked_after_vocabulary_repair",
|
|
137
|
+
"destination_exists",
|
|
138
|
+
"destination_inside_source",
|
|
139
|
+
"diagnosis_required",
|
|
140
|
+
"dry_run_receipt_required",
|
|
141
|
+
"dry_run_receipt_invalid",
|
|
142
|
+
"new_taxonomy_leaf_requires_dry_run_authorization",
|
|
143
|
+
"duplicate_obsidian_target",
|
|
144
|
+
"duplicate_target",
|
|
145
|
+
"duplicate_destination",
|
|
146
|
+
"fix_wiki_failed",
|
|
147
|
+
"graph_blockers",
|
|
148
|
+
"hygiene_errors",
|
|
149
|
+
"link_plan_blocked",
|
|
150
|
+
"linker_blocked",
|
|
151
|
+
"manifest_mismatch",
|
|
152
|
+
"manifest_invalid",
|
|
153
|
+
"meaning_claim_invalid",
|
|
154
|
+
"markdown_query_index_unavailable",
|
|
155
|
+
"missing_or_invalid_artifact_manifest",
|
|
156
|
+
"missing_or_invalid_note_plan",
|
|
157
|
+
"note_plan_invalid",
|
|
158
|
+
"note_plan_v2_required",
|
|
159
|
+
"orchestrator_required",
|
|
160
|
+
"preconditions_failed",
|
|
161
|
+
"process_chats_linker_blocked",
|
|
162
|
+
"provenance_gap",
|
|
163
|
+
"publish_receipt_invalid",
|
|
164
|
+
"publish_state_blocked",
|
|
165
|
+
"reference_repair_required",
|
|
166
|
+
"related_notes",
|
|
167
|
+
"related_notes_blocked",
|
|
168
|
+
"related_notes_edge_invalid",
|
|
169
|
+
"related_notes_edges_invalid",
|
|
170
|
+
"related_notes_export_contract_invalid",
|
|
171
|
+
"related_notes_export_invalid",
|
|
172
|
+
"related_notes_export_invalid_json",
|
|
173
|
+
"related_notes_export_missing",
|
|
174
|
+
"related_notes_export_schema_invalid",
|
|
175
|
+
"related_notes_export_still_stale",
|
|
176
|
+
"related_notes_export_stale",
|
|
177
|
+
"related_notes_hash_migration_write_failed",
|
|
178
|
+
"related_notes_hash_mismatch",
|
|
179
|
+
"related_notes_note_path_invalid",
|
|
180
|
+
"related_notes_notes_invalid",
|
|
181
|
+
"related_notes_recovery_not_applicable",
|
|
182
|
+
"related_notes_recovery_blocked",
|
|
183
|
+
"related_notes_revalidation_failed",
|
|
184
|
+
"related_notes_vault_mismatch",
|
|
185
|
+
"requires_llm_rewrite",
|
|
186
|
+
"root_note",
|
|
187
|
+
"retry_requested",
|
|
188
|
+
"semantic_ingestion.atomicity_signal_required",
|
|
189
|
+
"semantic_ingestion.integrity_conflict",
|
|
190
|
+
"semantic_ingestion.invalid_atomic_status",
|
|
191
|
+
"semantic_ingestion.meaning_canonical_conflict",
|
|
192
|
+
"semantic_ingestion.meaning_note_conflict",
|
|
193
|
+
"semantic_ingestion.stale_note_hash",
|
|
194
|
+
"semantic_ingestion.validation_error",
|
|
195
|
+
"source_missing",
|
|
196
|
+
"source_not_directory",
|
|
197
|
+
"stale_diagnosis",
|
|
198
|
+
"stale_receipt",
|
|
199
|
+
"stale_fix_wiki_plan",
|
|
200
|
+
"style_rewrite_required",
|
|
201
|
+
"taxonomy_action_required",
|
|
202
|
+
"taxonomy_blocked",
|
|
203
|
+
"taxonomy_plan_blocked",
|
|
204
|
+
"triager_eval_failed",
|
|
205
|
+
"triager_eval_invalid",
|
|
206
|
+
"triager_eval_required",
|
|
207
|
+
"triager_eval_stale",
|
|
208
|
+
"unmapped_top_level_dir",
|
|
209
|
+
"validation_errors",
|
|
210
|
+
"validation_failed",
|
|
211
|
+
"vocabulary_bootstrap_required",
|
|
212
|
+
"vocabulary_db_missing",
|
|
213
|
+
"vocabulary_map.unresolved_surfaces_without_meanings",
|
|
214
|
+
"vocabulary_map_blocked",
|
|
215
|
+
"vocabulary_queue_inconsistent",
|
|
216
|
+
"vocabulary_recovery_backup_exists",
|
|
217
|
+
"vocabulary_recovery_plan_blocked",
|
|
218
|
+
"vocabulary_recovery_plan_required",
|
|
219
|
+
"vocabulary_recovery_plan_stale",
|
|
220
|
+
"vocabulary_recovery_receipt_required",
|
|
221
|
+
"vocabulary_recovery_receipt_unwritable",
|
|
222
|
+
"vocabulary_semantic_ingestion_pending",
|
|
223
|
+
"vocabulary_semantic_ingestion_stale",
|
|
224
|
+
"vocabulary_semantic_repair_blocked",
|
|
225
|
+
"vocabulary_schema_drift",
|
|
226
|
+
"write_errors",
|
|
227
|
+
],
|
|
228
|
+
owner_phase="workflow_recovery",
|
|
229
|
+
decision="auto_plan",
|
|
230
|
+
safe=True,
|
|
231
|
+
public_label="Recuperacao automatica planejavel",
|
|
232
|
+
public_explanation="O workflow deve regenerar, reconciliar ou validar artefatos antes de continuar.",
|
|
233
|
+
developer_explanation="Recoverable blocker: route to the official plan/diagnosis/recovery step, not ask_human.",
|
|
234
|
+
test_fixture="tests/test_workflow_blocker_scanner.py",
|
|
235
|
+
)
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
BLOCKER_REGISTRY.update(
|
|
239
|
+
_entries(
|
|
240
|
+
[
|
|
241
|
+
"provenance.legacy_chat_original_footer",
|
|
242
|
+
"provenance.sources_section_missing",
|
|
243
|
+
],
|
|
244
|
+
owner_phase="provenance_backfill",
|
|
245
|
+
decision="auto_fix",
|
|
246
|
+
safe=True,
|
|
247
|
+
public_label="Correcao automatica de proveniencia",
|
|
248
|
+
public_explanation="A nota tem proveniencia recuperavel e o workflow pode normalizar a estrutura.",
|
|
249
|
+
developer_explanation="Recoverable provenance shape: route through sources backfill/fix-wiki before continuing.",
|
|
250
|
+
test_fixture="tests/test_wiki_provenance_style.py",
|
|
251
|
+
)
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
BLOCKER_REGISTRY.update(
|
|
255
|
+
_entries(
|
|
256
|
+
[
|
|
257
|
+
"no_delta_to_merge",
|
|
258
|
+
"related_notes_export_only_unsafe_for_changed_notes",
|
|
259
|
+
"vocabulary_bootstrap_preview",
|
|
260
|
+
"vocabulary_map.direct_policy_on_ambiguous_surface",
|
|
261
|
+
],
|
|
262
|
+
owner_phase="workflow_deferral",
|
|
263
|
+
decision="auto_defer",
|
|
264
|
+
safe=True,
|
|
265
|
+
public_label="Adiamento automatico seguro",
|
|
266
|
+
public_explanation="O workflow pode continuar de forma conservadora sem pedir escolha manual.",
|
|
267
|
+
developer_explanation="Conservative skip/defer route is safer than ask_human for this blocker.",
|
|
268
|
+
test_fixture="tests/test_workflow_blockers.py",
|
|
269
|
+
)
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
BLOCKER_REGISTRY.update(
|
|
273
|
+
_entries(
|
|
274
|
+
[
|
|
275
|
+
"apply_plan_already_exists",
|
|
276
|
+
"blocked_branch_confirmation_required",
|
|
277
|
+
"branch_confirmation_required",
|
|
278
|
+
"flashcards_preview_confirmation_required",
|
|
279
|
+
"github_cli_missing",
|
|
280
|
+
"github_login_required",
|
|
281
|
+
"github_remote_ambiguous",
|
|
282
|
+
"github_remote_confirmation_required",
|
|
283
|
+
"github_remote_missing",
|
|
284
|
+
"github_remote_pending",
|
|
285
|
+
"history_restore_confirmation_required",
|
|
286
|
+
"link_apply_confirmation_required",
|
|
287
|
+
"link_related_apply_confirmation_required",
|
|
288
|
+
"publish_confirmation_required",
|
|
289
|
+
"plan_already_exists",
|
|
290
|
+
"preview_ready_for_human_choice",
|
|
291
|
+
"restore_mutates_resources",
|
|
292
|
+
"restore_preview_already_exists",
|
|
293
|
+
"restore_preview_requires_choice",
|
|
294
|
+
"vault_mutation_requires_confirmation",
|
|
295
|
+
"writes_anki_and_vault_tag",
|
|
296
|
+
"blocks_fix_wiki",
|
|
297
|
+
"blocks_reference_repair",
|
|
298
|
+
"no_unambiguous_target",
|
|
299
|
+
"non_main_branch",
|
|
300
|
+
"plan_needs_choice",
|
|
301
|
+
"plan_needs_target",
|
|
302
|
+
"unsafe_choice",
|
|
303
|
+
"unsafe_editorial_choice",
|
|
304
|
+
],
|
|
305
|
+
owner_phase="public_workflow_human_decision",
|
|
306
|
+
decision="ask_human",
|
|
307
|
+
safe=False,
|
|
308
|
+
human_packet=True,
|
|
309
|
+
public_label="Confirmacao humana necessaria",
|
|
310
|
+
public_explanation="A proxima etapa altera vault, Anki, historico ou politica local e precisa de confirmacao fechada.",
|
|
311
|
+
developer_explanation="Public FSM route must expose a typed human_decision_packet/resume_action, not a textual blocker.",
|
|
312
|
+
test_fixture="tests/test_workflow_blocker_scanner.py",
|
|
313
|
+
)
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
BLOCKER_REGISTRY.update(
|
|
317
|
+
_entries(
|
|
318
|
+
[
|
|
319
|
+
"agent_session_transcript_unreadable",
|
|
320
|
+
"agent_tool_contract_violation",
|
|
321
|
+
"agy_runtime_log_unavailable",
|
|
322
|
+
"agy_specialist_invocation_evidence_missing",
|
|
323
|
+
"agy_specialist_model_evidence_mismatch",
|
|
324
|
+
"agy_specialist_model_evidence_missing",
|
|
325
|
+
"agy_transcript_evidence_missing",
|
|
326
|
+
"architect_coverage_invalid",
|
|
327
|
+
"architect_note_validation_failed",
|
|
328
|
+
"architect_output_contract_invalid",
|
|
329
|
+
"architect_output_missing",
|
|
330
|
+
"architect_output_plan_mismatch",
|
|
331
|
+
"architect_plan_contract_invalid",
|
|
332
|
+
"architect_raw_file_missing",
|
|
333
|
+
"architect_work_item_missing",
|
|
334
|
+
"blocked",
|
|
335
|
+
"chats.shape_invalid",
|
|
336
|
+
"contract_gap.missing_error_context",
|
|
337
|
+
"contract_gap.missing_next_action",
|
|
338
|
+
"curator_prompt_eval.dev_escape_disabled",
|
|
339
|
+
"curator_prompt_eval.dev_escape_ignored",
|
|
340
|
+
"environment_blocker.windows_path_or_venv",
|
|
341
|
+
"OSError",
|
|
342
|
+
"anki_unavailable",
|
|
343
|
+
"force_diagnose_requires_diagnose",
|
|
344
|
+
"history_blocked",
|
|
345
|
+
"history_failed",
|
|
346
|
+
"invalid_linker_deferral",
|
|
347
|
+
"link_artifact_contract_invalid",
|
|
348
|
+
"link_diagnosis_contract_invalid",
|
|
349
|
+
"linker_mode_required",
|
|
350
|
+
"llm_disambiguation_failed",
|
|
351
|
+
"llm_disambiguation_invalid_response",
|
|
352
|
+
"obsidian_cli_timeout",
|
|
353
|
+
"obsidian_cli_unavailable",
|
|
354
|
+
"obsidian_not_ready",
|
|
355
|
+
"opencode_specialist_model_evidence_missing",
|
|
356
|
+
"opencode_specialist_model_fallback_forbidden",
|
|
357
|
+
"opencode_specialist_raw_content_contract_violation",
|
|
358
|
+
"opencode_specialist_task_metadata_invalid",
|
|
359
|
+
"opencode_specialist_task_metadata_mismatch",
|
|
360
|
+
"opencode_specialist_task_metadata_missing",
|
|
361
|
+
"opencode_specialist_task_metadata_placeholder",
|
|
362
|
+
"paths_missing",
|
|
363
|
+
"process_chats_publish_quota",
|
|
364
|
+
"related_notes_export_command_missing",
|
|
365
|
+
"related_notes_export_contains_private_payload",
|
|
366
|
+
"related_notes_headless_api_key_missing",
|
|
367
|
+
"related_notes_headless_plugin_settings_invalid",
|
|
368
|
+
"related_notes_headless_plugin_settings_missing",
|
|
369
|
+
"related_notes_headless_quota_exhausted",
|
|
370
|
+
"related_notes_headless_time_budget_exhausted",
|
|
371
|
+
"related_notes_plugin_unavailable",
|
|
372
|
+
"related_notes_apply_blocked",
|
|
373
|
+
"related_notes_convergence_not_reached",
|
|
374
|
+
"related_notes_export_recovery_blocked",
|
|
375
|
+
"related_notes_export_recovery_contract_invalid",
|
|
376
|
+
"related_notes_preview_blocked",
|
|
377
|
+
"related_notes_reindex_command_missing",
|
|
378
|
+
"related_notes_reindex_failed",
|
|
379
|
+
"receipt_path_exists",
|
|
380
|
+
"subagent_plan_attestation_invalid",
|
|
381
|
+
"subagent_plan_attestation_required",
|
|
382
|
+
"subagent_output_contract.invalid",
|
|
383
|
+
"specialist_model_metadata_missing",
|
|
384
|
+
"specialist_model_unavailable",
|
|
385
|
+
"specialist_model_quota_exhausted",
|
|
386
|
+
"specialist_runner_command_failed",
|
|
387
|
+
"specialist_runner_harness_unsupported",
|
|
388
|
+
"specialist_runner_policy_config_invalid",
|
|
389
|
+
"specialist_runner_timeout",
|
|
390
|
+
"specialist_runner_untrusted_gemini_binary",
|
|
391
|
+
"specialist_workspace_cleanup_failed",
|
|
392
|
+
"specialist_model_metadata_missing_after_timeout_output",
|
|
393
|
+
"specialist_task_run_receipt_attestation_invalid",
|
|
394
|
+
"specialist_task_run_receipt_invalid",
|
|
395
|
+
"style_rewrite_agent_contract_violation",
|
|
396
|
+
"style_rewrite_manifest_invalid",
|
|
397
|
+
"style_rewrite_manifest_required",
|
|
398
|
+
"style_rewrite_output_attestation_hash_mismatch",
|
|
399
|
+
"style_rewrite_output_attestation_invalid",
|
|
400
|
+
"style_rewrite_output_attestation_required",
|
|
401
|
+
"style_rewrite_output_hash_mismatch",
|
|
402
|
+
"style_rewrite_output_missing",
|
|
403
|
+
"style_rewrite_output_receipt_hash_mismatch",
|
|
404
|
+
"style_rewrite_output_receipt_invalid",
|
|
405
|
+
"style_rewrite_output_receipt_required",
|
|
406
|
+
"style_rewrite_plan_contract_invalid",
|
|
407
|
+
"style_rewrite_plan_missing",
|
|
408
|
+
"style_rewrite_model_provenance_unverified",
|
|
409
|
+
"style_rewrite_specialist_model_required",
|
|
410
|
+
"style_rewrite_stale_target_hash",
|
|
411
|
+
"style_rewrite_still_requires_rewrite",
|
|
412
|
+
"style_rewrite_target_missing",
|
|
413
|
+
"trigger_context_apply_not_allowed",
|
|
414
|
+
"related_notes_quota_wait",
|
|
415
|
+
"unsupported_by_policy",
|
|
416
|
+
"unsupported_host_or_policy_gap",
|
|
417
|
+
"ValidationError",
|
|
418
|
+
"vault_guard_required",
|
|
419
|
+
"version_control_safety_evidence_missing",
|
|
420
|
+
"wait_external.publish_quota",
|
|
421
|
+
"wait_external.specialist_capacity",
|
|
422
|
+
"vocabulary_db_mismatch",
|
|
423
|
+
"vocabulary_db_unconfigured",
|
|
424
|
+
"vocabulary_schema_drift_unsupported",
|
|
425
|
+
"wiki_dir_missing",
|
|
426
|
+
"wiki_path_missing",
|
|
427
|
+
"workflow_blocked",
|
|
428
|
+
"workflow_effect_blocked",
|
|
429
|
+
"workflow_effect_failed",
|
|
430
|
+
],
|
|
431
|
+
owner_phase="operational_guardrail",
|
|
432
|
+
decision="hard_block",
|
|
433
|
+
safe=False,
|
|
434
|
+
public_label="Bloqueio operacional",
|
|
435
|
+
public_explanation="O workflow deve parar ate o pre-requisito operacional ficar seguro.",
|
|
436
|
+
developer_explanation="External, security, environment, or contract blocker; do not ask_human as a fallback.",
|
|
437
|
+
test_fixture="tests/test_workflow_guardrails_contract.py",
|
|
438
|
+
)
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
BLOCKER_REGISTRY.update(
|
|
442
|
+
_entries(
|
|
443
|
+
[
|
|
444
|
+
"failed",
|
|
445
|
+
"flashcards_apply_failed",
|
|
446
|
+
"flashcards_prepare_failed",
|
|
447
|
+
"io_error_rollback_performed",
|
|
448
|
+
"linker_error",
|
|
449
|
+
"related_notes_headless_embedding_failed",
|
|
450
|
+
"vocabulary_recovery_receipt_finalization_failed",
|
|
451
|
+
"vocabulary_sqlite_integrity_error",
|
|
452
|
+
],
|
|
453
|
+
owner_phase="workflow_failure",
|
|
454
|
+
decision="failed",
|
|
455
|
+
safe=False,
|
|
456
|
+
public_label="Falha operacional",
|
|
457
|
+
public_explanation="O workflow falhou depois de uma tentativa operacional e precisa de inspecao ou retry seguro.",
|
|
458
|
+
developer_explanation="Failure route: report failure context and avoid converting IO/integrity failures into ask_human.",
|
|
459
|
+
test_fixture="tests/test_med_chat_processor.py",
|
|
460
|
+
)
|
|
461
|
+
)
|
|
462
|
+
|
|
463
|
+
BLOCKER_REGISTRY.update(
|
|
464
|
+
_entries(
|
|
465
|
+
[
|
|
466
|
+
"taxonomy_decision_required",
|
|
467
|
+
],
|
|
468
|
+
owner_phase="taxonomy",
|
|
469
|
+
decision="ask_human",
|
|
470
|
+
safe=False,
|
|
471
|
+
human_packet=True,
|
|
472
|
+
public_label="Decisao de taxonomia necessaria",
|
|
473
|
+
public_explanation="A movimentacao de taxonomia precisa de aprovacao humana antes de aplicar.",
|
|
474
|
+
developer_explanation="Taxonomy approval requires a typed human_decision_packet before crossing workflow boundaries.",
|
|
475
|
+
test_fixture="tests/test_path_contract_models.py",
|
|
476
|
+
)
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
def blocker_entry(code: str) -> BlockerEntry:
|
|
481
|
+
try:
|
|
482
|
+
return BLOCKER_REGISTRY[code]
|
|
483
|
+
except KeyError as exc:
|
|
484
|
+
raise BlockerRegistryError(f"unknown blocker code: {code}") from exc
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
def decision_for_code(
|
|
488
|
+
code: str,
|
|
489
|
+
*,
|
|
490
|
+
phase: str,
|
|
491
|
+
public_summary: str,
|
|
492
|
+
developer_summary: str,
|
|
493
|
+
next_action: str,
|
|
494
|
+
) -> WorkflowDecision:
|
|
495
|
+
entry = blocker_entry(code)
|
|
496
|
+
return WorkflowDecision(
|
|
497
|
+
kind=entry.default_decision,
|
|
498
|
+
phase=phase,
|
|
499
|
+
reason_code=code,
|
|
500
|
+
public_summary=public_summary or entry.public_explanation,
|
|
501
|
+
developer_summary=developer_summary or entry.developer_explanation,
|
|
502
|
+
evidence=[
|
|
503
|
+
DecisionEvidence(
|
|
504
|
+
summary=entry.public_explanation,
|
|
505
|
+
technical_code=code,
|
|
506
|
+
source=entry.owner_phase,
|
|
507
|
+
)
|
|
508
|
+
],
|
|
509
|
+
next_action=next_action,
|
|
510
|
+
)
|