@codyswann/lisa 2.293.1 → 2.295.0

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 (128) hide show
  1. package/cdk/create-only/.github/workflows/deploy.yml +19 -0
  2. package/dist/cli/deploy-status-adapter-github.d.ts +20 -0
  3. package/dist/cli/deploy-status-adapter-github.d.ts.map +1 -0
  4. package/dist/cli/deploy-status-adapter-github.js +167 -0
  5. package/dist/cli/deploy-status-adapter-github.js.map +1 -0
  6. package/dist/cli/deploy-status-adapter-jira.d.ts +18 -0
  7. package/dist/cli/deploy-status-adapter-jira.d.ts.map +1 -0
  8. package/dist/cli/deploy-status-adapter-jira.js +215 -0
  9. package/dist/cli/deploy-status-adapter-jira.js.map +1 -0
  10. package/dist/cli/deploy-status-adapter-linear.d.ts +16 -0
  11. package/dist/cli/deploy-status-adapter-linear.d.ts.map +1 -0
  12. package/dist/cli/deploy-status-adapter-linear.js +204 -0
  13. package/dist/cli/deploy-status-adapter-linear.js.map +1 -0
  14. package/dist/cli/deploy-status-adapter-shared.d.ts +57 -0
  15. package/dist/cli/deploy-status-adapter-shared.d.ts.map +1 -0
  16. package/dist/cli/deploy-status-adapter-shared.js +62 -0
  17. package/dist/cli/deploy-status-adapter-shared.js.map +1 -0
  18. package/dist/cli/deploy-status-adapter.d.ts +49 -0
  19. package/dist/cli/deploy-status-adapter.d.ts.map +1 -0
  20. package/dist/cli/deploy-status-adapter.js +87 -0
  21. package/dist/cli/deploy-status-adapter.js.map +1 -0
  22. package/dist/cli/deploy-status-refs.d.ts +70 -0
  23. package/dist/cli/deploy-status-refs.d.ts.map +1 -0
  24. package/dist/cli/deploy-status-refs.js +195 -0
  25. package/dist/cli/deploy-status-refs.js.map +1 -0
  26. package/dist/cli/deploy-status-sync-cmd.d.ts +23 -0
  27. package/dist/cli/deploy-status-sync-cmd.d.ts.map +1 -0
  28. package/dist/cli/deploy-status-sync-cmd.js +75 -0
  29. package/dist/cli/deploy-status-sync-cmd.js.map +1 -0
  30. package/dist/cli/deploy-status-sync-engine.d.ts +49 -0
  31. package/dist/cli/deploy-status-sync-engine.d.ts.map +1 -0
  32. package/dist/cli/deploy-status-sync-engine.js +214 -0
  33. package/dist/cli/deploy-status-sync-engine.js.map +1 -0
  34. package/dist/cli/deploy-status-sync-exec.d.ts +73 -0
  35. package/dist/cli/deploy-status-sync-exec.d.ts.map +1 -0
  36. package/dist/cli/deploy-status-sync-exec.js +95 -0
  37. package/dist/cli/deploy-status-sync-exec.js.map +1 -0
  38. package/dist/cli/gate-commands.d.ts +3 -1
  39. package/dist/cli/gate-commands.d.ts.map +1 -1
  40. package/dist/cli/gate-commands.js +26 -0
  41. package/dist/cli/gate-commands.js.map +1 -1
  42. package/dist/cli/index.d.ts +2 -7
  43. package/dist/cli/index.d.ts.map +1 -1
  44. package/dist/cli/index.js +4 -43
  45. package/dist/cli/index.js.map +1 -1
  46. package/dist/cli/kane-commands.d.ts +21 -0
  47. package/dist/cli/kane-commands.d.ts.map +1 -0
  48. package/dist/cli/kane-commands.js +44 -0
  49. package/dist/cli/kane-commands.js.map +1 -0
  50. package/dist/cli/update-check.d.ts +8 -0
  51. package/dist/cli/update-check.d.ts.map +1 -1
  52. package/dist/cli/update-check.js +4 -2
  53. package/dist/cli/update-check.js.map +1 -1
  54. package/dist/core/deploy-status-sync.d.ts +15 -0
  55. package/dist/core/deploy-status-sync.d.ts.map +1 -1
  56. package/dist/core/deploy-status-sync.js +57 -19
  57. package/dist/core/deploy-status-sync.js.map +1 -1
  58. package/dist/core/deploy-status-transition.d.ts +97 -0
  59. package/dist/core/deploy-status-transition.d.ts.map +1 -0
  60. package/dist/core/deploy-status-transition.js +134 -0
  61. package/dist/core/deploy-status-transition.js.map +1 -0
  62. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  63. package/dist/core/upstream-evidence-manifest.js +29 -8
  64. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  65. package/expo/create-only/.github/workflows/deploy.yml +13 -0
  66. package/harper-fabric/create-only/.github/workflows/deploy.yml +5 -0
  67. package/nestjs/create-only/.github/workflows/deploy.yml +14 -0
  68. package/package.json +1 -1
  69. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  71. package/plugins/lisa/rules/eager/config-resolution.md +3 -2
  72. package/plugins/lisa/rules/reference/config-resolution.md +13 -1
  73. package/plugins/lisa-agy/plugin.json +1 -1
  74. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  76. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  77. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-copilot/rules/eager/config-resolution.md +3 -2
  81. package/plugins/lisa-copilot/rules/reference/config-resolution.md +13 -1
  82. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +13 -1
  84. package/plugins/lisa-cursor/rules/config-resolution.mdc +3 -2
  85. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  87. package/plugins/lisa-expo-agy/plugin.json +1 -1
  88. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  92. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  93. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  95. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  96. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  97. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  98. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  102. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  103. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  107. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  108. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  110. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  111. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  112. package/plugins/lisa-rails-agy/plugin.json +1 -1
  113. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  115. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  116. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  117. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  118. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  120. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  121. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  122. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  123. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  124. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  125. package/plugins/src/base/rules/eager/config-resolution.md +3 -2
  126. package/plugins/src/base/rules/reference/config-resolution.md +13 -1
  127. package/rails/create-only/.github/workflows/deploy.yml +5 -0
  128. package/typescript/copy-overwrite/.github/GITHUB_ACTIONS.md +28 -0
@@ -0,0 +1,195 @@
1
+ import { createExec } from "./deploy-status-adapter.js";
2
+ const GITHUB_TOKEN_PATTERN = /^([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)?#([1-9]\d*)$/;
3
+ /** Git revision charset: branch names, SHAs, HEAD^/~ suffixes — nothing that
4
+ * could smuggle shell metacharacters or option-like payloads into argv. */
5
+ const REVISION_PATTERN = /^[\w./^~@-]+$/;
6
+ /** Maximum concurrent gh lookups during PR-token collection. */
7
+ const GH_CONCURRENCY = 8;
8
+ /**
9
+ * Split items into consecutive chunks of at most `size` elements. Used to
10
+ * bound gh fan-out: chunks run sequentially, items within a chunk run
11
+ * concurrently.
12
+ * @param items - Items to split
13
+ * @param size - Maximum chunk size (must be positive)
14
+ * @returns Consecutive chunks in input order
15
+ */
16
+ export function chunk(items, size) {
17
+ return Array.from({ length: Math.ceil(items.length / size) }, (_, index) => items.slice(index * size, (index + 1) * size));
18
+ }
19
+ const KEY_TOKEN_PATTERN = /^([A-Za-z][A-Za-z0-9]{1,9})-([1-9]\d*)$/;
20
+ const REF_LINE_PATTERN = /^(?:refs|closes)\b(.*)$/i;
21
+ /**
22
+ * Build production deps over the shared fixed-argv executor factory.
23
+ * @param cwd - Repository working directory
24
+ * @returns Real git/gh executors
25
+ */
26
+ export function defaultRefExtractionDeps(cwd) {
27
+ return {
28
+ execGit: createExec("git", cwd),
29
+ execGh: createExec("gh", cwd),
30
+ };
31
+ }
32
+ /**
33
+ * Canonicalize one token against the configured tracker scope.
34
+ * @param token - Raw token from a trailer or PR body
35
+ * @param options - Extraction options (tracker, repository, project key)
36
+ * @returns Canonical ref or a skip reason
37
+ */
38
+ function canonicalizeToken(token, options) {
39
+ if (options.tracker === "github") {
40
+ const match = GITHUB_TOKEN_PATTERN.exec(token);
41
+ if (match === null) {
42
+ return { token, reason: "not a GitHub work-item ref" };
43
+ }
44
+ if (options.repository === undefined) {
45
+ return { token, reason: "no github.org/github.repo configured" };
46
+ }
47
+ const repository = match[1];
48
+ if (repository !== undefined &&
49
+ repository.toLowerCase() !== options.repository.toLowerCase()) {
50
+ return {
51
+ token,
52
+ reason: `outside configured repository ${options.repository}`,
53
+ };
54
+ }
55
+ return { token, ref: `${options.repository}#${match[2] ?? ""}` };
56
+ }
57
+ const match = KEY_TOKEN_PATTERN.exec(token);
58
+ if (match === null) {
59
+ return { token, reason: `not a ${options.tracker} work-item ref` };
60
+ }
61
+ const key = (match[1] ?? "").toUpperCase();
62
+ if (key !== (options.projectKey ?? "").toUpperCase()) {
63
+ return {
64
+ token,
65
+ reason: `outside configured ${options.tracker} project ${options.projectKey ?? "(unset)"}`,
66
+ };
67
+ }
68
+ return { token, ref: `${key}-${match[2] ?? ""}` };
69
+ }
70
+ /**
71
+ * Collect Refs/Closes tokens from merged PRs associated with the commits.
72
+ * @param shas - Commit SHAs of the range
73
+ * @param repository - Configured `owner/repo`
74
+ * @param deps - Injectable executors
75
+ * @returns Raw tokens in appearance order
76
+ */
77
+ async function collectPrTokens(shas, repository, deps) {
78
+ // Chunked fan-out: a large range must not open one gh process (and one
79
+ // API request) per SHA simultaneously.
80
+ const payloads = await chunk(shas, GH_CONCURRENCY).reduce(async (accumulated, group) => {
81
+ const previous = await accumulated;
82
+ const results = await Promise.all(group.map(sha => deps.execGh(["api", `repos/${repository}/commits/${sha}/pulls`])));
83
+ return [...previous, ...results];
84
+ }, Promise.resolve([]));
85
+ const pulls = payloads.flatMap(raw => {
86
+ const parsed = JSON.parse(raw.length > 0 ? raw : "[]");
87
+ return Array.isArray(parsed)
88
+ ? parsed
89
+ : [];
90
+ });
91
+ const merged = pulls.filter(pull => pull.merged_at !== null && pull.merged_at !== undefined);
92
+ const unique = [...new Map(merged.map(pull => [pull.number, pull])).values()];
93
+ return unique.flatMap(pull => prBodyTokens(pull.body ?? ""));
94
+ }
95
+ /** Loose candidate shapes: contains a "#" or looks like KEY-N. A candidate
96
+ * that later fails canonicalization is reported in `skipped`, never dropped
97
+ * silently; plain prose words are not candidates. */
98
+ const CANDIDATE_PATTERN = /#|^[A-Za-z][A-Za-z0-9]*-\d/;
99
+ /** Punctuation stripped from the end of candidate tokens. */
100
+ const TRAILING_PUNCTUATION = new Set([".", ",", ";", ":", ")"]);
101
+ /**
102
+ * Strip trailing punctuation from a word in linear time (a quantified
103
+ * end-anchored regex would be flagged as super-linear).
104
+ * @param word - Raw word
105
+ * @returns The word without its trailing punctuation run
106
+ */
107
+ function stripTrailingPunctuation(word) {
108
+ const characters = [...word];
109
+ const cutoff = characters.reduce((keep, character, index) => TRAILING_PUNCTUATION.has(character) ? keep : index + 1, 0);
110
+ return word.slice(0, cutoff);
111
+ }
112
+ /**
113
+ * Collect candidate tokens from one PR body: Refs/Closes lines outside
114
+ * fenced code regions (triple-backtick blocks), with trailing punctuation
115
+ * stripped from each word so `Closes #102.` names #102.
116
+ * @param body - Raw PR body markdown
117
+ * @returns Candidate tokens in appearance order
118
+ */
119
+ function prBodyTokens(body) {
120
+ const scanned = body.split("\n").reduce((state, rawLine) => {
121
+ const line = rawLine.trim();
122
+ if (line.startsWith("```")) {
123
+ return { ...state, inFence: !state.inFence };
124
+ }
125
+ const match = state.inFence ? null : REF_LINE_PATTERN.exec(line);
126
+ if (match === null)
127
+ return state;
128
+ const words = (match[1] ?? "")
129
+ .replace(/^[\s:]+/, "")
130
+ .split(/[\s,]+/)
131
+ .map(stripTrailingPunctuation)
132
+ .filter(word => CANDIDATE_PATTERN.test(word));
133
+ return { ...state, tokens: [...state.tokens, ...words] };
134
+ }, { inFence: false, tokens: [] });
135
+ return scanned.tokens;
136
+ }
137
+ /**
138
+ * Extract the deduped union of work-item refs for a commit range.
139
+ * @param options - Range, tracker scope, and working directory
140
+ * @param deps - Injectable executors (defaults to real git/gh)
141
+ * @returns Canonical refs, skipped tokens, and the resolved head SHA
142
+ */
143
+ export async function extractWorkItemRefs(options, deps = defaultRefExtractionDeps(options.cwd)) {
144
+ // Library-level guard (the cmd layer has its own): without it, the
145
+ // dot-stripped head would give rev-parse two-dot semantics while rev-list
146
+ // received the raw three-dot range — two git calls disagreeing silently.
147
+ if (options.range.includes("...")) {
148
+ throw new Error(`Invalid range "${options.range}": three-dot "..." selects the symmetric difference, which is never a deploy range. Pass the deployed range as <base>..<head> (two dots).`);
149
+ }
150
+ const separator = options.range.indexOf("..");
151
+ if (separator === -1) {
152
+ throw new Error(`Invalid range "${options.range}": expected <base>..<head>`);
153
+ }
154
+ const base = options.range.slice(0, separator);
155
+ const head = options.range.slice(separator + 2);
156
+ // Charset gate + --end-of-options below: a revision must never be able to
157
+ // smuggle option-like or shell-meta payloads into the git argv.
158
+ if (!REVISION_PATTERN.test(base) || !REVISION_PATTERN.test(head)) {
159
+ throw new Error(`Invalid range "${options.range}": each revision side must be a plain git revision (letters, digits, ".", "_", "/", "^", "~", "@", "-").`);
160
+ }
161
+ // --verify puts rev-parse in single-revision mode, where --end-of-options
162
+ // is honored (bare rev-parse would echo it back instead).
163
+ const headSha = (await deps.execGit(["rev-parse", "--verify", "--end-of-options", head])).trim();
164
+ const shas = (await deps.execGit([
165
+ "rev-list",
166
+ "--reverse",
167
+ "--end-of-options",
168
+ options.range,
169
+ ]))
170
+ .split("\n")
171
+ .map(line => line.trim())
172
+ .filter(line => line.length > 0);
173
+ const trailerOutputs = await Promise.all(shas.map(sha => deps.execGit([
174
+ "log",
175
+ "-1",
176
+ "--format=%(trailers:key=Work-Item,valueonly)",
177
+ sha,
178
+ ])));
179
+ const trailerTokens = trailerOutputs.flatMap(output => output
180
+ .split("\n")
181
+ .map(line => line.trim())
182
+ .filter(line => line.length > 0));
183
+ const prTokens = options.repository === undefined
184
+ ? []
185
+ : await collectPrTokens(shas, options.repository, deps);
186
+ const results = [...trailerTokens, ...prTokens].map(token => canonicalizeToken(token, options));
187
+ const canonical = results.flatMap(result => result.ref === undefined ? [] : [result.ref]);
188
+ const refs = [...new Set(canonical)];
189
+ const allSkipped = results.flatMap(result => result.reason === undefined
190
+ ? []
191
+ : [{ token: result.token, reason: result.reason }]);
192
+ const skipped = allSkipped.filter((entry, index) => allSkipped.findIndex(other => other.token === entry.token) === index);
193
+ return { refs, skipped, headSha };
194
+ }
195
+ //# sourceMappingURL=deploy-status-refs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-status-refs.js","sourceRoot":"","sources":["../../src/cli/deploy-status-refs.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAwCxD,MAAM,oBAAoB,GAAG,kDAAkD,CAAC;AAChF;2EAC2E;AAC3E,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACzC,gEAAgE;AAChE,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CACnB,KAAmB,EACnB,IAAY;IAEZ,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CACzE,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAC9C,CAAC;AACJ,CAAC;AACD,MAAM,iBAAiB,GAAG,yCAAyC,CAAC;AACpE,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AASpD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,OAAO;QACL,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC;QAC/B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MAAM,CAAC,MAAM,EAAE,CAAC,CACrD,CAAC;IACF,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAC/B,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACf,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CACvE,CAAC;IACF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACpC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `lisa deploy-status-sync` — the DSS-2 transition engine entry point.
3
+ *
4
+ * Given a deploy event (environment or branch + commit range), extract the
5
+ * work-item refs the range shipped, plan transitions over the config-sourced
6
+ * deploy ladder (pure planner), and execute them idempotently through the
7
+ * tracker adapter. Exit code 0 covers success INCLUDING explanatory no-ops
8
+ * and skips — a deploy job must not gate on tracker vocabulary; 1 is
9
+ * reserved for genuine errors (config validation, git/gh/API failures,
10
+ * unknown environment, or any per-item transition failure — remaining items
11
+ * are still processed first).
12
+ * @module cli/deploy-status-sync-cmd
13
+ */
14
+ import { type DeployStatusSyncDependencies, type DeployStatusSyncOptions } from "./deploy-status-sync-engine.js";
15
+ export type { DeployStatusSyncDependencies, DeployStatusSyncOptions, } from "./deploy-status-sync-engine.js";
16
+ /**
17
+ * Run the deploy-status-sync engine for one deploy event.
18
+ * @param options - CLI options
19
+ * @param deps - Injectable collaborators for tests
20
+ * @returns Intended process exit code
21
+ */
22
+ export declare function runDeployStatusSync(options: DeployStatusSyncOptions, deps?: DeployStatusSyncDependencies): Promise<number>;
23
+ //# sourceMappingURL=deploy-status-sync-cmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-status-sync-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/deploy-status-sync-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAGL,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAE7B,MAAM,gCAAgC,CAAC;AAExC,YAAY,EACV,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AAmCxC;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,uBAAuB,EAChC,IAAI,GAAE,4BAAiC,GACtC,OAAO,CAAC,MAAM,CAAC,CAyBjB"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * `lisa deploy-status-sync` — the DSS-2 transition engine entry point.
3
+ *
4
+ * Given a deploy event (environment or branch + commit range), extract the
5
+ * work-item refs the range shipped, plan transitions over the config-sourced
6
+ * deploy ladder (pure planner), and execute them idempotently through the
7
+ * tracker adapter. Exit code 0 covers success INCLUDING explanatory no-ops
8
+ * and skips — a deploy job must not gate on tracker vocabulary; 1 is
9
+ * reserved for genuine errors (config validation, git/gh/API failures,
10
+ * unknown environment, or any per-item transition failure — remaining items
11
+ * are still processed first).
12
+ * @module cli/deploy-status-sync-cmd
13
+ */
14
+ import { resolveRunContext, runResolved, } from "./deploy-status-sync-engine.js";
15
+ /**
16
+ * Validate the mutually-exclusive event selector and range options.
17
+ * @param options - CLI options
18
+ * @returns The normalized range, or an error message
19
+ */
20
+ function normalizeInputs(options) {
21
+ const hasEnvironment = options.environment !== undefined;
22
+ const hasBranch = options.branch !== undefined;
23
+ if (hasEnvironment === hasBranch) {
24
+ return {
25
+ problem: "Pass exactly one of --environment <env> or --branch <branch> to identify the deploy target.",
26
+ };
27
+ }
28
+ if (options.range !== undefined) {
29
+ if (options.range.includes("...")) {
30
+ return {
31
+ problem: `Invalid range "${options.range}": three-dot "..." selects the symmetric difference, which is never a deploy range. Pass the deployed range as <base>..<head> (two dots).`,
32
+ };
33
+ }
34
+ return { range: options.range };
35
+ }
36
+ if (options.before !== undefined && options.after !== undefined) {
37
+ return { range: `${options.before}..${options.after}` };
38
+ }
39
+ return {
40
+ problem: "Pass the deployed commit range as --range <base>..<head> (or --before <sha> --after <sha>).",
41
+ };
42
+ }
43
+ /**
44
+ * Run the deploy-status-sync engine for one deploy event.
45
+ * @param options - CLI options
46
+ * @param deps - Injectable collaborators for tests
47
+ * @returns Intended process exit code
48
+ */
49
+ export async function runDeployStatusSync(options, deps = {}) {
50
+ const log = deps.log ?? ((message) => console.log(message));
51
+ const error = deps.error ?? ((message) => console.error(message));
52
+ // In --json mode the machine payload is the ONLY stdout content; human
53
+ // narration would corrupt consumers that parse the output.
54
+ const human = options.json === true ? () => undefined : log;
55
+ const sinks = { log, error, human };
56
+ const cwd = deps.cwd ?? process.cwd();
57
+ const normalized = normalizeInputs(options);
58
+ if ("problem" in normalized) {
59
+ error(normalized.problem);
60
+ return 1;
61
+ }
62
+ try {
63
+ const context = await resolveRunContext(options, cwd);
64
+ if ("problem" in context) {
65
+ error(context.problem);
66
+ return 1;
67
+ }
68
+ return await runResolved(context, normalized.range, options, deps, sinks);
69
+ }
70
+ catch (cause) {
71
+ error(cause instanceof Error ? cause.message : String(cause));
72
+ return 1;
73
+ }
74
+ }
75
+ //# sourceMappingURL=deploy-status-sync-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-status-sync-cmd.js","sourceRoot":"","sources":["../../src/cli/deploy-status-sync-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,iBAAiB,EACjB,WAAW,GAIZ,MAAM,gCAAgC,CAAC;AAOxC;;;;GAIG;AACH,SAAS,eAAe,CACtB,OAAgC;IAEhC,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC;IACzD,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC;IAC/C,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO;YACL,OAAO,EACL,6FAA6F;SAChG,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAChC,IAAI,OAAO,CAAC,KAAK,CAAC,QAA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AU,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACtD,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;YACzB,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACvB,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,MAAM,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { type DeployLadder, type Tracker } from "../core/deploy-status-sync.js";
2
+ import { type JsonValue } from "../sync/json-path.js";
3
+ import { type TrackerAdapter, type TrackerAdapterOptions } from "./deploy-status-adapter.js";
4
+ import { type ExtractedRefs, type ExtractRefsOptions } from "./deploy-status-refs.js";
5
+ import { type DeployStatusSyncOptions, type Sinks } from "./deploy-status-sync-exec.js";
6
+ export type { DeployStatusSyncOptions, Sinks, } from "./deploy-status-sync-exec.js";
7
+ /** Injectable collaborators for the engine. */
8
+ export interface DeployStatusSyncDependencies {
9
+ /** Working directory (defaults to the process cwd) */
10
+ readonly cwd?: string;
11
+ /** Output sink (defaults to stdout) */
12
+ readonly log?: (message: string) => void;
13
+ /** Error sink (defaults to stderr) */
14
+ readonly error?: (message: string) => void;
15
+ /** Ref extractor (defaults to the real git/gh extractor) */
16
+ readonly extractRefs?: (options: ExtractRefsOptions) => Promise<ExtractedRefs>;
17
+ /** Adapter factory (defaults to {@link createTrackerAdapter}) */
18
+ readonly adapterFactory?: (options: TrackerAdapterOptions) => TrackerAdapter;
19
+ }
20
+ /** Resolved run context shared by the engine stages. */
21
+ export interface RunContext {
22
+ readonly config: JsonValue;
23
+ readonly tracker: Tracker;
24
+ readonly ladder: DeployLadder;
25
+ readonly env: string;
26
+ readonly branch: string;
27
+ }
28
+ /**
29
+ * Read the config and resolve the tracker, ladder, and environment.
30
+ * @param options - CLI options
31
+ * @param cwd - Working directory
32
+ * @returns Run context, or a decision-ready problem
33
+ */
34
+ export declare function resolveRunContext(options: DeployStatusSyncOptions, cwd: string): Promise<RunContext | {
35
+ readonly problem: string;
36
+ }>;
37
+ /**
38
+ * Run the engine over a resolved context: preflight the environment (an
39
+ * unconfigured env is an explanatory no-op, exit 0), extract refs, then
40
+ * fetch/plan/execute.
41
+ * @param context - Resolved run context
42
+ * @param range - Normalized commit range
43
+ * @param options - CLI options
44
+ * @param deps - Injectable collaborators
45
+ * @param sinks - Output sinks
46
+ * @returns Intended process exit code
47
+ */
48
+ export declare function runResolved(context: RunContext, range: string, options: DeployStatusSyncOptions, deps: DeployStatusSyncDependencies, sinks: Sinks): Promise<number>;
49
+ //# sourceMappingURL=deploy-status-sync-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-status-sync-engine.d.ts","sourceRoot":"","sources":["../../src/cli/deploy-status-sync-engine.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,OAAO,EACb,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,KAAK,EACX,MAAM,8BAA8B,CAAC;AAEtC,YA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,0 +1,214 @@
1
+ /**
2
+ * Deploy-status-sync engine internals (DSS-2): context resolution, ref
3
+ * extraction scoping, state fetching, and plan execution. The thin
4
+ * `deploy-status-sync-cmd` entry point validates CLI inputs and delegates
5
+ * here; tests drive the same seams through injectable dependencies.
6
+ * @module cli/deploy-status-sync-engine
7
+ */
8
+ import { readFile } from "node:fs/promises";
9
+ import * as path from "node:path";
10
+ import { resolveDeployLadder, } from "../core/deploy-status-sync.js";
11
+ import { planTransitions } from "../core/deploy-status-transition.js";
12
+ import { getAtPath, isJsonObject } from "../sync/json-path.js";
13
+ import { createTrackerAdapter, withDryRun, } from "./deploy-status-adapter.js";
14
+ import { extractWorkItemRefs, } from "./deploy-status-refs.js";
15
+ import { emitNoOp, executePlan, fetchStates, } from "./deploy-status-sync-exec.js";
16
+ const VALID_TRACKERS = new Set(["github", "jira", "linear"]);
17
+ /**
18
+ * Resolve the target environment from an explicit flag or the deployed
19
+ * branch via the ladder (raw `deploy.branches` catches skipped rungs so the
20
+ * planner can explain the missing done-map key).
21
+ * @param options - CLI options
22
+ * @param ladder - Resolved deploy ladder
23
+ * @param config - Parsed config
24
+ * @returns The environment name, or an error message
25
+ */
26
+ function resolveEnvironment(options, ladder, config) {
27
+ if (options.environment !== undefined)
28
+ return { env: options.environment };
29
+ const branch = options.branch ?? "";
30
+ const matching = ladder.rungs.filter(rung => rung.branch === branch);
31
+ const envs = [...new Set(matching.map(rung => rung.env))];
32
+ if (envs.length === 1 && envs[0] !== undefined)
33
+ return { env: envs[0] };
34
+ if (envs.length > 1) {
35
+ return {
36
+ problem: `Branch "${branch}" deploys to multiple environments (${envs.join(", ")}); pass --environment to disambiguate.`,
37
+ };
38
+ }
39
+ const branches = getAtPath(config, "deploy.branches");
40
+ const rawEnvs = isJsonObject(branches)
41
+ ? Object.keys(branches).filter(env => branches[env] === branch)
42
+ : [];
43
+ if (rawEnvs.length === 1 && rawEnvs[0] !== undefined) {
44
+ return { env: rawEnvs[0] };
45
+ }
46
+ if (rawEnvs.length > 1) {
47
+ // Name ALL candidates — silently picking the first would report a
48
+ // misleading no-op for an env the operator never meant.
49
+ return {
50
+ problem: `Branch "${branch}" deploys to multiple environments (${rawEnvs.join(", ")}); pass --environment to disambiguate.`,
51
+ };
52
+ }
53
+ return {
54
+ problem: `Branch "${branch}" is not a value of deploy.branches in .lisa.config.json.`,
55
+ };
56
+ }
57
+ /**
58
+ * Read the config and resolve the tracker, ladder, and environment.
59
+ * @param options - CLI options
60
+ * @param cwd - Working directory
61
+ * @returns Run context, or a decision-ready problem
62
+ */
63
+ export async function resolveRunContext(options, cwd) {
64
+ const configPath = path.resolve(cwd, options.config ?? ".lisa.config.json");
65
+ const config = JSON.parse(await readFile(configPath, "utf8"));
66
+ const tracker = getAtPath(config, "tracker");
67
+ if (typeof tracker !== "string" || !VALID_TRACKERS.has(tracker)) {
68
+ return {
69
+ problem: "'tracker' is not set in .lisa.config.json. Run /lisa:setup:jira (or :github, :linear) to configure.",
70
+ };
71
+ }
72
+ const ladder = resolveDeployLadder(config, tracker, configPath);
73
+ const resolvedEnv = resolveEnvironment(options, ladder, config);
74
+ if ("problem" in resolvedEnv)
75
+ return resolvedEnv;
76
+ const env = resolvedEnv.env;
77
+ return {
78
+ config,
79
+ tracker: tracker,
80
+ ladder,
81
+ env,
82
+ branch: options.branch ??
83
+ ladder.rungs.find(rung => rung.env === env)?.branch ??
84
+ env,
85
+ };
86
+ }
87
+ /**
88
+ * Extract the work-item refs for the run's tracker scope.
89
+ * @param context - Resolved run context
90
+ * @param range - Normalized commit range
91
+ * @param cwd - Working directory
92
+ * @param deps - Injectable collaborators
93
+ * @returns Extraction result
94
+ */
95
+ function extractRefsForRun(context, range, cwd, deps) {
96
+ const org = getAtPath(context.config, "github.org");
97
+ const repo = getAtPath(context.config, "github.repo");
98
+ const repository = typeof org === "string" && typeof repo === "string"
99
+ ? `${org}/${repo}`
100
+ : undefined;
101
+ const projectKey = getAtPath(context.config, context.tracker === "jira" ? "jira.project" : "linear.teamKey");
102
+ return (deps.extractRefs ?? extractWorkItemRefs)({
103
+ range,
104
+ tracker: context.tracker,
105
+ ...(repository === undefined ? {} : { repository }),
106
+ ...(typeof projectKey === "string" ? { projectKey } : {}),
107
+ cwd,
108
+ });
109
+ }
110
+ /**
111
+ * Fetch states, plan, and execute for the extracted refs.
112
+ * @param context - Resolved run context
113
+ * @param extracted - Extraction result
114
+ * @param options - CLI options
115
+ * @param deps - Injectable collaborators
116
+ * @param sinks - Output sinks
117
+ * @returns Intended process exit code
118
+ */
119
+ async function runPlanned(context, extracted, options, deps, sinks) {
120
+ const base = (deps.adapterFactory ?? createTrackerAdapter)({
121
+ tracker: context.tracker,
122
+ config: context.config,
123
+ doneStatuses: context.ladder.rungs.map(rung => rung.doneStatus),
124
+ cwd: deps.cwd ?? process.cwd(),
125
+ });
126
+ const adapter = options.dryRun === true
127
+ ? withDryRun(base, write => {
128
+ sinks.human(`dry-run: would ${write.method} ${write.ref}`);
129
+ })
130
+ : base;
131
+ const fetched = await fetchStates(extracted.refs, adapter);
132
+ const plan = planTransitions({
133
+ ladder: context.ladder,
134
+ env: context.env,
135
+ tracker: context.tracker,
136
+ branch: context.branch,
137
+ headSha: extracted.headSha,
138
+ items: fetched.items,
139
+ });
140
+ // The if-guard is load-bearing for code-organization/enforce-statement-
141
+ // order: `if` statements are exempt from the definitions-before-side-
142
+ // effects ordering, a bare forEach here is not.
143
+ if (fetched.failures.length > 0) {
144
+ fetched.failures.forEach(failure => {
145
+ sinks.error(`failed ${failure.ref}: ${failure.detail ?? ""}`);
146
+ });
147
+ }
148
+ if (plan.kind === "no-op") {
149
+ emitNoOp(sinks, options, plan);
150
+ return fetched.failures.length > 0 ? 1 : 0;
151
+ }
152
+ const results = await executePlan(plan, adapter, sinks);
153
+ const allResults = [...fetched.failures, ...results];
154
+ if (options.json === true) {
155
+ sinks.log(JSON.stringify({ env: context.env, plan, results: allResults }, null, 2));
156
+ }
157
+ sinks.human(`deploy-status-sync: ${String(allResults.length)} item(s) processed for ${context.env}${options.dryRun === true ? " (dry-run)" : ""}`);
158
+ return allResults.some(result => result.outcome === "failed") ? 1 : 0;
159
+ }
160
+ /**
161
+ * Run the engine over a resolved context: preflight the environment (an
162
+ * unconfigured env is an explanatory no-op, exit 0), extract refs, then
163
+ * fetch/plan/execute.
164
+ * @param context - Resolved run context
165
+ * @param range - Normalized commit range
166
+ * @param options - CLI options
167
+ * @param deps - Injectable collaborators
168
+ * @param sinks - Output sinks
169
+ * @returns Intended process exit code
170
+ */
171
+ export async function runResolved(context, range, options, deps, sinks) {
172
+ const preflight = planTransitions({
173
+ ladder: context.ladder,
174
+ env: context.env,
175
+ tracker: context.tracker,
176
+ branch: context.branch,
177
+ headSha: "",
178
+ items: [],
179
+ });
180
+ if (preflight.kind === "no-op") {
181
+ emitNoOp(sinks, options, preflight);
182
+ return 0;
183
+ }
184
+ const extracted = await extractRefsForRun(context, range, deps.cwd ?? process.cwd(), deps);
185
+ extracted.skipped.forEach(entry => {
186
+ // Skipped tokens come from untrusted commit messages and PR bodies —
187
+ // strip control characters (incl. ANSI escapes) AND Unicode bidi/
188
+ // formatting controls (Trojan-Source-style reordering: LRM/RLM,
189
+ // embeddings/overrides U+202A-E, isolates U+2066-9) before echoing so a
190
+ // crafted token cannot manipulate the operator's terminal.
191
+ const printable = [...entry.token]
192
+ .filter(character => {
193
+ const code = character.codePointAt(0) ?? 0;
194
+ const isControl = code < 0x20 || code === 0x7f || (code >= 0x80 && code <= 0x9f);
195
+ const isBidi = code === 0x20_0e ||
196
+ code === 0x20_0f ||
197
+ (code >= 0x20_2a && code <= 0x20_2e) ||
198
+ (code >= 0x20_66 && code <= 0x20_69);
199
+ return !isControl && !isBidi;
200
+ })
201
+ .join("");
202
+ sinks.human(`skipped token ${printable} (${entry.reason})`);
203
+ });
204
+ if (extracted.refs.length === 0) {
205
+ emitNoOp(sinks, options, {
206
+ kind: "no-op",
207
+ env: context.env,
208
+ reason: `no work-item refs found in ${range}`,
209
+ });
210
+ return 0;
211
+ }
212
+ return runPlanned(context, extracted, options, deps, sinks);
213
+ }
214
+ //# sourceMappingURL=deploy-status-sync-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-status-sync-engine.js","sourceRoot":"","sources":["../../src/cli/deploy-status-sync-engine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,mBAAmB,GAGpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAkB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,UAAU,GAGX,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,mBAAmB,GAGpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,QAAQ,EACR,WAAW,EACX,WAAW,GAGZ,MAAM,8BAA8B,CAAC;AAgCtC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAErE;;;;;;;;GAQG;AACH,SAAS,kBAAkB,CACzB,OAAgC,EAChC,MAAoB,EACpB,MAAiB;IAEjB,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS;QAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;IACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,E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