# Bone Flow #045 ToggleButton — Full Re-Audit

Date: 2026-08-18
Status: Development / Candidate Package

## Baselines
- #042 Button v1.0.12
- #035 Switch v1.0.6
- #040 ColorPicker v1.0.15
- #043 Link v1.0.1 (Action UI / Class Guide comparison only)
- #002 Joint v1.1.36 contract used by the test/runtime path

## v1.0.5 disposition
v1.0.5 is rejected. It is not canonical and is not a release base.

Confirmed defects in v1.0.5:
1. install.bat was a reduced non-formal wrapper and did not preserve the canonical installer structure.
2. install.ps1 omitted canonical target detection / backup / logging / installed-version verification structure.
3. HTML Functional Class bridge was only a thin invoke list; it did not preserve the formal marker / args / token / scan / bind / MutationObserver contract from #042.
4. Class Guide was incomplete compared with the formal #042 guide contract.
5. Guide CSS header was wrong: `#042 ToggleButton ... v1.0.12`.
6. Guide Live execution reused state incorrectly and could create duplicate visual ToggleButtons.
7. Guide `connectOutput` JavaScript example contained a meaningless guard expression (`out.value===true ? true : true`).
8. Documentation was materially thinner than the reference contract and did not describe the complete Functional Class behavior.

## v1.0.6 staging corrections completed

### Runtime / Property
- Five display patterns preserved exactly: standard / soft-rounded / text / icon / button.
- Active Effect and Mouse Over Effect remain separate and both expose normal / neon / spin / cross / blink, direction, speed, and #040 custom color.
- Active is focus/active only; ON=true does not activate Active Effect.
- ON / OFF / Thumb colors use click-to-open #040 Caller and allow solid + gradient.
- Parent / Effect color callers are solid-only.
- Parent / FIT / 9-way placement retained.
- No #019 Image / #039 FilePicker / #042 Button Runtime direct dependency was introduced.

### Security / Joint / Delivery
- Security sandbox remains independent from normal Preview and Delivery.
- boolean true/false ACCEPT; string / number / object / accessor BLOCK.
- accessor getter is not executed.
- Connection image contains five cases and calls BoneJoint evaluate/draw paths.
- OUT path uses #002 `createDeliveryChannel()` + channel `.deliver(output)`.
- WAIT queues two events; READY resumes FIFO.
- BLOCKED keeps connection and prevents Target delivery.

### HTML Functional Class / Guide
- Bridge rebuilt to the formal marker contract (`bone-html-class-use`).
- 29 Public API methods are exposed 1:1.
- Restored `data-bone-event`, `data-bone-args`, `data-bone-arg-N`, `data-bone-once`, `data-bone-append-result`, `data-bone-throw`.
- Restored token resolution: `$self / $event / $value / $checked / $text / $dataset / $files / $selector: / $id: / $global: / $handler:`.
- Restored scan / bind / MutationObserver behavior.
- Guide now has Overview + all 29 Class entries.
- Each Class entry shows API, purpose, timing, usage location, argument/type, allowed values, Default, HTML setup, execution method, actual result, Result/State, responsibility boundary, JavaScript example, HTML example, and Live Run.
- Guide Live Run uses a dedicated sandbox isolated from Preview / Security / Delivery.
- Fixed Guide state reuse: switching entries destroys/reset the previous Guide instance.
- Fixed `create` Live Run so it renders exactly one ToggleButton, not duplicates.
- Fixed `connectOutput` example to use a real boolean guard and state callback.
- Guide CSS header now correctly identifies `#045 ToggleButton ... v1.0.6`.

### Smoke / Validation / Completion
- Initial state remains NOT RUN.
- Smoke / Validation individual and all-tests execution retained.
- Runtime Console retained.
- JSON / Markdown report controls retained.
- Completion remains disabled until Runtime tests pass and WAIT/BLOCK visual confirmations are checked.
- Completion was not clicked during controlled browser verification.

## Checks actually executed after the latest Guide fix

### Syntax / Static
- runtime JS: PASS (`node --check`)
- HTML Functional Class JS: PASS
- Runtime Node test JS: PASS
- Class Node test JS: PASS
- extracted inline HTML JS: PASS
- HTML ids: 145, duplicate ids: 0
- literal `q('id')` refs: 114, unresolved: 0
- `<input type="color">` custom markup outside #040: 0
- runtime `.send(` delivery API: 0
- runtime BoneButton / BoneImage / BoneFilePicker direct references: 0

### Node
- ToggleButton runtime contract: 41/41 PASS
- HTML Functional Class contract: 17/17 PASS

### Controlled Chromium re-run
Using Chromium with the real staged #045 runtime/Class files and real #040/#022 JS/CSS, with controlled #001/#002/#017/#020 host stubs where required:
- #040 click-open gradient heading visible: PASS
- 8 gradient presets visible: PASS
- gradient selection returns GRADIENT_V1 and renders CSS gradient: PASS
- Parent caller gradient count: 0 (solid-only): PASS
- JP/EN Property round trip: PASS
- all 5 patterns visually distinct: PASS
- Active focus-only and Mouse Over independent: PASS
- FIT actual dimensions: PASS
- all Security cases: PASS
- five connection cases: PASS
- Guide Overview contract: PASS
- Guide nav count: 29
- all 29 Guide Live Runs: PASS
- Guide maximum live ToggleButton count per entry: 1
- Smoke / Validation: ALL PASS in controlled browser
- WAIT 3-second cycle / FIFO: PASS
- BLOCKED target non-delivery: PASS
- Completion remains uncompleted unless explicitly clicked: PASS
- page errors: 0

## Installer gate
The staged v1.0.6 installer has been restored to the canonical structure (UTF-8 batch wrapper, target detection, dependency version checks, backup, log, MANIFEST verification, copy/hash verification, installed HTML/JS/Guide version verification).

However this environment does not provide Windows `cmd.exe`, Windows PowerShell, or Wine. Therefore the actual Windows `install.bat` / `install.ps1` execution gate is **NOT RUN**.

At the user’s explicit request, a **candidate ZIP is generated** with this limitation disclosed. The Windows installer gate remains **NOT RUN**, so the package is not called Browser ALL PASS, Completed, Release Ready, or Specification Frozen.

## Browser Runtime / Completion
User localhost Browser Runtime: NOT RUN for v1.0.6.
Completion: NOT RUN.
Completed / Specification Frozen: NO.
