projectops 4.104.5 → 4.104.7

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 (85) hide show
  1. package/README.md +1 -1
  2. package/bin/projectops.js +4 -4
  3. package/package.json +1 -1
  4. package/src/cli/args.js +43 -43
  5. package/src/cli/errors.js +8 -8
  6. package/src/cli/help.js +4 -4
  7. package/src/commands/doctor.js +39 -39
  8. package/src/commands/full.js +29 -29
  9. package/src/commands/interactive.js +86 -86
  10. package/src/commands/issues.js +5 -5
  11. package/src/commands/skills.js +13 -13
  12. package/src/commands/version.js +8 -8
  13. package/src/commands/workflows.js +19 -19
  14. package/src/context.js +24 -24
  15. package/src/core/agent-guide.js +5 -5
  16. package/src/core/assets.js +11 -11
  17. package/src/core/baseline.js +24 -24
  18. package/src/core/branch-sub.js +23 -23
  19. package/src/core/breaking-check.js +21 -21
  20. package/src/core/breaking.js +6 -6
  21. package/src/core/ci-minutes-sub.js +13 -13
  22. package/src/core/constants.js +17 -17
  23. package/src/core/copy/coderabbit.js +10 -10
  24. package/src/core/copy/gitignore.js +9 -9
  25. package/src/core/copy/readme.js +7 -7
  26. package/src/core/copy/simple.js +35 -35
  27. package/src/core/copy/util.js +9 -9
  28. package/src/core/copy/workflows.js +99 -99
  29. package/src/core/detect-fs.js +21 -21
  30. package/src/core/detect.js +12 -12
  31. package/src/core/development-branch.js +11 -11
  32. package/src/core/exclusions.js +12 -12
  33. package/src/core/fsutil.js +9 -9
  34. package/src/core/git-branch.js +11 -11
  35. package/src/core/ide/adapter.js +23 -23
  36. package/src/core/ide/adapters/claude.js +12 -12
  37. package/src/core/ide/adapters/codex.js +4 -4
  38. package/src/core/ide/adapters/copilot.js +12 -12
  39. package/src/core/ide/adapters/cursor.js +7 -7
  40. package/src/core/ide/adapters/gemini.js +5 -5
  41. package/src/core/ide/adapters/pi-common.js +12 -12
  42. package/src/core/ide/adapters/pi-harness.js +7 -7
  43. package/src/core/ide/adapters/pi.js +3 -3
  44. package/src/core/ide/home-skills.js +6 -6
  45. package/src/core/ide/legacy.js +8 -8
  46. package/src/core/ide/registry.js +6 -6
  47. package/src/core/ide/runner.js +15 -15
  48. package/src/core/ide/skills-copy.js +34 -34
  49. package/src/core/ide/stable-entry.js +11 -11
  50. package/src/core/ide/util.js +4 -4
  51. package/src/core/incoming.js +13 -13
  52. package/src/core/label-style.js +12 -12
  53. package/src/core/migration-guide.js +19 -19
  54. package/src/core/migrations/index.js +16 -16
  55. package/src/core/migrations/registry.js +39 -39
  56. package/src/core/migrations/rules/legacy-dirs.js +6 -6
  57. package/src/core/migrations/rules/obsolete-workflows.js +4 -4
  58. package/src/core/migrations/rules/root-files.js +3 -3
  59. package/src/core/migrations/rules/settings-extractors.js +8 -8
  60. package/src/core/options-ask.js +104 -104
  61. package/src/core/options-schema.js +23 -23
  62. package/src/core/orphan-workflows.js +14 -14
  63. package/src/core/paths-resolve.js +54 -54
  64. package/src/core/paths.js +2 -2
  65. package/src/core/placeholder-triggers.js +10 -10
  66. package/src/core/repo-language.js +10 -10
  67. package/src/core/resolve-options.js +30 -30
  68. package/src/core/run-trace.js +54 -54
  69. package/src/core/store-locales-hint.js +13 -13
  70. package/src/core/verify.js +27 -27
  71. package/src/core/version-yml.js +115 -115
  72. package/src/core/wizard-env.js +42 -42
  73. package/src/core/wizard-labels.js +31 -31
  74. package/src/core/workflow-groups.js +14 -14
  75. package/src/i18n/core.en.js +1 -1
  76. package/src/i18n/doctor.en.js +1 -1
  77. package/src/i18n/ide.en.js +1 -1
  78. package/src/i18n/migrate.en.js +1 -1
  79. package/src/i18n/options.en.js +1 -1
  80. package/src/index.js +60 -60
  81. package/src/ui/ansi.js +5 -5
  82. package/src/ui/env-plan.js +44 -44
  83. package/src/ui/prompts.js +21 -21
  84. package/src/ui/readline-engine.js +38 -38
  85. package/src/ui/skills-prompts.js +4 -4
@@ -1,10 +1,10 @@
1
- // 설치 옵션 값을 정하는 단 한 곳 (#851).
1
+ // The single place that decides install option values (#851).
2
2
  //
3
- // 비대화형(src/index.js)과 대화형(src/commands/interactive.js)이 같은 결과를 쓴다.
4
- // 각자 정하면 규칙이 갈라진다: 대화형 PR 요약 선택 유실(aiPrSummary),
5
- // 질문을 건너뛰는 version 모드가 모바일 단독 레포에 deploy: docker-ssh 를 남김.
6
- // 규칙은 모든 옵션에 같다: CLI 플래그 > version.yml 저장값 > 기본값.
7
- // 대화형은 이 결과를 초기값으로 쓰고, 사용자가 답한 것만 그 위에 덮어쓴다.
3
+ // Non-interactive (src/index.js) and interactive (src/commands/interactive.js) use the same result.
4
+ // Deciding separately splits the rules: the interactive PR summary choice was lost (aiPrSummary),
5
+ // and version mode, which skips questions, left deploy: docker-ssh in mobile-only repos.
6
+ // The rule is the same for every option: CLI flag > saved version.yml value > default.
7
+ // Interactive uses this result as initial values and overwrites only what the user answered.
8
8
  import { existsSync } from "node:fs";
9
9
  import { join } from "node:path";
10
10
  import { applicableTargets, migrateProvider } from "./options-ask.js";
@@ -12,11 +12,11 @@ import { DEFAULT_CODE_REVIEW_CODERABBIT } from "./constants.js";
12
12
  import { resolveLabelStyle } from "./label-style.js";
13
13
  import { resolveRepoLanguage } from "./repo-language.js";
14
14
 
15
- // 이미 설치돼 있으면 Projects 동기화를 켜진 것으로 보는 기준 파일 (#716)
15
+ // File that marks Projects sync as on when already installed (#716)
16
16
  export const PROJECTS_SYNC_WORKFLOW = ".github/workflows/PROJECT-COMMON-PROJECTS-SYNC-MANAGER.yaml";
17
17
 
18
- // 타입에 성립하지 않는 축 값을 정리한다 (#498). 모바일 앱·basic 단독은 두 축이 모두 비어
19
- // intent 도 none 으로 확정된다. 질문을 거친 값에도 같은 규칙을 다시 적용할 수 있게 따로 둔다.
18
+ // Clean up axis values that do not apply to the type (#498). Mobile app or basic alone leaves both axes empty
19
+ // and intent settles as none. Kept separate so the same rule can be reapplied to values from questions.
20
20
  export function normalizeAxes({ deploy, publish, intent, types }) {
21
21
  const applicable = applicableTargets(types);
22
22
  const outDeploy = deploy !== "none" && !applicable.deploy.includes(deploy) ? "none" : deploy;
@@ -25,20 +25,20 @@ export function normalizeAxes({ deploy, publish, intent, types }) {
25
25
  return { deploy: outDeploy, publish: outPublish, intent: noAxes ? "none" : intent, applicable };
26
26
  }
27
27
 
28
- // flags: parseArgs 결과 중 옵션 관련 값 (없으면 {} — 대화형 초기값)
29
- // existing: parseExisting 결과 또는 null
30
- // 반환: { values, sources } — sources 는 trace 가 "왜 이 값인가"를 남길 근거다 (#561).
28
+ // flags: option-related values from parseArgs (none → {} — interactive initial values)
29
+ // existing: parseExisting result or null
30
+ // Returns { values, sources } — sources lets the trace record "why this value" (#561).
31
31
  export function resolveOptions({ flags = {}, existing = null, types = [], cwd = "." }) {
32
32
  const stored = existing?.options ?? {};
33
33
  const applicable = applicableTargets(types);
34
34
 
35
- // 프로젝트 성격(#485): CLI --intent → 저장값. deploy/publish 유도의 기준.
35
+ // Project nature (#485): CLI --intent → saved value. Basis for deriving deploy/publish.
36
36
  let intent = flags.intent ?? stored.intent ?? null;
37
- // 배포/publish 축(#439): 플래그 → 저장값 → 기본값(적용 가능할 때만 docker-ssh — #498).
37
+ // Deploy/publish axes (#439): flag → saved value → default (docker-ssh only when applicable — #498).
38
38
  let deploy = flags.deployTarget ?? stored.deploy
39
39
  ?? (applicable.deploy.includes("docker-ssh") ? "docker-ssh" : "none");
40
40
  let publish = flags.publishTargets ?? stored.publish ?? [];
41
- // --intent 를 줬고 해당 축 플래그가 없으면 intent 가 축을 유도한다 (#485 비대화형)
41
+ // With --intent and no flag for that axis, intent derives the axis (#485 non-interactive)
42
42
  if (flags.intent != null) {
43
43
  if ((intent === "library" || intent === "none") && flags.deployTarget == null) deploy = "none";
44
44
  if ((intent === "app" || intent === "none") && flags.publishTargets == null) publish = [];
@@ -49,33 +49,33 @@ export function resolveOptions({ flags = {}, existing = null, types = [], cwd =
49
49
  const values = {
50
50
  intent, deployTarget: deploy, publishTargets: publish,
51
51
  includeSecretBackup: flags.includeSecretBackup ?? stored.secretBackup ?? false,
52
- // #566 — 설정 없이 바로 동작하므로 기본 켜짐
52
+ // #566 — works with no setup, so on by default
53
53
  aiPrSummary: flags.aiPrSummary ?? stored.aiPrSummary ?? true,
54
- // #716 — 설정(Secret, PROJECT_URL) 없는 신규 레포에 깔면 알림만 쌓인다. 이미 깔린 레포는 유지.
54
+ // #716 — installed in a new repo without setup (Secret, PROJECT_URL) it only piles up notices. Existing installs keep it.
55
55
  projectsSync: flags.projectsSync ?? stored.projectsSync ?? existsSync(join(cwd, PROJECTS_SYNC_WORKFLOW)),
56
- // #502 — version 모드가 기존 full 통합 기록을 강등하지 않게 (full 이 우세)
56
+ // #502 — keeps version mode from downgrading an existing full integration record (full wins)
57
57
  recordMode: existing?.templateMode === "full" ? "full" : "version",
58
- // #456 — 비어 있으면 version.yml 에 쓰지 않는다 (스킬이 develop 으로 폴백). 사용자가 고르거나 플래그로 준 것만 기록.
58
+ // #456 — not written to version.yml when empty (skills fall back to develop). Records only what the user chose or passed as a flag.
59
59
  deployBranch: flags.deployBranch || stored.deployBranch || "",
60
- // #1114 — 비어 있으면 워크플로를 바꾸지 않고 version.yml 에도 쓰지 않는다 (기존 레포 무변화)
60
+ // #1114 — when empty, workflows are untouched and nothing is written to version.yml (existing repos unchanged)
61
61
  deployTriggerBranch: flags.deployTriggerBranch || stored.deployTriggerBranch || "",
62
- // #1114 — 켤 때만 기록·치환. 꺼져 있으면 설치 결과가 바이트 동일
62
+ // #1114 — recorded and substituted only when on. When off, install output is byte-identical
63
63
  ciMinutesSaver: flags.ciMinutesSaver ?? stored.ciMinutesSaver ?? false,
64
- // #455 — null 이 흘러 provider:"null" 로 기록되던 버그 방지
64
+ // #455 — prevents the bug where null flowed through and was recorded as provider:"null"
65
65
  changelogProvider: migrateProvider(stored.changelogProvider) ?? "commit",
66
66
  changelogBaseUrl: stored.changelogBaseUrl ?? "",
67
67
  codeReviewCoderabbit: flags.codeReviewCoderabbit ?? stored.codeReviewCoderabbit ?? DEFAULT_CODE_REVIEW_CODERABBIT,
68
- // #546, #814 — 명시적 false 는 존중, 키가 없으면 신규·기존 모두 켠다
68
+ // #546, #814 — an explicit false is respected; when the key is missing, on for both new and existing
69
69
  semverAuto: stored.semverAuto ?? true,
70
- // 마법사가 묻지 않는 값은 저장값만 보존한다 (전체 재생성이라 안 넘기면 사라진다)
70
+ // Values the wizard does not ask about keep only the saved value (full regeneration drops anything not passed)
71
71
  appRelease: stored.appRelease ?? null, // #553
72
72
  excludedWorkflows: stored.excludedWorkflows ?? null, // #810
73
73
  storeLocales: stored.storeLocales ?? null, // #829
74
74
  storeLocalesIos: stored.storeLocalesIos ?? null,
75
75
  storeLocalesPlay: stored.storeLocalesPlay ?? null,
76
- // #771 — 신규만 켠다. 기존 레포는 키를 만들지 않아 현행 유지
76
+ // #771 — on for new installs only. Existing repos get no key and keep current behavior
77
77
  closeOnRelease: stored.closeOnRelease ?? (existing ? null : true),
78
- // #769, #776 — 신규 en / 기존 ko. 업데이트만으로 기존 레포 문구·라벨이 바뀌지 않는다
78
+ // #769, #776 — new en / existing ko. An update alone never changes existing repo text or labels
79
79
  language: resolveRepoLanguage({ flag: flags.language ?? null, stored: stored.language, existing: !!existing }),
80
80
  labelStyle: resolveLabelStyle({ flag: flags.labelStyle ?? null, stored: stored.labelStyle, existing: !!existing }),
81
81
  };
@@ -88,14 +88,14 @@ export function resolveOptions({ flags = {}, existing = null, types = [], cwd =
88
88
  deploy: from(flags.deployTarget, stored.deploy, "--deploy"),
89
89
  publish: from(flags.publishTargets, stored.publish, "--publish"),
90
90
  before, applicable,
91
- // 기존 레포에서 semver_auto 가 이번에 처음 켜졌는지 — 완료 화면이 알린다
91
+ // Whether semver_auto was turned on for the first time in an existing repo — the finish screen reports it
92
92
  semverAutoNewlyOn: !!existing && stored.semverAuto == null,
93
93
  };
94
94
  return { values, sources };
95
95
  }
96
96
 
97
- // version.yml options 로 기록되는 값 (resolveOptions 결과 이름 그대로)
98
- // 진입점(full·version)이 각자 고르면 빠진 옵션이 생성기 기본값으로 되돌아간다 (#909: version 모드 ai_summary false > true)
97
+ // Values recorded as version.yml options (same names as the resolveOptions result)
98
+ // If each entry point (full, version) picked its own, missing options revert to generator defaults (#909: version mode ai_summary false > true)
99
99
  const TEMPLATE_OPTION_FIELDS = [
100
100
  "intent", "deployTarget", "publishTargets", "includeSecretBackup", "aiPrSummary", "projectsSync",
101
101
  "changelogProvider", "changelogBaseUrl", "codeReviewCoderabbit", "semverAuto", "appRelease",
@@ -103,7 +103,7 @@ const TEMPLATE_OPTION_FIELDS = [
103
103
  "deployTriggerBranch", "ciMinutesSaver",
104
104
  ];
105
105
 
106
- /** 실행 context(resolveOptions 값이 펼쳐진 것) > buildVersionYml templateOptions */
106
+ /** Run context (resolveOptions values spread out) > buildVersionYml templateOptions */
107
107
  export function toTemplateOptions(context, { mode, optionsDate }) {
108
108
  const options = Object.fromEntries(TEMPLATE_OPTION_FIELDS.map((field) => [field, context[field]]));
109
109
  return { ...options, templateVersion: context.templateVersion, mode, optionsDate };
@@ -1,26 +1,26 @@
1
- // 마법사 실행 트레이스 (#494) — 3계층 기록의 Layer 2(JSONL 이벤트) + Layer 3(터미널 미러).
2
- // 마법사의 모든 결정·행동을 이벤트 한 줄씩 남겨, 나중에 사람·AI Agent가 파일명 grep 한 번으로
3
- // "이 파일에 마법사가 한 모든 일"을 시간순 추적할 수 있게 한다 (v4.2.15 수동 로그 복사 진단의 자동화).
4
- // Layer 1(큐레이션 가이드)은 migration-guide.js — 이 모듈의 events를 단일 소스로 소비한다.
1
+ // Wizard run trace (#494) — Layer 2 (JSONL events) + Layer 3 (terminal mirror) of the 3-layer record.
2
+ // Records every wizard decision and action as one event line, so people and AI agents can later trace
3
+ // "everything the wizard did to this file" in time order with one file name grep (automates the v4.2.15 manual log-copy diagnosis).
4
+ // Layer 1 (curated guide) is migration-guide.js — it consumes this module's events as the single source.
5
5
  import { join } from "node:path";
6
6
  import { writeText } from "./fsutil.js";
7
7
  import { getLang } from "../i18n/index.js";
8
8
 
9
- // 진단 로그 위치 (#561). 추적되는 docs/ 가 아닌 곳에 둔다 — 이 기록은 사람이 읽는 문서가
10
- // 아니라 Agent가 "지난 실행에서 무슨 일이 있었나"를 확인하는 자료다.
11
- // 폴더 안에 .gitignore를 함께 써서 폴더가 자기 규칙을 들고 다닌다(루트 .gitignore 무수정).
12
- // 형제인 .github/.projectops/baseline.json은 팀원 공유 자산이라 계속 추적된다.
9
+ // Diagnostic log location (#561). Kept outside the tracked docs/ — this record is not a document for people
10
+ // but material for agents to check "what happened in the last run".
11
+ // A .gitignore is written inside the folder so it carries its own rule (root .gitignore untouched).
12
+ // The sibling .github/.projectops/baseline.json is shared with the team, so it stays tracked.
13
13
  export const MIGRATION_DIR = ".github/.projectops/logs";
14
14
  export const LOGS_GITIGNORE = [
15
- "# projectops 실행 진단 로그 — 저장소에 추적하지 않습니다.",
16
- "# 이 폴더는 마법사가 실행할 때마다 기록을 남기며, 커밋 대상이 아닙니다.",
15
+ "# projectops run diagnostic logs — not tracked in the repository.",
16
+ "# The wizard writes a record here on every run; nothing here is meant to be committed.",
17
17
  "*",
18
18
  "!.gitignore",
19
19
  "",
20
20
  ].join("\n");
21
21
  export const TRACE_SCHEMA = 1;
22
22
 
23
- // 민감값 가드 — PAT·토큰·시크릿·비밀번호는 어떤 이벤트에도 남기지 않는다 (#494 안전 규칙).
23
+ // Sensitive value guard — PATs, tokens, secrets and passwords never go into any event (#494 safety rule).
24
24
  const SENSITIVE_KEY_RE = /pat|token|secret|password|credential/i;
25
25
  export function scrubDetail(detail) {
26
26
  if (detail == null || typeof detail !== "object" || Array.isArray(detail)) return detail;
@@ -32,22 +32,22 @@ export function scrubDetail(detail) {
32
32
  return out;
33
33
  }
34
34
 
35
- // 단계 소요 시간. 시계를 고정 주입한 경우(테스트)는 생략해 결과가 흔들리지 않게 한다.
35
+ // Step duration. Omitted when a fixed clock is injected (tests) so results stay stable.
36
36
  function elapsed(t0, clockIso) {
37
37
  return clockIso ? {} : { ms: Date.now() - t0 };
38
38
  }
39
39
 
40
- // 이벤트를 서버 로그 스타일 한 줄로 만든다 (#561).
41
- // [시각] 레벨 phase/action 대상 key=value ...
42
- // 레벨은 action에서 유추한다 — 조치가 필요한 것(미치환·취소·실패)만 눈에 띄어야 한다.
43
- // 레벨은 "무엇을 먼저 봐야 하는가"로 나눈다.
44
- // ERROR — 실패. 반드시 조치해야 한다.
45
- // WARN — 그대로 두면 나중에 실패할 수 있는 것, 사용자가 판단해야 하는 것.
46
- // INFO — 실행의 큰 줄기. 단계 경계와 확정된 판단.
47
- // DEBUG — 건별 상세(파일 하나, 치환 하나). 기본값은 INFO지만 전부 파일에는 남는다.
40
+ // Turn an event into one server-log style line (#561).
41
+ // [time] LEVEL phase/action target key=value ...
42
+ // The level is inferred from action — only what needs action (unreplaced, cancelled, failed) should stand out.
43
+ // Levels split by "what to look at first".
44
+ // ERROR — failure. Must be acted on.
45
+ // WARN — may fail later if left as is, or needs a user decision.
46
+ // INFO — the main flow of the run. Step boundaries and settled decisions.
47
+ // DEBUG — per-item detail (one file, one substitution). Default is INFO, but everything goes to the file.
48
48
  //
49
- // DEBUG가 파일에 남는 이유: 문제가 터진 뒤에 "그때 DEBUG를 켰더라면"은 소용이 없다.
50
- // 화면은 조용히 두되 파일에는 전부 적는다.
49
+ // Why DEBUG goes to the file: after a problem hits, "if only DEBUG had been on" is useless.
50
+ // Keep the screen quiet but write everything to the file.
51
51
  const ERROR_ACTIONS = new Set(["error", "failed"]);
52
52
  const WARN_ACTIONS = new Set([
53
53
  "unresolved", "cancelled", "skipped-conflict", "leftover-old-gen",
@@ -78,22 +78,22 @@ export function formatLogLine(e) {
78
78
  return parts.join("") + "\n";
79
79
  }
80
80
 
81
- // 색상·커서 제어 시퀀스 제거 (#561). 로그 파일은 에디터·Agent가 읽으므로 이스케이프가
82
- // 그대로 남으면 판독을 방해한다. 터미널 출력 자체는 건드리지 않는다(사본만 정제).
81
+ // Strip color and cursor control sequences (#561). Log files are read by editors and agents, so leftover
82
+ // escapes get in the way. Terminal output itself is untouched (only the copy is cleaned).
83
83
  // eslint-disable-next-line no-control-regex
84
84
  const ANSI_RE = /\u001b\[[0-9;]*[A-Za-z]/g;
85
85
  export function stripAnsi(text) {
86
86
  return String(text).replace(ANSI_RE, "");
87
87
  }
88
88
 
89
- // now("YYYY-MM-DD HH:MM:SS") → 파일명 스탬프 "YYYYMMDD_HHMMSS". 형식이 아니면 "run" 폴백(테스트 주입 clock 안전).
89
+ // now("YYYY-MM-DD HH:MM:SS") → file name stamp "YYYYMMDD_HHMMSS". Falls back to "run" if not in that format (safe for test-injected clocks).
90
90
  export function stampFromNow(now) {
91
91
  const digits = String(now ?? "").replace(/[^0-9]/g, "");
92
92
  if (digits.length < 14) return "run";
93
93
  return `${digits.slice(0, 8)}_${digits.slice(8, 14)}`;
94
94
  }
95
95
 
96
- // 트레이스 팩토리. clockIso 주입 가능(테스트 결정성) — 기본은 실제 UTC.
96
+ // Trace factory. clockIso can be injected (test determinism) — default is the real UTC.
97
97
  export function createRunTrace({ clockIso = null } = {}) {
98
98
  const events = [];
99
99
  const lines = [];
@@ -107,9 +107,9 @@ export function createRunTrace({ clockIso = null } = {}) {
107
107
  events,
108
108
  lines,
109
109
 
110
- // 이벤트 1건 기록. detail은 민감키 스크럽 후 저장.
111
- // 같은 내용을 사람이 읽는 로그 라인으로도 남긴다 (#561) — 터미널에 보이지 않는 내부
112
- // 동작까지 .log 한 파일에서 시간순으로 따라갈 수 있어야, 문제가 생겼을 때 바로 대응된다.
110
+ // Record one event. detail is stored after scrubbing sensitive keys.
111
+ // Also writes it as a human-readable log line (#561) — internal behavior not shown in the terminal
112
+ // must be traceable in time order in the one .log file so problems can be handled right away.
113
113
  event(phase, action, target = "", detail = null) {
114
114
  const e = { ts: nowIso(), phase, action, target };
115
115
  const d = scrubDetail(detail);
@@ -119,11 +119,11 @@ export function createRunTrace({ clockIso = null } = {}) {
119
119
  return e;
120
120
  },
121
121
 
122
- // 터미널 출력 미러 시작 — stdout/stderr write를 감싸 사본만 수집(출력 자체는 그대로 통과).
123
- // 실제 CLI 실행에서만 켠다 (테스트 스텁 io 경로는 호출하지 않음).
122
+ // Start the terminal output mirror — wraps stdout/stderr write and collects a copy (output itself passes through).
123
+ // Enabled only in a real CLI run (not called on the test stub io path).
124
124
  mirrorStart() {
125
125
  if (restore) return;
126
- const so = process.stdout.write; // 원본 참조 보관 — 복원 시 identity 유지
126
+ const so = process.stdout.write; // Keep the original reference — identity is kept on restore
127
127
  const se = process.stderr.write;
128
128
  // The run log is always English (agents read it later, and it must not change with the user's locale).
129
129
  // When the screen is in another language the raw terminal text is not copied; the caller appends an
@@ -133,7 +133,7 @@ export function createRunTrace({ clockIso = null } = {}) {
133
133
  try {
134
134
  const s = typeof chunk === "string" ? chunk : chunk.toString("utf8");
135
135
  lines.push(stripAnsi(s));
136
- } catch { /* 미러 실패는 실행에 영향 없음 */ }
136
+ } catch { /* A mirror failure does not affect the run */ }
137
137
  };
138
138
  process.stdout.write = function (chunk, ...rest) { capture(chunk); return so.apply(process.stdout, [chunk, ...rest]); };
139
139
  process.stderr.write = function (chunk, ...rest) { capture(chunk); return se.apply(process.stderr, [chunk, ...rest]); };
@@ -149,9 +149,9 @@ export function createRunTrace({ clockIso = null } = {}) {
149
149
  if (restore) { restore(); restore = null; }
150
150
  },
151
151
 
152
- // 단계 실행 래퍼 (#561) — 서버 로그처럼 "어디에 들어갔다 언제 나왔고 얼마 걸렸는지"를
153
- // 자동으로 남긴다. 개별 호출부에 start/done을 흩뿌리면 빠뜨리는 자리가 생긴다.
154
- // 예외가 나면 failed로 기록하고 그대로 던진다 — 삼키지 않는다.
152
+ // Step wrapper (#561) — records "where it entered, when it left and how long it took" automatically,
153
+ // like a server log. Scattering start/done over call sites always misses some.
154
+ // On an exception, records failed and rethrows — never swallows.
155
155
  step(name, fn, detail = null) {
156
156
  this.event("step", "start", name, detail);
157
157
  const t0 = Date.now();
@@ -165,7 +165,7 @@ export function createRunTrace({ clockIso = null } = {}) {
165
165
  }
166
166
  },
167
167
 
168
- // async 버전 — 대화형 단계(질문 대기 포함)에 쓴다.
168
+ // async version — for interactive steps (including waits for answers).
169
169
  async stepAsync(name, fn, detail = null) {
170
170
  this.event("step", "start", name, detail);
171
171
  const t0 = Date.now();
@@ -179,10 +179,10 @@ export function createRunTrace({ clockIso = null } = {}) {
179
179
  }
180
180
  },
181
181
 
182
- // 강제 종료(Ctrl+C)에도 기록을 남긴다 (#561).
183
- // SIGINT 기본 동작으로 프로세스가 즉사하면 finally가 돌지 않는다 — 사용자가 끊었을 때야말로
184
- // "어디까지 갔는지"가 가장 궁금한 순간이라, 여기서 놓치면 로그의 쓸모가 절반이다.
185
- // 핸들러는 기록만 하고 원래대로 종료시킨다(동작을 바꾸지 않는다).
182
+ // Leave a record even on forced exit (Ctrl+C) (#561).
183
+ // If SIGINT's default kills the process, finally never runs — yet when the user cuts it off is exactly when
184
+ // "how far did it get" matters most, so missing it here halves the log's value.
185
+ // The handler only records, then exits as before (behavior unchanged).
186
186
  armSignals(opts = {}) {
187
187
  if (signalsArmed) return () => {};
188
188
  signalsArmed = true;
@@ -190,10 +190,10 @@ export function createRunTrace({ clockIso = null } = {}) {
190
190
  const handlers = [];
191
191
  for (const sig of ["SIGINT", "SIGTERM"]) {
192
192
  const h = () => {
193
- self.event("run", "cancelled", sig, { reason: "사용자 강제 종료(신호 수신)" });
193
+ self.event("run", "cancelled", sig, { reason: "user forced exit (signal received)" });
194
194
  self.finalize(opts);
195
195
  process.removeListener(sig, h);
196
- process.kill(process.pid, sig); // 원래 종료 동작으로 넘긴다
196
+ process.kill(process.pid, sig); // Hand over to the original exit behavior
197
197
  };
198
198
  process.on(sig, h);
199
199
  handlers.push([sig, h]);
@@ -204,12 +204,12 @@ export function createRunTrace({ clockIso = null } = {}) {
204
204
  };
205
205
  },
206
206
 
207
- // 어떤 경로로 끝나든 기록을 남긴다 (#561) — 정상 완주·중간 취소·예외·강제 종료.
208
- // 사용자가 중간에 끊었을 때야말로 "어디까지 갔는지"가 가장 궁금한 순간이라,
209
- // 완주했을 때만 남기는 기록은 쓸모가 절반이다.
207
+ // Leave a record however it ends (#561) — normal finish, mid-run cancel, exception, forced exit.
208
+ // When the user cuts it off midway is exactly when "how far did it get" matters most,
209
+ // so a record kept only on a full run is half as useful.
210
210
  //
211
- // 두 번 불려도 한 번만 쓴다(정상 경로 + finally 중복 호출 대비). 실패는 삼킨다 —
212
- // 기록 실패가 종료를 막아선 안 된다.
211
+ // Writes once even if called twice (normal path + duplicate call in finally). Failures are swallowed —
212
+ // a recording failure must not block exit.
213
213
  finalize(opts = {}) {
214
214
  if (finalized) return null;
215
215
  finalized = true;
@@ -221,8 +221,8 @@ export function createRunTrace({ clockIso = null } = {}) {
221
221
  }
222
222
  },
223
223
 
224
- // 기록 파일 경로만 계산한다 (쓰지 않음). 완료 화면까지 캡처하려면 write를 화면 출력 뒤로
225
- // 미뤄야 하는데, 가이드 엔트리는 그 전에 traceFile 경로를 참조해야 해서 둘을 분리했다.
224
+ // Only computes the record file paths (no write). Capturing the finish screen means delaying write until after screen output,
225
+ // but the guide entry needs the traceFile path before that, so the two are separated.
226
226
  paths({ fromVersion = "", toVersion = "", now = "" } = {}) {
227
227
  const stamp = stampFromNow(now);
228
228
  const from = String(fromVersion || "new").replace(/[^0-9a-zA-Z.-]/g, "");
@@ -231,15 +231,15 @@ export function createRunTrace({ clockIso = null } = {}) {
231
231
  return { base, traceFile: `${MIGRATION_DIR}/${base}.jsonl`, logFile: `${MIGRATION_DIR}/${base}.log` };
232
232
  },
233
233
 
234
- // Layer 2/3 파일 기록 — .github/.projectops/logs/{stamp}_v{from}_to_v{to}.{jsonl,log}
235
- // 반환: { traceFile, logFile } (targetRoot 기준 상대 경로 — 가이드 메타 포인터용).
236
- // 이벤트가 0건이면 기록하지 않는다(no-op 실행 오염 방지) — null 반환.
234
+ // Layer 2/3 file record — .github/.projectops/logs/{stamp}_v{from}_to_v{to}.{jsonl,log}
235
+ // Returns { traceFile, logFile } (relative to targetRoot — used as guide meta pointers).
236
+ // Writes nothing when there are 0 events (avoids polluting no-op runs) — returns null.
237
237
  write({ targetRoot = ".", fromVersion = "", toVersion = "", now = "" } = {}) {
238
238
  if (events.length === 0) return null;
239
239
  const from = String(fromVersion || "new").replace(/[^0-9a-zA-Z.-]/g, "");
240
240
  const to = String(toVersion || "unknown").replace(/[^0-9a-zA-Z.-]/g, "");
241
241
  const planned = this.paths({ fromVersion, toVersion, now });
242
- // 폴더 규칙을 매번 보장한다 — 사용자가 지웠거나 폴더가 새로 생겨도 추적되지 않게.
242
+ // Ensure the folder rule every time — stays untracked even if the user deleted it or the folder is new.
243
243
  writeText(join(targetRoot, `${MIGRATION_DIR}/.gitignore`), LOGS_GITIGNORE);
244
244
  const header = JSON.stringify({ schema: TRACE_SCHEMA, kind: "projectops-migration-trace", from, to, started: events[0]?.ts ?? "" });
245
245
  writeText(join(targetRoot, planned.traceFile), [header, ...events.map((e) => JSON.stringify(e))].join("\n") + "\n");
@@ -1,17 +1,17 @@
1
- // 스토어 다국어 설정 감지 (#843): store_locales 없이 여러 언어에 한 문구를 올리는 레포를 찾아 알리기만 한다.
2
- // 동작·version.yml 은 바꾸지 않는다. 결과는 완료 화면 한 줄 + 마이그레이션 가이드 체크리스트 한 항목.
1
+ // Store multi-language setup detection (#843): only finds and reports repos that push one text to many languages without store_locales.
2
+ // Changes neither behavior nor version.yml. Output is one line on the finish screen + one migration guide checklist item.
3
3
  import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
4
4
  import { join, relative } from "node:path";
5
5
 
6
- // 언어 폴더 이름 모양 (ko, ko-KR, en-US, zh-Hans)
6
+ // Shape of a language folder name (ko, ko-KR, en-US, zh-Hans)
7
7
  const LOCALE_NAME = /^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/;
8
- // DELIVER_LOCALES 대입 (yaml `KEY: "a,b"`, 셸 `KEY=a,b`, Ruby `ENV["KEY"] = "a,b"`). `||` 기본값은 대입이 아니라 제외
8
+ // DELIVER_LOCALES assignment (yaml `KEY: "a,b"`, shell `KEY=a,b`, Ruby `ENV["KEY"] = "a,b"`). A `||` default is not an assignment and is excluded
9
9
  const DELIVER_LOCALES_ASSIGN = /DELIVER_LOCALES["']?\]?\s*[:=]\s*["']?([A-Za-z0-9_, -]+)/g;
10
10
  const MINIMUM_LOCALE_COUNT = 2;
11
11
 
12
12
  /**
13
- * 다국어 스토어 신호 3종 수집: DELIVER_LOCALES 2개 이상, Play metadata 언어 폴더, release-notes 언어 폴더
14
- * storeLocales 가 이미 있거나(null 아님) 신호가 없으면 null
13
+ * Collect 3 multi-language store signals: DELIVER_LOCALES with 2+ entries, Play metadata language folders, release-notes language folders
14
+ * null if storeLocales already exists (not null) or there is no signal
15
15
  */
16
16
  export function detectMultiLocaleStore({ root, flutterPath = ".", storeLocales = null }) {
17
17
  if (storeLocales != null) return null;
@@ -21,14 +21,14 @@ export function detectMultiLocaleStore({ root, flutterPath = ".", storeLocales =
21
21
  ...findLocaleDirectories(root, join(appRoot, "android/fastlane/metadata/android"), "play-metadata"),
22
22
  ...findLocaleDirectories(root, join(appRoot, "release-notes"), "release-notes"),
23
23
  ];
24
- // 루트와 앱 폴더가 다를 때만 루트 release-notes 도 본다 (같으면 중복)
24
+ // Also check the root release-notes only when the root and app folder differ (same would be a duplicate)
25
25
  if (appRoot !== join(root, ".")) signals.push(...findLocaleDirectories(root, join(root, "release-notes"), "release-notes"));
26
26
  if (signals.length === 0) return null;
27
27
  const locales = [...new Set(signals.flatMap((s) => s.locales))];
28
28
  return { signals, locales };
29
29
  }
30
30
 
31
- // 워크플로우(.yml/.yaml) + Fastfile(ios·android·루트) 의 DELIVER_LOCALES
31
+ // DELIVER_LOCALES in workflows (.yml/.yaml) + Fastfiles (ios, android, root)
32
32
  function findDeliverLocales(root, appRoot) {
33
33
  const candidates = [];
34
34
  const workflowsDir = join(root, ".github/workflows");
@@ -48,14 +48,14 @@ function findDeliverLocales(root, appRoot) {
48
48
  const locales = match[1].split(",").map((s) => s.trim()).filter((s) => LOCALE_NAME.test(s));
49
49
  if (locales.length >= MINIMUM_LOCALE_COUNT) {
50
50
  found.push({ source: "deliver-locales", path: toRelative(root, file), locales });
51
- break; // 파일당 1건이면 충분
51
+ break; // One hit per file is enough
52
52
  }
53
53
  }
54
54
  }
55
55
  return found;
56
56
  }
57
57
 
58
- // <dir>/<lang>/ 폴더가 2개 이상이면 신호 1건
58
+ // 2+ <dir>/<lang>/ folders count as one signal
59
59
  function findLocaleDirectories(root, dir, source) {
60
60
  if (!existsSync(dir) || !statSync(dir).isDirectory()) return [];
61
61
  const locales = readdirSync(dir)
@@ -68,14 +68,14 @@ function isFile(path) {
68
68
  return existsSync(path) && statSync(path).isFile();
69
69
  }
70
70
 
71
- // 화면·가이드 표기는 OS 와 무관하게 / 구분자
71
+ // Screen and guide text use the / separator regardless of OS
72
72
  function toRelative(root, path) {
73
73
  return relative(root, path).split("\\").join("/");
74
74
  }
75
75
 
76
76
  /**
77
- * 진입점(비대화형·대화형) 공통: 기존 레포 + storeLocales 미설정일 때만 감지 > trace 기록 > 결과 반환
78
- * 신규 설치는 null (알릴 대상은 이미 다국어로 운영 중인 레포)
77
+ * Shared by both entry points (non-interactive, interactive): detect only for an existing repo with storeLocales unset > write trace > return the result
78
+ * null for new installs (the target is repos already running in several languages)
79
79
  */
80
80
  export function detectStoreLocalesHint({ root, existing, paths, trace = null }) {
81
81
  if (!existing) return null;
@@ -1,23 +1,23 @@
1
- // 설치 후 검증 (#549) — 설치된 워크플로우를 다시 읽어 "이대로 돌아가는가"를 본다.
1
+ // Post-install verification (#549) — rereads installed workflows to see "will this run as is".
2
2
  //
3
- // 왜 설치 전이 아니라 후인가: 치환은 파일 단위로 흩어져 일어나고 auto 토큰은 resolver 결과에
4
- // 의존한다. 최종 디스크 내용을 보는 것이 실제로 배포될 것과 같은 것을 보는 유일한 방법이다.
3
+ // Why after, not before install: substitution happens scattered per file, and auto tokens depend on
4
+ // resolver results. Looking at the final disk content is the only way to see what will actually deploy.
5
5
  import { join } from "node:path";
6
6
  import { existsSync, readFileSync, readdirSync } from "node:fs";
7
7
  import { PATHS } from "./paths.js";
8
8
 
9
- // 치환 대상이 아닌 토큰 — 워크플로우 스크립트 안의 heredoc 구분자다. 값이 아니라 문법이므로
10
- // 미치환 검사에서 제외한다. (예: cat <<'__SUH_FILE_CONTENT_EOF__')
9
+ // Tokens that are not substitution targets — heredoc delimiters inside workflow scripts. They are syntax,
10
+ // not values, so they are excluded from the unreplaced check. (e.g. cat <<'__SUH_FILE_CONTENT_EOF__')
11
11
  const SENTINEL_RE = /^__SUH_[A-Z0-9_]*__$/;
12
12
  const PLACEHOLDER_RE = /__[A-Z][A-Z0-9_]*__/g;
13
13
 
14
- // 주석으로 죽어 있는 줄 — 실행되지 않으므로 검사 대상이 아니다.
15
- // 템플릿에는 "[선택] ..." 예시 스텝이 통째로 주석 처리돼 들어 있는데, 이걸 세면
16
- // 쓰지도 않는 Secret을 "등록하세요"라고 안내하게 된다.
14
+ // Commented-out lines — they never run, so they are not checked.
15
+ // Templates ship whole "[optional] ..." sample steps commented out; counting them would
16
+ // tell users to "register" secrets they never use.
17
17
  const isCommented = (line) => /^\s*#/.test(line);
18
18
 
19
- // 검사 대상 파일 목록. 호출부가 명시하지 않으면 설치된 워크플로우 전체를 스캔한다
20
- // (복사 결과 목록을 조합해 넘기는 것보다, 최종 디스크 상태를 그대로 보는 쪽이 목적에 맞다).
19
+ // Files to check. If the caller does not specify, scan every installed workflow
20
+ // (looking at the final disk state fits the purpose better than assembling the copy result list).
21
21
  function listWorkflowFiles(workflowsDir, filenames) {
22
22
  if (filenames && filenames.length) return filenames;
23
23
  if (!existsSync(workflowsDir)) return [];
@@ -41,12 +41,12 @@ function readLines(workflowsDir, filename) {
41
41
  }
42
42
  }
43
43
 
44
- // 미치환 플레이스홀더 스캔.
45
- // auto 토큰 계산이 실패해도(예: application.yaml을 못 찾아 경로가 빈 문자열) 그 줄을 건드리지
46
- // 않고 넘어가므로, __APPLICATION_YML_DIR__ 이 그대로 남은 워크플로우가 "설치 성공"으로 끝난다.
47
- // 문제는 배포 시점에야 그 이름의 디렉터리가 만들어지며 드러난다.
44
+ // Unreplaced placeholder scan.
45
+ // When an auto token computation fails (e.g. application.yaml not found, empty path), the line is left
46
+ // untouched, so a workflow still holding __APPLICATION_YML_DIR__ ends as "install succeeded".
47
+ // The problem only shows at deploy time, when a directory with that name gets created.
48
48
  //
49
- // 반환: [{ filename, line, token, text }] — 사람이 바로 고칠 수 있게 줄 번호까지 준다.
49
+ // Returns [{ filename, line, token, text }] — includes line numbers so people can fix it right away.
50
50
  export function scanUnsubstituted(workflowsDir, filenames = []) {
51
51
  const found = [];
52
52
  for (const filename of listWorkflowFiles(workflowsDir, filenames)) {
@@ -63,23 +63,23 @@ export function scanUnsubstituted(workflowsDir, filenames = []) {
63
63
  return found;
64
64
  }
65
65
 
66
- // GITHUB_TOKEN은 Actions가 자동 주입하므로 사용자가 등록할 대상이 아니다.
66
+ // GITHUB_TOKEN is injected by Actions automatically, so users do not register it.
67
67
  const AUTO_SECRETS = new Set(["GITHUB_TOKEN"]);
68
68
 
69
- // 없어도 워크플로우가 도는 secret — 폴백이 문서화돼 있다. 필수와 섞어 "등록해야 동작합니다"라고
70
- // 하면 안내 자체를 못 믿게 되므로 분리한다.
71
- // MODEL_API_KEY → 등록하면 외부 AI 요약, 없으면 Copilot → 커밋 분석 (#455·#566 사다리)
72
- // _GITHUB_PAT_TOKEN → 없으면 GITHUB_TOKEN으로 머지하고 후속 워크플로우를 직접 깨운다 (#551)
69
+ // Secrets the workflow runs without — the fallback is documented. Mixing them with required ones under "needed to work"
70
+ // would make the notice itself untrustworthy, so they are kept separate.
71
+ // MODEL_API_KEY → if registered, external AI summary; otherwise Copilot → commit analysis (#455·#566 ladder)
72
+ // _GITHUB_PAT_TOKEN → if missing, merge with GITHUB_TOKEN and wake follow-up workflows directly (#551)
73
73
  export const OPTIONAL_SECRETS = new Set(["MODEL_API_KEY", "_GITHUB_PAT_TOKEN"]);
74
74
 
75
75
  const SECRET_RE = /secrets\.([A-Z_][A-Z0-9_]*)/g;
76
76
 
77
- // 설치된 워크플로우가 요구하는 GitHub Secret 목록.
78
- // 완료 화면이 아무것도 안내하지 않는 바람에, 배포 워크플로우가 실제로 필요로 하는
79
- // SERVER_HOST·SSH_KEY 같은 값이 드러나지 않았다. 설치 직후 상태로는 배포가 돌지 않는데
80
- // 그 사실을 알 방법이 없다.
77
+ // GitHub secrets required by the installed workflows.
78
+ // Because the finish screen said nothing, values the deploy workflows actually need, like
79
+ // SERVER_HOST and SSH_KEY, never surfaced. Right after install the deploy cannot run,
80
+ // and there was no way to know it.
81
81
  //
82
- // 반환: Map<secretName, string[] 그 secret을 쓰는 파일명> (이름 오름차순)
82
+ // Returns Map<secretName, string[] file names using that secret> (sorted by name)
83
83
  export function collectRequiredSecrets(workflowsDir, filenames = []) {
84
84
  const out = new Map();
85
85
  for (const filename of listWorkflowFiles(workflowsDir, filenames)) {
@@ -99,8 +99,8 @@ export function collectRequiredSecrets(workflowsDir, filenames = []) {
99
99
  return new Map([...out.entries()].sort(([a], [b]) => a.localeCompare(b)));
100
100
  }
101
101
 
102
- // 설치 직후 한 번에 돌리는 진입점. targetRoot 기준으로 워크플로우 폴더를 찾는다.
103
- // 반환: { unresolved: [...], secrets: Map, ok: boolean }
102
+ // Entry point run once right after install. Finds the workflow folder under targetRoot.
103
+ // Returns { unresolved: [...], secrets: Map, ok: boolean }
104
104
  export function verifyInstall(targetRoot = ".", filenames = []) {
105
105
  const workflowsDir = join(targetRoot, PATHS.workflowsDir);
106
106
  const unresolved = scanUnsubstituted(workflowsDir, filenames);