8fd807f174
crate BREAKING CHANGE: Moved engine/ module (cgroups, executor, pm, upm, types) and shared types (command, repology, time) from workshop-baker to new workshop-engine crate. All internal error types consolidated into workshop-engine::error. Import paths changed throughout codebase.
3.9 KiB
3.9 KiB
PROJECT KNOWLEDGE BASE
Generated: 2026-04-22
Commit: 7b3b71a
Branch: master
OVERVIEW
HoneyBiscuitWorkshop is a Rust-based CI/CD system ("蜜饼工坊") with LLM-powered pipeline auto-configuration. 9 independent Cargo crates, no workspace.
STRUCTURE
./
├── workshop-baker/ # Main orchestrator (CLI + daemon)
├── workshop-agent/ # HTTP agent server
├── workshop-pipeline/ # Config library (prebake/finalize)
├── workshop-llm-detector/ # LLM repo analyzer
├── workshop-vault/ # Secret management client
├── workshop-cert/ # TLS certificate generator
├── workshop-deviceid/ # Device ID library
├── workshop-builder-native/ # Stub (unused)
├── workshop-helper-mac/ # MAC address utility
├── docs/ # mdBook documentation (zh-CN)
├── playground/ # Experimentation
└── third_party/ # Empty
WHERE TO LOOK
| Task | Location | Notes |
|---|---|---|
| Baker (main) | workshop-baker/src/{bake,prebake,engine}/ |
Core pipeline logic |
| Agent server | workshop-agent/src/ |
Actix-web HTTP + TLS |
| Pipeline config | workshop-pipeline/src/config/ |
prebake/finalize YAML |
| LLM integration | workshop-llm-detector/src/llm/ |
Ollama/OpenAI clients |
| Secrets | workshop-vault/src/ |
Vault client wrapper |
CODE MAP
| Symbol | Type | Location | Role |
|---|---|---|---|
| PipelineConfig | struct | workshop-pipeline/src/lib.rs:27 | Full pipeline config |
| CICDLLMHelper | struct | workshop-llm-detector/src/lib.rs:16 | LLM analysis entry |
| Engine | struct | workshop-baker/src/engine.rs | Build executor |
| VaultClient | struct | workshop-vault/src/client.rs | Secret ops |
CONVENTIONS
Rust
- Edition: 2024 (non-standard, requires Rust 1.85+)
- Deprecate
mod.rs
- Deprecate
- Naming:
snake_casefiles/modules,PascalCasetypes,SCREAMING_SNAKE_CASEconsts - Error handling:
thiserror+anyhowcombo - Async:
#[tokio::main]+tokiowith "full" features - Imports:
std→external_crate→crate::module
Testing
- Rust:
#[test]inline,#[tokio::test]async,tests/*.rsintegration - Python:
pytestwithtests/integration/test_*.py(Docker-based) - Benchmarks: Criterion with
harness = false
Build Pipeline
- prebake.yml: Environment setup (docker/firecracker/baremetal)
- bake.sh: Build execution with
# @pipelinedecorators - finalize.yml: Packaging, deployment, notifications
- Annotations:
@timeout(),@retry(),@parallel,@fallible
ANTI-PATTERNS (THIS PROJECT)
- Python in Rust project — workshop-baker has Python tests (pytest.ini, test_prebake.py)
- temp/ directory — Non-standard in Rust projects
- Certificates in source — artifact workshop-cert/certs/ not excluded
- Deprecated projects — workshop-executor.old, workshop-monitor.old still present
- Hardcoded mirrors — Tsinghua University mirrors in configs
- Rust 2024 edition — May not work with stable toolchains
UNIQUE STYLES
- Pipeline DSL: Shell scripts with
# @decoratorannotations - Dual-mode baker: CLI commands + daemon mode
- LLM cookbook system: YAML cookbooks for language-specific builds
- Chinese docs — Documentation primarily in zh-CN
- User "vulcan" — Custom build user (not root/runner)
COMMANDS
# Build
cargo build --release -p workshop-baker
# Test
cargo test -p workshop-baker
pytest tests/integration/test_prebake.py -v
# Lint
cargo clippy -- -D warnings
cargo fmt --all
# Run baker
cargo run --bin workshop-baker -- prebake config.yml
cargo run --bin workshop-baker -- bake script.sh
# Run agent
cargo run --bin workshop-agent
NOTES
- Docker required for integration tests
- workshop-builder-native is a stub (3-line Hello World)
- No root workspace Cargo.toml — each crate is independent
AGENTS.md.oldat root — legacy documentation