fix: add scenario example to protocol-lab, sync EnvironmentPolicy types
This commit is contained in:
@@ -235,7 +235,7 @@ Overall: 8.5/10 for real team pilot use. Potential 9/10 if standalone observe pr
|
||||
7. ✅ Plugin contract support end-to-end: docs, tests, all runners wired.
|
||||
8. ✅ Artifact pipeline CI/CD regression tests: json-summary, ndjson-summary, --quiet, skipped field, exit codes.
|
||||
9. ✅ Qualify --changed implemented.
|
||||
10. Add standalone observe process management (`apophis observe --app ./app.ts`) for local/staging observation.
|
||||
10. Add OTel-compatible observe sink — export contract.violation / contract.pass events as OpenTelemetry spans or custom metrics so teams can visualize APOPHIS results in existing dashboards (Jaeger, Datadog, etc.) without custom glue code. This replaces the earlier "standalone observe process" idea; OTel already solves service lifecycle and transport.
|
||||
11. Add route ownership / file-to-route maps for precise `--changed` filtering.
|
||||
12. Consider true scoped outbound mocking (undici dispatcher) only if concurrent in-process dependency tests become a core promise.
|
||||
|
||||
|
||||
@@ -330,6 +330,13 @@ export function protocolLabScaffold(): ScaffoldResult {
|
||||
// hooks: { onResponse: { ensures: ['status != 429'] } },
|
||||
// },
|
||||
// },
|
||||
// scenarios: [{
|
||||
// name: 'create-and-read',
|
||||
// steps: [
|
||||
// { request: { method: 'POST', url: '/users', body: { name: 'test' } }, expect: ['status:201'], capture: { userId: 'response_body(this).id' } },
|
||||
// { request: { method: 'GET', url: '/users/{userId}' }, expect: ['status:200', 'response_body(this).name == "test"'] },
|
||||
// ],
|
||||
// }],
|
||||
};
|
||||
|
||||
const readmeContent = `
|
||||
@@ -374,6 +381,7 @@ Qualify can produce large output. In CI, use machine-readable formats and filter
|
||||
## Next Steps
|
||||
|
||||
- Define scenario sequences in your config.
|
||||
- Example scenario is commented out in apophis.config.js — uncomment and adapt.
|
||||
- Add route allowlists for chaos if needed.
|
||||
- Run \`apophis replay --artifact <path>\` to debug failures.
|
||||
`;
|
||||
|
||||
@@ -38,6 +38,13 @@ export interface EnvironmentPolicy {
|
||||
allowedModes?: ('verify' | 'observe' | 'qualify')[];
|
||||
blockQualify?: boolean;
|
||||
allowChaosOnProtected?: boolean;
|
||||
allowVerify?: boolean;
|
||||
allowObserve?: boolean;
|
||||
allowQualify?: boolean;
|
||||
allowChaos?: boolean;
|
||||
allowBlocking?: boolean;
|
||||
requireSink?: boolean;
|
||||
sinks?: Record<string, unknown>;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user