You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add owner-approved discussion drafting and an owner cheat sheet - #493
Add an owner-only /typechat draft workflow for Issues and Discussions that prepares a read-only draft, validates it after threat detection, and publishes an exact preview and immutable review artifact in the Actions summary.
Add a separate /typechat publish <artifact-id>:<body-sha256> workflow that posts only the owner's explicitly approved text through github-actions[bot]. Discussion posts are top-level comments.
Share the proven read-only model/tool/native-metric controls with the existing backlog assessment without changing its runtime settings beyond the empty shared prompt import.
Add the standalone owner cheat sheet, update the automation guide and rollout history, and expand PR CI to cover both workflows and the protocol helper.
Approval and safety boundaries
Drafting does not post, accept work, close threads, label items, or start implementation. Publishing approves only the exact comment, not implementation or merging.
The protocol checks the human owner, default-branch code, repository and artifact/run provenance, current policy/control fingerprints, thread snapshots, referenced PR revisions, and the approved body hash. Target-specific publishing jobs have only their required comment-write scope. Durable publication intents and existing-comment checks prevent blind retries after an uncertain write; stale drafts fail closed. No personal token or new bot secret is introduced.
The main drafting budget is 50 AI credits; the backlog's main budget remains 400. Threat detection retains its separate 400-credit default, so neither is a combined workflow cap. The future 1,000-credit implementation allowance and budget overrides remain documentation only.
Verification
110 automation tests passed using Node 24.22.1, including actual workflow-script execution with mocked GitHub for both Issues and Discussions, approval withdrawal, stale context, exact size/page limits, provenance, and uncertain-write recovery.
Both workflows strictly compile with gh-aw v0.93.5, pinned runtime 32ecafbc061c9af57e9361942099e381102ae304; repeat compilation produces no generated-file drift.
Parsed backlog settings match current main, except the verified empty shared import.
Owner-guide and automation-document local links/anchors, staged whitespace, and preservation of the newer upstream README navigation checked.
Read-only GitHub API checks verified public thread queries, stable Actions-bot identity, and artifact/run/history response shapes.
Rollout and review
This branch is based on the latest main (a322637), with one new commit. No live drafting run or bot publication has been performed. Existing branch-review protections are unchanged, and the project-direction policy is not modified.
PR CI can validate this without merging. Full pre-merge end-to-end testing would use an isolated staging repository with explicitly pinned staging identity and available Copilot access; production comment triggers require these workflows on the default branch. Human review and explicit owner approval remain required. After deployment, record live verification before marking the pilot active.
Separate read-only drafting from exact-text owner-approved publication, preserve the backlog controls, and add an owner cheat sheet with regression coverage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The timestamp comparison can reject valid drafts and block publication when sealing and artifact creation occur within the same second because their timestamp precision differs.
Adds owner-approved drafting and exact-text publication for Issues and Discussions, extending TypeChat’s automation beyond read-only backlog assessments without enabling work acceptance or implementation.
Changes:
Adds separate draft and publish workflows with approval, provenance, freshness, and duplicate-publication checks.
Shares read-only agent controls and expands workflow and protocol regression tests.
Adds an owner cheat sheet and updates rollout guidance; live verification remains pending.
File
Description
tools/tests/discussion-workflows.test.mjs
Checks workflow permissions, budgets, gates, and CI coverage.
tools/tests/discussion-draft.test.mjs
Tests approval, validation, publication, and recovery behavior.
tools/tests/backlog-assessment.test.mjs
Adapts contract tests to shared controls.
tools/discussion-draft.mjs
Implements draft sealing and approved-publication validation.
README.md
Updates automation status and pilot milestones.
OWNER-CHEATSHEET.md
Adds owner commands and recovery guidance.
AUTOMATION.md
Documents the pilot, safeguards, budgets, and rollout.
.github/workflows/shared/read-only-analysis.md
Extracts shared model, tool, and diagnostic controls.
Cover HTML comment delimiters across every plain-text draft field and preserve escaped generic type and comparison text.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accept sealing and artifact creation within the same recorded second without changing sealed bytes, lower-bound ordering, or expiry checks. Add successful publication and invalid-ordering regressions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Timestamp precision mismatches can permanently block valid drafts, while per-run artifact scans risk API-quota exhaustion and publication timeouts.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Avoid per-run artifact scans when checking publication history
tools/discussion-draft.mjs:708
At the supported 1,000-run history limit, this loop makes roughly 1,000 artifact-list requests, and a single publication scans that history in both checkPublication and publishDraft. This consumes API quota and risks exhausting the publisher's 15-minute timeout, even when those runs have no relevant intent. Replace the per-run scan with a bounded lookup keyed by the draft artifact, while preserving detection of prior intents across runs and reruns.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The publication gate does not ensure the exact candidate artifact undergoes a successful threat scan before sealing and publishing, especially for file-only candidates.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Scan the candidate artifact before sealing
.github/workflows/discussion-draft.md:91
The candidate JSON is uploaded separately, but the compiled detector downloads only agent/agent-output-fallback and can skip scanning when there are no safe outputs or patches. This gate therefore does not establish that the exact candidate later rendered and published underwent threat detection. Make the candidate artifact an explicit detection input, require an executed and successful scan before sealing, and add coverage for a file-only candidate.
The two remaining Copilot review-summary concerns are addressed in follow-up #494 (commit ba43644), since #493 was merged before these fixes were pushed.
Exact candidate scanning: stage the candidate JSON in detector input and require successful execution, a successful verdict, and a matching same-run/attempt SHA-256 scan binding before sealing. File-only candidates, skipped/failed scans, missing evidence, and changed bytes have regression coverage.
Bounded intent lookup: one exact-name repository-artifact request per phase, reading at most two matches. The regression reproduced 2,022 requests before the fix; the corrected publication cycle uses two. Prior intents across runs and reruns still block uncertain duplicate writes, and existing exact bot comments remain no-op retries.
All 123 automation tests pass on Node 24.22.1. Both workflows strictly compile with gh-aw v0.93.5, with zero warnings and no repeat-compilation drift. The backlog workflow, inference budgets, and read-only drafting permissions are unchanged.
No live drafting run or bot publication was performed. Please review and merge #494 before the first live draft/publish verification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/typechat draftworkflow for Issues and Discussions that prepares a read-only draft, validates it after threat detection, and publishes an exact preview and immutable review artifact in the Actions summary./typechat publish <artifact-id>:<body-sha256>workflow that posts only the owner's explicitly approved text throughgithub-actions[bot]. Discussion posts are top-level comments.Approval and safety boundaries
Drafting does not post, accept work, close threads, label items, or start implementation. Publishing approves only the exact comment, not implementation or merging.
The protocol checks the human owner, default-branch code, repository and artifact/run provenance, current policy/control fingerprints, thread snapshots, referenced PR revisions, and the approved body hash. Target-specific publishing jobs have only their required comment-write scope. Durable publication intents and existing-comment checks prevent blind retries after an uncertain write; stale drafts fail closed. No personal token or new bot secret is introduced.
The main drafting budget is 50 AI credits; the backlog's main budget remains 400. Threat detection retains its separate 400-credit default, so neither is a combined workflow cap. The future 1,000-credit implementation allowance and budget overrides remain documentation only.
Verification
32ecafbc061c9af57e9361942099e381102ae304; repeat compilation produces no generated-file drift.main, except the verified empty shared import.Rollout and review
This branch is based on the latest
main(a322637), with one new commit. No live drafting run or bot publication has been performed. Existing branch-review protections are unchanged, and the project-direction policy is not modified.PR CI can validate this without merging. Full pre-merge end-to-end testing would use an isolated staging repository with explicitly pinned staging identity and available Copilot access; production comment triggers require these workflows on the default branch. Human review and explicit owner approval remain required. After deployment, record live verification before marking the pilot active.