Files
openprose__prose/packages/std/composites/oversight.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

3.9 KiB

name, kind
name kind
oversight composite

Oversight

Actor acts, observer watches outcomes independently, arbiter decides next step based on the observer's report — not the actor's self-assessment.

Description

Actor executes, observer independently analyzes outcomes, arbiter decides whether to continue, adjust, or abort.

Metadata

  • version: 0.1.0

Slots

  • actor (primary)
    • requires: task_brief, adjustment (if prior cycle was adjusted)
    • ensures: execution outcome
  • observer
    • requires: task_brief, actor outcome
    • ensures: independent analysis of the outcome
  • arbiter
    • requires: task_brief, observer report
    • ensures: {'decision': 'continue'}, adjust, or abort

Config

  • task_brief (string, default: none): The task for the actor to perform
  • max_cycles (integer, default: 3): Maximum oversight cycles

Invariants

  • The observer sees only the outcome, never the actor's reasoning or self-assessment
  • The actor does not know an observer is watching
  • The observer does not know an arbiter will act on its report
  • The arbiter decides solely from the observer's report, not from the actor

Shape

  • self: manage the cycle, route information between roles, enforce separation
  • delegates:
    • actor: execute the current plan
    • observer: independently analyze the outcome
    • arbiter: decide: continue, adjust, or abort
  • prohibited: none

Requires

  • &compositeState exists at __compositeState with: actor: string -- component name for the actor observer: string -- component name for the observer arbiter: string -- component name for the arbiter task_brief: string -- the task to execute max_cycles: number -- (optional, default 3)

Ensures

  • Actor receives the task brief (first cycle) or adjusted brief (subsequent cycles)
  • Observer receives ONLY the outcome — not the actor's reasoning or self-assessment
  • Arbiter receives the observer's report and decides: continue, adjust, or abort
  • If arbiter says adjust: the adjustment is passed to the actor's next cycle
  • If arbiter says abort: return immediately with the reason
  • If arbiter says continue: actor runs another cycle with the same brief
  • &compositeState.result contains the final outcome
  • &compositeState.cycles contains the number of cycles run

Delegation Loop

const { actor, observer, arbiter, task_brief, max_cycles = 3 } = __compositeState;
let currentBrief = task_brief;
let lastOutcome = null;

for (let cycle = 0; cycle < max_cycles; cycle++) {
  // Actor executes
  lastOutcome = await rlm(currentBrief, null, { use: actor });

  // Observer analyzes the outcome — no access to actor's reasoning
  const observerBrief = `Analyze this outcome independently.\n\nTask: ${task_brief}\nOutcome:\n${lastOutcome}`;
  const observation = await rlm(observerBrief, null, { use: observer });

  // Arbiter decides based on observer's report
  const arbiterBrief = `Based on this independent observation, decide: continue, adjust, or abort.\n\nTask: ${task_brief}\nObserver report:\n${observation}`;
  const decision = await rlm(arbiterBrief, null, { use: arbiter });

  const decisionStr = String(decision).toLowerCase();
  if (/abort/.test(decisionStr)) {
    __compositeState.result = lastOutcome;
    __compositeState.cycles = cycle + 1;
    __compositeState.abort_reason = decision;
    return(lastOutcome);
  }

  if (/adjust/.test(decisionStr)) {
    currentBrief = `${task_brief}\n\nAdjustment from oversight: ${decision}`;
  }
  // "continue" → loop with same or adjusted brief
}

__compositeState.result = lastOutcome;
__compositeState.cycles = max_cycles;
return(lastOutcome);

Notes

The actor does not know an observer is watching. The observer does not know an arbiter will act on its report. The information firewall between actor and observer is the structural guarantee — the observer's assessment cannot be contaminated by the actor's rationalization.