Skip to content

fix(aip18): close legacy-helper budget leak + buyer-link path bug + buyer UX#22

Merged
DamirAGI merged 1 commit into
mainfrom
fix/aip18-freeze
Jun 6, 2026
Merged

fix(aip18): close legacy-helper budget leak + buyer-link path bug + buyer UX#22
DamirAGI merged 1 commit into
mainfrom
fix/aip18-freeze

Conversation

@DamirAGI
Copy link
Copy Markdown
Collaborator

@DamirAGI DamirAGI commented Jun 6, 2026

Closes the three review findings against the v4.4.4 AIP-18 implementation (the items blocking a 'frozen AIP-18' sign-off).

1. (Medium) Legacy helper budget leak

publishAgirailsMd() (exported helper) uploaded a pay-only file to IPFS before its on-chain pay-only short-circuit, so a direct caller could still leak a buyer's budget. Intent is now detected up front; the IPFS/Arweave upload is skipped entirely for intent: pay (cid='', no config_cid written). The CLI path was already correct — this guards the helper too. (publishPipeline.ts)

2. (Medium) Buyer-link marker written to the wrong .actp

The marker was written via getActpDir() (cwd/.actp), not the project root of the published {slug}.md. actp publish path/to/buyer.md from another directory dropped the marker where the runtime client couldn't find it → client fell back to EOA. buyerLink now accepts an explicit actpDir; actp publish passes the {slug}.md project root (ACTP_DIR still wins, matching the client). (buyerLink.ts, publish.ts)

3. (Low/UX) Buyer publish output muddied the mental model

Pay-only actp publish printed "Config published to IPFS" + "Mainnet activation on first payment" — re-muddying exactly what AIP-18 clarifies. Output now branches by intent: a buyer sees "linked, budget stays local, no on-chain registration" + buyer next-steps.

Tests

publishPipeline pay-only (no upload, no register, no config_cid) + buyerLink explicit-actpDir. Full SDK suite green (2315 passed, 0 failed).

Builds on #20/#21. With this, AIP-18 is ready to freeze. Implements agirails/aips#3.

🤖 Generated with Claude Code

…uyer UX

Three review findings against the v4.4.4 AIP-18 implementation:

1. (Medium) publishAgirailsMd() — the exported legacy helper — uploaded a
   pay-only file to IPFS *before* its on-chain pay-only short-circuit, so a
   direct caller could still leak a buyer's budget. Intent is now detected up
   front; the IPFS/Arweave upload is skipped entirely for intent:pay (cid='',
   no config_cid written). The CLI path was already correct; this guards the
   helper too.

2. (Medium) The buyer-link marker was written via getActpDir() (cwd/.actp),
   not the project root of the published {slug}.md. `actp publish path/to/
   buyer.md` from another directory dropped the marker where the runtime
   client couldn't find it → client fell back to EOA. buyerLink now accepts an
   explicit actpDir; `actp publish` passes the {slug}.md project root
   (ACTP_DIR still wins, matching the client).

3. (Low/UX) Pay-only `actp publish` printed "Config published to IPFS" and
   "Mainnet activation on first payment" — re-muddying exactly what AIP-18
   clarifies. Output now branches by intent: a buyer sees "linked, budget
   stays local, no on-chain registration" + buyer next-steps.

Tests: publishPipeline pay-only (no upload, no register, no config_cid) +
buyerLink explicit-actpDir. Full SDK suite green (2315 passed, 0 failed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@DamirAGI DamirAGI requested a review from roosch269 as a code owner June 6, 2026 01:12
@DamirAGI DamirAGI merged commit 81e63ae into main Jun 6, 2026
7 of 9 checks passed
DamirAGI added a commit that referenced this pull request Jun 6, 2026
Closes the three review findings on top of 4.4.4:
- legacy publishAgirailsMd() no longer uploads a pay-only file to IPFS
- buyer-link marker is written to the {slug}.md project root, not cwd
- pay-only publish output no longer claims IPFS publish / mainnet activation

Source merged in #22. Bump kept separate from in-flight 4.5.0 delivery work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant