Skip to content

docs: typecheck every example and drop hand-written version prose - #16

Merged
Upd4ting merged 1 commit into
campaign/integrationfrom
docs/a2-docs-checks
Oct 31, 2026
Merged

Upd4ting merged 1 commit into
campaign/integrationfrom
docs/a2-docs-checks

Conversation

@Upd4ting

@Upd4ting Upd4ting commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Why

Goal (Antony): the docs rewrite on campaign/integration, every repo's docs check green against the re-pinned docs action (.github tag v1-campaign, docs action tooling-configs v0.2.17, pin 46816ff). This PR switches this repo's ci-node caller to @v1-campaign and fixes every failure that action reports, so the integration branch stays green.

What changed

  • .github/workflows/ci.yml: the ci-node caller @v1 -> @v1-campaign. Other callers stay on @v1.
  • docs/tsconfig.json (existing docs project): added module: esnext and moduleResolution: bundler. The root config is CommonJS, which raised TS1378 (top-level await, 18 diagnostics). The project already maps @antelopejs/interface-payment to src/index.ts; include is unchanged.
  • 16 failing fences, handled as follows. No example is deleted and no fence is left out of the page.
  • 8 fences are complete and still checked. Seven are the same calls with the same arguments, wrapped in an exported function whose free variables became typed parameters, plus imports from @antelopejs/interface-payment: docs/1.introduction.md (charge), docs/2.payments.md (readOrderPayment, chargeSavedMethod, authorizeThenCapture, refundPart), docs/3.customers-and-methods.md (startSavingCheckout, paySavingMethod). The eighth is the PaymentMethod shape block, which gets import type { CardDetails } (it matches PaymentMethod in src/types.ts: id, type over the four PAYMENT_METHOD_TYPES, customer, card?, createdAt).
  • 1 fence is no longer TypeScript: docs/4.webhooks.md "The event set" is a list of eight quoted event names, not code (TS1005 x5). It is now a text fence. The eight names equal PAYMENT_EVENT_TYPES in src/types.ts, in the same order.
  • 7 fences get fragment. Each is a statement or member excerpt that uses application-owned names or sits inside a handler: docs/2.payments.md the checkout-redirect step (orders, orderId, response), the declined-payment branch (logger, render, request, return), the requires_action redirect (payment, response, return); docs/3.customers-and-methods.md the customer-creation step (user, users, idempotencyKey) and the off-session renewal (user, period, dunning, return); docs/4.webhooks.md the @Post() controller method (a class member using @antelopejs/interface-api, which this repo does not depend on) and the HANDLERS table (orders, refunds, disputes, events are the application's stores). Proof each is a true excerpt: a scratch probe (not committed) wraps the fence body in an async function, imports the interface exports it uses, declares the application names as any, and typechecks against docs/tsconfig.json; all six function-shaped excerpts give no error. The controller method cannot be wrapped that way; its one interface call was checked on its own: VerifyWebhook({ body, headers: rawRequest.headers }) with body: Buffer and Node's IncomingHttpHeaders typechecks against WebhookRequest, and WebhookVerificationError narrows the catch.
  • docs/4.webhooks.md HANDLERS also gains import type { PaymentEvent } and types every event parameter as PaymentEvent (it was implicit any, TS7006 x9). That is a real fix to what a reader pastes, not only a marker.

Proofs

Lever: campaign/tools/docs-measure.sh interface-payment --action 46816ff3bd104560514386e30e73b89478d7989e, copied from its output.

Before (origin/campaign/integration bf68408):

interface-payment campaign/integration@bf68408 total=127 ts=127 version=0 fences=16
raw: /home/antony/.cache/campaign2/docs/interface-payment-bf68408.raw

After (committed head c793961, --dir .): no output, exit 0.

$ docs-measure.sh interface-payment --dir . --action 46816ff3bd104560514386e30e73b89478d7989e
$ echo $?
0

pnpm exec antelopejs-sync --check: Guardrails are in sync.
pnpm run checks on head c793961: Checks: 8 passed, 0 failed.

Attention

  • Only docs, README, docs tsconfig and the ci-node ref changed. No code, package version, ratchet or suppression change.

CI docs step

Run https://github.com/AntelopeJS/interface-payment/actions/runs/41170583521 on head c793961, step "Check documentation" (copied from the log):

Docs: 6 files, 18 local links, 1 compatibility tables, 9 checked examples, 0 API pages; 0 failures.
Run AntelopeJS/tooling-configs/actions/docs@46816ff3bd104560514386e30e73b89478d7989e

@Upd4ting
Upd4ting marked this pull request as ready for review October 31, 2026 04:57
@Upd4ting

Copy link
Copy Markdown
Member Author

interface-payment#16 head c793961: PASS+NOTES

Head verified: c79396112e74a4e3fca982c8f3cd61f834740138 (base campaign/integration bf68408, merge-base equal). Verifier verify-docs-c, own clone /home/antony/.cache/campaign/h8/verify/interface-payment-16. I did not write this PR.

Checks

Check Result
Files changed .github/workflows/ci.yml docs/1.introduction.md docs/2.payments.md docs/3.customers-and-methods.md docs/4.webhooks.md docs/tsconfig.json. No package, lockfile, src, ratchet or suppressions file.
Caller ref ci.yml ci-node @v1 -> @v1-campaign. Every other reusable workflow stays @v1. Tag v1-campaign = .github 98c0f46, whose ci-node.yml:110 pins actions/docs@46816ff3bd104560514386e30e73b89478d7989e # v0.2.17. docs-guard.sh exit 0.
Docs check in CI on this head Run 41170583521: headSha=c79396112e74a4e3fca982c8f3cd61f834740138 conclusion=success event=pull_request created=2026-10-31T04:56:46Z. Log: ci-node.yml@refs/tags/v1-campaign (98c0f46b694adf0413ce11d42df70ba9d255f23f), actions/docs@46816ff3bd104560514386e30e73b89478d7989e, Docs: 6 files, 18 local links, 1 compatibility tables, 9 checked examples, 0 API pages; 0 failures. CI pnpm run checks (which includes sync:check) green.
Lever before (rerun by me, --action 46816ff) interface-payment bf684081d46137e6a44f0c99fce8ec4473b7f264@bf68408 total=127 ts=127 version=0 fences=16 exit 1 Docs: 6 files, 18 local links, 1 compatibility tables, 17 checked examples, 0 API pages; 127 failures.
Lever after (rerun by me, pin resolved from the caller ref) exit 0 Docs: 6 files, 18 local links, 1 compatibility tables, 9 checked examples, 0 API pages; 0 failures.
No example dropped Fence lines in *.md (base head): 90 90. Fragment markers at head: docs/2.payments.md:36 docs/2.payments.md:119 docs/2.payments.md:157 docs/3.customers-and-methods.md:14 docs/3.customers-and-methods.md:108 docs/4.webhooks.md:13 docs/4.webhooks.md:131.
Sync My pnpm exec antelopejs-sync --check on the head: "Guardrails are in sync."
Docs tsconfig The existing docs/tsconfig.json gains module: esnext and moduleResolution: bundler. paths and include are unchanged.
Version prose None at base (version=0) and none touched.
Edited fences (8, checked by CI) Seven make the same calls with the same arguments inside an exported function, with typed parameters and imports from @antelopejs/interface-payment. The eighth is the PaymentMethod block, which equals src/types.ts:420 field by field (type spelled out as the four PAYMENT_METHOD_TYPES).
Fence to text docs/4.webhooks.md "The event set" holds the eight names of PAYMENT_EVENT_TYPES (src/types.ts:459), in source order. It is a name list, not code, so text is right.
Fragments (7 of 7 read) Classifier: none compiles as it is or with public imports. Each still fails on application names, a top-level return, or a class member. Stub check on all 7, fence text verbatim: application names declared with narrow types (orders.update(id, { idempotencyKey?, sessionId? }), logger.warn(fields, message), users.update(id, { paymentCustomerId }), the four stores of HANDLERS). Handler bodies are wrapped in an async function, and the @Post() member sits in a class with the published @antelopejs/interface-api 0.1.0 linked into node_modules (untracked). All 7 typecheck with 0 errors, and each seeded error is caught. So no marker hides a real type error.
HANDLERS fix Every event parameter is now PaymentEvent. It was an implicit any at base (TS7006 x9).
Examples Checked examples 17 -> 9 (7 markers + 1 text). Fence lines 90 -> 90.
Title, commits, attribution Conventional title, one commit, no attribution. Body counts match my rerun.

Blocking

None.

Notes

  • docs/2.payments.md:36 (checkout redirect) has its imports and fails only on orders, orderId and response, which the application owns. Precedent (interface-auth#33) treats that as an acceptable fragment. Three declare lines would keep its CreateCheckoutSession call checked by CI. Suggested for W4, not required.
  • The PaymentMethod block restates the interface rather than tying it to the source. It is true today, but nothing fails if src/types.ts changes. Suggested for W4.

Artifacts: /home/antony/.cache/campaign/h8/verify/docs-c-r1/interface-payment-16/ (state.txt, diff, ci.log, base.raw), levers in /home/antony/.cache/campaign/h8/verify/docs-c-r1/bin/ (collect.sh, fences.mjs, exports.mjs, classify.py, fragcheck.mjs, sample.py, sample-small.py, verdict.sh), outputs in /home/antony/.cache/campaign/h8/verify/docs-c-r1/frag/.

@Upd4ting
Upd4ting merged commit b182761 into campaign/integration Oct 31, 2026
6 checks passed
@Upd4ting
Upd4ting deleted the docs/a2-docs-checks branch October 31, 2026 05:29
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