Add ucanlib (from libforge) and fixed test identities to testutil - #57
Draft
Peeja wants to merge 2 commits into
Draft
Add ucanlib (from libforge) and fixed test identities to testutil#57Peeja wants to merge 2 commits into
Peeja wants to merge 2 commits into
Conversation
Adds the two things dependents have been getting from libforge/testutil that this package did not have: Must2, the two-value form of Must, and six fixed identities (Alice, Bob, Carol, Mallory, Service, WebService) for tests that need stable DIDs rather than fresh random ones. Every other symbol libforge/testutil exports is already a re-export of this package, so with these in place dependents can import ucantone/testutil directly. The identities are the same throwaway ed25519 keys libforge's fixtures use, so tests that hard-code their DIDs keep passing after switching import paths. WebService is Service under a did:web identity. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CGAGAib517Ae1kg8SCdcEt
Moves libforge's ucan package (Go package name ucanlib) into ucantone. It is the invoker-side counterpart to validator: validator walks a proof chain already attached to a token and checks it; ucanlib searches a delegation store and assembles one — DelegationMatcherFunc, ProofChain, ProofStore, and the container-backed ContainerProofStore — in the order an invocation's prf list expects. Both traverse the same Container type from opposite ends, so they belong in the same module. The directory is ucanlib rather than ucan (the package's own name, and ucan/ is taken here). Source is byte-identical to libforge's apart from a package doc comment and the import paths in the tests, which now use this module's testutil for the fixed identities they rely on. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CGAGAib517Ae1kg8SCdcEt
Peeja
pushed a commit
to fil-forge/forge
that referenced
this pull request
Sep 4, 2026
github.com/fil-forge/forge/protocol carries what libforge published as the network's wire contract, taken from libforge main (81372e7) plus its feat/hilt-s3-client branch (928cf2a, libforge PR #52): commands/** (every command binding except ucan/attest, which belongs with attestation), blobindex, receipt, retrieval (was ucan/retrieval), and the two small helpers they depend on, bytemap and digestutil. Import paths change from github.com/fil-forge/libforge/<pkg> to github.com/fil-forge/forge/protocol/<pkg>; the code does not, with one exception: commands/s3/bucket/errors.go is hilt main's newer copy of the bucket error sentinels (it adds ErrBucketAlreadyOwned), not PR #52's. The module depends only on ucantone and third-party libraries — on none of the other in-repo modules — so anything can consume it. ucantone is pinned to the branch that took libforge's ucan package (fil-forge/ucantone#57); re-pin to main once that merges. Codecs are generated (cbor-gen + dag-json-gen): `make gen` regenerates, `make codegen-build gen-check` is the CI gate. Both pass here. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CGAGAib517Ae1kg8SCdcEt
Peeja
pushed a commit
to fil-forge/forge
that referenced
this pull request
Sep 4, 2026
github.com/fil-forge/forge/protocol carries what libforge published as the network's wire contract, taken from libforge main (81372e7) plus its feat/hilt-s3-client branch (928cf2a, libforge PR #52): commands/** (every command binding except ucan/attest, which belongs with attestation), blobindex, receipt, retrieval (was ucan/retrieval), and the two small helpers they depend on, bytemap and digestutil. Import paths change from github.com/fil-forge/libforge/<pkg> to github.com/fil-forge/forge/protocol/<pkg>; the code does not, with one exception: commands/s3/bucket/errors.go is hilt main's newer copy of the bucket error sentinels (it adds ErrBucketAlreadyOwned), not PR #52's. The module depends only on ucantone and third-party libraries — on none of the other in-repo modules — so anything can consume it. ucantone is pinned to the branch that took libforge's ucan package (fil-forge/ucantone#57); re-pin to main once that merges. Codecs are generated (cbor-gen + dag-json-gen): `make gen` regenerates, `make codegen-build gen-check` is the CI gate. Both pass here. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CGAGAib517Ae1kg8SCdcEt
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.
[From Claude:]
Two additive commits that let libforge's
ucanandtestutilpackages be retired as part of consolidating libforge into the forge monorepo. Nothing existing changes; the full module builds, vets and tests clean standalone (GOWORK=off).ucanlib/— invoker-side proof chain assemblylibforge's
ucanpackage (Go package nameucanlib) moved here asucanlib/. It is the invoker-side counterpart tovalidator/:validatorwalks a proof chain already attached to a token and checks it;ucanlibsearches a delegation store and assembles one, in the order an invocation'sprflist expects —DelegationMatcherFunc,ProofChain,ProofStore, and the container-backedContainerProofStore. Both traverse the sameContainertype from opposite ends, which is why it belongs in this module rather than in a Forge-specific library.The directory is
ucanlib(the package's own name) becauseucan/is taken here. Source is byte-identical to libforge'sucan/proof_chain.goanducan/proof_store.goapart from a package doc comment; the tests differ only in import paths.Deliberately not included from libforge's
ucan/directory:ucan/retrieval(an HTTP transport binding used by Forge services, staying in the monorepo) anducan/zapucan(depends ongo.uber.org/zap, which this module's dependency policy excludes).testutil/—Must2and fixed identitiesEvery symbol
libforge/testutilexports is already a re-export of this package except two things dependents actually use:Must2(the two-value form ofMust) and six fixed identities —Alice,Bob,Carol,Mallory,Service,WebService— for tests that need stable DIDs. Both are added here (same throwaway ed25519 test keys as libforge's fixtures, so tests that hard-code the DIDs keep passing after switching imports). With these in place, dependents can importucantone/testutildirectly andlibforge/testutilcan be deleted rather than moved.Verification
AGENTS.mdgained a bullet for each addition. No other files touched.Part of the forge consolidation; the forge PRs that consume this pin
github.com/fil-forge/ucantone@v0.0.0-20260904190501-7fca40e13941(this branch's head) and should be re-pinned tomainonce this merges.🤖 Generated with Claude Code
https://claude.ai/code/session_01CGAGAib517Ae1kg8SCdcEt
Generated by Claude Code