feat(mdl): alter microflow target resolver and describe … with handles - #730
Merged
Merged
Conversation
Start of mfmutator (mdl/backend/mfmutator), alongside pagemutator and
wfmutator: a content-addressed target resolver over the stored microflow
object collection (ADR-0012 decision 2, proposal item 4.2a).
A target addresses an activity by output variable ($Lines), by caption
('Email is valid?'), or by statement pattern with * wildcards
(commit $Order *), optionally with an @n ordinal. A target matching more
than one activity is an error listing each match with its ordinal; the
resolver never guesses. Patterns match the statement as describe prints
it and as it is stored, since describe negates an if whose then-branch
is empty.
describe microflow M.X with handles prints "-- handle: <target>" above
each activity. The handles are comments; removing them leaves the plain
description (tested as a control).
Tested on Studio Pro-authored FeedbackModule.VAL_Feedback via
MXCLI_PEDAPP_MPR until the PedApp fixture lands (#703).
Refs #713, #714
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Activities inside an `on error { … }` block were rendered by a second
describer that never wrote the source map, so describe … with handles
printed no handle for them and the resolver counted them after the whole
main flow. On PedApp's SUB_Feedback_PostToAppInsights, `return * @1`
picked `return $Response` although describe prints the handler's
`return empty` first: an ordinal a reader counted selected another
activity.
The handler traversal now reports each object's statement span and the
emitters record it (also in the ELK sourceMap, additively).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The output-variable switch was a copy of actionOutputVariableName and had drifted from the formatter: a REST call whose result is on its result handling (PedApp's $Response), a cast, create list, web service call, REST operation call, database query, XML/JSON and workflow actions all print `$X = …` yet `$X` found nothing. It now reads the variable where describe does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe prints an activity it cannot render as `-- Unsupported …`. Used as a statement, that became the handle `-- handle: -- Unsupported action type: …`, which the lexer swallows as a comment when pasted into an alter target, and `*` matched it. Such an activity is now addressed only by its variable or caption, or listed in an ambiguity error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 tasks
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.
Closes #713. This is the first step of
alter microflow(plan item 4.2a, ADR-0012 decision 2).What it adds
mdl/backend/mfmutator: a content-addressed target resolver that works on the stored object collection, loop bodies included. A target can be:$IsValidEmail),'Email is Valid?'),*matches any run of words.Any of them can end in
@n. When there is no match, the error gives hints. When several activities match and no@nis given, the error lists them (<target> @n -- <statement> at (x, y)); it never guesses.describe microflow M.X with handlesprints-- handle: <target>above each activity. The handles are comments, so the output still runs unchanged. Every handle is checked by resolving it back. It refuses to combine withnormalized.Design choices (not settled by the ADRs)
$Varonly means an output variable, and a quoted string only means a caption.commit $Orderdoes not matchcommit $Order with events; writecommit $Order *.$variablesand string literals match exactly.ifs with a negated condition.with handlesandnormalizedcannot be combined.Tests
mdl/backend/mfmutatorand in executor tests on the mock backend. They cover each address form, ambiguity errors, ordinals, whole-statement matching, the round trip from handle to activity, and a control showing that output minus the handle lines equals plain describe.FeedbackModule.VAL_Feedback(gated byMXCLI_PEDAPP_MPRuntil Round-trip harness: describe → exec on the Studio Pro PedApp fixture must write nothing #725's fixture lands):set $ValidFeedback = falseis refused, listing its three matches;@positionfollows them.SetPrintedbreaks the resolver and negated-if tests;Checks run
main(after skills: choose the edit mode by document owner (#711) #723, fix(mdl): refuse throw, float/currency/date and the parenthesised association; warn on unstored index names and enum-value docs #724 and fix(describe): round-trip quoted strings, MCP blocks, workflow captions; stop printing secrets (#707) #728).make buildpassed.make lintpassed (Go and TypeScript).go test ./... -timeout 45mpassed in every package, withMXCLI_PEDAPP_MPRpointing at a pristine PedApp.Follow-ups
insert/replace/dropstatements on the genericalter(Generic alter <type> X { set / insert / replace / drop } with per-doctype target resolvers #712).describe nanoflow … with handles.testdata/pedapponce Round-trip harness: describe → exec on the Studio Pro PedApp fixture must write nothing #725 merges.renderMicroflowMDLis off by the number of prepended warning lines.🤖 Generated with Claude Code