Skip to content

docs(tasks): split 0038 lexical scoping into 0165-0167, file 0168/0169, add the approved plan - #491

Merged
rmorozov merged 1 commit into
masterfrom
claude/project-thread-qo6mj7
Oct 12, 2026
Merged

rmorozov merged 1 commit into
masterfrom
claude/project-thread-qo6mj7

Conversation

@rmorozov

Copy link
Copy Markdown
Member

Requested by Ruslan · project thread

Before: 0038 (lexical scoping for macros) was one open task with no plan. Its six divergence lines named 0038, and the task's touches held render_context.h and the macro code in every task_batches.py wave.

After: the plan Ruslan approved is in docs/design/0038-lexical-scoping-plan.md, with its advisor review next to it. 0038 is now an umbrella task over three phase tasks, each owning the divergence lines it removes:

  • 0165: macro and call bodies, loop() and super() run where they were defined. It owns 5 lines and can run in wave 2.
  • 0166: defaults are evaluated per call. It owns macro_default_reassigned_global.
  • 0167: imported modules own their context. The render owns each module and exports hold weak anchors, so no cycles form and no sweep is needed. It depends on 0155.

Two out-of-scope findings are filed and pinned with new corpus cases:

  • 0168: Jinja2's idtracking binds a name at frame entry. The new case is statements.idtracking_inner_read_before_outer_set: Python renders '', we render 33.
  • 0169: caller() without a call block should raise "No caller defined". The new cases are errors.caller_without_call_block and errors.call_body_reads_own_missing_caller.

How: this PR adds task files and corpus rows only, with no src/ changes. expected/*.json was regenerated with jinja2 3.1.6. I left out an unrelated operators.json message change that comes from the local Python version. ctest -R parity passes locally (2941 tests). docs/tasks/README.md is not edited; the steward runs task_index.py.

Roles: architect (plan), advisor (review). Verifier not run because there is no code change. Pushes red in CI: none so far.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Krh9zQy8ifSut6nW1jwRZf


Generated by Claude Code

…ved plan

The approved lexical-scoping plan and its advisor review go to docs/design/.
0038 becomes the umbrella: 0165 (bodies run where defined), 0166 (defaults
per call), 0167 (modules own their context). Its divergence lines now name
the phase that removes them. 0168 (idtracking frame-entry binding) and 0169
(caller() without a call block) are pinned with new corpus cases.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Krh9zQy8ifSut6nW1jwRZf
@rmorozov rmorozov self-assigned this Oct 12, 2026
@rmorozov
rmorozov merged commit d8b1bd0 into master Oct 12, 2026
37 of 38 checks passed
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.

2 participants