docs: add STYLE.md documenting unwritten coding conventions - #1335
Merged
Conversation
This document complements CodingStandards.md by capturing the style conventions that live between the lint rules — the choices that survive only through review and through documentation. The guide covers: - Function/closure/class role split and DI patterns - `.then()` chains over async/await, with rationale - The two-error blame taxonomy (CaseConfigurationError vs CaseCoreError) - Wire-format namespaced keys and type-tag constants - Context threading and location trails for error messages - Plugin executor shapes and registry patterns - Documentation as a build artifact with release tags - Testing patterns (no mocking library, test-data factories) - Cross-language mirroring rules for Java and other bindings - Known deviations (things to migrate opportunistically) The guide also includes the motivation and trade-offs for each convention, so future maintainers understand not just the rules but why they exist. Distilled from reading ~700 lines of TS source and 25+ files across all packages. Co-Authored-By: Timothy Jones <timothy.l.jones@gmail.com>
The function plugin's index.ts file incorrectly listed 'ContractCase Core HTTP Plugin' in the copyright banner. Corrected to 'ContractCase Core Function Plugin'. Co-Authored-By: Timothy Jones <timothy.l.jones@gmail.com>
TimothyJones
enabled auto-merge (squash)
July 5, 2026 03:13
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
Adds a new
STYLE.mdguide that documents the coding conventions in ContractCase that are not enforced by lint or covered by the existingCodingStandards.md. This captures the unwritten rules that survive through review — the trade-off reasoning behind key architectural choices — so that future maintainers (and LLMs) understand not just the rules but why they exist.The guide covers:
.then()chains overasync/awaitAlso includes:
Promise.resolve(() => {})bug in FunctionResultMatcher.tsThis is the companion to
CodingStandards.md— one is the machine-checked rules, the other is the hand-maintained conventions.Test plan
I've added the commit override below, since the PR from the fork didn't merge the normal way, we have to override release please somehow.
BEGIN_COMMIT_OVERRIDE
fix(plugins)!: Plugins names are now restricted to be node module names, preventing malicious contracts or clients of the contract server from loading arbitrary code via remote or inline URIs. This is technically a breaking change, as remote and inline URIs for plugins were previously unintentionally supported.
END_COMMIT_OVERRIDE