# CODEBASE AUDIT RC89

## Scope
Root-cause fix for Calendar navigation/render failure.

## Root cause
The Calendar button itself was calling the correct function: `showCalendar()`.

The failure was inside `assets/js/renderers/calendar-renderer.js`:

```js
const { calendarExpandedKey } = ctx;
...
calendarExpandedKey = '';
```

Because `calendarExpandedKey` is destructured as a `const`, assigning to it throws:

```text
Assignment to constant variable
```

So `showCalendar()` was reached, but `renderCalendar()` died before the calendar screen could complete rendering.

## Fix
RC89 does not mutate the context value. It computes a local safe key instead:

```js
const activeExpandedKey = entryKeys.includes(calendarExpandedKey) ? calendarExpandedKey : '';
```

## Counts / checks
| Metric | Count / Status |
|---|---:|
| Base | RC88 |
| `calendarExpandedKey = ''` left in renderer | False |
| `activeExpandedKey` present | True |
| Calendar button direct `showCalendar()` | True |
| Calendar renderer test OK | True |
| `app.js` lines | 3501 |
| `calendar-renderer.js` lines | 89 |

## Test output
```text
calendar-renderer empty expanded key test: OK
```

## Deferred
Exercise player/video remains untouched.
