Commit d7a6758
`extractLocalImports` in build-skill-references.ts under-reported a skill's
transitive schema deps because of two blind spots in the import scan:
- The regex `/^import\s+.*\s+from\s+.../` used `.`, which does not cross
newlines, so any multi-line named import (`import {\n … \n} from './x'`)
was silently dropped and never queued into the closure.
- `.js`-suffixed ESM specifiers were mangled: the resolver appended `.ts`
unconditionally, turning `./types.js` into a non-existent `./types.js.ts`
that then failed the `fs.existsSync` check and was discarded.
Replace the pattern with a multi-line-tolerant scan that excludes `;`,
quotes, and `(` between `import` and `from` — this keeps the non-greedy
span from bridging across statement boundaries, side-effect imports, or a
dynamic `import(...)`. Normalize `.js` specifiers to `.ts` before resolving.
Regenerated the indexes with the fix in place: the platform skill now
surfaces `system/tenant.zod.ts`, reached through the previously-invisible
`.js` import in `kernel/context.zod.ts`. The `check:skill-refs` gate added
in #3138 passes with the regenerated output.
Claude-Session: https://claude.ai/code/session_01YTjm38Bo2xUv1UUPWu4mC5
Co-authored-by: Claude <noreply@anthropic.com>
1 parent b8a21ad commit d7a6758
2 files changed
Lines changed: 15 additions & 3 deletions
File tree
- packages/spec/scripts
- skills/objectstack-platform/references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
129 | | - | |
130 | 136 | | |
131 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
132 | 143 | | |
133 | 144 | | |
134 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
0 commit comments