Add two usage patterns and three future-enhancement proposals#1806
Merged
pmcelhaney merged 3 commits intomainfrom Apr 10, 2026
Merged
Add two usage patterns and three future-enhancement proposals#1806pmcelhaney merged 3 commits intomainfrom
pmcelhaney merged 3 commits intomainfrom
Conversation
Closed
Copilot
AI
changed the title
[WIP] Review usage patterns and suggest undocumented candidates
Add two usage patterns and three future-enhancement proposals
Apr 9, 2026
pmcelhaney
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the usage patterns catalogue with two patterns covering currently-supported but undocumented features, and proposes three future patterns as GitHub issues.
New pattern files
docs/patterns/automated-integration-tests.md) — embeds Counterfact in a Jest/Vitest suite viabeforeAll/afterAllusing the programmatic API; showscontextRegistryfor per-test flag togglingdocs/patterns/custom-middleware.md) — covers_.middleware.tsfor auth gates, response headers (withrandomUUIDimport), request logging, and scoped admin-only middlewareIndex updates (
docs/usage-patterns.md)Issue proposals (
.github/issue-proposals/) — all parented to #1805docs-pattern-record-and-replay.md—--recordflag to capture proxy traffic into handler filesdocs-pattern-webhook-simulation.md—$.webhook()helper for outbound push eventsdocs-pattern-persistent-state.md—--persist-stateto serialize/restore context across restartsOriginal Prompt
Issue: More usage patterns
Review the usage patterns and suggest candidates that haven't been documented yet. Include patterns that Counterfact doesn't support but should be considered for future enhancements.
Manual acceptance tests
docs/usage-patterns.mdtable contains rows for Automated Integration Tests and Custom Middleware; intro paragraph references bothdocs/patterns/automated-integration-tests.mdrenders with a completebeforeAll/afterAllexample using a sharedconfigobject (no duplicate config literal)docs/patterns/custom-middleware.mdrenders withimport { randomUUID } from "node:crypto"in the response-headers example.github/issue-proposals/with valid YAML front matter (parentIssue: 1805) and non-empty bodiesTasks
docs/patterns/automated-integration-tests.mddocumenting programmatic API usage in test suitesdocs/patterns/custom-middleware.mddocumenting_.middleware.tsfor cross-cutting concernsdocs/usage-patterns.mdtable and intro paragraph.changeset/more-usage-patterns.md