# Platform abstraction adoption

## Why use CCE

Platform engineering teams ship internal SDKs to abstract cloud APIs, but adoption is uneven. Direct `boto3` or AWS SDK v2 calls bypass golden paths, breaking centralized policy, telemetry, and cost attribution.

CCE measures **direct cloud SDK usage** vs **platform wrapper** call sites per repo for adoption scorecards.

## What CCE extracts

| JSON field | Meaning for this use case |
|------------|---------------------------|
| `provider` | `DIRECT_CLOUD` or `PLATFORM` |
| `resource` | SDK segment or platform module |
| `operation` | Method name |
| `file` / `line` | Migrate to platform SDK |

## CLI wiring

**Customize the lens** — replace `github.com/acme/platform-sdk/` (and equivalents) with your org's platform package prefixes in [`platform-adoption.yaml`](platform-adoption_lenses.yaml).

```bash
cce -folder . \
    -language GO \
    -mapper-file https://releases.stackgen.com/cce/lenses/platform-adoption/latest/platform-adoption_lenses.yaml \
    -filter cloud \
    -format json \
    -output platform-gap.json
```

## How to read the JSON output

- **`summary.by_provider.DIRECT_CLOUD`** vs **`PLATFORM`** → golden-path adoption ratio.
- Filter `entitlements[]` where `provider == "DIRECT_CLOUD"` for migration backlog.
- Track ratio over time in CI to enforce platform standards on new code.

## CI/CD snippet

```yaml
- name: Platform adoption score
  run: |
    cce -folder . -language AUTO \
        -mapper-file https://releases.stackgen.com/cce/lenses/platform-adoption/latest/platform-adoption_lenses.yaml \
        -filter cloud -format json -output platform-gap.json
    # optional: fail if DIRECT_CLOUD / total exceeds threshold
```




## Published lens

Latest mapper YAML is published on every push to `main` (public, no auth):

- **Latest:** [https://releases.stackgen.com/cce/lenses/platform-adoption/latest/platform-adoption_lenses.yaml](https://releases.stackgen.com/cce/lenses/platform-adoption/latest/platform-adoption_lenses.yaml)
- **Catalog:** [https://releases.stackgen.com/cce/lenses/index.json](https://releases.stackgen.com/cce/lenses/index.json)

```bash
curl -fsSL "https://releases.stackgen.com/cce/lenses/platform-adoption/latest/platform-adoption_lenses.yaml" -o platform-adoption_lenses.yaml
cce -folder . -mapper-file https://releases.stackgen.com/cce/lenses/platform-adoption/latest/platform-adoption_lenses.yaml -language AUTO -filter all -format json -output report.json
```

## Known limitations

**Proof status:** Lens-only — see [`KNOWN_LIMITATIONS.md`](../../../reference/known-limitations.md#per-use-case-limitations-and-proof-status) (platform-adoption) and [`docs/proof`](../../proof/README.md).

| Limitation | Impact |
|------------|--------|
| Org prefixes | You must configure platform package prefixes in YAML. |
| Unmatched SDK calls | Without lens rules, built-in cloud mapping still applies. |

**Platform limits** (CGO, languages, static analysis, mapper precedence, filters): [`KNOWN_LIMITATIONS.md`](../../../reference/known-limitations.md#platform-wide-limitations-every-use-case).

## Related

- Enterprise catalog workflow: [Enterprise lenses guide](https://appcd-dev.github.io/cce/guides/enterprise-lenses-and-catalogs/)
- Lens YAML: [`platform-adoption.yaml`](platform-adoption_lenses.yaml)
- Pipeline overview: [`modernization_use_cases.md`](../../catalog.md)
