Skip to content

docs(studio): rewrite architecture for the shipped Node runtime - #886

Merged
0xlucasliao merged 1 commit into
bnb-chain:mainfrom
Ang-dot:docs/studio-architecture-node-path
Aug 25, 2026
Merged

docs(studio): rewrite architecture for the shipped Node runtime#886
0xlucasliao merged 1 commit into
bnb-chain:mainfrom
Ang-dot:docs/studio-architecture-node-path

Conversation

@Ang-dot

@Ang-dot Ang-dot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

📋 Merge order

One of four related docs PRs. Recommended sequence:

# PR Depends on
1 #885 — Studio Node path + nav order
2 #884 — TypeScript SDK quickstart rebased on #885; fast-forwards after it
3 #886 — Studio architecture independent
4 #887 — remaining Studio pages independent

#882 (SDK server-module fixes) is independent of all four.


Summary

Completes the Studio Node-path work started in #885, which deliberately left this page alone to stay reviewable. architecture.md described a two-artifact Python system that does not ship. Verified against the published @bnbagent/studio-cli@0.0.12 tarball.

What was wrong

Page said Reality
"two deployable artifacts", Layer A + Layer B, app/service/ on EC2/Fargate, a "keyless" boundary, InvokeAgentRuntime action envelopes (quote/fulfill/settle) None of it exists. One runtime holds the only key and signs in-process.
L4 = bnbagent_studio_core; L1 lists app/service/* L4 is the published @bnbagent/studio-runtime; there is no service tier
A frameworks/ recipe axis, default Google ADK No frameworks/ directory exists in recipes/ at all. Real axes: agent, wallet, runtimes/{agentcore,azure-foundry}, providers/pieverse-llm, tools-chain, x402-buyer
Emitted main.py, managed_model.py, tools.py, signing.py, service.py The shipped templates are TypeScript: signing.ts, sellerCore.ts, unifiedMain.ts, mcpMain.ts, dualMain.ts, executor.ts, agentCard.ts, model.ts, tools.ts, chainTools.ts, x402Buyer.ts

What replaced it

The invariants as they actually are:

  • The two bounded ERC-8183 operations. negotiate clamps price against studio.toml in deterministic code and signs EIP-191 — no LLM touches money. notify_funded verifies the funded job on-chain (signed terms, assigned provider, status, budget, funded state) before doing paid work.
  • The signing boundary. Fixed code in app/agent/src/signing.ts or the bounded x402 handler, never an LLM-callable tool; the model's chain tools are read-only. The keystore sits at the workspace root, outside the deploy codeLocation.
  • Manual settlebag erc8183 settle <jobId>; Studio never auto-settles a buyer's job.
  • Which entrypoint binds which port, and that dualMain.ts is AgentCore-only. That last detail is the mechanical reason Foundry deploys A2A scaffolds only — runtimes/azure-foundry/ ships no dualMain template. The A2A entrypoint is byte-identical across both runtimes (pinned by a parity test), so one image deploys to either cloud.

Also refreshed the mermaid diagram and the commerce-flow sequence to the real negotiate → fund → notify_funded → submit → buyer-decides path.

Also fixed

Dropped two Further reading links into bnb-chain/bnbagent-studio/docs/design/ — that repo returns 404, so both were dead.

Verification

  • grep for Layer A|Layer B|keyless|EC2|Fargate|app/service|service.py|main.py|managed_model|bnbagent_studio_core|frameworks/|Google ADK|InvokeAgentRuntime|six-layer|two deployable returns one deliberate hit: "There is no separate keyless service tier and no cross-service invoke hop."
  • every relative link resolves; code fences balanced
  • recipe axes and template filenames enumerated directly from the tarball (find recipes -name '*.tmpl')

Merge order

Independent of #885/#884 — this touches only architecture.md, which neither of those modifies.

The page described a two-artifact Python system that does not ship.
Verified against the published @bnbagent/studio-cli 0.0.12 tarball.

Replaced:
- "two deployable artifacts" / Layer A + Layer B, app/service/ on
  EC2/Fargate, the "keyless" boundary, and InvokeAgentRuntime action
  envelopes (quote/fulfill/settle) — none of this exists. The shipped
  model is one runtime holding the only key and signing in-process.
- The six-layer stack's L4 `bnbagent_studio_core` -> the published
  @bnbagent/studio-runtime, and L1 no longer lists app/service/*.
- A `frameworks/` recipe axis with a "Google ADK" default. There is no
  frameworks/ directory in recipes at all; the real axes are agent,
  wallet, runtimes/{agentcore,azure-foundry}, providers/pieverse-llm,
  tools-chain and x402-buyer.
- Emitted .py filenames -> the templates actually shipped: signing.ts,
  sellerCore.ts, unifiedMain.ts, mcpMain.ts, dualMain.ts, executor.ts,
  agentCard.ts, model.ts, tools.ts, chainTools.ts, x402Buyer.ts.

Added what the invariants actually are: the two bounded ERC-8183
operations (negotiate clamps price in deterministic code and signs
EIP-191; notify_funded verifies the funded job on-chain before doing paid
work), the signing boundary, manual settle, and the ports each entrypoint
binds. Notes that dualMain.ts is AgentCore-only, which is the mechanical
reason Foundry deploys A2A scaffolds only, and that the A2A entrypoint is
byte-identical across runtimes.

Dropped two Further-reading links into bnb-chain/bnbagent-studio/docs/design/
— that repo returns 404, so both were dead.
@hashdit-bot

hashdit-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown

Pull Request Review

This documentation-only PR rewrites the BNB Agent Studio architecture to describe the shipped TypeScript/Node.js runtime rather than the previously documented two-artifact Python design. It documents the single-runtime signing boundary, bounded ERC-8183 and x402 flows, actual recipe and entrypoint layout, workspace isolation, cloud runtime differences, and manual settlement behavior.

Sensitive Content

No sensitive content detected.

Security Issues

No serious security issues detected.


Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits.

0xlucasliao pushed a commit that referenced this pull request Aug 25, 2026
Completes the sweep started in #885 and #886. Verified against the
published @bnbagent/studio-cli 0.0.12 tarball.

deployment.md — rewritten. It described shipping "two artifacts": Layer A
to AgentCore and Layer B to EC2/Fargate, with `bag deploy agent` +
`bag deploy package` + a manual EC2 upload. One runtime ships now, and
every deploy explicitly selects bnb | aws | azure. Documents the real
per-target constraints (48h testnet trial runs in the operator's cloud so
signing material leaves your control; Azure is container-only and A2A-only)
and the per-target secret channel (Secrets Manager / Foundry CustomKeys /
managed store). Notes that local deliverable storage fails readiness by
design, and that cloud lifecycle is delegated to the pinned
@bnbagent/deploy-cli — no azd, no azure.yaml in the scaffold.

configuration.md — dropped the second `app/service/studio.toml` config and
the keyless-Service env section; one runtime means one studio.toml.
`--project-root app/service` no longer exists.

cli-reference.md — removed `bag deploy prepare --include-service-preflight`
(absent from the shipped CLI) and the Python flat-imports section. Fixed
`bag erc8004 register --endpoint .../apex/`: no `apex` route exists in the
package; the runtime serves /readiness, /invocations, /responses, /mcp and
/x402.

troubleshooting.md — replaced the two-studio.toml drift check, the
`main.py` flat-import advice, and the `@aws/agentcore` + Node>=20
prerequisite. Retargeted the funded-jobs checklist at the single runtime
and /readiness, and noted settle is manual.

demo.md — NOT rewritten, deliberately. It is a 610-line walkthrough of
recorded IDE transcripts and command output. A faithful version has to be
executed to be trustworthy, not adapted on paper; inferring one would
produce a confident guide that does not work. Added a prominent banner
pointing at the current Quickstart and Architecture, and fixed a
pre-existing broken link (../../bnbagent-sdk/networks.md was one level too
deep).

Verified: the four rewritten pages contain zero stale markers, and all 37
relative links across the studio doc set resolve.
@0xlucasliao
0xlucasliao merged commit 1baefd6 into bnb-chain:main Aug 25, 2026
1 check 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