GeezerVison is showing github.com — mcpx(recipes): an @name in a comment or string becomes a required placeholder — and Render splices its JSON value inside the string, breaking the script · Issue #1670 · developing-today/code
mcpx(recipes): an @name in a comment or string becomes a required placeholder — and Render splices its JSON value inside the string, breaking the script #1670Labels 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)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DescriptionSummary
internal/recipes' placeholder scanner says it ignores comments and strings — but it implements neither. An @name mentioned in a // comment, a /* */ comment, or inside a string literal becomes a required placeholder: the daemon elicits for it / returns 422 ("still needs …") when it is unfilled, and if it is filled, Render splices the JSON-encoded value inside the string literal, producing a script that does not parse.
Evidence (verified this run on main 1b22a6e3)
pkgs/mcpx/internal/recipes/recipes.go (sha256 30dbbf05…):
refs() doc, :236-237: "refs finds every @name in the body, ignoring declarations, comments and anything inside a string."
refs() implementation, :238-276: the only line ever skipped is a declaration line (declLine.MatchString, :242). There is no comment state and no string state — every line is scanned byte-by-byte, and any @ not preceded by a word byte starts a name.
Parse turns every undeclared ref into Placeholder{Name, TypeString, Required: true} (:158-166 of the listing in this run's trace: the "used but never declared" loop).
substitute() (:335-356) repeats the same stateless scan, so a filled value is replaced in strings and comments too. For a string placeholder the literal is the JSON encoding including the quotes (literal()), which is correct in code position and corrupting inside an existing string.
- Consumers: daemon
routes_consumer.go:312,325 gates the run on rec.Missing(values) (elicitation, then 422 "… still needs …"), :331 Renders and runs the result; CLI scripts.go:331 parses the same way. recipes_test.go pins a code-position ref and the email shape ([email protected], saved only by the preceding-word-byte rule) — there is no comment-mention or string-mention test.
Premise exercised this run
A faithful Python mirror of refs() + substitute() + Render()'s placeholder logic (hidden_files/probe-2026-10-28-laneA-recipesrefs/premise.py + premise.log in the goal workspace; all expectations held):
- CTRL-A:
await demo.echo({ message: @who }); → placeholder who, renders with "hi", valid.
- CTRL-B:
const to = "[email protected]"; → no placeholder (existing pinned behaviour).
- BUG-A:
// thanks @alice for the review → placeholder alice (required); rendering with no values errors recipe x needs alice — a thank-you in a comment blocks the run behind an elicitation/422 for a value that is never used in code.
- BUG-B:
const note = "ask @admin first"; → placeholder admin; rendering with admin="root" yields const note = "ask "root" first"; — node --check rejects the rendered script, while the original source passes node --check.
- BUG-C:
/* ping @oncall on failure */ → placeholder oncall, same as BUG-A.
Disclosure
The prepared Go probe (hidden_files/probe-2026-10-28-laneA-recipesrefs/probe_lanea_test.go, package recipes_test, three tests: comment mention, string mention, code-position control) was not executed: the laptop was unreachable for the whole run (~/tools/laptop-ssh.sh → "Connection closed by UNKNOWN port 65535", the ongoing fleet outage, cf. #1667) and verification probes are never compiled on the sandbox. Triage step 1: run the probe in the real package on the laptop/CI and confirm or correct these verdicts before fixing.
Why it matters
Recipes are saved scripts run with the user's credentials. The ordinary ways a person writes a script — crediting someone in a comment, writing "ask @admin first" in a message string, a handle in a template — silently become holes that (a) block the deterministic, no-model recipe path behind a pointless question or a 422, and (b) when answered, corrupt the very string they were mentioned in, so the rendered script fails to parse at run time with an error pointing at generated code. The function's own doc comment already states the intended behaviour; the implementation just never grew the state machine.
Acceptance criteria
- Triage runs the prepared probe first and confirms/corrects the verdicts above.
-
@name inside // comments, /* */ comments, and string literals (single, double, and template literals) does not create a placeholder, is not listed by Missing, is not in the elicitation FormSchema, and is left byte-identical by Render.
- A code-position
@name (including the email non-case, [email protected]) behaves exactly as today; existing recipes tests pass unchanged.
- The ruling for template literals is stated explicitly (interpolations
${…} are code; the literal text around them is string) and pinned by a test.
- The ruling for regex literals is stated (either handled, or explicitly documented as out of scope in the
refs doc comment) — cf. the same lexical-state problem in mcpx(scripting): Validate condemns valid scripts whose regex literals contain a quote, delimiter or comment-like sequence — the delimiter scanner has no regex state #1659's scripting validator and mcpx(secrets): References scan misreads regex literals, parameter/destructured bindings and phantom declarations — Preflight refuses scripts that reach nothing and clears scripts that do #1644's secrets scanner; whether the three scanners share a helper is triage's call.
- New tests in
internal/recipes cover: comment mention, block-comment mention, string mention (render leaves the line untouched), and a mixed script whose only real hole is in code position.
- Either
refs' doc comment and code agree, or the doc comment is corrected to describe the behaviour triage pins.
Cross-link: sibling defect in the same file's declaration parsing filed separately (splitDefault bracket counting) — the two share the "scanner without lexical state" root but need separate fixes. Activityadded 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 · filed
- Agent: new-issue-creator job (new-issue-creator-code-a)
- Session / ID: new-issue-creator-code-a cron run 2026-10-28 08:05 CDT
- Found via: filed this run
- Task: Triage the recipes refs()/substitute() string/comment defect: run the prepared probe first (goal hidden_files/probe-2026-10-28-laneA-recipesrefs/), then pin the lexical-state fix.
- Expectation: effort/s — done when @name inside comments and string literals no longer creates a placeholder or is substituted, with the template-literal and regex rulings stated and tested.
- Links: queue packet repo-health-code-pilot (triage, enqueued this run)
dezren39 commented on Oct 28, 2026 Cross-link: sibling defect in the same file filed this run as #1671 (splitDefault truncates a JSON default at the first bracket inside its strings). Same lexical-state root, separate fix — triage of each should note the other. dezren39 commented on Oct 28, 2026 Intake review
— fleet monitor intake pass, 2026-10-28T13:45Z dezren39 commented on Oct 31, 2026 dezren39 commented on Oct 31, 2026 dezren39 commented on Oct 31, 2026 dezren39 commented on Oct 31, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane A shift
- Session / ID: queue task 4225, shift 2026-10-31 07:44 CDT
- Found via: queue claim (resume of PR 2957)
- Task: PR 2957 rechecked fresh: ALL checks now SUCCESS/SKIPPED — lint, plugin tests, stress PR-changed tests, docs build, and the previously queued
final: CI time budget all green on head 36107f1; Codex clean (3 review threads, 0 unresolved). Merging now.
- Expectation: effort/s — done = PR 2957 merged, mcpx(recipes): an @name in a comment or string becomes a required placeholder — and Render splices its JSON value inside the string, breaking the script #1670 closed, task 4225 completed fixed_merged
- Links: PR fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) #2957
dezren39 commented on Oct 31, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane A shift
- Session / ID: queue task 4225, shift 2026-10-31 07:44 CDT
- Found via: queue claim (resume of PR 2957)
- Task: merged PR 2957 (squash, merge commit c6e099c) after fresh verification: all CI checks green on head 36107f1 (lint, plugin tests, stress PR-changed, docs, final CI time budget), Codex clean (3 threads, 0 unresolved). This issue auto-closed by the merge. Task 4225 completed fixed_merged.
- Expectation: done — recipes refs()/substitute() comment+string-aware scanning is on main
- Links: PR fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) #2957
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)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/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
|