notifier: per-community SMTP submission credential minting (retire the shared-while-alpha credential) #386

Closed
opened 2026-08-10 03:11:21 +00:00 by ben · 4 comments
Owner

Follow-up filed on closing #369 (ADR 0153, spec docs/superpowers/specs/2026-08-10-own-vps-carrier-design.md §4).

#369 landed the alpha shape: ONE Matou-held submission credential, shared while alpha, fed app-side into the gateway's ourcloud-smtp-* clan vars (render in internal/clan/vmguest.go, gated on GatewayFacts.SMTPSubmission). That amends ADR 0106's end-state (a per-community credential).

Scope: a Matou provisioning endpoint that mints a per-community submission credential at founding, which the carrier's seed leg feeds into the same clan-var pipe (the SMTP{Addr,From,Username,Password}Generator names are the render↔feed contract). Amends this back to ADR 0106's per-community end-state.

Not blocking the rehearsal (#183): the shared credential proves the path.

Follow-up filed on closing #369 (ADR 0153, spec `docs/superpowers/specs/2026-08-10-own-vps-carrier-design.md` §4). #369 landed the alpha shape: ONE Matou-held submission credential, shared while alpha, fed app-side into the gateway's `ourcloud-smtp-*` clan vars (render in `internal/clan/vmguest.go`, gated on `GatewayFacts.SMTPSubmission`). That amends ADR 0106's end-state (a per-community credential). Scope: a Matou provisioning endpoint that mints a per-community submission credential at founding, which the carrier's seed leg feeds into the same clan-var pipe (the `SMTP{Addr,From,Username,Password}Generator` names are the render↔feed contract). Amends this back to ADR 0106's per-community end-state. Not blocking the rehearsal (#183): the shared credential proves the path.
Author
Owner

This was generated by AI during triage.

Triage

Category: enhancement · State: ready-for-human

Redundancy check: searched for any existing credential-minting / provisioning-endpoint pattern (internal/notify, control-plane/cmd/*, and the alert-path renders in internal/clan/vmguest.go) — nothing mints a submission credential anywhere in this repo today. The only existing SMTP credential path is the single shared-while-alpha credential landed by #369 (ADR 0153), which this issue explicitly amends. Not already implemented.

Prior rejection check: no .out-of-scope/ entries exist yet; this is a follow-up explicitly filed (not rejected) alongside #369's close, so it's a live, wanted piece of work — just not a scoped one yet.

Design contract: this isn't a UX-flow gap (no docs/ux/flows/wireframes reference applies — it's backend infrastructure), so the design-to-agent needs-design gate doesn't literally apply. But the same problem exists one layer down: ADR 0153 and the own-VPS carrier design spec both name the dependency as "needs a Matou provisioning endpoint" without specifying what that endpoint is — there is no ADR or design doc ruling: what system mints the credential (a new service? an admin API on the existing mail.matou.nz platform? something else?), what protects it (this mints live SMTP-submission secrets for Matou's shared mail infrastructure — a credential-minting surface reachable by every community's founding flow), or how the carrier's seed leg authenticates to it. No precedent for a "Matou-operated provisioning endpoint" exists anywhere else in the codebase to follow.

Why this can't go to an AFK agent: two judgement calls sit ahead of any code — (1) the shape/location of the provisioning endpoint itself (which platform or service actually issues Matou-mail submission credentials, and where that code/service lives — inside this repo's control plane, or Matou's separate mail-ops tooling), and (2) the security model for a secret-minting endpoint that, if scoped wrong, lets one community mint or read another's mail credentials. Both need a ruling (likely a new ADR) before there's a spec an agent could build against. This also plausibly requires real access to Matou's operated mail infrastructure to implement and test against, which an AFK agent doesn't have.

Brief (for the human who picks this up)

Category: enhancement
Summary: Design and build a Matou-operated provisioning endpoint that mints a per-community SMTP submission credential at founding, replacing the ADR 0153 shared-while-alpha credential and restoring ADR 0106's ruled per-community end-state.

Current behavior:
One Matou-held SMTP submission credential is shared across all alpha communities (ADR 0153), fed app-side into the founding carrier's seed leg and rendered into the gateway's OURCLOUD_SMTP_ADDR/_FROM/_USERNAME/_PASSWORD clan vars (internal/clan/vmguest.go, gated on GatewayFacts.SMTPSubmission). Any alpha community can spoof another's alert-email sender since the credential is shared. This is an accepted, centrally-revocable interim state — not a bug, but a ruled deviation from ADR 0106 with a named follow-up (this issue).

Desired behavior:
At founding, the carrier's seed leg obtains a credential scoped to the one community being founded, minted by a Matou-operated endpoint, and feeds it through the same SMTP{Addr,From,Username,Password}Generator render↔feed contract that already exists — so vmguest.go's render side needs no change, only the seed leg's source of the credential. The shared credential's blast radius (cross-community spoofing) is closed.

Key interfaces:

  • The SMTP{Addr,From,Username,Password}Generator name contract between the render (vmguest.go) and whatever feeds the seed leg — this must stay intact so the render side doesn't need to change.
  • Whatever new client/protocol the carrier's seed leg uses to call the provisioning endpoint (design decision, not yet named).

Acceptance criteria:

  • A design decision is recorded (ADR) naming what mints the credential, where it runs, and how the seed leg authenticates to it.
  • Founding a new community mints a credential scoped to only that community — no other community can use, read, or derive it.
  • The credential reaches the gateway via the existing clan-var render pipe unchanged.
  • Revoking one community's credential does not affect any other community's alert-email delivery.
  • The shared-while-alpha credential path (ADR 0153) is retired once this lands, or an explicit follow-up is filed to retire it.

Out of scope:

  • The dashboard alert-contact editor (separate follow-up, #387).
  • Any change to the alert-contact config surface or SetAlertContact itself.
  • Blocking the #183 rehearsal — the shared credential already proves the path end-to-end.
> *This was generated by AI during triage.* ## Triage **Category:** enhancement · **State:** ready-for-human **Redundancy check:** searched for any existing credential-minting / provisioning-endpoint pattern (`internal/notify`, `control-plane/cmd/*`, and the alert-path renders in `internal/clan/vmguest.go`) — nothing mints a submission credential anywhere in this repo today. The only existing SMTP credential path is the single shared-while-alpha credential landed by #369 (ADR 0153), which this issue explicitly amends. Not already implemented. **Prior rejection check:** no `.out-of-scope/` entries exist yet; this is a follow-up explicitly filed (not rejected) alongside #369's close, so it's a live, wanted piece of work — just not a scoped one yet. **Design contract:** this isn't a UX-flow gap (no `docs/ux/flows`/`wireframes` reference applies — it's backend infrastructure), so the design-to-agent `needs-design` gate doesn't literally apply. But the same problem exists one layer down: ADR 0153 and the own-VPS carrier design spec both name the dependency as "needs a Matou provisioning endpoint" without specifying what that endpoint is — there is no ADR or design doc ruling: what system mints the credential (a new service? an admin API on the existing `mail.matou.nz` platform? something else?), what protects it (this mints live SMTP-submission secrets for Matou's shared mail infrastructure — a credential-minting surface reachable by every community's founding flow), or how the carrier's seed leg authenticates to it. No precedent for a "Matou-operated provisioning endpoint" exists anywhere else in the codebase to follow. **Why this can't go to an AFK agent:** two judgement calls sit ahead of any code — (1) the shape/location of the provisioning endpoint itself (which platform or service actually issues Matou-mail submission credentials, and where that code/service lives — inside this repo's control plane, or Matou's separate mail-ops tooling), and (2) the security model for a secret-minting endpoint that, if scoped wrong, lets one community mint or read another's mail credentials. Both need a ruling (likely a new ADR) before there's a spec an agent could build against. This also plausibly requires real access to Matou's operated mail infrastructure to implement and test against, which an AFK agent doesn't have. ## Brief (for the human who picks this up) **Category:** enhancement **Summary:** Design and build a Matou-operated provisioning endpoint that mints a per-community SMTP submission credential at founding, replacing the ADR 0153 shared-while-alpha credential and restoring ADR 0106's ruled per-community end-state. **Current behavior:** One Matou-held SMTP submission credential is shared across all alpha communities (ADR 0153), fed app-side into the founding carrier's seed leg and rendered into the gateway's `OURCLOUD_SMTP_ADDR/_FROM/_USERNAME/_PASSWORD` clan vars (`internal/clan/vmguest.go`, gated on `GatewayFacts.SMTPSubmission`). Any alpha community can spoof another's alert-email sender since the credential is shared. This is an accepted, centrally-revocable interim state — not a bug, but a ruled deviation from ADR 0106 with a named follow-up (this issue). **Desired behavior:** At founding, the carrier's seed leg obtains a credential scoped to the one community being founded, minted by a Matou-operated endpoint, and feeds it through the same `SMTP{Addr,From,Username,Password}Generator` render↔feed contract that already exists — so `vmguest.go`'s render side needs no change, only the seed leg's source of the credential. The shared credential's blast radius (cross-community spoofing) is closed. **Key interfaces:** - The `SMTP{Addr,From,Username,Password}Generator` name contract between the render (`vmguest.go`) and whatever feeds the seed leg — this must stay intact so the render side doesn't need to change. - Whatever new client/protocol the carrier's seed leg uses to call the provisioning endpoint (design decision, not yet named). **Acceptance criteria:** - [ ] A design decision is recorded (ADR) naming what mints the credential, where it runs, and how the seed leg authenticates to it. - [ ] Founding a new community mints a credential scoped to only that community — no other community can use, read, or derive it. - [ ] The credential reaches the gateway via the existing clan-var render pipe unchanged. - [ ] Revoking one community's credential does not affect any other community's alert-email delivery. - [ ] The shared-while-alpha credential path (ADR 0153) is retired once this lands, or an explicit follow-up is filed to retire it. **Out of scope:** - The dashboard alert-contact editor (separate follow-up, #387). - Any change to the alert-contact config surface or `SetAlertContact` itself. - Blocking the #183 rehearsal — the shared credential already proves the path end-to-end.
Author
Owner

Ruled by Ben 2026-08-10: yes — proceed to ADR 0106's per-community end-state, exactly as ADR 0153's amendment clause anticipated ("per-community when a Matou provisioning endpoint exists; shared until then") — no new ADR needed, 0153's interim clause self-retires when this lands. Scope split for the swarm: the code slice is ready-for-agent — the minting endpoint (broker service, this repo) + the carrier's seed leg feeding the minted credential into the existing SMTP{Addr,From,Username,Password}Generator clan-var pipe (render↔feed contract unchanged), plus revocation of a community's credential at offboard. The droplet deploy leg stays human (Ben deploys to the mail droplet, as with the broker itself); the shared-while-alpha credential keeps working until the swap, and its retirement is the last step, not the first.

**Ruled by Ben 2026-08-10: yes — proceed to ADR 0106's per-community end-state**, exactly as ADR 0153's amendment clause anticipated ("per-community **when a Matou provisioning endpoint exists**; shared until then") — no new ADR needed, 0153's interim clause self-retires when this lands. Scope split for the swarm: the **code slice** is `ready-for-agent` — the minting endpoint (broker service, this repo) + the carrier's seed leg feeding the minted credential into the existing `SMTP{Addr,From,Username,Password}Generator` clan-var pipe (render↔feed contract unchanged), plus revocation of a community's credential at offboard. The **droplet deploy leg stays human** (Ben deploys to the mail droplet, as with the broker itself); the shared-while-alpha credential keeps working until the swap, and its retirement is the last step, not the first.
Author
Owner

Blocked — needs a human ruling (asked Ben in Mattermost thread wtjyoqfo3jb8jd5rm8a7apgdco; no reply within the wait window, so parking here — a late reply resumes that same thread).

The 2026-08-10 ruling scopes the code slice as "the carrier's seed leg feeding the minted credential into the existing SMTP{Addr,From,Username,Password} clan-var pipe (render↔feed contract unchanged)". Building against the code, that pipe is only half-built and there is no working feed mechanism — so "feed into the existing pipe" needs a design decision the ruling's premise didn't cover.

Findings (code as of this iteration):

  1. #369 landed only the render half: internal/clan/vmguest.go dereferences generators ourcloud-smtp-* and ourcloud-claim-secret ($(cat ${gen.files.secret.path})), gated on GatewayFacts.SMTPSubmission/ClaimSecret.
  2. Those flags are never set true on any production path (the own-VPS carrier installOwnVPS doesn't set them), and the generators are declared nowhere (no nix script, no SetVarSpec). So the shared-while-alpha credential was never actually fed into a founded community — there is no live feed to "keep working until the swap", and flipping SMTPSubmission on today would eval-fail on undeclared generators.
  3. There is no mechanism to inject an app-held secret into a node's clan vars in this flow: the enrollment preflight runs a node-wide clan vars generate <node> with no answers (internal/clan/enrollment.go), which conflicts with a prompting-generator feed (an unsealed prompt hangs/fails headlessly).

Decision needed — how should the app-held credential enter the gateway's clan vars?

  • A) Reduce this issue to the broker-side minting endpoint + revocation (broker service, this repo) + the app-side brokerclient method — the piece named in the ruling — fully TDD'd; file a separate ticket for the carrier feed + the app-secret-into-clan-vars mechanism (its own design + lab proof against mail infra).
  • B) Design+build the full feed now via: declare the smtp/claim generators as prompting generators in the render and add a seed-leg Vars.Generate(answers) that seals them before the enrollment's node-wide generate runs (a render change — contra "render unchanged" — and a re-order of the carrier legs); no live proof this iteration.
  • C) Other — you may have an injection path in mind.

Re-arm by resolving the decision (a comment here suffices) and re-adding ready-for-agent.

**Blocked — needs a human ruling (asked Ben in Mattermost thread `wtjyoqfo3jb8jd5rm8a7apgdco`; no reply within the wait window, so parking here — a late reply resumes that same thread).** The 2026-08-10 ruling scopes the code slice as "the carrier's seed leg feeding the minted credential into the **existing** `SMTP{Addr,From,Username,Password}` clan-var pipe (render↔feed contract unchanged)". Building against the code, that pipe is only half-built and there is no working feed mechanism — so "feed into the existing pipe" needs a design decision the ruling's premise didn't cover. **Findings (code as of this iteration):** 1. #369 landed only the **render half**: `internal/clan/vmguest.go` dereferences generators `ourcloud-smtp-*` and `ourcloud-claim-secret` (`$(cat ${gen.files.secret.path})`), gated on `GatewayFacts.SMTPSubmission`/`ClaimSecret`. 2. Those flags are **never set true on any production path** (the own-VPS carrier `installOwnVPS` doesn't set them), and the generators are **declared nowhere** (no nix script, no `SetVarSpec`). So the shared-while-alpha credential was never actually fed into a founded community — there is no live feed to "keep working until the swap", and flipping `SMTPSubmission` on today would eval-fail on undeclared generators. 3. There is **no mechanism to inject an app-held secret into a node's clan vars** in this flow: the enrollment preflight runs a node-wide `clan vars generate <node>` with no answers (`internal/clan/enrollment.go`), which conflicts with a prompting-generator feed (an unsealed prompt hangs/fails headlessly). **Decision needed — how should the app-held credential enter the gateway's clan vars?** - **A)** Reduce this issue to the broker-side minting endpoint + revocation (broker service, this repo) + the app-side `brokerclient` method — the piece named in the ruling — fully TDD'd; file a separate ticket for the carrier feed + the app-secret-into-clan-vars mechanism (its own design + lab proof against mail infra). - **B)** Design+build the full feed now via: declare the smtp/claim generators as **prompting** generators in the render **and** add a seed-leg `Vars.Generate(answers)` that seals them **before** the enrollment's node-wide generate runs (a render change — contra "render unchanged" — and a re-order of the carrier legs); no live proof this iteration. - **C)** Other — you may have an injection path in mind. Re-arm by resolving the decision (a comment here suffices) and re-adding `ready-for-agent`.
Author
Owner

Ben's ruling 2026-08-13: OPTION A — split. (Resolves the parked 2026-08-11 decision above.)

This ticket's scope shrinks to the minting side only, fully TDD'd:

  • the broker-side minting endpoint (per-community SMTP submission credential) + revocation — broker service, this repo;
  • the app-side brokerclient method that requests it at founding and holds it for the seed leg.
  • Explicitly OUT of scope: any feed into clan vars. Do not set SMTPSubmission, do not declare/feed the ourcloud-smtp-* generators. The app holding the minted credential (with a test proving it survives to where the seed leg would consume it) is this ticket's finish line.

The feed half is #507 — blocked by #505, which is landing the first app-held-secret→clan-var feed (claim secret, "box holds the key") and becomes the pattern to copy.

Record correction (2026-08-13, cross-session verification): the premise "feed into the existing pipe" from the 2026-08-10 ruling — and a later "the seed-leg feed already exists" reading — both traced to internal/clan/clan.go:378's doc comment, which is #369's design INTENT, not landed code. Verified at HEAD: the render half exists, fact-gated off everywhere; no feed exists anywhere. The parked worker's findings were accurate.

Re-arming ready-for-agent per the parking comment's re-arm instruction.

**Ben's ruling 2026-08-13: OPTION A — split.** (Resolves the parked 2026-08-11 decision above.) **This ticket's scope shrinks to the minting side only, fully TDD'd:** - the broker-side minting endpoint (per-community SMTP submission credential) + revocation — broker service, this repo; - the app-side `brokerclient` method that requests it at founding and holds it for the seed leg. - **Explicitly OUT of scope: any feed into clan vars.** Do not set `SMTPSubmission`, do not declare/feed the `ourcloud-smtp-*` generators. The app holding the minted credential (with a test proving it survives to where the seed leg would consume it) is this ticket's finish line. **The feed half is #507** — blocked by #505, which is landing the first app-held-secret→clan-var feed (claim secret, "box holds the key") and becomes the pattern to copy. **Record correction (2026-08-13, cross-session verification):** the premise "feed into the *existing* pipe" from the 2026-08-10 ruling — and a later "the seed-leg feed already exists" reading — both traced to `internal/clan/clan.go:378`'s doc comment, which is #369's design INTENT, not landed code. Verified at HEAD: the render half exists, fact-gated off everywhere; no feed exists anywhere. The parked worker's findings were accurate. Re-arming ready-for-agent per the parking comment's re-arm instruction.
ben closed this issue 2026-08-14 03:44:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#386
No description provided.