Skip to content

Runs the upgrade host's cascade over a child - #231

Merged
johnnyt merged 1 commit into
mainfrom
se-u6hl-upgrade-host-cascade-child
Oct 11, 2026
Merged

johnnyt merged 1 commit into
mainfrom
se-u6hl-upgrade-host-cascade-child

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 11, 2026

Copy link
Copy Markdown
Member

The upgrade host's cascade test failed a loan and ran
Executions.cascade_cancel/3 over it, but the loan document opens no
subchart, so the answer {:ok, 0} and the :no_linkage read would also
hold if the cascade did nothing. A later bump step that changed the
cascade or the linkage reads would not have been caught.

What changes

  • upgrade_host/test/support/loan_with_notice.ex (new, test support): a
    second loan document whose core.subchart names an overdue-notice
    document (which waits for notice.sent), the
    StatifierBlocks.Runtime.DurableSubchart host callbacks that resolve
    it, and a StatifierPersistence.Driver over the host's own store.
  • upgrade_host/test/upgrade_host/loan_test.exs: a new test opens such
    a loan through Driver.create/3, finds the notice through
    Linkage.parent_match/1, reads its linkage back through
    Linkage.from_metadata/1 and Driver.parent_link/2 (the parent id,
    the invoke id, the child index, the content hash, the derived child id), fails the
    loan with Executions.fail/3, checks the notice is still active, and
    asserts Executions.cascade_cancel/3 answers {:ok, 1} and leaves the
    notice :cancelled; a second run answers {:ok, 0}. The existing
    no-child test stays as it was, with its comment pointing at the new
    one.
  • upgrade_host/README.md: one bullet under "What it holds" for the
    loan with a child execution.

No file under lib/ changes, and the upgrade host's exact pins in
upgrade_host/mix.exs and its mix.lock do not move.

Sabotage

Each mutation was applied, the test run, and the file restored
byte-equal (a dependency mutation recompiled the dependency for the
test env before and after):

  • the cascade counted each child without cancelling it
    (statifier_persistence's cancel_counted): red, the notice was still
    active after the cascade;
  • Linkage.from_metadata/1 read a key the package never writes: red, the
    notice's linkage read :no_linkage;
  • the driver's dispatch answered :pending without starting a child:
    red, the loan had no child.

Gate

Both gates green on the branch: the root mix quality, and from
upgrade_host/ the CI job's steps (mix deps.get --check-locked,
mix compile --warnings-as-errors, mix test against Postgres).

Provenance

Exercising the cascade over a loan with a child, with a README limit
only as the fallback, was decided by the conductor under a standing
consent, 2026-10-10. The bounded attempt fitted inside the test support
with no package change, so the fallback was not taken. No record text
changes in this PR.

The cascade test failed a loan with no child, so its {:ok, 0} would
hold even if cascade_cancel did nothing. A second loan document in the
test support opens a core.subchart for an overdue notice, driven
through StatifierPersistence.Driver and DurableSubchart; the new test
reads the notice's linkage, fails the loan from outside, and asserts
the cascade cancels the notice. The upgrade host's pins do not move.

Refs: se-u6hl
@johnnyt
johnnyt merged commit bf96e54 into main Oct 11, 2026
4 checks passed
@johnnyt
johnnyt deleted the se-u6hl-upgrade-host-cascade-child branch October 11, 2026 14:47
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