Skip to content

Allow users to revise macros before publishing - #3238

Open
George Ng (GeorgeNgMsft) wants to merge 2 commits into
mainfrom
feat/macro-publish-edit
Open

George Ng (GeorgeNgMsft) wants to merge 2 commits into
mainfrom
feat/macro-publish-edit

Conversation

@GeorgeNgMsft

Copy link
Copy Markdown
Contributor

Summary

Users can now describe corrections to a captured macro during publish review instead of accepting an incorrect draft or recording the task again.

  • Add revise_macro with an exact current draft version and plain-language feedback, plus get_macro_learning_job to track the revised draft.
  • Expose the same workflow through @typeagent recipe revise <macroId> <version> <feedback> and @typeagent recipe status <jobId>.
  • Preserve the original recording and immutable draft history, accumulate corrections, and regenerate version-targeted grammar and checked programs.
  • Independently derive fixtures using the requested correction without exposing either implementation's source to the verifier.

Revised drafts always stop for explicit review and approval, including under Read-only or All. Starting a revision blocks approval of the old draft. Unsupported changes fail explicitly; this does not add tools, authorize effects, weaken capability checks, or execute the recorded task during authoring.

Example

During review, ask: “Return only the title, not the entire tool response.”

Copilot calls revise_macro with the current draft reference and that feedback. Once the returned job reaches needsReview, the user can inspect the new version, request another correction, or approve that exact version.

Validation

  • Affected macro and plugin builds passed.
  • 99 macro tests passed across learning, revision lifecycle, program execution, and portable authoring.
  • 75 plugin tests passed across recipe commands, owner IPC, MCP adapters, bundled tool discovery, and bypass integration.
  • Regression coverage includes restart recovery, immutable history, accumulated corrections, stale versions, failed-correction retry, cancellation, and explicit approval under All.
  • Real compiled fixtures reject the old implementation for an uppercase-output correction and accept the corrected program without exposing private verifier fixtures to the author.
  • Formatting, lint, complexity, circular-dependency, and test-debt PR gates passed.
  • Completed an adversarial review before opening the PR. Git Story and Copilot coauthor attribution are included in the commits.

Add checked, immutable draft revisions with plain-language feedback, job tracking, and explicit approval. Preserve recording provenance and validate corrected outputs independently before publication.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Git-Story:
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#1 apply_patch ts/packages/copilot-macros/src/contracts.ts ts/packages/copilot-macros/src/macroLearning.ts ts/packages/copilot-macros/src/macroManager.ts ts/packages/copilot-macros/src/macroProgramAuthoring.ts
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#2 apply_patch ts/packages/copilot-macros/src/macroLearning.ts ts/packages/copilot-plugin/src/extension/local-recipe-service.ts ts/packages/copilot-plugin/src/mcp/macroServer.ts ts/packages/copilot-plugin/src/shared/macro-owner.ts ts/packages/copilot-plugin/src/shared/mcp-guidance.ts ts/packages/copilot-plugin/src/shared/recipe-commands.ts
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#3 apply_patch ts/packages/copilot-macros/test/macroChildLearning.spec.ts
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#4 apply_patch ts/packages/copilot-macros/test/macroChildLearning.spec.ts ts/packages/copilot-macros/test/macroAuthoringRuntime.spec.ts ts/packages/copilot-plugin/test/localRecipeService.spec.ts ts/packages/copilot-plugin/test/macroServer.spec.ts ts/packages/copilot-plugin/test/pluginArtifact.spec.ts ts/packages/copilot-plugin/test/recipeCommands.spec.ts
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#5 apply_patch ts/docs/architecture/workflows/macros.md ts/packages/copilot-macros/README.md ts/packages/copilot-plugin/README.md ts/packages/copilot-plugin/skills/typeagent-macros/SKILL.md
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#6 apply_patch ts/packages/copilot-macros/test/macroChildLearning.spec.ts
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#7 powershell ts/packages/copilot-macros/src/macroLearning.ts ts/packages/copilot-macros/test/macroAuthoringRuntime.spec.ts ts/packages/copilot-macros/test/macroChildLearning.spec.ts
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#8 vote_memory ts/packages/copilot-plugin/test/macroServer.spec.ts ts/packages/copilot-plugin/test/recipeCommands.spec.ts
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#9 apply_patch ts/docs/architecture/workflows/macros.md ts/packages/copilot-macros/src/macroLearning.ts ts/packages/copilot-plugin/README.md ts/packages/copilot-plugin/src/shared/recipe-commands.ts ts/packages/copilot-plugin/test/recipeCommands.spec.ts
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#10 powershell ts/packages/copilot-macros/src/macroLearning.ts ts/packages/copilot-plugin/src/shared/recipe-commands.ts
Keep run, revision, inspection and publication commands on the same positive-safe-integer validation path and stay within the command complexity budget.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Git-Story:
- cece3bbc3ceb3f157b172d12f280b65f6e4bc07162d3c5afe32e6a394ca6618d#11 apply_patch ts/packages/copilot-plugin/src/shared/recipe-commands.ts

This branch has not been deployed

No deployments
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.

1 participant