Skip to content

Effect done well for agents — what t3code does #7

Closed

Description

@allisonmahmood

Question

How does t3code (local clone at ~/Dev/t3code) structure Effect so that agents write it well, and what would each practice cost us to adopt? The vendored .repos/effect-smol plus generated LLMS.md via sync:repos (pinned how, how large, how it stays in sync); the effect-service-conventions rules file; the lint rules (no-manual-effect-runtime-in-tests, no-inline-schema-compile, namespace imports for service modules, others); @effect/vitest layers; typed receipts instead of sleeps; service and layer conventions. Read the source, not summaries of it.

Output: docs/research/effect-for-agents-t3code.md on branch research/effect-for-agents-t3code. Waits on it: Chart the Effect v4 port map.

Activity

  1. added
    wayfinder:research
    on Aug 26, 2026
  2. allisonmahmood commented on Aug 26, 2026

    @allisonmahmood
    OwnerAuthor

    Resolution

    Write-up verified claim-by-claim against the t3code clone at e67074f, the vendored upstream sources, t3code PR bodies, the npm registry, and the language-service/tsgo/Macroscope docs, then corrected in place. File: https://github.com/allisonmahmood/patchy-cloud/blob/research/effect-for-agents-t3code/docs/research/effect-for-agents-t3code.md

    Summary

    • t3code does not rely on prose alone. It stacks five mechanisms, cheapest to dearest: a 155-line AGENTS.md that points agents at vendored upstream docs; the upstream LLMS.md and .patterns/ carried in by a git subtree; 25 @effect/language-service diagnostics set to error in tsconfig.base.json and surfaced by tsgo --noEmit; five custom oxlint rules; and a paid Macroscope review agent for the conventions that cannot be checked mechanically [1][3][5][6][7].
    • .repos/ is two git subtree --squash snapshots: Effect-TS/effect at tag effect@<pnpm catalog version> and alchemy-run/alchemy-effect at v<infra/relay dependency>. Together they are 97 MB, 12,961 of the repo's 16,066 tracked files (81%), and about 1.7 M lines of TypeScript, excluded from lint, format and test [2][4].
    • LLMS.md is not generated by t3code. It is upstream's effect-ai-docgen ai-docs/src -o LLMS.md output (382 lines, 16 KB) that the subtree happens to include, alongside upstream's .patterns/*.md and .agents/. None of that ships in the effect npm tarball, which does ship src/**/*.ts [8][9].
    • The pin is derived, not stored: sync:repos reads catalog.effect from pnpm-workspace.yaml and runs git subtree pull --prefix=.repos/effect-smol <url> effect@<version> --squash. Nothing automates it. Of the four catalog versions since June, the vendored copy matched two: it sat at beta.73 for 53 days after the beta.78 bump, and has sat at beta.102 for the 22 days since the beta.103 bump (2026-08-04) [2][10].
    • Effect namespace imports (import * as Effect from "effect/Effect") are enforced by the language-service (importFromBarrel: "error" with namespaceImportPackages: ["@effect/platform-node", "effect"]) plus Macroscope prose, not by oxlint. Result: across apps/, packages/, infra/ and scripts/ (tests included) 4,861 import * as X from "effect/..." lines vs 4 named imports from "effect". The oxlint namespace-node-imports rule covers only node:* and exists because the language-service option did not [5][6][11].
    • no-manual-effect-runtime-in-tests is a ratchet: any Effect.run* or ManagedRuntime.make in a *.test.ts is an error unless the file is in a hard-coded baseline (27 files, 244 occurrences). The baseline has shrunk by 5 occurrences in 2.5 months, so the debt is frozen rather than paid down [7].
    • no-inline-schema-compile (warn) flags Schema.decode*/encode*/is/asserts compiled inside a function body with a static schema; the landing PR hoisted "hundreds" of call sites to module scope and fixed a class of throw-on-encode bugs on the way [7][12].
    • The Macroscope check .macroscope/check-run-agents/effect-service-conventions.md is a 13 KB prose spec run by claude-opus-5 at effort: high on the full diff of every PR touching TS under apps/, packages/, infra/, with conclusion: failure (merge-blocking). It was tightened six times in the two days after landing. Macroscope is usage-billed SaaS [3][13][14].
    • Tests: 399 of 881 test files import @effect/vitest, none import vitest directly; 2,915 it.effect, 129 it.layer, 29 it.live; effect/testing/TestClock imported in 48 test files. @effect/vitest is patched to import from vite-plus/test, a cost specific to t3code's Vite+ toolchain [15][16].
    • "Typed receipts instead of sleeps" is precise about the target, not the mechanism: receipts are a Schema.Union of three milestone structs published by CheckpointReactor; the production layer's publish is a no-op and only the test layer is PubSub-backed. The integration harness's waitForReceipt polls a Ref of received receipts every 10 ms for up to 40 s. DrainableWorker.drain (65 uses in server tests) is the other wait primitive. 22 sleep/setTimeout calls remain in server tests [17][18][19].
    • Service conventions in code (non-test source under apps/, packages/, infra/): 224 Context.Service classes, 0 Context.Tag, 708 Schema.TaggedErrorClass vs 32 Data.TaggedError, 229 module-level make and 204 layer exports, consumers importing service modules as namespaces. The migration to single-file services is incomplete: 81 files still live under Services/ or Layers/ and 8 services still take a separate *Shape type [20][21].
    • For Patchy Cloud (no Effect dependency today; vitest 4, ESLint, TypeScript 6): AGENTS.md guidance, @effect/vitest, and the language-service plugin are cheap; porting the two Effect oxlint rules to ESLint is a few hundred lines; vendoring 97 MB that its own authors let drift, and a paid prose-driven review agent, are the two practices whose cost is not obviously earned [22].

    Open questions

    • How PR #4643 produced its incremental sync. git subtree merge --squash refuses to run when main carries no git-subtree-dir trailer, which is t3code's state after squash-merging, so the pull branch of sync:repos cannot have worked as written on a clean checkout; the PR (11,694 files) does not say whether the author ran it on a non-squashed branch, deleted and re-added the prefix, or something else.
    • Whether the language-service diagnostics actually gate CI in practice. The documented mechanism says yes (effect-tsgo patch + tsgo --noEmit + vpr typecheck, ignoreEffectErrorsInTscExitCode defaulting to false and unset in tsconfig.base.json), but no CI run failing on an Effect diagnostic was located.
    • How much the Macroscope agent catches. The repo records its spec and its revisions, not its findings, false-positive rate, or credit spend.
    • Whether the same Effect diagnostics are as complete on TypeScript 6 via @effect/language-service 0.87.2 as on TS 7 via @effect/tsgo; the rule docs list Effect versions per rule but not TS-version coverage, and two of t3code's error rules (missingEffectServiceDependency, schemaSyncInEffect) are listed as v3-only at tsgo HEAD.
    • Whether upstream intends to publish LLMS.md or ai-docs in the effect npm package; today the tarball is src/** and dist/** only, which is the whole reason the subtree exists.
    • Whether t3code will finish the Services/→single-file migration (81 files remain) or leave the Macroscope prose to apply only to touched code, which is what its "Do not demand unrelated repository-wide cleanup" line implies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions