Skip to content
Merged
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
97 changes: 56 additions & 41 deletions .github/workflows/opencode-release-project-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,49 +197,15 @@ jobs:
--github-step-summary "$GITHUB_STEP_SUMMARY" \
--result "$RUNNER_TEMP/resolved-invocation.json"

- name: Stop after validation-only
if: steps.resolve.outputs.validate_only == 'true'
env:
AGENTIC_WORKFLOW_VERSION: ${{ job.workflow_sha }}
run: |
echo "validate_only selected; no release fetch, checkout, model invocation, or publication performed."
python3 - <<'PY'
import json, os, sys
from pathlib import Path
import importlib.util
spec = importlib.util.spec_from_file_location("agentic_provenance", Path(os.environ["AGENTIC_WORKFLOW_ROOT"]) / "scripts/agentic_provenance.py")
prov = importlib.util.module_from_spec(spec); sys.modules[spec.name] = prov; spec.loader.exec_module(prov)
record = prov.build_provenance(
workflow_version=os.environ.get("AGENTIC_WORKFLOW_VERSION", "dev"),
workflow_name="release-project-review",
caller_repository=os.environ.get("GITHUB_REPOSITORY", ""),
target_kind="release",
target_number=None,
target_head_sha=None,
bundle=None,
prompt_template_sha256=None,
output_contract=None,
model_profile=None,
effective_policy_sha256=None,
mode="validate-only",
result="validated",
)
Path(os.environ["RUNNER_TEMP"] + "/resolved-agentic-provenance.json").write_text(record.to_json() + "\n")
summary = Path(os.environ["GITHUB_STEP_SUMMARY"])
existing = summary.read_text() if summary.exists() else ""
if existing and not existing.endswith("\n"):
existing += "\n"
summary.write_text(existing + prov.job_summary(record), encoding="utf-8")
PY
echo "::notice::Resolved configuration written to job summary and artifact."

# Configuration and policy are resolved before the validation-only stop
# so an invalid command configuration (unknown midflight ID, disallowed
# phase, count/overlap violation) is caught without a release fetch,
# checkout, command execution, or model invocation.
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
if: steps.resolve.outputs.validate_only != 'true'
with:
python-version: '3.12'

- name: Resolve agentic configuration
if: steps.resolve.outputs.validate_only != 'true'
id: config
env:
AGENTIC_WORKFLOW: release-project-review
Expand All @@ -248,6 +214,7 @@ jobs:
AGENTIC_CONFIGURATION_PROFILE: ${{ steps.resolve.outputs.configuration_profile }}
GITHUB_TOKEN: ${{ secrets.central_config_token || github.token }}
AGENTIC_WORKFLOW_VERSION: ${{ job.workflow_sha }}
AGENTIC_DRY_RUN: ${{ steps.resolve.outputs.dry_run }}
run: |
set -euo pipefail
if ! python3 "$AGENTIC_WORKFLOW_ROOT/scripts/agentic_configuration.py" \
Expand All @@ -262,11 +229,12 @@ jobs:
import importlib.util
spec = importlib.util.spec_from_file_location("agentic_provenance", Path(os.environ["AGENTIC_WORKFLOW_ROOT"]) / "scripts/agentic_provenance.py")
prov = importlib.util.module_from_spec(spec); sys.modules[spec.name] = prov; spec.loader.exec_module(prov)
mode = "dry-run" if os.environ.get("AGENTIC_DRY_RUN") == "true" else "publish"
record = prov.failure_record(
workflow_version=os.environ.get("AGENTIC_WORKFLOW_VERSION", "dev"),
workflow_name="release-project-review",
caller_repository=os.environ.get("GITHUB_REPOSITORY", ""),
mode="publish",
mode=mode,
error=RuntimeError("configuration resolution failed"),
)
Path(os.environ["RUNNER_TEMP"] + "/resolved-agentic-provenance.json").write_text(record.to_json() + "\n")
Expand All @@ -275,7 +243,6 @@ jobs:
fi

