discussion framework migration

This commit is contained in:
2026-03-27 04:38:15 +00:00
parent abdb28aa68
commit e582527937
31 changed files with 17 additions and 17 deletions
@@ -0,0 +1,44 @@
---
id: LSN-0009
ticket: packer-docs-import
title: Packer mental model legacy lesson
created: 2026-03-26
tags:
- packer
- legacy-import
- mental-model
---
## Context
Legacy import from `docs/packer/learn/mental-model-packer.md`.
This lesson preserves the high-level didactic framing of what the packer is and is not.
## Key Decisions
### The packer turns asset workspaces into stable asset artifacts
**What:** The packer is neither cartridge shipper, runtime reader, nor generic file janitor. It is the system that turns a managed asset workspace into stable runtime-facing and tool-facing artifacts.
**Why:** Contributors drift quickly when they treat packer behavior as a mix of authoring convenience, runtime semantics, and shipping responsibilities rather than one explicit artifact-producing domain.
**Trade-offs:** This framing forces sharper boundaries between packer, runtime, shipper, and Studio, but it keeps contracts and responsibilities legible.
## Patterns and Algorithms
- Treat the managed asset root as the unit of management.
- Split source-of-truth responsibilities between registry state and per-asset declaration.
- Keep `asset_id` and `asset_name` as separate concepts.
- Treat `assets.pa` as the authoritative runtime-facing artifact.
- Prefer determinism, explicit declaration, and canonical serialization.
## Pitfalls
- Treating the packer like a generic filesystem janitor.
- Collapsing `asset_id` and `asset_name` into one concept.
- Forgetting that determinism is part of the artifact contract chain.
## Takeaways
- The packer owns artifact production, not runtime reading or shipping.
- Stable asset identity and deterministic output are central to the whole domain.
- Legacy source attribution: `docs/packer/learn/mental-model-packer.md`.
@@ -0,0 +1,43 @@
---
id: LSN-0010
ticket: packer-docs-import
title: Asset identity and runtime contract legacy lesson
created: 2026-03-26
tags:
- packer
- legacy-import
- asset-identity
- runtime-contract
---
## Context
Legacy import from `docs/packer/learn/mental-model-asset-identity-and-runtime-contract.md`.
This lesson preserves the distinction between stable artifact identity and logical naming.
## Key Decisions
### `asset_id` and `asset_name` are intentionally different
**What:** `asset_id` is the stable artifact identity used for runtime-facing stability and preload integrity, while `asset_name` remains a logical, human-facing, code-facing reference.
**Why:** Using only `asset_name` makes rename behave like identity breakage, while using only `asset_id` everywhere today makes source-level ergonomics worse. The architecture intentionally keeps both.
**Trade-offs:** Carrying both values increases conceptual surface area, but it avoids forcing authoring ergonomics and stable runtime identity into one compromised field.
## Patterns and Algorithms
- Use `asset_id` when the question is stable artifact identity.
- Use `asset_name` when the question is authoring/reference ergonomics.
- Keep both values visible in runtime-facing asset tables.
## Pitfalls
- Treating rename as identity change.
- Treating name-only references as stable preload/bootstrap identity.
- Forcing code-facing APIs into raw integer identity too early.
## Takeaways
- Stable identity and logical naming solve different problems.
- Runtime artifact correctness should prefer `asset_id`; human-facing and source-facing flows may still use `asset_name`.
- Legacy source attribution: `docs/packer/learn/mental-model-asset-identity-and-runtime-contract.md`.
@@ -0,0 +1,46 @@
---
id: LSN-0011
ticket: packer-docs-import
title: Foundations workspace runtime and build legacy lesson
created: 2026-03-26
tags:
- packer
- legacy-import
- foundations
- deterministic-build
---
## Context
Legacy import from `docs/packer/learn/foundations-workspace-runtime-and-build.md`.
This lesson preserves the stable foundation for workspace control, runtime snapshots, writes, and deterministic build output.
## Key Decisions
### The stable foundation is filesystem-first authoring plus coherent snapshot-backed runtime and deterministic build
**What:** The packer keeps the workspace open and filesystem-first, anchors managed identity in registry and asset declarations, serves reads through coherent runtime snapshots, coordinates writes through packer-owned lanes, and emits deterministic build outputs from validated state.
**Why:** The original implementation wave spread this knowledge across many PR slices, which stopped being a good onboarding surface. The stable model needed one didactic consolidation.
**Trade-offs:** This architecture demands stronger ownership of snapshots, write coordination, and deterministic ordering, but it prevents UI heuristics, traversal order, or cache state from silently becoming semantic authority.
## Patterns and Algorithms
- Keep `asset_id` stable and separate from `asset_name`.
- Treat `asset.json` as authoring intent rather than registry bookkeeping.
- Read from coherent runtime snapshots.
- Serialize commit-bearing writes through one project-scoped semantic lane.
- Order build outputs deterministically by managed identity.
## Pitfalls
- Treating `asset_name` as stable runtime identity.
- Moving registry-owned fields into `asset.json`.
- Depending on traversal order or UI order for build layout.
- Treating cache state as semantic authority.
## Takeaways
- The packer foundation is as much about ownership and determinism as it is about file formats.
- Filesystem durability, snapshot coherence, and deterministic emission must stay aligned.
- Legacy source attribution: `docs/packer/learn/foundations-workspace-runtime-and-build.md`.
@@ -0,0 +1,45 @@
---
id: LSN-0012
ticket: packer-docs-import
title: Runtime ownership and Studio boundary legacy lesson
created: 2026-03-26
tags:
- packer
- legacy-import
- runtime-boundary
- studio-boundary
---
## Context
Legacy import from `docs/packer/learn/runtime-ownership-and-studio-boundary.md`.
This lesson preserves the ownership boundary between packer operational semantics and Studio presentation.
## Key Decisions
### Packer owns operational asset semantics; Studio consumes translated responses and events
**What:** The stable boundary is filesystem-first authoring, project-scoped runtime snapshots for coherent reads, one serialized semantic write lane per project, authoritative packer events with causality, and Studio adapters that translate but do not invent semantics.
**Why:** Without this boundary, the system drifts into split-brain behavior where Studio and packer both try to own summaries, mutation meaning, or reconcile logic.
**Trade-offs:** Strong semantic ownership in packer makes Studio adapters less flexible, but it keeps lifecycle, concurrency, and event meaning testable and consistent.
## Patterns and Algorithms
- Keep divergence explicit packer state rather than silent repair.
- Allow coherent `read/read`, serialize `write/write`, and avoid torn `read/write` views.
- Preserve operation causality with stable ids and monotonic sequence.
- Let Studio remap data for presentation without recomputing semantics.
## Pitfalls
- Rebuilding packer summaries from Studio-side heuristics.
- Treating adapters as a second semantic authority.
- Hiding divergence by silent refresh.
- Allowing same-project writes to race.
## Takeaways
- Studio should present packer semantics, not recreate them.
- Event causality and write-lane ownership are part of the domain contract.
- Legacy source attribution: `docs/packer/learn/runtime-ownership-and-studio-boundary.md`.
@@ -0,0 +1,44 @@
---
id: LSN-0013
ticket: packer-docs-import
title: Metadata convergence and runtime sink legacy lesson
created: 2026-03-26
tags:
- packer
- legacy-import
- metadata
- runtime-sink
---
## Context
Legacy import from `docs/packer/learn/mental-model-metadata-convergence-and-runtime-sink.md`.
This lesson preserves the rule that runtime-consumable metadata converges into one effective sink.
## Key Decisions
### Runtime-consumable metadata converges to `AssetEntry.metadata`
**What:** Authoring contracts may segment metadata by concern, but all runtime-consumable metadata must normalize deterministically into `AssetEntry.metadata`. Payload slicing fields such as `AssetEntry.offset` and `AssetEntry.size` keep their own semantics and do not replace internal indexing values.
**Why:** Without an explicit convergence rule, runtime readers, normalization behavior, and metadata collision handling all become accidental and non-deterministic.
**Trade-offs:** Deterministic convergence requires explicit normalization rules and collision handling, but it gives runtime consumers one clear reading surface.
## Patterns and Algorithms
- Segment metadata in source declarations when useful for authoring ergonomics.
- Normalize all runtime-consumable metadata into one root map in emitted asset entries.
- Fail or use explicit rules on collisions rather than silently overwriting.
- Keep payload slicing and internal indexing semantics distinct.
## Pitfalls
- Treating segmented declaration metadata as multiple runtime sinks.
- Allowing silent key overwrite.
- Mixing asset-table slicing semantics with internal indexing offsets.
## Takeaways
- Runtime consumers should read runtime metadata from `AssetEntry.metadata`.
- Convergence behavior must live in specs and tests, not only in code comments.
- Legacy source attribution: `docs/packer/learn/mental-model-metadata-convergence-and-runtime-sink.md`.
@@ -0,0 +1,47 @@
---
id: LSN-0014
ticket: packer-docs-import
title: Pack wizard summary validation and pack execution legacy lesson
created: 2026-03-26
tags:
- packer
- legacy-import
- pack-wizard
- validation
- execution
---
## Context
Legacy import from `docs/packer/learn/pack-wizard-summary-validation-and-pack-execution.md`.
This lesson preserves the packer-owned semantics behind the Studio-side pack wizard.
## Key Decisions
### Summary, validation, and pack execution are distinct packer-owned phases
**What:** `summary` is a fast snapshot-backed preflight view, `validation` is a blocking-diagnostics gate over the same active pack set, and `packWorkspace(...)` is the only artifact-emitting operation, rerunning the gate on a fresh frozen snapshot and promoting staged outputs only after coherent success.
**Why:** Studio-side shelling only works if packer provides one coherent operational story instead of a mix of stale UI assumptions and live filesystem rereads.
**Trade-offs:** This model is stricter and less forgiving than trusting previous UI state, but it prevents stale or torn assumptions from leaking into final build output.
## Patterns and Algorithms
- Define the active pack set as `registered + included in build`.
- Keep summary fast and snapshot-backed.
- Let only blocking diagnostics fail first-wave validation.
- Re-run the gate on a fresh execution snapshot before emission.
- Stage outputs before promoting them to final `build/`.
## Pitfalls
- Treating summary as emitted-artifact preview.
- Validating a broader set than the active pack set.
- Letting warnings fail the first-wave gate.
- Reading live filesystem bytes after frozen execution starts.
## Takeaways
- Green validation from a few seconds earlier is not enough; pack execution must revalidate on a fresh frozen snapshot.
- Packer-owned result semantics should be enough for Studio to render packing and result phases.
- Legacy source attribution: `docs/packer/learn/pack-wizard-summary-validation-and-pack-execution.md`.
@@ -0,0 +1,46 @@
---
id: LSN-0015
ticket: packer-docs-import
title: Tile bank packing contract legacy lesson
created: 2026-03-26
tags:
- packer
- legacy-import
- tile-bank
- packing-contract
---
## Context
Legacy import from `docs/packer/learn/tile-bank-packing-contract.md`.
This lesson preserves the first-wave producer contract for tile-bank assets.
## Key Decisions
### Tile bank packing emits one canonical payload per asset with explicit normalization and early structural validation
**What:** The first-wave contract emits one canonical `TILES/indexed_v1` payload per asset, normalizes artifacts by explicit `artifacts[*].index`, packs one fixed `256 x 256` row-major sheet with packed `u4` pixels and `RGB565` palette blocks, treats palette identity as semantic rather than positional, and surfaces structural blockers early in walker/materialization.
**Why:** The repository needed one explicit producer contract for tile banks rather than a mix of implicit artifact ordering, late byte-emission surprises, and unstable palette identity.
**Trade-offs:** This contract is more explicit and restrictive than ad hoc per-artifact packing, but it yields stable reviewability, predictable runtime metadata, and earlier validation.
## Patterns and Algorithms
- Treat `1 artifact = 1 tile`.
- Normalize artifact identity by ascending declared `index`.
- Emit one canonical bank raster rather than concatenated artifact-local binaries.
- Keep palette identity explicit with `{ index, palette }`.
- Produce structural diagnostics before late pack-only phases.
## Pitfalls
- Treating artifact declaration order as semantic tile identity.
- Embedding per-tile palette choice in packed payload.
- Flattening all metadata into one ambiguous map.
- Discovering tile-bank blockers only during final byte emission.
## Takeaways
- The tile-bank producer contract depends on canonical normalization and early structural validation.
- Palette identity should be semantic and explicit, not positional by list order.
- Legacy source attribution: `docs/packer/learn/tile-bank-packing-contract.md`.
@@ -0,0 +1,50 @@
---
id: LSN-0017
ticket: packer-docs-import
title: Packer docs import pattern
created: 2026-03-26
tags:
- packer
- migration
- discussion-framework
- import-pattern
---
## Context
This lesson summarizes the completed migration of `docs/packer` into `discussion/`.
The original migration control artifacts were:
- `AGD-0003`
- `DEC-0002`
- `PLN-0002`
Those workflow files are being deleted during housekeeping. The index remains the permanent historical record.
## Key Decisions
### Packer domain import follows the same retained-set migration pattern as Studio
**What:** The `docs/packer` migration imported only retained artifacts, promoted retained open agendas into new discussions, preserved the empty retained sets for decisions and plans, rewrote retained `learn` into legacy lessons, and kept `specs` outside `discussion/`.
**Why:** The packer domain already had two live agendas and a didactic learn corpus, but no retained decisions or plans. The migration needed to preserve that real operational state instead of fabricating symmetry.
**Trade-offs:** The pattern keeps workflow truth honest, but it requires explicit editorial rewriting and separate migration bookkeeping before the resulting discussions can continue normally.
## Patterns and Algorithms
- Treat README-declared empty retained sets as authoritative.
- Create one new discussion per retained agenda.
- Backfill retained learn documents as legacy lessons in the migration discussion directory.
- Keep normative specs external to the workflow control plane.
- Delete completed migration control artifacts after recording the durable pattern lesson.
## Pitfalls
- Manufacturing missing decisions or plans to make the imported tree look symmetric.
- Forgetting to separate imported open agendas into their own discussions.
- Keeping completed migration scaffolding around after the lesson already captures the reusable pattern.
## Takeaways
- Domain migration is a repeatable workflow: preserve retained truth, normalize into framework templates, split open agendas into real discussions, and delete completed migration scaffolding after housekeeping.
- This lesson captures the migration pattern; the imported packer legacy lessons capture the domain knowledge itself.