portal: the member doors route — GET /api/v1/me/doors = live services × the tier's decider; the portal ledger retired (spec #1361 s30–31) #1370

Closed
opened 2026-09-10 00:56:46 +00:00 by ben · 2 comments
Owner

Parent

Spec #1361 (the Portal); program map #1336; design contract DDR 0232 / ADR 0233, flow docs/ux/flows/portal.mermaid, wireframes docs/ux/wireframes/portal/. Slice doors-route in docs/slices/portal.yaml.

What to build

GET /api/v1/me/doors: the live services from the same per-service health the Services tab reads (deployed placement × health, ADR 0157 url, the catalogue's product line) × GateDecision(sub, slug) through the composed decider; {slug, name, product{name,url}, url?, standing open|resting}; refused doors omitted; the no-hostname set never lists; a resting door carries no url; a removed service is absent. The portal ledger and its PortalLinks port are RETIRED (no portal-links.json written; nothing reads it). Handler tests with fake health + decider.

Acceptance criteria

  • Given a live member, when GET /api/v1/me/doors is called, then it answers {doors:[{slug, name, product{name,url}, url, standing:open}]} for every live service the composed decider admits this identity to, and omits every refused one.
  • Given a service with no access-matrix row, when it is called, then the door is open (the decider's default), and an operator outside a restricted komiti sees that door too.
  • Given a deployed service failing health, when it is called, then its door carries standing:resting and no url.
  • Given a removed service, when it is called, then its door is absent.
  • Given the no-hostname set (front-door, backup-copy), when it is called, then never listed.
  • Given the private path, when it is called, then the decider's answer exactly as on the public path.
  • Given provisioning publishes a health-passed service, when it runs, then no portal-links.json is written; the PortalLinks port is a no-op or removed; nothing reads the ledger.

Blocked by

Task manifest

task: doors-route
implements_flow: portal
implements_edge: PT-S1→SVC (the doors open to me = live services × the tier's decider)
wireframe: ''
interface: GET /api/v1/me/doors → {doors:[{slug,name,product{name,url},url?,standing}]}
seam: controlapi handler tests (fake health + decider)
acceptance:
- given: a live member
  when: GET /api/v1/me/doors is called
  then: it answers {doors:[{slug, name, product{name,url}, url, standing:open}]} for every live service
    the composed decider admits this identity to, and omits every refused one
- given: a service with no access-matrix row
  when: it is called
  then: the door is open (the decider's default), and an operator outside a restricted komiti sees that
    door too
- given: a deployed service failing health
  when: it is called
  then: its door carries standing:resting and no url
- given: a removed service
  when: it is called
  then: its door is absent
- given: the no-hostname set (front-door, backup-copy)
  when: it is called
  then: never listed
- given: the private path
  when: it is called
  then: the decider's answer exactly as on the public path
- given: provisioning publishes a health-passed service
  when: it runs
  then: no portal-links.json is written; the PortalLinks port is a no-op or removed; nothing reads the
    ledger
depends_on:
- me-route
out_of_scope:
- operator truth on the Portal
- operator notices / per-service public switch
- IDIP identity door
- mail on IDIP (stated limit)
- IDIP browser sign-in UX (#1302)
needs_human_decision: []
## Parent Spec **#1361** (the Portal); program map **#1336**; design contract DDR 0232 / ADR 0233, flow `docs/ux/flows/portal.mermaid`, wireframes `docs/ux/wireframes/portal/`. Slice `doors-route` in `docs/slices/portal.yaml`. ## What to build GET /api/v1/me/doors: the live services from the same per-service health the Services tab reads (deployed placement × health, ADR 0157 url, the catalogue's product line) × GateDecision(sub, slug) through the composed decider; {slug, name, product{name,url}, url?, standing open|resting}; refused doors omitted; the no-hostname set never lists; a resting door carries no url; a removed service is absent. The portal ledger and its PortalLinks port are RETIRED (no portal-links.json written; nothing reads it). Handler tests with fake health + decider. ## Acceptance criteria - [ ] Given a live member, when GET /api/v1/me/doors is called, then it answers {doors:[{slug, name, product{name,url}, url, standing:open}]} for every live service the composed decider admits this identity to, and omits every refused one. - [ ] Given a service with no access-matrix row, when it is called, then the door is open (the decider's default), and an operator outside a restricted komiti sees that door too. - [ ] Given a deployed service failing health, when it is called, then its door carries standing:resting and no url. - [ ] Given a removed service, when it is called, then its door is absent. - [ ] Given the no-hostname set (front-door, backup-copy), when it is called, then never listed. - [ ] Given the private path, when it is called, then the decider's answer exactly as on the public path. - [ ] Given provisioning publishes a health-passed service, when it runs, then no portal-links.json is written; the PortalLinks port is a no-op or removed; nothing reads the ledger. ## Blocked by - #1362 ## Task manifest ```yaml task: doors-route implements_flow: portal implements_edge: PT-S1→SVC (the doors open to me = live services × the tier's decider) wireframe: '' interface: GET /api/v1/me/doors → {doors:[{slug,name,product{name,url},url?,standing}]} seam: controlapi handler tests (fake health + decider) acceptance: - given: a live member when: GET /api/v1/me/doors is called then: it answers {doors:[{slug, name, product{name,url}, url, standing:open}]} for every live service the composed decider admits this identity to, and omits every refused one - given: a service with no access-matrix row when: it is called then: the door is open (the decider's default), and an operator outside a restricted komiti sees that door too - given: a deployed service failing health when: it is called then: its door carries standing:resting and no url - given: a removed service when: it is called then: its door is absent - given: the no-hostname set (front-door, backup-copy) when: it is called then: never listed - given: the private path when: it is called then: the decider's answer exactly as on the public path - given: provisioning publishes a health-passed service when: it runs then: no portal-links.json is written; the PortalLinks port is a no-op or removed; nothing reads the ledger depends_on: - me-route out_of_scope: - operator truth on the Portal - operator notices / per-service public switch - IDIP identity door - mail on IDIP (stated limit) - IDIP browser sign-in UX (#1302) needs_human_decision: [] ```

swarm-claim host=matou-dev-server-01 run=20996
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=20996 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1370 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1370,
  "status": "success",
  "commits": [
    "d27ab5d8"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/portal_publication_test.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "dashboard/src/lib/api/generated.ts",
    "internal/controlapi/me_doors.go",
    "internal/controlapi/me_doors_adapter_test.go",
    "internal/controlapi/me_doors_test.go",
    "internal/provision/health.go",
    "internal/provision/portal.go",
    "internal/provision/portal_test.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/controlapi/ ./internal/provision/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/controlapi/... ./internal/provision/... ./control-plane/cmd/control-plane/...",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a live member, GET /api/v1/me/doors answers {doors:[{slug,name,product{name,url},url,standing:open}]} for every live service the composed decider admits and omits every refused one": "me_doors.go registerMeDoors iterates DoorsSource.LiveServices × GateDecision, emits open doors with url+product, skips !Allow; me_doors_test.go TestMeDoors_ListsAdmittedOpenDoorsAndOmitsRefused",
    "Given a service with no access-matrix row the door is open (decider default) and an operator outside a restricted komiti sees it too": "handler trusts GateDecision verbatim; me_doors_test.go TestMeDoors_DefaultOpenAndOperatorSeesRestricted (files open by default; operator ana sees restricted records)",
    "Given a deployed service failing health its door carries standing:resting and no url": "me_doors.go sets DoorStandingResting + omits url when !s.Healthy; me_doors_test.go TestMeDoors_RestingDoorCarriesNoURL",
    "Given a removed service the door is absent": "source (monitor status projection) drops it; me_doors_test.go TestMeDoors_RemovedServiceAbsent + me_doors_adapter_test.go TestLiveDoors_RemovedServiceAbsent",
    "Given the no-hostname set (front-door, backup-copy) never listed": "liveDoors.LiveServices drops any slug with no hostnames.ServiceReachable; me_doors_adapter_test.go TestLiveDoors_ComposesHealthURLAndProductAndDropsNoHostname",
    "Given the private path the decider's answer exactly as on the public path": "handler only reads the decider (URL shape differs by webPort, decision does not); me_doors_test.go TestMeDoors_SuspendedMemberIsRefusedEveryDoor + adapter TestLiveDoors_PrivatePathCarriesForwardedPort",
    "Given provisioning publishes a health-passed service no portal-links.json is written; the PortalLinks port is a no-op; nothing reads the ledger": "whole_composition.go wires no PortalLinks (o.portal nil, portalUp no-op); FilePortalLedger (portal.go) deleted; portal_publication_test.go TestComposePortal_HealthPassedServiceWritesNoLedger/WithheldServiceWritesNoLedger/RestingWritesNoLedger"
  },
  "summary": "GET /api/v1/me/doors answers the signed-in member's open doors from the same per-service health the Services tab reads × the composed decider, and the write-only portal ledger is retired.",
  "blockers": []
}
**close-report** for #1370 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1370, "status": "success", "commits": [ "d27ab5d8" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/portal_publication_test.go", "control-plane/cmd/control-plane/whole_composition.go", "dashboard/src/lib/api/generated.ts", "internal/controlapi/me_doors.go", "internal/controlapi/me_doors_adapter_test.go", "internal/controlapi/me_doors_test.go", "internal/provision/health.go", "internal/provision/portal.go", "internal/provision/portal_test.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/controlapi/ ./internal/provision/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/controlapi/... ./internal/provision/... ./control-plane/cmd/control-plane/...", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 } ], "criteria": { "Given a live member, GET /api/v1/me/doors answers {doors:[{slug,name,product{name,url},url,standing:open}]} for every live service the composed decider admits and omits every refused one": "me_doors.go registerMeDoors iterates DoorsSource.LiveServices × GateDecision, emits open doors with url+product, skips !Allow; me_doors_test.go TestMeDoors_ListsAdmittedOpenDoorsAndOmitsRefused", "Given a service with no access-matrix row the door is open (decider default) and an operator outside a restricted komiti sees it too": "handler trusts GateDecision verbatim; me_doors_test.go TestMeDoors_DefaultOpenAndOperatorSeesRestricted (files open by default; operator ana sees restricted records)", "Given a deployed service failing health its door carries standing:resting and no url": "me_doors.go sets DoorStandingResting + omits url when !s.Healthy; me_doors_test.go TestMeDoors_RestingDoorCarriesNoURL", "Given a removed service the door is absent": "source (monitor status projection) drops it; me_doors_test.go TestMeDoors_RemovedServiceAbsent + me_doors_adapter_test.go TestLiveDoors_RemovedServiceAbsent", "Given the no-hostname set (front-door, backup-copy) never listed": "liveDoors.LiveServices drops any slug with no hostnames.ServiceReachable; me_doors_adapter_test.go TestLiveDoors_ComposesHealthURLAndProductAndDropsNoHostname", "Given the private path the decider's answer exactly as on the public path": "handler only reads the decider (URL shape differs by webPort, decision does not); me_doors_test.go TestMeDoors_SuspendedMemberIsRefusedEveryDoor + adapter TestLiveDoors_PrivatePathCarriesForwardedPort", "Given provisioning publishes a health-passed service no portal-links.json is written; the PortalLinks port is a no-op; nothing reads the ledger": "whole_composition.go wires no PortalLinks (o.portal nil, portalUp no-op); FilePortalLedger (portal.go) deleted; portal_publication_test.go TestComposePortal_HealthPassedServiceWritesNoLedger/WithheldServiceWritesNoLedger/RestingWritesNoLedger" }, "summary": "GET /api/v1/me/doors answers the signed-in member's open doors from the same per-service health the Services tab reads × the composed decider, and the write-only portal ledger is retired.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1370
No description provided.