diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..89a7c7b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Default owner for everything - review is requested automatically on external PRs. +* @using-system diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..0053c62 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,45 @@ +name: Bug report +description: Something in oddyssey misbehaves - a tool, an agent contract, a skill, the stack +labels: [bug] +body: + - type: markdown + attributes: + value: | + Thanks for the report. The house style (set by our first external consumer): state what you **confirmed** with a command and its output vs what you only **observed** once. Self-contained reports get fixed fastest. + - type: input + id: version + attributes: + label: oddyssey version + description: Package version (apm) or git commit, and oddyssey-mcp version if relevant + placeholder: "1.4.0" + validations: + required: true + - type: input + id: environment + attributes: + label: Environment + description: OS, Docker version, otel-lgtm image tag, target CLI (claude / copilot / opencode / ...) + placeholder: "macOS 15, Docker 29, grafana/otel-lgtm:0.30.2, claude" + validations: + required: true + - type: dropdown + id: confidence + attributes: + label: Status + options: + - "confirmed - reproduced with a command and its output" + - "observed - seen once, not yet isolated" + validations: + required: true + - type: textarea + id: what + attributes: + label: What happens, and what you expected + description: Include the reproduction commands and their real output where possible. + validations: + required: true + - type: textarea + id: extra + attributes: + label: Anything else + description: Suggested fix, workaround you used, related issues. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..1562d8d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Question or idea to discuss + url: https://github.com/using-system/oddyssey/discussions + about: Questions and open-ended ideas belong in Discussions - issues are for bugs and scoped features. + - name: Security vulnerability + url: https://github.com/using-system/oddyssey/security/advisories/new + about: Please report vulnerabilities privately, never in a public issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..1944cc6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,23 @@ +name: Feature request +description: An improvement to the ODD loop, the agents/skills, the MCP server, or the distribution +labels: [enhancement] +body: + - type: textarea + id: problem + attributes: + label: The friction + description: What real situation does the current behavior make painful? Concrete beats abstract. + validations: + required: true + - type: textarea + id: proposal + attributes: + label: Proposed change + description: What you would change, and - if there are options - the trade-offs you see. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Workaround today + description: How you cope without it (helps calibrate priority). diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a83e8b5 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + commit-message: + prefix: "ci(deps)" + - package-ecosystem: uv + directory: /src/mcp-server + schedule: + interval: weekly + commit-message: + prefix: "build(deps)" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..b123406 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,19 @@ + + +## What + + +## Why + + +## How to test + + +## Checklist + +- [ ] PR title follows Conventional Commits (it becomes the squash commit and drives the version — see CONTRIBUTING) +- [ ] No `!` / breaking marker (or it was explicitly discussed first) +- [ ] `ruff check` and `format --check` pass at the CI-pinned version (if `src/` or `tests/` changed) +- [ ] Unit tests pass; integration tests pass if the stack behavior changed +- [ ] No hand edits to generated files (`marketplace/`, `.claude-plugin/`, `.agents/plugins/`) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c14457b..e89ed8e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,26 @@ name: release on: - push: - branches: - - main - # Manual bootstrap/backfill: build and publish the CURRENT version to - # PyPI without any bump (used once to seed the first package). + # Fully manual release flow, two acts: + # 1. Run workflow -> propose : opens/updates the chore(release) PR + # 2. review it, then Run workflow -> publish + # publish merges the (single) open chore(release) PR - failing clearly + # when there is none or more than one - then tags, creates the GitHub + # release, builds, and publishes to PyPI. Every step is skipped when + # already done (tag/release exist, skip-existing on PyPI), so publish + # also serves as bootstrap/backfill and is safe to re-run. workflow_dispatch: + inputs: + mode: + description: >- + propose = open/update the release PR from git history; + publish = merge the release PR, tag, GitHub release, build and + publish to PyPI - idempotent, safe to re-run. + type: choice + default: propose + options: + - propose + - publish jobs: propose-release: @@ -15,7 +29,7 @@ jobs: # the version bumps and CHANGELOG. Nothing is ever pushed to main # directly - a human approves and merges that PR. runs-on: ubuntu-latest - if: "github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release)')" + if: inputs.mode == 'propose' permissions: contents: write pull-requests: write @@ -82,26 +96,62 @@ jobs: marketplace/ tag-and-release: - # Runs on the merge of the chore(release) PR: tags the merge commit and - # publishes the GitHub release with the git-cliff notes. + # Run workflow -> publish: merges the open chore(release) PR (exactly + # one must exist, unless the version was already merged/tagged), then + # tags main's version and creates the GitHub release, both only if + # missing - re-running is a no-op. runs-on: ubuntu-latest - if: "github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)')" + if: inputs.mode == 'publish' permissions: contents: write + pull-requests: write outputs: released: ${{ steps.tag.outputs.released }} tag: ${{ steps.tag.outputs.tag }} steps: + - name: Merge the release PR + id: merge + env: + GH_TOKEN: ${{ github.token }} + run: | + PRS="$(gh pr list -R "${GITHUB_REPOSITORY}" --state open --json number,title \ + --jq '[.[] | select(.title | startswith("chore(release)"))]')" + COUNT="$(echo "$PRS" | jq 'length')" + if [ "$COUNT" -gt 1 ]; then + echo "::error::multiple open chore(release) PRs - close the stale ones first:" + echo "$PRS" | jq -r '.[] | "#\(.number) \(.title)"' + exit 1 + fi + if [ "$COUNT" -eq 0 ]; then + echo "merged=false" >> "$GITHUB_OUTPUT" + echo "No open chore(release) PR - only legitimate as a re-run (the tag guard below decides)." + else + NUMBER="$(echo "$PRS" | jq -r '.[0].number')" + TITLE="$(echo "$PRS" | jq -r '.[0].title')" + echo "Merging release PR #${NUMBER}: ${TITLE}" + gh pr merge -R "${GITHUB_REPOSITORY}" "${NUMBER}" --squash + echo "merged=true" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + ref: main fetch-depth: 0 - - name: Tag the release + - name: Tag the release (if not already tagged) id: tag + env: + MERGED: ${{ steps.merge.outputs.merged }} run: | VERSION="$(grep '^version:' apm.yml | awk '{print $2}')" TAG="v${VERSION}" - git tag "${TAG}" - git push origin "${TAG}" + if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then + echo "${TAG} already exists - leaving it in place." + elif [ "$MERGED" != "true" ]; then + echo "::error::${TAG} is untagged and no chore(release) PR was open - run propose (and merge review) first." + exit 1 + else + git tag "${TAG}" + git push origin "${TAG}" + fi echo "released=true" >> "$GITHUB_OUTPUT" echo "tag=${TAG}" >> "$GITHUB_OUTPUT" - name: Generate the release notes @@ -109,21 +159,26 @@ jobs: uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v4.8.0 with: args: --latest --strip all -o /tmp/release-notes.md - - name: Publish the GitHub release + - name: Publish the GitHub release (if not already published) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG: ${{ steps.tag.outputs.tag }} NOTES: ${{ steps.notes.outputs.content }} - run: gh release create "${TAG}" --title "${TAG}" --notes "${NOTES}" + run: | + if gh release view "${TAG}" >/dev/null 2>&1; then + echo "${TAG} release already exists - leaving it in place." + else + gh release create "${TAG}" --title "${TAG}" --notes "${NOTES}" + fi build: runs-on: ubuntu-latest needs: tag-and-release - if: always() && (needs.tag-and-release.outputs.released == 'true' || github.event_name == 'workflow_dispatch') + if: needs.tag-and-release.outputs.released == 'true' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ needs.tag-and-release.outputs.tag || github.sha }} + ref: ${{ needs.tag-and-release.outputs.tag }} - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 - name: Build the MCP server package run: uv build src/mcp-server --out-dir dist @@ -148,3 +203,7 @@ jobs: path: dist/ - name: Publish to PyPI (trusted publishing) uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + with: + # Publish is idempotent end to end: a re-run with the version + # already on PyPI succeeds instead of failing on duplicates. + skip-existing: true diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..948ced5 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,85 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at mnicolescu@gmail.com. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..49cd860 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,78 @@ +# Contributing to oddyssey + +Thanks for helping build Observability-Driven Development for coding +agents. This project is young and external feedback has already shaped +it — issues, docs fixes, and code are all welcome. + +## The two-minute orientation + +The repo is an [APM](https://microsoft.github.io/apm/) package plus a +Python MCP server: + +| Where | What | +| --- | --- | +| `.apm/agents/`, `.apm/skills/`, `.apm/prompts/` | The product's primitives (markdown contracts). Cross-references between them are **by name only** — never by path — so they survive materialization into any CLI. | +| `src/mcp-server/` | The `oddyssey-mcp` Python package (self-contained uv project). `tests/` mirrors `src/`. | +| `marketplace/`, `.claude-plugin/`, `.agents/plugins/` | **GENERATED** by `scripts/build-marketplace.sh` at release time — never edit them by hand; edit `.apm/` and `apm.yml` instead. | +| `.odd/` | The repo's own ODD memory: committed observation reports (instrumentation reports join them as investigations run). Part of the product's dogfooding — do not delete. | +| `docs/superpowers/` | Specs and implementation plans of past waves — the design record. | + +## Building and testing + +Everything runs from the repo root. The pinned tool versions below are +the CI ones — `.github/workflows/` is canonical if they ever disagree: + +```bash +# Unit tests (no Docker needed) +uv run --project src/mcp-server pytest -c src/mcp-server/pyproject.toml tests/mcp-server -v + +# Lint + format check (exactly what CI enforces; drop --check to apply fixes) +uvx ruff@0.16.4 check src/mcp-server tests/mcp-server +uvx ruff@0.16.4 format --check src/mcp-server tests/mcp-server + +# Integration tests (needs Docker; drives the real stack) +bash integration-tests/mcp-server/run.sh + +# Validate the APM package like CI does +uvx --from apm-cli==0.28.0 apm install --target claude && uvx --from apm-cli==0.28.0 apm audit +``` + +Two hard constraints on the MCP server (owned by the +[instrumentation spec](docs/superpowers/specs/2026-08-22-mcp-otel-instrumentation-design.md) +§2 — it wins if this summary ever drifts): + +- **stdout is the JSON-RPC wire.** Nothing may ever print to stdout. +- **Telemetry never breaks a tool.** Export failure is the normal + state; bootstrap failure degrades to no telemetry, never to a dead + server. + +## Pull requests + +- **The PR title IS the release note.** We squash-merge with the PR + title as the commit message, and versions are computed from + [Conventional Commits](https://www.conventionalcommits.org/): + `feat:` → minor, `fix:`/others → patch. Use + `type(scope): lowercase imperative description`. +- **Never add a `!` or `BREAKING CHANGE` marker** without discussing it + in the PR first — it triggers a major release. +- CI must be green: the 8-target APM matrix runs on every PR; the + server's lint/unit/integration jobs run when `src/` or `tests/` + change. +- Keep one logical change per PR, and match the surrounding style — + the agent/skill markdown files are executable contracts, so wording + changes there are behavior changes. + +## Issues + +Use the issue forms (bug / feature) — the bug form's fields, including +its confirmed-vs-observed status, ARE the house style. Questions belong +in [Discussions](https://github.com/using-system/oddyssey/discussions). + +## Trying your changes end to end + +The product tests itself: install your working copy into a scratch +consumer +(`uvx --from apm-cli==0.28.0 apm install /path/to/your/clone --target claude`), +or run +the ODD loop on the repo itself (`/odd-observe` on `oddyssey-mcp`) — +the stored reports under `.odd/` show what a healthy run looks like. diff --git a/README.md b/README.md index 13c7c0c..bab6507 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ **A CLI toolbox for Observability-Driven Development (ODD).** +[![CI](https://github.com/using-system/oddyssey/actions/workflows/ci-mcp-server.yml/badge.svg?event=pull_request)](https://github.com/using-system/oddyssey/actions/workflows/ci-mcp-server.yml) +[![PyPI](https://img.shields.io/pypi/v/oddyssey-mcp)](https://pypi.org/project/oddyssey-mcp/) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) + ## Install ### With APM (every CLI) @@ -256,13 +260,20 @@ accumulates knowledge instead of starting blind. ## Development -```bash -uv run --project src/mcp-server pytest -c src/mcp-server/pyproject.toml tests/mcp-server -bash integration-tests/mcp-server/run.sh # end-to-end via an MCP client; needs Docker -``` +The exact build, test, and lint commands live in +[CONTRIBUTING.md](CONTRIBUTING.md) — single source, matching what CI +enforces. In short: the project under `src/` is a self-contained uv +project (own `pyproject.toml`); `tests/` mirrors `src/`. + +## Contributing -The project under `src/` is a self-contained uv project (own -`pyproject.toml`); `tests/` mirrors `src/`. +Issues, docs fixes, and code are welcome — see +[CONTRIBUTING.md](CONTRIBUTING.md) for the layout, the exact build/test +commands, and the PR conventions (squash titles drive the released +version). Questions and ideas belong in +[Discussions](https://github.com/using-system/oddyssey/discussions); +[good first issues](https://github.com/using-system/oddyssey/issues?q=is%3Aopen+label%3A%22good+first+issue%22) +are waiting. ## License diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..4909276 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported versions + +Only the latest released version of the `oddyssey` package and the +`oddyssey-mcp` PyPI package receives security fixes. + +## Reporting a vulnerability + +Please **do not open a public issue** for security problems. Use +GitHub's private vulnerability reporting: +[Report a vulnerability](https://github.com/using-system/oddyssey/security/advisories/new). + +You can expect an acknowledgement within a few days. Relevant scope +includes the MCP server (`oddyssey-mcp`, executed via `uvx` on user +machines), the generated marketplace artifacts, and the release +pipeline (PyPI trusted publishing).