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
41 changes: 26 additions & 15 deletions .github/workflows/discussion-draft.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 8 additions & 21 deletions .github/workflows/discussion-draft.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
types: [created]
roles: [admin, maintain, write]
github-token: ${{ secrets.GITHUB_TOKEN }}
reaction: eyes
status-comment: false
if: &draft_request >-
github.repository == 'microsoft/TypeChat' &&
github.event.sender.type == 'User' &&
Expand All @@ -28,10 +30,6 @@ imports:
- shared/read-only-analysis.md
safe-outputs:
report-missing-tool: false
noop:
# One trusted scan signal plus the two existing model no-ops.
max: 3
report-as-issue: false
threat-detection:
continue-on-error: false
report-as-issue: false
Expand Down Expand Up @@ -229,21 +227,6 @@ steps:
artifact-ids: ${{ needs.prepare.outputs.context_artifact_id }}
merge-multiple: true
path: .typechat-draft
pre-agent-steps:
# The pinned detection guard only sees native output types, not file artifacts.
- name: Require candidate threat detection
id: require_candidate_detection
env:
GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
shell: node {0}
run: |
const fs = require("node:fs");
const path = require("node:path");
fs.mkdirSync(path.dirname(process.env.GH_AW_SAFE_OUTPUTS), { recursive: true });
fs.appendFileSync(process.env.GH_AW_SAFE_OUTPUTS, JSON.stringify({
type: "noop",
message: "This read-only workflow requires threat detection of its candidate artifact before sealing."
}) + "\n");
post-steps:
- name: Verify candidate draft file
if: success()
Expand Down Expand Up @@ -348,6 +331,10 @@ exactly `number`, `headSha` (the full inspected commit), and `updatedAt` (the
inspected API update timestamp). Include at most eight PRs. Do not invent
references or claim tests were executed.

After writing `discussion-draft.json`, call `safeoutputs-noop` with a brief
completion summary. Do not report completion before the file exists. This
native completion signal does not publish a comment or approve the draft.

The workflow will validate and freeze the exact rendered comment. Only a later
human-owner publish command can authorize posting it. Finish with a brief
summary; do not claim that anything was posted or accepted.
human-owner publish command can authorize posting it. Do not claim that anything
was posted or accepted.
29 changes: 23 additions & 6 deletions AUTOMATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ by `npm test`), including checks that the runtime pin matches the compilation
command, generated drafting jobs cannot write to issues or pull requests, and
the separate publisher has only its target-specific comment permission.
The discussion tests execute the compiled detection guard with Bash (Git Bash
on Windows), including a candidate with no model-emitted safe outputs or patch.
on Windows), covering collected completion/incomplete signals and a missing signal.

The assessment itself remains report-only and does not change existing
maintenance and deployment workflows. The separate
Expand Down Expand Up @@ -501,7 +501,16 @@ Editing a command does not trigger or authorize a run. Other users, bots, PR
comments, non-default-branch code, and changed or deleted commands cannot
authorize drafting or publication. Comment events may still show ignored or
skipped workflow runs; they do not authorize model inference or posting.
An `eyes` reaction on the triggering command comment acknowledges that the
workflow has started processing the request. It is not confirmation that a draft
is ready, that scanning succeeded, or that work was accepted. Check Actions for
completion and errors. Native workflow code handles the reaction; the model
retains read-only access.
No new public bot comment is made just to acknowledge a draft request.
The pinned compiler grants reaction-write permissions to trusted activation,
including `pull-requests: write` because GitHub also uses `issue_comment` for PR
comments. The owner-only workflow guard still excludes PR comments. These write
permissions are not granted to model execution, detection, or sealing.

If the wording is wrong, do not approve it. Add clarification to the thread and
request a new draft. There is no force-publish or editable-artifact shortcut.
Expand All @@ -518,11 +527,19 @@ recorded requirements, suggested criteria, and a readiness recommendation.
Thread context is bounded at 1 MiB and 1,000 comments, including replies;
incomplete or oversized context is an error, not silent truncation.

Before model execution, a trusted step adds a read-only no-op to the native
safe-output stream. This makes the pinned runtime's detection guard run even
when the model writes only the candidate file and emits no safe outputs or patch.
The no-op limit reserves one slot for that signal in addition to the two existing
model no-ops; no-op issue reporting remains disabled.
Do not seed a native `noop` before model execution: the pinned runtime interprets
it as completed work and skips the model. The model writes the candidate first,
then emits its native completion signal. If it emits no terminal safe output,
the pinned collector records an explicit `report_incomplete` signal rather than
treating silence as successful work. The detection guard consumes the collected
output types; a missing signal cannot authorize sealing.

The first owner-commanded [draft run](https://github.com/microsoft/TypeChat/actions/runs/41136773812)
on 2026-10-30 exposed this preflight behavior. The synthetic pre-agent no-op caused
the model to be skipped, so no candidate or sealed draft was produced. Detection
and sealing failed closed, and nothing was published. Removing that premature
completion signal needs a fresh owner-commanded live verification after merge;
the failed run is not evidence that drafting or scanning succeeded.

The detector downloads the attempt-specific, immutable candidate artifact.
Trusted code adds its complete JSON text to the detector's agent-output input,
Expand Down
4 changes: 4 additions & 0 deletions OWNER-CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ the command**, with no leading text. Editing an old comment does not trigger it.
/typechat draft
```

The Actions bot acknowledges the command comment with an `eyes` reaction when
the workflow starts processing it. This is not a success or acceptance signal;
check Actions for progress and errors.

**2. Review:** Open **Actions > Prepare discussion draft**, wait for the run to
succeed, and read its summary's exact preview. Check factual accuracy, scope,
existing contributions, unanswered questions, and suggested criteria.
Expand Down
Loading
Loading