Skip to content

Commit d77c7b4

Browse files
committed
🔀 Integrate main and preserve the workflow agent test host
2 parents b1c75d5 + bddf524 commit d77c7b4

154 files changed

Lines changed: 16644 additions & 4885 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎architecture.md‎

Lines changed: 264 additions & 72 deletions
Large diffs are not rendered by default.

‎examples/adversarial-implementation/README.md‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ configured Git signing and verification. Run from that source checkout:
2424

2525
```bash
2626
cd /absolute/path/to/prepared-source-worktree
27-
xmd run /absolute/path/to/workflow/examples/adversarial-implementation/run.md \
27+
xmd run --allow-absolute /absolute/path/to/workflow/examples/adversarial-implementation/run.md \
2828
--props-task /absolute/path/to/task.json \
2929
--include /absolute/path/to/workflow/examples/adversarial-implementation/components --raw
3030
```
@@ -34,6 +34,10 @@ complete CLI with `xmd run /absolute/path/to/workflow/examples/adversarial-imple
3434
The task has no mode, phase, full flag or initialization override. `phase.md`
3535
and `continue.md` below serve separate assignments and existing records.
3636

37+
The workflow enters the prepared checkout and artifact directory through absolute
38+
`Dir` paths. Enable `--allow-absolute` for these runs; the flag retains existing
39+
read/write restrictions.
40+
3741
## Select role providers and budgets
3842

3943
The launch task requires `providers` for all three original roles and explicit
@@ -176,7 +180,7 @@ Publish the branch and draft PR through the existing owner, then run from the
176180
same source checkout:
177181

178182
```bash
179-
xmd run /absolute/path/to/workflow/examples/adversarial-implementation/delivery.md \
183+
xmd run --allow-absolute /absolute/path/to/workflow/examples/adversarial-implementation/delivery.md \
180184
--props-record /absolute/work/fresh-bounded-parser-fix/delivery/requirements.json \
181185
--props-number 123 --props-action status \
182186
--include /absolute/path/to/workflow/examples/adversarial-implementation/components --raw
@@ -309,7 +313,7 @@ files whose contents enter this prompt; artifacts remain references. A retained
309313
session uses `initialize: false`. Set it to true only for the role's first call.
310314

311315
```bash
312-
deno task xmd run examples/adversarial-implementation/phase.md \
316+
deno task xmd run --allow-absolute examples/adversarial-implementation/phase.md \
313317
--props-request /absolute/path/to/request.json \
314318
--include examples/adversarial-implementation/components --raw
315319
```
@@ -346,7 +350,7 @@ To advance a saved `Ticket.Run` or `Ticket.Continue` record, pass that complete
346350
record rather than reconstructing its assignment or artifact paths:
347351

