seam red on main: the two service-access test fakes lose contextual typing through as unknown as, six TS7006 errors in the dashboard build #1795

Closed
opened 2026-09-23 18:34:54 +00:00 by matou-build-agent · 2 comments

main is red on the seam's TypeScript: build (tsc), test (vitest), lint (eslint) stage: pnpm --filter @idss/dashboard run build (vue-tsc -p tsconfig.json) exits 2 with six TS7006 errors. Every push to main fails CI until this lands.

tests/unit/provisionWhoCanReach.test.ts(28,29): error TS7006: Parameter 'service' implicitly has an 'any' type.
tests/unit/provisionWhoCanReach.test.ts(28,38): error TS7006: Parameter 'credentials' implicitly has an 'any' type.
tests/unit/serviceAccessSurface.test.ts(51,25): error TS7006: Parameter 'service' implicitly has an 'any' type.
tests/unit/serviceAccessSurface.test.ts(55,28): error TS7006: Parameter 'service' implicitly has an 'any' type.
tests/unit/serviceAccessSurface.test.ts(59,29): error TS7006: Parameter 'service' implicitly has an 'any' type.
tests/unit/serviceAccessSurface.test.ts(59,38): error TS7006: Parameter 'creds' implicitly has an 'any' type.

Root cause

Both fakes build a plain object literal and close with } as unknown as IdipCredentialsClient & { … }. Going through unknown erases the contextual type, so the shorthand methods (async serviceAccess(service), async openServiceToAll(service), async restrictServiceTo(service, creds), async restrictServiceTo(service, credentials)) infer nothing for their parameters, and strict: true in tsconfig.base.json makes that an error. The sibling entries written as arrow properties (list: async () => []) take no parameters, which is why only these four methods are red.

Why it surfaced only now

The errors shipped with ba97b116 (#1782, the two service-access doors) and were masked, not absent. scripts/seam-smoke.sh runs the ADR 0037 stage "OpenAPI: generated client in sync with the spec" (line 159) before the TypeScript stage (line 182), and #871 re-armed errexit, so the seam aborted at the ADR 0037 gate — which ba97b116 had also broken by hand-editing the generated client. c1ae3b24 (#1794) repaired the ADR 0037 gate; the TypeScript stage finally ran and the pre-existing type debt came out. Nothing regressed in #1794 — it only removed the mask.

Acceptance criteria

  • pnpm --filter @idss/dashboard run build exits 0 at main's tip.
  • The parameters are typed from IdipCredentialsClient rather than silenced (no any annotations, no @ts-expect-error, no loosened strict). Preferred shape: keep the as unknown as … return but annotate each parameter (service: string, creds: string[]), or drop the double assertion so the literal takes its contextual type.
  • Both suites still pass under pnpm -r run test, and their assertions are unchanged — this is a typing repair, not a behaviour change.

Evidence

Reproduced read-only in the swarm workdir at c1ae3b24: dashboard/node_modules/.bin/vue-tsc -p tsconfig.json → the six errors above, exit 2. Failing CI run: https://git.matou.nz/Matou/idss/actions/runs/31162 (signature eeb55dc3cbe7). Filed by the swarm healer, heal run heal-Matou-idss-1790188317-2466878.

`main` is red on the seam's **TypeScript: build (tsc), test (vitest), lint (eslint)** stage: `pnpm --filter @idss/dashboard run build` (`vue-tsc -p tsconfig.json`) exits 2 with six `TS7006` errors. Every push to main fails CI until this lands. ``` tests/unit/provisionWhoCanReach.test.ts(28,29): error TS7006: Parameter 'service' implicitly has an 'any' type. tests/unit/provisionWhoCanReach.test.ts(28,38): error TS7006: Parameter 'credentials' implicitly has an 'any' type. tests/unit/serviceAccessSurface.test.ts(51,25): error TS7006: Parameter 'service' implicitly has an 'any' type. tests/unit/serviceAccessSurface.test.ts(55,28): error TS7006: Parameter 'service' implicitly has an 'any' type. tests/unit/serviceAccessSurface.test.ts(59,29): error TS7006: Parameter 'service' implicitly has an 'any' type. tests/unit/serviceAccessSurface.test.ts(59,38): error TS7006: Parameter 'creds' implicitly has an 'any' type. ``` ## Root cause Both fakes build a plain object literal and close with `} as unknown as IdipCredentialsClient & { … }`. Going through `unknown` erases the contextual type, so the shorthand methods (`async serviceAccess(service)`, `async openServiceToAll(service)`, `async restrictServiceTo(service, creds)`, `async restrictServiceTo(service, credentials)`) infer nothing for their parameters, and `strict: true` in `tsconfig.base.json` makes that an error. The sibling entries written as arrow properties (`list: async () => []`) take no parameters, which is why only these four methods are red. ## Why it surfaced only now The errors shipped with **ba97b116** (#1782, the two service-access doors) and were **masked, not absent**. `scripts/seam-smoke.sh` runs the ADR 0037 stage *"OpenAPI: generated client in sync with the spec"* (line 159) **before** the TypeScript stage (line 182), and #871 re-armed errexit, so the seam aborted at the ADR 0037 gate — which ba97b116 had also broken by hand-editing the generated client. **c1ae3b24** (#1794) repaired the ADR 0037 gate; the TypeScript stage finally ran and the pre-existing type debt came out. Nothing regressed in #1794 — it only removed the mask. ## Acceptance criteria - `pnpm --filter @idss/dashboard run build` exits 0 at main's tip. - The parameters are typed from `IdipCredentialsClient` rather than silenced (no `any` annotations, no `@ts-expect-error`, no loosened `strict`). Preferred shape: keep the `as unknown as …` return but annotate each parameter (`service: string`, `creds: string[]`), or drop the double assertion so the literal takes its contextual type. - Both suites still pass under `pnpm -r run test`, and their assertions are unchanged — this is a typing repair, not a behaviour change. ## Evidence Reproduced read-only in the swarm workdir at c1ae3b24: `dashboard/node_modules/.bin/vue-tsc -p tsconfig.json` → the six errors above, exit 2. Failing CI run: https://git.matou.nz/Matou/idss/actions/runs/31162 (signature `eeb55dc3cbe7`). Filed by the swarm healer, heal run `heal-Matou-idss-1790188317-2466878`.
Author
Member

swarm-claim host=bens-mac-04 run=30973
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=30973 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1795 — status success

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

envelope
{
  "issue": 1795,
  "status": "success",
  "commits": [
    "e075a73b"
  ],
  "changed_files": [
    "dashboard/tests/unit/provisionWhoCanReach.test.ts",
    "dashboard/tests/unit/serviceAccessSurface.test.ts"
  ],
  "tests": [
    {
      "command": "CI=true pnpm --filter @idss/dashboard run build",
      "exit_code": 0
    },
    {
      "command": "vitest run tests/unit/provisionWhoCanReach.test.ts tests/unit/serviceAccessSurface.test.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "pnpm --filter @idss/dashboard run build exits 0 at main's tip": "CI=true pnpm --filter @idss/dashboard run build → exit 0, vue-tsc -p tsconfig.json → exit 0 after commit e075a73b",
    "Parameters typed from IdipCredentialsClient rather than silenced (no any, no @ts-expect-error, no loosened strict)": "commit e075a73b annotates each shorthand param from the interface signature (service: string, credentials/creds: string[]); the `as unknown as` return is kept, strict untouched",
    "Both suites still pass under pnpm -r run test with assertions unchanged": "vitest run of both suites → 10 tests passed; only parameter type annotations added, no assertion or fixture-body change"
  },
  "summary": "Annotated the two service-access fakes' shorthand-method params from IdipCredentialsClient, clearing the six TS7006 errors that reded main's dashboard build.",
  "blockers": []
}
**close-report** for #1795 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1795, "status": "success", "commits": [ "e075a73b" ], "changed_files": [ "dashboard/tests/unit/provisionWhoCanReach.test.ts", "dashboard/tests/unit/serviceAccessSurface.test.ts" ], "tests": [ { "command": "CI=true pnpm --filter @idss/dashboard run build", "exit_code": 0 }, { "command": "vitest run tests/unit/provisionWhoCanReach.test.ts tests/unit/serviceAccessSurface.test.ts", "exit_code": 0 } ], "criteria": { "pnpm --filter @idss/dashboard run build exits 0 at main's tip": "CI=true pnpm --filter @idss/dashboard run build → exit 0, vue-tsc -p tsconfig.json → exit 0 after commit e075a73b", "Parameters typed from IdipCredentialsClient rather than silenced (no any, no @ts-expect-error, no loosened strict)": "commit e075a73b annotates each shorthand param from the interface signature (service: string, credentials/creds: string[]); the `as unknown as` return is kept, strict untouched", "Both suites still pass under pnpm -r run test with assertions unchanged": "vitest run of both suites → 10 tests passed; only parameter type annotations added, no assertion or fixture-body change" }, "summary": "Annotated the two service-access fakes' shorthand-method params from IdipCredentialsClient, clearing the six TS7006 errors that reded main's dashboard build.", "blockers": [] } ``` </details>
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#1795
No description provided.