Improve agent context: boundaries, decisions, test norms, idempotency#3635
Open
Mpdreamz wants to merge 1 commit into
Open
Improve agent context: boundaries, decisions, test norms, idempotency#3635Mpdreamz wants to merge 1 commit into
Mpdreamz wants to merge 1 commit into
Conversation
- AGENTS.md: add cross-cutting decisions (AOT/JsonSerializerContext rule, shared search contract rationale), an explicit never-touch/human-gated boundaries section, a test-alongside-change norm with the real change->test-project mapping, and correct the inaccurate TUnit claim (currently xUnit v3 + AwesomeAssertions + FakeItEasy; TUnit is the org's pending migration target, not yet in use). - Add module-scoped AGENTS.md for src/Elastic.Markdown and src/services/search/Elastic.Documentation.Search.Contract, modeled on the existing src/Elastic.ApiExplorer/AGENTS.md. - Add an idempotency/convergence test for IndicesCleanupPlanner proving a cleanup re-plan after a partial apply deletes nothing further. - CONTRIBUTING.md: add a short "Working on non-trivial changes" section asking for a brief plan/definition-of-done before non-trivial work. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reakaleek
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves how well an AI agent can work in this repo without prior context: explicit safety boundaries, cross-cutting architectural rationale, a real test-alongside-change norm, module-scoped context for two core subsystems, and a fixed inaccuracy in the testing stack description. Also adds a genuine idempotency test and a lightweight "write a short plan first" norm for non-trivial work.
AGENTS.md(symlinked fromCLAUDE.md):essc indicescommands,[CommandIntent(Intent.Destructive)]-taggeddocs-buildercommands, environment-gated Lambda deploys, andconfig/assembler.yml's public-bucket allowlist blast radius.JsonSerializerContextregistration rule, and why the search contract is a separate shared project.AGENTS.mdforsrc/Elastic.Markdown/andsrc/services/search/Elastic.Documentation.Search.Contract/, modeled on the existingsrc/Elastic.ApiExplorer/AGENTS.md(structure map, named patterns, "where do I put X" table).Applying_the_plan_then_replanning_yields_no_further_deletionsinIndicesCleanupPlannerTests.cs— provesIndicesCleanupPlanner.Planconverges on retry (safe to re-run after a partial apply).CONTRIBUTING.md: added a short "Working on non-trivial changes" section asking for a brief plan/definition-of-done before non-trivial implementation.Why
The repo was already in good shape going into this — a clean, real
AGENTS.md/CLAUDE.md, disciplined commit/PR history, fast unit tests, environment-gated prod deploys, and a scoped context file for the one subsystem (ApiExplorer) that had already been deliberately restructured. None of that changed here. What moved the score was almost entirely encoding more of what's already true about this codebase intoAGENTS.md— explicit boundaries, decision rationale, and module-scoped conventions that previously lived only in people's heads or in scattered PRs — plus one small, genuine gap (an idempotency test) and one real inaccuracy (the TUnit claim).Before / after
Self-scored against a 6-pillar rubric (Context Legibility, Blast Radius & Boundaries, Verification Determinism, Task Decomposability, Tool & Environment Reachability, Idempotency & Retry Safety), each 0–100:
DandEare mostly gated by things outside this repo's docs (issue-tracker practice, an upstream UI-only content source) and weren't expected to move much from a doc-only PR — left as-is rather than overclaimed.Test plan
dotnet build— 0 errorsdotnet format --verify-no-changes— cleandotnet test tests/Elastic.SiteSearch.Tests/— 172/172 passed (including the new idempotency test)./build.sh unit-test— full suite green (~50s)🤖 Generated with Claude Code