Repository navigation
Conversation
Implement ClaimAudit specification preflight, 2-phase target-audit with sealed Spec/Captured environments, and once-per-Checker precompilation of staged TrustedBoundary.olean. Source: https://github.com/joshlf/anneal/tree/dfe5e02478ab99734150962bd67c3662b86bf33b Agent-authored-by: AI agent acting on joshlf's behalf
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5dd8e066e1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let args = vec![ | ||
| "-j1".to_string(), | ||
| mem_limit, | ||
| "-R".to_string(), |
There was a problem hiding this comment.
Preserve mandatory Lean compilation flags
Add -DElab.async=false and -Ddebug.skipKernelTC=false to both new inspector-compilation argument lists. Every inspector invocation now consumes this cached .olean, but unlike the existing module compilation paths, both the direct and sandboxed branches omit the repository-required synchronous and kernel-checking flags, so the trusted inspector is no longer built under the fixed compilation contract.
AGENTS.md reference: anneal/AGENTS.md:L263-L268
Useful? React with 👍 / 👎.
| def preflightSpecs (j : Json) (foundation : Array Name) : IO Json := do | ||
| let libraries ← names j "libraries" | ||
| let sources ← field (α := Array (String × String)) j "sources" | ||
| let env ← importEnv j (foundation ++ libraries) true |
There was a problem hiding this comment.
Keep extension loading out of target spec preflight
Passing true here makes every spec-preflight call execute imported initializers and persistent-extension callbacks through enableInitializersExecution, creating a third loadExts := true mode even though the trusted-boundary policy restricts extension loading to the locked preflight and correspondence-preflight modes. This affects every target containing a specification and expands the executable TCB before target compilation; either avoid extension loading here or explicitly establish and review a replacement invariant for this new mode.
AGENTS.md reference: anneal/AGENTS.md:L263-L271
Useful? React with 👍 / 👎.
| /// `"headers"` rejects Lean 4 module-system headers (`module`), import | ||
| /// modifiers (`import all`, `public import`, `meta import`), and | ||
| /// `Lean.*`/`Lake.*` imports with exit code 1, while accepting omitted | ||
| /// `prelude` (synthetic non-meta + meta `Init` pair) in unpinned mode. | ||
| #[test] | ||
| fn headers_rejects_module_system_modifiers_and_lean_lake_and_allows_no_prelude() { |
There was a problem hiding this comment.
Add required guard-sensitivity tests
The new header, specification-preflight, and target-audit guards are covered only by additions to target_audit.rs; none of these tests disables its target guard to demonstrate that the negative case becomes accepted, and this commit does not update boundary_audit.rs. Consequently the new trust-boundary checks lack the required sensitivity evidence and could become vacuous or be disconnected without the mandated regression suite detecting it.
AGENTS.md reference: anneal/AGENTS.md:L272-L276
Useful? React with 👍 / 👎.
| if forbiddenSpecIdentifiers.contains val then | ||
| fail s!"disallowed identifier {val} in specification" | ||
| if forbiddenSpecRootNamespaces.contains val.getRoot then | ||
| unless allowedSystemPlatformDecls.contains val do |
There was a problem hiding this comment.
Normalize root-qualified identifiers before admission checks
An explicitly rooted identifier such as _root_.autoParam or _root_.IO.println has _root_ as getRoot, so neither the exact forbidden-identifier check nor the forbidden-namespace check matches it. In particular, _root_.autoParam still resolves to the elaborator-recognized declaration and can execute a stored tactic script during specification elaboration, bypassing the new preflight guard; strip rootNamespace before applying both policies, as the later kernel checks already do.
AGENTS.md reference: anneal/AGENTS.md:L254-L271
Useful? React with 👍 / 👎.
| if imp.isMeta then | ||
| unless imp.module == `Init && hasNonMetaInit do | ||
| fail s!"meta import {imp.module} is unsupported in {context}" |
There was a problem hiding this comment.
Reject explicitly authored meta imports of Init
When a source explicitly contains both import Init and meta import Init, hasNonMetaInit is true and this accepts the meta edge even though the exception is intended only for the synthetic pair produced when prelude is omitted. The same predicate is duplicated in the Rust admission path, so the authored modifier survives both checks; bind the exception to an omitted-prelude header or otherwise distinguish the synthetic edge from an explicit meta import.
AGENTS.md reference: anneal/AGENTS.md:L254-L262
Useful? React with 👍 / 👎.
| let spec_libraries: BTreeSet<String> = { | ||
| let adm = self.admitted()?; | ||
| let mut visited_mods: BTreeSet<String> = BTreeSet::new(); | ||
| let mut libs: BTreeSet<String> = BTreeSet::new(); | ||
| let mut queue: VecDeque<String> = spec_sources.iter().map(|(m, _)| m.clone()).collect(); |
There was a problem hiding this comment.
Parse each specification against its own import closure
This builds one union closure starting from every specification module and then parses all of their sources in the resulting shared parser environment. When two specifications import different Init/Std libraries, parser extensions, scoped syntax, and namespace state reachable only from one module can therefore change how the other module is preflighted, rather than matching the environment used to compile that file. Compute and use a separate authenticated closure per specification (or group only identical closures).
AGENTS.md reference: anneal/AGENTS.md:L263-L271
Useful? React with 👍 / 👎.
Human review surface
Implement ClaimAudit specification preflight, 2-phase target-audit with sealed Spec/Captured environments, and once-per-Checker precompilation of staged TrustedBoundary.olean.
Layer 18 of 19 in the migrated Anneal verification stack under
anneal/.Public Anneal source checkpoint.
Authored by an AI agent acting on joshlf's behalf.