Skip to content

agenticspec 0.7.0

Choose a tag to compare

@b10x-bot b10x-bot released this 30 Nov 08:07
· 157 commits to main since this release
27c2bdf

Added

  • A time source a runtime reads without being woken by it (R166). The new block agentic.time_source (layer 3, capability; page blocks/3-capability/time-source) holds a TimeSource (identifier agentic.shared.TimeSourceId) with the kind of time it gives (Wall, Simulated) and its resolution: RegisterTimeSource and RetireTimeSource (actor Keeper), and ReadTime (actor Reader), which records a TimeReading with the time it gave and changes nothing else, refused once the source is retired. agentic.architecture.PartKind and agentic.kpi.Block have the variant TimeSource; a part of block time_source takes kind (wall by default, or simulated) and resolution (a duration, 1s by default) and uses no port of the contract. A runtime reads it over a link carrying read; agenticspec sim starts no run from it, and the event log of sim run --events writes the payload field time_read (seconds of simulated time, the line's t_seconds) on each agentic.work.RunStarted of a part that reads a time source, declared on that event and on agentic.work.StartRun as an optional timestamp. agenticspec sim check refuses a link carrying trigger from a time source under trigger_source_not_trigger with the message "a time source is read over a read link, not a trigger source; use an on_schedule trigger for timed starts". Two KPIs in the catalogue: runs_started_by_time_source (a gate, additive) and time_reads_per_run. A block's docs page is named as its file (time-source.md).
  • A requirement can name a nested architecture as its part (R162): { kpi: cost_usd, at_most: 150, part: work } reads the sum of the KPI over every part of the nested architecture work (its flattened parts work.<part>, those of architectures nested in it too), so a cap on what a module spends as a whole holds for every variant of it, with or without a given inner part. Each model call counts once: the simulator books a call's cost_usd and rate_limited_seconds on the agent that made it and again on the model or gateway part that served it, so for those two the sum leaves out the module's model and gateway parts (a module of one agent and its model reads the agent's cost, which equals the model's, not both). Before, part had to name one part and such a requirement was refused (`part` names `work`, which is no part). The sum takes only an additive KPI: every entry of kpis/counts.yaml, and each entry of kpis/catalogue.yaml marked with the new optional key additive: true (58 of them: counts and sums of money, tokens or seconds, such as cost_usd and tasks_done). agenticspec sim check, deploy bundle and an experiment refuse a share, a ratio or a percentile there (requirement_invalid, naming the KPI and "not additive"). A catalogue entry whose additive is not a boolean is refused when the catalogue is read. Every committed result keeps its bytes. Docs: "Requirements" on the architectures overview, kpis/README.md.
  • The simulator evaluates the condition of an on_event trigger (R153). A trigger part takes condition, a value of agentic.trigger.Condition (all and any, each a list of comparisons {field, op, value}; the settings table has the type condition), and condition_share, a number from 0 to 1. The simulated events carry one field, part, the part the event is at (events::CARRIED); a comparison on it by Equal, NotEqual, Defined or NotDefined is evaluated on each event. A comparison on any other field holds in the share condition_share of the events that meet the rest of the condition, drawn from a stream of the trigger's own, so a run whose triggers declare no share draws what it drew before and every committed result.json keeps its bytes. Before, a trigger fired on every event its event_name and source matched, whatever its condition. agenticspec sim check refuses, as architecture_refused: an event_name that no block declares and the simulation does not emit (event_unknown; sim run refuses every event the simulation does not emit, as before), another operator on part (op_unsupported), a comparison on another field without a condition_share (condition_unmodelled), a share outside 0 to 1 (share_invalid) and a share beside no such comparison (share_unused). The five rules are no gate KPIs: sim run refuses the same triggers, so no result changes.
  • agenticspec sim run --live streams the run to its page while the simulator runs. It serves the page and its feed on 127.0.0.1 at a port the system picks and prints agenticspec sim: live on http://127.0.0.1:<port>/ on standard error first. The baseline at the experiment's first seed is streamed before the search, the shown run (the run of events.jsonl) after it, paced in simulated time (--pace, simulated seconds per second, 60 by default). The feed is the one of agenticspec ui serve: server-sent events, one channel per stream (baseline, shown) with the event's seq as its cursor and Last-Event-ID resume; each event carries its line of events.jsonl and, on the next line, the replay records of its moment, and an end event follows the last one with the records after it. Joined in order, the records of the shown stream are its run in replay.json. The page reads both streams as they arrive and adds each as a run; its scrubber ends at the last event received. A client that connects after the end gets both streams from the start. Once both are sent the command exits 0 when the last client leaves, or after --linger seconds (0 by default) when none is connected. Every file it writes is the same bytes as without --live.
  • agenticspec sim run --events also writes replay.json (agenticspec-sim-replay/1), and the index.html it writes plays the run back over the architecture graph. The file holds the baseline and the shown variant (the best, else the baseline) at every seed of the experiment, each recorded in full; the shown variant at the first seed is the run of events.jsonl. Per run it holds each part's series of changes of waiting items (queue), busy items and spend (USD) over simulated time, each change naming the line of events.jsonl it is for, and each link crossing (from part, to part, start, end, subject key). An item (a task, a build's claim, a trigger's firing) waits at or is worked by one part at a time; a crossing runs from when an item is sent to a part until it leaves it, and model calls and firings cross as the run's port uses record them. A part's spend at the end of a run is its cost_usd in that run. The page embeds the file and needs no server: play, pause, a speed (1 min/s to 1 day/s), a scrubber over simulated time and a choice of run, with each part's counts in a table (data-queue, data-busy, data-spend) and a link marked data-carrying while a crossing of it spans the time shown. Without --events nothing changes: no replay.json, and index.html, result.json and events.jsonl keep their bytes. task check:sim-page runs the page in a browser, a run of 94,473 events included, and holds its work against ux/work/sim-page.json.
  • A nested architecture can be off for part of a run (R160). A part of block architecture takes active, the window of the run it works in ({from, until}, durations from the start of the run, either left out) or a list of such windows, and handback, the part of the architecture that nests it where its tasks go while it is off: a part of that document outside the nested one, or a border part of another nested architecture (<part>.<border part>). The two come together. While it is off, its worker and reviewer parts take no task, and the tasks they hold or have queued, and every task that reaches it, go to the hand-back part: a post on a shared channel, a task handed to an agent that takes them over an order link, otherwise the backlog. After its window ends it works again. The result of a run with active counts handed_back (overall and on the hand-back part) and tasks_open, the tasks still held at the end, so tasks_arrived is tasks_done plus tasks_open when no task is lost; a run without it reports neither, and every committed result keeps its bytes. agenticspec sim check refuses a hand-back part that is not a part of the outer architecture, or is inside the nested one, a window that does not run forward, and either setting without the other (setting_invalid), and lists active and handback with the nested architecture. The settings table has the type windows.
  • The policy module_link_cycles: refuse of an architecture document makes agenticspec sim check refuse a cycle of links that runs through the borders of two or more nested architectures (module a's workers post to module b's inbox, b's workers post back to a's inbox), read over the flattened document grouped by nested architecture; the refusal module_link_cycles names the nested architectures and the parts of the cycle. A chain of nested architectures and a cycle through one border only are accepted; without the policy (or under allow, the default) nothing changes, and another value is refused as setting_invalid on policies. The rule is a new gate KPI: sim check --json and every catalog result count it. Docs: "Nesting an architecture" on the architectures overview. (R161)
  • Spend caps per run and per agent (R132). A runtime and a budget take the setting per_run_usd and an agent max_cost (USD, at least 0; an agent's max_cost narrows its harness.session port), the spend cap of one run, beside the caps per day and month. agenticspec sim ends a run that has spent its cap: it makes no further model call and its task ships nothing. A budget's cap holds for the runs of every part its grant link ends at, and of every part whose model calls pass the gateway or model it ends at; the smallest cap applies. A result reports runs_capped (in its KPIs and per capped part, listed in kpis/counts.yaml) only when a cap is set, so every committed result.json keeps its bytes; the event log writes a capped run as agentic.work.RunEnded. Authored scenarios blocks/scenarios/agent/max-cost-refuses-further-spend.yaml and blocks/scenarios/work/run-capped-by-budget.yaml walk the refusal in the blocks: a budget of owner kind AgentRevision or Run whose limit is the cap refuses a spend over it and every spend after it is exhausted, and a run that ended BudgetExhausted takes no further step. No guard compares a summed cost with max_cost (ESS 0.99.22 has no sum guard), noted as UNMAPPED on agentic.agent.BudgetLimits.
  • A trigger has a dry run (R131): it lists the firings a trigger would make and starts none. In the blocks, agentic.trigger.DryRunTrigger (actor Scheduler) takes a trigger and the subjects its condition holds for now and records an agentic.trigger.DryRun (identifier agentic.shared.DryRunId) with one subject per firing and the trigger's reaction and target (agent_revision_id or command), event agentic.trigger.TriggerDryRun, view agentic.trigger.DryRuns; it records no firing, leaves the trigger's running count alone and works on a disabled trigger. It is a command, not a view: a trigger's condition is a value it holds, and a view filters only by a predicate the specification declares. Scenarios dry-run-two-subjects (two subjects, two firings listed, no firing recorded, no run) and dry-run-no-subject (none listed). In the simulator, agenticspec sim triggers <architecture> --profile <profile> --dry-run [--seed <n>] [--horizon <duration>] answers the firings each trigger would make over the inputs the profile's load generates in the window (one day by default), each with its time, subject (tick 2 of hourly, post 0 on inbox, task_arrived 3), reaction and the agent parts it would wake, and per trigger how many it would make; a firing starts no run (started is 0). Without --dry-run it is refused (dry_run_required).
  • A block records what an artifact was derived from, and marks it when that changes (R130). The new block agentic.derivation (layer 7, collaboration) holds a Derivation: a store record, a deliverable or a run (artifact_kind, with record_id, deliverable_id or run_id), derived from one source, a decision (question_id, an Answered question or one that took its default, with the option it held as decided_option) or another derivation (derived_from). RecordDerivation (actor Author) refuses a derivation with no source (NoSource) or two (TwoSources), an artifact its kind does not name (ArtifactNotNamed), an unknown record, deliverable or run (UnknownArtifact), question (UnknownQuestion) or derivation (UnknownDerivation), a question with no chosen option (DecisionNotTaken) and a source derivation marked for revision (SourceMarkedForRevision). Marking goes one step per command (actor Reviser): MarkDecisionChanged marks every Current derivation made from a decision MarkedForRevision (cause DecisionChanged, event DecisionDerivationsMarked with the count), and MarkDerivedFrom marks every Current derivation made from a marked derivation (cause SourceMarked, event DerivedMarked; refused as SourceNotMarked while its source is not marked), so a mark reaches every artifact that followed from the decision. Views Derivations, DerivedFromDecision and DerivedFrom. A decision taken is changed by the new agentic.question.ReviseAnswer (the addressee or a delegate; an Answered or DefaultTaken question moves to Answered with the new option, event AnswerRevised with the previous option; the same option is refused as AnswerUnchanged). Authored scenario blocks/scenarios/derivation/revised-decision-marks-two-steps.yaml: a draft derived from a decision and a run derived from the draft; the decision is revised; the first step marks the draft, the second the run. ESS 0.99.22 synthesizes none of these outcomes but the refusals option-not-offered and unchanged of ReviseAnswer and unknown-question of MarkDecisionChanged (a derivation is read through when_related:, whose rows these families do not arrange, and a run or deliverable needs a process the arrangement creates twice), so the authored scenarios record-derivation-refusals.yaml and question/revise-answer-refusals.yaml walk the rest and name each refused scenario under covers:. KPIs derivations_marked_for_revision and derived_left_unmarked (gate) are planned in kpis/catalogue.yaml.
  • An architecture document can place stores and event buses. agentic.architecture.PartKind has the variant Store and agentic.architecture.Carries the variant Event. A part of block store takes the settings kind (required: record, artifact, key_value, semantic, graph), scope (architecture by default, part beside a per, or external), retention (a duration, run or forever, the default) and, on a semantic store, vectors (supplied by default, or made); a channel part of kind event is a named bus. agenticspec sim check has four new rules, each a gate KPI: a link to a store that carries neither record nor read (store_reach_not_record_or_read, naming the part and the store), a link to, from or over an event bus that does not carry event (bus_reach_not_event), a semantic store with vectors: made and no model_call path to a model (semantic_store_without_model), and an external store a part links to that the egress of the part's sandbox does not name (external_store_not_in_egress, naming the sandbox and the store). sim check --json counts the four rules, and so does every catalog result. The contract gives a store part no port yet. Docs: "Stores and buses" on the architectures overview.

Changed

  • The local browser gates task check:site, check:app, check:studio and check:views are bounded by the work they do, not by 120 s of wall time, which moves with the load of a shared host. scripts/work-count.sh runs each step's Playwright command under perf stat -e instructions:u (the instructions retired by the runner, its server and the browsers) and the tests record every resource their pages load (ui/app/e2e/network.ts); ui/app/e2e/work.ts holds the instructions (5 %) and, per type of resource, the count (exact) and the bytes (0.5 %) against the work key of ux/site/baseline.json, ux/baseline.json, ux/work/studio.json and ux/work/views.json. Worse fails, and better fails until WORK_RATCHET=write takes it into the baseline. A hang guard ends a step after 480 s. On a host without a hardware instruction counter only the network is held. On the forge each step keeps Playwright's 120 s bound.

Fixed

  • agenticspec sim check refuses a display group of the view: key that names a part its document does not have (R165): architecture_refused with the rule view_group_unknown_part, the group, the name and its path (view/groups/<group>/parts/<i>, under the nested part for the key of a nested document). Such a document was accepted before, and the UI derived from it had a group with a hole. A group names the parts of its own document, as agenticspec ui derive reads it: a nested architecture by its part's name, not the flattened parts inside it. The rule is no gate KPI, so no simulation result changes. No document under architectures/ has such a group.
  • A decision that must never take a default can be written again (R138; a regression of ac47474 in 0.5.0, which made a question's default required). A question names its default_option and its deadline together or neither: agentic.question.Ask refuses one without the other (incomplete-default, new error IncompleteDefault), and a question asked with neither never takes a default and stays Open until it is answered, withdrawn or recorded as could not read; TakeDefault refuses it (no-default, new error NoDefault) however late it comes. Question, QuestionAsked and the views Questions and OpenQuestions carry both as optional. A question part's settings default and default_after are optional again, and agenticspec sim check refuses a part that names one without the other (setting_invalid). Authored scenarios blocks/scenarios/question/question-without-default-never-defaults.yaml and half-given-default-refused.yaml.
  • A pool can grant by priority again, and a work queue needs no claim time limit (R143; regression of ac47474, which dropped the pool setting order and made job_limit required for every pool). The resource block has agentic.resource.PoolOrder (Fifo, Priority): CreatePool takes an optional order (without it, Fifo) and RequestClaim an optional priority (Integer), kept on Pool and Claim. On a pool of order Priority, GrantClaim grants the waiting claim of the highest priority first, equal priorities in queue order and a claim without a priority behind every claim with one; a grant out of that order is refused as out-of-priority, NotFirstByPriority. A pool of order Fifo, or of none, grants in queue order as before and takes no priority: RequestClaim with a priority on it is refused as priority-on-fifo, PriorityNotTaken, so the grant reads the claims alone. A pool part takes the setting order again (fifo or priority, default fifo, narrows resource.claim; lifo is not taken), and job_limit is required unless the pool's kind is queue: {block: pool, kind: queue, capacity: 4} passes agenticspec sim check. The settings table has the key unless: {<enum setting>: [words]} beside required: true, and a block page shows such a setting as "required unless kind is queue". Authored scenarios blocks/scenarios/resource/priority-first.yaml, priority-ties-in-queue-order.yaml and fifo-takes-no-priority.yaml.