editor with write capability
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
---
|
||||
id: AGD-0022
|
||||
discussion: DSC-0021
|
||||
ticket: studio-frontend-editor-write-and-save-wave
|
||||
title: Enable Frontend Editing and Save in the Studio Code Editor
|
||||
status: accepted
|
||||
created: 2026-04-04
|
||||
updated: 2026-04-04
|
||||
owner: studio
|
||||
tags: [studio, editor, frontend, write, save, vfs, lsp, pbs, access-policy]
|
||||
---
|
||||
|
||||
## Problem
|
||||
|
||||
The Studio Code Editor already delivers frontend semantic-read value through `prometeu-lsp`, but frontend documents are still hard `read-only`.
|
||||
|
||||
That leaves the FE editing wave unfinished:
|
||||
|
||||
- frontend files can be opened, analyzed, highlighted, and navigated;
|
||||
- but they cannot be edited or saved;
|
||||
- and the current contract explicitly says that FE editing requires a separate decision.
|
||||
|
||||
The next step is to define how FE mutation and save rights should be released without breaking the VFS/LSP/editor ownership split that the repository has already stabilized.
|
||||
|
||||
## Context
|
||||
|
||||
Domain owner: `studio`.
|
||||
|
||||
The current durable constraints are already clear:
|
||||
|
||||
1. `prometeu-vfs` owns document classification, access mode, snapshots, and save behavior;
|
||||
2. `prometeu-lsp` is a semantic consumer of VFS-backed snapshots and must not absorb save or access-policy ownership;
|
||||
3. Studio UI is a consumer of both boundaries and must not re-derive document rights locally;
|
||||
4. frontend semantic-read was intentionally released before frontend edit rights;
|
||||
5. FE edit rights now require a new explicit discussion and decision.
|
||||
|
||||
This means the new wave cannot be framed as “let the editor mutate text and figure out persistence later”.
|
||||
If FE editing is released, it must be released through the same document-runtime owner that already controls access and save semantics.
|
||||
|
||||
## Open Questions
|
||||
|
||||
1. Should FE editing be released only together with FE save in the same wave?
|
||||
2. Must FE editable snapshots remain owned by `prometeu-vfs`, exactly like non-frontend editable documents?
|
||||
3. How should `prometeu-lsp` consume dirty FE snapshots after mutation: on-demand analyze only, background refresh, or both?
|
||||
4. Are FE edit rights universal for all frontend-scoped supported files, or do they need an additional narrowing rule in this first FE write wave?
|
||||
5. What explicit safeguards are needed so FE editing does not accidentally turn `prometeu-lsp` into the document owner?
|
||||
|
||||
## Options
|
||||
|
||||
### Option 1: Allow FE editing in the editor before FE save exists
|
||||
|
||||
The editor would accept FE text mutation locally, and LSP could consume that dirty text, but FE save would remain unavailable or deferred.
|
||||
|
||||
Tradeoffs:
|
||||
|
||||
- appears to unlock FE editing quickly;
|
||||
- creates a half-owned document state with unclear persistence semantics;
|
||||
- weakens the current VFS ownership model;
|
||||
- encourages exactly the “editor mutates first, persistence later” drift the repository has avoided so far.
|
||||
|
||||
This option is weak and should be rejected.
|
||||
|
||||
### Option 2: Release FE editing and FE save together through `prometeu-vfs`
|
||||
|
||||
FE documents become editable only when `prometeu-vfs` can own their writable snapshots, dirty tracking, and save behavior.
|
||||
The editor consumes that access mode, and `prometeu-lsp` continues to analyze VFS-backed FE snapshots as a consumer.
|
||||
|
||||
Tradeoffs:
|
||||
|
||||
- preserves the current architecture cleanly;
|
||||
- avoids split-brain ownership between editor, VFS, and LSP;
|
||||
- makes FE write behavior coherent on day one;
|
||||
- requires a broader implementation wave than a UI-only unlock.
|
||||
|
||||
This is the strongest option.
|
||||
|
||||
### Option 3: Let `prometeu-lsp` become the temporary owner of editable FE session text
|
||||
|
||||
LSP would hold the live FE text state because it already consumes FE semantics, and save integration would come later.
|
||||
|
||||
Tradeoffs:
|
||||
|
||||
- seems convenient because FE semantics already live there;
|
||||
- collapses semantic ownership into document ownership;
|
||||
- directly conflicts with the established VFS boundary;
|
||||
- would make the previous editor/VFS/LSP split editorially and architecturally inconsistent.
|
||||
|
||||
This option should be rejected.
|
||||
|
||||
## Recommendation
|
||||
|
||||
Adopt Option 2.
|
||||
|
||||
Recommended direction:
|
||||
|
||||
1. FE editing and FE save should be released in the same wave.
|
||||
2. `prometeu-vfs` should remain the sole owner of FE writable snapshots, access mode, dirty tracking, and persistence.
|
||||
3. `prometeu-lsp` should continue as a semantic consumer of VFS-backed FE snapshots, including dirty in-memory FE state.
|
||||
4. Studio UI should remain a policy consumer and must not introduce FE-local save or access heuristics outside the VFS contract.
|
||||
5. The first FE write wave should explicitly define scope, save semantics, user-visible access changes, and any resulting LSP refresh model.
|
||||
|
||||
## Next Step
|
||||
|
||||
If this agenda is accepted, convert it into a decision that normatively locks:
|
||||
|
||||
- whether FE edit and FE save release together;
|
||||
- VFS ownership of FE writable snapshots and save behavior;
|
||||
- LSP consumption rules for dirty FE snapshots;
|
||||
- and the exact scope of the first FE write wave.
|
||||
|
||||
## Resolution
|
||||
|
||||
Accepted on 2026-04-04.
|
||||
|
||||
The discussion is closed with the following resolution:
|
||||
|
||||
1. FE editing and FE save release together in the same wave.
|
||||
2. `prometeu-vfs` remains the sole owner of FE writable snapshots, access mode, dirty tracking, and persistence.
|
||||
3. `prometeu-lsp` continues as a semantic consumer of VFS-backed FE snapshots, including dirty in-memory FE state, but no new LSP implementation work is part of the immediate execution wave.
|
||||
4. The first FE write wave applies to all frontend-scoped supported files rather than introducing an additional narrowing rule.
|
||||
@@ -0,0 +1,125 @@
|
||||
---
|
||||
id: DEC-0019
|
||||
discussion: DSC-0021
|
||||
agenda: AGD-0022
|
||||
ticket: studio-frontend-editor-write-and-save-wave
|
||||
title: Enable Frontend Editing and Save in the Studio Code Editor
|
||||
status: accepted
|
||||
created: 2026-04-04
|
||||
updated: 2026-04-04
|
||||
owner: studio
|
||||
tags: [studio, editor, frontend, write, save, vfs, lsp, pbs, access-policy]
|
||||
---
|
||||
|
||||
## Context
|
||||
|
||||
Studio already provides frontend semantic-read value through `prometeu-lsp`, while frontend documents remain hard `read-only`.
|
||||
The repository also already locked the architectural split between document ownership and semantic ownership:
|
||||
|
||||
1. `prometeu-vfs` owns document classification, access mode, snapshots, and save behavior;
|
||||
2. `prometeu-lsp` consumes VFS-backed snapshots for semantic analysis;
|
||||
3. Studio UI consumes both boundaries and must not re-derive document rights locally.
|
||||
|
||||
The previous semantic-read wave explicitly stated that frontend editing requires a separate decision.
|
||||
This decision closes that gap.
|
||||
|
||||
## Decision
|
||||
|
||||
Studio SHALL release frontend editing and frontend save together in one explicit write wave.
|
||||
|
||||
The wave is normatively defined as follows:
|
||||
|
||||
1. Frontend editing MUST NOT be released without frontend save in the same wave.
|
||||
2. `prometeu-vfs` MUST remain the sole owner of frontend writable snapshots.
|
||||
3. `prometeu-vfs` MUST remain the sole owner of frontend access mode.
|
||||
4. `prometeu-vfs` MUST remain the sole owner of frontend dirty tracking.
|
||||
5. `prometeu-vfs` MUST remain the sole owner of frontend save and save-all behavior.
|
||||
6. Studio UI MUST consume frontend editability and save rights from `prometeu-vfs` rather than introducing editor-local policy.
|
||||
7. `prometeu-lsp` MUST continue as a semantic consumer of VFS-backed frontend snapshots, including dirty in-memory frontend state.
|
||||
8. This decision does NOT authorize a new LSP implementation wave as part of the immediate execution scope.
|
||||
9. The first frontend write wave MUST apply to all frontend-scoped supported files and MUST NOT introduce an additional narrowing rule in this wave.
|
||||
10. Releasing frontend editing MUST NOT collapse semantic ownership, document ownership, and persistence ownership into one module.
|
||||
|
||||
## Rationale
|
||||
|
||||
Frontend mutation without frontend save would create a half-owned editorial state and weaken the document boundary that the repository has already stabilized.
|
||||
The correct release shape is therefore coherent FE mutation plus coherent FE persistence under the same owner.
|
||||
|
||||
Keeping `prometeu-vfs` as the sole owner preserves the existing architecture:
|
||||
|
||||
- VFS owns documents and persistence;
|
||||
- LSP consumes document state for semantics;
|
||||
- UI renders and interacts with policy.
|
||||
|
||||
This decision also avoids using a fake transitional step where the editor mutates frontend text locally while persistence remains undefined.
|
||||
|
||||
## Technical Specification
|
||||
|
||||
### Frontend Document Ownership
|
||||
|
||||
Frontend-scoped supported files MUST move from hard `read-only` to editable only through `prometeu-vfs`.
|
||||
|
||||
That means:
|
||||
|
||||
1. writable FE in-memory snapshots MUST be created and owned by VFS;
|
||||
2. FE dirty tracking MUST be owned by VFS;
|
||||
3. FE save and save-all MUST route through VFS;
|
||||
4. editor-visible FE access mode MUST be surfaced from VFS.
|
||||
|
||||
### Editor Behavior
|
||||
|
||||
The Studio editor MUST consume the new FE access policy from VFS exactly as it already does for non-frontend editable documents.
|
||||
|
||||
The editor MUST NOT:
|
||||
|
||||
1. create a separate FE-only mutation model;
|
||||
2. implement FE-local persistence outside VFS;
|
||||
3. infer FE save rights through UI heuristics.
|
||||
|
||||
### LSP Consumption Boundary
|
||||
|
||||
`prometeu-lsp` remains authorized to consume dirty FE snapshots from VFS.
|
||||
However, this decision does not authorize a new LSP feature wave as part of immediate execution.
|
||||
|
||||
Immediate implementation may rely on the existing semantic-read seam, provided that:
|
||||
|
||||
1. no new persistence ownership moves into LSP;
|
||||
2. no new access-policy ownership moves into LSP;
|
||||
3. FE write enablement does not depend on introducing a new LSP-owned document model.
|
||||
|
||||
### Scope of First FE Write Wave
|
||||
|
||||
The first FE write wave applies to all frontend-scoped supported files currently recognized by the VFS/frontend boundary.
|
||||
|
||||
This decision does not authorize:
|
||||
|
||||
1. a temporary subset of FE file classes;
|
||||
2. an editor-only FE draft mode;
|
||||
3. FE edit rights without FE save rights.
|
||||
|
||||
## Constraints
|
||||
|
||||
1. This decision does not authorize a new LSP implementation scope by itself.
|
||||
2. This decision does not authorize moving document state ownership into Studio UI.
|
||||
3. This decision does not authorize moving document state ownership into LSP.
|
||||
4. This decision does not authorize releasing FE editing through a separate temporary persistence path.
|
||||
|
||||
## Propagation Targets
|
||||
|
||||
- Specs:
|
||||
- `docs/specs/studio/5. Code Editor Workspace Specification.md`
|
||||
- `docs/specs/studio/6. Project Document VFS Specification.md`
|
||||
- `docs/specs/studio/7. Integrated LSP Semantic Read Phase Specification.md`
|
||||
- Plans:
|
||||
- FE VFS write/access/save propagation
|
||||
- Studio FE editor access-mode and save UX propagation
|
||||
- Code:
|
||||
- `prometeu-vfs` FE writable snapshot and save policy
|
||||
- `prometeu-studio` FE editor write UX and access-state propagation
|
||||
- Tests:
|
||||
- FE VFS access-mode and save coverage
|
||||
- FE editor editable/saveable behavior
|
||||
|
||||
## Revision Log
|
||||
|
||||
- 2026-04-04: Accepted from `AGD-0022` to release FE editing and save together under VFS ownership, with no new immediate LSP implementation scope.
|
||||
@@ -0,0 +1,175 @@
|
||||
---
|
||||
id: PLN-0040
|
||||
discussion: DSC-0021
|
||||
decision: DEC-0019
|
||||
ticket: studio-frontend-editor-write-and-save-wave
|
||||
title: Implement the frontend editor write and save wave through VFS ownership
|
||||
status: done
|
||||
created: 2026-04-04
|
||||
updated: 2026-04-04
|
||||
owner: studio
|
||||
tags: [studio, editor, frontend, write, save, vfs, lsp, pbs, access-policy]
|
||||
---
|
||||
|
||||
## Briefing
|
||||
|
||||
Implement the accepted frontend write wave for the Studio Code Editor.
|
||||
Frontend editing and frontend save must be released together, must remain owned by `prometeu-vfs`, and must be consumed by Studio UI without introducing a new immediate LSP implementation wave.
|
||||
|
||||
## Objective
|
||||
|
||||
Move frontend-scoped supported files from hard `read-only` to VFS-owned editable/saveable documents while preserving the current boundary:
|
||||
|
||||
- `prometeu-vfs` owns document state and persistence;
|
||||
- `prometeu-lsp` remains a semantic consumer of VFS-backed snapshots;
|
||||
- Studio UI remains a policy consumer.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `DEC-0019` Enable Frontend Editing and Save in the Studio Code Editor
|
||||
- existing `prometeu-vfs` editable snapshot and save model for non-frontend textual documents
|
||||
- existing Studio editor consumption of VFS access mode and save behavior
|
||||
- existing semantic-read seam where `prometeu-lsp` reads VFS-backed frontend snapshots
|
||||
|
||||
## Scope
|
||||
|
||||
- propagate the new FE write/save contract into Studio and VFS specs
|
||||
- extend `prometeu-vfs` so frontend-scoped supported files become editable/saveable
|
||||
- keep FE writable snapshots, dirty tracking, and save ownership inside VFS
|
||||
- update Studio editor behavior to consume FE editability from VFS
|
||||
- update FE write/save tests in VFS and Studio
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- any new LSP feature implementation wave
|
||||
- per-file FE access policy
|
||||
- partial FE draft mode without save
|
||||
- moving persistence logic into Studio UI
|
||||
- moving persistence logic into `prometeu-lsp`
|
||||
|
||||
## Execution Method
|
||||
|
||||
### 1. Propagate the accepted contract into specs
|
||||
|
||||
Update the Studio specs that still describe FE files as hard `read-only` so they now describe the new FE write/save wave and preserve VFS ownership plus semantic-consumer-only LSP ownership.
|
||||
|
||||
Targets:
|
||||
|
||||
- `docs/specs/studio/5. Code Editor Workspace Specification.md`
|
||||
- `docs/specs/studio/6. Project Document VFS Specification.md`
|
||||
- `docs/specs/studio/7. Integrated LSP Semantic Read Phase Specification.md`
|
||||
|
||||
### 2. Change FE access policy in `prometeu-vfs`
|
||||
|
||||
Update the filesystem-backed VFS classification so frontend-scoped supported files become `EDITABLE` rather than `READ_ONLY`, while preserving frontend classification itself.
|
||||
|
||||
What changes:
|
||||
|
||||
- document kind classification for FE files
|
||||
- VFS acceptance of FE `updateDocument`
|
||||
- VFS save/save-all behavior for FE snapshots
|
||||
- FE dirty tracking semantics under the same VFS owner model already used for editable non-frontend documents
|
||||
|
||||
Targets:
|
||||
|
||||
- `prometeu-vfs/prometeu-vfs-v1/src/main/java/p/studio/vfs/FilesystemVfsProjectDocument.java`
|
||||
- any supporting VFS API contracts if required by the implementation
|
||||
|
||||
Dependency ordering:
|
||||
|
||||
- this step must land before Studio editor UX changes so the UI can consume the new policy rather than invent it.
|
||||
|
||||
### 3. Update VFS tests for FE edit/save behavior
|
||||
|
||||
Replace tests that assert FE hard `read-only` behavior with tests that assert:
|
||||
|
||||
1. FE documents open as frontend documents with `EDITABLE` access mode;
|
||||
2. FE documents accept `updateDocument`;
|
||||
3. FE documents save correctly through `saveDocument`;
|
||||
4. FE documents participate correctly in `saveAllDocuments`.
|
||||
|
||||
Targets:
|
||||
|
||||
- `prometeu-vfs/prometeu-vfs-v1/src/test/java/p/studio/vfs/FilesystemVfsProjectDocumentTest.java`
|
||||
|
||||
### 4. Propagate FE editability into the Studio editor
|
||||
|
||||
Update the Studio editor to consume the new FE access mode from VFS exactly as it already does for editable non-frontend documents.
|
||||
|
||||
What changes:
|
||||
|
||||
- FE tabs become editable when VFS reports `EDITABLE`
|
||||
- FE warning surfaces that are specific to hard `read-only` FE behavior must be revised or removed
|
||||
- editor save/save-all enablement must work for dirty FE buffers through the existing VFS-backed flow
|
||||
- no FE-local persistence path may be introduced
|
||||
|
||||
Targets:
|
||||
|
||||
- `prometeu-studio/src/main/java/p/studio/workspaces/editor/EditorWorkspace.java`
|
||||
- `prometeu-studio/src/main/java/p/studio/workspaces/editor/EditorStatusBar.java`
|
||||
- any FE-warning or editor-session support classes affected by access-mode transition
|
||||
|
||||
Dependency ordering:
|
||||
|
||||
- this step depends on VFS access-mode propagation from Step 2.
|
||||
|
||||
### 5. Keep LSP integration stable without opening new implementation scope
|
||||
|
||||
Verify that the existing editor and semantic-read flow still calls `prometeu-lsp` as a consumer of FE snapshots, but do not introduce a new LSP implementation wave.
|
||||
|
||||
What changes:
|
||||
|
||||
- only compatibility adjustments that are strictly necessary because FE snapshots are now editable may be made;
|
||||
- no new semantic features, refresh model, or ownership expansion is authorized here.
|
||||
|
||||
Targets:
|
||||
|
||||
- only the minimum compatibility surface if compilation or existing tests require it
|
||||
|
||||
Dependency ordering:
|
||||
|
||||
- this is verification-oriented and should follow the VFS/editor write changes.
|
||||
|
||||
### 6. Update Studio tests for FE editable/saveable behavior
|
||||
|
||||
Add or revise editor tests so they assert FE files are no longer treated as permanently hard `read-only` once VFS grants FE `EDITABLE` access mode.
|
||||
|
||||
Targets:
|
||||
|
||||
- Studio editor tests under `prometeu-studio/src/test/java/p/studio/workspaces/editor/...`
|
||||
- any session/editor tests affected by FE access-mode transition
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
1. Frontend-scoped supported files open through VFS with `EDITABLE` access mode.
|
||||
2. Frontend-scoped supported files can be updated and saved through VFS-owned snapshots.
|
||||
3. Studio editor FE tabs become editable only because VFS reports them as editable.
|
||||
4. FE save and save-all route through the same VFS owner path used by other editable documents.
|
||||
5. No new persistence or access-policy ownership moves into Studio UI.
|
||||
6. No new persistence or access-policy ownership moves into `prometeu-lsp`.
|
||||
7. Specs no longer describe FE files as hard `read-only` for the current wave.
|
||||
|
||||
## Tests
|
||||
|
||||
- VFS tests for FE access mode, update, save, and save-all
|
||||
- Studio editor tests for FE editable/saveable behavior
|
||||
- regression tests that confirm non-frontend editable documents still behave correctly
|
||||
- compile/test verification that existing LSP consumer seams still pass without opening new LSP feature scope
|
||||
|
||||
## Affected Artifacts
|
||||
|
||||
- `discussion/workflow/decisions/DEC-0019-studio-frontend-editor-write-and-save-wave.md`
|
||||
- `docs/specs/studio/5. Code Editor Workspace Specification.md`
|
||||
- `docs/specs/studio/6. Project Document VFS Specification.md`
|
||||
- `docs/specs/studio/7. Integrated LSP Semantic Read Phase Specification.md`
|
||||
- `prometeu-vfs/prometeu-vfs-v1/src/main/java/p/studio/vfs/FilesystemVfsProjectDocument.java`
|
||||
- `prometeu-vfs/prometeu-vfs-v1/src/test/java/p/studio/vfs/FilesystemVfsProjectDocumentTest.java`
|
||||
- `prometeu-studio/src/main/java/p/studio/workspaces/editor/...`
|
||||
- Studio editor tests
|
||||
|
||||
## Risks
|
||||
|
||||
- existing specs and tests currently encode the old hard `read-only` FE contract and will fail until all propagation lands coherently
|
||||
- FE warning/UI surfaces may assume old read-only semantics in more than one place
|
||||
- LSP snapshot consumption could reveal hidden assumptions about FE immutability even without opening a new LSP scope
|
||||
- if implementation order is reversed and Studio is changed before VFS policy, UI code may drift into local heuristics
|
||||
Reference in New Issue
Block a user