ggen 1.2.0

ggen is a deterministic, language-agnostic code generation framework that treats software artifacts as projections of knowledge graphs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
# GitHub API configuration
[env]
GITHUB_REPO = "seanchatmangpt/ggen"
GITHUB_API = "https://api.github.com"
GITHUB_PAGES_URL = "https://seanchatmangpt.github.io/ggen"

# Act configuration for local GitHub Actions testing
[env.ACT]
ACT_CONTAINER_ARCH = "linux/amd64"
ACT_PLATFORM = "ubuntu-latest=catthehacker/ubuntu:act-latest"
ACT_MEMORY = "2g"
ACT_CPUS = "2"

# Core development tasks
[tasks.check]
description = "Check code without building"
command = "cargo"
args = ["check"]

[tasks.build]
description = "Build in debug mode"
command = "cargo"
args = ["build"]

[tasks.build-release]
description = "Build in release mode"
command = "cargo"
args = ["build", "--release"]

[tasks.clean]
description = "Clean build artifacts"
command = "cargo"
args = ["clean"]

[tasks.fmt]
description = "Format code"
command = "cargo"
args = ["fmt", "--all"]

[tasks.lint]
description = "Run clippy with strict settings"
command = "cargo"
args = ["clippy", "--all-targets", "--all-features", "--", "-D", "warnings"]

[tasks.test]
description = "Run all tests"
command = "cargo"
args = ["test", "--workspace", "--no-default-features"]
workspace = false

[tasks.test-unit]
description = "Unit tests only"
command = "cargo"
args = ["test", "--lib"]

[tasks.test-integration]
description = "Integration tests only"
command = "cargo"
args = ["test", "--test"]

[tasks.test-testcontainers]
description = "Run testcontainers production readiness validation tests"
command = "cargo"
args = ["test", "--package", "ggen-cli-lib", "--test", "integration"]
env = { "RUST_LOG" = "info" }

[tasks.test-cleanroom]
description = "Run cleanroom production tests with testcontainers"
workspace = false
command = "cargo"
args = [
  "test",
  "--package",
  "ggen-cli-lib",
  "--test",
  "integration_tests",
  "--",
  "testcontainers_cleanroom",
]
env = { "RUST_LOG" = "info" }

[tasks.test-cleanroom-crate]
description = "Run tests for the cleanroom crate"
workspace = false
command = "cargo"
args = ["test", "--package", "cleanroom"]
env = { "RUST_LOG" = "info" }

[tasks.lint-cleanroom]
description = "Run clippy on cleanroom crate"
workspace = false
command = "cargo"
args = ["clippy", "--package", "cleanroom", "--", "-D", "warnings"]

[tasks.cleanroom-validate]
description = "Validate cleanroom implementation and integration"
workspace = false
dependencies = ["test-cleanroom-crate", "test-cleanroom", "lint-cleanroom"]

[tasks.cleanroom-slo-check]
description = "Check cleanroom performance SLOs"
workspace = false
command = "cargo"
args = [
  "test",
  "--package",
  "cleanroom",
  "--release",
  "--",
  "--nocapture",
  "slo",
]
env = { "RUST_LOG" = "info" }

[tasks.cleanroom-profile]
description = "Profile cleanroom performance"
workspace = false
command = "cargo"
args = ["flamegraph", "--package", "cleanroom", "--bin", "cleanroom-bench"]

[tasks.production-readiness]
description = "Comprehensive production readiness validation with testcontainers"
workspace = false
dependencies = [
  "test-testcontainers",
  "test-cleanroom",
  "cleanroom-validate",
  "test-unit",
  "test-integration",
  "lint",
  "build-release",
]

[tasks.production-readiness-script]
description = "Run production readiness validation script"
workspace = false
command = "./scripts/production-readiness-validation.sh"
args = ["--full"]

[tasks.test-live]
description = "Run tests with live LLM integrations (requires API keys)"
command = "cargo"
args = ["test", "--features", "live-llm-tests,all-integrations"]

[tasks.test-ollama]
description = "Run Ollama integration tests (requires Ollama running)"
command = "cargo"
args = [
  "test",
  "--features",
  "ollama-integration",
  "--test",
  "ollama_integration",
  "-p",
  "ggen-ai",
]

[tasks.test-openai]
description = "Run OpenAI integration tests (requires OPENAI_API_KEY)"
command = "cargo"
args = ["test", "--features", "openai-integration,live-llm-tests"]
env = { "RUST_LOG" = "info" }

[tasks.test-anthropic]
description = "Run Anthropic integration tests (requires ANTHROPIC_API_KEY)"
command = "cargo"
args = ["test", "--features", "anthropic-integration,live-llm-tests"]
env = { "RUST_LOG" = "info" }

[tasks.test-ollama-performance]
description = "Run Ollama performance and stress tests"
workspace = false
command = "cargo"
args = [
  "test",
  "--package",
  "ggen-ai",
  "--features",
  "ollama-integration",
  "--test",
  "ollama_performance",
]

[tasks.test-ollama-resilience]
description = "Run Ollama resilience and error recovery tests"
workspace = false
command = "cargo"
args = [
  "test",
  "--package",
  "ggen-ai",
  "--features",
  "ollama-integration",
  "--test",
  "ollama_resilience",
]

[tasks.test-ollama-all]
description = "Run all Ollama integration tests (integration, performance, resilience)"
workspace = false
dependencies = [
  "test-ollama",
  "test-ollama-performance",
  "test-ollama-resilience",
]

[tasks.validate-ollama]
description = "Validate Ollama integration (checks service, model, and runs tests)"
workspace = false
command = "./scripts/validate-ollama.sh"

# GitHub Actions local testing with act
[tasks.act-list]
description = "List available GitHub Actions workflows"
workspace = false
command = "act"
args = ["--list"]

[tasks.act-lint]
description = "Run lint workflow locally with act"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--memory",
  "${ACT_MEMORY}",
  "--cpus",
  "${ACT_CPUS}",
  "-j",
  "lint",
]

[tasks.act-test]
description = "Run test workflow locally with act"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--memory",
  "${ACT_MEMORY}",
  "--cpus",
  "${ACT_CPUS}",
  "-j",
  "test",
]

[tasks.act-build]
description = "Run build workflow locally with act"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--memory",
  "${ACT_MEMORY}",
  "--cpus",
  "${ACT_CPUS}",
  "-j",
  "build",
]

[tasks.act-audit]
description = "Run security audit workflow locally with act"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--memory",
  "${ACT_MEMORY}",
  "--cpus",
  "${ACT_CPUS}",
  "-j",
  "audit",
]

[tasks.act-all]
description = "Run all workflows locally with act (lightweight)"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--memory",
  "${ACT_MEMORY}",
  "--cpus",
  "${ACT_CPUS}",
  "--matrix",
]

[tasks.act-release]
description = "Run release workflows locally with act (parallel execution)"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh
'''

[tasks.act-release-dry-run]
description = "Show what act-release would execute without running"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh --dry-run
'''

[tasks.act-release-workflow-only]
description = "Run only the release workflow with act"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh --workflow-only
'''

[tasks.act-release-homebrew-only]
description = "Run only the homebrew-release workflow with act"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh --homebrew-only
'''

[tasks.act-release-debug]
description = "Run release workflows with debug output"
workspace = false
script_runner = "@shell"
script = '''
DEBUG=true ./scripts/act-release.sh
'''

[tasks.act-release-json]
description = "Run release workflows with JSON output"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh --json
'''

[tasks.act-release-retry]
description = "Run release workflows with retry logic"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh --retry-failed
'''

[tasks.act-release-metrics]
description = "Run release workflows with metrics collection"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh --metrics
'''

[tasks.act-release-timeout]
description = "Run release workflows with custom timeout"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh --timeout 3600
'''

[tasks.act-release-verbose]
description = "Run release workflows with verbose output"
workspace = false
script_runner = "@shell"
script = '''
./scripts/act-release.sh --verbose
'''

[tasks.act-parallel]
description = "Run multiple workflows in parallel"
workspace = false
dependencies = ["act-lint", "act-test", "act-build"]

[tasks.act-cleanup]
description = "Clean up act containers and images"
workspace = false
script = '''
echo "🧹 Cleaning up act containers..."
docker ps -a --filter "label=act" --format "table {{.ID}}\t{{.Status}}\t{{.Names}}" | grep act || true
docker container prune -f --filter "label=act" || true
docker image prune -f --filter "label=act" || true
echo "✅ Act cleanup complete"
'''

