trunk-merge/pr-1166/e12655c7-8f54-42ce-a701-b29bd165e4dd - #1167
Closed
trunk-io[bot] wants to merge 6 commits into
Closed
trunk-merge/pr-1166/e12655c7-8f54-42ce-a701-b29bd165e4dd#1167trunk-io[bot] wants to merge 6 commits into
trunk-io[bot] wants to merge 6 commits into
Conversation
A test case id is only unique within a (collection, repo) pairing: ids are generated from framework-internal values, and `--no-repo` deliberately makes the same test share one id across a collection's repos. Consumers that need to address a single test case by one value -- links, APIs, webhooks -- have no id to use. Add `gen_test_case_guid(test_collection_id, repo_id, test_case_id)`, a deterministic UUIDv8 derived from that whole identity tuple, so it is unique by construction and inherits the tuple's semantics (including the `--no-repo` collapse to one id per collection). The hash contract is frozen: the three ids as canonical lowercase text, joined with `#`, SHA-256, first 16 bytes, stamped as an RFC 9562 UUIDv8. The stamp is required rather than cosmetic -- consumers validate the value with a UUID matcher that enforces the version and variant nibbles. Two golden vectors are pinned in the Rust tests and mirrored into the JS and Python binding suites, which is what keeps every copy of the contract honest. `gen_info_id` is untouched, so existing bindings and their pinned tests are unaffected. Exported through context-js and context-py alongside it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The doc comments restated the algorithm the code already shows. Keep only what is not visible from reading it: why the tuple is the identity, that the contract is frozen, and that the v8 stamp is load-bearing rather than decorative. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nine new lint findings, all in the two test files this PR adds: - `vitest/prefer-describe-function-title` wants the identifier when a describe title is exactly a function name, while `vitest/valid-title` rejects a non-string title — the two conflict, and trunk's autofix for the first produced a violation of the second. A string that isn't an exact match satisfies both. The `gen_info_id` describe was pre-existing but became a "new" finding once my import shifted its line. - `vitest/require-to-throw-message`: assert the message rather than bare throw. - pytest isn't resolvable in the pyright environment (nothing else here imports it), so the raises test uses try/except instead of depending on it. - `context_py`'s stub is generated rather than committed, so pyright strict can't type anything imported from it. Annotating or `str()`-wrapping just relocates the unknown, so the two call sites and the import carry targeted suppressions, matching the existing precedent in test_parse_codeowners.py. `trunk check` is clean; 113 Rust and 33 context-js tests still pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…uppressions pyright type-checks context-py against context_py.pyi, which is generated by a trunk action rather than committed. Trunk actions run on git hooks, not during `trunk check`, so a developer's tree has the stub and CI never does — every symbol imported from context_py is `Unknown` there, which is most of this repo's standing pyright findings and why adding one import produced a new one. The trunk check job already builds the wasm package for exactly this reason on the JS side (eslint needs the generated pkg/ to resolve). Generating the Python stub is the missing counterpart, and the job already builds the workspace, so it is nearly free. With the stub present the suppressions are unnecessary, so they are gone and the tests keep their natural shape. Existing pyright findings across context-py drop from 70 to 47 as a side effect. The raises test still uses try/except rather than pytest.raises: pytest is not resolvable in the pyright environment either, and nothing else in this directory imports it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review nit: parentheses in the describe titles. They were threading a rule
conflict — `vitest/valid-title` rejects both the bare function name as a string
and a function reference, so only a non-matching string passes.
Splitting the guid tests into their own file (matching how the other suites here
are organised) fixes it more cleanly: the new block gets a descriptive title, and
meta.test.ts goes back to byte-identical with main. It was only in the diff
because adding a third name to its import made prettier wrap the line, which
pulled the pre-existing `describe("gen_info_id", …)` into the changed set and
made a long-standing lint finding count as new.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1167 +/- ##
==========================================
+ Coverage 83.17% 83.30% +0.12%
==========================================
Files 72 72
Lines 16241 16313 +72
==========================================
+ Hits 13509 13589 +80
+ Misses 2732 2724 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
trunk-io
Bot
deleted the
trunk-merge/pr-1166/e12655c7-8f54-42ce-a701-b29bd165e4dd
branch
August 25, 2026 16:46
Author
|
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.
This pull request was created and is being managed by Trunk Merge.
This pull request is based on the main branch at SHA 308c2f39ec62026db26703799261a365b6d9ff82.
See more details here.
When CI completes, this pull request will be closed automatically.
Pull Requests Being Tested
This pull request is testing the changes from pull request 1166.