@muggleai/works 5.34.0-staging.311 → 5.34.0-staging.313

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/{chunk-H47WQEDR.js → chunk-TAZURSYL.js} +69 -45
  3. package/dist/{chunk-7Y3PHHOL.js → chunk-V4BVBLLO.js} +2 -2
  4. package/dist/cli.js +2 -2
  5. package/dist/index.js +2 -2
  6. package/dist/plugin/.claude-plugin/plugin.json +1 -1
  7. package/dist/plugin/.codex-mcp.json +1 -1
  8. package/dist/plugin/.codex-plugin/plugin.json +1 -1
  9. package/dist/plugin/.cursor-plugin/plugin.json +1 -1
  10. package/dist/plugin/.mcp.json +1 -1
  11. package/dist/plugin/skills/do/address-reviews.md +1 -0
  12. package/dist/plugin/skills/do/audit-trail.md +51 -0
  13. package/dist/plugin/skills/do/build.md +2 -0
  14. package/dist/plugin/skills/do/cleanup.md +1 -0
  15. package/dist/plugin/skills/do/cycle-size.md +2 -0
  16. package/dist/plugin/skills/do/fix-ci.md +1 -0
  17. package/dist/plugin/skills/do/impact-analysis.md +2 -0
  18. package/dist/plugin/skills/do/next-step.md +1 -1
  19. package/dist/plugin/skills/do/open-prs/forward.md +5 -0
  20. package/dist/plugin/skills/do/pre-flight.md +1 -0
  21. package/dist/plugin/skills/do/requirements.md +5 -0
  22. package/dist/plugin/skills/do/resolve-conflicts.md +1 -0
  23. package/dist/plugin/skills/do/respawn-watcher.md +2 -0
  24. package/dist/plugin/skills/muggle-do/SKILL.md +4 -0
  25. package/dist/release-manifest.json +4 -4
  26. package/dist/{src-5BGECNR4.js → src-2QNYQXMU.js} +1 -1
  27. package/package.json +1 -1
  28. package/plugin/.claude-plugin/plugin.json +1 -1
  29. package/plugin/.codex-mcp.json +1 -1
  30. package/plugin/.codex-plugin/plugin.json +1 -1
  31. package/plugin/.cursor-plugin/plugin.json +1 -1
  32. package/plugin/.mcp.json +1 -1
  33. package/plugin/skills/do/address-reviews.md +1 -0
  34. package/plugin/skills/do/audit-trail.md +51 -0
  35. package/plugin/skills/do/build.md +2 -0
  36. package/plugin/skills/do/cleanup.md +1 -0
  37. package/plugin/skills/do/cycle-size.md +2 -0
  38. package/plugin/skills/do/fix-ci.md +1 -0
  39. package/plugin/skills/do/impact-analysis.md +2 -0
  40. package/plugin/skills/do/next-step.md +1 -1
  41. package/plugin/skills/do/open-prs/forward.md +5 -0
  42. package/plugin/skills/do/pre-flight.md +1 -0
  43. package/plugin/skills/do/requirements.md +5 -0
  44. package/plugin/skills/do/resolve-conflicts.md +1 -0
  45. package/plugin/skills/do/respawn-watcher.md +2 -0
  46. package/plugin/skills/muggle-do/SKILL.md +4 -0
@@ -9,7 +9,7 @@
9
9
  "name": "muggleai",
10
10
  "source": "./plugin",
11
11
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
12
- "version": "5.34.0-staging.311"
12
+ "version": "5.34.0-staging.313"
13
13
  }
14
14
  ]
15
15
  }
@@ -6997,7 +6997,7 @@ var TestCaseUpdateInputSchema = z.object({
6997
6997
  precondition: z.string().optional().describe("Updated precondition"),
6998
6998
  expectedResult: z.string().min(1).optional().describe("Updated expected result"),
6999
6999
  url: z.string().url().optional().describe("Updated target URL"),
7000
- status: z.enum(["DRAFT", "ACTIVE", "DEPRECATED", "ARCHIVED"]).optional().describe("Updated status"),
7000
+ status: z.enum(["DRAFT", "ACTIVE", "DEPRECATED", "ARCHIVED"]).optional().describe("New lifecycle status; a status the lifecycle does not reach from the current one fails the call"),
7001
7001
  priority: z.enum(["HIGH", "MEDIUM", "LOW"]).optional().describe("Updated priority"),
7002
7002
  tags: z.array(z.string()).optional().describe("Updated tags"),
7003
7003
  category: z.string().optional().describe("Updated category"),
@@ -7883,6 +7883,62 @@ function toSecretMetadata(upstreamSecret) {
7883
7883
  };
7884
7884
  }
7885
7885
 
7886
+ // packages/mcps/src/mcp/tools/e2e/test-state-upstream.ts
7887
+ function buildTestChainingCatalogPath(projectId) {
7888
+ return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/catalog`;
7889
+ }
7890
+ function buildTestStatesPath(projectId) {
7891
+ return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/states`;
7892
+ }
7893
+ function buildTestRolesPath(projectId) {
7894
+ return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/roles`;
7895
+ }
7896
+ function buildTestChainingSettingsPath(projectId) {
7897
+ return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/settings`;
7898
+ }
7899
+ function buildTestChainingPlanPath(projectId) {
7900
+ return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/plan`;
7901
+ }
7902
+ function pickTestCaseTestStateFields(testStateFields) {
7903
+ const requestFields = {};
7904
+ if (testStateFields.actsAsRoleIds !== void 0) requestFields.actsAsRoleIds = testStateFields.actsAsRoleIds;
7905
+ if (testStateFields.prerequisiteStateId !== void 0) {
7906
+ requestFields.prerequisiteStateId = testStateFields.prerequisiteStateId;
7907
+ }
7908
+ if (testStateFields.resultStateId !== void 0) requestFields.resultStateId = testStateFields.resultStateId;
7909
+ return requestFields;
7910
+ }
7911
+
7912
+ // packages/mcps/src/mcp/tools/e2e/test-case-update-upstream.ts
7913
+ function buildTestCaseDefinitionUpdateBody(toolInput) {
7914
+ const definitionBody = { id: toolInput.testCaseId, ...pickTestCaseTestStateFields(toolInput) };
7915
+ if (toolInput.title !== void 0) definitionBody.title = toolInput.title;
7916
+ if (toolInput.description !== void 0) definitionBody.description = toolInput.description;
7917
+ if (toolInput.goal !== void 0) definitionBody.goal = toolInput.goal;
7918
+ if (toolInput.precondition !== void 0) definitionBody.precondition = toolInput.precondition;
7919
+ if (toolInput.expectedResult !== void 0) definitionBody.expectedResult = toolInput.expectedResult;
7920
+ if (toolInput.url !== void 0) definitionBody.url = toolInput.url;
7921
+ if (toolInput.priority !== void 0) definitionBody.priority = toolInput.priority;
7922
+ if (toolInput.tags !== void 0) definitionBody.tags = toolInput.tags;
7923
+ if (toolInput.category !== void 0) definitionBody.category = toolInput.category;
7924
+ if (toolInput.automated !== void 0) definitionBody.automated = toolInput.automated;
7925
+ if (toolInput.pinnedAccount !== void 0) definitionBody.pinnedAccount = toolInput.pinnedAccount;
7926
+ if (toolInput.alwaysStartsFreshSession !== void 0) {
7927
+ definitionBody.alwaysStartsFreshSession = toolInput.alwaysStartsFreshSession;
7928
+ }
7929
+ return definitionBody;
7930
+ }
7931
+ function hasTestCaseDefinitionEdit(toolInput) {
7932
+ return Object.keys(buildTestCaseDefinitionUpdateBody(toolInput)).some((fieldName) => fieldName !== "id");
7933
+ }
7934
+ function buildTestCaseStatusUpdateCall(testCaseId, status) {
7935
+ return {
7936
+ method: "PUT",
7937
+ path: `${MUGGLE_TEST_PREFIX}/test-cases/${testCaseId}/state`,
7938
+ body: { status }
7939
+ };
7940
+ }
7941
+
7886
7942
  // packages/mcps/src/mcp/tools/e2e/test-runs-summary-transform.ts
7887
7943
  var UNKNOWN_STATUS = "UNKNOWN";
7888
7944
  function slimEntry(raw) {
@@ -7937,32 +7993,6 @@ function mapTestScriptsSummary(response) {
7937
7993
  };
7938
7994
  }
7939
7995
 
7940
- // packages/mcps/src/mcp/tools/e2e/test-state-upstream.ts
7941
- function buildTestChainingCatalogPath(projectId) {
7942
- return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/catalog`;
7943
- }
7944
- function buildTestStatesPath(projectId) {
7945
- return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/states`;
7946
- }
7947
- function buildTestRolesPath(projectId) {
7948
- return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/roles`;
7949
- }
7950
- function buildTestChainingSettingsPath(projectId) {
7951
- return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/settings`;
7952
- }
7953
- function buildTestChainingPlanPath(projectId) {
7954
- return `${MUGGLE_TEST_PREFIX}/projects/${projectId}/test-chaining/plan`;
7955
- }
7956
- function pickTestCaseTestStateFields(testStateFields) {
7957
- const requestFields = {};
7958
- if (testStateFields.actsAsRoleIds !== void 0) requestFields.actsAsRoleIds = testStateFields.actsAsRoleIds;
7959
- if (testStateFields.prerequisiteStateId !== void 0) {
7960
- requestFields.prerequisiteStateId = testStateFields.prerequisiteStateId;
7961
- }
7962
- if (testStateFields.resultStateId !== void 0) requestFields.resultStateId = testStateFields.resultStateId;
7963
- return requestFields;
7964
- }
7965
-
7966
7996
  // packages/mcps/src/mcp/tools/e2e/tool-registry.ts
7967
7997
  var getWorkflowTimeoutMs = () => getConfig().e2e.workflowTimeoutMs;
7968
7998
  var projectTools = [
@@ -8403,31 +8433,22 @@ var testCaseTools = [
8403
8433
  },
8404
8434
  {
8405
8435
  name: "muggle-remote-test-case-update",
8406
- description: `Directly update an existing test case's fields. Pass only the fields you want to change \u2014 others are left untouched. ${TEST_CASE_LIMIT_GUIDANCE} Use this for cheap, deterministic edits (rename, change status/priority, fix expected result, add tags, set or clear the pinned account with pinnedAccount, set whether every run starts from a fresh session with alwaysStartsFreshSession; pinned account and fresh session apply from the next script generation, not to existing scripts; set the roles it acts as and its prerequisite and result test states with actsAsRoleIds, prerequisiteStateId and resultStateId, null clearing each). Does not touch the associated test script \u2014 script regeneration is a separate workflow (muggle-remote-workflow-start-test-script-generation).`,
8436
+ description: `Directly update an existing test case's fields. Pass only the fields you want to change \u2014 others are left untouched. ${TEST_CASE_LIMIT_GUIDANCE} Use this for cheap, deterministic edits (rename, change status/priority, fix expected result, add tags, set or clear the pinned account with pinnedAccount, set whether every run starts from a fresh session with alwaysStartsFreshSession; pinned account and fresh session apply from the next script generation, not to existing scripts; set the roles it acts as and its prerequisite and result test states with actsAsRoleIds, prerequisiteStateId and resultStateId, null clearing each). A status change follows the test case lifecycle and is written after the other fields: a status the lifecycle does not reach from the current one fails the call with the statuses it does reach, and the other fields stay saved. Does not touch the associated test script \u2014 script regeneration is a separate workflow (muggle-remote-workflow-start-test-script-generation).`,
8407
8437
  inputSchema: TestCaseUpdateInputSchema,
8408
8438
  mapToUpstream: (input) => {
8409
8439
  const toolInput = input;
8410
- const body = { id: toolInput.testCaseId, ...pickTestCaseTestStateFields(toolInput) };
8411
- if (toolInput.title !== void 0) body.title = toolInput.title;
8412
- if (toolInput.description !== void 0) body.description = toolInput.description;
8413
- if (toolInput.goal !== void 0) body.goal = toolInput.goal;
8414
- if (toolInput.precondition !== void 0) body.precondition = toolInput.precondition;
8415
- if (toolInput.expectedResult !== void 0) body.expectedResult = toolInput.expectedResult;
8416
- if (toolInput.url !== void 0) body.url = toolInput.url;
8417
- if (toolInput.status !== void 0) body.status = toolInput.status;
8418
- if (toolInput.priority !== void 0) body.priority = toolInput.priority;
8419
- if (toolInput.tags !== void 0) body.tags = toolInput.tags;
8420
- if (toolInput.category !== void 0) body.category = toolInput.category;
8421
- if (toolInput.automated !== void 0) body.automated = toolInput.automated;
8422
- if (toolInput.pinnedAccount !== void 0) body.pinnedAccount = toolInput.pinnedAccount;
8423
- if (toolInput.alwaysStartsFreshSession !== void 0) {
8424
- body.alwaysStartsFreshSession = toolInput.alwaysStartsFreshSession;
8440
+ if (toolInput.status !== void 0 && !hasTestCaseDefinitionEdit(toolInput)) {
8441
+ return buildTestCaseStatusUpdateCall(toolInput.testCaseId, toolInput.status);
8425
8442
  }
8426
8443
  return {
8427
8444
  method: "PUT",
8428
8445
  path: `${MUGGLE_TEST_PREFIX}/test-cases/${toolInput.testCaseId}`,
8429
- body
8446
+ body: buildTestCaseDefinitionUpdateBody(toolInput)
8430
8447
  };
8448
+ },
8449
+ mapToFollowUpUpstream: (input) => {
8450
+ const toolInput = input;
8451
+ return toolInput.status !== void 0 && hasTestCaseDefinitionEdit(toolInput) ? [buildTestCaseStatusUpdateCall(toolInput.testCaseId, toolInput.status)] : [];
8431
8452
  }
8432
8453
  },
8433
8454
  {
@@ -9935,7 +9956,10 @@ async function executeQaTool(toolName, input, correlationId) {
9935
9956
  try {
9936
9957
  const upstreamCall = tool.mapToUpstream(resolvedInput);
9937
9958
  const client = getPromptServiceClient();
9938
- const response = await client.execute(upstreamCall, credentials, correlationId);
9959
+ let response = await client.execute(upstreamCall, credentials, correlationId);
9960
+ for (const followUpCall of tool.mapToFollowUpUpstream?.(resolvedInput) ?? []) {
9961
+ response = await client.execute(followUpCall, credentials, correlationId);
9962
+ }
9939
9963
  const mapper = tool.mapFromUpstream || defaultResponseMapper;
9940
9964
  const mappedResponse = mapper(response, resolvedInput);
9941
9965
  const dashboardLinkTarget = tool.dashboardLink?.(resolvedInput, response) ?? null;
@@ -1,4 +1,4 @@
1
- import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, buildElectronAppChecksumsUrl, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, ELECTRON_APP_CHECKSUMS_ASSET_NAME, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-H47WQEDR.js';
1
+ import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, buildElectronAppChecksumsUrl, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, ELECTRON_APP_CHECKSUMS_ASSET_NAME, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-TAZURSYL.js';
2
2
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
3
  import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema } from '@modelcontextprotocol/sdk/types.js';
4
4
  import { v4 } from 'uuid';
@@ -1256,7 +1256,7 @@ async function resolveGsScreenshotUrls(report, opts) {
1256
1256
  if (gsUrls.length === 0) {
1257
1257
  return report;
1258
1258
  }
1259
- const mcps = await import('./src-5BGECNR4.js');
1259
+ const mcps = await import('./src-2QNYQXMU.js');
1260
1260
  const credentials = await mcps.getCallerCredentialsAsync();
1261
1261
  if (!credentials.bearerToken && !credentials.apiKey) {
1262
1262
  stderrWrite(
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-7Y3PHHOL.js';
3
- import './chunk-H47WQEDR.js';
2
+ import { runCli } from './chunk-V4BVBLLO.js';
3
+ import './chunk-TAZURSYL.js';
4
4
 
5
5
  // src/cli/main.ts
6
6
  runCli().catch((error) => {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-7Y3PHHOL.js';
2
- export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-H47WQEDR.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-V4BVBLLO.js';
2
+ export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-TAZURSYL.js';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
4
- "version": "5.34.0-staging.311",
4
+ "version": "5.34.0-staging.313",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.34.0-staging.311",
7
+ "@muggleai/works@5.34.0-staging.313",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.34.0-staging.311",
3
+ "version": "5.34.0-staging.313",
4
4
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
5
- "version": "5.34.0-staging.311",
5
+ "version": "5.34.0-staging.313",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.34.0-staging.311",
7
+ "@muggleai/works@5.34.0-staging.313",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  mandatoryStages:
3
3
  - respawn-watcher.md
4
+ - audit-trail.md
4
5
  - ../_shared/telemetry-events/muggle-do-cycle.md
5
6
  ---
6
7
 
@@ -0,0 +1,51 @@
1
+ # Audit trail
2
+
3
+ **Arm first.** If this cycle leaves a PR open and its watch is not armed yet, stop reading and arm it now ([`respawn-watcher.md`](respawn-watcher.md), or Stage 8 on a forward cycle). The block is written after the arm, never instead of it.
4
+
5
+ What a cycle shows the user before it ends: the tests the change involved, their results, and links to the proof. It reports and gates nothing. Anything missing is stated in the block, never a reason to stop, retry, or ask.
6
+
7
+ ## Where it prints
8
+
9
+ - **Forward cycle** — its closing message ([`open-prs/forward.md`](open-prs/forward.md#output)), whatever Stage 7.5 cleared.
10
+ - **Watcher cycle** — its closing message ([`respawn-watcher.md`](respawn-watcher.md)). A cycle that changed nothing prints nothing.
11
+ - **Terminal turn** — before the ending selector ([`next-step.md`](next-step.md)), from the record [`cleanup.md`](cleanup.md#terminal-record) captured before teardown.
12
+
13
+ The block goes in that message in full, ahead of everything else, because the closing message is what the user reads: a block printed earlier in the turn, or summarized, does not count. One block per PR, or one for the change when no PR opened. Terminal only: the PR keeps its own walkthrough.
14
+
15
+ ## Sources
16
+
17
+ - **Unit tests** — the tests the change added or changed, read from `git diff <base>...HEAD` on test paths, each with its name, file path and result from the latest unit run, then that run's overall result. A bug fix's regression test comes first, with `failed before, passed after` from Stage 3.
18
+ - **E2E tests** — every case in the latest E2E report, each with its title, result and `viewUrl`. A skipped run shows its skip code and detail.
19
+ - **Evidence** — the PR's walkthrough comment, then the `viewUrl` of each run. Deliverable checks point at the PR's `## Validation` section.
20
+ - **Regression** — a bug fix's regression criterion from `requirements.md`, the one line saying what the test proves.
21
+
22
+ ## Shape
23
+
24
+ ```
25
+ Audit trail — acme/widget#142
26
+
27
+ Regression: [web] A duplicate email shows the sign-in prompt instead of a blank page
28
+
29
+ Unit tests
30
+ PASS shows the sign-in prompt for a duplicate email — src/signup/signup.test.ts (failed before, passed after)
31
+ PASS keeps the entered email on error — src/signup/signup.test.ts
32
+ Run: pnpm test — PASS
33
+
34
+ E2E tests
35
+ PASS Duplicate sign-up prompts to sign in — https://app.example.com/runs/4f2a
36
+ FAIL Reset link reaches the inbox — https://app.example.com/runs/91c0
37
+
38
+ Evidence
39
+ Walkthrough: https://github.com/acme/widget/pull/142#issuecomment-2210
40
+ PR: https://github.com/acme/widget/pull/142
41
+
42
+ Missing: nothing
43
+ ```
44
+
45
+ ## Rules
46
+
47
+ - Print it as a fenced block with exactly these headings: `Audit trail — <pr>`, `Unit tests`, `E2E tests`, `Evidence`, `Missing:`. A prose recap in the closing message's own style is a summary, and does not count.
48
+ - Links, not ids. An id appears only beside its link.
49
+ - Every section prints. An empty one says why: `none — <reason>`. A section with nothing to show still names the gap on the `Missing` line, such as no test changed, no PR opened, or a run with no link.
50
+ - `Regression` prints for bug fixes only. A bug fix with no regression test or case says so under `Missing`.
51
+ - Results are the recorded ones, never inferred. A run that never happened is `not run`, not a pass.
@@ -18,6 +18,7 @@ Implement the code change for this dev cycle. Read the frozen requirements from
18
18
  For each affected repo:
19
19
 
20
20
  1. **Re-read `requirements.md`.** Treat goal + AC as frozen. If something is unclear at this stage, that's a pre-flight bug — escalate, do not improvise.
21
+ 1.5. **Prove a bug fix first.** When `requirements.md` says `Change type: bug fix`, write a unit test for its regression criterion before touching the fix and run it: it must fail, for the bug's reason. Apply the fix, then run it again: it must pass. This stage's marker records the criterion, the test's file path, and `failed before, passed after`. A bug no unit test can reach is waived in `state.md` with the reason. The re-entries below owe no new regression test: they carry review comments and defects the change itself introduced.
21
22
  2. **Apply the change** in the repo's worktree. Edit existing files first; create new files only when the requirements demand it. Match the surrounding code's style, naming, and file layout.
22
23
  3. **Don't add what wasn't asked for.** No speculative abstractions, no extra logging, no "while I'm here" refactors. Three similar lines is better than a premature abstraction.
23
24
  4. **Cover new logic with tests.** If you added or changed non-trivial logic (a hook, reducer, parser, state machine, branching util), write its unit tests now — Stage 5 only *runs* the suite, it never authors tests. Untested new logic is a Definition-of-Done failure, not a Stage-5 gap.
@@ -43,6 +44,7 @@ Per repo:
43
44
  - Files edited / created: list
44
45
  - Commit subject: `<conventional commit>`
45
46
  - Notable choices: anything that needed a judgment call (briefly)
47
+ - Regression test: `<file path>` — failed before, passed after (bug fixes only)
46
48
 
47
49
  **Overall:** READY for impact analysis | BLOCKED — reason
48
50
 
@@ -16,6 +16,7 @@ The facts [`next-step.md`](next-step.md) reports a finished PR from. Teardown de
16
16
  - `e2eFailing` — the title carries `[E2E FAILING]`: the PR shipped on a waived or still-undecided E2E verdict.
17
17
  - `escalatedReviewIds` — `result.md`'s `Escalated review ids`; empty on `none` or when `result.md` is absent.
18
18
  - `waivers` — `state.md`'s waiver and Blocker lines and any open `## E2E decision` block, verbatim.
19
+ - `auditTrail` — the [audit trail](audit-trail.md) for this PR, rendered from the slot's `iterations/` and `requirements.md` while they still exist. A slot without them renders the gaps under `Missing`.
19
20
  - `teardown` — the note next-step prints, from this turn's teardown report: `cleaned up` when no row is `❌`, the first `❌` row's reason otherwise, `branch kept` when teardown did not run.
20
21
  - `finishedAt` — ISO-8601, when step 6 ran.
21
22
 
@@ -13,6 +13,8 @@ Once the cycle's edits are in the working tree, run [`impact-analysis.md`](impac
13
13
  - **minor** — every path the cycle changed is docs, tests, lint/format config, or CI config, exactly as the `NO_APP_LOGIC_CHANGE` rule in [`e2e-acceptance.md`](e2e-acceptance.md) defines them.
14
14
  - **full** — anything else, a comment-only or formatting-only edit in a source file included. The rule reads paths, not content, because a path rule is what the guardrail can verify.
15
15
 
16
+ `Change type` plays no part. A follow-up on a bug-fix PR is sized by the same rule and owes no new regression test or case: those belong to the forward cycle ([`build.md`](build.md)).
17
+
16
18
  An empty `cycleFiles` is neither size: the cycle changed nothing (every review was an answerable question), so it runs no tail — no unit run, no push, no declaration — and goes straight to the mode's replies.
17
19
 
18
20
  ## Rebase size
@@ -2,6 +2,7 @@
2
2
  mandatoryStages:
3
3
  - ../_shared/session-state-writes.md
4
4
  - respawn-watcher.md
5
+ - audit-trail.md
5
6
  - ../_shared/telemetry-events/muggle-do-cycle.md
6
7
  ---
7
8
 
@@ -118,6 +118,8 @@ The criteria are the acceptance criteria in the session's `requirements.md`, plu
118
118
  5. **Map every criterion.** A criterion's mapping follows its category's flow file ([`../_shared/deliverable-categories.md`](../_shared/deliverable-categories.md#category-flows)), never the category's name. A flow **Verified by** test cases gives the criterion `coveredBy` (impacted or new test cases that verify it); a flow **Verified by** a deliverable check gives it `verifiedBy` (the deliverable checks that verify it). Either may instead carry `unobservable` (why no check can observe it: a log line, a unit-test requirement, a config value). A criterion with none of the three is a scoping failure.
119
119
  6. **Plan the new cases.** Each uncovered criterion gets a new test case under the impacted use case its behavior belongs to, or under a new use case when none fits. A test case instruction names one atomic behavior to verify, with no signup, login, navigation, or seed-data steps, per [`../_shared/test-case-design.md`](../_shared/test-case-design.md); prerequisites come from the test-plan graph at run time ([`../_shared/test-case-chain-readiness.md`](../_shared/test-case-chain-readiness.md)).
120
120
 
121
+ A bug fix's regression criterion is uncovered unless an existing case's recorded run shows it failing on this bug. A case that passed while the bug was live never caught it: it stays impacted, and the criterion gets a new test case, so the fix ships with a case that guards it. A bug no browser run can reach keeps its category's mapping, a deliverable check or `unobservable`. A watcher cycle plans no second case: it keeps the one the forward cycle mapped.
122
+
121
123
  7. **Plan the deliverable checks.** One check per artifact that the criteria mapped to `verifiedBy` are about, keyed `DC1`, `DC2`, …: its category, the artifact and how it is obtained (committed path, or the build command), the probes with their expected values, and the criteria it verifies. A changed artifact that no criterion names is still checked when the diff touches it — the probes alone, with expected values from its base-branch version.
122
124
 
123
125
  This stage plans new cases and creates nothing. Stage 6 creates them, so a cycle that never reaches E2E leaves no cases behind in the project.
@@ -18,7 +18,7 @@ The sessions directory holds every chat's slots, so a selector drawn from the wh
18
18
 
19
19
  1. Read the session plan — the current session's TodoWrite list.
20
20
  2. **Pending items remain** → do not prompt. Append `next-step: plan has <N> pending — advancing` to `followup.log` and continue to the next pending item. The user set a course; honor it.
21
- 3. **No pending items** → print the [status block](#status-block), then ask the [selector](#selector) — with one `AskUserQuestion`, or as text while this chat still watches an open PR. The status block always comes first: a selector without it asks the user to decide blind.
21
+ 3. **No pending items** → print `terminalRecord`'s [audit trail](audit-trail.md), print the [status block](#status-block), then ask the [selector](#selector) — with one `AskUserQuestion`, or as text while this chat still watches an open PR. The status block always comes first: a selector without it asks the user to decide blind.
22
22
  4. Append the chosen outcome to `followup.log`.
23
23
 
24
24
  Both appends target `<slug>`'s `followup.log` and are skipped once teardown's report marks `Session slot cleared` ✅ — the log went with the slot, and an append would recreate the directory.
@@ -78,6 +78,8 @@ Runs once Stage 6 has recorded this change's verdict; a Stage 6 readiness halt n
78
78
 
79
79
  5. **Overflow comment:** if the walkthrough skill returned a non-null `comment`, post it once — `github` per [`../../_shared/vcs/github/top-level-comment.md`](../../_shared/vcs/github/top-level-comment.md), `gitlab` per [`../../_shared/vcs/gitlab/mr-note.md`](../../_shared/vcs/gitlab/mr-note.md). End the posted body with the signature line (command `/muggle-do`) per [`../../_shared/vcs/post-signature.md`](../../_shared/vcs/post-signature.md). Never post when `comment` is `null`.
80
80
 
81
+ 6. **Recurring run:** bug fixes only. A regression case guards the future only while something replays it, and the PR walkthrough check replays nothing. Look in the working tree for a scheduled pipeline that runs Muggle: a `schedule:` trigger in `.github/workflows/`, or a scheduled job in `.gitlab-ci.yml`. None found → call `muggle-remote-recommend-schedule` with the project id and put its options on the **Recurring run** output line, adding `/muggle-ci-install` when the repo lacks `muggle-walkthrough.yml`, [`autoInstallCiWorkflow`](../../muggle-preferences/preference-gates/autoInstallCiWorkflow.md) is not `never`, and `state.md` records no `CI check: skip`. This is an offer: nothing here asks, installs, or waits.
82
+
81
83
  ## Stage 7.5 gate
82
84
 
83
85
  The E2E repair loop ([`../e2e-repair.md`](../e2e-repair.md)) runs once Stage 7 has settled the walkthrough, and before the handoff below. Proceed only on its `green`, `waived`, or `decision-pending` clearance — handing a red run to a watcher with no decision asked puts it in front of reviewers with nobody looking at the failures. When Stage 6 recorded `PASS` or `SKIPPED` the loop clears in its own Step 0 at no cost, so there is never a reason to skip it.
@@ -106,11 +108,14 @@ If `prs.json` is empty, **do not arm** — record the reason in `result.md` and
106
108
 
107
109
  ## Output
108
110
 
111
+ The cycle's closing message opens with the [audit trail](../audit-trail.md), on every exit, a cycle that opened no PR included. These lines follow it:
112
+
109
113
  **Synced with base:** repo → `rebased onto <base> (<n> behind)` | `already up to date` | `skipped (autoRebase)`
110
114
  **PRs Created:** repo → URL
111
115
  **Skipped:** repo → reason (when `autoCreatePR` short-circuited)
112
116
  **Tested head:** repo → `already the PR head` | `force-pushed <short-sha> (Stage 6 synced onto a moved base)`
113
117
  **Overflow comments posted:** repo → PR #
118
+ **Recurring run:** `already scheduled` | `<recommended options>` (bug fixes only)
114
119
  **Stage 7.5:** `green` | `waived — <reason>` | `decision-pending`
115
120
  **Stage 8:** `Watching <N> PR(s) — one watch loop per PR, armed per arm-watcher.md` | `No PRs to watch — stage 8 not armed`
116
121
  **Errors:** repo → message
@@ -7,6 +7,7 @@ mandatoryStages:
7
7
  - e2e-acceptance.md
8
8
  - open-prs/forward.md
9
9
  - e2e-repair.md
10
+ - audit-trail.md
10
11
  ---
11
12
 
12
13
  # Pre-flight Agent (Stage 1)
@@ -24,6 +24,7 @@ You receive:
24
24
  2. **Extract the goal** — one clear sentence describing the outcome.
25
25
  3. **Extract acceptance criteria** — specific, verifiable conditions that must be true when the task is done. Each criterion should be independently testable. If the user's description is vague, infer reasonable criteria but flag them as inferred. Tag each criterion with its deliverable category per [`../_shared/deliverable-categories.md`](../_shared/deliverable-categories.md#tagging-a-criterion), splitting any criterion that spans two.
26
26
  4. **Identify which repos are likely affected** — based on the task description and the repo names provided.
27
+ 5. **Mark a bug fix.** A task that corrects wrong behavior is `Change type: bug fix`; anything else is `other`. A bug fix also gets a **regression criterion**: one acceptance criterion, tagged like the rest, saying what behavior proves this bug is gone. Stages 3 and 4 work from that line, and the [audit trail](audit-trail.md) shows it.
27
28
 
28
29
  ## Output
29
30
 
@@ -36,6 +37,10 @@ Write the findings to `~/.muggle-ai/muggle-do/sessions/<slug>/requirements.md`.
36
37
  - [<category>] (criterion 1)
37
38
  - [<category>] (criterion 2)
38
39
 
40
+ **Change type:** bug fix | other
41
+
42
+ **Regression criterion:** [<category>] (bug fixes only: the behavior that proves this bug is gone, also listed above)
43
+
39
44
  **Affected Repos:** (comma-separated list)
40
45
 
41
46
  **Notes:** (ambiguities and assumptions — optional)
@@ -2,6 +2,7 @@
2
2
  mandatoryStages:
3
3
  - ../_shared/session-state-writes.md
4
4
  - respawn-watcher.md
5
+ - audit-trail.md
5
6
  - ../_shared/telemetry-events/muggle-do-cycle.md
6
7
  ---
7
8
 
@@ -12,6 +12,8 @@ As the final action of the turn, settle the watch per [`../muggle-pr-followup/ar
12
12
 
13
13
  A cycle is not finished while its per-comment replies are unposted. A blocked reply — e.g. GitHub refuses with 422 while the reviewer's own pending review is open — escalates to the owner and holds this arming until the replies land. Never resume the watch over unposted replies.
14
14
 
15
+ Arm before you write anything closing. The cycle's closing message is the text after the watch is armed, and it opens with the [audit trail](audit-trail.md). Printing the block does not end the cycle: a cycle that printed it and never armed has stranded its PR.
16
+
15
17
  ## Recovery net
16
18
 
17
19
  This helper guarantees respawn on the paths that reach it, but a cycle that crashes or errors out *before* its exit path can still drop the respawn. [`../muggle-pr-followup/reconcile.md`](../muggle-pr-followup/reconcile.md) is the backstop: it re-arms any open slot whose watcher went silent (no tick within the staleness window), recovering a dropped respawn on the next sweep.
@@ -69,6 +69,10 @@ Before Stage 7 settles the PR's walkthrough:
69
69
 
70
70
  Opening a PR, or settling its walkthrough, with an unchecked, unwaived line of its gate is a cycle failure. A Stage 6 readiness halt ([`../do/e2e-acceptance.md`](../do/e2e-acceptance.md) Step 0.5) leaves the E2E line open: no skip code, waiver, or explicit request to open the PR closes it.
71
71
 
72
+ ### Audit trail
73
+
74
+ Every cycle's closing message opens with the fenced block [`../do/audit-trail.md`](../do/audit-trail.md) defines: the unit tests involved, the E2E tests with results, links to the evidence, and what is missing. A prose recap does not replace it. It reports and gates nothing, and it comes after the last action: the watcher arms first.
75
+
72
76
  ## Address-reviews flow
73
77
 
74
78
  When invoked with the directive (PR URL + slug + review ids), routes to [`../do/address-reviews.md`](../do/address-reviews.md). Shares stages 3–5 with the forward pipeline, then sizes the cycle from its diff per [`../do/cycle-size.md`](../do/cycle-size.md): a full cycle adds stage 6 and a fresh walkthrough, a minor one skips E2E under a verified `NO_APP_LOGIC_CHANGE`. Skips pre-flight, requirements, and PR creation. See the orchestrator for the cycle's exact step order, classification rules, and respawn logic.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release": "5.34.0-staging.311",
3
- "buildId": "run-311-1",
4
- "commitSha": "657421ecd1e5b13418a75d605c9becff9f254e8f",
5
- "buildTime": "2026-11-05T23:29:50Z",
2
+ "release": "5.34.0-staging.313",
3
+ "buildId": "run-313-1",
4
+ "commitSha": "918f7d52f135f7df3375d82a5b40621664b91347",
5
+ "buildTime": "2026-11-06T06:14:39Z",
6
6
  "serviceName": "muggle-ai-works-mcp"
7
7
  }
@@ -1 +1 @@
1
- export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_CHECKSUMS_ASSET_NAME, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-H47WQEDR.js';
1
+ export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_CHECKSUMS_ASSET_NAME, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-TAZURSYL.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@muggleai/works",
3
3
  "mcpName": "io.github.multiplex-ai/muggle",
4
- "version": "5.34.0-staging.311",
4
+ "version": "5.34.0-staging.313",
5
5
  "description": "13 years of Microsoft hyperscale engineering, packaged as a harness for your AI coding agent.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
4
- "version": "5.34.0-staging.311",
4
+ "version": "5.34.0-staging.313",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.34.0-staging.311",
7
+ "@muggleai/works@5.34.0-staging.313",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.34.0-staging.311",
3
+ "version": "5.34.0-staging.313",
4
4
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
5
- "version": "5.34.0-staging.311",
5
+ "version": "5.34.0-staging.313",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
package/plugin/.mcp.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.34.0-staging.311",
7
+ "@muggleai/works@5.34.0-staging.313",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  mandatoryStages:
3
3
  - respawn-watcher.md
4
+ - audit-trail.md
4
5
  - ../_shared/telemetry-events/muggle-do-cycle.md
5
6
  ---
6
7
 
@@ -0,0 +1,51 @@
1
+ # Audit trail
2
+
3
+ **Arm first.** If this cycle leaves a PR open and its watch is not armed yet, stop reading and arm it now ([`respawn-watcher.md`](respawn-watcher.md), or Stage 8 on a forward cycle). The block is written after the arm, never instead of it.
4
+
5
+ What a cycle shows the user before it ends: the tests the change involved, their results, and links to the proof. It reports and gates nothing. Anything missing is stated in the block, never a reason to stop, retry, or ask.
6
+
7
+ ## Where it prints
8
+
9
+ - **Forward cycle** — its closing message ([`open-prs/forward.md`](open-prs/forward.md#output)), whatever Stage 7.5 cleared.
10
+ - **Watcher cycle** — its closing message ([`respawn-watcher.md`](respawn-watcher.md)). A cycle that changed nothing prints nothing.
11
+ - **Terminal turn** — before the ending selector ([`next-step.md`](next-step.md)), from the record [`cleanup.md`](cleanup.md#terminal-record) captured before teardown.
12
+
13
+ The block goes in that message in full, ahead of everything else, because the closing message is what the user reads: a block printed earlier in the turn, or summarized, does not count. One block per PR, or one for the change when no PR opened. Terminal only: the PR keeps its own walkthrough.
14
+
15
+ ## Sources
16
+
17
+ - **Unit tests** — the tests the change added or changed, read from `git diff <base>...HEAD` on test paths, each with its name, file path and result from the latest unit run, then that run's overall result. A bug fix's regression test comes first, with `failed before, passed after` from Stage 3.
18
+ - **E2E tests** — every case in the latest E2E report, each with its title, result and `viewUrl`. A skipped run shows its skip code and detail.
19
+ - **Evidence** — the PR's walkthrough comment, then the `viewUrl` of each run. Deliverable checks point at the PR's `## Validation` section.
20
+ - **Regression** — a bug fix's regression criterion from `requirements.md`, the one line saying what the test proves.
21
+
22
+ ## Shape
23
+
24
+ ```
25
+ Audit trail — acme/widget#142
26
+
27
+ Regression: [web] A duplicate email shows the sign-in prompt instead of a blank page
28
+
29
+ Unit tests
30
+ PASS shows the sign-in prompt for a duplicate email — src/signup/signup.test.ts (failed before, passed after)
31
+ PASS keeps the entered email on error — src/signup/signup.test.ts
32
+ Run: pnpm test — PASS
33
+
34
+ E2E tests
35
+ PASS Duplicate sign-up prompts to sign in — https://app.example.com/runs/4f2a
36
+ FAIL Reset link reaches the inbox — https://app.example.com/runs/91c0
37
+
38
+ Evidence
39
+ Walkthrough: https://github.com/acme/widget/pull/142#issuecomment-2210
40
+ PR: https://github.com/acme/widget/pull/142
41
+
42
+ Missing: nothing
43
+ ```
44
+
45
+ ## Rules
46
+
47
+ - Print it as a fenced block with exactly these headings: `Audit trail — <pr>`, `Unit tests`, `E2E tests`, `Evidence`, `Missing:`. A prose recap in the closing message's own style is a summary, and does not count.
48
+ - Links, not ids. An id appears only beside its link.
49
+ - Every section prints. An empty one says why: `none — <reason>`. A section with nothing to show still names the gap on the `Missing` line, such as no test changed, no PR opened, or a run with no link.
50
+ - `Regression` prints for bug fixes only. A bug fix with no regression test or case says so under `Missing`.
51
+ - Results are the recorded ones, never inferred. A run that never happened is `not run`, not a pass.
@@ -18,6 +18,7 @@ Implement the code change for this dev cycle. Read the frozen requirements from
18
18
  For each affected repo:
19
19
 
20
20
  1. **Re-read `requirements.md`.** Treat goal + AC as frozen. If something is unclear at this stage, that's a pre-flight bug — escalate, do not improvise.
21
+ 1.5. **Prove a bug fix first.** When `requirements.md` says `Change type: bug fix`, write a unit test for its regression criterion before touching the fix and run it: it must fail, for the bug's reason. Apply the fix, then run it again: it must pass. This stage's marker records the criterion, the test's file path, and `failed before, passed after`. A bug no unit test can reach is waived in `state.md` with the reason. The re-entries below owe no new regression test: they carry review comments and defects the change itself introduced.
21
22
  2. **Apply the change** in the repo's worktree. Edit existing files first; create new files only when the requirements demand it. Match the surrounding code's style, naming, and file layout.
22
23
  3. **Don't add what wasn't asked for.** No speculative abstractions, no extra logging, no "while I'm here" refactors. Three similar lines is better than a premature abstraction.
23
24
  4. **Cover new logic with tests.** If you added or changed non-trivial logic (a hook, reducer, parser, state machine, branching util), write its unit tests now — Stage 5 only *runs* the suite, it never authors tests. Untested new logic is a Definition-of-Done failure, not a Stage-5 gap.
@@ -43,6 +44,7 @@ Per repo:
43
44
  - Files edited / created: list
44
45
  - Commit subject: `<conventional commit>`
45
46
  - Notable choices: anything that needed a judgment call (briefly)
47
+ - Regression test: `<file path>` — failed before, passed after (bug fixes only)
46
48
 
47
49
  **Overall:** READY for impact analysis | BLOCKED — reason
48
50
 
@@ -16,6 +16,7 @@ The facts [`next-step.md`](next-step.md) reports a finished PR from. Teardown de
16
16
  - `e2eFailing` — the title carries `[E2E FAILING]`: the PR shipped on a waived or still-undecided E2E verdict.
17
17
  - `escalatedReviewIds` — `result.md`'s `Escalated review ids`; empty on `none` or when `result.md` is absent.
18
18
  - `waivers` — `state.md`'s waiver and Blocker lines and any open `## E2E decision` block, verbatim.
19
+ - `auditTrail` — the [audit trail](audit-trail.md) for this PR, rendered from the slot's `iterations/` and `requirements.md` while they still exist. A slot without them renders the gaps under `Missing`.
19
20
  - `teardown` — the note next-step prints, from this turn's teardown report: `cleaned up` when no row is `❌`, the first `❌` row's reason otherwise, `branch kept` when teardown did not run.
20
21
  - `finishedAt` — ISO-8601, when step 6 ran.
21
22
 
@@ -13,6 +13,8 @@ Once the cycle's edits are in the working tree, run [`impact-analysis.md`](impac
13
13
  - **minor** — every path the cycle changed is docs, tests, lint/format config, or CI config, exactly as the `NO_APP_LOGIC_CHANGE` rule in [`e2e-acceptance.md`](e2e-acceptance.md) defines them.
14
14
  - **full** — anything else, a comment-only or formatting-only edit in a source file included. The rule reads paths, not content, because a path rule is what the guardrail can verify.
15
15
 
16
+ `Change type` plays no part. A follow-up on a bug-fix PR is sized by the same rule and owes no new regression test or case: those belong to the forward cycle ([`build.md`](build.md)).
17
+
16
18
  An empty `cycleFiles` is neither size: the cycle changed nothing (every review was an answerable question), so it runs no tail — no unit run, no push, no declaration — and goes straight to the mode's replies.
17
19
 
18
20
  ## Rebase size
@@ -2,6 +2,7 @@
2
2
  mandatoryStages:
3
3
  - ../_shared/session-state-writes.md
4
4
  - respawn-watcher.md
5
+ - audit-trail.md
5
6
  - ../_shared/telemetry-events/muggle-do-cycle.md
6
7
  ---
7
8
 
@@ -118,6 +118,8 @@ The criteria are the acceptance criteria in the session's `requirements.md`, plu
118
118
  5. **Map every criterion.** A criterion's mapping follows its category's flow file ([`../_shared/deliverable-categories.md`](../_shared/deliverable-categories.md#category-flows)), never the category's name. A flow **Verified by** test cases gives the criterion `coveredBy` (impacted or new test cases that verify it); a flow **Verified by** a deliverable check gives it `verifiedBy` (the deliverable checks that verify it). Either may instead carry `unobservable` (why no check can observe it: a log line, a unit-test requirement, a config value). A criterion with none of the three is a scoping failure.
119
119
  6. **Plan the new cases.** Each uncovered criterion gets a new test case under the impacted use case its behavior belongs to, or under a new use case when none fits. A test case instruction names one atomic behavior to verify, with no signup, login, navigation, or seed-data steps, per [`../_shared/test-case-design.md`](../_shared/test-case-design.md); prerequisites come from the test-plan graph at run time ([`../_shared/test-case-chain-readiness.md`](../_shared/test-case-chain-readiness.md)).
120
120
 
121
+ A bug fix's regression criterion is uncovered unless an existing case's recorded run shows it failing on this bug. A case that passed while the bug was live never caught it: it stays impacted, and the criterion gets a new test case, so the fix ships with a case that guards it. A bug no browser run can reach keeps its category's mapping, a deliverable check or `unobservable`. A watcher cycle plans no second case: it keeps the one the forward cycle mapped.
122
+
121
123
  7. **Plan the deliverable checks.** One check per artifact that the criteria mapped to `verifiedBy` are about, keyed `DC1`, `DC2`, …: its category, the artifact and how it is obtained (committed path, or the build command), the probes with their expected values, and the criteria it verifies. A changed artifact that no criterion names is still checked when the diff touches it — the probes alone, with expected values from its base-branch version.
122
124
 
123
125
  This stage plans new cases and creates nothing. Stage 6 creates them, so a cycle that never reaches E2E leaves no cases behind in the project.
@@ -18,7 +18,7 @@ The sessions directory holds every chat's slots, so a selector drawn from the wh
18
18
 
19
19
  1. Read the session plan — the current session's TodoWrite list.
20
20
  2. **Pending items remain** → do not prompt. Append `next-step: plan has <N> pending — advancing` to `followup.log` and continue to the next pending item. The user set a course; honor it.
21
- 3. **No pending items** → print the [status block](#status-block), then ask the [selector](#selector) — with one `AskUserQuestion`, or as text while this chat still watches an open PR. The status block always comes first: a selector without it asks the user to decide blind.
21
+ 3. **No pending items** → print `terminalRecord`'s [audit trail](audit-trail.md), print the [status block](#status-block), then ask the [selector](#selector) — with one `AskUserQuestion`, or as text while this chat still watches an open PR. The status block always comes first: a selector without it asks the user to decide blind.
22
22
  4. Append the chosen outcome to `followup.log`.
23
23
 
24
24
  Both appends target `<slug>`'s `followup.log` and are skipped once teardown's report marks `Session slot cleared` ✅ — the log went with the slot, and an append would recreate the directory.
@@ -78,6 +78,8 @@ Runs once Stage 6 has recorded this change's verdict; a Stage 6 readiness halt n
78
78
 
79
79
  5. **Overflow comment:** if the walkthrough skill returned a non-null `comment`, post it once — `github` per [`../../_shared/vcs/github/top-level-comment.md`](../../_shared/vcs/github/top-level-comment.md), `gitlab` per [`../../_shared/vcs/gitlab/mr-note.md`](../../_shared/vcs/gitlab/mr-note.md). End the posted body with the signature line (command `/muggle-do`) per [`../../_shared/vcs/post-signature.md`](../../_shared/vcs/post-signature.md). Never post when `comment` is `null`.
80
80
 
81
+ 6. **Recurring run:** bug fixes only. A regression case guards the future only while something replays it, and the PR walkthrough check replays nothing. Look in the working tree for a scheduled pipeline that runs Muggle: a `schedule:` trigger in `.github/workflows/`, or a scheduled job in `.gitlab-ci.yml`. None found → call `muggle-remote-recommend-schedule` with the project id and put its options on the **Recurring run** output line, adding `/muggle-ci-install` when the repo lacks `muggle-walkthrough.yml`, [`autoInstallCiWorkflow`](../../muggle-preferences/preference-gates/autoInstallCiWorkflow.md) is not `never`, and `state.md` records no `CI check: skip`. This is an offer: nothing here asks, installs, or waits.
82
+
81
83
  ## Stage 7.5 gate
82
84
 
83
85
  The E2E repair loop ([`../e2e-repair.md`](../e2e-repair.md)) runs once Stage 7 has settled the walkthrough, and before the handoff below. Proceed only on its `green`, `waived`, or `decision-pending` clearance — handing a red run to a watcher with no decision asked puts it in front of reviewers with nobody looking at the failures. When Stage 6 recorded `PASS` or `SKIPPED` the loop clears in its own Step 0 at no cost, so there is never a reason to skip it.
@@ -106,11 +108,14 @@ If `prs.json` is empty, **do not arm** — record the reason in `result.md` and
106
108
 
107
109
  ## Output
108
110
 
111
+ The cycle's closing message opens with the [audit trail](../audit-trail.md), on every exit, a cycle that opened no PR included. These lines follow it:
112
+
109
113
  **Synced with base:** repo → `rebased onto <base> (<n> behind)` | `already up to date` | `skipped (autoRebase)`
110
114
  **PRs Created:** repo → URL
111
115
  **Skipped:** repo → reason (when `autoCreatePR` short-circuited)
112
116
  **Tested head:** repo → `already the PR head` | `force-pushed <short-sha> (Stage 6 synced onto a moved base)`
113
117
  **Overflow comments posted:** repo → PR #
118
+ **Recurring run:** `already scheduled` | `<recommended options>` (bug fixes only)
114
119
  **Stage 7.5:** `green` | `waived — <reason>` | `decision-pending`
115
120
  **Stage 8:** `Watching <N> PR(s) — one watch loop per PR, armed per arm-watcher.md` | `No PRs to watch — stage 8 not armed`
116
121
  **Errors:** repo → message
@@ -7,6 +7,7 @@ mandatoryStages:
7
7
  - e2e-acceptance.md
8
8
  - open-prs/forward.md
9
9
  - e2e-repair.md
10
+ - audit-trail.md
10
11
  ---
11
12
 
12
13
  # Pre-flight Agent (Stage 1)
@@ -24,6 +24,7 @@ You receive:
24
24
  2. **Extract the goal** — one clear sentence describing the outcome.
25
25
  3. **Extract acceptance criteria** — specific, verifiable conditions that must be true when the task is done. Each criterion should be independently testable. If the user's description is vague, infer reasonable criteria but flag them as inferred. Tag each criterion with its deliverable category per [`../_shared/deliverable-categories.md`](../_shared/deliverable-categories.md#tagging-a-criterion), splitting any criterion that spans two.
26
26
  4. **Identify which repos are likely affected** — based on the task description and the repo names provided.
27
+ 5. **Mark a bug fix.** A task that corrects wrong behavior is `Change type: bug fix`; anything else is `other`. A bug fix also gets a **regression criterion**: one acceptance criterion, tagged like the rest, saying what behavior proves this bug is gone. Stages 3 and 4 work from that line, and the [audit trail](audit-trail.md) shows it.
27
28
 
28
29
  ## Output
29
30
 
@@ -36,6 +37,10 @@ Write the findings to `~/.muggle-ai/muggle-do/sessions/<slug>/requirements.md`.
36
37
  - [<category>] (criterion 1)
37
38
  - [<category>] (criterion 2)
38
39
 
40
+ **Change type:** bug fix | other
41
+
42
+ **Regression criterion:** [<category>] (bug fixes only: the behavior that proves this bug is gone, also listed above)
43
+
39
44
  **Affected Repos:** (comma-separated list)
40
45
 
41
46
  **Notes:** (ambiguities and assumptions — optional)
@@ -2,6 +2,7 @@
2
2
  mandatoryStages:
3
3
  - ../_shared/session-state-writes.md
4
4
  - respawn-watcher.md
5
+ - audit-trail.md
5
6
  - ../_shared/telemetry-events/muggle-do-cycle.md
6
7
  ---
7
8
 
@@ -12,6 +12,8 @@ As the final action of the turn, settle the watch per [`../muggle-pr-followup/ar
12
12
 
13
13
  A cycle is not finished while its per-comment replies are unposted. A blocked reply — e.g. GitHub refuses with 422 while the reviewer's own pending review is open — escalates to the owner and holds this arming until the replies land. Never resume the watch over unposted replies.
14
14
 
15
+ Arm before you write anything closing. The cycle's closing message is the text after the watch is armed, and it opens with the [audit trail](audit-trail.md). Printing the block does not end the cycle: a cycle that printed it and never armed has stranded its PR.
16
+
15
17
  ## Recovery net
16
18
 
17
19
  This helper guarantees respawn on the paths that reach it, but a cycle that crashes or errors out *before* its exit path can still drop the respawn. [`../muggle-pr-followup/reconcile.md`](../muggle-pr-followup/reconcile.md) is the backstop: it re-arms any open slot whose watcher went silent (no tick within the staleness window), recovering a dropped respawn on the next sweep.
@@ -69,6 +69,10 @@ Before Stage 7 settles the PR's walkthrough:
69
69
 
70
70
  Opening a PR, or settling its walkthrough, with an unchecked, unwaived line of its gate is a cycle failure. A Stage 6 readiness halt ([`../do/e2e-acceptance.md`](../do/e2e-acceptance.md) Step 0.5) leaves the E2E line open: no skip code, waiver, or explicit request to open the PR closes it.
71
71
 
72
+ ### Audit trail
73
+
74
+ Every cycle's closing message opens with the fenced block [`../do/audit-trail.md`](../do/audit-trail.md) defines: the unit tests involved, the E2E tests with results, links to the evidence, and what is missing. A prose recap does not replace it. It reports and gates nothing, and it comes after the last action: the watcher arms first.
75
+
72
76
  ## Address-reviews flow
73
77
 
74
78
  When invoked with the directive (PR URL + slug + review ids), routes to [`../do/address-reviews.md`](../do/address-reviews.md). Shares stages 3–5 with the forward pipeline, then sizes the cycle from its diff per [`../do/cycle-size.md`](../do/cycle-size.md): a full cycle adds stage 6 and a fresh walkthrough, a minor one skips E2E under a verified `NO_APP_LOGIC_CHANGE`. Skips pre-flight, requirements, and PR creation. See the orchestrator for the cycle's exact step order, classification rules, and respawn logic.