Skip to content

Conversation

@mengwong
Copy link
Contributor

Summary

Changes the decision service to expose all functions from L4 files, not just those with explicit @export markers. This aligns the decision service behavior with the core library.

Motivation

Previously, the decision service required explicit @export annotations to expose functions via the REST API. This was inconsistent with the core library (L4.Export), which exposes the topmost function as default when no @export markers are present.

This created a barrier for users getting started with L4 - they had to learn about @export annotations before their functions would be accessible through the API.

Changes

  • Removed explicitExportsOnly filter in jl4-decision-service/src/Examples.hs
  • Now uses getExportedFunctions directly from L4.Export
  • Inherits core library behavior:
    • When no @export markers exist: exposes topmost function as default
    • When @export markers exist but no default: marks topmost as default
    • When explicit default exists: uses as-is
  • Cleaned up unused imports (L4.Annotation, DescFlags, ParsedDesc)

Behavior

Before:

GIVEN x IS A NUMBER
GIVETH A NUMBER
DECIDE square x IS x * x

Result: No functions exposed via API ❌

After:

GIVEN x IS A NUMBER
GIVETH A NUMBER
DECIDE square x IS x * x

Result: square exposed as default function ✅

Testing

  • Builds successfully (cabal build jl4-decision-service)
  • Verified via REPL that functions are recognized
  • Tested with L4 file containing no @export markers

Impact

  • Makes L4 programs more accessible for beginners
  • Reduces boilerplate for simple programs
  • Maintains backward compatibility (programs with @export work as before)

…port

Previously, the decision service required explicit @export markers to
expose functions via the REST API. This was inconsistent with the core
library (L4.Export), which exposes the topmost function as default when
no @export markers are present.

Changes:
- Removed explicitExportsOnly filter
- Now uses getExportedFunctions directly from L4.Export
- Inherits core library behavior: topmost function becomes default
- Cleaned up unused imports (L4.Annotation, DescFlags, ParsedDesc)

This makes L4 programs more accessible - users can start with simple
programs without needing to learn about @export annotations.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

mengwong and others added 3 commits January 14, 2026 12:34
Previously, when evaluation succeeded, the result wasn't shown unless
the query plan also indicated determination. Additionally, evaluation
errors were silently swallowed, making debugging difficult.

Changes:
- Set isDetermined=true when evaluation succeeds
- Log evaluation errors to console instead of silently catching
- Result now shows as soon as evaluation completes successfully

This fixes the issue where setting parameters (like c=Red) didn't
show results in the wizard UI.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
…vior

Updated DiskLoadingSpec to reflect the new behavior where all functions
are exposed by default (using core library's implicit export logic).

Changes:
- "loads only explicit @export" → "loads explicit AND implicit default"
- Tests for badly-placed @export markers now expect implicit export
- Functions without valid @export still get exported as implicit default

This aligns tests with the new behavior where the decision service
exposes all functions, not just those with explicit @export markers.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@mengwong mengwong merged commit b71d408 into main Jan 14, 2026
3 checks passed
@mengwong mengwong deleted the mengwong/gen-web-app branch January 14, 2026 05:10
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