hamilton-core
Core Hamilton patterns for creating DAGs, applying decorators, testing, and debugging dataflows. Use for basic Hamilton development tasks.
- License 许可
- Apache-2.0
- 所属仓库
- apache/hamilton
- 最近更新
- 2026-11-10
- Stars
- ★ 2.6k
- Forks
- 230
03 SKILL.md 正文
Language Match Semantics — Feature Expert
Ownership
- Frontend patterns may preserve a bare identifier as a binding-shaped HIR node when its value/category is unavailable until MIR lowering.
- MIR must resolve immutable current-module scalar
valnames before enum or capture fallback. Mutablevarnames and genuinely unbound identifiers stay capture patterns. - Dispatch must consume normalized arms. Integer-only cases retain the switch
path; text and bool cases use ordered scalar equality, with text compared by
content through
rt_text_eq_any.
Regression contract
test/01_unit/compiler/codegen/match_bare_val_constant_spec.spl is the exact
and adjacent contract: two text constants, two integer constants, bool values,
wildcard reachability, mutable-name capture, and genuine capture.
Evidence honesty
Source and static contracts do not close native behavior. Require a provenance-admitted pure-Simple CLI to execute the focused spec before changing the BugDB row from verification-pending to fixed.
Guards are evaluated on every arm shape (3a)
case P if g: runs its body only when P matches and g holds, for every
pattern kind. Two lowerings carry guards and both are counted:
- enum arms and guarded catch-alls:
lower_enum_match_flat; guarded int / or-of-int / binding / wildcard arms:lower_guarded_scalar_match(50.mir/_MirLoweringExpr/switch_operators_calls.spl); - tuple, text, range, struct and array arms:
build_if_chain(20.hir/hir_lowering/_Expressions/match_desugaring.spl), which testspattern and { destructure prelude; guard }.
The guard-count invariant (E-HIR-MATCH-GUARD / E-MIR-MATCH-GUARD, level via
SIMPLE_MIR_VERIFY_LEVELS=E-MIR-MATCH-GUARD=...) reports a guard that was parsed but
not lowered. Guide: doc/07_guide/compiler/robustness/match-guard-invariant.md.
Specs: test/01_unit/compiler/50.mir/match_guard/. The seed
run engine ignores a guard on case _ if c:; simple test evaluates it.
04 同仓库更多 Skills
hamilton-scale
Performance and parallelization patterns for Hamilton including async I/O, Spark, Ray, Dask, caching, and multithreading. Use for scaling Hamilton workflows.
hamilton-observability
Hamilton UI and SDK patterns for tracking, monitoring, and debugging dataflows. Use for observability, lineage tracking, and production monitoring.
hamilton-mcp
Interactive Hamilton DAG development via MCP tools. Validate, visualize, scaffold, and execute Hamilton pipelines without leaving the conversation. Use when building or debugging Hamilton dataflows interactively.
hamilton-llm
LLM and AI workflow patterns for Hamilton including RAG pipelines, embeddings, vector databases, and prompt engineering. Use for building AI applications with Hamilton.
hamilton-integrations
Hamilton integration patterns for Airflow, Dagster, FastAPI, Streamlit, Jupyter notebooks, and other frameworks. Use when integrating Hamilton with other tools.
hamilton-dev-workflow
Systematic 5-step workflow for building Hamilton DAGs - DOT graphs, signatures, validation, TDD implementation. Use this workflow when creating new Hamilton modules from scratch.