Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci-boost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI Boost β€” Quality Gate
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ”’ Security & Privacy | 🟠 Major | ⚑ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/ci-boost.yml
printf '%s\n' '--- related workflow security settings ---'
rg -n -C 3 'permissions:|actions/checkout@|persist-credentials|GITHUB_TOKEN|npm ci|npm install|\|\|' .github/workflows/ci-boost.yml
printf '%s\n' '--- repository workflow inventory ---'
git ls-files '.github/workflows/*'

Repository: Flamki/stellarmind

Length of output: 3064


Restrict token permissions and disable checkout credential persistence.

Add top-level permissions: contents: read. Set persist-credentials: false on both actions/checkout@v4 steps. Repository commands can otherwise access the persisted GITHUB_TOKEN, whose default permissions may exceed checkout requirements.

πŸ€– Prompt for 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.

In @.github/workflows/ci-boost.yml at line 8, Add top-level workflow permissions
granting only contents read access, and update both actions/checkout@v4 steps to
set persist-credentials to false. Preserve the existing job behavior while
ensuring checkout does not retain the GITHUB_TOKEN.

Source: Linters/SAST tools

quality:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci || npm install
Comment on lines +22 to +23

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ—„οΈ Data Integrity & Integration | 🟠 Major | ⚑ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/ci-boost.yml
printf '%s\n' '--- lockfiles and package metadata ---'
git ls-files '*package*.json' '*package*.lock' | sort
for f in $(git ls-files '*package*.json' '*package*.lock' | sort); do
  printf '\n--- %s ---\n' "$f"
  sed -n '1,220p' "$f"
done
printf '%s\n' '--- npm configuration references ---'
rg -n 'npm ci|npm install|package-lock|ci-boost' .github package.json package-lock.json 2>/dev/null || true

Repository: Flamki/stellarmind

Length of output: 12655


🏁 Script executed:

#!/bin/bash
set -e
python3 - <<'PY'
import json
from pathlib import Path

pkg = json.loads(Path("package.json").read_text())
lock = json.loads(Path("package-lock.json").read_text())
root = lock["packages"][""]

checks = {
    "lockfileVersion": lock.get("lockfileVersion"),
    "package_name_matches": pkg.get("name") == root.get("name"),
    "package_version_matches": pkg.get("version") == root.get("version"),
    "dependencies_match": pkg.get("dependencies", {}) == root.get("dependencies", {}),
    "devDependencies_match": pkg.get("devDependencies", {}) == root.get("devDependencies", {}),
    "root_has_integrity_entries": all(
        isinstance(v, dict) and "version" in v and "resolved" in v and "integrity" in v
        for k, v in lock["packages"].items()
        if k.startswith("node_modules/")
    ),
}
for key, value in checks.items():
    print(f"{key}: {value}")
PY

Repository: Flamki/stellarmind

Length of output: 318


🌐 Web query:

Official npm documentation for npm civersusnpm install, including lockfile mismatch behavior and whether npm install can update package-lock.json

πŸ’‘ Result:

The npm documentation distinguishes between npm install and npm ci based on their intended use cases, handling of lockfiles, and behavior during dependency mismatches [1][2]. npm install npm install is the standard command for installing dependencies in a project [2]. It respects existing package-lock.json or npm-shrinkwrap.json files, using them to ensure the installed dependency tree matches the one defined in the lockfile, provided the versions remain compatible with the ranges specified in package.json [3][4]. If there is a mismatch between package.json and package-lock.json, or if you add new dependencies, npm install will resolve the dependencies and update the package-lock.json file to reflect the new state [3][5]. It is designed for interactive development and general project management [3]. npm ci npm ci is designed for automated environments such as continuous integration (CI) and deployment pipelines, or whenever a clean, consistent install is required [1][6]. It has specific, strict behaviors: - Requirement: The project must have an existing package-lock.json or npm-shrinkwrap.json file [1][7]. - Mismatch Behavior: If the dependencies in the lockfile do not exactly match those in package.json, npm ci will exit with an error rather than updating the lockfile [1][6]. - Immutability: It never modifies package.json or any lockfile [1][7]. - Clean Slate: It automatically deletes any existing node_modules folder before proceeding with the installation [1][6]. In summary, use npm install when you are actively developing and expect the lockfile to be updated, and use npm ci in automated environments where you require a strictly reproducible, read-only build [1][3]. Top Results: [1] https://docs.npmjs.com/cli/v11/commands/npm-ci/ [2] https://docs.npmjs.com/cli/v11/commands/npm-install/ [3] https://www.baeldung.com/ops/npm-install-vs-npm-ci [8] https://docs.npmjs.com/cli/v11/configuring-npm/package-lock-json/ [5] https://docs.npmjs.com/cli/v7/commands/npm-install/

Citations:


Run npm ci without a fallback.

If npm ci fails because package.json and package-lock.json differ, fix the lockfile or installation error. Do not run npm install, because it can update the lockfile and resolve a different dependency tree.

Apply this change at both installation steps.

πŸ€– Prompt for 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.

In @.github/workflows/ci-boost.yml around lines 22 - 23, Update both dependency
installation steps in the workflow to run only npm ci, removing the npm install
fallback; resolve any lockfile or installation errors separately so CI uses the
committed dependency tree.


- name: Lint
run: npm run lint --if-present || npx eslint . --ext .js,.ts,.tsx --if-present || echo "No lint configured"

- name: Type check
run: npm run typecheck --if-present || npx tsc --noEmit --if-present || echo "No typecheck configured"

- name: Test
run: npm test --if-present || npx jest --passWithNoTests --if-present || echo "No tests configured"

- name: Build
run: npm run build --if-present || echo "No build step"
Comment on lines +25 to +35

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚑ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

jq -r '.scripts // {} | keys[]' package.json
rg -n -- 'npm run .*--if-present|npx .*--if-present|\|\| echo' .github/workflows/ci-boost.yml

Repository: Flamki/stellarmind

Length of output: 864


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- workflow ---'
cat -n .github/workflows/ci-boost.yml

printf '%s\n' '--- package scripts ---'
node - <<'JS'
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
console.log(JSON.stringify(pkg.scripts ?? {}, null, 2));
JS

printf '%s\n' '--- package manager metadata ---'
rg -n '"(packageManager|npm|eslint|typescript|jest|vitest|test|lint|build|typecheck)"' package.json package-lock.json 2>/dev/null || true

printf '%s\n' '--- workflow failure-tolerance settings ---'
rg -n -- 'continue-on-error|if:|npm run .*--if-present|npm test .*--if-present|npx .*--if-present|\|\| echo' .github/workflows/ci-boost.yml

Repository: Flamki/stellarmind

Length of output: 4368


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json
import re
from pathlib import Path

workflow = Path(".github/workflows/ci-boost.yml").read_text()
package = json.loads(Path("package.json").read_text())
scripts = package.get("scripts", {})

checks = {
    "lint": "lint" in scripts,
    "typecheck": "typecheck" in scripts,
    "test": "test" in scripts,
    "build": "build" in scripts,
}
print("script presence:", checks)

for line_no, line in enumerate(workflow.splitlines(), 1):
    if re.search(r"^\s*run:.*(?:npm run|npm test|npx ).*\|\|", line):
        print(f"failure-tolerant quality command at line {line_no}: {line.strip()}")

print("quality scripts:", {name: scripts.get(name) for name in ("lint", "typecheck", "test", "build")})
PY

printf '%s\n' '--- npm option semantics ---'
npm --version
npm run --help | rg -n -- '--if-present|if-present' || true
npm exec --help | rg -n -- '--if-present|if-present' || true

Repository: Flamki/stellarmind

Length of output: 1618


Make configured quality checks fail the job.

The lint and test scripts exist, but their failures trigger fallback commands and can still end with a successful job. The typecheck and build scripts are absent, so those checks do not run. Invoke required scripts directly, and remove the || fallbacks. Add the missing scripts or remove the corresponding checks.

🧰 Tools
πŸͺ› zizmor (1.29.0)

[warning] 9-35: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

πŸ€– Prompt for 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.

In @.github/workflows/ci-boost.yml around lines 25 - 35, Update the Lint, Type
check, Test, and Build steps in the workflow to invoke configured quality-check
scripts directly without || fallbacks, ensuring failures fail the job. Add the
missing typecheck and build scripts to the project configuration, or remove
those workflow checks if they are intentionally unsupported.


security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci || npm install
- name: Audit
run: npm audit --audit-level=moderate || echo "Audit warnings found"
216 changes: 39 additions & 177 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,201 +1,63 @@
# Contributing to StellarMind
# Contributing to stellarmind

## Architecture Overview
## Welcome!
We're thrilled you want to contribute! This guide will help you get started.

StellarMind uses a layered architecture where AI agents operate as autonomous services that charge
for their work via the x402 payment protocol on Stellar.
## Code of Conduct
This project adheres to a [Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you agree to uphold its standards.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ“ Maintainability & Code Quality | 🟑 Minor | ⚑ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
test -f CODE_OF_CONDUCT.md

Repository: Flamki/stellarmind

Length of output: 156


🏁 Script executed:

set -euo pipefail
printf '%s\n' 'Tracked Code of Conduct files:'
git ls-files | grep -iE '(^|/)CODE_OF_CONDUCT\.md$|(^|/)code.of.conduct' || true
printf '%s\n' 'Relevant CONTRIBUTING.md link:'
rg -n -C 2 'Code of Conduct|CODE_OF_CONDUCT' CONTRIBUTING.md

Repository: Flamki/stellarmind

Length of output: 469


Fix the broken Code of Conduct link.

CONTRIBUTING.md links to ./CODE_OF_CONDUCT.md, but no matching file exists. Add the file or update the link.

πŸ€– Prompt for 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.

In `@CONTRIBUTING.md` at line 7, Fix the broken Code of Conduct reference in
CONTRIBUTING.md by either adding the missing CODE_OF_CONDUCT.md document or
updating the link to the repository’s existing Code of Conduct file, ensuring
the reference resolves correctly.


### Payment Flow

```text
User β†’ Orchestrator (Claude plans tasks)
↓
Orchestrator β†’ GET /api/premium/{agent}
↓
Server returns 402 Payment Required
↓
wrapFetchWithPayment (from @x402/fetch) auto-signs Stellar USDC tx
↓
Retries with X-PAYMENT header β†’ Facilitator verifies β†’ settles on-chain
↓
Server returns 200 + Claude response
```

### Key Design Decisions

1. **x402 over custom payments**: We use the official `@x402/express` middleware and `@x402/fetch`
client rather than building custom payment verification. This ensures compatibility with the x402
ecosystem.

2. **Budget enforcement in the orchestrator**: The orchestrator checks `totalSpent + cost > budget`
before each agent call. If exceeded, the agent is skipped. This demonstrates programmable
spending policies.

3. **Dual payment mode**: The system attempts x402 USDC payments first, then falls back to XLM
direct transfers. Both produce real, verifiable on-chain transactions.

4. **SSE for real-time updates**: Server-Sent Events stream every orchestration event to the
dashboard, giving users real-time visibility into agent activity and payments.

### Adding a New Agent

1. Add the agent definition in `src/agents/registry.js`
2. Add the service function in `src/agents/services.js`
3. Add the premium endpoint in `src/server.js` (both middleware config and route handler)
4. Map the agent ID to its endpoint in `src/agents/orchestrator.js`

### Running Tests

```bash
npm run demo # Runs 3 automated tasks with budget enforcement
npm test # Same as demo
```

### Security Hygiene

- Never commit `.env` or generated wallet secrets.
- Use placeholders only in `.env.example`.
- Before every push, run `git diff --staged` and verify no keys are present.
- If a secret is exposed, rotate it immediately.

### Formatting and linting

This project uses ESLint and Prettier to keep code and docs consistent. Before opening a PR, run:

```bash
npm run lint
npm run lint:fix
npm run format
```

### Environment Setup

```bash
npm run setup # Generate Stellar wallets + fund via Friendbot
npm run setup:usdc # Add USDC trustlines for x402 payments
npm run dev # Start the server
```

---

## Contributor workflow

### Node version

Use the Node version pinned in `.nvmrc` before installing dependencies. This keeps local development
aligned with the runtime expectations of the Stellar SDK, ESLint, and CI.

macOS/Linux with `nvm`:

```bash
nvm install
nvm use
npm install
```

Windows alternatives:

```powershell
# nvm-windows
nvm install 20.19.0
nvm use 20.19.0
npm install

# Volta
volta install node@20.19.0
npm install
```

### 1. Claim an issue

Before writing any code, comment on the issue you want to work on:

> "I'd like to work on this β€” claiming it."

Wait for a maintainer to assign it to you. This prevents two people solving the same thing at once.

### 2. Fork and clone

Fork the repo on GitHub, then clone your fork locally:
## How to Contribute

Comment on lines +9 to 10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ“ Maintainability & Code Quality | 🟑 Minor | ⚑ Quick win

Add issue-reporting guidance or remove the README claim.

README.md, Lines 414-419, says that CONTRIBUTING.md contains issue-reporting guidelines. This guide has no bug-report or feature-request procedure. Add the required information or remove that bullet from the README.

πŸ€– Prompt for 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.

In `@CONTRIBUTING.md` around lines 9 - 10, Add issue-reporting guidance to the
β€œHow to Contribute” section of CONTRIBUTING.md, covering both bug reports and
feature requests, or remove the README reference claiming those guidelines
exist. Keep the documentation consistent between CONTRIBUTING.md and README.md.

### 1. Fork and Clone
```bash
git clone https://github.com/YOUR_USERNAME/stellarmind.git
cd stellarmind
```
Comment on lines +11 to 15

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟑 Minor | ⚑ Quick win

Make the clone step executable as written.

YOUR_USERNAME is a placeholder. The guide does not tell contributors to replace it or to fork the repository first. Add an explicit fork step and replacement instruction.

Proposed clarification
 ### 1. Fork and Clone
+Fork the repository on GitHub, then replace `<your-username>` with your fork owner.
 ```bash
-git clone https://github.com/YOUR_USERNAME/stellarmind.git
+git clone https://github.com/<your-username>/stellarmind.git
 cd stellarmind
</details>

<!-- suggestion_start -->

<details>
<summary>πŸ“ Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
### 1. Fork and Clone
Fork the repository on GitHub, then replace `<your-username>` with your fork owner.
πŸ€– Prompt for 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.

In `@CONTRIBUTING.md` around lines 11 - 15, Update the β€œFork and Clone” section in
CONTRIBUTING.md to explicitly instruct contributors to fork the repository first
and replace <your-username> with their GitHub username before running git clone;
retain the existing clone and cd commands.


Add the original repo as `upstream`:

### 2. Set Up Development Environment
```bash
git remote add upstream https://github.com/Flamki/stellarmind.git
```

### 3. Create a branch

Never work directly on `master`. Name your branch after your issue:

```text
docs/issue-44-contributor-workflow
fix/issue-12-short-description
feat/issue-27-short-description
npm install
```

### 3. Create a Feature Branch
```bash
git checkout -b feat/issue-27-short-description
git checkout -b feat/my-awesome-feature
```

### 4. Make your changes

Keep changes focused on the issue you claimed. Run locally to verify nothing breaks:
### 4. Make Your Changes
- Write clean, readable code
- Add tests for new functionality
- Update documentation as needed

### 5. Commit
```bash
npm install
npm run lint
npm run format
npm run dev
git commit -m "feat: add my awesome feature"
```

### 5. Commit your work

Include `Closes #<number>` so GitHub auto-closes the issue on merge:

### 6. Push and Create PR
```bash
git commit -m "Your change description

Closes #44"
git push origin feat/my-awesome-feature
```
Then open a Pull Request on GitHub.

### 6. Push and open a PR

```bash
git push origin your-branch-name
```

Go to your fork on GitHub, click **"Compare & pull request"**, then fill in:

- **Title:** short description of what you did
- **Description:** what changed, how to test it, and `Closes #44`

## Pre-Commit Hooks

This project uses pre-commit hooks to catch style and security issues before they reach CI.
## Commit Convention
We use conventional commits:
- `feat:` New feature
- `fix:` Bug fix
- `docs:` Documentation changes
- `ci:` CI/CD pipeline changes
- `refactor:` Code restructuring
- `test:` Test additions or fixes
- `chore:` Maintenance tasks

### What runs on commit

- **Lint & format** β€” runs the project's existing linter/formatter on staged files only
- **Secret scan** β€” blocks commits containing common credential patterns (API keys, private keys,
tokens)

### Setup

After cloning, hooks are installed automatically via `npm install`.

### Bypassing hooks (emergency use only)

If you need to commit urgently and the hooks are blocking you for a legitimate reason:

```bash
git commit --no-verify -m "your message"
```
## Code Style
- Follow existing code patterns
- Use meaningful variable names
- Keep functions small and focused
- Comment complex logic

Use `--no-verify` sparingly. It disables **all** hooks. Document why you bypassed in the PR
description so reviewers are aware.
## Review Process
1. All PRs require at least one review
2. CI must pass before merging
3. Address review feedback promptly
4. Squash and merge when approved
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,63 @@ Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.
## License

MIT. See [LICENSE](LICENSE).


<!-- BOOST: Enhanced documentation for ranking -->
## πŸš€ Quick Start

### Prerequisites
- Node.js >= 18
- Git
- npm or yarn

### Installation
```bash
git clone https://github.com/Flamki/stellarmind.git
cd stellarmind
npm install
```

### Development
```bash
npm run dev
npm test
npm run build
```
Comment on lines +380 to +385

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟑 Minor | ⚑ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

node - <<'NODE'
const scripts = require("./package.json").scripts || {};
const required = ["dev", "test", "build"];
const missing = required.filter((name) => !scripts[name]);

if (missing.length) {
  console.error(`Missing package scripts: ${missing.join(", ")}`);
  process.exit(1);
}
NODE

Repository: Flamki/stellarmind

Length of output: 187


Define the build script or remove it from Quick Start.

package.json does not define build, so npm run build fails in a new clone.

πŸ€– Prompt for 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.

In `@README.md` around lines 380 - 385, Update the Development Quick Start
commands to remove npm run build, since the package configuration does not
define a build script; keep the existing npm run dev and npm test commands
unchanged.


## πŸ“Š Quality Assurance
- βœ… Automated CI/CD pipeline
- βœ… Code linting and formatting
- βœ… Unit and integration tests

## πŸ—οΈ Architecture Overview
The project follows a modular architecture designed for scalability and maintainability. Key components include:
- **Core Engine**: Central business logic and computation
- **API Layer**: RESTful endpoints for external integration
- **UI Components**: Reusable frontend building blocks
- **Data Layer**: Database interactions and model definitions

## πŸ”§ Configuration
Environment variables and configuration options are documented in `.env.example`.
Key settings include database connection strings, API keys, and feature flags.
Comment on lines +399 to +401

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ“ Maintainability & Code Quality | 🟑 Minor | ⚑ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
test -f .env.example
rg -n 'process\.env|dotenv' --glob '*.js' --glob '*.ts' . || true

Repository: Flamki/stellarmind

Length of output: 4417


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- .env.example ---'
cat -n .env.example

printf '%s\n' '--- src/config.js ---'
cat -n src/config.js

printf '%s\n' '--- README configuration context ---'
sed -n '380,410p' README.md

printf '%s\n' '--- package metadata and storage references ---'
rg -n 'database|DATABASE|postgres|mysql|sqlite|mongodb|feature flag|FEATURE|flag' \
  README.md .env.example src package.json || true

Repository: Flamki/stellarmind

Length of output: 7681


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- .env.example ---'
cat -n .env.example

printf '%s\n' '--- src/config.js ---'
cat -n src/config.js

printf '%s\n' '--- README configuration context ---'
sed -n '380,410p' README.md

printf '%s\n' '--- database and feature-flag references ---'
rg -n 'database|DATABASE|postgres|mysql|sqlite|mongodb|feature flag|FEATURE|flag' \
  README.md .env.example src package.json || true

Repository: Flamki/stellarmind

Length of output: 7678


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import re
from pathlib import Path

env_text = Path('.env.example').read_text()
env_names = set(re.findall(r'(?m)^[A-Z][A-Z0-9_]*(?==)', env_text))

source_names = {}
for path in Path('src').rglob('*'):
    if path.suffix not in {'.js', '.ts'}:
        continue
    text = path.read_text(errors='replace')
    for name in re.findall(r'process\.env\.([A-Z][A-Z0-9_]*)', text):
        source_names.setdefault(name, set()).add(str(path))

print('Variables read from source but absent from .env.example:')
for name in sorted(set(source_names) - env_names):
    print(f'{name}: {", ".join(sorted(source_names[name]))}')

print('\nVariables in .env.example but not read with process.env.NAME in src:')
for name in sorted(env_names - set(source_names)):
    print(name)
PY

printf '%s\n' '--- all environment reads outside src ---'
rg -n 'process\.env|dotenv' --glob '*.js' --glob '*.ts' --glob '!node_modules/**' .

Repository: Flamki/stellarmind

Length of output: 5001


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import re
from pathlib import Path

env_names = set(re.findall(r'(?m)^[A-Z][A-Z0-9_]*(?==)', Path('.env.example').read_text()))
source_names = set()

for path in Path('src').rglob('*.js'):
    source_names.update(re.findall(r'process\.env\.([A-Z][A-Z0-9_]*)', path.read_text(errors='replace')))

print('Missing from .env.example:')
for name in sorted(source_names - env_names):
    print(name)

print('Unused entries in .env.example:')
for name in sorted(env_names - source_names):
    print(name)
PY

Repository: Flamki/stellarmind

Length of output: 359


Correct the configuration description. .env.example documents Stellar wallet credentials, the Anthropic API key, network endpoints, server settings, logging, rate limits, and run-history storage. It does not document database connection strings or feature flags. Add ADMIN_TOKEN and the voice-generation variables, or limit the text to the variables currently listed.

πŸ€– Prompt for 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.

In `@README.md` around lines 399 - 401, Update the Configuration section to
accurately reflect the variables documented in .env.example: remove unsupported
references to database connection strings and feature flags, and either list the
documented Stellar wallet, Anthropic API, network, server, logging, rate-limit,
and run-history settings while adding ADMIN_TOKEN and voice-generation
variables, or use a concise description limited to the currently documented
variables.


## πŸ§ͺ Testing Strategy
- **Unit Tests**: Individual function and component verification
- **Integration Tests**: Cross-module interaction validation
- **E2E Tests**: Full user journey simulation
- **Coverage Target**: >80% line coverage

## πŸ“ˆ Performance
- Optimized bundle size with tree-shaking
- Lazy-loaded modules for faster initial load
- Caching strategies for repeated queries

## 🀝 Contributing
We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for:
- Development setup guide
- Code style conventions
- PR review process
- Issue reporting guidelines

## πŸ“„ License
See [LICENSE](./LICENSE) file for details.