@tiic-tech/openworkflow 0.1.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/LICENSE +21 -0
- package/README.md +37 -0
- package/dist/adapters/codex/src/doctorCodexAdapter.d.ts +6 -0
- package/dist/adapters/codex/src/doctorCodexAdapter.js +124 -0
- package/dist/adapters/codex/src/doctorCodexAdapter.js.map +1 -0
- package/dist/adapters/codex/src/generateAgents.d.ts +2 -0
- package/dist/adapters/codex/src/generateAgents.js +40 -0
- package/dist/adapters/codex/src/generateAgents.js.map +1 -0
- package/dist/adapters/codex/src/generateCodexAdapter.d.ts +9 -0
- package/dist/adapters/codex/src/generateCodexAdapter.js +59 -0
- package/dist/adapters/codex/src/generateCodexAdapter.js.map +1 -0
- package/dist/adapters/codex/src/generateCommands.d.ts +6 -0
- package/dist/adapters/codex/src/generateCommands.js +205 -0
- package/dist/adapters/codex/src/generateCommands.js.map +1 -0
- package/dist/adapters/codex/src/generateSkills.d.ts +7 -0
- package/dist/adapters/codex/src/generateSkills.js +60 -0
- package/dist/adapters/codex/src/generateSkills.js.map +1 -0
- package/dist/adapters/codex/src/generatedFiles.d.ts +4 -0
- package/dist/adapters/codex/src/generatedFiles.js +67 -0
- package/dist/adapters/codex/src/generatedFiles.js.map +1 -0
- package/dist/adapters/codex/src/manifest.d.ts +4 -0
- package/dist/adapters/codex/src/manifest.js +40 -0
- package/dist/adapters/codex/src/manifest.js.map +1 -0
- package/dist/adapters/codex/src/templates.d.ts +7 -0
- package/dist/adapters/codex/src/templates.js +6 -0
- package/dist/adapters/codex/src/templates.js.map +1 -0
- package/dist/cli/src/args.d.ts +8 -0
- package/dist/cli/src/args.js +34 -0
- package/dist/cli/src/args.js.map +1 -0
- package/dist/cli/src/commands/doctor.d.ts +1 -0
- package/dist/cli/src/commands/doctor.js +26 -0
- package/dist/cli/src/commands/doctor.js.map +1 -0
- package/dist/cli/src/commands/init.d.ts +1 -0
- package/dist/cli/src/commands/init.js +52 -0
- package/dist/cli/src/commands/init.js.map +1 -0
- package/dist/cli/src/commands/shared.d.ts +4 -0
- package/dist/cli/src/commands/shared.js +19 -0
- package/dist/cli/src/commands/shared.js.map +1 -0
- package/dist/cli/src/commands/sync.d.ts +1 -0
- package/dist/cli/src/commands/sync.js +27 -0
- package/dist/cli/src/commands/sync.js.map +1 -0
- package/dist/cli/src/commands/validate.d.ts +1 -0
- package/dist/cli/src/commands/validate.js +17 -0
- package/dist/cli/src/commands/validate.js.map +1 -0
- package/dist/cli/src/dev/validateRepositoryContractsCli.d.ts +2 -0
- package/dist/cli/src/dev/validateRepositoryContractsCli.js +37 -0
- package/dist/cli/src/dev/validateRepositoryContractsCli.js.map +1 -0
- package/dist/cli/src/dev/verifyRuntimeSurface.d.ts +2 -0
- package/dist/cli/src/dev/verifyRuntimeSurface.js +344 -0
- package/dist/cli/src/dev/verifyRuntimeSurface.js.map +1 -0
- package/dist/cli/src/dev/verifyWorkflowE2E.d.ts +2 -0
- package/dist/cli/src/dev/verifyWorkflowE2E.js +366 -0
- package/dist/cli/src/dev/verifyWorkflowE2E.js.map +1 -0
- package/dist/cli/src/index.d.ts +2 -0
- package/dist/cli/src/index.js +51 -0
- package/dist/cli/src/index.js.map +1 -0
- package/dist/core/src/artifacts/registry.d.ts +53 -0
- package/dist/core/src/artifacts/registry.js +483 -0
- package/dist/core/src/artifacts/registry.js.map +1 -0
- package/dist/core/src/commands/registry.d.ts +36 -0
- package/dist/core/src/commands/registry.js +539 -0
- package/dist/core/src/commands/registry.js.map +1 -0
- package/dist/core/src/contracts/index.d.ts +23 -0
- package/dist/core/src/contracts/index.js +16 -0
- package/dist/core/src/contracts/index.js.map +1 -0
- package/dist/core/src/contracts/yaml.d.ts +2 -0
- package/dist/core/src/contracts/yaml.js +12 -0
- package/dist/core/src/contracts/yaml.js.map +1 -0
- package/dist/core/src/contracts.d.ts +23 -0
- package/dist/core/src/contracts.js +15 -0
- package/dist/core/src/contracts.js.map +1 -0
- package/dist/core/src/fs/index.d.ts +4 -0
- package/dist/core/src/fs/index.js +28 -0
- package/dist/core/src/fs/index.js.map +1 -0
- package/dist/core/src/fs.d.ts +4 -0
- package/dist/core/src/fs.js +28 -0
- package/dist/core/src/fs.js.map +1 -0
- package/dist/core/src/initOpenWorkflow.d.ts +7 -0
- package/dist/core/src/initOpenWorkflow.js +220 -0
- package/dist/core/src/initOpenWorkflow.js.map +1 -0
- package/dist/core/src/validateOpenWorkflow.d.ts +5 -0
- package/dist/core/src/validateOpenWorkflow.js +145 -0
- package/dist/core/src/validateOpenWorkflow.js.map +1 -0
- package/dist/core/src/validators/validateOpenWorkflow.d.ts +5 -0
- package/dist/core/src/validators/validateOpenWorkflow.js +551 -0
- package/dist/core/src/validators/validateOpenWorkflow.js.map +1 -0
- package/dist/core/src/validators/validateRepositoryContracts.d.ts +2 -0
- package/dist/core/src/validators/validateRepositoryContracts.js +827 -0
- package/dist/core/src/validators/validateRepositoryContracts.js.map +1 -0
- package/dist/core/src/workflow/initOpenWorkflow.d.ts +7 -0
- package/dist/core/src/workflow/initOpenWorkflow.js +182 -0
- package/dist/core/src/workflow/initOpenWorkflow.js.map +1 -0
- package/dist/core/src/yaml.d.ts +2 -0
- package/dist/core/src/yaml.js +12 -0
- package/dist/core/src/yaml.js.map +1 -0
- package/package.json +55 -0
- package/references/artifact-authoring-templates.md +78 -0
- package/references/audit-first-discovery-loop.md +85 -0
- package/references/contract-graph.md +129 -0
- package/references/discovery-artifact-contracts.md +155 -0
- package/references/engineering-skill-reference-research.md +204 -0
- package/references/npm-cli-architecture.md +63 -0
- package/references/runtime-command-surface.md +169 -0
- package/schemas/artifact-contracts.schema.json +130 -0
- package/schemas/change.schema.json +71 -0
- package/schemas/contract-graph.schema.json +80 -0
- package/schemas/decision-record.schema.json +92 -0
- package/schemas/disclosure-levels.schema.json +66 -0
- package/schemas/openworkflow-contract.schema.json +88 -0
- package/schemas/product-design.schema.json +356 -0
- package/schemas/prototype-evidence.schema.json +325 -0
- package/schemas/prototype.schema.json +149 -0
- package/schemas/validation-target.schema.json +127 -0
- package/schemas/validation.schema.json +123 -0
- package/schemas/vision-session.schema.json +78 -0
- package/schemas/work-items.schema.json +87 -0
- package/schemas/workflow-index.schema.json +70 -0
- package/skills/build-prototype/SKILL.md +87 -0
- package/skills/build-prototype/agents/openai.yaml +4 -0
- package/skills/build-prototype/references/prototype-protocol.md +56 -0
- package/skills/build-prototype/scripts/init_prototype.py +260 -0
- package/skills/build-team/SKILL.md +292 -0
- package/skills/build-team/agents/openai.yaml +4 -0
- package/skills/build-team/references/runtime-schema.md +275 -0
- package/skills/build-team/references/team-protocol.md +244 -0
- package/skills/build-team/scripts/init_team_runtime.py +431 -0
- package/skills/build-validation/SKILL.md +81 -0
- package/skills/build-validation/agents/openai.yaml +4 -0
- package/skills/build-validation/references/validation-protocol.md +51 -0
- package/skills/build-validation/scripts/init_validation.py +194 -0
- package/skills/build-workflow/SKILL.md +65 -0
- package/skills/build-workflow/agents/openai.yaml +4 -0
- package/skills/build-workflow/references/workflow-layout.md +57 -0
- package/skills/build-workflow/scripts/init_workflow.py +423 -0
- package/skills/run-team/SKILL.md +93 -0
- package/skills/run-team/agents/openai.yaml +4 -0
- package/skills/run-team/references/delegation-and-agent-lifecycle.md +78 -0
- package/skills/run-team/references/run-loop.md +73 -0
- package/skills/run-team/references/runtime-audit.md +56 -0
- package/skills/run-team/references/scope-selection.md +64 -0
- package/skills/run-team/scripts/audit_team_runtime.py +173 -0
- package/skills/run-team/scripts/init_next_scope.py +304 -0
- package/templates/README.md +5 -0
- package/templates/codex/README.md +4 -0
- package/templates/openworkflow/README.md +4 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { mkdtemp, readFile, rm, stat } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { dirname, join, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { getDiscoveryArtifactContractsForCommand } from "../../../core/src/artifacts/registry.js";
|
|
8
|
+
import { getWorkflowCommands } from "../../../core/src/commands/registry.js";
|
|
9
|
+
import { parseYaml } from "../../../core/src/contracts/yaml.js";
|
|
10
|
+
const CURRENT_FILE = fileURLToPath(import.meta.url);
|
|
11
|
+
const REPO_ROOT = resolve(dirname(CURRENT_FILE), "../../../..");
|
|
12
|
+
const CLI = join(REPO_ROOT, "dist", "cli", "src", "index.js");
|
|
13
|
+
const USER_FACING_DISCOVERY_HANDOFFS = ["/ow:tune", "/ow:design", "/ow:validation"];
|
|
14
|
+
async function main() {
|
|
15
|
+
await assertFile(CLI);
|
|
16
|
+
const tempRoot = await mkdtemp(join(tmpdir(), "openworkflow-e2e-workflow-"));
|
|
17
|
+
try {
|
|
18
|
+
const target = join(tempRoot, "target");
|
|
19
|
+
const codexHome = join(tempRoot, "codex-home");
|
|
20
|
+
const env = { ...process.env, CODEX_HOME: codexHome };
|
|
21
|
+
await run(["node", CLI, "init", target, "--tools", "codex", "--force"], env);
|
|
22
|
+
await run(["node", CLI, "sync", "--root", target, "--tools", "codex"], env);
|
|
23
|
+
await run(["node", CLI, "doctor", "--root", target, "--tools", "codex"], env);
|
|
24
|
+
await run(["node", CLI, "validate", "--root", target], env);
|
|
25
|
+
const runtime = await loadRuntime(target);
|
|
26
|
+
await verifyVisionPhase(runtime);
|
|
27
|
+
await verifyValidationPhase(runtime);
|
|
28
|
+
await verifyPrototypePhase(runtime);
|
|
29
|
+
await verifyTunePhase(runtime);
|
|
30
|
+
await verifyInternalDecisionPhase(runtime);
|
|
31
|
+
await verifyDisplayLabels(runtime);
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
35
|
+
}
|
|
36
|
+
console.log("OpenWorkflow workflow E2E regression verification passed.");
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
async function loadRuntime(target) {
|
|
40
|
+
const commandIndex = await readYaml(join(target, ".openworkflow", "audit", "COMMAND_AUDIT_INDEX.yaml"));
|
|
41
|
+
const contextPackets = await readYaml(join(target, ".openworkflow", "audit", "CONTEXT_PACKETS.yaml"));
|
|
42
|
+
return {
|
|
43
|
+
target,
|
|
44
|
+
commands: records(commandIndex, "commands", "runtime"),
|
|
45
|
+
packets: records(contextPackets, "packets", "runtime"),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
async function verifyVisionPhase(runtime) {
|
|
49
|
+
const phase = "vision";
|
|
50
|
+
const source = command("vision", phase);
|
|
51
|
+
const protocol = protocolFor(source, phase);
|
|
52
|
+
assertPhase(phase, protocol.interactionMode === "conversation-first-sustained-grill", "source protocol is not sustained grill");
|
|
53
|
+
assertExactList(phase, protocol.handoffCommands, ["/ow:validation"], "vision source handoffs changed");
|
|
54
|
+
assertListIncludes(phase, protocol.forbiddenOutputs, ".openworkflow/validation/**", "vision can create validation artifacts");
|
|
55
|
+
assertListIncludes(phase, protocol.forbiddenOutputs, ".openworkflow/prototypes/**", "vision can create prototype artifacts");
|
|
56
|
+
assertListIncludes(phase, protocol.auditCheckpoints.before, "Start in conversation mode and ask the next useful vision question before writing artifacts.", "vision does not start conversation-first");
|
|
57
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.during, "make each question depend on the previous answer", "vision does not enforce progressive questioning");
|
|
58
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.after, "user confirms readiness", "vision handoff does not require user readiness confirmation");
|
|
59
|
+
const generated = commandRecord(runtime, "vision", phase);
|
|
60
|
+
assertPhase(phase, stringField(generated, "visibility", phase) === "user", "generated vision command is not user visible");
|
|
61
|
+
assertExactList(phase, stringList(generated, "handoff_commands", phase), ["/ow:validation"], "generated vision handoffs changed");
|
|
62
|
+
assertListIncludes(phase, stringList(generated, "forbidden_outputs", phase), ".openworkflow/prototypes/**", "generated vision can create prototypes");
|
|
63
|
+
const packet = packetRecord(runtime, "/ow:vision", phase);
|
|
64
|
+
assertSomeIncludes(phase, nestedStringList(packet, ["audit_checkpoints", "before"], phase), "ask the next useful vision question", "context packet lost conversation-first checkpoint");
|
|
65
|
+
assertSomeIncludes(phase, nestedStringList(packet, ["audit_checkpoints", "during"], phase), "Cover mandatory vision dimensions", "context packet lost mandatory coverage checkpoint");
|
|
66
|
+
assertSomeIncludes(phase, nestedStringList(packet, ["audit_checkpoints", "after"], phase), "user confirms readiness", "context packet lost readiness gate");
|
|
67
|
+
const skill = await readSkill(runtime, "ow-vision");
|
|
68
|
+
assertIncludes(phase, skill, "<conversation_first>", "skill missing conversation_first block");
|
|
69
|
+
assertIncludes(phase, skill, "Ask exactly one question", "skill no longer limits vision to one focused question");
|
|
70
|
+
assertIncludes(phase, skill, "<mandatory_coverage>", "skill missing mandatory coverage block");
|
|
71
|
+
assertIncludes(phase, skill, "Do not hand off to /ow:validation until mandatory coverage is addressed", "skill lost validation handoff gate");
|
|
72
|
+
assertIncludes(phase, skill, "not on a fixed number of turns", "skill permits fixed-turn readiness");
|
|
73
|
+
assertIncludes(phase, skill, "<artifact_checkpoint>", "skill missing artifact checkpoint separation");
|
|
74
|
+
const template = await readYaml(join(runtime.target, ".openworkflow", "vision", "_templates", "VISION_SESSION.yaml"));
|
|
75
|
+
const handoff = recordField(template, "handoff", phase);
|
|
76
|
+
assertPhase(phase, handoff.ready === false, "vision template should default to not ready");
|
|
77
|
+
assertPhase(phase, handoff.next_command === null, "vision template should not default to validation handoff");
|
|
78
|
+
}
|
|
79
|
+
async function verifyValidationPhase(runtime) {
|
|
80
|
+
const phase = "validation";
|
|
81
|
+
const source = command("validation", phase);
|
|
82
|
+
const protocol = protocolFor(source, phase);
|
|
83
|
+
assertListIncludes(phase, protocol.requiredContext, ".openworkflow/vision/VISION_CONTRACT.yaml", "validation no longer requires vision contract");
|
|
84
|
+
assertListIncludes(phase, protocol.forbiddenOutputs, ".openworkflow/prototypes/**", "validation can create prototype artifacts");
|
|
85
|
+
assertExactList(phase, protocol.handoffCommands, ["/ow:proto", "/ow:vision"], "validation source handoffs changed");
|
|
86
|
+
const generated = commandRecord(runtime, "validation", phase);
|
|
87
|
+
const handoffs = stringList(generated, "handoff_commands", phase);
|
|
88
|
+
assertListIncludes(phase, handoffs, "/ow:proto", "generated validation does not hand off to prototype");
|
|
89
|
+
assertListExcludes(phase, handoffs, "/ow:decision", "generated validation exposes manual decision");
|
|
90
|
+
const packet = packetRecord(runtime, "/ow:validation", phase);
|
|
91
|
+
assertListIncludes(phase, stringList(packet, "required", phase), ".openworkflow/vision/VISION_CONTRACT.yaml", "context packet does not require vision contract");
|
|
92
|
+
assertSomeIncludes(phase, nestedStringList(packet, ["audit_checkpoints", "during"], phase), "single highest-risk validation question", "validation does not focus the core risk");
|
|
93
|
+
assertSomeIncludes(phase, nestedStringList(packet, ["audit_checkpoints", "after"], phase), "prototype brief", "validation does not produce prototype brief");
|
|
94
|
+
const template = await readYaml(join(runtime.target, ".openworkflow", "validation", "_templates", "VALIDATION.yaml"));
|
|
95
|
+
assertPhase(phase, "prototype_scope" in template, "validation template missing prototype_scope");
|
|
96
|
+
assertPhase(phase, stringList(template, "decision_options", phase).includes("needs_more_evidence"), "validation template missing decision options");
|
|
97
|
+
}
|
|
98
|
+
async function verifyPrototypePhase(runtime) {
|
|
99
|
+
const phase = "prototype";
|
|
100
|
+
const source = command("proto", phase);
|
|
101
|
+
const protocol = protocolFor(source, phase);
|
|
102
|
+
assertPhase(phase, protocol.interactionMode === "classified-prototype-creation", "prototype source protocol is not classified creation");
|
|
103
|
+
assertDiscoveryHandoffs(phase, protocol.handoffCommands, "source prototype handoffs");
|
|
104
|
+
assertListIncludes(phase, protocol.allowedOutputs, ".openworkflow/decisions/<id>/DECISION.yaml", "prototype cannot write decision audit");
|
|
105
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.before, "Classify prototype mode", "prototype does not classify mode first");
|
|
106
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.before, "Detect reference inputs", "prototype does not detect references");
|
|
107
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.during, "high-fidelity static concept", "prototype does not require static concept");
|
|
108
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.after, "decision audit record internally", "prototype does not write decision audit internally");
|
|
109
|
+
assertSomeIncludes(phase, protocol.antiPatterns, "Do not ask the user to manually invoke /ow:decision", "prototype permits manual decision handoff");
|
|
110
|
+
const generated = commandRecord(runtime, "proto", phase);
|
|
111
|
+
assertDiscoveryHandoffs(phase, stringList(generated, "handoff_commands", phase), "generated prototype handoffs");
|
|
112
|
+
assertListIncludes(phase, stringList(generated, "allowed_outputs", phase), ".openworkflow/decisions/<id>/DECISION.yaml", "generated prototype cannot write decision audit");
|
|
113
|
+
const packet = packetRecord(runtime, "/ow:proto", phase);
|
|
114
|
+
assertSomeIncludes(phase, nestedStringList(packet, ["audit_checkpoints", "during"], phase), "before HTML", "context packet lost visual-first ordering");
|
|
115
|
+
assertSomeIncludes(phase, nestedStringList(packet, ["audit_checkpoints", "after"], phase), "decision audit record internally", "context packet lost internal decision audit");
|
|
116
|
+
const skill = await readSkill(runtime, "ow-proto");
|
|
117
|
+
for (const tag of [
|
|
118
|
+
"prototype_classification",
|
|
119
|
+
"reference_extraction",
|
|
120
|
+
"visual_first_path",
|
|
121
|
+
"design_seed_protocol",
|
|
122
|
+
"verification_protocol",
|
|
123
|
+
"self_critique",
|
|
124
|
+
"internal_decision_audit",
|
|
125
|
+
]) {
|
|
126
|
+
assertIncludes(phase, skill, `<${tag}>`, `skill missing ${tag} block`);
|
|
127
|
+
}
|
|
128
|
+
assertIncludes(phase, skill, "image generation before HTML", "skill lost image generation before HTML rule");
|
|
129
|
+
assertIncludes(phase, skill, "reference-pattern extraction", "skill lost reference-pattern extraction wording");
|
|
130
|
+
assertIncludes(phase, skill, "repair pass before evidence handoff", "skill lost critique repair gate");
|
|
131
|
+
assertIncludes(phase, skill, "decision_record", "skill does not expose decision artifact contract for internal audit");
|
|
132
|
+
assertNotIncludes(phase, extractBlock(skill, "handoff_commands"), "/ow:decision", "skill exposes decision in prototype handoffs");
|
|
133
|
+
const artifacts = getDiscoveryArtifactContractsForCommand("/ow:proto").map((artifact) => artifact.artifactType);
|
|
134
|
+
assertListIncludes(phase, artifacts, "prototype_evidence", "source proto artifacts missing prototype evidence");
|
|
135
|
+
assertListIncludes(phase, artifacts, "decision_record", "source proto artifacts missing decision record");
|
|
136
|
+
const template = await readYaml(join(runtime.target, ".openworkflow", "prototypes", "_templates", "EVIDENCE.yaml"));
|
|
137
|
+
assertPhase(phase, "reference_analysis" in template, "prototype template missing reference analysis");
|
|
138
|
+
assertPhase(phase, "visual_concept_policy" in template, "prototype template missing visual concept policy");
|
|
139
|
+
assertPhase(phase, "concept_evidence" in template, "prototype template missing concept evidence");
|
|
140
|
+
assertPhase(phase, "implementation_evidence" in template, "prototype template missing implementation evidence");
|
|
141
|
+
assertPhase(phase, "verification" in template, "prototype template missing verification evidence");
|
|
142
|
+
assertPhase(phase, "self_critique" in template, "prototype template missing self critique");
|
|
143
|
+
const conceptPolicy = recordField(template, "visual_concept_policy", phase);
|
|
144
|
+
assertPhase(phase, conceptPolicy.image_generation === "generated|skipped_by_user|not_applicable", "prototype template lost image generation policy");
|
|
145
|
+
const critique = recordField(template, "self_critique", phase);
|
|
146
|
+
for (const key of ["philosophy", "hierarchy", "execution", "specificity", "restraint", "accessibility", "responsive_behavior", "repairs"]) {
|
|
147
|
+
assertPhase(phase, key in critique, `prototype critique missing ${key}`);
|
|
148
|
+
}
|
|
149
|
+
const handoff = recordField(template, "handoff", phase);
|
|
150
|
+
assertPhase(phase, handoff.next_command !== "/ow:decision", "prototype template exposes manual decision as next command");
|
|
151
|
+
assertListIncludes(phase, USER_FACING_DISCOVERY_HANDOFFS, String(handoff.next_command), "prototype template next command is not user-facing");
|
|
152
|
+
}
|
|
153
|
+
async function verifyTunePhase(runtime) {
|
|
154
|
+
const phase = "tune";
|
|
155
|
+
const source = command("tune", phase);
|
|
156
|
+
const protocol = protocolFor(source, phase);
|
|
157
|
+
assertPhase(phase, protocol.interactionMode === "prototype-revision-orchestration", "tune source protocol is not revision orchestration");
|
|
158
|
+
assertDiscoveryHandoffs(phase, protocol.handoffCommands, "source tune handoffs");
|
|
159
|
+
assertListIncludes(phase, protocol.allowedOutputs, ".openworkflow/decisions/<id>/DECISION.yaml", "tune cannot write decision audit");
|
|
160
|
+
assertListExcludes(phase, protocol.requiredContext, ".openworkflow/prototypes/PROTOTYPE_INDEX.yaml", "tune requires prototype index and cannot bootstrap from validation");
|
|
161
|
+
assertListIncludes(phase, protocol.optionalContext, ".openworkflow/prototypes/PROTOTYPE_INDEX.yaml", "tune optional context missing prototype index");
|
|
162
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.before, "/ow:tune:proto default to the current prototype", "tune does not default to current prototype");
|
|
163
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.before, "no current prototype exists", "tune does not orchestrate proto when prototype is absent");
|
|
164
|
+
assertSomeIncludes(phase, protocol.auditCheckpoints.after, "internal decision audit record", "tune does not record decision audit internally");
|
|
165
|
+
assertSomeIncludes(phase, protocol.antiPatterns, "Do not ask the user to manually invoke /ow:decision", "tune permits manual decision handoff");
|
|
166
|
+
const generated = commandRecord(runtime, "tune", phase);
|
|
167
|
+
assertDiscoveryHandoffs(phase, stringList(generated, "handoff_commands", phase), "generated tune handoffs");
|
|
168
|
+
assertListIncludes(phase, stringList(generated, "allowed_outputs", phase), ".openworkflow/decisions/<id>/DECISION.yaml", "generated tune cannot write decision audit");
|
|
169
|
+
const packet = packetRecord(runtime, "/ow:tune", phase);
|
|
170
|
+
assertListExcludes(phase, stringList(packet, "required", phase), ".openworkflow/prototypes/PROTOTYPE_INDEX.yaml", "context packet requires prototype index");
|
|
171
|
+
assertListIncludes(phase, stringList(packet, "optional", phase), ".openworkflow/prototypes/PROTOTYPE_INDEX.yaml", "context packet optional context missing prototype index");
|
|
172
|
+
const skill = await readSkill(runtime, "ow-tune");
|
|
173
|
+
for (const tag of ["target_resolution", "proto_orchestration", "revision_protocol", "internal_decision_audit"]) {
|
|
174
|
+
assertIncludes(phase, skill, `<${tag}>`, `skill missing ${tag} block`);
|
|
175
|
+
}
|
|
176
|
+
assertIncludes(phase, skill, "/ow:tune resolves to the current prototype by default.", "skill lost default target behavior");
|
|
177
|
+
assertIncludes(phase, skill, "Every tune pass must write or update a decision audit record internally.", "skill lost decision audit requirement");
|
|
178
|
+
assertIncludes(phase, skill, "Do not expose /ow:decision as the next manual user step", "skill exposes decision as user step");
|
|
179
|
+
assertNotIncludes(phase, extractBlock(skill, "handoff_commands"), "/ow:decision", "skill exposes decision in tune handoffs");
|
|
180
|
+
const artifacts = getDiscoveryArtifactContractsForCommand("/ow:tune").map((artifact) => artifact.artifactType);
|
|
181
|
+
assertListIncludes(phase, artifacts, "prototype_evidence", "source tune artifacts missing prototype evidence");
|
|
182
|
+
assertListIncludes(phase, artifacts, "decision_record", "source tune artifacts missing decision record");
|
|
183
|
+
}
|
|
184
|
+
async function verifyInternalDecisionPhase(runtime) {
|
|
185
|
+
const phase = "internal-decision";
|
|
186
|
+
const source = command("decision", phase);
|
|
187
|
+
assertPhase(phase, source.visibility === "internal", "source decision command is not internal");
|
|
188
|
+
const generated = commandRecord(runtime, "decision", phase);
|
|
189
|
+
assertPhase(phase, stringField(generated, "visibility", phase) === "internal", "generated decision command is not internal");
|
|
190
|
+
for (const id of ["proto", "tune", "design", "validation"]) {
|
|
191
|
+
const handoffs = stringList(commandRecord(runtime, id, phase), "handoff_commands", phase);
|
|
192
|
+
assertListExcludes(phase, handoffs, "/ow:decision", `${id} exposes manual decision handoff`);
|
|
193
|
+
}
|
|
194
|
+
const skill = await readSkill(runtime, "ow-decision");
|
|
195
|
+
assertIncludes(phase, skill, "<command_visibility>internal</command_visibility>", "decision skill is not internal");
|
|
196
|
+
assertIncludes(phase, skill, "<internal_audit_only>", "decision skill missing internal audit block");
|
|
197
|
+
assertIncludes(phase, skill, "not as a normal user-facing workflow step", "decision skill exposes normal user workflow");
|
|
198
|
+
}
|
|
199
|
+
async function verifyDisplayLabels(runtime) {
|
|
200
|
+
const phase = "display-labels";
|
|
201
|
+
for (const id of ["vision", "validation", "proto", "tune", "decision", "design", "spec"]) {
|
|
202
|
+
const skillName = `ow-${id}`;
|
|
203
|
+
const semanticCommand = `/ow:${id}`;
|
|
204
|
+
const displayName = `ow:${id}`;
|
|
205
|
+
const interfaceContent = await read(join(runtime.target, ".agents", "skills", skillName, "agents", "openai.yaml"));
|
|
206
|
+
const skill = await readSkill(runtime, skillName);
|
|
207
|
+
assertPhase(phase, hasYamlScalar(interfaceContent, "display_name", displayName), `${skillName} missing slashless display name`);
|
|
208
|
+
assertPhase(phase, !hasYamlScalar(interfaceContent, "display_name", semanticCommand), `${skillName} display name includes semantic slash`);
|
|
209
|
+
assertIncludes(phase, skill, `Semantic command: ${semanticCommand}`, `${skillName} missing semantic command`);
|
|
210
|
+
assertIncludes(phase, interfaceContent, `Use ${semanticCommand}`, `${skillName} default prompt lost semantic command`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
async function run(command, env) {
|
|
214
|
+
await new Promise((resolvePromise, reject) => {
|
|
215
|
+
const child = spawn(command[0] ?? "", command.slice(1), {
|
|
216
|
+
cwd: REPO_ROOT,
|
|
217
|
+
env,
|
|
218
|
+
stdio: "inherit",
|
|
219
|
+
});
|
|
220
|
+
child.on("error", reject);
|
|
221
|
+
child.on("close", (code) => {
|
|
222
|
+
if (code === 0) {
|
|
223
|
+
resolvePromise();
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
reject(new Error(`command failed (${code ?? "signal"}): ${command.join(" ")}`));
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function command(id, phase) {
|
|
232
|
+
const found = getWorkflowCommands().find((item) => item.id === id);
|
|
233
|
+
if (!found) {
|
|
234
|
+
throw phaseError(phase, `source command missing ${id}`);
|
|
235
|
+
}
|
|
236
|
+
return found;
|
|
237
|
+
}
|
|
238
|
+
function protocolFor(command, phase) {
|
|
239
|
+
if (!command.protocol) {
|
|
240
|
+
throw phaseError(phase, `${command.id} source command missing protocol`);
|
|
241
|
+
}
|
|
242
|
+
return command.protocol;
|
|
243
|
+
}
|
|
244
|
+
function commandRecord(runtime, id, phase) {
|
|
245
|
+
return findRecord(runtime.commands, "id", id, phase, `generated command missing ${id}`);
|
|
246
|
+
}
|
|
247
|
+
function packetRecord(runtime, command, phase) {
|
|
248
|
+
return findRecord(runtime.packets, "command", command, phase, `context packet missing ${command}`);
|
|
249
|
+
}
|
|
250
|
+
function findRecord(records, key, value, phase, message) {
|
|
251
|
+
const found = records.find((record) => record[key] === value);
|
|
252
|
+
if (!found) {
|
|
253
|
+
throw phaseError(phase, message);
|
|
254
|
+
}
|
|
255
|
+
return found;
|
|
256
|
+
}
|
|
257
|
+
async function readSkill(runtime, name) {
|
|
258
|
+
return read(join(runtime.target, ".agents", "skills", name, "SKILL.md"));
|
|
259
|
+
}
|
|
260
|
+
async function readYaml(path) {
|
|
261
|
+
const parsed = parseYaml(await read(path));
|
|
262
|
+
assert(isRecord(parsed), `${path} must be a YAML mapping`);
|
|
263
|
+
return parsed;
|
|
264
|
+
}
|
|
265
|
+
async function read(path) {
|
|
266
|
+
return readFile(path, "utf8");
|
|
267
|
+
}
|
|
268
|
+
async function assertFile(path) {
|
|
269
|
+
const info = await stat(path);
|
|
270
|
+
assert(info.isFile(), `missing file: ${path}`);
|
|
271
|
+
}
|
|
272
|
+
function records(data, key, phase) {
|
|
273
|
+
const value = data[key];
|
|
274
|
+
assertPhase(phase, Array.isArray(value), `${key} must be a list`);
|
|
275
|
+
return value.map((item, index) => {
|
|
276
|
+
assertPhase(phase, isRecord(item), `${key}[${index}] must be a mapping`);
|
|
277
|
+
return item;
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
function recordField(data, key, phase) {
|
|
281
|
+
const value = data[key];
|
|
282
|
+
assertPhase(phase, isRecord(value), `${key} must be a mapping`);
|
|
283
|
+
return value;
|
|
284
|
+
}
|
|
285
|
+
function stringField(data, key, phase) {
|
|
286
|
+
const value = data[key];
|
|
287
|
+
assertPhase(phase, typeof value === "string", `${key} must be a string`);
|
|
288
|
+
return value;
|
|
289
|
+
}
|
|
290
|
+
function stringList(data, key, phase) {
|
|
291
|
+
const value = data[key];
|
|
292
|
+
assertPhase(phase, Array.isArray(value), `${key} must be a list`);
|
|
293
|
+
return value.map((item, index) => {
|
|
294
|
+
assertPhase(phase, typeof item === "string", `${key}[${index}] must be a string`);
|
|
295
|
+
return item;
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function nestedStringList(data, keys, phase) {
|
|
299
|
+
let current = data;
|
|
300
|
+
for (const key of keys.slice(0, -1)) {
|
|
301
|
+
assertPhase(phase, isRecord(current), `${keys.join(".")} parent must be a mapping`);
|
|
302
|
+
current = current[key];
|
|
303
|
+
}
|
|
304
|
+
assertPhase(phase, isRecord(current), `${keys.join(".")} parent must be a mapping`);
|
|
305
|
+
return stringList(current, keys[keys.length - 1] ?? "", phase);
|
|
306
|
+
}
|
|
307
|
+
function assertDiscoveryHandoffs(phase, actual, label) {
|
|
308
|
+
for (const command of USER_FACING_DISCOVERY_HANDOFFS) {
|
|
309
|
+
assertListIncludes(phase, actual, command, `${label} missing ${command}`);
|
|
310
|
+
}
|
|
311
|
+
assertListExcludes(phase, actual, "/ow:decision", `${label} exposes manual decision`);
|
|
312
|
+
}
|
|
313
|
+
function assertExactList(phase, actual, expected, message) {
|
|
314
|
+
assertPhase(phase, JSON.stringify(actual) === JSON.stringify(expected), `${message}: ${actual.join(", ")}`);
|
|
315
|
+
}
|
|
316
|
+
function assertListIncludes(phase, list, item, message) {
|
|
317
|
+
assertPhase(phase, list.includes(item), message);
|
|
318
|
+
}
|
|
319
|
+
function assertListExcludes(phase, list, item, message) {
|
|
320
|
+
assertPhase(phase, !list.includes(item), message);
|
|
321
|
+
}
|
|
322
|
+
function assertSomeIncludes(phase, list, needle, message) {
|
|
323
|
+
assertPhase(phase, list.some((item) => item.includes(needle)), message);
|
|
324
|
+
}
|
|
325
|
+
function assertIncludes(phase, content, needle, message) {
|
|
326
|
+
assertPhase(phase, content.includes(needle), message);
|
|
327
|
+
}
|
|
328
|
+
function assertNotIncludes(phase, content, needle, message) {
|
|
329
|
+
assertPhase(phase, !content.includes(needle), message);
|
|
330
|
+
}
|
|
331
|
+
function hasYamlScalar(content, key, value) {
|
|
332
|
+
return content.includes(`${key}: ${value}`) || content.includes(`${key}: "${value}"`);
|
|
333
|
+
}
|
|
334
|
+
function extractBlock(content, key) {
|
|
335
|
+
const openTag = `<${key}>`;
|
|
336
|
+
const closeTag = `</${key}>`;
|
|
337
|
+
if (!content.includes(openTag) || !content.includes(closeTag)) {
|
|
338
|
+
return "";
|
|
339
|
+
}
|
|
340
|
+
return content.split(openTag, 2)[1]?.split(closeTag, 1)[0] ?? "";
|
|
341
|
+
}
|
|
342
|
+
function isRecord(value) {
|
|
343
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
344
|
+
}
|
|
345
|
+
function assertPhase(phase, condition, message) {
|
|
346
|
+
if (!condition) {
|
|
347
|
+
throw phaseError(phase, message);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function assert(condition, message) {
|
|
351
|
+
if (!condition) {
|
|
352
|
+
throw new Error(message);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function phaseError(phase, message) {
|
|
356
|
+
return new Error(`[${phase}] ${message}`);
|
|
357
|
+
}
|
|
358
|
+
main()
|
|
359
|
+
.then((code) => {
|
|
360
|
+
process.exitCode = code;
|
|
361
|
+
})
|
|
362
|
+
.catch((error) => {
|
|
363
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
364
|
+
process.exitCode = 1;
|
|
365
|
+
});
|
|
366
|
+
//# sourceMappingURL=verifyWorkflowE2E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verif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AAS,WAAW,CAAC,KAAa,EAAE,SAAkB,EAAE,OAAe;IACrE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,SAAkB,EAAE,OAAe;IACjD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,OAAe;IAChD,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,IAAI,EAAE;KACH,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;IACb,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC,CAAC;KACD,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACxB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { booleanFlag, parseArgs } from "./args.js";
|
|
3
|
+
import { doctorCommand } from "./commands/doctor.js";
|
|
4
|
+
import { initCommand } from "./commands/init.js";
|
|
5
|
+
import { syncCommand } from "./commands/sync.js";
|
|
6
|
+
import { validateCommand } from "./commands/validate.js";
|
|
7
|
+
async function main() {
|
|
8
|
+
const parsed = parseArgs(process.argv.slice(2));
|
|
9
|
+
if (!parsed.command || parsed.command === "help" || parsed.command === "--help" || parsed.command === "-h" || booleanFlag(parsed.flags, "help")) {
|
|
10
|
+
printHelp();
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
if (parsed.command === "init") {
|
|
14
|
+
return initCommand(parsed.positional, parsed.flags);
|
|
15
|
+
}
|
|
16
|
+
if (parsed.command === "validate") {
|
|
17
|
+
return validateCommand(parsed.flags);
|
|
18
|
+
}
|
|
19
|
+
if (parsed.command === "sync") {
|
|
20
|
+
return syncCommand(parsed.flags);
|
|
21
|
+
}
|
|
22
|
+
if (parsed.command === "doctor") {
|
|
23
|
+
return doctorCommand(parsed.flags);
|
|
24
|
+
}
|
|
25
|
+
console.error(`Unknown command: ${parsed.command}`);
|
|
26
|
+
printHelp();
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
function printHelp() {
|
|
30
|
+
console.log(`OpenWorkflow CLI
|
|
31
|
+
|
|
32
|
+
Usage:
|
|
33
|
+
openworkflow init <folder> --tools codex [--force]
|
|
34
|
+
openworkflow validate --root <folder>
|
|
35
|
+
openworkflow sync --root <folder> --tools codex [--force]
|
|
36
|
+
openworkflow doctor --root <folder> --tools codex
|
|
37
|
+
|
|
38
|
+
Commands:
|
|
39
|
+
init Initialize .openworkflow contracts and optional tool adapters.
|
|
40
|
+
validate Validate .openworkflow contract files.
|
|
41
|
+
sync Regenerate project-local tool adapters from packaged templates.
|
|
42
|
+
doctor Check generated adapter files for missing or stale templates.
|
|
43
|
+
`);
|
|
44
|
+
}
|
|
45
|
+
main().then((code) => {
|
|
46
|
+
process.exitCode = code;
|
|
47
|
+
}).catch((error) => {
|
|
48
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
49
|
+
process.exitCode = 1;
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/cli/src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OA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;;;CAab,CAAC,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;IACnB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC1B,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type DiscoveryArtifactType = "vision_session" | "validation_target" | "prototype_evidence" | "decision_record" | "product_design";
|
|
2
|
+
export interface DiscoveryArtifactContract {
|
|
3
|
+
artifactType: DiscoveryArtifactType;
|
|
4
|
+
contractType: "vision" | "validation" | "prototype" | "decision" | "design";
|
|
5
|
+
command: string;
|
|
6
|
+
title: string;
|
|
7
|
+
sourceOfTruthPath: string;
|
|
8
|
+
templatePath: string;
|
|
9
|
+
indexPath: string;
|
|
10
|
+
indexCollectionKey: string;
|
|
11
|
+
notePath: string;
|
|
12
|
+
reviewPath: string | null;
|
|
13
|
+
disclosureLevel: 2;
|
|
14
|
+
requiredKeys: string[];
|
|
15
|
+
readPolicy: ArtifactReadPolicy;
|
|
16
|
+
activePointer: ActivePointer;
|
|
17
|
+
evidencePolicy: string;
|
|
18
|
+
handoffKey: string;
|
|
19
|
+
template: Record<string, unknown>;
|
|
20
|
+
conditionalPackets?: readonly ConditionalPacketMetadata[];
|
|
21
|
+
}
|
|
22
|
+
export interface ConditionalPacketMetadata {
|
|
23
|
+
artifactType: string;
|
|
24
|
+
path: string;
|
|
25
|
+
requiredByDefault: boolean;
|
|
26
|
+
when: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ArtifactReadPolicy {
|
|
29
|
+
loadByDefault: boolean;
|
|
30
|
+
agentReadOrder: number;
|
|
31
|
+
maxYamlLines: number;
|
|
32
|
+
maxNoteLines: number;
|
|
33
|
+
rawEvidence: "never_by_default" | "only_when_referenced" | "human_review_only";
|
|
34
|
+
}
|
|
35
|
+
export interface ActivePointer {
|
|
36
|
+
indexPath: string;
|
|
37
|
+
pointerKey: string;
|
|
38
|
+
collectionKey: string;
|
|
39
|
+
idKey: string;
|
|
40
|
+
pathKey: string;
|
|
41
|
+
}
|
|
42
|
+
export interface DisclosureLevel {
|
|
43
|
+
level: 0 | 1 | 2 | 3 | 4;
|
|
44
|
+
name: string;
|
|
45
|
+
defaultForAgents: boolean;
|
|
46
|
+
purpose: string;
|
|
47
|
+
examples: string[];
|
|
48
|
+
}
|
|
49
|
+
export declare const DISCLOSURE_LEVELS: readonly DisclosureLevel[];
|
|
50
|
+
export declare const DISCOVERY_ARTIFACT_CONTRACTS: readonly DiscoveryArtifactContract[];
|
|
51
|
+
export declare function getDiscoveryArtifactContracts(): readonly DiscoveryArtifactContract[];
|
|
52
|
+
export declare function getDisclosureLevels(): readonly DisclosureLevel[];
|
|
53
|
+
export declare function getDiscoveryArtifactContractsForCommand(command: string): DiscoveryArtifactContract[];
|