Skip to content

feat: --refine=<id> + issue_propose — the agent proposes, a human approves (#173) - #175

Merged
alpibrupa merged 2 commits into
mainfrom
173-refine-acceptance
Sep 22, 2026
Merged

alpibrupa merged 2 commits into
mainfrom
173-refine-acceptance

Conversation

@alpibrupa

Copy link
Copy Markdown
Contributor

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_propose tool (in the build and minimal toolsets): runs lex 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 --issue instead. 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 printing lex issue approve|reject <proposal> --by <you>.
  • --issue uses effective_acceptance once a proposal is approved, and the prompt names the proposal that supplied the contract.
  • Toolchain 0.11.66 → 0.11.68: propose/approve need it, and it fixes 0.11.67's ls-remote storm (lex-lang #1015). lex check src/tools/index.lex takes 3.3s, down from ~2 min.

Known limit: --refine runs 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

  • Live, local qwen3.8:27b-mlx, on a free_form issue "reverse the digits of a number (negatives keep their sign; trailing zeros disappear)":
    • --refine read the package and proposed reverse_digits:(n :: Int) -> Int with 7 examples covering sign, trailing zeros, 0, a single digit and a palindrome. The rationale cited digit_sum's negative-handling convention.
    • It wrote no code and printed the approve command.
    • I approved it as a test fixture. verify then went from inconclusive to failed (fn absent).
    • --issue implemented it against the approved contract (the prompt carried "refined by approved proposal 68ef6e625201"): [ISSUE_VERDICT] verified, confirmed by an independent lex issue verify.
  • Local CI replica on the released 0.11.68: type-check of all files, fmt, doc-sync, smoke (SMOKE OK — 30 tools, incl. issue_propose), tests 4/4, bar gate, effect minimality, and the manifesto twin. All green.

🤖 Generated with Claude Code

alpibrupa and others added 2 commits September 22, 2026 15:13
…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>
@alpibrupa
alpibrupa merged commit 4eb3d69 into main Sep 22, 2026
1 check passed
@alpibrupa
alpibrupa deleted the 173-refine-acceptance branch September 22, 2026 14:27
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.

Implement from a typed issue: work from its acceptance as the contract, publish with intent = issue ref (lex-lang #949)

1 participant