Skip to content

Add os-select and os-toggle widget contracts with thin Playwright handlers#35

Open
danielbdyer wants to merge 1 commit into
mainfrom
codex/grow-widget-support-and-handlers
Open

Add os-select and os-toggle widget contracts with thin Playwright handlers#35
danielbdyer wants to merge 1 commit into
mainfrom
codex/grow-widget-support-and-handlers

Conversation

@danielbdyer
Copy link
Copy Markdown
Owner

Motivation

  • Expand runtime widget coverage for high-frequency families (selects and toggles) by codifying domain contracts so capability derivation and resolution use typed semantics instead of ad hoc heuristics.
  • Keep runtime handlers Playwright-specific and intentionally thin to avoid domain leakage while preserving stable execution receipts and degraded-locator signaling.
  • Provide test coverage and authoring guidance so knowledge authors map affordances to contracts consistently.

Description

  • Added two domain WidgetCapabilityContract entries: os-select and os-toggle, and registered them in the contract registry (lib/domain/widgets/contracts.ts).
  • Implemented minimal Playwright-only handlers osSelectHandlers and osToggleHandlers (lib/runtime/widgets/os-select.ts, lib/runtime/widgets/os-toggle.ts) and wired them into the runtime handler registry (lib/runtime/widgets/index.ts).
  • Updated discovery mapping so combobox/select inputs resolve to os-select and checkbox/radio/switch resolve to os-toggle, and aligned supported-action mappings (lib/domain/discovery.ts).
  • Ensured engage/enter flows include structured metadata in execution receipts by returning locatorStrategy, locatorRung, and widgetContract for enter outcomes in addition to observed effects (lib/runtime/engage.ts).
  • Added focused contract-first and runtime tests exercising affordances/preconditions, failure-mode stability, degraded locator rung semantics, select execution metadata, and toggle mutation behavior (tests/widget-contracts.spec.ts, updates to tests/runtime-errors.spec.ts).
  • Updated authoring guidance to map common affordances to the new widget contracts and refreshed generated type projections so widget unions and supported-action maps include the new families (docs/authoring.md, regenerated lib/generated/tesseract-knowledge.*).

Testing

  • Ran npm run types to regenerate types and projection artifacts and it completed successfully.
  • Ran targeted tests npm test -- tests/widget-contracts.spec.ts tests/runtime-errors.spec.ts and observed all tests in that run passed (15 passed).
  • Ran the full test suite with npm test and observed the suite complete successfully with the test summary showing 118 passed, 2 skipped.

Codex Task

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