Skip to content

Add AD4M executor developer skill (build, MCP, bootstrap)#713

Open
HexaField wants to merge 5 commits intocoasys:devfrom
HexaField:docs/ad4m-executor-skill
Open

Add AD4M executor developer skill (build, MCP, bootstrap)#713
HexaField wants to merge 5 commits intocoasys:devfrom
HexaField:docs/ad4m-executor-skill

Conversation

@HexaField
Copy link
Contributor

@HexaField HexaField commented Mar 5, 2026

AD4M Executor Developer Skill

Adds an AI-agent-compatible skill file (skills/ad4m-executor/SKILL.md) that documents everything a developer needs to build and run the AD4M executor from a fresh clone.

What it covers

  • Build from source — the two-step build order (rust-executor then cli), the binary collision gotcha
  • Bootstrap seed selection — why cli/mainnet_seed.json works and tests/js/bootstrapSeed.json doesn't for standalone use
  • Running the executor — minimal and full flag examples, port table
  • MCP server — flags, Streamable HTTP transport, full authentication flow with curl examples
  • TLS/remote access — dual-server behaviour, self-signed cert workflow
  • Common issues — diagnostic table for the most frequent failure modes

Why a skill file?

Skill files (SKILL.md) are structured documentation designed to be loaded by AI coding agents (Codex, Claude, etc.) as on-demand context. They follow a progressive disclosure pattern — metadata triggers loading, the body provides actionable instructions. This means any developer using an AI assistant gets the right guidance automatically when working with the executor.

The skill is equally readable by humans as a quickstart reference.

Context

This addresses multiple undocumented friction points encountered during fresh-clone setup on Ubuntu 24, including the bootstrap seed confusion, MCP authentication flow, and the dual binary issue.

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive developer guide for the AD4M executor covering prerequisites, platform packages, build and rebuild strategies, binary handling, bootstrap seed usage, minimal and full run configurations, port and network usage, agent initialization, multi-user mode, MCP and TLS setup, Flux and GraphQL workflows (including subscriptions), the waker pattern and tools, TLS remote access, troubleshooting, and project structure/port reference.

Covers build from source, bootstrap seed selection, MCP setup,
TLS configuration, port reference, and common issues.
Addresses undocumented friction points in developer onboarding.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 98e9cc7b-99ba-4e35-956a-d4a4feee83af

📥 Commits

Reviewing files that changed from the base of the PR and between 012442b and 68f5c9c.

📒 Files selected for processing (1)
  • skills/ad4m-executor/SKILL.md

📝 Walkthrough

Walkthrough

Added a new developer guide at skills/ad4m-executor/SKILL.md that documents building, configuring, running, diagnosing, and operating the AD4M executor from source, covering prerequisites, platform packages, build/run steps, runtime modes, networking/ports, bootstrap seeds, MCP/TLS, GraphQL agent initialization, and troubleshooting (new file).

Changes

Cohort / File(s) Summary
Executor documentation
skills/ad4m-executor/SKILL.md
New comprehensive developer guide added. Covers prerequisites, platform packages, two-step build/run, binary handling and rebuild strategies, bootstrap seeds and port/seed matrices, language resolution diagnostics, minimal vs full runtime configurations, GraphQL agent init, MCP/TLS options, Flux/GraphQL notes, waker pattern, MCP tools, TLS remote access, project layout, and troubleshooting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I munched the README, found the sun,

Seeds and ports in tidy rows—what fun!
Build, run, and reboot with a hop and a hum,
The executor wakes; the networks come. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add AD4M executor developer skill (build, MCP, bootstrap)' accurately summarizes the main change: adding a SKILL.md file documenting how to build and run the AD4M executor, with emphasis on key features (build process, MCP server, and bootstrap seed selection).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

data-bot-coasys
data-bot-coasys previously approved these changes Mar 5, 2026
Copy link
Contributor

@data-bot-coasys data-bot-coasys left a comment

Choose a reason for hiding this comment

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

Excellent work! This is exactly what's been missing. The bootstrap seed section alone will save hours of debugging for new developers.

A few small notes:

  • Ubuntu packages: use libayatana-appindicator3-dev instead of libappindicator3-dev — modern Ubuntu (22.04+) ships the ayatana fork and the old package conflicts.
  • rust-client/schema.gql is a broken symlink (target deleted in 2023). Worth adding: cp tests/js/schema.gql rust-client/schema.gql to the build steps, or noting it as a known issue.
  • Rust version: CI uses 1.92, the skill says 1.84.0+ — might want to bump to match.
  • Node version: CI uses Node 18, skill says 20+ — worth aligning.

None of these block merging. The content is thorough, accurate, and well-structured. 👏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
skills/ad4m-executor/SKILL.md (1)

242-242: Prefer a safer stop command than unconditional kill -9.

Using SIGKILL as the default troubleshooting step is aggressive. Prefer graceful termination first and escalate only if needed.

Suggested doc tweak
-| Port bind error | Previous executor still running | `lsof -ti:12100 \| xargs kill -9` |
+| Port bind error | Previous executor still running | `lsof -ti:12100 \| xargs -r kill` (use `kill -9` only if process does not exit) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/ad4m-executor/SKILL.md` at line 242, Replace the unconditional SIGKILL
troubleshooting command in the "Port bind error" table entry (currently shown as
`lsof -ti:12100 \| xargs kill -9`) with a safer, stepwise termination sequence:
first attempt a graceful kill (e.g., `lsof -ti:12100 | xargs -r kill`),
wait/verify the process is gone, then fall back to `kill -9` only if necessary;
update the table cell in SKILL.md accordingly so the command shows the safer
escalation instead of always using `kill -9`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/ad4m-executor/SKILL.md`:
- Around line 86-90: Add language identifiers to the two fenced code blocks: the
block containing the error lines starting with "Did not find language source for
given address: QmzSYwd..." should be changed from ``` to ```text, and the ASCII
tree block beginning with "ad4m/" should be changed from ``` to ```text (same
fix also for the second occurrence at lines 222-233). Update those fenced code
blocks in SKILL.md so markdownlint MD040 is satisfied and rendering/tooling
improves.
- Around line 61-64: Update the rebuild matrix so the "Deno/JS changes" path
also rebuilds the executor JS before rust-executor: when JS changes happen under
executor/, run `pnpm build` in executor/ then in rust-executor/ and finally in
cli/ as needed (mirroring the Rust executor change path); adjust the Deno/JS
changes bullet to list "executor/ and rust-executor" rebuild steps to ensure
snapshot/runtime inputs are refreshed.

---

Nitpick comments:
In `@skills/ad4m-executor/SKILL.md`:
- Line 242: Replace the unconditional SIGKILL troubleshooting command in the
"Port bind error" table entry (currently shown as `lsof -ti:12100 \| xargs kill
-9`) with a safer, stepwise termination sequence: first attempt a graceful kill
(e.g., `lsof -ti:12100 | xargs -r kill`), wait/verify the process is gone, then
fall back to `kill -9` only if necessary; update the table cell in SKILL.md
accordingly so the command shows the safer escalation instead of always using
`kill -9`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3d8e13f3-f503-4d28-9594-4401e9bc7cac

📥 Commits

Reviewing files that changed from the base of the PR and between 6dfad94 and 7ae37b1.

📒 Files selected for processing (1)
  • skills/ad4m-executor/SKILL.md

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@skills/ad4m-executor/SKILL.md`:
- Around line 237-261: The curl examples in the MCP auth flow (the four example
requests: initialize, notifications/initialized, tools/call for
request_capability, and tools/call for generate_jwt) are malformed because they
use "curl ... POST ..." which treats POST as a URL token; change each to use
either "-X POST" (e.g., "curl -s -X POST ...") or remove the stray "POST" and
rely on "-d" to set the method, so the examples become valid and executable;
update all occurrences of the faulty "curl ... POST" invocations in the examples
for initialize, notifications/initialized, request_capability, and generate_jwt.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3779c6b4-216c-4ddb-b908-73dd84e76851

📥 Commits

Reviewing files that changed from the base of the PR and between 7ae37b1 and eb5191b.

📒 Files selected for processing (1)
  • skills/ad4m-executor/SKILL.md

## Prerequisites

### Required toolchain
- **Rust 1.84.0+** with `wasm32-unknown-unknown` target
Copy link
Member

Choose a reason for hiding this comment

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

this is Rust 1.92 by now

Copy link
Member

Choose a reason for hiding this comment

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

.circleci/Dockerfile and rust-toolchain.toml are normative

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in fb2aab2 — bumped to Rust 1.92+ and now references rust-toolchain.toml and .circleci/Dockerfile as normative sources. ⬡

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted — the skill now points to these files as the source of truth for toolchain version. ⬡

…d matrix, code block langs, curl -X POST, safer kill, broken symlink note
Copy link
Contributor Author

@HexaField HexaField left a comment

Choose a reason for hiding this comment

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

Thanks Data — all addressed in fb2aab2:

  • libayatana-appindicator3-dev replaces libappindicator3-dev
  • rust-client/schema.gql broken symlink added to Common Issues table
  • ✅ Rust version bumped to 1.92+ (references rust-toolchain.toml and .circleci/Dockerfile as normative)
  • ✅ Node version corrected to 18+

@data-bot-coasys
Copy link
Contributor

Hex addressed your review comments in fb2aab2 — Rust version updated to 1.92, references to .circleci/Dockerfile and rust-toolchain.toml as normative sources added, plus libayatana fix and other cleanups. Ready for re-review when you get a chance @lucksus! 🙏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
skills/ad4m-executor/SKILL.md (1)

145-147: ⚠️ Potential issue | 🟡 Minor

Add language tags to fenced code blocks.

These two fenced blocks still lack language identifiers and trigger MD040.

Suggested fix
-```
+```text
 Failed to generate token: main key not found. call createMainKey() first

- +text
https://deploy-preview-548--fluxsocial-dev.netlify.app/

Also applies to: 310-312

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/ad4m-executor/SKILL.md` around lines 145 - 147, Add explicit language
identifiers to the two fenced code blocks that currently have no language tag
(the block containing "Failed to generate token: main key not found. call
createMainKey() first" and the block with
"https://deploy-preview-548--fluxsocial-dev.netlify.app/") so they validate
against MD040; change their opening fences from ``` to ```text (or another
appropriate language like ```bash or ```ansi) to silence the lint rule and make
intent explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/ad4m-executor/SKILL.md`:
- Line 421: The table entry for "Port bind error" contains an escaped pipe in
the kill command example (`lsof -ti:12100 \| xargs kill`); edit SKILL.md to
remove the backslash so the command uses a literal pipe between lsof and xargs
(preserve the rest of the text including the note about using `kill -9` only if
needed) so the example copies and executes correctly.

---

Duplicate comments:
In `@skills/ad4m-executor/SKILL.md`:
- Around line 145-147: Add explicit language identifiers to the two fenced code
blocks that currently have no language tag (the block containing "Failed to
generate token: main key not found. call createMainKey() first" and the block
with "https://deploy-preview-548--fluxsocial-dev.netlify.app/") so they validate
against MD040; change their opening fences from ``` to ```text (or another
appropriate language like ```bash or ```ansi) to silence the lint rule and make
intent explicit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 86f54e68-1edc-466c-9eb3-a8bb6213ee17

📥 Commits

Reviewing files that changed from the base of the PR and between eb5191b and fb2aab2.

📒 Files selected for processing (1)
  • skills/ad4m-executor/SKILL.md


### ⚠️ Binary collision

Both crates produce a binary named `ad4m-executor` in `target/release/`. The CLI crate's version has all runtime flags (MCP, TLS, multi-user). **Always build CLI last**, or target it explicitly:
Copy link
Member

Choose a reason for hiding this comment

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

No, only CLI creates binaries. rust-executor is a library used in cli and ui

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right — corrected in 012442b. Replaced the "binary collision" section with a note that only CLI produces binaries, and rust-executor is a library (its build generates the Deno snapshot needed by CLI). ⬡

**Always use the mainnet seed for development:**
```bash
ad4m-executor init --data-path /tmp/ad4m-data \
--network-bootstrap-seed ./cli/mainnet_seed.json
Copy link
Member

Choose a reason for hiding this comment

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

the bootstrap seed gets embedded in into the binary. if you want to use the mainnet seed, you don't have to specify this parameter when running the binary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 012442b — rewrote the bootstrap section: mainnet seed is embedded in the binary, ad4m-executor init writes it to the data dir as mainnet_seed.seed. No --network-bootstrap-seed flag needed for standard dev. ⬡

--network-bootstrap-seed ./cli/mainnet_seed.json
```

Without `--network-bootstrap-seed`, the executor looks for `mainnet_seed.seed` in the data path — a file that doesn't exist after init. This fails silently: the executor starts, agent generates, but all languages fail to resolve.
Copy link
Member

Choose a reason for hiding this comment

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

ah, yeah right. ad4m-executor init creates ~/.ad4m and writes the included mainnet seet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated — the skill now documents the init flow correctly: ad4m-executor init creates the data directory and writes the embedded mainnet seed. ⬡

Copy link
Member

@lucksus lucksus left a comment

Choose a reason for hiding this comment

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

just a few more change requests @HexaField

…inaries), bootstrap seed is embedded (no --network-bootstrap-seed needed), fix escaped pipe in troubleshooting
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
skills/ad4m-executor/SKILL.md (1)

144-146: ⚠️ Potential issue | 🟡 Minor

Add language identifiers to fenced blocks (MD040).

Line 144 and Line 309 start fenced code blocks without a language, which can trigger markdownlint warnings. Please use text (or an appropriate language) for both blocks.

Also applies to: 309-311

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/ad4m-executor/SKILL.md` around lines 144 - 146, Two fenced code blocks
in SKILL.md are missing language identifiers; add a language (e.g., text) to the
opening triple-backtick fences so markdownlint MD040 is satisfied. Specifically,
update the fence that wraps the message "Failed to generate token: main key not
found. call createMainKey() first" and the other example block later in the
document (the fenced block around the example at ~309-311) by changing ``` to
```text for each. Ensure both opening fences include the language identifier and
leave the closing fences untouched.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@skills/ad4m-executor/SKILL.md`:
- Around line 144-146: Two fenced code blocks in SKILL.md are missing language
identifiers; add a language (e.g., text) to the opening triple-backtick fences
so markdownlint MD040 is satisfied. Specifically, update the fence that wraps
the message "Failed to generate token: main key not found. call createMainKey()
first" and the other example block later in the document (the fenced block
around the example at ~309-311) by changing ``` to ```text for each. Ensure both
opening fences include the language identifier and leave the closing fences
untouched.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 097a3c03-a997-4868-b1b2-133f54090054

📥 Commits

Reviewing files that changed from the base of the PR and between fb2aab2 and 012442b.

📒 Files selected for processing (1)
  • skills/ad4m-executor/SKILL.md

…larification

- Add language identifiers to fenced code blocks (MD040)
- Add wallet unlock after restart section (critical for MCP/JWT)
- Add --data-path vs --app-data-path clarification
- Add trusted agents section
- Add wallet-locked to common issues table
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