Skip to content

fix(examples): let hello.affine use the builtin println so just jaffa hello runs - #80

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/fix-hello-example
Oct 9, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/fix-hello-example

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

This makes just jaffa hello run. On main (16fb94a) it fails with Runtime error: Unhandled effect: println, and so do bin/jaffa eval examples/hello.affine and the README's eval example.

The cause is in the example, not in affinescript. examples/hello.affine declared its own effect:

effect IO {
  fn println(s: String) -> ();
}

AffineScript already has a builtin println, typed String -{IO}-> () (affinescript lib/typecheck.ml:1824). The declaration shadows that builtin with an effect operation. eval then performs the operation, finds no handler, and stops. The exit code 124 is affinescript's own error code. It is not a timeout: the run takes under a second, and a "Module not found" error returns 124 as well.

I had earlier reported this as an affinescript 0.1.1 interpreter bug (in #79's Testing table and in my report to the owner). That was wrong.

Changes

  • examples/hello.affine: the effect IO { … } block is removed. A short comment explains why it must not come back. main keeps its -{IO}-> annotation, which now names the builtin's effect.
  • README.adoc "Hello" section: its copy of the example gets the same change, so the README shows the source that runs.

Not changed

  • The example's comment says it exercises let and ===, which it does not use. That was true before this PR too; making the example match the comment is a separate change.
  • docs/AFFIRMATION.adoc and docs/affirmations/AFFIRMATION-2026-10-07.adoc. The 10-07 affirmation (line 178) records that the README's eval example fails. Once this merges, that describes the repo as it was when signed. Agents do not edit signed affirmations; re-affirming is the owner's decision.
  • The upstream affinescript examples (examples/hello.affine, examples/faces/hello-jaffa.affine) fail the same way, and hello-jaffa.affine also fails with Module 'io' not found. affinescript is not changed here; the finding is logged for its owner.
  • eval prints the string with its quotes ("Hello, JaffaScript!"). That is how the interpreter displays the value, not something this repo controls.

📌 New pins

  • Head SHA: 4d5c674e2d153fc54b8bd992c052da3f3e50a4d3
  • None. No action uses:, actions.lock, lockfile or container digest is added or changed.

RSR Quality Checklist

Required

  • Tests pass: there is no test suite for examples. Each recipe was run on the new file (see Testing).
  • Code is formatted: no AffineScript formatter gate here. affinescript lint --face jaffa reports No issues found.
  • Linter is clean: affinescript lint as above, and asciidoctor --failure-level=WARN passes on README.adoc.
  • No banned language patterns: nothing added.
  • No unsafe blocks: n/a, no Rust changed.
  • No banned functions: n/a, no proofs changed.
  • SPDX license headers present: examples/hello.affine keeps its MPL-2.0 header; README.adoc keeps its header.
  • No secrets, credentials, or .env files.

As Applicable

  • .machine_readable/*.a2ml: no. A2ML is retired.
  • Documentation updated: README.adoc's copy of the example.
  • TOPOLOGY.md: n/a.
  • CHANGELOG: not updated; this is an example fix.
  • New dependencies: none.
  • ABI/FFI: n/a.

Testing

All runs used just 1.56.0 and affinescript 0.1.1, in this branch's worktree at 4d5c674.

Command main 16fb94a This head
just jaffa hello rc 124, Unhandled effect: println rc 0, prints "Hello, JaffaScript!"
just jaffa run examples/hello.affine rc 124, same error rc 0
just jaffa check examples/hello.affine rc 0 rc 0, Type checking passed
just jaffa build examples/hello.affine <tmp>/hello.wasm not run rc 0, a 315-byte WASM module
just jaffa preview examples/hello.affine not run rc 0, prints the canonical lowering (fn main, let greeting)
just jaffa lint examples/hello.affine not run rc 0, No issues found
./bin/jaffa eval / check / compile on the example eval rc 124 all rc 0
The README's [source,affine] block, extracted and run with eval rc 124 rc 0
  • Control: the original file, kept as a copy outside the repo, still fails with Unhandled effect: println (rc 124) under the same binary. So the pass above comes from the change, not from the environment.
  • Docstrings: no functions are added or changed.

Red checks on this head

To be filled in once CI has run on this head.

Screenshots

n/a, no UI change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GpUzjdhWFi26k6s7AWxYcf

…a hello` runs

The example declared its own `effect IO { fn println(s: String) -> (); }`.
That declaration shadows AffineScript's builtin `println`, which already
carries the `IO` effect. `eval` then performs the declared effect, finds no
handler, and stops with "Runtime error: Unhandled effect: println" (exit 124,
affinescript's own error code; it is not a timeout).

Dropping the declaration makes check, eval, compile, preview-js and lint all
pass under affinescript 0.1.1, through `just jaffa …` and `bin/jaffa`. The
README's copy of the example gets the same change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GpUzjdhWFi26k6s7AWxYcf
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c7eee8fe-e196-4913-bccd-a6cd3fba4335
📥 Commits

Reviewing files that changed from the base of the PR and between 16fb94a and 4d5c674.

📒 Files selected for processing (2)
  • README.adoc
  • examples/hello.affine
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 53 issues detected

Severity Count
🔴 Critical 6
🟠 High 20
🟡 Medium 27

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Job `triage` in label-triage.yml has no `timeout-minutes:` declaration. Default is 6 hours — a stuck codeload fetch or runner hang can burn budget. Add `timeout-minutes: 10` (or proportional).",
    "type": "missing_timeout_minutes",
    "file": ".github/workflows/label-triage.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium",
    "recipe_id": "recipe-add-workflow-timeout-minutes",
    "job": "triage"
  },
  {
    "reason": "Job `sync` in labels.yml has no `timeout-minutes:` declaration. Default is 6 hours — a stuck codeload fetch or runner hang can burn budget. Add `timeout-minutes: 10` (or proportional).",
    "type": "missing_timeout_minutes",
    "file": ".github/workflows/labels.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium",
    "recipe_id": "recipe-add-workflow-timeout-minutes",
    "job": "sync"
  },
  {
    "line": 38,
    "reason": "job in .github/workflows/labels.yml references `secrets.*` but does not install `step-security/harden-runner` — review outbound-egress monitoring",
    "type": "RE001",
    "file": ".github/workflows/labels.yml",
    "action": "report",
    "rule_module": "research_extensions",
    "severity": "medium"
  },
  {
    "line": 44,
    "reason": "job in .github/workflows/push-email-notify.yml references `secrets.*` but does not install `step-security/harden-runner` — review outbound-egress monitoring",
    "type": "RE001",
    "file": ".github/workflows/push-email-notify.yml",
    "action": "report",
    "rule_module": "research_extensions",
    "severity": "medium"
  },
  {
    "line": 82,
    "reason": "job in .github/workflows/hypatia-scan.yml references `secrets.*` but does not install `step-security/harden-runner` — review outbound-egress monitoring",
    "type": "RE001",
    "file": ".github/workflows/hypatia-scan.yml",
    "action": "report",
    "rule_module": "research_extensions",
    "severity": "medium"
  },
  {
    "line": 52,
    "reason": "job in .github/workflows/label-triage.yml references `secrets.*` but does not install `step-security/harden-runner` — review outbound-egress monitoring",
    "type": "RE001",
    "file": ".github/workflows/label-triage.yml",
    "action": "report",
    "rule_module": "research_extensions",
    "severity": "medium"
  },
  {
    "line": 33,
    "reason": "workflow .github/workflows/labels.yml:33 job `sync` has no `timeout-minutes:` — defaults to 360 min on hang",
    "type": "WH006",
    "file": ".github/workflows/labels.yml",
    "action": "report",
    "rule_module": "workflow_hardening",
    "severity": "medium"
  },
  {
    "line": 47,
    "reason": "workflow .github/workflows/label-triage.yml:47 job `triage` has no `timeout-minutes:` — defaults to 360 min on hang",
    "type": "WH006",
    "file": ".github/workflows/label-triage.yml",
    "action": "report",
    "rule_module": "workflow_hardening",
    "severity": "medium"
  },
  {
    "line": null,
    "reason": "workflow .github/workflows/hypatia-scan.yml uploads SARIF to code scanning but masks the scanner's failure (`|| true` / `|| echo 0`) and never asserts the findings artefact is a non-empty array. When the scanner fails, this uploads a SARIF with zero results, and GitHub AUTO-CLOSES every previously-open alert for that category — silently, with the job green.",
    "type": "WH014",
    "file": ".github/workflows/hypatia-scan.yml",
    "action": "report",
    "rule_module": "workflow_hardening",
    "severity": "high"
  },
  {
    "reason": "Code scanning (Hypatia): hypatia/workflow_audit/missing_timeout_minutes -- Hypatia workflow_audit: missing_timeout_minutes -- 7 day(s) old",
    "type": "CSA001",
    "file": ".github/workflows/labels.yml",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath merged commit 290979c into main Oct 9, 2026
29 checks passed
@hyperpolymath
hyperpolymath deleted the claude/fix-hello-example branch October 9, 2026 02:03
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