Skip to main content

Known issues & gaps

Every item here was found by reading the cse-http-be source (audit of 2026-09-24), not by running requests against dev. The "Confidence" column says how sure the finding is. Each API page links to the items that affect it. When an item is fixed, delete it here and correct the affected page(s) in the same change.

Summary​

IDAreaIssueImpactConfidence
KI-5Email OTP sign-inOnly registered, verified accounts pay for the DynamoDB + SES callsTiming side-channel on account existenceMedium
KI-6Email OTP sign-inNot usable by real users yet: needs a verified SES sender (-c otpSenderEmail), DKIM and SES sandbox exit (owner actions); old phone-OTP app builds stop signing in on deployCodes reach only SES-verified recipients until thenHigh (known)
KI-7Legacy POST/PUT routes (the seven lenient mobile routes)A body that isn't valid JSON throws SyntaxError500 INTERNAL instead of 4xx. Already fixed on every strict route (the Team API and on, 400 MALFORMED_REQUEST) — only these seven original lenient routes still have the bug — see detailsHigh
KI-8POST …/devicesClaiming a serial again on the same plant returns 500 FIXED in feature 005 (code complete, not deployed)Now 200 with the existing deviceHigh
KI-9POST …/devicesUniqueness check reads an eventually-consistent GSI FIXED in feature 005 (serial guard item; code complete, not deployed)Two plants claiming the same serial at the same moment can both succeedHigh
KI-10GET /v1/meNothing writes deviceCount onto membership items FIXED in feature 005 (stream router maintains it; code complete, not deployed)deviceCount is always 0 until feature 005 (devices) maintains itHigh
KI-11GET /v1/meselectedPlantId is never set automaticallyAbsent after the first plant is created, until the client PUTs itHigh
KI-12AuthorizationNo endpoint adds members CLOSED — superseded by feature 003's org-scoped roles/scopes/shares modelN/A — see detailsHigh
KI-15Profileemail/displayName are copied from Cognito onceLater Cognito name changes don't show up in GET /v1/me. A stored empty email is a partial exception — see details belowHigh
KI-16ToolingIdentityProvider.createUser omits phone_number, which the pool requiresThat method (and a naive admin-create-user) is expected to failMedium
KI-17InfraCognito not on SESPassword-reset email capped at Cognito's built-in senderHigh (known)
KI-21POST /v1/plantsNo idempotency key FIXED in feature 004 — the route now honours Idempotency-Key (optional on mobile, required on the web X-Org-Id variant)A retry with the same key replays the first response instead of creating a duplicateHigh (code reading, 2026-10-13)
KI-19Plant timezoneUTC offsets such as +05:00 were accepted FIXED in feature 004Only IANA names are accepted now; an offset is 422 VALIDATION_FAILEDHigh (code reading, 2026-10-13)
KI-24Team API — GET .../members, GET .../scopes/summaryInvitations never appear in the people list or scope summary, and the org's pending-invitation count is always 0status=INVITED matches zero rows; list pending invitations with GET .../invitations. A page can hold fewer than limit items while a cursor is present. members/summary, the members list statusCounts.INVITED and /v1/me/context pendingInvitations are exact counts since 2026-11-25 (deployed to dev); always 0 beforeHigh (code + unit tests, 2026-11-04; counts fixed 2026-11-25)
KI-57Team API, shares, access requestsMember, share and access-request counters (and member/share search tokens) were never maintained by the deployed stream-routerPeople counts, role/department memberCount, members q search, share level bands and the pending access-request badge read 0 / nothing. Fixed and rebuilt on dev 2026-11-25; access-request rebuild added 2026-11-26 (dev dry run: no access requests to count)High (bundle inspected, unit tests, 2026-11-25)
KI-25Team API — PATCH .../members/{sub}, POST .../members/{sub}:suspend, GET .../roles/{roleId}, GET .../scopes/summarySeveral response fields are permanent placeholders todayPATCH's impact is always {} (plantsRemovedApprox never computed); :suspend's assignedWorkOrdersRemain is always false; ScopesSummary carries no per-kind design caveatMedium (code reading, 2026-10-02)
KI-27Team API — POST .../members:bulk-assign-scope, POST .../departmentsIdempotency-Key required but doesn't replayA retry with the same key re-executes rather than returning the stored response (no commitItem, same gap as invitations create)Medium (code reading, 2026-10-03)
KI-28Shares (email grantee)Invitations are in-app only since 2026-11-17An external-share invitee with no account has no way to learn of the share except the non-production acceptUrlMedium
KI-29Authorization — MFAMoot since 2026-11-11 (two-factor is never required; the gate never forms). CUSTOM_AUTH (email OTP) sign-in may bypass TOTP enrolment (no amr claim on the LITE Cognito plan to check)MFA_ENFORCEMENT defaults to warn (logs only, never blocks) until the OQ-09 manual verification procedure confirms the risk; flipping to on before then could lock out legitimate email-OTP users on an mfaRequired orgMedium — mitigated by the warn default, not yet independently verified
KI-30Retired 2026-10-26 (ADR 0012 phase 3) — DELETE /v1/plants/{plantId}Plant delete skips devices it cannot releasePlant delete now removes every serial binding; nothing is skipped—
KI-31Resolved by removal (ADR 0012) — PATCH /v1/device-models/{modelId}A model is marked "in use" only by a manufacturing-record importA type change is still accepted on a model whose only users are registered/claimed devicesMedium
KI-37Email delivery (password reset, report emails; invitations are in-app only)SES is still in sandbox: DKIM verification and sandbox exit are pending (owner actions)Email reaches only SES-verified recipients (see KI-6, KI-17). Invitations are not emailed at allHigh (known)
KI-38Any routeIntermittent 503 DEPENDENCY_UNAVAILABLEAn AWS SDK call was throttled or unavailable; retry after Retry-After: 1. Find the dependency with the Logs Insights query in Operations → TroubleshootingHigh (code reading, 2026-10-28)
KI-39Legacy (mobile-created) plants on the webMigrated on dev 2026-10-29 (17 plants); app-created plants are legacy again until the next run; staging/prod pending, and must wait for the mobile edit/delete fixWhere unmigrated: favourites list them without entity; they are missing from search suggestions and the web plant listHigh (executed against dev, 2026-10-29)
KI-40Brand-asset uploads (N-49)Fixed in code, not deployed (issue #14, 2026-11-13): uploads now go to pending/brand/<org>/<asset>, which the bucket's 1-day pending/ lifecycle rule cleans up. Not verified on devUntil deployed, unconfirmed uploads still stay under brand/. Objects left there before the fix are not cleaned up by the new ruleHigh (code reading, 2026-11-13; not run on dev)
KI-41Report renderingSuperseded. The TCP Server built a renderer after 2026-10-29; its reports integration page records an end-to-end report verified on dev on 2026-11-05. Not re-verified from the HTTP side, and the scheduled-run path has not been checked end to end on devNewer renderer content (sections, completeness, dataAsOf) and manifest v5 (platform-wide reports) depend on the TCP deploy stateMedium (TCP documentation, 2026-11-25)
KI-42Plant deletion sagaBoth halves are now in code: the TCP Server's plant eraser replies plant.erasure.completed.v1, and this API's handler for it erases the plant. Whether both are deployed and working on dev is not verifiedIf the eraser isn't running on dev, or has no TCP_EVENTS_TOPIC_ARN, a web-deleted plant still stays DELETING (410 GONE) and the 24 h overdue sweep reports itMedium (code reading of both repos, 2026-11-13; not run on dev)
KI-43Every stream-maintained projection (search, counters, access index, inbox, outbox)Resolved on dev (bus on since 2026-11-19; cse-http-be-dev-integration re-verified UPDATE_COMPLETE on 2026-11-23). On a stage deployed without busEnabled, the IntegrationStack, and with it the stream-router, is not createdOn such a stage writes succeed, but nothing derived from them updates: new or renamed records are missing from search, facet and customer counters go stale, revocations do not fan out, the HTTP inbox stays empty and no event reaches the TCP ServerHigh (code reading, 2026-10-29)
KI-44Platform-wide plant list (SVC-2, ADR 0016; committed 2026-11-03, not deployed)Super Admin / Administrator in Crown HQ can list every org's plants, but the summary counts, the installer filter and plants created before the deploy are not covered yetGET /v1/plants/summary from HQ still needs operatorOrgId; installerOrgId without operatorOrgId is 400; older plants are missing from the all-org list until rebuild:projections -- --all-orgs --execute runs; q matches only plants the stream-router has tokenised (KI-43)High (code reading, 2026-11-03)
KI-45Plant devices (binding) and the web console's Device InventoryADR 0018: the binding follows TCP's device.binding.changed.v1. Resolved on dev (both servers deployed, first sync completed 2026-11-04); not deployed on staging or prodOn staging and prod, a transfer accepted in TCP isn't reflected here until both servers are deployed there; the first sync then takes about 28 h for 1M devicesHigh (verified on dev from logs and queue metrics, 2026-11-04)
KI-48Web push (ADR 0022; HTTP half committed 2026-11-06, not deployed)Updated 2026-11-25 from the TCP side: its FCM sender runs on dev and honours link, tag and platforms. Still open: the sender's Firebase project (cse-datalogger) differs from the one these docs name (crown-solar-energy-dev); WEB_CONSOLE_ORIGIN is unset on dev, so push links are bare paths; iOS pushes fail with an invalid APNs credentialWeb tokens minted in another Firebase project are rejected by FCM; a bare-path link may be refused. Report-ready pushes for ["WEB"] no longer reach mobileMedium (TCP session report, read-only checks, 2026-11-25; no push verified end to end)
KI-49Crown HQ dashboard fleet view (bug B-2, ADR 0024; committed 2026-11-11, not deployed)The HQ dashboard reads fleet-wide counters that start empty and count suspended orgsUntil deployed, HQ shows 0 plants / 0 kWp / 0 regions. After deploy, only plants created or changed since then show up until rebuild:projections -- --all-orgs --execute runs. Plants of a suspended org stay counted (owner decision). Counts can differ from the TCP fleet messages, which count plants by in-service devicesHigh (code reading, 2026-11-11)
KI-50Role boundaries (console request 2026-11-11; deployed to dev 2026-11-12)Backfills and rebuild:projections --all-orgs run on dev 2026-11-12; nothing open on the HTTP sideNone on dev: all 19 personal orgs and 15 live plants are in the Crown-wide list, fleet totals and searchHigh (executed against dev, 2026-11-12)
KI-52Sign-in records (session fixes 2026-11-12; committed, not deployed)No IP-location provider is configured; Cognito cannot revoke one sign-in's refresh token; an open TCP WebSocket is not cut at oncelocation stays absent on every row (ipAddress is recorded); an ended device can still refresh at Cognito (every token is refused by this API); an open WebSocket from an ended sign-in drops within about 11 minutesHigh (code reading, 2026-11-12)
KI-53Push: End Users only and the push toggle (ADR 0025; HTTP half written 2026-11-13, not committed, not deployed)The TCP Server must honour pushEligible (its own ws-gateway tokens included) and the stricter pushEnabled; staff already on the TCP side stay unprojected until one reconciliation run after deployUntil both sides deploy, staff still get mobile alert push and the push toggle does not stop CRITICAL pushesHigh (code reading, 2026-11-13)
KI-54Plant hasBattery (battery moved to devices, 2026-11-18; written, not committed, not deployed)Plant hasBattery is derived from TCP's per-device battery flag on device.binding.changed.v1; existing plants learn it only from TCP's migration 0138 events (single-device plants) or a later battery changeUntil then a plant reports hasBattery: false (and gridTopology ON_GRID, battery-temperature alert default off). Deploy this server before TCPHigh (code reading and unit tests, 2026-11-18)
KI-51Profile picture (/v1/me/avatar; committed 2026-11-11, not deployed)The server does not strip image metadata, and other users cannot see a user's picture yetA JPEG uploaded without re-encoding keeps its EXIF data (for example GPS location), readable by anyone holding the 5-minute signed URL — today only the user. Team lists, work orders and other screens still show initialsHigh (code reading, 2026-11-11)
KI-33Resolved by removal (ADR 0012) — D13 device transfersThe hourly sweeper is in IntegrationStack (busEnabled only)Without the bus, PENDING transfers never auto-expire; they expire only when someone tries to decide them (409 TRANSFER_EXPIRED)High
DEV-2026-10-13Dev verification run, 2026-10-13Several routes 500 on dev; some docs were wrongResolved: fixes and GSI3 deployed to dev 2026-10-13; realtime still needs its flagHigh (executed against dev)
FE limits 005Device registryDeliberate contract limitsSee belowHigh

FE contract limits (feature 005)​

These are by design, not bugs; build the console around them.

  • Search fields: inventory q (2–64 chars) is a prefix match on serial, label and model only. No search on plant name, customer, installer or country; use the filters instead. With q or plantId only the default sort is allowed.
  • No fleet-wide list: every device list is scoped to one organisation (GET /v1/orgs/{orgId}/devices) or one plant. There is no cross-org device list, not even for Crown; use the verification queue or serial lookup.
  • Removed (ADR 0012) — CSV only: bulk import (D14) accepts text/csv only, ≤ 5 MiB, ≤ 5,000 rows. No XLSX. D14 is routed; without -c busEnabled=true there is no import queue/worker, so :validate/:commit answer 503; the import queue, worker and uploads bucket are gone (Device imports).
  • PARENT_OFFLINE not computed: the warning row code exists in the enum but is never emitted; it needs live telemetry, which this API never reads.

Details​

KI-5​

Timing side-channel on account existence

The response shape is the same for registered and unregistered emails. Timing is not: only a registered account with a verified email triggers the conditional throttle PutItem and the SES SendEmail. That adds tens to hundreds of milliseconds. So the "identical at every step" claim holds for shape, not timing.

KI-6​

Email OTP sign-in not usable by real users yet

Phone + SMS sign-in was removed (owner decision OQ-09, 2026-10-27); sign-in codes go by email through SES. Before real users can sign in this way:

  • Deploy with -c otpSenderEmail=<verified SES identity> (optionally -c otpSesConfigurationSet=<name>). Without it no code is sent and CreateAuthChallengeFn logs email_signin_sender_not_configured.
  • SES DKIM verification and sandbox exit (owner actions). In the sandbox only verified recipient addresses receive mail (200/day).
  • Codes are sent only to an account whose email is verified; otherwise the trigger logs email_signin_unverified_address and sends nothing.

Old app builds: builds that use the removed phone + SMS sign-in stop signing in once this version is deployed. There is no transition period (owner decision).

No real email sign-in has been captured against dev yet.

KI-7​

Malformed JSON body returns 500 — legacy lenient routes only

Fixed for strict routes (parseBody(), packages/api/src/http/claims.ts): a present-but-invalid body is now 400 MALFORMED_REQUEST. PATCH /v1/orgs/{orgId}/members/{sub} (Team) is the first live strict route with a body, so the fix is reachable today — the bug remains only on the seven original legacy routes below.

On the seven legacy lenient routes (the ones the shipped APK calls), parseBody() still calls JSON.parse(raw) unguarded, deliberately, until the mobile team confirms the shipped APK always sends valid JSON (CR-13). A SyntaxError there is neither an AppError nor a ZodError, so handler() logs unhandled_error and returns 500 INTERNAL. An empty body is handled correctly on every route (422, "Request body is required").

KI-8​

:::note Fixed in feature 005 (code complete, not yet deployed) A same-plant re-claim now returns 200 with the existing device. See Devices API. :::

Same-plant re-claim of a serial returns 500

claimDevice() writes the device inside a TransactWriteCommand with attribute_not_exists(PK) OR attribute_not_exists(SK). If the serial is already on the same plant, findPlantBySerial() returns that plant, the "other plant" check passes, and the transaction's condition fails with TransactionCanceledException. Nothing maps that exception, so it becomes 500 INTERNAL.

KI-9​

:::note Fixed in feature 005 (code complete, not yet deployed) A SERIAL#<serialNorm>/GUARD item is written in the claim transaction; a concurrent claim elsewhere gets 409 CONFLICT. Legacy duplicates are quarantined on migration. :::

Concurrent claims of one serial can both succeed

Global uniqueness comes from a Query on GSI1 before the write. GSI reads are eventually consistent, and the device item's key (PLANT#<id> / DEVICE#<serial>) differs per plant, so the transaction's condition can't catch a claim under another plant. Two claims for the same serial on two plants, close together in time, can both be written. A real fix needs a uniqueness item keyed on the serial alone (e.g. SERIAL#<serial>/CLAIM), written in the same transaction with attribute_not_exists(PK).

KI-10​

:::note Fixed in feature 005 (code complete, not yet deployed) The stream router adds/subtracts deviceCount on each access-index item when a device is linked to or removed from a plant. :::

deviceCount is always 0

getAccountSummary() sums a deviceCount attribute on each membership item. claimDevice() never increments it, and nothing else writes it. Device claiming is implemented, but GET /v1/me and PUT /v1/me/selected-plant still return deviceCount: 0.

Fix path (feature 005, code complete, not deployed): the stream router adds 1/subtracts 1 on each access-index item when a plant-device link is inserted/removed (idempotent on redelivery); when a user gains access to a plant, the access-index seeds their deviceCount by counting the plant's device links (bounded query). The count is approximate: a link in flight can be counted twice, and a partial failure can undercount. Until 005 deploys, treat 0 as "unknown", not "no devices".

KI-11​

selectedPlantId is never set automatically

createPlant() doesn't set the creator's selectedPlantId. The self-heal in GET /v1/me only fires when a value exists and is stale. It never fills in a missing one. An account with plants has no selectedPlantId until the client calls PUT /v1/me/selected-plant. So clients shouldn't read "no selectedPlantId" as "no plants". Use plantCount.

KI-12​

Only OWNER memberships can exist — CLOSED (2026-10-03, feature 003's evaluator)

The original finding: the only code that wrote legacy plant memberships was createPlant(), and it always wrote role: 'OWNER', with no invite/add-member endpoint for that model — so the VIEWER check in claimDevice() and the ADMIN/VIEWER distinction could never be reached, and access pattern #6 (members of a plant, GSI1PK=PLANT#<id>) had nothing querying it.

Why this is closed, not fixed: feature 003 doesn't add an ADMIN/VIEWER-granting endpoint to the legacy per-plant model — it replaces graduated access with the org-scoped roles/scopes/shares model described in Authorization instead. The evaluator (effectiveAccess) reads the three legacy memberships as a compatibility path alongside the new organisation paths — OWNER as the external FULL ceiling, ADMIN as EDIT, VIEWER as VIEW — so the original impact ("every membership is OWNER, ADMIN/VIEWER unreachable") no longer describes a gap: an operator org's own Technician/Sales/Operations Manager/Compliance Auditor roles, or an external share at one of the 5 ceiling levels, are now the real way to grant anything less than full access to a plant. createPlant() still only ever writes OWNER — that's expected, not a bug, since a plant's creator legitimately gets full access at creation. Access pattern #6 remains undesigned-against; nothing on this site claims it will be built.

KI-15​

Profile fields aren't synced from Cognito

ensureUserProfile() copies email, name → displayName, and custom:terms_accepted_at once, when the profile is created. There's no general update path: a later change to the user's Cognito name doesn't reach GET /v1/me.

Partial exception (T002-039): email specifically is repaired, not just copied once. An access token has no email claim (requireClaims() reads it from JWT claims only), so a profile auto-provisioned from an access-token call used to be stored with email: "" permanently. ensureUserProfile() (packages/core/src/repositories/users.ts) now takes an IdentityProvider and:

  • on first provisioning, falls back to identityProvider.getUserEmail(sub) (Cognito AdminGetUser, by sub) when the token carried no email, so a fresh profile is no longer stored with "";
  • on every subsequent GET /v1/me, if the stored profile's email is still "" (from before this fix), repairs it in place from the same AdminGetUser call and returns the repaired value.

This only fixes email. displayName and termsAcceptedAt are still copied once and never resynced.

KI-16​

Admin user creation omits the required phone_number

The user pool marks phone_number as a required standard attribute. CognitoIdentityProvider.createUser() (and the admin-create-user example formerly in docs/getting-started.md) sends only email, email_verified and optionally name. Cognito is expected to reject this for a missing required attribute. Operations → Minting a test JWT includes phone_number.

KI-17​

Cognito email not on SES

Known and deliberate for now. See Authentication → Forgot / reset password. (No CloudFront is a separate, already-documented architectural decision — see Architecture → Overall architecture — not listed here as an issue.)

KI-21​

Creating a plant wasn't idempotent — FIXED in feature 004

POST /v1/plants used to take no idempotency key, so a client retry after a lost response created a second plant. Feature 004 wired the existing claim/commit/complete mechanism (ADR 0010, FR-012–FR-015) to the route: lib/routes.ts now declares CreatePlant with idempotency: 'optional'. A retry that sends the same Idempotency-Key gets the stored first response back. The web variant (with X-Org-Id) requires the header (428 PRECONDITION_REQUIRED without it); the mobile variant accepts it but does not require it, so the shipped APK keeps working. Mobile clients that do not send the header still need the client-side check in the FE guide.

KI-19​

Plant timezone accepted UTC offsets — FIXED in feature 004

The shared Timezone schema in packages/core/src/schemas.ts now accepts IANA names only (for example Asia/Karachi). An offset such as +05:00 is rejected with 422 VALIDATION_FAILED (T004-012).

KI-24​

People list and scope summary never show invitations (by design)

GET /v1/orgs/{orgId}/members and GET /v1/orgs/{orgId}/scopes/summary list members only. Pending invitations have their own list, GET /v1/orgs/{orgId}/invitations. status=INVITED is accepted by the query schema but always matches zero rows, and no list item ever carries an inviteId.

Internal and delegated invitations are still written into the same DynamoDB indexes the People list reads (data model D-05). Both routes drop every item that is not a membership after the read, so:

  • a page can hold fewer than limit items (even zero) while a cursor is still returned; keep paging until it is absent;
  • revoking or accepting an invitation removes it from those indexes; an invitation that simply expires stays in them until its ttl (expiry + 30 days) deletes it, which the filter makes harmless.

Pending invitations are left out of the member counts. Their own count — GET …/members/summary pendingInvitations, the members list statusCounts.INVITED and GET /v1/me/context badges.pendingInvitations — was always 0 until 2026-11-25, because it read the org counter COUNT#invitations#status#PENDING, which nothing maintains. Since 2026-11-25 (deployed to dev) all three count the org's PENDING, unexpired invitations directly (repositories/invitation-counts.ts). The per-role count on GET …/roles/{roleId} is a live query and is correct. A caller's own pending invitations are counted by badges.myInvitations (2026-11-23).

History: until 2026-11-04 (cse-http-backend#15) the routes did not filter, so one pending invitation made GET …/members answer 500 INTERNAL and put an item with no sub into the scope summary.

KI-25​

A few Team API fields are permanent placeholders until later features land

  • PATCH /v1/orgs/{orgId}/members/{sub}'s response impact is always {} — plantsRemovedApprox is never computed, even when a scope narrowing genuinely drops plants from the member's coverage.
  • GET /v1/orgs/{orgId}/scopes/summary's ScopesSummary carries no per-scope-kind design caveat (ALL_REVIEW_OFTEN/TAG_SILENT_GRANT from the design copy are not surfaced).
  • POST /v1/orgs/{orgId}/members/{sub}:suspend's response assignedWorkOrdersRemain is always false — it's meant to warn that a suspended technician still has open work orders assigned, sourced from a facet counter feature 006 (work orders) hasn't been built yet to maintain.

KI-27​

Idempotency-Key on POST /v1/orgs/{orgId}/members:bulk-assign-scope and POST /v1/orgs/{orgId}/departments doesn't replay

Both routes require the header (428 if missing) and reject a reused key with a different body, but neither splices a commitItem into its own write path — so a crash/timeout between commit and response leaves no stored response to replay from. A retry with the same key re-executes the operation rather than returning the original response. For bulk-assign-scope this is low-risk in practice (re-applying the same scope to a member already on it is a harmless no-op, see Team API's own note); for department creation a retry after a genuine partial failure could attempt the create again and surface 409 ALREADY_EXISTS instead of the original 201. Same documented simplification as POST /v1/orgs/{orgId}/invitations's own gap.

KI-28​

Invitations are in-app only — no invitation email (2026-11-17)

The invitation email path was removed (owner decision 2026-11-17): no SES call, no INVITE_EMAIL_* variables, no ses:SendEmail grant on the invitations function. An invitee with an account sees pending invitations with GET /v1/me/invitations and accepts or declines them in the app. delivery.status is always NOT_SENT.

  • Since 2026-11-23 (deployed to dev 2026-11-23) an invitee whose account has the invited email verified also gets an INVITATION_RECEIVED inbox item and web push when an INTERNAL/DELEGATED invitation is created or renewed. Share (EXTERNAL) invitations get none.
  • Someone with no account learns of an invitation only outside the system (the inviter tells them; outside prod the console can copy acceptUrl). Once they sign up with the invited email and verify it, the invitation is in their in-app list.
  • POST /v1/orgs/{orgId}/shares's email-grantee path has the same property.

KI-29​

Superseded 2026-11-11 (product decision): two-factor is the user's own choice. No organisation, org kind or role requires it — effectiveMfaRequired is always false — so no route returns 403 MFA_REQUIRED, whatever MFA_ENFORCEMENT is set to. The code stays reserved in the contract. The text below describes the earlier behaviour.

MFA enforcement can't cryptographically verify CUSTOM_AUTH used TOTP (OQ-09)

Cognito's LITE feature plan issues no amr (authentication methods reference) claim, so a request authenticated via email OTP (CUSTOM_AUTH) is indistinguishable, from the token alone, from one that somehow bypassed TOTP entirely. Authorization's MFA check works around this by trusting only the client id the request came through (WEB_CONSOLE_CLIENT_IDS — SRP-only, TOTP-challenging clients) rather than anything in the token itself; MFA_ENFORCEMENT ships defaulted to warn (logs what would have been a 403 MFA_REQUIRED refusal, never blocks) specifically so this can run in dev and be observed before anyone flips it to on. The manual verification procedure (specs/003-organizations-access/quickstart.md §6, repo-internal) confirms CUSTOM_AUTH never independently satisfies an org's MFA requirement before that flip happens. Until that verification is complete and -c mfaEnforcement=on is set, an org with mfaRequired is only advisory-enforced for email-OTP sign-ins, not hard-blocked.

Owner decision (OQ-09 sign-in, 2026-10-27): the mobile app signs in with email OTP only and can never satisfy an MFA requirement. A refused request now carries details.reason: WEB_CONSOLE_SIGN_IN_REQUIRED (non-web token) or TOTP_ENROLMENT_REQUIRED (web token, no TOTP).

Closed (2026-10-27): the earlier bypass where routes without an org selector skipped the MFA check is closed for both plant and org-level paths: every route acting through an MFA-requiring membership (plants, reports, schedules, invitations, plant jobs, service routes, device binding) is gated by that membership, with or without X-Org-Id (see Authorization).

Dev verification (2026-10-13)​

Unlike the items above, this one comes from requests executed against dev on 2026-10-13. Resolved: every fix below was deployed to dev on 2026-10-13 (data stack for GSI3, then auth and api stacks). The signed-in fixes are deployed but not yet re-verified with a signed-in call.

Deployed to dev 2026-10-13:

  • DynamoDB Key carried GSI1 attributes → 500. Reads now narrow keys.relationship() / keys.customerProfile() / keys.partnerProfile() with primaryKey(). Affected web plant detail and workspace (legacy plants), customer get/PATCH/:close, partner get/PATCH, and web plant create with a customer or installer.
  • GSI3 missing — deployed (T002-134); customer list default path, partner lists filtered by relationship/status, single-status member lists and the web plant created-order/lifecycle path are expected to work.
  • Realtime 500 when tickets are disabled — now 503 DEPENDENCY_UNAVAILABLE (captured on dev, see Realtime).
  • GET /v1/me/context levels for personal orgs — now the full role levels.
  • Member ETag — GET /v1/orgs/{orgId}/members/{sub} sends ETag: "<version>".
  • Router 404 tracing — X-Request-Id, X-Correlation-Id, Cache-Control: no-store, requestId in the body.
  • Saved views and plant share links — deployed.

Still open:

  • Realtime flag — dev has realtimeTicketsEnabled off, so no tickets are issued until a human deploys with -c realtimeTicketsEnabled=true -c realtimeWsUrl=<wss://…>. Both are now saved in cdk.json context.stages.dev (2026-11-03, realtimeWsUrl = wss://d2heoz2zkqbsg1.cloudfront.net/ws), so the next plain npm run deploy:dev turns tickets on. Synth refuses a missing or loopback realtimeWsUrl once tickets are on.

By design (docs corrected):

  • Mobile POST /v1/plants still creates legacy plant items, so a mobile-created plant is missing from the web plant list until it is migrated or gets its first web PATCH — see Plants.
  • GET /v1/me/context requires an org selector (X-Org-Id or ?orgId=); there is no fallback to defaultOrgId — see Me.

KI-30​

Plant delete skips devices it cannot release

:::info Retired 2026-10-26 — ADR 0012 phase 3 The 005 device-release hook is gone. Plant delete (route, deletion sweep, erasure) now deletes every serial binding of the plant and its SERIALBIND# guard via unbindAllBindingsForPlant; no device is skipped, no device.upserted.v1 is published, and the :bind / :unbind device routes no longer exist (the only unbind route is DELETE /v1/plants/{plantId}/devices/{serial}). :::

Residual: when the owner delete's second release fails (log plant_after_deleting_hook_failed, metric PlantDeviceReleaseFailed), the device links are kept so the release can be re-run, but there is no operator re-run command or alarm yet — re-running unbindAllForPlant(plantId) needs a code-level invocation. See Operations → Troubleshooting.

KI-31​

:::info Resolved by removal — ADR 0012 phase 2 The routes this entry describes are no longer registered; devices and commands are served by the TCP server over the WebSocket. Kept for history only (ADR 0012 phase 5 complete). :::

Device-model "in use" lock is set only by imports (yet)

PATCH /v1/device-models/{modelId} refuses a type change with 409 INVALID_STATE (MODEL_IN_USE) once the model is in use. Today only POST /v1/manufacturing-records:import sets that flag; registering or claiming a device against the model does not, so such a model can still have its type changed. See Device catalog.

KI-32​

:::info Resolved by removal — ADR 0012 phase 2 The routes this entry describes are no longer registered; devices and commands are served by the TCP server over the WebSocket. Kept for history only (ADR 0012 phase 5 complete). :::

A deleted device answers 410 regardless of caller access

GET /v1/devices/{deviceId} (D05) checks the device tombstone before the access check, so a removed device returns 410 GONE (details.lifecycle: "REMOVED") to any signed-in caller, including one who never had access. This reveals only that the ID once existed (a minor existence leak) and is kept as the contract. FE: handle 410 as "device removed" and leave the page. See Device inventory.

KI-33​

:::info Resolved by removal — ADR 0012 phase 2 The routes this entry describes are no longer registered; devices and commands are served by the TCP server over the WebSocket. Kept for history only (ADR 0012 phase 5 complete). :::

Since issue #26, device transfers are immediate on the TCP server: there is no pending transfer state and the HTTP side no longer has a TRANSFER_PENDING binding state. The text below about pending transfers describes the retired two-step flow. See Device transfers.

Phase 3 removed the sweeper itself and DeviceRemovalStuck. Original entry: the device-registry-sweeper (transfer expiry, stale import-job expiry, DeviceRemovalStuck) was deployed in IntegrationStack, which exists only with -c busEnabled=true. Until the bus is enabled, a pending transfer past expiresAt stays PENDING in lists and keeps the device TRANSFER_PENDING; it is expired the first time someone accepts, declines or cancels it. Stuck removals are not counted either. FE: treat expiresAt in the past as expired in the UI. See Operations.

KI-34​

:::info Resolved by removal — ADR 0012 phase 2 The routes this entry describes are no longer registered; devices and commands are served by the TCP server over the WebSocket. Kept for history only (ADR 0012 phase 5 complete). :::

Feature 007 device operations were removed (ADR 0012). They were never deployed. The routes, the api-devices-ops stack, the command sweep, the bulk-task driver, the firmware and engineering-files buckets, the COMMANDS_DISPATCH_ENABLED / FIRMWARE_TASKS_ENABLED flags and the command.* events no longer exist in code. Commands, bulk tasks, firmware and device files belong to the TCP server; see Commands (stub).

KI-35​

POST /v1/orgs/{orgId}/invitations/{inviteId}:resend dispatch changed (batch 51 router fix). The old router split the action off the first path variable (orgId), so :resend most likely answered 404 instead of reaching the handler. The fixed router splits the variable that carries the verb, so the call now reaches ResendInvitation. Not verified against a deployed stage; FE code that treated the 404 as permanent should retry.

KI-36​

Pre-2026 legacy device claims can be bound to two plants (ADR 0012). Legacy claim items (PLANT#<p>/DEVICE#<rawSerial>) were written before the SERIALBIND# uniqueness guard existed. On the same plant, a legacy item and a normalised claim of the same serial are treated as one binding. Across plants they are not guarded: the same device can appear on two plants until the owner runs the one-off guard backfill (npm run backfill:binding-guards, see Operations), which writes the missing guards and reports conflicts for manual resolution. New claims are always guarded.

Audit wave 1 known issues (2026-10-27)​

  • Realtime op binding is HTTP-side only until cse-tcp-be checks plant.operatorOrgId === op.
  • Email OTP lockout can be imposed by others: anyone who knows an address can cause a ~1-minute refusal, and up to 15 minutes if they keep guessing.
  • Mailbox = account on mobile (A10): email OTP never adds TOTP. After an admin reset-mfa, an attacker can re-enrol TOTP.
  • Throttles/Errors alarms are account-wide and also fire on cse-tcp-be functions.
  • The execute-api endpoint is reachable directly, bypassing CloudFront's HTTP-to-HTTPS redirect.
  • No reconcile sweep for report schedules. Retryable sync errors are rethrown and retried, but nothing re-checks drift afterwards.
  • Device-count projection costs about 4 WCU per access-index item per binding change (transactional guard). This is negligible at current volumes.

Feature 008 — notifications (planned)​

Applies to the Notifications API, which is routed (the web team observed the routes answering on dev on 2026-10-28); the NotifyStack (queued recompute, digests) exists only with -c busEnabled=true.

  • Audience recompute (Q36, 2026-10-27): changes affecting more than 25 users are queued to notify-recompute (USERS requests, ≤ 1000 users each) when busEnabled is on; otherwise, or after an enqueue failure (WARN notify_recompute_enqueue_failed), they are recomputed synchronously, chunked, in the request. The ≤ 2-minute revocation bound is a target, not a measured value.
  • User deletion has a notify hook but no caller: no user-deletion path (route, script or Cognito delete) exists yet. The hook planUserDeletionNotify(sub) in packages/core/src/notify/access-change.ts is ready: it returns the notify.user.deleted.v1 tombstone plus a NONE audience tombstone for every operator that held the user, to put in the deletion's own transaction. Until a deletion path calls it, a deleted user's audiences and endpoints are only cleared by removing their memberships first.
  • Channel availability from SSM flags (Q37): PUSH follows /cse-tcp-be/<stage>/notify/push-enabled, EMAIL /cse-http-be/<stage>/notify/email-enabled. Unset ⇒ UNAVAILABLE.
  • Org directory needs a backfill (Q38): the GSI2 ORGS#<kind> directory is written on org create and rename (never for personal orgs) since 2026-10-27. Orgs created earlier are missing from it until the owner runs npm run backfill:org-directory (see Operations). Until then the ORG_SETTINGS_ALL republish and the reconcile ORGS pass skip those orgs (WARN notify_org_directory_empty when a walk finds none).
  • Email consumer is off by default: SES is in sandbox, so notify.email.requested.v1 is not sent as email.
  • Edit capability: the FE shows rule edit controls only when viewer.capabilities contains notificationRules.edit (alerts ≥ MANAGE).
  • B-02 / TCP-REQ-17 pending: push sending and the delivery log depend on TCP work that is not done.
  • Huawei devices without Google services get no push (FCM only).
  • 008 routes are routed: A09, G01, G02 and G05 live in cse-http-be-<stage>-api-notify, G03 in ApiStack via POST /v1/{collection} (observed answering on dev, 2026-10-28).
  • Recompute is synchronous without the queue (Q36): in a stage without busEnabled (no NotifyStack), audiences beyond the first 25 users are recomputed synchronously after commit, in chunks of 25. Rule writes in very large orgs can then be slow (Lambda timeout 25 s); if the timeout is exceeded the rule is saved but some audiences may stay stale until the next weekly reconcile.
  • Reconcile-stale alarm has blind spots: NotifyReconcileStale checks one 7-day period (Sum of ReconcileCompleted < 1) with missing data not breaching. It is quiet after the first deploy and cannot detect a reconcile function that never runs at all.
  • tcp-events consumer cannot create digest schedules yet: the IntegrationStack tcp-events consumer can create digest schedules, but it has no scheduler:CreateSchedule / iam:PassRole grant and no DIGEST_* environment variables. That path is reached only when NOTIFY_EMAIL_REQUESTS_ENABLED=true (off by default). Add the grants and variables before turning that flag on.
  • Digest DLQ has no alarm: only the notify-recompute queue age feeds BacklogAge; no DLQ has an alarm (see below).

No DLQ alarm — check by hand​

  • Owner decision 2026-10-27 dropped the DlqDepth alarm to stay within the CloudWatch free tier (10 alarm metrics). The DLQs still exist, but a message landing in any of them alerts nobody. Check them by hand with the DLQ runbook.

Feature 009 — reports (routed; generation gated)​

  • Report/schedule routes are routed (observed answering on dev, 2026-10-28). Generating requires ReportsStack (-c busEnabled=true) and reportsGenerateEnabled=true (-c or cdk.json stages.<stage>; dev sets it since 2026-11-04; else 422 REPORTS_GENERATE_DISABLED); without ReportsStack, generating routes (H02, H03a, H06, H05b, :resume, :run-now) answer 503 DEPENDENCY_UNAVAILABLE before any write.
  • The S3 expiry write-back needs reportDispatchQueueArn on the data stack; omitting it on a later data deploy silently drops the notification. Dev keeps it in cdk.json stages.dev (2026-11-04), so this only affects a stage without it.
  • ReportsOverdue counts sweeps from logs; a sweeper that never runs emits no datapoints, so the alarm stays quiet.
  • With busEnabled the account has 8 alarms = 10 standard alarm metrics (exactly the free tier; DlqDepth and the notify-recompute input of BacklogAge were dropped by owner decision 2026-10-27, so neither the DLQs nor the notify-recompute queue age are alarmed — check them by hand) No DependencyUnavailable alarm (dropped by owner decision 2026-11-10, Q12): an AWS dependency outage shows up in the DependencyUnavailable metric and the DEPENDENCY_UNAVAILABLE 503 log lines, but notifies nobody. Source: CloudWatch pricing page, read 2026-10-27.
  • Per-customer fan-out re-resolves the scope in every batch (25 customers each); a plant that changes customer between batches of one run can leave a customer out of that run's reports.
  • Email delivery of reports blocked by B-02.
  • Portal q search covers only the newest 200 viewer rows.
  • Download ignores PREVIEW when deciding whether file is required.
  • Per-customer schedules accept every scope kind; plants with no customer are left out and counted as lastRun.unassignedPlantCount, except with scope ALL, where they are not counted (gap; Q40).
  • Schedule create/resume/run-now are refused (503) without Scheduler config; schedules stored earlier stay unarmed until it is deployed.
  • UPLOAD_URL_EXPIRED treated as UPLOAD_FAILED, no re-dispatch.
  • Q39 (resolved 2026-11-02): no default retention floor; old data renders as partial.
  • Rendering depends on the TCP renderer (see TCP dependencies).

KI-37​

Email delivery is blocked by the SES sandbox. Password-reset email via SES and report emails cannot reach arbitrary users until the owner completes DKIM verification and SES sandbox exit. Until then SES delivers only to verified recipients. See KI-6 and KI-17. (Invitations are not emailed — KI-28.)

KI-38​

Intermittent 503 DEPENDENCY_UNAVAILABLE. packages/api/src/http/respond.ts returns this (with Retry-After: 1) when an AWS SDK call is classified as throttled or unavailable, emits the dimensionless DependencyUnavailable metric and logs dependency_unavailable with the dependency field. See Operations → Troubleshooting for the query that finds which dependency.

KI-39​

Legacy plants are only partly visible on the web. GET /v1/me/favorites returns favourited legacy plants without entity (B-1). They have no org id and no search tokens, so search suggestions and the web plant list skip them until the owner runs npm run migrate:legacy-plants (see Operations).

Status: run on dev on 2026-10-29 with --apply: 16 users, 17 legacy plants, 17 migrated, 0 skipped, 0 failed; owners without a personal org got one. Dry run again on 2026-11-19: 30 users, 0 legacy plants. The script only finds plants owned by a current user, so a legacy plant with no owner record, or whose owner account was deleted, would not be counted; whether any exist on dev has not been checked.

Search tokens still missing on dev (B-3). Neither the migration script nor the If-Match: "0" web PATCH writes SRCH# tokens inline. Plant search tokens and plant facet counters are written only by the stream-router (planRecord with the plants extractor), which is not running while the bus is off. Migrated plants therefore still do not appear in q search or search suggestions until the bus is turned on. See KI-43. The bus is now on for dev (checked 2026-11-19), but the stream starts at LATEST, so a plant migrated while it was off gets its tokens only from its next write. Whether the migrated dev plants now have tokens has not been checked.

New app plants are no longer legacy (committed 2026-11-03, not yet deployed). The mobile app's POST /v1/plants now writes the same schema v2 item the migration script produces (see Plants), so the stream-router indexes it like a web plant. Until that change is deployed, plants created in the app are still legacy: run the script once more after the deploy (it is idempotent) to pick up the ones created in between.

Side effect, until the fix below is deployed: the deployed mobile PUT and DELETE routes accept only legacy items, so the app gets 409 INVALID_STATE ("managed by an organisation") when it edits or deletes a migrated plant. The app still lists and opens these plants. The fix (committed 2026-10-29, not yet deployed) lets the app edit and delete a migrated plant that still belongs only to its owner's personal org, and stops a web edit of such a plant from hiding it from the owner's app list. Do not run the migration on staging or prod before that fix is deployed there.

KI-40​

Fixed in code, not deployed; not verified on dev (issue #14, 2026-11-13, code reading).

The problem: POST /v1/orgs/{orgId}/brand-assets presigned a PUT straight to brand/<org>/<asset>. If the client never called :confirm, the PENDING record expired after 2 days, but the uploaded object was not deleted, because the org-branding family had no S3 delete grant.

The fix (packages/core/src/orgs/brand-assets.ts, lib/route-family.ts):

  • The presigned PUT now goes to pending/brand/<org>/<asset>. The bucket's existing expire-pending-uploads lifecycle rule (prefix pending/, 1 day) deletes an upload that is never confirmed.
  • :confirm checks the upload, copies it to brand/<org>/<asset>, sets the asset READY, then deletes the upload. It now returns {asset, download} with a presigned GET of the final key.
  • The family gained s3:PutObject / s3:GetObject / s3:DeleteObject on pending/brand/* only.
  • Assets created before the fix have no upload key; their confirm still checks brand/<org>/<asset> directly. Objects already orphaned under brand/ are not removed by the rule.

To close it on dev: deploy, create an asset, upload, and confirm it; check that the object is at brand/<org>/<asset> and gone from pending/. Leave a second upload unconfirmed and check it is gone after a day. See Web console additions.

KI-41​

Superseded (2026-11-25). On 2026-10-29 the TCP Server had no renderer. It has since built one: the TCP reports integration page records a customer monthly summary reaching READY on dev on 2026-11-05. This entry stays open only until the HTTP side re-verifies a manual and a scheduled run end to end on dev, and until the TCP renderer accepts manifest v5 for platform-wide reports.

The renderer contract is ready for the TCP team: a handout describing the S3 layout, IAM grant, render-manifest v3 and status events has been prepared, and the contract itself is in specs/009-analytics-reports/contracts/integration-events.md (cse-http-be repo). See Reports pipeline → Render manifest v5.

KI-42​

Plant deletion: both halves are in code, not verified on dev (updated 2026-11-13, code reading). The contract is in the blueprint (docs/blueprint/05-integration.md §7.2, TCP-REQ-12): TCP erases the plant's device data and replies plant.erasure.completed.v1 { plantId }.

  • TCP side (cse-tcp-backend, committed 2026-11-04): plant.deletion.requested.v1 queues a plant_erasures job, and the plant eraser (server/internal/httpbus/eraser.go, run by persistence-worker) erases the data and publishes plant.erasure.completed.v1 on TCP's SNS topic. It only reports when the worker has TCP_EVENTS_TOPIC_ARN set. Without it, the worker still erases but sends nothing back.
  • HTTP side: from-tcp subscribes to plant.erasure.completed.v1 (lib/integration-stack.ts), and onPlantErasureCompleted (packages/core/src/plants/lifecycle.ts) deletes the remaining items, writes a tombstone and removes the pending marker. The hourly sweep raises PlantDeletionOverdue for anything DELETING longer than 24 h.

To close it on dev: delete a web plant (C11), check the TCP worker logs for the erasure, and check that the plant leaves DELETING (GET stays 410, and the tombstone is written) with no PlantDeletionOverdue after 24 h. App deletes of a migrated plant finish here; a later plant.erasure.completed.v1 for them is a logged no-op.

KI-43​

:::note Status on dev The bus is on for dev: on 2026-11-19 the stream-router's event-source mapping (cse-http-be-dev-integration-StreamRouterFn…) was Enabled, and npm run resync:plants -- --bump-version --apply was run afterwards. The table below describes what happens on any stage deployed without busEnabled=true, and why writes made on dev while it was off still have stale projections until their next write. :::

Stream-maintained projections do not update while the bus is off. busEnabled defaults to false on every stage, and with it false the cse-http-be-<stage>-integration stack is not created at all. Even inside that stack the stream-router's DynamoEventSource is created with enabled: busEnabled (lib/integration-stack.ts). So no DynamoDB stream record is processed. The request itself always succeeds (the source item is written); only the derived items below never change. Each was checked against its plan function in packages/api/src/handlers/stream-router.ts:

Pass (plan function)What it maintainsVisible effect on dev today
planAccessRevocationFan-out when a role's level is loweredMembers keep their old access-index copies after a role downgrade
planScopeWideningFan-out when a role scope goes SCOPED → ALLMembers do not gain copies of the newly in-scope plants
planAccessIndexActionsPer-user plant copies for PLANTS-scope memberships and user sharesNew grants do not appear in "my plants" lists
planShareIndexActionsPlant ↔ share reverse links and the grantee's per-user copyShare lists by plant and the grantee's list lag
planPlantCopyRefreshRefresh of access-index copies from plant META (beyond the ≤ 25 rows a web PATCH refreshes inline)Renames/edits of plants with many viewers are stale in their lists
planCustomerRetokeniseRe-tokenising plants when a customer is renamedPlant search by the new customer name misses
planTagRelabel / planTagDetachTag rename copied into plant tagLabels; a DELETING tag detached from plants/customers and then deletedRenamed tags show the old label on plants; deleted tags stay DELETING and attached
planDeviceCountDeltadeviceCount on every access-index copy of a plantDevice counts in plant lists do not move after a bind/unbind
planRecord (registered collections: plants, customers, partners, tags, members, shares, access requests, reports, work orders)Facet and sum counters (COUNT#…), search tokens (SRCH#…) and outbox publishing to SNSNew or renamed plants, customers, partners, members, work orders and reports are missing from q search and suggestions; facet counts, tag groupCounts, the pending access-request badge and customer counters are stale; outbox rows are never published, so the TCP Server receives no plant.upserted.v1, notify.*.v1 or other event
planAssignmentChangesWork-order assignment facts and per-customer open counterTechnician assignment listeners and COUNT#WOCUST#OPEN#<c> do not move
planReportChildCleanupDeleting a removed report's download/event childrenChildren stay until their own TTL
planReportScheduleSyncEventBridge Scheduler schedules for report schedulesReport schedules are stored but never armed
planInboxNotificationsThe HTTP in-app inboxOnly ACCESS_REQUEST_DECIDED, SHARE_GRANTED and REPORT_READY are missing. Since 2026-11-05 (ADR 0019) the work-order and service-request items are also written on the request path, so they arrive without the stream-router. ADR 0023 (built, not deployed) retires the service-request items and adds nine work-order kinds, also written on the request path

Work orders are moving off this list (ADR 0023 D10; built 2026-11-10, not deployed). Once deployed, the work-order counters (COUNT#WO#…, COUNT#WOHIST#<day>, COUNT#WOCUST#OPEN#<c>, the new COUNT#WOSTATUS#<status>, and the Crown-wide ORG#ALL counters) and the work-order search tokens (SRCH#<o>#workOrders#…) are written right after each order write, on the request path, by the same projector code (packages/core/src/service/wo-projection-bridge.ts, one dedup id per order version, best-effort). The stream-router's copy then becomes a no-op. The work-order assignment facts (planAssignmentChanges) still need the stream-router. Whether the existing counters and tokens on dev are stale has not been checked against the table (that read needs the owner's approval). The lifecycle v2 backfill with --counters rebuilds them for existing orders.

Why it was off. It was gated by blocker B-01 (Lambda concurrency quota 10). B-01 closed on 2026-10-26 (quota now 1000, shared with the TCP Server), so that reason is gone. Turning the bus on is an owner deploy decision (-c busEnabled=true). After the first such deploy on a stage, run npm run resync:plants so the TCP Server learns plants written more than 7 days earlier, npm run republish:orgs so it learns every existing org's name, and the customer counter backfill so counters include older records. The mapping starts at LATEST, so writes made while the bus was off are never replayed: their projections are rebuilt only by those scripts (plant events, customer counters) or by the next write to the same item (search tokens, copies, other counters).

KI-45​

The binding follows TCP only where TCP's publisher is on. Resolved on dev; open on staging and prod. ADR 0018 makes TCP the source of truth for which plant a device is on. This server applies TCP's device.binding.changed.v1 (Integration bus).

  • Dev (2026-11-04): both servers are deployed, and TCP's cse-tcp-be-dev-events topic delivers to cse-http-be-dev-from-tcp. The first sync completed at 08:06Z: 6 SYNC events were applied, and 2 were stale (already applied as live changes). The queue and DLQ were 0. The console can call TCP only on dev.
  • Staging and prod: out of scope — dev is the only stage (Hard Rule 4, owner 2026-11-05). The console keeps calling both servers for bind and unbind (Plant devices).
  • First sync: when it's turned on, TCP sends one SYNC event per device at 10/s (about 28 h for 1M devices). Live changes go first. Bindings that drifted during the two-call period are corrected as their device's event arrives.
  • Reused logger ids: a binding found only under a device's previous serial is left alone when it belongs to another TCP device, so a reused logger id can't delete someone else's binding. That other device's own event corrects it.

KI-44​

The platform-wide plant list (SVC-2) has three gaps. ADR 0016 lets the built-in Super Admin and Administrator in the Crown HQ platform org call GET /v1/plants (and /geo) without operatorOrgId and get every org's plants, personal orgs included (committed 2026-11-03, not deployed). Still open:

  • Summary counts stay per org. GET /v1/plants/summary reads facet counters kept per operator org and written by the stream-router. From HQ it still returns 400 VALIDATION_FAILED (details.field: operatorOrgId) without operatorOrgId, for every role. A platform-wide summary is a separate change.
  • No installer filter across orgs. Installer links are keyed by operator org, so installerOrgId without operatorOrgId is 400 VALIDATION_FAILED (details.field: installerOrgId).
  • Backfill needed after deploy. The list reads one PLANT#<p>/LISTALL entry per plant. New plants get it in their own transactions; plants created before the deploy appear only after a human runs npm run rebuild:projections -- --all-orgs --execute (Operations).
  • q in the all-org list reads the platform-wide search tokens, which only the stream-router writes (KI-43).

KI-46​

Invitation onboarding (ADR 0021): two points still open. The code was committed on 2026-11-06. None of the new routes has been called against dev yet, so every example on Invitations is illustrative.

  • Resolved on dev, 2026-11-06: the RBAC roles backfill moved all 11 personal-org owners from Administrator to End User, and raised the HQ Installer role to the IO-9 defaults. A final dry run found nothing left to do.
  • Personal orgs created before the deploy start with an Administrator owner, because the code before ADR 0021 creates them that way. Re-run the backfill after npm run deploy:dev; it is safe to re-run.
  • GET /v1/me/invitations misses older invitations. It reads a per-email inbox written since this change. A pending invitation created earlier is listed once its inviter resends it. Its token link still works.
  • No invitation email (KI-28). Since 2026-11-17 invitations are in-app only.

KI-47​

Role edits that don't rename the role failed on DynamoDB (fixed 2026-11-06, live after the next deploy). patchRole always sent the #name attribute name, even when the name wasn't changing. DynamoDB rejects an unused attribute name (ValidationException), so on dev every role edit that only changed permissions, summary, note, colour, scope rule or audit trail failed with a 500, from the console as well as the backfill. Unit tests fake DynamoDB, so they never caught it; a regression test now checks for unused names. Fix: commit 349e2e2.

KI-48​

Update 2026-11-25 (TCP side, read-only checks). The TCP FCM sender is running on dev (push switch on, FCM secret set) and honours link, tag and platforms, so WP-1 and the field support below are done. Still open: (1) the sender uses Firebase project cse-datalogger, while WP-1 below names crown-solar-energy-dev, and web tokens must come from the sender's project; (2) WEB_CONSOLE_ORIGIN is unset on dev, so the click-through link is a bare path, which FCM documents as needing to be an HTTPS URL; (3) iOS pushes fail with "Invalid APNs credential" (Firebase console). The original entry follows.

Web push: the HTTP half is committed, nothing is sent yet. This server now leaves staff users' web tokens out of the TCP projection (End Users only), pushes work-order and report-ready inbox items, and charges the registration quota only for new tokens (Web push). It is committed, not deployed, and none of it has been exercised on dev. Still open, all on the TCP Server's side:

  • WP-1: deploy its FCM sender, store the service-account credentials for crown-solar-energy-dev in its secret store, and set its push kill switch to true.
  • WP-2: send each web token one message with a notification block and webpush.fcm_options.link.
  • Honour the new fields on notify.push.requested.v1: link, tag and platforms. Until platforms is honoured, those pushes would also reach the mobile app.
  • WP-4: document the alert push content.
  • WP-5: publish notify.endpoint.invalid.v1 for dead tokens. This server's consumer is already built.
  • WP-6: write its own inbox entry before each alert push.

This server's bus must also be deployed on dev, or the TCP Server never receives the tokens (KI-43).

KI-49​

Crown HQ dashboard: fleet view committed, not deployed. For a Super Admin or Administrator in Crown HQ, GET /v1/dashboard returned 0 plants, 0 kWp and 0 regions, because it read the HQ org's own counters and no plant belongs to HQ (bug report B-2, 2026-11-05). ADR 0024 adds a fleet-wide partition, FLEET#ALL, kept by the plants stream projector and the plant write transactions, and the dashboard reads it for those two roles (fleet view). Still open:

  • Deploy, then run the fleet backfill once. Until then, plants written before the deploy are not counted.
  • The counters need the stream-router (KI-43).
  • Plants of a suspended org stay in the totals (owner decision 2026-11-11).
  • GET /v1/plants/summary from HQ still needs operatorOrgId (KI-44).

KI-50​

Role boundaries: deployed to dev, backfills run. The console request "Business, Installer and End User access" (2026-11-11) is on dev since 2026-11-12 (Role boundaries). Run on dev on 2026-11-12 (human-run, dry run first each time):

  • RBAC roles backfill: raised 2 Installer roles to reports: MANAGE; no Administrator left to move in customer or personal orgs.
  • Customer list backfill: 19 personal-org entries; platform counters active=19 personal=19 (dev has no Business customer orgs). A first run had a bug that skipped personal orgs (they are kind: CUSTOMER); fixed in 95a20f1 before the real run.
  • Crown staff masking backfill with --by-membership: 19 access-log entries and 2 work-order events marked; nothing else matched.
  • rebuild:projections -- --all-orgs --execute: 19 personal orgs, 15 plants, 61 search tokens, fleet totals written, 0 failures. A first run found personal orgs through Cognito users only and skipped one no user points to (a second "Crown Admin" personal org with 1 plant); the script now reads every personal org from the ORGCODE# guards (332584b) and the re-run counted all 15.
  • Resolved 2026-11-12 (deployed to dev): an Installer's customer list has no plant cap; the Crown-wide customer list has tiles (zero until the every-org customer-list backfill runs); a Business no longer grants End User or lists the Business role.
  • Alert actions are TCP-owned: HTTP now issues the pm / vp ticket claims the TCP Server uses to hide Crown staff there; the TCP side is committed in cse_tcp_be (437fbcd, 2026-11-12), deployment not verified here.
  • 2026-11-12 (committed, not deployed): Installer-type roles are stored with scope NONE on invite, invite edit, member role / scope change and bulk assign. Still open (decision C-2): existing Installers stored with another scope keep it — and §6 still keys on the stored scope — until their role or scope is next changed.
  • 2026-11-12 (console authorization audit; committed, not deployed): Installers stored with NONE still see work orders, maintenance history and reports on their assigned plants; WO-4 now also covers WO- lookups and an alert's linked work orders; scoped members are narrowed on access requests, CU-/PB- lookups and partner businesses; Crown staff masking fails closed. Still open: notification rules (/notification-rules) are org-wide for any member with alerts ≥ VIEW (what an Installer may see of a rule is not decided), and an audit reported roster / maintenance-plan reads as org-wide for service ≥ VIEW (not re-checked).

KI-51​

Profile picture: metadata kept, own picture only. The Profile picture API (committed 2026-11-11, not deployed) stores the uploaded bytes unchanged after checking type, size and magic bytes. Still open:

  • EXIF is not stripped server-side. Doing it would need an image library in the Lambda. The client must re-encode (crop/resize) before upload, which drops EXIF; the app teams' checklist says so.
  • Only the owner can read the picture. No route returns another user's picture (team members, work-order assignees, POST /v1/users/lookup). Showing it there needs an access rule for who may see whose picture.
  • Account deletion has no HTTP route today, so nothing removes avatars/<sub>/* when a user is deleted.

KI-52​

Sign-in records: committed, not deployed; three gaps remain. The session fixes of 2026-11-12 (one record per sign-in, EXPIRED after the refresh-token lifetime, :end-others, refusal on every route, ipAddress, expiresAt) are in code on main, not on dev. Still open:

  • No IP-location provider. location is resolved from the console-forwarded IP through a pluggable resolver with a per-IP cache, but no provider is wired (which service may receive users' IP addresses is the owner's decision). Until then location is absent on every row; the console shows "Location unavailable".
  • Cognito cannot revoke one sign-in's refresh token server-side. RevokeToken needs the token itself and AdminUserGlobalSignOut ends every sign-in. After {sessionId}:end or :end-others the ended device can still refresh until its refresh token expires (1 day, or 90 days for "Remember me"); every token it gets is refused 401 SESSION_REVOKED by this API, and the web console revokes its own refresh token on that answer.
  • TCP WebSocket: closed at once since 2026-11-30 (QA B5), with one exception. Tickets now carry the sign-in's origin_jti as oj. Ending a sign-in (current:end, {sessionId}:end, :end-others, and the other sign-ins on password:report-change) publishes access.revoked.v1 {scope: USER, reason: SESSIONS_ENDED, originJtis}, and ws-gateway closes those sockets at once. This needs the integration bus (busEnabled). The exception: a socket whose ticket was issued before this change, so has no oj, is closed too, but that ticket can reconnect until it expires, at most about 11 minutes as before. The TCP side's own gap (unticketed legacy mobile messages while WS_AUTH_MODE=optional) is documented by cse-tcp-be.
  • Rows written before the deploy that were never tied to a token are hidden, not deleted; they expire by TTL.

KI-53​

Push for End Users only, and the push toggle: the HTTP half is written, nothing is deployed. ADR 0025 (2026-11-13) adds pushEligible to notify.user.v1, sends no endpoints for staff on any platform, republishes notify.user.v1 on every membership change and on every notifications preferences save, and makes pushEnabled: false block CRITICAL pushes too (details). Not committed and not deployed; nothing has been exercised on dev. Still open:

  • TCP Server: treat pushEligible: false as "no push at all" for that person, including the tokens the app registered over the ws-gateway WebSocket and notify.push.requested.v1. Treat a missing pushEligible, or a user that was never projected, as eligible. Stop the CRITICAL override from pushing past pushEnabled: false. Accept the new NOT_ELIGIBLE reason in the conformance vectors.
  • After the HTTP deploy: staff whose tokens live only on the TCP side have no notify.user.v1 until the next reconciliation run completes (it projects every member of a Platform, Business or Installer org). Until then the TCP Server treats them as eligible.
  • Mobile app: the toggle is PATCH /v1/me/preferences {"notifications":{"channels":{"push":false}}} (Account settings). No new route.

RBAC v2 (ADR 0026): deployed to dev 2026-11-13; follow-ups (carried-in shares, customer backfill, a new Business after close, work orders cancelled on detach, blocked badge, legacy plants moved) built 2026-11-14, not deployed yet. Business suspend/restore/close/reopen with End Users unaffected, self-serve Business onboarding, join codes and join requests, the connected End User remote-control switch, plant moves on join/detach, Business plant-delete rules and user block (A/B) — see RBAC v2, including its known gaps. Needs a human deploy, the backfills (backfill:rbac-roles --only installer, backfill:rbac-v2, backfill:rbac-v2 --only customers) and republish:orgs; the TCP half in cse_tcp_be is deployed to dev.

KI-54​

Plant hasBattery is derived from the plant's devices (2026-11-18): written, not committed, not deployed. Battery details moved from plants to devices on the TCP server (batteries). This server no longer stores any battery field on a plant; hasBattery in every plant response is true only when a device bound to the plant has a battery, which this server learns from the new hasBattery field on device.binding.changed.v1 (integration bus). Still open:

  • TCP Server (implemented 2026-11-18, not deployed): hasBattery is on every device.binding.changed.v1 (false on ERASE), with a new event (higher seq, reason: SYNC) when a device's battery count goes 0 ↔ non-zero. TCP's migration 0138 sends hasBattery: true on its deploy for the devices of plants that had exactly one in-service device. Deploy this server first, so those events are not lost.
  • Other plants: report hasBattery: false, gridTopology without _BACKUP, and the battery-temperature alert defaults to off, until a battery is added to one of their devices on the TCP server.
  • Stored data: old plant items keep the retired attributes until npm run migrate:strip-plant-battery -- --stage dev --apply runs (Operations). Nothing reads them.
  • Mobile app: older builds that still send wizard step 4 keep working (the fields are ignored). Remove step 4 and add batteries per device on the TCP server.

KI-55​

Plant ownership, share and unshare (2026-11-20, ADR 0029): committed, not deployed. Plant create takes no battery data (old fields ignored), every new plant stores its owner, share sets the owner to the end user (Crown staff may pick a Business for an independent end user), and POST /v1/orgs/{orgId}/plant-unshares (removed 2026-11-27, ADR 0035) made the caller the owner (Plants). Not exercised against dev. Still open:

  • Backfill: older plants have no stored owner until npm run migrate:plant-owners -- --stage dev --apply runs (Operations); until then their events keep the old derived owner.
  • Owner questions: unsharing a plant that sits in an end user's own account (PLANT_IN_PERSONAL_ORG) or that the End User brought into the Business (PLANT_BROUGHT_IN) is refused rather than moving the plant.
  • No owner left: when a staff owner leaves a Business that has no other Business-role member, the plant keeps the leaving user as owner.

KI-56​

Role defaults and permission rules RBAC-S1 … S13 — CLOSED (2026-11-27). Built, deployed to dev, and every backfill below has run. The rules themselves are in the Role permissions matrix.

  • TCP-owned parts (cse_tcp_be): done. RBAC-S3 on the TCP side is on dev: migration 0156 is applied, and the backfill for older rows was committed on dev_telemetry_db on 2026-11-27. A caller outside the Crown org gets "Crown Support" instead of a Crown staff sub in the operation log, its CSV export, the userSub filter, device events, Activity Trail detail, and command and bulk-task replies and pushes (Operation log, Commands, Activity Trail detail). RBAC-S8 is closed by owner decision (register writes need no second-person approval). RBAC-S12's device-transfer check is gone, because device transfer has been removed.
  • Old Crown actors on the HTTP side: done. backfill:via-platform -- --by-membership --apply has been run on dev (2026-11-27), so records written before 2026-11-12 by Crown members show "Crown Support" to callers outside the Crown org. A dry run with --include-former-crown (which also counts the Crown org's 1 REMOVED member) found nothing left to mark (Operations).
  • Not open items, standing behaviour (owner decisions): Installer roles created before the change keep their reports level until each Business lowers it (note ² in the matrix), and connected End Users have the reduced levels in note ¹ of the matrix, including that their earlier shares on Business plants are not revoked.

KI-57​

Member, share and access-request counters were never maintained (fixed on dev 2026-11-25; access-request rebuild added 2026-11-26)

@cse/core's barrel loaded the members, shares and accessRequests collection registrations with export {} from '…'. esbuild (the Lambda bundler, and vitest) drops that line as an empty re-export, so the deployed stream-router never registered those three collections. Confirmed by bundling stream-router.ts: 7 registerCollection calls before the fix, 10 after. As a result, on every deployed stack:

  • COUNT#members#… never moved: members list statusCounts.ACTIVE/SUSPENDED, members/summary tiles, roles[].memberCount and departments' memberCount read 0 (console review 2026-11-25: "0 People", "3 of 0 shown" in the Crown org);
  • no member search tokens were written, so GET …/members?q= found nobody;
  • COUNT#shares#… (share level bands) and COUNT#accessRequests#status#PENDING (/v1/me/context badges.pendingAccessRequests) never moved either.

Not a DLQ or a missed-write problem: the stream delivered the records and the router planned nothing for them. Dev also had no stream mapping before 2026-11-03 (busEnabled), with StartingPosition.LATEST.

Fix: plain side-effect imports in packages/core/src/index.ts, guarded by test/collection-registrations.test.ts. Same change: a REMOVED membership leaves every member counter (it used to stay in its role's and department's count).

Done on dev (2026-11-25): npm run deploy:dev, then rebuild:projections --all-orgs (dry run) and --all-orgs --execute: 40 orgs' COUNT#members#… counters and 443 tokens written, shares (none on dev) recomputed, 0 failures. The same run also rebuilt the Crown FLEET#ALL totals and deleted 7 stale items there.

Access-request counters (2026-11-26): rebuild:projections --all-orgs now also recounts each org's COUNT#accessRequests#status#… counters from its ACCESSREQ# partition (access requests have no GSI2 list key; see Operations). Dev dry run (2026-11-26): 41 orgs walked, 0 access-request counters to write, 0 failures. Dev holds no access requests, so the pending access-request badge was not wrong there and nothing needs writing. The rebuild counts the stored status, like the stream, so a PENDING request past its expiresAt still counts in the badge.