- name: Resolve effective policy
if: steps.resolve.outputs.validate_only != 'true'
id: policy
env:
DRY_RUN: ${{ steps.resolve.outputs.dry_run }}
Expand Down Expand Up @@ -316,11 +283,12 @@ jobs:
spec = importlib.util.spec_from_file_location("agentic_provenance", Path(os.environ["AGENTIC_WORKFLOW_ROOT"]) / "scripts/agentic_provenance.py")
prov = importlib.util.module_from_spec(spec); sys.modules[spec.name] = prov; spec.loader.exec_module(prov)
bundle = json.loads(Path(os.environ["RUNNER_TEMP"] + "/resolved-agentic-configuration.json").read_text())
mode = "dry-run" if os.environ.get("DRY_RUN") == "true" else "publish"
record = prov.failure_record(
workflow_version=os.environ.get("AGENTIC_WORKFLOW_VERSION", "dev"),
workflow_name="release-project-review",
caller_repository=os.environ.get("GITHUB_REPOSITORY", ""),
mode="publish",
mode=mode,
error=RuntimeError("policy resolution failed"),
bundle=bundle,
)
Expand All @@ -329,6 +297,44 @@ jobs:
exit 1
}

- name: Stop after validation-only
if: steps.resolve.outputs.validate_only == 'true'
env:
AGENTIC_WORKFLOW_VERSION: ${{ job.workflow_sha }}
run: |
echo "validate_only selected; configuration and policy resolved. No release fetch, checkout, command execution, model invocation, or publication performed."
python3 - <<'PY'
import json, os, sys
from pathlib import Path
import importlib.util
spec = importlib.util.spec_from_file_location("agentic_provenance", Path(os.environ["AGENTIC_WORKFLOW_ROOT"]) / "scripts/agentic_provenance.py")
prov = importlib.util.module_from_spec(spec); sys.modules[spec.name] = prov; spec.loader.exec_module(prov)
bundle = json.loads(Path(os.environ["RUNNER_TEMP"] + "/resolved-agentic-configuration.json").read_text())
policy = json.loads(Path(os.environ["RUNNER_TEMP"] + "/effective-policy.json").read_text())
record = prov.build_provenance(
workflow_version=os.environ.get("AGENTIC_WORKFLOW_VERSION", "dev"),
workflow_name="release-project-review",
caller_repository=os.environ.get("GITHUB_REPOSITORY", ""),
target_kind="release",
target_number=None,
target_head_sha=None,
bundle=bundle,
prompt_template_sha256=bundle.get("prompt_template_sha256"),
output_contract=bundle.get("output_contract"),
model_profile=bundle.get("model_profile"),
effective_policy_sha256=policy.get("sha256"),
mode="validate-only",
result="validated",
)
Path(os.environ["RUNNER_TEMP"] + "/resolved-agentic-provenance.json").write_text(record.to_json() + "\n")
summary = Path(os.environ["GITHUB_STEP_SUMMARY"])
existing = summary.read_text() if summary.exists() else ""
if existing and not existing.endswith("\n"):
existing += "\n"
summary.write_text(existing + prov.job_summary(record), encoding="utf-8")
PY
echo "::notice::Resolved configuration and policy written to job summary and artifact."

- name: Set up Node.js 24
if: steps.resolve.outputs.validate_only != 'true'
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
Expand Down Expand Up @@ -399,6 +405,15 @@ jobs:
- name: Review release and publish release-readiness issue
if: steps.resolve.outputs.validate_only != 'true'
id: review
# The runner, not the workflow YAML, constructs the command execution
# environment from a fixed credential-free allowlist. No workflow secret
# (OPENROUTER_API_KEY, release_target_token, GITHUB_TOKEN) is forwarded
# into the midflight command environment: the registry executor drops
# provider/GitHub/OIDC/SSH/proxy variables and uses a disposable HOME.
# Network isolation posture: only network-disabled registry commands
# are approved for midflight, and the executor refuses to run any
# command requesting network; enforceable OS-level denial (netns /
# locked-down container) is the hosted runner's responsibility.
env:
GITHUB_TOKEN: ${{ github.token }}
RELEASE_TARGET_TOKEN_FORWARDED: ${{ secrets.release_target_token != '' }}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/verify-reusable-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ name: Verify reusable workflows

