Skip to content

docs(adr): ADR-054 one-file integrations via module extensions, ADR-055 recurring triggers - #669

Draft
seanspeaks wants to merge 1 commit into
nextfrom
adr/054-055-one-file-integrations
Draft

seanspeaks wants to merge 1 commit into
nextfrom
adr/054-055-one-file-integrations

Conversation

@seanspeaks

@seanspeaks seanspeaks commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two Proposed ADRs for the one-file integration path in 2.0.1. Under ADR-043 (open PR #646), an ADR does not merge as Proposed, so this PR is opened as a draft. It needs the maintainer's review of the API shape before it is marked Accepted and merged.

  • ADR-054: One-file integrations via module extensions (Proposed)
    • defineIntegration, defineApp and use(), plus extension contract 2. Contract 2 covers verification, tenant resolution, namespaced events, the subscription lifecycle, triggers, config fields, env, scripts and lifecycle hooks.
    • Records the decisions made so far:
      • The event-driven path ships stable in 2.0.1: helpers, contract 2, lifecycle hooks, recurring triggers, app-scope subscriptions, the HubSpot extension on contract 2, Slack promoted to v1-ready, and docs.
      • The sync pieces ship under @friggframework/core/experimental until two production apps use them: objects/pages(), the resumable page runner and watermark, ctx.each/ctx.links, and instance-scope subscriptions.
      • Handlers take ctx only, with no this.
    • Changed from the draft: module APIs are no longer top-level ctx keys. A handler is (payload, ctx) with ctx = { modules: { <authorKey>: api }, config, log, telemetry, commands, integration }. The integration author chooses the module keys, and they are not part of core's interface. Every code sample is updated to this shape, and the rejected alternative is recorded.
    • The sample app definitions use encryption: { fieldLevelEncryptionMethod: 'kms' }, and I checked them against ADR-051's app-definition.schema.json (PR feat(devtools): frigg validate, and make the app-definition schema match the runtime (ADR-051) #666). Actions and config options are reached through ADR-053 /api/v2/integrations/* paths (PR docs(adr): ADR-052 entity proxy security, ADR-053 Management API versioning #668).
    • The register has no assets-directory convention, so both target files are inlined as Appendix A.
  • ADR-055: Recurring triggers (Proposed)
    • One tick function per integration runs on a fixed schedule. Each tick pages through the ENABLED instances and enqueues the ones that are due, using a stateless slot-vs-hash check. Overlapping runs are skipped using a Process record, and missed ticks are not replayed. Per-instance EventBridge schedules are rejected.
    • Trigger syntax and handler shape match ADR-054. Framework triggers use the reserved frigg. prefix (frigg.subscriptions.reconcile).
    • Supersedes the type: 'CRON' docs. CLAUDE.md and docs/guides/INTEGRATION-PATTERNS.md are corrected when the implementation lands, not in this PR.
  • Adds an ADR-054 cross-reference line to ADR-015, 018, 019 and 023, following the precedent of the ADR-048 line in ADR-011. ADR-032 (docs(adr): ADR-032 integration deletion data cleanup #641) and ADR-049 (docs(adr): ADR-049 rate-limit awareness #655) are not on next yet, so their amendments are listed only in ADR-054.
  • Adds register rows to docs/architecture-decisions/README.md and entries to website/roadmap/data/adrs.json.

ADR numbers 054 and 055 are not used on next or on any open ADR branch.

Test plan

  • This PR changes docs only, no code.
  • website/roadmap/data/adrs.json parses, and count matches the number of entries.
  • Both inlined target files pass node --check.
  • The maintainer reviews the API shape, then sets both ADRs to Accepted and marks the PR ready.

🤖 Generated with Claude Code

📦 Published PR as canary version: 2.0.0--canary.669.5f3833b.0

✨ Test out this PR locally via:

npm install @friggframework/admin-scripts@2.0.0--canary.669.5f3833b.0
npm install @friggframework/core@2.0.0--canary.669.5f3833b.0
npm install @friggframework/devtools@2.0.0--canary.669.5f3833b.0
npm install @friggframework/eslint-config@2.0.0--canary.669.5f3833b.0
npm install @friggframework/prettier-config@2.0.0--canary.669.5f3833b.0
npm install @friggframework/schemas@2.0.0--canary.669.5f3833b.0
npm install @friggframework/serverless-plugin@2.0.0--canary.669.5f3833b.0
npm install @friggframework/test@2.0.0--canary.669.5f3833b.0
npm install @friggframework/ui@2.0.0--canary.669.5f3833b.0
# or 
yarn add @friggframework/admin-scripts@2.0.0--canary.669.5f3833b.0
yarn add @friggframework/core@2.0.0--canary.669.5f3833b.0
yarn add @friggframework/devtools@2.0.0--canary.669.5f3833b.0
yarn add @friggframework/eslint-config@2.0.0--canary.669.5f3833b.0
yarn add @friggframework/prettier-config@2.0.0--canary.669.5f3833b.0
yarn add @friggframework/schemas@2.0.0--canary.669.5f3833b.0
yarn add @friggframework/serverless-plugin@2.0.0--canary.669.5f3833b.0
yarn add @friggframework/test@2.0.0--canary.669.5f3833b.0
yarn add @friggframework/ui@2.0.0--canary.669.5f3833b.0

…55 recurring triggers

ADR-054 (Proposed): defineIntegration/defineApp/use and extension contract 2
make a production integration fit in one file. Records the decisions so
far: the event-driven path ships stable in 2.0.1; the sync pieces ship
under @friggframework/core/experimental until two production apps use
them; handlers are (payload, ctx) with no this, and module APIs live under
ctx.modules by author-chosen keys. Inlines both target files as Appendix A,
with the encryption setting fixed to fieldLevelEncryptionMethod: 'kms'.

ADR-055 (Proposed): one tick function per integration, a stateless
slot-versus-hash due check, overlap skipped through a Process record,
missed ticks not replayed. Supersedes the type: 'CRON' docs, which are
corrected when the implementation lands.

Adds ADR-054 cross-references to ADR-015, 018, 019 and 023, the register
rows and the roadmap entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seanspeaks seanspeaks added release Create a release when this pr is merged prerelease This change is available in a prerelease. labels Oct 3, 2026
@netlify

netlify Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for friggframework-org ready!

Name Link
🔨 Latest commit 5f3833b
🔍 Latest deploy log https://app.netlify.com/projects/friggframework-org/deploys/6ac15a9a7592e200084159df
😎 Deploy Preview https://deploy-preview-669--friggframework-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2026

Copy link
Copy Markdown

@seanspeaks

Copy link
Copy Markdown
Contributor Author

ADR reconciliation needed after Stack A/B — drafted with Claude Code at Sean's request

Severity: must-reconcile. Stack B (#692–#700) builds overlapping pieces outside ADR-054/055.

ADR-055

ADR-054

Merge order: this PR (amended) before #694 rebases; ADR-063 (#692) should cite 054/055 for triggers, contract 2 and objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prerelease This change is available in a prerelease. release Create a release when this pr is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant