You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e06e783
Browse filesBrowse the repository at this point in the historyBrowse files
✨ Turn a request into a Plan with a packaged command document (#260)
`xmd prompt` now executes two roots with a scope boundary between them. First
`src/documents/prompt-command.md`, the checked-in first-party Markdown that
implements the conversion and its review workflow; then the Plan it returned,
through the ordinary supplied-source path. The TypeScript authorship loop —
`author()`, `evaluate()` and `review()` — is gone: what the assistant is asked,
how many drafts may be fixed, how many you are shown and what happens when you
approve nothing are readable Markdown now, and arguable.
A Plan is not a script with comments. The shipped generation, repair and
revision instructions ask for every requested outcome as reader-facing prose
with each component placed immediately after the sentences describing what it
does, so the source can be audited and the execution followed by the same
narrative. That authorship rule is the document's and human review's; it is
never a hidden validation rule.
The prompt profile is what that document runs inside. The assistant gets an
empty directory of this host's own, no additional directories, no MCP servers,
no native tools and a strict denial answered inside the provider — so nothing
composed around it can widen a ceiling with nothing in it, and `--approve-all`
configures the approved Plan rather than the conversation that wrote it. The
document itself reaches no Files, command, service or network capability, runs
against no repository component search, and cannot opt out of a failing turn
ending it: a turn that streamed half a program and failed presents nothing.
`<ValidateCandidate>` is declared to that execution rather than resolved from a
repository, and it keeps the two kinds of failure apart. A defect a draft
authored comes back as structured facts the document may repair; a defect the
command line authored raises out of it, so no policy can catch a caller's
mistake and call it feedback.
The host takes the returned Plan back as untrusted text. Only after every Prompt
task, provider and Elicitation resource has torn down does it validate those
exact bytes again and resolve their props — a revision that changed a property's
declared type changes what the run receives — and only then does `--save` create
the file and the Plan run.
`--session <name>` names the assistant session; without it each invocation
places its own. The profile's working directory is one fixed host-owned path
because a session's key includes the directory it lives in, and a location that
changed every time would leave that option unable to name anything.
Evidence runs the packaged document itself against a scripted agent and a
scripted review: the shipped words reach the turn, ten presentations bound the
review with no revision on the tenth, an interleaved Plan returns byte for byte,
and what a person reads says each thing once however many rounds it took.
Claude-Session: https://claude.ai/code/session_015HcqB9kJM9KFnMNToAuZF6
Copy file name to clipboardExpand all lines: architecture.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,10 @@ Existing documents and code get aligned to this section retroactively.
33
33
| Repository base | the optional Git revision from which one named Workspace Repository initializes its primary checkout |
34
34
| pinned commit | the commit obtained by resolving a base once; it remains the workflow run's starting repository state even as the run creates descendant commits |
35
35
| document target | an addressable static heading in a root document's own Markdown flow, named by the canonical path of heading labels that reaches it; selecting one executes the preamble, each ancestor's own content, and that heading's complete subtree |
36
+
| Prompt | a person's original request, in ordinary natural language. `xmd prompt` takes exactly one |
37
+
| Plan | the executable program produced from a Prompt: an Executable Markdown document combining readable prose that expresses the Prompt's intent with the components that carry it out, each placed beside the prose describing what it does. A Plan is what `xmd prompt` approves, optionally saves and runs; it is not a synonym for a workflow, a policy document or any executable Markdown file |
38
+
| prompt command document | the one exact checked-in first-party Markdown value root `xmd prompt` executes to convert a Prompt into a Plan. It implements that conversion and its review workflow — the request wording, the draft and repair loops, the check branches, human review, revision, approval, abort and exhaustion — and returns the exact approved Plan source. It is not itself a Plan. Internal: no command-line option selects another one, and no repository component search can answer for it |
39
+
| prompt profile | the trusted-host assembly used only for the prompt command document: its fixed inputs, a constrained Agent provider, Elicitation, the fixed first-party components and the host-declared draft validator. It uses no repository component search and exposes no custom root, and the ceiling it establishes is not readable from the command line |
36
40
| expansion | one logical evaluation of an authored executable element within a document execution |
37
41
| expansion ID | a deterministic identifier for one logical expansion; restoring or retrying that expansion preserves the ID, while a distinct evaluation requested by the document receives another |
38
42
| Git capability | the contextual interface through which workflow infrastructure queries the Git repository associated with the current working directory |
@@ -3541,7 +3545,7 @@ Status is measured against main.
3541
3545
| --- | --- | --- |
3542
3546
|`xmd syntax`| describes every structural construct and every selected component the production `run` profile would let a document write in the contextual working directory, as deterministic Markdown or as version-1 JSON, from one catalog. Inspection only: it registers the run profile's declarations in a bounded scope and reads the filesystem for which files exist and, for a selected Markdown component, that file's frontmatter. It runs no body, imports no repository TypeScript module, installs no provider, mints no authority and writes no journal. An include it cannot enumerate — a selection-relevant symbolic link to a directory beneath it included — fails the whole request rather than printing a healthy subset | built on the #632 stack |
3543
3547
| document validation | validates one supplied root projection and the recursive Markdown source closure normal component selection discovers, returning deterministic version-1 document diagnostics and `valid`, `invalid` or `not-statically-checkable` invocation outcomes without evaluating document code or installing operational host behavior | built on the #654 stack |
3544
-
|`xmd prompt`| asks the configured agent for a complete executable Markdown root, validates it without executing any of it, repairs its definite defects by asking again at most three times per draft, shows a person the exact bytes, and executes the approved ones through the ordinary supplied-source path under the `<prompt>` identity. Authorship sits outside durability: the catalog, the fresh generator session, every repair and the review create no journal, retain no durable identity and replay nothing, and the generator's scope closes before the optional exclusive save and before execution. What runs is one ordinary document with its own Agent provider, its own journal and ordinary run output, result and failure behavior. A defect the draft authored is repairable; one the command line authored terminates without spending a turn on it | built on the #656 stack |
3548
+
| `xmd prompt` | turns one Prompt into a Plan and runs it, by executing two root documents with a complete scope boundary between them. First the packaged prompt command document, under the internal `<prompt-command>` identity, inside the prompt profile: one enclosing Session, a host ceiling of an empty host-owned working directory with no additional directories, no MCP servers, no native tools and a private strict denial no permission flag widens, no Files, command, service or network capability for that document, no repository component search, and one host-declared `<ValidateCandidate>` whose closed assessment answers `valid: false` for a defect the draft authored and raises for a defect the command line authored. Its instructions require the Plan to keep every requested outcome as reader-facing prose with each component beside the sentences describing it, through repairs and revisions alike, and prose quality stays that document's policy rather than a TypeScript rule. Authorship sits outside durability: it runs on an invocation-owned in-memory stream that is never journaled, persisted, reused or replayed. Then, only after that execution and every provider, Prompt task and Elicitation resource inside it has torn down, the host validates the returned Plan again, resolves props for exactly those bytes, optionally creates the save exclusively, and executes them through the ordinary supplied-source path under the `<prompt>` identity — one ordinary document with its own Agent provider, its own journal and ordinary run output, result and failure behavior | built on the #659 stack |
3545
3549
|`<PrintErrors>` / `printErrors(fn)`| prints failures | built on main |
3546
3550
| `<Fail message>` | stops authored work with the sentence its author wrote, raised where it is written. An ordinary overridable core default — never structural, never reserved, so a repository `Fail.md` is chosen ahead of it — with a closed schema of one required non-empty `message` and **self-closing only**: a paired spelling never enters its body, and `as` is refused by the body itself because there is nothing to bind. Every refusal reports the invocation and happens before the authored message, so a document that never reached its decision is never reported as having made one. A valid invocation is the ordinary failure of a function component: an `Error` carrying the exact authored message, positioned at the opening tag, rendering nothing and binding nothing. It carries no `printErrors()` declaration, which is what leaves recovery to an authored `<PrintErrors>` region under ordinary text-root modes; a value body's `throw` is not replaced there, so the authored failure settles the body ahead of missing-`<Return>` settlement. No authority, context, provider, resource, module state or durable operation of its own: replay of a completed root restores the recorded outcome without re-expanding the body | built on the #659 stack |
3547
3551
|`<Let as="name">`| binds one name in the current environment from exactly one source: the content it renders, or the exact value `value` names, bound by reference and never through the JSON boundary component props cross — the scanner resolves no JSON for that one prop, and expansion projects none. Which source it has is read from what the author wrote, before either one runs, so a construct naming both expands no child and evaluates no expression. It opens no scope, owns no resource, adds no middleware boundary and writes no journal record — replay reconstructs both sources through ordinary expansion | built on the #527 stack |
0 commit comments