@stravica-ai/rcf-schemas 0.7.1 → 0.8.0

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/CHANGELOG.md CHANGED
@@ -4,6 +4,35 @@ All notable changes to `@stravica-ai/rcf-schemas` are documented in this file.
4
4
 
5
5
  The format roughly follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Pre-1.0 breaking changes are signalled by a minor bump per semver 0.x convention.
6
6
 
7
+ ## 0.8.0 - 2026-10-16
8
+
9
+ Minor release for rcf-lite FBS-218 (per-AC probe catalog, rcf-lite PR 370), review gate 3. A probe `{ "path": "/", "expectBody": { "contains": " " } }` validated under 0.7.1, because `minLength: 1` counts a single space, and a deterministic verify run resolved it to a vacuous pass. Every assertion string on the probe must now contain at least one non-whitespace character: `"pattern": "\\S"` alongside the existing `minLength: 1`.
10
+
11
+ Semver: URLs pinned at `v0.6.0`. This is a narrowing, not an addition: a user story whose probe carries a whitespace-only assertion string validated under 0.7.1 and is rejected under 0.8.0. Under this repo's rule (`CONTRIBUTING.md` and the `README.md` Versioning section) a narrowing is a minor bump, as 0.5.0 did for the `testPointer` `minLength: 1` tightening, so this ships as `0.8.0`. The only documents rejected are ones whose assertion string asserts nothing, which is the defect this release closes; rcf-lite pins the package exact and bumps on its FBS-218 branch.
12
+
13
+ ### Added
14
+
15
+ - **Fixtures (valid)**: `fixtures/valid/user-story/us-009-ac-probe-expect-body-contains.json` (`contains: "Welcome back"`), `fixtures/valid/user-story/us-010-ac-probe-expect-body-matches.json` (`matches` with a `\s*` class), `fixtures/valid/user-story/us-011-ac-probe-expect-header-name.json` (`name: "x-request-id"`), `fixtures/valid/user-story/us-012-ac-probe-expect-header-match.json` (`match: "public, max-age=60"`), `fixtures/valid/user-story/us-013-ac-probe-selector.json` (`selector` with a descendant combinator).
16
+ - **Fixtures (invalid)**: `fixtures/invalid/user-story/us-014-ac-probe-expect-body-contains-whitespace.json` (a single space, the gate 3 case), `fixtures/invalid/user-story/us-015-ac-probe-expect-body-matches-whitespace.json` (a tab), `fixtures/invalid/user-story/us-016-ac-probe-expect-header-name-whitespace.json` (two spaces), `fixtures/invalid/user-story/us-017-ac-probe-expect-header-match-whitespace.json` (a newline), `fixtures/invalid/user-story/us-018-ac-probe-selector-whitespace.json` (space, tab, space). Each fails on exactly one ajv error (`pattern`), and each validates under 0.7.1, so it exercises the new constraint alone.
17
+ - **Tests**: `test/user-story.test.js` gains 31 cases: the gate 3 regression probe; for each of the five fields, a whitespace-only value rejected on `pattern` across ten ASCII and Unicode whitespace strings, a real value accepted with inner, leading and trailing whitespace, a one-character value accepted (the `minLength: 1` boundary), and an empty string still rejected on `minLength`; and one case per new fixture, pinning its outcome and, for the invalid ones, the single `pattern` error at its instance path. Total suite grows from 402 to 433.
18
+
19
+ ### Changed
20
+
21
+ - **`user-story.schema.json`**: `$defs.acProbeExpectBody.contains`, `$defs.acProbeExpectBody.matches`, `$defs.acProbeExpectHeader.name`, `$defs.acProbeExpectHeader.match` and `$defs.acProbe.selector` each gain `"pattern": "\\S"` next to `minLength: 1`, and each `description` says so. The pattern is unanchored, so a real value with leading, trailing or inner whitespace still validates. ajv compiles patterns with the `u` flag, so `\S` also treats Unicode whitespace (no-break space, em space, byte-order mark, line separator) as whitespace.
22
+ - **Unchanged on purpose**: `$defs.acProbe.path` and `$defs.acProbe.parityEnv` keep `minLength: 1` only. They name the request target and the environment scope, not something the resolver checks the response against, so they sit outside this fix. `method` (enum), `expectStatus` (integer, 100..599), the `expectBody` exactly-one-of rule and every other def are untouched.
23
+
24
+ ### Migration
25
+
26
+ - **Existing chains on 0.7.1**: bump `@stravica-ai/rcf-schemas` to `0.8.0`. A document is rejected only when a probe carries a whitespace-only `expectBody.contains`, `expectBody.matches`, `expectHeader.name`, `expectHeader.match` or `selector`. Replace the value with the text the criterion actually asserts, or remove that assertion.
27
+ - **Consumers to bump**: `rcf-lite` (its `packages/rcf-lite/package.json` pins the schemas package exact, at `0.7.0` on `main` at this release). FBS-218 validates every probe against `$defs.acProbe`, so pinning `0.8.0` closes the whitespace-only case there without resolver-side trimming. This repo does not touch rcf-lite.
28
+
29
+ ### Notes
30
+
31
+ - Scripted back-compat pass at authoring time: every 0.7.1 fixture at main `c34bf96` (67 valid + 95 invalid = 162 total) validates to the same outcome, with the same ajv error list, against the 0.8.0 schemas: zero drift.
32
+ - Mutation check at authoring time: run against the 0.7.1 `user-story.schema.json`, the 11 new rejection cases fail, as does the existing invalid-fixture case for `user-story`; the 20 new acceptance and `minLength` cases pass on both.
33
+ - `docs/user-story.md` still does not describe `probe` (deferred at 0.7.1); this release is scoped to the schema, fixtures, tests, version and changelog.
34
+ - `back-compat-freeze.test.js` continues to pass.
35
+
7
36
  ## 0.7.1 - 2026-10-16
