agentleFS
AWSKnown publisheraws/aws-durable-execution-sdk-python/AGENTS.md

aws-durable-execution-sdk-python

AGENTS.md56 starsChanged 6 months agoApache-2.0View on GitHub

This repository contains the AWS Durable Execution SDK for Python and its companion packages, used to author AWS Lambda durable functions. Do not rely on this file for method signatures, configuration objects, or code examples. The canonical reference is the AWS Durable Execution SDK Developer Guide, which is maintained alongside SDK releases and covers TypeScript, Python, and Java. Key sections: For Lambda service topics such as deployment, infrastructure as code, invocation, IAM permissions, and quotas, see the Lambda durable functions…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not rely on this file for method signatures, configuration objects, or code examples.

    line 8
  2. Distinctive:

    Never call durable operations inside a step: Use a child context to group operations.

    line 46
  3. Very specific:

    Side effects outside steps repeat on every replay: Put side effects in steps.

    line 50
  4. Very specific:

    Do not use yaml.load() or yaml.load_all(), including with Loader= arguments or suppression comments.

    line 59
  5. Very specific:

    Use yaml.safe_load() or yaml.safe_load_all() for plain YAML.

    line 62
  6. Very specific:

    Before finishing YAML-related changes, check Python code for unsafe call forms: rg -n --glob '*.py' "yaml\\.load\\b|yaml\\.load_all\\b|from …

    line 70
  7. Distinctive:

    Do NOT add or modify conformance tests without coordinating with the team.

    line 78
  8. Very specific:

    Read CONTRIBUTING.md before making changes.

    line 87
  9. Distinctive:

    When the developer guide and the installed SDK source disagree, trust the source in this repository and report the discrepancy.

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AWS Durable Execution SDK for Python - Agent Guide

This repository contains the AWS Durable Execution SDK for Python and its companion packages, used to author AWS Lambda durable functions.

Use the developer guide, not this file, for APIs

Do not rely on this file for method signatures, configuration objects, or code examples. The canonical reference is the AWS Durable Execution SDK Developer Guide, which is maintained alongside SDK releases and covers TypeScript, Python, and Java. Key sections:

For Lambda service topics such as deployment, infrastructure as code, invocation, IAM permissions, and quotas, see the Lambda durable functions guide.

Critical rules: the replay model

Durable functions use checkpoint and replay. After a wait, failure, or resume, code re-runs from the beginning. Completed steps return their checkpointed results without re-executing, and code outside steps runs again on every replay. This implies four rules:

  1. Code outside steps must be deterministic. Wrap timestamps, random values, UUID generation, API calls, and any other non-deterministic work in a step.
  2. Never call durable operations inside a step. Use a child context to group operations.
  3. Closure mutations inside steps are lost on replay. Return values from steps instead of mutating enclosing scope.
  4. Side effects outside steps repeat on every replay. Put side effects in steps. context.logger is the exception: it is replay-aware and safe anywhere.

See Determinism and Replay for worked examples.

Security-sensitive parsing

  • Do not use yaml.load() or yaml.load_all(), including with Loader= arguments or suppression comments. CodeQL and security scanners flag the unsafe call form even when the loader subclasses yaml.SafeLoader.
  • Use yaml.safe_load() or yaml.safe_load_all() for plain YAML.
  • For CloudFormation or SAM templates with short-form tags such as !Ref, !Sub, !GetAtt, or !If, use a yaml.SafeLoader subclass with explicit tag constructors so the tags are preserved.
  • For custom safe loaders, instantiate the loader directly, call get_single_data() or the equivalent multi-document API, and call dispose() in a finally block. This matches what yaml.safe_load() does internally while preserving custom tag support.
  • Before finishing YAML-related changes, check Python code for unsafe call forms: rg -n --glob '*.py' "yaml\\.load\\b|yaml\\.load_all\\b|from yaml import load\\b|from yaml import load_all\\b" .

Testing Requirements

All changes MUST include related tests. At minimum, include unit tests. Include e2e integration tests (in the tests/e2e/ directory) when the change affects cross-component behavior, public API surfaces, or end-to-end workflows. For isolated bug fixes where a unit test alone sufficiently covers the fix, integration tests are not required.

Do NOT add or modify conformance tests without coordinating with the team. Conformance test requirements and the runner live in a separate repository (aws-durable-execution-conformance-tests). If a change warrants a new conformance test, note it in the PR description or open an issue in that repository.

Working in this repository

  • Packages live under packages/: the core SDK (aws-durable-execution-sdk-python), the testing library (aws-durable-execution-sdk-python-testing), the OpenTelemetry plugin (aws-durable-execution-sdk-python-otel), and examples (aws-durable-execution-sdk-python-examples).
  • Read CONTRIBUTING.md before making changes. Use hatch for all tests, type checks, and formatting (for example hatch run dev-core:test, hatch run dev-core:typecheck, and hatch fmt --check from a package directory).
  • When the developer guide and the installed SDK source disagree, trust the source in this repository and report the discrepancy.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.