Skip to content

feat: implement from a typed issue — --issue=<id>, issue_show/issue_verify (#173) - #174

Merged
alpibrupa merged 1 commit into
mainfrom
173-implement-from-issue
Sep 22, 2026
Merged

alpibrupa merged 1 commit into
mainfrom
173-implement-from-issue

Conversation

@alpibrupa

Copy link
Copy Markdown
Contributor

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 with lex issue verify and prints [ISSUE_VERDICT]\t<verified|failed|inconclusive|unavailable>\t<id> as its last line.
  • Provenance: .lex/intent/issue = <session>\t<issue> binds the session to the issue, so every clean .lex write 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.
  • Tools issue_show / issue_verify in the build and minimal toolsets, so the fix loop iterates against the issue's own oracle. A failed verdict is an answer (ok:true, exit 1) with the detail naming the wrong signature or example. It is not a tool error.
  • Smoke gate: added unknown command to the refusal vocabulary. A toolchain older than the command a tool calls prints exactly that, and none of the existing phrases matched it.
  • Toolchain 0.11.32 → 0.11.66 (lex issue needs ≥ 0.11.50). I didn't use 0.11.67: lex-lang #1005 runs git ls-remote once per import, with no memoization. That makes lex check src/tools/index.lex take 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

  • Local replica of every CI step on 0.11.66: type-check of all files, fmt, doc-sync, smoke (SMOKE OK — 29 tools, including issue_show/issue_verify), tests 4/4, bar gate, effect minimality, and the manifesto twin. All green.
  • Negative control: a deliberately wrong examples {} expectation in issue_contract.lex is rejected by lex check (example_mismatch), so the new examples really run.
  • Live end-to-end with local qwen3.8:27b-mlx (OLLAMA_THINK=false) on a fresh package:
    • Set up a typed_delta issue (digit_sum(n :: Int) -> Int, 3 examples) that fails at head.
    • lex-code --ollama --issue=<id> wrote digit_sum with the issue's examples, called issue_verify itself, and ended with [ISSUE_VERDICT] verified.
    • An independent lex issue verify also returned verified.
    • Both new ops carry the intent whose issue_id is the issue. The baseline op's intent has none.

🤖 Generated with Claude Code

…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>
@alpibrupa
alpibrupa merged commit 24e4acd into main Sep 22, 2026
1 check passed
@alpibrupa
alpibrupa deleted the 173-implement-from-issue branch September 22, 2026 11:25
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.

1 participant