# Runs the full test suite, including static reusable-workflow wiring,
# validate-only resolver invocations, configuration-bundle materialization,
# hash freshness, and policy/prompt/provenance validation. The only separate
# test invocation is the authenticated central configuration pin ancestry check.
# hash freshness, and policy/prompt/provenance validation. It also validates the
# documentation build and links. The only separate test invocation is the
# authenticated central configuration pin ancestry check.
on:
pull_request:
paths:
- '.github/workflows/**'
- 'scripts/**'
- 'tests/**'
- 'docs/examples/**'
- 'docs/**'
- '.opencode/**'
- 'README.md'
- 'pyproject.toml'
- 'uv.lock'
- '.readthedocs.yaml'
workflow_dispatch:

permissions:
Expand All @@ -23,6 +28,7 @@ jobs:
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
persist-credentials: false

- name: Install UV
Expand Down Expand Up @@ -59,5 +65,5 @@ jobs:

- name: Run unit tests (includes real OpenCode smoke when binary present)
run: uv run python -m unittest discover -s tests -v
# End of workflow.

# End of workflow.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ __pycache__/

# UV / Python tooling
.ruff_cache/

# Sphinx build output
docs/_build/
docs/_build-linkcheck/
docs/_build-baseline/
15 changes: 11 additions & 4 deletions .opencode/configuration/release-project-review/bundle.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
"schema_version": 1,
"schema_version": 2,
"profile_name": "release-project-review",
"allowed_workflows": ["release-project-review"],
"allowed_workflows": [
"release-project-review"
],
"agent_file": "agent.md",
"skill_files": ["skills/release-management/SKILL.md"],
"skill_files": [
"skills/release-management/SKILL.md"
],
"prompt_template": "prompts/release-project-review.md",
"model_profile": "release-project-review-readonly",
"output_contract": "release-project-issue-v1",
"preflight_commands": ["make -C docs html"],
"preflight_commands": [
"documentation-build"
],
"midflight_commands": [],
"limits": {},
"policy": {
"capabilities": {
Expand Down
32 changes: 32 additions & 0 deletions .opencode/policy/output-contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,38 @@
],
"forbidden_findings": ["code-only findings", "empty evidence"],
"publication": "at most one release-readiness issue in the canonical target repository; workflow owns destination, marker, labels, and publication"
},
"release-project-analysis-handoff-v1": {
"kind": "json",
"required_top_level_fields": ["assessment", "validation_questions", "relevant_evidence"],
"optional_top_level_fields": [],
"max_assessment_bytes": 8192,
"max_validation_questions": 20,
"max_question_bytes": 1024,
"max_relevant_evidence_items": 20,
"max_evidence_bytes": 1024,
"forbidden_fields": [
"command",
"commands",
"args",
"argv",
"shell",
"environment",
"env",
"working_directory",
"cwd",
"url",
"repository",
"repo",
"endpoint",
"credentials",
"token",
"decision",
"title",
"body",
"labels"
],
"publication": "non-publication intermediate contract; phase 1 of the two-stage release-project-review. The handoff is validated by the workflow, inserted into the phase-2 prompt as delimited untrusted data, and never published or appended to system instructions. The model cannot select a command, endpoint, repository, or credentials."
}
}
}
30 changes: 30 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# .readthedocs.yaml
# Read the Docs configuration file.
# See https://docs.readthedocs.com/platform/stable/config-file/v2.html for details.

# Required
version: 2

# Set the OS and Python version.
build:
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_checkout:
- git fetch --unshallow || true

# Build documentation in the docs/ directory with Sphinx.
sphinx:
builder: dirhtml
configuration: docs/conf.py
fail_on_warning: true

# Install project dependencies (including the `docs` extra) using uv via the
# official Read the Docs uv install method.
python:
install:
- method: uv
command: sync
extras:
- docs
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ Finally, confirm that obsolete model identifiers are absent from active configur
git diff --check
```

## Documentation accessibility checks

Review representative pages in the built preview at `docs/_build` or on the
published site. Check that:

- each page has one top-level heading and does not skip heading levels;
- theme-provided banner, navigation, and main-content landmarks are present and
navigable;
- the sidebar, search, and disclosure controls work with keyboard input alone;
- tables have header rows and a simple structure; and
- each code block identifies its language and is introduced by surrounding
text.

Automated checks of the rendered output may be evaluated later; do not migrate
accessibility frameworks as part of this manual review.

## Security requirements

- Treat issue text, pull-request text, diffs, and external configuration as untrusted data.
Expand Down
Loading
Loading