Skip to content

Arena/8fcd3755 apodeixis jl - #3

Merged
hyperpolymath merged 6 commits into
mainfrom
arena/8fcd3755-apodeixis-jl
Oct 26, 2026
Merged

hyperpolymath merged 6 commits into
mainfrom
arena/8fcd3755-apodeixis-jl

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Changes

RSR Quality Checklist

Required

  • Tests pass (just test or equivalent)
  • Code is formatted (just fmt or equivalent)
  • Linter is clean (no new warnings or errors)
  • No banned language patterns (no Python, Go, TypeScript or ReScript; JavaScript runs Bun > Deno > pnpm > npm)
  • No unsafe blocks without // SAFETY: comments
  • No banned functions (believe_me, unsafeCoerce, Obj.magic, Admitted, sorry)
  • SPDX license headers present on all new/modified source files
  • No secrets, credentials, or .env files included

As Applicable

  • Repo deed (*_chora.deed) (status) / (maturity) updated (if project state changed)
  • Repo deed (ecosystem) updated (if integrations changed)
  • Repo deed (meta) and/or docs/decisions/ updated (if architectural decisions changed)
  • docs/status/ROADMAP.adoc updated (if milestones or next actions changed)
  • Documentation updated for user-facing changes
  • TOPOLOGY.md updated (if architecture changed)
  • CHANGELOG or release notes updated
  • New dependencies reviewed for license compatibility (MPL-2.0 / MPL-2.0)
  • ABI/FFI changes validated (src/interface/abi/ and src/interface/ffi/ consistent)

Testing

Screenshots

Summary by CodeRabbit

  • New Features
    • Added a Julia source-audit tool that reports policy findings and supports a mutation-score option. Clean audits are clearly labeled “POLICY CLEAN (NOT VERIFIED).”
    • Added package setup for Julia 1.9 and a command-line interface with help and distinct exit statuses for clean audits, findings, and input errors.
  • Documentation
    • Added project setup, usage, and development guidance, plus design and implementation plans outlining current capabilities and planned verification work.
  • Tests
    • Added coverage for audit behavior, policy checks, diagnostics, and command-line outcomes.

hyperpolymath and others added 6 commits October 22, 2026 15:32
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T22:25:02.203694Z d90fde4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

This change adds the Apodeixis Julia package, a source-policy audit API, a command-line interface, and tests. It replaces the template README and adds architecture documents describing the current audit and a planned verification toolchain.

Changes: Apodeixis audit and verification plans

Layer / File(s) Summary
Package and source-policy audit
Project.toml, src/Apodeixis.jl, test/runtests.jl
The package defines audit report types and functions. The syntax walk reports policy findings without executing source or macros. Tests cover policy checks, diagnostics, and audit behavior.
CLI audit flow
scripts/apodeixis.jl, test/runtests.jl
The CLI accepts an audit command and optional mutation score, invokes the file audit, and reports findings with exit statuses. Tests cover command handling and executable exit codes.
Project status and package guidance
README.adoc, docs/README.adoc, docs/architecture/REPOSITORY-MAP.adoc, docs/architecture/APODEIXIS-MVP-IMPLEMENTATION-PLAN.adoc, docs/architecture/APODEIXIS-ULTRAPLAN.adoc
The documentation describes package setup, current audit limits, CLI usage, test status, and links to the architecture plans.
Verification scope and implementation stages
docs/architecture/APODEIXIS-MVP-IMPLEMENTATION-PLAN.adoc, docs/architecture/APODEIXIS-ULTRAPLAN.adoc, docs/architecture/APODEIXIS-VERIFICATION-DESIGN.adoc
The plans define a restricted verification target, compiler and frontend boundaries, implementation stages, and explicit unsupported outcomes.
Verification semantics and obligations
docs/architecture/APODEIXIS-VERIFICATION-DESIGN.adoc, docs/architecture/APODEIXIS-ULTRAPLAN.adoc
The documents specify arithmetic tiers, array and allocation policies, FFI obligations, example verification conditions, and an illustrative kernel.
Receipts, release gates, and contributor handoff
docs/architecture/APODEIXIS-MVP-IMPLEMENTATION-PLAN.adoc, docs/architecture/APODEIXIS-ULTRAPLAN.adoc, docs/architecture/APODEIXIS-VERIFICATION-DESIGN.adoc
The plans describe Warrant and Receipt handling, release gates, roadmap phases, engineering rules, and contributor handoff requirements.

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CLI as apodeixis.jl
  participant FileAudit as audit_file
  participant SourceAudit as audit_source
  CLI->>FileAudit: audit FILE.jl with optional mutation score
  FileAudit->>SourceAudit: audit file contents
  SourceAudit-->>FileAudit: AuditReport
  FileAudit-->>CLI: AuditReport
