Repository navigation
Refuse an Ask that registers no Question - #2448
Merged
Merged
Conversation
A page went out with four lf-ask regions whose lf-options lacked choose: each read as a question, the banner counted none, and the user could answer none. `page check` passed because #2240 dropped the exactly-one-source rule to let an Ask frame several Questions, and nothing kept its lower bound. question_context_errors now refuses an x-question-context region that frames no asking x-awaits widget, naming what each framed widget lacks. A when condition that only requires an attribute absent (settled) is how a decision already asked is retired, so a settled source keeps its context; one a recorded value writes can still be met by a gesture. A quoted Ask stays exempt. Behavior change in tests: an empty lf-ask was asserted valid and is now refused. The shared PAGE fixture framed a choose-less lf-options in an lf-ask (the incident's shape) and is now a div with the same id; two server tests' added Asks gain choose, and one render case drops a nested Ask around a draft without needed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 11, 2026
# Conflicts: # tests/interact_support.py
leaf-agent
reviewed
Oct 12, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The values != [False] exception in unasked leaves the original empty-Ask failure open for package widgets. A widget may declare x-awaits.when as {"needed": [false]}. When its needed flag is present, canonical asking returns false, but question_context_errors returns no error for an Ask containing only that widget; I reproduced both readings with this validator. A false-only predicate does not itself say the Question was previously asked. The retirement allowance needs an explicit basis that agrees with Question registration, so a never-asking source cannot satisfy the context check.
The context check counted a widget failing only an absence-requiring `when` condition as a retired Question. That reads retirement off the predicate's shape: a widget whose flag stops it asking from the start would satisfy an Ask it never asked in. `x-awaits.retired` now names the flag an author sets to end a Question already asked (lf-options: settled), and registry validation requires `when` to read that flag's presence as not asking, so retirement and registration agree. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 12, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 12, 2026
The [failed main run](https://github.com/max-sixty/leaf/actions/runs/38196042452) hit three parameterizations of `test_command_hub_an_absorbed_input_stays_fulfilled`: its honoring revision removed `needed` from the only draft inside an `lf-ask`, so the new check from #2448 correctly refused the empty Question context. The test now changes that Ask to a plain region when the draft becomes optional editing. It still verifies that the recorded answer remains reviewable at `1/5` after the revision. The three cases failed on current `main` before this edit and pass after it (`uv run pytest tests/test_render_projection.py -q -n0 -k test_command_hub_an_absorbed_input_stays_fulfilled`). This repairs the test fixture; the validator's lower bound remains intact. --------- Co-authored-by: leaf-agent <[email protected]>
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.
leaf page checknow refuses anlf-askthat registers no Question. A page went out with four Asks whoself-optionslackedchoose: each read as a question, but the banner counted none of them and the user could answer none. The check passed because #2240 dropped the old exactly-one-source rule so an Ask could frame several Questions, and nothing kept its lower bound.The rule lives in
question_context_errors(skills/leaf/scripts/leaf/validation/instances.py), so it covers page source and thread message markup alike, and it reads declarations only: anx-question-contextregion needs at least onex-awaitswidget, outside anx-exhibit, whose nearest context is that region and which asks or was retired. The error names what each framed widget lacks, for example<lf-options id="pick"> (line 12) asks only where choose is present.A retired Question keeps its context.
x-awaitsgainsretired, naming the flag an author sets to end a Question already asked;lf-optionsdeclares"retired": "settled", and registry validation requireswhento read that flag's presence as not asking, so retirement and registration agree. The review-queue and comparison fixtures and the corpus keep settled decisions inside their Asks. Awhencondition a recorded value writes counts too, since a gesture can still meet it, and an Ask quoted inside an exhibit is exempt.references/packages.mddocumentsretiredand the rule.Behavior changes in tests: an empty
lf-askwas asserted valid and is now refused. The sharedPAGEfixture framed a choose-lesslf-optionsin anlf-ask, the incident's shape; it is now adivwith the same id. Two server tests' added Asks gainchoose, and one render case drops a nested Ask around a draft withoutneeded.