Add independent component release architecture
Modular container CI / release-build (push) Failing after 12s

This commit is contained in:
faumaray committed 2026-07-29 22:40:35 +03:00
1 parent 458dde05a6
commit 2a533a27f8
18 files changed
+2110 -216

No files matched your search

+86
View File
@@ -0,0 +1,86 @@
# ADR 0001: Future paid official-binary distribution
Status: explored, not implemented
## Decision
Keep update metadata public and cryptographically signed. Keep artifact URLs
stable behind the distribution gateway. If paid access is introduced later,
authorize artifact responses at that gateway; do not put credentials or
short-lived signed URLs into immutable feeds.
The future request path is:
```text
billing webhook
-> Echoion entitlement service
-> account/device access token
-> distribution gateway
-> short-lived origin authorization or streamed object response
```
Billing authorization and update integrity are separate:
- The gateway decides whether an account may receive the bytes.
- The updater independently verifies the feed signature, artifact SHA-256,
signed manifest, size, compatibility, and replay sequence.
No billing, account, license, device, or gateway authorization code is part of
the current implementation.
## Provider options
### Stripe Billing
Use Stripe subscriptions and Billing Entitlements webhooks while Echoion owns
the entitlement database, account model, tax configuration, support, and
gateway. This provides the most control but also leaves more commerce and
compliance work in Echoion.
- <https://docs.stripe.com/billing/entitlements>
- <https://docs.stripe.com/billing/subscriptions/webhooks>
### Paddle or Lemon Squeezy
Prefer a merchant-of-record provider when supported jurisdictions, tax
collection/remittance, invoices, and payment operations should be delegated.
Echoion still needs a webhook-driven entitlement projection and must treat
webhooks as replayable, out-of-order external events.
- <https://developer.paddle.com/build/subscriptions/provision-access-webhooks/>
- <https://docs.lemonsqueezy.com/help/webhooks>
### Keygen
Consider Keygen in addition to a billing provider when per-device activation,
offline signed licenses, machine limits, or license-policy administration
becomes a product requirement.
- <https://keygen.sh/docs/api/entitlements/>
## Required follow-up decisions
Before implementation, produce a jurisdiction-specific commerce review and
lock these product choices:
- Merchant of record versus Echoion-operated merchant account.
- Monthly, annual, perpetual, trial, and grace-period behavior.
- Device limits, device replacement, account sharing, and offline operation.
- Refund, dispute, chargeback, failed-payment, cancellation, and revocation
timing.
- Availability when billing, entitlement, or gateway dependencies are down.
- Minimal personal data, retention, account deletion, audit history, and
customer-support access.
Webhook handlers must verify provider signatures, persist provider event IDs,
be idempotent, tolerate reordering, and derive access from stored entitlement
state rather than trusting a single webhook delivery.
## Limits
Echoion is public source. A download paywall can control official signed
binaries, automated updates, and paid support, but cannot prevent someone from
building and running the public source. Stronger enforcement would require
moving real product value into private components or a hosted service and is
outside this decision.
+107
View File
@@ -0,0 +1,107 @@
# Independent component releases
Echoion product releases and component releases are deliberately separate.
A component release never edits `components.lock.json`, creates an Echoion
product tag, or starts the Echoion product workflow. The lock is updated only
while preparing a later full Echoion release.
## Published objects
Every runtime component publishes the same verified package to two places:
1. A release in the component's own Gitea repository. This is the provenance
and maintainer-facing release after that repository becomes private.
2. An immutable object-storage key exposed through the permanent distribution
gateway:
```text
<distribution-base>/<ComponentId>/<version>/<artifact>
```
The signed public feed refers only to the distribution URL. It never contains
Gitea credentials, object-storage credentials, presigned URLs, or private clone
URLs. Private Gitea repositories do not have independently public release
units, so public delivery must remain a separate distribution concern.
The object origin should be private from its first deployment. The gateway may
allow anonymous `GET` requests initially; a future entitlement check can return
`401` or `403` at the same permanent URL without rewriting signed immutable
feed documents.
## Release transaction
The workflow on a signed `vX.Y.Z` tag publishes stable releases. A prerelease
tag publishes beta. A scheduled run publishes a nightly only when that
component's source SHA differs from its last nightly state.
The shared release tool performs this idempotent transaction:
1. Verify the component tag and derive the required version from the prior
stable feed state and canonical ABI contract.
2. Check out exact dependency revisions from the product dependency snapshot.
3. Configure the component with its own `ECHOION_COMPONENT_VERSION`, build,
test, install, and package it deterministically.
4. Upload with an object-store create precondition and download-verify the
result. An existing object is accepted only when its bytes match.
5. Create or reconcile the component's native Gitea release.
6. Merge that component into the signed channel feed and push one signed
`release-feed` commit.
Gitea 1.25 does not enforce the GitHub Actions `concurrency` and `permissions`
keys. All component release jobs therefore target the dedicated
`echoion-release-serial` runner label. That label must have capacity one.
The feed push is still a compare-and-swap through Git's fast-forward rule, so a
misconfigured second runner fails instead of losing another publication.
## Required configuration
Set `ECHOION_RELEASE_TOOLS_REF` to the full 40-character Echoion commit that
contains the approved release tools. Workflows verify the checkout against the
exact value.
The following Gitea Actions variables are required:
- `ECHOION_RELEASE_TOOLS_REF`
- `ECHOION_DISTRIBUTION_BASE_URL`
- `ECHOION_FEED_BASE_URL`
- `ECHOION_FEED_SIGNING_KEY_ID`
- `COMPONENT_OBJECT_STORAGE_BUCKET`
- `COMPONENT_OBJECT_STORAGE_ENDPOINT` when using a non-AWS S3 service
- `COMPONENT_OBJECT_STORAGE_PREFIX`, normally `components`
- `COMPONENT_OBJECT_STORAGE_REGION`
The following secrets are required in each component repository:
- `RELEASE_CHECKOUT_SSH_KEY`
- `RELEASE_TAG_ALLOWED_SIGNERS`
- `RELEASE_BOT_TOKEN`
- `RELEASE_FEED_ED25519_PRIVATE_KEY`
- `RELEASE_FEED_GIT_SIGNING_KEY`
- `COMPONENT_OBJECT_STORAGE_ACCESS_KEY`
- `COMPONENT_OBJECT_STORAGE_SECRET_KEY`
The Echoion product repository needs only
`RELEASE_FEED_ED25519_PUBLIC_KEY` for feed verification. It must not receive
the component-feed private key.
Use a release-bot PAT limited to repository release and feed publication
operations. Do not share a personal administrator token. Protect `v*` tags and
the Echoion `release-feed` branch, and permit only the release identity to
publish them.
## Manifest schema 3
Independent packages use manifest schema 3. The manifest carries the component
version, product compatibility range, source/tree/ABI identities, exact build
dependency provenance, platform/toolchain contract, activation policy, private
libraries, and file hashes. It does not claim the current Echoion product
version.
The channel catalog is a merge of independently published components. Its
sequence is global and monotonic; each component state also maintains
monotonic per-channel history. Immutable release documents are never replaced
with different artifact or source identities.
Before creating a full Echoion tag, update `components.lock.json` intentionally.
The product workflow verifies every locked component against its signed
immutable feed document before it builds or publishes the product.