Add explicit OpenProse context envelope - #100
Conversation
26ff19a to
885b7ab
Compare
885b7ab to
cbc215a
Compare
|
I refreshed this PR as a stacked follow-up on #145 ( Current shape:
Why this is stacked on #145#145 moved
The stacked shape lets those pieces evolve together in one repo. It also reduces drift: if What problem this PR is solvingWhen writing
Before this PR, authors could put that material somewhere informal, but the language did not give it a stable contract home. That creates two bad outcomes:
This PR gives that material a named section: The design decision
It is not dependency injection. It is not a payload slot. It does not create Forme edges. It cannot satisfy That distinction is the center of the change. The feature is useful only if it gives authors a clearer place to put grounding while preserving OpenProse's existing dependency model:
The shorthand is:
What changed in the language docsThe docs now define The key language is:
The updated files are:
The Public runnable exampleThis PR now includes a committed Context example, not just tests with generated temporary sources:
The example is intentionally small: The point of the example is to make the boundary inspectable:
How reviewers can run the example checksThe deterministic path is the one I would recommend reviewers start with. It runs offline, uses fake compile providers/fake renders, and exercises the committed example source through the Reactor CLI test path: REACTOR_OFFLINE=1 pnpm --filter @openprose/reactor-cli build:test
REACTOR_OFFLINE=1 node --test packages/reactor-cli/dist-test/__tests__/compile.test.js
REACTOR_OFFLINE=1 node --test packages/reactor-cli/dist-test/__tests__/run.test.js
REACTOR_OFFLINE=1 node --test packages/reactor-cli/dist-test/__tests__/connectors.test.jsThe important passing lines to look for are: The committed example also has ordinary source-shape coverage: cargo run -p openprose-lint -- lint --profile strict skills/open-prose/examples/context-boundary/src
REACTOR_OFFLINE=1 pnpm test:examplesExpected result:
For a manual live Reactor run, from the example directory: cd skills/open-prose/examples/context-boundary
reactor doctor
reactor compile
reactor topology
reactor trigger request-inbox --data '{"id":"ctx-demo-001","source_revision":"manual","goal":"Summarize what the Context boundary allows."}'
reactor receiptsWhat reviewers should see in a successful live run:
What changed in the linter
Concretely:
The capability tests prove two important things:
This is important because it gives us a deterministic way to say "this program uses Context; this harness says it can or cannot provide the declared context boundary." What changed in Reactor compile/runReactor now preserves Context through the compile/run surfaces that matter for reviewability and cache correctness. The branch updates:
The important runtime behavior is that the render sees This matters for cache correctness: editing What changed in render instructionsThe render instruction layer now includes Context in the node contract. The wake header also became more explicit about upstream truth:
That distinction is intentional. Context can guide the render, but upstream facts still come from the declared world-model surfaces. What changed in
|
Summary
This adds an explicit worker-frame context boundary for OpenProse runs.
### Contextas a service-local, read-only allow-list separate from### Requires.PROSE_OPENPROSE_ROOT, activation id, and explicit OpenProse skill-root override.Why This Shape
### Requiresand### Contextnow have different jobs.### Requiresis the task interface: values the service needs in order to run.### Contextis a read-only background allow-list: material the VM is allowed to place inside that worker frame. If requested context is missing, the worker should fail closed or produce missing-context evidence instead of reconstructing it from ambient parent context.That gives OpenProse a cleaner boundary for multi-agent systems: the parent can have broad context, private scratch, sibling outputs, and operational details, while each worker receives only the task, declared inputs, declared context, workspace path, and output instructions it needs.
To make that boundary auditable, the VM writes a worker launch envelope before spawning a worker. The envelope records what classes of input were included and which classes were intentionally absent. This is stronger than relying only on the worker's final answer, because it captures the launch boundary before the model runs.
Validation
The committed CLI tests cover the public contract surface:
### Contextdocumentation, worker-launch-envelope documentation, active-root bootstrap instructions, shared Codex/Claude Code harness routing, explicit skill-root overrides, and fail-closed invalid override behavior.In addition to those committed checks, I tested the shape with a local context-boundary run that deliberately mixed safe context with private parent-only material.
The run checked that:
I also ran polarity controls for the envelope rule:
Those checks are why this PR uses both a declared
### Contextsection and a launch envelope: the section expresses intent, and the envelope proves what actually crossed the worker boundary.The CLI bootstrap path is shared by the Codex and Claude Code harness adapters. This PR updates that shared path so forwarded runs receive the active OpenProse root, activation id, and skill-root override consistently. The focused CLI tests cover both harness routing and the shared bootstrap contract; the local runtime proof exercised the Codex harness path.
Local Checks
vitest --run tests/skills/open-prose.test.tstsc -p tsconfig.json --noEmittsc -p tsconfig.build.jsonubsscan on changed files