setup process correct behavior
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{"type":"meta","next_id":{"DSC":20,"AGD":21,"DEC":18,"PLN":39,"LSN":33,"CLSN":1}}
|
||||
{"type":"meta","next_id":{"DSC":21,"AGD":22,"DEC":19,"PLN":40,"LSN":34,"CLSN":1}}
|
||||
{"type":"discussion","id":"DSC-0001","status":"done","ticket":"studio-docs-import","title":"Import docs/studio into discussion-framework artifacts","created_at":"2026-03-26","updated_at":"2026-03-26","tags":["studio","migration","discussion-framework","docs-import"],"agendas":[],"decisions":[],"plans":[],"lessons":[{"id":"LSN-0001","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0001-assets-workspace-execution-wave-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0002","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0002-bank-composition-editor-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0003","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0003-mental-model-asset-mutations-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0004","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0004-mental-model-assets-workspace-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0005","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0005-mental-model-studio-events-and-components-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0006","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0006-mental-model-studio-shell-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0007","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0007-pack-wizard-shell-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0008","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0008-project-scoped-state-and-activity-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0016","file":"discussion/lessons/DSC-0001-studio-docs-import/LSN-0016-studio-docs-import-pattern.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"}]}
|
||||
{"type":"discussion","id":"DSC-0002","status":"open","ticket":"palette-management-in-studio","title":"Palette Management in Studio","created_at":"2026-03-26","updated_at":"2026-03-26","tags":["studio","legacy-import","palette-management","tile-bank","packer-boundary"],"agendas":[{"id":"AGD-0002","file":"AGD-0002-palette-management-in-studio.md","status":"open","created_at":"2026-03-26","updated_at":"2026-03-26"}],"decisions":[],"plans":[],"lessons":[]}
|
||||
{"type":"discussion","id":"DSC-0003","status":"done","ticket":"packer-docs-import","title":"Import docs/packer into discussion-framework artifacts","created_at":"2026-03-26","updated_at":"2026-03-26","tags":["packer","migration","discussion-framework","docs-import"],"agendas":[],"decisions":[],"plans":[],"lessons":[{"id":"LSN-0009","file":"discussion/lessons/DSC-0003-packer-docs-import/LSN-0009-mental-model-packer-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0010","file":"discussion/lessons/DSC-0003-packer-docs-import/LSN-0010-asset-identity-and-runtime-contract-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0011","file":"discussion/lessons/DSC-0003-packer-docs-import/LSN-0011-foundations-workspace-runtime-and-build-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0012","file":"discussion/lessons/DSC-0003-packer-docs-import/LSN-0012-runtime-ownership-and-studio-boundary-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0013","file":"discussion/lessons/DSC-0003-packer-docs-import/LSN-0013-metadata-convergence-and-runtime-sink-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0014","file":"discussion/lessons/DSC-0003-packer-docs-import/LSN-0014-pack-wizard-summary-validation-and-pack-execution-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0015","file":"discussion/lessons/DSC-0003-packer-docs-import/LSN-0015-tile-bank-packing-contract-legacy.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"},{"id":"LSN-0017","file":"discussion/lessons/DSC-0003-packer-docs-import/LSN-0017-packer-docs-import-pattern.md","status":"done","created_at":"2026-03-26","updated_at":"2026-03-26"}]}
|
||||
@@ -18,3 +18,4 @@
|
||||
{"type":"discussion","id":"DSC-0017","status":"open","ticket":"studio-editor-inline-type-hints-for-let-bindings","title":"Inline Type Hints for Let Bindings in the Studio Editor","created_at":"2026-04-03","updated_at":"2026-04-03","tags":["studio","editor","inline-hints","inlay-hints","lsp","pbs","type-inference"],"agendas":[{"id":"AGD-0018","file":"AGD-0018-studio-editor-inline-type-hints-for-let-bindings.md","status":"accepted","created_at":"2026-04-03","updated_at":"2026-04-03"}],"decisions":[{"id":"DEC-0015","file":"DEC-0015-studio-editor-inline-type-hints-contract-and-rendering-model.md","status":"accepted","created_at":"2026-04-03","updated_at":"2026-04-03","ref_agenda":"AGD-0018"}],"plans":[{"id":"PLN-0033","file":"PLN-0033-inline-hint-spec-and-contract-propagation.md","status":"done","created_at":"2026-04-03","updated_at":"2026-04-03","ref_decisions":["DEC-0015"]},{"id":"PLN-0034","file":"PLN-0034-lsp-inline-hint-transport-contract.md","status":"done","created_at":"2026-04-03","updated_at":"2026-04-03","ref_decisions":["DEC-0015"]},{"id":"PLN-0035","file":"PLN-0035-pbs-inline-type-hint-payload-production.md","status":"done","created_at":"2026-04-03","updated_at":"2026-04-03","ref_decisions":["DEC-0015"]},{"id":"PLN-0036","file":"PLN-0036-studio-inline-hint-rendering-and-rollout.md","status":"done","created_at":"2026-04-03","updated_at":"2026-04-03","ref_decisions":["DEC-0015"]}],"lessons":[]}
|
||||
{"type":"discussion","id":"DSC-0018","status":"done","ticket":"studio-project-local-studio-state-under-dot-studio","title":"Persist project-local Studio state under .studio","created_at":"2026-04-04","updated_at":"2026-04-04","tags":["studio","project-session","project-state","persistence","dot-studio","shell","layout","setup"],"agendas":[],"decisions":[],"plans":[],"lessons":[{"id":"LSN-0031","file":"discussion/lessons/DSC-0018-studio-project-local-studio-state-under-dot-studio/LSN-0031-project-local-studio-state-and-lifecycle-safe-layout-restoration.md","status":"done","created_at":"2026-04-04","updated_at":"2026-04-04"}]}
|
||||
{"type":"discussion","id":"DSC-0019","status":"done","ticket":"studio-project-local-setup-separate-from-main-studio-state","title":"Separate project-local setup from the main Studio state under .studio","created_at":"2026-04-04","updated_at":"2026-04-04","tags":["studio","project-session","project-state","persistence","dot-studio","setup","boundary"],"agendas":[],"decisions":[],"plans":[],"lessons":[{"id":"LSN-0032","file":"discussion/lessons/DSC-0019-studio-project-local-setup-separate-from-main-studio-state/LSN-0032-separate-project-config-from-session-restoration-state.md","status":"done","created_at":"2026-04-04","updated_at":"2026-04-04"}]}
|
||||
{"type":"discussion","id":"DSC-0020","status":"done","ticket":"studio-editor-indentation-policy-and-project-setup","title":"Indentation Policy, Status-Bar Semantics, and Project-Local Editor Setup","created_at":"2026-04-04","updated_at":"2026-04-04","tags":["studio","editor","indentation","tabs","setup","dot-studio","configuration","ux"],"agendas":[],"decisions":[],"plans":[],"lessons":[{"id":"LSN-0033","file":"discussion/lessons/DSC-0020-studio-editor-indentation-policy-and-project-setup/LSN-0033-setup-owned-indentation-policy-and-project-bootstrap-defaults.md","status":"done","created_at":"2026-04-04","updated_at":"2026-04-04"}]}
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
---
|
||||
id: LSN-0033
|
||||
ticket: studio-editor-indentation-policy-and-project-setup
|
||||
title: Setup-Owned Indentation Policy and Project Bootstrap Defaults
|
||||
created: 2026-04-04
|
||||
tags: [studio, editor, indentation, tabs, setup, dot-studio, project-creation, gitignore]
|
||||
---
|
||||
|
||||
## Context
|
||||
|
||||
The Studio editor exposed an indentation chip in the status bar, but that chip was driven by file-content heuristics rather than by a stable editor policy.
|
||||
At the same time, `Tab` insertion did not obey the displayed value, which made the editor self-contradictory during normal editing.
|
||||
|
||||
The work also surfaced a second bootstrap problem: project creation already owned `.studio/` and `.workspace/`, but it was not yet treating project-local setup and baseline ignore rules as first-class bootstrapped assets.
|
||||
|
||||
## Key Decisions
|
||||
|
||||
### Project-Local Setup Owns Editor Indentation Policy
|
||||
|
||||
**What:**
|
||||
The active indentation policy is now owned by `.studio/setup.json`, loaded into memory once per project session, shown in the status bar, and used directly by editable-document `Tab` handling.
|
||||
|
||||
**Why:**
|
||||
The status bar must show the active policy, not a moving guess.
|
||||
If `Tab` behavior and the visible chip disagree, the editor loses trust immediately.
|
||||
|
||||
**Trade-offs:**
|
||||
This first wave intentionally stays project-wide.
|
||||
It does not attempt per-file or per-language precedence, and it does not reformat existing files that already diverge from the configured policy.
|
||||
|
||||
### Project Creation Must Bootstrap Real Project-Local Setup
|
||||
|
||||
**What:**
|
||||
The project-creation wizard now includes a dedicated details step before location selection.
|
||||
That step captures indentation width and Prometeu runtime path and persists them into `.studio/setup.json`.
|
||||
|
||||
**Why:**
|
||||
Indentation policy and runtime path are project-local configuration, so they should exist from project birth rather than appear later as ad hoc repair.
|
||||
|
||||
**Trade-offs:**
|
||||
Project creation becomes a little longer, but the result is a better-initialized project and a cleaner setup boundary.
|
||||
|
||||
### New Projects Must Ship With a Baseline `.gitignore`
|
||||
|
||||
**What:**
|
||||
Project bootstrap now writes a root `.gitignore` with Studio-local state and common OS junk excluded by default.
|
||||
|
||||
**Why:**
|
||||
`.studio/` and `.workspace/` are local machine artifacts and should not depend on users remembering to ignore them later.
|
||||
The same applies to common macOS, Windows, and Linux metadata noise.
|
||||
|
||||
**Trade-offs:**
|
||||
The generated file is intentionally conservative and generic rather than ecosystem-specific.
|
||||
|
||||
## Final Implementation
|
||||
|
||||
The final state established these rules in code and specs:
|
||||
|
||||
- `ProjectLocalStudioSetup` now carries editor indentation configuration with default resolution to `Spaces: 4`.
|
||||
- `ProjectLocalStudioSetupService` now supports both loading and saving setup data.
|
||||
- `StudioProjectSession` loads setup once and keeps it available in memory for runtime consumers.
|
||||
- `EditorStatusBar` now renders configured indentation policy instead of inspecting file contents.
|
||||
- `EditorWorkspace` converts `Tab` into the configured number of spaces for editable files.
|
||||
- `NewProjectWizard` now captures indentation width and runtime path on a dedicated details step before location.
|
||||
- `ProjectCatalogService` persists `.studio/setup.json` and writes a baseline `.gitignore` during project creation.
|
||||
|
||||
## Patterns and Algorithms
|
||||
|
||||
### Pattern: Policy Chips Must Reflect Runtime Policy, Not Content Heuristics
|
||||
|
||||
If a status-bar chip describes how the editor will behave, it must be backed by the same runtime value that input handling uses.
|
||||
Do not derive policy chips from observed content when the editor behavior is actually driven elsewhere.
|
||||
|
||||
### Pattern: Load Setup Once, Use It Repeatedly
|
||||
|
||||
Project-local setup is durable configuration, not per-keystroke state.
|
||||
Load it at project-session time, keep the resolved value in memory, and let editor interactions consume that in-memory representation directly.
|
||||
|
||||
### Pattern: Bootstrap Project Hygiene at Creation Time
|
||||
|
||||
If a project requires local-only directories such as `.studio/` or `.workspace/`, generate the corresponding `.gitignore` entries when the project is created.
|
||||
Do not push that responsibility onto users later.
|
||||
|
||||
## Pitfalls
|
||||
|
||||
- Do not let the status-bar indentation chip switch based on whatever indentation currently exists in the open file.
|
||||
- Do not make `Tab` obey one rule while the chip displays another.
|
||||
- Do not reread `.studio/setup.json` on every editing interaction just because the file is durable configuration.
|
||||
- Do not auto-reformat preexisting file content just because a project now has a configured indentation policy.
|
||||
- Do not keep `.studio/` and `.workspace/` out of `.gitignore` and expect users to fix repository hygiene manually.
|
||||
|
||||
## References
|
||||
|
||||
- `docs/specs/studio/1. Studio Shell and Workspace Layout Specification.md`
|
||||
- `docs/specs/studio/5. Code Editor Workspace Specification.md`
|
||||
- `docs/specs/studio/8. Project-Local Studio State Specification.md`
|
||||
- `prometeu-studio/src/main/java/p/studio/projectstate/ProjectLocalStudioSetup.java`
|
||||
- `prometeu-studio/src/main/java/p/studio/projectstate/ProjectLocalStudioSetupService.java`
|
||||
- `prometeu-studio/src/main/java/p/studio/window/NewProjectWizard.java`
|
||||
- `prometeu-studio/src/main/java/p/studio/workspaces/editor/EditorWorkspace.java`
|
||||
- `prometeu-studio/src/main/java/p/studio/projects/ProjectCatalogService.java`
|
||||
|
||||
## Takeaways
|
||||
|
||||
- Editor policy must be explicit, stable, and shared between UI and input handling.
|
||||
- `.studio/setup.json` is the right owner for project-local editor configuration such as indentation and runtime path.
|
||||
- Project creation should bootstrap both configuration and repository hygiene, not leave them as follow-up chores.
|
||||
Reference in New Issue
Block a user