## What's happening

The core API client is generated by `ogen` from the upstream OpenAPI spec. Every generated decoder is **strict**: when it hits a field it doesn't recognize, it hard-errors instead of skipping it. From `internal/coreapi/oas_json_gen.go`:

```
1
2

default:
    return errors.Errorf("unexpected field %q", k)
```

This is the line that kills the CLI when the server adds a field.

## How widespread it is

I counted across the generated client:

- **54 / 54** schema decoders use the strict `unexpected field` path
- **0** use the tolerant `d.Skip()` path
- This is driven by the spec: `core.gen.json` has **54** occurrences of `"additionalProperties": false`

So _any_ new field on _any_ of these 54 models will break decoding. ogen only generates the strict branch because the upstream spec declares `additionalProperties: false` on every schema; without that, ogen generates `d.Skip()` and tolerates unknown fields automatically.

## Has anyone addressed it?

No. `internal/coreapi/UPSTREAM.md` is the running checklist of spec workarounds, and this isn't on it. The only normalize transform (`spec/normalize.go` → `foldErrorResponses`) folds error responses; it does nothing about `additionalProperties`. Recent coreapi commits (`ENTIRE_TOKEN` override, spec refreshes, mirror rewires) don't touch this either.

## Two ways to fix it

1. **Upstream (clean, correct):** stop emitting `additionalProperties: false` in the control-plane spec, then regenerate. Every decoder flips to `d.Skip()` and the client becomes forward-compatible for free. Worth adding as item #2 in `UPSTREAM.md`.

2. **Local workaround (immediate, fully in this repo):** add a transform in `spec/normalize.go` that strips `additionalProperties: false` from all schemas before ogen runs — directly analogous to the existing `foldErrorResponses` fold. Regenerating then produces tolerant decoders without waiting on the server team. This is the fastest path to "new server fields don't kill the CLI."

## Why this matters for the unknown-fields bug

This is exactly where the fix belongs. The `"additionalProperties": false` entries that make the decoders strict come from **upstream** (`core.openapi.json`) and pass straight through `normalize.go` untouched — `normalize.go` currently only does the `foldErrorResponses` transform.

So the local fix (my earlier "option 2") is: add a transform in `normalize.go` that strips `additionalProperties: false` from all schemas as it writes `core.gen.json`. Because `core.gen.json` is regenerated, not edited, you can't just edit the open file by hand — it'd be overwritten on the next `go generate`. The change has to go in `normalize.go`, then regenerate.

Both `core.openapi.json` and `core.gen.json` are committed (last refreshed Jun 5, commit `93735addc`), which is why the stale strict decoders are sitting in the tree right now.

## Result: the bug is fixed at the source

The upstream control-plane team had **already flipped all 54 schemas** from `"additionalProperties": false` → `true` in their OpenAPI spec. The refresh pulled that in and regenerated the client:

|  | Before refresh | After refresh |
| --- | --- | --- |
| Schemas with `additionalProperties: false` | 54 | 0 |
| Decoders that hard-error on unknown fields (`unexpected field %q`) | 54 | **0** |
| Behavior on a new server field | **CLI dies** | Captured into an `AdditionalProps` map (preserved, not dropped) |

So a new field on any core API model no longer breaks the CLI — ogen now generates a `default:` branch that reads the unknown field into a raw map instead of returning an error.

## Files changed

```
 M internal/coreapi/spec/core.openapi.json   ← upstream refetch (54 × false→true)
 M internal/coreapi/spec/core.gen.json        ← regenerated by normalize.go
 M internal/coreapi/oas_json_gen.go           ← decoders now tolerant
 M internal/coreapi/oas_schemas_gen.go        ← structs gained AdditionalProps
```

The original bug — a new server field killing the CLI — is resolved: the upstream fix flowed through, and the regenerated client now tolerates (and preserves) unknown response fields. Ready to push/PR whenever you want.
