Skip to content

fix(app): reject unrunnable inline kinds at validate + compile (#160)#163

Merged
pawellisowski merged 3 commits into
mainfrom
fix/inline-kind-validate
May 25, 2026
Merged

fix(app): reject unrunnable inline kinds at validate + compile (#160)#163
pawellisowski merged 3 commits into
mainfrom
fix/inline-kind-validate

Conversation

@pawellisowski
Copy link
Copy Markdown
Contributor

Summary

An inline node with kind: shape (or map) passed aware app validate and compile but aware app run aborted (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_app now errors (E_APP_INLINE_KIND) on any inline kind other than predicate — the only kind the runtime executes — and recurses into for-each do: bodies (which the compiler flattens and the runtime runs).
  • The gate lives in 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 just validate.
  • app-spec.md's inline-glue section now marks map/shape as 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_test integration tests green; new unit tests (top-level + nested do: shape) and integration tests (validate- and compile-rejection)
  • Full suite green — the shared gate doesn't break any existing compile/run/inspect path
  • Changed files fmt + clippy clean

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.
@pawellisowski pawellisowski merged commit 98f598d into main May 25, 2026
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.

inline kind: shape/map accepted by 'app validate' but rejected by 'app run' (only 'predicate' runs)

1 participant