Skip to content

trunk-merge/pr-1166/e12655c7-8f54-42ce-a701-b29bd165e4dd - #1167

Closed
trunk-io[bot] wants to merge 6 commits into
mainfrom
trunk-merge/pr-1166/e12655c7-8f54-42ce-a701-b29bd165e4dd
Closed

trunk-merge/pr-1166/e12655c7-8f54-42ce-a701-b29bd165e4dd#1167
trunk-io[bot] wants to merge 6 commits into
mainfrom
trunk-merge/pr-1166/e12655c7-8f54-42ce-a701-b29bd165e4dd

Conversation

@trunk-io

@trunk-io trunk-io Bot commented Aug 25, 2026

Copy link
Copy Markdown
Trunk Merge Pull Request Banner

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.

max-trunk and others added 6 commits August 24, 2026 15:28
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>
@trunk-staging-io

trunk-staging-io Bot commented Aug 25, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
pending_quarantine_test should be quarantined when run with variant A test marked as pending was expected to fail but unexpectedly passed. Logs ↗︎
variant_quarantine_test should be quarantined when run with variant A test expected the sum of 2 + 2 to be 5, but it was actually 4, indicating a failing assertion. Logs ↗︎

View Full Report ↗︎Docs

@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 59.72222% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.30%. Comparing base (308c2f3) to head (24a53f7).

Files with missing lines Patch % Lines
context-py/src/lib.rs 0.00% 15 Missing ⚠️
context-js/src/lib.rs 0.00% 14 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trunk-io trunk-io Bot closed this Aug 25, 2026
@trunk-io
trunk-io Bot deleted the trunk-merge/pr-1166/e12655c7-8f54-42ce-a701-b29bd165e4dd branch August 25, 2026 16:46
@trunk-io

trunk-io Bot commented Aug 25, 2026

Copy link
Copy Markdown
Author

Static BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
pending_quarantine_test should be quarantined when run with variant A test marked as pending was expected to fail but unexpectedly passed. Logs ↗︎
variant_quarantine_test should be quarantined when run with variant A test expected the sum of 2 + 2 to be 5, but it was actually 4, indicating a failing assertion. Logs ↗︎

View Full Report ↗︎Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants