Skip to content

core's agent guidance documents sudo() as returning AccessContext; it returns StackContext #1344

Description

@borisno2

The problem

packages/core/CLAUDE.md:60 documents sudo() as returning an AccessContext. It returns a StackContext.

The two differ in a way that matters: StackContext deliberately omits the ORM handle, so an author following this line and reaching for the handle finds nothing there.

Provenance

Made false by #1332. That pull request removed an as unknown as AccessContext cast which had been papering over exactly this difference — the plugin runtime was being handed something typed as one thing and shaped as another, and a write over it found nothing. Removing the cast was correct; this line was not updated with it.

Why it is low severity, and still worth fixing

The type system now rejects the mistake, and the plugin-owned write refuses a handle-less context by name rather than failing obscurely. So a reader is caught quickly.

But this is a CLAUDE.md — guidance an agent reads before writing code — and it currently describes a type the function does not return, in the file that is the reference for this package's context surface.

What to do

Correct the line, and check the surrounding entries against the real signatures rather than only this one. Two rounds of this delivery found that fixing a named line while its neighbours stayed wrong was the most common way a defect survived.

Context


_Generated by Claude Code

Activity

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

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions