fix(#1990): keep onboard resolver delegation in sync with canonical launcher
onboard.md delegates the gsd_run preamble to
gsd-core/references/gsd-run-resolver.md via @-include, but two guards
regressed once the canonical launcher snippet advanced to
${CLAUDE_CONFIG_DIR:-$HOME/.claude} (#2024):
- runtime-launcher-parity (B2): the resolver reference still shipped the
old $HOME/.claude arm. references/ is not covered by
sync-runtime-launcher.cjs, so refresh the resolver bash block to be
byte-equal to _runtime-launcher.snippet.sh.
- /gsd:onboard command contract: sync-runtime-launcher.cjs had re-inlined
the preamble into onboard.md (a delegating file). Teach the sync
transform to strip-but-never-inline files that @-include the resolver,
mirroring the exemption already in the parity test (B/B2).
Regenerate golden install fixtures and the workflow size baseline for the
smaller onboard.md.
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
This commit is contained in:
@@ -343,9 +343,12 @@ function transformFile(content, preamble) {
|
||||
}
|
||||
}
|
||||
|
||||
// Insert preamble into the first gsd_run block only
|
||||
// Insert preamble into the first gsd_run block only — UNLESS this file
|
||||
// delegates to the shared resolver reference (@-include). Delegating files keep
|
||||
// the stripped blocks (any inline preamble removed) but never get one inserted.
|
||||
const delegates = delegatesToResolverReference(content);
|
||||
const finalBlocks = strippedBlocks.map((stripped, bi) => {
|
||||
if (bi === firstGsdRunBlockIdx) {
|
||||
if (!delegates && bi === firstGsdRunBlockIdx) {
|
||||
return insertPreamble(stripped, preamble);
|
||||
}
|
||||
return stripped;
|
||||
@@ -374,6 +377,21 @@ function escapeRegExp(str) {
|
||||
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
}
|
||||
|
||||
/**
|
||||
* A file "delegates to the shared resolver" when it pulls the canonical gsd_run
|
||||
* preamble in from gsd-core/references/gsd-run-resolver.md via an @-include
|
||||
* instead of inlining the snippet (see onboard.md / issue #1990).
|
||||
*
|
||||
* These files must NOT carry an inline preamble: the resolver reference ships the
|
||||
* one canonical copy, and onboard-command.test.cjs asserts the inline form is
|
||||
* absent. transformFile still STRIPS any inline preamble from them (so a stray
|
||||
* copy is removed) but never re-inserts one — mirroring the exemption in
|
||||
* runtime-launcher-parity.test.cjs (subtest B / B2).
|
||||
*/
|
||||
function delegatesToResolverReference(content) {
|
||||
return content.includes('references/gsd-run-resolver.md');
|
||||
}
|
||||
|
||||
// Main
|
||||
function main() {
|
||||
const preamble = loadPreamble();
|
||||
|
||||
Reference in New Issue
Block a user