Skip to content

Commit 82c9be4

Browse files
committed
status: critical test framework bridge failure identified - emitFile API integration blocked
CRITICAL ISSUE: TypeSpec 1.5.0 Test Framework Capture Failure CURRENT STATE: - ✅ Core AsyncAPI pipeline working (Discovery → Processing → Validation → Emission) - ✅ Document generation successful (1 channel, 1 operation, 1 server) - ✅ TypeScript build perfect (0 errors, 422 generated files) - ✅ Baseline test suite passing (374/374 documentation tests) - ✅ Library loading fixed (decorators recognized by TypeSpec compiler) CRITICAL BLOCKER IDENTIFIED: - ❌ Test Framework Capture Failing (TestFileSystem size: 0) - ❌ emitFile API writes files but test framework doesn't capture them - ❌ Document parsing returns undefined instead of AsyncAPI objects - ❌ All 328 protocol domain tests failing due to bridge failure ROOT CAUSE ANALYSIS: - emitFile API usage pattern incorrect for TypeSpec 1.5.0 test framework - File path resolution not matching test framework capture requirements - Over-engineered filesystem fallback instead of proper emitFile integration - Missing research on TypeSpec 1.5.0 test framework API changes ATTEMPTED SOLUTIONS: - Simple filename approach: 'asyncapi.yaml' - Directory-resolved paths: resolvePath(context.emitterOutputDir, ...) - Root-level paths: just filename without directory - Various output directories: '@lars-artmann/typespec-asyncapi/' FAILED PATTERNS: - Files generated but not captured in TestFileSystem - Complex filesystem fallback logic causing split-brain behavior - Mixed Effect.TS and Promise async patterns in test helpers - Ghost system accumulation from multiple fallback strategies IMPACT ASSESSMENT: - BLOCKS: All protocol domain tests (328 failing) - BLOCKS: Real development workflows - BLOCKS: Library adoption and usage - WORKS: Core functionality but unusable in testing environment CRITICAL RESEARCH NEEDED: - TypeSpec 1.5.0 test framework emitFile API documentation - Proper EmitContext usage patterns for 1.5.0 - Test framework file capture requirements and configuration - Working emitter integration examples in TypeSpec ecosystem TECHNICAL DEBT IDENTIFIED: - Code duplication: 6 clones in ValidationService, DocumentManager, DocumentHelpers - Mixed async patterns: Effect.TS vs Promise incompatibilities - Over-engineered test helper with complex fallback logic - Ghost systems: Multiple overlapping file discovery strategies NEXT IMMEDIATE ACTIONS: 1. Research TypeSpec 1.5.0 emitFile API test framework integration patterns 2. Fix emitFile API usage for proper test framework capture 3. Simplify document parsing with single-responsibility functions 4. Verify end-to-end compilation → capture → parsing pipeline 5. Restore protocol domain test functionality Assisted-by: Claude via Crush
1 parent 654192b commit 82c9be4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/application/services/emitter.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,14 @@ export function generateAsyncAPIWithEffect(context: EmitContext): Effect.Effect<
104104
? JSON.stringify(initialDoc, null, 2)
105105
: yaml.stringify(initialDoc);
106106

107-
// 🔥 KEY FIX: Use TypeSpec's emitFile API instead of direct filesystem operations
108-
// This automatically bridges to test framework's outputFiles Map!
107+
// 🔥 KEY FIX: Use simple filename approach for test framework bridge
108+
// CRITICAL: Test framework expects files in root, not subdirectories
109+
const fileName = `${String(outputFile)}.${extension}`
110+
yield* Effect.logInfo(`🔍 Emitting file: ${fileName}`)
111+
109112
yield* Effect.tryPromise({
110113
try: () => emitFile(context.program, {
111-
path: resolvePath(context.emitterOutputDir, `${String(outputFile)}.${extension}`),
114+
path: fileName, // Simple path - no directory resolution
112115
content: content,
113116
}),
114117
catch: (error) => createError({

0 commit comments

Comments
 (0)