Skip to content

docs(agents): verify and refresh AGENTS.md + CLAUDE.md against the current codebase#495

Merged
Gajesh2007 merged 3 commits into
masterfrom
docs/agents-md-refresh
Jul 3, 2026
Merged

docs(agents): verify and refresh AGENTS.md + CLAUDE.md against the current codebase#495
Gajesh2007 merged 3 commits into
masterfrom
docs/agents-md-refresh

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

Full verification pass over both agent-onboarding docs: every factual claim treated as a hypothesis and checked against source. ~96 insertions / 56 deletions across the two files.

Before / After

flowchart LR
  subgraph Before
    A1["agent reads AGENTS.md/CLAUDE.md"] --> B1["stale facts: 3x memory rule (gone),<br/>ScoreProvider (deleted), ChatML inject (never true),<br/>Solana billing (removed), wrong package descriptions,<br/>wrong paths, missing subsystems"]
    B1 --> C1["agent designs against a codebase<br/>that no longer exists"]
  end
  subgraph After
    A2["agent reads AGENTS.md/CLAUDE.md"] --> B2["UnifiedMemoryCap model, cost-based selection,<br/>TemplateRenderCheck reality, current routes/packages,<br/>new hot-path subsystems documented,<br/>hypervisor legacy-compat note"]
    B2 --> C2["docs match code<br/>(every cited path/symbol existence-checked)"]
  end
Loading

