Repository navigation
Expand unit-test coverage, pin known quirks, polish docs - #2
Merged
Merged
Conversation
Captures the scope, test plan, and pinned quirks for an upcoming unit-test coverage push (covering every modeled Operation, Asset edge cases, VIZEncoder primitives) plus the narrow set of behavior-preserving source corrections. Also adjusts .gitignore so design docs under docs/superpowers/ are tracked while generated docs under /docs remain ignored.
Deletes the commented-out debug print in Client.urlRequest and adds TODO/explanatory comments at five known-quirk locations (Share decode fallback, currentEnergy clock injection, Operation.Convert missing OperationId, custom/CustomJson encode-decode asymmetry, testNet prefix collision). No behavior changes.
Adds testRoundTrip_<op> for every operation that AnyOperation.encode dispatches on, verifying binary encode, JSON decode, and AnyOperation wrapped JSON round-trip in one helper. Custom and DeleteContent are omitted: both have encode/decode asymmetries in AnyOperation (Custom encodes as Custom but decodes as CustomJson; delete_content is missing from the OperationId string switch). These are documented as comments and tracked for Task 6.
Comment said 'absent from OperationId string-switch in AnyOperation.init(from:)' when the actual missing entry is in OperationId.init(from:). No code change.
The typo on the affected line meant VIZURLTest was silently skipped on Linux. Fix restores those 2 tests to Linux CI.
- Add a table of contents - Promote the feature list to the top, drop the philosophy section - Normalize headers to sentence case, add consistent dividers - Fix code samples that referenced undefined identifiers (Error.invalidKey, regularKey, publicKey) - Cover .codingError in the error-handling example - Show all three swift test invocations - Note that XCTestManifests.swift is hand-edited
AGENTS.md captures: project layout, build/test commands, code conventions (async/actor/Sendable, VIZCodable contracts, JSON snake_case, raw-Data no-length-prefix), the Linux manifest hand-edit workflow, the 5 grep-discoverable known quirks with source locations, and commit style. CLAUDE.md is a one-line pointer to AGENTS.md so Claude Code picks up the same guidance. Also gitignores .claude/settings.local.json (user-local).
IntegrationTests hit https://node.viz.cx and fail when chain state drifts from fixtures (block heights, balances). The unit suite is the load-bearing contract; integration tests can be run manually or in a scheduled job later. This is the open question flagged in docs/superpowers/specs/2026-05-16-test-coverage-and-safe-fixes-design.md under 'CI: filter the badge workflow to --filter UnitTests'.
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.
Summary
Unknown-mapped op ids, and pins 14 encode-asymmetric cases. StrengthensAssetandVIZEncoderprimitive coverage.// TODO:inSources/VIZ/(Share parse-failure fallback, currentEnergy Date(), Convert missing OperationId, custom encode/decode type mismatch, testNet prefix). Behavior unchanged.printinClient.swift:233. All other source diffs are TODO comments.SeemURLTest→VIZURLTesttypo inXCTestManifests.swift(was silently disabling 2 tests on Linux).AGENTS.md+CLAUDE.mdfor AI coding agents.What's deferred
Two ops (
Customround-trip,DeleteContentround-trip) are intentionally not tested in this round — they're incompatible with current encode/decode dispatch and pinned via the asymmetry test + source TODOs. Documented at the test site.Plan and design docs live under
docs/superpowers/for the next round.Test plan
swift test --filter UnitTests— 108 tests, 0 failures, ~0.05s locallyswift buildsucceedsgrep -n "TODO:" Sources/VIZ/*.swiftgit diff master..HEAD -- Sources/shows only the dead-print removal, 5 TODO comments, and 1 explanatory comment)🤖 Generated with Claude Code