Files
openprose__prose/packages/std/composites/stochastic-probe.md
irl-dan 63c8ce4b23 Migrate std and co into packages/ monorepo layout
Move the standard library (previously `github.com/openprose/std`) and
the company-as-prose library (previously local dir
`/Users/sl/code/openprose/company-as-prose`) into this repository
under `packages/std/` and `packages/co/` respectively.

Motivation: concentrate attention on one repository so stars,
discussions, and issues aggregate. `openprose/std` was a genuinely
useful asset nobody could find because ~50 stars on its own repo
told a much worse story than 1,106 stars on `openprose/prose`
would have. Same logic applies to co.

Layout choice: `packages/{std,co}/` rather than `std/` + `co/` at
the repo root. Root siblings accumulate over time, and a flat
top-level made future libraries (hub, kit, dev, etc.) compete with
spec infrastructure. `packages/` is bounded — new libraries land
there without cluttering root. Matches pnpm/Deno/monorepo tooling
conventions.

Changes:

- New: `packages/std/` (copied from openprose/std, `.git` excluded)
- New: `packages/co/` (copied from company-as-prose, README updated
  for new name and location)
- `packages/std/README.md`: updated shorthand expansion reference
- `packages/co/README.md`: renamed "company-as-prose" to "co" in
  self-references, added std-vs-co split heuristic, updated
  `prose run` examples to use `co/` shorthand
- `skills/open-prose/deps.md`:
  - `std/` shorthand now expands to
    `github.com/openprose/prose/packages/std/`
  - `co/` shorthand added, expands to
    `github.com/openprose/prose/packages/co/`
  - Both shorthands resolve into the same clone of
    `openprose/prose` under `.deps/github.com/openprose/prose/`;
    `packages/std/` and `packages/co/` are sibling subdirectories
  - `prose.lock` format row updated to `host/owner/repo sha`
    (matches the explicit-host resolution that landed in #35)
  - `.deps/` directory structure example redrawn to show the
    `{host}/{owner}/{repo}/packages/{std,co}/...` shape
  - Error message and Interaction tables refreshed accordingly
  - Resolution Algorithm step 1 now documents both shorthands
- `skills/open-prose/forme.md`: Step 2 resolution list updated to
  include co/ shorthand and the host-keyed `.deps/` layout
- `skills/open-prose/help.md`: Q&A "How do dependencies work?"
  rewritten to name both shorthands and the new explicit-host model
- `skills/open-prose/state/filesystem.md`: `.deps/` directory
  tree re-drawn to include the `{host}/` layer with std/co as
  sibling packages inside the clone
- `skills/open-prose/guidance/patterns.md`,
  `skills/open-prose/guidance/antipatterns.md`: examples now use
  the `std/` shorthand or explicit `github.com/...` rather than
  the deprecated bare `openprose/std/` form
- `skills/open-prose/examples/registry-import/index.md`: sample
  service reference switched to `std/evals/inspector`
- `README.md`: Stdlib badge replaced with internal `packages/std/`
  link plus new `packages/co/` link; "Standard Library" section
  rewritten as "Libraries" with both packages described

Out of scope for this PR (deliberately):
- Tooling changes to `prose install` and Forme's `.deps/` writer
  to adopt the `{host}/{owner}/{repo}/` layout in practice — this
  PR is spec-only. Existing tooling continues to work against
  whatever layout it currently implements; the spec now describes
  the target.
- Retiring the `openprose/std` GitHub repo. Delete that repo
  separately after this merges.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:14:31 -07:00

4.7 KiB

name, kind
name kind
stochastic-probe composite

Stochastic Probe

Run the same agent on the same material N times. Variance in responses measures how much the material underdetermines its interpretation.

Description

Run the same agent on identical inputs N times; variance in responses measures how much the material underdetermines interpretation.

Metadata

  • version: 0.1.0

Slots

  • probe (primary)
    • requires: task_brief, material
    • ensures: response
  • analyst
    • requires: responses
    • ensures: analysis

Config

  • sample_size (number, default: 7): Number of identical probe runs
  • model (string, default: none): Model tier to probe at — fixing the tier isolates material variance from capability variance
  • task_brief (string, default: none): The question to pose against the material
  • material (string, default: none): The corpus or artifact to examine

Invariants

  • All N runs receive identical inputs — same brief, same material, same model
  • Temperature and sampling inherent to the model are the only source of variation

Shape

  • self: run probe N times with identical inputs, collect responses, delegate variance analysis
  • delegates:
    • probe: respond to the brief — run N times with identical configuration
    • analyst: quantify variance across N responses, classify determinism
  • prohibited: none

Requires

  • &compositeState exists at __compositeState with: probe: string -- component name for the probe agent analyst: string -- component name for the variance analyst task_brief: string -- the question to pose against the material material: string -- the corpus or artifact to examine sample_size: number -- (optional, default 7) number of runs model: string -- (optional) model tier to probe at — fixing the tier isolates material variance from capability variance

Ensures

  • All N runs receive IDENTICAL inputs — same brief, same material, same model
  • Temperature and sampling inherent to the model are the ONLY source of variation
  • Analyst receives all N responses and classifies the material as:
    • Deterministic: responses are substantively identical — the material constrains interpretation tightly
    • Underdetermined: responses vary in specific areas — those areas permit multiple valid readings
    • Chaotic: responses vary widely — the material fails to constrain interpretation at all
  • Analyst identifies WHICH aspects of the responses vary and which are stable
  • &compositeState.result contains the analyst's classification and variance map
  • &compositeState.responses contains the N raw responses

Delegation Loop

const { probe, analyst, task_brief, material, sample_size = 7, model } = __compositeState;

// Run the same probe N times — identical inputs
const responses = [];
for (let i = 0; i < sample_size; i++) {
  const opts = model ? { use: probe, model } : { use: probe };
  const response = await rlm(
    `${task_brief}\n\nMaterial:\n${material}`,
    null,
    opts
  );
  responses.push(response);
}

// Analyst measures variance
const analystBrief = `${sample_size} identical runs of the same agent on the same material produced the following responses. The agent, prompt, and material were identical across all runs — any variation comes from the material's ambiguity, not the agent's inconsistency.

Analyze:
1. Which aspects of the responses are STABLE across all runs? (The material determines these.)
2. Which aspects VARY? (The material underdetermines these — multiple valid readings exist.)
3. Classify the material overall:
   - DETERMINISTIC: responses substantively identical
   - UNDERDETERMINED: specific aspects vary, others stable
   - CHAOTIC: responses vary widely with no stable core

For underdetermined material, identify the specific passages or aspects that permit multiple readings.

Original task: ${task_brief}

Responses:
${responses.map((r, i) => `--- Run ${i + 1} ---\n${r}`).join("\n\n")}`;

const analysis = await rlm(analystBrief, null, { use: analyst });

__compositeState.result = analysis;
__compositeState.responses = responses;
return(analysis);

Notes

This is a seed pattern. The probe does not know it is being run multiple times. The analyst does not know it is part of a stochastic probe composite. The measurement is orthogonal to blind-review: blind-review measures cross-tier divergence (is the material clear to different capability levels?), while stochastic probe measures within-tier stability (does the material produce the same reading every time?). Material can be clear but underdetermined (everyone understands it, but they understand it differently each time) or deterministic but complex (it always produces the same reading, but only at high tiers).