Skip to content

docs: add AGENTS.md with release, optional-peer, and repo-state notes#1736

Merged
marblom007 merged 3 commits into
masterfrom
docs/agents-md
Jul 22, 2026
Merged

docs: add AGENTS.md with release, optional-peer, and repo-state notes#1736
marblom007 merged 3 commits into
masterfrom
docs/agents-md

Conversation

@marblom007

@marblom007 marblom007 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Adds AGENTS.md (with CLAUDE.md symlinked to it) capturing knowledge that cost real time to rediscover while cutting v0.21.39.

The substantive entry is the barrel/optional-peer trap. src/index.tsx re-exports nearly everything, so a module-scope import of an optional peer in any reachable file makes import { anything } from '@sistent/sistent' throw for consumers who did not install it - naming sistent rather than the missing peer. #1732 fixed this for @mui/x-date-pickers; #1735 is the remaining date-fns instance.

The reason it is worth writing down: CI cannot catch it, because this repo always has its own devDependencies installed. It only appears in a downstream clean install. The note includes the one-line check that does catch it.

Also records:

  • a pointer to the existing release runbook at .claude/skills/cut-release/SKILL.md rather than restating it
  • that prettier --check (~82 files) and tsc --noEmit fail repo-wide today and are not CI gates, so contributors do not assume they broke something or mass-reformat to "fix" it

No code or config change.

Signed-off-by: Ahmed Jamil 197998703+CodeAhmedJamil@users.noreply.github.com

Summary by CodeRabbit

  • Documentation
    • Expanded the new root guidance document into a detailed “agent memory” release workflow, including how to determine what’s currently released, how release verification is performed by inspecting the build output, and rules for handling optional peer constraints.
    • Updated the assistant guidance entry to reference the new source of truth via a symbolic link.

Records the barrel/optional-peer trap found while releasing v0.21.39: a
module-scope import of an optional peer in any barrel-reachable file breaks
clean-install consumers, and CI cannot observe it because the repo always has
its own devDependencies installed. Points at the existing cut-release runbook
rather than restating it, and notes the pre-existing prettier/tsc failures so
the next contributor does not think they caused them.

Signed-off-by: Ahmed Jamil <197998703+CodeAhmedJamil@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 22, 2026 04:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 823b1bca-eb27-4054-8192-e2d28e09cea7

📥 Commits

Reviewing files that changed from the base of the PR and between 0df0e4c and d14a74a.

📒 Files selected for processing (1)
  • AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • AGENTS.md

📝 Walkthrough

Walkthrough

Adds root-level agent guidance for release procedures, package compatibility verification, optional peer constraints, repository health notes, and document maintenance. Replaces CLAUDE.md content with a pointer to AGENTS.md.

Changes

Agent guidance

Layer / File(s) Summary
Release and compatibility guidance
AGENTS.md
Documents automated release procedures, npm latest release identification, dist/ verification requirements, optional peer enforcement, known issues, and repository health notes.
Guidance source and maintenance
CLAUDE.md, AGENTS.md
Makes AGENTS.md the source of truth through CLAUDE.md and adds rules for maintaining the guidance document.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the documentation-only addition of AGENTS.md and its release, optional-peer, and repo-state notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/agents-md

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Around line 28-30: Update the build validation command in AGENTS.md to create
a package tarball after building, install or require that tarball from a
temporary consumer directory, and run the check there without the repository’s
optional peer dependencies. Replace the direct repo-tree require while
preserving the intended module-load verification.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb0ecf8a-ec6e-437e-817e-6d03d28f294e

📥 Commits

Reviewing files that changed from the base of the PR and between 46dcc81 and e91ad59.

📒 Files selected for processing (2)
  • AGENTS.md
  • CLAUDE.md

Comment thread AGENTS.md
@marblom007

Copy link
Copy Markdown
Contributor Author

Heads-up: #1737 merged and shipped in v0.21.40, which closes #1735. Two small updates for this file before it lands:

  1. The Known live instance line under "The barrel must not require an optional peer" is now stale - date-fns in UniversalFilter is fixed. Worth replacing the pointer to Barrel import still requires the optional peer date-fns (UniversalFilter), breaking clean-install consumers #1735 with a pointer to the regression guard, since that is the durable thing: src/__testing__/optionalPeerDependencies.test.ts now fails the build on any eager import/require/export ... from of an optional peer, and also fails if a new peer is marked optional without being added to the scan.

  2. The manual check in the note (node -e "require('./dist/index.js')" from a dir without the optional peers) is still a good pre-release sanity check, but it is no longer the only line of defence - the guard runs in CI on every PR now, which closes the "CI cannot see this" gap the note calls out. That paragraph may want softening from "CI cannot see this" to something like "CI could not see this until fix(peers): stop the barrel from requiring optional peer dependencies #1737 added a guard; the guard scans source, so the clean-install check is still worth running before a release."

Separately, the "repo state that looks broken but is pre-existing" section is accurate and was genuinely useful while working #1737 - the ~82 prettier failures are still there, and make lint running format:write before eslint is what keeps CI green despite them.

Also filed #1739 for a related but distinct trap in the same family: dist/index.mjs carries an extensionless lodash/debounce specifier that Node's ESM resolver rejects. Same shape - fails at import time, names a third-party package, invisible to CI - so it may deserve a line in this file once fixed.

The documented command required ./dist/index.js from inside the repo tree, so
Node resolved the optional peers out of the repo's own node_modules - the check
passed unconditionally and proved nothing, which is the exact failure mode the
section warns about. Pack the build and require it from a throwaway consumer
instead: npm installs required peers but not optional ones, reproducing a
downstream clean install.

Also record how to verify a published release by content rather than by the
version number moving - the extension contract export and the absence of a
module-scope optional-peer require are what the meshery-extensions chain
depends on - and note that current-version should be read from the npm latest
dist-tag rather than inferred from semver ordering.

Command block verified verbatim against the published 0.21.40 tarball:
optional peers absent, barrel loads.

Signed-off-by: Ahmed Jamil <197998703+CodeAhmedJamil@users.noreply.github.com>
@marblom007

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit's finding in 0df0e4c — it was correct and the impact was larger than low suggests: the documented verification command could not fail, because it required the barrel from inside the repo tree where the optional peers are always installed. Replaced with a pack-into-throwaway-consumer flow, validated verbatim against the published 0.21.40 tarball.

Also folded in two release-verification notes learned while cutting this release: verify a published version by content (extension contract export present, no module-scope optional-peer require) rather than by the version number moving, and resolve "what is current" from the npm latest dist-tag.

Still docs-only — AGENTS.md plus the CLAUDE.md symlink, no source or CI changes.

@copilot review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Around line 44-45: Update the optional-peer validation commands in AGENTS.md
to enumerate every optional peer declared in package.json, including date-fns
and `@mui/x-date-pickers`, and exit nonzero when any are installed before running
the `@sistent/sistent` require check. Preserve the require test only after
confirming all optional peers are absent.
- Around line 35-37: Update the AGENTS.md guidance around the throwaway consumer
check to distinguish it from the CI guard in optionalPeerDependencies.test.ts.
State that the CI test detects eager optional-peer imports at source level,
while the packed build loaded from a clean consumer validates built/published
behavior; present them as complementary checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d532f46e-46f4-4922-bea6-a294118a015c

📥 Commits

Reviewing files that changed from the base of the PR and between e91ad59 and 0df0e4c.

📒 Files selected for processing (1)
  • AGENTS.md

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Two corrections to the optional-peer section.

'CI cannot see this' went stale when #1737 landed
src/__testing__/optionalPeerDependencies.test.ts, which scans src/ for
load-time imports of an enforced optional peer and fails jest. Describe the two
guards as complementary instead: the test covers source, the packed-consumer
check covers what the bundler emitted and what is actually on npm - neither
subsumes the other. Point at the test as the source of truth for which peers
are enforced, since it is where the react / react-dom exemption is recorded.

The absence check only looked for date-fns and only warned, so it could print a
warning and then report a passing load with @mui/x-date-pickers still installed
- a false pass in exactly the situation the check exists to catch. It now walks
the enforced peers and exits nonzero.

Deliberately not enumerating every peer under peerDependenciesMeta: react and
react-dom are marked optional there but are imported at module scope by every
component, so requiring their absence could never pass. That exemption is
documented in the test rather than invented here.

Verified verbatim against the published 0.21.40 tarball: clean consumer loads
(exit 0); with date-fns force-installed it aborts (exit 1).

Signed-off-by: Ahmed Jamil <197998703+CodeAhmedJamil@users.noreply.github.com>
@marblom007

Copy link
Copy Markdown
Contributor Author

Both new findings addressed in d14a74a. Details in the threads.

@copilot review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants