Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/openwiki-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: OpenWiki Update

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
# Full history so `openwiki code --update` can diff HEAD against the
# commit it last documented; a shallow clone hides that commit and the
# update runs against an empty change summary.
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"

- name: Install OpenWiki
# mermaid + jsdom are optional; they add high-fidelity validation of Mermaid diagrams. Remove if your wiki has none.
run: npm install --global openwiki@0.7.2 mermaid@11.16.0 jsdom@29.1.1

- name: Run OpenWiki
id: openwiki
continue-on-error: true
run: openwiki code --update --print
env:
OPENWIKI_PROVIDER: openai-compatible
OPENAI_COMPATIBLE_API_KEY: ${{ secrets.OPENAI_COMPATIBLE_API_KEY }}
OPENAI_COMPATIBLE_BASE_URL: ${{ vars.OPENAI_COMPATIBLE_BASE_URL }}
OPENWIKI_MODEL_ID: "gpt-6.1-sol"
OPENWIKI_OPENAI_COMPATIBLE_USE_RESPONSES_API: "true"
# Required for the LangSmith connector's code-mode pull to authenticate.
# For extra workspaces, add OPENWIKI_LANGSMITH_API_KEY_2, _3, ... as repo
# secrets and env entries here.
OPENWIKI_LANGSMITH_API_KEY: ${{ secrets.OPENWIKI_LANGSMITH_API_KEY }}
# Optional: also trace this workflow's own OpenWiki run to LangSmith.
LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY }}
LANGCHAIN_PROJECT: openwiki
LANGCHAIN_TRACING_V2: "true"

- name: Remove transient OpenWiki run state
if: ${{ !cancelled() }}
run: rm -f -- openwiki/.run.json

- name: List OpenWiki update paths
id: paths
if: ${{ !cancelled() }}
# CLAUDE.md is listed only when present: git add fails on a missing path
# and then stages nothing.
run: |
paths=openwiki,AGENTS.md,.github/workflows/openwiki-update.yml
if [ -e CLAUDE.md ]; then paths="$paths,CLAUDE.md"; fi
echo "list=$paths" >> "$GITHUB_OUTPUT"

- name: Create OpenWiki update pull request
id: create-pr
if: ${{ !cancelled() }}
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
with:
add-paths: ${{ steps.paths.outputs.list }}
branch: openwiki/update
commit-message: "docs: update OpenWiki"
title: "docs: update OpenWiki"
body: |
Automated OpenWiki documentation update.

OpenWiki result: ${{ steps.openwiki.outcome }}

When the result is `failure`, this PR intentionally preserves only the
pages completed before the failure. Merge it to make that progress the
baseline for the next manual run.

- name: Annotate OpenWiki update pull request
if: ${{ !cancelled() && steps.create-pr.outputs.pull-request-url != '' }}
run: echo "::notice title=OpenWiki update pull request::${{ steps.create-pr.outputs.pull-request-url }}"

- name: Propagate OpenWiki failure
if: ${{ steps.openwiki.outcome == 'failure' }}
run: exit 1
60 changes: 60 additions & 0 deletions .openwikiignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# OpenWiki read boundary. Preserve authored RST/RSTX, includes, Swagger YAML,
# configuration examples, build tooling, templates, and meaningful diagrams.
# Do not ignore openwiki/: generated pages and claim metadata must stay writable.

# VCS, editor state, installed dependencies, and local environments.
.git/
.idea/
.DS_Store
__pycache__/
*.pyc
*.pyo
*.egg-info/
.venv/
venv/
env/
.python_env*/
.my_env/
node_modules/
.pytest_cache/
.mypy_cache/
.ruff_cache/
.tox/
.cache/

# Rendered site/exports and generated runtime output, not authored source.
/_build/
/build/
/dist/
/htmlcov/
/coverage/
/logs/
*.log
*.log.*
.coverage
.coverage.*
coverage.xml
*.zip
*.tar.gz
*.pptx
*.docx

# Local secrets; template configuration is useful evidence.
.env
.env.*
!.env.example
!.env.sample
!.env.template
!.env.dist
/.secrets/
/.aws/
/.azure/
/.ssh/
.netrc
.pypirc
*.key
*.pem
*.p12
*.pfx
id_rsa
id_ed25519
16 changes: 16 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- OPENWIKI:START -->

## OpenWiki

This repository has a generated `openwiki/` evidence index. It is optional just-in-time context, not required startup reading.

- Do not enumerate, preload, or search wikis at task start. Use retrieval when the user asks for it, when unfamiliar architecture or dependency behavior materially affects the task, or when source inspection leaves an important uncertainty. Stop once the question is grounded.
- When those conditions apply and OpenWiki retrieval tools are available, use `openwiki_search` for just-in-time context and `openwiki_read` for the relevant complete sections. If search returns `workspace_required`, ask which listed workspace to use and retry with its ID.
- Use `openwiki_list_workspaces` or `openwiki_list_wikis` when workspace membership itself needs to be discovered.
- If the retrieval tools are unavailable, read `openwiki/quickstart.md` and follow its links to the relevant pages.
- Treat source code and tests as authoritative. A brief's unknowns and review items are verification gaps, not automatic requirements.
- Prefer the narrowest quiet validation that proves the changed behavior. Preserve complete failure output.

The manually triggered OpenWiki GitHub Actions workflow refreshes the repository wiki. Do not hand-edit generated OpenWiki pages unless explicitly asked; prefer updating source code/docs and letting OpenWiki regenerate.

<!-- OPENWIKI:END -->
Loading
Loading