From 0efcd72a62419080f64ddbde44d2369a59c332bb Mon Sep 17 00:00:00 2001 From: duongja Date: Wed, 1 Jul 2026 14:54:24 +0300 Subject: [PATCH] Submit LP-0008 Logos Agent solution --- solutions/LP-0008.md | 225 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 solutions/LP-0008.md diff --git a/solutions/LP-0008.md b/solutions/LP-0008.md new file mode 100644 index 0000000..84e9ace --- /dev/null +++ b/solutions/LP-0008.md @@ -0,0 +1,225 @@ +# Solution: LP-0008 — Logos Agent Module + +**Submitted by:** agate.eth + +## Summary + +This submission implements a Logos Core module named `logos_agent` that runs an +autonomous agent with native adapters for the Logos stack: LEZ wallet/program +operations, Logos Storage, Logos Chat/Basecamp owner interaction, +Delivery-backed messaging, and A2A-compatible agent coordination. + +The agent is packaged as a dynamically loadable Logos module and exposes the +LP-0008 skill surface through a documented `invoke(skill, params)` interface. It +maintains durable state, owns a LEZ identity, enforces owner spending limits, +publishes signed Agent Cards, executes Delivery-backed A2A task lifecycles, and +includes CLI/evidence tooling for evaluator replay. + +## Repository + +- **Repo:** https://github.com/duongja/logosagent +- **License:** MIT +- **Submission dossier:** https://github.com/duongja/logosagent/blob/main/docs/prize-submission-dossier.md +- **Final hosted LEZ v0.2.0 evidence:** https://github.com/duongja/logosagent/blob/main/docs/testnet-v020-final-evidence-20260701.md + +## Approach + +The implementation treats the agent as a first-class Logos Core module rather +than an external HTTP service. Logos Core loads `logos_agent` beside the existing +runtime modules and the agent calls those modules through adapters: + +- `WalletAdapter` uses `logos_execution_zone` and LEZ wallet tooling for + balances, transfers, history, program deployment, and supported program calls. +- `StorageAdapter` encrypts files with AES-256-GCM before Logos Storage upload, + tracks content addresses, and returns X25519-wrapped share payloads rather + than raw keys. +- `MessagingAdapter` connects the owner channel through `chat_module` and uses + Delivery topics for group-style transport where the current Chat group API is + not exposed. +- `A2AAdapter` publishes signed Agent Cards, discovers peer cards, sends task + envelopes over Delivery, tracks A2A lifecycle state, and attaches LEZ payment + receipts for priced tasks. +- `PolicyEngine` enforces per-transaction and per-period spending limits. The + default policy fails closed, so token-spending skills require explicit owner + approval until configured otherwise. + +The main architectural choice was to keep the agent inside Logos Core and keep +its payments, storage, and communication inside Logos primitives. A faster +centralized alternative would have been a cloud-hosted chatbot/API wrapper, but +that would lose the properties LP-0008 is meant to prove: no custodian, no +exposed server API, owner-controlled keys, encrypted Logos messaging, and +on-chain LEZ payment/program actions. + +A2A compatibility is implemented at the Agent Card and task lifecycle level. +Logos Delivery replaces A2A's default HTTP transport, and LEZ transfers fill the +payment layer that A2A leaves to implementers. This gives peer agents discovery, +priced task acceptance, status updates, cancellation, and payment evidence +without requiring a central broker. + +The repo includes `demo.sh` for evaluators. By default it runs safe preflight +checks and creates a sanitized evidence bundle. With `--localnet`, it replays +local sequencer proofs for Storage, wallet, Messaging/Delivery, paid A2A, and +program operations with `RISC0_DEV_MODE=0`. + +## Success Criteria Checklist + +- [x] The agent module loads and runs inside Logos Core alongside wallet, + storage, chat, and delivery modules. Evidence: Basecamp 0.1.2 agent proof, + Basecamp owner-chat evidence, headless three-agent proof, LGX packaging + scripts, and local smoke runs in the linked repo. +- [x] The agent has its own LEZ account and can send/receive tokens + independently of the owner wallet. Evidence: local wallet smoke runs and final + hosted LEZ `v0.2.0` `wallet.send` tx + `7bdeea835624591f222da7ece3d6a58f3663d5e943ee28f57d0ab35c37824de1`. +- [x] The owner can deploy/configure the agent with CLI flows using + `logos-agent-cli make-config`, `provision`, `init`, and `start`. +- [x] The owner can interact with the agent from Basecamp Chat with no exposed + HTTP API. Evidence: narrated Video 2 and + `docs/basecamp-owner-chat-evidence-20260622.md`. +- [x] Spending thresholds hold above-limit transactions for approval and execute + allowed transactions autonomously. Evidence: owner-chat `wallet.send` + approval proof, local wallet approval/transfer proofs, and wallet history + evidence. +- [x] All default skills are implemented and documented in + `docs/skill-interface.md`: Storage, Messaging, Wallet, Program, A2A, and + Meta. +- [x] Agent coordination is A2A-compatible at the card/task lifecycle level and + documented as a Logos Messaging/Delivery transport binding in + `docs/a2a-logos-messaging-binding.md`. +- [x] Two agents can discover each other, execute a task through the A2A + lifecycle, and attach a LEZ payment receipt. Evidence: narrated Video 3, + `docs/localnet-a2a-discovery-payment-evidence-20260620.md`, and final hosted + LEZ `v0.2.0` A2A payment-leg tx + `3d2d8a20b07c2df742078fbefdc18c6eb2e483e3ef9468681686e67f4d213894`. +- [x] At least three illustrative use cases are demonstrated: personal file + vault, paid skill marketplace, and program/on-chain operation flow. Evidence: + Video 3 and the localnet evidence refresh. +- [x] Three separate agents are generated/deployed for the Storage, Messaging, + and Blockchain categories. Evidence: + `docs/three-agent-headless-evidence-20260620.md`. +- [x] Full documentation is provided: architecture, skill interface, deployment, + owner channel, A2A binding, security model, CU status, evidence runbook, and + submission dossier. +- [x] Third-party skill development is supported through the documented skill + registry/handler interface. +- [x] The owner-facing interface is accessible through Basecamp Chat. Loadable + module assets and profile install smoke scripts are included. +- [x] Pending approvals, transactions, files, messages, tasks, and discovered + cards are persisted in durable JSON state so restart recovery does not depend + on memory-only state. +- [x] Failed owner notifications are fail-closed: above-threshold transactions + remain pending and are not executed without approval. +- [x] Skill failures are isolated through per-skill dispatch results; failures + return structured errors instead of crashing the module. +- [x] Hosted LEZ testnet evidence was refreshed after Logos announced final + `v0.2.0`. The final evidence uses LEZ commit + `a58fbce2ff48c58b7bb5001b1a27e64b9596ee3a`, `RISC0_DEV_MODE=0`, and includes: + `wallet.send` + `7bdeea835624591f222da7ece3d6a58f3663d5e943ee28f57d0ab35c37824de1`, + `agent.task` payment + `3d2d8a20b07c2df742078fbefdc18c6eb2e483e3ef9468681686e67f4d213894`, + `program.deploy` + `e9c0d01039e9ccb1b4c3ab915b263a6b4a6c5b8244737bb063b33282093a7d02`, and + `program.call` + `ee2c922038fa225bb13d9dba9b8a9f63d48ccf23b8c1c6bd4ef1cb534f261e9f`. +- [x] CU reporting is documented in `docs/cu-report.md`. Current LEZ wallet/RPC + output does not expose CU values, so CU is marked `TBD` rather than guessed. + The report lists each on-chain operation, network, tx hash, and the + team-suggested `fryorcraken/lez-signature-bench` style follow-up method. +- [x] End-to-end local sequencer proof scripts are included and the default CI + runs artifact-safe smoke checks. Heavier local sequencer scripts are exposed + through `demo.sh --localnet` and individual smoke scripts. +- [x] CI is configured under `.github/workflows/` in the implementation repo. +- [x] README documents deployment, configuration, CLI use, Basecamp owner + channel, evidence scripts, and testnet runbooks. +- [x] A reproducible demo script is provided at repo root: `demo.sh`. +- [x] Narrated demo videos are included. They demonstrate the module behavior + and end-to-end flows. Some terminal segments were recorded before the final + LEZ `v0.2.0` evidence refresh, so the final tx hashes in + `docs/testnet-v020-final-evidence-20260701.md` are the source of truth for + hosted-testnet evidence. + +## FURPS Self-Assessment + +### Functionality + +The module implements the required LP-0008 default skills, owner channel, +spending controls, signed Agent Cards, Delivery discovery, A2A task lifecycle, +paid task receipts, and program operation helpers. Final hosted LEZ `v0.2.0` +evidence exists for wallet transfer, A2A payment leg, program deployment, and a +stable wallet-facade program call. Storage, Chat, Delivery messaging, full A2A +lifecycle, and three category agents are proven through local Logos +Core/Basecamp evidence. + +Known limitations are documented in the repo. Generic arbitrary +`program.call(program_id, instruction, params)` support is bridged through the +currently available LEZ wallet/facade commands until LEZ exposes a stable +generic arbitrary-program call API. CU values are documented as unavailable from +the current wallet/RPC outputs rather than invented. + +### Usability + +The owner flow is CLI-first for deployment and Basecamp Chat-first for ongoing +interaction. The repo provides `logos-agent-cli make-config`, `provision`, +`init`, `start`, and `invoke`, plus a root `demo.sh` for reviewers. Basecamp +owner-chat setup and test instructions are documented, and Video 2 demonstrates +the owner pasting the intro bundle and invoking skills from the Chat UI. + +### Reliability + +The agent persists state on disk, uses a fail-closed default spending policy, +keeps above-threshold transactions in an approval queue, and returns structured +skill errors. Local smoke scripts exercise failure-sensitive paths including +approval gating, restart-oriented durable state inspection, Delivery receive +proofs, and paid A2A completion/cancel paths. + +### Performance + +The repo includes `docs/cu-report.md` with on-chain operations, networks, tx +hashes, and CU status. The LEZ wallet/RPC output used for this submission does +not expose CU fields, so the submission marks CU as `TBD` and documents the +expected measurement path: real `RISC0_DEV_MODE=0` proofs, `ProveInfo.stats` +cycles/segments where available, prove wall time, receipt size, and optional +end-to-end localnet transaction timing. + +### Supportability + +The codebase is split into runtime, policy, state, adapters, CLI, helper, and +script layers. The public repo includes MIT licensing, README, CI workflows, +tests/smokes, packaging scripts, Basecamp install scripts, evidence collectors, +and a sanitized submission bundle generator. The latest repo state includes +`demo.sh` and `module.json` for reviewer discovery and lambda-prize validation. + +## Supporting Materials + +- Demo Video 1: repository readiness, package/evidence bundle, hosted-testnet + transaction evidence, and submission overview: + https://www.youtube.com/watch?v=fYlokf7NIfI +- Demo Video 2: Basecamp owner-to-agent Chat flow and owner-channel skill calls: + https://www.youtube.com/watch?v=nS8928doTkE +- Demo Video 3: live skill proofs for Storage, wallet, Messaging/Delivery, + paid A2A, and program operations: + https://www.youtube.com/watch?v=hxRQejaBhxo +- Demo video note: + https://github.com/duongja/logosagent/blob/main/docs/demo-video-links.md +- Submission dossier: + https://github.com/duongja/logosagent/blob/main/docs/prize-submission-dossier.md +- Final hosted LEZ v0.2.0 evidence: + https://github.com/duongja/logosagent/blob/main/docs/testnet-v020-final-evidence-20260701.md +- Basecamp owner chat evidence: + https://github.com/duongja/logosagent/blob/main/docs/basecamp-owner-chat-evidence-20260622.md +- Localnet evidence refresh: + https://github.com/duongja/logosagent/blob/main/docs/localnet-prize-evidence-refresh-20260622.md +- Three-agent deployment evidence: + https://github.com/duongja/logosagent/blob/main/docs/three-agent-headless-evidence-20260620.md +- A2A Delivery/payment evidence: + https://github.com/duongja/logosagent/blob/main/docs/localnet-a2a-discovery-payment-evidence-20260620.md +- CU report: + https://github.com/duongja/logosagent/blob/main/docs/cu-report.md +- Root demo script: + https://github.com/duongja/logosagent/blob/main/demo.sh + +## Terms & Conditions + +By submitting this solution, I confirm that I have read and agree to the +[Terms & Conditions](../TERMS.md).