GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #1670

New issue
Copy link
New issue
Copy link
Closed
#2957
Closed
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
#2957
Copy link
Assignees
dezren39
Labels
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

Description

@dezren39
dezren39
opened on Oct 28, 2026
Issue body actions

Summary

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.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 28, 2026
  2. github-actions
    assigned
    dezren39
    on Oct 28, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    🤖 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)
  4. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    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.

  5. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    Intake review

    • Still live: Yes. Filed 2026-10-28T13:10Z by the creator, verified on main 1b22a6e with a probe; the one merged-PR search hit (PR fix(id): world doctor — Warn no longer fails the command; --ceiling/--profile wired #826) predates this issue and is an unrelated world-doctor change — not a fix. refs() in pkgs/mcpx/internal/recipes/recipes.go still has no comment or string state.
    • Related: mcpx(recipes): a JSON default is truncated at the first bracket inside its strings — splitDefault counts brackets with no string state #1671 (sibling: splitDefault in the same file has the identical missing-string-state flaw — the two fixes share one scanner-state helper and should land together or sequentially with care), 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 (recipes Validate/regex-literal finding, same package).
    • Notes: Body already contains acceptance criteria; labels already complete. Marked meta/enriched only.
    • Risks: Render splicing a JSON value inside a string literal produces scripts that fail to parse at runtime — a correctness break, not just a spurious elicitation. A scanner fix must handle // and /* */ comments, all three quote forms, and escapes, or it trades one bug for another.
    • Suggested approach: Give refs() a single-pass lexer state (code / line-comment / block-comment / string-with-quote) shared with the splitDefault fix in mcpx(recipes): a JSON default is truncated at the first bracket inside its strings — splitDefault counts brackets with no string state #1671; table-driven tests covering @NAMEs in each non-code region.

    — fleet monitor intake pass, 2026-10-28T13:45Z

  6. dezren39
    added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 28, 2026
  7. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane D shift
    • Session / ID: queue task 1871 (triage)
    • Found via: queue claim
    • Task: Run the prepared Go probe in the real internal/recipes package on the laptop (triage step 1 from the issue), confirm or correct the BUG-A/B/C verdicts against current main, post the triage verdict, and enqueue the fix packet if confirmed.
    • Expectation: effort s — done = verdict posted + fix task enqueued (or issue closed with evidence if already fixed).
    • Links: 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
  8. dezren39
    removed
    status/needs-triageNot yet triaged; needs a first look
    on Oct 31, 2026
  9. 109 remaining items

  10. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Oct 31, 2026
  11. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), openchamber scheduled lane
    • Session / ID: queue task 4225
    • Found via: queue claim (resume)
    • Task: Fix 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: recipes refs()/substitute() comment+string-aware scanning (PR fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) #2957 @ 36107f1).
    • State: Codex review clean on head (receipt 2026-10-31T09:02Z, no findings). Worktree targeted tests pass (go test -race ./internal/recipes/ PASS). Actions run 41186851710 has all test/lint legs green: basic: lint PASS, basic: plugin tests PASS, stress: PR changed tests PASS, mcpx docs PASS. Only trailing check final: CI time budget has been queued awaiting runner for 14m.
    • Expectation: Parked 20 minutes per 5-minute rule. Resume: final: CI time budget resolves → merge PR 2957 → close 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 → complete fixed_merged.
  12. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane F shift
    • Session / ID: queue task 4225
    • Found via: queue claim · resume from park (stage awaiting_ci)
    • Task: PR fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) #2957 @36107f128 re-checked: every substantive leg is now green — basic: lint ✔, basic: plugin tests ✔, stress: PR changed tests ✔, mcpx-docs build ✔. Only final: CI time budget (job 124526788977) remains, still queued after a ~4-minute poll (fleet runner backlog). Codex clean per the previous park; head unchanged.
    • Expectation: resume = time-budget job green → merge PR fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) #2957 → close 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 → complete fixed_merged
    • Links: PR fix(mcpx/recipes): scan comments and strings when finding @name placeholders (#1670) #2957
  13. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 31, 2026
  14. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 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
  15. dezren39
    added a commit that references this issue on Oct 31, 2026

    fix(mcpx/recipes): scan comments and strings when finding @name place…

    c6e099c
  16. dezren39
    closed this as completedin #2957on Oct 31, 2026
  17. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 31, 2026
  18. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.