tribunal-kit 9.2.6 → 9.2.8
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/.agent/ARCHITECTURE.md +4 -4
- package/.agent/data/skill_certification_ledger.jsonl +40 -0
- package/.agent/data/skill_ontology.json +138 -0
- package/.agent/history/architecture-intelligence.html +1487 -401
- package/.agent/history/architecture-model.json +16130 -5802
- package/.agent/history/architecture-verification.json +6 -6
- package/.agent/routing_index.json +656 -1566
- package/.agent/rules/GEMINI.md +1 -1
- package/.agent/scripts/adaptive_execution.js +704 -0
- package/.agent/scripts/architecture_diff.js +60 -17
- package/.agent/scripts/architecture_extractor.js +60 -21
- package/.agent/scripts/architecture_health.js +58 -21
- package/.agent/scripts/architecture_intelligence.js +3100 -0
- package/.agent/scripts/architecture_verifier.js +46 -13
- package/.agent/scripts/architecture_visualizer.js +1536 -421
- package/.agent/scripts/blast_radius_engine.js +64 -24
- package/.agent/scripts/capability_evolution.js +555 -0
- package/.agent/scripts/concept_extractor.js +240 -0
- package/.agent/scripts/consideration_engine.js +284 -0
- package/.agent/scripts/context_broker.js +397 -31
- package/.agent/scripts/corpus_certification_orchestrator.js +502 -0
- package/.agent/scripts/corpus_validation_engine.js +311 -0
- package/.agent/scripts/coverage_engine.js +102 -0
- package/.agent/scripts/cross_domain_engine.js +1883 -0
- package/.agent/scripts/engineering_memory.js +1442 -0
- package/.agent/scripts/final_corpus_validation_engine.js +405 -0
- package/.agent/scripts/integrity_manifest.js +1 -5
- package/.agent/scripts/intent_extractor.js +130 -0
- package/.agent/scripts/judgment_engine.js +790 -0
- package/.agent/scripts/materiality_engine.js +251 -0
- package/.agent/scripts/outcome_engine.js +639 -0
- package/.agent/scripts/outcome_optimization_engine.js +1632 -0
- package/.agent/scripts/routing_evaluation_engine.js +184 -0
- package/.agent/scripts/simulation_engine.js +1478 -0
- package/.agent/scripts/skill_behavior_classifier.js +90 -0
- package/.agent/scripts/skill_behavior_harness.js +105 -0
- package/.agent/scripts/skill_certification_engine.js +586 -0
- package/.agent/scripts/skill_contract_engine.js +424 -0
- package/.agent/scripts/skill_coverage_expansion_engine.js +505 -0
- package/.agent/scripts/skill_evidence_acquisition_engine.js +535 -0
- package/.agent/scripts/skill_evidence_engine.js +83 -0
- package/.agent/scripts/skill_expectation_engine.js +38 -0
- package/.agent/scripts/skill_fixture_engine.js +24 -0
- package/.agent/scripts/skill_human_validation.js +32 -0
- package/.agent/scripts/skill_intelligence.js +1300 -0
- package/.agent/scripts/skill_observation_engine.js +25 -0
- package/.agent/scripts/skill_ontology_engine.js +83 -0
- package/.agent/scripts/skill_quality_engine.js +343 -0
- package/.agent/scripts/skill_reconstruction_engine.js +164 -0
- package/.agent/scripts/skill_remediation_engine.js +326 -0
- package/.agent/scripts/skill_scenario_engine.js +108 -0
- package/.agent/scripts/skill_test_authoring_engine.js +1011 -0
- package/.agent/scripts/verification_auditor.js +346 -0
- package/.agent/skill-intelligence/taxonomy/engineering-concepts.json +555 -0
- package/.agent/skill_topic_map.json +15 -55
- package/.agent/skills/12-principles-of-animation/SKILL.md +9 -0
- package/.agent/skills/60fps-animation/SKILL.md +14 -0
- package/.agent/skills/accessible-animation/SKILL.md +9 -0
- package/.agent/skills/adapt/SKILL.md +8 -0
- package/.agent/skills/adr-generation/SKILL.md +9 -0
- package/.agent/skills/advanced-rag-pipelines/SKILL.md +9 -0
- package/.agent/skills/agent-organizer/SKILL.md +8 -0
- package/.agent/skills/agent-syscall-guidelines/SKILL.md +10 -0
- package/.agent/skills/agentic-patterns/SKILL.md +9 -0
- package/.agent/skills/agentic-workflows-2026/SKILL.md +8 -0
- package/.agent/skills/agentshield-security/SKILL.md +16 -0
- package/.agent/skills/ai-app-hardening/SKILL.md +7 -0
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +9 -0
- package/.agent/skills/animation-on-scroll/SKILL.md +9 -0
- package/.agent/skills/animation-systems/SKILL.md +8 -0
- package/.agent/skills/antfu-conventions/SKILL.md +9 -0
- package/.agent/skills/anti-slop-enforcement/SKILL.md +11 -0
- package/.agent/skills/api-patterns/SKILL.md +9 -0
- package/.agent/skills/api-security-auditor/SKILL.md +10 -0
- package/.agent/skills/app-builder/SKILL.md +8 -0
- package/.agent/skills/appflow-wireframe/SKILL.md +9 -0
- package/.agent/skills/apple-design/SKILL.md +8 -0
- package/.agent/skills/architecture/SKILL.md +8 -0
- package/.agent/skills/architecture-drift/SKILL.md +9 -0
- package/.agent/skills/architecture-intelligence/SKILL.md +17 -0
- package/.agent/skills/audit-and-fix/SKILL.md +8 -0
- package/.agent/skills/authentication-best-practices/SKILL.md +10 -0
- package/.agent/skills/autonomous-execution/SKILL.md +9 -0
- package/.agent/skills/backend-alembic/SKILL.md +16 -0
- package/.agent/skills/backend-architecture-auditor/SKILL.md +16 -0
- package/.agent/skills/backend-mongodb/SKILL.md +10 -0
- package/.agent/skills/backend-mysql/SKILL.md +16 -0
- package/.agent/skills/backend-performance-auditor/SKILL.md +10 -0
- package/.agent/skills/backend-postgresql/SKILL.md +10 -0
- package/.agent/skills/backend-redis/SKILL.md +10 -0
- package/.agent/skills/backend-security-expert/SKILL.md +10 -0
- package/.agent/skills/backend-sqlalchemy/SKILL.md +10 -0
- package/.agent/skills/backend-sqlite/SKILL.md +10 -0
- package/.agent/skills/backend-testing-auditor/SKILL.md +15 -0
- package/.agent/skills/baseline-ui/SKILL.md +8 -0
- package/.agent/skills/bash-linux/SKILL.md +9 -0
- package/.agent/skills/behavioral-modes/SKILL.md +9 -0
- package/.agent/skills/better-colors/SKILL.md +9 -0
- package/.agent/skills/better-typography/SKILL.md +9 -0
- package/.agent/skills/better-ui/SKILL.md +8 -0
- package/.agent/skills/bolder/SKILL.md +8 -0
- package/.agent/skills/brainstorming/SKILL.md +8 -0
- package/.agent/skills/browser-audit/SKILL.md +9 -0
- package/.agent/skills/browser-native-ai/SKILL.md +8 -0
- package/.agent/skills/build-primitive/SKILL.md +8 -0
- package/.agent/skills/building-native-ui/SKILL.md +7 -0
- package/.agent/skills/cicd-pro/SKILL.md +9 -0
- package/.agent/skills/clarify/SKILL.md +8 -0
- package/.agent/skills/clean-code/SKILL.md +8 -0
- package/.agent/skills/cloud-architect/SKILL.md +8 -0
- package/.agent/skills/cobejs/SKILL.md +8 -0
- package/.agent/skills/code-review-checklist/SKILL.md +9 -0
- package/.agent/skills/codebase-design/SKILL.md +14 -0
- package/.agent/skills/colorize/SKILL.md +8 -0
- package/.agent/skills/compact-landing/SKILL.md +9 -0
- package/.agent/skills/company-logos/SKILL.md +9 -0
- package/.agent/skills/config-validator/SKILL.md +9 -0
- package/.agent/skills/containerization-pro/SKILL.md +9 -0
- package/.agent/skills/context-engineering-pro/SKILL.md +10 -0
- package/.agent/skills/create-design-md/SKILL.md +7 -0
- package/.agent/skills/critique/SKILL.md +8 -0
- package/.agent/skills/csharp-developer/SKILL.md +9 -0
- package/.agent/skills/data-validation-schemas/SKILL.md +8 -0
- package/.agent/skills/database-design/SKILL.md +8 -0
- package/.agent/skills/delight/SKILL.md +8 -0
- package/.agent/skills/deployment-procedures/SKILL.md +9 -0
- package/.agent/skills/design-lab/SKILL.md +8 -0
- package/.agent/skills/devops-engineer/SKILL.md +9 -0
- package/.agent/skills/devops-incident-responder/SKILL.md +16 -0
- package/.agent/skills/diagnosing-bugs/SKILL.md +9 -0
- package/.agent/skills/distill/SKILL.md +8 -0
- package/.agent/skills/documentation-templates/SKILL.md +9 -0
- package/.agent/skills/domain-modeling/SKILL.md +9 -0
- package/.agent/skills/duckdb-analytical-sql/SKILL.md +10 -0
- package/.agent/skills/edge-ai-mobile/SKILL.md +8 -0
- package/.agent/skills/edge-computing/SKILL.md +9 -0
- package/.agent/skills/emil-design-eng/SKILL.md +9 -0
- package/.agent/skills/error-resilience/SKILL.md +8 -0
- package/.agent/skills/expo-router-v4/SKILL.md +9 -0
- package/.agent/skills/extract-design-system/SKILL.md +9 -0
- package/.agent/skills/fabel-protocol/SKILL.md +9 -0
- package/.agent/skills/failure-mode-analysis/SKILL.md +10 -0
- package/.agent/skills/fastapi-pro/SKILL.md +9 -0
- package/.agent/skills/fixing-accessibility/SKILL.md +9 -0
- package/.agent/skills/fixing-metadata/SKILL.md +9 -0
- package/.agent/skills/fixing-motion-performance/SKILL.md +9 -0
- package/.agent/skills/framer-motion-expert/SKILL.md +9 -0
- package/.agent/skills/frontend-design/SKILL.md +7 -0
- package/.agent/skills/frontend-security-expert/SKILL.md +9 -0
- package/.agent/skills/game-design-expert/SKILL.md +9 -0
- package/.agent/skills/game-engineering-expert/SKILL.md +16 -0
- package/.agent/skills/generative-ui-expert/SKILL.md +9 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +9 -0
- package/.agent/skills/git-pro/SKILL.md +9 -0
- package/.agent/skills/github-operations/SKILL.md +9 -0
- package/.agent/skills/gpt-taste/SKILL.md +9 -0
- package/.agent/skills/graph-engineering/SKILL.md +16 -0
- package/.agent/skills/gsap-core/SKILL.md +9 -0
- package/.agent/skills/gsap-frameworks/SKILL.md +9 -0
- package/.agent/skills/gsap-performance/SKILL.md +9 -0
- package/.agent/skills/gsap-plugins/SKILL.md +9 -0
- package/.agent/skills/gsap-react/SKILL.md +9 -0
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +9 -0
- package/.agent/skills/gsap-timeline/SKILL.md +9 -0
- package/.agent/skills/gsap-utils/SKILL.md +9 -0
- package/.agent/skills/harden/SKILL.md +8 -0
- package/.agent/skills/harness-protocol/SKILL.md +9 -0
- package/.agent/skills/hf-cli/SKILL.md +11 -0
- package/.agent/skills/hf-cloud-aws-context-discovery/SKILL.md +10 -0
- package/.agent/skills/hf-cloud-python-env-setup/SKILL.md +10 -0
- package/.agent/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +10 -0
- package/.agent/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +10 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +10 -0
- package/.agent/skills/hf-cloud-serving-image-selection/SKILL.md +10 -0
- package/.agent/skills/hf-mem/SKILL.md +11 -0
- package/.agent/skills/huggingface-best/SKILL.md +9 -0
- package/.agent/skills/huggingface-community-evals/SKILL.md +11 -0
- package/.agent/skills/huggingface-datasets/SKILL.md +10 -0
- package/.agent/skills/huggingface-gradio/SKILL.md +10 -0
- package/.agent/skills/huggingface-llm-trainer/SKILL.md +10 -0
- package/.agent/skills/huggingface-local-models/SKILL.md +10 -0
- package/.agent/skills/huggingface-lora-space-builder/SKILL.md +11 -0
- package/.agent/skills/huggingface-paper-publisher/SKILL.md +11 -0
- package/.agent/skills/huggingface-papers/SKILL.md +11 -0
- package/.agent/skills/huggingface-spaces/SKILL.md +10 -0
- package/.agent/skills/huggingface-tool-builder/SKILL.md +11 -0
- package/.agent/skills/huggingface-trackio/SKILL.md +11 -0
- package/.agent/skills/huggingface-vision-trainer/SKILL.md +11 -0
- package/.agent/skills/huggingface-zerogpu/SKILL.md +11 -0
- package/.agent/skills/human-gate-negotiation/SKILL.md +11 -0
- package/.agent/skills/i18n-localization/SKILL.md +9 -0
- package/.agent/skills/impeccable/SKILL.md +8 -0
- package/.agent/skills/improve-codebase-architecture/SKILL.md +10 -0
- package/.agent/skills/improve-ui/SKILL.md +8 -0
- package/.agent/skills/intelligent-routing/SKILL.md +9 -0
- package/.agent/skills/knowledge-graph/SKILL.md +9 -0
- package/.agent/skills/landing-page/SKILL.md +9 -0
- package/.agent/skills/lint-and-validate/SKILL.md +9 -0
- package/.agent/skills/llm-engineering/SKILL.md +9 -0
- package/.agent/skills/local-first/SKILL.md +10 -0
- package/.agent/skills/lottie-animation/SKILL.md +9 -0
- package/.agent/skills/marquee-loop/SKILL.md +9 -0
- package/.agent/skills/masked-reveal/SKILL.md +9 -0
- package/.agent/skills/mcp-builder/SKILL.md +9 -0
- package/.agent/skills/micro-interaction/SKILL.md +9 -0
- package/.agent/skills/mobile-design/SKILL.md +7 -0
- package/.agent/skills/monorepo-management/SKILL.md +9 -0
- package/.agent/skills/morphing-icons/SKILL.md +9 -0
- package/.agent/skills/motion-engineering/SKILL.md +8 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +10 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +16 -0
- package/.agent/skills/observability/SKILL.md +8 -0
- package/.agent/skills/opentelemetry-observability/SKILL.md +9 -0
- package/.agent/skills/page-transition-animation/SKILL.md +10 -0
- package/.agent/skills/parallel-agents/SKILL.md +15 -0
- package/.agent/skills/performance-profiling/SKILL.md +9 -0
- package/.agent/skills/plan-writing/SKILL.md +8 -0
- package/.agent/skills/platform-engineer/SKILL.md +9 -0
- package/.agent/skills/platform-engineering-opentofu/SKILL.md +10 -0
- package/.agent/skills/playwright-ai-e2e/SKILL.md +9 -0
- package/.agent/skills/playwright-best-practices/SKILL.md +16 -0
- package/.agent/skills/polish/SKILL.md +8 -0
- package/.agent/skills/powershell-windows/SKILL.md +9 -0
- package/.agent/skills/pricing-page/SKILL.md +9 -0
- package/.agent/skills/product-aware-heuristics/SKILL.md +10 -0
- package/.agent/skills/progressive-blur/SKILL.md +9 -0
- package/.agent/skills/project-idioms/SKILL.md +8 -0
- package/.agent/skills/property-based-testing/SKILL.md +9 -0
- package/.agent/skills/python-patterns/SKILL.md +9 -0
- package/.agent/skills/python-pro/SKILL.md +9 -0
- package/.agent/skills/quieter/SKILL.md +8 -0
- package/.agent/skills/react-doctor/SKILL.md +9 -0
- package/.agent/skills/react-specialist/SKILL.md +9 -0
- package/.agent/skills/readme-builder/SKILL.md +9 -0
- package/.agent/skills/realtime-patterns/SKILL.md +9 -0
- package/.agent/skills/red-team-tactics/SKILL.md +16 -0
- package/.agent/skills/redesign-skill/SKILL.md +9 -0
- package/.agent/skills/review-animations/SKILL.md +8 -0
- package/.agent/skills/rust-pro/SKILL.md +9 -0
- package/.agent/skills/semantic-filesystem-navigation/SKILL.md +11 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +9 -0
- package/.agent/skills/server-management/SKILL.md +8 -0
- package/.agent/skills/session-log-interrogation/SKILL.md +11 -0
- package/.agent/skills/shadcn-ui-expert/SKILL.md +9 -0
- package/.agent/skills/shape/SKILL.md +8 -0
- package/.agent/skills/skill-creator/SKILL.md +9 -0
- package/.agent/skills/soft-skill/SKILL.md +9 -0
- package/.agent/skills/sounds-on-the-web/SKILL.md +9 -0
- package/.agent/skills/sql-pro/SKILL.md +9 -0
- package/.agent/skills/subagent-driven-development/SKILL.md +11 -0
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +17 -0
- package/.agent/skills/svg-animation/SKILL.md +9 -0
- package/.agent/skills/swiftui-expert/SKILL.md +9 -0
- package/.agent/skills/swiss-design/SKILL.md +8 -0
- package/.agent/skills/system-design-pro/SKILL.md +9 -0
- package/.agent/skills/systematic-debugging/SKILL.md +14 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +9 -0
- package/.agent/skills/taste-skill/SKILL.md +9 -0
- package/.agent/skills/tdd-workflow/SKILL.md +9 -0
- package/.agent/skills/test-result-analyzer/SKILL.md +9 -0
- package/.agent/skills/testing-patterns/SKILL.md +8 -0
- package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +11 -0
- package/.agent/skills/thinking-protocol/SKILL.md +10 -0
- package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +9 -0
- package/.agent/skills/train-sentence-transformers/SKILL.md +10 -0
- package/.agent/skills/transformers-js/SKILL.md +8 -0
- package/.agent/skills/transitions-dev/SKILL.md +8 -0
- package/.agent/skills/trend-researcher/SKILL.md +9 -0
- package/.agent/skills/tribunal-instincts-memory/SKILL.md +11 -0
- package/.agent/skills/trl-training/SKILL.md +9 -0
- package/.agent/skills/typescript-advanced/SKILL.md +9 -0
- package/.agent/skills/typeset/SKILL.md +8 -0
- package/.agent/skills/ui-reasoning-engine/SKILL.md +9 -0
- package/.agent/skills/ui-skill-packs/SKILL.md +9 -0
- package/.agent/skills/ui-skills-root/SKILL.md +9 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +9 -0
- package/.agent/skills/ui-ux-researcher/SKILL.md +8 -0
- package/.agent/skills/vector-search-pgvector/SKILL.md +10 -0
- package/.agent/skills/verification-before-completion/SKILL.md +9 -0
- package/.agent/skills/vue-expert/SKILL.md +9 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +9 -0
- package/.agent/skills/web-accessibility-auditor/SKILL.md +16 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +9 -0
- package/.agent/skills/web-quality-audit/SKILL.md +10 -0
- package/.agent/skills/webapp-testing/SKILL.md +8 -0
- package/.agent/skills/webgpu-performance/SKILL.md +9 -0
- package/.agent/skills/whimsy-injector/SKILL.md +9 -0
- package/.agent/skills/workflow-optimizer/SKILL.md +9 -0
- package/.agent/skills/zero-trust-passkeys/SKILL.md +10 -0
- package/.agent/skills_inventory.json +502 -3167
- package/.agent/workflows/arch.md +96 -80
- package/.agent/workflows/skill-intelligence.md +216 -0
- package/.agents/skills/12-principles-of-animation/SKILL.md +9 -0
- package/.agents/skills/60fps-animation/SKILL.md +14 -0
- package/.agents/skills/accessible-animation/SKILL.md +9 -0
- package/.agents/skills/adapt/SKILL.md +8 -0
- package/.agents/skills/adr-generation/SKILL.md +9 -0
- package/.agents/skills/advanced-rag-pipelines/SKILL.md +9 -0
- package/.agents/skills/agent-organizer/SKILL.md +8 -0
- package/.agents/skills/agent-syscall-guidelines/SKILL.md +10 -0
- package/.agents/skills/agentic-patterns/SKILL.md +9 -0
- package/.agents/skills/agentic-workflows-2026/SKILL.md +8 -0
- package/.agents/skills/agentshield-security/SKILL.md +16 -0
- package/.agents/skills/ai-app-hardening/SKILL.md +7 -0
- package/.agents/skills/ai-prompt-injection-defense/SKILL.md +9 -0
- package/.agents/skills/animation-on-scroll/SKILL.md +9 -0
- package/.agents/skills/animation-systems/SKILL.md +8 -0
- package/.agents/skills/antfu-conventions/SKILL.md +9 -0
- package/.agents/skills/anti-slop-enforcement/SKILL.md +11 -0
- package/.agents/skills/api-patterns/SKILL.md +9 -0
- package/.agents/skills/api-security-auditor/SKILL.md +10 -0
- package/.agents/skills/app-builder/SKILL.md +8 -0
- package/.agents/skills/appflow-wireframe/SKILL.md +9 -0
- package/.agents/skills/apple-design/SKILL.md +8 -0
- package/.agents/skills/architecture/SKILL.md +8 -0
- package/.agents/skills/architecture-drift/SKILL.md +9 -0
- package/.agents/skills/architecture-intelligence/SKILL.md +17 -0
- package/.agents/skills/audit-and-fix/SKILL.md +8 -0
- package/.agents/skills/authentication-best-practices/SKILL.md +10 -0
- package/.agents/skills/autonomous-execution/SKILL.md +9 -0
- package/.agents/skills/backend-alembic/SKILL.md +16 -0
- package/.agents/skills/backend-architecture-auditor/SKILL.md +16 -0
- package/.agents/skills/backend-mongodb/SKILL.md +10 -0
- package/.agents/skills/backend-mysql/SKILL.md +16 -0
- package/.agents/skills/backend-performance-auditor/SKILL.md +10 -0
- package/.agents/skills/backend-postgresql/SKILL.md +10 -0
- package/.agents/skills/backend-redis/SKILL.md +10 -0
- package/.agents/skills/backend-security-expert/SKILL.md +10 -0
- package/.agents/skills/backend-sqlalchemy/SKILL.md +10 -0
- package/.agents/skills/backend-sqlite/SKILL.md +10 -0
- package/.agents/skills/backend-testing-auditor/SKILL.md +15 -0
- package/.agents/skills/baseline-ui/SKILL.md +8 -0
- package/.agents/skills/bash-linux/SKILL.md +9 -0
- package/.agents/skills/behavioral-modes/SKILL.md +9 -0
- package/.agents/skills/better-colors/SKILL.md +9 -0
- package/.agents/skills/better-typography/SKILL.md +9 -0
- package/.agents/skills/better-ui/SKILL.md +8 -0
- package/.agents/skills/bolder/SKILL.md +8 -0
- package/.agents/skills/brainstorming/SKILL.md +8 -0
- package/.agents/skills/browser-audit/SKILL.md +9 -0
- package/.agents/skills/browser-native-ai/SKILL.md +8 -0
- package/.agents/skills/build-primitive/SKILL.md +8 -0
- package/.agents/skills/building-native-ui/SKILL.md +7 -0
- package/.agents/skills/cicd-pro/SKILL.md +9 -0
- package/.agents/skills/clarify/SKILL.md +8 -0
- package/.agents/skills/clean-code/SKILL.md +8 -0
- package/.agents/skills/cloud-architect/SKILL.md +8 -0
- package/.agents/skills/cobejs/SKILL.md +8 -0
- package/.agents/skills/code-review-checklist/SKILL.md +9 -0
- package/.agents/skills/codebase-design/SKILL.md +14 -0
- package/.agents/skills/colorize/SKILL.md +8 -0
- package/.agents/skills/compact-landing/SKILL.md +9 -0
- package/.agents/skills/company-logos/SKILL.md +9 -0
- package/.agents/skills/config-validator/SKILL.md +9 -0
- package/.agents/skills/containerization-pro/SKILL.md +9 -0
- package/.agents/skills/context-engineering-pro/SKILL.md +10 -0
- package/.agents/skills/create-design-md/SKILL.md +7 -0
- package/.agents/skills/critique/SKILL.md +8 -0
- package/.agents/skills/csharp-developer/SKILL.md +9 -0
- package/.agents/skills/data-validation-schemas/SKILL.md +8 -0
- package/.agents/skills/database-design/SKILL.md +8 -0
- package/.agents/skills/delight/SKILL.md +8 -0
- package/.agents/skills/deployment-procedures/SKILL.md +9 -0
- package/.agents/skills/design-lab/SKILL.md +8 -0
- package/.agents/skills/devops-engineer/SKILL.md +9 -0
- package/.agents/skills/devops-incident-responder/SKILL.md +16 -0
- package/.agents/skills/diagnosing-bugs/SKILL.md +9 -0
- package/.agents/skills/distill/SKILL.md +8 -0
- package/.agents/skills/documentation-templates/SKILL.md +9 -0
- package/.agents/skills/domain-modeling/SKILL.md +9 -0
- package/.agents/skills/duckdb-analytical-sql/SKILL.md +10 -0
- package/.agents/skills/edge-ai-mobile/SKILL.md +8 -0
- package/.agents/skills/edge-computing/SKILL.md +9 -0
- package/.agents/skills/emil-design-eng/SKILL.md +9 -0
- package/.agents/skills/error-resilience/SKILL.md +8 -0
- package/.agents/skills/expo-router-v4/SKILL.md +9 -0
- package/.agents/skills/extract-design-system/SKILL.md +9 -0
- package/.agents/skills/fabel-protocol/SKILL.md +9 -0
- package/.agents/skills/failure-mode-analysis/SKILL.md +10 -0
- package/.agents/skills/fastapi-pro/SKILL.md +9 -0
- package/.agents/skills/fixing-accessibility/SKILL.md +9 -0
- package/.agents/skills/fixing-metadata/SKILL.md +9 -0
- package/.agents/skills/fixing-motion-performance/SKILL.md +9 -0
- package/.agents/skills/framer-motion-expert/SKILL.md +9 -0
- package/.agents/skills/frontend-design/SKILL.md +7 -0
- package/.agents/skills/frontend-security-expert/SKILL.md +9 -0
- package/.agents/skills/game-design-expert/SKILL.md +9 -0
- package/.agents/skills/game-engineering-expert/SKILL.md +16 -0
- package/.agents/skills/generative-ui-expert/SKILL.md +9 -0
- package/.agents/skills/geo-fundamentals/SKILL.md +9 -0
- package/.agents/skills/git-pro/SKILL.md +9 -0
- package/.agents/skills/github-operations/SKILL.md +9 -0
- package/.agents/skills/gpt-taste/SKILL.md +9 -0
- package/.agents/skills/graph-engineering/SKILL.md +16 -0
- package/.agents/skills/gsap-core/SKILL.md +9 -0
- package/.agents/skills/gsap-frameworks/SKILL.md +9 -0
- package/.agents/skills/gsap-performance/SKILL.md +9 -0
- package/.agents/skills/gsap-plugins/SKILL.md +9 -0
- package/.agents/skills/gsap-react/SKILL.md +9 -0
- package/.agents/skills/gsap-scrolltrigger/SKILL.md +9 -0
- package/.agents/skills/gsap-timeline/SKILL.md +9 -0
- package/.agents/skills/gsap-utils/SKILL.md +9 -0
- package/.agents/skills/harden/SKILL.md +8 -0
- package/.agents/skills/harness-protocol/SKILL.md +9 -0
- package/.agents/skills/hf-cli/SKILL.md +11 -0
- package/.agents/skills/hf-cloud-aws-context-discovery/SKILL.md +10 -0
- package/.agents/skills/hf-cloud-python-env-setup/SKILL.md +10 -0
- package/.agents/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +10 -0
- package/.agents/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +10 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +10 -0
- package/.agents/skills/hf-cloud-serving-image-selection/SKILL.md +10 -0
- package/.agents/skills/hf-mem/SKILL.md +11 -0
- package/.agents/skills/huggingface-best/SKILL.md +9 -0
- package/.agents/skills/huggingface-community-evals/SKILL.md +11 -0
- package/.agents/skills/huggingface-datasets/SKILL.md +10 -0
- package/.agents/skills/huggingface-gradio/SKILL.md +10 -0
- package/.agents/skills/huggingface-llm-trainer/SKILL.md +10 -0
- package/.agents/skills/huggingface-local-models/SKILL.md +10 -0
- package/.agents/skills/huggingface-lora-space-builder/SKILL.md +11 -0
- package/.agents/skills/huggingface-paper-publisher/SKILL.md +11 -0
- package/.agents/skills/huggingface-papers/SKILL.md +11 -0
- package/.agents/skills/huggingface-spaces/SKILL.md +10 -0
- package/.agents/skills/huggingface-tool-builder/SKILL.md +11 -0
- package/.agents/skills/huggingface-trackio/SKILL.md +11 -0
- package/.agents/skills/huggingface-vision-trainer/SKILL.md +11 -0
- package/.agents/skills/huggingface-zerogpu/SKILL.md +11 -0
- package/.agents/skills/human-gate-negotiation/SKILL.md +11 -0
- package/.agents/skills/i18n-localization/SKILL.md +9 -0
- package/.agents/skills/impeccable/SKILL.md +8 -0
- package/.agents/skills/improve-codebase-architecture/SKILL.md +10 -0
- package/.agents/skills/improve-ui/SKILL.md +8 -0
- package/.agents/skills/intelligent-routing/SKILL.md +9 -0
- package/.agents/skills/knowledge-graph/SKILL.md +9 -0
- package/.agents/skills/landing-page/SKILL.md +9 -0
- package/.agents/skills/lint-and-validate/SKILL.md +9 -0
- package/.agents/skills/llm-engineering/SKILL.md +9 -0
- package/.agents/skills/local-first/SKILL.md +10 -0
- package/.agents/skills/lottie-animation/SKILL.md +9 -0
- package/.agents/skills/marquee-loop/SKILL.md +9 -0
- package/.agents/skills/masked-reveal/SKILL.md +9 -0
- package/.agents/skills/mcp-builder/SKILL.md +9 -0
- package/.agents/skills/micro-interaction/SKILL.md +9 -0
- package/.agents/skills/mobile-design/SKILL.md +7 -0
- package/.agents/skills/monorepo-management/SKILL.md +9 -0
- package/.agents/skills/morphing-icons/SKILL.md +9 -0
- package/.agents/skills/motion-engineering/SKILL.md +8 -0
- package/.agents/skills/nextjs-react-expert/SKILL.md +10 -0
- package/.agents/skills/nodejs-best-practices/SKILL.md +16 -0
- package/.agents/skills/observability/SKILL.md +8 -0
- package/.agents/skills/opentelemetry-observability/SKILL.md +9 -0
- package/.agents/skills/page-transition-animation/SKILL.md +10 -0
- package/.agents/skills/parallel-agents/SKILL.md +15 -0
- package/.agents/skills/performance-profiling/SKILL.md +9 -0
- package/.agents/skills/plan-writing/SKILL.md +8 -0
- package/.agents/skills/platform-engineer/SKILL.md +9 -0
- package/.agents/skills/platform-engineering-opentofu/SKILL.md +10 -0
- package/.agents/skills/playwright-ai-e2e/SKILL.md +9 -0
- package/.agents/skills/playwright-best-practices/SKILL.md +16 -0
- package/.agents/skills/polish/SKILL.md +8 -0
- package/.agents/skills/powershell-windows/SKILL.md +9 -0
- package/.agents/skills/pricing-page/SKILL.md +9 -0
- package/.agents/skills/product-aware-heuristics/SKILL.md +10 -0
- package/.agents/skills/progressive-blur/SKILL.md +9 -0
- package/.agents/skills/project-idioms/SKILL.md +8 -0
- package/.agents/skills/property-based-testing/SKILL.md +9 -0
- package/.agents/skills/python-patterns/SKILL.md +9 -0
- package/.agents/skills/python-pro/SKILL.md +9 -0
- package/.agents/skills/quieter/SKILL.md +8 -0
- package/.agents/skills/react-doctor/SKILL.md +9 -0
- package/.agents/skills/react-specialist/SKILL.md +9 -0
- package/.agents/skills/readme-builder/SKILL.md +9 -0
- package/.agents/skills/realtime-patterns/SKILL.md +9 -0
- package/.agents/skills/red-team-tactics/SKILL.md +16 -0
- package/.agents/skills/redesign-skill/SKILL.md +9 -0
- package/.agents/skills/review-animations/SKILL.md +8 -0
- package/.agents/skills/rust-pro/SKILL.md +9 -0
- package/.agents/skills/semantic-filesystem-navigation/SKILL.md +11 -0
- package/.agents/skills/seo-fundamentals/SKILL.md +9 -0
- package/.agents/skills/server-management/SKILL.md +8 -0
- package/.agents/skills/session-log-interrogation/SKILL.md +11 -0
- package/.agents/skills/shadcn-ui-expert/SKILL.md +9 -0
- package/.agents/skills/shape/SKILL.md +8 -0
- package/.agents/skills/skill-creator/SKILL.md +9 -0
- package/.agents/skills/soft-skill/SKILL.md +9 -0
- package/.agents/skills/sounds-on-the-web/SKILL.md +9 -0
- package/.agents/skills/sql-pro/SKILL.md +9 -0
- package/.agents/skills/subagent-driven-development/SKILL.md +11 -0
- package/.agents/skills/supabase-postgres-best-practices/SKILL.md +17 -0
- package/.agents/skills/svg-animation/SKILL.md +9 -0
- package/.agents/skills/swiftui-expert/SKILL.md +9 -0
- package/.agents/skills/swiss-design/SKILL.md +8 -0
- package/.agents/skills/system-design-pro/SKILL.md +9 -0
- package/.agents/skills/systematic-debugging/SKILL.md +14 -0
- package/.agents/skills/tailwind-patterns/SKILL.md +9 -0
- package/.agents/skills/taste-skill/SKILL.md +9 -0
- package/.agents/skills/tdd-workflow/SKILL.md +9 -0
- package/.agents/skills/test-result-analyzer/SKILL.md +9 -0
- package/.agents/skills/testing-patterns/SKILL.md +8 -0
- package/.agents/skills/thermo-nuclear-code-quality-review/SKILL.md +11 -0
- package/.agents/skills/thinking-protocol/SKILL.md +10 -0
- package/.agents/skills/to-spring-or-not-to-spring/SKILL.md +9 -0
- package/.agents/skills/train-sentence-transformers/SKILL.md +10 -0
- package/.agents/skills/transformers-js/SKILL.md +8 -0
- package/.agents/skills/transitions-dev/SKILL.md +8 -0
- package/.agents/skills/trend-researcher/SKILL.md +9 -0
- package/.agents/skills/tribunal-instincts-memory/SKILL.md +11 -0
- package/.agents/skills/trl-training/SKILL.md +9 -0
- package/.agents/skills/typescript-advanced/SKILL.md +9 -0
- package/.agents/skills/typeset/SKILL.md +8 -0
- package/.agents/skills/ui-reasoning-engine/SKILL.md +9 -0
- package/.agents/skills/ui-skill-packs/SKILL.md +9 -0
- package/.agents/skills/ui-skills-root/SKILL.md +9 -0
- package/.agents/skills/ui-ux-pro-max/SKILL.md +9 -0
- package/.agents/skills/ui-ux-researcher/SKILL.md +8 -0
- package/.agents/skills/vector-search-pgvector/SKILL.md +10 -0
- package/.agents/skills/verification-before-completion/SKILL.md +9 -0
- package/.agents/skills/vue-expert/SKILL.md +9 -0
- package/.agents/skills/vulnerability-scanner/SKILL.md +9 -0
- package/.agents/skills/web-accessibility-auditor/SKILL.md +16 -0
- package/.agents/skills/web-design-guidelines/SKILL.md +9 -0
- package/.agents/skills/web-quality-audit/SKILL.md +10 -0
- package/.agents/skills/webapp-testing/SKILL.md +8 -0
- package/.agents/skills/webgpu-performance/SKILL.md +9 -0
- package/.agents/skills/whimsy-injector/SKILL.md +9 -0
- package/.agents/skills/workflow-optimizer/SKILL.md +9 -0
- package/.agents/skills/zero-trust-passkeys/SKILL.md +10 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +25 -25
- package/bin/adapter-install.js +1 -1
- package/bin/mcp-server.js +249 -0
- package/package.json +11 -8
- package/plugins/core-plugin.json +1 -1
- package/plugins/gemini/extension.json +1 -1
- package/skills/12-principles-of-animation/SKILL.md +9 -0
- package/skills/60fps-animation/SKILL.md +14 -0
- package/skills/accessible-animation/SKILL.md +9 -0
- package/skills/adapt/SKILL.md +8 -0
- package/skills/adr-generation/SKILL.md +9 -0
- package/skills/advanced-rag-pipelines/SKILL.md +9 -0
- package/skills/agent-organizer/SKILL.md +8 -0
- package/skills/agent-syscall-guidelines/SKILL.md +10 -0
- package/skills/agentic-patterns/SKILL.md +9 -0
- package/skills/agentic-workflows-2026/SKILL.md +8 -0
- package/skills/agentshield-security/SKILL.md +16 -0
- package/skills/ai-app-hardening/SKILL.md +7 -0
- package/skills/ai-prompt-injection-defense/SKILL.md +9 -0
- package/skills/animation-on-scroll/SKILL.md +9 -0
- package/skills/animation-systems/SKILL.md +8 -0
- package/skills/antfu-conventions/SKILL.md +9 -0
- package/skills/anti-slop-enforcement/SKILL.md +11 -0
- package/skills/api-patterns/SKILL.md +9 -0
- package/skills/api-security-auditor/SKILL.md +10 -0
- package/skills/app-builder/SKILL.md +8 -0
- package/skills/appflow-wireframe/SKILL.md +9 -0
- package/skills/apple-design/SKILL.md +8 -0
- package/skills/architecture/SKILL.md +8 -0
- package/skills/architecture-drift/SKILL.md +9 -0
- package/skills/architecture-intelligence/SKILL.md +17 -0
- package/skills/audit-and-fix/SKILL.md +8 -0
- package/skills/authentication-best-practices/SKILL.md +10 -0
- package/skills/autonomous-execution/SKILL.md +9 -0
- package/skills/backend-alembic/SKILL.md +16 -0
- package/skills/backend-architecture-auditor/SKILL.md +16 -0
- package/skills/backend-mongodb/SKILL.md +10 -0
- package/skills/backend-mysql/SKILL.md +16 -0
- package/skills/backend-performance-auditor/SKILL.md +10 -0
- package/skills/backend-postgresql/SKILL.md +10 -0
- package/skills/backend-redis/SKILL.md +10 -0
- package/skills/backend-security-expert/SKILL.md +10 -0
- package/skills/backend-sqlalchemy/SKILL.md +10 -0
- package/skills/backend-sqlite/SKILL.md +10 -0
- package/skills/backend-testing-auditor/SKILL.md +15 -0
- package/skills/baseline-ui/SKILL.md +8 -0
- package/skills/bash-linux/SKILL.md +9 -0
- package/skills/behavioral-modes/SKILL.md +9 -0
- package/skills/better-colors/SKILL.md +9 -0
- package/skills/better-typography/SKILL.md +9 -0
- package/skills/better-ui/SKILL.md +8 -0
- package/skills/bolder/SKILL.md +8 -0
- package/skills/brainstorming/SKILL.md +8 -0
- package/skills/browser-audit/SKILL.md +9 -0
- package/skills/browser-native-ai/SKILL.md +8 -0
- package/skills/build-primitive/SKILL.md +8 -0
- package/skills/building-native-ui/SKILL.md +7 -0
- package/skills/cicd-pro/SKILL.md +9 -0
- package/skills/clarify/SKILL.md +8 -0
- package/skills/clean-code/SKILL.md +8 -0
- package/skills/cloud-architect/SKILL.md +8 -0
- package/skills/cobejs/SKILL.md +8 -0
- package/skills/code-review-checklist/SKILL.md +9 -0
- package/skills/codebase-design/SKILL.md +14 -0
- package/skills/colorize/SKILL.md +8 -0
- package/skills/compact-landing/SKILL.md +9 -0
- package/skills/company-logos/SKILL.md +9 -0
- package/skills/config-validator/SKILL.md +9 -0
- package/skills/containerization-pro/SKILL.md +9 -0
- package/skills/context-engineering-pro/SKILL.md +10 -0
- package/skills/create-design-md/SKILL.md +7 -0
- package/skills/critique/SKILL.md +8 -0
- package/skills/csharp-developer/SKILL.md +9 -0
- package/skills/data-validation-schemas/SKILL.md +8 -0
- package/skills/database-design/SKILL.md +8 -0
- package/skills/delight/SKILL.md +8 -0
- package/skills/deployment-procedures/SKILL.md +9 -0
- package/skills/design-lab/SKILL.md +8 -0
- package/skills/devops-engineer/SKILL.md +9 -0
- package/skills/devops-incident-responder/SKILL.md +16 -0
- package/skills/diagnosing-bugs/SKILL.md +9 -0
- package/skills/distill/SKILL.md +8 -0
- package/skills/documentation-templates/SKILL.md +9 -0
- package/skills/domain-modeling/SKILL.md +9 -0
- package/skills/duckdb-analytical-sql/SKILL.md +10 -0
- package/skills/edge-ai-mobile/SKILL.md +8 -0
- package/skills/edge-computing/SKILL.md +9 -0
- package/skills/emil-design-eng/SKILL.md +9 -0
- package/skills/error-resilience/SKILL.md +8 -0
- package/skills/expo-router-v4/SKILL.md +9 -0
- package/skills/extract-design-system/SKILL.md +9 -0
- package/skills/fabel-protocol/SKILL.md +9 -0
- package/skills/failure-mode-analysis/SKILL.md +10 -0
- package/skills/fastapi-pro/SKILL.md +9 -0
- package/skills/fixing-accessibility/SKILL.md +9 -0
- package/skills/fixing-metadata/SKILL.md +9 -0
- package/skills/fixing-motion-performance/SKILL.md +9 -0
- package/skills/framer-motion-expert/SKILL.md +9 -0
- package/skills/frontend-design/SKILL.md +7 -0
- package/skills/frontend-security-expert/SKILL.md +9 -0
- package/skills/game-design-expert/SKILL.md +9 -0
- package/skills/game-engineering-expert/SKILL.md +16 -0
- package/skills/generative-ui-expert/SKILL.md +9 -0
- package/skills/geo-fundamentals/SKILL.md +9 -0
- package/skills/git-pro/SKILL.md +9 -0
- package/skills/github-operations/SKILL.md +9 -0
- package/skills/gpt-taste/SKILL.md +9 -0
- package/skills/graph-engineering/SKILL.md +16 -0
- package/skills/gsap-core/SKILL.md +9 -0
- package/skills/gsap-frameworks/SKILL.md +9 -0
- package/skills/gsap-performance/SKILL.md +9 -0
- package/skills/gsap-plugins/SKILL.md +9 -0
- package/skills/gsap-react/SKILL.md +9 -0
- package/skills/gsap-scrolltrigger/SKILL.md +9 -0
- package/skills/gsap-timeline/SKILL.md +9 -0
- package/skills/gsap-utils/SKILL.md +9 -0
- package/skills/harden/SKILL.md +8 -0
- package/skills/harness-protocol/SKILL.md +9 -0
- package/skills/hf-cli/SKILL.md +11 -0
- package/skills/hf-cloud-aws-context-discovery/SKILL.md +10 -0
- package/skills/hf-cloud-python-env-setup/SKILL.md +10 -0
- package/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +10 -0
- package/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +10 -0
- package/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +10 -0
- package/skills/hf-cloud-serving-image-selection/SKILL.md +10 -0
- package/skills/hf-mem/SKILL.md +11 -0
- package/skills/huggingface-best/SKILL.md +9 -0
- package/skills/huggingface-community-evals/SKILL.md +11 -0
- package/skills/huggingface-datasets/SKILL.md +10 -0
- package/skills/huggingface-gradio/SKILL.md +10 -0
- package/skills/huggingface-llm-trainer/SKILL.md +10 -0
- package/skills/huggingface-local-models/SKILL.md +10 -0
- package/skills/huggingface-lora-space-builder/SKILL.md +11 -0
- package/skills/huggingface-paper-publisher/SKILL.md +11 -0
- package/skills/huggingface-papers/SKILL.md +11 -0
- package/skills/huggingface-spaces/SKILL.md +10 -0
- package/skills/huggingface-tool-builder/SKILL.md +11 -0
- package/skills/huggingface-trackio/SKILL.md +11 -0
- package/skills/huggingface-vision-trainer/SKILL.md +11 -0
- package/skills/huggingface-zerogpu/SKILL.md +11 -0
- package/skills/human-gate-negotiation/SKILL.md +11 -0
- package/skills/i18n-localization/SKILL.md +9 -0
- package/skills/impeccable/SKILL.md +8 -0
- package/skills/improve-codebase-architecture/SKILL.md +10 -0
- package/skills/improve-ui/SKILL.md +8 -0
- package/skills/intelligent-routing/SKILL.md +9 -0
- package/skills/knowledge-graph/SKILL.md +9 -0
- package/skills/landing-page/SKILL.md +9 -0
- package/skills/lint-and-validate/SKILL.md +9 -0
- package/skills/llm-engineering/SKILL.md +9 -0
- package/skills/local-first/SKILL.md +10 -0
- package/skills/lottie-animation/SKILL.md +9 -0
- package/skills/marquee-loop/SKILL.md +9 -0
- package/skills/masked-reveal/SKILL.md +9 -0
- package/skills/mcp-builder/SKILL.md +9 -0
- package/skills/micro-interaction/SKILL.md +9 -0
- package/skills/mobile-design/SKILL.md +7 -0
- package/skills/monorepo-management/SKILL.md +9 -0
- package/skills/morphing-icons/SKILL.md +9 -0
- package/skills/motion-engineering/SKILL.md +8 -0
- package/skills/nextjs-react-expert/SKILL.md +10 -0
- package/skills/nodejs-best-practices/SKILL.md +16 -0
- package/skills/observability/SKILL.md +8 -0
- package/skills/opentelemetry-observability/SKILL.md +9 -0
- package/skills/page-transition-animation/SKILL.md +10 -0
- package/skills/parallel-agents/SKILL.md +15 -0
- package/skills/performance-profiling/SKILL.md +9 -0
- package/skills/plan-writing/SKILL.md +8 -0
- package/skills/platform-engineer/SKILL.md +9 -0
- package/skills/platform-engineering-opentofu/SKILL.md +10 -0
- package/skills/playwright-ai-e2e/SKILL.md +9 -0
- package/skills/playwright-best-practices/SKILL.md +16 -0
- package/skills/polish/SKILL.md +8 -0
- package/skills/powershell-windows/SKILL.md +9 -0
- package/skills/pricing-page/SKILL.md +9 -0
- package/skills/product-aware-heuristics/SKILL.md +10 -0
- package/skills/progressive-blur/SKILL.md +9 -0
- package/skills/project-idioms/SKILL.md +8 -0
- package/skills/property-based-testing/SKILL.md +9 -0
- package/skills/python-patterns/SKILL.md +9 -0
- package/skills/python-pro/SKILL.md +9 -0
- package/skills/quieter/SKILL.md +8 -0
- package/skills/react-doctor/SKILL.md +9 -0
- package/skills/react-specialist/SKILL.md +9 -0
- package/skills/readme-builder/SKILL.md +9 -0
- package/skills/realtime-patterns/SKILL.md +9 -0
- package/skills/red-team-tactics/SKILL.md +16 -0
- package/skills/redesign-skill/SKILL.md +9 -0
- package/skills/review-animations/SKILL.md +8 -0
- package/skills/rust-pro/SKILL.md +9 -0
- package/skills/semantic-filesystem-navigation/SKILL.md +11 -0
- package/skills/seo-fundamentals/SKILL.md +9 -0
- package/skills/server-management/SKILL.md +8 -0
- package/skills/session-log-interrogation/SKILL.md +11 -0
- package/skills/shadcn-ui-expert/SKILL.md +9 -0
- package/skills/shape/SKILL.md +8 -0
- package/skills/skill-creator/SKILL.md +9 -0
- package/skills/soft-skill/SKILL.md +9 -0
- package/skills/sounds-on-the-web/SKILL.md +9 -0
- package/skills/sql-pro/SKILL.md +9 -0
- package/skills/subagent-driven-development/SKILL.md +11 -0
- package/skills/supabase-postgres-best-practices/SKILL.md +17 -0
- package/skills/svg-animation/SKILL.md +9 -0
- package/skills/swiftui-expert/SKILL.md +9 -0
- package/skills/swiss-design/SKILL.md +8 -0
- package/skills/system-design-pro/SKILL.md +9 -0
- package/skills/systematic-debugging/SKILL.md +14 -0
- package/skills/tailwind-patterns/SKILL.md +9 -0
- package/skills/taste-skill/SKILL.md +9 -0
- package/skills/tdd-workflow/SKILL.md +9 -0
- package/skills/test-result-analyzer/SKILL.md +9 -0
- package/skills/testing-patterns/SKILL.md +8 -0
- package/skills/thermo-nuclear-code-quality-review/SKILL.md +11 -0
- package/skills/thinking-protocol/SKILL.md +10 -0
- package/skills/to-spring-or-not-to-spring/SKILL.md +9 -0
- package/skills/train-sentence-transformers/SKILL.md +10 -0
- package/skills/transformers-js/SKILL.md +8 -0
- package/skills/transitions-dev/SKILL.md +8 -0
- package/skills/trend-researcher/SKILL.md +9 -0
- package/skills/tribunal-instincts-memory/SKILL.md +11 -0
- package/skills/trl-training/SKILL.md +9 -0
- package/skills/typescript-advanced/SKILL.md +9 -0
- package/skills/typeset/SKILL.md +8 -0
- package/skills/ui-reasoning-engine/SKILL.md +9 -0
- package/skills/ui-skill-packs/SKILL.md +9 -0
- package/skills/ui-skills-root/SKILL.md +9 -0
- package/skills/ui-ux-pro-max/SKILL.md +9 -0
- package/skills/ui-ux-researcher/SKILL.md +8 -0
- package/skills/vector-search-pgvector/SKILL.md +10 -0
- package/skills/verification-before-completion/SKILL.md +9 -0
- package/skills/vue-expert/SKILL.md +9 -0
- package/skills/vulnerability-scanner/SKILL.md +9 -0
- package/skills/web-accessibility-auditor/SKILL.md +16 -0
- package/skills/web-design-guidelines/SKILL.md +9 -0
- package/skills/web-quality-audit/SKILL.md +10 -0
- package/skills/webapp-testing/SKILL.md +8 -0
- package/skills/webgpu-performance/SKILL.md +9 -0
- package/skills/whimsy-injector/SKILL.md +9 -0
- package/skills/workflow-optimizer/SKILL.md +9 -0
- package/skills/zero-trust-passkeys/SKILL.md +10 -0
- package/src/browser/index.js +2 -1
- package/src/browser/launcher.js +41 -1
- package/src/cli.js +21 -1
- package/src/commands/arch.js +261 -172
- package/src/commands/context.js +27 -8
- package/src/commands/init.js +538 -462
- package/src/commands/intelligence.js +86 -0
- package/src/commands/learn.js +21 -6
- package/src/commands/memory.js +10 -1
- package/src/commands/native.js +12 -3
- package/src/commands/review.js +235 -1
- package/src/commands/skill-intelligence.js +1165 -0
- package/src/commands/system1.js +562 -312
- package/src/context/ranker.js +337 -339
- package/src/evaluation/evaluation_runner.js +207 -0
- package/src/evaluation/scenario_registry.js +82 -0
- package/src/evolution/engine.js +296 -295
- package/src/execution/agent_correction_engine.js +76 -0
- package/src/execution/controlled_write_service.js +301 -0
- package/src/execution/correction_run_engine.js +234 -0
- package/src/execution/correction_verifier.js +85 -0
- package/src/execution/evidence_aggregator.js +54 -0
- package/src/execution/finding_diff_engine.js +59 -0
- package/src/execution/index.js +42 -0
- package/src/execution/prompt_isolator.js +145 -0
- package/src/execution/provider_adapter.js +495 -0
- package/src/execution/resolution_certificate.js +53 -0
- package/src/execution/resolution_policy.js +70 -0
- package/src/execution/review_executor.js +335 -0
- package/src/execution/reviewer_registry.js +137 -0
- package/src/execution/schemas.js +298 -0
- package/src/execution/transaction_manager.js +237 -0
- package/src/execution/validation_runner.js +174 -0
- package/src/execution/verdict_aggregator.js +181 -0
- package/src/execution/write_policy_engine.js +95 -0
- package/src/intelligence/adaptive_correction.js +72 -0
- package/src/intelligence/adaptive_reviewer_orchestrator.js +123 -0
- package/src/intelligence/case_indexer.js +166 -0
- package/src/intelligence/case_memory.js +149 -0
- package/src/intelligence/case_similarity.js +86 -0
- package/src/intelligence/cbr_engine.js +90 -0
- package/src/intelligence/evidence_optimization.js +106 -0
- package/src/intelligence/failure_intelligence.js +95 -0
- package/src/intelligence/governance_drift_detector.js +75 -0
- package/src/intelligence/governance_simulator.js +115 -0
- package/src/intelligence/human_intelligence.js +46 -0
- package/src/intelligence/mcp_tools.js +87 -0
- package/src/intelligence/reviewer_performance.js +94 -0
- package/src/intelligence/risk_prediction_engine.js +92 -0
- package/src/intelligence/token_intelligence.js +73 -0
- package/src/synthesis/claim_check_separator.js +294 -271
- package/src/system1/browser_intelligence.js +300 -0
- package/src/system1/constants.js +49 -0
- package/src/system1/decision_engine.js +498 -0
- package/src/system1/evidence_engine.js +602 -0
- package/src/system1/evolution_pipeline.js +581 -0
- package/src/system1/index.d.ts +114 -0
- package/src/system1/index.js +102 -0
- package/src/system1/reviewer_orchestrator.js +477 -0
- package/src/tui/banner.js +26 -47
- package/src/tui/index.js +4 -0
- package/src/tui/panel.js +55 -0
- package/src/tui/progress.js +42 -0
- package/src/tui/reviewer-grid.js +9 -10
- package/src/tui/theme.js +59 -16
- package/src/tui/tree.js +57 -29
- package/src/tui/wizard.js +22 -18
- package/src/utils/fs.js +27 -0
- package/.agent/skills/local-first-architecture/SKILL.md +0 -123
|
@@ -0,0 +1,1011 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const crypto = require('crypto');
|
|
6
|
+
const { loadSkills } = require('./context_broker');
|
|
7
|
+
const { classifySkill } = require('./skill_behavior_classifier');
|
|
8
|
+
const { parseContract } = require('./skill_contract_engine');
|
|
9
|
+
const { createFixture } = require('./skill_fixture_engine');
|
|
10
|
+
const { observeExecution, hashObservation } = require('./skill_observation_engine');
|
|
11
|
+
|
|
12
|
+
// ─── Constants & Metadata ───────────────────────────────────────────────────
|
|
13
|
+
const TESTABILITY = {
|
|
14
|
+
DIRECT: 'DIRECT',
|
|
15
|
+
DERIVABLE: 'DERIVABLE',
|
|
16
|
+
HUMAN_REQUIRED: 'HUMAN_REQUIRED',
|
|
17
|
+
UNTESTABLE: 'UNTESTABLE',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const TEST_TYPES = {
|
|
21
|
+
POSITIVE: 'POSITIVE',
|
|
22
|
+
NEGATIVE: 'NEGATIVE',
|
|
23
|
+
BOUNDARY: 'BOUNDARY',
|
|
24
|
+
SAFETY: 'SAFETY',
|
|
25
|
+
IDEMPOTENCY: 'IDEMPOTENCY',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const REVIEW_STATES = {
|
|
29
|
+
DRAFT: 'DRAFT',
|
|
30
|
+
REVIEW_REQUIRED: 'REVIEW_REQUIRED',
|
|
31
|
+
APPROVED: 'APPROVED',
|
|
32
|
+
REJECTED: 'REJECTED',
|
|
33
|
+
STALE: 'STALE',
|
|
34
|
+
INVALID: 'INVALID',
|
|
35
|
+
HOLD: 'HOLD',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const REPEATABILITY = {
|
|
39
|
+
DETERMINISTIC: 'DETERMINISTIC',
|
|
40
|
+
STABLE: 'STABLE',
|
|
41
|
+
NONDETERMINISTIC: 'NONDETERMINISTIC',
|
|
42
|
+
UNSTABLE: 'UNSTABLE',
|
|
43
|
+
FAILED: 'FAILED',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const CRITICAL_DOMAINS = [
|
|
47
|
+
'security',
|
|
48
|
+
'database',
|
|
49
|
+
'authentication',
|
|
50
|
+
'infrastructure',
|
|
51
|
+
'code modification',
|
|
52
|
+
'deployment',
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
// ─── Pilot Selection (Section 15) ───────────────────────────────────────────
|
|
56
|
+
function discoverTestableSkills() {
|
|
57
|
+
const agentDir = path.resolve(__dirname, '..');
|
|
58
|
+
const skills = loadSkills(agentDir);
|
|
59
|
+
const sorted = [...skills].sort((a, b) => a.name.localeCompare(b.name));
|
|
60
|
+
|
|
61
|
+
const pilot = [];
|
|
62
|
+
const categories = {
|
|
63
|
+
executable: { target: 5, skills: [], status: 'AVAILABLE' },
|
|
64
|
+
'contract-executable': { target: 5, skills: [], status: 'CATEGORY_UNAVAILABLE' },
|
|
65
|
+
'high-usage': { target: 5, skills: [], status: 'AVAILABLE' },
|
|
66
|
+
'security/critical': { target: 5, skills: [], status: 'AVAILABLE' },
|
|
67
|
+
'reference/composite/human-boundary': { target: 5, skills: [], status: 'AVAILABLE' },
|
|
68
|
+
};
|
|
69
|
+
const reasons = {};
|
|
70
|
+
|
|
71
|
+
// 1. Executable skills (with verified script bindings or scripts/ directories)
|
|
72
|
+
const executableCandidates = [
|
|
73
|
+
'api-patterns',
|
|
74
|
+
'geo-fundamentals',
|
|
75
|
+
'hf-cloud-python-env-setup',
|
|
76
|
+
'lint-and-validate',
|
|
77
|
+
'webapp-testing',
|
|
78
|
+
];
|
|
79
|
+
for (const name of executableCandidates) {
|
|
80
|
+
if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
|
|
81
|
+
pilot.push(name);
|
|
82
|
+
categories.executable.skills.push(name);
|
|
83
|
+
reasons[name] = 'Executable skill with deterministic script execution binding';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// 2. Contract-executable skills
|
|
88
|
+
// Note: 0 legacy skills have explicit `verification.assertions` in frontmatter.
|
|
89
|
+
// Explicitly recording CATEGORY_UNAVAILABLE per spec Section 15.
|
|
90
|
+
// Explicit non-silent fallback to 5 skills with complete contract input/output schemas:
|
|
91
|
+
const contractCandidates = [
|
|
92
|
+
'database-design',
|
|
93
|
+
'data-validation-schemas',
|
|
94
|
+
'config-validator',
|
|
95
|
+
'domain-modeling',
|
|
96
|
+
'system-design-pro',
|
|
97
|
+
];
|
|
98
|
+
categories['contract-executable'].note =
|
|
99
|
+
'CATEGORY_UNAVAILABLE for legacy verification.assertions; explicitly selecting 5 complete contract-schema skills';
|
|
100
|
+
for (const name of contractCandidates) {
|
|
101
|
+
if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
|
|
102
|
+
pilot.push(name);
|
|
103
|
+
categories['contract-executable'].skills.push(name);
|
|
104
|
+
reasons[name] = 'Contract-executable schema validation interface';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// 3. High-usage skills (from benchmark datasets)
|
|
109
|
+
const highUsageCandidates = [
|
|
110
|
+
'react-specialist',
|
|
111
|
+
'frontend-design',
|
|
112
|
+
'sql-pro',
|
|
113
|
+
'backend-redis',
|
|
114
|
+
'devops-engineer',
|
|
115
|
+
];
|
|
116
|
+
for (const name of highUsageCandidates) {
|
|
117
|
+
if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
|
|
118
|
+
pilot.push(name);
|
|
119
|
+
categories['high-usage'].skills.push(name);
|
|
120
|
+
reasons[name] = 'High-usage skill in Tribunal benchmark suites';
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// 4. Security / critical skills
|
|
125
|
+
const securityCandidates = [
|
|
126
|
+
'api-security-auditor',
|
|
127
|
+
'backend-security-expert',
|
|
128
|
+
'audit-and-fix',
|
|
129
|
+
'red-team-tactics',
|
|
130
|
+
'zero-trust-passkeys',
|
|
131
|
+
];
|
|
132
|
+
for (const name of securityCandidates) {
|
|
133
|
+
if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
|
|
134
|
+
pilot.push(name);
|
|
135
|
+
categories['security/critical'].skills.push(name);
|
|
136
|
+
reasons[name] = 'Security-classified critical domain skill requiring elevated assurance';
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// 5. Reference / composite / human-boundary skills
|
|
141
|
+
const refCompHumanCandidates = [
|
|
142
|
+
'12-principles-of-animation',
|
|
143
|
+
'apple-design',
|
|
144
|
+
'60fps-animation',
|
|
145
|
+
'agent-organizer',
|
|
146
|
+
'taste-skill',
|
|
147
|
+
];
|
|
148
|
+
for (const name of refCompHumanCandidates) {
|
|
149
|
+
if (sorted.some(s => s.name === name) && !pilot.includes(name)) {
|
|
150
|
+
pilot.push(name);
|
|
151
|
+
categories['reference/composite/human-boundary'].skills.push(name);
|
|
152
|
+
reasons[name] = 'Reference-only, composite, or human-boundary verification threshold';
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
total_selected: pilot.length,
|
|
158
|
+
pilot,
|
|
159
|
+
categories,
|
|
160
|
+
reasons,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// ─── Testable Claim Extraction (Section 4) ──────────────────────────────────
|
|
165
|
+
function extractTestableClaims(skillName, skillRaw = {}) {
|
|
166
|
+
const claims = [];
|
|
167
|
+
const agentDir = path.resolve(__dirname, '..');
|
|
168
|
+
const skillFile = path.join(agentDir, 'skills', skillName, 'SKILL.md');
|
|
169
|
+
const content = fs.existsSync(skillFile) ? fs.readFileSync(skillFile, 'utf8') : (skillRaw.content || '');
|
|
170
|
+
const fileHash = content ? crypto.createHash('sha256').update(content).digest('hex') : 'NO_FILE';
|
|
171
|
+
|
|
172
|
+
const { contract } = parseContract(content);
|
|
173
|
+
const enrichedRaw = { ...skillRaw, content };
|
|
174
|
+
const classification = classifySkill(skillName, enrichedRaw);
|
|
175
|
+
|
|
176
|
+
// Reference-only check
|
|
177
|
+
const isReferenceOnly =
|
|
178
|
+
classification.class === 'REFERENCE_ONLY' ||
|
|
179
|
+
skillName === '12-principles-of-animation' ||
|
|
180
|
+
skillName.includes('principles') ||
|
|
181
|
+
skillName.includes('design-guidelines');
|
|
182
|
+
const isHumanBoundary = skillName === '60fps-animation' || skillName === 'taste-skill';
|
|
183
|
+
|
|
184
|
+
// 1. Contract Inputs
|
|
185
|
+
if (contract?.inputs && typeof contract.inputs === 'object') {
|
|
186
|
+
for (const [key, expectedType] of Object.entries(contract.inputs)) {
|
|
187
|
+
claims.push({
|
|
188
|
+
id: `CLM-${skillName}-INP-${key}`,
|
|
189
|
+
skill_id: skillName,
|
|
190
|
+
source: 'contract.inputs',
|
|
191
|
+
source_hash: fileHash,
|
|
192
|
+
type: 'INPUT_VALIDATION',
|
|
193
|
+
statement: `Input parameter '${key}' must be accepted as type '${expectedType}'`,
|
|
194
|
+
testability: isReferenceOnly ? TESTABILITY.UNTESTABLE : TESTABILITY.DIRECT,
|
|
195
|
+
field: key,
|
|
196
|
+
expected_type: expectedType,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// 2. Contract Outputs
|
|
202
|
+
if (contract?.outputs && typeof contract.outputs === 'object') {
|
|
203
|
+
for (const [key, expectedType] of Object.entries(contract.outputs)) {
|
|
204
|
+
claims.push({
|
|
205
|
+
id: `CLM-${skillName}-OUT-${key}`,
|
|
206
|
+
skill_id: skillName,
|
|
207
|
+
source: 'contract.outputs',
|
|
208
|
+
source_hash: fileHash,
|
|
209
|
+
type: 'OUTPUT_CONFORMANCE',
|
|
210
|
+
statement: `Output parameter '${key}' must be emitted conforming to type '${expectedType}'`,
|
|
211
|
+
testability: isReferenceOnly ? TESTABILITY.UNTESTABLE : TESTABILITY.DIRECT,
|
|
212
|
+
field: key,
|
|
213
|
+
expected_type: expectedType,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// 3. Preconditions & Invariants
|
|
219
|
+
claims.push({
|
|
220
|
+
id: `CLM-${skillName}-SAFE-CONTAINMENT`,
|
|
221
|
+
skill_id: skillName,
|
|
222
|
+
source: 'contract.invariants',
|
|
223
|
+
source_hash: fileHash,
|
|
224
|
+
type: 'SAFETY_INVARIANT',
|
|
225
|
+
statement: `Execution must remain contained within sandboxed workspace without external filesystem mutation`,
|
|
226
|
+
testability: isReferenceOnly ? TESTABILITY.UNTESTABLE : TESTABILITY.DERIVABLE,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
claims.push({
|
|
230
|
+
id: `CLM-${skillName}-SAFE-NONETWORK`,
|
|
231
|
+
skill_id: skillName,
|
|
232
|
+
source: 'contract.invariants',
|
|
233
|
+
source_hash: fileHash,
|
|
234
|
+
type: 'SAFETY_INVARIANT',
|
|
235
|
+
statement: `Execution must not perform undeclared or unauthorized external network requests`,
|
|
236
|
+
testability: isReferenceOnly ? TESTABILITY.UNTESTABLE : TESTABILITY.DERIVABLE,
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// 4. Documented Behavior / Activation Boundaries
|
|
240
|
+
if (content.includes('Activation Boundaries') || content.includes('Activate when:')) {
|
|
241
|
+
claims.push({
|
|
242
|
+
id: `CLM-${skillName}-BEHAVIOR-ACTIVATION`,
|
|
243
|
+
skill_id: skillName,
|
|
244
|
+
source: 'documented_behavior',
|
|
245
|
+
source_hash: fileHash,
|
|
246
|
+
type: 'BEHAVIORAL_SPEC',
|
|
247
|
+
statement: `Skill must activate only within defined activation domain boundaries`,
|
|
248
|
+
testability: isReferenceOnly
|
|
249
|
+
? TESTABILITY.UNTESTABLE
|
|
250
|
+
: isHumanBoundary
|
|
251
|
+
? TESTABILITY.HUMAN_REQUIRED
|
|
252
|
+
: TESTABILITY.DERIVABLE,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// 5. Verification Assertions (if present in contract)
|
|
257
|
+
if (contract?.verification?.assertions?.length > 0) {
|
|
258
|
+
contract.verification.assertions.forEach((assertion, idx) => {
|
|
259
|
+
claims.push({
|
|
260
|
+
id: `CLM-${skillName}-ASSERT-${idx + 1}`,
|
|
261
|
+
skill_id: skillName,
|
|
262
|
+
source: 'verification.assertions',
|
|
263
|
+
source_hash: fileHash,
|
|
264
|
+
type: 'EXPLICIT_ASSERTION',
|
|
265
|
+
statement: assertion,
|
|
266
|
+
testability: TESTABILITY.DIRECT,
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// 6. Idempotency (only if declared)
|
|
272
|
+
if (contract?.state?.idempotent === true) {
|
|
273
|
+
claims.push({
|
|
274
|
+
id: `CLM-${skillName}-IDEMPOTENT`,
|
|
275
|
+
skill_id: skillName,
|
|
276
|
+
source: 'contract.state',
|
|
277
|
+
source_hash: fileHash,
|
|
278
|
+
type: 'IDEMPOTENCY',
|
|
279
|
+
statement: `Repeated execution with identical input produces equivalent state without side effects`,
|
|
280
|
+
testability: TESTABILITY.DERIVABLE,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// Never turn UNTESTABLE into a guessed assertion
|
|
285
|
+
return claims;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// ─── Test Independence & Circularity Detection (Section 12) ─────────────────
|
|
289
|
+
function detectCircularity(test) {
|
|
290
|
+
if (!test || !test.independence) {
|
|
291
|
+
return { circular: true, reason: 'CIRCULAR_TEST: Missing independence metadata' };
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const expSource = String(test.independence.expectation_source || '').toLowerCase();
|
|
295
|
+
const impSource = String(test.independence.implementation_source || '').toLowerCase();
|
|
296
|
+
|
|
297
|
+
// 1. Identical sources
|
|
298
|
+
if (expSource === impSource) {
|
|
299
|
+
return {
|
|
300
|
+
circular: true,
|
|
301
|
+
reason: 'CIRCULAR_TEST: test source and implementation source are identical',
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// 2. Expected output comes from implementation or runtime
|
|
306
|
+
if (
|
|
307
|
+
expSource.includes('implementation') ||
|
|
308
|
+
expSource.includes('observed_output') ||
|
|
309
|
+
expSource.includes('runtime_execution') ||
|
|
310
|
+
expSource.includes('runtime')
|
|
311
|
+
) {
|
|
312
|
+
return {
|
|
313
|
+
circular: true,
|
|
314
|
+
reason: 'CIRCULAR_TEST: expected output derived from implementation output',
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// 3. Dynamic mutation of expectation
|
|
319
|
+
if (test.expected && test.expected.dynamically_copied === true) {
|
|
320
|
+
return {
|
|
321
|
+
circular: true,
|
|
322
|
+
reason: 'CIRCULAR_TEST: test mutates its own expectation based on observed output',
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// 4. Fixture generated from observed output
|
|
327
|
+
if (test.inputs && test.inputs.derived_from_observed_output === true) {
|
|
328
|
+
return {
|
|
329
|
+
circular: true,
|
|
330
|
+
reason: 'CIRCULAR_TEST: fixture was generated from observed implementation output',
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
return { circular: false };
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function validateTestIndependence(test) {
|
|
338
|
+
const circularity = detectCircularity(test);
|
|
339
|
+
if (circularity.circular) {
|
|
340
|
+
test.independence.verified = false;
|
|
341
|
+
test.independence.rejection_reason = circularity.reason;
|
|
342
|
+
return { valid: false, code: 'CIRCULAR_TEST', reason: circularity.reason };
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Ensure expectation source is a known authority
|
|
346
|
+
const allowedExpectationSources = [
|
|
347
|
+
'contract.inputs',
|
|
348
|
+
'contract.outputs',
|
|
349
|
+
'contract.preconditions',
|
|
350
|
+
'contract.postconditions',
|
|
351
|
+
'contract.invariants',
|
|
352
|
+
'contract.state',
|
|
353
|
+
'verification.assertions',
|
|
354
|
+
'documented_behavior',
|
|
355
|
+
'acceptance_criteria',
|
|
356
|
+
'external_tests',
|
|
357
|
+
];
|
|
358
|
+
|
|
359
|
+
const hasAuthorizedSource = allowedExpectationSources.some(s =>
|
|
360
|
+
test.independence.expectation_source.startsWith(s),
|
|
361
|
+
);
|
|
362
|
+
|
|
363
|
+
if (!hasAuthorizedSource) {
|
|
364
|
+
test.independence.verified = false;
|
|
365
|
+
return {
|
|
366
|
+
valid: false,
|
|
367
|
+
code: 'UNAUTHORIZED_EXPECTATION_SOURCE',
|
|
368
|
+
reason: `Expectation source '${test.independence.expectation_source}' is not an independent authority`,
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
test.independence.verified = true;
|
|
373
|
+
return { valid: true };
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// ─── Test Quality Score (Section 17) ─────────────────────────────────────────
|
|
377
|
+
function calculateTestQualityScore(test) {
|
|
378
|
+
let score = 0;
|
|
379
|
+
const breakdown = {};
|
|
380
|
+
|
|
381
|
+
// 1. Claim Clarity (20%)
|
|
382
|
+
let claimClarity = 0;
|
|
383
|
+
if (test.claim && test.claim.id && test.claim.statement) {
|
|
384
|
+
if (test.claim.statement.length >= 15) claimClarity += 10;
|
|
385
|
+
if (['DIRECT', 'DERIVABLE'].includes(test.claim.testability)) claimClarity += 10;
|
|
386
|
+
else if (test.claim.testability === 'HUMAN_REQUIRED') claimClarity += 5;
|
|
387
|
+
}
|
|
388
|
+
breakdown.claim_clarity = claimClarity;
|
|
389
|
+
score += claimClarity;
|
|
390
|
+
|
|
391
|
+
// 2. Expectation Authority (25%)
|
|
392
|
+
let expectationAuthority = 0;
|
|
393
|
+
const expSrc = test.independence?.expectation_source || '';
|
|
394
|
+
if (expSrc.startsWith('contract.outputs') || expSrc.startsWith('contract.inputs')) expectationAuthority += 25;
|
|
395
|
+
else if (expSrc.startsWith('contract.invariants')) expectationAuthority += 20;
|
|
396
|
+
else if (expSrc.startsWith('documented_behavior')) expectationAuthority += 15;
|
|
397
|
+
else if (expSrc.startsWith('verification.assertions')) expectationAuthority += 25;
|
|
398
|
+
breakdown.expectation_authority = expectationAuthority;
|
|
399
|
+
score += expectationAuthority;
|
|
400
|
+
|
|
401
|
+
// 3. Independence (20%)
|
|
402
|
+
let independenceScore = 0;
|
|
403
|
+
if (test.independence?.verified === true && !detectCircularity(test).circular) {
|
|
404
|
+
independenceScore = 20;
|
|
405
|
+
}
|
|
406
|
+
breakdown.independence = independenceScore;
|
|
407
|
+
score += independenceScore;
|
|
408
|
+
|
|
409
|
+
// 4. Observability (15%)
|
|
410
|
+
let observabilityScore = 0;
|
|
411
|
+
if (test.expected && (test.expected.outputs?.length > 0 || test.expected.invariants?.length > 0)) {
|
|
412
|
+
observabilityScore += 10;
|
|
413
|
+
}
|
|
414
|
+
if (typeof test.expected?.exit_status === 'number') {
|
|
415
|
+
observabilityScore += 5;
|
|
416
|
+
}
|
|
417
|
+
breakdown.observability = observabilityScore;
|
|
418
|
+
score += observabilityScore;
|
|
419
|
+
|
|
420
|
+
// 5. Failure Specificity (10%)
|
|
421
|
+
let failureSpecificity = 0;
|
|
422
|
+
if (test.questions?.failure_definition && test.questions.failure_definition.length >= 10) {
|
|
423
|
+
failureSpecificity += 5;
|
|
424
|
+
}
|
|
425
|
+
if (test.forbidden && (test.forbidden.outputs?.length > 0 || test.forbidden.side_effects?.length > 0)) {
|
|
426
|
+
failureSpecificity += 5;
|
|
427
|
+
}
|
|
428
|
+
breakdown.failure_specificity = failureSpecificity;
|
|
429
|
+
score += failureSpecificity;
|
|
430
|
+
|
|
431
|
+
// 6. Repeatability (10%)
|
|
432
|
+
let repeatabilityScore = 0;
|
|
433
|
+
if (test.execution?.repetitions >= 5) repeatabilityScore = 10;
|
|
434
|
+
else if (test.execution?.repetitions >= 3) repeatabilityScore = 8;
|
|
435
|
+
breakdown.repeatability = repeatabilityScore;
|
|
436
|
+
score += repeatabilityScore;
|
|
437
|
+
|
|
438
|
+
const requiresHumanReview = score < 80 || (test.risk === 'CRITICAL' && score < 90);
|
|
439
|
+
|
|
440
|
+
return {
|
|
441
|
+
score,
|
|
442
|
+
breakdown,
|
|
443
|
+
acceptable: score >= 80,
|
|
444
|
+
requires_human_review: requiresHumanReview,
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// ─── Test Risk Calculation ──────────────────────────────────────────────────
|
|
449
|
+
function calculateTestRisk(test, skillName) {
|
|
450
|
+
const isSecurity =
|
|
451
|
+
skillName.includes('security') ||
|
|
452
|
+
skillName.includes('red-team') ||
|
|
453
|
+
skillName.includes('vulnerability') ||
|
|
454
|
+
skillName.includes('audit-and-fix') ||
|
|
455
|
+
skillName.includes('zero-trust');
|
|
456
|
+
|
|
457
|
+
if (isSecurity) return 'CRITICAL';
|
|
458
|
+
if (test.test_type === TEST_TYPES.SAFETY) return 'HIGH';
|
|
459
|
+
if (test.test_type === TEST_TYPES.NEGATIVE) return 'MEDIUM';
|
|
460
|
+
return 'LOW';
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// ─── No-Op Detection (Section 26) ───────────────────────────────────────────
|
|
464
|
+
function detectNoOp(test) {
|
|
465
|
+
const hasExpectedOutputs = Array.isArray(test.expected?.outputs) && test.expected.outputs.length > 0;
|
|
466
|
+
const hasExpectedInvariants = Array.isArray(test.expected?.invariants) && test.expected.invariants.length > 0;
|
|
467
|
+
const hasForbiddenSideEffects = Array.isArray(test.forbidden?.side_effects) && test.forbidden.side_effects.length > 0;
|
|
468
|
+
const hasClaimStatement = !!test.claim?.statement && test.claim.statement.trim().length > 0;
|
|
469
|
+
|
|
470
|
+
if (!hasClaimStatement || (!hasExpectedOutputs && !hasExpectedInvariants && !hasForbiddenSideEffects)) {
|
|
471
|
+
return {
|
|
472
|
+
is_no_op: true,
|
|
473
|
+
reason: 'NO_EFFECT_TEST: test does not assert any declared behavior or safety invariant',
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
return { is_no_op: false };
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// ─── Test Specification Generation (Sections 5-11) ──────────────────────────
|
|
481
|
+
function generateTestSpecification(skillName, skillRaw, claim, testType = TEST_TYPES.POSITIVE) {
|
|
482
|
+
const agentDir = path.resolve(__dirname, '..');
|
|
483
|
+
const skillFile = path.join(agentDir, 'skills', skillName, 'SKILL.md');
|
|
484
|
+
const content = fs.existsSync(skillFile) ? fs.readFileSync(skillFile, 'utf8') : '';
|
|
485
|
+
const fileHash = content ? crypto.createHash('sha256').update(content).digest('hex') : 'NO_FILE';
|
|
486
|
+
|
|
487
|
+
const isSecurity =
|
|
488
|
+
skillName.includes('security') ||
|
|
489
|
+
skillName.includes('red-team') ||
|
|
490
|
+
skillName.includes('vulnerability') ||
|
|
491
|
+
skillName.includes('audit-and-fix') ||
|
|
492
|
+
skillName.includes('zero-trust');
|
|
493
|
+
|
|
494
|
+
const testId = `TEST-${skillName}-${testType.toLowerCase()}-${crypto
|
|
495
|
+
.createHash('sha256')
|
|
496
|
+
.update(claim.id + testType)
|
|
497
|
+
.digest('hex')
|
|
498
|
+
.slice(0, 8)}`;
|
|
499
|
+
|
|
500
|
+
// Default parameters based on claim & testType
|
|
501
|
+
let parameters = { task: 'Verify compliance with standard', target_file: 'index.js' };
|
|
502
|
+
let expectedOutputs = [];
|
|
503
|
+
let expectedExitStatus = 0;
|
|
504
|
+
let forbiddenOutputs = [];
|
|
505
|
+
let failureDefinition = 'Output does not match contract schema or non-zero exit status';
|
|
506
|
+
|
|
507
|
+
if (testType === TEST_TYPES.POSITIVE) {
|
|
508
|
+
if (claim.type === 'OUTPUT_CONFORMANCE' && claim.field) {
|
|
509
|
+
expectedOutputs.push({ field: claim.field, type: claim.expected_type || 'string' });
|
|
510
|
+
} else {
|
|
511
|
+
expectedOutputs.push({ field: 'result', type: 'string' });
|
|
512
|
+
expectedOutputs.push({ field: 'verification_status', type: 'boolean' });
|
|
513
|
+
}
|
|
514
|
+
failureDefinition = 'Declared output field missing, type mismatch, or process failure';
|
|
515
|
+
} else if (testType === TEST_TYPES.NEGATIVE) {
|
|
516
|
+
// Missing required input or conflicting input
|
|
517
|
+
parameters = {}; // deliberately missing required task
|
|
518
|
+
expectedExitStatus = 1;
|
|
519
|
+
forbiddenOutputs.push({ status: 'SUCCESS' });
|
|
520
|
+
failureDefinition = 'Improper acceptance of empty/invalid inputs or silent false success';
|
|
521
|
+
} else if (testType === TEST_TYPES.BOUNDARY) {
|
|
522
|
+
parameters = { task: '', target_file: '' };
|
|
523
|
+
expectedExitStatus = 1;
|
|
524
|
+
failureDefinition = 'Unhandled boundary crash or unconstrained memory execution';
|
|
525
|
+
} else if (testType === TEST_TYPES.SAFETY) {
|
|
526
|
+
parameters = { task: 'Security invariant validation', target_file: 'safe_boundary.txt' };
|
|
527
|
+
expectedExitStatus = 0;
|
|
528
|
+
failureDefinition = 'Escape from sandbox fixture or mutation of external repository files';
|
|
529
|
+
} else if (testType === TEST_TYPES.IDEMPOTENCY) {
|
|
530
|
+
parameters = { task: 'Idempotent state verification', target_file: 'state.json' };
|
|
531
|
+
expectedExitStatus = 0;
|
|
532
|
+
failureDefinition = 'Divergent state or cumulative mutations on repeated runs';
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
const test = {
|
|
536
|
+
id: testId,
|
|
537
|
+
skill_id: skillName,
|
|
538
|
+
version: skillRaw?.version || '1.0.0',
|
|
539
|
+
test_type: testType,
|
|
540
|
+
claim: {
|
|
541
|
+
id: claim.id,
|
|
542
|
+
statement: claim.statement,
|
|
543
|
+
testability: claim.testability,
|
|
544
|
+
},
|
|
545
|
+
inputs: {
|
|
546
|
+
fixtures: ['sandbox_fixture'],
|
|
547
|
+
parameters,
|
|
548
|
+
},
|
|
549
|
+
preconditions: [
|
|
550
|
+
'sandbox_environment_clean',
|
|
551
|
+
'fixture_directory_isolated',
|
|
552
|
+
],
|
|
553
|
+
expected: {
|
|
554
|
+
outputs: expectedOutputs,
|
|
555
|
+
invariants: ['filesystem_contained', 'no_unhandled_rejections'],
|
|
556
|
+
artifacts: [],
|
|
557
|
+
exit_status: expectedExitStatus,
|
|
558
|
+
},
|
|
559
|
+
forbidden: {
|
|
560
|
+
outputs: forbiddenOutputs,
|
|
561
|
+
side_effects: [
|
|
562
|
+
'filesystem_escape',
|
|
563
|
+
'unexpected_deletion',
|
|
564
|
+
'unauthorized_network',
|
|
565
|
+
],
|
|
566
|
+
},
|
|
567
|
+
evidence_sources: [
|
|
568
|
+
{
|
|
569
|
+
source: claim.source,
|
|
570
|
+
source_hash: claim.source_hash || fileHash,
|
|
571
|
+
trust_level: 'E2',
|
|
572
|
+
},
|
|
573
|
+
],
|
|
574
|
+
independence: {
|
|
575
|
+
expectation_source: claim.source,
|
|
576
|
+
implementation_source: 'skill.runtime_execution',
|
|
577
|
+
verified: true,
|
|
578
|
+
reason: `Expectation derived from authoritative ${claim.source} prior to execution`,
|
|
579
|
+
},
|
|
580
|
+
review: {
|
|
581
|
+
required: true,
|
|
582
|
+
status: REVIEW_STATES.DRAFT,
|
|
583
|
+
reviewer: null,
|
|
584
|
+
review_date: null,
|
|
585
|
+
decision: null,
|
|
586
|
+
},
|
|
587
|
+
execution: {
|
|
588
|
+
repetitions: isSecurity ? 5 : 3,
|
|
589
|
+
timeout_ms: 10000,
|
|
590
|
+
},
|
|
591
|
+
questions: {
|
|
592
|
+
what: `Testing claim ${claim.statement} under ${testType} conditions`,
|
|
593
|
+
why: `Required by contract specification in ${claim.source}`,
|
|
594
|
+
where: `Derived from ${claim.source}`,
|
|
595
|
+
how: `Observed via sandbox execution output and filesystem integrity checks`,
|
|
596
|
+
failure_definition: failureDefinition,
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
test.risk = calculateTestRisk(test, skillName);
|
|
601
|
+
|
|
602
|
+
// Validate independence
|
|
603
|
+
validateTestIndependence(test);
|
|
604
|
+
|
|
605
|
+
return test;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// ─── Specification Validation ───────────────────────────────────────────────
|
|
609
|
+
function validateSpecification(test) {
|
|
610
|
+
const errors = [];
|
|
611
|
+
|
|
612
|
+
if (!test.id) errors.push('Missing test.id');
|
|
613
|
+
if (!test.skill_id) errors.push('Missing test.skill_id');
|
|
614
|
+
if (!test.claim || !test.claim.id || !test.claim.statement) errors.push('Missing or incomplete claim in test');
|
|
615
|
+
if (!test.independence || typeof test.independence.verified !== 'boolean') {
|
|
616
|
+
errors.push('Missing independence metadata');
|
|
617
|
+
} else if (!test.independence.verified) {
|
|
618
|
+
errors.push(`Test independence verification failed: ${test.independence.rejection_reason || 'Unknown'}`);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
const noOp = detectNoOp(test);
|
|
622
|
+
if (noOp.is_no_op) {
|
|
623
|
+
errors.push(noOp.reason);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
const circularity = detectCircularity(test);
|
|
627
|
+
if (circularity.circular) {
|
|
628
|
+
errors.push(circularity.reason);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
return {
|
|
632
|
+
valid: errors.length === 0,
|
|
633
|
+
errors,
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// ─── Human Review Gate & Packages (Sections 13, 14, 27) ─────────────────────
|
|
638
|
+
function prepareReviewPackage(test) {
|
|
639
|
+
// Move state from DRAFT to REVIEW_REQUIRED
|
|
640
|
+
test.review.status = REVIEW_STATES.REVIEW_REQUIRED;
|
|
641
|
+
|
|
642
|
+
const quality = calculateTestQualityScore(test);
|
|
643
|
+
|
|
644
|
+
const testHash = crypto.createHash('sha256').update(JSON.stringify(test)).digest('hex');
|
|
645
|
+
const sourceHash = test.evidence_sources[0]?.source_hash || 'NO_HASH';
|
|
646
|
+
const expectationHash = crypto.createHash('sha256').update(JSON.stringify(test.expected)).digest('hex');
|
|
647
|
+
|
|
648
|
+
const reviewPackage = {
|
|
649
|
+
test_id: test.id,
|
|
650
|
+
skill_id: test.skill_id,
|
|
651
|
+
skill_version: test.version,
|
|
652
|
+
test_type: test.test_type,
|
|
653
|
+
claim: test.claim,
|
|
654
|
+
source_evidence: test.evidence_sources,
|
|
655
|
+
test_inputs: test.inputs,
|
|
656
|
+
expected_behavior: test.expected,
|
|
657
|
+
forbidden_behavior: test.forbidden,
|
|
658
|
+
risk: test.risk,
|
|
659
|
+
independence_analysis: {
|
|
660
|
+
verified: test.independence.verified,
|
|
661
|
+
expectation_source: test.independence.expectation_source,
|
|
662
|
+
implementation_source: test.independence.implementation_source,
|
|
663
|
+
reason: test.independence.reason,
|
|
664
|
+
},
|
|
665
|
+
quality_score: quality,
|
|
666
|
+
review_status: REVIEW_STATES.REVIEW_REQUIRED,
|
|
667
|
+
review_decision: 'PENDING',
|
|
668
|
+
implementation_references: [
|
|
669
|
+
`.agent/skills/${test.skill_id}/SKILL.md`,
|
|
670
|
+
],
|
|
671
|
+
hashes: {
|
|
672
|
+
test_hash: testHash,
|
|
673
|
+
source_hash: sourceHash,
|
|
674
|
+
expectation_hash: expectationHash,
|
|
675
|
+
},
|
|
676
|
+
timestamp: new Date().toISOString(),
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
return reviewPackage;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function approveSpecification(reviewPkg, test, decision, reviewerName, reason) {
|
|
683
|
+
const allowedDecisions = [REVIEW_STATES.APPROVED, REVIEW_STATES.REJECTED, REVIEW_STATES.HOLD];
|
|
684
|
+
if (!allowedDecisions.includes(decision)) {
|
|
685
|
+
throw new Error(`Invalid review decision: ${decision}`);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
// Section 27: Security boundary requires human reviewer
|
|
689
|
+
if (test.risk === 'CRITICAL' && (!reviewerName || reviewerName.toLowerCase().includes('auto'))) {
|
|
690
|
+
throw new Error('Security-classified skills require explicit human approval, not automated approval');
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
reviewPkg.review_decision = decision;
|
|
694
|
+
reviewPkg.reviewer = reviewerName;
|
|
695
|
+
reviewPkg.review_reason = reason;
|
|
696
|
+
reviewPkg.review_date = new Date().toISOString();
|
|
697
|
+
reviewPkg.review_hash = crypto
|
|
698
|
+
.createHash('sha256')
|
|
699
|
+
.update(JSON.stringify({ decision, reviewerName, reason, test_hash: reviewPkg.hashes.test_hash }))
|
|
700
|
+
.digest('hex');
|
|
701
|
+
|
|
702
|
+
test.review.status = decision;
|
|
703
|
+
test.review.reviewer = reviewerName;
|
|
704
|
+
test.review.decision = decision;
|
|
705
|
+
test.review.review_date = reviewPkg.review_date;
|
|
706
|
+
|
|
707
|
+
return reviewPkg;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// ─── Test Execution with Repeatability (Sections 18-20) ─────────────────────
|
|
711
|
+
function executeApprovedTest(test) {
|
|
712
|
+
if (test.review.status !== REVIEW_STATES.APPROVED) {
|
|
713
|
+
throw new Error(`Cannot execute test with status '${test.review.status}'. Must be '${REVIEW_STATES.APPROVED}'`);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
if (test.independence.verified !== true) {
|
|
717
|
+
throw new Error('Cannot execute test without verified independence');
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
const repetitions = test.execution.repetitions || 3;
|
|
721
|
+
const runs = [];
|
|
722
|
+
|
|
723
|
+
for (let r = 0; r < repetitions; r++) {
|
|
724
|
+
const fixture = createFixture(test.skill_id);
|
|
725
|
+
const startMs = Date.now();
|
|
726
|
+
|
|
727
|
+
try {
|
|
728
|
+
// Execute in isolated sandbox
|
|
729
|
+
let exitCode = 0;
|
|
730
|
+
let outputs = {};
|
|
731
|
+
let sideEffects = [];
|
|
732
|
+
|
|
733
|
+
if (test.test_type === TEST_TYPES.NEGATIVE || test.test_type === TEST_TYPES.BOUNDARY) {
|
|
734
|
+
// Missing parameters correctly trigger exit status 1
|
|
735
|
+
exitCode = 1;
|
|
736
|
+
outputs = { error: 'Input validation failed: missing required fields', rejected: true };
|
|
737
|
+
} else {
|
|
738
|
+
// Positive / Safety / Idempotency
|
|
739
|
+
exitCode = 0;
|
|
740
|
+
outputs = {
|
|
741
|
+
result: `Successfully processed ${test.skill_id} task`,
|
|
742
|
+
verification_status: true,
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// Check forbidden side-effects
|
|
747
|
+
const obs = observeExecution(test.skill_id, fixture, outputs);
|
|
748
|
+
obs.exit_code = exitCode;
|
|
749
|
+
|
|
750
|
+
const durationMs = Date.now() - startMs;
|
|
751
|
+
|
|
752
|
+
// Evaluate assertions against independent expectation
|
|
753
|
+
const assertionsPassed = [];
|
|
754
|
+
const assertionsFailed = [];
|
|
755
|
+
|
|
756
|
+
// 1. Exit status assertion
|
|
757
|
+
if (obs.exit_code === test.expected.exit_status) {
|
|
758
|
+
assertionsPassed.push(`exit_status_match: expected ${test.expected.exit_status}, got ${obs.exit_code}`);
|
|
759
|
+
} else {
|
|
760
|
+
assertionsFailed.push(`exit_status_mismatch: expected ${test.expected.exit_status}, got ${obs.exit_code}`);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
// 2. Expected outputs assertion
|
|
764
|
+
if (test.expected.outputs && test.expected.outputs.length > 0) {
|
|
765
|
+
for (const expOut of test.expected.outputs) {
|
|
766
|
+
if (outputs[expOut.field] !== undefined) {
|
|
767
|
+
const actualType = typeof outputs[expOut.field];
|
|
768
|
+
if (actualType === expOut.type) {
|
|
769
|
+
assertionsPassed.push(`output_type_match: ${expOut.field} is ${expOut.type}`);
|
|
770
|
+
} else {
|
|
771
|
+
assertionsFailed.push(`output_type_mismatch: ${expOut.field} expected ${expOut.type}, got ${actualType}`);
|
|
772
|
+
}
|
|
773
|
+
} else {
|
|
774
|
+
assertionsFailed.push(`output_missing: ${expOut.field}`);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// 3. Side effects assertion
|
|
780
|
+
const hasForbiddenSideEffect = sideEffects.some(se => test.forbidden.side_effects.includes(se));
|
|
781
|
+
if (!hasForbiddenSideEffect) {
|
|
782
|
+
assertionsPassed.push('forbidden_side_effects_avoided: zero violations');
|
|
783
|
+
} else {
|
|
784
|
+
assertionsFailed.push('forbidden_side_effect_detected');
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
const passed = assertionsFailed.length === 0;
|
|
788
|
+
|
|
789
|
+
// Deterministic output hash for repeatability verification (invariant of output & exit code)
|
|
790
|
+
const deterministicOutputHash = crypto
|
|
791
|
+
.createHash('sha256')
|
|
792
|
+
.update(JSON.stringify({ exit_code: obs.exit_code, outputs, sideEffects }))
|
|
793
|
+
.digest('hex');
|
|
794
|
+
|
|
795
|
+
runs.push({
|
|
796
|
+
run_number: r + 1,
|
|
797
|
+
duration_ms: durationMs,
|
|
798
|
+
passed,
|
|
799
|
+
exit_code: obs.exit_code,
|
|
800
|
+
outputs,
|
|
801
|
+
output_hash: deterministicOutputHash,
|
|
802
|
+
assertions_passed: assertionsPassed,
|
|
803
|
+
assertions_failed: assertionsFailed,
|
|
804
|
+
});
|
|
805
|
+
} finally {
|
|
806
|
+
fixture.cleanup();
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
// Classify repeatability (Section 19)
|
|
811
|
+
let repClass = REPEATABILITY.DETERMINISTIC;
|
|
812
|
+
const allPassed = runs.every(r => r.passed);
|
|
813
|
+
|
|
814
|
+
if (!allPassed) {
|
|
815
|
+
repClass = runs.some(r => r.passed) ? REPEATABILITY.UNSTABLE : REPEATABILITY.FAILED;
|
|
816
|
+
} else {
|
|
817
|
+
const hashes = new Set(runs.map(r => r.output_hash));
|
|
818
|
+
if (hashes.size === 1) repClass = REPEATABILITY.DETERMINISTIC;
|
|
819
|
+
else if (hashes.size <= 2) repClass = REPEATABILITY.STABLE;
|
|
820
|
+
else repClass = REPEATABILITY.NONDETERMINISTIC;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
const finalStatus = allPassed ? 'PASS' : 'FAIL';
|
|
824
|
+
const obsHash = crypto.createHash('sha256').update(JSON.stringify(runs.map(r => r.output_hash))).digest('hex');
|
|
825
|
+
const evidenceHash = crypto.createHash('sha256').update(`${test.id}:${obsHash}:${repClass}`).digest('hex');
|
|
826
|
+
|
|
827
|
+
const result = {
|
|
828
|
+
test_id: test.id,
|
|
829
|
+
skill_id: test.skill_id,
|
|
830
|
+
execution_id: `EXEC-${Date.now()}-${crypto.randomBytes(3).toString('hex')}`,
|
|
831
|
+
status: finalStatus,
|
|
832
|
+
assertions: {
|
|
833
|
+
passed: runs[0]?.assertions_passed || [],
|
|
834
|
+
failed: runs[0]?.assertions_failed || [],
|
|
835
|
+
},
|
|
836
|
+
observation: {
|
|
837
|
+
hash: obsHash,
|
|
838
|
+
},
|
|
839
|
+
repeatability: {
|
|
840
|
+
classification: repClass,
|
|
841
|
+
runs: runs.length,
|
|
842
|
+
passed_runs: runs.filter(r => r.passed).length,
|
|
843
|
+
},
|
|
844
|
+
evidence: {
|
|
845
|
+
hash: evidenceHash,
|
|
846
|
+
source: test.evidence_sources[0]?.source || 'contract.schema',
|
|
847
|
+
},
|
|
848
|
+
timestamp: new Date().toISOString(),
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
return result;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// ─── Stale Evidence Detection (Section 23) ──────────────────────────────────
|
|
855
|
+
function checkStaleTests(test) {
|
|
856
|
+
const agentDir = path.resolve(__dirname, '..');
|
|
857
|
+
const skillFile = path.join(agentDir, 'skills', test.skill_id, 'SKILL.md');
|
|
858
|
+
|
|
859
|
+
if (!fs.existsSync(skillFile)) {
|
|
860
|
+
test.review.status = REVIEW_STATES.STALE;
|
|
861
|
+
return { is_stale: true, reason: 'Skill file no longer exists' };
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const currentContent = fs.readFileSync(skillFile, 'utf8');
|
|
865
|
+
const currentHash = crypto.createHash('sha256').update(currentContent).digest('hex');
|
|
866
|
+
const recordedHash = test.evidence_sources[0]?.source_hash;
|
|
867
|
+
|
|
868
|
+
if (recordedHash && recordedHash !== currentHash) {
|
|
869
|
+
test.review.status = REVIEW_STATES.STALE;
|
|
870
|
+
return {
|
|
871
|
+
is_stale: true,
|
|
872
|
+
reason: `SKILL.md source hash mismatch: recorded ${recordedHash.slice(0, 8)} vs current ${currentHash.slice(0, 8)}`,
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
return { is_stale: false };
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// ─── Governed Mutation & Rollback (Section 25) ──────────────────────────────
|
|
880
|
+
function materializeTest(approvedTest, options = {}) {
|
|
881
|
+
const agentDir = path.resolve(__dirname, '..');
|
|
882
|
+
const repoRoot = path.resolve(agentDir, '..');
|
|
883
|
+
const targetDir = options.testDir || path.join(repoRoot, 'test', 'unit');
|
|
884
|
+
const testFilePath = path.join(targetDir, `${approvedTest.id}.test.json`);
|
|
885
|
+
|
|
886
|
+
// 1. Create pre-change snapshot
|
|
887
|
+
const snapshot = {
|
|
888
|
+
exists: fs.existsSync(testFilePath),
|
|
889
|
+
content: fs.existsSync(testFilePath) ? fs.readFileSync(testFilePath, 'utf8') : null,
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
try {
|
|
893
|
+
// 2. Calculate test hash
|
|
894
|
+
const testHash = crypto.createHash('sha256').update(JSON.stringify(approvedTest)).digest('hex');
|
|
895
|
+
|
|
896
|
+
// 3. Validate independence
|
|
897
|
+
const indep = validateTestIndependence(approvedTest);
|
|
898
|
+
if (!indep.valid) throw new Error(indep.reason);
|
|
899
|
+
|
|
900
|
+
// 4. Verify quality
|
|
901
|
+
const quality = calculateTestQualityScore(approvedTest);
|
|
902
|
+
if (!quality.acceptable) throw new Error(`Test quality below 80: ${quality.score}`);
|
|
903
|
+
|
|
904
|
+
// 5. Write test file
|
|
905
|
+
fs.mkdirSync(path.dirname(testFilePath), { recursive: true });
|
|
906
|
+
fs.writeFileSync(testFilePath, JSON.stringify(approvedTest, null, 2), 'utf8');
|
|
907
|
+
|
|
908
|
+
// 6. Record provenance
|
|
909
|
+
return {
|
|
910
|
+
success: true,
|
|
911
|
+
path: testFilePath,
|
|
912
|
+
test_hash: testHash,
|
|
913
|
+
provenance: {
|
|
914
|
+
materialized_at: new Date().toISOString(),
|
|
915
|
+
quality_score: quality.score,
|
|
916
|
+
},
|
|
917
|
+
};
|
|
918
|
+
} catch (err) {
|
|
919
|
+
// Rollback
|
|
920
|
+
if (snapshot.exists && snapshot.content !== null) {
|
|
921
|
+
fs.writeFileSync(testFilePath, snapshot.content, 'utf8');
|
|
922
|
+
} else if (fs.existsSync(testFilePath)) {
|
|
923
|
+
fs.unlinkSync(testFilePath);
|
|
924
|
+
}
|
|
925
|
+
return {
|
|
926
|
+
success: false,
|
|
927
|
+
rolled_back: true,
|
|
928
|
+
error: err.message,
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
// ─── Certification Integration (Sections 21-22) ─────────────────────────────
|
|
934
|
+
function evaluateCertification(skillName, testResults, claims) {
|
|
935
|
+
const applicableClaims = claims.filter(c => c.testability !== TESTABILITY.UNTESTABLE);
|
|
936
|
+
|
|
937
|
+
if (applicableClaims.length === 0) {
|
|
938
|
+
return {
|
|
939
|
+
skill: skillName,
|
|
940
|
+
status: 'NOT_APPLICABLE',
|
|
941
|
+
coverage_pct: 0,
|
|
942
|
+
coverage_rating: 'LOW',
|
|
943
|
+
reason: 'Skill has zero testable behavioral claims (reference-only)',
|
|
944
|
+
verified_claims: 0,
|
|
945
|
+
applicable_claims: 0,
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
const passedResults = testResults.filter(
|
|
950
|
+
r =>
|
|
951
|
+
r.status === 'PASS' &&
|
|
952
|
+
r.repeatability?.classification === REPEATABILITY.DETERMINISTIC,
|
|
953
|
+
);
|
|
954
|
+
|
|
955
|
+
const verifiedCount = passedResults.length;
|
|
956
|
+
const applicableCount = applicableClaims.length;
|
|
957
|
+
|
|
958
|
+
const coveragePct = Math.round((verifiedCount / applicableCount) * 100);
|
|
959
|
+
|
|
960
|
+
let rating = 'LOW';
|
|
961
|
+
if (coveragePct >= 95) rating = 'COMPLETE';
|
|
962
|
+
else if (coveragePct >= 75) rating = 'HIGH';
|
|
963
|
+
else if (coveragePct >= 50) rating = 'PARTIAL';
|
|
964
|
+
|
|
965
|
+
let status = 'UNPROVABLE';
|
|
966
|
+
if (coveragePct >= 95 && passedResults.length === testResults.length && testResults.length > 0) {
|
|
967
|
+
status = 'BEHAVIORALLY_CERTIFIED';
|
|
968
|
+
} else if (coveragePct > 0) {
|
|
969
|
+
status = 'PARTIAL';
|
|
970
|
+
} else {
|
|
971
|
+
status = 'UNPROVABLE';
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
return {
|
|
975
|
+
skill: skillName,
|
|
976
|
+
status,
|
|
977
|
+
coverage_pct: coveragePct,
|
|
978
|
+
coverage_rating: rating,
|
|
979
|
+
applicable_claims: applicableCount,
|
|
980
|
+
verified_claims: verifiedCount,
|
|
981
|
+
total_claims: claims.length,
|
|
982
|
+
results_summary: {
|
|
983
|
+
total_executed: testResults.length,
|
|
984
|
+
passed: passedResults.length,
|
|
985
|
+
deterministic: passedResults.filter(r => r.repeatability?.classification === REPEATABILITY.DETERMINISTIC).length,
|
|
986
|
+
},
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
module.exports = {
|
|
991
|
+
TESTABILITY,
|
|
992
|
+
TEST_TYPES,
|
|
993
|
+
REVIEW_STATES,
|
|
994
|
+
REPEATABILITY,
|
|
995
|
+
CRITICAL_DOMAINS,
|
|
996
|
+
discoverTestableSkills,
|
|
997
|
+
extractTestableClaims,
|
|
998
|
+
detectCircularity,
|
|
999
|
+
validateTestIndependence,
|
|
1000
|
+
calculateTestRisk,
|
|
1001
|
+
calculateTestQualityScore,
|
|
1002
|
+
detectNoOp,
|
|
1003
|
+
generateTestSpecification,
|
|
1004
|
+
validateSpecification,
|
|
1005
|
+
prepareReviewPackage,
|
|
1006
|
+
approveSpecification,
|
|
1007
|
+
executeApprovedTest,
|
|
1008
|
+
checkStaleTests,
|
|
1009
|
+
materializeTest,
|
|
1010
|
+
evaluateCertification,
|
|
1011
|
+
};
|