Skip to content

E6: pin Effect 4.0.0-rc.112 (and E7 working-rule docs) - #246

Draft
nikomatt69 wants to merge 6 commits into
live-mainfrom
cursor/e6-effect-rc-pin-001e
Draft

E6: pin Effect 4.0.0-rc.112 (and E7 working-rule docs)#246
nikomatt69 wants to merge 6 commits into
live-mainfrom
cursor/e6-effect-rc-pin-001e

Conversation

@nikomatt69

@nikomatt69 nikomatt69 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Issue for this PR

ROADMAP E6 (Now after #245). E7 is included in the same PR as allowed once the pin is in the tree.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Measured pin bump, not a rewrite. Research: specs/research-effect-4-rc.md (diff of effect@4.0.0-beta.83 vs 4.0.0-rc.112). npm's latest 4.0.0-rc.* on 2026-08-26 is still rc.112.

Grep against 480b8724 (packages/**/*.ts), not the research estimate:

Symbol Sites Files Replacement
Schema.TaggedErrorClass 112 53 Schema.TaggedError
Schema.ErrorClass 1 1 Schema.Error
HttpApiEndpoint.Any / AnyWithProps, HttpApiGroup.Any 6 2 Top / Constraint

Research said 109/52 for TaggedErrorClass; the extra three hits are comments and generated-string literals. Every other removed .d.ts symbol has 0 uses here. Layer / Cause / Stream / ScopedCache / ManagedRuntime were not touched.

The .d.ts grep missed runtime/property changes in httpapi-codegen that the pin actually requires: endpoint.identifier, SchemaRepresentation.toRepresentations, class markers ~constructor/~sentinels, RC built-ins shipping toCode + an effect/ representation instead of a generation annotation, fromJsonString allocating a new Transformation (so sameEncoding compares encoded to including Literal values), HttpApiClient.Client.Group dropping its identifier type argument, and OtlpTracer.make requiring OtlpExporter.Flusher. Sse.decode now also fails with SseError; sseFraming maps that to LLMError.

RC Schema.is* checks moved off annotations.meta._tag onto annotations.representation.id (effect/schema/isStartsWith) plus payload. zodObject dropped those filters, so Session.Info.parse accepted id: "invalid-id". The walker now reads the RC representation (meta fallback kept). That is why the first Windows smoke failed on Session > Info schema > rejects invalid id format; after 8588fb20 that suite is green on both cmd and pwsh.

beta.105 dropped implicit Issue#toString. test/server/httpapi-encode-failure.test.ts drives GET /session/:id after workspaceID: null and asserts the effect log still contains encoded route failed, Expected string, and ["workspaceID"]. The RC no longer says got null.

E7: working rule points at node_modules/effect/AGENTS.md and ai-docs/src. .nikcli/skill/effect-v4/SKILL.md is 34 lines and records only layer/defaultLayer, runPromiseWithLayer, and fromZod. Search for the old author-machine clone path under specs and packages is empty.

Not in this PR: R2, H9, H10, HTTP compression, SchemaBinary, Effect.withExecutionPlan.

How did you verify your code works?

  • GitHub ci-pipeline validate passed on 8588fb20 (4m57s). Typecheck job passed. Linux test job passed.
  • Local bun run typecheck 35/35.
  • bun test test/session test/util — 1000 pass / 0 fail. Session.Info.parse("invalid-id") throws again. effect-zod refinements including startsWith/endsWith pass.
  • Windows smoke (cmd and pwsh) on 8588fb20: typecheck and the four targeted suites all passed (double-ESC, session, config+worktree, util), plus --help / --version / binary build. The remaining red step is Built nikcli.exe boots the TUI (tui-smoke painted 0 printable characters). That step is not one of the four suites. windows-compat on live-main has been red since 2026-08-20 (last success); the latest live-main run failed at Windows typecheck and never reached TUI smoke.
  • bun test test/server/httpapi-encode-failure.test.ts test/server/httpapi-session.test.ts — 16 pass
  • additional httpapi-bridge, httpapi-bridge-401, httpapi-config, httpapi-client-compat, instance-scope, user-error — 32 pass
  • packages/httpapi-codegen — 86 pass / 0 fail, tsc --noEmit clean
  • bun run check:routes --strict — 338 contracts, 315 handlers, 23 raw
  • bun run generate:httpapi-clients — no drift after the RC codegen adaptations
  • grep for TaggedErrorClass / Schema.ErrorClass / HttpApiEndpoint.Any / HttpApiGroup.Any in packages/**/*.ts is 0
  • all nine workspace effect / @effect/platform-* pins are 4.0.0-rc.112; bun.lock one copy; npm latest 4.0.0-rc.* is still rc.112

Did not run bun run test:ci (the full nikcli shard). packages/llm has one pre-existing-looking toMatchObject assertion on OpenRouter cache hints (openrouter.test.ts:87); first assertion in that test still passes (4 cache controls). Not part of this pin's rename surface.

update-node-modules-hashes is continue-on-error on PRs. It fails because the nix node_modules fileset does not include the github workspace (Workspace not found "github"). Pre-existing packaging gap, not this pin; nix-eval passed.

Screenshots / recordings

N/A — pin bump, no UI.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
Open in Web Open in Cursor 

Move the workspace Effect pin from 4.0.0-beta.83 to 4.0.0-rc.112 (latest
4.0.0-rc.* on npm). Rename Schema.TaggedErrorClass to Schema.TaggedError
(112 sites / 53 files on live-main) and Schema.ErrorClass to Schema.Error.

httpapi-codegen type helpers follow the RC (Any/AnyWithProps → Top/Constraint)
plus the runtime/property changes the .d.ts diff could not see: endpoint
identifier, SchemaRepresentation.toRepresentations, class markers, builtin
toCode generation, and sameEncoding that no longer relies on Transformation
identity. Regenerated HTTP clients. Pin the encoded-route failure log on
Expected string at ["workspaceID"] after beta.105 dropped Issue#toString.
Replace the dangling author-machine effect-smol clone with
node_modules/effect/AGENTS.md and ai-docs/src. Add a short repo-only
skill for layer/defaultLayer, runPromiseWithLayer, and fromZod. Mark
E6 and E7 done in ROADMAP against the measured rename counts.
HttpApiEndpoint.Top is too tight for unused never params; keep a runtime
endpoint shape and map Group.Any to Constraint. Schema.toType and
Schema.make now return Constraint. Client.Group dropped the identifier
type argument. Provide OtlpExporter.layerFlusher, and map SseError onto
LLMError so sseFraming stays closed.
@github-actions github-actions Bot added size/XL PR touches 903 lines area/sdk area/deps area/cli area/docs area/server and removed size/XL PR touches 903 lines labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

Scorecard details
PackageVersionScoreDetails
npm/@effect/platform-node 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown
npm/@effect/platform-bun 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown
npm/@effect/platform-node 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown
npm/@effect/platform-bun 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown
npm/effect 4.0.0-rc.112 UnknownUnknown

Scanned Files

  • packages/http-recorder/package.json
  • packages/httpapi-codegen/package.json
  • packages/llm/package.json
  • packages/nikcli/package.json
  • packages/plugin/package.json
  • packages/sdk-next/package.json
  • packages/simulation/package.json
  • packages/tui/package.json
  • packages/util/package.json

CI format:check failed because TaggedError is shorter than TaggedErrorClass
and prettier wants those two class declarations on fewer lines.
@nikomatt69

Copy link
Copy Markdown
Owner Author

⚠️ CI Validation Failed

@nikomatt69 — validation failed on this commit.

Detail Value
Failed step Unknown step
Autofix status ⏭️ Autofix skipped
Run View full logs

Failure Summary

(no summary available)

Please inspect the full Actions logs for complete output. Do not share this comment publicly — it may contain redacted paths.

@github-actions github-actions Bot added the size/XL PR touches 903 lines label Aug 26, 2026
RC 4.0.0 moved isStartsWith / isPattern / isMinLength off
annotations.meta._tag onto annotations.representation.id + payload.
zodObject dropped those filters, so Session.Info.parse accepted
invalid-id. Read the RC representation and keep the meta fallback.

@nikomatt69 nikomatt69 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Ultrareview (bugs / security / performance / patterns)

Four-role review of this draft pin. Validate / typecheck / Linux test are green. Windows smoke is red; that matches live-main history (TUI smoke / heap), not a new pin-only typecheck break.

[HIGH] RC SseError is mapped in sseFraming and left open on the generated Effect client

The RC decoder fails with tagged SseError (e.g. EventTooLarge) in addition to Retry. This PR closes that channel in packages/llm/src/protocols/shared.ts. The production in-process client is emitEffectImported, whose mapClientError still is:

HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error)
  ? new ClientError({ cause: error })
  : error

