# Deployment Artifact Generation Plan

Date: 2026-03-29

## Goal

Move the deployment analysis set from markdown-only conclusions toward reproducible JSON artifacts with explicit provenance.

## Generator

Primary entrypoint:

```bash
python3 construction/generate-deployment-derived-artifacts.py
```

## Generation Order

1. Load `app-delivery` ApplicationSets from every `app-registry/` directory.
2. Load current top-level ownership from `knowledge/deployment/app-delivery-object-mapping.json`.
3. Add stable IDs and evidence references to the mapping inventory.
4. Load `knowledge/deployment/deployment-manifest-graph.json` and normalize edge-level evidence fields.
5. Regenerate the compact top-level `deployment-environment-graph.json` from `ApplicationSet` files only.
6. Regenerate the curated high-level `deployment-graph.json` from code-managed anchors plus current ownership mappings.
7. Project all ApplicationSet placements into `deployment-object-environment-matrix.json`.
8. Group nested `app-registry/` trees into `deployment-bundle-decomposition.json`.
9. Run consistency checks and write `deployment-validation-report.json`.

## Inputs That Must Stay Read-Only

- `app-delivery`
- `knowledge/repos/*`
- `knowledge/meta/repos-*.json`
- `.local/review-history/repos-filtered.txt`

## Outputs That Are Safe To Rewrite

- `knowledge/deployment/app-delivery-object-mapping.json`
- `knowledge/deployment/deployment-manifest-graph.json`
- `knowledge/deployment/deployment-environment-graph.json`
- `knowledge/deployment/deployment-graph.json`
- `knowledge/deployment/deployment-object-environment-matrix.json`
- `knowledge/deployment/deployment-bundle-decomposition.json`
- `knowledge/deployment/deployment-validation-report.json`

## Current Scope Boundaries

- The generator trusts the existing ownership conclusions in `app-delivery-object-mapping.json`.
- It does not infer new source repos from scratch.
- It only parses `ApplicationSet` files that use `list` generators.
- It treats `argocd-target-clusters-config` as a known top-level exclusion because it behaves like registry/control-plane configuration rather than an application workload object.

## Expected Follow-Up

1. Regenerate after any `app-delivery` registry change.
2. Regenerate after ownership updates in `app-delivery-object-mapping.json`.
3. Extend the generator when new `ApplicationSet` generator types appear.
4. Later replace the remaining hand-curated high-level topology constants with deeper KB-derived generation rules when enough source evidence exists.
