feat(cli): align energy purchase, security, and agent output - #2
Merged
mixiaowu2023 merged 12 commits intoAug 28, 2026
Merged
Conversation
- add config, quote, order, history, risk, and buy commands - require explicit trusted API config and payer-visible confirmation - retry only the same signed payment and persist reconciliation markers
- acquire per-payer process and filesystem intent locks before signing - fail closed on invalid risk state and require exact quote confirmation - add regression coverage and document the hardened purchase flow
- Lock shared risk-store mutations across processes. - Preserve independent payer records under write contention.
- align the purchase flow with the authoritative API and memo contract\n- retain ambiguous signed payments for exact replay across process restarts\n- bind network, payment recipient, and signer output before submission\n- redact order credentials and sanitize terminal output
- Observe FullNode receipts before checking SolidityNode finality - Persist chain status without reopening ambiguous payment risks - Expose the staged result and cover reconciliation with tests
- Protect local signer state with owner-only permissions and atomic replacement. - Reject automatic redirects for token-bearing energy API requests.
- emit one schema-versioned envelope for successes and parser errors\n- add retry metadata, a published JSON Schema, and process-level tests\n- correct package entry points and bump the source release to 1.0.1
# Conflicts: # README.md # src/lib/output.ts
This was referenced Aug 19, 2026
Merged
- propagate stable purchase codes, retryability, and HTTP status\n- cover structured JSON output for ambiguous payment results
- default to the app release's trusted production endpoint\n- normalize live config, quote, and purchase payload fields\n- guard non-mainnet usage and cover the production contract
- enforce the mainnet-only production host on every buy path - recover tokenless orders through public payer history - retain and document signed recovery state until reconciliation
- retain the signer IPC token in daemon memory\n- reject HTTP redirects by default in the shared request helper\n- stop Moolah writes when token precision cannot be verified
mixiaowu2023
approved these changes
Aug 28, 2026
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.
Scope
This is the single CLI PR for the coordinated open-source release. It combines energy direct purchase, security remediation, and AI readability in one review.
1. Energy direct purchase
energy purchase config,quote,order,history,risk, andbuyhttps://tegrow.ablesdxd.linkbuy --dry-runand explicit production URL overrides2. Security audit remediation
--yesfor non-interactive writes and preserve fail-closed recovery state0600risk file until reconciliation3. AI readability
schemaVersion: "1.0.0"schemas/output-v1.schema.jsonin the v1.0.1 packageValidation
npm run check— typecheck, 136 tests, and build passed98c3a0df-22ad-4090-bfd2-d09abfd23864delivered; payment 89e9afd2…b2645 solidified; EnergyLimit +65,000; 0 unresolved risksnpm audit --audit-level=high— 0 vulnerabilitiesnpm pack --dry-run— v1.0.1 package includes the JSON schemaNo mainnet payment was signed or broadcast during self-test.
Runtime boundary
The CLI signs the native TRX payment but never broadcasts it locally. The configured backend validates and may broadcast it. Economic limits, price, payment address, and pool capacity always come from live responses. Custom/test endpoints require explicit configuration and trust opt-in; the production endpoint is rejected with non-mainnet networks.
Coordinated rollout
Docs may merge first. The CLI, MCP, and Skills PRs should follow in the same release window so public contracts do not remain ahead of implementation.