|
|
@@ -419,8 +419,12 @@ const VENDORED_LIBRARY = /^@deepseek-ai\\/(cosmokit|schemastery)(\\/|$)/
|
|
|
})),
|
|
|
]
|
|
|
|
|
|
-/** Files the rescope must never rewrite. */
|
|
|
-function excluded(file: string): boolean {
|
|
|
+/**
|
|
|
+ * Identify files whose recorded content must remain outside the rescope pass.
|
|
|
+ * @param file - Repository-relative path with forward slash separators.
|
|
|
+ * @returns Whether the codemod must preserve the file without scanning its tokens.
|
|
|
+ */
|
|
|
+export function isRescopeExcluded(file: string): boolean {
|
|
|
if (file === 'scripts/rescope-vendor.ts') return true // the mapping itself
|
|
|
if (file.startsWith('.agents/notes/')) return true // notes record what was true when written
|
|
|
// Recorded model payloads quote documentation verbatim, so they must mirror the
|
|
|
@@ -430,6 +434,8 @@ function excluded(file: string): boolean {
|
|
|
if (file === 'docs/rescope.md' || file === 'docs/rescope.zh.md') return true
|
|
|
if (file.endsWith('.i18n.yaml')) return true // blob-hash records, re-recorded by the pairing gate
|
|
|
if (file === 'pnpm-lock.yaml') return true // regenerated by pnpm install
|
|
|
+ // Raw npm registry resolution; only gen-dependency-catalog --refresh replaces this evidence.
|
|
|
+ if (file === 'scripts/dependency-catalog/package-lock.json') return true
|
|
|
if (/^vendor\/[^/]+\/(README\.md|LICENSE)$/.test(file)) return true // upstream files kept verbatim
|
|
|
return !EXTENSIONS.some(extension => file.endsWith(extension))
|
|
|
}
|
|
|
@@ -558,7 +564,7 @@ function main(): void {
|
|
|
const all = patterns(reverse)
|
|
|
const files = execFileSync('git', ['ls-files', '-z'], { cwd: root, encoding: 'utf8' })
|
|
|
.split('\0')
|
|
|
- .filter(file => file !== '' && !excluded(file))
|
|
|
+ .filter(file => file !== '' && !isRescopeExcluded(file))
|
|
|
|
|
|
const counts = new Map<string, { files: number; lines: number }>()
|
|
|
const failures: string[] = []
|