@tacuchi/agent-workflow-cli 25.4.0 → 25.6.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.
- package/README.md +2 -0
- package/dist/application/cut-intent-ledger.js +164 -0
- package/dist/application/cut-intent-ledger.js.map +1 -0
- package/dist/application/export-service.js +253 -37
- package/dist/application/export-service.js.map +1 -1
- package/dist/application/history-publications.js +76 -0
- package/dist/application/history-publications.js.map +1 -0
- package/dist/application/lineage-service.js +119 -0
- package/dist/application/lineage-service.js.map +1 -0
- package/dist/application/paths-service.js +8 -0
- package/dist/application/paths-service.js.map +1 -1
- package/dist/application/persist-service.js +9 -3
- package/dist/application/persist-service.js.map +1 -1
- package/dist/application/release-pass-ledger.js +327 -0
- package/dist/application/release-pass-ledger.js.map +1 -0
- package/dist/application/resume-service.js +9 -5
- package/dist/application/resume-service.js.map +1 -1
- package/dist/application/retirement/prepare.js +2 -2
- package/dist/application/retirement/prepare.js.map +1 -1
- package/dist/application/retirement/resolve.js.map +1 -1
- package/dist/application/session-resolver.js +8 -2
- package/dist/application/session-resolver.js.map +1 -1
- package/dist/application/{retirement/graph.js → workline-graph.js} +18 -12
- package/dist/application/workline-graph.js.map +1 -0
- package/dist/application/workline-index-service.js +200 -16
- package/dist/application/workline-index-service.js.map +1 -1
- package/dist/application/workspace-materialization-service.js +40 -4
- package/dist/application/workspace-materialization-service.js.map +1 -1
- package/dist/application/worktree-service.js +276 -6
- package/dist/application/worktree-service.js.map +1 -1
- package/dist/cli/commands/cut-intent.js +176 -0
- package/dist/cli/commands/cut-intent.js.map +1 -0
- package/dist/cli/commands/export.js +64 -15
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/cli/commands/index.js +10 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/release-pass.js +228 -0
- package/dist/cli/commands/release-pass.js.map +1 -0
- package/dist/cli/commands/resume.js +3 -0
- package/dist/cli/commands/resume.js.map +1 -1
- package/dist/cli/commands/status.js +7 -0
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/worktree.js +19 -5
- package/dist/cli/commands/worktree.js.map +1 -1
- package/dist/cli/help-groups.js +11 -0
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/main.js +27 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/parser.js +4 -0
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/tui/data/recommended-skills.js +39 -10
- package/dist/cli/tui/data/recommended-skills.js.map +1 -1
- package/dist/domain/cut-intent.js +79 -0
- package/dist/domain/cut-intent.js.map +1 -0
- package/dist/domain/flow/authority.js +8 -0
- package/dist/domain/flow/authority.js.map +1 -1
- package/dist/domain/release-pass.js +104 -0
- package/dist/domain/release-pass.js.map +1 -0
- package/dist/runtime/namespace-resolver.js +3 -10
- package/dist/runtime/namespace-resolver.js.map +1 -1
- package/dist/runtime/workline-marker.js +70 -0
- package/dist/runtime/workline-marker.js.map +1 -0
- package/package.json +1 -1
- package/skills/w/commands/export-scripts.md +13 -12
- package/skills/w/exports/README.md +4 -2
- package/skills/w/exports/export-scripts/EXPORT.md +39 -45
- package/dist/application/retirement/graph.js.map +0 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { appendCutIntent, currentIntentOf, cutIntentLedgerPath, readCutIntents, readingForPlan, } from "../../application/cut-intent-ledger.js";
|
|
2
|
+
import { CutIntentError } from "../../domain/cut-intent.js";
|
|
3
|
+
import { formatNodeId } from "../../domain/workline-node.js";
|
|
4
|
+
import { nodeFromDocPath } from "../../domain/workline-node.js";
|
|
5
|
+
import { flagValue } from "../parser.js";
|
|
6
|
+
import { fail } from "../render.js";
|
|
7
|
+
const USAGE = "uso: cut-intent [show] [--plan <NNN|ruta>] [--spec <NNN|ruta>] | cut-intent declare --spec <NNN|ruta> --order <NNN,NNN> [--deferred <NNN,…>] [--cause <texto>]";
|
|
8
|
+
/**
|
|
9
|
+
* The order and grouping a person meant for a cut — declared, read back and
|
|
10
|
+
* corrected.
|
|
11
|
+
*
|
|
12
|
+
* Its own surface rather than a flag on `status`, for the reason the record
|
|
13
|
+
* exists: this is the ONE place a human intention enters the workspace, and
|
|
14
|
+
* everything else derives from it. Folding the declaration into a board that
|
|
15
|
+
* otherwise only reports would blur which of the two a given number came from.
|
|
16
|
+
*
|
|
17
|
+
* Correcting is declaring again. There is no edit verb and no delete verb,
|
|
18
|
+
* because the ledger underneath has neither: the new record supersedes the old
|
|
19
|
+
* one for reading and the old one stays readable above it, which is what makes a
|
|
20
|
+
* reorder something a person can review instead of merely inherit.
|
|
21
|
+
*/
|
|
22
|
+
export const cutIntentCommand = {
|
|
23
|
+
name: "cut-intent",
|
|
24
|
+
describe: "The intent with which a cut of plans born from one spec was meant to be executed: which plans go together, in what order inside the group, and which are held back for a later pass. 'cut-intent' or 'cut-intent show' reads it back — with --plan it answers for one plan, and a plan nobody declared gets an explicit answer, never an empty list. 'cut-intent declare --spec <NNN> --order <NNN,NNN>' records it; declaring again is how you correct it, and the superseded record is kept, never rewritten. The book is append-only under the workspace namespace, next to HISTORY.md. It constrains nothing: executing out of the declared order is allowed and only warned about. Usage: aw cut-intent [show] [--plan <NNN|ruta>] | aw cut-intent declare --spec <NNN> --order <NNN,NNN> [--deferred <NNN,…>] [--cause <texto>].",
|
|
25
|
+
async execute(args, ctx) {
|
|
26
|
+
const verb = args.rest[0] ?? "show";
|
|
27
|
+
if (verb !== "show" && verb !== "declare")
|
|
28
|
+
return fail("INVALID_INPUT", USAGE, { error: USAGE });
|
|
29
|
+
if (verb === "show")
|
|
30
|
+
return await show(args, ctx);
|
|
31
|
+
return await declare(args, ctx);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
async function show(args, ctx) {
|
|
35
|
+
const read = await readCutIntents(ctx.fs, ctx.paths);
|
|
36
|
+
const planRef = flagValue(args, "plan");
|
|
37
|
+
const specRef = flagValue(args, "spec");
|
|
38
|
+
if (planRef !== undefined) {
|
|
39
|
+
const plan = nodeOf(planRef, "plan");
|
|
40
|
+
if (plan === null)
|
|
41
|
+
return fail("INVALID_INPUT", refusal(planRef, "plan"), { error: USAGE });
|
|
42
|
+
return {
|
|
43
|
+
ok: true,
|
|
44
|
+
data: { plan: formatNodeId(plan), ...readingForPlan(read, plan) },
|
|
45
|
+
exitCode: 0,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (specRef !== undefined) {
|
|
49
|
+
const spec = nodeOf(specRef, "spec");
|
|
50
|
+
if (spec === null)
|
|
51
|
+
return fail("INVALID_INPUT", refusal(specRef, "spec"), { error: USAGE });
|
|
52
|
+
const current = currentIntentOf(read.events, spec);
|
|
53
|
+
if (current === null) {
|
|
54
|
+
return {
|
|
55
|
+
ok: true,
|
|
56
|
+
data: {
|
|
57
|
+
spec: formatNodeId(spec),
|
|
58
|
+
declared: false,
|
|
59
|
+
reason: `nadie declaró una intención de corte para '${formatNodeId(spec)}'`,
|
|
60
|
+
unreadable: read.unreadable,
|
|
61
|
+
},
|
|
62
|
+
exitCode: 0,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
ok: true,
|
|
67
|
+
data: { spec: formatNodeId(spec), declared: true, at: current.at, intent: current.intent },
|
|
68
|
+
exitCode: 0,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// The whole book, current-first: one row per spec that has an intent in force,
|
|
72
|
+
// and the superseded records counted rather than listed — they are history, and
|
|
73
|
+
// a listing that mixed them with the current one would read as a contradiction.
|
|
74
|
+
const specs = new Map();
|
|
75
|
+
for (const event of read.events)
|
|
76
|
+
specs.set(formatNodeId(event.intent.spec), event.intent.spec);
|
|
77
|
+
const cuts = [...specs.values()]
|
|
78
|
+
.map((spec) => currentIntentOf(read.events, spec))
|
|
79
|
+
.filter((event) => event !== null)
|
|
80
|
+
.map((event) => ({
|
|
81
|
+
spec: formatNodeId(event.intent.spec),
|
|
82
|
+
at: event.at,
|
|
83
|
+
intent: event.intent,
|
|
84
|
+
}));
|
|
85
|
+
return {
|
|
86
|
+
ok: true,
|
|
87
|
+
data: {
|
|
88
|
+
path: cutIntentLedgerPath(ctx.paths),
|
|
89
|
+
cuts,
|
|
90
|
+
records: read.events.length,
|
|
91
|
+
superseded: read.events.length - cuts.length,
|
|
92
|
+
unreadable: read.unreadable,
|
|
93
|
+
},
|
|
94
|
+
exitCode: 0,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async function declare(args, ctx) {
|
|
98
|
+
const specRef = flagValue(args, "spec");
|
|
99
|
+
const orderRef = flagValue(args, "order");
|
|
100
|
+
if (specRef === undefined || orderRef === undefined) {
|
|
101
|
+
return fail("INVALID_INPUT", USAGE, { error: USAGE });
|
|
102
|
+
}
|
|
103
|
+
const spec = nodeOf(specRef, "spec");
|
|
104
|
+
if (spec === null)
|
|
105
|
+
return fail("INVALID_INPUT", refusal(specRef, "spec"), { error: USAGE });
|
|
106
|
+
const order = nodeList(orderRef);
|
|
107
|
+
const deferred = nodeList(flagValue(args, "deferred") ?? "");
|
|
108
|
+
if (order === null || deferred === null) {
|
|
109
|
+
return fail("INVALID_INPUT", refusal(orderRef, "plan"), { error: USAGE });
|
|
110
|
+
}
|
|
111
|
+
const intent = { spec, order, deferred };
|
|
112
|
+
const at = new Date().toISOString();
|
|
113
|
+
const cause = flagValue(args, "cause");
|
|
114
|
+
try {
|
|
115
|
+
await appendCutIntent(ctx.fs, ctx.paths, {
|
|
116
|
+
at,
|
|
117
|
+
intent,
|
|
118
|
+
...(cause !== undefined ? { cause } : {}),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (error instanceof CutIntentError)
|
|
123
|
+
return fail(error.code, error.message, { error: error.message });
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
const read = await readCutIntents(ctx.fs, ctx.paths);
|
|
127
|
+
const previous = read.events.filter((e) => formatNodeId(e.intent.spec) === formatNodeId(spec));
|
|
128
|
+
return {
|
|
129
|
+
ok: true,
|
|
130
|
+
data: {
|
|
131
|
+
declared: true,
|
|
132
|
+
at,
|
|
133
|
+
intent,
|
|
134
|
+
path: cutIntentLedgerPath(ctx.paths),
|
|
135
|
+
// Said explicitly on a correction, because the value of an append-only
|
|
136
|
+
// book is only real if the person can see that the earlier record survived.
|
|
137
|
+
supersedes: previous.length - 1,
|
|
138
|
+
},
|
|
139
|
+
exitCode: 0,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A node from a bare correlative or from a workspace-relative document path.
|
|
144
|
+
*
|
|
145
|
+
* Both spellings are accepted because both are what a person has at hand: the
|
|
146
|
+
* board prints numbers and the flows pass paths. The path form goes through
|
|
147
|
+
* `nodeFromDocPath`, the one place that decides what a path IS, so this never
|
|
148
|
+
* becomes a second spelling of that rule.
|
|
149
|
+
*/
|
|
150
|
+
function nodeOf(reference, kind) {
|
|
151
|
+
const trimmed = reference.trim();
|
|
152
|
+
if (trimmed.length === 0)
|
|
153
|
+
return null;
|
|
154
|
+
if (/^\d{3,}$/.test(trimmed))
|
|
155
|
+
return { kind, key: trimmed };
|
|
156
|
+
const fromPath = nodeFromDocPath(trimmed);
|
|
157
|
+
return fromPath !== null && fromPath.kind === kind ? fromPath : null;
|
|
158
|
+
}
|
|
159
|
+
function nodeList(raw) {
|
|
160
|
+
const parts = raw
|
|
161
|
+
.split(",")
|
|
162
|
+
.map((part) => part.trim())
|
|
163
|
+
.filter((part) => part.length > 0);
|
|
164
|
+
const nodes = [];
|
|
165
|
+
for (const part of parts) {
|
|
166
|
+
const node = nodeOf(part, "plan");
|
|
167
|
+
if (node === null)
|
|
168
|
+
return null;
|
|
169
|
+
nodes.push(node);
|
|
170
|
+
}
|
|
171
|
+
return nodes;
|
|
172
|
+
}
|
|
173
|
+
function refusal(reference, kind) {
|
|
174
|
+
return `'${reference}' no nombra ${kind === "spec" ? "una spec" : "un plan"}: usá su correlativo (por ejemplo 045) o su ruta en el workspace`;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=cut-intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cut-intent.js","sourceRoot":"","sources":["../../../src/cli/commands/cut-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAuB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAmB,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,MAAM,KAAK,GACT,gKAAgK,CAAC;AAEnK;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,IAAI,EAAE,YAAY;IAClB,QAAQ,EACN,wyBAAwyB;IAC1yB,KAAK,CAAC,OAAO,CAAC,IAAgB,EAAE,GAAe;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QACpC,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,SAAS;YACvC,OAAO,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAExD,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO,MAAM,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAClD,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;CACF,CAAC;AAEF,KAAK,UAAU,IAAI,CAAC,IAAgB,EAAE,GAAe;IACnD,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,KAAK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CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;IAC5D,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IAC1C,OAAO,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AACvE,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,MAAM,KAAK,GAAG,GAAG;SACd,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAClC,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,SAAiB,EAAE,IAAqB;IACvD,OAAO,IAAI,SAAS,eAAe,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,kEAAkE,CAAC;AAChJ,CAAC"}
|
|
@@ -6,7 +6,7 @@ const DESCRIBES = {
|
|
|
6
6
|
diagrams: "Publica un dossier de diagramas (README + Markdown, DSL opcional) en docs/diagrams.",
|
|
7
7
|
manuals: "Publica un dossier de manuales en docs/manuals; docs/manuals/INDEX.md es el único archivo sobrescribible y exige --overwrite.",
|
|
8
8
|
reports: "Publica un informe acotado en docs/reports.",
|
|
9
|
-
scripts: "Consolida el SQL pendiente en un bundle de docs/scripts (00-ROLLBACK.sql + forwards continuos + README). NUNCA ejecuta SQL.",
|
|
9
|
+
scripts: "Consolida el SQL pendiente en un bundle de docs/scripts (00-ROLLBACK.sql + forwards continuos + README). NUNCA ejecuta SQL. El origen se compone: --from sessions|bundles|workspace elige la base, --exclude <nombre> (repetible) le resta piezas y --environment <ambiente> deja fuera los bundles que el libro de pases registra como aplicados allí. Sin ninguno de los tres, la base es el corpus de sesiones, igual que siempre.",
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* The answer envelope, published where an executor can read it WITHOUT running
|
|
@@ -32,7 +32,7 @@ const ENVELOPE = [
|
|
|
32
32
|
" state: proposed | ambiguous | unsupported.",
|
|
33
33
|
"",
|
|
34
34
|
" proposed artifacts: [{path, content}] — cada path dentro del destino que el request declara en 'allowed_destinations'.",
|
|
35
|
-
" scope: el 'scope' del request, copiado TAL CUAL. Es el alcance con el que se
|
|
35
|
+
" scope: el 'scope' del request, copiado TAL CUAL. Es el alcance con el que se preparó —incluidos 'from', 'exclude' y 'environment'—: validate y apply lo leen en vez de re-derivarlo, así que NO hace falta repetir --sessions/--since/--source/--date/--from/--exclude/--environment. Repetirlos con otro valor se rechaza.",
|
|
36
36
|
"",
|
|
37
37
|
" ambiguous reason: por qué no se puede decidir. No se escribe nada.",
|
|
38
38
|
" unsupported reason: por qué la operación no aplica. No se escribe nada.",
|
|
@@ -47,7 +47,7 @@ const ENVELOPE = [
|
|
|
47
47
|
function exportCommand(category) {
|
|
48
48
|
return {
|
|
49
49
|
name: `export-${category}`,
|
|
50
|
-
describe: `${DESCRIBES[category]} Escribe SOLO en su carpeta y nunca crea una sesión. Usage: aw export-${category} prepare | validate | apply --approval <digest> [--overwrite] [--sessions <a,b>] [--since <YYYY-MM-DD>] [--source <alias>] [--date <YYYY-MM-DD>].
|
|
50
|
+
describe: `${DESCRIBES[category]} Escribe SOLO en su carpeta y nunca crea una sesión. Usage: aw export-${category} prepare | validate | apply --approval <digest> [--overwrite] [--sessions <a,b>] [--since <YYYY-MM-DD>] [--source <alias>] [--date <YYYY-MM-DD>]${category === "scripts" ? " [--from sessions|bundles|workspace] [--exclude <nombre>] [--environment <ambiente>]" : ""}.
|
|
51
51
|
|
|
52
52
|
${ENVELOPE}`,
|
|
53
53
|
async execute(args, ctx) {
|
|
@@ -78,18 +78,8 @@ ${ENVELOPE}`,
|
|
|
78
78
|
const data = result.data;
|
|
79
79
|
if (data === undefined)
|
|
80
80
|
return "";
|
|
81
|
-
if (data.stage === "prepare")
|
|
82
|
-
|
|
83
|
-
const lines = [
|
|
84
|
-
`export-${category} · prepare (${request.metrics.request_bytes} B)`,
|
|
85
|
-
` Destino ${data.prepared.unit}`,
|
|
86
|
-
` Corpus ${request.read_set.length} sesión(es)`,
|
|
87
|
-
` Digest ${request.input_digest.slice(0, 12)}…`,
|
|
88
|
-
];
|
|
89
|
-
if (context.detail)
|
|
90
|
-
lines.push("", request.contract);
|
|
91
|
-
return `${lines.join("\n")}\n`;
|
|
92
|
-
}
|
|
81
|
+
if (data.stage === "prepare")
|
|
82
|
+
return renderPrepare(category, data.prepared, context);
|
|
93
83
|
if (data.stage === "validate") {
|
|
94
84
|
const lines = [
|
|
95
85
|
`export-${category} · propuesta validada — falta tu aprobación`,
|
|
@@ -107,6 +97,52 @@ ${ENVELOPE}`,
|
|
|
107
97
|
},
|
|
108
98
|
};
|
|
109
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* What `prepare` resolved, for a person: where it publishes, what the material
|
|
102
|
+
* came from, and what it left out.
|
|
103
|
+
*
|
|
104
|
+
* The exclusions are listed one by one with their reason, because an exclusion
|
|
105
|
+
* somebody asked for and one the release book imposed look identical in the
|
|
106
|
+
* resulting bundle and only the first is something the person can take back.
|
|
107
|
+
* A name that subtracted nothing is printed too: it is the only place a typo in
|
|
108
|
+
* `--exclude` becomes visible before the bundle carries the piece anyway.
|
|
109
|
+
*/
|
|
110
|
+
function renderPrepare(category, prepared, context) {
|
|
111
|
+
const request = prepared.request;
|
|
112
|
+
const inventory = request.inventory;
|
|
113
|
+
const lines = [
|
|
114
|
+
`export-${category} · prepare (${request.metrics.request_bytes} B)`,
|
|
115
|
+
` Destino ${prepared.unit}`,
|
|
116
|
+
` Origen ${(inventory.origins ?? []).join(" + ")}`,
|
|
117
|
+
` Material ${request.read_set.length} pieza(s)`,
|
|
118
|
+
` Digest ${request.input_digest.slice(0, 12)}…`,
|
|
119
|
+
...(inventory.environment
|
|
120
|
+
? [` Ambiente ${describeEnvironment(inventory.environment)}`]
|
|
121
|
+
: []),
|
|
122
|
+
...(inventory.excluded ?? []).map((piece) => ` Fuera ${piece.name} (${piece.reason})`),
|
|
123
|
+
...(inventory.exclude_unmatched ?? []).map((name) => ` Sin efecto ${name} (--exclude no encontró ninguna pieza con ese nombre)`),
|
|
124
|
+
];
|
|
125
|
+
if (context.detail)
|
|
126
|
+
lines.push("", request.contract);
|
|
127
|
+
return `${lines.join("\n")}\n`;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* What the environment filter did, said so it cannot be misread.
|
|
131
|
+
*
|
|
132
|
+
* "No record" and "nothing was applied" are different answers and only one of
|
|
133
|
+
* them is a fact about the world, so the line says which one it is — and when
|
|
134
|
+
* the material held no bundle to look at, it says that instead of letting an
|
|
135
|
+
* empty exclusion list pass for a verdict.
|
|
136
|
+
*/
|
|
137
|
+
function describeEnvironment(filter) {
|
|
138
|
+
if (filter.axis === "no-record") {
|
|
139
|
+
return `${filter.name} — el libro de pases no registra ninguna aplicación en este ambiente (no es lo mismo que nada aplicado)`;
|
|
140
|
+
}
|
|
141
|
+
if (filter.scanned === 0) {
|
|
142
|
+
return `${filter.name} — no había bundles en el material: el SQL que todavía vive en una sesión nunca puede constar aplicado`;
|
|
143
|
+
}
|
|
144
|
+
return `${filter.name} — ${filter.excluded} de ${filter.scanned} bundle(s) quedan fuera por constar aplicados`;
|
|
145
|
+
}
|
|
110
146
|
/**
|
|
111
147
|
* What this stage should prepare over: the scope the answer echoes when there
|
|
112
148
|
* is one, the invocation's own flags otherwise.
|
|
@@ -138,6 +174,9 @@ function describeScope(scope) {
|
|
|
138
174
|
...(scope.sessions === undefined ? [] : [`--sessions ${scope.sessions.join(",")}`]),
|
|
139
175
|
...(scope.since === undefined ? [] : [`--since ${scope.since}`]),
|
|
140
176
|
...(scope.source === undefined ? [] : [`--source ${scope.source}`]),
|
|
177
|
+
...(scope.from === undefined ? [] : [`--from ${scope.from}`]),
|
|
178
|
+
...(scope.exclude ?? []).map((name) => `--exclude ${name}`),
|
|
179
|
+
...(scope.environment === undefined ? [] : [`--environment ${scope.environment}`]),
|
|
141
180
|
`--date ${scope.date}`,
|
|
142
181
|
];
|
|
143
182
|
return parts.join(" ");
|
|
@@ -170,6 +209,13 @@ function selection(args) {
|
|
|
170
209
|
// `source` is a MULTI_VALUE flag: `values.get` would silently miss it.
|
|
171
210
|
const source = flagValue(args, "source");
|
|
172
211
|
const date = args.values.get("date");
|
|
212
|
+
const from = args.values.get("from");
|
|
213
|
+
// `--exclude` is repeatable, so ALL its occurrences count: `flagValue` returns
|
|
214
|
+
// the last one and would leave the rest inside the bundle.
|
|
215
|
+
const exclude = (args.valuesMulti.get("exclude") ?? [])
|
|
216
|
+
.map((name) => name.trim())
|
|
217
|
+
.filter((name) => name.length > 0);
|
|
218
|
+
const environment = args.values.get("environment");
|
|
173
219
|
return {
|
|
174
220
|
...(sessions !== undefined
|
|
175
221
|
? {
|
|
@@ -182,6 +228,9 @@ function selection(args) {
|
|
|
182
228
|
...(since !== undefined ? { since } : {}),
|
|
183
229
|
...(source !== undefined ? { source } : {}),
|
|
184
230
|
...(date !== undefined ? { date } : {}),
|
|
231
|
+
...(from !== undefined ? { from: from } : {}),
|
|
232
|
+
...(exclude.length > 0 ? { exclude } : {}),
|
|
233
|
+
...(environment !== undefined ? { environment } : {}),
|
|
185
234
|
};
|
|
186
235
|
}
|
|
187
236
|
export const exportDiagramsCommand = exportCommand("diagrams");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/cli/commands/export.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/cli/commands/export.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,WAAW,EACX,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAmB,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAQlD,MAAM,SAAS,GAAmC;IAChD,QAAQ,EAAE,qFAAqF;IAC/F,OAAO,EACL,+HAA+H;IACjI,OAAO,EAAE,6CAA6C;IACtD,OAAO,EACL,uaAAua;CAC1a,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,QAAQ,GAAG;IACf,sGAAsG;IACtG,EAAE;IACF,wEAAwE;IACxE,yEAAyE;IACzE,kFAAkF;IAClF,8DAA8D;IAC9D,EAAE;IACF,iIAAiI;IACjI,+UAA+U;IAC/U,EAAE;IACF,4EAA4E;IAC5E,+EAA+E;IAC/E,EAAE;IACF,8HAA8H;CAC/H,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;GAIG;AACH,SAAS,aAAa,CAAC,QAAwB;IAC7C,OAAO;QACL,IAAI,EAAE,UAAU,QAAQ,EAAE;QAC1B,QAAQ,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,yEAAyE,QAAQ,mJAAmJ,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,sFAAsF,CAAC,CAAC,CAAC,EAAE;;EAE1X,QAAQ,EAAE;QAER,KAAK,CAAC,OAAO,CAAC,IAAgB,EAAE,GAAe;YAC7C,MAAM,KA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kB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -12,6 +12,7 @@ import { claimsCommand } from "./claims.js";
|
|
|
12
12
|
import { codeScanCommand } from "./code-scan.js";
|
|
13
13
|
import { contextBudgetCommand } from "./context-budget.js";
|
|
14
14
|
import { contextPlanCommand } from "./context-plan.js";
|
|
15
|
+
import { cutIntentCommand } from "./cut-intent.js";
|
|
15
16
|
import { designsCommand } from "./designs.js";
|
|
16
17
|
import { harnessCommand, logsCommand, nextNumberCommand, profilesCommand } from "./dev-only.js";
|
|
17
18
|
import { doctorCommand } from "./doctor.js";
|
|
@@ -31,6 +32,7 @@ import { pluginCacheCommand } from "./plugin-cache.js";
|
|
|
31
32
|
import { pluginDoctorCommand } from "./plugin-doctor.js";
|
|
32
33
|
import { projectMdUpsertCommand } from "./project-md-upsert.js";
|
|
33
34
|
import { releaseDataCommand } from "./release-data.js";
|
|
35
|
+
import { releasePassCommand } from "./release-pass.js";
|
|
34
36
|
import { removeSourceCommand } from "./remove-source.js";
|
|
35
37
|
import { resealCommand } from "./reseal.js";
|
|
36
38
|
import { resumeSummaryCommand } from "./resume-summary.js";
|
|
@@ -98,6 +100,14 @@ export const ALL_COMMANDS = [
|
|
|
98
100
|
profilesCommand,
|
|
99
101
|
logsCommand,
|
|
100
102
|
claimsCommand,
|
|
103
|
+
// The one place a human intention enters the workspace: how a cut of plans
|
|
104
|
+
// born from one spec was meant to be executed. Everything that orders the
|
|
105
|
+
// board derives from it, so it is declared here and nowhere else.
|
|
106
|
+
cutIntentCommand,
|
|
107
|
+
// The production axis the board never had: a pass is its own object, and
|
|
108
|
+
// 'closed' is not 'released'. It sits beside cut-intent because the two are
|
|
109
|
+
// the only facts a person declares into the workspace by hand.
|
|
110
|
+
releasePassCommand,
|
|
101
111
|
nextNumberCommand,
|
|
102
112
|
// Retirement: the two cross-cutting commands that take work away. They open no
|
|
103
113
|
// flow and create no session, because a retirement can end by deleting the very
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,iFAAiF;AACjF,4EAA4E;AAC5E,gFAAgF;AAChF,iEAAiE;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,W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;IAClB,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,cAAc;IACd,qBAAqB;IACrB,uBAAuB;IACvB,kBAAkB;IAClB,mBAAmB;IACnB,cAAc;IACd,iBAAiB;IACjB,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;IAClB,sBAAsB;IACtB,yBAAyB;IACzB,WAAW;IACX,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,eAAe;IACf,WAAW;IACX,aAAa;IACb,iBAAiB;IACjB,+EAA+E;IAC/E,gFAAgF;IAChF,yBAAyB;IACzB,cAAc;IACd,YAAY;IACZ,+EAA+E;IAC/E,6EAA6E;IAC7E,2CAA2C;IAC3C,aAAa;IACb,YAAY;IACZ,aAAa;IACb,eAAe;IACf,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,aAAa;IACb,kBAAkB;IAClB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,0EAA0E;IAC1E,uCAAuC;IACvC,uBAAuB;IACvB,oBAAoB;IACpB,WAAW;CACZ,CAAC;AAEF,mEAAmE;AACnE,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,iFAAiF;AACjF,4EAA4E;AAC5E,gFAAgF;AAChF,iEAAiE;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,E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AA0E;IAC1E,uCAAuC;IACvC,uBAAuB;IACvB,oBAAoB;IACpB,WAAW;CACZ,CAAC;AAEF,mEAAmE;AACnE,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { declarePass, derivePasses, linkArtifact, readReleasePasses, recordApplication, recordArrival, recordReversion, releasePassLedgerPath, } from "../../application/release-pass-ledger.js";
|
|
2
|
+
import { ReleasePassError, isArrivalKind } from "../../domain/release-pass.js";
|
|
3
|
+
import { nodeFromDocPath } from "../../domain/workline-node.js";
|
|
4
|
+
import { flagValue } from "../parser.js";
|
|
5
|
+
import { fail } from "../render.js";
|
|
6
|
+
const USAGE = [
|
|
7
|
+
"uso: release-pass [list] [--version <v>]",
|
|
8
|
+
" release-pass declare --version <v> --sources <alias,…> [--plans <NNN,…>] [--cause <texto>]",
|
|
9
|
+
" release-pass arrived --version <v> --source <alias> --kind <published-version|deployment|production-branch> --detail <hecho> [--date <ISO>]",
|
|
10
|
+
" release-pass applied --version <v> --environment <ambiente> --detail <hecho> [--date <ISO>]",
|
|
11
|
+
" release-pass revert --version <v> [--cause <texto>]",
|
|
12
|
+
" release-pass link --version <v> --artifact <ruta-relativa>",
|
|
13
|
+
].join("\n");
|
|
14
|
+
/**
|
|
15
|
+
* The passes to production: declared, arrived at per source, reverted, and read
|
|
16
|
+
* back.
|
|
17
|
+
*
|
|
18
|
+
* Its own surface because a pass is its own object, not a property of a plan. The
|
|
19
|
+
* axis it carries — is this in production? — is independent of the closure axis
|
|
20
|
+
* the board already had, and folding it into `status` would have buried the one
|
|
21
|
+
* distinction the whole record exists to draw: closed is not released.
|
|
22
|
+
*
|
|
23
|
+
* Nothing here checks the world. Registering an arrival is DECLARING a fact
|
|
24
|
+
* somebody already knows; querying a package registry or a live host would make
|
|
25
|
+
* the record depend on network reachability to say it.
|
|
26
|
+
*/
|
|
27
|
+
export const releasePassCommand = {
|
|
28
|
+
name: "release-pass",
|
|
29
|
+
describe: "Passes to production as first-class objects: which plans travelled together, over which sources, and whether each source actually arrived. 'release-pass declare --version <v> --sources <a,b>' opens one — the version NAMES it and is not any source's arrival fact, and the order between passes is the book's sequence, never a comparison of names. 'release-pass arrived --source <alias> --kind <…> --detail <hecho>' registers one source's arrival; with a second source still missing the pass reads partially released, naming both, and the missing source's work never reads as released. 'release-pass applied --environment <ambiente> --detail <hecho>' registers that the SQL this pass carries RAN there — its own axis, never a fourth arrival kind, so the release axis does not move and a pass with no such record reads as NO RECORD rather than as nothing applied. 'release-pass revert' adds a reversion that never erases the arrivals it follows. 'release-pass link --artifact <ruta>' attaches a document by workspace-relative path, checking only that it exists — never opening, moving, renumbering or executing it. The book is append-only under the workspace namespace. Usage: aw release-pass [list] | declare | arrived | applied | revert | link.",
|
|
30
|
+
async execute(args, ctx) {
|
|
31
|
+
const verb = args.rest[0] ?? "list";
|
|
32
|
+
try {
|
|
33
|
+
if (verb === "list")
|
|
34
|
+
return await list(args, ctx);
|
|
35
|
+
if (verb === "declare")
|
|
36
|
+
return await declare(args, ctx);
|
|
37
|
+
if (verb === "arrived")
|
|
38
|
+
return await arrived(args, ctx);
|
|
39
|
+
if (verb === "applied")
|
|
40
|
+
return await applied(args, ctx);
|
|
41
|
+
if (verb === "revert")
|
|
42
|
+
return await revert(args, ctx);
|
|
43
|
+
if (verb === "link")
|
|
44
|
+
return await link(args, ctx);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error instanceof ReleasePassError) {
|
|
48
|
+
return fail(error.code, error.message, { error: error.message });
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
return fail("INVALID_INPUT", USAGE, { error: USAGE });
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
async function list(args, ctx) {
|
|
56
|
+
const read = await readReleasePasses(ctx.fs, ctx.paths);
|
|
57
|
+
const passes = derivePasses(read.events);
|
|
58
|
+
const wanted = flagValue(args, "version");
|
|
59
|
+
const shown = wanted === undefined ? passes : passes.filter((p) => p.pass.version === wanted);
|
|
60
|
+
if (wanted !== undefined && shown.length === 0) {
|
|
61
|
+
return fail("RELEASE_PASS_UNKNOWN", `no hay ningún pase declarado con la versión '${wanted}'`, {
|
|
62
|
+
error: `no hay ningún pase declarado con la versión '${wanted}'`,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
ok: true,
|
|
67
|
+
data: {
|
|
68
|
+
path: releasePassLedgerPath(ctx.paths),
|
|
69
|
+
passes: shown,
|
|
70
|
+
records: read.events.length,
|
|
71
|
+
unreadable: read.unreadable,
|
|
72
|
+
},
|
|
73
|
+
exitCode: 0,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
async function declare(args, ctx) {
|
|
77
|
+
const version = flagValue(args, "version");
|
|
78
|
+
const sourcesRaw = flagValue(args, "sources");
|
|
79
|
+
if (version === undefined || sourcesRaw === undefined) {
|
|
80
|
+
return fail("INVALID_INPUT", USAGE, { error: USAGE });
|
|
81
|
+
}
|
|
82
|
+
const sources = splitList(sourcesRaw);
|
|
83
|
+
const plans = planList(flagValue(args, "plans") ?? "");
|
|
84
|
+
if (plans === null) {
|
|
85
|
+
return fail("INVALID_INPUT", "--plans toma correlativos o rutas de plan separados por coma", {
|
|
86
|
+
error: USAGE,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const at = new Date().toISOString();
|
|
90
|
+
const cause = flagValue(args, "cause");
|
|
91
|
+
await declarePass(ctx.fs, ctx.paths, {
|
|
92
|
+
at,
|
|
93
|
+
pass: { version, plans, sources },
|
|
94
|
+
...(cause !== undefined ? { cause } : {}),
|
|
95
|
+
});
|
|
96
|
+
return await standingOf(ctx, version, { declared: true, at });
|
|
97
|
+
}
|
|
98
|
+
async function arrived(args, ctx) {
|
|
99
|
+
const version = flagValue(args, "version");
|
|
100
|
+
const source = flagValue(args, "source");
|
|
101
|
+
const kind = flagValue(args, "kind");
|
|
102
|
+
const detail = flagValue(args, "detail");
|
|
103
|
+
if (version === undefined || source === undefined || detail === undefined) {
|
|
104
|
+
return fail("INVALID_INPUT", USAGE, { error: USAGE });
|
|
105
|
+
}
|
|
106
|
+
if (!isArrivalKind(kind)) {
|
|
107
|
+
const message = "--kind toma el hecho que constituye la llegada: published-version, deployment o production-branch";
|
|
108
|
+
return fail("INVALID_INPUT", message, { error: message });
|
|
109
|
+
}
|
|
110
|
+
const known = await knownPass(ctx, version);
|
|
111
|
+
if (known !== null)
|
|
112
|
+
return known;
|
|
113
|
+
const now = new Date().toISOString();
|
|
114
|
+
// The arrival's own date is the fact's, and the record's is when it was
|
|
115
|
+
// written. Defaulting the first to the second is honest; inferring it from
|
|
116
|
+
// anything else would be inventing when something shipped.
|
|
117
|
+
const at = flagValue(args, "date") ?? now;
|
|
118
|
+
await recordArrival(ctx.fs, ctx.paths, {
|
|
119
|
+
at: now,
|
|
120
|
+
passVersion: version,
|
|
121
|
+
arrival: { source, kind, detail, at },
|
|
122
|
+
});
|
|
123
|
+
return await standingOf(ctx, version, { arrived: source, at });
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Register that the SQL this pass carries RAN against an environment.
|
|
127
|
+
*
|
|
128
|
+
* Its own verb because it is its own axis: an environment is not one of the
|
|
129
|
+
* pass's code sources, and reusing `arrived` for it would move the release axis
|
|
130
|
+
* on a fact that says nothing about whether any source shipped.
|
|
131
|
+
*/
|
|
132
|
+
async function applied(args, ctx) {
|
|
133
|
+
const version = flagValue(args, "version");
|
|
134
|
+
const environment = flagValue(args, "environment");
|
|
135
|
+
const detail = flagValue(args, "detail");
|
|
136
|
+
if (version === undefined || environment === undefined || detail === undefined) {
|
|
137
|
+
return fail("INVALID_INPUT", USAGE, { error: USAGE });
|
|
138
|
+
}
|
|
139
|
+
const named = environment.trim();
|
|
140
|
+
if (named.length === 0) {
|
|
141
|
+
const message = "--environment nombra el ambiente contra el que corrió el SQL: sin ambiente la constancia no dice dónde";
|
|
142
|
+
return fail("INVALID_INPUT", message, { error: message });
|
|
143
|
+
}
|
|
144
|
+
const known = await knownPass(ctx, version);
|
|
145
|
+
if (known !== null)
|
|
146
|
+
return known;
|
|
147
|
+
const now = new Date().toISOString();
|
|
148
|
+
// Same split as an arrival: the application's own date is the fact's, and the
|
|
149
|
+
// record's is when it was written.
|
|
150
|
+
const at = flagValue(args, "date") ?? now;
|
|
151
|
+
await recordApplication(ctx.fs, ctx.paths, {
|
|
152
|
+
at: now,
|
|
153
|
+
passVersion: version,
|
|
154
|
+
application: { environment: named, detail, at },
|
|
155
|
+
});
|
|
156
|
+
return await standingOf(ctx, version, { applied: named, at });
|
|
157
|
+
}
|
|
158
|
+
async function revert(args, ctx) {
|
|
159
|
+
const version = flagValue(args, "version");
|
|
160
|
+
if (version === undefined)
|
|
161
|
+
return fail("INVALID_INPUT", USAGE, { error: USAGE });
|
|
162
|
+
const known = await knownPass(ctx, version);
|
|
163
|
+
if (known !== null)
|
|
164
|
+
return known;
|
|
165
|
+
const at = new Date().toISOString();
|
|
166
|
+
const cause = flagValue(args, "cause");
|
|
167
|
+
await recordReversion(ctx.fs, ctx.paths, {
|
|
168
|
+
at,
|
|
169
|
+
passVersion: version,
|
|
170
|
+
...(cause !== undefined ? { cause } : {}),
|
|
171
|
+
});
|
|
172
|
+
return await standingOf(ctx, version, { reverted: true, at });
|
|
173
|
+
}
|
|
174
|
+
async function link(args, ctx) {
|
|
175
|
+
const version = flagValue(args, "version");
|
|
176
|
+
const artifact = flagValue(args, "artifact");
|
|
177
|
+
if (version === undefined || artifact === undefined) {
|
|
178
|
+
return fail("INVALID_INPUT", USAGE, { error: USAGE });
|
|
179
|
+
}
|
|
180
|
+
const known = await knownPass(ctx, version);
|
|
181
|
+
if (known !== null)
|
|
182
|
+
return known;
|
|
183
|
+
const at = new Date().toISOString();
|
|
184
|
+
const result = await linkArtifact(ctx.fs, ctx.paths, { at, passVersion: version, artifact });
|
|
185
|
+
if (!result.linked)
|
|
186
|
+
return fail("RELEASE_PASS_ARTIFACT_ABSENT", result.reason, { error: result.reason });
|
|
187
|
+
return await standingOf(ctx, version, { linked: artifact, at });
|
|
188
|
+
}
|
|
189
|
+
/** Refuse before writing when the name is not a declared pass. `null` = it is. */
|
|
190
|
+
async function knownPass(ctx, version) {
|
|
191
|
+
const read = await readReleasePasses(ctx.fs, ctx.paths);
|
|
192
|
+
const exists = derivePasses(read.events).some((p) => p.pass.version === version);
|
|
193
|
+
if (exists)
|
|
194
|
+
return null;
|
|
195
|
+
const message = `no hay ningún pase declarado con la versión '${version}': declaralo antes de registrar nada contra él`;
|
|
196
|
+
return fail("RELEASE_PASS_UNKNOWN", message, { error: message });
|
|
197
|
+
}
|
|
198
|
+
/** Every write answers with the pass's state derived again from its own facts. */
|
|
199
|
+
async function standingOf(ctx, version, applied) {
|
|
200
|
+
const read = await readReleasePasses(ctx.fs, ctx.paths);
|
|
201
|
+
const derived = derivePasses(read.events).find((p) => p.pass.version === version);
|
|
202
|
+
return {
|
|
203
|
+
ok: true,
|
|
204
|
+
data: { ...applied, version, pass: derived, path: releasePassLedgerPath(ctx.paths) },
|
|
205
|
+
exitCode: 0,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function splitList(raw) {
|
|
209
|
+
return raw
|
|
210
|
+
.split(",")
|
|
211
|
+
.map((part) => part.trim())
|
|
212
|
+
.filter((part) => part.length > 0);
|
|
213
|
+
}
|
|
214
|
+
function planList(raw) {
|
|
215
|
+
const nodes = [];
|
|
216
|
+
for (const part of splitList(raw)) {
|
|
217
|
+
if (/^\d{3,}$/.test(part)) {
|
|
218
|
+
nodes.push({ kind: "plan", key: part });
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
const node = nodeFromDocPath(part);
|
|
222
|
+
if (node === null || node.kind !== "plan")
|
|
223
|
+
return null;
|
|
224
|
+
nodes.push(node);
|
|
225
|
+
}
|
|
226
|
+
return nodes;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=release-pass.js.map
|