Skip to content

bounds: bounds resolved once and re-checked between commands, run.more and extend, OUT{} as a command, and the profile error pinned - #87

Open
ohdearquant wants to merge 3 commits into
mainfrom
owed/bounds
Open

ohdearquant wants to merge 3 commits into
mainfrom
owed/bounds

Conversation

@ohdearquant

Copy link
Copy Markdown
Owner

Closes #28, closes #31, closes #30, closes #25.

Every bound is resolved once at run start (the profile's defaults, max_idle, cost_budget, the context check) and time and cost are re-checked between commands, so a run that crosses a budget mid-turn ends there. A reported cost that is not a number reads as spent, not as room. run.more has a default handler and jobs take an extend field. OUT{} is dispatched as a command with accept as its last before hook, and a hook's rewrite of the output is held to the run's declared outputs: a field off the list is refused, a dict is validated into the spec. RunRequest takes its fields by name only. A profile outside the operable set, or beyond the actor's privileges, raises ProfileError before any turn, and a test pins it.

ADR-0001 and ADR-0003 state what holds, with the tests named. This branch and the run branch (#83) both touch the run loop in lionagi/actor.py; whichever merges second takes a merge of main.

Suite: 100% coverage on 3.11, 3.12 and 3.14; pre-commit clean.

…ber reads as spent, and a hook's rewrite of OUT{} is held to the run's outputs
…ept judges it held

A before hook's rewrite could drop a required output (_out checked
only for names off the list), and accept saw the rewrite raw, before
validation: a dict rewrite reached a typed accept as a dict and was
refused, and an invalid rewrite reached accept at all. One rule,
_held, now serves the assembled OUT{}, the rewrite, and accept, which
judges output instances and whose approved value is what leaves.
ADR-0003 D4.
@ohdearquant

Copy link
Copy Markdown
Owner Author

9040623: a before hook's rewrite of out is now held by the rule that held OUT{} (a required output dropped is a refusal, not a success with the field missing), and accept judges the rewrite once held and validated, so a dict rewrite reaches a typed accept as the output instance and an invalid rewrite never reaches it; the value accept judged is the value the caller receives. One rule, _held, serves the assembled OUT{}, the rewrite and accept. ADR-0003 D4 says so; four tests pin it. Gates: pre-commit twice, pytest with coverage on 3.11, 3.12 and 3.14 at 100%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment