Skip to content

[codex] add synapse command coverage#10

Open
snissn wants to merge 3 commits intomainfrom
codex/test-synapse-command-coverage
Open

[codex] add synapse command coverage#10
snissn wants to merge 3 commits intomainfrom
codex/test-synapse-command-coverage

Conversation

@snissn
Copy link
Copy Markdown

@snissn snissn commented Apr 29, 2026

Summary

Adds pre-upgrade regression coverage for the current Synapse SDK/Core integration surfaces before any dependency bump. This PR intentionally leaves @filoz/synapse-sdk and @filoz/synapse-core unchanged so the follow-up upgrade PR can use these tests as the compatibility net.

What changed

  • Added a Bun module-mock harness for Synapse SDK, Synapse Core, local client factories, and viem action boundaries.
  • Added command-level tests for top-level upload, multi-upload, wallet, provider, dataset, and piece commands.
  • Added bun run test as a package script.
  • Updated CLI help/docs/skill text where tests confirmed the documented behavior did not match current behavior:
    • dataset create requires an explicit provider ID today.
    • wallet costs examples require both --extraBytes and --extraRunway.
    • piece group docs no longer advertise a missing upload command.

Current behavior gaps captured for follow-up

The suite keeps PR1 green but includes TODO tests for current behavior that should be addressed in PR2 or a targeted fix:

  • multi-upload silently ignores unreadable input files instead of failing the requested upload set.
  • dataset details returns the string "No metadata" for empty piece metadata even though the schema declares a string record.
  • piece list returns dataSetId as a number even though the schema declares a string.

Validation

  • bun install --frozen-lockfile
  • bun run test — 29 pass, 3 todo, 0 fail
  • bunx biome check src tests
  • bunx tsc --noEmit
  • bun run build
  • git diff --check

@snissn snissn marked this pull request as ready for review April 29, 2026 18:55
Copilot AI review requested due to automatic review settings April 29, 2026 18:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Bun-based regression tests and module mocks to lock in current Synapse SDK/Core integration behavior for foc-cli commands, plus small help/docs adjustments based on observed behavior.

Changes:

  • Added a Bun module-mock harness and command-level tests covering upload, multi-upload, wallet, provider, dataset, and piece commands.
  • Updated CLI help/docs/skill text to reflect current behavior (dataset create requires providerId; wallet costs examples require both flags; remove “piece upload” wording in piece group description).
  • Added bun test as a test package script.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
skills/foc-cli/SKILL.md Updates skill command table to match current CLI behavior/requirements.
cli/tests/synapse-commands.test.ts Adds command-level regression coverage using Bun tests and mocks.
cli/tests/output.test.ts Reformats/cleans up output serialization tests (no behavior change intended).
cli/tests/command-mocks.ts Introduces module-mock harness for Synapse SDK/Core and viem boundaries.
cli/src/commands/wallet/costs.ts Removes outdated example that no longer matches required flags.
cli/src/commands/piece/index.ts Updates piece group description to remove “upload” wording.
cli/src/commands/dataset/create.ts Updates arg description/examples to reflect providerId requirement.
cli/package.json Adds test script running bun test.
README.md Updates dataset create usage docs to require <providerId>.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/src/commands/dataset/create.ts Outdated
@snissn snissn requested a review from nijoe1 April 29, 2026 22:33
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.

2 participants