@sdd-method/verify-cli 5.1.1 → 5.2.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.
@@ -721,7 +721,7 @@ enums:
721
721
  - value: zero-or-one
722
722
  - value: one-or-more
723
723
  - value: zero-or-more
724
- description: "How many entities one end of a relationship holds for one entity at the other end (M-ADR 0230 §4.3): a Mermaid ER end marker (|| exactly one, |o or o| zero or one, }| or |{ one or more, }o or o{ zero or more). A TypeQL relationship is zero-or-more at both ends, because the subset admits no participation cardinality; a role's @card is a cardinality invariant (domain_invariants). Replaced entity_relationship_cardinality in schema 6.0.0."
724
+ description: "How many entities one end of a relationship holds for one entity at the other end (M-ADR 0230 §4.3): a Mermaid ER end marker (|| exactly one, |o or o| zero or one, }| or |{ one or more, }o or o{ zero or more). A TypeQL relationship's end is the other player's participation: B plays R:b @card(1..1) makes A's end exactly-one, @card(0..1) zero-or-one, and an unannotated plays zero-or-more; a role's @card is a cardinality invariant (domain_invariants). Replaced entity_relationship_cardinality in schema 6.0.0."
725
725
  domain_invariant_kind:
726
726
  values:
727
727
  - value: unique
@@ -175,11 +175,10 @@ export function parseTypes(text, fileLabel = "catalogue-schema.tql", options = {
175
175
  if (decl.plays.has(w[1]))
176
176
  throw new ParseError(`${where}: ${lab} plays ${w[1]} twice`);
177
177
  const ann = parseAnnotations(w.slice(2), where);
178
- // A plays clause's cardinality constrains participation, which the relational projection has no place for:
179
- // refused, so a constraint the model gained can never be dropped by the projection with the gate green.
180
- if (ann.key || ann.required || ann.multi || ann.optional) {
181
- throw new ParseError(`${where}: ${lab} plays ${w[1]} with a cardinality annotation; participation cardinality cannot be projected onto the catalogue schema, so it is not admitted`);
182
- }
178
+ // A plays clause's cardinality constrains participation, and is kept: a reader that can hold it does, and a
179
+ // projection that cannot refuses it there (schema-projection), never here, so no reader drops it silently.
180
+ if (ann.key)
181
+ throw new ParseError(`${where}: ${lab} plays ${w[1]} @key; a role is not a key`);
183
182
  decl.plays.set(w[1], ann);
184
183
  }
185
184
  else if (head === "relates") {
@@ -86,6 +86,8 @@ const COMMIT_RE = /^[0-9a-f]{7,40}$/;
86
86
  // OpenSpec counts a task done when its box holds only `x`, either case, any spacing.
87
87
  const TASK_DONE_RE = /^\s*-\s*\[\s*[xX]\s*\]/m;
88
88
  const TARGET_HEADING_RE = /^##\s+(MODIFIED|REMOVED|RENAMED)\s+Requirements\b/m;
89
+ // A tasks.md group headed by one word, `## <n>. <word>`, is that repository's work order (taskGroups).
90
+ const GROUP_REPO = (repo) => `tasks.md has a work order for ${repo} and the record's work_orders do not; its evidence cannot be checked (a group heading of one word, \`## <n>. ${repo}\`, names the group's repository)`;
89
91
  async function exists(p) {
90
92
  try {
91
93
  await access(p);
@@ -516,6 +518,14 @@ export async function checkBehaviourStore(repo, options = {}) {
516
518
  }
517
519
  }
518
520
  }
521
+ // The archive check reads a task group's repository from its heading; once the record declares work orders, a
522
+ // heading it would read as a repository the record lacks fails here, while the change can still be amended.
523
+ if (versionAtLeast(record?.schemaVersion, "1.1.0") && record?.status === "agreed" && record.workOrders.length > 0 && tasks !== null) {
524
+ const recorded = new Set(record.workOrders.map((w) => w.repo));
525
+ for (const g of taskGroups(tasks))
526
+ if (!recorded.has(g.repo))
527
+ failures.push(`${record.file}: ${GROUP_REPO(g.repo)}`);
528
+ }
519
529
  // A test plan's kinds (M-ADR 0223 §4.4 as amended): changed and repaired scenarios go red then green, carried ones stay green.
520
530
  if (versionAtLeast(record?.schemaVersion, "1.1.0") && record?.status === "agreed") {
521
531
  const plan = await readText(join(repo, dir, "test-plan.md"));
@@ -717,7 +727,7 @@ export async function checkBehaviourStore(repo, options = {}) {
717
727
  const recorded = new Set(record.workOrders.map((w) => w.repo));
718
728
  for (const g of groups)
719
729
  if (!recorded.has(g.repo))
720
- failures.push(`${record.file}: tasks.md has a work order for ${g.repo} and the record's work_orders do not; its evidence cannot be checked`);
730
+ failures.push(`${record.file}: ${GROUP_REPO(g.repo)}`);
721
731
  // Requirement names are unique within a feature, not across a change: a work order names `<feature>::<name>`,
722
732
  // or a bare name only one feature in the change has (schema 5.0.0). An ambiguous bare name implements nothing.
723
733
  const built = [];
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.15.1",
3
- "built_against_sdd_cli": "5.1.1"
2
+ "version": "0.16.1",
3
+ "built_against_sdd_cli": "5.2.1"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "5.1.1",
3
- "built_against_sdd_cli": "5.1.1"
2
+ "version": "5.2.1",
3
+ "built_against_sdd_cli": "5.2.1"
4
4
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sdd-method/verify-cli",
3
- "version": "5.1.1",
4
- "sddCliVersion": "5.1.1",
3
+ "version": "5.2.1",
4
+ "sddCliVersion": "5.2.1",
5
5
  "description": "Verify an SDD repository without changing it — validate, list, and read-only catalogue and pack checks. Ships only the code those verbs reach; it cannot write to the repository it is pointed at. Authoring and maintenance are in @sdd-method/sdd-cli.",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",