# Bone Flow #119 State — Specification v1.0

Package: 1.0.26  
Runtime: BoneState 1.0.0  
HTML Functional Class Runtime: 1.0.4  
HTML Functional Class: `bf-state`  
Status: Development Candidate / NOT Specification Frozen

## 1. Responsibility

#119 State manages **the current semantic state of a Target UI / Part**. The Development Order values `Normal / Hover / Focus / Active / Disabled / Selected / Checked / Error` are representative examples, not a closed enum. Safe custom semantic state tokens are allowed by the Runtime contract.

#119 answers: **What state is this Target UI / Part in now?** It holds Current State, Previous State, Relation metadata, change notification, and an OUT state payload. It does not absorb Trigger, Timeline, KeyFrame, Animation, Transition, or visual Effect responsibilities.

## 2. Usage model

1. identify Target UI and optional Target Part KEY
2. set or update Current State
3. downstream logic reads the State from Runtime state/output/change notification

The Preview may visualize a State so a human can see the change, but the border/opacity/error appearance shown by that Consumer example is not a BoneState rendering responsibility.

## 3. State Relation

A State relation holds `stateUiNo`, `targetUiNo`, `targetPart`, `currentState`, `previousState`, and `relationKey = stateUiNo::targetUiNo::targetPart`.

The resolved Target/Part reflects the current state through `data-bf-state` while attached. The `bf-state` controller and Target UI remain separate elements.

### Relation Image rendering

State semantics remain #119 responsibility. The **Relation Image presentation** uses the formal #002 Bone Joint v1.1.36 Runtime for connection judgment/line/endpoint/error-marker rendering:

- `BoneJoint.evaluate()`
- `BoneJoint.drawLine()`
- `BoneJoint.drawError()`

Three technical cases are shown:

1. attached relation
2. missing Target UI — `TARGET_UI_NOT_FOUND`
3. missing Target Part — `TARGET_PART_NOT_FOUND`

Independent CSS pseudo-lines or custom error X markers are not used as the formal relation rendering.

## 4. HTML Functional Class

Normal-use class: `bf-state`.

```html
<div class="bf-state"
     data-state-ui-no="UI-119-001"
     data-target-ui-no="UI-042-001"
     data-target-part="whole"
     data-state="Error"></div>

<button data-ui-no="UI-042-001">Save</button>
```

`bf-state` is the State Relation Controller, not the Target UI itself. Arbitrary CSS selector targeting is not the normal relation contract. Missing UI/Part resolution is an explicit error.

The test page keeps only a compact live Functional Class sample and bottom `HTML Functional Class` bar. Detailed attributes and usage belong to the Operation Guide.

## 5. Untrusted IN / Security Test

Security Test is isolated from the normal Preview. It rejects invalid/selector-like state tokens, non-string state input, invalid Target UI tokens, and accessor/getter payloads without intentionally executing the accessor. A rejected input preserves the previous semantic state.

Security validation uses its own #119 instance. The **Security relation path and BLOCK error marker are rendered by #002 Bone Joint v1.1.36** using `drawLine()` and `drawError()`; this does not move security validation responsibility into Joint.

## 6. OUT WAIT / FIFO / BLOCKED

#119 provides the semantic State OUT payload. WAIT/FIFO/BLOCKED delivery behavior is delegated to #002 Bone Joint v1.1.36 delivery support rather than reimplemented as a #119 queue/retry subsystem.

Formal visible behavior:

- WAIT: Target BUSY → connection remains established → queue → #002 WAIT spinner → Target READY → FIFO delivery → READY
- BLOCKED: connection remains established → #002 blocked marker (`fa-ban` / `beat-fade`) → blocked payload is not delivered → clear block returns READY

The visible test uses real BoneJoint paths/markers. Custom substitute spinner/ban icons are not accepted as the formal result.

## 7. Smoke / Validation

Initial status is `NOT RUN`. Smoke-only does not mean Runtime ALL PASS. Runtime overall ALL PASS requires both Smoke and Validation to execute with zero failures.

Formal runner-facing controls/status IDs:

- `run-smoke-test`
- `run-validation`
- `run-all-tests`
- `clear-test-results`
- `save-report-json`
- `save-report-md`
- `overall`
- `smoke-status`
- `validation-status`
- `runtime-version`

Smoke/Validation verifies Runtime identity, open semantic states, `bf-state` separation from Target UI, real #002 State Relation rendering, isolated Security relation rendering, WAIT/FIFO/BLOCKED single visible live stage, no duplicate IDs, required APIs, and Completion gates.

## 8. Completion

Browser Completion requires Runtime QA ALL PASS and the required visual confirmations. Assistant-side static/Node checks are not user localhost confirmation. `Completed / Specification Frozen` must not be declared before explicit user confirmation.

## 9. Packaging boundary

Package 1.0.26 is a **standalone #119 package**. It does not bundle or overwrite:

- `boneflow/test/bone-development-order.html`
- `index.html`
- frozen Component files

The cumulative regression runner is a separate work item after #119 standalone verification.
