CLAUDE.md@deno/core/context · git:20260527.c1e80b1 · 2026-05-27 · sha256 0000e3ecf3de884a

CLAUDE.md@deno/core/context git:20260527.c1e80b1A

Immutable. This exact content is served forever at /api/v1/blob/0000e3ecf3de884a.

# core/context — directory guide

The engine lives here. Three context classes, one per pipeline phase:

- **`ParseContext`** — OpenAPI/GraphQL JSON → OAS / GQL objects.
- **`GenerateContext`** — OAS / GQL → in-memory `File` map. Owns the
  per-generator dispatch loop. The variant fan-out happens in
  `#runOasOperationGenerator` / `#runGqlOperationGenerator` /
  `#runModelGenerator`; the helper `toVariantList`
  (`@/helpers/toVariantList.ts`) enumerates variant keys and
  enforces the `'main'`-must-be-present rule.
- **`RenderContext`** — `File` map → `{ path: content }` artifacts.
  No formatter runs here (skill §1 fact #2).

**Variant axis touchpoints in this directory:**

- `GenerateContext.#runOasOperationGenerator` / `#runGqlOperationGenerator`
  / `#runModelGenerator` — per-item dispatch reducers that fan out
  over variants.
- `GenerateContext.toOperationContentSettings` /
  `toModelContentSettings` — thread `variant` into the Projection's
  static methods and into `new ContentSettings`.
- `GenerateContext.insertOperation` / `insertModel` — `variant`
  defaults to `'main'` when callers omit it.
- `toOasOperationSource` / `toGqlOperationSource` / `toModelSource`
  — Source descriptors in the manifest carry the variant.
- `matchesPathFilter` / `matchesRefFilter` — sibling helpers that
  match operation- and model-shaped skip/include entries against the
  per-variant tuple.

**Tests pinning variant invariants:**

- `GenerateContext.variants.test.ts` — operation-level engine fan-out,
  missing-`main` throw, per-variant skip/include matching, single-
  `'main'` fallback, StackTrail nesting.
- `GenerateContext.model-variants.test.ts` — sibling coverage for the
  model arm: refName-level fan-out, missing-`main` throw, per-variant
  skip/include matching.
- `GenerateContext.cross-variant.test.ts` — peer Definition is shared
  across variants; imports register to each variant's file.
- `GenerateContext.end-to-end.test.ts` — real Projection → real
  Driver → `GeneratorKey` carries variant end to end.
- `GenerateContext.normalized-model-variants.test.ts` — variant-bound
  `fallbackName` produces distinct model Definitions.
- `GenerateContext.include.test.ts` — operation- and model-level
  include/skip behaviour (model entries now use the record-of-variant-
  arrays shape).
- `dsl/model/ModelDriver.variants.test.ts` — Driver-level peer-variant
  guard and the `generatorKey` collision check for variants-aware
  model Projections.

The skill that authors this code: `docs/skills/skmtc-generator/SKILL.md`.
Concept doc for the variant axis: `docs/concepts/variants.md`.

---

<claude-mem-context>
# Recent Activity

<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->

### May 11, 2026

| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #20531 | 8:04 PM | 🟣 | Include settings test suite created for allow-list generator filtering | ~531 |
| #20245 | 10:40 AM | 🔄 | Made GqlParseContext.log() exhaustively checked via switch | ~294 |
| #20240 | 10:38 AM | 🔄 | Unified parse issue storage across OAS and GraphQL contexts | ~303 |

### May 12, 2026

| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #21012 | 7:08 PM | 🟣 | Created comprehensive how-generators-emit.md concept document | ~598 |
| #20971 | 2:58 PM | 🔵 | StackTrail location format discrepancy and cumulative fix status update | ~746 |
| #20928 | 2:20 PM | 🔵 | Critical enrichment routing path discrepancy discovered in documentation | ~940 |
| #20658 | 8:54 AM | 🔵 | SKMTC error isolation pattern - tryParseAt for partial parse failures | ~788 |
| #20651 | 8:45 AM | 🔵 | RenderContext implementation - final phase of SKMTC pipeline | ~790 |
| #20650 | " | 🔵 | SKMTC GenerateContext orchestration and skip/include filtering | ~785 |
| #20644 | 8:34 AM | 🔵 | SKMTC architecture - three-phase pipeline and CLI commands | ~812 |
</claude-mem-context>