Skip to content

feat(cli)!: move fund under the wallet group as tenjin wallet fund - #158

Open
A1igator wants to merge 3 commits into
A1igator/x402-pay-discoverfrom
A1igator/wallet-fund
Open

feat(cli)!: move fund under the wallet group as tenjin wallet fund#158
A1igator wants to merge 3 commits into
A1igator/x402-pay-discoverfrom
A1igator/wallet-fund

Conversation

@A1igator

Copy link
Copy Markdown
Contributor

Scope

  • src/cli.ts: fund registers under the wallet group (tenjin wallet fund [amountUsd], envelope command wallet.fund); behavior, flags, and output unchanged, and commands/fund.ts stays the body. No compat alias: alpha, same clean-break posture as feat(cli)!: remove the candidate pen — decisions are ephemeral #131, and the changeset says what to update.
  • Every surface follows the spelling: the free-tier permission rule is Bash(tenjin wallet fund:*) (lib/permissions.ts, lib/harness-permissions.ts), doctor/install/wallet fix lines, the tenjin-search skill (the wallet marker block now covers one uniform wallet fund/show/balance group), README, docs/agent-permissions.md.
  • Risk: operator allowlists carrying the old Bash(tenjin fund:*) line go stale (named in the changeset); the MCP tool deliberately keeps its flat tenjin_fund name, since MCP names do not nest and a tool rename would break MCP consumers for no grouping gain.

Testing

  • pnpm lint, pnpm typecheck, pnpm format:check: clean. Full pnpm test: 1896 passed, 10 skipped (integration included).
  • Updated pins: free-verb rule order (harness-permissions, permissions), doctor funding fix line, wallet-create funding line. No new behavior, so no new tests; the existing fund command tests pass unchanged.

🤖 Generated with Claude Code

@A1igator A1igator added the priority: medium Medium priority label Aug 14, 2026

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@A1igator
A1igator force-pushed the A1igator/wallet-fund branch from 00adfe4 to 4092f2f Compare August 14, 2026 22:42

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@A1igator
A1igator force-pushed the A1igator/x402-pay-discover branch from 30bda1d to ae6ee8e Compare August 14, 2026 22:42
@A1igator
A1igator force-pushed the A1igator/wallet-fund branch from 4092f2f to 1e76e77 Compare August 14, 2026 22:42

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@A1igator
A1igator force-pushed the A1igator/wallet-fund branch from 1e76e77 to 739a1c7 Compare August 15, 2026 01:05

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@A1igator
A1igator force-pushed the A1igator/wallet-fund branch from 739a1c7 to 141fdaa Compare August 16, 2026 04:40

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

Compose the base's skill-diet rewrite of skills/tenjin-search/SKILL.md with
this layer's `tenjin fund` -> `tenjin wallet fund` rename.

The diet moved the free-verb allowlist fence out of SKILL.md into the new
skills/tenjin-search/references/permissions.md, so the rename had to follow it
there. src/skills-text.test.ts:124 pins every ALWAYS_SAFE_ALLOWLIST rule
verbatim in that reference file, and the pasteable-fence check pins the reverse,
so a stale `Bash(tenjin fund:*)` fails both.

Also rebind harness-permissions.test.ts:381 to FREE_VERB_RULES[1]. It stripped
the rule by literal name to build an incomplete free tier; after the rename the
filter matched nothing, leaving the tier complete and the test vacuous.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@A1igator

Copy link
Copy Markdown
Contributor Author

Conflict resolved and pushed as 7762681.

The conflict was against this PR's base (A1igator/x402-pay-discover, PR #151), which had picked up main's #164 skill diet. git merge-tree --write-tree marked exactly one file, skills/tenjin-search/SKILL.md, where the base rewrote nearly the whole document and this layer had two one-word renames in it.

Composed, not sided. I took the base's diet rewrite wholesale and re-applied this layer's rename to the one occurrence that survived it, skills/tenjin-search/SKILL.md:107. Proof in both directions, running src/skills-text.test.ts:

  • Drop this layer's rename: 2 failures, lists every always-safe allowlist entry verbatim and ships no rule in a pasteable code block that is not a recommended rule.
  • Drop the base's diet (keep the pre-merge SKILL.md): 6 failures, including points at the reference file and at doctor for the lines themselves and keeps the whole denial rule to five sentences or fewer.

