Skip to content

Remove Context service definition stack capture - #7084

Merged
tim-smart merged 3 commits into
mainfrom
agent/codex-engineer/776e04b2
Aug 6, 2026
Merged

Remove Context service definition stack capture#7084
tim-smart merged 3 commits into
mainfrom
agent/codex-engineer/776e04b2

Conversation

@tim-smart

@tim-smart tim-smart commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop Context.Service from capturing definition-location stack frames
  • remove definition stack data from service keys, JSON, and missing-service errors

Testing

  • nix develop -c pnpm --dir packages/effect check
  • nix develop -c pnpm lint

Closes EFF-525

@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 91ad47f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
effect Patch
@effect/ai-anthropic Patch
@effect/ai-openai Patch
@effect/ai-openai-compat Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/openapi-generator Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node Patch
@effect/platform-node-shared Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/vitest Patch

Not sure what this means? Click here to learn what changesets are.

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

@effect-slopcop effect-slopcop Bot added 4.0 bug Something isn't working labels Aug 6, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — please add a changeset for this exported API change.

Reviewed changes

  • packages/effect/src/Context.ts: removed definition-location stack capture from Context.Service, dropped the optional stack property from Context.Key, removed stack from Service.toJSON(), and removed the "(defined at ...)" suffix from missing-service errors.
  • packages/effect/test/Context.test.ts: added a regression test asserting services no longer expose a stack property and that toJSON() excludes it.

ℹ️ Missing changeset

