@proflandrigan/shards 1.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/README.md +475 -0
- package/package.json +37 -0
- package/src/agents/academic.md +276 -0
- package/src/agents/ai-engineer.md +377 -0
- package/src/agents/analytics-engineer.md +364 -0
- package/src/agents/applied-ml-scientist.md +410 -0
- package/src/agents/backend-engineer.md +255 -0
- package/src/agents/bi-engineer.md +333 -0
- package/src/agents/data-analyst.md +343 -0
- package/src/agents/data-engineer.md +260 -0
- package/src/agents/data-modeller.md +386 -0
- package/src/agents/data-scientist.md +366 -0
- package/src/agents/deep-learning-engineer.md +389 -0
- package/src/agents/ml-engineer.md +424 -0
- package/src/agents/mlops-engineer.md +339 -0
- package/src/agents/researcher.md +187 -0
- package/src/agents/specific_instructions/academic/critical_review.md +263 -0
- package/src/agents/specific_instructions/academic/report.md +113 -0
- package/src/agents/specific_instructions/ai_engineer/advise.md +162 -0
- package/src/agents/specific_instructions/ai_engineer/bi_engineer_handoff.md +86 -0
- package/src/agents/specific_instructions/ai_engineer/experiment.md +471 -0
- package/src/agents/specific_instructions/ai_engineer/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/ai_engineer/phases/index.md +45 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-1.md +55 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-2.md +86 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-3.md +96 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-4.md +138 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-5.md +157 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-6.md +196 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-7.md +313 -0
- package/src/agents/specific_instructions/ai_engineer/phases.md +1011 -0
- package/src/agents/specific_instructions/ai_engineer/prompt_lab.md +161 -0
- package/src/agents/specific_instructions/ai_engineer/prompt_lab_ui_mode.md +28 -0
- package/src/agents/specific_instructions/ai_engineer/research.md +393 -0
- package/src/agents/specific_instructions/ai_engineer/research_ui_mode.md +66 -0
- package/src/agents/specific_instructions/ai_engineer/review.md +159 -0
- package/src/agents/specific_instructions/ai_engineer/validation_checklist.md +182 -0
- package/src/agents/specific_instructions/analytics_engineer/advise.md +155 -0
- package/src/agents/specific_instructions/analytics_engineer/bi_engineer_handoff.md +91 -0
- package/src/agents/specific_instructions/analytics_engineer/data_analyst_handoff.md +84 -0
- package/src/agents/specific_instructions/analytics_engineer/deep_phases.md +818 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/index.md +24 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-1.md +77 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-2.md +106 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-3.md +93 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-4.md +79 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-5.md +61 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-6.md +45 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-7.md +235 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-8.md +221 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/phase-1.md +47 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/phase-2.md +78 -0
- package/src/agents/specific_instructions/analytics_engineer/quick_phases.md +112 -0
- package/src/agents/specific_instructions/analytics_engineer/review.md +167 -0
- package/src/agents/specific_instructions/analytics_engineer/service_mode.md +369 -0
- package/src/agents/specific_instructions/analytics_engineer/ui_mode.md +45 -0
- package/src/agents/specific_instructions/analytics_engineer/update.md +162 -0
- package/src/agents/specific_instructions/analytics_engineer/validation_checklist.md +121 -0
- package/src/agents/specific_instructions/applied_ml_scientist/advise.md +143 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/index.md +21 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-1.md +51 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-2.md +66 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-3.md +113 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-4.md +104 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-5.md +156 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases.md +428 -0
- package/src/agents/specific_instructions/applied_ml_scientist/research.md +379 -0
- package/src/agents/specific_instructions/applied_ml_scientist/review.md +142 -0
- package/src/agents/specific_instructions/applied_ml_scientist/validation_checklist.md +136 -0
- package/src/agents/specific_instructions/backend_engineer/clean.md +149 -0
- package/src/agents/specific_instructions/backend_engineer/review.md +91 -0
- package/src/agents/specific_instructions/backend_engineer/review_checklist.md +54 -0
- package/src/agents/specific_instructions/backend_engineer/service_mode.md +67 -0
- package/src/agents/specific_instructions/bi_engineer/advise.md +137 -0
- package/src/agents/specific_instructions/bi_engineer/data_analyst_handoff.md +77 -0
- package/src/agents/specific_instructions/bi_engineer/incoming_handoff.md +45 -0
- package/src/agents/specific_instructions/bi_engineer/phases/index.md +20 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-1.md +164 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-2.md +92 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-3.md +121 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-4.md +106 -0
- package/src/agents/specific_instructions/bi_engineer/phases.md +451 -0
- package/src/agents/specific_instructions/bi_engineer/review.md +166 -0
- package/src/agents/specific_instructions/bi_engineer/update.md +147 -0
- package/src/agents/specific_instructions/bi_engineer/validation_checklist.md +124 -0
- package/src/agents/specific_instructions/data_analyst/advise.md +138 -0
- package/src/agents/specific_instructions/data_analyst/explain.md +221 -0
- package/src/agents/specific_instructions/data_analyst/incoming_handoff.md +40 -0
- package/src/agents/specific_instructions/data_analyst/phases/index.md +20 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-1.md +159 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-2.md +112 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-3.md +265 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-4.md +100 -0
- package/src/agents/specific_instructions/data_analyst/phases.md +501 -0
- package/src/agents/specific_instructions/data_analyst/review.md +138 -0
- package/src/agents/specific_instructions/data_analyst/ui_mode.md +26 -0
- package/src/agents/specific_instructions/data_analyst/update.md +144 -0
- package/src/agents/specific_instructions/data_analyst/validation_checklist.md +95 -0
- package/src/agents/specific_instructions/data_engineer/advise.md +137 -0
- package/src/agents/specific_instructions/data_engineer/phases.md +466 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/index.md +23 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-1.md +49 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-2.md +93 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-3.md +55 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-4.md +48 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-5.md +40 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-6.md +102 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-7.md +87 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/phase-1.md +45 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/phase-2.md +54 -0
- package/src/agents/specific_instructions/data_engineer/review.md +135 -0
- package/src/agents/specific_instructions/data_engineer/validation_checklist.md +136 -0
- package/src/agents/specific_instructions/data_modeller/advise.md +137 -0
- package/src/agents/specific_instructions/data_modeller/phases.md +581 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/index.md +23 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-1.md +52 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-2.md +113 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-3.md +47 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-4.md +51 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-5.md +45 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-6.md +105 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-7.md +136 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/phase-1.md +47 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/phase-2.md +65 -0
- package/src/agents/specific_instructions/data_modeller/review.md +141 -0
- package/src/agents/specific_instructions/data_modeller/service_mode.md +218 -0
- package/src/agents/specific_instructions/data_modeller/validation_checklist.md +125 -0
- package/src/agents/specific_instructions/data_scientist/advise.md +158 -0
- package/src/agents/specific_instructions/data_scientist/bi_engineer_handoff.md +63 -0
- package/src/agents/specific_instructions/data_scientist/experiment.md +482 -0
- package/src/agents/specific_instructions/data_scientist/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/data_scientist/explain.md +247 -0
- package/src/agents/specific_instructions/data_scientist/greenfield_data.md +35 -0
- package/src/agents/specific_instructions/data_scientist/ml_engineer_handoff.md +52 -0
- package/src/agents/specific_instructions/data_scientist/notebook_walkthrough.md +76 -0
- package/src/agents/specific_instructions/data_scientist/phases/index.md +24 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-1.md +45 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-2.md +67 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-3.md +89 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-4.md +143 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-5.md +71 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-6.md +239 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-7.md +207 -0
- package/src/agents/specific_instructions/data_scientist/phases.md +651 -0
- package/src/agents/specific_instructions/data_scientist/research.md +345 -0
- package/src/agents/specific_instructions/data_scientist/research_ui_mode.md +52 -0
- package/src/agents/specific_instructions/data_scientist/review.md +136 -0
- package/src/agents/specific_instructions/data_scientist/service_mode.md +247 -0
- package/src/agents/specific_instructions/data_scientist/validation_checklist.md +183 -0
- package/src/agents/specific_instructions/deep_learning_engineer/advise.md +145 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/index.md +21 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-1.md +74 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-2.md +98 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-3.md +76 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-4.md +128 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-5.md +292 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases.md +567 -0
- package/src/agents/specific_instructions/deep_learning_engineer/research.md +389 -0
- package/src/agents/specific_instructions/deep_learning_engineer/review.md +155 -0
- package/src/agents/specific_instructions/deep_learning_engineer/validation_checklist.md +147 -0
- package/src/agents/specific_instructions/ml_engineer/advise.md +174 -0
- package/src/agents/specific_instructions/ml_engineer/bi_engineer_handoff.md +71 -0
- package/src/agents/specific_instructions/ml_engineer/experiment.md +474 -0
- package/src/agents/specific_instructions/ml_engineer/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/ml_engineer/notebook_walkthrough.md +75 -0
- package/src/agents/specific_instructions/ml_engineer/phases/index.md +25 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-1.md +49 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-2.md +75 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-3.md +124 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-4.md +279 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-5.md +160 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-6-5.md +170 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-6.md +295 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-7.md +337 -0
- package/src/agents/specific_instructions/ml_engineer/phases.md +1068 -0
- package/src/agents/specific_instructions/ml_engineer/research.md +437 -0
- package/src/agents/specific_instructions/ml_engineer/research_ui_mode.md +71 -0
- package/src/agents/specific_instructions/ml_engineer/review.md +187 -0
- package/src/agents/specific_instructions/ml_engineer/service_mode.md +273 -0
- package/src/agents/specific_instructions/ml_engineer/validation_checklist.md +185 -0
- package/src/agents/specific_instructions/mlops_engineer/advise.md +139 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/index.md +23 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-1.md +52 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-2.md +86 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-3.md +105 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-4.md +128 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-5.md +106 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-6.md +128 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-7.md +144 -0
- package/src/agents/specific_instructions/mlops_engineer/phases.md +671 -0
- package/src/agents/specific_instructions/mlops_engineer/review.md +164 -0
- package/src/agents/specific_instructions/mlops_engineer/service_mode.md +81 -0
- package/src/agents/specific_instructions/mlops_engineer/validation_checklist.md +151 -0
- package/src/agents/specific_instructions/researcher/critical_review.md +292 -0
- package/src/agents/specific_instructions/researcher/review_checklist.md +67 -0
- package/src/agents/specific_instructions/researcher/service_mode.md +224 -0
- package/src/agents/specific_instructions/shared/auto_verify_mode.md +141 -0
- package/src/agents/specific_instructions/shared/autonomous_research.md +1289 -0
- package/src/agents/specific_instructions/shared/behavioral_rules.md +36 -0
- package/src/agents/specific_instructions/shared/diverge_protocol.md +387 -0
- package/src/agents/specific_instructions/shared/engineering_guidelines.md +136 -0
- package/src/agents/specific_instructions/shared/experiment_versioning.md +184 -0
- package/src/agents/specific_instructions/shared/goal_mode.md +187 -0
- package/src/agents/specific_instructions/shared/incremental_testing.md +139 -0
- package/src/agents/specific_instructions/shared/intent_discovery.md +223 -0
- package/src/agents/specific_instructions/shared/join_path_protocol.md +168 -0
- package/src/agents/specific_instructions/shared/knowledge_checkpoint.md +83 -0
- package/src/agents/specific_instructions/shared/knowledge_harvest.md +220 -0
- package/src/agents/specific_instructions/shared/knowledge_retrieval.md +100 -0
- package/src/agents/specific_instructions/shared/notebook_walkthrough_protocol.md +367 -0
- package/src/agents/specific_instructions/shared/reviewer_verdict_protocol.md +74 -0
- package/src/agents/specific_instructions/shared/swarm_protocol.md +97 -0
- package/src/agents/specific_instructions/shared/validation_protocol.md +139 -0
- package/src/agents/specific_instructions/syn/arbiter.md +140 -0
- package/src/agents/specific_instructions/syn/brainstorm.md +550 -0
- package/src/agents/specific_instructions/syn/code_review.md +232 -0
- package/src/agents/specific_instructions/syn/diff.md +239 -0
- package/src/agents/specific_instructions/syn/final_review.md +65 -0
- package/src/agents/specific_instructions/syn/fixer.md +240 -0
- package/src/agents/specific_instructions/syn/free_form.md +130 -0
- package/src/agents/specific_instructions/syn/knowledge.md +468 -0
- package/src/agents/specific_instructions/syn/notebook_walkthrough.md +78 -0
- package/src/agents/specific_instructions/syn/panel_review.md +634 -0
- package/src/agents/specific_instructions/syn/pm.md +453 -0
- package/src/agents/specific_instructions/syn/pr_review.md +255 -0
- package/src/agents/specific_instructions/syn/slides.md +417 -0
- package/src/agents/syn.md +729 -0
- package/src/commands/academic.md +41 -0
- package/src/commands/ai-engineer.md +45 -0
- package/src/commands/analytics-engineer.md +48 -0
- package/src/commands/applied-ml-scientist.md +45 -0
- package/src/commands/backend-engineer.md +35 -0
- package/src/commands/bi-engineer.md +40 -0
- package/src/commands/brainstorm.md +24 -0
- package/src/commands/data-analyst.md +38 -0
- package/src/commands/data-engineer.md +37 -0
- package/src/commands/data-modeller.md +38 -0
- package/src/commands/data-scientist.md +38 -0
- package/src/commands/deep-learning-engineer.md +47 -0
- package/src/commands/end.md +49 -0
- package/src/commands/knowledge.md +24 -0
- package/src/commands/ml-engineer.md +42 -0
- package/src/commands/mlops-engineer.md +47 -0
- package/src/commands/notebook-walkthrough.md +58 -0
- package/src/commands/researcher.md +40 -0
- package/src/commands/resume.md +57 -0
- package/src/commands/review-pr.md +26 -0
- package/src/commands/shards-guide.md +41 -0
- package/src/commands/shards-ui.md +32 -0
- package/src/commands/shards.md +41 -0
- package/src/docs/01-getting-started/concepts.md +109 -0
- package/src/docs/01-getting-started/first-session.md +79 -0
- package/src/docs/01-getting-started/install.md +61 -0
- package/src/docs/02-agents/academic.md +71 -0
- package/src/docs/02-agents/ai-engineer.md +78 -0
- package/src/docs/02-agents/analytics-engineer.md +58 -0
- package/src/docs/02-agents/applied-ml-scientist.md +59 -0
- package/src/docs/02-agents/backend-engineer.md +58 -0
- package/src/docs/02-agents/bi-engineer.md +65 -0
- package/src/docs/02-agents/data-analyst.md +67 -0
- package/src/docs/02-agents/data-engineer.md +57 -0
- package/src/docs/02-agents/data-modeller.md +51 -0
- package/src/docs/02-agents/data-scientist.md +78 -0
- package/src/docs/02-agents/deep-learning-engineer.md +64 -0
- package/src/docs/02-agents/ml-engineer.md +80 -0
- package/src/docs/02-agents/mlops-engineer.md +59 -0
- package/src/docs/02-agents/overview.md +62 -0
- package/src/docs/02-agents/researcher.md +73 -0
- package/src/docs/02-agents/syn.md +88 -0
- package/src/docs/03-protocols/auto-verify.md +82 -0
- package/src/docs/03-protocols/autonomous-research.md +59 -0
- package/src/docs/03-protocols/behavioral-rules.md +35 -0
- package/src/docs/03-protocols/diverge.md +50 -0
- package/src/docs/03-protocols/engineering-guidelines.md +56 -0
- package/src/docs/03-protocols/experiment-versioning.md +38 -0
- package/src/docs/03-protocols/gate-pattern.md +65 -0
- package/src/docs/03-protocols/incremental-testing.md +68 -0
- package/src/docs/03-protocols/join-path.md +46 -0
- package/src/docs/03-protocols/knowledge-ledger.md +70 -0
- package/src/docs/03-protocols/reviewer-verdicts.md +39 -0
- package/src/docs/03-protocols/swarm.md +40 -0
- package/src/docs/03-protocols/validation.md +174 -0
- package/src/docs/04-ui/activity-bar.md +70 -0
- package/src/docs/04-ui/chat-pane.md +80 -0
- package/src/docs/04-ui/code-intel.md +62 -0
- package/src/docs/04-ui/file-editing.md +61 -0
- package/src/docs/04-ui/git.md +54 -0
- package/src/docs/04-ui/keybindings.md +79 -0
- package/src/docs/04-ui/knowledge-map.md +76 -0
- package/src/docs/04-ui/overview.md +93 -0
- package/src/docs/04-ui/panels.md +49 -0
- package/src/docs/04-ui/pinboard-selection.md +66 -0
- package/src/docs/04-ui/quick-open-palette.md +56 -0
- package/src/docs/04-ui/sessions.md +81 -0
- package/src/docs/04-ui/settings-permissions.md +56 -0
- package/src/docs/05-commands/reference.md +59 -0
- package/src/docs/06-outputs/directory-map.md +116 -0
- package/src/docs/07-workflows/ai-eval-first.md +57 -0
- package/src/docs/07-workflows/deep-study-to-production.md +76 -0
- package/src/docs/07-workflows/diverge-exploration.md +77 -0
- package/src/docs/07-workflows/quick-analysis.md +45 -0
- package/src/docs/08-integrations/claude-code-auto-mode.md +191 -0
- package/src/docs/08-integrations/google-slides.md +175 -0
- package/src/docs/README.md +30 -0
- package/src/docs/manifest.json +108 -0
- package/src/templates/analysis-template.md +20 -0
- package/src/templates/branch-report.md +46 -0
- package/src/templates/diff-report.md +88 -0
- package/src/templates/knowledge-index.md +7 -0
- package/src/templates/model-card-schema.json +186 -0
- package/src/templates/model-card-schema.md +88 -0
- package/src/templates/model-card.md +124 -0
- package/src/templates/project-plan.md +47 -0
- package/src/templates/project-specs.md +81 -0
- package/src/templates/report-template.md +43 -0
- package/src/templates/study-template.md +25 -0
- package/src/ui/cc-readonly.js +181 -0
- package/src/ui/chat-session.js +466 -0
- package/src/ui/css/base.css +136 -0
- package/src/ui/css/brainstorm.css +525 -0
- package/src/ui/css/chat.css +1405 -0
- package/src/ui/css/editor.css +546 -0
- package/src/ui/css/eval-dashboard.css +157 -0
- package/src/ui/css/experiment.css +237 -0
- package/src/ui/css/guide.css +186 -0
- package/src/ui/css/knowledge-map.css +383 -0
- package/src/ui/css/layout.css +431 -0
- package/src/ui/css/model-card.css +161 -0
- package/src/ui/css/notebook-walkthrough.css +271 -0
- package/src/ui/css/pr-review.css +403 -0
- package/src/ui/css/prompt-lab.css +325 -0
- package/src/ui/css/sessions.css +258 -0
- package/src/ui/css/sidebar.css +661 -0
- package/src/ui/css/terminal.css +113 -0
- package/src/ui/css/theme-light.css +542 -0
- package/src/ui/index.html +389 -0
- package/src/ui/js/agents.js +32 -0
- package/src/ui/js/bookmarks.js +230 -0
- package/src/ui/js/chat.js +1776 -0
- package/src/ui/js/code-intel.js +328 -0
- package/src/ui/js/command-palette.js +142 -0
- package/src/ui/js/events.js +591 -0
- package/src/ui/js/explorer.js +317 -0
- package/src/ui/js/file-view.js +477 -0
- package/src/ui/js/git.js +536 -0
- package/src/ui/js/guide.js +198 -0
- package/src/ui/js/hud.js +75 -0
- package/src/ui/js/init.js +351 -0
- package/src/ui/js/knowledge-map.js +906 -0
- package/src/ui/js/markdown.js +114 -0
- package/src/ui/js/monaco.js +164 -0
- package/src/ui/js/notebook-walkthrough.js +272 -0
- package/src/ui/js/notebook.js +448 -0
- package/src/ui/js/panels.js +2681 -0
- package/src/ui/js/pinboard.js +186 -0
- package/src/ui/js/quick-open.js +164 -0
- package/src/ui/js/selection-context.js +131 -0
- package/src/ui/js/sessions.js +256 -0
- package/src/ui/js/settings.js +476 -0
- package/src/ui/js/split-view.js +82 -0
- package/src/ui/js/state.js +343 -0
- package/src/ui/js/table.js +161 -0
- package/src/ui/js/tabs.js +284 -0
- package/src/ui/js/tabular.js +125 -0
- package/src/ui/js/terminal.js +354 -0
- package/src/ui/js/timeline.js +137 -0
- package/src/ui/js/utils.js +293 -0
- package/src/ui/notebook-kernel.py +790 -0
- package/src/ui/open-browser.js +55 -0
- package/src/ui/permission-pattern.js +42 -0
- package/src/ui/relay.js +513 -0
- package/src/ui/server.js +3072 -0
- package/src/ui/session-index.js +225 -0
- package/src/ui/shards_icon.png +0 -0
- package/src/ui/spawn-server.js +41 -0
- package/src/ui/symbol-index.js +813 -0
- package/src/ui/ui-push.js +177 -0
- package/tools/gate-hook/VALIDATION_SPEC.md +273 -0
- package/tools/gate-hook/__tests__/auto-verify.test.js +343 -0
- package/tools/gate-hook/auto-allowlist.js +179 -0
- package/tools/gate-hook/auto-state.js +68 -0
- package/tools/gate-hook/classify.js +21 -0
- package/tools/gate-hook/log.js +57 -0
- package/tools/gate-hook/parser.js +205 -0
- package/tools/gate-hook/sql-guard.js +230 -0
- package/tools/gate-hook/state.js +170 -0
- package/tools/gate-hook/sweep.js +139 -0
- package/tools/gate-hook/transcript.js +45 -0
- package/tools/gate-hook/validation.js +321 -0
- package/tools/gate-hook.js +475 -0
- package/tools/install.js +914 -0
- package/tools/shards-gates.js +311 -0
- package/tools/shards-sessions.js +261 -0
- package/tools/shards-ui.js +377 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ui-push.js — Agent-to-UI panel push CLI
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* node ui-push.js <panel-type> [options]
|
|
10
|
+
*
|
|
11
|
+
* Panel types:
|
|
12
|
+
* data-viewer Interactive data table (Tabulator.js)
|
|
13
|
+
* dag Dependency graph
|
|
14
|
+
* diagram ER / architecture diagram
|
|
15
|
+
* chart Plotly.js chart
|
|
16
|
+
* diff Code diff viewer
|
|
17
|
+
* model-card Structured model metadata card (Mitchell et al. 2019)
|
|
18
|
+
* eval-dashboard Live evaluation results dashboard
|
|
19
|
+
* notebook-walkthrough Interactive cell-by-cell notebook walkthrough
|
|
20
|
+
* brainstorm Live multi-specialist brainstorm fan-out
|
|
21
|
+
* close Close a panel by ID
|
|
22
|
+
*
|
|
23
|
+
* Options:
|
|
24
|
+
* --title <string> Panel tab title
|
|
25
|
+
* --data <json> Inline JSON data
|
|
26
|
+
* --source <filepath> Path to data file (server reads it; watches for changes)
|
|
27
|
+
* --type <subtype> Panel subtype (e.g. "bar", "scatter" for charts)
|
|
28
|
+
* --agent <name> Agent name (e.g. "data-analyst")
|
|
29
|
+
* --panel-id <id> Panel ID for updates or close (auto-generated if not given)
|
|
30
|
+
*
|
|
31
|
+
* Exits silently on any failure (UI not running = no-op).
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
const fs = require('fs');
|
|
35
|
+
const http = require('http');
|
|
36
|
+
const path = require('path');
|
|
37
|
+
const { randomUUID } = require('crypto');
|
|
38
|
+
|
|
39
|
+
// ─── Locate .shards/ui.port ───────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
function findPortFile() {
|
|
42
|
+
// Walk up from cwd to find .shards/ui.port
|
|
43
|
+
let dir = process.cwd();
|
|
44
|
+
for (let i = 0; i < 10; i++) {
|
|
45
|
+
const candidate = path.join(dir, '.shards', 'ui.port');
|
|
46
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
47
|
+
const parent = path.dirname(dir);
|
|
48
|
+
if (parent === dir) break;
|
|
49
|
+
dir = parent;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function readPortFile(portFile) {
|
|
55
|
+
try {
|
|
56
|
+
return JSON.parse(fs.readFileSync(portFile, 'utf8'));
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ─── Argument parser ──────────────────────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
function parseArgs(argv) {
|
|
65
|
+
const result = {
|
|
66
|
+
panel: null,
|
|
67
|
+
title: null,
|
|
68
|
+
data: null,
|
|
69
|
+
source: null,
|
|
70
|
+
type: null,
|
|
71
|
+
agent: null,
|
|
72
|
+
panelId: null,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const args = argv.slice(2);
|
|
76
|
+
result.panel = args[0] || null;
|
|
77
|
+
|
|
78
|
+
for (let i = 1; i < args.length; i++) {
|
|
79
|
+
const arg = args[i];
|
|
80
|
+
if (arg === '--title' && args[i + 1]) { result.title = args[++i]; }
|
|
81
|
+
else if (arg === '--data' && args[i + 1]) { result.data = args[++i]; }
|
|
82
|
+
else if (arg === '--source' && args[i + 1]) { result.source = args[++i]; }
|
|
83
|
+
else if (arg === '--type' && args[i + 1]) { result.type = args[++i]; }
|
|
84
|
+
else if (arg === '--agent' && args[i + 1]) { result.agent = args[++i]; }
|
|
85
|
+
else if (arg === '--panel-id' && args[i + 1]) { result.panelId = args[++i]; }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ─── HTTP POST ────────────────────────────────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
function postEvent(port, token, payload) {
|
|
94
|
+
return new Promise((resolve) => {
|
|
95
|
+
const body = JSON.stringify(payload);
|
|
96
|
+
const req = http.request(
|
|
97
|
+
{
|
|
98
|
+
hostname: '127.0.0.1',
|
|
99
|
+
port,
|
|
100
|
+
path: '/event',
|
|
101
|
+
method: 'POST',
|
|
102
|
+
headers: {
|
|
103
|
+
'Content-Type': 'application/json',
|
|
104
|
+
'Content-Length': Buffer.byteLength(body),
|
|
105
|
+
'Authorization': `Bearer ${token}`,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
(res) => {
|
|
109
|
+
res.resume();
|
|
110
|
+
res.on('end', () => resolve(true));
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
req.on('error', () => resolve(false));
|
|
114
|
+
req.setTimeout(3000, () => { req.destroy(); resolve(false); });
|
|
115
|
+
req.write(body);
|
|
116
|
+
req.end();
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ─── Main ─────────────────────────────────────────────────────────────────────
|
|
121
|
+
|
|
122
|
+
async function main() {
|
|
123
|
+
const portFile = findPortFile();
|
|
124
|
+
if (!portFile) process.exit(0); // UI not running — silent no-op
|
|
125
|
+
|
|
126
|
+
const portInfo = readPortFile(portFile);
|
|
127
|
+
if (!portInfo || !portInfo.port || !portInfo.token) process.exit(0);
|
|
128
|
+
|
|
129
|
+
const { port, token } = portInfo;
|
|
130
|
+
const args = parseArgs(process.argv);
|
|
131
|
+
|
|
132
|
+
if (!args.panel) process.exit(0);
|
|
133
|
+
|
|
134
|
+
const VALID_PANELS = ['data-viewer', 'dag', 'diagram', 'chart', 'diff', 'model-card', 'experiment-dashboard', 'eval-dashboard', 'prompt-lab', 'pr-review', 'notebook-walkthrough', 'brainstorm', 'close'];
|
|
135
|
+
if (!VALID_PANELS.includes(args.panel)) process.exit(0);
|
|
136
|
+
|
|
137
|
+
// Resolve source to absolute path if given
|
|
138
|
+
const sourcePath = args.source ? path.resolve(args.source) : null;
|
|
139
|
+
|
|
140
|
+
// Parse inline data if provided
|
|
141
|
+
let inlineData = null;
|
|
142
|
+
if (args.data) {
|
|
143
|
+
try {
|
|
144
|
+
inlineData = JSON.parse(args.data);
|
|
145
|
+
} catch {
|
|
146
|
+
// If it's not valid JSON, pass as string — server will handle
|
|
147
|
+
inlineData = args.data;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const panelId = args.panelId || randomUUID();
|
|
152
|
+
|
|
153
|
+
let payload;
|
|
154
|
+
if (args.panel === 'close') {
|
|
155
|
+
payload = {
|
|
156
|
+
eventType: 'ui-panel-close',
|
|
157
|
+
panelId: args.panelId || null,
|
|
158
|
+
};
|
|
159
|
+
} else {
|
|
160
|
+
payload = {
|
|
161
|
+
eventType: 'ui-panel',
|
|
162
|
+
panel: args.panel,
|
|
163
|
+
panelId,
|
|
164
|
+
title: args.title || args.panel,
|
|
165
|
+
data: inlineData,
|
|
166
|
+
source: sourcePath,
|
|
167
|
+
type: args.type || null,
|
|
168
|
+
agent: args.agent || null,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
await postEvent(port, token, payload);
|
|
173
|
+
// Always exit 0 — agents should never fail due to UI state
|
|
174
|
+
process.exit(0);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
main().catch(() => process.exit(0));
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Gate Hook — Validation Enforcement Spec
|
|
2
|
+
|
|
3
|
+
Design spec for extending the gate hook (`tools/gate-hook.js` + `tools/gate-hook/*.js`) to enforce the shared validation protocol (`src/agents/specific_instructions/shared/validation_protocol.md`).
|
|
4
|
+
|
|
5
|
+
Status: draft — not yet implemented. Companion to the protocol and per-agent checklists.
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
Block phase advancement when a validation-eligible phase closes without a populated `## Validation` section in `project-specs.md`. The hook should distinguish "forgot to validate" from "validated but the section is formatted wrong" from "this phase doesn't require validation" — each needs a different error message.
|
|
10
|
+
|
|
11
|
+
## Trigger Model
|
|
12
|
+
|
|
13
|
+
The gate hook currently opens a gate on `Stop` if the last assistant message contains a `::GATE::` fence. The validation check runs **before** the gate is opened:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Stop event
|
|
17
|
+
├─ parse last message → find gate fence
|
|
18
|
+
├─ if gate requires validation (see "Gate Attribute" below):
|
|
19
|
+
│ ├─ read project-specs.md
|
|
20
|
+
│ ├─ locate `## Validation` section
|
|
21
|
+
│ ├─ parse schema-required fields
|
|
22
|
+
│ └─ if any required field is missing → block, do not open gate
|
|
23
|
+
└─ else → open gate as today
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
On block, the user sees a structured error and the gate remains closed. The agent's next turn must fix the validation section and re-emit the gate fence.
|
|
27
|
+
|
|
28
|
+
## Gate Attribute
|
|
29
|
+
|
|
30
|
+
Introduce one new optional attribute on the gate fence:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
::GATE:: id=<slug> phase=<n> kind=<phase|execute|...> validates=<checklist-key>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- `validates=<checklist-key>` — the checklist to require, e.g. `analytics_engineer`, `ml_engineer`, `data_scientist`.
|
|
37
|
+
- Absent attribute → no validation check (current behavior preserved). Review / Advise / Explain / Handoff gates do not set it.
|
|
38
|
+
- The checklist-key maps to a per-agent `validation_checklist.md` path. The hook does not actually read the checklist — it only passes the key through to error messages. Semantic coverage is the agent's responsibility.
|
|
39
|
+
|
|
40
|
+
**Alternative considered:** auto-require validation for `kind=execute`. Rejected — too broad, and plumbing opt-in via an explicit attribute makes the intent legible in transcripts.
|
|
41
|
+
|
|
42
|
+
## Specs File Contract
|
|
43
|
+
|
|
44
|
+
The hook resolves `project-specs.md` in the following priority order:
|
|
45
|
+
|
|
46
|
+
1. `SHARDS_PROJECT_SPECS_PATH` env var if set (absolute path, overrides everything)
|
|
47
|
+
2. `project-specs.md` at CWD if it exists
|
|
48
|
+
3. The most recently modified `project-specs.md` under any conventional project directory — `analysis/<name>/`, `studies/<name>/`, `models/<name>/`, `data_models/<name>/`, `services/<name>/`, `research/<name>/`, `dashboards/<name>/`, `brainstorm/<name>/`, or `fixes/<name>/`. Only immediate subdirectories of these roots are searched (one level deep).
|
|
49
|
+
|
|
50
|
+
The hook then looks for the most recent `## Validation` section within that file — defined as the final `## Validation` heading before EOF or before the next non-validation top-level heading.
|
|
51
|
+
|
|
52
|
+
### Required fields
|
|
53
|
+
|
|
54
|
+
| Field | Format | Check |
|
|
55
|
+
|-------|--------|-------|
|
|
56
|
+
| `**Track:**` | `quick`, `deep`, or `fixer` | Exact match on one of three values (case-insensitive) |
|
|
57
|
+
| `**Mode:**` | Free-form string | **Optional.** If present, value must be non-empty; if absent, no check. Not validated against any vocabulary. |
|
|
58
|
+
| `**Checklist:**` | `<name>/validation_checklist.md` | Non-empty, ends with `validation_checklist.md` |
|
|
59
|
+
| `**Applied at:**` | Phase descriptor | Non-empty |
|
|
60
|
+
| `### Evidence` | Markdown table with ≥1 data row | At least one row where Check, Expected, and Observed cells are non-empty; `Pass/Fail` is one of `✓`, `✗`, or `n/a`; any row with `Pass/Fail = n/a` requires a non-empty Notes cell. Unresolved checks (`?` or blank Pass/Fail) are rejected. |
|
|
61
|
+
| `### Artifacts` | Bulleted list | At least one bullet OR an explicit `- none (see Summary for rationale)` |
|
|
62
|
+
| `### Downstream Impact` | Bulleted list | At least one bullet |
|
|
63
|
+
| `### Summary` | Prose | ≥ 20 non-whitespace characters |
|
|
64
|
+
|
|
65
|
+
`### Open Issues` is **not** required to be populated — `- none` is an acceptable value — but the heading must be present.
|
|
66
|
+
|
|
67
|
+
### Parser sketch
|
|
68
|
+
|
|
69
|
+
New module: `tools/gate-hook/validation.js`.
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
// Pseudocode
|
|
73
|
+
const VALID_PASS_FAIL = new Set(['✓', '✗', 'n/a']);
|
|
74
|
+
|
|
75
|
+
function parseValidationSection(specsContent) {
|
|
76
|
+
const sections = splitByH2(specsContent);
|
|
77
|
+
const last = sections.filter(s => s.heading === 'Validation').pop();
|
|
78
|
+
if (!last) return { present: false };
|
|
79
|
+
|
|
80
|
+
const body = last.body;
|
|
81
|
+
return {
|
|
82
|
+
present: true,
|
|
83
|
+
track: matchOne(body, /\*\*Track:\*\*\s*(quick|deep|fixer)\b/i),
|
|
84
|
+
mode: matchOne(body, /\*\*Mode:\*\*\s*([^\n]+)/), // optional — null if absent
|
|
85
|
+
checklist: matchOne(body, /\*\*Checklist:\*\*\s*([^\n]+validation_checklist\.md)/),
|
|
86
|
+
appliedAt: matchOne(body, /\*\*Applied at:\*\*\s*([^\n]+)/),
|
|
87
|
+
evidenceRows: parseMarkdownTableRows(body, 'Evidence'),
|
|
88
|
+
artifactsBullets: parseBulletedList(body, 'Artifacts'),
|
|
89
|
+
downstreamBullets: parseBulletedList(body, 'Downstream Impact'),
|
|
90
|
+
summaryLength: parseSection(body, 'Summary').replace(/\s+/g, '').length,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function checkValidation(parsed) {
|
|
95
|
+
const errors = [];
|
|
96
|
+
if (!parsed.present) return [{ code: 'MISSING_SECTION' }];
|
|
97
|
+
if (!parsed.track) errors.push({ code: 'MISSING_TRACK' });
|
|
98
|
+
if (parsed.mode !== null && !parsed.mode.trim())
|
|
99
|
+
errors.push({ code: 'EMPTY_MODE' }); // Mode line present but blank value
|
|
100
|
+
if (!parsed.checklist) errors.push({ code: 'MISSING_CHECKLIST' });
|
|
101
|
+
if (parsed.evidenceRows.length === 0) errors.push({ code: 'NO_EVIDENCE_ROWS' });
|
|
102
|
+
|
|
103
|
+
for (const [i, row] of parsed.evidenceRows.entries()) {
|
|
104
|
+
if (!row.check.trim() || !row.expected.trim() || !row.observed.trim()) {
|
|
105
|
+
errors.push({ code: 'INCOMPLETE_EVIDENCE_ROW', row: i });
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (!VALID_PASS_FAIL.has(row.passFail.trim())) {
|
|
109
|
+
errors.push({ code: 'INVALID_PASS_FAIL', row: i, got: row.passFail });
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (row.passFail.trim() === 'n/a' && !row.notes.trim()) {
|
|
113
|
+
errors.push({ code: 'NA_WITHOUT_JUSTIFICATION', row: i });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (parsed.artifactsBullets.length === 0) errors.push({ code: 'NO_ARTIFACTS' });
|
|
118
|
+
if (parsed.downstreamBullets.length === 0) errors.push({ code: 'NO_DOWNSTREAM' });
|
|
119
|
+
if (parsed.summaryLength < 20) errors.push({ code: 'SUMMARY_TOO_SHORT' });
|
|
120
|
+
return errors;
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Keep the parser boring. Regex on headings, split on `|` for table rows, trim aggressively. Do not attempt to validate semantic correctness of the observed values — the hook is a structure check, not a correctness check.
|
|
125
|
+
|
|
126
|
+
## Integration Point in `handleStop`
|
|
127
|
+
|
|
128
|
+
After `parseGates(lastMsg)` and before `state.write(newState)`:
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
const { validates } = gate.attrs;
|
|
132
|
+
if (validates) {
|
|
133
|
+
const specs = readSpecsFile();
|
|
134
|
+
const parsed = parseValidationSection(specs);
|
|
135
|
+
const errors = checkValidation(parsed);
|
|
136
|
+
if (errors.length > 0) {
|
|
137
|
+
appendViolation({
|
|
138
|
+
type: 'validation-missing',
|
|
139
|
+
gate_id: id,
|
|
140
|
+
checklist: validates,
|
|
141
|
+
errors,
|
|
142
|
+
session_id: sessionId,
|
|
143
|
+
});
|
|
144
|
+
respond({
|
|
145
|
+
decision: 'block',
|
|
146
|
+
reason: formatValidationError(validates, errors),
|
|
147
|
+
});
|
|
148
|
+
return; // do not open gate
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The gate stays closed — the agent's next turn must re-emit the fence after fixing the section.
|
|
154
|
+
|
|
155
|
+
## Error Messages
|
|
156
|
+
|
|
157
|
+
Error messages should be actionable, name the specific missing field, and point to the protocol. Template:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
::GATE-BLOCK:: Validation evidence is missing or incomplete.
|
|
161
|
+
|
|
162
|
+
Required checklist: <checklist-key>/validation_checklist.md
|
|
163
|
+
Gate: <gate-id> (phase <n>, kind <kind>)
|
|
164
|
+
|
|
165
|
+
Problems:
|
|
166
|
+
- <code>: <human description>
|
|
167
|
+
- <code>: <human description>
|
|
168
|
+
|
|
169
|
+
What to do:
|
|
170
|
+
1. Re-read src/agents/specific_instructions/shared/validation_protocol.md
|
|
171
|
+
for the required `## Validation` section schema.
|
|
172
|
+
2. Re-read .claude/agents/specific_instructions/<agent>/validation_checklist.md
|
|
173
|
+
for the domain-specific checks.
|
|
174
|
+
3. Run the checks, record observed values in the Evidence table, and
|
|
175
|
+
re-emit the gate fence.
|
|
176
|
+
|
|
177
|
+
If this phase should not require validation, remove the `validates=...`
|
|
178
|
+
attribute from the gate fence.
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Example codes and descriptions:
|
|
182
|
+
|
|
183
|
+
| Code | Description |
|
|
184
|
+
|------|-------------|
|
|
185
|
+
| `MISSING_SECTION` | No `## Validation` heading found in project-specs.md |
|
|
186
|
+
| `MISSING_TRACK` | `**Track:**` line missing or value is not quick/deep/fixer |
|
|
187
|
+
| `EMPTY_MODE` | `**Mode:**` line present but value is blank (omit the line entirely if Mode is not meaningful) |
|
|
188
|
+
| `MISSING_CHECKLIST` | `**Checklist:**` line missing or doesn't reference a `validation_checklist.md` |
|
|
189
|
+
| `NO_EVIDENCE_ROWS` | Evidence table has zero data rows |
|
|
190
|
+
| `INCOMPLETE_EVIDENCE_ROW` | A row has an empty Check, Expected, or Observed cell |
|
|
191
|
+
| `INVALID_PASS_FAIL` | A row's Pass/Fail value is not one of `✓`, `✗`, or `n/a` (includes `?`, blank, or any other symbol) |
|
|
192
|
+
| `NA_WITHOUT_JUSTIFICATION` | A row has `Pass/Fail: n/a` but the Notes cell is empty |
|
|
193
|
+
| `NO_ARTIFACTS` | Artifacts section has no bullets (use `- none (see Summary)` to override intentionally) |
|
|
194
|
+
| `NO_DOWNSTREAM` | Downstream Impact section has no bullets |
|
|
195
|
+
| `SUMMARY_TOO_SHORT` | Summary has fewer than 20 non-whitespace characters |
|
|
196
|
+
|
|
197
|
+
## State & Logging
|
|
198
|
+
|
|
199
|
+
Extend the existing `.shards/gates/state.json` and violation log with validation events:
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"type": "validation-missing",
|
|
204
|
+
"timestamp": "2026-04-22T...",
|
|
205
|
+
"gate_id": "ae-phase-3",
|
|
206
|
+
"checklist": "analytics_engineer",
|
|
207
|
+
"errors": [
|
|
208
|
+
{ "code": "NO_EVIDENCE_ROWS", "field": "Evidence" },
|
|
209
|
+
{ "code": "SUMMARY_TOO_SHORT", "observed_length": 8 }
|
|
210
|
+
],
|
|
211
|
+
"session_id": "..."
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
On successful validation pass, append to history:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{ "event": "validation-passed", "gate_id": "...", "checklist": "...", "evidence_rows": 7 }
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
This gives `shards-gates status` and future UI panels enough to surface validation coverage over time.
|
|
222
|
+
|
|
223
|
+
## Edge Cases
|
|
224
|
+
|
|
225
|
+
- **Specs file missing or unreadable.** Treat as `MISSING_SECTION`. Do not crash the hook.
|
|
226
|
+
- **Multiple `## Validation` sections.** Use the last one. Agents should overwrite, not append, but if they append, the most recent wins.
|
|
227
|
+
- **Agent amends validation in a post-block turn.** Expected flow. The amended message re-emits the fence; the hook re-parses and re-checks. No special handling required.
|
|
228
|
+
- **`validates=none` attribute.** Treat same as absent attribute. Offered as explicit-opt-out syntax for transcripts where intent should be visible.
|
|
229
|
+
- **Nested specs files (sub-projects).** Honor `SHARDS_PROJECT_SPECS_PATH` override. Default does not recurse.
|
|
230
|
+
- **Empty Evidence table (only header).** `NO_EVIDENCE_ROWS`. A header-only table is not evidence.
|
|
231
|
+
- **Row with all cells populated but nonsense values** (e.g., `Observed: lorem ipsum`). Hook cannot detect. This is why the final-review reviewer (Syn) must read the Validation section — structural and semantic checks are separate layers.
|
|
232
|
+
|
|
233
|
+
## Escape Hatch Behavior
|
|
234
|
+
|
|
235
|
+
- `SHARDS_GATE_ENFORCE=0` disables all gate enforcement including validation — already handled by the early-exit at the top of `gate-hook.js`, no change needed.
|
|
236
|
+
- There is no validation-only escape hatch. If a session is so broken it needs to bypass validation but not other gates, add `validates=none` to the fence instead.
|
|
237
|
+
|
|
238
|
+
## Test Plan
|
|
239
|
+
|
|
240
|
+
Unit tests for `validation.js`:
|
|
241
|
+
|
|
242
|
+
1. Fully-populated section (both with and without Mode line) → zero errors
|
|
243
|
+
2. Missing section → `MISSING_SECTION`
|
|
244
|
+
3. Missing each individual required field → corresponding code
|
|
245
|
+
4. Evidence table with one `?` Pass/Fail → `INVALID_PASS_FAIL`
|
|
246
|
+
5. Evidence table with one blank Pass/Fail → `INVALID_PASS_FAIL`
|
|
247
|
+
6. Evidence table with `Pass/Fail: n/a` and empty Notes → `NA_WITHOUT_JUSTIFICATION`
|
|
248
|
+
7. Evidence table with `Pass/Fail: n/a` and non-empty Notes → zero errors on that row
|
|
249
|
+
8. Evidence table with all three valid Pass/Fail values across rows → zero errors
|
|
250
|
+
9. `**Mode:**` line present with empty value → `EMPTY_MODE`
|
|
251
|
+
10. `**Mode:**` line absent entirely → zero errors (Mode is optional)
|
|
252
|
+
11. Summary with 19 whitespace-stripped chars → `SUMMARY_TOO_SHORT`
|
|
253
|
+
12. Multiple `## Validation` sections → uses the last
|
|
254
|
+
13. `validates` attribute absent → parser not invoked (integration test in `gate-hook.js`)
|
|
255
|
+
14. Specs file missing → graceful `MISSING_SECTION`
|
|
256
|
+
|
|
257
|
+
Integration tests against a sample `project-specs.md` fixture directory — one "good" specs file per agent, one intentionally broken specs file per error code.
|
|
258
|
+
|
|
259
|
+
## Out of Scope
|
|
260
|
+
|
|
261
|
+
- Checking that the artifact files referenced in `### Artifacts` actually exist on disk. Possible future addition; adds I/O cost and cross-platform path complexity. Defer.
|
|
262
|
+
- Running the tests (e.g., `dbt test`, `pytest`) automatically. Not the hook's job; the agent runs tests and records results.
|
|
263
|
+
- Checking that evidence values are semantically plausible. That's the reviewer agent's job.
|
|
264
|
+
- Enforcing checklist-specific required check IDs (e.g., AE-03 must appear for analytics_engineer). Possible future addition; start permissive.
|
|
265
|
+
|
|
266
|
+
## Rollout
|
|
267
|
+
|
|
268
|
+
1. Ship the protocol + per-agent checklists first (no hook changes). Agents start populating the `## Validation` section. Zero enforcement.
|
|
269
|
+
2. Ship the hook extension with enforcement **opt-in via environment variable** (e.g., `SHARDS_VALIDATION_ENFORCE=1`). Soft launch.
|
|
270
|
+
3. Flip default to enforced once the schema has shaken out across 2–3 agents' real projects.
|
|
271
|
+
4. Add the remaining per-agent checklists in parallel.
|
|
272
|
+
|
|
273
|
+
Rolling out enforcement before the protocol is battle-tested will create more friction than it's worth.
|