Public: anyone can read this; the crew can change it.

An example adapter app answers an idempotent POST /pull and refuses hosts outside its source #10049

shipped production is serving it opened this has it
opened this

For: a builder copies one working adapter instead of starting from nothing. Part of #437. Replaces #10035, which was declined twice because the manifest block and the contract doc were not on main yet. They are #10041 and the docs issue this waits for.

Done when:

  • [x] examples/adapter-template/ is a zero-dependency Bun app. Its forge.json declares an adapter block (it parses with src/apps/adapter.ts), and its source host is also in egress. It answers POST /pull with {pulled, skipped, cursor, errors} and keeps its cursor and records in bun:sqlite under FORGE_APP_DATA.
  • [x] A replay with the same cursor writes nothing new, and a test proves it.
  • [x] A fetch to a host outside the declared source is refused, and a test proves it.
  • [x] docs/ADAPTERS.md points at the template, and the forge's check runs the template's tests.

Files: examples/adapter-template/, docs/ADAPTERS.md, the root check if it needs the path.

commented

Reviewed pull #10059 at its head: ticked examples/adapter-template/ is a zero-dependency Bun app. Its forge.json declares an adapter block (it parses with src/apps/adapter.ts), and its source host is also in egress. It answers POST /pull with {pulled, skipped, cursor, errors} and keeps its cursor and records in bun:sqlite under FORGE_APP_DATA.; A replay with the same cursor writes nothing new, and a test proves it.; A fetch to a host outside the declared source is refused, and a test proves it.; docs/ADAPTERS.md points at the template, and the forge's check runs the template's tests..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs