Repository navigation
Description
Summary
Add missing coverage that scope / async scope forms are available in no-runtime/no-std contexts according to the §14.9 rule boundaries. Existing tests cover scoped tasks and OS-thread scopes, but not the negative/positive no-runtime split. This prevents regressions where scope syntax becomes accidentally tied to the fiber runtime.
Spec
§14.9 says scope supports inline, colon, and braced body forms and is available in no-runtime contexts where the body does not require fibers. Async scopes, by contrast, require the fiber runtime because cleanup awaits tracked tasks.
Current state
Sema handles sync scope and async async scope separately. Async scope requires the runtime (src/SemaCheck.w:3298 from the require_async_runtime call family), while ordinary scope has worker capture and escape checks around the sync-scope path (src/SemaCheck.w:3340). Existing tests cover block forms and scoped task tracking (test/behavior/behav_scope_block_forms.w, test/spec/spec_ss14_8_scoped_task_tracking.w), but not no-runtime scope availability.
Implementation plan
- Add a no-runtime positive test for ordinary
scopewith inline, colon, and braced bodies that uses only core operations. - Add a no-runtime negative test for
async scope, expectingasync scope requires the fiber runtime. - Ensure the positive test runs with
//! args: --no-runtimeor the existing harness directive form. If no_std is part of the requirement, include--no-stdplus required panic/entry boilerplate. - Keep OS-thread
s.spawnout of the no-runtime positive unless §14 says OS threads are available for that target; this issue is about scope syntax/body forms, not thread spawn.
Test plan
Add:
test/spec/spec_ss14_9_scope_no_runtime.wwith//! args: --no-runtimeand ordinary scope forms;test/compile_errors/err_async_scope_no_runtime.wwith//! expect-error: async scope requires the fiber runtime.
Run existing scope tests as regression coverage.
Acceptance criteria
- Ordinary scope body forms are tested under no-runtime where valid.
- Async scope remains rejected without the fiber runtime.
- Tests clarify the boundary between lexical scope and async structured concurrency.
with build && with build :fixpoint && with build :testpass.
Dependencies
None.
Traceability
From the requirements campaign (docs/requirements.md, spec v7.1). Affected requirement IDs: 14.9.1.23.
Activity
ehartford commentedon Jul 3, 2026
Closing — ordinary scope under --no-runtime (spec_ss14_9_scope_no_runtime) + async scope rejected under --no-runtime (err_async_scope_no_runtime), pinned 13f4f88. §14.9.
test: coverage-sweep batch 4 (#497 #504 #506 #524 #525 #531 #534)