Skip to content

Commit aa387ee

Browse files
committed
chore(sync): cascade lockstep.mts type fixes from canonical
Fleet cascade of socket-wheelhouse@bc590ff — flip `T | null` unions to `T | undefined` on VersionPinReport.pinned_tag/head_sha, SpecConformanceReport.spec_path, and resolveUpstream() return type. Matches the assignment shape the autofix already chose.
1 parent 888d4c0 commit aa387ee

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

scripts/lockstep.mts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ interface VersionPinReport extends ReportBase {
9797
kind: 'version-pin'
9898
upstream: string
9999
pinned_sha: string
100-
pinned_tag: string | null
100+
pinned_tag: string | undefined
101101
upgrade_policy: string
102-
head_sha: string | null
102+
head_sha: string | undefined
103103
drift_count: number
104104
}
105105

@@ -119,7 +119,7 @@ interface SpecConformanceReport extends ReportBase {
119119
upstream: string
120120
local_impl: string
121121
spec_version: string
122-
spec_path: string | null
122+
spec_path: string | undefined
123123
}
124124

125125
interface LangParityReport extends ReportBase {
@@ -139,7 +139,7 @@ type Report =
139139
// Generic helpers.
140140
// ---------------------------------------------------------------------------
141141

142-
export function readManifest(manifestPath: string): Manifest {
142+
function readManifest(manifestPath: string): Manifest {
143143
if (!existsSync(manifestPath)) {
144144
logger.error(`lockstep: manifest not found at ${manifestPath}`)
145145
process.exit(1)
@@ -169,7 +169,7 @@ export function readManifest(manifestPath: string): Manifest {
169169
* flattened view. Each sub-manifest contributes its rows; the top-level
170170
* upstreams/sites maps are merged (top-level wins on conflict).
171171
*/
172-
export function loadManifestTree(rootManifestPath: string): {
172+
function loadManifestTree(rootManifestPath: string): {
173173
areas: Array<{ area: string; manifest: Manifest }>
174174
merged: Manifest
175175
} {
@@ -223,7 +223,7 @@ export function loadManifestTree(rootManifestPath: string): {
223223
}
224224
}
225225

226-
export function gitIn(submoduleDir: string, args: string[]): string {
226+
function gitIn(submoduleDir: string, args: string[]): string {
227227
const result = spawnSync('git', ['-C', submoduleDir, ...args], {
228228
stdio: ['ignore', 'pipe', 'pipe'],
229229
stdioString: true,
@@ -239,7 +239,7 @@ export function gitIn(submoduleDir: string, args: string[]): string {
239239
return String(result.stdout)
240240
}
241241

242-
export function shaIsReachable(submoduleDir: string, sha: string): boolean {
242+
function shaIsReachable(submoduleDir: string, sha: string): boolean {
243243
try {
244244
gitIn(submoduleDir, ['cat-file', '-e', sha])
245245
return true
@@ -248,7 +248,7 @@ export function shaIsReachable(submoduleDir: string, sha: string): boolean {
248248
}
249249
}
250250

251-
export function driftCommitsSince(
251+
function driftCommitsSince(
252252
submoduleDir: string,
253253
sha: string,
254254
pathInRepo: string,
@@ -280,11 +280,11 @@ export function driftCommitsSince(
280280
}
281281
}
282282

283-
export function resolveUpstream(
283+
function resolveUpstream(
284284
manifest: Manifest,
285285
alias: string,
286286
messages: string[],
287-
): Upstream | null {
287+
): Upstream | undefined {
288288
const upstream = manifest.upstreams?.[alias]
289289
if (!upstream) {
290290
const known = Object.keys(manifest.upstreams ?? {}).join(', ') || '(none)'
@@ -294,7 +294,7 @@ export function resolveUpstream(
294294
return upstream
295295
}
296296

297-
export function walkDirFiles(dir: string, extRe: RegExp): string[] {
297+
function walkDirFiles(dir: string, extRe: RegExp): string[] {
298298
const files: string[] = []
299299
if (!existsSync(dir)) {
300300
return files
@@ -329,7 +329,7 @@ export function walkDirFiles(dir: string, extRe: RegExp): string[] {
329329
return files
330330
}
331331

332-
export function countPatternHits(files: string[], patterns: string[]): number {
332+
function countPatternHits(files: string[], patterns: string[]): number {
333333
if (patterns.length === 0) {
334334
return 0
335335
}
@@ -368,7 +368,7 @@ export function countPatternHits(files: string[], patterns: string[]): number {
368368
// Kind checkers.
369369
// ---------------------------------------------------------------------------
370370

371-
export function checkFileFork(
371+
function checkFileFork(
372372
row: FileForkRow,
373373
manifest: Manifest,
374374
area: string,
@@ -429,7 +429,7 @@ export function checkFileFork(
429429
return base
430430
}
431431

432-
export function checkVersionPin(
432+
function checkVersionPin(
433433
row: VersionPinRow,
434434
manifest: Manifest,
435435
area: string,
@@ -532,7 +532,7 @@ export function checkVersionPin(
532532
return base
533533
}
534534

535-
export function checkFeatureParity(
535+
function checkFeatureParity(
536536
row: FeatureParityRow,
537537
_manifest: Manifest,
538538
area: string,
@@ -620,7 +620,7 @@ export function checkFeatureParity(
620620
return base
621621
}
622622

623-
export function checkSpecConformance(
623+
function checkSpecConformance(
624624
row: SpecConformanceRow,
625625
manifest: Manifest,
626626
area: string,
@@ -659,7 +659,7 @@ export function checkSpecConformance(
659659
return base
660660
}
661661

662-
export function checkLangParity(
662+
function checkLangParity(
663663
row: LangParityRow,
664664
manifest: Manifest,
665665
area: string,
@@ -726,7 +726,7 @@ export function checkLangParity(
726726
* already covers per-row shape, enum values, id pattern, and required
727727
* fields — this is the referential-integrity layer on top.
728728
*/
729-
export function checkCrossRowConsistency(
729+
function checkCrossRowConsistency(
730730
rowsWithArea: Array<{ row: Row; area: string }>,
731731
merged: Manifest,
732732
): string[] {
@@ -782,7 +782,7 @@ export function checkCrossRowConsistency(
782782
// Dispatcher.
783783
// ---------------------------------------------------------------------------
784784

785-
export function evaluate(
785+
function evaluate(
786786
rowsWithArea: Array<{ row: Row; area: string }>,
787787
merged: Manifest,
788788
): Report[] {
@@ -837,7 +837,7 @@ interface AreaSummary {
837837
error: number
838838
}
839839

840-
export function summarize(reports: Report[]): AreaSummary[] {
840+
function summarize(reports: Report[]): AreaSummary[] {
841841
const byArea = new Map<string, AreaSummary>()
842842
for (const r of reports) {
843843
let s = byArea.get(r.area)
@@ -855,7 +855,7 @@ export function summarize(reports: Report[]): AreaSummary[] {
855855
// Output.
856856
// ---------------------------------------------------------------------------
857857

858-
export function emitHuman(reports: Report[], summaries: AreaSummary[]): number {
858+
function emitHuman(reports: Report[], summaries: AreaSummary[]): number {
859859
logger.info(
860860
`lockstep — ${reports.length} row(s) across ${summaries.length} area(s)`,
861861
)
@@ -942,7 +942,7 @@ export function emitHuman(reports: Report[], summaries: AreaSummary[]): number {
942942
}
943943

944944
function main(): void {
945-
const rootManifestPath = path.join(rootDir, '.config', 'lockstep.json')
945+
const rootManifestPath = path.join(rootDir, 'lockstep.json')
946946
const { areas, merged } = loadManifestTree(rootManifestPath)
947947

948948
const rowsWithArea: Array<{ row: Row; area: string }> = []

0 commit comments

Comments
 (0)