[tasks.act-lint-light]
description = "Run lint workflow locally with act (lightweight, no cargo-make)"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--memory",
  "1g",
  "--cpus",
  "1",
  "-W",
  ".github/workflows/lint.yml",
  "-j",
  "lint",
  "--artifact-server-path",
  "/tmp/act-artifacts",
]

[tasks.act-test-light]
description = "Run test workflow locally with act (lightweight)"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--memory",
  "1g",
  "--cpus",
  "1",
  "-W",
  ".github/workflows/test.yml",
  "-j",
  "test",
  "--artifact-server-path",
  "/tmp/act-artifacts",
]

[tasks.act-build-light]
description = "Run build workflow locally with act (lightweight)"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--memory",
  "1g",
  "--cpus",
  "1",
  "-W",
  ".github/workflows/build.yml",
  "-j",
  "build",
  "--artifact-server-path",
  "/tmp/act-artifacts",
]

[tasks.act-dry-run]
description = "Dry run all workflows (no execution)"
workspace = false
command = "act"
args = [
  "--container-architecture",
  "${ACT_CONTAINER_ARCH}",
  "--platform",
  "${ACT_PLATFORM}",
  "--dryrun",
]

[tasks.act-status]
description = "Check act installation and Docker status"
workspace = false
script = '''
echo "🔍 Checking act installation..."
act --version || echo "❌ act not installed"
echo ""
echo "🐳 Checking Docker status..."
docker --version || echo "❌ Docker not available"
docker ps > /dev/null 2>&1 && echo "✅ Docker daemon running" || echo "❌ Docker daemon not running"
echo ""
echo "📊 Docker resource usage:"
docker system df
'''

[tasks.test-bdd]
description = "Run BDD tests (Cucumber feature tests)"
workspace = false
command = "cargo"
args = ["test", "--test", "bdd"]

[tasks.test-bdd-feature]
description = "Run specific BDD feature (usage: cargo make test-bdd-feature FEATURE=graph)"
workspace = false
command = "cargo"
args = ["test", "--test", "bdd", "test_${FEATURE}_features"]

[tasks.test-bdd-verbose]
description = "Run BDD tests with verbose output"
workspace = false
command = "cargo"
args = ["test", "--test", "bdd", "--", "--nocapture"]

[tasks.audit]
description = "Security audit"
command = "cargo"
args = ["audit"]
workspace = false

[tasks.audit-outdated]
description = "Check for outdated dependencies"
command = "cargo"
args = ["outdated"]
workspace = false

[tasks.audit-unused]
description = "Check for unused dependencies (requires nightly)"
command = "cargo"
args = ["+nightly", "udeps"]
workspace = false

[tasks.audit-deny]
description = "Comprehensive dependency audit with cargo-deny"
command = "cargo"
args = ["deny", "check"]
workspace = false

[tasks.audit-all]
description = "Run all dependency audits"
dependencies = ["audit", "audit-outdated", "audit-deny"]
workspace = false

[tasks.format]
description = "Format code"
command = "cargo"
args = ["fmt", "--all"]

[tasks.clippy-ci-flow]
description = "Run clippy with CI-friendly settings"
command = "cargo"
args = ["clippy", "--all-targets", "--all-features", "--", "-D", "warnings"]

[tasks.test-verbose]
description = "Run tests with verbose output"
workspace = false
command = "cargo"
args = ["test", "--workspace", "--", "--nocapture"]

[tasks.test-proptest]
description = "Run property-based tests with proptest"
command = "cargo"
args = ["test", "--workspace", "--features", "proptest", "--", "--nocapture"]

[tasks.test-proptest-single]
description = "Run property-based tests for a single package"
command = "cargo"
args = [
  "test",
  "--package",
  "${PACKAGE}",
  "--features",
  "proptest",
  "--",
  "--nocapture",
]

[tasks.test-proptest-parallel]
description = "Run property-based tests in parallel"
command = "cargo"
args = [
  "test",
  "--workspace",
  "--features",
  "proptest",
  "--",
  "--test-threads",
  "4",
  "--nocapture",
]

