Skip to content

Commit aae7ca4

Browse files
committed
[docs] specify and size C1-S1 current-draft recovery
Signed-off-by: Viwat Vchirawongkwin <viwat.v@chula.ac.th>
1 parent e03ecbc commit aae7ca4

7 files changed

Lines changed: 615 additions & 3 deletions

File tree

‎docs/decisions/0010-working-loop-in-memory-document.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,15 @@ Unchanged: the `Connection` seam (D1), neutral types (D2), Riverpod as the one s
5757
- Extends [ADR-0007](0007-riverpod-state-management.md) (Riverpod / D3) and [ADR-0009](0009-runtime-connection-manager.md) (runtime session facade); honors [ADR-0008](0008-signal-design-system.md) (`SignalCodeColors` for the editor/console surfaces).
5858
- Ratifies App [TDD.md §11.6](../specifications/App/TDD.md#116-working-loop-provider-contract-frozen) and the scoping freeze notes in [TDD.md §11.1](../specifications/App/TDD.md#111-editor)/[§11.4](../specifications/App/TDD.md#114-console--error-explanation) and [specs.md §4.5](../specifications/App/specs.md)/§4.6/§4.7/§4.8.
5959
- Scopes App stories **A-20 / A-21 / A-16 / A-30** (working-loop subset); defers FR-EDIT-7, NFR-REL-3/FR-PROJ-6, and the rich-editor part of FR-EDIT-1 to **A-24** ([OI-1](../specifications/App/specs.md)).
60+
61+
## 2026-09-25 follow-up — bounded current-text recovery specified
62+
63+
The historical decision and its original context above remain unchanged.
64+
[ADR-0012](0012-flutter-code-editor-behind-editorsurface.md) already superseded
65+
the rich-editor deferral. [ADR-0048](0048-bounded-current-text-draft-recovery.md)
66+
now specifies the bounded current-text recovery successor, with its
67+
[write/failure/board-authority contract](../specifications/App/current-draft-recovery.md)
68+
and [C1-S1 review and sizing](../developments/2026-q4-reliable-workflow/c1-s1/03_Recovery_Design_and_Sizing.md).
69+
The inspected source is still volatile; implementation and acceptance evidence
70+
are pending. The remaining A-24 project, settings, console, import and Blocks
71+
obligations are carried, not satisfied by the successor design.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!-- SPDX-License-Identifier: MIT -->
2+
<!-- Part of PyBLE (https://pyble.dev) — see /LICENSE. -->
3+
4+
# ADR 0048 — Recover one current text draft through the planned Drift store
5+
6+
**Status:** Specified for implementation (2026-09-25) under the user's request
7+
to execute C1-S1. Source implementation and physical acceptance remain pending; no named human
8+
sign-off is claimed and this is not release admission.
9+
10+
## Context
11+
12+
[ADR-0010](0010-working-loop-in-memory-document.md) recorded an intentionally
13+
volatile current document and deferred Drift persistence to A-24. That
14+
limitation remains in the inspected source. Its old rich-editor deferral has
15+
already been superseded by [ADR-0012](0012-flutter-code-editor-behind-editorsurface.md),
16+
so the persistence problem must be scoped against the current rich Editor,
17+
Blocks handoff and file-backed Run implementation.
18+
19+
The current provider has a mutation epoch, but Save/Run/Files completion guards
20+
still compare document values. A stable Connection facade also makes object
21+
identity insufficient to bind a multi-step text action to one attached board.
22+
Recovery must not amplify either gap by restoring a historical target as
23+
current write authority.
24+
25+
C1-S1 requests a bounded contract and an honest estimate, not the full A-24
26+
implementation. The [design review and sizing](../developments/2026-q4-reliable-workflow/c1-s1/03_Recovery_Design_and_Sizing.md)
27+
records this distinction and the proposed reforecast.
28+
29+
## Decision
30+
31+
Adopt [the bounded current-draft contract](../specifications/App/current-draft-recovery.md)
32+
for the next implementation slice:
33+
34+
1. Use one current-text slot in the planned Drift `projects`/`project_files`
35+
subset and single SettingsStore. Commit its content and recovery metadata
36+
atomically. No scratch file or separate preferences backend.
37+
2. Distinguish local checkpoint state from board-dirty state. A saved-local
38+
indication acknowledges a successful transaction for that exact revision.
39+
3. Offer explicit offline Restore/Discard with nondestructive failure handling.
40+
A local recovery panel is a narrow extension of
41+
[ADR-0011](0011-connection-gated-shell.md); it does not implement the complete
42+
offline IDE.
43+
4. Restore text without board authority. Require a current-session destination
44+
decision before a recovered document can be saved, uploaded or run on a
45+
board; use document epochs and the existing neutral session stamp across
46+
asynchronous boundaries.
47+
5. Include interrupted-write, corrupt/full storage, version handling, stale
48+
completions and applicable platform evidence in the same usable increment.
49+
Keep Blocks graph recovery and the rest of A-24 explicitly carried.
50+
51+
This decision supersedes only ADR-0010's volatile-only current-text design for
52+
the future accepted slice. It does not retroactively claim that released builds
53+
persist drafts, change PBLE/1 or remove the existing provider/Connection seams.
54+
55+
## Alternatives considered
56+
57+
| Option | Decision |
58+
|---|---|
59+
| Ad-hoc text/JSON scratch file or separate preferences | Rejected: duplicates the accepted Drift direction and leaves another migration/storage boundary |
60+
| Complete all A-24 projects, histories, imports and Blocks state together | Deferred: exceeds the first bounded outcome and needs separate contracts |
61+
| Infer the old board from a recovered path or advertised name | Rejected: path and display identity do not authorize a new session |
62+
| Restore automatically over a fresh empty provider | Rejected: races hydration, user edits and pending replacement decisions |
63+
| Ship only successful restart recovery, add failure handling later | Rejected: cannot meet the recovery story's minimum safety acceptance |
64+
65+
## Consequences
66+
67+
The implementation needs the actual Drift/native database dependencies,
68+
versioned schemas, local recovery UI and stronger completion guards. None of
69+
these exist merely because this ADR is written. The estimate exceeds the
70+
original C1-S2 recovery allowance; future Sprint selection must be reforecast
71+
without weakening the failure cases. The narrower feature can eventually
72+
protect useful current text, while full project persistence remains unfinished.

‎docs/decisions/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,8 @@ Each ADR captures one significant decision: its context, the choice, and the con
5151
| [0045](0045-adopt-ios-15-deployment-floor.md) | Adopt iOS and iPadOS 15 as the maintained source and compiled distribution floor while preserving build 5 as historical evidence | Accepted |
5252
| [0046](0046-publish-release-bound-static-learning-center.md) | Publish a static `/learn` center whose app, firmware, examples, validation, privacy, and deployment claims remain release-bound | Accepted |
5353
| [0047](0047-standardize-official-workspaces-on-lfs2.md) | Standardize all five official firmware workspaces on explicit, fail-closed LFS2 mounting and provisioning | Accepted |
54+
| [0048](0048-bounded-current-text-draft-recovery.md) | Specify bounded Drift current-text recovery with explicit local durability, recovery choices and session-bound board authority; implementation pending | Specified |
5455

5556
Decided 2026-06-30 (0001–0005); 0006 accepted 2026-07-01; 0007, 0008, 0009 and 0010 accepted 2026-07-02; 0011 accepted 2026-07-03; 0012 accepted 2026-07-25; 0013 accepted 2026-07-27; 0014, 0015, 0016, and 0017 accepted 2026-07-28; 0018–0022 accepted 2026-07-29; 0023 and 0024 accepted 2026-08-01; 0025 and 0026 accepted 2026-08-02; 0027–0029 accepted 2026-08-03; 0030 accepted 2026-08-11; 0031–0033 accepted 2026-08-12; 0034 accepted 2026-08-13; 0035 and 0036 accepted 2026-08-16; 0037 and 0038 accepted 2026-08-20; 0039 accepted 2026-08-21; 0040 accepted 2026-08-22; 0041 accepted 2026-08-25; 0042–0045 accepted 2026-08-27; 0046 accepted 2026-08-28; 0047 accepted 2026-09-03.
57+
58+
0048 specified for implementation on 2026-09-25 during C1-S1; this status does not claim delivered persistence or release acceptance.

0 commit comments

Comments
 (0)