Skip to content

Law 8 at instantiation: a helper, a skill and a snippet are checked as documents - #25

Merged
jithinAB merged 4 commits into
masterfrom
pact-kernel/law8-instantiation
Nov 14, 2026
Merged

jithinAB merged 4 commits into
masterfrom
pact-kernel/law8-instantiation

Conversation

@jithinAB

Copy link
Copy Markdown
Contributor

Law 8 says anything a run creates passes the same checker before it can be asked, and names three such things: a run-code snippet, a narrowed-new helper and a skill a run wrote (97 §4, law 8). The reference checked a learning proposal's instructions: (check_instructions) and none of the three. This adds the documents they are checked as, so a runtime that instantiates them checks them the way this one checks a proposal, and two runtimes check the same document.

What changes

  • checking.with_helper(document, starter, instructions, description=, uses=): the starter's own entry under <starter>-helper (the next free -2, -3… when taken), without its name:, told instructions, on the starter's model. uses may narrow it; a name the starter lacks raises NotNarrower with delegation.beyond_its_starter's sentence, so a model reads the same refusal from either.
  • checking.with_skill(document, agent, name, description, content, use_when=): a skills: entry, named in the agent's uses: when the agent writes one.
  • checking.with_program(document, language, code, description=, runs_for_at_most_ms=): a nondeterministic program under run-code-<first 12 hex of the code's sha256>, its fuel the run's own ceiling and stop-and-say-so. PACT records a program's body and never opens it, so the code is not part of what is checked. A language with no engine raises Uncheckable.
  • checking.literal(text, document): words a model wrote are checked literally. Under the default template language {{ is written \{{; under template-language: jinja the words go in raw blocks, an {% endraw %} inside them written between two blocks as a string.
  • check_document on the result is the check, as for a proposal.

Evidence

  • tests/test_what_a_run_instantiates_passes_the_same_checker.py (6 tests, real checker): a helper of examples/kernel/phases passes and is its starter told something else; a narrower helper passes and a wider one is refused in beyond_its_starter's words; the next free key; a written skill passes and one whose description says nothing is refused; a snippet is a program with the run's ceiling, and a language with no engine is uncheckable; both template languages read model words literally.
  • The same rules, in TypeScript, check the helper, skill and program of every runnable agent of this repository's examples and test trees against the pinned checker in Bud Meta Harness (packages/pact/pact-runtime/src/instantiate.ts, packages/pact/pact-loader/tests/instantiate.pact.ts).
  • The full adapter suite on this branch: 3127 passed, 4 failed, of which one fails on master too (test_the_second_port_reports_a_spend_cap_it_cannot_price) and three were this change's own bookkeeping, fixed in the same commit: the headline test count (now 4923: 1642 Rust + 3281 adapter) and the host-API rows (with_helper, with_skill and with_program added; delegation.beyond_its_starter is reached now, so its row goes).

Nothing changes in the specification or the crates.

🤖 Generated with Claude Code

jithinAB and others added 4 commits November 13, 2026 11:04
…s documents

Law 8 says anything a run creates passes the same checker before it can be
asked, and names a run-code snippet, a narrowed-new helper and a skill a run
wrote. The reference checked a learning proposal's instructions and none of
the three. checking.py gains the documents they are checked as:

- with_helper: the starter's own entry under <starter>-helper, told the
  helper's instructions, on the starter's model; `uses` may narrow it, and
  anything the starter lacks raises NotNarrower with beyond_its_starter's
  sentence (now reached, so its host-API row goes).
- with_skill: a skills entry, named in the agent's uses when it writes one.
- with_program: a nondeterministic program under run-code-<sha12>, its fuel
  the run's ceiling; a language with no engine is Uncheckable.
- literal: a model's words are checked literally (\{{, or Jinja raw blocks).

Bud Meta Harness builds the same documents in TypeScript and checks every
runnable agent of the examples and test trees with them.

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

# Conflicts:
#	CHANGELOG.md
#	README.md
#	docs/90-REVIEW.md
#	site-docs/index.md
#	site-docs/status/verified.md
…stantiation

# Conflicts:
#	CHANGELOG.md
#	README.md
#	docs/90-REVIEW.md
#	site-docs/index.md
#	site-docs/status/verified.md
…stantiation

# Conflicts:
#	CHANGELOG.md
#	README.md
#	docs/90-REVIEW.md
#	site-docs/index.md
#	site-docs/status/verified.md
@jithinAB
jithinAB marked this pull request as ready for review November 14, 2026 05:54
@jithinAB

Copy link
Copy Markdown
Contributor Author

Marked ready and merged on the owner's instruction (BMH lane pact-kernel). BMH's PK-13b holds what a run creates (helpers, skills, programs) to this check; merging it lets the next re-pin retire BMH's own copy of the instantiation rule.

@jithinAB
jithinAB merged commit 6aac092 into master Nov 14, 2026
1 of 2 checks passed
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