Skip to content

Feat/pact - #50

Draft
vsraccubits wants to merge 22 commits into
masterfrom
feat/pact
Draft

vsraccubits wants to merge 22 commits into
masterfrom
feat/pact

Conversation

@vsraccubits

Copy link
Copy Markdown

No description provided.

root and others added 22 commits November 29, 2026 01:16
… and discover

pact check --json prints one object in place of its report: diagnostics with severity, rule, message, fix, file (relative to the folder checked), line, column, related and the agent each is about, then the error, warning and note counts and the egress boundary. show, waits and discover keep stdout as it was and put the same object on stderr. A command that read nothing is the same object with one cli/ error. Exit codes do not change. Span, Severity, Related and Diagnostic derive Serialize, and Diagnostics::report gives the flat form. pact-import --json reports what did not come across in the same shape, each key on the line of the source it is written on.

Refs: P1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
facts(), drafts() and entries() turn the loaded document into Bud's prompt
config drafts and a Bud agent team back into PACT entries, beside the
grammar they follow. The module reads only the document (P-1), imports
nothing of Bud's and writes no Bud id; every result is an envelope with
bud_draft_version. bud-target.yaml, the loss table pact check --target
reads for Bud, covers every <group>.<field> in spec/schema.yaml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…target

pact check --target <table.yaml> reads a host's table in the shape of pydantic_ai_registry.yaml (rows <group>.<field>: {outcome: carried | mapped | loss, how} under fields:, anything else at the top the host's own) and walks the loaded document through the specification, listing every written field as carried, mapped or lost with its path, file, line and the row's other keys, per agent and for the workspace. An entry is the agent's it is written in, or every agent's that reaches its entry by name, by applies-to: every-agent or as the agent a port answers. The walk goes into a field only when its row keeps it. silent_losses lists every written field the table does not mention, so a new field fails a host's contract test instead of being dropped. A malformed row is target/not-an-outcome; a row naming nothing is a note. With --json the report is target in the check's object.

Refs: P2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not travel

A PACT skill is the Agent Skills layout, and a SKILL.md written for another runtime was refused for the lines that runtime reads. license, compatibility, metadata (a map of named values) and allowed-tools are skill fields now, kept as written; allowed-tools is recorded and never a permission. pydantic_ai_skills keeps the four on import and writes them back on export. loader/not-an-agent-skills-name warns when a skill's name (name:, else its folder) is not 1 to 64 lowercase letters, digits and single hyphens with no hyphen at either end, and offers the nearest one that is.

Refs: P8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hole may name only a run input, so an input the system prompt or a turn
fills is written under run-inputs, and the rest under accepts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s a runtime can bind

through: named the system that carries a port, and where in it work arrives, what sort of system it is and what it calls what arrives were left to description: prose. reached-in: (it needs through:), category: (chat, email, tickets, webhook, phone, monitoring) and arrives-as: are port fields now; arrives-as: on a timer is loader/nothing-arrives-at-a-timer. On a port that answers an agent, same-conversation-when: is written thread, channel, sender or direct-message, and anything else is loader/a-conversation-said-in-words, a warning with the word to write. ir.PortSpec reads the three. The worked example's Slack and email ports write all three and say thread, so its digest and golden document move.

Refs: P10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tool, skill or set the import never mapped stays in uses, as the
original has it, unless the key map says it was removed; a loop stage or
a policy naming it then still finds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sks somebody who exists

Four corrections that add no field. loader/a-time-with-no-zone holds for every timer, not only one answering a workflow, so refund-desk's and kernel/governed-change's weekly reviews now say in-time-zone. The schema's redaction wording says what it does: hidden for every agent at every moment of a run that carries values, and in a promoted case or a report as well. The shipped spec/questions/is-this-ok.yaml (and questions.LIBRARY) asks the-requester instead of whoever-is-running-this, which no asked-of: word means and was read as a team nobody is in; refund-desk's own questions keep support-leads. loader/where-the-rules-are counts the rules of a skill whose content is a folder of prose.

Refs: P14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… model {id, alias}

alias: is an optional line on an agent, a resource, a skill (in SKILL.md), a policy, an interceptor and a port: the name the system that runs the tree gives what it stands for. PACT keeps it as written and resolves nothing by it. A model: entry may be {id, alias}, pinning exactly what the id alone pins. The new type text-or-group:<group> reads a bare entry as the group's first field (model-pin.id), so names: pact:models holds the long entry's id as it holds a short one, and every reader of model: (egress, model kinds, settings, the grader check, discover, the deciding and origins checks) reads both through pact_loader::pins. pact show keeps each entry as written. The IR reads models as ids in order, model_aliases as {id: alias}, and alias on AgentSpec, ResourceSpec, SkillSpec and PortSpec; pydantic_ai_skills keeps a skill's alias both ways.

Refs: P19

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and what it may reach

resource-kind: host-tool names one of the runtime's own tools by capability: (web-search, web-fetch, planner, await; required on a host tool) and sets it up with settings:, the runtime's own words, kept as written and checked by nothing here. A tool connects to it and writes no actions: (loader/actions-the-runtime-supplies). A sandbox gains size: {cpus, memory}, idle-timeout: (a length of time or never) and network: (off, open, or {mode: filtered, allow, block}); text-or-group: now reads a bare value as its group's first field checked as that field is. Each line is held to its kind and its grammar (crates/pact-loader/src/hosttools.rs), and under an allow-egress: that does not list tools, a web-search or web-fetch host tool and a sandbox whose network is not off reach outside the box. ir.ResourceSpec carries the new lines.

Refs: P20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ettings

policy-settings: on an agent is keyed by a policy or interceptor that covers it (the one policy: names, one in interceptors:, or one that applies-to: every-agent), each entry with mode (enforce, observe, off), callers (end-users, agents, events), when (a list of {fact, op, value, presence} conditions on the run, in the runtime's own words) and remember-approval. A key naming a rule file that does not cover the agent is loader/a-setting-for-a-rule-that-does-not-cover-it, which names the files that do; a key naming nothing is schema/no-such-name. The worked example writes an entry on every agent, approvals and redact-card-numbers included through every-agent, so its document and digest move. ir.AgentSpec.policy_settings reads them as PolicySetting.

Refs: P21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts.sh)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bud-target.yaml gains rows for policy-setting, run-condition, model-pin,
sandbox-size and sandbox-network, so no shipped example has a silent loss.
A trigger's grouping is exported as P10's conversation word when it names
one, and kept in the port's x-bud otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Live Bud agents carry what the examples didn't: Code Interpreter with
only a CPU count (it wrote NoneGB), bindings to preset policies with no
body (policy-settings named a file it never wrote), skills whose files
storage lost (uses named a skill it never wrote), SKILL.md keys PACT's
skill has no field for (moved into metadata, as Agent Skills does), and
an empty system prompt (left out, so PACT asks for instructions in
words the builder can act on).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loader prints models/catalog.yaml whole, {version?, models: {...}},
so catalogue() saw one row called models and never the ones an export
wrote. A Bud model the shipped catalogue lacks (openai/gpt-4.1, written
as gpt-4-1 with also-known-as) then came back Not in Bud, and the
re-import couldn't preselect its deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only hide-values interceptors become a Bud policy. The rest (refund-desk's
stop-runaway-refunds counts refunds and stops the run) were dropped with
no Review line; they now read Count-based stop when a rule counts calls,
else Other interceptor actions (FRD §8.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A skill folder is an Agent Skills bundle, and Agent Skills lets a skill
carry any files beside SKILL.md: a core/ package its scripts import, a
requirements.txt. The loader read each as a field and the schema refused
it ('core' is not something a skill can have), so real bundles couldn't
load, and Bud couldn't export an agent that used one. Entries of a skill
folder whose name is no field of skill are now its files: one payload
rooted at the folder, walked with every check the attachment walk makes
(symlinks, FIFOs, size caps, fingerprints), never opened. scripts/,
references/, assets/ and the fields are unchanged. The field list is held
against the schema's skill group by a test; Bud's target table carries
skill.files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…acts

When Bud sends what it knows of a deployment's model (D-52), export now
writes a whole models/catalog.yaml row for it, even over a shipped id:
also-known-as, family, tier, served-by (the provider's -api runtime,
gemini as google-api, or the local engine), tool-calling, modality in and
out, context window and cost, with Bud's model registry as provenance.
reasoning is written as unknown, since Bud records no rung; ignores and
ignores-while-thinking are never written: Bud can't know them, and PACT
would hold the agent's settings against them.

On the way back (D-51), model_match carries each model's row facts
(family, local, runtimes, tool calling, images, documents, context
window, reasoning, thinks) for Bud's deployment rules. A fact the row
doesn't state stays None, so Bud never holds it against a deployment.
An agent with no model: asks for the workspace catalogue's default:,
marked from_default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host that runs agents for many callers keeps per agent how hard its
model thinks and for how long, how long one call may take, how many runs
go at once, its A2A card, how a voice call opens and ends, which arrivals
start one run, when a conversation is over, and what a request must
satisfy before work starts. None of it had a line in a tree, so each was
lost on the way out of such a host and back.

An author can now write:
- settings: thinking: minimal, very-high and the-model-picks;
  thinking-at-most:, call-times-out-after: and logprobs:
- on an agent: tool-tries-at-most:, serving:, card: and
  checks-what-it-is-sent:, with about: on a rule
- on a port: same-conversation-when: event.<path>,
  conversation-ends-after: and gathers:
- on a context policy: when-longer-than:, what: quote-older, folds-into:
- on voice: {id, alias} models, speaks-at, opens-with, speaking-style,
  speaks-field, hangs-up-after, calls-last-at-most and settings
- governance: policy: as a list; refuse: and tell-a-person: beside
  ask-a-person:, each with about: and applies-when:; policies and
  detectors provided-by: the-runtime; interceptors that may refuse, ask
  or tell

The loader checks each (settings.rs, and the new serving.rs,
fieldrules.rs, tidying.rs and runtimekept.rs among others). The Python
harness refuses a request that breaks a checks-what-it-is-sent: rule
before the first model call, carries out an interceptor's refusal, and
says an ask or tell it can't put in unenforced. Pydantic AI and OpenAI
Agents take the new settings words.

Bud's export writes no x-bud (Bud spec 035 D-53): every value goes to a
PACT field or a not_carried line, and the draft version is now 2. Import
still reads an earlier export's x-bud where a P24 field is absent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whatever serves a model sizes it for a typical call: how much goes in,
how much comes back, how many are going at once. An agent said only what
may happen (runs-at-once-at-most:, max-tokens:), never what usually
does, so a host that sizes its deployments had to guess, and whatever it
was sized for was lost on the way out.

serving: now takes typical-input: and typical-output: (sizes, counted
the way the model counts them) and typical-at-once:. They are what the
model is sized for, not limits. The loader warns when a typical figure
is past its ceiling: typical-at-once: above runs-at-once-at-most:,
typical-output: above settings.max-tokens:, and typical-input: above
the context-window of the model the agent runs on (its first pin, else
the workspace default), which a catalogue row now carries. A window
nobody published holds nothing against it.

Bud's Deploy form is sized from the workspace: model_match carries
deploy_figures (concurrent requests, average input and output tokens,
TTFT, end-to-end latency, per-session tokens per second), and an export
writes a deployment's figures back as serving.typical-*,
limits.first-reply-within, limits.per-word-under and
settings.call-times-out-after. A line the agent already states wins.
first-reply-within and per-word-under are now mapped, not lost.
parallel-tool-calls is read as a yes or no rather than passed on as the
word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in master's each/join gate fixes (#51, #52): a growing `each` takes
what the requests that joined the run bring, and starts no queued item once
its join has its answer.

Conflicts resolved:
- CHANGELOG.md: both sides kept, master's 3 and 2 December entries first.
- README.md, docs/90-REVIEW.md: the test counts, rewritten with
  scripts/sync-counts.sh (which also updates site-docs/index.md and
  site-docs/status/verified.md): 5606 tests, 1817 Rust + 3789 adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant