Skip to content

refactor: drop the unread backend field from Automation templates - #3334

Open
yihanzhu wants to merge 2 commits into
apache:mainfrom
yihanzhu:chore/drop-scheduled-task-template-backend
Open

refactor: drop the unread backend field from Automation templates#3334
yihanzhu wants to merge 2 commits into
apache:mainfrom
yihanzhu:chore/drop-scheduled-task-template-backend

Conversation

@yihanzhu

Copy link
Copy Markdown
Contributor

Summary

ScheduledTaskExecutionTemplate.backend is durable state nothing reads: the fire path builds the execution session without consulting it, and after #3249 session creation no longer accepts a backend from any caller. This drops the field from the template, stops copying header.backend in executionTemplateFromHeader — the writer that could still freeze a legacy 'fake' into a brand-new record (#3211) — and stops emitting it from the protocol decoder. No migration, the same position #3226 and #3249 took for session headers.

Fixes #3306

Review focus

The execution decoder is a closed shape, so backend moves from the required key list to the optional one instead of disappearing: Automations frozen by older builds still carry it and must stay decodable. The key is tolerated on the way in — all three directions (stored, create, update) — and never lands on the decoded value. BackendOrigin/isBackendFor lose their last caller and go with it.

Verification

  • @maka/core suite: 563 pass; @maka/runtime-host suite: 1024 pass; root format:check and lint pass
  • New regression: a template carrying backend: 'fake' decodes in all three directions and the decoded value never carries the key
  • Red state confirmed: with the source change reverted, the updated core test fails and @maka/runtime-host no longer compiles

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code (Fable 5) — implementation and tests, under my direction and review. The commit carries a Generated-by trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — new canonical Automation records and decoded templates no longer carry backend; stored records that do remain readable

🤖 Generated with Claude Code

yihanzhu and others added 2 commits August 20, 2026 08:49
ScheduledTaskExecutionTemplate.backend is durable state nothing reads:
the fire path builds the execution session without it, and after apache#3249
session creation no longer accepts a backend from any caller. Drop the
field from the template, stop copying header.backend in
executionTemplateFromHeader (the writer that could freeze a legacy
'fake' into a new record, apache#3211), and stop emitting it from the
protocol decoder.

The execution decoder is a closed shape, so the key moves from the
required list to the optional one instead of disappearing: Automations
frozen by older builds still carry it and must stay decodable. It is
tolerated on the way in and never lands on the decoded value. No
migration, matching apache#3226 and apache#3249 for session headers.

Closes apache#3306

Generated-by: Claude Code (Fable 5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pin the full decoded template shape with deepEqual instead of asserting
only the key's absence, and route the stored direction through the
query-result frame so the regression exercises the outermost decode
path.

Generated-by: Claude Code (Fable 5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

ScheduledTaskExecutionTemplate.backend is durable state nothing reads

1 participant