@lotics/cli 0.312.6 → 0.312.7

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 (2) hide show
  1. package/dist/src/cli.js +22 -9
  2. package/package.json +1 -1
package/dist/src/cli.js CHANGED
@@ -36187,7 +36187,8 @@ var MODEL_RULES = {
36187
36187
  sentence: 'An act\'s `of` names a child the record lists in a rows block; it works on the one child row it is pressed on \u2014 or, `on: "rows"`, on the rows ticked together where the record lists that child as tasks \u2014 never on the rows in view.'
36188
36188
  },
36189
36189
  "act.files-written": {
36190
- sentence: "An act's `writes` never names a files field of the record: a file an act makes is a paper \u2014 the record states its papers (an `expect` block over a child pictured by its files field) and the act names its slot with `paper`."
36190
+ sentence: "An act's `writes` never names a files field of the record: a file an act makes is a paper \u2014 the record states its papers (an `expect` block over a child pictured by its files field) and the act names its slot with `paper`.",
36191
+ authoring: true
36191
36192
  },
36192
36193
  "act.writes-line-key": { sentence: "An act never writes the link or the key naming an expected line under its record \u2014 a line's key is stated by filling it." },
36193
36194
  "act.makes-or-runs": { sentence: "An act makes a document (`template`, `templates`) or runs an authored `workflow`, never both \u2014 the workflow makes what it needs." },
@@ -41663,14 +41664,18 @@ function hiddenFiles(model) {
41663
41664
  function decision(rule, app, of, path18, fact, patch) {
41664
41665
  return { rule, app, key: of === void 0 ? rule : `${rule}:${of}`, path: path18, fact, patch, design: MODEL_RULES[rule].design };
41665
41666
  }
41667
+ function appOfFinding(path18) {
41668
+ const [root, alias2] = path18.split(".");
41669
+ return root === "apps" ? alias2 : void 0;
41670
+ }
41666
41671
  function refusalsOf(model, prior) {
41667
41672
  const apps = new Set(registerApps(model).map((app) => app.alias));
41668
41673
  const own2 = /* @__PURE__ */ new Map();
41669
41674
  const outside = [];
41670
41675
  for (const finding of prior) {
41671
41676
  if (finding.severity !== "error") continue;
41672
- const [root, alias2] = finding.path.split(".");
41673
- if (root === "apps" && alias2 !== void 0 && apps.has(alias2)) own2.set(alias2, [...own2.get(alias2) ?? [], finding]);
41677
+ const alias2 = appOfFinding(finding.path);
41678
+ if (alias2 !== void 0 && apps.has(alias2)) own2.set(alias2, [...own2.get(alias2) ?? [], finding]);
41674
41679
  else outside.push(finding);
41675
41680
  }
41676
41681
  return (app) => [...outside, ...own2.get(app) ?? []];
@@ -46632,7 +46637,7 @@ async function saveSignedLinks(links, dir) {
46632
46637
  }
46633
46638
 
46634
46639
  // src/version.ts
46635
- var VERSION = "0.312.6";
46640
+ var VERSION = "0.312.7";
46636
46641
  var APP_SDK_VERSION = "0.122.4";
46637
46642
 
46638
46643
  // src/timezone.ts
@@ -49048,7 +49053,7 @@ function indistinctRows(entities, records, rows, apps) {
49048
49053
  });
49049
49054
  }
49050
49055
  function checkWorkspaceModel(raw, options = {}) {
49051
- const read = readWorkspaceModel(raw, options.documents);
49056
+ const read = readWorkspaceModel(raw, options.documents, options.apps);
49052
49057
  return verdictOf(read.findings, read.model);
49053
49058
  }
49054
49059
  function checkWorkspaceModelFor(raw, mode) {
@@ -49056,7 +49061,7 @@ function checkWorkspaceModelFor(raw, mode) {
49056
49061
  const read2 = readWorkspaceModel(raw, void 0);
49057
49062
  return { ...verdictOf(read2.findings.filter((finding) => finding.rule === void 0 || bindsRecompile(finding.rule)), read2.model), designs: [] };
49058
49063
  }
49059
- const read = readWorkspaceModel(raw, mode.documents);
49064
+ const read = readWorkspaceModel(raw, mode.documents, mode.apps);
49060
49065
  if (read.model === void 0) return { ...verdictOf(read.findings, void 0), designs: [] };
49061
49066
  const design = designCheck(appModelOf(read.model), read.findings, { stats: mode.stats, apps: mode.apps });
49062
49067
  return { ...verdictOf([...read.findings, ...design.refusals], read.model), designs: design.designs };
@@ -49066,7 +49071,7 @@ function verdictOf(findings, model) {
49066
49071
  const notes = findings.filter((finding) => finding.severity === "note");
49067
49072
  return { errors, notes, model: errors.length > 0 || model === void 0 ? null : model };
49068
49073
  }
49069
- function readWorkspaceModel(raw, documents) {
49074
+ function readWorkspaceModel(raw, documents, written) {
49070
49075
  const read = parseModelFile(raw);
49071
49076
  if (read.type === "invalid") return { findings: read.findings };
49072
49077
  const { rows: authoredRows = {}, records: stated = {}, write_rules = {}, apps = [], ...authoredContract } = read.file;
@@ -49076,7 +49081,7 @@ function readWorkspaceModel(raw, documents) {
49076
49081
  const contract = expanded.model;
49077
49082
  const rows = withStageClocks(contract.entities, records, withOpeningHistory(contract.entities, records, authoredRows));
49078
49083
  const validated = validateWorkspaceModel({ ...contract, records, apps, write_rules }, rows);
49079
- const findings = [
49084
+ const findings = carriedAsNotes([
49080
49085
  // What the parse dropped is a mistake the author cannot otherwise see.
49081
49086
  ...unknownModelKeys(raw, read.file),
49082
49087
  ...expanded.findings,
@@ -49094,9 +49099,17 @@ function readWorkspaceModel(raw, documents) {
49094
49099
  ...removed_records.flatMap(
49095
49100
  (entity) => contract.entities.some((one) => one.alias === entity) ? [] : [error51("model.names-declared", `records.${entity}`, `removes the entry of entity "${entity}", which this model does not declare`)]
49096
49101
  )
49097
- ];
49102
+ ], written);
49098
49103
  return { findings, model: { contract, rows, records, removed_records, write_rules, apps } };
49099
49104
  }
49105
+ function carriedAsNotes(findings, written) {
49106
+ if (written === void 0) return findings;
49107
+ return findings.map((finding) => {
49108
+ const app = appOfFinding(finding.path);
49109
+ const carried = finding.severity === "error" && app !== void 0 && !written.includes(app) && finding.rule !== void 0 && !bindsRecompile(finding.rule);
49110
+ return carried ? { ...finding, severity: "note" } : finding;
49111
+ });
49112
+ }
49100
49113
  function missingDocuments(contract, rows, documents) {
49101
49114
  return modelRowDocuments(contract, rows).filter((document) => document.kind === "path" && !documents.exists(document.value)).map((document) => error51("rows.value", `rows.${document.entity}.${document.ref}.${document.field}`, `"${document.value}" is not a file beside this model (looked in ${documents.dir})`));
49102
49115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/cli",
3
- "version": "0.312.6",
3
+ "version": "0.312.7",
4
4
  "description": "Lotics SDK and CLI for AI agents",
5
5
  "type": "module",
6
6
  "bin": {