Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ be checked, maintained, and restored across bounded runs:
| `prose compile` | Run the bundled OpenProse compiler program, emit `<openprose-root>/dist/manifest.next.json`, and validate it before success |
| `prose serve` | Load active IR and run local cron and HTTP trigger adapters |
| `prose run` | Execute one bounded OpenProse VM activation |
| `prose write` | Author a validated OpenProse program package from rough English/pseudo-Prose, asking targeted shape/root questions in interactive hosts and returning `unresolved-intent` only for non-interactive missing decisions |
| `prose write` | Author a validated OpenProse program package from rough English/pseudo-Prose; `--out <path> --apply` writes the package after lint passes, and host adapters that support `--run` expand it to write/apply followed by ordinary `prose run <generated-root>` |
| `prose status` | Inspect active IR, diagnostics, trigger plan, recent runs, and responsibility status/pressure |

The compiled Responsibility Runtime manifest preserves responsibilities as
Expand Down
2 changes: 1 addition & 1 deletion packages/std/ops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ come back as `unresolved-intent` instead of terminal prompts.
| `preflight.prose.md` | `prose preflight <file>` | Check that dependencies are installed and environment variables are set |
| `wire.prose.md` | `prose run std/ops/wire` | Run Forme wiring to produce an execution manifest |
| `status.prose.md` | `prose status` | Show recent runs with system name, duration, and pass/fail status |
| `prose-author.prose.md` | `prose write [request...]` | Interactive-by-default authoring of a validated OpenProse package from rough English or pseudo-Prose |
| `prose-author.prose.md` | `prose write [--out <path>] [--apply] [--run] [request...]` | Interactive-by-default authoring of a validated OpenProse package from rough English or pseudo-Prose; `--out --apply` may write it, and host adapters that support `--run` expand it to write/apply followed by ordinary `prose run <generated-root>` |
| `diagnose.prose.md` | `prose run std/ops/diagnose` | Diagnose why a run failed -- root cause analysis with fix recommendations |
| `profiler.prose.md` | `prose run std/ops/profiler` | Profile a run for cost, tokens, and time using actual API session data |

Expand Down
83 changes: 75 additions & 8 deletions packages/std/ops/prose-author.prose.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,25 @@ decisions instead of guessing.
### Requires

- `output_mode`: output mode requested by the caller. `prose write` passes
`source-package-only`; in that mode the system must return source content and
apply notes only.
`source-package-only` by default; shell `--out --apply` and `--out --run`
pass `source-package-and-files`, where the system must write the generated
source after validation and still return a reviewable summary.
- `apply`: whether this run is allowed to write generated source into the
caller's repository. `prose write` passes `false`.
caller's repository. `prose write` passes `false` by default; shell
`--apply` and `--run` pass `true`.
- `target_path`: optional root-relative file or folder path selected by the
caller. When present with `apply: true`, generated files must stay under this
path. Folder targets use `index.prose.md` as the root file; file targets must
end in `.prose.md`.
- `post_apply_action`: optional non-operational host follow-up marker. `none`
means no known host follow-up; `host-will-run-root` means the invoking host
adapter intends to run the generated root as a separate top-level
`prose run` after successful apply. This marker does not authorize
`prose-author` to run, simulate, or publish receipts for the generated root.
- `run_state`: preferred run-state mode. `prose write` passes `in-context` so
package-only authoring avoids creating run artifacts in the caller's
workspace when the host can honor that mode.
workspace when the host can honor that mode. Apply-enabled shell runs may
pass `filesystem`.
- `terminal_summary`: whether a concise final terminal status block is required.
`prose write` passes `required`.
- `interactive`: whether the host may ask targeted follow-up questions before
Expand Down Expand Up @@ -106,6 +118,9 @@ decisions instead of guessing.
- Landscape inspection is read-only: it may list and read nearby source,
configuration, and OpenProse layout markers, but it must not create, modify,
delete, format, install, compile, or migrate files.
- Apply-enabled source writing may happen only after planning, linting, and
repair pass. It must be limited to the generated files under `target_path`
and must not modify unrelated repository files.
- When `output_mode` is `source-package-only` or `apply` is `false`, generated
files are returned as source package content and optional apply notes only.
The authoring run must not write generated files to the caller's repository,
Expand Down Expand Up @@ -148,6 +163,14 @@ decisions instead of guessing.
issue trackers, status pages, deploy systems, feature flags, and similar
integrations are declarations or future runtime tools in the returned
package, never actions performed by `prose-author`.
- Authoring must not create optional memory notes, mycelium entries,
recognition memories, issue drafts, run evidence, or other non-source
artifacts while applying a generated package. Successful authoring depends
only on the generated source package, lint/repair checks, and explicitly
requested writes under `target_path`.
- `post_apply_action` is advisory only. `prose-author` must not execute,
simulate, or publish run receipts for the generated root; follow-up execution
belongs to the host adapter and ordinary `prose run` semantics.

