Skip to content

docs(adr): draft ADR-0008 — shell calls join the ^action model - #72

Merged
rsenna merged 3 commits into
mainfrom
adr-0008-shell-calls
Sep 12, 2026
Merged

rsenna merged 3 commits into
mainfrom
adr-0008-shell-calls

Conversation

@owkwo-bot

@owkwo-bot owkwo-bot commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Drafts ADR-0008, deciding the design note's §4.5 open question — your
pick, option (c) (immediate at the top level only) — by showing it isn't
actually a separate mechanism from option (b):

  • ADR-0006 already lists the top-level runner and do as effect
    boundaries where actions execute (its own §6 example runs echo/cp
    inside a do block with no explicit run). So "immediate at the top
    level" is what "boundary" already implies once you take that list
    literally — not a carve-out bolted onto "always ^action".
  • (vim start) builds an ^action ^t exactly like cp/echo — no
    separate immediate-exec primitive, matching LANGUAGE.md's own Phase 2
    roadmap ("port shell/file/network built-ins to return ^action ^t").
  • It runs wherever ADR-0006's boundaries already say any action runs: bare
    at the top-level runner, inside do, via run, via then, or boundary
    ;. Nowhere else.
  • Defines "top-level" precisely (the design note's own ask): the single
    expression submitted as one unit to the runner — not a do-body, not a
    function body, not an argument position.
  • Capturing the action via let/set suppresses auto-run even at the top
    level, per ADR-0006's own let :copy be cp "a" "b" example applied
    literally — not a new rule invented for shell calls.

Status: Proposed — acceptance = editing the Status line, same
convention as ADR-0006/0007.

Also updates design-note.md's remaining §2/§5/§6/§7 "ADR 4.5" / "ADR-0008
(planned)" placeholders to real links, and execution-queue.md's epic 007
criteria likewise.

With this, all three ADRs the epic 006 design note flagged (§4.1–4.3,
§4.4, §4.5) are drafted. Remaining on the epic 007 unblock path: the IK1
grammar ADR (fn/cond/repeat), then epic 008.

Summary by Sourcery

Adopt the existing ^action effect model for shell executable calls and document the decision in ADR-0008.

Enhancements:

  • Define shell executable calls as pure ^action ^t values that execute only at the existing effect boundaries, including the top-level runner, without a shell-specific immediate-execution exception.
  • Precisely define top-level evaluation and clarify that captured actions remain unexecuted, consistent with the existing effect model.

Documentation:

  • Add proposed ADR-0008 documenting the shell executable call effect model and its consequences.
  • Replace design-note and execution-queue placeholders with links to ADR-0008 and update the affected design classifications.

Summary by cubic

Drafts ADR-0008, resolving the design note's §4.5 open question: shell-mode executable calls like (vim start) build an ^action ^t exactly like cp/echo and run only at ADR-0006's existing effect boundaries, with no immediate-execution carve-out. Replaces the remaining "ADR 4.5" / "ADR-0008 (planned)" placeholders in design-note.md and execution-queue.md with links to the new ADR.

  • "Immediate at the top level" turns out to be what ADR-0006 already implies, since the top-level runner and do are already effect boundaries.
  • "Top-level" is now precisely defined as the single expression submitted to the runner, not a do body, function body, or argument position.
  • let capturing suppresses auto-run even at top level, per ADR-0006's existing example; set is not an action-capturing form and stays governed by ADR-0007's mutation classification.
  • design-note.md §6's (vim start) row now says construction is pure, matching its notes column; the ADR's follow-up no longer lists the execution-queue update as pending.
  • Status is Proposed; accepting the ADR means editing the Status line, not just merging.

Written for commit 597d948. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation
    • Documented shell executable calls as values that run only at established effect boundaries.
    • Clarified behavior for top-level execution, sequencing, run, do, then, let, and set.
    • Added examples, consequences, non-decisions, and follow-up implementation guidance.
    • Updated Epic 007 references to link to the relevant architecture decisions and reflect their finalized status.

Decides the design note's §4.5 open question (a/b/c) by dissolving the
apparent tension: ADR-0006 already lists the top-level runner and `do`
as effect boundaries where actions execute (its own §6 example runs
`echo`/`cp` inside a `do` block with no explicit `run`). So "immediate
at the top level" isn't a special case bolted onto "always ^action" --
it's what "boundary" already implies once you take ADR-0006's list
literally. This ADR gives shell calls zero carve-out:

- (vim start) builds an ^action ^t exactly like cp/echo -- no separate
  immediate-exec primitive, matching LANGUAGE.md's own Phase 2 roadmap.
- It runs wherever ADR-0006's boundaries already say any action runs:
  bare at the top-level runner, inside `do`, via `run`, via `then`, or
  boundary `;`. Nowhere else.
- Defines "top-level" precisely (the design note's own ask): the single
  expression submitted as one unit to the runner -- not a do-body, not
  a function body, not an argument position.
- Capturing the action via let/set suppresses auto-run even at the top
  level, per ADR-0006's own `let :copy be cp "a" "b"` example applied
  literally -- not a new rule for shell calls specifically.

Status: Proposed (acceptance = editing the Status line, same
convention as ADR-0006/0007). Updates design-note.md's remaining §2/§5/
§6/§7 "ADR 4.5"/"ADR-0008 (planned)" placeholders to real links, and
execution-queue.md's epic 007 criteria likewise.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012SbjL7643FUSoVuwCGtkJv
@sourcery-ai

sourcery-ai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Reviewer's Guide

This documentation-only PR drafts ADR-0008 and resolves shell executable semantics by making them ordinary ^action ^t values that execute only at ADR-0006's existing effect boundaries, while updating design-note references and epic 007 prerequisites.

File-Level Changes

Change Details Files
Adds ADR-0008 to standardize shell executable calls under the existing action/effect-boundary model.
  • Defines shell calls such as (vim start) as pure construction of ^action ^t, with process IO only on execution.
  • Reuses ADR-0006 boundaries: top-level runner, do, run, then, and boundary ;.
  • Precisely defines top-level submissions and clarifies that let/set capture suppresses automatic execution.
  • Documents non-decisions, consequences, and implementation follow-ups for epic 007.
specs/decisions/ADR-0008-shell-executable-calls.md
Updates the strictness/effects design note to reflect ADR-0008 as the resolution of shell-call semantics.
  • Reclassifies shell executable calls as pure-to-construct, effectful-to-run actions.
  • Replaces ADR 4.5/planned placeholders with a proposed ADR-0008 link.
  • Aligns examples, effect classifications, and epic dependencies with the no-carve-out decision.
specs/006-strictness-effects-spike/design-note.md
Links ADR-0008 into epic 007's execution prerequisites.
  • Replaces the planned ADR placeholder with a direct ADR-0008 reference in the epic criteria.
  • Keeps ADR acceptance as an explicit prerequisite for implementation.
specs/execution-queue.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2b8a8b60-4c96-4c65-9902-d73e02c144fa

📥 Commits

Reviewing files that changed from the base of the PR and between b3bca16 and 597d948.

📒 Files selected for processing (3)
  • specs/006-strictness-effects-spike/design-note.md
  • specs/decisions/ADR-0008-shell-executable-calls.md
  • specs/execution-queue.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull request defines shell executable calls as ^action ^t values. It documents execution at existing effect boundaries and updates the design note and Epic 007 criteria to reference ADR-0008.

Changes

Shell executable call effects

Layer / File(s) Summary
Action execution model
specs/decisions/ADR-0008-shell-executable-calls.md
Adds ADR-0008. It defines shell action construction, execution boundaries, let capture, set mutation, behavior outside boundaries, and Epic 007 follow-ups.
Design and Epic 007 alignment
specs/006-strictness-effects-spike/design-note.md, specs/execution-queue.md
Updates shell-call guidance to use the shared action model. Epic 007 now references ADR-0008 as an adopted decision document.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 597d9

The documentation changes are consistent and do not introduce a merge-blocking issue.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: drafting ADR-0008 to define shell calls within the ^action model. It is concise and specific.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch adr-0008-shell-calls

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="specs/006-strictness-effects-spike/design-note.md" line_range="196" />
<code_context>
 | `to adder :n do fn do :n + 1 end end` || pure (definition) | none | Yes — defines closure, no side effects. |
 | Graph `let ^bool :x be -true` | strict | effectful (mutation) | graph commit | Yes — modifies graph binding engine. |
-| `(vim start)` (shell) | strict | effectful | process IO | Effectful is settled; *when* it runs (immediately vs `^action` at a boundary) is **ADR 4.5**. |
+| `(vim start)` (shell) | strict | effectful | process IO | Yes — builds an `^action ^t`, runs at the same boundaries as any action (top-level runner, `do`, …), per [ADR-0008](../decisions/ADR-0008-shell-executable-calls.md). |
 | `` `[ a ~:b _:c d ] `` (syntax-quote) || pure (compile-time) | none | Yes — macro template, no runtime effect. |
 | `map %{ a->1, b->2 }` | strict | pure | none | Yes — literal constructor, pure per contract. |
</code_context>
<issue_to_address>
**issue:** The §6 verification table classifies `(vim start)` as `effectful`, while the new ADR and the preceding taxonomy state that constructing it is pure and only running its returned action is effectful. This contradiction can lead implementers to execute the shell command during expression construction instead of producing an unrun `^action` value.

**Suggested fix:** Change the table's purity entry to `pure (builds action)` and describe process IO as occurring only when the action reaches an effect boundary.

```suggestion
| `(vim start)` (shell) | strict | pure (builds action) | process IO only when the action reaches an effect boundary | Yes — builds an `^action ^t`, runs at the same boundaries as any action (top-level runner, `do`, …), per [ADR-0008](../decisions/ADR-0008-shell-executable-calls.md). |
```
</issue_to_address>

### Comment 2
<location path="specs/decisions/ADR-0008-shell-executable-calls.md" line_range="149-151" />
<code_context>
+- Epic 007 (IK1 core language) implements shell-mode form resolution
+  against this model: build an `^action ^t`, run only at the named
+  boundaries.
+- Update [`specs/execution-queue.md`](../execution-queue.md) epic 007 start
+  criteria to drop "ADR-0008 (planned)" in favor of a direct reference,
+  once accepted.
</code_context>
<issue_to_address>
**nitpick:** The ADR's Follow-ups says the execution queue still needs to be updated once ADR-0008 is accepted, but this diff has already changed that queue to the direct ADR link while the ADR remains Proposed. The follow-up is stale and leaves an already-completed documentation task appearing unfinished.

**Suggested fix:** Remove this follow-up, or change it to state that the execution-queue reference has already been updated and only the ADR Status line remains to be changed on acceptance.

```suggestion

```
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: specs/006-strictness-effects-spike/design-note.md:196


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread specs/006-strictness-effects-spike/design-note.md Outdated
Comment thread specs/decisions/ADR-0008-shell-executable-calls.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread specs/decisions/ADR-0008-shell-executable-calls.md Outdated
Comment thread specs/006-strictness-effects-spike/design-note.md Outdated
Comment thread specs/decisions/ADR-0008-shell-executable-calls.md Outdated
- design-note.md §6's (vim start) row still said Purity: effectful /
  Effect: process IO, contradicting the row's own Notes column (and
  ADR-0008) which say building the action is pure and only running it
  performs IO. Fixed to `pure (builds action)` / `process IO only when
  the action reaches an effect boundary`, matching sourcery's suggestion
  and the §2 row already updated correctly in this same PR.
- ADR-0008's Follow-ups told the reader to update execution-queue.md
  "once accepted", but that update already happened in this PR's own
  diff -- a completed task described as pending. Reworded to say so
  directly; only the Status line itself remains for acceptance.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012SbjL7643FUSoVuwCGtkJv

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

§3 grouped `set` with `let` as an action-capturing form that "suppresses
auto-run," but ADR-0007 (decided alongside this one) classifies `set`
as an immediate evaluation-time mutation effect, explicitly exempt from
the ^action pattern with no build-then-run split at all. ADR-0006's
only worked example (let :copy be cp "a" "b") is let-only, so claiming
the suppression mechanism extends to set adds something the ADRs don't
actually establish and contradicts ADR-0007's own framing.

Rescoped §3 to let (the actual evidence) and added a note that set's
effect status comes entirely from ADR-0007's mutation classification,
independent of whatever its RHS evaluates to -- not a parallel
capturing mechanism.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012SbjL7643FUSoVuwCGtkJv
@sonarqubecloud

Copy link
Copy Markdown

@rsenna
rsenna merged commit 2448f3f into main Sep 12, 2026
6 of 7 checks passed
@rsenna
rsenna deleted the adr-0008-shell-calls branch September 12, 2026 00:53
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