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
19 changes: 18 additions & 1 deletion .github/workflows/issue-implementation.lock.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/issue-implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: string
roles: [admin, maintain, write]
github-token: ${{ secrets.GITHUB_TOKEN }}
reaction: none
reaction: rocket
status-comment: false
if: &owner_request >-
github.repository == 'microsoft/TypeChat' &&
Expand Down
33 changes: 32 additions & 1 deletion AUTOMATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,19 @@ the original draft command, approval, completed successful producer, unchanged
policy and discussion, referenced PR revisions, and exact acceptance hash
before posting one top-level **Accepted work** comment.

After confirming that exact record, the publisher adds a thumbs-up reaction to
the owner's `/typechat accept` comment, on either an Issue or a Discussion.
The reaction confirms recorded acceptance, not merely receipt of the command.
Rejected approvals and unconfirmed publication outcomes do not receive it.
An unchanged, already-published record can also confirm a subsequent valid
approval command without creating another acceptance comment.

Reaction failures are reported separately from the already-recorded decision.
A valid publisher retry can restore the reaction without editing or reposting
accepted work. Reaction requests are idempotent, and reactions do not change
the frozen discussion evidence. The existing target-scoped publisher credentials
are reused; the acceptance record, not the reaction alone, remains authoritative.

The conversational response and acceptance record have different hashes and
publication markers. A response publish command cannot accept work; an accept
command cannot use the response hash. A direct-reply artifact cannot be accepted.
Expand Down Expand Up @@ -880,7 +893,7 @@ decisions should be clear and visible.

## Third pilot: owner-triggered Issue implementation

**Prepared for review; disabled and not live-verified.** The
**Default-off; successful automated PR publication is not yet live-verified.** The
[accepted agreement for #504](https://github.com/microsoft/TypeChat/issues/504#issuecomment-6562465109)
authorizes development of this workflow, not an automated coding run. The new
[workflow](./.github/workflows/issue-implementation.md) requires
Expand All @@ -899,6 +912,24 @@ command with the same hash, is supported. Ordinary manual acceptance remains
valid human governance but is not machine-readable authority for this pilot.
Discussion builds and inline notes remain unsupported; #502 is still deferred.

The native rocket reaction acknowledges startup for an eligible owner build
command. It does not mean that agreement validation, App preflight, generation,
or tests have passed. Manual command preparation does not add a reaction or
authorize execution. Only trusted activation receives reaction-write permissions;
the pinned compiler also grants `pull-requests: write` for the shared
`issue_comment` event, while the owner guard continues to reject PR comments.
The coding agent, detector, and generated checks retain read-only repository access.
No start comment is posted.

The owner-authorized [live run](https://github.com/microsoft/TypeChat/actions/runs/41493733655)
exercised App preflight, generation, full-patch threat detection, and isolated
checks. The Python suite passed 107 runtime tests with 3 skipped, but failed
strict Pyright checks on three partially unknown types. Publication was correctly
blocked, and the temporary activation flag was removed. Native usage was
50.71891 coding credits plus 10.53936 detection credits. This verifies rejection
of a failing candidate, not successful automated PR creation. Manual recovery
of that candidate does not change the failed run's outcome.

### Frozen authorization and bounded spending

Preflight verifies owner identity, default-branch workflow code, the current
Expand Down
12 changes: 10 additions & 2 deletions OWNER-CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ separate check.** This is a real scope decision, not a test acknowledgment.
4. Follow **Publish approved response or work acceptance** to the **Accepted
work** comment. Confirm it records the terms you approved.

After acknowledgment rollout, a thumbs-up on your command confirms that the
exact acceptance was recorded; it is not an acknowledgment of merely receiving
the command. This works for both Issues and Discussions. If the reaction fails
after recording acceptance, inspect the publisher's error before retrying the
still-valid command. An unchanged confirmed record is not posted twice.

Use the acceptance hash, not the conversational reply's publish hash. A
`/typechat reply` artifact cannot be accepted. Publishing a response first changes
the context; request a fresh draft before accepting rather than reusing it.
Expand Down Expand Up @@ -187,8 +193,10 @@ yet. After review and merge, and a separate decision to activate:
variable `TYPECHAT_IMPLEMENTATION_ENABLED=true`, then post the generated
`/typechat build <acceptance-comment-id>:<sha256>` as a fresh Issue comment.
This authorizes one run with **1,000 main credits plus 400 detection credits**.
4. Follow Actions, then the resulting PR. Build commands do not add an eyes/start
comment. The PR links the agreement, exact patch origin, checks, usage, and
4. Follow Actions, then the resulting PR. After acknowledgment rollout, a rocket
reaction on the build command acknowledges startup, not successful validation
or completion. No start comment is posted. The PR links the agreement,
exact patch origin, checks, usage, and
limitations. Verify normal PR CI and Copilot review actually ran before review
and any separate merge decision.

Expand Down
24 changes: 24 additions & 0 deletions tools/discussion-draft.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ export async function checkPublication(github, context, env, bundle, clock = ()
const publication = await identifyPublication(github, context, env, clock);
const { existing } = await verifyBundleContext(github, publication, bundle);
if (existing) {
await acknowledgeAcceptance(github, publication.request);
return { shouldPost: false, url: existing.url };
}
const prior = await priorIntent(github, publicationIntentName(publication));
Expand All @@ -977,6 +978,7 @@ export async function publishDraft(github, context, env, bundle, intentId, clock
const publication = await identifyPublication(github, context, env, clock);
const { existing } = await verifyBundleContext(github, publication, bundle);
if (existing) {
await acknowledgeAcceptance(github, publication.request);
return { posted: false, url: existing.url, bodyHash: digest(existing.body) };
}
const intent = (await github.rest.actions.getArtifact({ ...API_REPO, artifact_id: integer(Number(intentId), "Missing durable publication intent.") })).data;
Expand All @@ -991,14 +993,36 @@ export async function publishDraft(github, context, env, bundle, intentId, clock
const latest = await identifyPublication(github, context, env, clock);
const rechecked = await verifyBundleContext(github, latest, bundle);
if (rechecked.existing) {
await acknowledgeAcceptance(github, latest.request);
return { posted: false, url: rechecked.existing.url, bodyHash: digest(rechecked.existing.body) };
}
await verifyCommand(github, latest.request);
const content = publicationContent(bundle, latest.request.command.action);
const comment = await writeDiscussionComment(github, bundle.target, content.body);
await acknowledgeAcceptance(github, latest.request);
return { posted: true, id: comment.id, url: comment.url, bodyHash: content.bodyHash };
}

async function acknowledgeAcceptance(github, request) {
if (request.command.action !== "accept") {
return;
}
await verifyCommand(github, request);
try {
const result = await github.graphql(`mutation DiscussionPilotAcceptReaction($id:ID!) {
addReaction(input:{subjectId:$id,content:THUMBS_UP}) {
subject { ... on Node { id } }
reaction { content }
}
}`, { id: request.commentId });
requireValue(result.addReaction?.subject?.id === request.commentId &&
result.addReaction?.reaction?.content === "THUMBS_UP", "The reaction response does not confirm the target and content.");
} catch (error) {
throw new Error("Acceptance is recorded, but its confirmation reaction failed. Inspect the command before retrying; do not recreate accepted work.",
{ cause: error });
}
}

async function writeDiscussionComment(github, target, body, existing = null) {
const commentId = existing && target.kind === "issue" ?
integer(Number(existing.url.split("#issuecomment-")[1]), "Invalid receipt comment URL.") : null;
Expand Down
Loading
Loading