Skip to content

Procedure step safety fields, execution target entity, tier-2 tooling auto-sync #6

Description

@CST-100

Summary

Three additive data-model gaps plus one logic rule, backported from an internal operations portal being consolidated into OPAL:

  1. ProcedureStep.caution (TEXT, nullable) — safety warning rendered prominently (red callout) in the step editor and during execution.
  2. ProcedureStep.required_role (VARCHAR(50), nullable) — informational role badge on a step (e.g. QE, MFG-LEAD). Does not gate execution.
  3. ProcedureInstance.target_entity (JSON, nullable) — pins an execution to a specific entity being worked on, e.g. {"entity_type": "part", "entity_id": 42, "entity_label": "SN-00042"}. Rendered as a badge on the execution Meta tab and settable from the new-execution form.
  4. Tier-2 → tooling auto-sync — creating a Part with tier=2 forces is_tooling=true regardless of submitted value (API create, bulk import, and MCP create_part).

Scope

  • Alembic migration (3 nullable columns, no defaults)
  • ORM models, API schemas/handlers, version-snapshot inclusion of the new step fields in publish_version
  • Web: step editor inputs, execution runner caution callout + role badge, Meta tab entity badge, new-execution target entity section
  • MCP: add_procedure_step gains required_role/caution
  • Tests for all of the above

All changes additive; no existing behavior altered. Published-version immutability is preserved — new fields ride along in the snapshot content blob.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions