@zalom/plastic 1.0.0-alpha.30 → 1.0.0-alpha.31
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/package.json
CHANGED
|
@@ -9,7 +9,8 @@ require "time"
|
|
|
9
9
|
# (intent 60).
|
|
10
10
|
#
|
|
11
11
|
# An intent is born complete when its frontmatter carries every required field
|
|
12
|
-
# and its `sources` and `chain` are well-formed arrays of Folgezettel id
|
|
12
|
+
# and its `sources` and `chain` are well-formed arrays of Folgezettel id references
|
|
13
|
+
# (bare ids like `1a2`, or cross-store refs like `global:1a2`; integer ids are coerced).
|
|
13
14
|
# This module is the only definition of that contract; the `validate-intent` CLI,
|
|
14
15
|
# the doctor diagnostics, and the creating-intent skill all consult it so the
|
|
15
16
|
# definition never drifts across copies.
|
|
@@ -28,11 +29,11 @@ module IntentValidator
|
|
|
28
29
|
|
|
29
30
|
# Folgezettel id form: digits then an optional lowercase-letter/digit suffix
|
|
30
31
|
# (for example "14", "14a", "4a1"). Mirrors scripts/folgezettel-id.
|
|
31
|
-
ID_PATTERN = /\A
|
|
32
|
+
ID_PATTERN = /\A([a-z0-9-]+:)?\d+[a-z0-9]*\z/
|
|
32
33
|
|
|
33
34
|
# True iff `value` is a String matching the Folgezettel id form.
|
|
34
35
|
def valid_id?(value)
|
|
35
|
-
value.
|
|
36
|
+
value.to_s.match?(ID_PATTERN)
|
|
36
37
|
end
|
|
37
38
|
|
|
38
39
|
# Read a file's YAML frontmatter, returning the parsed Hash (or {} when the
|