4.7 KiB
4.7 KiB
APOPHIS Task Breakdown
Completed (v1.1)
Phase 1: Core Extension Points
- Add
headersfield toApophisExtensioninterface - Implement
getExtensionHeaders()in ExtensionRegistry - Update parser to accept extension headers
- Verify evaluator supports extension predicates
- Add 14 tests
Phase 2A: Multipart Uploads
- Add
MultipartFileandMultipartPayloadtypes - Implement multipart schema-to-arbitrary handler
- Update request builder for multipart payloads
- Add multipart support to HTTP executor
- Add
request_filesandrequest_fieldsparser operations - Add multipart operations to evaluator
- File arrays:
maxCount > 1generates arrays of files - Add 9 tests
Phase 2B: Streaming / NDJSON
- Add
chunksandstreamDurationMsto EvalContext.response - Add streaming config extraction from schema
- Implement NDJSON parsing in HTTP executor
- Add
stream_chunksandstream_durationparser operations - Add streaming operations to evaluator
- Integration tests with Fastify NDJSON routes
- Add 7 tests
Phase 2C: Extension System Polish
- Update contract-validation.ts with extension headers
- Update substitutor.ts with extension header support
- Add integration tests for extension registration
- Add 5 tests
Phase 3A: SSE Extension
- Create
src/extensions/sse/module - Implement SSE format parser
- Implement
sse_eventspredicate - Add response transformer hook
- Integration tests with Fastify SSE routes
- Add 7 tests
Phase 3B: Serializers Extension
- Create
src/extensions/serializers/module - Implement
SerializerRegistry - Implement request/response transformers
- Create
createSerializerExtension()factory - Integration tests for request body transformation
- Add 4 tests
Phase 3C: WebSockets Extension
- Create
src/extensions/websocket/module - Implement
ws_messageandws_statepredicates - Add
onSuiteStartpre-validation hook - Implement
runWebSocketTests()runner - State transition validation
- Add 5 tests
Phase 4: TypeScript Strict Mode
- Fix
src/domain/request-builder.ts: multipart files type - Fix
src/extension/registry.ts: type safety - Fix
src/extensions/sse/transformer.ts: SSEEvent type - Fix
src/extensions/sse/test.ts: predicate assertions - Fix
src/extensions/websocket/test.ts: predicate assertions - Fix
src/formula/evaluator.ts: accessor undefined checks, restore exports - Fix all extension tests: predicate return type narrowing
- Fix all test helpers: HttpMethod casting
npx tsc --noEmitpasses with zero errors- All 468 tests passing
Phase 5: Extension System Hardening
- Dependency ordering:
dependsOnwith topological sort - Async boot:
onSuiteStarthooks run in dependency order - Health checks:
healthCheckfield withrunHealthChecks() - State isolation with
Object.freeze() - Redaction of sensitive data before passing to extensions
- Timeout guards on all hooks
- Prototype pollution prevention in accessor resolution
validateFormula(): error messages with suggestions
Phase 7: Schema-to-Contract Inference
- Create
src/domain/schema-to-contract.tsmodule - Infer
!= nullfromrequiredfields - Infer
>=/<=fromminimum/maximumbounds - Infer
matchesfrompatternregexes - Infer
==fromconstvalues - Infer
==/||chains from smallenumsets - Recurse into nested objects and arrays
- Merge inferred + explicit contracts in
extractContract() - Deduplicate inferred against explicit
x-ensures - Add 15 tests for inference logic
- Add integration tests for
extractContractmerging - Build passes with 0 TypeScript errors
- 482 tests passing
Phase 6: Code Cleanup
- Evaluator deduplication: operation lookup table, shared
resolveAccessor() - Error suggestions: imperative if-chain to pattern matchers
- Extension registry:
handleHookError()utility - Shared test utilities:
src/test/helpers.ts - Shared runner utilities:
src/test/runner-utils.ts - Test deduplication: convert test files to shared helpers
- Remove duplicate
scope auto-discoverytest - Shared security utilities:
src/infrastructure/security.ts - Deduplicate error handling:
getErrorMessage()replaces 19 instances - Deduplicate path param extraction: shared
extractPathParams()
Release Criteria
- TypeScript strict mode passes
- All integration tests pass
- Performance benchmarks within 5% of v1.0
- Documentation complete
- CHANGELOG.md updated
- README.md updated
- Version bumped in package.json