Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions conformance/blueprint/v1/cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@
"phase": "structural",
"path": "structural/023-generated-parameter-marked-insensitive"
},
{
"id": "structural-024-integer-parameter-type",
"phase": "structural",
"path": "structural/024-integer-parameter-type"
},
{
"id": "structural-025-json-parameter-with-pattern",
"phase": "structural",
"path": "structural/025-json-parameter-with-pattern"
},
{
"id": "structural-026-json-parameter",
"phase": "structural",
"path": "structural/026-json-parameter"
},
{
"id": "semantic-001-connection-names-unknown-role",
"phase": "semantic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Both components declare `adminPassword`, and they disagree about what it is:
# a STRING for `api`, an INTEGER for `db`. Silent first-wins would hand `db` a
# a STRING for `api`, a NUMBER for `db`. Silent first-wins would hand `db` a
# value validated against `api`'s rules and fail at deploy time, a long way from
# either document.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
inputs:
adminPassword:
schema:
type: INTEGER
type: NUMBER
isSensitive: true
suppliedBy: USER
ui:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `db` publishes an INTEGER port; `web` asks for a STRING. Both ends resolve —
# `db` publishes a NUMBER port; `web` asks for a STRING. Both ends resolve —
# the node, the output and the input all exist — so nothing above §4.2's
# compatibility rule fires. Without it the mismatch reaches the consuming
# workload at deploy time with nothing pointing back at either document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ spec:
outputs:
port:
schema:
type: INTEGER
type: NUMBER
valueFrom: DECLARED
value: '5432'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The parameter asks for an INTEGER; the input it covers declares a STRING.
# The parameter asks for a NUMBER; the input it covers declares a STRING.
# The deploying user is validated against the parameter's schema and the
# component then receives the result against its own, so nothing fails until the
# workload starts.
Expand All @@ -20,7 +20,7 @@ spec:
parameters:
adminPassword:
schema:
type: INTEGER
type: NUMBER
isSensitive: true
isRequired: true
ui:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# The component half of this rule is component structural/039. This family
# carries its own parameter value schema, so a fixture over there proves nothing
# about a blueprint — the two would drift apart silently and CI would stay
# green.
specVersion: v1
kind: BLUEPRINT
metadata:
slug: acme-wiki
version: 1
spec:
components:
db:
component: ./components/postgres.yaml
size: general.standard.small
connections: {}
parameters:
replicaCount:
schema:
type: INTEGER
isRequired: true
ui:
label: Replica count
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"code": "ERR_INVALID_VALUE",
"path": "/spec/parameters/replicaCount/schema/type"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "structural-024-integer-parameter-type",
"phase": "structural",
"expected": "fail",
"clause": "specifications/blueprint/v1/spec.md#authored-parameters",
"requirements": ["COMP-VAL-001"],
"summary": "An authored parameter declaring the withdrawn INTEGER shape is rejected."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# The JSON restrictions belong to component §6.3 and this family enforces them
# on the same terms. Fixtured here because the enforcement is a separate schema
# module, not because the rule is a separate rule.
specVersion: v1
kind: BLUEPRINT
metadata:
slug: acme-wiki
version: 1
spec:
components:
db:
component: ./components/postgres.yaml
size: general.standard.small
connections: {}
parameters:
settings:
schema:
type: JSON
pattern: '^\{.*\}$'
isRequired: false
ui:
label: Advanced settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"code": "ERR_INVALID_TYPE",
"path": "/spec/parameters/settings/schema/pattern"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "structural-025-json-parameter-with-pattern",
"phase": "structural",
"expected": "fail",
"clause": "specifications/blueprint/v1/spec.md#authored-parameters",
"requirements": ["COMP-VAL-002"],
"summary": "A regular expression on a JSON parameter is rejected."
}
21 changes: 21 additions & 0 deletions conformance/blueprint/v1/structural/026-json-parameter/case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The positive verdict for the same module, so both branches of the conditional
# are exercised in this family and not only in the component one.
specVersion: v1
kind: BLUEPRINT
metadata:
slug: acme-wiki
version: 1
spec:
components:
db:
component: ./components/postgres.yaml
size: general.standard.small
connections: {}
parameters:
settings:
schema:
type: JSON
default: '{"logLevel":"info"}'
isRequired: false
ui:
label: Advanced settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "structural-026-json-parameter",
"phase": "structural",
"expected": "pass",
"clause": "specifications/blueprint/v1/spec.md#authored-parameters",
"requirements": ["COMP-VAL-001"],
"summary": "An authored parameter may take a JSON value."
}
30 changes: 30 additions & 0 deletions conformance/component/v1/cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,36 @@
"phase": "structural",
"path": "structural/038-probe-defaults-are-effective"
},
{
"id": "structural-039-integer-value-type",
"phase": "structural",
"path": "structural/039-integer-value-type"
},
{
"id": "structural-040-number-value-type",
"phase": "structural",
"path": "structural/040-number-value-type"
},
{
"id": "structural-041-json-value-type",
"phase": "structural",
"path": "structural/041-json-value-type"
},
{
"id": "structural-042-json-value-with-pattern",
"phase": "structural",
"path": "structural/042-json-value-with-pattern"
},
{
"id": "structural-043-json-value-with-enum",
"phase": "structural",
"path": "structural/043-json-value-with-enum"
},
{
"id": "structural-044-format-on-a-non-string-value",
"phase": "structural",
"path": "structural/044-format-on-a-non-string-value"
},
{
"id": "semantic-001-floating-tag-image-reference",
"phase": "semantic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
inputs:
gamePort:
schema:
type: INTEGER
type: NUMBER
ui:
label: Game server port
platformDefault:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# INTEGER was a member of this vocabulary and is not one now. The case exists to
# make the withdrawal executable rather than declared: it passed before NUMBER
# replaced INTEGER, and fails after. See ADR 0013.
specVersion: v1
kind: COMPONENT
metadata:
version: 1
spec:
workload:
kind: SERVICE
source:
type: IMAGE
ref: nginx:1.29.4-alpine
endpoints:
web:
containerPort: 8080
protocol: HTTP
visibility: PRIVATE
contract:
inputs:
replicaCount:
schema:
type: INTEGER
ui:
label: Replica count
outputs: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"code": "ERR_INVALID_VALUE",
"path": "/spec/contract/inputs/replicaCount/schema/type"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "structural-039-integer-value-type",
"phase": "structural",
"expected": "fail",
"clause": "specifications/component/v1/spec.md#value-schema",
"requirements": ["COMP-VAL-001"],
"summary": "A value schema declaring the withdrawn INTEGER shape is rejected."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# NUMBER is JSON's own numeric kind, so it covers whole numbers and reals alike.
# An author who needs whole numbers writes the constraint rather than reaching
# for a second type, and this is what that looks like. The output's `value` is a
# quoted string because every value is carried as text — the shape names the
# string form, not a host type.
specVersion: v1
kind: COMPONENT
metadata:
version: 1
spec:
workload:
kind: SERVICE
source:
type: IMAGE
ref: postgres:17.10-alpine
endpoints:
primary:
containerPort: 5432
protocol: TCP
visibility: PRIVATE
contract:
inputs:
port:
schema:
type: NUMBER
pattern: '^-?[0-9]+$'
ui:
label: Listen port
outputs:
port:
schema:
type: NUMBER
valueFrom: DECLARED
value: '5432'
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "structural-040-number-value-type",
"phase": "structural",
"expected": "pass",
"clause": "specifications/component/v1/spec.md#value-schema",
"requirements": ["COMP-VAL-001"],
"summary": "A NUMBER value constrained to whole numbers by a pattern validates.",
"effective": {
"/spec/contract/inputs/port/schema/format": null,
"/spec/contract/inputs/port/schema/isSensitive": false,
"/spec/contract/inputs/port/schema/semanticType": null
}
}
34 changes: 34 additions & 0 deletions conformance/component/v1/structural/041-json-value-type/case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# A JSON value's string form is a JSON document, so its `default` is a string
# whose content is that document — quoted, or the YAML profile would read it as
# a flow mapping and reject it against `type: string`. Nothing in any phase
# parses it: the contract does not check a value against the shape beside it,
# and that is as true of JSON as of every other member.
specVersion: v1
kind: COMPONENT
metadata:
version: 1
spec:
workload:
kind: SERVICE
source:
type: IMAGE
ref: nginx:1.29.4-alpine
endpoints:
web:
containerPort: 8080
protocol: HTTP
visibility: PRIVATE
contract:
inputs:
settings:
schema:
type: JSON
default: '{"logLevel":"info"}'
ui:
label: Advanced settings
outputs:
topology:
schema:
type: JSON
valueFrom: DECLARED
value: '{"shards":1}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "structural-041-json-value-type",
"phase": "structural",
"expected": "pass",
"clause": "specifications/component/v1/spec.md#value-schema",
"requirements": ["COMP-VAL-001"],
"summary": "A JSON value carries its default as JSON text.",
"effective": {
"/spec/contract/inputs/settings/schema/pattern": null,
"/spec/contract/inputs/settings/schema/format": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# One JSON value has many spellings, and a regular expression decides membership
# on the spelling. A rule written with one would accept one author's formatter
# and reject another's, so the pairing is rejected outright rather than left to
# mean whatever each implementation's serializer happens to emit.
specVersion: v1
kind: COMPONENT
metadata:
version: 1
spec:
workload:
kind: SERVICE
source:
type: IMAGE
ref: nginx:1.29.4-alpine
endpoints:
web:
containerPort: 8080
protocol: HTTP
visibility: PRIVATE
contract:
inputs:
settings:
schema:
type: JSON
pattern: '^\{.*\}$'
ui:
label: Advanced settings
outputs: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"code": "ERR_INVALID_TYPE",
"path": "/spec/contract/inputs/settings/schema/pattern"
}
]
Loading