8
37
 
9
38
  Patch bump for rcf-lite issue 349 (per-AC probe catalog resolved by deterministic verify, rcf-lite TAC-4150 and FBS-218). Adds an additive, optional `probe` object on the inline `$defs.acceptanceCriterion` of the user story, so an acceptance criterion can carry a structured, deterministic probe that `rcf verify run --mode deterministic` resolves to pass, fail or skipped with evidence. An AC without a probe stays critique-only. Every change is additive: every 0.7.0-valid document keeps validating.
@@ -0,0 +1,26 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "draft",
7
+ "title": "Probe expectBody.contains as a single space is rejected",
8
+ "asA": "author",
9
+ "iWant": "a body assertion that asserts something",
10
+ "soThat": "a whitespace-only contains cannot resolve to a vacuous pass",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "expectBody.contains is a single space.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/",
18
+ "expectBody": {
19
+ "contains": " "
20
+ }
21
+ }
22
+ }
23
+ ],
24
+ "createdAt": "2026-01-01T00:00:00Z",
25
+ "updatedAt": "2026-10-16T00:00:00Z"
26
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "draft",
7
+ "title": "Probe expectBody.matches as a tab is rejected",
8
+ "asA": "author",
9
+ "iWant": "a body pattern that asserts something",
10
+ "soThat": "a whitespace-only regular expression source cannot resolve to a vacuous pass",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "expectBody.matches is a single tab.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/",
18
+ "expectBody": {
19
+ "matches": "\t"
20
+ }
21
+ }
22
+ }
23
+ ],
24
+ "createdAt": "2026-01-01T00:00:00Z",
25
+ "updatedAt": "2026-10-16T00:00:00Z"
26
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "draft",
7
+ "title": "Probe expectHeader.name as two spaces is rejected",
8
+ "asA": "author",
9
+ "iWant": "a header assertion keyed on a real header name",
10
+ "soThat": "a whitespace-only header name cannot resolve to a vacuous pass",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "expectHeader.name is two spaces.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/",
18
+ "expectHeader": {
19
+ "name": " ",
20
+ "match": "application/json"
21
+ }
22
+ }
23
+ }
24
+ ],
25
+ "createdAt": "2026-01-01T00:00:00Z",
26
+ "updatedAt": "2026-10-16T00:00:00Z"
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "draft",
7
+ "title": "Probe expectHeader.match as a newline is rejected",
8
+ "asA": "author",
9
+ "iWant": "a header assertion with a real expected value",
10
+ "soThat": "a whitespace-only header value cannot resolve to a vacuous pass",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "expectHeader.match is a single newline.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/",
18
+ "expectHeader": {
19
+ "name": "content-type",
20
+ "match": "\n"
21
+ }
22
+ }
23
+ }
24
+ ],
25
+ "createdAt": "2026-01-01T00:00:00Z",
26
+ "updatedAt": "2026-10-16T00:00:00Z"
27
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "draft",
7
+ "title": "Probe selector as mixed whitespace is rejected",
8
+ "asA": "author",
9
+ "iWant": "a DOM assertion on a real selector",
10
+ "soThat": "a whitespace-only selector cannot resolve to a vacuous pass",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "selector is a space, a tab and a space.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/",
18
+ "selector": " \t "
19
+ }
20
+ }
21
+ ],
22
+ "createdAt": "2026-01-01T00:00:00Z",
23
+ "updatedAt": "2026-10-16T00:00:00Z"
24
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "approved",
7
+ "title": "Probe expectBody.contains carries real text with inner whitespace",
8
+ "asA": "operator running deterministic verify",
9
+ "iWant": "a body assertion on literal text that includes spaces",
10
+ "soThat": "a real phrase passes while a whitespace-only string is refused",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "The home page greets the signed-in user.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/",
18
+ "expectStatus": 200,
19
+ "expectBody": {
20
+ "contains": "Welcome back"
21
+ }
22
+ }
23
+ }
24
+ ],
25
+ "createdAt": "2026-01-01T00:00:00Z",
26
+ "updatedAt": "2026-10-16T00:00:00Z"
27
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "approved",
7
+ "title": "Probe expectBody.matches carries a real regular expression",
8
+ "asA": "operator running deterministic verify",
9
+ "iWant": "a body assertion on a pattern that includes a whitespace class",
10
+ "soThat": "a real pattern passes while a whitespace-only source is refused",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "The notes page renders its heading.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/notes",
18
+ "expectBody": {
19
+ "matches": "<h1>\\s*Notes\\s*</h1>"
20
+ }
21
+ }
22
+ }
23
+ ],
24
+ "createdAt": "2026-01-01T00:00:00Z",
25
+ "updatedAt": "2026-10-16T00:00:00Z"
26
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "approved",
7
+ "title": "Probe expectHeader.name carries a real header name",
8
+ "asA": "operator running deterministic verify",
9
+ "iWant": "a header assertion keyed on a named response header",
10
+ "soThat": "a real header name passes while a whitespace-only name is refused",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "The health endpoint carries a request id header.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/healthz",
18
+ "expectHeader": {
19
+ "name": "x-request-id",
20
+ "match": "^[0-9a-f-]{36}$"
21
+ }
22
+ }
23
+ }
24
+ ],
25
+ "createdAt": "2026-01-01T00:00:00Z",
26
+ "updatedAt": "2026-10-16T00:00:00Z"
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "approved",
7
+ "title": "Probe expectHeader.match carries a real value with inner whitespace",
8
+ "asA": "operator running deterministic verify",
9
+ "iWant": "a header assertion whose expected value includes a space",
10
+ "soThat": "a real header value passes while a whitespace-only value is refused",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "The public page is cacheable for a minute.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/",
18
+ "expectHeader": {
19
+ "name": "cache-control",
20
+ "match": "public, max-age=60"
21
+ }
22
+ }
23
+ }
24
+ ],
25
+ "createdAt": "2026-01-01T00:00:00Z",
26
+ "updatedAt": "2026-10-16T00:00:00Z"
27
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "usId": "US-302",
3
+ "prdId": "PRD-100",
4
+ "reqId": "REQ-302",
5
+ "version": "1.0.0",
6
+ "status": "approved",
7
+ "title": "Probe selector carries a real descendant selector",
8
+ "asA": "operator running deterministic verify",
9
+ "iWant": "a DOM assertion with a descendant combinator",
10
+ "soThat": "a real selector passes while a whitespace-only selector is refused",
11
+ "acceptanceCriteria": [
12
+ {
13
+ "id": "AC-302-1",
14
+ "description": "The notes list renders inside the main landmark.",
15
+ "testable": true,
16
+ "probe": {
17
+ "path": "/notes",
18
+ "selector": "main [data-testid=\"notes-list\"]"
19
+ }
20
+ }
21
+ ],
22
+ "createdAt": "2026-01-01T00:00:00Z",
23
+ "updatedAt": "2026-10-16T00:00:00Z"
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stravica-ai/rcf-schemas",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "JSON Schemas for the Requirements Confidence Framework (RCF). Language-neutral. The contract every RCF tool keys to.",
6
6
  "license": "Apache-2.0",
@@ -138,7 +138,8 @@
138
138
  "selector": {
139
139
  "type": "string",
140
140
  "minLength": 1,
141
- "description": "DOM selector that must be present in the rendered response."
141
+ "pattern": "\\S",
142
+ "description": "DOM selector that must be present in the rendered response. At least one non-whitespace character is required."
142
143
  },
143
144
  "parityEnv": {
144
145
  "type": "string",
@@ -156,12 +157,14 @@
156
157
  "name": {
157
158
  "type": "string",
158
159
  "minLength": 1,
159
- "description": "Response header name."
160
+ "pattern": "\\S",
161
+ "description": "Response header name. At least one non-whitespace character is required."
160
162
  },
161
163
  "match": {
162
164
  "type": "string",
163
165
  "minLength": 1,
164
- "description": "Value the named header must match. Match semantics belong to the consuming resolver."
166
+ "pattern": "\\S",
167
+ "description": "Value the named header must match. Match semantics belong to the consuming resolver. At least one non-whitespace character is required."
165
168
  }
166
169
  },
167
170
  "description": "Response header assertion on an acceptance-criterion probe. Both name and match are required."
@@ -173,12 +176,14 @@
173
176
  "contains": {
174
177
  "type": "string",
175
178
  "minLength": 1,
176
- "description": "Literal text the response body must contain."
179
+ "pattern": "\\S",
180
+ "description": "Literal text the response body must contain. At least one non-whitespace character is required."
177
181
  },
178
182
  "matches": {
179
183
  "type": "string",
180
184
  "minLength": 1,
181
- "description": "Regular expression source the response body must match."
185
+ "pattern": "\\S",
186
+ "description": "Regular expression source the response body must match. At least one non-whitespace character is required."
182
187
  }
183
188
  },
184
189
  "minProperties": 1,