Skip to content

feat(forge): ForgeRecipeEntity + ForgeArtifactEntity + registry hookup (#1164 Phase 3)#1180

Merged
joelteply merged 1 commit into
canaryfrom
feat/forge-entity-classes-and-registry
May 14, 2026
Merged

feat(forge): ForgeRecipeEntity + ForgeArtifactEntity + registry hookup (#1164 Phase 3)#1180
joelteply merged 1 commit into
canaryfrom
feat/forge-entity-classes-and-registry

Conversation

@joelteply
Copy link
Copy Markdown
Contributor

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 on recipeId + unique-indexed alloyHash for content-addressable lookup. Collection: forge_artifacts.
  • EntityRegistry.ts — imports + instantiates + registers both entity classes alongside the existing entity bulk.
  • shared/generated/entity_schemas.json regenerates: 55 → 57 entities, sha 8cf44380640f → d5c1cff2a1ed6a6c.

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. 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 plan

🤖 Generated with Claude Code

#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 joelteply merged commit b40a39f into canary May 14, 2026
4 checks passed
@joelteply joelteply deleted the feat/forge-entity-classes-and-registry branch May 14, 2026 16:13
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant