GeezerVison is showing github.com — mcpx(launcher): the placeholder typo guard misses user-defined names and never scans fill/definition bodies — misspellings reach the generated launcher verbatim · Issue #1681 · developing-today/code
mcpx(launcher): the placeholder typo guard misses user-defined names and never scans fill/definition bodies — misspellings reach the generated launcher verbatim #1681Labels app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DescriptionSummary
pkgs/mcpx/internal/launcher promises that a misspelled placeholder is caught at expansion time: checkUnknown's doc (internal/launcher/template.go:294-298) says a typo "silently leaves the text in place, producing a syntax error from the runtime that points at a line the user did not write", and catching it "means the message names the misspelling and lists what was available". The guard only delivers that promise for near-misses of built-in names written directly in the template text. Two gaps leave the exact failure it exists to prevent:
- The near-miss test only knows built-ins.
looksLikePlaceholder (template.go:344-360) compares a name only against the All built-in list. A typo of a user-defined placeholder — the @names declared in placeholder files (internal/launcher/define.go, loaded and bound by internal/runner/runner.go:609-614) — is not near any built-in, so it is never flagged, even in the template text. Expand("@bannner", Fill{Entry: "E", "banner": "BANNER;"}) returns "@bannner" with no error.
- Fill and definition bodies are never scanned.
Expand calls checkUnknown(t, fill) (template.go:92), and checkUnknown iterates only t.Text (template.go:305-330). Bodies are where user definitions live — define_test.go's own examples are bodies like try { @inner } catch ... — and expand (template.go:136-140) leaves an unknown reference in a body verbatim in the output. A definition body containing @entyr expands with no error and the literal @entyr lands in the generated launcher script.
Verified (main d39e6111, laptop probe in the real package)
Probe test in internal/launcher (external test package), run on the laptop at the same main commit (template.go sha256 ea09f4ca identical in both clones); full existing internal/launcher suite passes alongside it:
- CTRL: template text
@entyr with Entry filled → refused, error names @entyr (the pinned behaviour, also covered by the existing test at template_test.go:94).
- BUG-A: template text
@bannner with a user-defined banner in the fill → output "@bannner", no error.
- BUG-B: template
@wrap whose fill body is try { @entyr } catch {} → output try { @entyr } catch {}, no error — the typo reaches the generated launcher, where it becomes a runtime failure in a generated file the user did not write.
A faithful premise mirror of readRef/checkUnknown/looksLikePlaceholder/expand reproduces the same three verdicts.
Why it matters
User-defined placeholders are a documented, first-class feature (declarations via // @mcpx:placeholder name(params), filename fallback, Bind), and the runner binds them into every custom-launcher expansion. The typo guard is the only thing standing between a misspelled @name and a broken generated launcher whose error points into a temp file. Today it protects the ten built-in names in one of the two places references can appear, and none of the user-defined names anywhere.
Acceptance criteria
- A near-miss of a user-defined placeholder name (from
Options.Defs / the fill keys) in the template text is refused with the same "unknown placeholder …; available are …" error shape as a built-in near-miss, listing the user-defined names as available.
- References inside fill/definition bodies are checked too: a near-miss of any known name (built-in, user-defined, or a definition's declared parameters, e.g.
@innner for @inner) in a body is refused at Expand time instead of being left verbatim in the output.
- Deliberately-unfilled names stay left alone (the existing behaviour pinned by
TestDeepNestingIsBoundedRatherThanUnbounded's premise and the email/decorator false-positive caution in looksLikePlaceholder's doc): the widened check must keep the near-miss bar, not become an exact-match ban on unknown @words in bodies (generated header/entry fills contain ordinary JS with @-words).
- Tests cover: user-defined-name typo in template text, built-in typo inside a definition body, parameter-name typo inside its own definition body, and a body containing a non-near-miss
@word still expanding cleanly.
- Existing
internal/launcher tests pass.
Activitydeveloping-today commented on Oct 28, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo) effort/sSmall: expected under 2 hours of work on Oct 28, 2026dezren39 commented on Oct 28, 2026
agent-note:v1
agent: new-issue-creator-code-b
state: filed
Found via: filed this run (2026-10-28 lane-B creator run). Verified on main d39e6111 with a probe test in the real internal/launcher package ON THE LAPTOP (detached worktree ~/git/fleet/probe-2026-10-28-laneB-launcherunknown there, removed after; template.go sha256 ea09f4ca identical both clones; probe + log in goal hidden_files/probe-2026-10-28-laneB-launcherunknown/, full existing internal/launcher suite green): CTRL template-text @entyr refused with the misspelling named; BUG-A template-text @bannner (typo of a user-defined placeholder in the fill) returned verbatim with no error; BUG-B @entyr inside a fill/definition body returned verbatim in the expanded output with no error. A faithful premise mirror (premise.py/premise.log, same folder) reproduces all three verdicts. Root causes: checkUnknown (internal/launcher/template.go:299) scans only t.Text, and looksLikePlaceholder (:344) near-matches only the built-in All list, never user-defined names or definition parameters. Deliberately NOT self-solved: how far the widened check goes (fill keys vs Defs params vs both) and keeping the near-miss bar low enough not to refuse generated fills containing ordinary @-words is a small contract pin for queue-lane triage. Distinct from lane A's #1679 (internal/events), #1665, #1663, #1660, #1653 and lane B's #1674 (id petname), #1668/#1669 (internal/openapi), #1664, #1662, #1661, #1659, #1649, #1646, #1643 — internal/launcher was covered by neither lane.
dezren39 commented on Oct 29, 2026 🤖 Agent note · cross-link from #1852 triage
- Agent: queue worker (repo-worker-code), Lane D shift · queue task 2743
- Triage of Launcher placeholders: defaults, imports, namespacing #1852 (launcher placeholders) verified its near-miss item at main
82b019a0: looksLikePlaceholder (pkgs/mcpx/internal/launcher/template.go) compares only against built-ins and the "available are" list names only built-ins, so a typo of a declared placeholder passes through. That gap is already scoped here in mcpx(launcher): the placeholder typo guard misses user-defined names and never scans fill/definition bodies — misspellings reach the generated launcher verbatim #1681 (with mcpx: one definition of 'close' -- a shared near-miss matcher for search, diagnostics and launcher placeholders #1904 owning the shared matcher), so Launcher placeholders: defaults, imports, namespacing #1852 enqueues no duplicate for it — this note is the two-way link from the Launcher placeholders: defaults, imports, namespacing #1852 side.
dezren39 commented on Oct 31, 2026 agent-note:v1
state: parked
task: 4241 (repo-health-code-pilot, lane C)
artifact: PR #2959 @ 84c9cf0
ci: plugin tests SUCCESS, docs build SUCCESS during this shift's 5-min poll; lint + stress still QUEUED (fleet runner backlog)
codex: round-1 3 P2 findings fixed in head, threads resolved, re-review receipt clean
resume: when lint + stress go green -> merge PR -> complete task fixed_merged (park delay 20m) dezren39 commented on Oct 31, 2026 agent-note:v1 {"kind":"done","task":4241,"lane":"d","state":"done","summary":"PR 2959 merged (squash 95640a3): lint/plugin/stress/docs all SUCCESS on 84c9cf0, Codex review of head clean with no unresolved findings. Issue auto-closed by the merge."}
MetadataMetadataapp/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DevelopmentNo branches or pull requestsIssue actions
|