Repository navigation
Ship an agent skill for the CLI - #12
Conversation
An agent driving unicity-proof has no way to learn the parts of the interface that are not discoverable from --help. The costly one is that `verify <token>` alone reports Status OK for a valid timestamp that was never tied to a document: without --file or --hash the verdict says nothing about the file the caller is holding. Add skills/unicity-proof/SKILL.md covering that trap and the rest of the non-obvious behaviour: that exit 3 leaves the request possibly certified, that a token dumped to stderr as hex is recoverable without re-stamping, that the token file is the only receipt, why UNICITY_TRUST_BASE from a discovered .env is ignored, and that a stamp is evidence only if it precedes the outcome it commits to. The skill asserts exit codes, so it would rot silently as the CLI changes. SkillTest parses the documented codes and compares them against the constants in src/errors.ts, and checks the skill is listed in the package files so it reaches installs. No MCP server: a tool schema costs thousands of context tokens before any work happens, where this costs a few hundred and loads only when relevant. The CLI is already the better interface for any agent with a shell.
The documented install ran mkdir against .claude/skills and then copied into .claude/skills/unicity-proof/, which cp refuses when that directory does not exist: 'cannot create regular file ... Not a directory'. The documented sequence therefore failed on a fresh checkout and the skill never reached the agent.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f024a65f40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - **Exit 3 does not mean nothing happened.** The timeout fired and nothing was | ||
| written locally, but the network may still have certified the request. | ||
| Re-running `stamp` spends quota again. |
There was a problem hiding this comment.
Limit the exit-3 warning to actual timeouts
When exit 3 results from an HTTP/network failure or an aggregator rejection, no timeout necessarily fired and retrying may not spend another quota unit; toExitCode deliberately maps all of those cases to the same code. An agent following this unconditional guidance will misdiagnose authentication, rate-limit, and rejected-request failures, so make the possible-certification warning conditional on the error being a timeout after successful submission.
Useful? React with 👍 / 👎.
The skill stated that exit 3 means the timeout fired and the request may still have been certified. That holds only for SleepError. toExitCode also maps StampError, JsonRpcNetworkError, JsonRpcResponseError, JsonRpcDataError and a failed fetch to the same code, and none of those certify anything: a 429, a refused API key or an aggregator rejection leaves nothing on the network. An agent following the old text would treat an auth or rate-limit failure as possibly-certified and hesitate to retry, when the correct action is to fix the cause. Name the timeout as the only ambiguous case and quote the five gateway messages that distinguish the others, since describeError already prints which one happened. Those quoted strings can drift like the exit codes, so SkillTest now extracts them from the skill and asserts each appears in src/errors.ts or src/lib/errors.ts.
certifyMintTransaction submits the certification request before it calls waitInclusionProof, and the polling path reaches the same gateway. A dropped connection or an HTTP error can therefore surface after the network has already accepted the request, and a lost submission response is ambiguous for the same reason. The previous text listed those messages as certifying nothing, which is the opposite error to the one it replaced. Only an explicit aggregator rejection is unambiguous. Say that, and say that the CLI does not track the request so it cannot resolve the rest.
|
Both review findings on the exit-3 bullet are addressed, in two steps because my first correction was wrong in the opposite direction. The original text asserted that exit 3 meant a timeout and the request might still be certified. That holds only for My first fix listed the gateway messages as certifying nothing. That was also wrong: Final text: exit 3 generally cannot tell you whether anything was certified, and the CLI does not track the request so it cannot resolve that. The only unambiguous message is an explicit aggregator rejection. A refused API key should be fixed before retrying regardless.
|
Closes #11.
An agent driving
unicity-proofcannot learn from--helpthe parts of the interface that actually matter. The costly one:verify <token>on its own printsStatus OKfor a valid timestamp that was never tied to a document. Without--fileor--hashthat verdict says nothing about the file the caller is holding, and an agent that skips the flag reports success on a proof that establishes nothing.skills/unicity-proof/SKILL.mdcovers that and the rest of the non-obvious behaviour:verifymust be given--fileor--hashto bind a proof to a documentstampspends quota againUNICITY_TRUST_BASEfrom a discovered./.envis ignored, and why--sign/--anonymousfor automation that must not produce the wrong kind of stampKeeping it honest
The skill asserts exit codes, so it would rot silently as the CLI changes.
tests/unit/SkillTest.tsparses the documented codes out ofSKILL.mdand compares them against the constants insrc/errors.ts, following the patternTrustBasesTest.tsalready uses for trust-base digests. It also asserts the skill is listed inpackage.jsonfiles, so it reaches installs. Both guards were confirmed to fail when the thing they check is broken.No MCP server
A tool schema costs thousands of context tokens before any work happens; this costs a few hundred and is read only when relevant. For any agent with a shell the CLI is already the better interface. The two cases a skill cannot serve — agents with no shell, and holding the gateway API key so the agent never sees it — are not addressed here and would need their own issue.
Verification
npm run lint,npm run build:checkcleannpm pack --dry-runconfirms the skill ships atskills/unicity-proof/SKILL.mdcodex exec review --base mainclean; it caught a real defect in the first commit, where the documentedmkdircreated.claude/skillsbutcpneeded.claude/skills/unicity-proofto exist, so the install failed. Fixed in the second commit and reproduced both ways.Network e2e tests were not run; they need a gateway API key and this change touches no network path.