Skip to content

fix(domain): box project route detail so master clippy passes - #2315

Merged
ScriptedAlchemy merged 8 commits into
masterfrom
fleet/clippy-large-err
Sep 27, 2026
Merged

ScriptedAlchemy merged 8 commits into
masterfrom
fleet/clippy-large-err

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Fixes #2308

Restores CI's clippy on master. Master had three kinds of breakage.

1. clippy::result_large_err (root cause of the report). TraceDecayError::ProjectRoute stored Option<ApplicationProblemDetailV1> inline since the typed problem detail work (#2283/#2289), so every Result<_, TraceDecayError> carried a 160-byte error. The detail is now Option<Box<ApplicationProblemDetailV1>>. project_route_with_detail is still the only constructor that attaches a detail, and project_route_typed_detail() still returns Option<&ApplicationProblemDetailV1>, so no caller changed. All 13 direct ProjectRoute { .. } sites either build typed_detail: None or match with .., so none needed edits. TraceDecayError is not serialized, so the wire shape is unchanged: contracts:check says "contracts up to date" and there is no SDK diff.

  • size_of::<TraceDecayError>(): 160 bytes before, 64 after.
  • New test errors::tests::error_stays_small_enough_to_return_by_value asserts <= 64. It fails on origin/master ("TraceDecayError grew to 160 bytes; box the new payload") and passes with the fix.

2. too_many_arguments and op_ref in tracedecay-query (introduced by d054014, merged through #2293). restore_content_addressed_with_progress took 8 arguments. All four callers passed the same CODE_LEXICAL_ARTIFACT_QUERY_CACHE_BUDGET_BYTES_V1, so the parameter is gone and the restore uses the query budget directly. &sections != … is now sections != ….

3. Red tests on master, found while proving the fix.

Local proof (on origin/master b80c426 merged in)

  • cargo clippy --workspace --all-targets --locked -- -D warnings: Finished, exit 0.

  • cargo clippy --workspace --all-targets --locked --features tracedecay/test-transport,tracedecay-cli/test-transport -- -D warnings: Finished, exit 0.

  • cargo check --workspace --all-targets --locked --target x86_64-pc-windows-gnu --features tracedecay/test-transport,tracedecay/test-helpers,tracedecay-cli/test-transport: exit 0.

  • cargo test --lib results:

    Crate Result
    domain 223 passed
    runtime-core 440 passed
    contracts 421 passed
    mcp 392 passed
    daemon-service 322 passed
    query 267 passed, 1 ignored
    code-index-runtime 521 passed, 2 ignored
  • cargo test -p tracedecay-cli --bin tracedecay: 332 passed, after building --example tracedecay-host-cli-fixture.

  • cargo fmt --all -- --check: clean.

  • pnpm run contracts:check: "contracts up to date".

@changeset-bot

changeset-bot Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5730ff6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T10:36:58.760959Z d196c18 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d196c1886c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

#[test]
fn error_stays_small_enough_to_return_by_value() {
assert!(
std::mem::size_of::<TraceDecayError>() <= 64,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the arbitrary 64-byte error-size gate

This test enforces a substantially stricter constraint than the result_large_err lint it is meant to protect: a legitimate future variant that makes TraceDecayError 72–120 bytes would still satisfy Clippy but would fail the unit suite and force unnecessary boxing. Rely on the workspace Clippy check, or at least derive the assertion from the lint's actual threshold instead of freezing the enum at its incidental current size; repository guidance also explicitly rejects hard-coded gate counts as acceptance evidence.

AGENTS.md reference: AGENTS.md:L172-L176

Useful? React with 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy merged commit 1a0287b into master Sep 27, 2026
1 check passed
@ScriptedAlchemy
ScriptedAlchemy deleted the fleet/clippy-large-err branch September 27, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(domain): TraceDecayError too large for clippy since 21552e3764

1 participant