Runs subcharts: registers the canonical handler - #40
Merged
Conversation
Registers `statifier_blocks:subchart` with a resolver over this app's own fixture list, which retires the standing Findings-1 warning on `signup_invitations`: both fixtures that name a child chart now compile with no unregistered-handler finding at all. The registration is a union rather than one list. The sync adapter's `use` moves to `StatifierExamples.Charts.SyncAdapter` because the macro writes `invoke_types/0` and `invoke_handlers/0` over its own handlers, and the subchart handler is not a sync call; `Charts` joins the two. `StatifierExamples.Charts.Subchart` supplies the package's two host callbacks - a document-id lookup over the fixtures, and the palette. `signup_onboarding` is the new fixture: a parent that embeds the wizard as a `core.subchart` and routes on the outcome. One level deep, because a child session is started without the parent's invoke handlers (st-pvpz), which the tests assert over the shipped set. A created run records the child chart each subchart resolved to, keyed by document id, beside the fixture key - the host-provenance pin `StatifierBlocks.Core.Subchart` names, since a document id is stable across every revision of the child. A durable run refuses a subchart by name: starting a child chart has no executor in the durable driver, and durable subcharts are a follow-up. The demo script gains the two beats, read off a real run. Moves the statifier_blocks pin to the commit carrying the handler. Refs: se-4dt.4
The registry comment beside `Statifier.Supervisor` still said the adapter is generated into `StatifierExamples.Charts` and that the module is this app's one `Statifier.Invoke.Handler`. Since se-4dt.4 the generated adapter lives in `StatifierExamples.Charts.SyncAdapter`, and `StatifierExamples.Charts` joins it with `StatifierExamples.Charts.Subchart`. Prose only. Refs: se-4dt.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provenance
se-4dtuptake epic).chart identity, written at run create. Ruling R-b's closed refusal set
is the package's, and is what the
unknown_documenttest reads.R-e (durable subcharts) is out of scope and is what the durable
refusal below defers to.
mainatda66f44, which carries E1-E3 and E6(PRs Declares the step types on the upstream base #36, Moves the invoke handlers onto SyncHandler #37, Moves the drive loop onto the upstream driver #38, Marks the disabled Run button as disabled #39). No rebase conflict; nothing here reopens a file
a sibling rewrote.
statifier_blocksPR #197 (sb-6edf), the canonicalStatifierBlocks.Runtime.Subchart.Pin
The
statifier_blocksgit pin moves 957ea91 -> 487cebf (sbmain, thecommit documenting the shipped subchart handler). It is the fourth INTERIM
pin this dep has carried; the FINAL re-pin to a Hex requirement happens at
the operator's publish, per the se-p22 pattern.
mix.lockand the pin test'sexpectation move with it. No other dep line is touched.
What landed
StatifierExamples.Charts.Subchartusesthe package's
StatifierBlocks.Runtime.Subchartand supplies this host'stwo callbacks:
resolve_chart/2, a document-id lookup overCharts.fixtures/0, andpalette/0.usemoved.Statifier.Invoke.SyncHandler.Adapterwritesinvoke_types/0andinvoke_handlers/0as plain definitions over its own handler list, so amodule that
uses it cannot also state a union including something thatlist does not hold. The
usenow lives inStatifierExamples.Charts.SyncAdapterandChartsjoins the sync halfwith the subchart handler. The engine still writes the adapter; se-4dt.2's
uptake is intact.
priv/fixtures/signup_onboarding.json(
bdoc_su_onboarding_demo): a parent whose onecore.subchartnames thewizard's document id and routes
done/abandon/error.subchartskey -%{document id => content hash}- beside the existingfixturekey. Acore.subchartnames its child by document id, which is stable acrossevery revision of that child, so without this the record says nothing
about which revision ran. This is the host-provenance concern
StatifierBlocks.Core.Subchart's moduledoc names in as many words.real run rather than composed.
The retired warning (before / after)
Before, on
mainatda66f44, compilingsignup_invitationsthroughCharts.Durable.compile/2:After, on this branch, the same call:
warnings: []. Both fixtures that namea child chart (
signup_invitations,signup_onboarding) compile with nounregistered-handler finding at all, which
InvokeRegistryTestasserts over the pair. The test that used torefutethe registration is rewritten to the new truth rather than deleted, with the
old reading quoted in its comment.
Two limits, both reported rather than worked around
Statifier.Sessionstarts a child session withinvoked_by:, a seeded datamodel and the parent's observer options, andnot with the parent's
:invoke_handlers- filed upstream asst-pvpz. So a child chart's own
<invoke>s reach a session with nohandler for them,
myapp:*calls included. The wizard child thereforestarts and sits at its first step; it cannot finish inside the parent, and
a nested subchart would not run at all. The fixture is written to that
limit, says so in its own description, and a test walks the shipped set to
prove no document used as a child names a subchart of its own. This is the
engine's to fix, not this app's to route around (CLAUDE.md's reference-embedder
rule).
{:start_child, _, _}is executed byStatifier.Sessionand by nothing else; the durable driver performs an<invoke>through this app'sdispatch:fun, which routes sync handlers.So
Charts.dispatch/3refuses the type as{:error, {:durable_subchart_unsupported, type}}rather than letting itfall through to
:unknown_invoke_type, which would be untrue in the waythat matters to a reader of the feed - the type is registered, and a
session answers it. Durable subcharts are ruling R-e's follow-up. The
widened refusal shape surfaced in
Durable.reason/1exactly where thatfunction's own comment predicted it would.
LOC delta
lib/test/docs/,priv/,mix.*Net-positive, unlike E1-E3: this child adds a capability rather than moving
plumbing upstream. The
lib/half is 178 lines of new handler module, 43 ofadapter relocation, and the rest moduledoc on two seams that did not exist.
Gate
Full
mix qualitygreen on this HEAD: format, compile (warnings as errors),credo, dependencies, dialyzer, 225 of 225 tests, 75.6% coverage (floor 70).
Doctor, Sobelow and Gettext are the manifest's declared
not-applicable skips. Every new test was sabotaged by hand and shown red;
the mutations are noted above each one.