From 4527c9b93ff08568ddea052d2a004e38ab96d997 Mon Sep 17 00:00:00 2001 From: garrytan Date: Sat, 3 Oct 2026 21:38:56 +0000 Subject: [PATCH] C3: guard Kiro's router copies on a present source; give the QA pointer adapter the copy and dist helpers A copy fails where a symlink dangled, so the Kiro router and upgrade copies are written only when their render exists (as every other runtime root already does). test/qa-lazy-sections' extracted Kiro installer now supplies _link_runtime_dists (C2) and the SKILL.md copy helpers (C3). --- setup | 8 ++++++-- test/qa-lazy-sections.test.ts | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/setup b/setup index 1fd430bb6..70dfdc662 100755 --- a/setup +++ b/setup @@ -3332,8 +3332,12 @@ if [ "$INSTALL_KIRO" -eq 1 ]; then echo " error: could not back up an edited SKILL.md copy under $KIRO_GSTACK; Kiro install stopped before overwriting it" >&2 exit 1 fi - _copy_skill_md "$KIRO_DIR/gstack-upgrade/SKILL.md" "$KIRO_GSTACK/gstack-upgrade/SKILL.md" - _copy_skill_md "$KIRO_DIR/gstack/SKILL.md" "$KIRO_GSTACK/SKILL.md" + if [ -f "$KIRO_DIR/gstack-upgrade/SKILL.md" ]; then + _copy_skill_md "$KIRO_DIR/gstack-upgrade/SKILL.md" "$KIRO_GSTACK/gstack-upgrade/SKILL.md" + fi + if [ -f "$KIRO_DIR/gstack/SKILL.md" ]; then + _copy_skill_md "$KIRO_DIR/gstack/SKILL.md" "$KIRO_GSTACK/SKILL.md" + fi if [ -f "$KIRO_DIR/gstack-office-hours/SKILL.md" ]; then mkdir -p "$KIRO_GSTACK/office-hours" _copy_skill_md "$KIRO_DIR/gstack-office-hours/SKILL.md" "$KIRO_GSTACK/office-hours/SKILL.md" diff --git a/test/qa-lazy-sections.test.ts b/test/qa-lazy-sections.test.ts index 4779689d6..412fc7ab6 100644 --- a/test/qa-lazy-sections.test.ts +++ b/test/qa-lazy-sections.test.ts @@ -544,6 +544,7 @@ describe('installed QA pointers', () => { '_gstack_generated_header', '_claude_entry_owned_strongly', '_claude_entry_is_ours', '_write_owned_marker', '_backup_skill_md', '_cleanup_weak_dir', '_gstack_dir_only_links', '_cleanup_linked_dir', '_owned_for_windows_refresh', '_sidecar_root_user_owned', '_prune_stale_generated', '_skill_source_exists', + '_link_runtime_dists', '_copy_skill_md', '_skill_copy_hash', '_skill_copy_unmodified', '_preserve_skill_copy_edits', '_record_skill_copies', ].map(setupFunction).join('\n') // Install-registry rows (setup's _setup_arm_* / _setup_row) are not under test here. + '\n_setup_arm_begin() { :; }\n_setup_arm_publish() { :; }\n_setup_row() { :; }'; @@ -583,7 +584,8 @@ describe('installed QA pointers', () => { const script = [ 'set -e', `IS_WINDOWS=${copy ? 1 : 0}`, `SKILL_PREFIX=${prefix}`, 'QUIET=1', '_FOREIGN_SKIPPED_ENTRIES=()', '_BACKED_UP_SKILL_MDS=()', '_SKILL_BACKUP_ROOT="$HOME/backups"', - 'GSTACK_USER_RENDER_DIR="$HOME/absent-render"', helpers, + 'GSTACK_USER_RENDER_DIR="$HOME/absent-render"', + 'GSTACK_STATE_ROOT="$HOME/.gstack"', '_SKILL_COPIES_FILE="$GSTACK_STATE_ROOT/skill-copies.tsv"', helpers, 'log() { :; }', '_browser_hint() { :; }', 'bun_cmd() { :; }', install, ].join('\n'); const runInstall = () => runBashScript(script, {