Skip to content

Commit 992c40d

Browse files
committed
docs: mark M7 Phase 4 (config -> $ctx->{cfg}) done
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 38b7506 commit 992c40d

2 files changed

Lines changed: 27 additions & 8 deletions

File tree

M7-CTX-PLAN.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,26 @@ threading mistake shows up as a crash or a mis-drawn screen, not a silent pass.
144144
resize_form closure), `t/11` layout, `t/07` `--dump` form, `t/20` submit. Full
145145
suite 311 green.
146146

147-
### Phase 4 — config settings → `$ctx->{cfg}` *(~30 vars, incl. 17 colour attrs)*
148-
- `load_config`'s per-section dispatch writes `$ctx->{cfg}{...}`; the
149-
`eval "$VAR = ..."` colour assignments become `eval "\$ctx->{cfg}{labelFg} =
150-
..."` (still evaluated in `ccfe.pl`'s package for the colour helpers).
151-
- Read-only after startup, so readers are a mechanical `$X``$ctx->{cfg}{X}`.
152-
- **Gate:** `t/06` colour/theme integration.
147+
### Phase 4 — config settings → `$ctx->{cfg}` *(done — ~45 vars, ~290 sites)*
148+
- **Decision (agreed):** config is read-only-after-startup shared state, so it
149+
is *consolidated* into one explicit `$ctx->{cfg}` object rather than
150+
param-threaded through the ~15 reading subs. `$ctx` is promoted to a top-level
151+
`our` global, built before the config defaults; `load_config`, the defaults
152+
and every reader fill/read `$ctx->{cfg}{X}`. No param-threading (no benefit for
153+
immutable data); the per-call MUTABLE state already got true lexical isolation
154+
in Phases 1–3.
155+
- Done in three test-gated word-boundary-rename commits: **4a** scalar settings
156+
(LAYOUT, HIDE_CURSOR, PATH, RESTRICTED, *_FOOTER_ROWS, …); **4b** colour/attr
157+
vars incl. the `eval "$VAR = ..."` ones (rewritten to
158+
`eval "\$ctx->{cfg}{labelFg} = ..."`, still evaluated in `ccfe.pl`'s package);
159+
**4c** structures (`%keys``$ctx->{cfg}{keys}` hashref, `@fval_delim` and
160+
`@RESTRICTED_ALLOW` → arrayrefs). Only `@mf_path`/`@cnf_path` stay global
161+
(search-path infrastructure used by `t/01`).
162+
- **Test fallout:** `t/04-restricted.t` poked `$main::RESTRICTED` /
163+
`@main::RESTRICTED_ALLOW` and grepped the source for `unless $RESTRICTED`;
164+
updated to `$main::ctx->{cfg}{...}`.
165+
- **Gate:** `t/06` colour/theme, `t/04` restricted policy, `t/07` CLI, full
166+
suite 311 green.
153167

154168
### Phase 5 — residual scalar runtime state
155169
- `$SCREEN_DIR`, `$last_item_id`, `$pad_lines`, `$exec_args`, `$child_es`.

ROADMAP.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,13 @@ the conformance tests.
218218
converted to anonymous closures (3a), then `%form`/`@fp`/`$cform` flipped from
219219
`local` to per-call `my` (3b); `load_form` now builds a lexical and copies it
220220
out to a caller ref. ~325 body sites stayed byte-identical. `t/20-form-submit.t`
221-
added to fire the submit-path closures. 311 tests green. Next: Phase 4
222-
(config settings → `$ctx->{cfg}`).
221+
added to fire the submit-path closures. **Phase 4 done:** the ~45 read-only
222+
config vars (~290 sites) consolidated into one explicit `$ctx->{cfg}` object
223+
(`our $ctx` built before the config defaults) rather than param-threaded
224+
through ~15 subs, since config is immutable after `load_config`; done in three
225+
word-boundary-rename commits (4a settings, 4b colour attrs incl. the eval'd
226+
ones, 4c `%keys`/arrays). 311 tests green. Next: Phase 5 (residual scalars),
227+
then the Phase 6 `use v5.36` capstone.
223228

224229
## M8 — Non-functional close-out audit _(final gate)_
225230
Five dimensions: **test coverage, code quality, performance, security,

0 commit comments

Comments
 (0)