Resolve {{manual.NAME}} instead of leaving it as literal text - #218
Merged
Conversation
Every trigger seeds its event data into the run under the manual.* namespace, and
{{manual.NAME}} is the form the README's trigger table, docs/claude-reference.md,
the workflow styleguide, the designer's variable picker, the ForEach hint and the
AI prompt catalog all tell authors to write. The resolver had no pattern for it.
StepPattern cannot match it either -- the tail after the dot is a user-chosen
name, not one of its four fixed property tails -- so the placeholder survived
resolution untouched AND slipped past the T-7.1 unresolved check, which scans
step patterns only. The step then reported success having written the literal
where the value belonged. Measured against a 1.2.6 install: a log activity
rendered "A={{manual.ziel}}" and finished green while {{trg.param.ziel}} on the
same run resolved correctly, and the documented forEach pattern (read the item as
{{manual.item}} in the child) never saw its item.
ManualPattern joins GlobalsPattern as a namespace pattern: a flat name lookup in
the JSON-config pass, the plain-string pass and the PowerShell script path, so
runScript and custom activities get the value with their usual quoting. The
config resolver now receives the run's input parameters, which it previously was
never given.
A surviving {{manual.X}} is fatal with its own diagnostic ("Unknown trigger
input(s)") rather than being reported as a missing step, which would send the
author looking for a node that was never meant to exist.
The MCP analyzer already treated manual.* as resolvable, so the engine was the
odd one out; no analyzer change was needed.
| [Fact] | ||
| public async Task ManualParameter_ResolvesInActivityConfig() | ||
| { | ||
| var (captured, engine, db, conn) = Harness("log"); |
| [Fact] | ||
| public async Task ManualParameter_AndTriggerParamForm_AgreeOnTheValue() | ||
| { | ||
| var (captured, engine, db, conn) = Harness("log"); |
| [Fact] | ||
| public async Task UnknownManualParameter_FailsTheStep_WithItsOwnDiagnostic() | ||
| { | ||
| var (_, engine, db, conn) = Harness("log"); |
| [Fact] | ||
| public async Task ManualParameter_ReachesTheScriptBody() | ||
| { | ||
| var (captured, engine, db, conn) = Harness("runScript"); |
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.
Problem
Every trigger seeds its event data into the run under the
manual.*namespace, and{{manual.NAME}}is the form we tell authors to write — the README trigger table (for all six trigger types),docs/claude-reference.md,docs/workflow-designer-features.md,docs/workflow-styleguide.md, the docs site, the designer's variable picker, the ForEach config hint, and the AI prompt catalog (src/NodePilot.Ai/Prompts/activity-reference.md).The resolver had no pattern for it.
StepPatterncannot match it either — the tail after the dot is a user-chosen name, not one of its four fixed property tails — so:The step then reported success having written the literal where the value belonged. Measured against a 1.2.6 lab install, in one run:
The documented
forEachpattern is hit directly: the UI tells the author to read the loop item as{{manual.<itemParameterName>}}in the child workflow, and the child never saw its item while reporting 3/3 succeeded.Change
ManualPatternjoinsGlobalsPatternas a namespace pattern — a flat name lookup — applied in:ResolveVariables), JSON-escaped like globals;ResolveStringValue), which also coverstargetMachineId/credentialId;PowerShellActivitySupport), sorunScriptand custom activities get the value with their usual context-aware quoting.ResolveConfigForExecutionnow receives the run's input parameters, which it previously was never given.A surviving
{{manual.X}}is fatal with its own diagnostic — "Unknown trigger input(s) — this run carries no such value" — instead of being reported as a missing step, which would send the author looking for a node that was never meant to exist.{{manual.output}}(a trigger input named like a step tail) overlaps both patterns over the same span; the script path's overlap dedupe now covers that the same way it already covered{{globals.output}}.The MCP analyzer already treated
manual.*as resolvable, so the engine was the odd one out — no analyzer change needed, andTemplateGrammarParityTestsis unaffected (StepPatternis untouched).Tests
tests/NodePilot.Engine.Tests/Execution/ManualParameterResolutionTests.cs— 4 end-to-end cases: resolves in config; agrees byte-for-byte with the{{trg.param.X}}spelling in the same run; an unknown input fails the step with the new diagnostic; the value reaches arunScriptbody.Ran:
dotnet test tests/NodePilot.Engine.Tests— 1836 passed.Docs
CLAUDE.md(databus contract now names all three patterns and the new failure mode),docs/claude-reference.md,src/nodepilot-docs-ui/content/concepts/data-bus.md. The rest of the documentation already described this behaviour — it just wasn't true yet.