@muggleai/works 5.34.0-staging.310 → 5.34.0-staging.312

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 (47) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/{chunk-TVA5J73U.js → chunk-7Y3PHHOL.js} +107 -40
  3. package/dist/{chunk-SMUHQITB.js → chunk-H47WQEDR.js} +4 -4
  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 +1 -0
  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
  47. package/dist/src-5M2MYBRC.js +0 -1
@@ -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.310"
12
+ "version": "5.34.0-staging.312"
13
13
  }
14
14
  ]
15
15
  }
@@ -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, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-SMUHQITB.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-H47WQEDR.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-5M2MYBRC.js');
1259
+ const mcps = await import('./src-5BGECNR4.js');
1260
1260
  const credentials = await mcps.getCallerCredentialsAsync();
1261
1261
  if (!credentials.bearerToken && !credentials.apiKey) {
1262
1262
  stderrWrite(
@@ -4797,8 +4797,95 @@ function seconds(ms) {
4797
4797
  function minutes(ms) {
4798
4798
  return `${Math.max(0, Math.round(ms / 6e4))}m`;
4799
4799
  }
4800
- var logger7 = getLogger();
4800
+
4801
+ // src/cli/studio-release/constants.ts
4801
4802
  var GITHUB_RELEASES_API = "https://api.github.com/repos/multiplex-ai/muggle-ai-works/releases?per_page=100";
4803
+ var GITHUB_RELEASES_API_HEADERS = {
4804
+ "Accept": "application/vnd.github.v3+json",
4805
+ "User-Agent": "muggle"
4806
+ };
4807
+ var PAGINATION_LINK_HEADER = "link";
4808
+ var NEXT_PAGE_LINK_PATTERN = /<([^>]+)>;\s*rel="next"/;
4809
+ var MAX_RELEASE_LIST_PAGES = 50;
4810
+
4811
+ // src/cli/studio-release/newest-release.ts
4812
+ function extractVersionFromTag(tag, releaseTagPrefix) {
4813
+ if (!tag.startsWith(releaseTagPrefix)) {
4814
+ return null;
4815
+ }
4816
+ const match = tag.slice(releaseTagPrefix.length).match(/^(\d+\.\d+\.\d+)$/);
4817
+ return match ? match[1] : null;
4818
+ }
4819
+ function listRequiredAssetNames(params) {
4820
+ const requiredAssetNames = [params.platformArchiveName, ELECTRON_APP_CHECKSUMS_ASSET_NAME];
4821
+ const integrityPolicy = resolveIntegrityPolicy({
4822
+ version: params.version,
4823
+ signedFromVersion: params.signedFromVersion,
4824
+ expectedChecksum: ""
4825
+ });
4826
+ if (integrityPolicy.requiresSignature) {
4827
+ requiredAssetNames.push(params.platformArchiveName + SIGNATURE_BUNDLE_SUFFIX);
4828
+ }
4829
+ return requiredAssetNames;
4830
+ }
4831
+ function hasEveryRequiredAsset(params) {
4832
+ const uploadedAssetNames = new Set(
4833
+ params.release.assets.filter((asset) => asset.state === "uploaded" /* Uploaded */).map((asset) => asset.name)
4834
+ );
4835
+ return params.requiredAssetNames.every((assetName) => uploadedAssetNames.has(assetName));
4836
+ }
4837
+ function selectNewestInstallableVersion(params) {
4838
+ let newestVersion = null;
4839
+ for (const release of params.releases) {
4840
+ if (release.draft) {
4841
+ continue;
4842
+ }
4843
+ const version = extractVersionFromTag(release.tag_name, params.releaseTagPrefix);
4844
+ if (!version || newestVersion && compareVersions2(version, newestVersion) <= 0) {
4845
+ continue;
4846
+ }
4847
+ const requiredAssetNames = listRequiredAssetNames({
4848
+ version,
4849
+ platformArchiveName: params.platformArchiveName,
4850
+ signedFromVersion: params.signedFromVersion
4851
+ });
4852
+ if (hasEveryRequiredAsset({ release, requiredAssetNames })) {
4853
+ newestVersion = version;
4854
+ }
4855
+ }
4856
+ return newestVersion;
4857
+ }
4858
+ function parseNextPageUrl(linkHeader) {
4859
+ const nextPageMatch = linkHeader?.match(NEXT_PAGE_LINK_PATTERN);
4860
+ return nextPageMatch ? nextPageMatch[1] : null;
4861
+ }
4862
+ async function fetchStudioReleases() {
4863
+ const releases = [];
4864
+ let pageUrl = GITHUB_RELEASES_API;
4865
+ for (let pagesRead = 0; pageUrl; pagesRead++) {
4866
+ if (pagesRead === MAX_RELEASE_LIST_PAGES) {
4867
+ throw new Error(`The release list runs past ${MAX_RELEASE_LIST_PAGES} pages.`);
4868
+ }
4869
+ const response = await fetch(pageUrl, { headers: GITHUB_RELEASES_API_HEADERS });
4870
+ if (!response.ok) {
4871
+ throw new Error(`GitHub API error: ${response.status} ${response.statusText}`);
4872
+ }
4873
+ releases.push(...await response.json());
4874
+ pageUrl = parseNextPageUrl(response.headers.get(PAGINATION_LINK_HEADER));
4875
+ }
4876
+ return releases;
4877
+ }
4878
+ async function resolveNewestInstallableVersion(requirements) {
4879
+ return selectNewestInstallableVersion({
4880
+ releases: await fetchStudioReleases(),
4881
+ releaseTagPrefix: requirements.releaseTagPrefix,
4882
+ platformArchiveName: requirements.platformArchiveName,
4883
+ signedFromVersion: requirements.signedFromVersion
4884
+ });
4885
+ }
4886
+
4887
+ // src/cli/upgrade.ts
4888
+ var logger7 = getLogger();
4802
4889
  var INSTALL_METADATA_FILE_NAME2 = ".install-metadata.json";
4803
4890
  var VERSION_OVERRIDE_FILE = "electron-app-version-override.json";
4804
4891
  function getBinaryName2() {
@@ -4815,13 +4902,6 @@ function getBinaryName2() {
4815
4902
  throw new Error(`Unsupported platform: ${os}`);
4816
4903
  }
4817
4904
  }
4818
- function extractVersionFromTag(tag, releaseTagPrefix) {
4819
- if (!tag.startsWith(releaseTagPrefix)) {
4820
- return null;
4821
- }
4822
- const match = tag.slice(releaseTagPrefix.length).match(/^(\d+\.\d+\.\d+)$/);
4823
- return match ? match[1] : null;
4824
- }
4825
4905
  function getVersionOverridePath() {
4826
4906
  return path.join(getDataDir2(), VERSION_OVERRIDE_FILE);
4827
4907
  }
@@ -4852,40 +4932,27 @@ function saveVersionOverride(version) {
4852
4932
  async function checkForUpdates() {
4853
4933
  const currentVersion = getEffectiveElectronAppVersion();
4854
4934
  try {
4855
- const response = await fetch(GITHUB_RELEASES_API, {
4856
- headers: {
4857
- "Accept": "application/vnd.github.v3+json",
4858
- "User-Agent": "muggle"
4859
- }
4935
+ const binaryName = getBinaryName2();
4936
+ const newestVersion = await resolveNewestInstallableVersion({
4937
+ releaseTagPrefix: getElectronAppReleaseTagPrefix(),
4938
+ platformArchiveName: binaryName,
4939
+ signedFromVersion: getElectronAppSignedFromVersion()
4860
4940
  });
4861
- if (!response.ok) {
4862
- throw new Error(`GitHub API error: ${response.status} ${response.statusText}`);
4863
- }
4864
- const releases = await response.json();
4865
- const releaseTagPrefix = getElectronAppReleaseTagPrefix();
4866
- for (const release of releases) {
4867
- if (release.draft) {
4868
- continue;
4869
- }
4870
- const version = extractVersionFromTag(release.tag_name, releaseTagPrefix);
4871
- if (version) {
4872
- const updateAvailable = compareVersions2(version, currentVersion) > 0;
4873
- const binaryName = getBinaryName2();
4874
- return {
4875
- currentVersion,
4876
- latestVersion: version,
4877
- updateAvailable,
4878
- downloadUrl: buildElectronAppReleaseAssetUrl({
4879
- version,
4880
- assetFileName: binaryName
4881
- })
4882
- };
4883
- }
4941
+ if (!newestVersion) {
4942
+ return {
4943
+ currentVersion,
4944
+ latestVersion: currentVersion,
4945
+ updateAvailable: false
4946
+ };
4884
4947
  }
4885
4948
  return {
4886
4949
  currentVersion,
4887
- latestVersion: currentVersion,
4888
- updateAvailable: false
4950
+ latestVersion: newestVersion,
4951
+ updateAvailable: compareVersions2(newestVersion, currentVersion) > 0,
4952
+ downloadUrl: buildElectronAppReleaseAssetUrl({
4953
+ version: newestVersion,
4954
+ assetFileName: binaryName
4955
+ })
4889
4956
  };
4890
4957
  } catch (error) {
4891
4958
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -44,6 +44,7 @@ __export(src_exports, {
44
44
  ClaudeCodeReadiness: () => ClaudeCodeReadiness,
45
45
  DEFAULT_LOCAL_LLM_BASE_URL: () => DEFAULT_LOCAL_LLM_BASE_URL,
46
46
  DEFAULT_PREFERENCES: () => DEFAULT_PREFERENCES,
47
+ ELECTRON_APP_CHECKSUMS_ASSET_NAME: () => ELECTRON_APP_CHECKSUMS_ASSET_NAME,
47
48
  ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS: () => ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS,
48
49
  ELECTRON_APP_RESOURCES_PATH_SEGMENTS: () => ELECTRON_APP_RESOURCES_PATH_SEGMENTS,
49
50
  ElectronAppPlatform: () => ElectronAppPlatform,
@@ -350,8 +351,7 @@ var ELECTRON_APP_RESOURCES_PATH_SEGMENTS = {
350
351
  ["win32" /* Win32 */]: ["resources"],
351
352
  ["linux" /* Linux */]: ["resources"]
352
353
  };
353
-
354
- // packages/mcps/src/shared/electron-app-executable.ts
354
+ var ELECTRON_APP_CHECKSUMS_ASSET_NAME = "checksums.txt";
355
355
  function isElectronAppPlatform(platformName) {
356
356
  return Object.values(ElectronAppPlatform).includes(platformName);
357
357
  }
@@ -731,7 +731,7 @@ function buildElectronAppReleaseAssetUrl(params) {
731
731
  return `${getDownloadBaseUrl()}/${buildElectronAppReleaseTag(params.version)}/${params.assetFileName}`;
732
732
  }
733
733
  function buildElectronAppChecksumsUrl(version) {
734
- return `${getDownloadBaseUrl()}/${buildElectronAppReleaseTag(version)}/checksums.txt`;
734
+ return `${getDownloadBaseUrl()}/${buildElectronAppReleaseTag(version)}/${ELECTRON_APP_CHECKSUMS_ASSET_NAME}`;
735
735
  }
736
736
  function getElectronAppChecksums() {
737
737
  return getMuggleConfig().checksumsByStream?.[getActiveElectronAppReleaseStream()];
@@ -11898,4 +11898,4 @@ function applyLlmSourceSelection(selection, dataDirOverride2) {
11898
11898
  return resolveLlmSourceStatus(dataDirOverride2);
11899
11899
  }
11900
11900
 
11901
- 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_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, EventName, 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, ServiceName, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, Surface, TelemetryEnvironment, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, __export, __require, 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_exports2 as e2e_exports, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir, getDataDir2, getDisclosureCopy, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, hasShownDisclosure, initTelemetry, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports2 as local_exports, lookUpCheckoutPullRequest, markDisclosureShown, markOnboardingCompleted, maskLlmApiKey, mcp_exports, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, 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, src_exports, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, track, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml };
11901
+ 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, EventName, 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, ServiceName, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, Surface, TelemetryEnvironment, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, __export, __require, 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_exports2 as e2e_exports, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir, getDataDir2, getDisclosureCopy, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, hasShownDisclosure, initTelemetry, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports2 as local_exports, lookUpCheckoutPullRequest, markDisclosureShown, markOnboardingCompleted, maskLlmApiKey, mcp_exports, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, 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, src_exports, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, track, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml };
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-TVA5J73U.js';
3
- import './chunk-SMUHQITB.js';
2
+ import { runCli } from './chunk-7Y3PHHOL.js';
3
+ import './chunk-H47WQEDR.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-TVA5J73U.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-SMUHQITB.js';
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,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.310",
4
+ "version": "5.34.0-staging.312",
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.310",
7
+ "@muggleai/works@5.34.0-staging.312",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.34.0-staging.310",
3
+ "version": "5.34.0-staging.312",
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.310",
5
+ "version": "5.34.0-staging.312",
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.310",
7
+ "@muggleai/works@5.34.0-staging.312",
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.310",
3
- "buildId": "run-310-1",
4
- "commitSha": "8357ccb201eb2959719b07ba87cedd1967b3bee4",
5
- "buildTime": "2026-11-05T22:51:37Z",
2
+ "release": "5.34.0-staging.312",
3
+ "buildId": "run-312-1",
4
+ "commitSha": "f65b61bb4dcf14ae38534b7527e4c1f774da9509",
5
+ "buildTime": "2026-11-05T23:35:58Z",
6
6
  "serviceName": "muggle-ai-works-mcp"
7
7
  }
@@ -0,0 +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';
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.310",
4
+ "version": "5.34.0-staging.312",
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.310",
4
+ "version": "5.34.0-staging.312",
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.310",
7
+ "@muggleai/works@5.34.0-staging.312",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.34.0-staging.310",
3
+ "version": "5.34.0-staging.312",
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.310",
5
+ "version": "5.34.0-staging.312",
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.310",
7
+ "@muggleai/works@5.34.0-staging.312",
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 +0,0 @@
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_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-SMUHQITB.js';