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
2 changes: 2 additions & 0 deletions .github/workflows/opencode-documentation-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ jobs:
--effective-policy "$RUNNER_TEMP/effective-policy.json"
--provenance "$RUNNER_TEMP/resolved-agentic-provenance.json"
--response-diagnostics "$RUNNER_TEMP/opencode-response-diagnostics.json"
--publication-preview "$RUNNER_TEMP/agentic-publication-preview.json"
)
if [[ "$FAIL_IF_REVIEWED" == "true" ]]; then
review_args+=(--fail-if-reviewed)
Expand Down Expand Up @@ -400,5 +401,6 @@ jobs:
${{ runner.temp }}/effective-policy.json
${{ runner.temp }}/resolved-agentic-provenance.json
${{ runner.temp }}/opencode-response-diagnostics.json
${{ runner.temp }}/agentic-publication-preview.json
retention-days: 14
if-no-files-found: ignore
2 changes: 2 additions & 0 deletions .github/workflows/opencode-issue-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ jobs:
--resolved-config "$RUNNER_TEMP/resolved-agentic-configuration.json"
--effective-policy "$RUNNER_TEMP/effective-policy.json"
--provenance "$RUNNER_TEMP/resolved-agentic-provenance-$issue_number.json"
--publication-preview "$RUNNER_TEMP/agentic-publication-preview-$issue_number.json"
)
if [[ "$DRY_RUN" == "true" ]]; then
feedback_args+=(--dry-run)
Expand All @@ -330,5 +331,6 @@ jobs:
${{ runner.temp }}/effective-policy.json
${{ runner.temp }}/resolved-agentic-provenance.json
${{ runner.temp }}/resolved-agentic-provenance-*.json
${{ runner.temp }}/agentic-publication-preview-*.json
retention-days: 14
if-no-files-found: ignore
2 changes: 2 additions & 0 deletions .github/workflows/opencode-release-project-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ jobs:
--target-token-forwarded "$RELEASE_TARGET_TOKEN_FORWARDED"
--repo-root "$GITHUB_WORKSPACE/release-target"
--provenance "$RUNNER_TEMP/resolved-agentic-provenance.json"
--publication-preview "$RUNNER_TEMP/agentic-publication-preview.json"
)
if [[ "$DRY_RUN" == "true" ]]; then
args+=(--dry-run)
Expand All @@ -448,5 +449,6 @@ jobs:
${{ runner.temp }}/effective-policy.json
${{ runner.temp }}/release-metadata.json
${{ runner.temp }}/resolved-agentic-provenance.json
${{ runner.temp }}/agentic-publication-preview.json
retention-days: 14
if-no-files-found: ignore
6 changes: 6 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ For field-by-field definitions and complete bundle-file examples, see the

`validate_only` does not invoke a model or write to GitHub. `dry_run` can
invoke the model but cannot publish. The two modes are mutually exclusive.
For a dry run that generates feedback, download the workflow's
short-retention `resolved-invocation-*` artifact. Its
`agentic-publication-preview*.json` file contains the validated payload that
would have been posted: the review body and inline comments, an issue comment,
or a release-readiness issue. No preview file is written for `validate_only`,
model/contract failures, or a release review that decides `NO_ISSUE`.

## Pathway 1: supplied `default` profile

Expand Down
6 changes: 6 additions & 0 deletions docs/operations/operations-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ failures that occur before a complete record exists, the runner emits a minimal
redacted attempted-resolution record with `result: "failed"` and a non-secret
error message.

For a feedback-generating `dry_run`, the same short-retention artifact also
includes `agentic-publication-preview*.json`. This is the validated payload
that publication would use (the comment/review/issue body, plus any inline
review comments). Treat it as workflow output with the same access controls as
the target content; it intentionally is not included in redacted provenance.

The configuration digest backs the v2 idempotency marker. A configuration
change (different profile, manifest hash, prompt template hash, output
contract, or model profile) produces a different digest, which triggers a
Expand Down
33 changes: 33 additions & 0 deletions scripts/run_agentic_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,12 @@ def main(argv: list[str] | None = None) -> int:
default=None,
help="Path to write safe structural diagnostics for the model response",
)
parser.add_argument(
"--publication-preview",
type=Path,
default=None,
help="Path to write the validated GitHub publication payload during a dry run",
)
parser.add_argument("--pr-metadata", type=Path, help="Verified PR metadata JSON")
parser.add_argument("--base-ref", help="Trusted base SHA/ref used for context blobs")
parser.add_argument("--head-ref", help="Fetched untrusted PR-head ref used for context blobs")
Expand Down Expand Up @@ -853,6 +859,20 @@ def main(argv: list[str] | None = None) -> int:
file=sys.stderr,
)
if args.dry_run:
if args.publication_preview:
args.publication_preview.write_text(
json.dumps(
{
"kind": "pull-request-review",
"body": f"{marker}\n{summary}",
"comments": comments,
},
sort_keys=True,
indent=2,
)
+ "\n",
encoding="utf-8",
)
print(
f"Dry run: would post agentic review with {len(comments)} inline comment(s).\n"
f"{marker}\n{summary}",
Expand Down Expand Up @@ -908,6 +928,19 @@ def main(argv: list[str] | None = None) -> int:
)
return 1
if args.dry_run:
if args.publication_preview:
args.publication_preview.write_text(
json.dumps(
{
"kind": "issue-comment",
"body": f"{marker}\n{published_body}",
},
sort_keys=True,
indent=2,
)
+ "\n",
encoding="utf-8",
)
print(
f"Dry run: would post agentic feedback.\n{marker}\n{published_body}",
)
Expand Down
21 changes: 21 additions & 0 deletions scripts/run_agentic_release_project_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,21 @@ def _cmd_review(args: argparse.Namespace) -> int:

# CREATE_ISSUE: search for the idempotency marker before creating.
if args.dry_run:
if args.publication_preview:
args.publication_preview.write_text(
json.dumps(
{
"kind": "issue",
"title": decision["title"],
"body": f"{marker}\n{decision['body']}",
"labels": decision["labels"],
},
sort_keys=True,
indent=2,
)
+ "\n",
encoding="utf-8",
)
print(
f"Dry run: would create one release-readiness issue in {target_repository}.\n"
f"{marker}\ntitle: {decision['title']}"
Expand Down Expand Up @@ -1329,6 +1344,12 @@ def _build_parser() -> argparse.ArgumentParser:
)
review.add_argument("--focus", default=None)
review.add_argument("--dry-run", action="store_true")
review.add_argument(
"--publication-preview",
type=Path,
default=None,
help="Path to write the validated issue payload during a dry run.",
)
review.add_argument("--provenance", type=Path, default=None)
return parser

Expand Down
15 changes: 14 additions & 1 deletion tests/test_run_agentic_release_project_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ def test_create_issue_publishes_exactly_one_issue(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
tmp_path = Path(tmp)
bundle, policy, metadata = self._write_inputs(tmp_path)
preview_path = tmp_path / "preview.json"
create_output = json.dumps(
{
"decision": "CREATE_ISSUE",
Expand Down Expand Up @@ -910,6 +911,7 @@ def test_dry_run_does_not_publish(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
tmp_path = Path(tmp)
bundle, policy, metadata = self._write_inputs(tmp_path)
preview_path = tmp_path / "preview.json"
create_output = json.dumps(
{
"decision": "CREATE_ISSUE",
Expand All @@ -924,14 +926,25 @@ def test_dry_run_does_not_publish(self) -> None:
mock.patch.object(RUNNER, "_search_existing_marker") as m_search,
mock.patch.object(RUNNER, "_create_issue") as m_create,
):
rc = RUNNER.main(self._args(tmp_path, bundle, policy, metadata, dry_run=True))
args = self._args(tmp_path, bundle, policy, metadata, dry_run=True)
args.extend(["--publication-preview", str(preview_path)])
rc = RUNNER.main(args)
self.assertEqual(rc, 0)
m_access.assert_not_called()
m_search.assert_not_called()
m_create.assert_not_called()
prov = json.loads((tmp_path / "prov.json").read_text())
self.assertEqual(prov["mode"], "dry-run")
self.assertEqual(prov["result"], "generated")
self.assertEqual(
json.loads(preview_path.read_text()),
{
"body": mock.ANY,
"kind": "issue",
"labels": ["release-readiness"],
"title": "Missing rollback",
},
)

def test_contract_violation_rejected(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
Expand Down
Loading