Skip to content

Confluence import: app layer, worker, and state machine - #34

Draft
Willyfrog wants to merge 1 commit into
stack/3-storefrom
stack/4-app
Draft

Confluence import: app layer, worker, and state machine#34
Willyfrog wants to merge 1 commit into
stack/3-storefrom
stack/4-app

Conversation

@Willyfrog

@Willyfrog Willyfrog commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Layer 5 of 7 in the Confluence page import stack, split out of #18. The design narrative and the accepted risks live in #18 — read it first; this PR is one layer of it.

Stack order: #30#31#32#33#34#35#36

The orchestration core: admission, preflight, confirmation, execution, retry, terminalization, and cleanup. This is the layer with the most behaviour per line and the one that most deserves a senior reviewer.

What's here

import.go, import_preflight.go, import_confirm.go, import_execute.go, import_provision.go, import_retry.go, import_report.go, import_cleanup.go, plus service.go and ws_events.go wiring.

What to look for

  • Nothing is written before the user agrees to it, and the agreement names a specific plan revision. A confirmation for a revision that no longer describes the source must be refused and the job requeued for re-review — check the revision comparison can't be satisfied by a stale-but-equal value.
  • Bounded, paced retries. A failing job steps aside so unrelated imports proceed; one that keeps failing is failed with a report rather than retried forever. Critically: a pass that committed pages must not spend an attempt. A regression here already broke same-source serialization once (retry cooldown).
  • Unified terminalization — every path out of the state machine goes through it, so "job ended without a report" should be unrepresentable. Try to find a path that isn't.
  • Retained accounting — mandatory per-entity outcomes are reserved up front so an admitted job can always record what happened to every page. Check an admitted job can't exhaust the budget mid-run.
  • The HA risk is accepted and stated in Confluence page import: importer, worker, execution, reports, and wizard #18: a second node would requeue this node's in-flight preflight repeatedly. V1 is single-node by design. Worth re-reading that argument here rather than re-litigating it.

Verification

go build ./..., go vet ./... clean. server/app suite green.

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