# mdbook documentation tasks (workspace-level only)

[tasks.docs-build]
description = "Build documentation with mdbook"
workspace = false
command = "mdbook"
args = ["build", "docs"]

[tasks.docs-serve]
description = "Serve documentation locally with mdbook"
workspace = false
command = "mdbook"
args = ["serve", "docs", "--open"]

[tasks.docs-watch]
description = "Watch and rebuild documentation on changes"
workspace = false
command = "mdbook"
args = ["watch", "docs"]

[tasks.docs-clean]
description = "Clean built documentation"
workspace = false
command = "rm"
args = ["-rf", "docs/book"]

[tasks.docs-test]
description = "Test documentation build"
workspace = false
dependencies = ["docs-build"]
command = "echo"
args = ["Documentation built successfully"]

[tasks.docs-validate]
description = "Validate documentation structure and links"
workspace = false
dependencies = ["docs-build"]
command = "./scripts/docs-validate.sh"

[tasks.docs-deploy]
description = "Build and validate documentation for deployment"
workspace = false
dependencies = ["docs-clean", "docs-build", "docs-validate"]

# GitHub Pages API Diagnostic Tasks

[tasks.gh-pages-status]
description = "Check GitHub Pages configuration and deployment status via API"
workspace = false
command = "./scripts/gh-pages-status.sh"

[tasks.gh-workflow-status]
description = "Check GitHub Actions workflow status for Pages deployment"
workspace = false
command = "./scripts/gh-workflow-status.sh"

[tasks.gh-pages-compare]
description = "Compare local docs build with deployed version"
workspace = false
dependencies = ["docs-build"]
command = "./scripts/gh-pages-compare.sh"

[tasks.gh-pages-trigger]
description = "Trigger GitHub Pages deployment workflow manually"
workspace = false
command = "./scripts/gh-pages-trigger.sh"

[tasks.gh-pages-logs]
description = "View logs from latest GitHub Pages deployment"
workspace = false
command = "./scripts/gh-pages-logs.sh"

[tasks.gh-pages-setup-check]
description = "Comprehensive GitHub Pages setup validation"
workspace = false
command = "./scripts/gh-pages-setup-check.sh"

# Add docs tasks to existing workflows (if they exist)
[tasks.ci]
description = "Run CI pipeline"
workspace = false
dependencies = ["format", "clippy-ci-flow", "test", "audit-all", "docs-test"]

[tasks.release]
description = "Create a release"
dependencies = ["ci", "docs-build"]

# ============================================================================
# Homebrew Release Tasks
# ============================================================================

[tasks.brew-update-formula]
description = "Update Homebrew formula with SHA256 from latest release"
workspace = false
command = "./scripts/update-homebrew-formula.sh"
args = ["${1}"]

[tasks.brew-update]
alias = "brew-update-formula"

[tasks.release-brew]
description = "Complete release workflow with Homebrew update"
workspace = false
dependencies = ["ci", "docs-build"]
command = "./scripts/release-brew.sh"

[tasks.release-check]
description = "Check if release artifacts are ready"
workspace = false
command = "./scripts/release-check.sh"
args = ["${1}"]

# ============================================================================
# GitHub Actions Workflow Health Check
# ============================================================================

[tasks.ci-check]
description = "Check GitHub Actions workflow health and report failures"
workspace = false
command = "./scripts/ci-health-check.sh"

[tasks.ci-health]
alias = "ci-check"

# ============================================================================
# Shell Completion Tasks
# ============================================================================

[tasks.completions]
description = "Generate shell completion scripts"
command = "cargo"
args = [
  "run",
  "--bin",
  "ggen",
  "--",
  "shell",
  "completion",
  "generate",
  "--shell",
  "${SHELL}",
  "--output",
  "${OUTPUT}",
]

[tasks.completions-install]
description = "Install shell completion scripts"
command = "cargo"
args = [
  "run",
  "--bin",
  "ggen",
  "--",
  "shell",
  "completion",
  "install",
  "--shell",
  "${SHELL}",
  "--force",
]

[tasks.completions-list]
description = "List supported shell completion types"
command = "cargo"
args = ["run", "--bin", "ggen", "--", "shell", "completion", "list"]