@codyswann/lisa 2.294.0 → 2.295.1

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 (133) hide show
  1. package/dist/cli/gate-commands.d.ts +1 -3
  2. package/dist/cli/gate-commands.d.ts.map +1 -1
  3. package/dist/cli/gate-commands.js +0 -26
  4. package/dist/cli/gate-commands.js.map +1 -1
  5. package/dist/cli/index.d.ts +7 -2
  6. package/dist/cli/index.d.ts.map +1 -1
  7. package/dist/cli/index.js +43 -4
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/cli/update-check.d.ts +0 -8
  10. package/dist/cli/update-check.d.ts.map +1 -1
  11. package/dist/cli/update-check.js +2 -4
  12. package/dist/cli/update-check.js.map +1 -1
  13. package/dist/core/project-config.d.ts +0 -3
  14. package/dist/core/project-config.d.ts.map +1 -1
  15. package/dist/core/project-config.js +40 -4
  16. package/dist/core/project-config.js.map +1 -1
  17. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  18. package/dist/core/upstream-evidence-manifest.js +2 -28
  19. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  20. package/dist/sync/registry.d.ts.map +1 -1
  21. package/dist/sync/registry.js +6 -3
  22. package/dist/sync/registry.js.map +1 -1
  23. package/package.json +1 -1
  24. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  26. package/plugins/lisa/rules/eager/config-resolution.md +0 -9
  27. package/plugins/lisa/rules/reference/config-resolution.md +0 -59
  28. package/plugins/lisa-agy/plugin.json +1 -1
  29. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  31. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  32. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-copilot/rules/eager/config-resolution.md +0 -9
  36. package/plugins/lisa-copilot/rules/reference/config-resolution.md +0 -59
  37. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +0 -59
  39. package/plugins/lisa-cursor/rules/config-resolution.mdc +0 -9
  40. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  42. package/plugins/lisa-expo-agy/plugin.json +1 -1
  43. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  47. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  48. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  53. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  57. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  58. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  63. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  67. package/plugins/lisa-rails-agy/plugin.json +1 -1
  68. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  72. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  73. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  77. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  78. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  80. package/plugins/src/base/rules/eager/config-resolution.md +0 -9
  81. package/plugins/src/base/rules/reference/config-resolution.md +0 -59
  82. package/dist/cli/deploy-status-adapter-github.d.ts +0 -20
  83. package/dist/cli/deploy-status-adapter-github.d.ts.map +0 -1
  84. package/dist/cli/deploy-status-adapter-github.js +0 -167
  85. package/dist/cli/deploy-status-adapter-github.js.map +0 -1
  86. package/dist/cli/deploy-status-adapter-jira.d.ts +0 -18
  87. package/dist/cli/deploy-status-adapter-jira.d.ts.map +0 -1
  88. package/dist/cli/deploy-status-adapter-jira.js +0 -215
  89. package/dist/cli/deploy-status-adapter-jira.js.map +0 -1
  90. package/dist/cli/deploy-status-adapter-linear.d.ts +0 -16
  91. package/dist/cli/deploy-status-adapter-linear.d.ts.map +0 -1
  92. package/dist/cli/deploy-status-adapter-linear.js +0 -204
  93. package/dist/cli/deploy-status-adapter-linear.js.map +0 -1
  94. package/dist/cli/deploy-status-adapter-shared.d.ts +0 -57
  95. package/dist/cli/deploy-status-adapter-shared.d.ts.map +0 -1
  96. package/dist/cli/deploy-status-adapter-shared.js +0 -62
  97. package/dist/cli/deploy-status-adapter-shared.js.map +0 -1
  98. package/dist/cli/deploy-status-adapter.d.ts +0 -49
  99. package/dist/cli/deploy-status-adapter.d.ts.map +0 -1
  100. package/dist/cli/deploy-status-adapter.js +0 -87
  101. package/dist/cli/deploy-status-adapter.js.map +0 -1
  102. package/dist/cli/deploy-status-refs.d.ts +0 -70
  103. package/dist/cli/deploy-status-refs.d.ts.map +0 -1
  104. package/dist/cli/deploy-status-refs.js +0 -195
  105. package/dist/cli/deploy-status-refs.js.map +0 -1
  106. package/dist/cli/deploy-status-sync-cmd.d.ts +0 -23
  107. package/dist/cli/deploy-status-sync-cmd.d.ts.map +0 -1
  108. package/dist/cli/deploy-status-sync-cmd.js +0 -75
  109. package/dist/cli/deploy-status-sync-cmd.js.map +0 -1
  110. package/dist/cli/deploy-status-sync-engine.d.ts +0 -49
  111. package/dist/cli/deploy-status-sync-engine.d.ts.map +0 -1
  112. package/dist/cli/deploy-status-sync-engine.js +0 -214
  113. package/dist/cli/deploy-status-sync-engine.js.map +0 -1
  114. package/dist/cli/deploy-status-sync-exec.d.ts +0 -73
  115. package/dist/cli/deploy-status-sync-exec.d.ts.map +0 -1
  116. package/dist/cli/deploy-status-sync-exec.js +0 -95
  117. package/dist/cli/deploy-status-sync-exec.js.map +0 -1
  118. package/dist/cli/kane-commands.d.ts +0 -21
  119. package/dist/cli/kane-commands.d.ts.map +0 -1
  120. package/dist/cli/kane-commands.js +0 -44
  121. package/dist/cli/kane-commands.js.map +0 -1
  122. package/dist/core/config-field-validation.d.ts +0 -19
  123. package/dist/core/config-field-validation.d.ts.map +0 -1
  124. package/dist/core/config-field-validation.js +0 -69
  125. package/dist/core/config-field-validation.js.map +0 -1
  126. package/dist/core/deploy-status-sync.d.ts +0 -103
  127. package/dist/core/deploy-status-sync.d.ts.map +0 -1
  128. package/dist/core/deploy-status-sync.js +0 -339
  129. package/dist/core/deploy-status-sync.js.map +0 -1
  130. package/dist/core/deploy-status-transition.d.ts +0 -97
  131. package/dist/core/deploy-status-transition.d.ts.map +0 -1
  132. package/dist/core/deploy-status-transition.js +0 -134
  133. package/dist/core/deploy-status-transition.js.map +0 -1
