Skip to content

WIP: 1.5.0 row 8 — evaluation & write-back (WP-7) - #1890

Merged
caomengxuan666 merged 3 commits into
masterfrom
feat150/eval-writeback
Oct 27, 2026
Merged

caomengxuan666 merged 3 commits into
masterfrom
feat150/eval-writeback

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

PLAN row 8 (WP-7) on master f8988042. Draft until the row-8 gates close; do not merge.

Deliveries

  1. Evaluation checker, single owner — src/debugger/evaluation.rs: fragment parsed by the engine's own parser; command-level AST answers structure; word-level expansion spans classified with the parser's own matched-pair discipline (skip_nested_expansion) and the parser's own arithmetic operator scan (lifted to pub(crate), no second rule set anywhere). The parser probe behind this: per-word expansion inventories are deliberately empty for ordinary words in this engine — the checker works at the two levels the engine itself decomposes at (details in the cluster REPORT).
  2. Power rules as code — explicit = full power; implicit = whitelist only (check_implicit), rejections delivered as §6.3-shaped diagnostics (skipped and marked, never executed; exact message pinned).
  3. evaluate / print paths — StopLoopOutcome::Evaluate channel: the stop loop asks, the executor executes in the stopped frame and installs the outcome on the session, then re-serves the same stop. Single-expansion words expand via the engine's expand_word_mut (the entry command preparation uses, := -pre-scan included); dynamic faces read through the engine's own dynamic getters (the row-6 views' sources).
  4. Write-back only through the real assignment path (§7.6) — assignment text executes through execute_ast under the funnel guard; no debugger-private write channel. Readonly refusal and PIPESTATUS transience pinned as the real path answers them.
  5. Companion item (row-6 REPORT §5 note 1) — $BASH_COMMAND refreshes to the seam's frozen command text for the consult window (design §7.3 ordering) and is restored on every exit; act2's pin updated to the aligned value.

Gate evidence (local)

Cluster REPORT: ~/workspace/rubash-150/clusters/150-row8/REPORT.md (per-item ledger, whitelist↔pin table, residuals).

…list, serve-loop channel

PLAN row 8 (WP-7), on master f898804:

- src/debugger/evaluation.rs: the single owner of the evaluation
  power rules (design 5.3/7.4/7.5/7.6). Explicit = full power;
  implicit = AST whitelist only (check_implicit), rejections as
  section 6.3 diagnostics. Word-level classification walks
  expansion spans with the parser's own matched-pair discipline
  and the parser's own arithmetic operator scan.
- StopLoopOutcome::Evaluate channel: the stop loop asks, the
  executor executes in the stopped frame and installs the
  EvaluationOutcome on the session; the stop is re-served.
- Executor paths in trap_exec: single-expansion words go through
  the engine's own expand_word; command text executes through
  execute_ast under the funnel guard — write-back is the real
  assignment machinery, no debugger-private write channel.
- Consult window: $BASH_COMMAND refreshes to the seam's frozen
  command text before the consult (design 7.3 ordering; closes
  150-views REPORT section 5 note 1's one-command lag) and is
  restored on every exit.
- Parser: arithmetic_operators / is_arithmetic_assignment_operator
  lifted to pub(crate) for the checker's reuse.

Tests (scenario-7 battery) follow in the next commit.
- evaluation_tests: the whitelist/rejection correspondence
  pinned one form at a time (every design 7.5 allowed form
  admitted, every rejected form refused with its class and the
  section 6.3 diagnostic shape); the section 8 scenario 7
  fixture end to end — implicit reads of the stopped frame
  (scalar/array/assoc/local/$1/$?/PIPESTATUS), rejected forms
  provably never execute (the := target still reads its old
  value next; the comsub's marker file never appears), explicit
  full power (comsub executes, := lands), write-back through
  the real assignment path (scalar/array element/local/set --
  visible to the debuggee's own next command; readonly refused
  with status 1; PIPESTATUS assignment transient as in GNU),
  frame addressing, parse failure as a Parse diagnostic; the
  extglob pathname class refused at a stop in an
  extglob-enabled debuggee.
- Evaluation expands through expand_word_mut (the entry command
  preparation uses): its := pre-scan is what makes an explicit
  ${x:=y} write land, exactly as in a real command word.
- consumer_tests act2: $BASH_COMMAND at the pipeline stop now
  pins the aligned value — the stop's own frozen command text
  (WP-7 consult refresh), replacing the lagging-read pin.
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 27, 2026 20:22
@caomengxuan666
caomengxuan666 merged commit 54df3f8 into master Oct 27, 2026
8 of 9 checks passed
@caomengxuan666
caomengxuan666 deleted the feat150/eval-writeback branch October 30, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant