cf2968e720
Archive 7 deprecated crates. Add Resource model documentation. Remove internal fetch module from workshop-baker.
3.9 KiB
3.9 KiB
PROJECT KNOWLEDGE BASE
Generated: 2026-05-19
Commit: 28abc5d
Branch: master
OVERVIEW
HoneyBiscuitWorkshop ("蜜饼工坊") — Rust CI/CD system with decorator-driven shell pipeline DSL and LLM-powered configuration. 3 independent Cargo crates, no workspace.
STRUCTURE
./
├── workshop-baker/ # Main orchestrator (CLI + pipeline stages)
├── workshop-engine/ # Execution engine (extracted from baker)
├── workshop-getterurl/ # URL fetching (go-getter style)
├── docs/ # mdBook documentation (zh-CN)
├── templates/ # Pipeline templates (bake.sh, finalize.yml, prebake.yml)
└── archived/ # Deprecated crates (7 moved here)
WHERE TO LOOK
| Task | Location | Notes |
|---|---|---|
| Baker (CLI) | workshop-baker/src/{lib,main}.rs |
Clap CLI + tokio entry |
| Pipeline stages | workshop-baker/src/{bake,prebake,finalize}/ |
Stage orchestration |
| Notifications | workshop-baker/src/notify/ |
Plugin-based event notifications |
| Engine (execution) | workshop-engine/src/ |
|
| URL fetching | workshop-getterurl/src/ |
Git/HTTP/File resource getter |
CODE MAP
| Symbol | Type | Location | Role |
|---|---|---|---|
| Cli | struct | workshop-baker/src/lib.rs:21 | CLI argument struct |
| ExecutionContext | struct | workshop-engine/src/types.rs:10 | Pipeline context |
| Engine | struct | workshop-engine/src/types.rs:99 | Build executor (placeholder) |
| PrebakeConfig | struct | workshop-baker/src/prebake/config.rs | Prebake YAML schema |
| FinalizeConfig | struct | workshop-baker/src/finalize/config.rs:21 | Finalize YAML schema |
| GetterUrl | struct | workshop-getterurl/src/lib.rs:84 | Parsed resource URL |
| Getter | trait | workshop-getterurl/src/getter.rs:18 | Resource fetch trait |
CONVENTIONS
Rust
- Edition: 2024 (requires Rust 1.85+), deprecates
mod.rs - Naming:
snake_casefiles/modules,PascalCasetypes,SCREAMING_SNAKE_CASEconsts - Error handling:
thiserror+anyhowcombo;HasExitCodetrait for exit codes - Async:
#[tokio::main]+tokiowith "full" features - Imports:
std→external_crate→crate::module - Dual-mode: CLI commands (prebake/bake/finalize) + daemon mode (unimplemented)
Testing
- Rust:
#[test]inline,#[tokio::test]async,tests/integration - Benchmarks: Criterion (configured in Cargo.toml)
CI
- GitHub Actions: rust-toolchain (stable), clippy + rustfmt,
cargo test --all-features - Matrix: workshop-baker, workshop-engine
ANTI-PATTERNS (THIS PROJECT)
- Hardcoded user — "vulcan" username hardcoded throughout prebake
- Unsafe libc — workshop-baker/src/prebake/security.rs has 5+ unsafe blocks
- Rust 2024 edition — May not work with stable toolchains
- Empty daemon —
daemon/dir is empty, Daemon command isunimplemented!()
UNIQUE STYLES
- Pipeline DSL: Shell scripts with
# @decoratorannotations - Notification system: Plugin-based with batching, retry, priority groups
- LLM cookbook system: YAML cookbooks for language-specific builds (archived)
- Chinese docs — Documentation primarily in zh-CN
COMMANDS
# Build
cargo build --release -p workshop-baker
# Test
cargo test -p workshop-baker
cargo test -p workshop-engine
# Lint
cargo clippy -- -D warnings
cargo fmt --all
# Run
cargo run --bin workshop-baker -- --pipeline demo --build-id 1 --prebake prebake.yml --bake bake.sh --finalize finalize.yml
NOTES
- Docker required for integration tests
- No root workspace — each crate independent, build separately
- 7 archived crates — workshop-agent, workshop-cert, workshop-deviceid, workshop-helper-mac, workshop-llm-detector, workshop-pipeline, workshop-vault
- Python tests removed — pytest.ini exists but test files no longer in workspace