@aligndottech/cli 0.39.0 → 0.40.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 (91) hide show
  1. package/dist/commands/connect.d.ts +11 -13
  2. package/dist/commands/connect.d.ts.map +1 -1
  3. package/dist/commands/connect.js +0 -21
  4. package/dist/commands/connect.js.map +1 -1
  5. package/dist/commands/import/confluence.js +2 -2
  6. package/dist/commands/import/confluence.js.map +1 -1
  7. package/dist/commands/import/docs.js +1 -1
  8. package/dist/commands/import/docs.js.map +1 -1
  9. package/dist/commands/import/git.js +1 -1
  10. package/dist/commands/import/git.js.map +1 -1
  11. package/dist/commands/import/github.js +1 -1
  12. package/dist/commands/import/github.js.map +1 -1
  13. package/dist/commands/import/gitlab.js +1 -1
  14. package/dist/commands/import/gitlab.js.map +1 -1
  15. package/dist/commands/import/jira.js +2 -2
  16. package/dist/commands/import/jira.js.map +1 -1
  17. package/dist/commands/import/linear.js +1 -1
  18. package/dist/commands/import/linear.js.map +1 -1
  19. package/dist/commands/import/notion.js +1 -1
  20. package/dist/commands/import/notion.js.map +1 -1
  21. package/dist/commands/import/sessions.d.ts +1 -1
  22. package/dist/commands/import/sessions.js +1 -1
  23. package/dist/commands/import/sessions.js.map +1 -1
  24. package/dist/commands/import/slack.js +1 -1
  25. package/dist/commands/import/slack.js.map +1 -1
  26. package/dist/commands/import/teams.js +1 -1
  27. package/dist/commands/import/teams.js.map +1 -1
  28. package/dist/commands/import/zoom.js +1 -1
  29. package/dist/commands/import/zoom.js.map +1 -1
  30. package/dist/commands/import.d.ts +24 -3
  31. package/dist/commands/import.d.ts.map +1 -1
  32. package/dist/commands/import.js +38 -21
  33. package/dist/commands/import.js.map +1 -1
  34. package/dist/commands/mcp.d.ts +49 -3
  35. package/dist/commands/mcp.d.ts.map +1 -1
  36. package/dist/commands/mcp.js +214 -17
  37. package/dist/commands/mcp.js.map +1 -1
  38. package/dist/commands/ratify.js +1 -1
  39. package/dist/commands/ratify.js.map +1 -1
  40. package/dist/commands/registry.d.ts.map +1 -1
  41. package/dist/commands/registry.js +11 -1
  42. package/dist/commands/registry.js.map +1 -1
  43. package/dist/commands/search.js +1 -1
  44. package/dist/commands/search.js.map +1 -1
  45. package/dist/commands/setup.js +1 -1
  46. package/dist/commands/setup.js.map +1 -1
  47. package/dist/commands/why.js +3 -3
  48. package/dist/commands/why.js.map +1 -1
  49. package/dist/lib/capture-sources.d.ts +1 -1
  50. package/dist/lib/capture-sources.js +1 -1
  51. package/dist/lib/command-opts.d.ts +1 -1
  52. package/dist/lib/command-opts.js +1 -1
  53. package/dist/lib/commands-doc.d.ts.map +1 -1
  54. package/dist/lib/commands-doc.js +4 -1
  55. package/dist/lib/commands-doc.js.map +1 -1
  56. package/dist/lib/decision-refs.d.ts +1 -1
  57. package/dist/lib/decision-refs.js +1 -1
  58. package/dist/lib/errors.d.ts +1 -1
  59. package/dist/lib/errors.js +2 -2
  60. package/dist/lib/errors.js.map +1 -1
  61. package/dist/lib/fetchers/git.d.ts +1 -1
  62. package/dist/lib/fetchers/git.js +1 -1
  63. package/dist/lib/gateway-client.d.ts +70 -1
  64. package/dist/lib/gateway-client.d.ts.map +1 -1
  65. package/dist/lib/gateway-client.js +121 -8
  66. package/dist/lib/gateway-client.js.map +1 -1
  67. package/dist/lib/git.js +1 -1
  68. package/dist/lib/git.js.map +1 -1
  69. package/dist/lib/import-defaults.d.ts +1 -1
  70. package/dist/lib/import-defaults.js +1 -1
  71. package/dist/lib/local-db.js +1 -1
  72. package/dist/lib/local-gateway-client.d.ts +1 -1
  73. package/dist/lib/local-gateway-client.d.ts.map +1 -1
  74. package/dist/lib/local-gateway-client.js +9 -1
  75. package/dist/lib/local-gateway-client.js.map +1 -1
  76. package/dist/lib/mcp-timeline-tools.d.ts +128 -0
  77. package/dist/lib/mcp-timeline-tools.d.ts.map +1 -0
  78. package/dist/lib/mcp-timeline-tools.js +504 -0
  79. package/dist/lib/mcp-timeline-tools.js.map +1 -0
  80. package/dist/lib/personal-oauth.d.ts +1 -1
  81. package/dist/lib/personal-oauth.js +4 -4
  82. package/dist/lib/personal-oauth.js.map +1 -1
  83. package/dist/lib/resolve-env.d.ts +1 -1
  84. package/dist/lib/resolve-env.js +1 -1
  85. package/dist/lib/sessions/import-summary.d.ts +2 -2
  86. package/dist/lib/sessions/import-summary.js +1 -1
  87. package/dist/lib/sessions/registry.d.ts +1 -1
  88. package/dist/lib/sessions/registry.js +1 -1
  89. package/dist/lib/usage-telemetry.d.ts +2 -2
  90. package/dist/lib/usage-telemetry.js +2 -2
  91. package/package.json +1 -1
@@ -19,7 +19,7 @@ import { registerImportTeamsCommand } from './import/teams.js';
19
19
  import { registerImportZoomCommand } from './import/zoom.js';
20
20
  import { registerImportNotionCommand } from './import/notion.js';
21
21
  import { registerImportSessionsCommand } from './import/sessions.js';
22
- import { importAliasLine, invokedAsImport, runConnect } from './connect.js';
22
+ import { runConnect } from './connect.js';
23
23
  function renderProgress(jobs) {
24
24
  process.stdout.write('\x1b[2K\r');
25
25
  const running = jobs.filter(j => j.status === 'running');
@@ -107,7 +107,7 @@ function registerImportListCommands(importCmd) {
107
107
  { header: 'CONFIDENCE', width: 12 },
108
108
  { header: 'STATUS', width: 12 },
109
109
  ], suggestions.map(s => [s.id, s.suggested_title, (s.confidence ?? 0).toFixed(2), s.status]));
110
- console.log(chalk.dim('Approve all: align import --all --approve'));
110
+ console.log(chalk.dim('Approve all: align connect --all --approve'));
111
111
  console.log('');
112
112
  }
113
113
  catch (err) {
@@ -157,16 +157,46 @@ function registerImportListCommands(importCmd) {
157
157
  });
158
158
  }
159
159
  /**
160
- * The `connect` group (ALI-951), which `import` still reaches as a deprecated alias. With no
161
- * source and no `--all` it is the local picker (connect.ts); `connect <source>` is the old
162
- * `import <source>` subcommand, unchanged; `--all` and a cloud env keep the cloud scan below.
160
+ * ALI-951: `import` was retired in 0.40.0, and a RETIRED command still has to exist.
161
+ *
162
+ * Deleting the alias outright is not the end state, because `align` has a default action for a
163
+ * free-text question (cli.ts's `program.action(runDefaultAction)`). With no `import` command
164
+ * registered, `align import git` parses as the QUESTION "import git", runs the default action
165
+ * and **exits 0** - so a script that has been importing for a year keeps reporting success and
166
+ * silently imports nothing. Measured on the built binary before this stub existed:
167
+ * `align import git` -> exit 0, and `align import git --approve` -> exit 1 with
168
+ * "unknown option '--approve'", which names neither the removal nor the replacement.
169
+ *
170
+ * So it stays registered, hidden from `--help`, accepting anything, and fails loudly naming the
171
+ * new spelling. `.error()` rather than `process.exit`, so exitOverride still works in a test.
172
+ * It has its own COMMAND_REGISTRY entry because help-tiers.test.ts requires every registered
173
+ * command to be claimed by exactly one - and it is deliberately NOT `internal`, which in this
174
+ * registry means "Align team only": a customer with the old spelling in a script is precisely
175
+ * who needs to reach it.
176
+ */
177
+ export function registerRetiredImportCommand(program) {
178
+ const retired = program
179
+ .command('import [args...]', { hidden: true })
180
+ .allowUnknownOption()
181
+ .description('removed in 0.40.0 - use align connect')
182
+ .action((args) => {
183
+ const sub = args[0] ? ` ${args[0]}` : '';
184
+ retired.error(`align import${sub} was removed in 0.40.0. Use align connect${sub}. ` +
185
+ 'The old spelling was deprecated in 0.38.0 and printed a line on every run until now.', { exitCode: 2 });
186
+ });
187
+ }
188
+ /**
189
+ * The `connect` group (ALI-951). With no source and no `--all` it is the local picker
190
+ * (connect.ts); `connect <source>` runs that source's import; `--all` and a cloud env take
191
+ * the cloud scan below. `import` no longer reaches any of it - it is the retirement stub
192
+ * above, which exits 2 - so this group is the only live spelling.
193
+ *
163
194
  * This file stays on the bare resolver on purpose - the scan's job endpoints exist only on
164
195
  * the cloud gateway (import-env-parity.test.ts); the picker path resolves in connect.ts.
165
196
  */
166
197
  export function registerImportCommand(program) {
167
198
  const importCmd = program
168
199
  .command('connect [connectors...]')
169
- .alias('import')
170
200
  .description('Connect a source and import its decisions. No source: pick from a list. --all: scan every connected cloud connector')
171
201
  .option('--env <env>', 'Environment')
172
202
  .option('--source <id>', 'The source to connect without the picker (github, jira, ...)')
@@ -179,19 +209,6 @@ export function registerImportCommand(program) {
179
209
  .option('--from <date>', 'Start date ISO e.g. 2025-01-01')
180
210
  .option('--to <date>', 'End date ISO')
181
211
  .option('--approve', 'Auto-approve all suggestions when scan completes')
182
- .hook('preAction', (thisCommand, actionCommand) => {
183
- // ALI-951: one line per invocation, whichever subcommand ran, only through the alias.
184
- // rawArgs lives on the root Commander parsed from; the walk finds it from any depth.
185
- let root = thisCommand;
186
- while (root.parent)
187
- root = root.parent;
188
- // rawArgs is set by parse() and absent from Commander's typings; process.argv is the
189
- // same list on the real CLI, and only a test drives parse() with anything else.
190
- const rawArgs = root.rawArgs ?? process.argv;
191
- if (invokedAsImport(rawArgs)) {
192
- console.error(chalk.yellow(importAliasLine(actionCommand === thisCommand ? undefined : actionCommand.name())));
193
- }
194
- })
195
212
  .hook('preSubcommand', (thisCommand, subcommand) => {
196
213
  // `--json` is honoured by the picker path only; a subcommand would parse it (Commander
197
214
  // awards a parent flag to the parent) and then print its human report regardless.
@@ -309,7 +326,7 @@ export function registerImportCommand(program) {
309
326
  console.log(chalk.green(`Approval queued as background job: ${result.job_id}`));
310
327
  if (result.stream_url)
311
328
  console.log(chalk.dim(`Stream: ${result.stream_url}`));
312
- console.log(chalk.dim('Run `align import list` to check progress.\n'));
329
+ console.log(chalk.dim('Run `align connect list` to check progress.\n'));
313
330
  }
314
331
  else {
315
332
  console.log(chalk.green(`Done. ${result.created_decisions} decision(s) added to the graph.\n`));
@@ -317,7 +334,7 @@ export function registerImportCommand(program) {
317
334
  }
318
335
  else {
319
336
  console.log(chalk.dim(`Review at: ${resolveAppUrl(env)}/discover`));
320
- console.log(chalk.dim(`Or approve all: align import --all --approve\n`));
337
+ console.log(chalk.dim(`Or approve all: align connect --all --approve\n`));
321
338
  }
322
339
  });
323
340
  registerImportListCommands(importCmd);
@@ -1 +1 @@
1
- {"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/commands/import.ts"],"names":[],"mappings":"AAAA,OAA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C,CAAC;IACtC,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACrC,2BAA2B,CAAC,SAAS,CAAC,CAAC;IACvC,6BAA6B,CAAC,SAAS,CAAC,CAAC;AAC3C,CAAC"}
@@ -2,7 +2,13 @@ import type { Command } from 'commander';
2
2
  import { type EnvironmentConfig } from '../lib/config.js';
3
3
  import { createGatewayClient } from '../lib/gateway-client.js';
4
4
  export declare const ALIGN_MCP_INSTRUCTIONS: string;
5
- /** Server instructions for the environment actually being served. */
5
+ /**
6
+ * Server instructions for the environment actually being served.
7
+ *
8
+ * Budget: re-derive rather than trusting a number written here. mcp-graph-identity.test.ts
9
+ * pins both modes under 2048, and local is the binding case because its graph-identity suffix
10
+ * is the longest.
11
+ */
6
12
  export declare function instructionsFor(env: EnvironmentConfig): string;
7
13
  /**
8
14
  * Tool schemas with the retrieval tools' descriptions marked with the graph they search.
@@ -13,7 +19,7 @@ export declare function instructionsFor(env: EnvironmentConfig): string;
13
19
  */
14
20
  export declare function toolSchemasFor(env: EnvironmentConfig): typeof TOOL_SCHEMAS;
15
21
  export declare function serializeMcpResult(result: unknown): string;
16
- export declare function dispatchTool(name: string, args: Record<string, unknown> | undefined, client: ReturnType<typeof createGatewayClient>, env: EnvironmentConfig): Promise<unknown>;
22
+ export declare function dispatchTool(name: string, args: Record<string, unknown> | undefined, client: ReturnType<typeof createGatewayClient>, env: EnvironmentConfig, createdBefore?: string): Promise<unknown>;
17
23
  /**
18
24
  * ALI-949: did this tool call hand the agent a real answer from the graph? The three tools
19
25
  * an agent reaches for to GET something (ask, search, check) count; a non-empty conflicts
@@ -32,7 +38,7 @@ export declare function isFirstUsefulToolResult(name: string, result: unknown):
32
38
  * make the agent the usual asker. The once-per-install guard is recordFunnelStage's, shared
33
39
  * with `align ask`; fired without await so the tool response never waits on telemetry.
34
40
  */
35
- export declare function createCallToolHandler(client: ReturnType<typeof createGatewayClient>, env: EnvironmentConfig): (request: {
41
+ export declare function createCallToolHandler(client: ReturnType<typeof createGatewayClient>, env: EnvironmentConfig, createdBefore?: string): (request: {
36
42
  params: {
37
43
  name: string;
38
44
  arguments?: Record<string, unknown>;
@@ -69,6 +75,7 @@ export declare const TOOL_SCHEMAS: ({
69
75
  content?: undefined;
70
76
  source_type?: undefined;
71
77
  file_path?: undefined;
78
+ topic?: undefined;
72
79
  };
73
80
  required: string[];
74
81
  };
@@ -99,6 +106,7 @@ export declare const TOOL_SCHEMAS: ({
99
106
  content?: undefined;
100
107
  source_type?: undefined;
101
108
  file_path?: undefined;
109
+ topic?: undefined;
102
110
  };
103
111
  required: string[];
104
112
  };
@@ -129,6 +137,7 @@ export declare const TOOL_SCHEMAS: ({
129
137
  content?: undefined;
130
138
  source_type?: undefined;
131
139
  file_path?: undefined;
140
+ topic?: undefined;
132
141
  };
133
142
  required: string[];
134
143
  };
@@ -155,6 +164,7 @@ export declare const TOOL_SCHEMAS: ({
155
164
  content?: undefined;
156
165
  source_type?: undefined;
157
166
  file_path?: undefined;
167
+ topic?: undefined;
158
168
  };
159
169
  required: string[];
160
170
  };
@@ -187,6 +197,7 @@ export declare const TOOL_SCHEMAS: ({
187
197
  query?: undefined;
188
198
  input?: undefined;
189
199
  file_path?: undefined;
200
+ topic?: undefined;
190
201
  };
191
202
  required: string[];
192
203
  };
@@ -213,6 +224,7 @@ export declare const TOOL_SCHEMAS: ({
213
224
  content?: undefined;
214
225
  source_type?: undefined;
215
226
  file_path?: undefined;
227
+ topic?: undefined;
216
228
  };
217
229
  required: string[];
218
230
  };
@@ -236,6 +248,7 @@ export declare const TOOL_SCHEMAS: ({
236
248
  content?: undefined;
237
249
  source_type?: undefined;
238
250
  file_path?: undefined;
251
+ topic?: undefined;
239
252
  };
240
253
  required?: undefined;
241
254
  };
@@ -265,9 +278,42 @@ export declare const TOOL_SCHEMAS: ({
265
278
  decision_id?: undefined;
266
279
  content?: undefined;
267
280
  source_type?: undefined;
281
+ topic?: undefined;
282
+ };
283
+ required: string[];
284
+ };
285
+ } | {
286
+ name: string;
287
+ annotations: {
288
+ readonly readOnlyHint: true;
289
+ readonly destructiveHint: false;
290
+ };
291
+ description: string;
292
+ inputSchema: {
293
+ type: string;
294
+ properties: {
295
+ topic: {
296
+ type: string;
297
+ description: string;
298
+ };
299
+ limit: {
300
+ type: string;
301
+ description: string;
302
+ default?: undefined;
303
+ };
304
+ diff?: undefined;
305
+ context?: undefined;
306
+ question?: undefined;
307
+ query?: undefined;
308
+ input?: undefined;
309
+ decision_id?: undefined;
310
+ content?: undefined;
311
+ source_type?: undefined;
312
+ file_path?: undefined;
268
313
  };
269
314
  required: string[];
270
315
  };
271
316
  })[];
317
+ export declare function validateCreatedBeforeFlag(value: string, env: EnvironmentConfig): void;
272
318
  export declare function registerMcpCommand(program: Command): void;
273
319
  //# sourceMappingURL=mcp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,OAAO,EAAqB,KAAK,iBAAiB,EAAgB,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAkB/D,eAAO,MAAM,sBAAsB,QAGlC,CAAC;AA4BF,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,YAAY,CAkB1E;AAOD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAE1D;AAMD,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,MAAM,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,EAC9C,GAAG,EAAE,iBAAiB,GACrB,OAAO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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+JxB,CAAC;AAyCF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAkBrF;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkEzD"}
@@ -13,18 +13,42 @@ import { commandIntro } from '../lib/brand.js';
13
13
  import { recordFunnelStage } from '../lib/usage-telemetry.js';
14
14
  import { inviteNudgeLine } from '../lib/invite-prompt.js';
15
15
  import { renderMcpInstructions } from '../lib/mcp-instructions.shared.js';
16
+ import { DECISION_RATIONALE_TOOL, DECISION_TIMELINE_TOOL, shapeDecisionRationale, shapeTopicTimeline, STORY_GATE, TOPIC_TIMELINE_TOOL, } from '../lib/mcp-timeline-tools.js';
16
17
  // Server-level instructions (ALI-120): surfaced to the agent so it reaches for Align
17
18
  // proactively - without the user prompting - the moment this MCP server is connected.
18
19
  //
19
20
  // ONE text with the hosted server (ALI-952): the shared body lives in
20
21
  // mcp-instructions.shared.ts, byte-identical to align-stack's copy and pinned by
21
22
  // mcp-instructions-parity.test.ts. This server only supplies its names for the shared
22
- // tokens. It has no per-server lines: every tool it exposes is one the hosted server also
23
- // has, and the hosted-only tools (check_proposed_action, rate_conflict, coach,
24
- // get_topic_timeline) are appended on that side. The graph-identity suffix below is added
25
- // per environment by instructionsFor, and the whole rendered text stays under the ~2KB
26
- // Claude Code truncates server instructions to (mcp-graph-identity.test.ts).
23
+ // tokens, plus the per-server lines for tools whose NAME differs between the two servers.
24
+ // Every tool it exposes is one the hosted server also has; the remaining hosted-only tools
25
+ // (check_proposed_action, rate_conflict, coach) are appended on that side.
26
+ //
27
+ // ALI-1070 added the first per-server line here: this server now exposes the topic timeline,
28
+ // so it carries the hosted guidance sentence rendered with ITS name for the tool. That line
29
+ // is CLOUD ONLY (see instructionsFor) because local mode has no implementation for it. The
30
+ // graph-identity suffix is also added per environment by instructionsFor, and the whole
31
+ // rendered text stays under the ~2KB Claude Code truncates server instructions to
32
+ // (mcp-graph-identity.test.ts).
27
33
  export const ALIGN_MCP_INSTRUCTIONS = renderMcpInstructions({ check_alignment: 'align_check_alignment', search: 'align_ask' }, []);
34
+ /**
35
+ * F2 (Copilot, #296 inline at mcp.ts:52): the topic-timeline guidance is CLOUD ONLY.
36
+ *
37
+ * The first port put this line in the shared base, which `instructionsFor` serves to BOTH
38
+ * modes. Local mode has no `getTopicTimeline` - the local-mode Proxy throws on every call, and
39
+ * mcp-timeline-trio-local.test.ts measures exactly that - so the line shipped a
40
+ * guaranteed-fail instruction to every local user. An instruction naming a tool that cannot
41
+ * work is the defect this trio was ported as a trio to avoid, one level up.
42
+ *
43
+ * It stays a per-server line rather than moving into mcp-instructions.shared.ts because the
44
+ * two servers spell this tool differently (`get_topic_timeline` hosted,
45
+ * `align_get_topic_timeline` here), so it cannot live in a text with one spelling. align-stack
46
+ * keeps its own copy in HOSTED_ONLY_LINES for the same reason, which is why the byte-identical
47
+ * parity test is unaffected on both sides.
48
+ */
49
+ const CLOUD_ONLY_LINES = [
50
+ `- For "the story on X" or "how did we end up here", call ${TOPIC_TIMELINE_TOOL} - it returns the whole supersession chain in one call.`,
51
+ ];
28
52
  /**
29
53
  * Which decision graph THIS server reads, appended to the base instructions.
30
54
  *
@@ -48,9 +72,18 @@ function graphIdentity(env) {
48
72
  // graphs and answer the same question differently.
49
73
  return `\n\nThis server reads the hosted Align graph at ${env.gatewayUrl}.`;
50
74
  }
51
- /** Server instructions for the environment actually being served. */
75
+ /**
76
+ * Server instructions for the environment actually being served.
77
+ *
78
+ * Budget: re-derive rather than trusting a number written here. mcp-graph-identity.test.ts
79
+ * pins both modes under 2048, and local is the binding case because its graph-identity suffix
80
+ * is the longest.
81
+ */
52
82
  export function instructionsFor(env) {
53
- return ALIGN_MCP_INSTRUCTIONS + graphIdentity(env);
83
+ const base = env.mode === 'local-embedded'
84
+ ? ALIGN_MCP_INSTRUCTIONS
85
+ : renderMcpInstructions({ check_alignment: 'align_check_alignment', search: 'align_ask' }, CLOUD_ONLY_LINES);
86
+ return base + graphIdentity(env);
54
87
  }
55
88
  /**
56
89
  * Tool schemas with the retrieval tools' descriptions marked with the graph they search.
@@ -72,9 +105,27 @@ export function toolSchemasFor(env) {
72
105
  'results cover the same topic, prefer the one with the most recent decided_at or ' +
73
106
  'created_at. That is a heuristic, not a verified status.'
74
107
  : ` Searches the hosted Align graph at ${env.gatewayUrl}.`;
75
- return TOOL_SCHEMAS.map(tool => tool.name === 'align_ask' || tool.name === 'align_search'
76
- ? { ...tool, description: tool.description + suffix }
77
- : tool);
108
+ /**
109
+ * ALI-1070 follow-up: the two tools local mode cannot serve say so.
110
+ *
111
+ * They stay REGISTERED - deregistering per mode is a larger change and the Proxy stub is
112
+ * honest when reached. What was missing is any way for an agent reading descriptions to know
113
+ * before it calls. The rationale tool is deliberately NOT marked: it works locally, because
114
+ * the local client implements getDecision, so a blanket warning over all three would be
115
+ * false about one of them.
116
+ */
117
+ const cloudOnly = local
118
+ ? ' NOT AVAILABLE IN LOCAL MODE: this local graph has no implementation for it, so the call will fail. Use align_ask to search the local graph instead, or a cloud environment for this tool.'
119
+ : '';
120
+ return TOOL_SCHEMAS.map(tool => {
121
+ if (tool.name === 'align_ask' || tool.name === 'align_search') {
122
+ return { ...tool, description: tool.description + suffix };
123
+ }
124
+ if (cloudOnly && (tool.name === TOPIC_TIMELINE_TOOL || tool.name === DECISION_TIMELINE_TOOL)) {
125
+ return { ...tool, description: tool.description + cloudOnly };
126
+ }
127
+ return tool;
128
+ });
78
129
  }
79
130
  // Heavy internal fields that bloat the model's context without helping it reason.
80
131
  // MCP responses go straight into the agent's context window, so we omit these and
@@ -87,7 +138,7 @@ export function serializeMcpResult(result) {
87
138
  // and pure so the routing - argument extraction, the align_capture URL->platform
88
139
  // classifier, the local-mode raw-text rule, and the unknown-tool guard - is testable
89
140
  // without standing up an MCP server. Returns the raw result; the caller serializes it.
90
- export async function dispatchTool(name, args, client, env) {
141
+ export async function dispatchTool(name, args, client, env, createdBefore) {
91
142
  // A required argument that never arrived used to reach the implementation and fail
92
143
  // from wherever the undefined landed: a missing `diff` surfaced as the tokenizer's
93
144
  // `text may not be null or undefined`, raised to the agent as JSON-RPC -32603. That
@@ -112,7 +163,7 @@ export async function dispatchTool(name, args, client, env) {
112
163
  // semantic search (ALI-105); align_search's `query` is the same text under the old name.
113
164
  case 'align_search':
114
165
  case 'align_ask':
115
- return client.searchDecisions((args?.['question'] ?? args?.['query']), args?.['limit'] ?? 8);
166
+ return client.searchDecisions((args?.['question'] ?? args?.['query']), args?.['limit'] ?? 8, createdBefore);
116
167
  case 'align_capture': {
117
168
  const input = args?.['input'];
118
169
  let platform = 'cli';
@@ -147,7 +198,37 @@ export async function dispatchTool(name, args, client, env) {
147
198
  case 'align_get_conflicts':
148
199
  return client.getConflicts();
149
200
  case 'align_get_related_decisions':
150
- return client.searchDecisions(`${args?.['file_path']} ${args?.['context'] ?? ''}`, 5);
201
+ return client.searchDecisions(`${args?.['file_path']} ${args?.['context'] ?? ''}`, 5, createdBefore);
202
+ /**
203
+ * ALI-1070. The gateway already returns the whole story structure; what this arm adds is
204
+ * the projection and the RENDERING CONTRACT (mcp-timeline-tools.ts). Rows without the
205
+ * contract give a customer the data and not the ability to tell a supersession from a
206
+ * correction, which is the AlignBench split this port is measured on - so the shaping is
207
+ * not optional polish, it is the deliverable.
208
+ *
209
+ * `limit` is passed through undefined when the agent omitted it: the default lives in the
210
+ * client, so there is one writer of it.
211
+ */
212
+ case TOPIC_TIMELINE_TOOL:
213
+ return shapeTopicTimeline(await client.getTopicTimeline(args?.['topic'], args?.['limit']), args?.['topic']);
214
+ /**
215
+ * Reuses getDecision - the hosted connector's getDecisionRationale is the same
216
+ * `GET /snapshots/:id`, so a second client method would be two writers of one call. It
217
+ * also means this tool WORKS IN LOCAL MODE for free: the local client implements
218
+ * getDecision, so the local-mode Proxy passes it straight through instead of throwing
219
+ * the cloud-only stub. The local row carries no decision_json, so the reasoning fields
220
+ * are thinner there - honest degradation, not a failure.
221
+ */
222
+ case DECISION_RATIONALE_TOOL: {
223
+ // F7: PROJECTED, not returned raw. serializeMcpResult strips `decision_json`, which is
224
+ // where every field this tool promises lives - so the raw form answered with metadata
225
+ // and silently dropped the rationale. The raw id goes to the client (local mode does a
226
+ // database lookup with it); encoding is the HTTP boundary's job.
227
+ const row = await client.getDecision(args?.['decision_id']);
228
+ return shapeDecisionRationale(row, args?.['decision_id']);
229
+ }
230
+ case DECISION_TIMELINE_TOOL:
231
+ return client.getDecisionTimeline(args?.['decision_id']);
151
232
  default:
152
233
  throw new Error(`Unknown tool: ${name}`);
153
234
  }
@@ -180,10 +261,10 @@ export function isFirstUsefulToolResult(name, result) {
180
261
  * make the agent the usual asker. The once-per-install guard is recordFunnelStage's, shared
181
262
  * with `align ask`; fired without await so the tool response never waits on telemetry.
182
263
  */
183
- export function createCallToolHandler(client, env) {
264
+ export function createCallToolHandler(client, env, createdBefore) {
184
265
  return async (request) => {
185
266
  const { name, arguments: args } = request.params;
186
- const result = await dispatchTool(name, args, client, env);
267
+ const result = await dispatchTool(name, args, client, env, createdBefore);
187
268
  if (isFirstUsefulToolResult(name, result)) {
188
269
  void recordFunnelStage(env, 'first_useful_decision', 'mcp');
189
270
  }
@@ -306,7 +387,113 @@ export const TOOL_SCHEMAS = [
306
387
  required: ['file_path'],
307
388
  },
308
389
  },
390
+ /**
391
+ * ALI-1070: the timeline trio, ported from the hosted server (mcp-align).
392
+ *
393
+ * APPENDED rather than ranked high on purpose. Order is the ranking an agent reads off
394
+ * tools/list, and the existing eight encode ALI-139's "prescription over retrieval"
395
+ * decision with the pre-flight check leading. Re-ranking that is a separate product call;
396
+ * the lever for routing an agent to the timeline tool is the instructions line above,
397
+ * which names it for exactly the questions it answers.
398
+ *
399
+ * All three are READS, so the write set stays at two (mcp-tool-annotations.test.ts).
400
+ *
401
+ * Registered next to each other, and the descriptions do the disambiguating, because the
402
+ * names are one word apart and an agent picks from descriptions alone.
403
+ */
404
+ {
405
+ name: TOPIC_TIMELINE_TOOL,
406
+ annotations: READS,
407
+ // The full-render prose is GATED, not merely preceded by a compact sentence: this is the
408
+ // one surface some clients act on alone, and a description that says compact-by-default
409
+ // and then unconditionally prescribes the walk talks the default out of existence. The
410
+ // gate phrase is shared with the per-result message via STORY_GATE so the two surfaces
411
+ // cannot drift.
412
+ description: `Everything the team ever decided about a TOPIC, in time order, across every connected tool. Use for "what is the story on X", "how did we end up here", or onboarding onto an unfamiliar area. Includes superseded and archived decisions, because the retired past is what explains why the current answer is current. Not to be confused with ${DECISION_TIMELINE_TOOL}, which is the change history of ONE decision. Answer compactly by default: the current standard first in one sentence, the contested line when decisions disagree, up to three pivotal dated steps, a one-line chain summary, and the sharpest open question the chain leaves open - then offer the rest. Only when the user ${STORY_GATE} or asks the follow-up, render the full timeline: walk the supersession chain oldest first - which decision replaced which, active vs superseded - with each step's why from ${DECISION_RATIONALE_TOOL}, keep each decision's source_url inline with that decision rather than in a trailing sources list, put the status beside the title, and close with the still-open risks, each naming which decision it came from. When the payload carries \`still_open\`, those are the decisions' own stated open questions - close on them.`,
413
+ inputSchema: {
414
+ type: 'object',
415
+ properties: {
416
+ topic: { type: 'string', description: 'The topic to trace, e.g. "connection pooling" or "authentication strategy"' },
417
+ limit: { type: 'number', description: 'Max decisions to return (default 50, capped at 200)' },
418
+ },
419
+ required: ['topic'],
420
+ },
421
+ },
422
+ {
423
+ name: DECISION_RATIONALE_TOOL,
424
+ annotations: READS,
425
+ description: 'Retrieve the rationale, goals, risks, and context behind a specific decision. Use this when you need to understand WHY a decision was made - the reasoning, trade-offs, and constraints that led to it.',
426
+ inputSchema: {
427
+ type: 'object',
428
+ properties: {
429
+ decision_id: { type: 'string', description: 'The decision ID to retrieve rationale for' },
430
+ },
431
+ required: ['decision_id'],
432
+ },
433
+ },
434
+ {
435
+ name: DECISION_TIMELINE_TOOL,
436
+ annotations: READS,
437
+ description: 'Get the chronological history of events for a decision - when it was created, when conflicts were detected, when it was acknowledged or resolved. Use to understand how a decision has evolved over time.',
438
+ inputSchema: {
439
+ type: 'object',
440
+ properties: {
441
+ decision_id: { type: 'string', description: 'The decision ID to get history for' },
442
+ },
443
+ required: ['decision_id'],
444
+ },
445
+ },
309
446
  ];
447
+ /**
448
+ * ALI-1082: --created-before is a harness/audit-only bound (AlignBench's align arm passes
449
+ * it so it cannot see decisions the graph captured after a corpus item's frozen `asOf`).
450
+ * Fail closed at startup rather than silently accepting a value that does nothing:
451
+ *
452
+ * - Local-embedded mode has no server-side query to attach the bound to (the local graph
453
+ * answers from SQLite directly, not through the gateway route that enforces it), so a
454
+ * flag that appeared to work there would be lying.
455
+ * - Anything that is not an offset-bearing ISO-8601 instant is rejected the same way the
456
+ * gateway's own `created_before` filter rejects it (services/gateway/src/routes/
457
+ * decisions/smartSearchFilters.ts) - a bare calendar date (the shape the benchmark
458
+ * corpus's `asOf` field itself carries) is refused rather than coerced, because the
459
+ * caller must decide the instant in UTC, not have Postgres resolve a date-only literal
460
+ * against the session TimeZone.
461
+ */
462
+ const OFFSET_ISO_PATTERN = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
463
+ // Copilot (#302, mcp.ts:514): the pattern above checks SHAPE, not that the digits form a
464
+ // real calendar instant - `Date.parse` silently rolls a non-existent day into the next
465
+ // month (`2026-02-31T00:00:00Z` -> 2026-03-03) instead of rejecting it, so a corrupted
466
+ // cutoff could pass the shape check and the fail-closed contract would be lying. This
467
+ // reconstructs the instant from its own matched components and rejects any value whose
468
+ // round trip does not land back on the digits the caller typed - which is what a bare
469
+ // `Date.parse` cannot distinguish from a value it silently normalised.
470
+ function isRealCalendarInstant(value, match) {
471
+ const [, year, month, day, hour, minute, second] = match.map(Number);
472
+ const asUtc = new Date(Date.UTC(year, month - 1, day, hour, minute, second));
473
+ if (Number.isNaN(asUtc.getTime()))
474
+ return false;
475
+ return (asUtc.getUTCFullYear() === year &&
476
+ asUtc.getUTCMonth() === month - 1 &&
477
+ asUtc.getUTCDate() === day &&
478
+ asUtc.getUTCHours() === hour &&
479
+ asUtc.getUTCMinutes() === minute &&
480
+ asUtc.getUTCSeconds() === second);
481
+ }
482
+ export function validateCreatedBeforeFlag(value, env) {
483
+ if (env.mode === 'local-embedded') {
484
+ throw new Error(`--created-before is not supported in local-embedded mode: the local graph has no ` +
485
+ `server-side query to enforce the bound against, so accepting it would silently do ` +
486
+ `nothing. Got: ${value}`);
487
+ }
488
+ const match = OFFSET_ISO_PATTERN.exec(value);
489
+ // The offset's own range (e.g. +99:99) and an out-of-range hour/minute/second (25:00,
490
+ // 00:61) are already rejected by Date.parse below - only the calendar-day case needs
491
+ // the reconstruction above, since JS normalises it instead of erroring.
492
+ if (!match || Number.isNaN(Date.parse(value)) || !isRealCalendarInstant(value, match)) {
493
+ throw new Error(`--created-before must be an offset-bearing ISO-8601 timestamp, e.g. ` +
494
+ `2026-08-11T00:00:00.000Z - a bare date is not enough, it must resolve to one real instant. Got: ${value}`);
495
+ }
496
+ }
310
497
  export function registerMcpCommand(program) {
311
498
  program
312
499
  .command('mcp')
@@ -315,6 +502,7 @@ export function registerMcpCommand(program) {
315
502
  .option('--setup', 'Interactively configure your MCP-capable agents to use Align as an MCP server')
316
503
  .option('--install', 'Configure agents - alias for --setup')
317
504
  .option('--remove', 'Remove Align from your agents\' MCP config')
505
+ .option('--created-before <iso>', 'Hide decisions captured at or after this ISO-8601 instant (benchmark/audit use)')
318
506
  .addHelpText('after', `
319
507
  Claude Code config (~/.claude.json or workspace .mcp.json):
320
508
  {
@@ -339,11 +527,20 @@ Claude Code config (~/.claude.json or workspace .mcp.json):
339
527
  const resolvedEnv = resolveEnv(opts.env, { preferLocalEmbedded: true });
340
528
  const env = config.getEnvironment(resolvedEnv);
341
529
  const client = createGatewayClient(env);
530
+ // ALI-1082: fail closed BEFORE the server ever connects - a bound that silently does
531
+ // nothing is worse than no bound.
532
+ if (opts.createdBefore !== undefined) {
533
+ validateCreatedBeforeFlag(opts.createdBefore, env);
534
+ }
342
535
  const server = new Server({ name: 'align', version }, { capabilities: { tools: {} }, instructions: instructionsFor(env) });
343
536
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: toolSchemasFor(env) }));
344
- server.setRequestHandler(CallToolRequestSchema, createCallToolHandler(client, env));
537
+ server.setRequestHandler(CallToolRequestSchema, createCallToolHandler(client, env, opts.createdBefore));
345
538
  // MCP protocol requires clean stdout; log startup to stderr
346
- process.stderr.write(`align mcp server started (env: ${resolvedEnv}, gateway: ${env.gatewayUrl})\n`);
539
+ // ALI-1082: the cutoff is named in the banner whenever one is set, so a benchmark
540
+ // run's own transcript records that the bound was active - a bound nobody can see in
541
+ // the log is a bound nobody can audit afterwards.
542
+ const createdBeforeSuffix = opts.createdBefore !== undefined ? `, created-before: ${opts.createdBefore}` : '';
543
+ process.stderr.write(`align mcp server started (env: ${resolvedEnv}, gateway: ${env.gatewayUrl}${createdBeforeSuffix})\n`);
347
544
  // ALI-938: a URL asks someone to go figure it out later; the invite command is
348
545
  // something they can act on right there. See invite-prompt.ts.
349
546
  process.stderr.write(`${inviteNudgeLine('value')}\n`);