@@ -1,103 +0,0 @@
1
- /**
2
- * Deploy-status-sync ladder resolution and config schema (DSS-1).
3
- *
4
- * Pure, fs-free helpers that turn a parsed `.lisa.config.json` value into the
5
- * ordered environment ladder (env → deploy branch → tracker done status) the
6
- * deploy-status-sync flows walk, plus the validator for the optional
7
- * `deployStatusSync` section. The default done vocabularies live here — and
8
- * are consumed by `src/sync/registry.ts` — so the ladder resolver and the
9
- * sync registry share one source of truth without a runtime module cycle
10
- * (registry → project-config → this module would cycle if this module
11
- * imported the registry).
12
- * @module core/deploy-status-sync
13
- */
14
- import { type JsonValue } from "../sync/json-path.js";
15
- /** Tracker vendors whose done vocabulary can bind a deploy ladder. */
16
- export type Tracker = "jira" | "github" | "linear";
17
- /** One environment step of the deploy ladder. */
18
- export interface DeployLadderRung {
19
- /** Environment name as configured (e.g. `dev`, `prod`) */
20
- readonly env: string;
21
- /** Git branch that deploys to this environment */
22
- readonly branch: string;
23
- /** Tracker status/label a work item earns when deployed here */
24
- readonly doneStatus: string;
25
- }
26
- /** The resolved promotion ladder, ordered lowest environment first. */
27
- export interface DeployLadder {
28
- /** Ordered rungs (lowest environment first) */
29
- readonly rungs: readonly DeployLadderRung[];
30
- /** True when the ladder collapsed to a single terminal rung */
31
- readonly terminalOnly: boolean;
32
- /**
33
- * Highest-ranked env of the configured universe (post-alias), even when its
34
- * rung was skipped. Consumers gate terminal native closure on this — a
35
- * lower rung must never close items just because higher rungs were skipped.
36
- * Absent only when `deploy.branches` is empty.
37
- */
38
- readonly terminalEnv?: string;
39
- }
40
- /** Optional machine-written `deployStatusSync` section of the config. */
41
- export interface DeployStatusSyncConfig {
42
- /** Provisioning tier chosen at setup time */
43
- readonly tier?: string;
44
- /** Provisioned tracker artifact ids, keyed by artifact name */
45
- readonly provisioned?: Readonly<Record<string, string>>;
46
- /** How Linear deploy statuses are represented */
47
- readonly linearBinding?: "labels" | "states";
48
- /** ISO-8601 UTC timestamp of the last successful verification */
49
- readonly verifiedAt?: string;
50
- }
51
- /**
52
- * Default env-keyed done labels for label-driven trackers (GitHub, Linear).
53
- * Mirrored into the sync registry's `github.labels` / `linear.labels`
54
- * defaults — keep value-identical with what `lisa sync` populates.
55
- */
56
- export declare const ENV_DONE_LABEL_DEFAULTS: {
57
- readonly dev: "status:on-dev";
58
- readonly staging: "status:on-stg";
59
- readonly production: "status:done";
60
- };
61
- /**
62
- * Default env-keyed done statuses for JIRA workflows. Mirrored into the sync
63
- * registry's `jira.workflow` default — keep value-identical with what
64
- * `lisa sync` populates.
65
- */
66
- export declare const JIRA_DONE_STATUS_DEFAULTS: {
67
- readonly dev: "On Dev";
68
- readonly staging: "On Stg";
69
- readonly production: "Done";
70
- };
71
- /**
72
- * Config dot-path of a tracker's env-keyed done vocabulary. Exposed so
73
- * consumers (e.g. the transition engine's explanatory no-ops) can name the
74
- * exact missing config key without duplicating the vocabulary source map.
75
- * @param tracker - Tracker whose done map applies
76
- * @returns Dot-path inside `.lisa.config.json`
77
- */
78
- export declare function doneMapPath(tracker: Tracker): string;
79
- /**
80
- * Resolve the deploy promotion ladder for a tracker from parsed config.
81
- *
82
- * The env universe is the keys of `deploy.branches`, joined with the
83
- * tracker's done vocabulary (configured entries win over the default
84
- * tables). `prod` ↔ `production` alias as one env iff exactly one spelling
85
- * appears across the configured surfaces (branches, done map, order); the
86
- * rung reports the configured spelling. Absent or empty `deploy` yields an
87
- * empty ladder, never an error.
88
- * @param config - Parsed `.lisa.config.json` value
89
- * @param tracker - Tracker whose done vocabulary binds the ladder
90
- * @param source - Config source shown in errors
91
- * @returns The ordered ladder with its terminal-only collapse flag
92
- */
93
- export declare function resolveDeployLadder(config: JsonValue, tracker: Tracker, source: string): DeployLadder;
94
- /**
95
- * Validate the optional `deployStatusSync` config section. Unknown fields
96
- * inside the section are ignored in the typed view; the raw JSON round-trip
97
- * preserves them.
98
- * @param value - Untrusted section value
99
- * @param source - Config source shown in errors
100
- * @returns Typed section, or undefined when absent
101
- */
102
- export declare function validateDeployStatusSyncConfig(value: unknown, source: string): DeployStatusSyncConfig | undefined;
103
- //# sourceMappingURL=deploy-status-sync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy-status-sync.d.ts","sourceRoot":"","sources":["../../src/core/deploy-status-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAG9B,sEAAsE;AACtE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,uEAAuE;AACvE,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC5C,+DAA+D;IAC/D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,yEAAyE;AACzE,MAAM,WAAW,sBAAsB;IACrC,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD,iDAAiD;IACjD,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC7C,iEAAiE;IACjE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AASX;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpD;AAiOD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACb,YAAY,CA6Cd;AA2ED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,GACb,sBAAsB,GAAG,SAAS,CAiBpC"}
@@ -1,339 +0,0 @@
1
- /**
2
- * Deploy-status-sync ladder resolution and config schema (DSS-1).
3
- *
4
- * Pure, fs-free helpers that turn a parsed `.lisa.config.json` value into the
5
- * ordered environment ladder (env → deploy branch → tracker done status) the
6
- * deploy-status-sync flows walk, plus the validator for the optional
7
- * `deployStatusSync` section. The default done vocabularies live here — and
8
- * are consumed by `src/sync/registry.ts` — so the ladder resolver and the
9
- * sync registry share one source of truth without a runtime module cycle
10
- * (registry → project-config → this module would cycle if this module
11
- * imported the registry).
12
- * @module core/deploy-status-sync
13
- */
14
- import { getAtPath, isJsonObject, } from "../sync/json-path.js";
15
- import { optionalString } from "./config-field-validation.js";
16
- /**
17
- * Default env-keyed done labels for label-driven trackers (GitHub, Linear).
18
- * Mirrored into the sync registry's `github.labels` / `linear.labels`
19
- * defaults — keep value-identical with what `lisa sync` populates.
20
- */
21
- export const ENV_DONE_LABEL_DEFAULTS = {
22
- dev: "status:on-dev",
23
- staging: "status:on-stg",
24
- production: "status:done",
25
- };
26
- /**
27
- * Default env-keyed done statuses for JIRA workflows. Mirrored into the sync
28
- * registry's `jira.workflow` default — keep value-identical with what
29
- * `lisa sync` populates.
30
- */
31
- export const JIRA_DONE_STATUS_DEFAULTS = {
32
- dev: "On Dev",
33
- staging: "On Stg",
34
- production: "Done",
35
- };
36
- /** Config dot-path of each tracker's env-keyed done vocabulary. */
37
- const DONE_MAP_PATHS = {
38
- github: "github.labels.build.done",
39
- linear: "linear.labels.build.done",
40
- jira: "jira.workflow.done",
41
- };
42
- /**
43
- * Config dot-path of a tracker's env-keyed done vocabulary. Exposed so
44
- * consumers (e.g. the transition engine's explanatory no-ops) can name the
45
- * exact missing config key without duplicating the vocabulary source map.
46
- * @param tracker - Tracker whose done map applies
47
- * @returns Dot-path inside `.lisa.config.json`
48
- */
49
- export function doneMapPath(tracker) {
50
- return DONE_MAP_PATHS[tracker];
51
- }
52
- /** Default done vocabulary per tracker, used when config has no entry. */
53
- const DONE_DEFAULTS = {
54
- github: ENV_DONE_LABEL_DEFAULTS,
55
- linear: ENV_DONE_LABEL_DEFAULTS,
56
- jira: JIRA_DONE_STATUS_DEFAULTS,
57
- };
58
- /** Canonical promotion rank when `deploy.order` is absent (lowest first). */
59
- const CANONICAL_ENV_RANKS = {
60
- dev: 0,
61
- staging: 1,
62
- production: 2,
63
- };
64
- /**
65
- * Keep only the string-valued entries of a JSON object record.
66
- * @param value - JSON object record
67
- * @returns Record of the string-valued entries
68
- */
69
- function stringRecord(value) {
70
- return Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[1] === "string"));
71
- }
72
- /**
73
- * Read `deploy.branches` as an env → branch map, ignoring non-string values.
74
- * @param config - Parsed config value
75
- * @returns Env-to-branch record (empty when the section is absent)
76
- */
77
- function readBranches(config) {
78
- const branches = getAtPath(config, "deploy.branches");
79
- return isJsonObject(branches) ? stringRecord(branches) : {};
80
- }
81
- /**
82
- * Read the tracker's configured done vocabulary from config, if any.
83
- * @param config - Parsed config value
84
- * @param tracker - Tracker whose vocabulary path applies
85
- * @returns Configured env-keyed map, terminal string, or neither
86
- */
87
- function readConfiguredDone(config, tracker) {
88
- const done = getAtPath(config, DONE_MAP_PATHS[tracker]);
89
- if (typeof done === "string")
90
- return { terminal: done };
91
- if (!isJsonObject(done))
92
- return {};
93
- return { map: stringRecord(done) };
94
- }
95
- /**
96
- * Drop done-map entries whose value is EXACTLY the default table's value
97
- * for that env. `lisa sync` materializes the default map into config, so
98
- * such entries are not operator intent — they are invisible for ALL
99
- * purposes: stripped before the env-key union is computed, they never
100
- * block the sole `prod` ↔ `production` alias and never error. Only a
101
- * value that DIFFERS from the default is deliberate configuration.
102
- * @param doneMap - Configured env-keyed done map
103
- * @param defaults - Tracker default done vocabulary
104
- * @returns The done map without materialized-default entries
105
- */
106
- function stripMaterializedDefaults(doneMap, defaults) {
107
- return Object.fromEntries(Object.entries(doneMap).filter(([env, status]) => status !== defaults[env]));
108
- }
109
- /**
110
- * Reject a configured done entry whose environment has no deploy branch.
111
- * Materialized defaults are already stripped by the time this runs, so
112
- * every remaining entry is deliberate operator intent.
113
- * @param doneMap - Configured env-keyed done map (defaults stripped)
114
- * @param branchEnvs - Environments present in `deploy.branches`
115
- * @param source - Config source shown in errors
116
- */
117
- function assertDoneEnvsHaveBranches(doneMap, branchEnvs, source) {
118
- for (const [env, status] of Object.entries(doneMap)) {
119
- if (!branchEnvs.includes(env)) {
120
- throw new Error(`Invalid deploy configuration in ${source}: a done status ("${status}") is configured for environment "${env}", but deploy.branches has no "${env}" entry. Add deploy.branches.${env} (the git branch that deploys to ${env}) or remove "${env}" from the done map.`);
121
- }
122
- }
123
- }
124
- /**
125
- * Read `deploy.order` as a string array, if present. A non-string entry is a
126
- * decision-ready error, never silently dropped — dropping one would silently
127
- * change the promotion order.
128
- * @param config - Parsed config value
129
- * @param source - Config source shown in errors
130
- * @returns Ordered env names (lowest first), or undefined when absent
131
- */
132
- function readOrder(config, source) {
133
- const order = getAtPath(config, "deploy.order");
134
- if (!Array.isArray(order))
135
- return undefined;
136
- return order.map(entry => {
137
- if (typeof entry !== "string") {
138
- throw new Error(`Invalid deploy.order in ${source}: every entry must be an environment name string; found ${JSON.stringify(entry)}.`);
139
- }
140
- return entry;
141
- });
142
- }
143
- /**
144
- * Require `deploy.order` to name exactly the `deploy.branches` env set, with
145
- * no duplicate entries — a duplicate would otherwise survive set comparison
146
- * and produce duplicate rungs.
147
- * @param order - Configured order
148
- * @param branchEnvs - Environments present in `deploy.branches` (dupe-free)
149
- * @param source - Config source shown in errors
150
- */
151
- function assertOrderMatchesBranches(order, branchEnvs, source) {
152
- const orderSet = new Set(order);
153
- const matches = orderSet.size === order.length &&
154
- orderSet.size === branchEnvs.length &&
155
- branchEnvs.every(env => orderSet.has(env));
156
- if (!matches) {
157
- throw new Error(`Invalid deploy.order in ${source}: its environment names must exactly match the keys of deploy.branches. deploy.order has [${order.join(", ")}]; deploy.branches has [${branchEnvs.join(", ")}].`);
158
- }
159
- }
160
- /**
161
- * Order the configured environments lowest-first. `deploy.order` wins when
162
- * present; otherwise the canonical `dev < staging < production` rank applies
163
- * and any unrankable custom name (with more than one env) is a
164
- * decision-ready error rather than a guess.
165
- * @param branchEnvs - Environments present in `deploy.branches`
166
- * @param order - Configured `deploy.order`, if any
167
- * @param canonical - Alias-aware canonical name resolver
168
- * @param source - Config source shown in errors
169
- * @returns Environments ordered lowest first
170
- */
171
- function orderEnvironments(branchEnvs, order, canonical, source) {
172
- if (order !== undefined) {
173
- assertOrderMatchesBranches(order, branchEnvs, source);
174
- return order;
175
- }
176
- if (branchEnvs.length <= 1)
177
- return branchEnvs;
178
- const ranked = branchEnvs.map(env => {
179
- const rank = CANONICAL_ENV_RANKS[canonical(env)];
180
- if (rank === undefined) {
181
- throw new Error(`Invalid deploy configuration in ${source}: cannot order environment "${env}". Set deploy.order (environments listed lowest first, e.g. ["dev","staging","production"]) so Lisa knows the promotion order.`);
182
- }
183
- return { env, rank };
184
- });
185
- return [...ranked].sort((a, b) => a.rank - b.rank).map(entry => entry.env);
186
- }
187
- /**
188
- * Join ordered environments with their branch and done status. An env whose
189
- * done status resolves nowhere (possible only for custom names outside the
190
- * default tables) is skipped — a branch-only env is a deploy target without
191
- * tracker vocabulary, not an error.
192
- * @param input - Ordered envs, branch map, vocabularies, and alias resolver
193
- * @returns The joined rungs, lowest environment first
194
- */
195
- function buildRungs(input) {
196
- const { orderedEnvs, branches, done, defaults, canonical, terminalEnv } = input;
197
- return orderedEnvs.flatMap(env => {
198
- const branch = branches[env];
199
- const terminal = env === terminalEnv ? done.terminal : undefined;
200
- const doneStatus = done.map?.[env] ?? terminal ?? defaults[canonical(env)];
201
- return doneStatus === undefined || branch === undefined
202
- ? []
203
- : [{ env, branch, doneStatus }];
204
- });
205
- }
206
- /**
207
- * Resolve the deploy promotion ladder for a tracker from parsed config.
208
- *
209
- * The env universe is the keys of `deploy.branches`, joined with the
210
- * tracker's done vocabulary (configured entries win over the default
211
- * tables). `prod` ↔ `production` alias as one env iff exactly one spelling
212
- * appears across the configured surfaces (branches, done map, order); the
213
- * rung reports the configured spelling. Absent or empty `deploy` yields an
214
- * empty ladder, never an error.
215
- * @param config - Parsed `.lisa.config.json` value
216
- * @param tracker - Tracker whose done vocabulary binds the ladder
217
- * @param source - Config source shown in errors
218
- * @returns The ordered ladder with its terminal-only collapse flag
219
- */
220
- export function resolveDeployLadder(config, tracker, source) {
221
- const branches = readBranches(config);
222
- const branchEnvs = Object.keys(branches);
223
- if (branchEnvs.length === 0)
224
- return { rungs: [], terminalOnly: false };
225
- const raw = readConfiguredDone(config, tracker);
226
- // Materialized defaults are invisible everywhere: strip them BEFORE the
227
- // union so they can never block the sole alias or raise an error.
228
- const doneMap = raw.map === undefined
229
- ? undefined
230
- : stripMaterializedDefaults(raw.map, DONE_DEFAULTS[tracker]);
231
- const done = {
232
- ...(doneMap === undefined ? {} : { map: doneMap }),
233
- ...(raw.terminal === undefined ? {} : { terminal: raw.terminal }),
234
- };
235
- const order = readOrder(config, source);
236
- const union = new Set([
237
- ...branchEnvs,
238
- ...Object.keys(doneMap ?? {}),
239
- ...(order ?? []),
240
- ]);
241
- const soleProdAlias = union.has("prod") && !union.has("production");
242
- const canonical = (env) => soleProdAlias && env === "prod" ? "production" : env;
243
- if (doneMap !== undefined) {
244
- assertDoneEnvsHaveBranches(doneMap, branchEnvs, source);
245
- }
246
- const ordered = orderEnvironments(branchEnvs, order, canonical, source);
247
- const terminalEnv = ordered.at(-1);
248
- const rungs = buildRungs({
249
- orderedEnvs: ordered,
250
- branches,
251
- done,
252
- defaults: DONE_DEFAULTS[tracker],
253
- canonical,
254
- terminalEnv,
255
- });
256
- // terminalOnly guards DSS-2's native closure: a sole surviving LOWER rung
257
- // (skip-collapsed ladder) must never be treated as the terminal env.
258
- const terminalOnly = rungs.length === 1 && rungs[0]?.env === terminalEnv;
259
- return {
260
- rungs,
261
- terminalOnly,
262
- ...(terminalEnv === undefined ? {} : { terminalEnv }),
263
- };
264
- }
265
- /** Strict ISO-8601 UTC timestamp (`Z` suffix, optional milliseconds). */
266
- const ISO_UTC_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/u;
267
- /**
268
- * Validate the optional provisioned-artifact id map.
269
- * @param value - Untrusted field value
270
- * @param source - Config source shown in errors
271
- * @returns Valid id record or undefined
272
- */
273
- function validateProvisioned(value, source) {
274
- if (value === undefined)
275
- return undefined;
276
- if (!isJsonObject(value)) {
277
- throw new Error(`Invalid deployStatusSync.provisioned in ${source}: expected an object`);
278
- }
279
- return Object.fromEntries(Object.entries(value).flatMap(([key, id]) => {
280
- const valid = optionalString(id, source, `deployStatusSync.provisioned.${key}`);
281
- return valid === undefined ? [] : [[key, valid]];
282
- }));
283
- }
284
- /**
285
- * Validate the optional Linear binding mode.
286
- * @param value - Untrusted field value
287
- * @param source - Config source shown in errors
288
- * @returns Valid binding or undefined
289
- */
290
- function validateLinearBinding(value, source) {
291
- if (value === undefined)
292
- return undefined;
293
- if (value !== "labels" && value !== "states") {
294
- throw new Error(`Invalid deployStatusSync.linearBinding in ${source}: expected "labels" or "states"`);
295
- }
296
- return value;
297
- }
298
- /**
299
- * Validate the optional verification timestamp as strict ISO-8601 UTC.
300
- * @param value - Untrusted field value
301
- * @param source - Config source shown in errors
302
- * @returns Valid timestamp or undefined
303
- */
304
- function validateVerifiedAt(value, source) {
305
- if (value === undefined)
306
- return undefined;
307
- if (typeof value !== "string" ||
308
- !ISO_UTC_PATTERN.test(value) ||
309
- Number.isNaN(Date.parse(value))) {
310
- throw new Error(`Invalid deployStatusSync.verifiedAt in ${source}: expected an ISO-8601 UTC timestamp (e.g. 2026-01-01T00:00:00Z)`);
311
- }
312
- return value;
313
- }
314
- /**
315
- * Validate the optional `deployStatusSync` config section. Unknown fields
316
- * inside the section are ignored in the typed view; the raw JSON round-trip
317
- * preserves them.
318
- * @param value - Untrusted section value
319
- * @param source - Config source shown in errors
320
- * @returns Typed section, or undefined when absent
321
- */
322
- export function validateDeployStatusSyncConfig(value, source) {
323
- if (value === undefined)
324
- return undefined;
325
- if (!isJsonObject(value)) {
326
- throw new Error(`Invalid deployStatusSync in ${source}: expected an object`);
327
- }
328
- const tier = optionalString(value.tier, source, "deployStatusSync.tier");
329
- const provisioned = validateProvisioned(value.provisioned, source);
330
- const linearBinding = validateLinearBinding(value.linearBinding, source);
331
- const verifiedAt = validateVerifiedAt(value.verifiedAt, source);
332
- return {
333
- ...(tier === undefined ? {} : { tier }),
334
- ...(provisioned === undefined ? {} : { provisioned }),
335
- ...(linearBinding === undefined ? {} : { linearBinding }),
336
- ...(verifiedAt === undefined ? {} : { verifiedAt }),
337
- };
338
- }
339
- //# sourceMappingURL=deploy-status-sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy-status-sync.js","sourceR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nH,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,8BAA8B,CAC5C,KAAc,EACd,MAAc;IAEd,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,+BAA+B,MAAM,sBAAsB,CAC5D,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,uBAAuB,CAAC,CAAC;IACzE,MAAM,WAAW,GAAG,mBAAmB,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACnE,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACzE,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAChE,OAAO;QACL,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QACvC,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;QACrD,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC;QACzD,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC"}
@@ -1,97 +0,0 @@
1
- /**
2
- * Pure transition planner for deploy-status-sync (DSS-2).
3
- *
4
- * Given the resolved deploy ladder, a target environment, and the fetched
5
- * tracker item states, decide — with zero IO — what should happen to each
6
- * item: promote to the rung's done status (closing natively only at the
7
- * universe's terminal env), skip items at-or-beyond the rung (never moving
8
- * anything backward), skip containers per `leaf-only-lifecycle`, and turn an
9
- * unconfigured environment into an explanatory no-op naming the exact
10
- * missing config key. All status vocabulary is config-sourced via the DSS-1
11
- * resolver's ladder; this module never invents status names.
12
- * @module core/deploy-status-transition
13
- */
14
- import { type DeployLadder, type DeployLadderRung, type Tracker } from "./deploy-status-sync.js";
15
- /** Marker prefixing every managed comment the engine writes. */
16
- export declare const DEPLOY_STATUS_SYNC_MARKER = "[lisa-deploy-status-sync]";
17
- /** Vendor-neutral snapshot of one tracker item, fetched by an adapter. */
18
- export interface TrackerItemState {
19
- /** Canonical work-item ref (`owner/repo#N` or `KEY-N`) */
20
- readonly ref: string;
21
- /** Raw item type (e.g. `Epic`, `type:Story`), when the tracker exposes it */
22
- readonly type?: string;
23
- /** Number of child items not yet terminal */
24
- readonly openChildren: number;
25
- /** Current status within the configured done vocabulary, when recognizable */
26
- readonly currentStatus?: string;
27
- /** True when the item is natively closed/terminal */
28
- readonly closed: boolean;
29
- }
30
- /** Promote one leaf to the rung's done status (and optionally close). */
31
- export interface PromoteAction {
32
- readonly kind: "promote";
33
- readonly ref: string;
34
- /** Config-sourced done status of the target rung */
35
- readonly doneStatus: string;
36
- /** True only at the universe's terminal env (native closure) */
37
- readonly close: boolean;
38
- /** Deterministic managed-comment body (marker-prefixed, no timestamps) */
39
- readonly commentBody: string;
40
- }
41
- /** Skip an item already at-or-beyond the target rung — zero writes. */
42
- export interface SkipAtOrBeyondAction {
43
- readonly kind: "skip-at-or-beyond";
44
- readonly ref: string;
45
- readonly reason: string;
46
- }
47
- /** Skip a container per leaf-only-lifecycle, with a rollup comment. */
48
- export interface SkipContainerAction {
49
- readonly kind: "skip-container";
50
- readonly ref: string;
51
- readonly reason: string;
52
- /** Deterministic rollup body (identical across env events) */
53
- readonly commentBody: string;
54
- }
55
- /** Skip a closed item whose status is outside the config vocabulary. */
56
- export interface SkipUnrecognizedStatusAction {
57
- readonly kind: "skip-unrecognized-status";
58
- readonly ref: string;
59
- readonly reason: string;
60
- }
61
- /** One planned action for one extracted work-item ref. */
62
- export type ItemAction = PromoteAction | SkipAtOrBeyondAction | SkipContainerAction | SkipUnrecognizedStatusAction;
63
- /** Input to {@link planTransitions}. */
64
- export interface TransitionPlanInput {
65
- /** Resolved ladder from the DSS-1 resolver (config-sourced vocabulary) */
66
- readonly ladder: DeployLadder;
67
- /** Environment the deploy landed in */
68
- readonly env: string;
69
- /** Tracker vendor (names the done-map config key in no-ops) */
70
- readonly tracker: Tracker;
71
- /** Branch that deployed (comment context only) */
72
- readonly branch: string;
73
- /** Head SHA of the deployed range (comment context only) */
74
- readonly headSha: string;
75
- /** Fetched item states for every extracted ref */
76
- readonly items: readonly TrackerItemState[];
77
- }
78
- /** The full plan: either per-item actions or an explanatory no-op. */
79
- export type TransitionPlan = {
80
- readonly kind: "no-op";
81
- readonly env: string;
82
- /** Operator-readable explanation naming the missing config key */
83
- readonly reason: string;
84
- } | {
85
- readonly kind: "plan";
86
- readonly env: string;
87
- readonly rung: DeployLadderRung;
88
- readonly actions: readonly ItemAction[];
89
- };
90
- /**
91
- * Plan all transitions for a deploy event. Pure — performs no IO; callers
92
- * fetch item states through an adapter and execute the returned actions.
93
- * @param input - Ladder, env, tracker, range context, and item states
94
- * @returns Explanatory no-op or per-item action plan
95
- */
96
- export declare function planTransitions(input: TransitionPlanInput): TransitionPlan;
97
- //# sourceMappingURL=deploy-status-transition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy-status-transition.d.ts","sourceRoot":"","sources":["../../src/core/deploy-status-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACb,MAAM,yBAAyB,CAAC;AAEjC,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAErE,0EAA0E;AAC1E,MAAM,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