Retry becomes ClientError. SseError is returned as-is. Call sites that catchTag("ClientError") / instanceof ClientError do not see an oversized (or otherwise failed) SSE event. client.ts was not regenerated in this PR (only client-error.ts renamed), so the shipped mapper matches the stale template.

The per-endpoint emitEffect mapper at index.ts:1833 wraps unknown errors, so fixture clients do not leak. Nikcli’s imported client does.

Sse.SseError has no static .is (only Retry does). Use instanceof.

Fix: treat SseError like Retry in the emitEffectImported template, regenerate with bun run generate:httpapi-clients, and add a codegen assertion that the imported mapper mentions SseError.

⚠ regression — SSE error channel / ClientError contract
⚠ propagation — httpapi-codegen feeds every generated Effect client

Other dimensions

No security, performance, or additional pattern issues that survived validation. Pins are consistent at 4.0.0-rc.112. effect-zod representation walker plus the startsWith/endsWith test close the Session.Info id-format hole this pin first exposed.

Independent of #247 (E8). ROADMAP.md will conflict if both merge without a rebase; numbering is already consistent (this PR owns E6/E7).

Validation Summary

Total findings: 1 | Valid: 1 | Invalid: 0
By severity: CRITICAL: 0, HIGH: 1, MEDIUM: 0, LOW: 0
Warnings: propagation: 1, regression: 1

@nikomatt69 nikomatt69 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Line comment on sseFraming: RC SseError is closed here and still leaks through the generated Effect client's mapClientError. See the review summary.

Stream.decodeText(),
Stream.pipeThroughChannel(Sse.decode()),
Stream.catchTag("Retry", () => Stream.empty),
Stream.catchTag("SseError", (error) => Stream.fail(eventError("sse", error.message))),

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

[HIGH] This closes RC SseError on the LLM framing path only.

The generated Effect client mapper (packages/httpapi-codegen/src/index.ts emitEffectImportedpackages/nikcli/src/server/httpapi/client/generated/client.ts mapClientError) still wraps Sse.Retry and returns every other error as-is. After this pin, Sse.decode / HttpApiClient streams also fail with SseError (e.g. EventTooLarge). Callers that catchTag("ClientError") miss it.

Treat error instanceof Sse.SseError like Retry in that template, run bun run generate:httpapi-clients, and pin it with a codegen test. Sse.SseError has no static .is.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants