Skip to content

Wire visual regression & state-machine engine through all layers#212

Merged
JE-Chen merged 3 commits into
devfrom
feat/visual-regression-state-machine
Jun 18, 2026
Merged

Wire visual regression & state-machine engine through all layers#212
JE-Chen merged 3 commits into
devfrom
feat/visual-regression-state-machine

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

Two headless cores existed in utils/ but were never exposed past their
own package — no facade re-export, no AC_* command, no MCP tool, no GUI —
in violation of the project's "every feature ships headless + AC_ + GUI"
rule. This completes both.

Visual regression (golden images)

  • Facade: take_golden, compare_to_golden, image_difference,
    DiffResult, MaskRegion.
  • AC_take_golden — capture a baseline; AC_assert_visual — compare the
    screen to a golden, auto-creating the baseline on first run, saving a
    diff image on mismatch, and raising like every other AC_assert_*.
  • MCP: ac_take_golden, ac_assert_visual. Script Builder entries.

Finite-state machine

  • Facade: run_state_machine, StateMachine, StateMachineError.
  • AC_run_state_machine runs a declarative {initial, states} spec whose
    on_enter actions execute through the executor; transitions fire on
    after / if_var_eq / predicate guards, bounded by max_steps /
    global_timeout_s.
  • MCP: ac_run_state_machine. Script Builder entry.

Testing & docs

  • New headless tests inject PIL images / specs — no real screen needed.
  • v6 reference page (EN + Traditional Chinese) + README sections.
  • ruff / bandit clean; import je_auto_control stays Qt-free; no
    orphan Script Builder commands.

Independent of #211 (touches different files / different doc regions).

Two headless cores existed but were never exposed past their package, in
violation of the project's "every feature ships headless + AC_ + GUI"
rule. Complete them:

- Visual regression: facade re-export of take_golden / compare_to_golden /
  DiffResult / MaskRegion; AC_take_golden and AC_assert_visual executor
  commands (assert auto-creates the baseline on first run, saves a diff on
  mismatch, raises like other AC_assert_*); ac_take_golden /
  ac_assert_visual MCP tools; Script Builder entries.
- State machine: facade re-export of run_state_machine / StateMachine /
  StateMachineError; AC_run_state_machine command; ac_run_state_machine
  MCP tool; Script Builder entry.

Adds headless tests (PIL images / specs injected) and a v6 new-features
reference page (EN + Traditional Chinese) plus README sections.
@codacy-production

codacy-production Bot commented Jun 18, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 30 complexity · 2 duplication

Metric Results
Complexity 30
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

JE-Chen added 2 commits June 19, 2026 01:21
Compare the floating-point diff_pct via pytest.approx instead of exact
equality so SonarCloud's reliability gate stays green.
…-state-machine

# Conflicts:
#	je_auto_control/__init__.py
@JE-Chen JE-Chen merged commit 1587661 into dev Jun 18, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/visual-regression-state-machine branch June 18, 2026 17:46
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant