Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion .opencode/policy/organization-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"model_profile_allowlist": [
"review-readonly",
"issue-feedback-readonly",
"implementation-planner"
"implementation-planner",
"release-project-review-readonly"
],
"organization_ceilings": {
"max_tokens": 16000,
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Thanks for contributing to `generic-agentic-workflows`.

Reusable profiles live under `.opencode/configuration/<profile>/`. A bundle normally contains:

- `manifest.json` — declares the workflow, agent, skills, prompt, and model profile.
- `bundle.json` — declares the workflow, agent, skills, prompt, and model profile.
- `agent.md` and optional additional agent files — OpenCode agent front matter and instructions.
- `skills/` and `prompts/` — the bundle's verified guidance.
- `hashes.json` — SHA-256 integrity hashes for every declared content file.
Expand Down Expand Up @@ -85,7 +85,7 @@ For example, after editing `documentation-review/agent.md`, update:
}
```

Do not hash `manifest.json` into `hashes.json` unless the resolver is explicitly changed to require it. Do not alter an unrelated bundle's hashes merely to make a test pass—investigate the mismatch and update only when the checked-in content intentionally changed.
Do not hash `bundle.json` into `hashes.json` unless the resolver is explicitly changed to require it. Do not alter an unrelated bundle's hashes merely to make a test pass—investigate the mismatch and update only when the checked-in content intentionally changed.

## Validate bundle changes

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,22 @@ access outside its repository.

## Further documentation

- [Deploy a workflow](docs/deploying-a-workflow.md) — step-by-step consumer
setup for supplied, local, and central configuration sources.
- [Create a configuration bundle](docs/creating-a-configuration-bundle.md) —
author, hash, validate, and publish a reviewed profile.
- [`bundle.json` reference](docs/bundle-json-reference.md) — manifest fields,
valid workflow mappings, and safety constraints.
- [Run commands from a configuration bundle](docs/running_commands.md) —
configure and roll out approved release-review preflight commands.
- [Security model](docs/security-model.md) — trust boundaries, defensive
controls, and their rationale.
- [Configuration guide](docs/configuration.md) — setup, all pathways, bundle
layout, and operational safeguards.
- [Configuration reference](docs/configuration-reference.md) — every caller
input and bundle field, with examples.
- [Consumer examples](docs/examples/README.md) — ready-to-copy wrappers,
including complete `default`, `local`, and `central` source examples.
- [Central configuration example](docs/examples/central-configuration/README.md)
— remote bundle layout and release process.
- [Operations guide](docs/operations/operations-guide.md) — rollback,
reliability controls, and test matrix.

Expand Down
152 changes: 152 additions & 0 deletions docs/bundle-json-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# `bundle.json` reference

`bundle.json` is the manifest for a configuration bundle. It identifies the
reviewed content files and selects only workflow-owned model and output
options. The resolver supports schema version `1` and rejects unknown or
invalid combinations before model invocation.

For the authoring sequence, see [creating a configuration bundle](creating-a-configuration-bundle.md).

## Complete example

```json
{
"schema_version": 1,
"profile_name": "team-docs-review",
"allowed_workflows": ["pr-documentation-review"],
"agent_file": "agent.md",
"additional_agent_files": [],
"skill_files": ["skills/documentation/SKILL.md"],
"prompt_template": "prompts/review.md",
"model_profile": "review-readonly",
"output_contract": "pr-review-json-v1",
"context_policy": "pr-review-on-demand-v1",
"limits": {"max_comments": 5},
"policy": {
"capabilities": {
"filesystem": "read-trusted-checkout-diff",
"github_write": "review-comment-only",
"delegation": "deny"
}
}
}
```

## Fields

| Field | Required | Type | Valid values and rules |
| --- | --- | --- | --- |
| `schema_version` | Yes | integer | Must be `1`. |
| `profile_name` | Yes | string | Must match `[a-z0-9][a-z0-9-]{0,62}` and exactly match the bundle directory name and selected `configuration_profile`. |
| `allowed_workflows` | Yes | non-empty array of strings | Every value must be one of `pr-documentation-review`, `issue-feedback`, `issue-implementation`, or `release-project-review`. The current workflow must be present. |
| `agent_file` | Yes | safe relative path | Primary agent Markdown file, for example `agent.md`. It requires front matter with a safe unique `name`. |
| `additional_agent_files` | No | array of unique safe relative paths | Additional agent files, normally for implementation. They cannot repeat `agent_file`; each requires a unique front-matter `name`. |
| `skill_files` | Yes | array of unique safe relative paths | Skill Markdown files. The array may be empty. Each file requires front matter with a unique `name`. |
| `prompt_template` | Yes | safe relative path | Prompt template Markdown file, for example `prompts/review.md`. |
| `model_profile` | Yes | string | Registered profile name matching the profile-name grammar. The available names are listed below; a caller cannot override this value. |
| `output_contract` | Yes | string | One of the supported workflow-owned contracts listed below. |
| `context_policy` | No | string | PR documentation review only. The supported value is `pr-review-on-demand-v1`. Omit it for all other workflows. |
| `limits` | No | JSON object | Optional profile limits. A PR-review profile may set `{"max_comments": 10}` or a lower ceiling. `{}` is valid. |
| `policy` | No | JSON object | Restrictive policy overlay. It can narrow capabilities or quotas but cannot broaden built-in workflow policy. |
| `preflight_commands` | No | array of strings | Release-project-review only; at most three commands. The workflow runs them, if allowed, from its fixed local allowlist in the immutable checkout. The model never executes them. |

## Content-path requirements

The following fields are content paths: `agent_file`, `additional_agent_files`,
`skill_files`, and `prompt_template`.

Each path must:

- be a non-empty relative POSIX path inside the profile directory;
- use forward slashes and no control characters;
- contain no absolute prefix, backslash, `.`, `..`, empty segment, or trailing
slash;
- identify a normal, non-symlink file; and
- appear exactly once as a key in `hashes.json`.

The resolver allows at most 64 declared files, 1 MiB per content file, and 8
MiB of total bundle content.

## Workflow mappings

These combinations are supported by the supplied profiles and policy registry.

| Workflow | Compatible `model_profile` | Required `output_contract` | Notes |
| --- | --- | --- | --- |
| `pr-documentation-review` | `review-readonly` | `pr-review-json-v1` | May use `context_policy: "pr-review-on-demand-v1"`; review agent cannot request edit permission. |
| `issue-feedback` | `issue-feedback-readonly` | `issue-feedback-markdown-v1` | Review agent cannot request edit permission. |
| `issue-implementation` | `implementation-planner` | `issue-implementation-decision-v1` | May declare a delegated executor in `additional_agent_files`. |
| `release-project-review` | `release-project-review-readonly` | `release-project-issue-v1` | May declare up to three `preflight_commands`; review agent cannot request edit permission. |

The manifest parser recognizes all listed contracts. Effective-policy resolution
enforces the workflow-specific contract and model-profile compatibility, so a
mismatched pair fails before the provider is called.

## `policy` overlay

`policy` is optional, but when present it is restrictive only. A common shape
is:

```json
{
"policy": {
"capabilities": {
"filesystem": "read-trusted-checkout-diff",
"github_write": "review-comment-only",
"delegation": "deny"
},
"max_tokens": 4000
}
}
```

Capability axes are `filesystem`, `shell`, `network`, `github_write`, and
`delegation`. The built-in workflow policy is the upper bound. A bundle may
set an axis to `deny` or repeat the applicable scoped grant, but it may not
substitute a broader or different non-deny grant. Numeric limits similarly
cannot exceed the built-in or model-profile ceilings.

## `preflight_commands`

A release review can request up to three reviewed preflight commands:

```json
{
"preflight_commands": [
"python3 -m unittest -q"
]
}
```

Commands are not general shell access. The runner validates them against a
fixed local-only allowlist, runs them in the immutable target checkout with a
minimal environment and bounded output, and treats results as untrusted
evidence. A failed preflight supports a finding only if the output explains a
concrete release-management consequence and owner/action.

See [Run commands from a configuration bundle](running_commands.md) for the
approved command, rollout procedure, execution behavior, and troubleshooting.

## Relationship to `hashes.json`

`hashes.json` must map every declared content path—and only those paths—to a
lowercase SHA-256 digest. It does not include `bundle.json` or `hashes.json`.
Use the project helper after any content change:

```text
uv run scripts/update_hashes.py --profile <profile-name>
```

Hash validation covers bytes, not semantic equivalence. Reformatting front
matter, changing whitespace, or modifying a prompt requires regenerating the
corresponding digest.

## Rejected values

The manifest cannot introduce credentials, provider URLs, headers, arbitrary
model identifiers, new output contracts, or arbitrary executable locations.
The resolver also rejects an unsupported schema version, duplicate files,
workflow mismatch, missing required front matter, invalid paths, unknown
model/profile names, stale hashes, and policy escalation attempts. These
failures are intentional and fail closed: the workflow does not fall back to a
different source or revision.
15 changes: 11 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ jobs:
The current `central` alias resolves approved bundles in
`SecondSkoll/generic-agentic-workflows-config` under `.opencode/configuration`.
Its `configuration_ref` pins that repository and is independent of the SHA
that pins the reusable workflow in `uses:`.
See the copy-ready [central example](examples/configuration-sources/central/)
and the [central configuration guide](examples/central-configuration/README.md)
for its repository layout and release process.
that pins the reusable workflow in `uses:`. See the copy-ready
[central example](examples/configuration-sources/central/) and the
[bundle authoring guide](creating-a-configuration-bundle.md) for its
repository layout and release process.

## Common rules

Expand Down Expand Up @@ -179,6 +179,13 @@ commit (read-only) and the workflow—not the model—owns the issue destination
the `release-readiness` label allowlist, the idempotency marker, and
publication.

A release bundle may declare up to three reviewed `preflight_commands`. The
runner—not the model—executes these from a fixed local-only allowlist in the
immutable checkout with a minimal environment, no shell, no installation, and
bounded output. Preflight results are untrusted evidence; a test failure may
support an issue only when the generated finding explains a concrete
release-management consequence and owner/action.

## Rollout and operations

After a successful validation run, replace `validate_only: true` with
Expand Down
Loading
Loading