348352
```bash
349-
deno task xmd run examples/adversarial-implementation/continue.md \
353+
deno task xmd run --allow-absolute examples/adversarial-implementation/continue.md \
350354
--props-record /absolute/path/to/ticket-record.json --props-steps 1 \
351355
--include examples/adversarial-implementation/components --raw
352356
```
@@ -466,18 +470,24 @@ are ready, without waiting for CI on `main` or the reviewed branch. When Fable
466470
is unavailable, including exhausted Claude quota, use an independent Codex Astra
467471
(`gpt-6-astra`) reviewer under the same scope, effort policy and correction
468472
limits. Reconcile any in-flight call and preserve its findings before fallback.
469-
Record the review provider/model. The repository's
470-
[review rules](../../AGENTS.md#feedback-commits) retain main health and required
471-
CI as merge gates; review acceptance waives neither.
473+
Select Fable from the host provider's advertised model catalog, using its
474+
`fable` alias when available. Record the exact provider and resolved model for
475+
each review. A model name refused before the prompt is a configuration failure:
476+
preserve the refusal and confirm that no prompt was sent before selecting an
477+
advertised model. Keep automatic retries disabled.
478+
479+
The repository's [review rules](../../AGENTS.md#feedback-commits) retain main
480+
health and required CI as merge gates; review acceptance waives neither.
472481

473482
## Test without paid agents
474483

475484
```bash
476-
deno task xmd test examples/adversarial-implementation/tests/Workflow.test.md \
477-
--include examples/adversarial-implementation/tests/components \
478-
--include examples/adversarial-implementation/components
485+
deno task test packages/cli/tests/adversarial-implementation.test.ts
479486
```
480487

488+
The launcher wraps each Markdown suite in `<Testing>` and explicitly enables
489+
absolute host paths for its temporary checkouts and artifacts.
490+
481491
Only the role boundaries are replaced. These journeys use real signed scratch
482492
Git repositories, committed shell consumers, focused command failures, the
483493
production Markdown routing and the existing feedback verifier. The fake role

‎examples/adversarial-implementation/tests/Friction.test.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pwd -P
55
```bash exec as="commandSetting"
66
printf '%s' "$XMD_EXAMPLE_COMMAND"
77
```
8-
<Let as="runner" value={commandSetting.stdout || "deno run --allow-all '" + root.replaceAll("'","'\"'\"'") + "/packages/cli/src/deno.ts' run"} />
8+
<Let as="runner" value={commandSetting.stdout || "deno run --allow-all '" + root.replaceAll("'","'\"'\"'") + "/packages/cli/src/deno.ts' run --allow-absolute"} />
99
<Let as="assessment" value={{mechanical:false,architecture:false,acceptance:true,risk:null,reason:"Inspect the saved test evidence.",evidence:["intent.md"]}} />
1010

1111
<Test name="the phase entry carries source and selected documents and needs no SHA correction" timeout="60s">

‎examples/adversarial-implementation/tests/Implementation.test.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pwd -P
55
```bash exec as="commandSetting"
66
printf '%s' "$XMD_EXAMPLE_COMMAND"
77
```
8-
<Let as="runner" value={commandSetting.stdout || "deno run --allow-all '" + root.replaceAll("'","'\"'\"'") + "/packages/cli/src/deno.ts' run"} />
8+
<Let as="runner" value={commandSetting.stdout || "deno run --allow-all '" + root.replaceAll("'","'\"'\"'") + "/packages/cli/src/deno.ts' run --allow-absolute"} />
99

1010
<Test name="G1 G2 G3 G8 G9 normal launch preserves actual ordinary owners and captured evidence" timeout="90s">
1111
<Each in={[

‎examples/adversarial-implementation/tests/Workflow.test.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pwd -P
55
```bash exec as="commandSetting"
66
printf '%s' "$XMD_EXAMPLE_COMMAND"
77
```
8-
<Let as="runner" value={commandSetting.stdout || "deno run --allow-all '" + suiteRoot.replaceAll("'","'\"'\"'") + "/packages/cli/src/deno.ts' run"} />
8+
<Let as="runner" value={commandSetting.stdout || "deno run --allow-all '" + suiteRoot.replaceAll("'","'\"'\"'") + "/packages/cli/src/deno.ts' run --allow-absolute"} />
99

1010
<Let as="assessment" value={{mechanical:false,architecture:false,acceptance:true,risk:null,reason:"Bounded test migration.",evidence:["/fixture/intent.md"]}} />
1111

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Qualify a locally configured ACP agent
2+
3+
Use one local JSON configuration for qualification and ordinary orchestration.
4+
The command reaches XMD's production ACPX provider as a literal command; no agent
5+
registry edit is needed. Another agent changes configuration rather than copying
6+
this workflow.
7+
8+
Prepare this checkout with `deno task setup`. Install and authenticate your agent
9+
separately. Copy `kimi.example.json` outside this checkout and edit its command
10+
and expectations. Keep credentials in the agent's existing local authentication;
11+
the configuration accepts no credentials or environment map. ACPX's raw command
12+
resolution has platform limits on Windows; this example adds no launcher or
13+
registry to change them.
14+
15+
## Authorize one bounded run
16+
17+
Selecting a scenario authorizes its model turns and cancellation of the suite's
18+
own test turn. Live execution is opt-in and may cost money. Use a fresh private
19+
working directory. The runner generates unique local A/B/C Session names. The maximum is six Prompts,
20+
one attempt each: seed A, recall A, independent B, reconnect A, cancel C, then
21+
recall A from another OS invocation. Turns have 60 seconds; the cancellation
22+
request targets the still-active C turn after five seconds. Teardown observation
23+
has 30 seconds and the outer work deadline has 600 seconds. Expiry ends admission;
24+
the actual owner still joins. No uncertain turn is retried.
25+
26+
The runner computes setup dependencies before provider work. Continuity,
27+
separation, reconnect and resume require one completed A seed. Only selected
28+
continuity adds A's second turn; separation adds independent B. Cancellation
29+
needs no marker scenario. Selecting reconnect or resume authorizes their seed
30+
setup, even when the setup capability rows are unselected.
31+
32+
The checked-in initial document keeps one provider and A Session alive for the
33+
seed and recall, then tests B. Reconnect opens a new same-process invocation.
34+
Cancellation owns a separate document; its five-second interval begins at actual
35+
transport-confirmed start and structured cancellation joins that document. Resume uses one
36+
separate CLI invocation and ordinary retained A history. Its private comparison
37+
file is neither provider history nor continuation authority.
38+
39+
Ordinary production validation, including its cached availability probe, remains
40+
in force. After successful owner settlement independent stages can proceed even
41+
though exact native closing is unverified. Pending joins, actual teardown failure
42+
or production ownership refusal stop admission. A marker failure preserves earlier
43+
basic/settings evidence and permits independent cancellation. No capability passes
44+
from configuration, availability, process exit or matching display names.
45+
46+
From the private working directory, use absolute paths for the checked-in document,
47+
component directory, local configuration and report:
48+
49+
```sh
50+
xmd run /checkout/examples/agent-certification/certify.md --include /checkout/examples/agent-certification/components --props-config /private/local-agent.json --props-report /private/capabilities.json --deny-all --timeout 600s --raw
51+
```
52+
53+
The same command through this source checkout is `deno task xmd run ...`.
54+
Ordinary CI exercises controlled agents without credentials or model calls.
55+
56+
## Read the report
57+
58+
The current JSON format is closed and unversioned. Each of thirteen capability rows
59+
records selected and expected flags, an outcome, a fixed reason and bounded facts.
60+
`pass`, `failure`, `unsupported` and `not_run` are distinct. An absent selector is
61+
unsupported; a selection the target Session does not apply is a failure. Omitted
62+
model/effort settings supply no explicit-selection evidence.
63+
64+
`complete=false` includes missing provenance and selected evidence blocked by
65+
prerequisites. A measured unsupported capability is a non-pass. Overall success
66+
requires complete evidence and all selected/expected capabilities passing.
67+
Acceptance and native identity are separate rows: a standard command can pass
68+
basic authentication, streaming and completion while acceptance is
69+
`unsupported/acceptance-unavailable` and identity is unsupported. An actual native
70+
assertion can pass identity independently. Only a strong-declared adapter's gated
71+
started event proves acceptance; marker-like output from a literal command does
72+
not. Durable certification additionally requires acceptance, identity, continuity, separation, reconnect,
73+
separate-invocation resume and verified cleanup. Native cleanup remains
74+
`not_run/cleanup-unverified` after a successful owner join; actual observed cleanup
75+
failure is failure. Correct stop attribution alone cannot pass cancellation.
76+
77+
Only categorical values, booleans, counts, strict version tokens, fixed platform
78+
facts and fingerprints enter this report. Missing executable/adapter/runtime
79+
provenance remains null and prevents complete evidence. Configuration and source
80+
fingerprints identify exact noncredential inputs; no digest is invented. The
81+
report contains no prompts, replies, private marker, credential, environment
82+
value, path, command, raw identifier, exception or provider output.
83+
84+
Your agent can retain private native history under its normal policy. XMD's
85+
optional diagnostic journal is also private and is not this report or continuation
86+
input. Neither certification nor a report grants durable identity or tools.
87+
88+
## Use the same local configuration
89+
90+
Ordinary orchestration uses the same command and exact optional model/effort IDs:
91+
92+
```sh
93+
xmd run /checkout/examples/agent-certification/orchestrate.md --include /checkout/examples/agent-certification/components --props-config /private/local-agent.json --props-prompt 'Summarize this task without tools.' --deny-all --raw
94+
```
95+
96+
This is a separate explicitly requested model call, outside the qualification
97+
suite. Ordinary name/cwd retention is not workflow Session-site identity.
98+
A literal command uses standard ACP without the private acceptance barrier.
99+
Sequential prompts share the live Session; later reopening loads the exact ACP
100+
identity if supported and refuses otherwise. Interrupted requests are never
101+
automatically resent. Strong-declared adapters retain their acceptance barrier.
102+
103+
Kimi's selected live scope uses `kimi acp`, provider-default model and effort,
104+
and no retries. A later useful live run requires changed-source review, exact fingerprints and
105+
a fresh explicit selected-scenario grant. The earlier zero-Prompt attempt is
106+
retained invocation evidence only; it establishes no capability battery. Gemini was absent on PATH in prepared observations; its sample command is a placeholder for the installed adapter's documented command and is
107+
configuration syntax, not availability or certification evidence. This delivery
108+
authorizes zero Gemini live calls and installs no agent.
109+
110+
The terminal matrix always lists all thirteen capabilities with selected/expected flags,
111+
outcomes and fixed reasons, plus observed Prompt/cancellation counts and overall
112+
flags. Failure preserves earlier independent rows and a meaningful nonzero status.
113+
Private markers, replies, Session identities and child fragments remain local.
114+
115+
Prompt counts describe turns observed through the production stream. A refusal
116+
before stream disclosure can leave native submissions unobserved; these counts
117+
are not billing evidence. Resume follows its own CLI work deadline and the parent
118+
waits for actual process settlement even if outer work is cancelled.
119+
120+
The 30-second teardown observation begins when an element's own work exits,
121+
before its resources close. Expiry permanently ends later admission even if
122+
cleanup subsequently succeeds; the runner still waits for the real join. The
123+
same observation runs inside the resume child. Demonstrated invocation teardown
124+
failure remains failure/cleanup-failed after later successful joins.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
props:
3+
config: { type: string }
4+
report: { type: string }
5+
required: [config, report]
6+
---
7+
# Qualify a local ACP agent
8+
9+
You authorize the scenarios listed in your local configuration when you run this
10+
example. Read README.md first. Your command uses its existing local credentials.
11+
12+
<LoadConfiguration path={props.config} as="local" />
13+
<Let as="configuration" value={local.configuration} />
14+
15+
<Output>
16+
<Qualify configuration={configuration} configFingerprint={local.fingerprint} report={props.report}>
17+
<RunSequence />
18+
</Qualify>
19+
</Output>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Qualification } from "../state.ts";
2+
import { recordMarker } from "../report.ts";
3+
import { z } from "zod";
4+
import type { Json, PropsSchema } from "@executablemd/core";
5+
const inputSchema = z.strictObject({
6+
scenario: z.enum(["seed", "continuity", "separation", "reconnect", "resume"]),
7+
reply: z.string(),
8+
});
9+
export const props: PropsSchema = {
10+
type: "object",
11+
properties: {
12+
scenario: { enum: ["seed", "continuity", "separation", "reconnect", "resume"] },
13+
reply: { type: "string" },
14+
},
15+
required: ["scenario", "reply"],
16+
additionalProperties: false,
17+
};
18+
export default function* CheckMarker(input: Record<string, Json>) {
19+
const { scenario, reply } = inputSchema.parse(input);
20+
const state = yield* Qualification.expect();
21+
const accepted = state.turn.accepted && state.turn.completed;
22+
if (scenario === "seed") {
23+
state.seedAccepted = accepted;
24+
if (accepted) {
25+
state.identity = state.turn.identity;
26+
}
27+
} else {
28+
recordMarker(
29+
state.report,
30+
scenario,
31+
state.marker,
32+
reply,
33+
accepted && (scenario === "separation" || state.turn.identity === state.identity),
34+
);
35+
}
36+
return "";
37+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { readTextFile } from "@effectionx/fs";
2+
import { configurationSchema } from "../report.ts";
3+
import { cwd } from "@executablemd/runtime";
4+
import { createHash } from "node:crypto";
5+
import { resolve } from "node:path";
6+
import type { Json, PropsSchema } from "@executablemd/core";
7+
8+
export const props: PropsSchema = {
9+
type: "object",
10+
properties: { path: { type: "string" } },
11+
required: ["path"],
12+
additionalProperties: false,
13+
};
14+
export default function* LoadConfiguration(input: Record<string, Json>) {
15+
const source = yield* readTextFile(resolve(yield* cwd(), String(input.path)));
16+
const result = configurationSchema.safeParse(JSON.parse(source));
17+
if (!result.success) {
18+
throw new Error(
19+
"Invalid local agent configuration: use only command, optional model/effort, unique scenarios and expected capabilities.",
20+
);
21+
}
22+
return {
23+
configuration: result.data,
24+
fingerprint: createHash("sha256").update(source).digest("hex"),
25+
};
26+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Qualification } from "../state.ts";
2+
import type { Json, PropsSchema } from "@executablemd/core";
3+
export const props: PropsSchema = {
4+
type: "object",
5+
properties: { stage: { enum: ["seed", "recall"] } },
6+
required: ["stage"],
7+
additionalProperties: false,
8+
};
9+
export default function* Marker(input: Record<string, Json>) {
10+
const state = yield* Qualification.expect();
11+
state.turn = { accepted: false, completed: false };
12+
return input.stage === "seed"
13+
? `Remember this private marker for this conversation: ${state.marker}. Reply only READY. Use no tools.`
14+
: "Return the private marker from this conversation, or UNKNOWN if none was supplied. Return only that value. Use no tools.";
15+
}

0 commit comments

Comments
 (0)