From fc4cb6aaa9c98fba9de6edc13025e200e37d687e Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 14 Aug 2026 19:12:23 -0700 Subject: [PATCH] fix(gen): delete the codex-helpers shadow module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gen-skill-docs.ts imported externalSkillName (unaliased) from resolvers/codex-helpers.ts at line 21 and then re-declared the same function locally — the import was silently shadowed, and the imported copy was the STALE one (it lacked the frontmatterName param the local copy grew). Three more functions were byte-identical duplicates, imported only under _-prefixed aliases to keep the module 'referenced', and transformFrontmatter was a superseded hardcoded-Codex variant. Nothing else imported the module. Also drops three dead top-of-file imports (COMMAND_DESCRIPTIONS, SNAPSHOT_FLAGS — which pulled the whole browse/src module graph into every generator run for nothing — and an unused review-resolver trio). Proof: bun run gen:skill-docs exits 0 with a byte-identical tree (zero-diff regen); gen-skill-docs.test.ts 405/405 green. Co-Authored-By: Claude Fable 5 --- scripts/gen-skill-docs.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/gen-skill-docs.ts b/scripts/gen-skill-docs.ts index 5e11a2efe..8a99bd082 100644 --- a/scripts/gen-skill-docs.ts +++ b/scripts/gen-skill-docs.ts @@ -9,8 +9,6 @@ * Used by skill:check and CI freshness checks. */ -import { COMMAND_DESCRIPTIONS } from '../browse/src/commands'; -import { SNAPSHOT_FLAGS } from '../browse/src/snapshot'; import { discoverTemplates, discoverSectionTemplates } from './discover-skills'; import { writeLlmsTxt } from './gen-llms-txt'; import * as fs from 'fs'; @@ -18,8 +16,6 @@ import * as path from 'path'; import type { Host, TemplateContext } from './resolvers/types'; import { HOST_PATHS, unwrapResolver } from './resolvers/types'; import { RESOLVERS } from './resolvers/index'; -import { externalSkillName, extractHookSafetyProse as _extractHookSafetyProse, extractNameAndDescription as _extractNameAndDescription, condenseOpenAIShortDescription as _condenseOpenAIShortDescription, generateOpenAIYaml as _generateOpenAIYaml } from './resolvers/codex-helpers'; -import { generatePlanCompletionAuditShip, generatePlanCompletionAuditReview, generatePlanVerificationExec } from './resolvers/review'; import { ALL_HOST_CONFIGS, ALL_HOST_NAMES, resolveHostArg, getHostConfig } from '../hosts/index'; import type { HostConfig } from './host-config'; @@ -184,7 +180,8 @@ function rewriteSectionBase(content: string): string { // ─── External Host Helpers ─────────────────────────────────── -// Re-export local copy for use in this file (matches codex-helpers.ts) +// Canonical implementation (the codex-helpers.ts shadow copy was deleted — +// it was imported, immediately shadowed by this declaration, and stale) // Accepts optional frontmatter name to support directory/invocation name divergence function externalSkillName(skillDir: string, frontmatterName?: string): string { // Root skill (skillDir === '' or '.') always maps to 'gstack' regardless of frontmatter