docs: add AGENTS.md for agent orientation and package details#1
Merged
Conversation
Introduce AGENTS.md to provide a comprehensive guide for agents interacting with the VeChain dev-stack. The document outlines the package's purpose, repository layout, public API, conventions, testing procedures, and common surprises, ensuring agents have the necessary context before making changes.
There was a problem hiding this comment.
Pull request overview
Adds an AGENTS.md orientation guide intended to give coding agents (and contributors) the repository context needed to make safe changes to @vechain/dev-stack, including architecture, public API contracts, conventions, and operational workflow.
Changes:
- Introduces
AGENTS.mddescribing the stack’s purpose, shared vs per-project state, and repo layout. - Documents the public surface area (
registerAddresses+vechain-devCLI) and key invariants/conventions. - Adds notes on testing and common “gotchas” for day-to-day development.
Comments suppressed due to low confidence (3)
AGENTS.md:41
- This claims
genesis/solo.default.jsonis used by both thor-solo and the indexer, butcompose/base.yamldoesn’t mount or referenceVECHAIN_DEV_GENESISforthor-solo(only the indexer compose uses it). Update the wording to avoid implying thor-solo is pinned to this genesis file, or document how to configure thor-solo to use it if that’s intended.
compose/ base.yaml, indexer.yaml, explorer.yaml (Compose files)
genesis/solo.default.json Default genesis used by thor-solo + indexer
**AGENTS.md:48**
* `registerAddresses(...)` is documented here as writing to `~/.vechain-dev/config/<project>.json`, which matches `lib/register.mjs`, but `lib/register.d.ts` currently says it writes to `~/.vechain-dev/addresses/<project>.json`. Please align the docs (prefer updating `lib/register.d.ts`) so consumers don’t get conflicting information.
Two things consumers depend on. Any change here is a breaking change for every downstream project.
registerAddresses({ project, profiles, addresses })— exported from package main. Signature defined inlib/register.d.ts. Validates and atomically writes~/.vechain-dev/config/<project>.json.vechain-devCLI — commandsup,down,reset,sync,status. Theupflow is load-config → ensure network → start thor+mongo → run consumerdeploy→ merge address book → recreate indexer+explorer → exec consumerdev(the dev process becomes the foreground; signals are forwarded).
**AGENTS.md:61**
* This states images are pinned via env var with a default tag in each compose file, but `compose/base.yaml` hardcodes `ghcr.io/vechain/thor:latest` (not pinned and not env-var overridable). Either adjust the statement to exclude thor-solo or update the compose file to follow the documented pinning pattern.
- Spring profile names live in consumer projects. When adding a new profile-keyed start-block env var to the indexer, append it to
SOLO_START_BLOCKSinlib/addressBook.mjsso its cursor defaults to0for solo. - Container/service names are stable identifiers (
thor-solo,mongo-node1,vechain-indexer,vechain-indexer-api,block-explorer). The CLI references them by name; don't rename without updating every callsite. - Images are pinned via env var with a default tag in each compose file (e.g.
${VECHAIN_DEV_INDEXER_IMAGE:-ghcr.io/vechain/vechain-indexer/indexer:6.28}). Bump the default tag when intentionally upgrading.
</details>
---
💡 <a href="/vechain/dev-stack/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| - **Address book is the only contract for inter-project state.** The shape of `~/.vechain-dev/config/<project>.json` (`{ project, profiles, addresses, updatedAt }`) is load-bearing — changing it changes the contract every consumer has already written against. | ||
| - **Spring profile names live in consumer projects.** When adding a new profile-keyed start-block env var to the indexer, append it to `SOLO_START_BLOCKS` in `lib/addressBook.mjs` so its cursor defaults to `0` for solo. | ||
| - **Container/service names are stable identifiers** (`thor-solo`, `mongo-node1`, `vechain-indexer`, `vechain-indexer-api`, `block-explorer`). The CLI references them by name; don't rename without updating every callsite. | ||
| - **Images are pinned via env var with a default tag** in each compose file (e.g. `${VECHAIN_DEV_INDEXER_IMAGE:-ghcr.io/vechain/vechain-indexer/indexer:6.28}`). Bump the default tag when intentionally upgrading. |
|
|
||
| Two things consumers depend on. Any change here is a breaking change for every downstream project. | ||
|
|
||
| 1. **`registerAddresses({ project, profiles, addresses })`** — exported from package main. Signature defined in `lib/register.d.ts`. Validates and atomically writes `~/.vechain-dev/config/<project>.json`. |
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.
Introduce AGENTS.md to provide a comprehensive guide for agents interacting with the VeChain dev-stack. The document outlines the package's purpose, repository layout, public API, conventions, testing procedures, and common surprises, ensuring agents have the necessary context before making changes.