Skip to content

Add stage1 Option and Result outcome helpers#449

Open
jmcte wants to merge 1 commit intomainfrom
codex/issue-407-outcome-helpers
Open

Add stage1 Option and Result outcome helpers#449
jmcte wants to merge 1 commit intomainfrom
codex/issue-407-outcome-helpers

Conversation

@jmcte
Copy link
Copy Markdown
Collaborator

@jmcte jmcte commented Apr 29, 2026

Summary

  • Add std/outcome.ax with generic Option<T> and Result<T, E> helper predicates.
  • Add fallback unwrap helpers that avoid introducing panic-based unwrap behavior.
  • Add stage1/examples/stdlib_outcome and docs for the bounded helper surface.

Governing Issue

Closes #407

Validation

  • cargo run --manifest-path stage1/Cargo.toml -p axiomc -- test stage1/examples/stdlib_outcome --json
  • cargo fmt --manifest-path stage1/Cargo.toml
  • git diff --check
  • Required PR checks are expected to satisfy CI Gate
  • Skipped checks are explained below

Bootstrap Governance

  • Changes are scoped to the linked issue
  • Contributor or PR guidance changes are reflected in docs where applicable
  • No real secrets, runtime auth, or machine-local env files are committed

Notes

  • Skipped broader stage1 gates to keep this small stdlib-only issue slice cheap; focused generated-native example coverage passed.

@jmcte jmcte requested a review from pheidon as a code owner April 29, 2026 05:53
@jmcte jmcte enabled auto-merge (squash) April 30, 2026 18:45
Copy link
Copy Markdown

@athena-omt athena-omt left a comment

Choose a reason for hiding this comment

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

No blocking findings in the visible diff. The new std/outcome.ax helpers are scoped to pure Axiom match wrappers over the existing Option<T> and Result<T, E> forms, and the example/docs cover the intended bounded helper surface without adding host runtime or panic behavior.

I am leaving this as a comment rather than approval because the PR is currently reported dirty / non-mergeable, so the final merged diff still needs to be re-established against main. I also could not run local read-only checks from the required worktree because the command sandbox failed before starting commands with bwrap: Failed to make / slave: Permission denied.

Suggested non-blocking follow-up: after rebasing/merging main, consider extending stdlib_outcome to print the false predicate branches too (option_is_some(None), option_is_none(Some), result_is_ok(Err), result_is_err(Ok)) so every helper branch is represented explicitly.

Copy link
Copy Markdown
Contributor

@pheidon pheidon left a comment

Choose a reason for hiding this comment

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

Pheidon sweep review: approved. I inspected the Option/Result outcome helper stdlib additions and example. The helpers are added to the synthetic stdlib surface with docs and a deterministic stdlib_outcome example covering is_some/is_none/is_ok/is_err-style usage. Validation: git diff --check origin/main...HEAD; cargo run --manifest-path stage1/Cargo.toml -p axiomc -- test stage1/examples/stdlib_outcome --json. No blocker found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:daedalus Implementation and substantive code repair work. state:needs-repair Needs repair before advancing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: Result and Option helper functions

3 participants