diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..2a01390f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,76 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/PAI/Tools/pipeline-monitor-ui + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/observability-server/dashboard + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/observability-server + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Agents/Tools + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Media/Remotion/Tools + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Scraping/Apify + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Security/WebAssessment/BugBountyTool + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Telos/DashboardTemplate + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Telos/ReportTemplate + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Utilities/Browser + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Utilities/Pptx/Scripts + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Utilities/Prompting/Templates/Tools + schedule: + interval: daily + + - package-ecosystem: npm + directory: / + schedule: + interval: daily diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b26e22c..2474ab56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,9 @@ on: - dev - main +permissions: + contents: read + jobs: ci: name: Lint + Typecheck + Secrets @@ -17,14 +20,19 @@ jobs: timeout-minutes: 10 steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 # ⚠️ CRITICAL: Bun only — NEVER use npm/pnpm (per TECHSTACKPREFERENCES.md) - name: Setup Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version: "1.x" # pin to major — avoids breaking changes from Bun 2.x - name: Install dependencies run: bun install diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 87dde52d..dcf3067e 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -6,19 +6,27 @@ on: pull_request: branches: [dev, main] +permissions: + contents: read + jobs: biome: name: Biome Check runs-on: ubuntu-latest steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Setup Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version: "1.x" # pin to major — avoids breaking changes from Bun 2.x - name: Install dependencies run: bun install --frozen-lockfile diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..bc9b2fe1 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,79 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: ["main"] + pull_request: + # The branches below must be a subset of the branches above + branches: ["main"] + schedule: + - cron: "0 0 * * 1" + +permissions: + contents: read + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ["javascript-typescript", "python"] + # CodeQL supports a combined "javascript-typescript" analyzer for JS/TS. + # Using separate "javascript" and "typescript" entries is invalid. + # Learn more: https://aka.ms/codeql-docs/language-support + + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + + - name: Checkout repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 00000000..9c125043 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,27 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, +# surfacing known-vulnerable versions of the packages declared or updated in the PR. +# Once installed, if the workflow run is marked as required, +# PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + + - name: 'Checkout Repository' + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: 'Dependency Review' + uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0 diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 59163af9..074e5e5b 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -6,6 +6,9 @@ on: pull_request_review_comment: types: [created] +permissions: + contents: read + jobs: opencode: # Only trigger on /opencode or /oc commands @@ -22,14 +25,19 @@ jobs: issues: write steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 persist-credentials: false - name: Run OpenCode - uses: anomalyco/opencode/github@latest + uses: anomalyco/opencode/github@77fc88c8ade8e5a620ebbe1197f3a572d29ae91a # pinned to 77fc88c8 env: # Optional: Falls du einen API Key hast, als Secret konfigurieren # ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..9a411aac --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,27 @@ +name: Release Please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + name: Release Please + runs-on: ubuntu-latest + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml new file mode 100644 index 00000000..fe56191c --- /dev/null +++ b/.github/workflows/scorecards.yml @@ -0,0 +1,82 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '20 7 * * 2' + push: + branches: ["main"] + +# Minimal default permissions — job-level block grants what's actually needed. +permissions: + contents: read + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + contents: read + actions: read + # To allow GraphQL ListCommits to work + issues: read + pull-requests: read + # To detect SAST tools + checks: read + + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + + - name: "Checkout code" + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecards on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1 + with: + sarif_file: results.sarif diff --git a/.github/workflows/upstream-sync-opencode.yml b/.github/workflows/upstream-sync-opencode.yml index 50b3728d..17a1b064 100644 --- a/.github/workflows/upstream-sync-opencode.yml +++ b/.github/workflows/upstream-sync-opencode.yml @@ -16,6 +16,10 @@ on: type: boolean default: false +permissions: + contents: read + issues: write + env: UPSTREAM_OWNER: anomalyco UPSTREAM_REPO: opencode @@ -27,12 +31,18 @@ jobs: runs-on: ubuntu-latest steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout fork - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: repository: ${{ env.FORK_REPO }} token: ${{ secrets.UPSTREAM_SYNC_TOKEN }} fetch-depth: 0 + persist-credentials: false - name: Fetch upstream run: | @@ -58,7 +68,7 @@ jobs: - name: Check for new releases id: check_releases - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const upstreamOwner = process.env.UPSTREAM_OWNER; @@ -96,7 +106,7 @@ jobs: - name: Create sync issue (commits) if: steps.check_commits.outputs.commits_behind != '0' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const commitCount = '${{ steps.check_commits.outputs.commits_behind }}'; @@ -140,7 +150,7 @@ jobs: - name: Create sync issue (release) if: steps.check_releases.outputs.new_release == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const releaseTag = '${{ steps.check_releases.outputs.release_tag }}'; diff --git a/.github/workflows/upstream-sync-pai.yml b/.github/workflows/upstream-sync-pai.yml index 83a7bd2f..0c491743 100644 --- a/.github/workflows/upstream-sync-pai.yml +++ b/.github/workflows/upstream-sync-pai.yml @@ -29,22 +29,31 @@ env: # WICHTIG: Das ist dein FORK auf GitHub (nicht der lokale Pfad!) FORK_REPO: Steffen025/Personal_AI_Infrastructure +permissions: + contents: read + jobs: check-upstream: name: Check PAI Upstream & Create Info Issue runs-on: ubuntu-latest permissions: issues: write - + contents: read + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 - name: Fetch upstream commit history id: upstream_check - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const upstreamOwner = process.env.UPSTREAM_OWNER; @@ -126,7 +135,7 @@ jobs: - name: Check for new releases id: release_check - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const upstreamOwner = process.env.UPSTREAM_OWNER; @@ -170,7 +179,7 @@ jobs: - name: Create info issue (commits) if: steps.upstream_check.outputs.has_updates == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const commitCount = '${{ steps.upstream_check.outputs.commit_count }}'; @@ -310,7 +319,7 @@ jobs: - name: Create release issue if: steps.release_check.outputs.new_release == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const releaseTag = '${{ steps.release_check.outputs.release_tag }}'; diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..6b855722 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: +- repo: https://github.com/gitleaks/gitleaks + rev: v8.16.3 + hooks: + - id: gitleaks +- repo: https://github.com/jumanjihouse/pre-commit-hooks + rev: 3.0.0 + hooks: + - id: shellcheck +- repo: https://github.com/pre-commit/mirrors-eslint + rev: v8.38.0 + hooks: + - id: eslint +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-yaml + - id: check-json + - id: check-merge-conflict +- repo: https://github.com/pylint-dev/pylint + rev: v2.17.2 + hooks: + - id: pylint diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..d4f6f299 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.0.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 119d5ee5..57180991 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- -## [3.0.0] - Unreleased +## [3.0.0] - 2026-04-12 ### ⚠️ Breaking Changes diff --git a/package.json b/package.json index 19b2bdf6..900a3e47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pai-opencode", - "version": "2.0.0", + "version": "3.0.0", "description": "Personal AI Infrastructure for OpenCode (based on PAI v3.0, Algorithm v1.8.0)", "type": "module", "scripts": { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..9961c874 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "node", + "packages": { + ".": { + "changelog-path": "CHANGELOG.md", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "draft": false, + "prerelease": false + } + } +}