stylegallery 0.1.9 → 0.1.10

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/quality/claims.md CHANGED
@@ -75,16 +75,23 @@ Conflicts with: not applicable
75
75
 
76
76
  ## Machine Fields
77
77
 
78
- Records under `claim-records/` carry machine-readable fields so a validator can check them in CI. `scripts/validate-claim-records.mjs` enforces these fields; `scripts/test-validate-claim-records.mjs` guards the validator with positive and negative fixtures.
78
+ Records under `claim-records/` carry machine-readable fields so the Registrar can check them in CI. The Registrar (`scripts/registrar.mjs`, also `sg registrar`) enforces these fields and the rules below; `scripts/test-registrar.mjs` guards every Registrar rule with a failing fixture and the valid shapes with passing fixtures.
79
+
80
+ - Every field in the template above is present exactly once, and the template itself must list the same fields the Registrar checks. `Principle`, `Claim`, `Context`, `Warrant`, `Evidence family`, `Verification protocol`, `Boundary or limitation`, and `Debt or escalation` must state something rather than `not applicable`.
81
+ - Each record heading reads `Claim Record <number> - <title>`; numbers are unique within a file and titles are unique across all records. Every file that holds records is linked from [Claim Records](claim-records/index.md).
82
+ - `Evidence family`: backticked names defined in the [Evidence Family Glossary](evidence/families.md).
83
+ - `Consumer reference`: `not_applicable` with a one-sentence `Consumer reference reason`, or one existing repository-relative JSON record.
84
+ - `Decision`: begins with `pass`, `review_required`, or `blocked`.
79
85
 
80
86
  - `Evidence refs`: one or more backticked refs, comma-separated. A ref is a repository-relative path that must resolve to an existing file, or an agent-native StableRef-style id (for example `sg://...` or a dotted `domain.kind`). At least one ref is required. Inline code is used so link checking does not treat a ref as a navigable link.
81
87
  - `Verified by`: exactly one of `auto`, `human`, or `mixed`.
82
- - `Reviewed at`: a real `YYYY-MM-DD` date (the freshness review date).
83
- - `Review by`: a real `YYYY-MM-DD` date or `not applicable`.
84
- - `Source revision`: a commit SHA, URL, or `not applicable`, recorded for the deferred external-source drift audit.
85
- - `Conflicts with`: backticked claim refs or `not applicable`, recorded for the deferred conflict index.
88
+ - `Reviewed at`: a real `YYYY-MM-DD` date (the freshness review date), not after today.
89
+ - `Review by`: a real `YYYY-MM-DD` date no earlier than `Reviewed at`, or `not applicable`. A passed date is reported as a warning so the claim is re-reviewed; `sg registrar --stale` lists those records.
90
+ - `Source revision`: a 7-40 character lowercase commit SHA, an `https` URL, or `not applicable`. A claim bound to an external source revision must set a `Review by` date, because the source can drift.
91
+ - `Conflicts with`: backticked record refs of the form `quality/claim-records/<file>.md#claim-record-<number>`, or `not applicable`. Each ref must name another existing record, and that record must list the conflict back.
92
+ - A `sg://conservator/<pattern>` evidence ref must name a Conservator exhibit, and every exhibit must be cited by exactly one record; see the [Layout Pattern Records](claim-records/samples.md#layout-pattern-records).
86
93
 
87
- Automation certifies only what it can check: `Verified by: auto` is allowed only when the `Decision` is `pass`, and every `Evidence refs` entry must then be executable (a `scripts/` or `tests/` path, or a StableRef id). A `review_required` or `blocked` decision needs `human` or `mixed` verification, which in turn must cite at least one human-review artifact under `quality/evidence/` or `quality/gates/`. This keeps the repository's own rule that a scan cannot certify complete accessibility.
94
+ Automation certifies only what it can check: `Verified by: auto` is allowed only when the `Decision` is `pass`, the evidence family includes `validator`, the `Claim` uses none of the human-outcome terms listed under High-Impact Claim (good, better, best, harmonious, usable, accessible, readable, credible, clear), and every `Evidence refs` entry is executable (a `scripts/` or `tests/` path, or a StableRef id). `sg registrar --unverified` lists the records that are not fully automated. A `review_required` or `blocked` decision needs `human` or `mixed` verification, which in turn must cite at least one human-review artifact under `quality/evidence/` or `quality/gates/`. This keeps the repository's own rule that a scan cannot certify complete accessibility.
88
95
 
89
96
  ## Source Of Truth
90
97
 
@@ -92,7 +99,7 @@ Markdown claim records under `quality/claim-records/*.md` are the canonical, hum
92
99
 
93
100
  ## Review Rule
94
101
 
95
- A record is complete only when the evidence family names what the artifact can support and the boundary says what it cannot prove. Evidence without a warrant remains a blocking condition, and a machine-readable record is complete only when its machine fields pass `scripts/validate-claim-records.mjs`.
102
+ A record is complete only when the evidence family names what the artifact can support and the boundary says what it cannot prove. Evidence without a warrant remains a blocking condition, and a machine-readable record is complete only when it passes the Registrar (`scripts/registrar.mjs`).
96
103
 
97
104
  ## IA Navigation
98
105
 
@@ -7,8 +7,28 @@ export function withCompilerDiscovery(report, config = {}) {
7
7
  return { ...report, compiler: compilerDiscovery(config) };
8
8
  }
9
9
 
10
+ // The Registrar and the Conservator check this gallery's own claim register and Layout patterns.
11
+ // They load lazily so knowledge and compiler commands never import a browser.
12
+ async function runQualityCommand(command, args) {
13
+ try {
14
+ if (command === "registrar") {
15
+ const { parseRegistrarArgs, registrarView, runRegistrar } = await import("../registrar.mjs");
16
+ const options = parseRegistrarArgs(args.filter((arg) => arg !== "--format" && arg !== "json"));
17
+ return { operation: command, ...registrarView(runRegistrar(options.root ? { root: options.root } : {}), options) };
18
+ }
19
+ const { parseConservatorArgs, runConservator } = await import("../conservator.mjs");
20
+ return { operation: command, ...await runConservator(parseConservatorArgs(args.filter((arg) => arg !== "--format" && arg !== "json"))) };
21
+ } catch (error) {
22
+ return failure(command, error.code ?? `${command}_failed`, error.message);
23
+ }
24
+ }
25
+
10
26
  export async function runSgCli(argv, config = {}) {
11
27
  const args = [...argv];
28
+ if (args[0] === "registrar" || args[0] === "conservator") {
29
+ const report = await runQualityCommand(args[0], args.slice(1));
30
+ return { report, exitCode: report.ok ? 0 : 1, output: `${JSON.stringify(report, null, 2)}\n` };
31
+ }
12
32
  const options = { ...config };
13
33
  let report;
14
34
  const rootIndex = args.indexOf("--compiler-root");