Skip to content

feat(act): port the ACT engine from jackinabox86's fork (#25 Phase C)#70

Merged
Zillatron27 merged 2 commits into
mainfrom
feat/act-engine
Jul 6, 2026
Merged

feat(act): port the ACT engine from jackinabox86's fork (#25 Phase C)#70
Zillatron27 merged 2 commits into
mainfrom
feat/act-engine

Conversation

@Zillatron27

Copy link
Copy Markdown
Owner

Summary

Ports the full ACT engine (~2,600 lines) from jackinabox86's fork — his adaptation of refined-prun's XIT ACT feature (MIT, © 2025 Dan Pavlides; per-file Ported from refined-prun attribution headers kept verbatim). This is #25 Phase C: the engine lands complete and tested but nothing imports it at runtime — bundle size is unchanged. Phase D wires up BurnActView/RepairActView/ActionRunnerPanel and the Settings UI.

Credit to @jackinabox86 for the working port this adopts, including the DOM gotchas and mobile workarounds already baked into it.

Commit 1 — logic core: _compat store adapter, act-registry, step generator, CX Buy / MTRA action logic, Resupply / Repair material groups, plus settings.autoConfirm (field only, default false).
Commit 2 — DOM layer: prun-css C.* resolver, select-dom globals, mobile buffer navigator, step machine, action runner, CXPO_BUY / MTRA_TRANSFER / OPEN_SFC action steps.

Adaptations from the fork

  • Materials come from the FIO reference store (stores/reference.ts) instead of the fork's WS-derived store — the engine only reads ticker/weight/volume, which MaterialInfo carries. Phase D should gate run-start on useMaterialsStore.getState().fetched.
  • waitActionFeedback is gated on settings.autoConfirm (default false). The fork auto-clicked APEX's post-ACT confirmation overlay; per the action-authorisation ruling the default now brings the hidden buffer on-screen and waits for the user to tap CONFIRM themselves (observing the overlay's class transition). The auto-click survives only behind the opt-in flag; its Settings toggle ships with Phase D.
  • Fixed two latent fork tsc errors (missing WarehouseLocation import; ambient $ missing the timeoutMs param) — the fork built through them, main gates on tsc --noEmit.
  • Stripped 13 debug console.logs; dropped port-session breadcrumb comments.

Testing

  • 580 tests pass (was 520): stage1 port + 7 new suites — _compat seam contract, step-generator WAR state, resupply/repair bill math, CX Buy fill/generateSteps (noBuy, warehouse inventory, partial fills), prun-css parsing, register-all (keeps the unreferenced engine executed under vitest), and the confirmation gate.
  • Mutation-verified: broken ticker-case normalization and forced auto-confirm each fail their tests.
  • npx tsc --noEmit clean; Chrome + Firefox builds green; bundle size unchanged (engine tree-shakes until Phase D).
  • Device validation of the DOM layer (brittle APEX selectors, WebKit focus behaviour) is deliberately deferred to Phase D when the views make it drivable.

Part of #25. Related: #28 (the fork implements it — Phase D), #31 (_compat is the pure-core/adapter seam).

🤖 Generated with Claude Code

Zillatron27 and others added 2 commits July 6, 2026 15:58
Ports the store adapter (_compat), registry, step generator, action/bill
logic, and material groups from https://github.com/jackinabox86/APXM —
an rprun XIT ACT port (MIT, Dan Pavlides; refined-prun attribution
headers kept verbatim). #25 Phase C, commit 1 of 2 (DOM layer follows).

Adaptations from the fork:
- materials adapter now reads the FIO reference store
  (stores/reference.ts getById) instead of the fork's WS-derived
  stores/entities/materials; the engine only consumes
  ticker/weight/volume, which MaterialInfo carries
- add the WarehouseLocation type import _compat was missing (the fork
  built through the latent tsc error; main gates on tsc --noEmit)
- settings.autoConfirm (default false) added for the step machine's
  post-ACT confirmation gate — opt-in per the action-authorisation rule,
  Settings toggle UI lands with the Phase D views
- dropped port-session breadcrumb comments

Tests: ports the fork's stage1 suite and adds compat (seam contract),
step-generator (WAR state), and bills (resupply/repair math) suites —
38 tests, materials-adapter case normalization mutation-verified.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Completes the #25 Phase C engine port (commit 2 of 2): prun-css C.*
resolver, select-dom globals, mobile buffer navigator, step machine,
action runner, and the CXPO_BUY / MTRA_TRANSFER / OPEN_SFC action steps.

Deviations from the fork:
- waitActionFeedback is gated on settings.autoConfirm (default false):
  the machine brings the hidden buffer on-screen and waits for the user
  to tap APEX's CONFIRM themselves, observing the overlay's class
  transition instead of clicking it. The fork's auto-click survives only
  behind the opt-in flag, per the action-authorisation rule.
- stripped 13 debug console.logs (cont-utils, MTRA_TRANSFER)
- ambient $ declaration gains the optional timeoutMs param selectWait
  actually takes (latent fork tsc error; main gates on tsc --noEmit)

Nothing imports the engine at runtime until the Phase D views land —
bundle size is unchanged; register-all.test.ts keeps the registration
graph executed under vitest meanwhile.

Tests: prun-css parsing, CX Buy fillAmount/generateSteps (noBuy, WAR
inventory, partial fills), register-all, and the confirmation gate
(mutation-verified: forcing auto-click fails both manual-path tests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
apxm 4ecf4df Jul 06 2026, 06:06 AM

@Zillatron27 Zillatron27 merged commit f51baba into main Jul 6, 2026
1 check failed
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