Skip to content

Document safe-output data for persistent review state - #69437

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-comment-hidden-state
Oct 16, 2026
Merged

pelikhan merged 3 commits into
mainfrom
copilot/fix-comment-hidden-state

Conversation

Copilot AI commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Safe-output sanitization strips HTML markers, breaking incremental reviews that store baseline SHAs in them. Existing safe-outputs.data preserves structured state as visible JSON—not hidden metadata.

  • Documentation: Add a schema-backed baseline example and cross-run read-back guidance, including author/workflow filtering and SHA validation. Clarify that state restoration is not automatic.
  • Regression coverage: Verify baseline data survives comment publication with and without footers while HTML markers remain stripped.
safe-outputs:
  data:
    reviewed_sha: string
  add-comment:

The agent supplies data: {"reviewed_sha": "<sha>"} alongside body; later runs recover it from the posted comment’s fenced JSON.

Copilot AI changed the title [WIP] Fix safe-output comments to allow hidden machine-readable state Document safe-output data for persistent review state Oct 16, 2026
Copilot AI requested a review from pelikhan October 16, 2026 18:16
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

…idden-state

# Conflicts:
#	docs/src/content/docs/reference/safe-outputs.md

Co-authored-by: pelikhan <[email protected]>

Copilot AI commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Merged main and resolved the documentation conflict, preserving both updates. Merge commit: 14e2a8b437.

@pelikhan
pelikhan marked this pull request as ready for review October 16, 2026 19:48
Copilot AI max review requested due to automatic review settings October 16, 2026 19:48
@pelikhan
pelikhan merged commit 2903a64 into main Oct 16, 2026
6 checks passed
@pelikhan
pelikhan deleted the copilot/fix-comment-hidden-state branch October 16, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The recovery guidance references a workflow marker that published review comments do not contain.

1 open finding
What changed in this PR

Documents how gh-aw workflows can persist incremental-review baselines using existing safe-output structured data.

Changes:

  • Add a schema-backed baseline example and cross-run recovery guidance.
  • Add regression tests for JSON preservation and HTML-marker removal with footers enabled and disabled.
File Description
docs/​src/​content/​docs/​reference/​safe-outputs.md Explain structured state publication and recovery.
actions/​setup/​js/​add_comment.test.cjs Test baseline preservation under both footer settings.

🧠 Review effort: Max


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

}
```

On a later run, including an `issue_comment`-triggered run, read the PR's comment history and parse the fenced JSON following "Structured data:" in the latest matching review comment. Filter by the expected comment author and [workflow marker](#searching-for-workflow-created-items). Validate the recovered SHA against the target PR before using it as a baseline. The state persists in the posted comment; `data` does not automatically restore it or provide a separate cross-run store. Do not put secrets in `data`.
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.92.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Safe-output comments cannot carry hidden machine-readable state because every HTML comment is stripped

3 participants