### Tools

Expand Down Expand Up @@ -177,7 +200,9 @@ decisions instead of guessing.
`co/...`, or `github.com/owner/repo/path`. Do not invent bare `owner/repo`
registry references.
- Do not write directly to the caller's repository. Return a package and patch
notes; a separate file-writing step can apply it after human review.
notes unless `apply: true` and `target_path` are explicitly present. In
apply-enabled mode, write only the generated source package under
`target_path` after lint passes.
- Treat any request phrase such as "under src/foo" or "add it to this repo" as
a desired package path when `apply: false`, not as permission to create files.
- Use CLI-facing language for `prose write`: describe the result as an
Expand All @@ -194,6 +219,8 @@ let authoring_intent = call intent-normalizer
request: request
output_mode: output_mode
apply: apply
target_path: target_path
post_apply_action: post_apply_action
run_state: run_state
terminal_summary: terminal_summary
interactive: interactive
Expand Down Expand Up @@ -230,6 +257,9 @@ let source_plan = call source-planner
landscape: landscape
shape_decision: triage_result.shape_decision
guidance_report: guidance_report
apply: apply
target_path: target_path
post_apply_action: post_apply_action

let draft_source_package = call source-author
source_plan: source_plan
Expand All @@ -239,6 +269,7 @@ let draft_source_package = call source-author
guidance_report: guidance_report
output_mode: output_mode
apply: apply
target_path: target_path

let lint_report = call source-linter
draft_source_package: draft_source_package
Expand Down Expand Up @@ -270,6 +301,9 @@ let assembled = call package-assembler
landscape: landscape
shape_decision: triage_result.shape_decision
guidance_report: guidance_report
apply: apply
target_path: target_path
post_apply_action: post_apply_action

return {
source_package: assembled.source_package,
Expand All @@ -291,6 +325,10 @@ Normalize the caller's rough request into an explicit authoring intent.
brief from the caller
- `output_mode`: caller output mode, usually `source-package-only`
- `apply`: whether this authoring run may write files, usually `false`
- `target_path`: optional root-relative destination for generated source
- `post_apply_action`: non-operational host follow-up marker, usually `none`;
`host-will-run-root` means the host adapter intends to invoke ordinary
`prose run` after successful apply
- `run_state`: preferred run-state mode, usually `in-context`
- `terminal_summary`: whether the final status block is required
- `interactive`: whether targeted follow-up questions are allowed before source
Expand All @@ -309,6 +347,9 @@ Normalize the caller's rough request into an explicit authoring intent.
persistence, memory, and safety boundaries implied by the request
- output_mode: caller output mode, preserved for downstream authoring
- apply: caller apply flag, preserved for downstream authoring
- target_path: caller destination path, preserved for downstream authoring
- post_apply_action: caller follow-up marker, preserved for downstream
authoring but never executed by `prose-author`
- run_state: caller run-state preference, preserved for downstream
authoring
- terminal_summary: caller terminal-summary requirement, preserved for
Expand Down Expand Up @@ -458,6 +499,10 @@ planning begins.
or a graph that should be edited service-by-service later.
- Choose a native OpenProse root only when the landscape already looks native or
the user is clearly creating an OpenProse repository.
- When `target_path` is present, treat it as the binding destination for the
package. If it ends in `.prose.md`, choose single-file output at that file.
Otherwise choose a folder-shaped package rooted at `target_path` with
`index.prose.md` as the runnable root unless the request makes that invalid.
- Choose an attached sidecar root for ordinary application repositories where
generated Prose should live alongside, not inside, the app source.
- Choose user-global only when the user asks for a personal agent, cross-repo
Expand Down Expand Up @@ -573,6 +618,11 @@ Plan the generated file tree and contracts before drafting source.
`interactive-triage`
- `guidance_report`: baseline and shape-specific guidance from
`guidance-loader`
- `apply`: whether this run may write generated files
- `target_path`: optional root-relative destination for generated files
- `post_apply_action`: non-operational host follow-up marker;
`host-will-run-root` means the host adapter intends to run the generated root
after successful apply

### Ensures

Expand Down Expand Up @@ -647,6 +697,8 @@ Draft the planned source package.
`guidance-loader`
- `output_mode`: caller output mode, usually `source-package-only`
- `apply`: whether this authoring run may write files, usually `false`
- `target_path`: optional root-relative destination for apply-enabled source
writing

### Ensures

Expand All @@ -669,6 +721,9 @@ Draft the planned source package.
- In `source-package-only` or `apply: false` mode, include the chosen paths and
full file contents in `draft_source_package`; do not write those paths to the
filesystem.
- In `source-package-and-files` with `apply: true`, still draft the package as
explicit file paths plus contents. The later `package-assembler` performs the
filesystem write only after lint passes.
- Use current Contract Markdown headings exactly. Unknown `###` sections may
be preserved only as documentation, never as hidden runtime behavior.
- Make every `### Ensures` item named, evaluable, and specific enough for a
Expand Down Expand Up @@ -800,6 +855,11 @@ Repair blocking lint findings without changing the caller's intent.
`interactive-triage`
- `guidance_report`: baseline and shape-specific guidance from
`guidance-loader`
- `apply`: whether this authoring run may write files
- `target_path`: optional root-relative destination for generated source
- `post_apply_action`: non-operational host follow-up marker;
`host-will-run-root` means the host adapter intends to run the generated root
after successful apply

### Ensures

Expand Down Expand Up @@ -862,10 +922,11 @@ Publish the validated source package and concise next-step notes.
- `source_package`: `returned`
- `shape`: chosen package shape
- `root`: selected root file or root folder
- `apply`: `false` for `prose write`
- `files_written`: `none` when no generated source files were applied
- `apply`: whether generated source files were applied
- `files_written`: `none` when no generated source files were applied, or
a compact list/count of files written under `target_path`
- `lint`: `pass`
- `next`: recommended command or manual apply step
- `next`: recommended command, host follow-up note, or a manual apply step

### Errors

Expand All @@ -876,8 +937,14 @@ Publish the validated source package and concise next-step notes.
- Do not publish a package when `lint_report` has blocking findings.
- Keep final output reviewable: include paths first, then file contents in the
same order a human would open them.
- When `apply: true`, write the generated source files only after
`lint_report.status` is `pass`, only under `target_path`, and report the
concrete files in `files_written`.
- Do not claim files were written to the caller's repository unless this run
actually wrote them through an explicitly requested file-writing step.
- Do not claim a follow-up run happened during authoring. When
`post_apply_action` is `host-will-run-root`, report only that the host adapter
is expected to invoke ordinary `prose run` after this authoring run succeeds.
- End every successful package-only response with `final_status_summary` so a
terminal user can distinguish success from validation failure at a glance.
- When `terminal_summary` is `required`, treat the final status block as part of
Expand Down
15 changes: 14 additions & 1 deletion skills/open-prose/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ executing the system. The shell executable is the agent runner, e.g.
| `prose run runtime/judge-responsibility.prose.md` | Resolve from the OpenProse skill root; judge one responsibility from activation context |
| `prose run <host>/<owner>/<repo>[/path]` | Resolve installed dependency service or system, detect format, then route as above |
| `prose run std/...` / `co/...` | Expand OpenProse package shorthand, resolve installed dependency service or system, then route as above |
| `prose write [request...]` | Interactive-by-default authoring: load `contract-markdown.md`, `guidance/tenets.md`, and `guidance/authoring.md`; run `std/ops/prose-author`; scan the local landscape read-only, decide shape/root/path, load shape-specific guidance, ask a small number of targeted `ask_user` questions when the host can support them, then return a fully validated source package. If the caller or host marks the run non-interactive, return `unresolved-intent` with the missing decisions instead of guessing. Do not apply files unless the caller explicitly asks for that follow-up |
| `prose write [--out <path>] [--apply] [--run] [request...]` | Interactive-by-default authoring: load `contract-markdown.md`, `guidance/tenets.md`, and `guidance/authoring.md`; run `std/ops/prose-author`; scan the local landscape read-only, decide shape/root/path, load shape-specific guidance, ask a small number of targeted `ask_user` questions when the host can support them, then return a fully validated source package. If the caller or host marks the run non-interactive, return `unresolved-intent` with the missing decisions instead of guessing. Apply generated files only when the caller explicitly passes apply permission, normally through `--out <path> --apply`; `--run` is a host-adapter macro that implies apply permission and expands to an ordinary `prose run <generated-root>` only after authoring succeeds |
| `prose lint <file.prose.md>` | Validate Contract Markdown structure, headers, frontmatter, contracts, shapes, and wiring |
| `prose preflight <file.prose.md>` | Check dependencies and `### Environment` declarations without executing |
| `prose test <path>` | Load `contract-markdown.md`, `state/README.md` plus the selected backend, and `prose.md`; run `kind: test` file(s) |
Expand All @@ -142,6 +142,13 @@ executing the system. The shell executable is the agent runner, e.g.
| `prose examples` | List or run bundled examples from `examples/` |
| Other | Interpret intent and load the smallest relevant spec set |

`prose write --run` is a host-adapter macro. A host that supports it must run
it as two top-level operations: invoke `prose-author` with apply permission,
then invoke ordinary `prose run` semantics for the generated root only if
authoring succeeds. A host that cannot perform this macro must reject
`prose write --run` before authoring and must not pass the macro into
`prose-author`.

There is one skill: `open-prose`. Do not look for separate `prose-run`,
`prose-lint`, `prose-compile`, or `prose-boot` skills.

Expand Down Expand Up @@ -351,6 +358,12 @@ When writing a `### Execution` block or pattern delegation, also load

You do not owe OpenProse anything. But if a run went well and you want to help the next agent succeed, here are the ways — and the gates each one needs.

Forwarded CLI commands, non-interactive runs, and `prose write` authoring runs
must not perform giving-back actions, save recognition memories, create
mycelium notes, file issues, or otherwise write optional non-source artifacts
unless the outer user explicitly asked for that action in the current run.
Authoring success must not depend on optional memory or note writes.

You are the user's proxy. Actions attach to identities, and the identity determines what you can do on your own vs. what needs approval:

| Identity attached | Bucket | Approval gate |
Expand Down
2 changes: 1 addition & 1 deletion skills/open-prose/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Options:
| `prose compile [path] [--out <dir>]` | Compile source into `<openprose-root>/dist/manifest.next.json` |
| `prose serve` | Serve the active IR as local cron and HTTP trigger adapters |
| `prose run <file.prose.md>` | Run a service or system |
| `prose write [request...]` | Interactive-by-default authoring from rough English/pseudo-Prose into a validated source package; non-interactive runs return `unresolved-intent` when more detail is required |
| `prose write [--out <path>] [--apply] [--run] [request...]` | Interactive-by-default authoring from rough English/pseudo-Prose into a validated source package; `--out <path> --apply` writes it after lint passes, and host adapters that support `--run` expand it to write/apply followed by ordinary `prose run <generated-root>` |
| `prose lint <file.prose.md>` | Validate structure, schema, and contracts |
| `prose preflight <file.prose.md>` | Check dependencies and environment |
| `prose test <test.prose.md>` | Run tests with assertions |
Expand Down
2 changes: 1 addition & 1 deletion skills/open-prose/prose.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ codex exec "prose run system.prose.md"
| `prose run <owner>/<repo>` | Reserved for the OpenProse registry (future home at `p.prose.md`) |
| `prose run ...@<version>` | Pin to a SHA or tag; require that version in `<openprose-root>/deps/` |
| `prose run ... --offline` | Require disk-only resolution; error if not in `<openprose-root>/deps/` |
| `prose write [request...]` | Interactive-by-default authoring through `std/ops/prose-author`, asking targeted shape/root questions when supported and returning a validated source package |
| `prose write [--out <path>] [--apply] [--run] [request...]` | Interactive-by-default authoring through `std/ops/prose-author`, asking targeted shape/root questions when supported and returning a validated source package; `--out --apply` writes it when permitted, and host adapters that support `--run` expand it to write/apply followed by ordinary `prose run <generated-root>` |
| `prose lint <file.prose.md>` | Validate structure, schema, shapes, and contracts |
| `prose preflight <file.prose.md>` | Check dependencies, declared tools, and environment variables |
| `prose test <path>` | Run test(s) and report results |
Expand Down
Loading
Loading