Skip to content

[observation] examples/app-crm + app-todo typecheck excludes test/**, so their test files are never type-checked — app-crm's existing smoke test does not compile when it is included #7312

Description

@os-help

Filed unassigned by the #7258 dev (PR #7311) as an out-of-scope observation. Not fixed there: #7258 is a test-only card whose file surface is the two new pin tests, and changing an app's typecheck scope changes what its gate asserts.

The shape

The three example apps disagree about whether pnpm typecheck (tsc --noEmit) sees their tests:

app include
examples/app-showcase ["src/**/*", "objectstack.config.ts", "test/**/*"]
examples/app-crm ["src/**/*", "objectstack.config.ts"]
examples/app-todo ["src/**/*", "objectstack.config.ts"]

So in two of the three, everything under test/ is invisible to the typecheck gate — including the real-kernel harnesses that have landed there recently (app-todo/test/task-completion-trigger.test.ts and task-recurrence.test.ts from #6882 / #7036 / #7222; app-crm/test/opportunity-stage-hook.test.ts from #7258). Those files import engine, driver and plugin types across package boundaries, which is exactly the code a typecheck is worth running on.

Measured

Adding "test/**/*" to examples/app-crm/tsconfig.json and running pnpm --filter @objectstack/example-crm typecheck:

test/smoke.test.ts(9,12): error TS18048: 'stack.manifest' is possibly 'undefined'.
test/smoke.test.ts(10,12): error TS18048: 'stack.manifest' is possibly 'undefined'.
test/smoke.test.ts(11,12): error TS18048: 'stack.manifest' is possibly 'undefined'.

Three pre-existing errors in the app's own long-standing smoke test — the gap is not merely theoretical, it is already holding non-compiling code. The new #7258 pin file produced zero errors in the same run (tsc reports all of them), so the only thing standing between app-crm and an inclusive typecheck is smoke.test.ts's three optional-chain narrowings. app-todo shares the include shape; whether it also has latent errors was not measured, since editing that app was outside the #7258 dispatch surface.

Why observation-class rather than a defect

Nothing a user hits: these are private example workspaces, the errors are in test code, and every one of these suites passes at runtime. The cost is silent — a test file that stops compiling is not reported by any gate in two of the three example apps, so the corpus AI authors copy from can drift out of type-correctness without anyone learning about it.

Adjacent but not a duplicate: #4311 is the framework-side "66 tsup-built packages, nobody type-checks them" card. These example apps do run tsc --noEmit; the gap here is the include glob, not a missing gate.

Suggested fix if picked up: add "test/**/*" to both tsconfigs and repair the three TS18048s (stack.manifest is optional on the bundle type — the smoke test asserts through it without narrowing).


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions