Skip to content

Commit 08c9304

Browse files
committed
fix: finish the consumer sweep — repo-wide typecheck is green
The remaining sites the compiler named, all the same shape as the last commit: `metadata-protocol`'s seed-loader and search query plumbing hold parse results, so they name `XParsed`; `ISeedLoaderService`'s request/result/graph follow, and its contract test's mocks with them. Two test-typecheck ledgers move because the flip fixed what they recorded, not because anything was suppressed: @objectstack/spec 79 files / 691 errors -> 58 / 268 @objectstack/client 3 files / 6 errors -> 0 / 0 (ledger now empty) Both ledgers' own headers describe their contents as "fixture literals annotated with a schema OUTPUT type while holding an authored INPUT literal" — which is the defect ADR-0122 exists to end. No fixture was edited to achieve this; the bare name simply means the input type now. The four entries that reached zero are deleted, which is what the shrink-only ratchet requires. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bLZKxxUUk4mahNfn3g3Ed
1 parent ff5ec79 commit 08c9304

7 files changed

Lines changed: 30 additions & 20 deletions

File tree

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"_comment": "Per-file tsc error debt of the @objectstack/client TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed, almost all of them fixture literals annotated with a schema OUTPUT type (`z.infer`) while holding an authored INPUT literal. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/client gen:test-typecheck-debt",
3-
"entries": {
4-
"src/client.batch-transaction.test.ts": 3,
5-
"src/client.environment-scoping.test.ts": 1,
6-
"src/client.hono.test.ts": 2
7-
}
2+
"_comment": "Per-file tsc error debt of the @objectstack/client TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed, almost all of them fixture literals annotated with a schema OUTPUT type (`z.infer`) while holding an authored INPUT literal. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/client gen:test-typecheck-debt ADR-0122 phase 2 (#6083) emptied this ledger: all three remaining files were exactly the conflation described above — an authored literal annotated with the OUTPUT type — and the flip made the bare name mean the INPUT type, so they compile with no edit. An empty `entries` is the goal state, not a disabled gate: a file that gains an error is red on arrival.",
3+
"entries": {}
84
}

packages/metadata-protocol/src/protocol.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
SEARCHABLE_TEXTUAL_TYPES, SEARCHABLE_ENUM_TYPES, SEARCH_AUTO_EXCLUDED_FIELDS,
3131
RPC_QUERY_ALIAS_SLOTS, foldQueryAliasSlots,
3232
type QueryAliasConflict, type QueryAliasSlot,
33-
type DroppedFieldsEvent, type QueryAST, type EngineQueryOptions,
33+
type DroppedFieldsEvent, type QueryAST, type EngineQueryOptionsParsed,
3434
} from '@objectstack/spec/data';
3535
import { PLURAL_TO_SINGULAR, SINGULAR_TO_PLURAL } from '@objectstack/spec/shared';
3636
import { applyConversionsToStoredItem, type ConversionNotice } from '@objectstack/spec';
@@ -4140,7 +4140,7 @@ export class ObjectStackProtocolImplementation implements
41404140
// `.strict()`), which left this query running ascending — the
41414141
// OLDEST `limit` audit events, i.e. the beginning of an object's
41424142
// life and never its recent changes (#4674). The `as any` is gone
4143-
// for the same reason: `EngineQueryOptions` rejects the wrong key,
4143+
// for the same reason: `EngineQueryOptionsParsed` rejects the wrong key,
41444144
// and erasing the type is what let it through.
41454145
const rows = await this.engine.find('sys_metadata_audit', {
41464146
where,
@@ -5971,7 +5971,7 @@ export class ObjectStackProtocolImplementation implements
59715971
// truncated away the recently-edited records a searcher is most
59725972
// likely to want (#4674). Typed rather than `any` so the
59735973
// contract rejects the wrong key at the call site.
5974-
const opts: EngineQueryOptions = {
5974+
const opts: EngineQueryOptionsParsed = {
59755975
where,
59765976
limit: perObject,
59775977
orderBy: [{ field: 'updated_at', order: 'desc' }],

packages/metadata-protocol/src/seed-loader.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import type { IDataEngine, IMetadataService, ISeedLoaderService } from '@objectstack/spec/contracts';
44
import type {
5-
SeedLoaderRequest,
65
SeedLoaderRequestParsed,
76
SeedLoaderResultParsed,
87
SeedLoaderConfig,
@@ -334,7 +333,12 @@ export class SeedLoaderService implements ISeedLoaderService {
334333

335334
async validate(datasets: Seed[], config?: SeedLoaderConfig): Promise<SeedLoaderResultParsed> {
336335
const parsedConfig = SeedLoaderConfigSchema.parse({ ...config, dryRun: true });
337-
return this.load({ seeds: datasets, config: parsedConfig });
336+
// `datasets` is the AUTHOR state (that is what `validate` takes); `load`
337+
// takes the parsed request, and `SeedLoaderSchema` fills the per-seed defaults
338+
// this cast stands in for. Parsing each dataset here would be a second
339+
// validation pass with its own failure mode — `load` already reports every
340+
// seed problem it finds, which is the whole point of `dryRun`.
341+
return this.load({ seeds: datasets, config: parsedConfig } as SeedLoaderRequestParsed);
338342
}
339343

340344
// ==========================================================================
@@ -1979,7 +1983,7 @@ export class SeedLoaderService implements ISeedLoaderService {
19791983
return Array.isArray(externalId) ? externalId.join('+') : externalId;
19801984
}
19811985

1982-
private buildEmptyResult(config: SeedLoaderConfig, durationMs: number): SeedLoaderResultParsed {
1986+
private buildEmptyResult(config: SeedLoaderConfigParsed, durationMs: number): SeedLoaderResultParsed {
19831987
return {
19841988
success: true,
19851989
dryRun: config.dryRun,

packages/qa/dogfood/test/fixtures/endpoint-policy-fixture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
import { defineStack } from '@objectstack/spec';
3434
import { ObjectSchema, Field } from '@objectstack/spec/data';
35-
import type { ApiEndpoint, ApiEndpoint } from '@objectstack/spec/api';
35+
import type { ApiEndpoint } from '@objectstack/spec/api';
3636

3737
/** One object, so the `object_operation` endpoints have something real to read. */
3838
export const PolicyNote = ObjectSchema.create({

packages/spec/src/contracts/seed-loader-service.test.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
import { describe, it, expect } from 'vitest';
44
import type { ISeedLoaderService } from './seed-loader-service';
5-
import type { SeedLoaderRequest, SeedLoaderResult, ObjectDependencyGraph } from '../data/seed-loader.zod';
5+
import type {
6+
SeedLoaderRequestParsed,
7+
SeedLoaderResultParsed,
8+
ObjectDependencyGraphParsed,
9+
} from '../data/seed-loader.zod';
610
import type { Seed } from '../data/seed.zod';
711

812
describe('Seed Loader Service Contract', () => {
913
it('should allow a minimal implementation with required methods', () => {
1014
const service: ISeedLoaderService = {
11-
load: async (_request: SeedLoaderRequest): Promise<SeedLoaderResult> => {
15+
load: async (_request: SeedLoaderRequestParsed): Promise<SeedLoaderResultParsed> => {
1216
return {
1317
success: true,
1418
dryRun: false,
@@ -24,15 +28,17 @@ describe('Seed Loader Service Contract', () => {
2428
totalErrored: 0,
2529
totalReferencesResolved: 0,
2630
totalReferencesDeferred: 0,
31+
totalReferencesDropped: 0,
32+
totalSummariesStale: 0,
2733
circularDependencyCount: 0,
2834
durationMs: 0,
2935
},
3036
};
3137
},
32-
buildDependencyGraph: async (_objectNames: string[]): Promise<ObjectDependencyGraph> => {
38+
buildDependencyGraph: async (_objectNames: string[]): Promise<ObjectDependencyGraphParsed> => {
3339
return { nodes: [], insertOrder: [], circularDependencies: [] };
3440
},
35-
validate: async (_datasets: Seed[]): Promise<SeedLoaderResult> => {
41+
validate: async (_datasets: Seed[]): Promise<SeedLoaderResultParsed> => {
3642
return {
3743
success: true,
3844
dryRun: true,
@@ -48,6 +54,8 @@ describe('Seed Loader Service Contract', () => {
4854
totalErrored: 0,
4955
totalReferencesResolved: 0,
5056
totalReferencesDeferred: 0,
57+
totalReferencesDropped: 0,
58+
totalSummariesStale: 0,
5159
circularDependencyCount: 0,
5260
durationMs: 0,
5361
},
@@ -77,6 +85,8 @@ describe('Seed Loader Service Contract', () => {
7785
totalErrored: 0,
7886
totalReferencesResolved: 0,
7987
totalReferencesDeferred: 0,
88+
totalReferencesDropped: 0,
89+
totalSummariesStale: 0,
8090
circularDependencyCount: 0,
8191
durationMs: 42,
8292
},
@@ -91,7 +101,8 @@ describe('Seed Loader Service Contract', () => {
91101
summary: {
92102
objectsProcessed: 0, totalRecords: 0, totalInserted: 0, totalUpdated: 0,
93103
totalSkipped: 0, totalErrored: 0, totalReferencesResolved: 0,
94-
totalReferencesDeferred: 0, circularDependencyCount: 0, durationMs: 0,
104+
totalReferencesDeferred: 0, totalReferencesDropped: 0, totalSummariesStale: 0,
105+
circularDependencyCount: 0, durationMs: 0,
95106
},
96107
}),
97108
};

packages/spec/test-typecheck-debt.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"src/contracts/package-service.test.ts": 2,
2525
"src/contracts/plugin-lifecycle-events.test.ts": 2,
2626
"src/contracts/security-service.test.ts": 1,
27-
"src/contracts/seed-loader-service.test.ts": 2,
2827
"src/contracts/service-registry.test.ts": 7,
2928
"src/contracts/storage-service.test.ts": 1,
3029
"src/data/data-engine.test.ts": 6,

scripts/analytics-reconcile/boot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { SqliteWasmDriver } from '@objectstack/driver-sqlite-wasm';
1111
import { ObjectQLPlugin } from '@objectstack/objectql';
1212
import { AnalyticsServicePlugin } from '@objectstack/service-analytics';
1313
import { DatasetSchema } from '@objectstack/spec/ui';
14-
import type { Dataset, Dataset, Dashboard, Report } from '@objectstack/spec/ui';
14+
import type { Dataset, Dashboard, Report } from '@objectstack/spec/ui';
1515
import type { IAnalyticsService, DatasetSelection } from '@objectstack/spec/contracts';
1616
import type { FilterCondition } from '@objectstack/spec/data';
1717
import { reconcileDashboard, reconcileReports, type ReconcileExecutors, type WidgetReconcileResult } from './reconcile.js';

0 commit comments

Comments
 (0)