feat: implement from a typed issue — --issue=<id>, issue_show/issue_verify (#173) - #174
Merged
Merged
Conversation
…erify (#173) A typed issue (lex-lang #949) is the contract to satisfy: exact signatures plus the examples that decide whether it holds. lex-code now works from it directly: - `--issue=<id> ["guidance"]`: `lex issue show` renders the acceptance as the task (src/issue_contract.lex, pure + examples); the run ends with `lex issue verify` whatever the model claimed, and prints `[ISSUE_VERDICT]\t<verdict>\t<id>` as its last line. - Provenance: the session is bound to the issue via `.lex/intent/issue` (`<session>\t<issue>`, honoured only for the session that wrote it, so a leftover file cannot stamp a later session's ops), and every clean .lex write publishes with `--intent-issue` — issue -> intent -> ops -> attestation. - Tools `issue_show` / `issue_verify` (build + minimal toolsets) so the fix loop iterates against the issue's own oracle. A `failed` verdict is an answer (ok:true, exit 1), not a tool error. - Smoke gate: `unknown command` joins the refusal vocabulary — a toolchain older than the command a tool calls said exactly that, and none of the six phrases caught it. - Toolchain 0.11.32 -> 0.11.66 (`lex issue` needs >= 0.11.50). Not 0.11.67: its unmemoized per-import `git ls-remote` (lex-lang #1005) turns a `lex check` of src/tools/index.lex into ~2 minutes. Verified live with local qwen3.8:27b-mlx (OLLAMA_THINK=false) on a fresh package: typed_delta issue failing at head -> agent wrote digit_sum with the issue's examples -> `[ISSUE_VERDICT] verified`, re-verified independently; both new ops carry the intent whose issue_id is the issue. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Part of #173 (items 1–3; item 4, the agent-refined acceptance flow with human approval, is a follow-up). Consumer side of lex-lang epic alpibrusl/lex-lang#949.
What
--issue=<id> ["guidance"]: fetches the issue (lex issue show) and renders its acceptance as the task: exact signatures to ADD/CHANGE/REMOVE, the examples as the oracle, or the failing example to fix (src/issue_contract.lex, pure, covered by examples). Whatever the model claims, the run ends withlex issue verifyand prints[ISSUE_VERDICT]\t<verified|failed|inconclusive|unavailable>\t<id>as its last line..lex/intent/issue=<session>\t<issue>binds the session to the issue, so every clean.lexwrite publishes with--intent-issue. The chain is issue → intent → ops → attestation. The file is honoured only for the session that wrote it, so a leftover file can't put its issue on a later session's ops.issue_show/issue_verifyin the build and minimal toolsets, so the fix loop iterates against the issue's own oracle. Afailedverdict is an answer (ok:true, exit 1) with the detail naming the wrong signature or example. It is not a tool error.unknown commandto the refusal vocabulary. A toolchain older than the command a tool calls prints exactly that, and none of the existing phrases matched it.lex issueneeds ≥ 0.11.50). I didn't use 0.11.67: lex-lang #1005 runsgit ls-remoteonce per import, with no memoization. That makeslex check src/tools/index.lextake about 2 minutes (8s CPU), and CI checks ~115 files one by one. I measured it with a logging git shim: 21 ls-remotes for one small file, lex-schema alone 13×.Verification
SMOKE OK — 29 tools, includingissue_show/issue_verify), tests 4/4, bar gate, effect minimality, and the manifesto twin. All green.examples {}expectation inissue_contract.lexis rejected bylex check(example_mismatch), so the new examples really run.qwen3.8:27b-mlx(OLLAMA_THINK=false) on a fresh package:typed_deltaissue (digit_sum(n :: Int) -> Int, 3 examples) that fails at head.lex-code --ollama --issue=<id>wrotedigit_sumwith the issue's examples, calledissue_verifyitself, and ended with[ISSUE_VERDICT] verified.lex issue verifyalso returnedverified.issue_idis the issue. The baseline op's intent has none.🤖 Generated with Claude Code