Semantic break git did not mark. The diet moved the free-verb allowlist fence out of SKILL.md into a new file, skills/tenjin-search/references/permissions.md. That file is added-by-them, so it auto-merged clean while still shipping Bash(tenjin fund:*) — the rule this PR renames in src/lib/permissions.ts:119. src/skills-text.test.ts:124 pins every ALWAYS_SAFE_ALLOWLIST rule verbatim into that reference file, so the stale fence was a real failure, not cosmetic. Renamed at skills/tenjin-search/references/permissions.md:21. README.md:210, docs/agent-permissions.md:22,44 and docs/command-reference.md:250 auto-merged with the rename intact; I verified each.

One control the rename had silently killed, pre-existing at 141fdaa rather than caused by the merge. src/lib/harness-permissions.test.ts:381 built its "free tier is incomplete" premise by filtering out the literal 'Bash(tenjin fund:*)'. Once FREE_VERB_RULES emits Bash(tenjin wallet fund:*), that filter matched nothing, so the tier stayed complete and the test passed while testing nothing. Rebound to FREE_VERB_RULES[1] with an assertion that the strip actually removed one entry, so a future rename cannot make it vacuous again.

Not touched, flagging instead. src/mcp/server.ts:534 still labels the envelope runCore('fund', ...) while src/cli.ts:330 now labels runCommand('wallet.fund', ...). The MCP tool name stays tenjin_fund and this PR deliberately leaves the MCP surface alone, so the label arguably matches its own tool rather than the CLI verb. Nothing in the conflict forces the choice, so I left it as-is for you.

No payment-flow code is in the resolution. src/commands/fund.ts carries only a doc comment and the Example: tenjin wallet fund 5 usage string; payment construction, SIWX signing, and rail selection are untouched.

Gates run locally on the merge commit: pnpm format:check, pnpm lint, pnpm typecheck clean, and pnpm run check (build + test) green at 2182 passed / 10 skipped across 72 files. CI on 7762681 is still running; I have not watched it. GitHub now reports the PR mergeable, which matches git merge-tree --write-tree HEAD origin/A1igator/x402-pay-discover exiting 0 locally.

One note for whoever lands this: there is no changeset for the rename, and it is a breaking CLI change. Nothing in CI enforces one, so it is a judgement call rather than a blocker.

Pull forward 97f8650, the vendored tenjin skill mirror resync that clears
skill-drift. Latent on main; it surfaces only on PRs whose diff touches
skills/**, which this layer does.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@A1igator

Copy link
Copy Markdown
Contributor Author

Base pulled forward, pushed as 1d85a0c.

The red on 7762681 was skill-drift (mirror is in sync) and nothing else (the sibling auto-open resync PR job is skipped, not failed). Shared cause, owned by #151, this PR's base layer: the drift is latent on main and only surfaces on PRs whose diff touches skills/**, which this stack does. #151 fixed it at 97f8650 on A1igator/x402-pay-discover. Reviewers should not re-flag it here.

Merging the updated base in cleared the red with no further change from me. The merge touched exactly one file, skills/tenjin/SKILL.md, with no conflicts. I reproduced the CI gate verbatim locally, node scripts/sync-skill.mjs then git diff --exit-code -- skills/, and it now exits clean.

Worth recording why the two skill edits did not collide: scripts/sync-skill.mjs writes a single OUTPUT_PATH, skills/tenjin/SKILL.md. My edits this round were in skills/tenjin-search/, which is outside the regenerated surface, so the resync could not clobber them and they cannot re-dirty the drift gate.

Re-verified after the base merge, since both layers moved through skills/tenjin-search/ this round:

  • skills/tenjin-search/references/permissions.md:21 still reads Bash(tenjin wallet fund:*), and Bash(tenjin fund:*) appears nowhere under skills/.
  • skills/tenjin-search/SKILL.md:107 still carries the rename.
  • Controls still fail in both drop directions on src/skills-text.test.ts: dropping this layer's rename fails 2 tests, dropping the base's diet rewrite fails 6. Same numbers as before the base merge.

Gates on the merge commit: pnpm format:check, pnpm lint, pnpm typecheck clean; pnpm run check (build + test) green at 2182 passed / 10 skipped across 72 files. git merge-tree --write-tree HEAD origin/A1igator/x402-pay-discover exits 0. CI on 1d85a0c is running; not watched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant