@turingcode/cli 0.1.0 → 0.1.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.
@@ -1,7 +1,7 @@
1
1
  import yargs from "yargs/yargs";
2
- import clock from "../features/clock/command.js";
3
2
  import table from "../features/table/command.js";
4
- const commands = [clock, ...table];
3
+ // The clock commands (../features/clock/command.js) are kept but not registered for now.
4
+ const commands = [...table];
5
5
  /**
6
6
  * Builds the yargs parser with every feature command registered.
7
7
  *
@@ -9,13 +9,18 @@ const commands = [clock, ...table];
9
9
  * @returns The parser; call `parseAsync()` to run it.
10
10
  */
11
11
  export function createCli(args) {
12
- return yargs(args)
12
+ const cli = yargs(args)
13
13
  .scriptName("turingcode")
14
- .usage("Usage: $0 <command> [options]")
14
+ .usage("Usage: $0 <command> [options]; $0 <command> --help for each command's usage")
15
15
  .command(commands)
16
16
  .demandCommand(1)
17
17
  .strict()
18
18
  .help()
19
+ .hide("help")
20
+ .hide("version")
21
+ .wrap(null)
19
22
  .exitProcess(false)
20
23
  .fail((message, error) => { throw error ?? new Error(message); });
24
+ // Type tags such as [string] add tokens without information; the typings lack this yargs 17.7 method.
25
+ return cli.usageConfiguration({ "hide-types": true });
21
26
  }
package/dist/cli/index.js CHANGED
@@ -12,7 +12,7 @@ export async function main(args = hideBin(process.argv)) {
12
12
  await createCli(args).parseAsync();
13
13
  }
14
14
  catch (error) {
15
- process.stderr.write(`turingcode: ${error.message}\nRun "turingcode --help" for usage.\n`);
15
+ process.stderr.write(`turingcode: ${error.message}\nRun "turingcode <command> --help" for usage.\n`);
16
16
  process.exitCode = 1;
17
17
  }
18
18
  }
@@ -30,20 +30,28 @@ const finite = (value) => {
30
30
  return value;
31
31
  };
32
32
  const sharedOptions = {
33
- project: { type: "string", describe: "Project folder name on the server (see projects_list)" },
34
- format: { choices: ["markdown", "json"], describe: "Output format (server default: markdown)" },
35
- "hse-ppm": { type: "number", coerce: finite, describe: "HSE crystal tolerance in ppm, for the worst case" },
36
- vdd: { type: "number", coerce: finite, describe: "Supply voltage in volts, for the SPI limits" },
33
+ project: { type: "string", describe: "Project folder name on the server" },
34
+ format: { choices: ["markdown", "json"], describe: "markdown | json (default markdown)" },
35
+ "hse-ppm": { type: "number", coerce: finite, describe: "HSE tolerance in ppm, for the worst case (default 0)" },
36
+ vdd: { type: "number", coerce: finite, describe: "Supply voltage in V, for SPI limits (default 3.3)" },
37
37
  };
38
38
  const solve = {
39
39
  command: "solve",
40
- describe: "Solve a clock tree for a target SYSCLK and print the .ioc patch (server)",
40
+ describe: "Solve a clock tree for a target SYSCLK; prints a .ioc patch for stm32_cubetools_set_params",
41
41
  builder: cli => cli.options({
42
42
  ...sharedOptions,
43
- config: { type: "string", coerce: readJsonArg, describe: "Design as inline JSON or a .json file path" },
44
- target: { type: "number", coerce: finite, describe: "Target SYSCLK in Hz" },
45
- objective: { choices: ["exact_target", "min_error", "max_clock"], describe: "What to optimise" },
46
- }),
43
+ config: { type: "string", coerce: readJsonArg, describe: "Design (before a project exists), inline JSON or .json path" },
44
+ target: { type: "number", coerce: finite, describe: "Target SYSCLK in Hz (with --project)" },
45
+ objective: {
46
+ choices: ["exact_target", "min_error", "max_clock"],
47
+ describe: "exact_target | min_error | max_clock (default exact_target; with --project)",
48
+ },
49
+ })
50
+ .example(`$0 clock solve --config '{"part":"STM32G474RETx","sources":{"hse":{"hz":8000000,"ppm":50}},`
51
+ + `"system":{"objective":"exact_target","target_sysclk_hz":170000000}}'`, "")
52
+ .example("$0 clock solve --project my_board --target 170000000", "")
53
+ .epilogue("Give --project, --config or both. With --config, put target, objective, ppm and vdd inside it "
54
+ + "(system, sources, conditions)."),
47
55
  handler: args => runServerTool("stm32_cubetools_clock_solve", {
48
56
  project_name: args.project, config: args.config, target_sysclk_hz: args.target, objective: args.objective,
49
57
  output_format: args.format, hse_ppm: args["hse-ppm"], vdd: args.vdd,
@@ -51,16 +59,21 @@ const solve = {
51
59
  };
52
60
  const audit = {
53
61
  command: "audit",
54
- describe: "Audit a project's clocks and peripheral timing (server)",
55
- builder: cli => cli.options(sharedOptions).demandOption("project"),
62
+ describe: "Audit a project's clocks and peripheral timing against the datasheet limits",
63
+ builder: cli => cli.options({
64
+ ...sharedOptions,
65
+ project: { ...sharedOptions.project, demandOption: true, describe: "Project folder name on the server (required)" },
66
+ })
67
+ .example("$0 clock audit --project my_board", ""),
56
68
  handler: args => runServerTool("stm32_cubetools_clock_audit", {
57
69
  project_name: args.project, output_format: args.format, hse_ppm: args["hse-ppm"], vdd: args.vdd,
58
70
  }),
59
71
  };
60
72
  const command = {
61
73
  command: "clock",
62
- describe: "STM32 clock tree tools (needs TURINGCODE_TOKEN; TURINGCODE_URL overrides the gateway)",
63
- builder: cli => cli.command(solve).command(audit).demandCommand(1),
74
+ describe: "Solve or audit an STM32 clock tree on the Turing Code server",
75
+ builder: cli => cli.command(solve).command(audit).demandCommand(1)
76
+ .epilogue("Needs TURINGCODE_TOKEN (gateway token); TURINGCODE_URL overrides the gateway."),
64
77
  handler: () => { },
65
78
  };
66
79
  export default command;
@@ -15,19 +15,21 @@ const report = (result, text, json) => {
15
15
  process.stdout.write(json ? JSON.stringify(result) + "\n" : text);
16
16
  process.exitCode = EXIT_CODES[result.status] ?? 2;
17
17
  };
18
- const contractOptions = {
19
- contract: { type: "string", describe: "Stage contract JSON file" },
20
- "source-kinds": { type: "string", describe: "Pinned source_kinds registry JSON file" },
21
- json: { type: "boolean", describe: "Print the full spec result as one-line JSON instead of compact text" },
22
- };
18
+ const CONTRACT = { type: "string", demandOption: true, describe: "Contract JSON (required)" };
19
+ const SOURCE_KINDS = { type: "string", demandOption: true, describe: "source_kinds registry JSON the contract pins (required)" };
20
+ const JSON_FLAG = { type: "boolean", describe: "Full result as one-line JSON" };
23
21
  const check = {
24
22
  command: "check",
25
- describe: "Validate a table contract, or with --kit its whole cross-stage graph",
23
+ describe: "Validate a contract",
26
24
  builder: cli => cli.options({
27
- ...contractOptions,
28
- kit: { type: "boolean", describe: "Also validate the cross-stage reference graph" },
29
- "kit-manifest": { type: "string", describe: "Kit manifest pinning every stage contract (with --kit)" },
30
- }),
25
+ contract: { ...CONTRACT, demandOption: false, describe: "Contract JSON (required unless --kit-manifest)" },
26
+ "source-kinds": SOURCE_KINDS,
27
+ kit: { type: "boolean", describe: "Also validate the contracts it depends on (found next to it) and the references between them" },
28
+ "kit-manifest": { type: "string", describe: "With --kit: JSON {\"contracts\": {\"<id>@<version>\": \"<path>\"}} to validate" },
29
+ json: JSON_FLAG,
30
+ })
31
+ .example("$0 contract check --contract orders.json --source-kinds source_kinds.json --kit", "")
32
+ .epilogue("Exit: 0 VALID, 1 INVALID_CONTRACT, 2 bad input or missing file."),
31
33
  handler: args => {
32
34
  const result = contractCheck({
33
35
  contract_path: args.contract, source_kinds_path: args["source-kinds"], kit: args.kit,
@@ -38,57 +40,66 @@ const check = {
38
40
  };
39
41
  const describe = {
40
42
  command: "describe",
41
- describe: "Print a contract as the Markdown table guide for a stage prompt",
42
- builder: cli => cli.options(contractOptions),
43
+ describe: "Print the tables a contract expects, their columns and rules, as Markdown",
44
+ builder: cli => cli.options({ contract: CONTRACT, "source-kinds": SOURCE_KINDS, json: JSON_FLAG })
45
+ .example("$0 contract describe --contract orders.json --source-kinds source_kinds.json", ""),
43
46
  handler: args => {
44
47
  const result = describeContract({ contract_path: args.contract, source_kinds_path: args["source-kinds"] });
45
48
  report(result, result.markdown ?? formatContractCheck(result), args.json);
46
49
  },
47
50
  };
48
51
  /**
49
- * Parses `--upstream <contract_id@version>=<output path>` flags.
52
+ * Parses `--dep <contract_id@version>=<tables file>` flags.
50
53
  *
51
54
  * @param {string[]} values - Raw flag values.
52
- * @returns {Record<string, {output_path: string}>} pin -> output.
55
+ * @returns {Record<string, {output_path: string}>} pin -> tables file.
53
56
  * @throws {Error} When a value has no `=`.
54
57
  */
55
- function parseUpstreams(values) {
58
+ function parseDeps(values) {
56
59
  return Object.fromEntries(values.map(v => {
57
60
  const at = v.indexOf("=");
58
61
  if (at < 1)
59
- throw new Error(`--upstream expects <contract_id@version>=<path>, got '${v}'`);
62
+ throw new Error(`--dep expects <contract_id@version>=<tables file>, got '${v}'`);
60
63
  return [v.slice(0, at), { output_path: v.slice(at + 1) }];
61
64
  }));
62
65
  }
63
66
  const tableCheckCommand = {
64
67
  command: "check",
65
- describe: "Check a stage output's tables against its contract",
68
+ describe: "Check tables against a contract",
66
69
  builder: cli => cli.options({
67
- ...contractOptions,
68
- output: { type: "string", describe: "Stage output: a Markdown file (or a folder of <Table>.csv files)" },
69
- "contract-id": { type: "string", describe: "Expected <contract_id>@<version> of the contract file" },
70
- upstream: {
71
- type: "string", array: true, coerce: parseUpstreams,
72
- describe: "Upstream stage output, as <contract_id>@<version>=<path> (repeat per upstream)",
70
+ contract: CONTRACT,
71
+ "source-kinds": SOURCE_KINDS,
72
+ tables: { type: "string", demandOption: true, describe: "Markdown file of tables, or folder of <Table>.csv (required)" },
73
+ dep: {
74
+ type: "string", array: true, coerce: parseDeps,
75
+ describe: "<pin>=<tables file> for each contract this one depends on (`contract describe` lists them)",
73
76
  },
74
- }),
77
+ "contract-id": { type: "string", describe: "Expected <contract_id>@<version> of --contract" },
78
+ json: JSON_FLAG,
79
+ })
80
+ .example("$0 table check --contract orders.json --source-kinds source_kinds.json --tables orders.md", "")
81
+ .epilogue([
82
+ "Prints PASS or FAIL, then each failing item with how to fix it; after fixing, run it again to confirm.",
83
+ "Rules listed as \"not checked yet\" are not verified by this version. `contract describe` shows the tables a contract expects.",
84
+ "Exit: 0 PASS, 1 FAIL or invalid contract, 2 bad input or missing file.",
85
+ ].join("\n")),
75
86
  handler: args => {
76
87
  const result = tableCheck({
77
- contract_path: args.contract, source_kinds_path: args["source-kinds"], output_path: args.output,
78
- contract_id: args["contract-id"], upstream_outputs: args.upstream,
88
+ contract_path: args.contract, source_kinds_path: args["source-kinds"], output_path: args.tables,
89
+ contract_id: args["contract-id"], upstream_outputs: args.dep,
79
90
  });
80
91
  report(result, formatTableCheck(result), args.json);
81
92
  },
82
93
  };
83
94
  const contract = {
84
95
  command: "contract",
85
- describe: "Table contract tools (local)",
96
+ describe: "Validate a table contract, or print the tables it expects",
86
97
  builder: cli => cli.command(check).command(describe).demandCommand(1),
87
98
  handler: () => { },
88
99
  };
89
100
  const table = {
90
101
  command: "table",
91
- describe: "Stage table tools (local)",
102
+ describe: "Check Markdown/CSV tables against a contract",
92
103
  builder: cli => cli.command(tableCheckCommand).demandCommand(1),
93
104
  handler: () => { },
94
105
  };
@@ -84,7 +84,7 @@ export function indexFolder(dir, out) {
84
84
  */
85
85
  function statusOf(diags) {
86
86
  const codes = new Set(diags.filter(d => d.severity === "FAIL").map(d => d.code));
87
- if (codes.has("CONTRACT.MISSING_FILE") || codes.has("CONTRACT.UPSTREAM_NOT_FOUND"))
87
+ if (codes.has("CONTRACT.MISSING_FILE") || codes.has("CONTRACT.DEPENDENCY_NOT_FOUND"))
88
88
  return "MISSING_DATA";
89
89
  if (codes.has("CONTRACT.BOUND_EXCEEDED"))
90
90
  return "SEARCH_BOUND_EXCEEDED";
@@ -174,7 +174,7 @@ export function contractCheck(input) {
174
174
  return index ? index.get(pin) : null;
175
175
  };
176
176
  /** Reports an upstream pin that has no file, unless the lookup itself already failed. */
177
- const notFound = (pin, from, path) => path === undefined && diags.push(contractDiag("CONTRACT.UPSTREAM_NOT_FOUND", `${from.pin ?? from.path}: upstream ${pin} not found`, {}, pin, manifest ? "an entry in the kit manifest" : `a contract file in ${dirname(from.path)}`));
177
+ const notFound = (pin, from, path) => path === undefined && diags.push(contractDiag("CONTRACT.DEPENDENCY_NOT_FOUND", `${from.pin ?? from.path}: dependency ${pin} not found`, {}, pin, manifest ? "an entry in the kit manifest" : `a contract file in ${dirname(from.path)}`));
178
178
  const roots = [];
179
179
  if (input.contract_path)
180
180
  roots.push(load(input.contract_path));
@@ -198,12 +198,12 @@ export function contractCheck(input) {
198
198
  return;
199
199
  if (stack.includes(node)) {
200
200
  const chain = [...stack.slice(stack.indexOf(node)), node].map(n => n.pin ?? n.path).join(" -> ");
201
- diags.push(contractDiag("CONTRACT.CYCLE", `upstream cycle ${chain}`, {}, chain, "an acyclic graph"));
201
+ diags.push(contractDiag("CONTRACT.CYCLE", `dependency cycle ${chain}`, {}, chain, "an acyclic graph"));
202
202
  return;
203
203
  }
204
204
  if (maxDepth !== undefined && stack.length >= maxDepth) {
205
205
  const chain = [...stack, node].map(n => n.pin ?? n.path).join(" -> ");
206
- diags.push(contractDiag("CONTRACT.BOUND_EXCEEDED", `upstream chain deeper than max_cross_stage_depth`, {}, chain, `<= ${maxDepth} levels`));
206
+ diags.push(contractDiag("CONTRACT.BOUND_EXCEEDED", `dependency chain deeper than max_cross_stage_depth`, {}, chain, `<= ${maxDepth} levels`));
207
207
  return;
208
208
  }
209
209
  stack.push(node);
@@ -28,7 +28,7 @@ function whenText(rule) {
28
28
  * One plain-language sentence for a rule, for the prompt guide.
29
29
  *
30
30
  * @param {Rule} rule - The rule.
31
- * @param {Contract} c - The contract (for upstream names).
31
+ * @param {Contract} c - The contract (for dependency names).
32
32
  * @returns {string} The sentence.
33
33
  */
34
34
  function ruleText(rule, c) {
@@ -52,7 +52,7 @@ function ruleText(rule, c) {
52
52
  + `${list(p.value_cols)}.`;
53
53
  case "foreign_key": {
54
54
  const where = p.target_contracts
55
- ? `${p.target_table ? code(p.target_table) : "a table"} of ${list(p.target_contracts)} (the upstream output)`
55
+ ? `${p.target_table ? code(p.target_table) : "a table"} of ${list(p.target_contracts)} (its tables file, given with --dep)`
56
56
  : code(`${p.target_table}.${p.target_column ?? "ID"}`);
57
57
  return `Every ID in ${code(p.column)} must exist in ${where}` + (p.allow_dash ? "; `-` means none." : ".");
58
58
  }
@@ -76,7 +76,7 @@ function ruleText(rule, c) {
76
76
  return `Keep ${p.min_count === p.max_count ? `exactly ${p.min_count}` : `${p.min_count} to ${p.max_count}`} `
77
77
  + `row(s) whose ${code(p.id_col)} is ${code(p.id_value)}.`;
78
78
  case "extension_reader_citation":
79
- return `When an upstream stage (${list(p.upstream_stages)}) declares an extension whose Reader is this stage, `
79
+ return `When ${list(p.upstream_stages)} declares an extension whose Reader matches this contract (${code(c.stage_id)}), `
80
80
  + "cite its column name (or one of its row IDs; a table's name or row IDs for a new table) outside the "
81
81
  + `${list(p.exclude_sections ?? ["Inputs", "Extensions"])} sections.`;
82
82
  case "written_equals":
@@ -95,7 +95,7 @@ function ruleText(rule, c) {
95
95
  * @returns {string[]} Markdown lines.
96
96
  */
97
97
  function tableSection(t, c) {
98
- const lines = [`## ${t.name}${t.required ? "" : " (optional)"}`, ""];
98
+ const lines = [`### Table \`${t.name}\`${t.required ? "" : " (optional)"}`, ""];
99
99
  if (t.id_column)
100
100
  lines.push(`Row ID: ${code(t.id_column)}, matching ${code(t.id_pattern)}, unique.`);
101
101
  for (const s of t.sentinel_rows ?? []) {
@@ -116,7 +116,7 @@ function tableSection(t, c) {
116
116
  return lines;
117
117
  }
118
118
  /**
119
- * Renders a contract as the Markdown table guide for a stage prompt (spec §2.3).
119
+ * Renders a contract as the Markdown guide to the tables it expects (spec §2.3).
120
120
  *
121
121
  * @param {Contract} c - A valid contract.
122
122
  * @param {SourceKinds} registry - Its pinned source_kinds registry.
@@ -124,13 +124,13 @@ function tableSection(t, c) {
124
124
  */
125
125
  export function renderGuide(c, registry) {
126
126
  const lines = [
127
- `# ${c.stage_id}: tables to write (${c.contract_id}@${c.version})`, "",
127
+ `# Contract ${c.contract_id}@${c.version}`, "", "## Format", "",
128
128
  c.input_format === "csv"
129
- ? "Write each table as `<Table>.csv` in the output folder, header row first."
130
- : "Write each table under its own `## <Table>` heading as a Markdown table: a header row with exactly the "
129
+ ? "Write each table as `<Table>.csv` in one folder, header row first."
130
+ : "Write each table under a heading with its name, e.g. `## " + c.tables[0].name + "`, as a Markdown table: a header row with exactly the "
131
131
  + "columns below in this order, a `|---|` separator row, then one row per item. Write `\\|` for a `|` "
132
132
  + "inside a cell. Leave no table out, and add no table or column that is not declared.",
133
- "",
133
+ "", "## Tables", "",
134
134
  ];
135
135
  for (const t of c.tables)
136
136
  lines.push(...tableSection(t, c));
@@ -140,7 +140,7 @@ export function renderGuide(c, registry) {
140
140
  lines.push(...c.cross_table_rules.map(r => `- ${ruleText(r, c)}`), ...crossProse.map(r => `- ${r.section}: ${r.text}`), "");
141
141
  }
142
142
  const policy = c.extensions_policy;
143
- lines.push("## Extensions", "");
143
+ lines.push("## Extension declarations", "");
144
144
  if (!policy.allowed) {
145
145
  lines.push("No extra tables or columns are allowed.", "");
146
146
  }
@@ -165,7 +165,7 @@ export function renderGuide(c, registry) {
165
165
  lines.push(`Source priority, highest first: ${list(c.source_order)}.`, "");
166
166
  const ut = c.unit_table;
167
167
  if (ut) {
168
- lines.push("## Units", "", `Write units as one of: ${list(ut.kept_units)}.`);
168
+ lines.push("## Unit spellings", "", `Write units as one of: ${list(ut.kept_units)}.`);
169
169
  const conv = Object.entries(ut.convert_units).map(([from, [to, f]]) => f === "1" ? `${code(from)} is ${code(to)}` : `${code(from)} is ${code(to)} × ${f}`);
170
170
  if (conv.length)
171
171
  lines.push(`Other spellings: ${conv.join("; ")}.`);
@@ -173,6 +173,9 @@ export function renderGuide(c, registry) {
173
173
  lines.push(`Scale by these factors only, written next to \`*\` or \`/\`: ${list(ut.unit_factors)}.`);
174
174
  lines.push("");
175
175
  }
176
+ const deps = c.upstream_contracts.map(pin => ` --dep ${pin}=<its tables file>`).join("");
177
+ lines.push("## Checking", "", "```", `turingcode table check --contract <this contract> --source-kinds <registry> `
178
+ + `--tables <your tables file>${deps}`, "```", "");
176
179
  return lines.join("\n").replace(/\n{3,}/g, "\n\n").trimEnd() + "\n";
177
180
  }
178
181
  /**
@@ -14,7 +14,7 @@ const CONTRACT_HINTS = {
14
14
  "CONTRACT.REQUIRES_FIELD": ["Add the top-level field that this rule needs.", "spec §3.1"],
15
15
  "CONTRACT.ORPHAN_REF": ["Point the reference at a table/column that exists.", "spec §2.1"],
16
16
  "CONTRACT.CYCLE": ["Remove the circular upstream_contracts pin.", "spec §2.1"],
17
- "CONTRACT.UPSTREAM_NOT_FOUND": ["Provide the pinned upstream contract file (manifest or same folder).", "spec §2.1"],
17
+ "CONTRACT.DEPENDENCY_NOT_FOUND": ["Provide the pinned dependency contract file (in the manifest or the same folder).", "spec §2.1"],
18
18
  "CONTRACT.MANIFEST_MISMATCH": ["Make the manifest key match the file's contract_id@version.", "spec §2.1"],
19
19
  "CONTRACT.VERSION_MISMATCH": ["Pin the version that the given file actually has.", "spec §3.5"],
20
20
  "CONTRACT.FLOAT_LITERAL": ["Write the factor as a string, e.g. \"0.001\", so it stays exact.", "spec §3.4"],
@@ -44,11 +44,11 @@ const TABLE_HINTS = {
44
44
  "C0.INVALID_EXTENSION": "Fix the Extensions row so it names a real table and a new column (or '*').",
45
45
  "C0.INVALID_EXTENSION_TYPE": "Use one of the allowed extension types.",
46
46
  "C0.INVALID_EXTENSION_SOURCE": "Use one of the allowed extension sources.",
47
- "C0.INVALID_EXTENSION_READER": "Write the reader in the allowed form, e.g. 'stage 3' or 'supervisor'.",
47
+ "C0.INVALID_EXTENSION_READER": "Write the reader in the form shown in 'expected'.",
48
48
  "C0.EXTENSION_TYPE": "Make the cell match the type its Extensions row declares.",
49
49
  "C1.UNKNOWN_REF": "Cite only IDs that exist in the referenced table.",
50
- "C1.EXTENSION_NOT_CITED": "Cite the extension's column name (or one of its row IDs) where this stage uses it.",
51
- "C1.MISSING_UPSTREAM_OUTPUT": "Pass the upstream stage's output file.",
50
+ "C1.EXTENSION_NOT_CITED": "Cite the extension's column name (or one of its row IDs) in these tables.",
51
+ "C1.MISSING_DEP_TABLES": "Pass the dependency's tables file with --dep <pin>=<file>.",
52
52
  ...Object.fromEntries(["C0", "C1", "C2", "C3", "C4", "C5"].map(g => [`${g}.NOT_CHECKED`, "Nothing to fix: this engine version cannot check this rule yet, so check it yourself."])),
53
53
  "TABLE.MISSING_FILE": "Check the path; the file must exist and be readable.",
54
54
  "TABLE.INVALID_INPUT": "Fix the command arguments named in the message.",
@@ -421,7 +421,7 @@ function runRule(rule, table, stage, upstreams, out) {
421
421
  : [e.column, ...(p.allow_row_id_for_column === false ? []
422
422
  : upRows.filter(r => !isEmpty(r.cells[e.column] ?? "")).map(r => r.label))];
423
423
  if (!candidates.some(w => cites(text, w))) {
424
- fail("C1.EXTENSION_NOT_CITED", `${id} extension ${e.table}.${e.column} is for this stage but never cited`, "-", e.column, "(not cited)", show(candidates.slice(0, 10)), e.table);
424
+ fail("C1.EXTENSION_NOT_CITED", `${id} extension ${e.table}.${e.column} names this contract as reader but is never cited`, "-", e.column, "(not cited)", show(candidates.slice(0, 10)), e.table);
425
425
  }
426
426
  }
427
427
  }
@@ -505,7 +505,7 @@ export function tableCheck(input) {
505
505
  for (const upPin of contract.upstream_contracts) {
506
506
  const given = input.upstream_outputs?.[upPin];
507
507
  if (!given) {
508
- return stop("MISSING_DATA", "C1.MISSING_UPSTREAM_OUTPUT", `no output given for upstream ${upPin}`, "(absent)", `upstream_outputs["${upPin}"]`);
508
+ return stop("MISSING_DATA", "C1.MISSING_DEP_TABLES", `no tables file given for dependency ${upPin}`, "(absent)", `--dep ${upPin}=<tables file>`);
509
509
  }
510
510
  const upContract = JSON.parse(readFileSync(index.get(upPin), "utf-8").replace(/^/, ""));
511
511
  const upOutput = read(given.output_path, upContract);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turingcode/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Turing Code toolkit for AI agents on the command line, e.g. `turingcode clock solve`.",
5
5
  "type": "module",
6
6
  "bin": {