Skip to content

fix(cedar): the documented embedding helpers fail EVL001/EVL004 in a user's project #5514

Closed

Description

@lex00

Defect

The cedar docs show the AgentCore and AVP embedding helpers called inside a resource constructor:

new BedrockAgentCorePolicy({
  PolicyEngineId: engine.ref(),
  ...agentCoreStagedPolicy("writeNeedsApproval", writeNeedsApproval, "log-only"),
});

new VerifiedPermissionsPolicy({
  PolicyStoreId: policyStore.ref(),
  Definition: avpPolicyDefinition("ownerRead", ownerReadProps, { ... }),
});

(lexicons/cedar/docs/pages/dogwood.mdx:135, lexicons/cedar/README.md:259, src/skills/chant-cedar-dogwood.md:196, src/skills/chant-cedar-avp-embedding.md:53.)

chant lint on a project that copies these reports EVL001 on both calls and EVL004 on the spread. Reproduced on main (f3fb201) with a scratch project: EVL001 at the spread and at Definition:, EVL004 at the spread.

The cause is on the lint side. These helpers are pure functions of their arguments that return plain props data, which is what IntrinsicDef.foldsEagerly exists to declare, but the cedar plugin registers no intrinsics, so EVL001 (packages/core/src/fold/subset.ts, the bare-call branch) treats them as arbitrary package calls. EVL004 (packages/core/src/lint/rules/evl004-spread-non-const.ts isTraceableToConst) rejects every call as a spread source, including a registered eager intrinsic, although fold() folds that spread (packages/core/src/fold/fold.ts, eager call branch plus the SpreadAssignment branch).

#5509 hid this in the cedar examples by turning EVL001/EVL004 off in their chant.config.ts. A user following the docs still gets the errors.

The dogwood builders are a separate case. The docs call them through the namespace (dogwood.formerly(...)), which EVL001 already accepts as a method call. Only the two examples destructure them (const { formerly } = dogwood) and call them bare, which EVL001 flags; that is the rest of what #5509 turned off.

Fix

  • cedar registers its embedding helpers (agentCoreStatement, agentCorePolicyDefinition, agentCorePolicyResource, agentCoreStagedPolicy, agentCorePolicyName, avpStatement, avpPolicyDefinition, avpPolicyResource) as foldsEagerly intrinsics, so EVL001 accepts them through the registry it already receives.
  • EVL004 accepts a spread whose source is a call to an intrinsic the active lexicons registered foldsEagerly, matching what fold() does. A lexicon that registers nothing gets no change; foldsAsCall intrinsics stay rejected, since they fold to an envelope that cannot be spread.
  • The two cedar examples call the dogwood builders through dogwood. as the docs do, and the fix(cedar): turn off the fold-subset lint rules in the dogwood examples #5509 rule overrides are removed.
  • Docs describe the result.

Activity

  1. added
    bug
    epic:ci-hardening
    area:cedar
    area:lint
    on Nov 23, 2026
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

    area:cedararea:lintbugepic:ci-hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions