# STL Library Review

## What was reviewed

The `/Users/bryan/Desktop/Codex/STLs` folder was reviewed as a mixed archive of removable-design files and unrelated guide/implant files.

This write-up is intentionally de-identified. It focuses on reusable naming and package patterns rather than patient folder names.

## High-level counts

- Total STL files reviewed: `411`
- Removable-like STL files: `206`
- Guide-like STL files: `84`
- Distinct removable case groups: `69`
- Folders containing removable cases: `62`

## Important finding

This is not a pure removable dataset.

The library contains:

- removable print outputs
- monoblock variants
- implant or guide workflows
- analog/model files
- aligners and other unrelated outputs

That means the website should not learn from the folder blindly. It needs a removable-only curation layer first.

## Learned removable package patterns

The most common removable case signatures found in the archive were:

- `0P, 1M, 1P`
- `1M, 1P`
- `0M, 0P, 1P, 2P`
- `0M, 0P, 1P, 2P, 3P`
- `0P, 1P, 2M, 2P, 3M, 3P`
- `0M, 0P, 1M, 1P, 2M, 2P, 3M, 3P`

Legend:

- `P` = non-monoblock print STL
- `M` = monoblock STL

This supports the product decision to model exports as a package, not a single STL.

## Confirmed anchor case

One case is already confirmed by the user and should be treated as the strongest role anchor:

- `2026-8936-2-12-26_0_Print.stl` -> teeth only
- `2026-8936-2-12-26_1_Print.stl` -> teeth only
- `2026-8936-2-12-26_2_Print.stl` -> base only maxillary
- `2026-8936-2-12-26_2_Monoblock_Print.stl` -> base + teeth maxillary
- `2026-8936-2-12-26_3_Print.stl` -> base only mandibular
- `2026-8936-2-12-26_3_Monoblock_Print.stl` -> base + teeth mandibular

This confirms that file index alone is not enough without context. The same index number may represent different roles in other cases.

## Index frequency

- Index `0`: `46`
- Index `1`: `68`
- Index `2`: `36`
- Index `3`: `34`
- Index `4`: `8`
- Index `5`: `5`
- Index `6`: `3`

## Monoblock frequency

- Monoblock files: `80`
- Non-monoblock removable files: `126`

## Product implications

- The app should support one-arch and two-arch output bundles within the same case.
- Output role assignment should be treated as a confidence-weighted inference, not a hardcoded index map.
- The removable training/reference set should exclude guide-like files before any automated learning step.
- The case workspace should eventually show grouped outputs by inferred arch and role.
- The manifest schema should preserve both the raw filename and the inferred role.

## Recommended next engineering step

Build a curation layer that:

1. labels a case group as removable or non-removable
2. groups files into a case package
3. assigns tentative roles like `teeth_only`, `base_only`, or `monoblock`
4. records confidence and waits for clinician correction when uncertain

The new `backend/library_summary.py` file captures the first pass of these findings for the app and future API use.
