Skip to content

Add OSOP workflow example — automated code review pipeline#13727

Open
Archie0125 wants to merge 4 commits intomicrosoft:mainfrom
Archie0125:add-osop-example
Open

Add OSOP workflow example — automated code review pipeline#13727
Archie0125 wants to merge 4 commits intomicrosoft:mainfrom
Archie0125:add-osop-example

Conversation

@Archie0125
Copy link
Copy Markdown

Summary

  • Adds a portable YAML workflow definition (python/samples/concepts/osop/code-review-pipeline.osop.yaml) describing an automated PR code review pipeline with parallel analysis stages
  • Includes a README mapping OSOP concepts to Semantic Kernel equivalents (ChatCompletionAgent, plugins, KernelFunction, etc.)
  • Additive only — no existing files are modified

What is OSOP?

OSOP (Open Standard for Orchestration Protocols) is a portable YAML format for describing AI agent workflows — think OpenAPI, but for agent orchestration. It lets you document, validate, and visualize multi-agent patterns in a framework-agnostic way.

The .osop.yaml file is self-documenting and human-readable. It works standalone without any OSOP tooling installed.

Files Added

File Description
python/samples/concepts/osop/README.md Explains OSOP + Semantic Kernel integration with concept mapping table
python/samples/concepts/osop/code-review-pipeline.osop.yaml Code review workflow: fetch diff → parallel analysis (complexity + security + tests) → generate review → post comments

Test Plan

  • Verify YAML is valid: python -c "import yaml; yaml.safe_load(open('python/samples/concepts/osop/code-review-pipeline.osop.yaml'))"
  • Confirm no existing files were modified
  • Review README for accuracy of Semantic Kernel concept mappings

Adds a portable YAML workflow definition describing an automated PR code
review pipeline (fetch diff, parallel analysis, generate review, post
comments) using the OSOP open standard. Additive only — no existing files modified.

OSOP (Open Standard for Orchestration Protocols) is a framework-agnostic
format for describing AI workflows, similar to how OpenAPI standardizes
REST API descriptions.
Adds documentation explaining OSOP format and how it maps to Semantic Kernel concepts.
@Archie0125 Archie0125 requested a review from a team as a code owner April 2, 2026 07:03
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 4 | Confidence: 91%

✓ Correctness

This PR adds two new documentation-only files (a README and a YAML workflow definition) for OSOP (Open Standard for Orchestration Protocols) under python/samples/concepts/osop/. There is no executable Python code. The only correctness issue is a filename mismatch: the YAML file's internal comment on line 7 references semantic-kernel-code-review.osop.yaml but the actual file is named code-review-pipeline.osop.yaml. The README correctly references the filename. Additionally, the concepts README.md is not updated to list this new sample directory, though that's more of a completeness concern than a correctness bug.

✓ Security Reliability

This PR adds two documentation-only files (a README and a YAML workflow spec) under a new python/samples/concepts/osop/ directory. No executable code is introduced—these are purely declarative/descriptive files. From a security and reliability standpoint, the files themselves pose no direct risk (no code execution, no secrets, no deserialization). The only notable concern is that the README directs users to install a third-party package (pip install osop) from PyPI, which introduces a supply-chain trust dependency that users should be aware of, but this is standard practice for sample documentation.

✓ Test Coverage

This PR adds two purely documentation/sample files: a README.md and a YAML workflow definition describing an OSOP (Open Standard for Orchestration Protocols) code-review pipeline. No Python code, no library changes, and no behavioral modifications are introduced. Since there is no executable code to test, the lack of accompanying tests is appropriate. Other sample concept directories (agents, mcp, chat_history, etc.) follow the same pattern of including README files without dedicated tests. No test coverage concerns arise from this change.

✗ Design Approach

This PR adds a new osop/ directory under python/samples/concepts/ containing only a README and a declarative YAML file — no runable Python code. Every other directory under python/samples/concepts/ contains actual .py files that exercise Semantic Kernel APIs; this PR fundamentally breaks that contract. The YAML is a description of a workflow in a third-party format (OSOP) and cannot be executed by Semantic Kernel. The README frames OSOP as a peer to OpenAPI but the PyPI osop package has zero metadata (no author, no summary, no home page, no project URLs), making the pip install osop instruction untrustworthy. Additionally, the inline comment in the YAML references a wrong filename, and the check_tests agent node is missing a config.model field that all other agent nodes define.

Flagged Issues

  • The python/samples/concepts/ directory is for runable Python code demonstrating Semantic Kernel features. This PR adds only a YAML description file and README with no Python code that invokes any SK API. The correct approach is to either (a) add a working Python sample that uses SK to implement this workflow and optionally include the YAML as a supplementary artifact, or (b) place purely-declarative format examples under a resources/ or docs/ directory rather than concepts/.
  • The pip install osop instruction in README.md points to a PyPI package (osop) that has no author, no summary, no home page, and no project URLs — hallmarks of an unclaimed or placeholder package. Recommending installation of an unveted third-party package in an official Microsoft repository is a security risk.

Suggestions

  • Fix the filename mismatch in the YAML comment on line 7: osop validate semantic-kernel-code-review.osop.yaml should be osop validate code-review-pipeline.osop.yaml to match the actual filename.
  • Consider updating python/samples/concepts/README.md to include the new OSOP section for discoverability, consistent with other sample directories.
  • The README instructs users to run pip install osop — consider adding a note that this is a third-party package not maintained by Microsoft, so users can make an informed trust decision before installing it.
  • The YAML file references https://api.github.com/repos/{owner}/{repo}/pulls/{number} as API endpoints. If this sample is ever used as a basis for actual execution, ensure authentication tokens are handled securely and not embedded in the workflow definition.
  • The check_tests agent node (line 43–47 of the YAML) is the only agent node with no config section specifying a model, which is inconsistent with analyze_complexity and check_patterns. Add a config.model field for consistency.
  • The inline comment on line 7 of the YAML says osop validate semantic-kernel-code-review.osop.yaml but the actual filename is code-review-pipeline.osop.yaml. Update the comment to match.

Automated review by Archie0125's agents

# in parallel, generate a structured review, post comments on GitHub,
# and request changes if critical issues are found.
#
# Run with Semantic Kernel or validate: osop validate semantic-kernel-code-review.osop.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filename mismatch: the comment references semantic-kernel-code-review.osop.yaml but the actual file is named code-review-pipeline.osop.yaml.

Suggested change
# Run with Semantic Kernel or validate: osop validate semantic-kernel-code-review.osop.yaml
# Run with Semantic Kernel or validate: osop validate code-review-pipeline.osop.yaml

# in parallel, generate a structured review, post comments on GitHub,
# and request changes if critical issues are found.
#
# Run with Semantic Kernel or validate: osop validate semantic-kernel-code-review.osop.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filename in the comment doesn't match the actual file. Should be code-review-pipeline.osop.yaml.

Suggested change
# Run with Semantic Kernel or validate: osop validate semantic-kernel-code-review.osop.yaml
# Run with Semantic Kernel or validate: osop validate code-review-pipeline.osop.yaml

Comment on lines +43 to +47
- id: "check_tests"
type: "agent"
subtype: "llm"
name: "Check Test Coverage"
description: "Verify new code paths have corresponding test cases."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check_tests is the only agent node without a config.model field. All other type: agent nodes specify a model; omitting it here creates an inconsistent and incomplete workflow definition.

Suggested change
- id: "check_tests"
type: "agent"
subtype: "llm"
name: "Check Test Coverage"
description: "Verify new code paths have corresponding test cases."
- id: "check_tests"
type: "agent"
subtype: "llm"
name: "Check Test Coverage"
description: "Verify new code paths have corresponding test cases."
config:
model: "gpt-4o"

## Quick Start

```bash
# Validate the workflow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The osop package on PyPI has no author, summary, homepage, or project URLs. Recommending pip install osop in an official Microsoft repo without vetting this package is a trust and supply-chain risk. At minimum, pin to a specific version and verify the package provenance before publishing this.

Suggested change
# Validate the workflow
pip install osop==0.5 # verify package provenance before use

@Archie0125
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

- Fix filename mismatch in YAML comment (line 7)
- Add config.model to check_tests node for consistency
- Add model field to generate_review node
- Remove pip install osop from README (these are declarative docs, not executable)
- Add note that OSOP files are declarative descriptions
- Fix GitHub links to correct repo URLs
- Add osop_workflow_reader.py: reads .osop.yaml and creates SK
  ChatCompletionAgents from agent nodes (addresses design review
  concern that concepts/ needs runnable Python code)
- Remove pip install osop from README (address supply-chain concern)
- Update README to describe the Python script usage
@Archie0125
Copy link
Copy Markdown
Author

Thanks for the thorough review! Addressed the actionable items:

  1. Fixed filename reference in the YAML comment
  2. Added missing config.model field to the check_tests node

Regarding the YAML-only concern — the .osop.yaml file is a self-contained workflow definition that works standalone without any OSOP tooling. It's meant as documentation showing how Semantic Kernel concepts (planners, plugins, kernel functions) map to a portable format. Happy to move it to docs/ or examples/workflows/ if concepts/ isn't the right home. What would you prefer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant