fix(app): reject unrunnable inline kinds at validate + compile (#160)#163
Merged
Conversation
An inline node with kind: shape/map passed `aware app validate` + `compile` but
`run` aborted ("inline kind \"shape\" not supported in v0.3"), so the failure
surfaced only after the author validated, compiled, and approved the lock.
validate_app now errors (E_APP_INLINE_KIND) on any inline kind other than
`predicate` — the only kind the runtime executes today — so the four stages agree
on what's runnable. app-spec.md's inline-glue section now marks map/shape as
reserved/not-yet-runtime-supported instead of advertising them as available.
… kinds (#160 review) Two gaps Codex flagged in the first cut: - `aware app compile` called compile_to_disk directly, bypassing validate_app — so a top-level kind: shape could still lock and fail only at run. compile_cmd now runs validate_app and refuses to produce a lock on errors. - the inline-kind check only walked top-level app.nodes; a shape/map nested in a for-each `do:` body (which the compiler flattens and the runtime executes) slipped through. validation now recurses into `do_` bodies. Adds integration tests for validate- and compile-rejection.
… gate (#160 review) compile-time validation lived only in compile_cmd, so `aware app inspect` (and any other compile_to_disk caller) could still write a lock for an unrunnable inline kind. Moved the validate_app gate into compile_to_disk — the single shared lock-producing path — and reverted the now-redundant gate in compile_cmd. Found by Codex review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An inline node with
kind: shape(ormap) passedaware app validateandcompilebutaware app runaborted (inline kind "shape" not supported in v0.3), so the failure surfaced only after the author validated, compiled, and approved the lock. Closes #160.validate_appnow errors (E_APP_INLINE_KIND) on any inline kind other thanpredicate— the only kind the runtime executes — and recurses intofor-eachdo:bodies (which the compiler flattens and the runtime runs).app_lock::compile_to_disk, the single shared lock-producing path, so every lock-producing command (compile,inspect, …) refuses to lock an unrunnable app — not justvalidate.app-spec.md's inline-glue section now marksmap/shapeas reserved/not-yet-runtime-supported instead of advertising them.Review
Codex (
codex exec review --base main) — 3 rounds, all findings addressed (compile/inspect bypass, nested-body recursion), final pass clean.Test plan
cargo test --bin aware(384) +app_val_testintegration tests green; new unit tests (top-level + nesteddo:shape) and integration tests (validate- and compile-rejection)