reflective: Phase 3 docs — mark env.sx extraction DONE, others still blocked
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 19s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 19s
plans/kernel-on-sx.md — Phase 7 header updated from "partial" to "env.sx EXTRACTED 2026-05-12"; second-consumer-found checkbox ticked for env.sx specifically. Other five files (combiner, evaluator, hygiene, quoting, short-circuit) stay blocked pending their own second consumers. plans/lib-guest-reflective.md — Phases 1-3 ticked off with date stamps; Outcome section added summarising the three commits, file stats (124 LoC, within 80-200 bound), and the third-consumer adoption protocol (cfg with five keys, no changes to env.sx).
This commit is contained in:
@@ -91,21 +91,21 @@ The two consumer migrations:
|
||||
|
||||
## Roadmap
|
||||
|
||||
### Phase 1 — Skeleton + Kernel migration
|
||||
### Phase 1 — Skeleton + Kernel migration *[DONE 2026-05-12]*
|
||||
|
||||
- [ ] Create `lib/guest/reflective/env.sx` with the canonical wire shape and mutable defaults.
|
||||
- [ ] Migrate `lib/kernel/eval.sx` to use `refl-make-env` / `refl-extend-env` / `refl-env-*`. Rename `:knl-tag` → `:refl-tag` in env values only (operatives/applicatives keep their own tags for now).
|
||||
- [ ] All 322 Kernel tests must stay green.
|
||||
- [x] Create `lib/guest/reflective/env.sx` with the canonical wire shape and mutable defaults.
|
||||
- [x] Migrate `lib/kernel/eval.sx` to use `refl-make-env` / `refl-extend-env` / `refl-env-*`. Rename `:knl-tag` → `:refl-tag` in env values only (operatives/applicatives keep their own tags for now).
|
||||
- [x] All 322 Kernel tests stay green.
|
||||
|
||||
### Phase 2 — Tcl adapter
|
||||
### Phase 2 — Tcl adapter *[DONE 2026-05-12]*
|
||||
|
||||
- [ ] Add `tcl-frame-cfg` in `lib/tcl/runtime.sx`. Wire it through `frame-lookup` and `tcl-frame-nth` callers via `refl-env-lookup-with`. Keep Tcl's level/locals/parent shape unchanged.
|
||||
- [ ] Tcl test suite (must not regress).
|
||||
- [x] Add `tcl-frame-cfg` in `lib/tcl/runtime.sx`. `frame-lookup` and `frame-set-top` now delegate to `refl-env-lookup-or-nil-with` / `refl-env-bind!-with`. Tcl's `{:level :locals :parent}` shape unchanged.
|
||||
- [x] Tcl test suite green (427/427).
|
||||
|
||||
### Phase 3 — Documentation + cross-reference
|
||||
### Phase 3 — Documentation + cross-reference *[DONE 2026-05-12]*
|
||||
|
||||
- [ ] Update `plans/kernel-on-sx.md` to mark Phase 7's *env.sx* extraction as DONE (one of six). Keep the other five blocked.
|
||||
- [ ] Add `lib/guest/reflective/env.sx` header docstring listing both consumers and pointing at this plan.
|
||||
- [x] Update `plans/kernel-on-sx.md` to mark Phase 7's *env.sx* extraction as DONE (one of six). Other five blocked.
|
||||
- [x] `lib/guest/reflective/env.sx` header docstring already lists both consumers and links back to this plan.
|
||||
|
||||
### Phase 4 — Quick wins identified along the way
|
||||
|
||||
@@ -125,6 +125,18 @@ The extraction is real iff:
|
||||
2. The shared `env.sx` file is ≥80 LoC (substantial enough to be worth sharing) and ≤200 LoC (small enough that the cfg adapter pattern doesn't become its own framework).
|
||||
3. A third consumer in the future can adopt the kit by writing only the cfg dict — no algorithm changes to `env.sx`.
|
||||
|
||||
## Outcome (2026-05-12)
|
||||
|
||||
Three commits on `lib/tcl/uplevel`:
|
||||
|
||||
1. Plan committed.
|
||||
2. **`reflective: extract env.sx + migrate Kernel — 322 tests green`** — kit landed; Kernel's env block collapsed from ~30 lines to 6 thin wrappers (`kernel-env? = refl-env?` etc.). Envs now carry `:refl-tag :env`. All 7 Kernel suites unchanged.
|
||||
3. **`reflective: Tcl adapter cfg — second consumer wired, 427+322 tests green`** — `tcl-frame-cfg` defined, `frame-lookup`/`frame-set-top` delegate to the kit. Tcl's frame shape unchanged. Functional update preserved.
|
||||
|
||||
**File stats:** `lib/guest/reflective/env.sx` is 124 lines, 13 forms. Within the 80–200 LoC validation bound. Adapter-cfg pattern proven to bridge mutable-canonical (Kernel) and functional-frame (Tcl) wire shapes via a single ~7-line cfg dict per consumer.
|
||||
|
||||
**Third-consumer test:** any future guest can adopt the kit by writing its own cfg with five keys (`:bindings-of`, `:parent-of`, `:extend`, `:bind!`, `:env?`) — no changes to `env.sx`. The shape-divergence problem is solved by parameterisation, not by forcing both consumers onto one wire shape.
|
||||
|
||||
## References
|
||||
|
||||
- `plans/kernel-on-sx.md` — the kernel-on-sx loop's chisel notes; the six candidate API surfaces are documented there.
|
||||
|
||||
Reference in New Issue
Block a user