Title: Launcher placeholders: defaults, imports, namespacing · Issue #1852 · developing-today/code · GitHub
Open Graph Title: Launcher placeholders: defaults, imports, namespacing · Issue #1852 · developing-today/code
X Title: Launcher placeholders: defaults, imports, namespacing · Issue #1852 · developing-today/code
Description: Relocated from dezren39/darwin-nix#7 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix ...
Open Graph Description: Relocated from dezren39/darwin-nix#7 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references...
X Description: Relocated from dezren39/darwin-nix#7 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue refere...
Opengraph URL: https://github.com/developing-today/code/issues/1852
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Launcher placeholders: defaults, imports, namespacing","articleBody":"Relocated from dezren39/nix#7 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).\n\nParent: #181\n\n## Already shipped\n\nPlaceholders take arguments and users can declare their own:\n\n```\n@console(header, prefix) # arguments naming fragments\n@timed(entry, \"the script\") # a user-declared placeholder\n// @mcpx:placeholder timed(body, label)\n```\n\nDeclarations come from a comment, an exported `MCPX_PLACEHOLDER` constant, or\nthe filename, on `paths.placeholders`.\n\nSince this was filed (checked at 05c78b2):\n\n- **#75: launchers apply to inline snippets too.** `mcpx exec '\u003cts>'` now goes\n through the launcher like a file, and `--launcher`, `--no-launcher`,\n `--allow-repeat` are honoured for both (`internal/cli/commands.go:461-470`,\n `:748-785`). The two shapes still differ on purpose: a snippet gets\n `@prefix`/`@suffix` spliced into its own scope (they may declare bindings), a\n file gets them wrapped around its import (they may act, not declare). Anything\n below that moves code between fragments -- import hoisting especially -- has to\n work for both shapes.\n- **#73: a launcher is named for its contents.** The generated entry is the hash\n of the expanded launcher, so two runs of one script with different placeholder\n fills are two files, not one overwritten file (`internal/runner/runner.go`,\n #73). Placeholder features no longer risk the last-writer-wins bug.\n- **The near-miss check only knows built-in names.** `checkUnknown` treats\n declared names as known, but `looksLikePlaceholder` compares a misspelling only\n against the built-ins, and the \"available are\" list names only built-ins\n (`internal/launcher/template.go:299-358`). So `@baner` for a declared `@banner`\n passes through as literal text. #186 (#181 collision 6) owns what \"close\"\n means across search, diagnostics and the launcher; this issue should feed\n declared names into it, and namespacing below changes what a name is.\n\n## What is left\n\n### Arguments that are expressions\n\nToday an argument either names a placeholder or is literal. `@timed(entry,\n\"label\")` works; `@timed(entry, config.name)` does not, because there is no\nevaluation, only substitution.\n\nProbably correct as-is. Substitution that cannot compute is easy to reason\nabout, and the generated file is TypeScript that can compute for itself.\nWorth revisiting only if real templates keep wanting it.\n\n### Default arguments in a declaration\n\n```\n// @mcpx:placeholder timed(body, label = \"unnamed\")\n```\n\nSmall, obvious, not yet done. (Still true: the declaration's parameter list is\nsplit on commas only, so `label = \"unnamed\"` becomes a parameter literally named\nthat -- `internal/launcher/define.go:119`, `:163-170`.)\n\n### Declarations that pull in dependencies\n\nA fragment needing an import has to assume the header provides it. Letting a\ndeclaration state its imports, hoisted and deduplicated into the header, would\nmake fragments genuinely self-contained.\n\nThis is the one with real value and real design cost: it means parsing import\nstatements, merging specifiers, and deciding what happens when two fragments\nimport the same name from different modules.\n\n### Namespacing\n\nTwo projects each declaring `@banner` cannot both be on the path. Refused\ntoday, which is right, but a prefix (`@mine:banner`) would let both exist.\nNobody has hit this yet. (Still refused: `Bind`, `internal/launcher/define.go:203-233`.)\n\n## Notes\n\nThe single-resolution rule already handles the composition concern from the\noriginal note: if `@console` uses `@header` and `@prefix`, and the template\nalso uses them directly, that is a repeat and is refused unless named in\n`plumbing.launcherPlaceholderRepeat` (`internal/settings/registry.go:529`) or\n`--allow-repeat` (honoured for snippets since #75). So \"as long as those weren't\nused in two places once put together\" is enforced rather than assumed.\n\nNo real choice for three of the four items (expressions: leave; defaults: do;\nnamespacing: a prefix, when someone hits it). The one open design is import\nhoisting -- how two fragments importing the same name from different modules are\nresolved -- and it must hold for both the snippet and the file shape.\n\n## Ease · Impact · Related\n\n**Ease** M (defaults S; import hoisting is the M) · **Impact** med.\n\nRelated: #186 (one near-miss matcher; the launcher's is one of the two today),\n#81 and #112 (the `script.*` phases these placeholders splice are one of the\nhook vocabularies #81 reconciles, collision 2), #83 (recipes share the\n`@param` header spelling).\n\nSecurity/auth deferred; see tracker.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T22:04:31Z","url":"https://github.com/developing-today/code/issues/1852"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8d4f45ee-873d-2f15-e9e6-6a75849a1dff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2F6:1774FA:29CE74:384EE6:6B0616B1 |
| html-safe-nonce | ab1b4389cfcc674ac7698cdeba2b968b248d6c03f639846998c8d98fc94839c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkY2OjE3NzRGQToyOUNFNzQ6Mzg0RUU2OjZCMDYxNkIxIiwidmlzaXRvcl9pZCI6IjY1NjM4OTIxMDgxNjI2MzU0NDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | edfded9b0df07eff86cef92252b3fddf77148ecc03bd1b79b65143498511e772 |
| hovercard-subject-tag | issue:6088331782 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1852/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c56f8503ca587c7368e9caa91fbc8534081c0d59d1aa08593a1057da2d2bc828/developing-today/code/issues/1852 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c56f8503ca587c7368e9caa91fbc8534081c0d59d1aa08593a1057da2d2bc828/developing-today/code/issues/1852 |
| og:image:alt | Relocated from dezren39/darwin-nix#7 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width