Browse Source

G-007 achieved: interactive acceptance verified on tcl 8.6 and tcl 9

Flip G-007 (location-transparent punk::console) to achieved 2026-07-05 in the
GOALS.md index and detail file. Interactive verification on built punksys
(tcl 8.6) and punk902z (tcl 9) kits (punk::console 0.7.0, opunk::console
0.4.0; punk902z also rerun via src launch against dev modules): fact parity
and immediate cross-context visibility in both directions; brokered terminal
queries from the code interp succeed and cooperate with the repl reader in
raw mode with typed-ahead preserved; a chan-pipe console anchored from the
code interp registers its codethread as owner, operates locally, and clears
its registry entry on forget.

Detail-file Notes record the verification and characterize line-mode reader
cooperation (out of scope, no routing regression - brokered and owner-side
queries behave identically): on tcl 9, complete typed-ahead lines survive
with cosmetic garbling while incomplete typed-ahead starves the query raw
window and leaks responses as phantom input; on tcl 8.6 every line-mode
query fails that way, owner-side included (repro:
repl eval {punk::console::get_cursor_pos}) - candidate owner-side regression
to investigate separately. Also noted: the leaked stderr diagnostics are the
traffic G-011's per-console err channel would house.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
0d4d5aa036
  1. 2
      GOALS.md
  2. 38
      goals/G-007-console-location-transparency.md

2
GOALS.md

@ -86,7 +86,7 @@ Detail: goals/G-006-prebuilt-artifact-download.md
Goal: pre-built binary artifacts can be downloaded from a separate related binary-artifacts repository or user-configured sources, gated by explicit user consent/configuration by default.
Acceptance: a download mechanism fetches binary artifacts (the same set the zig build produces) from a configured source on demand; by default the download is gated behind explicit user consent (a config flag or interactive prompt) and does not occur silently; a user-configured source URL overrides the default binary-artifacts repo; downloaded artifacts satisfy the same build requirements as zig-built artifacts so `tclsh src/make.tcl project` succeeds with downloaded artifacts in place of built ones.
### G-007 [active] Location-transparent punk::console across repl and code interps
### G-007 [achieved 2026-07-05] Location-transparent punk::console across repl and code interps
Scope: src/modules/punk/console-999999.0a1.0.tm, src/modules/punk/repl-999999.0a1.0.tm, src/modules/punk/repl/codethread-999999.0a1.0.tm
Detail: goals/G-007-console-location-transparency.md
Goal: punk::console presents one API in every interp/thread of a punk session - code-interp callers see the same console facts and can perform the same queries/operations as the parent, routed to the console-owning context via a punk-side ownership registry, with no `repl eval` required.

38
goals/G-007-console-location-transparency.md

@ -1,6 +1,6 @@
# G-007 Location-transparent punk::console across repl and code interps
Status: active
Status: achieved 2026-07-05
Scope: src/modules/punk/console-999999.0a1.0.tm, src/modules/punk/repl-999999.0a1.0.tm, src/modules/punk/repl/codethread-999999.0a1.0.tm
Acceptance: from a running punk session's code interp, without `repl eval`: `console_fact_get` returns the same values the parent sees and a fact set in the parent is immediately visible; a terminal query (e.g. `get_cursor_pos` or `dec_get_mode`) against the default console succeeds and cooperates with the repl reader (no lost or garbled input); a console constructed and owned by code-interp code is operated on locally (no round-trip to the parent); the existing console test suites pass and single-interp (non-repl) usage is unchanged.
@ -91,6 +91,16 @@ already lives in tsv because it must be visible to all threads.
## Notes
- **Acceptance verified interactively 2026-07-05** on punksys (tcl 8.6) and punk902z (tcl 9),
built kits (punk::console 0.7.0, opunk::console 0.4.0; punk902z also rerun against dev
modules via `src` launch): fact parity and immediate cross-context visibility in both
directions; brokered terminal queries (get_cursor_pos, dec_get_mode) from the code interp
succeed and cooperate with the repl reader in raw mode with typed-ahead input preserved
intact; a chan-pipe console anchored from the code interp registers its anchoring codethread
as owner, routes nowhere (local operation), and clears its registry entry on forget. Test
suites had already passed non-interactively (ownerrouting.test et al, baseline exec-14.3
only).
- **Not blocked by G-002** - deliberately sequenced before it. A v1 with a single fixed owner
(the repl thread) is definable now and is the mechanism G-002's "target a named console"
criterion generalises to multiple owners. Deferred to G-002: multi-owner topology,
@ -104,3 +114,29 @@ already lives in tsv because it must be visible to all threads.
preserve that property (or use async+vwait) when generalising.
- The choke points listed in Context are the intended shim set; anything routed above them
(the ~60 public procs) inherits brokering for free.
- **Line-mode reader cooperation - characterized interactively (punk902z tcl9 + punksys tcl8.6,
2026-07-05), no routing regression.** Brokered (code-interp) and owner-side (`repl eval`)
queries behave identically in line mode on both runtimes, satisfying the location-transparency
intent; the limitations below are properties of line mode's interaction with the query
raw-window cycling (the `#review`-flagged line-mode `input_chunks_waiting` path in
punk::repl), not artifacts of G-007 brokering, and are out of scope here:
- *Complete* typed-ahead lines survive: consumed during the raw window, stashed to
`input_chunks_waiting`, recovered and executed after the loop via the line-mode
waiting-chunks path (accompanied by the red "chan blocked is true" diagnostic and echo
interleaving - cosmetic only, no loss).
- *Incomplete* typed-ahead (characters pending without Enter) breaks the query cycle: the
in-flight cooked-mode read starves the raw-window response read (per-query timeouts,
~560ms), and the responses later echo outside any read window and are submitted to the
line parser as phantom input (e.g. `invalid command name 60`).
- On tcl 8.6 (punksys) line mode is worse: *every* query - owner-side included, no routing
involved (`repl eval {punk::console::get_cursor_pos}` reproduces it) - times out (~500ms)
with the response leaking to the reader and being parsed as input. Raw mode works cleanly
on both runtimes, brokered and owner-side. The user recalls 8.6 line-mode queries working
previously - candidate owner-side regression somewhere in the punk::console 0.2.0-0.7.0
migration or repl reader changes; to be investigated as separate work (also suspected
behind increased ANSI artifacts in `help env` output on 8.6).
- Raw mode (the repl's own editor) cooperates cleanly in both directions - queries succeed
and typed-ahead is preserved intact. Line mode is today's default (raw is the intended
future default); fixing line-mode query cooperation would be its own goal.
Related: both diagnostics observed (the query-timeout stderr message, the "chan blocked"
notice) are the kind of raw diagnostic traffic G-011 gives a defined per-console home.

Loading…
Cancel
Save