examples: cover hmac-sha256, idxof, run-bg, discard-bind, packaging, style variants - #744
Open
danieljohnmorris wants to merge 2 commits into
Open
examples: cover hmac-sha256, idxof, run-bg, discard-bind, packaging, style variants#744danieljohnmorris wants to merge 2 commits into
danieljohnmorris wants to merge 2 commits into
Conversation
`Builtin::Idxof` was in the enum and in `Builtin::ALL` but missing from the BUILTINS name-arity table in verify.rs that `builtin_arity` consults. Every program calling `idxof` panicked the verifier with `is_builtin guarantees arity exists` rather than producing a diagnostic. Surfaced when writing examples/idxof-substring.ilo (in the same PR). The signature matches the ILO-39 spec: `idxof s sub > O n`.
…, packaging, style variants
Closes coverage gaps surfaced by the 26.5 audit.
New examples:
- `examples/webhook-verify.ilo` — Stripe-style HMAC-SHA256 signature
verification with constant-time compare (ct-eq) and replay-window
enforcement. The first end-to-end use case for hmac-sha256;
crypto-primitives.ilo was a per-builtin feature dump.
- `examples/idxof-substring.ilo` — find + slice idiom for the new
`idxof s sub > O n` builtin (ILO-39). Includes Unicode codepoint
semantics, empty-needle convention, and the blessed parse-on-first-
occurrence shape (idxof! then slc).
- `examples/run-bg-tail.ilo` — fire-and-forget background spawn
(`run-bg`, completing the run-family overhaul ILO-35 trio with
run / run2 / run-bg).
- `examples/discard-bind.ilo` — `_=expr` discard bind (ILO-36) for
silencing ILO-T033 on side-effecting calls at non-tail position.
Uses run2 since mset/+=/mdel are functional and the discard is
legitimately useful with spawn-shaped builtins.
- `examples/pkg-semver-range.ilo` — `ilo add` semver constraint reference
(caret, tilde, exact, wildcard, range, --branch, --rev, --exact).
Companion to pkg-registry.ilo which covers the runtime
`use "owner/repo"` shape.
- `examples/check-as-tool.ilo` — using `ilo check --json` as a verifier
tool (pre-commit hook, CI gate) and the JSON diagnostic shape.
- `examples/style/` — side-by-side style variants. `README.ilo` indexes
the set. `foreach-vs-map.ilo` contrasts `@x xs{...}` with `fld`.
`prefix-vs-infix.ilo` shows why prefix arithmetic composes more
predictably than infix (with the wrong-feeling shape pinned to its
surprise result so any future associativity change is caught here).
All files pass `ilo check`; all `-- run:` cases verified locally.
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
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.
Closes the example-coverage gaps surfaced by the 26.5 audit.
What's in the PR
One real bug fix (commit 1):
idxofwas completely unusable on main. TheBuiltin::Idxofvariant existed but was missing from theBUILTINSarity table insrc/verify.rs, so every program callingidxofpanicked the verifier withis_builtin guarantees arity exists. That's why no example foridxofexisted before now — nobody could write one. Three-line fix: add the missing entry with the ILO-39 signatureidxof s sub > O n.8 new examples (commit 2):
examples/webhook-verify.iloexamples/idxof-substring.iloexamples/run-bg-tail.iloexamples/discard-bind.ilo_=expr(ILO-36) for silencing ILO-T033 on side-effecting calls at non-tail positionexamples/pkg-semver-range.iloilo addconstraint syntax reference (caret, tilde, exact, wildcard, range, --branch, --rev, --exact)examples/check-as-tool.iloilo check --jsonas a verifier tool (pre-commit, CI gate), with the diagnostic JSON shapeexamples/style/README.iloexamples/style/foreach-vs-map.ilo@x xs{...}vsfld, with a recommendationexamples/style/prefix-vs-infix.iloWhy these specifically
Audit of 26.5's shipped features turned up:
idxof,_=,run-bg,ILO-W002,b64enc/b64dechmac-sha256,matvec,lstsq,tz-offset,run2,rgxall-multi,dtparse-rel,dur-parse,dur-fmthmac-sha256(webhook verifiers, signed APIs) but no realistic referenceThis PR closes the highest-value subset — anything that would meaningfully change what an agent writes when they reach for these features.
Verification
ilo check-- run:cases verified locally against a binary built with the verifier fixexamples_enginesregression harness exercises every new file across every available backendOut of scope
pkg-private-auth.ilo— needs live registry auth setup, hard to test in CIexamples/jpar-list-foreach.ilofrom the original recommend list — already covered byjpar-list-iter.ilo--depth expr(VM trace path) and the ILO-368 T044/T045 code collision — separate follow-up tickets