This PR changes runtime behavior and an exported public type (Context.Key.stack removed; Service.toJSON() shape changed), so it should include a .changeset/*.md entry per the repository convention.

Technical details
# Missing changeset for Context service stack removal

## Affected sites
- `packages/effect/src/Context.ts``Key` interface no longer has `stack`; `Service.toJSON()` no longer emits `stack`; missing-service errors no longer append "(defined at ...)".

## Required outcome
- A changeset file describing the removal of `Context.Key.stack` and the new JSON/error-message shape is present in `.changeset/`.

## Suggested approach
- Add a `.changeset/remove-context-service-stack.md` (or similar) with:
  ```md
  ---
  "effect": patch
  ---

  Remove the optional `stack` field from `Context.Key` and `Service.toJSON()`, and stop appending definition locations to missing-service errors.
  ```

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

pullfrog[bot]
pullfrog Bot previously requested changes Aug 6, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The latest commit removed the regression test that verified the stack-capture removal, and the PR still lacks a changeset for this exported API/runtime change.

Reviewed changes

Since the prior pullfrog review, commit d0c103a92 removed the regression test that the previous commit had added. No changeset was added for the public Context.Key.stack removal and Service.toJSON() shape change.

⚠️ Missing changeset

This PR removes the optional stack property from the public Context.Key interface and changes the shape of Service.toJSON(). These are exported API/runtime changes that require a .changeset/*.md entry per repository convention. The changeset-bot also flagged the absence.

Technical details
# Missing changeset for Context service stack removal

## Affected sites
- `packages/effect/src/Context.ts``Key` interface no longer has `stack`; `Service.toJSON()` no longer emits `stack`; missing-service errors no longer append "(defined at ...)".

## Required outcome
- A changeset file describing the removal of `Context.Key.stack` and the new JSON/error-message shape is present in `.changeset/`.

## Suggested approach
- Add `.changeset/remove-context-service-stack.md` (or similar) with:
  ```md
  ---
  "effect": patch
  ---

  Remove the optional `stack` field from `Context.Key` and `Service.toJSON()`, and stop appending definition locations to missing-service errors.
  ```

⚠️ Regression test removed without replacement

Commit d0c103a92 deleted the only test that verified services no longer expose a stack property and that Service.toJSON() excludes it. Without this coverage, the primary behavioral change of the PR has no automated regression guard.

Technical details
# Missing regression test for Context service stack removal

## Affected sites
- `packages/effect/test/Context.test.ts` — the "does not capture the service definition location" test added by `e668bb3d8` was removed by `d0c103a92`.

## Required outcome
- A test exists that asserts `"stack" in Service` is `false` and that `Service.toJSON()` returns `{ _id: "Service", key: ... }` without a `stack` field.

## Suggested approach
- Restore the removed test (or an equivalent assertion) in `packages/effect/test/Context.test.ts`.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@effect-slopcop effect-slopcop Bot added the enhancement New feature or request label Aug 6, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The changeset requested in the prior review is now present, but the regression test removed in d0c103a92 still has not been restored.

Reviewed changes

Since the prior pullfrog review, commit 91ad47f13 added .changeset/calm-services-rest.md to document the removal of definition-location stack capture from Context.Service.

⚠️ Regression test still missing

Commit d0c103a92 removed the only test that verified services no longer expose a stack property and that Service.toJSON() excludes it. The latest commit does not restore that coverage. Without an automated guard, the primary behavioral change of this PR has no regression protection.

Technical details
# Missing regression test for Context service stack removal

## Affected sites
- `packages/effect/test/Context.test.ts` — the "does not capture the service definition location" test added by `e668bb3d8` was removed by `d0c103a92` and has not been restored.

## Required outcome
- A test exists that asserts `"stack" in Service` is `false` and that `Service.toJSON()` returns `{ _id: "Service", key: ... }` without a `stack` field.

## Suggested approach
- Restore the removed test (or an equivalent assertion) in `packages/effect/test/Context.test.ts`.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
basic.ts 6.92 KB 7.13 KB -0.21 KB (-2.89%)
batching.ts 9.72 KB 9.92 KB -0.19 KB (-1.96%)
brand.ts 6.40 KB 6.40 KB 0.00 KB (0.00%)
cache.ts 10.59 KB 10.78 KB -0.19 KB (-1.73%)
config.ts 20.61 KB 20.79 KB -0.17 KB (-0.84%)
differ.ts 20.21 KB 20.37 KB -0.16 KB (-0.79%)
http-client.ts 21.50 KB 21.59 KB -0.09 KB (-0.43%)
logger.ts 10.81 KB 10.90 KB -0.10 KB (-0.89%)
metric.ts 8.86 KB 9.05 KB -0.19 KB (-2.12%)
optic.ts 7.25 KB 7.25 KB 0.00 KB (0.00%)
pubsub.ts 14.86 KB 15.05 KB -0.19 KB (-1.24%)
queue.ts 11.54 KB 11.72 KB -0.19 KB (-1.59%)
schedule.ts 10.71 KB 10.89 KB -0.18 KB (-1.68%)
schema-class.ts 19.14 KB 19.33 KB -0.19 KB (-0.99%)
schema-fromJsonSchemaDocument.ts 28.98 KB 29.15 KB -0.18 KB (-0.61%)
schema-representation-roundtrip.ts 25.28 KB 25.47 KB -0.18 KB (-0.73%)
schema-string-transformation.ts 13.31 KB 13.48 KB -0.17 KB (-1.25%)
schema-string.ts 10.85 KB 11.01 KB -0.16 KB (-1.45%)
schema-template-literal.ts 15.08 KB 15.27 KB -0.18 KB (-1.21%)
schema-toArbitraryLazy.ts 21.93 KB 22.11 KB -0.18 KB (-0.81%)
schema-toCodeDocument.ts 24.33 KB 24.50 KB -0.18 KB (-0.72%)
schema-toCodecJson.ts 19.17 KB 19.34 KB -0.17 KB (-0.86%)
schema-toEquivalence.ts 18.98 KB 19.17 KB -0.19 KB (-0.98%)
schema-toFormatter.ts 18.86 KB 19.03 KB -0.17 KB (-0.91%)
schema-toJsonSchemaDocument.ts 22.58 KB 22.75 KB -0.17 KB (-0.74%)
schema-toRepresentation.ts 19.48 KB 19.66 KB -0.18 KB (-0.91%)
schema.ts 18.40 KB 18.57 KB -0.18 KB (-0.95%)
stm.ts 12.59 KB 12.69 KB -0.10 KB (-0.81%)
stream.ts 9.67 KB 9.86 KB -0.19 KB (-1.96%)

@tim-smart
tim-smart merged commit f0be855 into main Aug 6, 2026
19 of 20 checks passed
@tim-smart
tim-smart deleted the agent/codex-engineer/776e04b2 branch August 6, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0 bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant