/ scripts / workflow-grammar.yaml
workflow-grammar.yaml
  1  # Workflow Prompt Grammar
  2  # Maps compressed cspec-style prompts to expanded instructions
  3  # Loaded by workflow runner and injected as system context
  4  
  5  grammar_version: 1.0
  6  
  7  # === COMMAND DEFINITIONS ===
  8  commands:
  9    ci_repair:
 10      expand: |
 11        Fix CI failures. scope={scope}. Priority: {priority}.
 12        For each failing repo: diagnose→fix→verify→commit.
 13        Action: {action}. Loop: {loop}.
 14      defaults:
 15        scope: all_repos
 16        priority: [security, build, test, lint]
 17        action: minimal_fix
 18        loop: until_green
 19  
 20    dead_code_cleanup:
 21      expand: |
 22        Remove dead code. Scope: {scope}. Tools: {tools}.
 23        Verify with {verify}. Skip: {skip}. Commit: {commit}.
 24      defaults:
 25        scope: all_repos
 26        tools: [cargo-machete, knip]
 27        verify: grep_usage
 28        skip: [cfg_test, feature_flags, public_exports]
 29        commit: true
 30  
 31    dep_update:
 32      expand: |
 33        Update dependencies. Audit: {audit}. Priority: {priority}.
 34        Action: {action}. Test: {test}. Commit: {commit}.
 35      defaults:
 36        audit: [cargo_audit, npm_audit]
 37        priority: [security, major, minor]
 38        action: bump_safe_versions
 39        test: verify_build
 40        commit: true
 41  
 42    sync_docs:
 43      expand: |
 44        Sync documentation. Source: {source}. Target: {target}.
 45        Sync: {sync}. Commit: {commit}.
 46      defaults:
 47        source: "components/*.cspec"
 48        target: "docs/"
 49        sync: [api, interfaces, changelog]
 50        commit: true
 51  
 52    mutation_fix:
 53      expand: |
 54        Fix mutation survivors. Source: {source}. Target: {target}.
 55        Action: {action}. Focus: {focus}. Threshold: {threshold}. Commit: {commit}.
 56      defaults:
 57        source: nightly_artifacts
 58        target: survived_mutants
 59        action: add_assertions
 60        focus: [boundary, boolean, arithmetic]
 61        threshold: "<10%"
 62        commit: true
 63  
 64    coverage_fix:
 65      expand: |
 66        Improve coverage. Source: {source}. Target: {target}.
 67        Threshold: {threshold}. Priority: {priority}. Commit: {commit}.
 68      defaults:
 69        source: ci-report.yaml
 70        target: gaps
 71        threshold: "80%"
 72        priority: [business_logic, error_handling, edge_cases]
 73        commit: true
 74  
 75    dashboard_report:
 76      expand: |
 77        Generate dashboard report. Source: {source}. Metrics: {metrics}. Format: {format}.
 78      defaults:
 79        source: dashboard-data.yaml
 80        metrics: [pass_fail, coverage_trend, vulns, mutation_score]
 81        format: summary
 82  
 83    health_report:
 84      expand: |
 85        Generate health report. Scope: {scope}. Collect: {collect}. Format: {format}.
 86      defaults:
 87        scope: all_repos
 88        collect: [ci_status, last_green, coverage, mutations, vulns, outdated]
 89        format: structured_yaml
 90  
 91  # === REPO LISTS ===
 92  repo_lists:
 93    all_repos:
 94      rust: [alphavm, deltavm, adnet, alphaos, deltaos, acdc-core, ac-dc, adl, wallet-core]
 95      frontend: [acdc-wallet, acdc-governor, acdc-messenger, acdc-scanner, acdc-docs, acdc-home, acdc-forge]
 96      other: [acdc-design, acdc-i18n, ci-dashboard, alpha-delta-context]
 97  
 98  # === TOOL MAPPINGS ===
 99  tool_mappings:
100    cargo_check: "cargo check --workspace"
101    clippy: "cargo clippy --workspace --all-targets -- -D warnings"
102    cargo_test: "cargo nextest run"
103    cargo_audit: "cargo audit"
104    cargo_deny: "cargo deny check"
105    cargo-machete: "cargo machete --fix"
106    npm_audit: "npm audit"
107    tsc: "tsc --noEmit"
108    eslint: "eslint --max-warnings 0"
109    vitest: "vitest run"
110    knip: "npx knip"
111  
112  # === OUTPUT FORMATS ===
113  output_templates:
114    json:
115      success: '{"status":"success","repos_fixed":{count},"changes":{changes}}'
116      failure: '{"status":"failure","error":"{error}","repos_failing":{repos}}'
117    summary:
118      success: "✓ {workflow}: {count} repos, {changes} changes"
119      failure: "✗ {workflow}: {error}"