Skip to content

Commit 7525816

Browse files
committed
Refresh todo: drop dropped variant-array phase, sync flag projection shape to flat array
1 parent 9258755 commit 7525816

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

docs/todo.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Deferred to v2 (see below): selection model and VSCode commands. Both naturally
3434

3535
Out of scope for v1: variant arrays, insert-at-index, multi-select, context menu, bulk ops, copy/paste, move up/down, `minSize`/`maxSize` validation gating (spec carries `defaultElement` only so far).
3636

37-
### v2 - selection, commands, variant arrays, ordering, context menu
37+
### v2 - selection, commands, ordering, context menu
3838

3939
#### v2.1 - selection model + commands (shipped)
4040

@@ -46,7 +46,7 @@ Out of scope for v1: variant arrays, insert-at-index, multi-select, context menu
4646

4747
- Right-click on an addable group header or a removable entry opens the VSCode-native webview context menu via `data-vscode-context` + `contributes.menus.webview/context`. Items dispatch to the v2.1 commands; `Shift+F10` and the keyboard menu key open the same menu.
4848

49-
#### v2.4 - ordering (shipped)
49+
#### v2.3 - ordering (shipped)
5050

5151
- `buildInsertEntryBytes(parseResult, entryPath, position)` and `buildMoveEntryBytes(parseResult, entryPath, direction)` on the adapter. `BinaryDocument` exposes `insertEntityBefore` / `insertEntityAfter` / `moveEntityUp` / `moveEntityDown` (each one undo-able through the existing pipeline).
5252
- VSCode commands `bgforge.binaryEditor.insertEntryBefore` / `insertEntryAfter` / `moveEntryUp` / `moveEntryDown`, all surfaced in the Command Palette and webview context menu (grouped separately from add/remove for readability).
@@ -105,7 +105,7 @@ item.abilities.add(makeAbility({ type: "ranged", damage: 8, range: 12 }));
105105
const bytes = item.toBytes();
106106
```
107107

108-
The named-projection shape gives `flags.unidentified = true` for free. Sub-record factories
108+
Surfacing flags as typed members (`flags.unidentified = true`) is a thin accessor wrapper over the canonical flag-set shape. Sub-record factories
109109
(`makeAbility`, `makeEffect`, `makeHeader`, ...) fill defaults from spec; constructors take a
110110
sparse `Partial<Document>` and merge over defaults.
111111

@@ -140,9 +140,10 @@ sparse `Partial<Document>` and merge over defaults.
140140

141141
### Prerequisites
142142

143-
The named-bit dict projection for flag fields (rule #7) is in place across all five formats -
144-
flag fields surface as `Record<string, boolean | string>` in canonical-doc, and the construction
145-
API inherits that shape directly (`item.header.flags.unidentified = true`). For enums and PIDs,
143+
The flat sorted-array projection for flag fields (rule #7) is in place across all five formats -
144+
flag fields surface as `string[]` in canonical-doc. The construction API exposes
145+
`item.header.flags.unidentified = true` as a typed-accessor wrapper over that shape, not as
146+
direct inheritance of the canonical shape. For enums and PIDs,
146147
canonical-doc carries raw ints (rule #9); the construction API can either use the int form
147148
directly (`item.header.frmType = 0`) or wrap a per-format helper that accepts the named string
148149
and resolves via `enumValueToInt` from `coded-projection.ts`. Default-value derivation
@@ -169,7 +170,7 @@ consumer with committed snapshots even if the library API is unchanged.
169170
### Pieces
170171

171172
- A versioned schema document - `binary/SNAPSHOT-FORMAT.md` or similar - listing
172-
per-format JSON shape: top-level keys, group structure, named-bit dict
173+
per-format JSON shape: top-level keys, group structure, flat sorted-array
173174
layout for flag fields (rule #7), enum encoding (raw int per rule #9), header
174175
fields, canonicalisation rules (key order, number formatting, whitespace).
175176
- A schema version embedded in the JSON itself (e.g. top-level `"$snapshot": 1`),

0 commit comments

Comments
 (0)