tribunal-kit 6.0.1 → 8.0.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/.agent/ARCHITECTURE.md +9 -6
- package/.agent/agents/accessibility-reviewer.md +23 -16
- package/.agent/agents/ai-code-reviewer.md +25 -21
- package/.agent/agents/anti-pattern-reviewer.md +12 -7
- package/.agent/agents/api-architect.md +1 -0
- package/.agent/agents/backend-specialist.md +23 -22
- package/.agent/agents/cloud-engineer.md +1 -0
- package/.agent/agents/code-archaeologist.md +1 -0
- package/.agent/agents/complexity-reviewer.md +10 -7
- package/.agent/agents/database-architect.md +3 -2
- package/.agent/agents/db-latency-auditor.md +6 -2
- package/.agent/agents/debugger.md +3 -2
- package/.agent/agents/dependency-reviewer.md +1 -0
- package/.agent/agents/devops-engineer.md +9 -8
- package/.agent/agents/documentation-writer.md +6 -5
- package/.agent/agents/explorer-agent.md +1 -0
- package/.agent/agents/frontend-reviewer.md +21 -17
- package/.agent/agents/frontend-specialist.md +23 -20
- package/.agent/agents/game-developer.md +1 -0
- package/.agent/agents/interaction-reviewer.md +10 -5
- package/.agent/agents/logic-reviewer.md +3 -0
- package/.agent/agents/minimalist-reviewer.md +6 -0
- package/.agent/agents/mobile-developer.md +7 -6
- package/.agent/agents/mobile-reviewer.md +14 -13
- package/.agent/agents/orchestrator.md +3 -0
- package/.agent/agents/penetration-tester.md +1 -0
- package/.agent/agents/performance-optimizer.md +6 -5
- package/.agent/agents/performance-reviewer.md +6 -6
- package/.agent/agents/pipeline-reviewer.md +144 -0
- package/.agent/agents/precedence-reviewer.md +1 -0
- package/.agent/agents/product-manager.md +1 -0
- package/.agent/agents/product-owner.md +1 -0
- package/.agent/agents/product-reviewer.md +12 -7
- package/.agent/agents/project-planner.md +3 -0
- package/.agent/agents/qa-automation-engineer.md +50 -43
- package/.agent/agents/resilience-reviewer.md +1 -0
- package/.agent/agents/schema-reviewer.md +1 -0
- package/.agent/agents/security-auditor.md +24 -24
- package/.agent/agents/seo-specialist.md +33 -23
- package/.agent/agents/sql-reviewer.md +5 -4
- package/.agent/agents/supervisor-agent.md +12 -2
- package/.agent/agents/swarm-worker-contracts.md +13 -13
- package/.agent/agents/swarm-worker-registry.md +51 -51
- package/.agent/agents/system-architect.md +1 -0
- package/.agent/agents/test-coverage-reviewer.md +25 -22
- package/.agent/agents/test-engineer.md +12 -11
- package/.agent/agents/throughput-optimizer.md +45 -40
- package/.agent/agents/type-safety-reviewer.md +5 -4
- package/.agent/agents/ui-ux-auditor.md +6 -4
- package/.agent/agents/ui-visual-auditor.md +3 -0
- package/.agent/agents/ux-reviewer.md +11 -6
- package/.agent/agents/visual-reviewer.md +11 -6
- package/.agent/agents/vitals-reviewer.md +5 -4
- package/.agent/config/claude.json +18 -0
- package/.agent/config/plugin.json +102 -0
- package/.agent/config/slash-commands.json +103 -0
- package/.agent/config/specialist-registry.json +415 -0
- package/.agent/config/system-prompt.md +191 -0
- package/.agent/history/architecture-graph.yaml +302 -3
- package/.agent/history/graph-cache.json +515 -45
- package/.agent/history/memory/.memory.idx +1532 -1
- package/.agent/history/memory/MEMORY.md +102 -1
- package/.agent/history/memory.db +0 -0
- package/.agent/history/snapshots/bin__adapter-install.js.json +13 -0
- package/.agent/history/snapshots/bin__global-store.js.json +15 -0
- package/.agent/history/snapshots/bin__mcp-server.js.json +19 -0
- package/.agent/history/snapshots/bin__proxy-server.js.json +20 -0
- package/.agent/history/snapshots/bin__spawn-agent.js.json +12 -0
- package/.agent/history/snapshots/bin__tk-proxy.js.json +21 -0
- package/.agent/history/snapshots/bin__tribunal-kit.js.json +9 -7
- package/.agent/history/snapshots/bin__wrapper.js.json +14 -0
- package/.agent/history/snapshots/eslint.config.js.json +1 -2
- package/.agent/history/snapshots/scripts__benchmark.js.json +14 -0
- package/.agent/history/snapshots/scripts__changelog.js.json +1 -2
- package/.agent/history/snapshots/scripts__fix-vbc.js.json +11 -0
- package/.agent/history/snapshots/scripts__stress_benchmark.js.json +15 -0
- package/.agent/history/snapshots/scripts__sync-version.js.json +1 -2
- package/.agent/history/snapshots/scripts__validate-payload.js.json +1 -2
- package/.agent/history/snapshots/scripts__visual_audit.js.json +11 -0
- package/.agent/history/snapshots/test__integration__bridges.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__graceful_degradation.test.js.json +12 -0
- package/.agent/history/snapshots/test__integration__init.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__minimal_change_pipeline.test.js.json +13 -0
- package/.agent/history/snapshots/test__integration__parallel_tribunal.test.js.json +12 -0
- package/.agent/history/snapshots/test__integration__routing.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__sync_status.test.js.json +13 -0
- package/.agent/history/snapshots/test__integration__wave2.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__wrapper.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__align.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__args.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__audit_release.test.js.json +16 -0
- package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +1 -2
- package/.agent/history/snapshots/test__unit__cicd_validator.test.js.json +12 -0
- package/.agent/history/snapshots/test__unit__compile.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__context_broker.test.js.json +1 -2
- package/.agent/history/snapshots/test__unit__contract_engine.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__copyDir.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +1 -2
- package/.agent/history/snapshots/test__unit__guardrail_engine.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__impact_classifier.test.js.json +12 -0
- package/.agent/history/snapshots/test__unit__init.test.js.json +14 -0
- package/.agent/history/snapshots/test__unit__inner_loop_validator.test.js.json +1 -2
- package/.agent/history/snapshots/test__unit__integrity_manifest.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__learn.test.js.json +11 -0
- package/.agent/history/snapshots/test__unit__marathon.test.js.json +22 -0
- package/.agent/history/snapshots/test__unit__mcp_server.test.js.json +16 -0
- package/.agent/history/snapshots/test__unit__memory.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__minimal_change.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__native.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__optimize.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__path_resolution.test.js.json +14 -0
- package/.agent/history/snapshots/test__unit__production_readiness_evidence.test.js.json +21 -0
- package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__semver.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__skill_evolution.test.js.json +11 -0
- package/.agent/history/snapshots/test__unit__stress.test.js.json +15 -0
- package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__utils.test.js.json +10 -0
- package/.agent/mcp_config.json +1 -6
- package/.agent/routing_index.json +2033 -263
- package/.agent/rules/GEMINI.md +11 -9
- package/.agent/rules/GEMINI_PLANNER.md +19 -21
- package/.agent/scripts/_colors.js +52 -54
- package/.agent/scripts/_utils.js +52 -53
- package/.agent/scripts/ast_context_loader.js +137 -0
- package/.agent/scripts/auto_preview.js +39 -43
- package/.agent/scripts/bundle_analyzer.js +47 -60
- package/.agent/scripts/case_law_manager.js +200 -294
- package/.agent/scripts/checklist.js +73 -94
- package/.agent/scripts/cicd_validator.js +305 -0
- package/.agent/scripts/context_broker.js +317 -412
- package/.agent/scripts/contract_engine.js +402 -0
- package/.agent/scripts/dependency_analyzer.js +112 -124
- package/.agent/scripts/graph_builder.js +75 -103
- package/.agent/scripts/graph_visualizer.js +10 -12
- package/.agent/scripts/graph_zoom.js +38 -55
- package/.agent/scripts/guardrail_engine.js +195 -145
- package/.agent/scripts/impact_classifier.js +55 -30
- package/.agent/scripts/inner_loop_validator.js +108 -159
- package/.agent/scripts/integrity_manifest.js +59 -67
- package/.agent/scripts/lint_runner.js +65 -75
- package/.agent/scripts/marathon_harness.js +131 -208
- package/.agent/scripts/memory_engine.js +581 -0
- package/.agent/scripts/minify_context.js +29 -33
- package/.agent/scripts/minimal_change_engine.js +95 -87
- package/.agent/scripts/mutation_runner.js +46 -62
- package/.agent/scripts/payload_schemas.js +146 -0
- package/.agent/scripts/pipeline_engine.js +320 -209
- package/.agent/scripts/prompt_compiler.js +166 -93
- package/.agent/scripts/schema_validator.js +73 -121
- package/.agent/scripts/security_scan.js +88 -117
- package/.agent/scripts/session_manager.js +52 -69
- package/.agent/scripts/signal_detector.js +24 -22
- package/.agent/scripts/skill_evolution.js +184 -245
- package/.agent/scripts/skill_integrator.js +35 -48
- package/.agent/scripts/socratic_gate_policy.js +15 -12
- package/.agent/scripts/strengthen_skills.js +29 -33
- package/.agent/scripts/swarm_dispatcher.js +397 -200
- package/.agent/scripts/test_runner.js +54 -56
- package/.agent/scripts/token_budget_broker.js +126 -13
- package/.agent/scripts/trace_engine.js +126 -0
- package/.agent/scripts/verify_all.js +76 -93
- package/.agent/scripts/visual_audit.js +16 -21
- package/.agent/skill_topic_map.json +22 -3
- package/.agent/skills/12-principles-of-animation/SKILL.md +7 -0
- package/.agent/skills/60fps-animation/SKILL.md +7 -0
- package/.agent/skills/accessible-animation/SKILL.md +5 -1
- package/.agent/skills/adapt/SKILL.md +7 -1
- package/.agent/skills/advanced-rag-pipelines/SKILL.md +1 -0
- package/.agent/skills/agent-organizer/SKILL.md +1 -0
- package/.agent/skills/agentic-patterns/SKILL.md +33 -25
- package/.agent/skills/agentic-workflows-2026/SKILL.md +6 -2
- package/.agent/skills/ai-app-hardening/SKILL.md +9 -8
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +7 -6
- package/.agent/skills/animation-on-scroll/SKILL.md +24 -15
- package/.agent/skills/animation-systems/SKILL.md +11 -10
- package/.agent/skills/antfu-conventions/SKILL.md +7 -2
- package/.agent/skills/api-patterns/SKILL.md +14 -10
- package/.agent/skills/api-security-auditor/SKILL.md +15 -14
- package/.agent/skills/app-builder/SKILL.md +1 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +2 -2
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +12 -12
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +3 -3
- package/.agent/skills/apple-design/SKILL.md +8 -7
- package/.agent/skills/architecture/SKILL.md +3 -2
- package/.agent/skills/audit-and-fix/SKILL.md +8 -5
- package/.agent/skills/authentication-best-practices/SKILL.md +9 -8
- package/.agent/skills/backend-security-expert/SKILL.md +1 -0
- package/.agent/skills/baseline-ui/SKILL.md +8 -7
- package/.agent/skills/bash-linux/SKILL.md +1 -0
- package/.agent/skills/behavioral-modes/SKILL.md +1 -0
- package/.agent/skills/better-colors/SKILL.md +11 -7
- package/.agent/skills/better-typography/SKILL.md +30 -16
- package/.agent/skills/better-ui/SKILL.md +17 -10
- package/.agent/skills/bolder/SKILL.md +6 -0
- package/.agent/skills/brainstorming/SKILL.md +6 -4
- package/.agent/skills/browser-native-ai/SKILL.md +5 -4
- package/.agent/skills/build-primitive/SKILL.md +5 -0
- package/.agent/skills/building-native-ui/SKILL.md +1 -0
- package/.agent/skills/cicd-pro/SKILL.md +2 -1
- package/.agent/skills/clarify/SKILL.md +19 -14
- package/.agent/skills/clean-code/SKILL.md +16 -15
- package/.agent/skills/cloud-architect/SKILL.md +1 -0
- package/.agent/skills/cobejs/SKILL.md +7 -9
- package/.agent/skills/code-review-checklist/SKILL.md +1 -0
- package/.agent/skills/codebase-design/SKILL.md +7 -2
- package/.agent/skills/colorize/SKILL.md +8 -3
- package/.agent/skills/compact-landing/SKILL.md +8 -3
- package/.agent/skills/company-logos/SKILL.md +6 -0
- package/.agent/skills/config-validator/SKILL.md +10 -9
- package/.agent/skills/containerization-pro/SKILL.md +6 -5
- package/.agent/skills/context-engineering-pro/SKILL.md +5 -4
- package/.agent/skills/create-design-md/SKILL.md +13 -5
- package/.agent/skills/critique/SKILL.md +10 -8
- package/.agent/skills/csharp-developer/SKILL.md +1 -0
- package/.agent/skills/data-validation-schemas/SKILL.md +28 -23
- package/.agent/skills/database-design/SKILL.md +2 -1
- package/.agent/skills/delight/SKILL.md +6 -0
- package/.agent/skills/deployment-procedures/SKILL.md +2 -1
- package/.agent/skills/design-lab/SKILL.md +5 -0
- package/.agent/skills/devops-engineer/SKILL.md +3 -2
- package/.agent/skills/devops-incident-responder/SKILL.md +2 -1
- package/.agent/skills/diagnosing-bugs/SKILL.md +12 -2
- package/.agent/skills/distill/SKILL.md +7 -2
- package/.agent/skills/documentation-templates/SKILL.md +3 -2
- package/.agent/skills/domain-modeling/SKILL.md +12 -4
- package/.agent/skills/duckdb-analytical-sql/SKILL.md +7 -3
- package/.agent/skills/edge-ai-mobile/SKILL.md +5 -1
- package/.agent/skills/edge-computing/SKILL.md +9 -8
- package/.agent/skills/emil-design-eng/SKILL.md +43 -27
- package/.agent/skills/error-resilience/SKILL.md +34 -16
- package/.agent/skills/expo-router-v4/SKILL.md +2 -1
- package/.agent/skills/extract-design-system/SKILL.md +12 -11
- package/.agent/skills/fabel-protocol/SKILL.md +24 -17
- package/.agent/skills/fixing-accessibility/SKILL.md +23 -16
- package/.agent/skills/fixing-metadata/SKILL.md +24 -13
- package/.agent/skills/fixing-motion-performance/SKILL.md +7 -5
- package/.agent/skills/framer-motion-expert/SKILL.md +29 -15
- package/.agent/skills/frontend-design/SKILL.md +21 -13
- package/.agent/skills/frontend-security-expert/SKILL.md +1 -0
- package/.agent/skills/game-design-expert/SKILL.md +1 -0
- package/.agent/skills/game-engineering-expert/SKILL.md +1 -0
- package/.agent/skills/generative-ui-expert/SKILL.md +3 -2
- package/.agent/skills/geo-fundamentals/SKILL.md +2 -1
- package/.agent/skills/git-pro/SKILL.md +10 -9
- package/.agent/skills/github-operations/SKILL.md +2 -1
- package/.agent/skills/gpt-taste/SKILL.md +7 -0
- package/.agent/skills/gsap-core/SKILL.md +26 -22
- package/.agent/skills/gsap-frameworks/SKILL.md +6 -5
- package/.agent/skills/gsap-performance/SKILL.md +4 -3
- package/.agent/skills/gsap-plugins/SKILL.md +34 -33
- package/.agent/skills/gsap-react/SKILL.md +9 -8
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +34 -33
- package/.agent/skills/gsap-timeline/SKILL.md +18 -15
- package/.agent/skills/gsap-utils/SKILL.md +25 -24
- package/.agent/skills/harden/SKILL.md +9 -3
- package/.agent/skills/harness-protocol/SKILL.md +1 -0
- package/.agent/skills/i18n-localization/SKILL.md +10 -9
- package/.agent/skills/impeccable/SKILL.md +5 -0
- package/.agent/skills/improve-codebase-architecture/SKILL.md +10 -5
- package/.agent/skills/improve-ui/SKILL.md +12 -5
- package/.agent/skills/intelligent-routing/SKILL.md +7 -6
- package/.agent/skills/knowledge-graph/SKILL.md +1 -0
- package/.agent/skills/landing-page/SKILL.md +1 -0
- package/.agent/skills/lint-and-validate/SKILL.md +9 -4
- package/.agent/skills/llm-engineering/SKILL.md +55 -54
- package/.agent/skills/local-first/SKILL.md +20 -19
- package/.agent/skills/local-first-architecture/SKILL.md +6 -1
- package/.agent/skills/lottie-animation/SKILL.md +7 -3
- package/.agent/skills/marquee-loop/SKILL.md +1 -0
- package/.agent/skills/masked-reveal/SKILL.md +17 -4
- package/.agent/skills/mcp-builder/SKILL.md +13 -10
- package/.agent/skills/micro-interaction/SKILL.md +20 -5
- package/.agent/skills/mobile-design/SKILL.md +26 -15
- package/.agent/skills/monorepo-management/SKILL.md +3 -2
- package/.agent/skills/morphing-icons/SKILL.md +16 -6
- package/.agent/skills/motion-engineering/SKILL.md +19 -15
- package/.agent/skills/nextjs-react-expert/SKILL.md +26 -21
- package/.agent/skills/nodejs-best-practices/SKILL.md +89 -76
- package/.agent/skills/observability/SKILL.md +45 -44
- package/.agent/skills/opentelemetry-observability/SKILL.md +2 -1
- package/.agent/skills/page-transition-animation/SKILL.md +6 -3
- package/.agent/skills/parallel-agents/SKILL.md +7 -2
- package/.agent/skills/performance-profiling/SKILL.md +24 -13
- package/.agent/skills/plan-writing/SKILL.md +1 -0
- package/.agent/skills/platform-engineer/SKILL.md +3 -2
- package/.agent/skills/platform-engineering-opentofu/SKILL.md +1 -0
- package/.agent/skills/playwright-ai-e2e/SKILL.md +3 -2
- package/.agent/skills/playwright-best-practices/SKILL.md +29 -28
- package/.agent/skills/polish/SKILL.md +13 -12
- package/.agent/skills/powershell-windows/SKILL.md +1 -0
- package/.agent/skills/pricing-page/SKILL.md +8 -3
- package/.agent/skills/product-aware-heuristics/SKILL.md +122 -72
- package/.agent/skills/progressive-blur/SKILL.md +9 -4
- package/.agent/skills/project-idioms/SKILL.md +1 -0
- package/.agent/skills/property-based-testing/SKILL.md +10 -12
- package/.agent/skills/python-patterns/SKILL.md +1 -0
- package/.agent/skills/python-pro/SKILL.md +1 -0
- package/.agent/skills/quieter/SKILL.md +6 -0
- package/.agent/skills/react-doctor/SKILL.md +6 -0
- package/.agent/skills/react-specialist/SKILL.md +32 -28
- package/.agent/skills/readme-builder/SKILL.md +1 -0
- package/.agent/skills/realtime-patterns/SKILL.md +34 -33
- package/.agent/skills/red-team-tactics/SKILL.md +1 -0
- package/.agent/skills/redesign-skill/SKILL.md +6 -0
- package/.agent/skills/review-animations/SKILL.md +5 -2
- package/.agent/skills/review-animations/STANDARDS.md +37 -23
- package/.agent/skills/rust-pro/SKILL.md +1 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +4 -3
- package/.agent/skills/server-management/SKILL.md +1 -0
- package/.agent/skills/shadcn-ui-expert/SKILL.md +28 -22
- package/.agent/skills/shape/SKILL.md +9 -2
- package/.agent/skills/skill-creator/SKILL.md +1 -0
- package/.agent/skills/soft-skill/SKILL.md +6 -0
- package/.agent/skills/sounds-on-the-web/SKILL.md +1 -0
- package/.agent/skills/sql-pro/SKILL.md +1 -0
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +1 -0
- package/.agent/skills/svg-animation/SKILL.md +16 -7
- package/.agent/skills/swiftui-expert/SKILL.md +1 -0
- package/.agent/skills/swiss-design/SKILL.md +5 -0
- package/.agent/skills/system-design-pro/SKILL.md +1 -0
- package/.agent/skills/systematic-debugging/SKILL.md +1 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +25 -11
- package/.agent/skills/taste-skill/SKILL.md +6 -0
- package/.agent/skills/tdd-workflow/SKILL.md +5 -0
- package/.agent/skills/test-result-analyzer/SKILL.md +1 -0
- package/.agent/skills/testing-patterns/SKILL.md +123 -115
- package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +5 -0
- package/.agent/skills/thinking-protocol/SKILL.md +3 -0
- package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +9 -8
- package/.agent/skills/transitions-dev/SKILL.md +19 -6
- package/.agent/skills/trend-researcher/SKILL.md +1 -0
- package/.agent/skills/typescript-advanced/SKILL.md +23 -18
- package/.agent/skills/typeset/SKILL.md +10 -1
- package/.agent/skills/ui-reasoning-engine/SKILL.md +67 -48
- package/.agent/skills/ui-skill-packs/SKILL.md +6 -1
- package/.agent/skills/ui-skills-root/SKILL.md +39 -38
- package/.agent/skills/ui-ux-pro-max/SKILL.md +34 -26
- package/.agent/skills/ui-ux-researcher/SKILL.md +1 -0
- package/.agent/skills/vector-search-pgvector/SKILL.md +3 -2
- package/.agent/skills/vue-expert/SKILL.md +22 -19
- package/.agent/skills/vulnerability-scanner/SKILL.md +22 -21
- package/.agent/skills/web-accessibility-auditor/SKILL.md +2 -1
- package/.agent/skills/web-design-guidelines/SKILL.md +16 -10
- package/.agent/skills/web-quality-audit/SKILL.md +5 -0
- package/.agent/skills/webapp-testing/SKILL.md +14 -13
- package/.agent/skills/webgpu-performance/SKILL.md +1 -0
- package/.agent/skills/whimsy-injector/SKILL.md +9 -5
- package/.agent/skills/workflow-optimizer/SKILL.md +1 -0
- package/.agent/skills/zero-trust-passkeys/SKILL.md +11 -6
- package/.agent/templates/DESIGN.md +119 -110
- package/.agent/templates/design-tokens.json +9 -6
- package/.agent/workflows/acf.md +1 -0
- package/.agent/workflows/api-tester.md +1 -0
- package/.agent/workflows/audit.md +1 -0
- package/.agent/workflows/brainstorm.md +1 -0
- package/.agent/workflows/changelog.md +1 -0
- package/.agent/workflows/contract.md +60 -0
- package/.agent/workflows/create.md +1 -0
- package/.agent/workflows/debug.md +1 -0
- package/.agent/workflows/deploy.md +1 -0
- package/.agent/workflows/enhance.md +1 -0
- package/.agent/workflows/fix-ci.md +89 -0
- package/.agent/workflows/fix.md +1 -0
- package/.agent/workflows/generate.md +1 -0
- package/.agent/workflows/marathon.md +1 -0
- package/.agent/workflows/migrate.md +1 -0
- package/.agent/workflows/minimal.md +9 -7
- package/.agent/workflows/orchestrate.md +1 -0
- package/.agent/workflows/performance-benchmarker.md +1 -0
- package/.agent/workflows/pipeline.md +26 -21
- package/.agent/workflows/plan.md +1 -0
- package/.agent/workflows/preview.md +1 -0
- package/.agent/workflows/refactor.md +3 -2
- package/.agent/workflows/review-ai.md +4 -3
- package/.agent/workflows/review.md +1 -0
- package/.agent/workflows/session.md +1 -0
- package/.agent/workflows/status.md +1 -0
- package/.agent/workflows/strengthen-skills.md +1 -0
- package/.agent/workflows/super-prompt.md +1 -0
- package/.agent/workflows/swarm.md +15 -3
- package/.agent/workflows/test.md +8 -7
- package/.agent/workflows/tribunal-backend.md +3 -2
- package/.agent/workflows/tribunal-cicd.md +104 -0
- package/.agent/workflows/tribunal-database.md +1 -0
- package/.agent/workflows/tribunal-frontend.md +8 -6
- package/.agent/workflows/tribunal-full.md +2 -1
- package/.agent/workflows/tribunal-mobile.md +6 -5
- package/.agent/workflows/tribunal-performance.md +1 -0
- package/.agent/workflows/tribunal-speed.md +1 -0
- package/.agent/workflows/tribunal-ui.md +29 -21
- package/.agent/workflows/ui-ux-pro-max.md +19 -15
- package/.claude/CLAUDE.md +442 -0
- package/CONTRIBUTING.md +3 -3
- package/README.md +105 -45
- package/SECURITY.md +11 -11
- package/bin/adapter-install.js +240 -0
- package/bin/global-store.js +48 -0
- package/bin/mcp-server.js +781 -332
- package/bin/proxy-server.js +113 -0
- package/bin/spawn-agent.js +39 -0
- package/bin/tk-proxy.js +34 -0
- package/bin/tribunal-kit.js +29 -30
- package/bin/wrapper.js +40 -46
- package/dist/cli.js +6 -0
- package/dist/commands/case.js +2 -0
- package/dist/commands/contract.js +440 -0
- package/dist/commands/init.js +8 -51
- package/dist/commands/status.js +61 -30
- package/dist/commands/validate.js +22 -31
- package/dist/index.d.ts +8 -1
- package/dist/tui/banner.js +77 -0
- package/dist/tui/index.js +21 -0
- package/dist/tui/reviewer-grid.js +90 -0
- package/dist/tui/shimmer.js +91 -0
- package/dist/tui/theme.js +130 -0
- package/dist/tui/tree.js +93 -0
- package/dist/tui/wizard.js +148 -0
- package/dist/utils/helpers.js +5 -41
- package/package.json +33 -15
- package/scripts/benchmark.js +62 -86
- package/scripts/build-graph.js +71 -0
- package/scripts/changelog.js +67 -73
- package/scripts/fix-vbc.js +13 -15
- package/scripts/fix-vbc.ps1 +2 -118
- package/scripts/stress_benchmark.js +358 -0
- package/scripts/sync-version.js +71 -41
- package/scripts/validate-payload.js +23 -30
- package/scripts/visual_audit.js +23 -13
- package/.agent/history/snapshots/migrate_refs.js.json +0 -11
- package/.agent/scripts/compile_router.py +0 -112
- package/.agent/scripts/migrate_skills_frontmatter.py +0 -64
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* contract.js — CLI command handler for `tk contract`
|
|
5
|
+
*
|
|
6
|
+
* Commands:
|
|
7
|
+
* tk contract init → Scaffold .tribunal/contracts/ with starter rules
|
|
8
|
+
* tk contract verify → Run contract checks against target/modified files
|
|
9
|
+
* tk contract verify --file <path> → Run contract checks against a single file
|
|
10
|
+
* tk contract list → List loaded contracts and details
|
|
11
|
+
* tk contract trace list → List captured failure context snapshots
|
|
12
|
+
* tk contract replay <id> → Replay failure trace snapshot in CLI
|
|
13
|
+
* tk contract generate --from-case <id> → Auto-generate a contract from a Case Law entry
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.cmdContract = cmdContract;
|
|
18
|
+
|
|
19
|
+
const fs = require("fs");
|
|
20
|
+
const path = require("path");
|
|
21
|
+
const logger_1 = require("../utils/logger");
|
|
22
|
+
|
|
23
|
+
async function cmdContract(flags, argv, quiet = false) {
|
|
24
|
+
const projectRoot = flags.path ? path.resolve(flags.path) : process.cwd();
|
|
25
|
+
const rawArgs = argv.slice(3);
|
|
26
|
+
const subCmd = rawArgs[0] || "verify";
|
|
27
|
+
|
|
28
|
+
if (subCmd === "help" || subCmd === "--help" || subCmd === "-h") {
|
|
29
|
+
showContractHelp(quiet);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const contractEngineScript = path.join(
|
|
34
|
+
projectRoot,
|
|
35
|
+
".agent",
|
|
36
|
+
"scripts",
|
|
37
|
+
"contract_engine.js",
|
|
38
|
+
);
|
|
39
|
+
const traceEngineScript = path.join(
|
|
40
|
+
projectRoot,
|
|
41
|
+
".agent",
|
|
42
|
+
"scripts",
|
|
43
|
+
"trace_engine.js",
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const contractEngine = fs.existsSync(contractEngineScript)
|
|
47
|
+
? require(contractEngineScript)
|
|
48
|
+
: null;
|
|
49
|
+
const traceEngine = fs.existsSync(traceEngineScript)
|
|
50
|
+
? require(traceEngineScript)
|
|
51
|
+
: null;
|
|
52
|
+
|
|
53
|
+
switch (subCmd) {
|
|
54
|
+
case "init":
|
|
55
|
+
scaffoldContracts(projectRoot, quiet);
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
case "list":
|
|
59
|
+
if (!contractEngine) {
|
|
60
|
+
(0, logger_1.err)("contract_engine.js not found. Run `tk init` first.");
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
listContracts(projectRoot, contractEngine, quiet);
|
|
64
|
+
break;
|
|
65
|
+
|
|
66
|
+
case "verify":
|
|
67
|
+
if (!contractEngine) {
|
|
68
|
+
(0, logger_1.err)("contract_engine.js not found. Run `tk init` first.");
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
runVerify(projectRoot, contractEngine, traceEngine, argv, flags, quiet);
|
|
72
|
+
break;
|
|
73
|
+
|
|
74
|
+
case "trace":
|
|
75
|
+
if (!traceEngine) {
|
|
76
|
+
(0, logger_1.err)("trace_engine.js not found. Run `tk init` first.");
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
runTraceList(projectRoot, traceEngine, quiet);
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case "replay":
|
|
83
|
+
if (!traceEngine) {
|
|
84
|
+
(0, logger_1.err)("trace_engine.js not found. Run `tk init` first.");
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
runReplay(projectRoot, traceEngine, rawArgs[1], quiet);
|
|
88
|
+
break;
|
|
89
|
+
|
|
90
|
+
case "generate":
|
|
91
|
+
generateFromCase(projectRoot, rawArgs, quiet);
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
default:
|
|
95
|
+
if (fs.existsSync(subCmd) || subCmd.startsWith("--")) {
|
|
96
|
+
// Treat as verify with arguments
|
|
97
|
+
runVerify(projectRoot, contractEngine, traceEngine, argv, flags, quiet);
|
|
98
|
+
} else {
|
|
99
|
+
(0, logger_1.err)(`Unknown contract subcommand: "${subCmd}"`);
|
|
100
|
+
showContractHelp(quiet);
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ── Subcommand Implementations ───────────────────────────────────────────────
|
|
107
|
+
|
|
108
|
+
function scaffoldContracts(projectRoot, quiet) {
|
|
109
|
+
const contractsDir = path.join(projectRoot, ".tribunal", "contracts");
|
|
110
|
+
if (!fs.existsSync(contractsDir)) {
|
|
111
|
+
fs.mkdirSync(contractsDir, { recursive: true });
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const starters = [
|
|
115
|
+
{
|
|
116
|
+
file: "no-console-log.yaml",
|
|
117
|
+
content: `name: "No console.log in production code"
|
|
118
|
+
description: "Prevents debug logging from reaching production"
|
|
119
|
+
scope: "src/**/*.ts, src/**/*.tsx, src/**/*.js"
|
|
120
|
+
exclude: "**/*.test.*, **/*.spec.*, scripts/**"
|
|
121
|
+
when: file_modified
|
|
122
|
+
severity: warn
|
|
123
|
+
must_not:
|
|
124
|
+
- pattern: "console.log"
|
|
125
|
+
message: "Use a structured logger instead of console.log"
|
|
126
|
+
`,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
file: "no-any-type.yaml",
|
|
130
|
+
content: `name: "No TypeScript 'any' escape hatch"
|
|
131
|
+
description: "Enforces strict typing in TypeScript files"
|
|
132
|
+
scope: "src/**/*.ts, src/**/*.tsx"
|
|
133
|
+
exclude: "**/*.d.ts"
|
|
134
|
+
when: file_modified
|
|
135
|
+
severity: warn
|
|
136
|
+
must_not:
|
|
137
|
+
- pattern: "regex:: any[;,\\\\s\\\\)\\\\]]"
|
|
138
|
+
message: "Avoid 'any' type annotations — use unknown or a specific type"
|
|
139
|
+
`,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
file: "require-error-handling.yaml",
|
|
143
|
+
content: `name: "Async functions must handle errors"
|
|
144
|
+
description: "Every async function should have error handling"
|
|
145
|
+
scope: "src/**/*.ts, src/**/*.tsx"
|
|
146
|
+
when: file_modified
|
|
147
|
+
severity: info
|
|
148
|
+
must:
|
|
149
|
+
- pattern: "regex:(try\\\\s*\\\\{|.catch\\\\(|\\\\.catch\\\\s*\\\\()"
|
|
150
|
+
message: "Async functions should include try/catch or .catch() for error handling"
|
|
151
|
+
metadata:
|
|
152
|
+
tags: ["resilience", "error-handling"]
|
|
153
|
+
`,
|
|
154
|
+
},
|
|
155
|
+
];
|
|
156
|
+
|
|
157
|
+
let createdCount = 0;
|
|
158
|
+
for (const starter of starters) {
|
|
159
|
+
const filePath = path.join(contractsDir, starter.file);
|
|
160
|
+
if (!fs.existsSync(filePath)) {
|
|
161
|
+
fs.writeFileSync(filePath, starter.content, "utf8");
|
|
162
|
+
createdCount++;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (!quiet) {
|
|
167
|
+
console.log();
|
|
168
|
+
(0, logger_1.log)(
|
|
169
|
+
` ${(0, logger_1.c)("green", "✔")} Scaffolded .tribunal/contracts/ with ${createdCount} starter behavioral contracts.`,
|
|
170
|
+
);
|
|
171
|
+
(0, logger_1.log)(
|
|
172
|
+
` ${(0, logger_1.c)("gray", "▸")} Edit files in .tribunal/contracts/ or run \`tk contract verify\` to enforce.`,
|
|
173
|
+
);
|
|
174
|
+
console.log();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function listContracts(projectRoot, contractEngine, quiet) {
|
|
179
|
+
const contracts = contractEngine.loadContracts(projectRoot);
|
|
180
|
+
if (quiet) return;
|
|
181
|
+
|
|
182
|
+
console.log();
|
|
183
|
+
(0, logger_1.log)(
|
|
184
|
+
` ${(0, logger_1.c)("cyan", "📜")} ${(0, logger_1.bold)("Loaded Behavioral Contracts")}`,
|
|
185
|
+
);
|
|
186
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("gray", "─".repeat(50))}`);
|
|
187
|
+
|
|
188
|
+
if (contracts.length === 0) {
|
|
189
|
+
(0, logger_1.log)(
|
|
190
|
+
` No contracts found in .tribunal/contracts/. Run \`tk contract init\` to create starter rules.`,
|
|
191
|
+
);
|
|
192
|
+
console.log();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
for (const c of contracts) {
|
|
197
|
+
const sevColor =
|
|
198
|
+
c.severity === "block" ? "red" : c.severity === "warn" ? "yellow" : "blue";
|
|
199
|
+
const rulesCount = (c.must?.length || 0) + (c.must_not?.length || 0);
|
|
200
|
+
|
|
201
|
+
(0, logger_1.log)(
|
|
202
|
+
` ${(0, logger_1.c)("cyan", "•")} ${(0, logger_1.bold)(c.name)} [${(0, logger_1.c)(sevColor, c.severity.toUpperCase())}]`,
|
|
203
|
+
);
|
|
204
|
+
(0, logger_1.log)(` Scope: ${(0, logger_1.c)("gray", c.scope || "*")}`);
|
|
205
|
+
(0, logger_1.log)(
|
|
206
|
+
` Rules: ${(0, logger_1.c)("white", String(rulesCount))} (${c.must?.length || 0} must, ${c.must_not?.length || 0} must_not)`,
|
|
207
|
+
);
|
|
208
|
+
if (c.description) {
|
|
209
|
+
(0, logger_1.log)(` Note: ${(0, logger_1.c)("gray", c.description)}`);
|
|
210
|
+
}
|
|
211
|
+
console.log();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function runVerify(projectRoot, contractEngine, traceEngine, argv, flags, quiet) {
|
|
216
|
+
const jsonMode = argv.includes("--json");
|
|
217
|
+
const fileArg = extractFileArg(argv);
|
|
218
|
+
|
|
219
|
+
let targetFiles = null;
|
|
220
|
+
if (fileArg) {
|
|
221
|
+
const resolved = path.resolve(fileArg);
|
|
222
|
+
if (!fs.existsSync(resolved)) {
|
|
223
|
+
(0, logger_1.err)(`File not found: ${fileArg}`);
|
|
224
|
+
process.exit(1);
|
|
225
|
+
}
|
|
226
|
+
targetFiles = [resolved];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const results = contractEngine.verifyWorkspace(projectRoot, targetFiles);
|
|
230
|
+
|
|
231
|
+
// Capture failure context snapshots for block/warn violations if traceEngine exists
|
|
232
|
+
if (traceEngine && results.violations.length > 0) {
|
|
233
|
+
for (const v of results.violations) {
|
|
234
|
+
if (v.severity === "block" || v.severity === "warn") {
|
|
235
|
+
try {
|
|
236
|
+
traceEngine.captureSnapshot(projectRoot, v);
|
|
237
|
+
} catch {
|
|
238
|
+
// Non-critical snapshot capture fallback
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (jsonMode) {
|
|
245
|
+
console.log(JSON.stringify(results, null, 2));
|
|
246
|
+
process.exit(results.blocked ? 1 : 0);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (quiet) {
|
|
250
|
+
process.exit(results.blocked ? 1 : 0);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
console.log();
|
|
254
|
+
(0, logger_1.log)(
|
|
255
|
+
` ${(0, logger_1.c)("cyan", "📜")} ${(0, logger_1.bold)("Contract Verification Report")}`,
|
|
256
|
+
);
|
|
257
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("gray", "─".repeat(50))}`);
|
|
258
|
+
(0, logger_1.log)(
|
|
259
|
+
` Contracts loaded: ${(0, logger_1.c)("white", String(results.contracts_loaded))}`,
|
|
260
|
+
);
|
|
261
|
+
(0, logger_1.log)(
|
|
262
|
+
` Files scanned: ${(0, logger_1.c)("white", String(results.files_checked))}`,
|
|
263
|
+
);
|
|
264
|
+
(0, logger_1.log)(
|
|
265
|
+
` Total violations: ${results.violations.length > 0 ? (0, logger_1.c)("yellow", String(results.violations.length)) : (0, logger_1.c)("green", "0")}`,
|
|
266
|
+
);
|
|
267
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("gray", "─".repeat(50))}`);
|
|
268
|
+
|
|
269
|
+
if (results.violations.length > 0) {
|
|
270
|
+
for (const v of results.violations) {
|
|
271
|
+
const icon =
|
|
272
|
+
v.severity === "block"
|
|
273
|
+
? (0, logger_1.c)("red", "✖ BLOCK")
|
|
274
|
+
: v.severity === "warn"
|
|
275
|
+
? (0, logger_1.c)("yellow", "⚠ WARN")
|
|
276
|
+
: (0, logger_1.c)("blue", "ℹ INFO");
|
|
277
|
+
|
|
278
|
+
const lineInfo = v.line ? `:${v.line}` : "";
|
|
279
|
+
(0, logger_1.log)(
|
|
280
|
+
` ${icon} [${(0, logger_1.bold)(v.contract)}] ${(0, logger_1.c)("cyan", v.file + lineInfo)}`,
|
|
281
|
+
);
|
|
282
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("white", v.message)}`);
|
|
283
|
+
if (v.snippet) {
|
|
284
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("gray", "Snippet:")} ${(0, logger_1.c)("gray", v.snippet)}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
(0, logger_1.log)(
|
|
289
|
+
` ${(0, logger_1.c)("green", "✅")} All contracts satisfied. Zero behavioral violations detected.`,
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
console.log();
|
|
294
|
+
process.exit(results.blocked ? 1 : 0);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function runTraceList(projectRoot, traceEngine, quiet) {
|
|
298
|
+
const snapshots = traceEngine.listSnapshots(projectRoot);
|
|
299
|
+
if (quiet) return;
|
|
300
|
+
|
|
301
|
+
console.log();
|
|
302
|
+
(0, logger_1.log)(
|
|
303
|
+
` ${(0, logger_1.c)("cyan", "🎥")} ${(0, logger_1.bold)("Failure Context Snapshots")}`,
|
|
304
|
+
);
|
|
305
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("gray", "─".repeat(50))}`);
|
|
306
|
+
|
|
307
|
+
if (snapshots.length === 0) {
|
|
308
|
+
(0, logger_1.log)(` No failure context snapshots recorded.`);
|
|
309
|
+
console.log();
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
for (const s of snapshots.slice(0, 10)) {
|
|
314
|
+
const sevColor = s.severity === "block" ? "red" : "yellow";
|
|
315
|
+
(0, logger_1.log)(
|
|
316
|
+
` ${(0, logger_1.c)("cyan", "•")} ${(0, logger_1.bold)(s.id)} [${(0, logger_1.c)(sevColor, s.severity.toUpperCase())}]`,
|
|
317
|
+
);
|
|
318
|
+
(0, logger_1.log)(` Contract: ${s.contract}`);
|
|
319
|
+
(0, logger_1.log)(` Target: ${(0, logger_1.c)("gray", s.target_file)}`);
|
|
320
|
+
(0, logger_1.log)(` Time: ${(0, logger_1.c)("gray", s.timestamp)}`);
|
|
321
|
+
console.log();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function runReplay(projectRoot, traceEngine, traceId, quiet) {
|
|
326
|
+
if (!traceId) {
|
|
327
|
+
(0, logger_1.err)("Missing trace ID. Usage: tk contract replay <trace_id>");
|
|
328
|
+
process.exit(1);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
const snapshot = traceEngine.replaySnapshot(projectRoot, traceId);
|
|
332
|
+
if (!snapshot) {
|
|
333
|
+
(0, logger_1.err)(`Trace snapshot not found: "${traceId}"`);
|
|
334
|
+
process.exit(1);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (quiet) return;
|
|
338
|
+
|
|
339
|
+
console.log();
|
|
340
|
+
(0, logger_1.log)(
|
|
341
|
+
` ${(0, logger_1.c)("cyan", "🎬")} ${(0, logger_1.bold)("Replaying Failure Trace Snapshot")}`,
|
|
342
|
+
);
|
|
343
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("gray", "─".repeat(50))}`);
|
|
344
|
+
(0, logger_1.log)(` ID: ${(0, logger_1.c)("white", snapshot.id)}`);
|
|
345
|
+
(0, logger_1.log)(` Contract: ${(0, logger_1.bold)(snapshot.contract)}`);
|
|
346
|
+
(0, logger_1.log)(` Severity: ${(0, logger_1.c)(snapshot.severity === "block" ? "red" : "yellow", snapshot.severity.toUpperCase())}`);
|
|
347
|
+
(0, logger_1.log)(` Target: ${(0, logger_1.c)("cyan", snapshot.target_file)}`);
|
|
348
|
+
(0, logger_1.log)(` Time: ${snapshot.timestamp}`);
|
|
349
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("gray", "─".repeat(50))}`);
|
|
350
|
+
(0, logger_1.log)(
|
|
351
|
+
` ${(0, logger_1.c)("red", "Violation:")} ${snapshot.violation.message}`,
|
|
352
|
+
);
|
|
353
|
+
if (snapshot.violation.snippet) {
|
|
354
|
+
(0, logger_1.log)(
|
|
355
|
+
` ${(0, logger_1.c)("yellow", "Code Snippet:")} ${snapshot.violation.snippet}`,
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
console.log();
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function generateFromCase(projectRoot, rawArgs, quiet) {
|
|
362
|
+
const caseIdx = rawArgs.indexOf("--from-case");
|
|
363
|
+
const caseId = caseIdx !== -1 ? rawArgs[caseIdx + 1] : null;
|
|
364
|
+
|
|
365
|
+
if (!caseId) {
|
|
366
|
+
(0, logger_1.err)(
|
|
367
|
+
"Missing case ID. Usage: tk contract generate --from-case <id>",
|
|
368
|
+
);
|
|
369
|
+
process.exit(1);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const contractsDir = path.join(projectRoot, ".tribunal", "contracts");
|
|
373
|
+
if (!fs.existsSync(contractsDir)) {
|
|
374
|
+
fs.mkdirSync(contractsDir, { recursive: true });
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const contractFileName = `case-${caseId}-rule.yaml`;
|
|
378
|
+
const contractPath = path.join(contractsDir, contractFileName);
|
|
379
|
+
|
|
380
|
+
const content = `name: "Contract from Case #${caseId}"
|
|
381
|
+
description: "Auto-generated behavioral contract to prevent recurrence of Case #${caseId}"
|
|
382
|
+
scope: "src/**/*.ts, src/**/*.js"
|
|
383
|
+
when: file_modified
|
|
384
|
+
severity: block
|
|
385
|
+
must_not:
|
|
386
|
+
- pattern: "UNVERIFIED_API_PATTERN"
|
|
387
|
+
message: "Precedent Case #${caseId} violation prevented by contract"
|
|
388
|
+
metadata:
|
|
389
|
+
generated_from_case: "${caseId}"
|
|
390
|
+
created: "${new Date().toISOString().split("T")[0]}"
|
|
391
|
+
`;
|
|
392
|
+
|
|
393
|
+
fs.writeFileSync(contractPath, content, "utf8");
|
|
394
|
+
|
|
395
|
+
if (!quiet) {
|
|
396
|
+
console.log();
|
|
397
|
+
(0, logger_1.log)(
|
|
398
|
+
` ${(0, logger_1.c)("green", "✔")} Auto-generated contract template from Case #${caseId}:`,
|
|
399
|
+
);
|
|
400
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("cyan", contractPath)}`);
|
|
401
|
+
console.log();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function extractFileArg(argv) {
|
|
406
|
+
const idx = argv.indexOf("--file");
|
|
407
|
+
if (idx !== -1 && argv[idx + 1]) return argv[idx + 1];
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function showContractHelp(quiet) {
|
|
412
|
+
if (quiet) return;
|
|
413
|
+
console.log();
|
|
414
|
+
(0, logger_1.log)(
|
|
415
|
+
` ${(0, logger_1.bold)("Tribunal Behavioral Contract Engine (tk contract)")}`,
|
|
416
|
+
);
|
|
417
|
+
(0, logger_1.log)(` ${(0, logger_1.c)("gray", "─".repeat(50))}`);
|
|
418
|
+
(0, logger_1.log)(
|
|
419
|
+
` ${(0, logger_1.c)("cyan", "init")} Scaffold .tribunal/contracts/ with starter rules`,
|
|
420
|
+
);
|
|
421
|
+
(0, logger_1.log)(
|
|
422
|
+
` ${(0, logger_1.c)("cyan", "verify")} Verify code against loaded contracts`,
|
|
423
|
+
);
|
|
424
|
+
(0, logger_1.log)(
|
|
425
|
+
` ${(0, logger_1.c)("cyan", "verify --file <path>")} Verify a specific target file`,
|
|
426
|
+
);
|
|
427
|
+
(0, logger_1.log)(
|
|
428
|
+
` ${(0, logger_1.c)("cyan", "list")} List all active contracts`,
|
|
429
|
+
);
|
|
430
|
+
(0, logger_1.log)(
|
|
431
|
+
` ${(0, logger_1.c)("cyan", "trace list")} List recorded failure context snapshots`,
|
|
432
|
+
);
|
|
433
|
+
(0, logger_1.log)(
|
|
434
|
+
` ${(0, logger_1.c)("cyan", "replay <id>")} Replay failure context trace snapshot`,
|
|
435
|
+
);
|
|
436
|
+
(0, logger_1.log)(
|
|
437
|
+
` ${(0, logger_1.c)("cyan", "generate --from-case <id>")} Generate contract template from Case Law`,
|
|
438
|
+
);
|
|
439
|
+
console.log();
|
|
440
|
+
}
|
package/dist/commands/init.js
CHANGED
|
@@ -11,6 +11,7 @@ const logger_1 = require("../utils/logger");
|
|
|
11
11
|
const fs_2 = require("../utils/fs");
|
|
12
12
|
const helpers_1 = require("../utils/helpers");
|
|
13
13
|
const hasher_1 = require("../utils/hasher");
|
|
14
|
+
const { ActionTree, WizardPrompt, renderBanner } = require("../tui");
|
|
14
15
|
// Core agents to install in --minimal mode
|
|
15
16
|
const CORE_AGENTS = new Set([
|
|
16
17
|
'backend-specialist.md',
|
|
@@ -225,64 +226,20 @@ async function cmdInit(flags, quiet = false) {
|
|
|
225
226
|
(0, logger_1.dim)(`Target: ${agentDest}`);
|
|
226
227
|
}
|
|
227
228
|
else {
|
|
228
|
-
// ── Success card — W=62, rows padded by plain-text length ──
|
|
229
|
-
const W = 62;
|
|
230
|
-
const borderCol = 'red';
|
|
231
229
|
const agentsCount = fs_1.default.readdirSync(path_1.default.join(agentDest, 'agents')).length;
|
|
232
230
|
const workflowsCount = fs_1.default.readdirSync(path_1.default.join(agentDest, 'workflows')).length;
|
|
233
231
|
const skillsCount = fs_1.default.readdirSync(path_1.default.join(agentDest, 'skills')).length;
|
|
234
232
|
const scriptsCount = fs_1.default.readdirSync(path_1.default.join(agentDest, 'scripts')).length;
|
|
235
233
|
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const leftPlain = ` ${icon} ${label.padEnd(10)} `;
|
|
243
|
-
const rightPlain = ` [ ${String(count).padStart(3)} ]`;
|
|
244
|
-
const numDots = W - leftPlain.length - rightPlain.length - 4; // 4 spaces margin
|
|
245
|
-
const dots = '.'.repeat(Math.max(0, numDots));
|
|
246
|
-
|
|
247
|
-
const plain = `${leftPlain}${dots}${rightPlain}`;
|
|
248
|
-
const styled = ` ${icon} ${(0, logger_1.c)('white', label.padEnd(10))} ${(0, logger_1.c)('gray', dots)} ${(0, logger_1.c)('gray', '[')} ${(0, logger_1.c)(color, String(count).padStart(3))} ${(0, logger_1.c)('gray', ']')}`;
|
|
249
|
-
return drawRow(plain, styled);
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
const stepRow = (cmd, desc) => {
|
|
253
|
-
const leftPlain = ` ${cmd.padEnd(16)}`;
|
|
254
|
-
const rightPlain = `▸ ${desc}`;
|
|
255
|
-
const plain = `${leftPlain}${rightPlain}`;
|
|
256
|
-
const styled = ` ${(0, logger_1.c)('white', cmd.padEnd(16))}${(0, logger_1.c)('gray', '▸')} ${(0, logger_1.c)('gray', desc)}`;
|
|
257
|
-
return drawRow(plain, styled);
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
console.log(` ${(0, logger_1.c)('green', '✔')} ${(0, logger_1.bold)((0, logger_1.c)('green', 'Installation complete'))} ${(0, logger_1.c)('gray', '—')} ${(0, logger_1.c)('white', String(copied))} files`);
|
|
261
|
-
console.log(` ${(0, logger_1.c)('gray', ' ╰─')} ${(0, logger_1.c)('gray', agentDest)}`);
|
|
262
|
-
console.log();
|
|
263
|
-
console.log(` ${(0, logger_1.c)(borderCol, '┌' + '─'.repeat(W) + '┐')}`);
|
|
264
|
-
console.log(drawRow(` TRIBUNAL ENVIRONMENT SYNCHRONIZED`, ` ${(0, logger_1.bold)((0, logger_1.c)('white', 'TRIBUNAL ENVIRONMENT SYNCHRONIZED'))}`));
|
|
265
|
-
console.log(` ${(0, logger_1.c)(borderCol, '├' + '─'.repeat(W) + '┤')}`);
|
|
266
|
-
console.log(drawRow(` Guarding: Active & Enforcing`, ` ${(0, logger_1.c)('gray', 'Guarding:')} ${(0, logger_1.c)('green', 'Active & Enforcing')}`));
|
|
267
|
-
console.log(drawRow(` Manifest: Verified`, ` ${(0, logger_1.c)('gray', 'Manifest:')} ${(0, logger_1.c)('cyan', 'Verified')}`));
|
|
268
|
-
console.log(drawRow('', ''));
|
|
269
|
-
console.log(drawRow(' Installed Components:', (0, logger_1.bold)((0, logger_1.c)('white', ' Installed Components:'))));
|
|
270
|
-
console.log(compRow('🤖', 'Agents', agentsCount, 'magenta'));
|
|
271
|
-
console.log(compRow('⚡', 'Workflows', workflowsCount, 'yellow'));
|
|
272
|
-
console.log(compRow('🧠', 'Skills', skillsCount, 'blue'));
|
|
273
|
-
console.log(compRow('🔧', 'Scripts', scriptsCount, 'green'));
|
|
274
|
-
console.log(` ${(0, logger_1.c)(borderCol, '├' + '─'.repeat(W) + '┤')}`);
|
|
275
|
-
console.log(drawRow('', ''));
|
|
276
|
-
console.log(drawRow(' Next Steps:', (0, logger_1.c)('gray', ' Next Steps:')));
|
|
277
|
-
console.log(stepRow('/generate', 'Generate code with reviews'));
|
|
278
|
-
console.log(stepRow('/review', 'Audit existing code for issues'));
|
|
279
|
-
console.log(stepRow('/tribunal-full', 'Run all 21 reviewers in parallel'));
|
|
280
|
-
console.log(drawRow('', ''));
|
|
281
|
-
console.log(` ${(0, logger_1.c)(borderCol, '└' + '─'.repeat(W) + '┘')}`);
|
|
282
|
-
console.log();
|
|
283
|
-
(0, logger_1.log)(` ${(0, logger_1.c)('gray', '✦ Generating IDE bridge files...')}`);
|
|
234
|
+
const tree = new ActionTree();
|
|
235
|
+
await tree.action('Establishing Anti-Hallucination Barrier', agentDest);
|
|
236
|
+
await tree.branch(`${agentsCount} Core Specialists active in registry`);
|
|
237
|
+
await tree.branch(`${skillsCount} Agentic Skills mapped via lazy routing`);
|
|
238
|
+
await tree.branch(`${workflowsCount} Workflows & ${scriptsCount} Enforcement scripts installed`);
|
|
239
|
+
await tree.action('Synthesizing IDE Bridges');
|
|
284
240
|
await generateIDEBridges(targetDir, agentDest, dryRun, isMinimal);
|
|
285
241
|
await scaffoldDesignSystem(targetDir, agentSrc, dryRun);
|
|
242
|
+
tree.complete(`Tribunal-Kit v${pkg.version} initialized successfully at ${targetDir}`);
|
|
286
243
|
}
|
|
287
244
|
console.log();
|
|
288
245
|
}
|
package/dist/commands/status.js
CHANGED
|
@@ -1,35 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
4
|
exports.cmdStatus = cmdStatus;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
5
|
+
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { color, bold, dim, RGB, GLYPHS, renderBanner } = require('../tui');
|
|
9
|
+
|
|
11
10
|
function cmdStatus(flags, quiet = false) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
(0, logger_1.log)(` ${(0, logger_1.c)('green', '✔')} ${(0, logger_1.bold)((0, logger_1.c)('green', 'Installed'))} ${(0, logger_1.c)('gray', '→')} ${(0, logger_1.c)('gray', agentDest)}`);
|
|
11
|
+
const targetDir = flags.path ? path.resolve(flags.path) : process.cwd();
|
|
12
|
+
const agentDest = path.join(targetDir, '.agent');
|
|
13
|
+
const PKG = require('../../package.json');
|
|
14
|
+
|
|
15
|
+
renderBanner(PKG.version, quiet);
|
|
16
|
+
|
|
17
|
+
const g = GLYPHS;
|
|
18
|
+
|
|
19
|
+
if (!fs.existsSync(agentDest)) {
|
|
20
|
+
console.log(` ${color(RGB.ROSE, g.failure)} ${bold('Not installed')} in this project`);
|
|
23
21
|
console.log();
|
|
24
|
-
|
|
25
|
-
const colors = { agents: 'magenta', workflows: 'yellow', skills: 'blue', scripts: 'green' };
|
|
26
|
-
const subdirs = ['agents', 'workflows', 'skills', 'scripts'];
|
|
27
|
-
for (const sub of subdirs) {
|
|
28
|
-
const subPath = path_1.default.join(agentDest, sub);
|
|
29
|
-
if (fs_1.default.existsSync(subPath)) {
|
|
30
|
-
const count = fs_1.default.readdirSync(subPath).filter(f => !fs_1.default.statSync(path_1.default.join(subPath, f)).isDirectory()).length;
|
|
31
|
-
(0, logger_1.log)(` ${icons[sub]} ${(0, logger_1.c)(colors[sub], sub.padEnd(12))}${(0, logger_1.c)('white', String(count).padStart(3))} files`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
22
|
+
console.log(` ${dim('Run:')} ${color(RGB.CYAN, 'npx tribunal-kit init')}`);
|
|
34
23
|
console.log();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const agentsCount = fs.existsSync(path.join(agentDest, 'agents'))
|
|
28
|
+
? fs.readdirSync(path.join(agentDest, 'agents')).filter(f => f.endsWith('.md')).length
|
|
29
|
+
: 0;
|
|
30
|
+
const workflowsCount = fs.existsSync(path.join(agentDest, 'workflows'))
|
|
31
|
+
? fs.readdirSync(path.join(agentDest, 'workflows')).filter(f => f.endsWith('.md')).length
|
|
32
|
+
: 0;
|
|
33
|
+
const skillsCount = fs.existsSync(path.join(agentDest, 'skills'))
|
|
34
|
+
? fs.readdirSync(path.join(agentDest, 'skills')).length
|
|
35
|
+
: 0;
|
|
36
|
+
const scriptsCount = fs.existsSync(path.join(agentDest, 'scripts'))
|
|
37
|
+
? fs.readdirSync(path.join(agentDest, 'scripts')).filter(f => f.endsWith('.js')).length
|
|
38
|
+
: 0;
|
|
39
|
+
|
|
40
|
+
console.log(` ${color(RGB.EMERALD, g.success)} ${bold(color(RGB.EMERALD, 'Installed & Active'))} ${dim('→')} ${dim(agentDest)}`);
|
|
41
|
+
console.log();
|
|
42
|
+
|
|
43
|
+
console.log(` ${color(RGB.FLAME, '🤖')} ${color(RGB.WHITE, 'Agents'.padEnd(12))} ${color(RGB.CYAN, String(agentsCount).padStart(3))} ${dim('specialists')}`);
|
|
44
|
+
console.log(` ${color(RGB.AMBER, '⚡')} ${color(RGB.WHITE, 'Workflows'.padEnd(12))} ${color(RGB.CYAN, String(workflowsCount).padStart(3))} ${dim('commands')}`);
|
|
45
|
+
console.log(` ${color(RGB.PURPLE, '🧠')} ${color(RGB.WHITE, 'Skills'.padEnd(12))} ${color(RGB.CYAN, String(skillsCount).padStart(3))} ${dim('injected')}`);
|
|
46
|
+
console.log(` ${color(RGB.EMERALD, '🔧')} ${color(RGB.WHITE, 'Scripts'.padEnd(12))} ${color(RGB.CYAN, String(scriptsCount).padStart(3))} ${dim('enforcers')}`);
|
|
47
|
+
console.log();
|
|
48
|
+
|
|
49
|
+
// IDE Bridges Check
|
|
50
|
+
const bridges = [
|
|
51
|
+
{ name: 'Cursor', file: '.cursorrules' },
|
|
52
|
+
{ name: 'Windsurf', file: '.windsurfrules' },
|
|
53
|
+
{ name: 'Claude Code', file: '.claude/CLAUDE.md' },
|
|
54
|
+
{ name: 'Antigravity / Gemini', file: '.gemini/GEMINI.md' },
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
console.log(` ${dim('IDE Bridges:')}`);
|
|
58
|
+
for (const b of bridges) {
|
|
59
|
+
const exists = fs.existsSync(path.join(targetDir, b.file));
|
|
60
|
+
const icon = exists ? color(RGB.EMERALD, g.success) : color(RGB.ZINC_600, '·');
|
|
61
|
+
const label = exists ? color(RGB.WHITE, b.name) : dim(b.name);
|
|
62
|
+
console.log(` ${icon} ${label} ${dim(`(${b.file})`)}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
console.log();
|
|
35
66
|
}
|