Skip to content

Fix SignWell field placement; add --ordered, test-mode banner, coordinate docs#190

Merged
DrBaher merged 6 commits into
mainfrom
fix/signwell-field-placement
Jun 21, 2026
Merged

Fix SignWell field placement; add --ordered, test-mode banner, coordinate docs#190
DrBaher merged 6 commits into
mainfrom
fix/signwell-field-placement

Conversation

@DrBaher

@DrBaher DrBaher commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Addresses field feedback against @drbaher/sign-cli (NDA send to 3 signers via SignWell, MCP + CLI). Each item was confirmed against the source.

🔴 Critical — SignWell custom field placements

  • audit verify, request list/cancel, CI workflow #2 — placements silently dropped. with_signature_page was hardcoded true, which makes SignWell discard supplied fields and auto-place its own. Now false whenever custom fields are present.
  • Trust beyond the provider + operational polish #3 — fields in the wrong place in the payload. Fields were nested under files[].fields; SignWell requires a top-level 2-D fields array (one inner array per file). Now sent top-level. With both, placements reach SignWell instead of being dropped (or rejected with recipients.with_no_fields).
  • Adds a payload-level regression test (fetch intercept) asserting the 2-D shape, no nesting under files[], and correct with_signature_page toggling — the coverage gap that let this ship.

🟡 Design

🟢 Polish

  • sign mcp --help lists subcommands instead of erroring (generalizes to any parent command).
  • --field help documents width/height, the full type: set, and the indexing quirk.
  • Stray ExperimentalWarning: SQLite filtered from stderr (lazy node:sqlite load; SIGN_SHOW_WARNINGS=1 restores it).

Not included (different repo)

Tests

524 tests, 522 pass, 1 skipped, 1 fail. The single failure (Cannot find module 'pg' in storage.js) is a pre-existing local env gap (pg optional dep not installed) — identical on the clean tree, and none of the postgres code was touched.

Note for reviewer

Local package version is 0.5.0 but the field report is against published 0.7.1 — worth confirming this branch is the right base, and a version bump before release.

🤖 Generated with Claude Code

DrBaher and others added 6 commits June 21, 2026 11:55
…ntrol

Two interlocking bugs dropped or rejected every custom --field placement on
SignWell:

  #2  with_signature_page was hardcoded true, so SignWell discarded the supplied
      fields and auto-placed its own (silently). It is now off whenever custom
      fields are present.
  #3  fields were nested under files[].fields, but SignWell requires a top-level
      2-D `fields` array (one inner array per file). They now go top-level.

With both fixed, placements reach SignWell instead of being silently dropped
(or, with only #2, rejected with `recipients.with_no_fields`).

Also adds an optional applySigningOrder to the SignWell send/template inputs
(consumed by the new --ordered CLI flag): when set it drives apply_signing_order
directly, otherwise it defaults to sequential for 2+ signers as before.

Adds a payload-level regression test (fetch intercept) asserting the 2-D shape,
that fields are not nested under files[], and that with_signature_page toggles
correctly with/without custom fields — the coverage gap that let this ship.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Carries the optional applySigningOrder from sendSigningRequest and
sendEmbeddedSigningRequest down to the SignWell provider send / sendEmbedded /
sendFromTemplate / sendFromTemplateEmbedded calls, so the new --ordered flag can
request parallel/unordered signing. Undefined preserves the prior default
(sequential when 2+ signers); other providers ignore it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
node:sqlite emits "ExperimentalWarning: SQLite is an experimental feature ..."
to stderr on load, polluting otherwise machine-readable output. A static ESM
import loads the builtin during module linking — before any user code can filter
it — so db.ts now loads node:sqlite lazily via require(), and a new
silence-warnings module (imported first in cli.ts) filters only ExperimentalWarning
through process.emitWarning. Set SIGN_SHOW_WARNINGS=1 to restore the warning.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- --ordered true|false on request send / run-email / send-embedded, wired to
  SignWell apply_signing_order (#5). Default unchanged (sequential for 2+ signers).
- Loud stderr banner whenever a SignWell send runs in test mode (#4). Test mode
  stays the default (non-binding, watermarked) but is no longer silent; the
  banner points at --test-mode false. Suppressed when test mode is off.
- `sign mcp --help` now lists subcommands (mcp serve / mcp tools) instead of
  erroring with "No help entry for mcp"; the prefix fallback applies to any
  parent command.
- --field help now documents width/height, the full type: set, and the 0-based
  doc vs 1-based page/signer indexing, pointing at docs/field-coordinates.md.
  Send commands document --ordered and --test-mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…helper

Adds docs/field-coordinates.md describing the --field grammar, the 1-based
page/signer vs 0-based doc indexing, and the top-left origin every provider
expects. Ships bottomLeftToTopLeft() to convert pdfjs/bottom-left detector
coordinates to provider space (with a unit test), closing the undocumented
mapping that landed signatures in body text (#6).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…anner

Bumps package.json / SIGN_CLI_VERSION / server.json to 0.8.0 and records the
0.8.0 CHANGELOG section: SignWell custom-field placement fixes (#2/#3),
--ordered signing control (#5), the test-mode safety banner (#4), the field
coordinate contract + helper (#6), and polish (mcp --help, --field help,
ExperimentalWarning suppression).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@DrBaher DrBaher force-pushed the fix/signwell-field-placement branch from 291511e to 74f0930 Compare June 21, 2026 10:02
@DrBaher DrBaher merged commit 222a4d6 into main Jun 21, 2026
1 check passed
@DrBaher DrBaher deleted the fix/signwell-field-placement branch June 21, 2026 10:03
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.

1 participant