Highlights

  • Memory model: replaced the dead estimatedMemoryGb × 3.0 rule with UnifiedMemoryCap (0.90 cap, 4 GiB load headroom, post-load KV guard, env overrides) and the freeForLoadGB mirroring nuance
  • Scheduler: ScoreProvider (deleted code) removed from both files; cost/penalty model documented; pendingModelLoads reader list corrected
  • False claims removed: ChatML auto-injection (no such code — replaced with TemplateRenderCheck/template_render_ok routing), Solana billing rail, CLAUDE.md's "Postgres not used in production yet"
  • Paths/structure: coordinator/internal/e2e/, telemetry/ vs datadog/ descriptions, consumer route list, CLI command list, runbook paths, admin-ui/landing/deploy + 7 missing coordinator packages added to the maps
  • New subsystems documented (one bullet each): single-parse frame decode, chunk-key cache lifecycle, two-lane writer + watchdog, overflow grace-then-499 policy, hypervisor legacy-compat (chore(attestation): retire the hypervisor_active stub — field, entitlement, and false UI claims #492)
  • Full verified-accurate list, evidence per correction, and overlap assessment (~60-65% duplication between the two files) in the agent report

Open questions for reviewers

  1. CLAUDE.md Infrastructure table says the prod console is an EigenCloud app — unverifiable from the repo (dev is Vercel). Left as-is; please confirm or correct.
  2. The continuous-batching benchmark figures (B=4 speedups) live in the submodule and were left unverified.
  3. Out of scope but flagged: coordinator/registry/scheduler.go:60 comment still references the deleted scripts/calibrate-routing.sh.

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

…rrent codebase

Every factual claim in both files was checked against source; stale ones
fixed with evidence, missing subsystems added, deleted things purged.

Headline corrections:
- Memory model: the 'estimatedMemoryGb * 3.0 headroom' rule is long gone —
  documented UnifiedMemoryCap (0.90 cap fraction, 2 GiB OS floor, 4 GiB
  load headroom, post-load measured-KV guard, env overrides) and the
  freeForLoadGB mirroring on the coordinator side.
- Provider scoring: ScoreProvider no longer exists; selection is
  cost/penalty-based. WarmModels warm-bonus claim removed.
- pendingModelLoads readers: now also cold-spill eligibility + warm-pool
  controller.
- coordinator/e2e/ -> coordinator/internal/e2e/; telemetry/ vs datadog/
  package descriptions swapped to reality; consumer routes (no
  transcriptions/images; /v1/responses exists); Solana rail removed from
  billing descriptions; darkbloom CLI command list (no serve).
- ChatML auto-inject claim was false — replaced with TemplateRenderCheck /
  template_render_ok routing reality.
- LatestProviderVersion is the no-release-row fallback, not the source of
  truth; release tag shapes; runbook paths (docs/operations/*).
- CLAUDE.md store-selection claim ('Postgres not used in production yet')
  was flat wrong; ARV enforcement claim softened to logged-only.
- 12 -> 14 E2E tests; structure maps gain apns/config/env/profilesign/
  stateexport/routingsim/api/types, admin-ui/, landing/, deploy/.

Added (one bullet each): type_scan single-parse decode, chunk_key_cache
forget-on-terminal lifecycle, two-lane provider writer + watchdog,
chunk-overflow 250ms-grace-then-499 policy, hypervisor_active legacy-compat
note (#492).

Open question flagged for review: CLAUDE.md Infrastructure table claims the
prod console is an EigenCloud app — could not be confirmed from the repo;
left unchanged.
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
d-inference Ready Ready Preview Jul 2, 2026 11:58pm
d-inference-console-ui-dev Ready Ready Preview Jul 2, 2026 11:58pm
d-inference-landing Ready Ready Preview Jul 2, 2026 11:58pm

Request Review

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No security-relevant changes: this PR only modifies AI agent instruction files and has no impact on any trust boundary or asset defined in the threat model.

Neither AGENTS.md nor CLAUDE.md is present in any affected_files list, and neither file is part of the production runtime (coordinator, provider-swift, or console-ui). They contain no secrets, no auth logic, no network handlers, and no build artifacts that ship to production.

New trust-boundary surface? No. These files are developer-tooling documentation. They do not introduce new API surface, credentials, or trust relationships. No additions to the threat model are warranted.

One housekeeping note: if either file is ever updated to include real secrets (e.g., example API keys, coordinator URLs pointing to production), that would be an out-of-band credential exposure — but the current content does not do this.


🔐 Threat model: docs/threat-model.yaml · Updates on each push to this PR

@ethenotethan ethenotethan 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.

Automated Code Review — Layr-Labs/d-inference#

Verdict: COMMENT

Security — ✅ No issues found

Performance — ✅ No issues found

Type_diligence — ✅ No issues found

Additive_complexity — ✅ No issues found

✅ All four passes clean. No issues found.

🤖 Automated review by Centaur · DAR-186

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e33baaf58

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CLAUDE.md Outdated
Comment on lines +100 to +101
(git submodules; a third submodule, `libs/mlx`, provides the MLX source that
`scripts/fetch-metallib.sh` builds the metallib from).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Point metallib guidance at the actual source tree

When a developer or release agent needs to update/debug Metal kernels, this sends them to the top-level libs/mlx submodule, but the build path does not use it: scripts/fetch-metallib.sh:24-25 sets MLX_SRC to libs/mlx-swift/Source/Cmlx/mlx, and the release workflow uses the same path at .github/workflows/release-swift.yml:217-230. Updating libs/mlx based on this guidance would not change the generated mlx.metallib, risking a release with kernels still tied to the nested MLX source.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 9940af5 — the doc now points at libs/mlx-swift/Source/Cmlx/mlx (what fetch-metallib.sh:25 and the release workflow actually build from) and explicitly warns that updating top-level libs/mlx alone does not change the generated kernels.

Comment thread AGENTS.md Outdated
- Provider bundle creation (staging, .app wrapping, signing, notarization) lives inline in `.github/workflows/release-swift.yml` (bundle steps ~341-617); there is no standalone bundling script.
- Installer flow lives in `scripts/install.sh`.
- Provider update checks use `LatestProviderVersion` in `coordinator/api/server.go`, so bundle uploads and version bumps need to stay coordinated.
- Provider update checks read the latest registered release from the store (CI registers via `POST /v1/releases`); `LatestProviderVersion` in `coordinator/api/server.go` is only the fallback when no release row exists and must stay in sync with `ProviderCore.version`, so bundle uploads and version bumps need to stay coordinated.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Don't imply LatestProviderVersion backs self-updates

This says the hardcoded version is the fallback when no release row exists, but that only applies to /api/version; the actual installer and darkbloom update path read /v1/releases/latest, whose handler returns 404 when GetLatestRelease is nil. In a dev/in-memory or mis-registered release scenario, keeping LatestProviderVersion synced will not make installs or self-updates work, so this guidance can cause release fixes to miss the required release-row registration.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 9940af5 — the bullet now leads with the real dependency: GET /v1/releases/latest 404s without a release row, so installs/self-updates are fixed by registering the release; LatestProviderVersion is described as the version-display fallback only.

Comment thread AGENTS.md Outdated
- Model scan uses fast discovery (no hashing) at startup. Weight hashing is on-demand via `compute_weight_hash()` only for the served model. Don't add hashing back to the scan path.
- Provider auto-injects ChatML template for models missing `chat_template` field. This is intentional -- Qwen3.5 base models ship without it.
- Model scan uses fast discovery (no hashing) at startup (`ModelScanner`). Weight hashing is on-demand via `WeightHasher.computeHash(for:)` only for models that need attestation/verification. Don't add hashing back to the scan path.
- Models with broken chat templates are not auto-repaired. The provider runs a scan-time chat-template render self-check (`TemplateRenderCheck`) and reports `template_render_ok=false`; the coordinator then keeps tool-bearing requests away from those models.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Describe template_render_ok as an all-request gate

The current routing gate rejects every request for a provider/model with an explicit template_render_ok=false: providerEligibleForTraitsLocked returns false before applying trait-specific floors. This new wording says the coordinator keeps only tool-bearing requests away, which can mislead future routing changes or incident triage into allowing plain text traffic to a model whose chat template self-check failed.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 9940af5 — now states the template_render_ok=false gate fences ALL request shapes for the (provider, model) pair (matching providerEligibleForTraitsLocked's own doc), with only the capability version floors being tool-scoped.

- metallib source is libs/mlx-swift/Source/Cmlx/mlx (the nested tree Cmlx
  compiles against), not the top-level libs/mlx submodule
- /v1/releases/latest 404s without a release row: installs/self-updates
  are fixed by registering the release; LatestProviderVersion only backs
  the version-display fallback
- template_render_ok=false fences ALL request shapes, not just
  tool-bearing ones; only capability version floors are tool-scoped

@ethenotethan ethenotethan 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.

Automated Code Review — Layr-Labs/d-inference#

Verdict: COMMENT

Security — ✅ No issues found

Performance — ✅ No issues found

Type_diligence — ✅ No issues found

Additive_complexity — ✅ No issues found

✅ All four passes clean. No issues found.

🤖 Automated review by Centaur · DAR-186

@blacksmith-sh

blacksmith-sh Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
github.com/eigeninference/d-inference/e2e/TestIntegration_ConcurrentRequests View Logs

Fix with Codesmith
Need help on this PR? Tag /codesmith with what you need.

@ethenotethan ethenotethan 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.

Automated Code Review — Layr-Labs/d-inference#

Verdict: COMMENT

Security — ✅ No issues found

Performance — ✅ No issues found

Type_diligence — ✅ No issues found

Additive_complexity — ✅ No issues found

✅ All four passes clean. No issues found.

🤖 Automated review by Centaur · DAR-186

@Gajesh2007
Gajesh2007 merged commit 9920498 into master Jul 3, 2026
15 of 17 checks passed
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.

2 participants