Loading

Suggested reviewers: {{owner}}

Merge Risk: Moderate · up to d90fd

The new package's test suite contains contradictory assertions that fail against the implementation, so it should be fixed before merge. The design documentation also has a few inaccuracies. No production-facing runtime risk is evident.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · 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

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 26, 2026 22:21
@hyperpolymath
hyperpolymath merged commit af27438 into main Oct 26, 2026
128 of 143 checks passed
@hyperpolymath
hyperpolymath deleted the arena/8fcd3755-apodeixis-jl branch October 26, 2026 22:24

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d90fde4974

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Apodeixis.jl
Comment on lines +152 to +153
is_function_definition = x.head === :function || _is_short_function_definition(x)
child_verified = is_function_definition && !nested_function ? false : verified

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Treat anonymous functions as new verification boundaries

When an @verified function contains a closure such as f = B -> (@inbounds B[1]), the :-> expression is not recognized as a function definition, so its body inherits verified=true and passes with a sufficient mutation score even though the closure itself was never annotated. Handle anonymous functions, including those generated for do blocks, as independent boundaries just like nested named methods.

Useful? React with 👍 / 👎.

Comment thread src/Apodeixis.jl
Comment on lines +40 to +42
const _FORBIDDEN_MACROS = Set((
Symbol("@generated"), Symbol("@eval"), Symbol("@fastmath"),
))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject the standard @CCall foreign-call syntax

On supported Julia versions, @ccall is a standard way to invoke foreign code, but it is absent from the forbidden macro set. Consequently, a top-level @ccall libc.printf(...)::Cint is treated as an ordinary unknown macro outside @verified and the audit reports :policy_clean, despite the documented rule that unmodeled foreign calls are rejected.

Useful? React with 👍 / 👎.

Comment thread src/Apodeixis.jl
Comment on lines +96 to +98
elseif x.head === :call && !isempty(x.args)
callee = _callee_symbol(first(x.args))
if callee in _FORBIDDEN_CALLS

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Inspect dotted broadcast calls for forbidden callees

Forbidden callees are checked only when the AST head is :call, while Julia represents dotted calls such as eval.([:x]), Base.invokelatest.(fs, xs), and unsafe_load.(ptrs) with a broadcast :. expression. These forms execute the same prohibited operations but currently produce no finding, allowing the fail-closed dynamic-escape policy to be bypassed.

Useful? React with 👍 / 👎.

Comment thread test/runtests.jl
Comment on lines +235 to +237
# The MVP rejects global declarations only within the annotated body.
@test is_policy_clean(audit_source("global mutable_state = 1"))
@test is_policy_clean(audit_source("function f(); global mutable_state = 1; end"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove contradictory clean-global assertions

These assertions require top-level and unannotated-function global declarations to be policy-clean, but lines 105–113 in the same test file require those inputs to be rejected, and _walk! unconditionally emits APX_GLOBAL_MUTATION for every :global node. Therefore Pkg.test() must fail whenever this testset runs; the expectations should be aligned with the documented rule that global declarations are rejected.

Useful? React with 👍 / 👎.

Comment thread src/Apodeixis.jl
Comment on lines +155 to +159
for arg in x.args
if arg isa LineNumberNode
current_line = Int(arg.line)
else
current_line = _walk!(arg, child_verified, mutation_score, current_line, findings)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip method signatures when checking forbidden calls

The recursive walk treats the call-shaped signature of every method definition as an executed call. Valid definitions such as function API.eval(x); x; end or API.unsafe_load(x) = x therefore emit APX_DYNAMIC_ESCAPE, even though the forbidden function is only being defined and never invoked; distinguish the signature child of long- and short-form definitions from executable call expressions.

Useful? React with 👍 / 👎.

Comment thread src/Apodeixis.jl
Comment on lines +60 to +64
elseif x isa Expr && x.head === :. && !isempty(x.args)
lastarg = last(x.args)
lastarg isa QuoteNode && return lastarg.value isa Symbol ? lastarg.value : nothing
lastarg isa Symbol && return lastarg
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate macro qualifiers before applying the allowlist

Macro classification discards the entire qualifier and keeps only the final symbol, so an unrelated Other.@verified establishes a verified boundary and Other.@pre, Other.@inbounds, or similar macros are treated as reviewed contract markers. Inside an annotated function this lets arbitrary third-party macros evade APX_UNMODELED_MACRO—and a spoofed @verified can make unsafe constructs appear to be in an approved scope—so recognized markers must be restricted to the intended unqualified or registered module identities.

Useful? React with 👍 / 👎.

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