feat: --refine=<id> + issue_propose — the agent proposes, a human approves (#173) - #175
Merged
Merged
Conversation
…roves (#173 item 4) The agent's half of lex-lang #956. A free-form issue has no oracle; the agent can now do the spec labor and propose one, and stop there. - `issue_propose` tool (build + minimal toolsets): `lex issue propose`, signed `--by lex-code/<provider>/<model>` from the turn's recorded intent. List fields (api/examples/invariants) are one entry per line. There is deliberately no approve tool — the human is the arbiter. - `--refine=<id> ["guidance"]`: refuses a non-free_form issue (points at --issue instead); prompts the agent to read the code, then propose exact signatures + edge-case examples (or one failing example) with a rationale, and NOT implement. The run ends by listing the proposals and the `lex issue approve|reject <proposal> --by <you>` command. The session is not bound to the issue (refining produces no code to link). Runs in Build mode — a read-only toolset would need wiring through all eight provider files (#88) — so the no-implementing rule is prompt-level. - issue_contract: `--issue` uses `effective_acceptance` once a proposal is approved and says which proposal supplied the contract; free_form issues point the agent at `issue_propose`. Verified live with local qwen3.8:27b-mlx against a free_form "reverse the digits" issue: --refine read the package, proposed reverse_digits with 7 examples covering sign and trailing zeros (citing digit_sum's negative-handling convention), wrote no code, and printed the approve command; after approving (as a test fixture), `--issue` implemented it against the approved contract → [ISSUE_VERDICT] verified, confirmed by an independent `lex issue verify`. CI replica green (smoke: 30 tools incl. issue_propose). Needs lex >= 0.11.68. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0.11.68 carries `lex issue propose|proposals|approve|reject` (lex-lang #956), which issue_propose and --refine call, and the one-ls-remote-per-load fix (lex-lang #1015) that made 0.11.67 unusable for this repo's per-file CI check (src/tools/index.lex: ~2 min on 0.11.67, 3.3s on 0.11.68). 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.
Closes #173 (item 4; items 1–3 landed in #174). This is the agent's half of alpibrusl/lex-lang#956, released in lex-lang v0.11.68.
What
issue_proposetool (in the build and minimal toolsets): runslex issue propose, signed--by lex-code/<provider>/<model>from the turn's recorded intent. List fields take one entry per line. There is deliberately no approve tool. The human is the arbiter.--refine=<id> ["guidance"]: refuses a non-free_form issue and points at--issueinstead. Otherwise the agent reads the code and proposes exact signatures plus edge-case examples, or one failing example, with a rationale. It does not implement. The run ends by listing the proposals and printinglex issue approve|reject <proposal> --by <you>.--issueuseseffective_acceptanceonce a proposal is approved, and the prompt names the proposal that supplied the contract.propose/approveneed it, and it fixes 0.11.67's ls-remote storm (lex-lang #1015).lex check src/tools/index.lextakes 3.3s, down from ~2 min.Known limit:
--refineruns in Build mode, so the rule against implementing is prompt-level only. A read-only toolset would need wiring through all eight provider files (#88).Verification
--refineread the package and proposedreverse_digits:(n :: Int) -> Intwith 7 examples covering sign, trailing zeros, 0, a single digit and a palindrome. The rationale citeddigit_sum's negative-handling convention.verifythen went from inconclusive to failed (fn absent).--issueimplemented it against the approved contract (the prompt carried "refined by approved proposal 68ef6e625201"):[ISSUE_VERDICT] verified, confirmed by an independentlex issue verify.SMOKE OK — 30 tools, incl.issue_propose), tests 4/4, bar gate, effect minimality, and the manifesto twin. All green.🤖 Generated with Claude Code