yaaw-se 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/cli/commands/install.d.ts +7 -0
- package/dist/cli/commands/install.js +50 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/status.d.ts +13 -0
- package/dist/cli/commands/status.js +2 -0
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/main.js +8 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/installer/manifest.js +8 -3
- package/dist/installer/manifest.js.map +1 -1
- package/dist/installer/plan.js +129 -3
- package/dist/installer/plan.js.map +1 -1
- package/dist/installer/status.d.ts +13 -0
- package/dist/installer/status.js +65 -0
- package/dist/installer/status.js.map +1 -1
- package/dist/installer/toml-managed.d.ts +7 -0
- package/dist/installer/toml-managed.js +192 -0
- package/dist/installer/toml-managed.js.map +1 -0
- package/dist/installer/transaction.js +26 -0
- package/dist/installer/transaction.js.map +1 -1
- package/dist/installer/types.d.ts +27 -0
- package/dist/integrations/codex-runtime.d.ts +25 -0
- package/dist/integrations/codex-runtime.js +85 -0
- package/dist/integrations/codex-runtime.js.map +1 -0
- package/dist/integrations/codex.d.ts +2 -1
- package/dist/integrations/codex.js +125 -3
- package/dist/integrations/codex.js.map +1 -1
- package/dist/integrations/types.d.ts +4 -0
- package/dist/payload/bootstrap/codex.md +3 -1
- package/dist/payload/integrations/codex/yaaw-runtime.md +66 -0
- package/dist/payload/payload-files.json +29 -19
- package/dist/payload/payload.json +1 -1
- package/dist/payload/yaaw-core/system/core/context-loading.md +11 -0
- package/dist/payload/yaaw-core/system/core/dispatch-execution.md +37 -0
- package/dist/payload/yaaw-core/system/core/io-contract.md +6 -1
- package/dist/payload/yaaw-core/system/core/recovery.md +3 -0
- package/dist/payload/yaaw-core/system/registries/execution-policy.json +164 -33
- package/dist/payload/yaaw-core/system/roles/orchestrator.md +5 -2
- package/dist/payload/yaaw-core/system/rules/review-independence.md +2 -0
- package/dist/payload/yaaw-core/system/workflows/orchestration/dispatch.md +9 -4
- package/dist/payload/yaaw-core/system/workflows/orchestration/route.md +5 -3
- package/dist/tui/configure-codex.d.ts +2 -0
- package/dist/tui/configure-codex.js +82 -0
- package/dist/tui/configure-codex.js.map +1 -0
- package/dist/tui/result.js +9 -1
- package/dist/tui/result.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,135 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { makeAdapter, pathExists } from "./helpers.js";
|
|
4
|
+
import { normalizeCodexRuntimeSettings } from "./codex-runtime.js";
|
|
5
|
+
import { readTomlManagedValue, validateManagedToml } from "../installer/toml-managed.js";
|
|
6
|
+
const baseAdapter = makeAdapter({
|
|
3
7
|
id: "codex",
|
|
4
8
|
displayName: "Codex",
|
|
5
9
|
executable: "codex",
|
|
6
|
-
detectionPaths: [".agents", "AGENTS.md"],
|
|
10
|
+
detectionPaths: [".agents", ".codex", "AGENTS.md"],
|
|
7
11
|
skillsRel: ".agents/skills",
|
|
8
12
|
bootstrapRel: "AGENTS.md",
|
|
9
13
|
bootstrapTemplate: "codex.md",
|
|
10
14
|
managedSection: true,
|
|
11
15
|
hint: skill => `$${skill}`
|
|
12
16
|
});
|
|
17
|
+
const roleDefinitions = {
|
|
18
|
+
prd: { agent: "yaaw_prd", file: "yaaw-prd.toml", description: "YAAW PRD authority worker. Use only for a YAAW handoff whose role is prd." },
|
|
19
|
+
planner: { agent: "yaaw_planner", file: "yaaw-planner.toml", description: "YAAW Planner authority worker. Use only for a YAAW handoff whose role is planner." },
|
|
20
|
+
implementer: { agent: "yaaw_implementer", file: "yaaw-implementer.toml", description: "YAAW Implementer authority worker. Use only for a YAAW handoff whose role is implementer." },
|
|
21
|
+
reviewer: { agent: "yaaw_reviewer", file: "yaaw-reviewer.toml", description: "YAAW Reviewer authority worker. Use only for a YAAW handoff whose role is reviewer." }
|
|
22
|
+
};
|
|
23
|
+
function roleConfig(settings) {
|
|
24
|
+
const lines = [
|
|
25
|
+
"# YAAW-SE Codex authority-worker runtime configuration.",
|
|
26
|
+
"# Canonical role/workflow semantics live under .yaaw-core/system/."
|
|
27
|
+
];
|
|
28
|
+
if (settings.model)
|
|
29
|
+
lines.push(`model = ${JSON.stringify(settings.model)}`);
|
|
30
|
+
if (settings.reasoning)
|
|
31
|
+
lines.push(`model_reasoning_effort = ${JSON.stringify(settings.reasoning)}`);
|
|
32
|
+
if (!settings.model && !settings.reasoning)
|
|
33
|
+
lines.push("# Inherit Codex project/user defaults.");
|
|
34
|
+
return lines.join("\n") + "\n";
|
|
35
|
+
}
|
|
36
|
+
function configEntries(settings) {
|
|
37
|
+
const entries = [];
|
|
38
|
+
for (const def of Object.values(roleDefinitions)) {
|
|
39
|
+
entries.push({ key: `agents.${def.agent}.description`, value: def.description }, { key: `agents.${def.agent}.config_file`, value: `agents/${def.file}` });
|
|
40
|
+
}
|
|
41
|
+
if (settings.orchestrator.model)
|
|
42
|
+
entries.push({ key: "model", value: settings.orchestrator.model });
|
|
43
|
+
if (settings.orchestrator.reasoning)
|
|
44
|
+
entries.push({ key: "model_reasoning_effort", value: settings.orchestrator.reasoning });
|
|
45
|
+
if (settings.defaultWorker.model)
|
|
46
|
+
entries.push({ key: "agents.default_subagent_model", value: settings.defaultWorker.model });
|
|
47
|
+
if (settings.defaultWorker.reasoning)
|
|
48
|
+
entries.push({ key: "agents.default_subagent_reasoning_effort", value: settings.defaultWorker.reasoning });
|
|
49
|
+
if (settings.maxConcurrentThreads !== null)
|
|
50
|
+
entries.push({ key: "agents.max_concurrent_threads_per_session", value: settings.maxConcurrentThreads });
|
|
51
|
+
if (settings.sandboxMode)
|
|
52
|
+
entries.push({ key: "sandbox_mode", value: settings.sandboxMode });
|
|
53
|
+
if (settings.approvalPolicy)
|
|
54
|
+
entries.push({ key: "approval_policy", value: settings.approvalPolicy });
|
|
55
|
+
if (settings.webSearch)
|
|
56
|
+
entries.push({ key: "web_search", value: settings.webSearch });
|
|
57
|
+
return entries;
|
|
58
|
+
}
|
|
59
|
+
async function planRuntime(ctx) {
|
|
60
|
+
const settings = normalizeCodexRuntimeSettings(ctx.settings);
|
|
61
|
+
const source = join(ctx.payloadRoot, "integrations", "codex", "yaaw-runtime.md");
|
|
62
|
+
const runtimeTemplate = await readFile(source, "utf8");
|
|
63
|
+
const operations = [
|
|
64
|
+
{
|
|
65
|
+
type: "write-managed-file",
|
|
66
|
+
path: join(ctx.projectRoot, ".codex", "yaaw-runtime.md"),
|
|
67
|
+
content: runtimeTemplate.replaceAll("{{RUNTIME_MODE}}", settings.mode),
|
|
68
|
+
owner: "integration:codex"
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
for (const [role, def] of Object.entries(roleDefinitions)) {
|
|
72
|
+
operations.push({
|
|
73
|
+
type: "write-managed-file",
|
|
74
|
+
path: join(ctx.projectRoot, ".codex", "agents", def.file),
|
|
75
|
+
content: roleConfig(settings.roles[role]),
|
|
76
|
+
owner: "integration:codex"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
operations.push({
|
|
80
|
+
type: "update-managed-config-keys",
|
|
81
|
+
path: join(ctx.projectRoot, ".codex", "config.toml"),
|
|
82
|
+
format: "toml",
|
|
83
|
+
entries: configEntries(settings),
|
|
84
|
+
owner: "integration:codex"
|
|
85
|
+
});
|
|
86
|
+
return operations;
|
|
87
|
+
}
|
|
88
|
+
async function verifyRuntime(ctx) {
|
|
89
|
+
const issues = [];
|
|
90
|
+
const configPath = join(ctx.projectRoot, ".codex", "config.toml");
|
|
91
|
+
if (!(await pathExists(join(ctx.projectRoot, ".codex", "yaaw-runtime.md"))))
|
|
92
|
+
issues.push("missing .codex/yaaw-runtime.md");
|
|
93
|
+
for (const def of Object.values(roleDefinitions)) {
|
|
94
|
+
if (!(await pathExists(join(ctx.projectRoot, ".codex", "agents", def.file))))
|
|
95
|
+
issues.push(`missing .codex/agents/${def.file}`);
|
|
96
|
+
}
|
|
97
|
+
if (!(await pathExists(configPath)))
|
|
98
|
+
issues.push("missing .codex/config.toml");
|
|
99
|
+
else {
|
|
100
|
+
try {
|
|
101
|
+
const text = await readFile(configPath, "utf8");
|
|
102
|
+
validateManagedToml(text);
|
|
103
|
+
for (const def of Object.values(roleDefinitions)) {
|
|
104
|
+
if (readTomlManagedValue(text, `agents.${def.agent}.config_file`) !== `agents/${def.file}`) {
|
|
105
|
+
issues.push(`missing/mismatched Codex role declaration: ${def.agent}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
issues.push(`invalid Codex config: ${error.message}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return { healthy: issues.length === 0, issues };
|
|
114
|
+
}
|
|
115
|
+
export const codexAdapter = {
|
|
116
|
+
...baseAdapter,
|
|
117
|
+
adapterVersion: 2,
|
|
118
|
+
planRuntime,
|
|
119
|
+
verifyRuntime,
|
|
120
|
+
async verify(ctx, selectedSkillIds) {
|
|
121
|
+
const base = await baseAdapter.verify(ctx, selectedSkillIds);
|
|
122
|
+
const runtime = await verifyRuntime(ctx);
|
|
123
|
+
return { healthy: base.healthy && runtime.healthy, issues: [...base.issues, ...runtime.issues] };
|
|
124
|
+
},
|
|
125
|
+
describeRuntime(settings) {
|
|
126
|
+
const runtime = normalizeCodexRuntimeSettings(settings);
|
|
127
|
+
return [
|
|
128
|
+
`mode: ${runtime.mode}`,
|
|
129
|
+
`orchestrator model: ${runtime.orchestrator.model ?? "inherit"}`,
|
|
130
|
+
`default worker model: ${runtime.defaultWorker.model ?? "inherit"}`,
|
|
131
|
+
`max concurrent threads: ${runtime.maxConcurrentThreads ?? "inherit"}`
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
};
|
|
13
135
|
//# sourceMappingURL=codex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/integrations/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/integrations/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,6BAA6B,EAAsD,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,MAAM,WAAW,GAAG,WAAW,CAAC;IAC9B,EAAE,EAAE,OAAO;IACX,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,OAAO;IACnB,cAAc,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC;IAClD,SAAS,EAAE,gBAAgB;IAC3B,YAAY,EAAE,WAAW;IACzB,iBAAiB,EAAE,UAAU;IAC7B,cAAc,EAAE,IAAI;IACpB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE;CAC3B,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,2EAA2E,EAAE;IAC3I,OAAO,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,mFAAmF,EAAE;IAC/J,WAAW,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,uBAAuB,EAAE,WAAW,EAAE,2FAA2F,EAAE;IACnL,QAAQ,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,oBAAoB,EAA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AM,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAuB;IAC9C,GAAG,WAAW;IACd,cAAc,EAAE,CAAC;IACjB,WAAW;IACX,aAAa;IACb,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,gBAAgB;QAChC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACnG,CAAC;IACD,eAAe,CAAC,QAAQ;QACtB,MAAM,OAAO,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC;QACxD,OAAO;YACL,SAAS,OAAO,CAAC,IAAI,EAAE;YACvB,uBAAuB,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,SAAS,EAAE;YAChE,yBAAyB,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,SAAS,EAAE;YACnE,2BAA2B,OAAO,CAAC,oBAAoB,IAAI,SAAS,EAAE;SACvE,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -7,6 +7,7 @@ export interface DetectionResult {
|
|
|
7
7
|
export interface IntegrationContext {
|
|
8
8
|
projectRoot: string;
|
|
9
9
|
payloadRoot: string;
|
|
10
|
+
settings?: unknown;
|
|
10
11
|
}
|
|
11
12
|
export interface IntegrationVerification {
|
|
12
13
|
healthy: boolean;
|
|
@@ -26,6 +27,9 @@ export interface IntegrationAdapter {
|
|
|
26
27
|
bootstrapRelativePath: string;
|
|
27
28
|
planBootstrap(ctx: IntegrationContext): Promise<InstallOperation[]>;
|
|
28
29
|
planSkills(ctx: IntegrationContext, skills: CanonicalSkill[]): Promise<InstallOperation[]>;
|
|
30
|
+
planRuntime?(ctx: IntegrationContext): Promise<InstallOperation[]>;
|
|
29
31
|
verify(ctx: IntegrationContext, selectedSkillIds: string[]): Promise<IntegrationVerification>;
|
|
32
|
+
verifyRuntime?(ctx: IntegrationContext): Promise<IntegrationVerification>;
|
|
33
|
+
describeRuntime?(settings: unknown): string[];
|
|
30
34
|
invocationHint(skillName: string): string;
|
|
31
35
|
}
|
|
@@ -5,8 +5,10 @@ This project uses YAAW-SE.
|
|
|
5
5
|
- Canonical YAAW implementation: `.yaaw-core/system/`
|
|
6
6
|
- Durable project memory: `.yaaw-core/project/`
|
|
7
7
|
- Public Codex skills: `.agents/skills/yaaw-*/`
|
|
8
|
+
- Codex execution adapter: `.codex/yaaw-runtime.md`
|
|
8
9
|
- Treat `.yaaw-core/project/` as durable project state.
|
|
9
|
-
- Do not duplicate YAAW workflow logic into `AGENTS.md`.
|
|
10
|
+
- Do not duplicate YAAW workflow logic into `AGENTS.md` or `.codex/`.
|
|
10
11
|
- Resolve the YAAW workspace root before shell/repository work; follow `.yaaw-core/system/core/execution-context.md`.
|
|
11
12
|
- Load workflows progressively; follow `.yaaw-core/system/core/context-loading.md`.
|
|
12
13
|
- When a YAAW skill is invoked, follow its canonical role/workflow references.
|
|
14
|
+
- When autonomous orchestration reaches `orchestration.dispatch`, follow `.codex/yaaw-runtime.md` for host-specific isolated-worker execution.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# YAAW Codex Runtime Adapter
|
|
2
|
+
|
|
3
|
+
This file defines **Codex execution mechanics only**. Canonical YAAW role/workflow semantics live under `.yaaw-core/system/`.
|
|
4
|
+
|
|
5
|
+
Configured YAAW runtime mode: **{{RUNTIME_MODE}}**.
|
|
6
|
+
|
|
7
|
+
## Root ownership
|
|
8
|
+
During autonomous `@yaaw-orchestrator` operation, the active/root Codex session is the YAAW Orchestrator. Never spawn a child `yaaw_orchestrator`.
|
|
9
|
+
|
|
10
|
+
## Authority worker mapping
|
|
11
|
+
When `orchestration.dispatch` selects a non-Orchestrator role, map it only after YAAW has already selected the handoff:
|
|
12
|
+
|
|
13
|
+
- `prd` -> `yaaw_prd`
|
|
14
|
+
- `planner` -> `yaaw_planner`
|
|
15
|
+
- `implementer` -> `yaaw_implementer`
|
|
16
|
+
- `reviewer` -> `yaaw_reviewer`
|
|
17
|
+
|
|
18
|
+
Codex role selection is an execution mechanism, never a second router.
|
|
19
|
+
|
|
20
|
+
## Runtime modes
|
|
21
|
+
|
|
22
|
+
### auto
|
|
23
|
+
1. Prefer a fresh named YAAW worker when the active spawn schema exposes named role / agent-type selection.
|
|
24
|
+
2. If named selection is unavailable or is explicitly rejected **before a child starts**, spawn one fresh generic worker for the same handoff.
|
|
25
|
+
3. If no isolated worker capability is available, execute the selected role/workflow inline.
|
|
26
|
+
4. If a child was created and then failed/interrupted, do not blindly retry. Return to YAAW reality inspection first.
|
|
27
|
+
|
|
28
|
+
### isolated-required
|
|
29
|
+
Use the named -> generic isolation ladder above. If no isolated worker can be created, return:
|
|
30
|
+
|
|
31
|
+
`BLOCKED:HOST_ISOLATION_UNAVAILABLE`
|
|
32
|
+
|
|
33
|
+
Do not fall back inline.
|
|
34
|
+
|
|
35
|
+
### inline
|
|
36
|
+
Do not spawn YAAW authority workers. Execute the selected handoff in the current context using canonical YAAW role/workflow contracts.
|
|
37
|
+
|
|
38
|
+
## Fresh worker bootstrap
|
|
39
|
+
Prefer no inherited parent conversation history. If the active host exposes a no-history control such as `fork_turns`, use its no-history value; if an older compatible host exposes a boolean fork-context control, disable inherited context.
|
|
40
|
+
|
|
41
|
+
Give a worker only:
|
|
42
|
+
- resolved workspace root;
|
|
43
|
+
- semantic role;
|
|
44
|
+
- `.yaaw-core/runtime/handoff.json`;
|
|
45
|
+
- instruction to read the handoff first;
|
|
46
|
+
- instruction to load the canonical role and resolve the workflow through registries;
|
|
47
|
+
- instruction to load only admitted artifacts, expertise, and repository context;
|
|
48
|
+
- instruction not to route/spawn another YAAW authority role;
|
|
49
|
+
- instruction to persist durable output before returning;
|
|
50
|
+
- instruction to return one legal typed result.
|
|
51
|
+
|
|
52
|
+
Do not paste product/engineering/spec/ticket/review history or the parent planning chat into the worker prompt when those facts already exist durably.
|
|
53
|
+
|
|
54
|
+
## Completion and recovery
|
|
55
|
+
One dispatch creates one fresh authority worker. Do not reuse a Planner across separate canonical planning dispatches. Never reuse an Implementer context as Reviewer.
|
|
56
|
+
|
|
57
|
+
After worker success, failure, interruption, no response, or lost response:
|
|
58
|
+
1. treat worker text as an execution signal only;
|
|
59
|
+
2. return to `orchestration.inspect-state`;
|
|
60
|
+
3. verify expected artifacts, revisions, repository state, evidence, and review state;
|
|
61
|
+
4. route again from observed reality.
|
|
62
|
+
|
|
63
|
+
Workers never perform YAAW lifecycle routing to peer authority roles.
|
|
64
|
+
|
|
65
|
+
## Capability note
|
|
66
|
+
YAAW does not force an experimental multi-agent backend. Use the capabilities the active Codex runtime actually exposes and follow the configured fallback mode.
|
|
@@ -13,17 +13,22 @@
|
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"path": "bootstrap/codex.md",
|
|
16
|
-
"sha256": "
|
|
17
|
-
"bytes":
|
|
16
|
+
"sha256": "c772f208677960cb8719516701d9512703575a63f338e8e255b29f549d662304",
|
|
17
|
+
"bytes": 792
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"path": "bootstrap/gemini-cli.md",
|
|
21
21
|
"sha256": "d859c0a32ab024860f935d4466eaa2db9b13736f490b62b2a0dc651435a67b47",
|
|
22
22
|
"bytes": 589
|
|
23
23
|
},
|
|
24
|
+
{
|
|
25
|
+
"path": "integrations/codex/yaaw-runtime.md",
|
|
26
|
+
"sha256": "dc8efda3fe6a841478fdc5c1ae8d34baf76dc3f6d30f756a6343aeffff8aa99d",
|
|
27
|
+
"bytes": 3179
|
|
28
|
+
},
|
|
24
29
|
{
|
|
25
30
|
"path": "payload.json",
|
|
26
|
-
"sha256": "
|
|
31
|
+
"sha256": "2e65f6ca956afc76ee0e1380d032ea6bb166a8f1bfadf2fc092353480e796508",
|
|
27
32
|
"bytes": 56
|
|
28
33
|
},
|
|
29
34
|
{
|
|
@@ -98,8 +103,13 @@
|
|
|
98
103
|
},
|
|
99
104
|
{
|
|
100
105
|
"path": "yaaw-core/system/core/context-loading.md",
|
|
101
|
-
"sha256": "
|
|
102
|
-
"bytes":
|
|
106
|
+
"sha256": "ac44a03b41e4403baf2cf3ef19c40b2d82fa6b7232766912b0e6285a2a321694",
|
|
107
|
+
"bytes": 2884
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"path": "yaaw-core/system/core/dispatch-execution.md",
|
|
111
|
+
"sha256": "3adf4cf3440e3cc0361ad5ea659660f4688824900b3dcd68b8882877c2fae7b9",
|
|
112
|
+
"bytes": 2814
|
|
103
113
|
},
|
|
104
114
|
{
|
|
105
115
|
"path": "yaaw-core/system/core/execution-context.md",
|
|
@@ -113,8 +123,8 @@
|
|
|
113
123
|
},
|
|
114
124
|
{
|
|
115
125
|
"path": "yaaw-core/system/core/io-contract.md",
|
|
116
|
-
"sha256": "
|
|
117
|
-
"bytes":
|
|
126
|
+
"sha256": "509270f9f3490ddc5ca071938f66167b6db4b171b88b13a8d3497be8a0ef0adb",
|
|
127
|
+
"bytes": 2945
|
|
118
128
|
},
|
|
119
129
|
{
|
|
120
130
|
"path": "yaaw-core/system/core/lifecycle.md",
|
|
@@ -123,8 +133,8 @@
|
|
|
123
133
|
},
|
|
124
134
|
{
|
|
125
135
|
"path": "yaaw-core/system/core/recovery.md",
|
|
126
|
-
"sha256": "
|
|
127
|
-
"bytes":
|
|
136
|
+
"sha256": "f197bdb188b31decdd183fbd7a611f1fd454dd530400fbfa33453db60e8ee3cb",
|
|
137
|
+
"bytes": 2068
|
|
128
138
|
},
|
|
129
139
|
{
|
|
130
140
|
"path": "yaaw-core/system/core/routing.md",
|
|
@@ -173,8 +183,8 @@
|
|
|
173
183
|
},
|
|
174
184
|
{
|
|
175
185
|
"path": "yaaw-core/system/registries/execution-policy.json",
|
|
176
|
-
"sha256": "
|
|
177
|
-
"bytes":
|
|
186
|
+
"sha256": "d67626880e4cf5adf5e4ba6adb30e45e5a3e3a17cbf51d961bbfd74bb5c6f880",
|
|
187
|
+
"bytes": 5540
|
|
178
188
|
},
|
|
179
189
|
{
|
|
180
190
|
"path": "yaaw-core/system/registries/expertise.json",
|
|
@@ -218,8 +228,8 @@
|
|
|
218
228
|
},
|
|
219
229
|
{
|
|
220
230
|
"path": "yaaw-core/system/roles/orchestrator.md",
|
|
221
|
-
"sha256": "
|
|
222
|
-
"bytes":
|
|
231
|
+
"sha256": "6d6b433c65fd0f09f4479e6bc2ed944fe630a532923acfbd3e57c575ac4d6d64",
|
|
232
|
+
"bytes": 1696
|
|
223
233
|
},
|
|
224
234
|
{
|
|
225
235
|
"path": "yaaw-core/system/roles/planner.md",
|
|
@@ -278,8 +288,8 @@
|
|
|
278
288
|
},
|
|
279
289
|
{
|
|
280
290
|
"path": "yaaw-core/system/rules/review-independence.md",
|
|
281
|
-
"sha256": "
|
|
282
|
-
"bytes":
|
|
291
|
+
"sha256": "e6a5cc02aac19edd251dc558e98a3a9009b0123a0bd6e055f12764e553cfbf49",
|
|
292
|
+
"bytes": 870
|
|
283
293
|
},
|
|
284
294
|
{
|
|
285
295
|
"path": "yaaw-core/system/rules/ticket-sizing.md",
|
|
@@ -423,8 +433,8 @@
|
|
|
423
433
|
},
|
|
424
434
|
{
|
|
425
435
|
"path": "yaaw-core/system/workflows/orchestration/dispatch.md",
|
|
426
|
-
"sha256": "
|
|
427
|
-
"bytes":
|
|
436
|
+
"sha256": "a12046d781265e425208b708bb1ea7c65d1305121ae36e14387e289914a57467",
|
|
437
|
+
"bytes": 2141
|
|
428
438
|
},
|
|
429
439
|
{
|
|
430
440
|
"path": "yaaw-core/system/workflows/orchestration/inspect-state.md",
|
|
@@ -443,8 +453,8 @@
|
|
|
443
453
|
},
|
|
444
454
|
{
|
|
445
455
|
"path": "yaaw-core/system/workflows/orchestration/route.md",
|
|
446
|
-
"sha256": "
|
|
447
|
-
"bytes":
|
|
456
|
+
"sha256": "e01c5a537d579e04c01bb3d55f429ff88b6d40c9c38ac919327cd0ed5437e0ce",
|
|
457
|
+
"bytes": 1649
|
|
448
458
|
},
|
|
449
459
|
{
|
|
450
460
|
"path": "yaaw-core/system/workflows/planning/create-spec.md",
|
|
@@ -16,6 +16,17 @@ After exactly one workflow is selected:
|
|
|
16
16
|
|
|
17
17
|
After durable output, return to routing before opening another workflow contract.
|
|
18
18
|
|
|
19
|
+
## Fresh worker bootstrap
|
|
20
|
+
When an Orchestrator dispatch runs in a fresh host worker, the worker should receive only enough parent context to locate and execute the handoff:
|
|
21
|
+
- resolved workspace root;
|
|
22
|
+
- target semantic role;
|
|
23
|
+
- `.yaaw-core/runtime/handoff.json`;
|
|
24
|
+
- instruction to load the canonical role contract and resolve the workflow through registries;
|
|
25
|
+
- instruction to load only handoff-admitted artifacts/expertise/repository context;
|
|
26
|
+
- instruction not to route another YAAW authority role.
|
|
27
|
+
|
|
28
|
+
Do not copy the parent planning conversation, all project documents, all expertise, all workflows, review history, or a repository dump into a worker prompt. Those are either durable artifacts or discoverable only when admitted by the selected workflow.
|
|
29
|
+
|
|
19
30
|
## Normal semantic context
|
|
20
31
|
```text
|
|
21
32
|
role contract
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Dispatch execution contract
|
|
2
|
+
|
|
3
|
+
Dispatch is a semantic request to execute exactly one already-selected YAAW handoff using the strongest context-isolation mechanism the active host can safely provide.
|
|
4
|
+
|
|
5
|
+
## Canonical rules
|
|
6
|
+
1. Orchestrator selects exactly one canonical workflow.
|
|
7
|
+
2. Orchestrator persists one valid `.yaaw-core/runtime/handoff.json`.
|
|
8
|
+
3. Under orchestrated operation, a non-Orchestrator semantic role should execute in a fresh isolated worker when the host provides that capability.
|
|
9
|
+
4. The worker receives minimal bootstrap context: workspace root, semantic role, handoff path, and instructions to resolve the canonical role/workflow from YAAW registries.
|
|
10
|
+
5. The worker reads durable YAAW state instead of depending on inherited planning conversation.
|
|
11
|
+
6. One dispatch executes exactly one handoff.
|
|
12
|
+
7. A worker may not route, spawn, or command another YAAW authority role.
|
|
13
|
+
8. The worker persists the required durable artifact/state/evidence before returning.
|
|
14
|
+
9. The worker returns only a legal typed result from the handoff/workflow contract.
|
|
15
|
+
10. A worker message is an execution signal, not project truth.
|
|
16
|
+
11. After worker completion, failure, interruption, or lost response, Orchestrator re-enters `orchestration.inspect-state` before selecting another semantic workflow.
|
|
17
|
+
12. If isolated execution is unavailable, the active host adapter applies its configured fallback policy.
|
|
18
|
+
|
|
19
|
+
## Direct invocation
|
|
20
|
+
A user who directly invokes PRD, Planner, Implementer, or Reviewer has intentionally selected that role/workflow and may execute it in the current context. Isolation policy here governs **Orchestrator dispatch**, not the existence of direct public entrypoints.
|
|
21
|
+
|
|
22
|
+
## Execution-context policy
|
|
23
|
+
`.yaaw-core/system/registries/execution-policy.json` declares one of:
|
|
24
|
+
- `ROOT_ONLY`: run in the active root Orchestrator context.
|
|
25
|
+
- `ISOLATED_PREFERRED`: prefer a fresh worker; host fallback may run inline.
|
|
26
|
+
- `INLINE_ALLOWED`: current-context execution is explicitly acceptable.
|
|
27
|
+
|
|
28
|
+
A future `ISOLATED_REQUIRED` value may be introduced only with a schema/version update. Host adapters may still expose a stricter local runtime mode that blocks instead of falling back.
|
|
29
|
+
|
|
30
|
+
## Fresh-context invariant
|
|
31
|
+
An orchestrated Implementer execution context must never become the Reviewer execution context for the same work. Reviewer acceptance is an independent dispatch.
|
|
32
|
+
|
|
33
|
+
## Failure and retry invariant
|
|
34
|
+
If a worker started and later failed or disappeared, do not blindly start the same authority worker again. Inspect durable reality first because the worker may already have mutated the repository or written evidence.
|
|
35
|
+
|
|
36
|
+
## Provider boundary
|
|
37
|
+
This contract is provider-neutral. Names of host tools, agent types, provider directories, model identifiers, and provider-specific spawning schemas belong only to integration adapters.
|
|
@@ -6,7 +6,7 @@ YAAW roles communicate through durable artifacts, exact Orchestrator handoffs, a
|
|
|
6
6
|
- `.yaaw-core/system/registries/artifacts.json` defines canonical artifact classes, locations, durability, and semantic ownership.
|
|
7
7
|
- `.yaaw-core/system/registries/role-io.json` defines each role's default read/write authority.
|
|
8
8
|
- `.yaaw-core/system/registries/workflows.json` maps canonical workflow IDs to one role/workflow contract.
|
|
9
|
-
- `.yaaw-core/system/registries/execution-policy.json` defines repository requirements and context/research admission for every workflow.
|
|
9
|
+
- `.yaaw-core/system/registries/execution-policy.json` defines repository requirements, execution-context policy, and context/research admission for every workflow.
|
|
10
10
|
- `.yaaw-core/runtime/handoff.json` resolves those contracts to one exact dispatch.
|
|
11
11
|
- `.yaaw-core/runtime/intent.json` may preserve the public entrypoint's desired destination while prerequisites are resolved.
|
|
12
12
|
|
|
@@ -17,16 +17,21 @@ The role reads the handoff, then its role contract, resolves `handoff.workflow`
|
|
|
17
17
|
|
|
18
18
|
A role must not search the repository for alternate YAAW artifact locations when a canonical input is missing. Missing or stale canonical prerequisites produce a typed result to Orchestrator.
|
|
19
19
|
|
|
20
|
+
Host execution transport is separate from semantic communication. A semantic role may run in another fresh host context, but authority still flows only through durable YAAW artifacts and typed results.
|
|
21
|
+
|
|
20
22
|
## Communication topology
|
|
21
23
|
```text
|
|
22
24
|
PRD / Planner / Implementer / Reviewer
|
|
23
25
|
↓ durable output + typed result
|
|
24
26
|
Orchestrator
|
|
27
|
+
↓ inspect reality
|
|
25
28
|
↓ exactly one next dispatch
|
|
26
29
|
```
|
|
27
30
|
|
|
28
31
|
Roles never spawn or command peer roles. **Roles report reality; Orchestrator decides routing.**
|
|
29
32
|
|
|
33
|
+
A worker's textual success message is not semantic truth. Orchestrator verifies the expected artifact, revision, repository/evidence basis, and legal state transition after every dispatched execution.
|
|
34
|
+
|
|
30
35
|
## Typed results
|
|
31
36
|
Common results include `SUCCESS`, `READY`, `HUMAN_INPUT_REQUIRED`, `PRECONDITION_UNSATISFIED`, `REVIEW_REQUIRED`, `REPLAN_REQUIRED`, `BLOCKED`, `PASS`, `REPAIR`, `REPLAN`, and `COMPLETE`.
|
|
32
37
|
|
|
@@ -16,6 +16,9 @@ Recovery compares claimed state with observed reality and returns to the last tr
|
|
|
16
16
|
- `PASS` + missing/stale review, source revision mismatch, or repository identity mismatch -> invalidate current PASS and route to review/replan as appropriate.
|
|
17
17
|
- A stale `.yaaw-core/runtime/handoff.json` is discarded, not executed.
|
|
18
18
|
- If repository identity is required but status is not `READY`, return `PRECONDITION_UNSATISFIED:REPOSITORY_IDENTITY_UNAVAILABLE` or `BLOCKED` with exact missing proof.
|
|
19
|
+
- If a dispatched worker ends unexpectedly, returns no response, loses its context, or its response is lost, treat that as an ordinary context interruption: inspect durable artifacts/repository/evidence and route from reality.
|
|
20
|
+
- Never blindly retry a worker that was successfully created; first determine whether it already produced durable effects.
|
|
21
|
+
- Do not persist host worker/session IDs into durable project memory. Replaceable coordination data, if ever required, belongs under `.yaaw-core/runtime/`.
|
|
19
22
|
- If the last trustworthy boundary cannot be proven, return `BLOCKED` with exact missing proof.
|
|
20
23
|
|
|
21
24
|
Every reconciliation uses a legal transition and records its reason/evidence in state provenance.
|