feat(forge): ForgeRecipeEntity + ForgeArtifactEntity + registry hookup (#1164 Phase 3)#1180
Merged
Merged
Conversation
#1164 Phase 3) Phase 3 of continuum#1164 (design at FORGE-RECIPE-AS-ENTITY.md). TS-side entity classes that wrap the Rust ts-rs types from #1170 (Phase 1a) + register both with the data daemon's EntityRegistry so callers can CRUD forge recipes + artifacts via the standard data/* commands. What ships: - src/system/data/entities/ForgeRecipeEntity.ts — class extending BaseEntity, mirrors the ForgeRecipe Rust shape with field decorators (TextField, JsonField, NumberField). validate() checks required fields. Collection: 'forge_recipes'. - src/system/data/entities/ForgeArtifactEntity.ts — class extending BaseEntity, mirrors ForgeArtifact. ForeignKeyField on recipeId + unique-indexed alloyHash for content-addressable lookup. validate() checks lineage + execution-time fields. Collection: 'forge_artifacts'. - EntityRegistry.ts — imports both entity classes, instantiates each during initializeEntityRegistry() so the decorators register metadata, then registerEntity() with the collection name. Same pattern as the existing entity bulk. - shared/generated/entity_schemas.json regenerates with the two new collections (sha goes from 8cf44380640f to d5c1cff2a1ed6a6c, entity count 55 -> 57). Field naming subtlety: Rust 'version: string' (semver) collides with BaseEntity 'version: number' (ORM row version). Renamed to 'recipeVersion: string' on the entity to avoid the conflict + leave both cross-layer fields workable. Doc-comment notes the drift; Phase 2+ may rename the Rust field for cross-layer alignment. Validation: npm run build:ts clean. Hooks ran without --no-verify. Phase 4 (next slice): forge/run IPC handler that takes a recipeId, runs the foundry pipeline, persists the artifact via data/* commands. Card: continuum#1180.
joelteply
added a commit
that referenced
this pull request
May 14, 2026
ForgeModule + forge/run IPC handler. v1 stub: takes a ForgeRecipe + optional hardware_node label, returns a synthesized ForgeArtifact with the recipe lineage frozen + a sha256:stub-<id> alloy_hash marker. No models loaded, no stages executed, no HF publishing — Phase 5+ wires the real foundry executor. Caller persists the returned artifact via standard data/upsert against the forge_artifacts collection (Phase 3 #1180 wired the entity registration). What ships: - src/workers/continuum-core/src/modules/forge.rs — ForgeModule ServiceModule + synthesize_stub_artifact helper. - modules/mod.rs — pub mod forge. - ipc/mod.rs — register ForgeModule alongside the existing module bulk. Tests: 6 covering recipe lineage, distinct artifact id, canonical sha256:stub- hash format, hardware_node echo, empty hw_verified when no hw_node, Phase 5+ fields all None on the stub. Phase 4 stub semantics — this PR explicitly does NOT claim to forge anything. It proves the IPC reachability + recipe -> artifact transformation shape end-to-end. Phase 5 replaces the stub with the real Rust foundry executor. Card: continuum#NNN. Co-authored-by: Test <test@test.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 of continuum#1164 (design at FORGE-RECIPE-AS-ENTITY.md). TS-side entity classes that wrap the Rust ts-rs types from #1170 (Phase 1a) + register both with the data daemon's EntityRegistry so callers can CRUD forge recipes + artifacts via the standard
data/*commands.What ships
src/system/data/entities/ForgeRecipeEntity.ts— class extending BaseEntity, mirrors the ForgeRecipe Rust shape with field decorators.validate()checks required fields. Collection:forge_recipes.src/system/data/entities/ForgeArtifactEntity.ts— class extending BaseEntity, mirrors ForgeArtifact. ForeignKeyField onrecipeId+ unique-indexedalloyHashfor content-addressable lookup. Collection:forge_artifacts.EntityRegistry.ts— imports + instantiates + registers both entity classes alongside the existing entity bulk.shared/generated/entity_schemas.jsonregenerates: 55 → 57 entities, sha 8cf44380640f → d5c1cff2a1ed6a6c.Field naming subtlety
Rust
version: string(semver) collides with BaseEntityversion: number(ORM row version). Renamed torecipeVersion: stringon the entity to avoid the conflict. Doc-comment notes the drift; Phase 2+ may rename the Rust field for cross-layer alignment.Validation
npm run build:tsclean. Hooks ran without--no-verify.Phase plan
forge/runIPC handler (recipe → foundry → artifact persisted viadata/*)🤖 Generated with Claude Code