diff --git a/justfile b/justfile index f6a17de..00ac88e 100644 --- a/justfile +++ b/justfile @@ -23,10 +23,10 @@ default: @just --list # Full development workflow -[doc("Run check + fmt + lint + test")] +[doc("Run check + fmt + lint (all languages) + test")] check-all: @just dev::fmt-check - @just dev::lint + @just dev::lint-all @just test::all # Full CI workflow (format + lint + test + build all variants) diff --git a/justfiles/build.just b/justfiles/build.just index c7bb1bc..393cdd8 100644 --- a/justfiles/build.just +++ b/justfiles/build.just @@ -1,14 +1,17 @@ # ╔══════════════════════════════════════════════════════════════════════╗ -# ║ BUILD RECIPES ║ -# ║ Build workspace with different feature flags ║ +# ║ BUILD RECIPES ║ +# ║ Build workspace with different feature flags ║ # ╚══════════════════════════════════════════════════════════════════════╝ # === FEATURE FLAGS === FEATURES_CLI := "cli,i18n,templates" FEATURES_TUI := "tui,i18n,templates" FEATURES_WEB := "web,i18n,templates" +FEATURES_AI := "ai_backend" +FEATURES_AGENT := "markup,nickel,cache" FEATURES_ALL_BACKENDS := "cli,tui,web" FEATURES_FULL := "cli,tui,web,i18n,templates" +FEATURES_FULL_AI := "cli,tui,web,i18n,templates,ai_backend" # Help for build module help: @@ -18,9 +21,14 @@ help: @echo " just build::default" @echo "" @echo "Build specific backends:" - @echo " just build::cli Build CLI backend" - @echo " just build::tui Build TUI backend" - @echo " just build::web Build Web backend" + @echo " just build::cli Build CLI backend (rendering)" + @echo " just build::tui Build TUI backend (rendering)" + @echo " just build::web Build Web backend (rendering)" + @echo " just build::ai-lib Build AI backend (library: RAG, KG, embeddings)" + @echo " just build::ai Build AI backend (FormBackend + microservice)" + @echo " just build::agent Build Agent system (LLM execution)" + @echo " just build::agent-server Build Agent server (HTTP API)" + @echo " just build::prov-gen Build Provisioning generator (IaC)" @echo "" @echo "Build combined:" @echo " just build::all Build all backends" @@ -68,6 +76,43 @@ web: cargo build -p typedialog-web @echo "✓ Web backend ready" +# Build AI backend library (RAG, Knowledge Graph, embeddings in core) +[doc("Build AI backend library")] +ai-lib: + @echo "=== Building AI backend library ===" + cargo build -p typedialog-core --features "{{ FEATURES_AI }}" + @echo "✓ AI backend library ready (RAG, KG, embeddings)" + +# Build AI backend (FormBackend implementation + microservice) +[doc("Build AI backend (FormBackend + microservice)")] +ai: + @echo "=== Building AI backend ===" + cargo build -p typedialog-ai + @echo "✓ AI backend ready (FormBackend + REST API + WebSocket + Web UI)" + +# Build Agent system (CLI for LLM execution) +[doc("Build Agent system (typedialog-ag CLI)")] +agent: + @echo "=== Building Agent system ===" + cargo build -p typedialog-ag-core --features "{{ FEATURES_AGENT }}" + cargo build -p typedialog-ag + @echo "✓ Agent system ready (typedialog-ag CLI)" + +# Build Agent with server support (same binary, use 'typedialog-ag serve') +[doc("Build Agent (use 'typedialog-ag serve' for HTTP server)")] +agent-server: + @echo "=== Building Agent (with server support) ===" + cargo build -p typedialog-ag-core --features "{{ FEATURES_AGENT }}" + cargo build -p typedialog-ag + @echo "✓ Agent ready (use 'typedialog-ag serve' to start HTTP server)" + +# Build Provisioning generator (Infrastructure as Code) +[doc("Build Provisioning generator (typedialog-prov-gen)")] +prov-gen: + @echo "=== Building Provisioning generator ===" + cargo build -p typedialog-prov-gen + @echo "✓ Provisioning generator ready (IaC generation)" + # === COMBINED BUILDS === # Build all backends (cli, tui, web) @@ -87,11 +132,15 @@ full: cargo build --workspace --all-features @echo "✓ Full build complete" -# Build all variants -[doc("Build all: default + all backends + release")] +# Build all variants (including AI backend, Agent system, and Prov-gen) +[doc("Build all: default + all backends + AI + Agent + Agent-server + Prov-gen + release")] all: just build::default just build::all-backends + just build::ai + just build::agent + just build::agent-server + just build::prov-gen just build::release @echo "✓ All builds complete" diff --git a/justfiles/ci.just b/justfiles/ci.just index ccf7044..ca9250f 100644 --- a/justfiles/ci.just +++ b/justfiles/ci.just @@ -1,8 +1,11 @@ # ╔══════════════════════════════════════════════════════════════════════╗ -# ║ CI/CD RECIPES ║ -# ║ Validation and deployment tasks ║ +# ║ CI/CD RECIPES ║ +# ║ Validation and deployment tasks ║ # ╚══════════════════════════════════════════════════════════════════════╝ +# Workspace root directory +WORKSPACE_ROOT := justfile_directory() + # Help for CI module help: @echo "CI/CD MODULE" @@ -15,6 +18,8 @@ help: @echo "" @echo "Compliance:" @echo " just ci::verify-sbom Verify SBOMs are up to date" + @echo " just ci::audit Audit dependencies (security)" + @echo " just ci::deny Check dependencies with cargo-deny" @echo "" @echo "Build validation:" @echo " just ci::build-debug Debug build" @@ -29,21 +34,61 @@ help: [doc("Check format")] fmt-check: @echo "=== Format validation ===" - cargo fmt --all -- --check + cargo fmt -p typedialog-core -p typedialog -p typedialog-tui -p typedialog-web -p typedialog-ai -p typedialog-prov-gen -p typedialog-ag-core -p typedialog-ag -- --check @echo "✓ Format valid" # Lint [doc("Run clippy")] lint: - @echo "=== Linting ===" - cargo clippy --all-targets --all-features -- -D warnings - @echo "✓ Lint passed" + #!/bin/bash + set -e + echo "=== Linting ===" + if [ -d "target/debug" ]; then + echo " → Using: target/debug (exists)" + cargo clippy --all-targets --all-features -- -D warnings + else + echo " → Using: /tmp/typedialog-ci (target/debug does not exist)" + cargo clippy --target-dir=/tmp/typedialog-ci --all-targets --all-features -- -D warnings + fi + echo "✓ Lint passed" -# Check formatting and linting -[doc("Check: format + lint")] +# === MULTI-LANGUAGE LINTING === + +# Lint Rust +[doc("Lint Rust (CI)")] +lint-rust: + just dev::lint-rust + +# Lint bash scripts +[doc("Lint bash (CI)")] +lint-bash: + just dev::lint-bash + +# Lint Nickel files +[doc("Lint Nickel (CI)")] +lint-nickel: + just dev::lint-nickel + +# Lint Nushell scripts +[doc("Lint Nushell (CI)")] +lint-nushell: + just dev::lint-nushell + +# Lint Markdown +[doc("Lint Markdown (CI)")] +lint-markdown: + just dev::lint-markdown + +# Lint all languages (CI) +[doc("Lint all languages (CI)")] +lint-all: + just dev::lint-all + +# Check formatting and linting (all languages) +[doc("Check: format + lint (all)")] check: just ci::fmt-check - just ci::lint + just ci::lint-all @echo "✓ All checks passed" # === TEST STAGE === @@ -51,32 +96,59 @@ check: # Test all features [doc("Test all features")] test-all: - @echo "=== Testing (all features) ===" - cargo test --workspace --all-features - @echo "✓ All tests passed" + #!/bin/bash + set -e + cd "{{ WORKSPACE_ROOT }}" + echo "=== Testing (all features) ===" + if [ -d "target/debug" ]; then + echo " → Using: target/debug (exists)" + cargo test --workspace --all-features + else + echo " → Using: /tmp/typedialog-ci (target/debug does not exist)" + cargo test --target-dir=/tmp/typedialog-ci --workspace --all-features + fi + echo "✓ All tests passed" # Test default features [doc("Test default features")] test-default: - @echo "=== Testing (default features) ===" - cargo test --workspace - @echo "✓ Tests passed (default features)" + #!/bin/bash + set -e + cd "{{ WORKSPACE_ROOT }}" + echo "=== Testing (default features) ===" + if [ -d "target/debug" ]; then + echo " → Using: target/debug (exists)" + cargo test --workspace + else + echo " → Using: /tmp/typedialog-ci (target/debug does not exist)" + cargo test --target-dir=/tmp/typedialog-ci --workspace + fi + echo "✓ Tests passed (default features)" # Test integration only [doc("Test integration")] test-integration: - @echo "=== Testing integration ===" - cargo test --test '*' --all-features - @echo "✓ Integration tests passed" + #!/bin/bash + set -e + cd "{{ WORKSPACE_ROOT }}" + echo "=== Testing integration ===" + if [ -d "target/debug" ]; then + echo " → Using: target/debug (exists)" + cargo test --test '*' --all-features + else + echo " → Using: /tmp/typedialog-ci (target/debug does not exist)" + cargo test --target-dir=/tmp/typedialog-ci --test '*' --all-features + fi + echo "✓ Integration tests passed" # === BUILD STAGE === -# Debug build -[doc("Build debug")] -build-debug: - @echo "=== Building debug ===" - cargo build --workspace --all-features - @echo "✓ Debug build complete" +# Debug build (commented out - large disk usage) +# [doc("Build debug")] +# build-debug: +# @echo "=== Building debug ===" +# cargo build --workspace --all-features +# @echo "✓ Debug build complete" # Release build [doc("Build release")] @@ -93,42 +165,137 @@ build-release: # Audit dependencies for security issues [doc("Audit dependencies for vulnerabilities")] audit: - @echo "=== Auditing dependencies ===" - cargo audit - @echo "✓ Security audit passed" + #!/bin/bash + set -e + echo "=== Auditing dependencies ===" -# Verify SBOMs are current -[doc("Verify SBOMs are up to date")] + cd "{{ WORKSPACE_ROOT }}" + + # Ensure HOME is set to absolute path, never literal ~ + if [ -z "$HOME" ]; then + export HOME="$(getent passwd $(whoami) | cut -d: -f6)" + fi + export CARGO_HOME="${HOME}/.cargo" + + # Use explicit --db path to prevent cargo audit from creating literal ~ directory + # This is a workaround for a cargo audit issue with ~ expansion + audit_db="${CARGO_HOME}/advisory-db" + mkdir -p "$audit_db" + + if cargo audit --quiet --db "$audit_db" 2>&1 > /dev/null; then + echo "✓ No vulnerabilities found" + else + echo "⚠️ Check failed (run 'cargo audit' manually)" + fi + +# cargo-deny check (licenses only, show errors but suppress warnings) +[doc("Check dependencies with cargo-deny")] +deny: + #!/bin/bash + set -e + echo "=== Running cargo-deny ===" + + cd "{{ WORKSPACE_ROOT }}" + + # Ensure HOME is set to absolute path + if [ -z "$HOME" ]; then + export HOME="$(getent passwd $(whoami) | cut -d: -f6)" + fi + + { cargo deny check licenses 2>&1 | sed '/^warning\[/,/^$$/d' | grep -q "error\[" && cargo deny check licenses 2>&1 | sed '/^warning\[/,/^$$/d' && exit 1; } || echo "✓ No license violations" + +# Verify SBOMs can be generated +[doc("Verify SBOMs can be generated")] verify-sbom: - @echo "=== Verifying SBOMs ===" - @echo "Regenerating SBOMs to check for changes..." - python3 "{{ justfile_directory() }}/scripts/generate_sbom.py" > /tmp/sbom_current.txt 2>&1 - @echo "✓ SBOMs verified" + #!/bin/bash + set -e + echo "=== Verifying SBOMs ===" + echo "Generating SBOMs to verify compliance..." + + cd "{{ WORKSPACE_ROOT }}" + + # Ensure HOME is set to absolute path + if [ -z "$HOME" ]; then + export HOME="$(getent passwd $(whoami) | cut -d: -f6)" + fi + + cargo sbom --output-format spdx_json_2_3 > /tmp/sbom_spdx.json || echo "⚠️ SPDX SBOM generation failed" + cargo sbom --output-format cyclone_dx_json_1_4 > /tmp/sbom_cyclonedx.json || echo "⚠️ CycloneDX SBOM generation failed" + echo "✓ SBOM verification complete" # === FULL PIPELINE === # Complete CI pipeline [doc("Full CI: check + test + build")] full: - @echo "╔═══════════════════════════════════════════════════════════╗" - @echo "║ TYPEDIALOG CI/CD PIPELINE ║" - @echo "╚═══════════════════════════════════════════════════════════╝" - @echo "" - @echo "=== Stage 1: Validation ===" - just ci::check - @echo "" - @echo "=== Stage 2: Compliance ===" + #!/bin/bash + set -e + + # Clean any stray ~ directory from previous runs (created by cargo audit download) + if [ -d "~" ]; then + rm -rf "~" + echo "✓ Cleaned stray ~ directory" + fi + + echo "╔═══════════════════════════════════════════════════════════╗" + echo "║ TYPEDIALOG CI/CD PIPELINE ║" + echo "╚═══════════════════════════════════════════════════════════╝" + echo "" + + # Ensure HOME and CARGO_HOME are set to absolute paths (prevents cargo from creating literal ~ directory) + if [ -z "$HOME" ]; then + export HOME="$(getent passwd $(whoami) | cut -d: -f6)" + fi + # Force CARGO_HOME to absolute path to prevent literal ~ directory creation + export CARGO_HOME="${HOME}/.cargo" + # Pre-create CARGO_HOME if it doesn't exist + mkdir -p "$CARGO_HOME" + + echo "ℹ️ Using HOME: $HOME" + echo "ℹ️ Using CARGO_HOME: $CARGO_HOME" + echo "" + + # Detect if target/debug exists at start + debug_existed=0 + if [ -d "target/debug" ]; then + debug_existed=1 + echo "ℹ️ target/debug detected - will preserve after CI" + fi + echo "" + + echo "=== Stage 1: Validation ===" + just ci::fmt-check + just ci::lint-all + echo "" + + echo "=== Stage 2: Compliance ===" just ci::verify-sbom - @echo "" - @echo "=== Stage 3: Testing ===" + just ci::audit + just ci::deny + echo "" + + echo "=== Stage 3: Testing ===" just ci::test-all - @echo "" - @echo "=== Stage 4: Build Debug ===" - just ci::build-debug - @echo "" - @echo "=== Stage 5: Build Release ===" + echo "" + + echo "=== Stage 4: Build Release ===" just ci::build-release - @echo "" - @echo "╔═══════════════════════════════════════════════════════════╗" - @echo "║ CI PIPELINE COMPLETE ✓ ║" - @echo "╚═══════════════════════════════════════════════════════════╝" + echo "" + + echo "=== Cleanup ===" + if [ $debug_existed -eq 0 ] && [ -d "/tmp/typedialog-ci" ]; then + rm -rf /tmp/typedialog-ci + echo "✓ Temporary artifacts cleaned" + else + if [ $debug_existed -eq 1 ]; then + echo "✓ Preserving target/debug (already existed)" + fi + if [ -d "/tmp/typedialog-ci" ]; then + echo "✓ Temporary CI directory left in place" + fi + fi + echo "" + + echo "╔═══════════════════════════════════════════════════════════╗" + echo "║ CI PIPELINE COMPLETE ✓ ║" + echo "╚═══════════════════════════════════════════════════════════╝" diff --git a/justfiles/dev.just b/justfiles/dev.just index 29e765e..7d54960 100644 --- a/justfiles/dev.just +++ b/justfiles/dev.just @@ -1,6 +1,6 @@ # ╔══════════════════════════════════════════════════════════════════════╗ -# ║ DEVELOPMENT UTILITIES ║ -# ║ Watch, format, lint, docs ║ +# ║ DEVELOPMENT UTILITIES ║ +# ║ Watch, format, lint, docs ║ # ╚══════════════════════════════════════════════════════════════════════╝ # === WORKSPACE === @@ -16,6 +16,15 @@ help: @echo " just dev::lint Run clippy linter" @echo " just dev::audit Audit dependencies" @echo "" + @echo "Testing & Coverage:" + @echo " just dev::coverage Generate HTML coverage report" + @echo " just dev::coverage-ci Generate lcov coverage" + @echo " just dev::coverage-open Open coverage report" + @echo "" + @echo "Benchmarks:" + @echo " just dev::bench Run benchmarks" + @echo " just dev::bench-open Run and open benchmark report" + @echo "" @echo "Documentation:" @echo " just dev::docs Generate and open docs" @echo " just dev::docs-gen Generate docs only" @@ -35,31 +44,144 @@ help: [doc("Format code with cargo fmt")] fmt: @echo "=== Formatting code ===" - cargo fmt --all + cargo fmt -p typedialog-core -p typedialog -p typedialog-tui -p typedialog-web -p typedialog-ai -p typedialog-prov-gen -p typedialog-ag-core -p typedialog-ag @echo "✓ Formatting complete" # Check format without modifying [doc("Check format without changes")] fmt-check: @echo "=== Checking format ===" - cargo fmt --all -- --check + cargo fmt -p typedialog-core -p typedialog -p typedialog-tui -p typedialog-web -p typedialog-ai -p typedialog-prov-gen -p typedialog-ag-core -p typedialog-ag -- --check @echo "✓ Format check passed" # === LINTING === -# Run clippy on all targets -[doc("Lint code with clippy")] +# Run clippy on all targets (alias for lint-rust) +[doc("Lint code with clippy (Rust only)")] lint: - @echo "=== Linting code ===" - cargo clippy --all-targets --all-features -- -D warnings - @echo "✓ Linting complete" + just dev::lint-rust # Auto-fix clippy warnings [doc("Auto-fix clippy warnings")] lint-fix: - @echo "=== Auto-fixing clippy warnings ===" - cargo clippy --all-targets --all-features --fix --allow-dirty - @echo "✓ Auto-fix complete" + #!/bin/bash + set -e + cd "{{ WORKSPACE_ROOT }}" + echo "=== Auto-fixing clippy warnings ===" + if [ -d "target/debug" ]; then + echo " → Using: target/debug (exists)" + cargo clippy --all-targets --all-features --fix --allow-dirty + else + echo " → Using: /tmp/typedialog-ci (target/debug does not exist)" + cargo clippy --target-dir=/tmp/typedialog-ci --all-targets --all-features --fix --allow-dirty + fi + echo "✓ Auto-fix complete" + +# === MULTI-LANGUAGE LINTING === + +# Lint Rust code (clippy) - respects existing target/debug +[doc("Lint Rust with clippy")] +lint-rust: + #!/bin/bash + set -e + cd "{{ WORKSPACE_ROOT }}" + echo "=== Linting Rust ===" + if [ -d "target/debug" ]; then + echo " → Using: target/debug (exists)" + cargo clippy --all-targets --all-features -- -D warnings + else + echo " → Using: /tmp/typedialog-ci (target/debug does not exist)" + cargo clippy --target-dir=/tmp/typedialog-ci --all-targets --all-features -- -D warnings + fi + echo "✓ Rust linting complete" + +# Lint bash scripts (shellcheck) +[doc("Lint bash scripts with shellcheck")] +lint-bash: + @echo "=== Linting bash scripts ===" + @command -v shellcheck >/dev/null || (echo "shellcheck not installed: brew install shellcheck"; exit 1) + @find . -name "*.sh" -not -path "*/node_modules/*" -not -path "*/target/*" | xargs shellcheck + @echo "✓ Bash linting complete" + +# Lint Nickel files (typecheck) +[doc("Lint Nickel files")] +lint-nickel: + @echo "=== Linting Nickel files ===" + @command -v nickel >/dev/null || (echo "nickel not installed: brew install nickel"; exit 1) + @find . -name "*.ncl" -not -path "*/node_modules/*" -not -path "*/target/*" | while read f; do \ + echo "Checking $$f"; \ + nickel typecheck "$$f" || exit 1; \ + done + @echo "✓ Nickel linting complete" + +# Lint Nushell scripts +[doc("Lint Nushell scripts")] +lint-nushell: + @echo "=== Linting Nushell scripts ===" + @command -v nu >/dev/null || (echo "nushell not installed: brew install nushell"; exit 1) + @find . -name "*.nu" -not -path "*/node_modules/*" -not -path "*/target/*" | while read f; do \ + echo "Checking $$f"; \ + nu --check "$$f" || exit 1; \ + done + @echo "✓ Nushell linting complete" + +# Lint Markdown syntax (markdownlint-cli2) +# Covers: docs/**/*.md + root *.md (excludes .claude, .coder, CLAUDE.md) +[doc("Lint Markdown syntax with markdownlint-cli2")] +lint-markdown: + @echo "=== Linting Markdown syntax (docs/ + root) ===" + @command -v markdownlint-cli2 >/dev/null || (echo "markdownlint-cli2 not installed: npm install -g markdownlint-cli2"; exit 1) + @markdownlint-cli2 "docs/**/*.md" "*.md" + @echo "✓ Markdown syntax linting complete" + +# Auto-fix Markdown lint errors +# Covers: docs/**/*.md + root *.md (excludes .claude, .coder, CLAUDE.md) +[doc("Auto-fix Markdown lint errors")] +lint-markdown-fix: + @echo "=== Auto-fixing Markdown syntax (docs/ + root) ===" + @command -v markdownlint-cli2 >/dev/null || (echo "markdownlint-cli2 not installed: npm install -g markdownlint-cli2"; exit 1) + @markdownlint-cli2 --fix "docs/**/*.md" "*.md" + @echo "✓ Markdown auto-fix complete" + +# Lint Markdown prose with Vale (quality, style, grammar) +# Covers: docs/**/*.md only +[doc("Lint Markdown prose quality with Vale")] +lint-markdown-prose: + @echo "=== Linting Markdown prose quality (docs/ only) ===" + @command -v vale >/dev/null || (echo "Vale not installed: brew install vale (macOS) or see https://vale.sh"; exit 1) + @vale docs/ + @echo "✓ Prose linting complete" + +# Lint Markdown: syntax + prose +# Complete linting with markdownlint-cli2 (syntax) + Vale (prose quality) +[doc("Lint Markdown: syntax (markdownlint-cli2) + prose (Vale)")] +lint-markdown-full: + @echo "╔═══════════════════════════════════════════════════════════╗" + @echo "║ MARKDOWN LINTING (SYNTAX + PROSE) ║" + @echo "╚═══════════════════════════════════════════════════════════╝" + @echo "" + just dev::lint-markdown + @echo "" + just dev::lint-markdown-prose + +# Lint all languages +[doc("Lint all: Rust + bash + Nickel + Nushell + Markdown")] +lint-all: + @echo "╔═══════════════════════════════════════════════════════════╗" + @echo "║ MULTI-LANGUAGE LINTING ║" + @echo "╚═══════════════════════════════════════════════════════════╝" + @echo "" + just dev::lint-rust + @echo "" + just dev::lint-bash + @echo "" + just dev::lint-nickel + @echo "" + just dev::lint-nushell + @echo "" + just dev::lint-markdown + @echo "" + @echo "✓ All linting complete" # === DEPENDENCY AUDITING === @@ -105,15 +227,49 @@ watch: # === COMPREHENSIVE CHECKS === -# Run check + format + lint -[doc("Check: format + lint + compile")] +# Run check + format + lint (all languages) +[doc("Check: format + lint (all languages) + compile")] check: @echo "=== Running comprehensive check ===" - cargo fmt --all -- --check || (echo "⚠ Format check failed"; true) - cargo clippy --all-targets --all-features -- -D warnings || (echo "⚠ Lint check failed"; true) + just dev::fmt-check + just dev::lint-all cargo check --all-features @echo "✓ Check complete" +# === CODE COVERAGE === + +[doc("Generate coverage report (HTML)")] +coverage: + @echo "=== Generating code coverage ===" + cargo llvm-cov --all-features --workspace --html + @echo "✓ Coverage report: target/llvm-cov/html/index.html" + +[doc("Generate coverage (lcov for CI)")] +coverage-ci: + @echo "=== Generating coverage (CI) ===" + cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + @echo "✓ Coverage file: lcov.info" + +[doc("Open coverage report")] +coverage-open: + @echo "=== Opening coverage report ===" + cargo llvm-cov --all-features --workspace --open + +# === BENCHMARKS === + +[doc("Run benchmarks")] +bench: + @echo "=== Running benchmarks ===" + cargo bench --workspace + @echo "✓ Benchmarks complete" + @echo " Reports: target/criterion/report/index.html" + +[doc("Run benchmarks and open report")] +bench-open: + cargo bench --workspace + @echo "Opening benchmark report..." + open target/criterion/report/index.html || xdg-open target/criterion/report/index.html + # === WORKSPACE INFO === # Show workspace information diff --git a/justfiles/distro.just b/justfiles/distro.just index 8a7ba96..1d55a2c 100644 --- a/justfiles/distro.just +++ b/justfiles/distro.just @@ -76,7 +76,7 @@ cross-target TARGET: cross-docker TARGET="x86_64-unknown-linux-gnu": @echo "=== Docker cross-compilation: {{TARGET}} ===" docker build \ - -f Dockerfile.cross \ + -f .woodpecker/Dockerfile.cross \ --build-arg TARGET="{{TARGET}}" \ -t typedialog-builder:{{TARGET}} \ . @@ -154,7 +154,7 @@ install DIR="": echo "" echo "Installing release binaries..." - for binary in typedialog typedialog-tui typedialog-web; do + for binary in typedialog typedialog-tui typedialog-web typedialog-ai typedialog-ag typedialog-prov-gen; do SRC="$WORKSPACE/target/release/$binary" if [ -f "$SRC" ]; then cp "$SRC" "$INSTALL_DIR/$binary" @@ -165,9 +165,22 @@ install DIR="": fi done + # Copy prov-gen templates if they don't exist + echo "" + echo "Installing data files..." + TEMPLATES_DIR="$HOME/.config/typedialog/prov-gen/templates" + if [ ! -d "$TEMPLATES_DIR" ]; then + mkdir -p "$TEMPLATES_DIR" + cp -r "$WORKSPACE/crates/typedialog-prov-gen/templates"/* "$TEMPLATES_DIR/" + echo " ✓ prov-gen templates" + else + echo " ⊘ prov-gen templates (already exist)" + fi + echo "" echo "Installation summary:" echo " Install dir: $INSTALL_DIR" + echo " Templates dir: $TEMPLATES_DIR" if echo "$INSTALL_DIR" | grep -q "\.local/bin"; then echo " Shell setup: Run 'export PATH=\"\$PATH:$INSTALL_DIR\"' or add to ~/.bashrc/.zshrc" diff --git a/justfiles/nickel.just b/justfiles/nickel.just index bdfbb88..7f4c218 100644 --- a/justfiles/nickel.just +++ b/justfiles/nickel.just @@ -1,6 +1,6 @@ # ╔══════════════════════════════════════════════════════════════════════╗ -# ║ Nickel Schema → TypeDialog Form Recipes ║ -# ║ Generate TOML forms with fragments, conditionals, i18n ║ +# ║ Nickel Schema → TypeDialog Form Recipes ║ +# ║ Generate TOML forms with fragments, conditionals, i18n ║ # ╚══════════════════════════════════════════════════════════════════════╝ # Generate TOML form from Nickel schema with all features diff --git a/justfiles/shared.just b/justfiles/shared.just index ab37aa4..d2b076c 100644 --- a/justfiles/shared.just +++ b/justfiles/shared.just @@ -1,6 +1,6 @@ # ╔══════════════════════════════════════════════════════════════════════╗ -# ║ SHARED VARIABLES AND HELPERS ║ -# ║ TypeDialog workspace ║ +# ║ SHARED VARIABLES AND HELPERS ║ +# ║ TypeDialog workspace ║ # ╚══════════════════════════════════════════════════════════════════════╝ # === WORKSPACE STRUCTURE === diff --git a/justfiles/test.just b/justfiles/test.just index 223051d..81cbee8 100644 --- a/justfiles/test.just +++ b/justfiles/test.just @@ -1,12 +1,14 @@ # ╔══════════════════════════════════════════════════════════════════════╗ -# ║ TEST RECIPES ║ -# ║ Test workspace with different feature flags ║ +# ║ TEST RECIPES ║ +# ║ Test workspace with different feature flags ║ # ╚══════════════════════════════════════════════════════════════════════╝ # === FEATURE FLAGS === FEATURES_CLI := "cli,i18n,templates" FEATURES_TUI := "tui,i18n,templates" FEATURES_WEB := "web,i18n,templates" +FEATURES_AI := "ai_backend" +FEATURES_AGENT := "markup,nickel,cache" # Help for test module help: @@ -20,6 +22,10 @@ help: @echo " just test::cli Test CLI backend features" @echo " just test::tui Test TUI backend features" @echo " just test::web Test Web backend features" + @echo " just test::ai-lib Test AI backend lib (RAG, KG, embeddings)" + @echo " just test::ai Test AI backend (FormBackend + microservice)" + @echo " just test::agent Test Agent system (LLM execution)" + @echo " just test::prov-gen Test Provisioning generator (IaC)" @echo "" @echo "Test by crate:" @echo " just test::core Test TypeDialog core" @@ -35,14 +41,16 @@ help: [doc("Run all tests with default features")] all: @echo "=== Testing workspace (default features) ===" - cargo test --workspace --lib + cargo test --target-dir=/tmp/typedialog-ci --workspace --lib + @rm -rf /tmp/typedialog-ci @echo "✓ All tests passed" # Run all tests with all features enabled [doc("Run all tests with all features")] all-features: @echo "=== Testing workspace (all features) ===" - cargo test --workspace --all-features + cargo test --target-dir=/tmp/typedialog-ci --workspace --all-features + @rm -rf /tmp/typedialog-ci @echo "✓ All tests passed (all features)" # === BACKEND-SPECIFIC TESTS === @@ -71,6 +79,34 @@ web: cargo test -p typedialog-web --lib @echo "✓ Web tests passed" +# Test AI backend library (RAG, Knowledge Graph, embeddings) +[doc("Test AI backend library")] +ai-lib: + @echo "=== Testing AI backend library (RAG, KG, embeddings) ===" + cargo test -p typedialog-core --features "{{ FEATURES_AI }}" --lib ai:: + @echo "✓ AI backend library tests passed" + +# Test AI backend (FormBackend + microservice) +[doc("Test AI backend (FormBackend + microservice)")] +ai: + @echo "=== Testing AI backend ===" + cargo test -p typedialog-ai --lib + @echo "✓ AI backend tests passed" + +# Test Agent system (LLM execution, multi-provider) +[doc("Test Agent system (typedialog-ag)")] +agent: + @echo "=== Testing Agent system ===" + cargo test -p typedialog-ag-core --features "{{ FEATURES_AGENT }}" --lib + @echo "✓ Agent tests passed" + +# Test Provisioning generator (Infrastructure as Code) +[doc("Test Provisioning generator (typedialog-prov-gen)")] +prov-gen: + @echo "=== Testing Provisioning generator ===" + cargo test -p typedialog-prov-gen --lib + @echo "✓ Provisioning generator tests passed" + # === CRATE-SPECIFIC TESTS === # Test core library only