diff --git a/GOALS.md b/GOALS.md index 3fbe3f5d..86442f38 100644 --- a/GOALS.md +++ b/GOALS.md @@ -377,3 +377,7 @@ Detail: goals/G-104-maketcl-buildsuite-surface.md ### G-105 [proposed] buildsuite cross-target builds (zig -target): linux first, WSL-verified Scope: src/buildsuites/suite_tcl90/ (target parameterization of recipe + driver; per-target out prefixes), src/buildsuites/ (layout/naming decision: target is an INVOCATION DIMENSION, suite folders stay version-named - no per-target tree copies), bin/runtime platform-dir naming alignment (punkshell's win32-x86_64-style names vs zig triples), punkbin per-target artifact layout (with G-103 metadata carrying the target), local WSL as the first cross-verification environment Detail: goals/G-105-buildsuite-cross-target.md + +### G-106 [proposed] powershell console-mode fallback: maintained raw-mode path for twapi-less runtimes +Scope: src/modules/punk/console-999999.0a1.0.tm (enableRaw_powershell/disableRaw_powershell + the persistent server lifecycle), scriptlib/utils/pwsh/ (consolemode_server_async.ps1 canonical + experiment-variant reconciliation), ps-script resolution/packaging across launch contexts (argv0-derived pstooldir; kits via the G-089 scriptlib-in-kits interplay), src/make.tcl shell (the verified launch context) +Detail: goals/G-106-powershell-consolemode-fallback.md diff --git a/goals/G-096-zig-buildsuite-piperepl.md b/goals/G-096-zig-buildsuite-piperepl.md index ff89b766..a1ba43ee 100644 --- a/goals/G-096-zig-buildsuite-piperepl.md +++ b/goals/G-096-zig-buildsuite-piperepl.md @@ -298,10 +298,14 @@ Remaining for acceptance: - DONE 2026-07-20 (see the Progress increment): piperepl rebase + variant builds + behaviour matrix. (Acceptance/Goal wording was first aligned to the G-103 kit-default policy at user request - the pre-G-103 text described the 2024 - opt-in gating.) Residual user-level check: a true interactive-typing session - on tclsh90spr (tty launch behaves as the normal repl; TCLSH_PIPEREPL=0 - likewise) - the automated matrix covers the piped/script-arg forms and the - console-reopen landing, not keystroke-driven use. + opt-in gating.) Residual user-level check DONE (user 2026-07-20): true + interactive sessions on tclsh90spr behave normally both with + TCLSH_PIPEREPL=0 and without. The user additionally exercised punk on the + bare pr shell (tcl::tm::add repo modules; package require repl; repl::init; + repl::start stdin - basic punk features functional; raw mode is + twapi-reliant), and via './tclsh90spr src/make.tcl shell' the powershell + console-mode fallback engaged and raw mode worked (noise/early-shutdown + roughness aside) - fallback maintenance now tracked as G-106. - Final clean-checkout re-verification of the whole flow once the above land. ### 2026-07-20 increment: piperepl rebased, gate flipped to G-103 policy, variants built + matrix PASS diff --git a/goals/G-103-runtime-kit-family.md b/goals/G-103-runtime-kit-family.md index a0081e31..458086c0 100644 --- a/goals/G-103-runtime-kit-family.md +++ b/goals/G-103-runtime-kit-family.md @@ -29,7 +29,10 @@ third-party binaries. Tk is built today; sqlite3 is a straightforward future bui (amalgamation compiles cleanly under zig cc); tdom moderate; twapi historically MSVC-leaning - its buildability under the zig-only policy needs investigation before it can join a bi kit (until then twapi remains a kit-vfs vendored payload as in -punk9wintk903.vfs, outside this family's attached-zip guarantee). +punk9wintk903.vfs, outside this family's attached-zip guarantee). The no-twapi +mitigation for raw-mode console control is the powershell console-mode fallback - +maintenance tracked as G-106, whose priority rises if zig-built twapi proves +impractical. Metadata format note: toml is acceptable HERE (runtime list/use run in punkshell contexts where vendored tomlish exists) - the 2026-07-20 toml drop applies to diff --git a/goals/G-106-powershell-consolemode-fallback.md b/goals/G-106-powershell-consolemode-fallback.md new file mode 100644 index 00000000..6beab85c --- /dev/null +++ b/goals/G-106-powershell-consolemode-fallback.md @@ -0,0 +1,46 @@ +# G-106 powershell console-mode fallback: maintained raw-mode path for twapi-less runtimes + +Status: proposed +Scope: src/modules/punk/console-999999.0a1.0.tm (enableRaw_powershell/disableRaw_powershell + the persistent server lifecycle), scriptlib/utils/pwsh/ (consolemode_server_async.ps1 canonical + experiment-variant reconciliation), ps-script resolution/packaging across launch contexts (argv0-derived pstooldir; kits via the G-089 scriptlib-in-kits interplay), src/make.tcl shell (the verified launch context) +Goal: the powershell console-mode fallback - a persistent pwsh/powershell named-pipe server driven by punk::console when twapi is absent - is a MAINTAINED, dependable raw-mode path for twapi-less runtimes (the suite-built shells and kits, until/unless zig-built twapi lands): quiet in normal operation, reliable across the session lifecycle, and resolvable from every supported launch shape rather than only argv0-relative luck. +Acceptance: on a twapi-less suite runtime, raw enable/disable work via the fallback from (a) the make.tcl shell launch and (b) a kit / plain-tclsh repl launch, with no stderr noise in normal operation; the server lifecycle is verified - starts once per session, stays up for the session's raw transitions (the 2026-07-20 observed early-shutdown mode diagnosed and fixed), and shuts down with the session leaving no orphan pwsh processes; ps-script resolution no longer depends solely on argv0 parent-dir derivation (works from kits and unusual cwds, with the fallback-to-pwd branch replaced by something principled); scriptlib/utils/pwsh is reconciled to one canonical server script with the experiment variants retired or explicitly labelled; the fallback's role as the no-twapi contingency is documented where G-103's twapi investigation will find it, and a repeatable verification recipe is recorded in this file. + +## Context + +User verification 2026-07-20 on the freshly built tclsh90spr (G-096 piperepl +variant): with `tcl::tm::add .../modules` + `package require repl; repl::init; +repl::start stdin`, basic punk features are functional on the bare suite runtime - +except raw mode, which is twapi-reliant. Launched instead via +`./tclsh90spr .../src/make.tcl shell`, the powershell fallback engaged and raw mode +WORKED - modulo consolemode_server_async.ps1 noise and an early server shutdown. +That working-but-rough state is what this goal hardens. User direction: "we would +like to look at maintaining this powershell fallback - especially if we can't get +zig-based twapi builds going." + +Mechanism today (punk::console): when twapi is absent, enableRaw/disableRaw are +aliased to *_powershell variants that talk over a named pipe to a persistent +`consolemode_server_async.ps1` process (templated per-console id; pwsh.exe probed +first, then powershell.exe). Known weak points at goal creation: + +- Resolution: pstooldir = argv0's grandparent + /scriptlib/utils/pwsh, else [pwd] - + works for `make.tcl shell` (argv0 = src/make.tcl -> repo root) and little else by + construction. Kits need the script carried/resolved properly (G-089 scriptlib in + kits). +- Lifecycle: observed early shutdown of the server mid-session; startup noise on + stderr ("twapi not present, using persistent powershell process: ..." plus ps1 + output). +- Hygiene: scriptlib/utils/pwsh holds several sibling experiments + (consolemode_server.ps1, *_async1.ps1, *_async.2ps1, consolemode.ps1, + consolemode_enableraw.ps1) with no marking of which is canonical. + +Relationships: G-103 (bi-kit twapi under the zig-only policy is +needs-investigation - THIS fallback is the mitigation; if zig-built twapi proves +impractical the fallback becomes the primary raw path on suite runtimes and this +goal's priority rises), G-013 (raw mode as the repl default ultimately requires raw +mode to be dependable on twapi-less runtimes), G-089 (scriptlib in kits - the +delivery vehicle for the ps script), G-061-era console-context findings (agent +console-context traps around attached consoles apply to verifying this). + +## Notes + +(none yet)