okf 1.13.0 → 2.0.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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +195 -0
  3. data/README.md +25 -6
  4. data/lib/okf/bundle/folder.rb +27 -1
  5. data/lib/okf/bundle/graph.rb +12 -3
  6. data/lib/okf/bundle/linter.rb +470 -47
  7. data/lib/okf/bundle/reader.rb +10 -4
  8. data/lib/okf/bundle/references.rb +111 -0
  9. data/lib/okf/bundle/row_filter.rb +53 -0
  10. data/lib/okf/bundle/search.rb +20 -2
  11. data/lib/okf/bundle/validator/result.rb +6 -3
  12. data/lib/okf/bundle/validator.rb +267 -26
  13. data/lib/okf/bundle/writer.rb +1 -1
  14. data/lib/okf/bundle.rb +105 -4
  15. data/lib/okf/cli/catalog.rb +1 -1
  16. data/lib/okf/cli/command.rb +27 -8
  17. data/lib/okf/cli/files.rb +1 -1
  18. data/lib/okf/cli/index.rb +1 -1
  19. data/lib/okf/cli/lint.rb +70 -12
  20. data/lib/okf/cli/references.rb +97 -0
  21. data/lib/okf/cli/search.rb +2 -1
  22. data/lib/okf/cli/stats.rb +3 -39
  23. data/lib/okf/cli/tags.rb +6 -43
  24. data/lib/okf/cli/types.rb +1 -1
  25. data/lib/okf/cli/validate.rb +3 -3
  26. data/lib/okf/cli.rb +4 -1
  27. data/lib/okf/concept.rb +362 -10
  28. data/lib/okf/markdown/citations.rb +41 -4
  29. data/lib/okf/markdown/frontmatter.rb +1 -1
  30. data/lib/okf/markdown/links.rb +67 -7
  31. data/lib/okf/render/graph/template.html.erb +173 -41
  32. data/lib/okf/render/graph.rb +11 -3
  33. data/lib/okf/server/app.rb +47 -15
  34. data/lib/okf/server/hub.rb +1 -1
  35. data/lib/okf/skill/SKILL.md +14 -12
  36. data/lib/okf/skill/playbooks/curate.md +8 -3
  37. data/lib/okf/skill/playbooks/doctor.md +3 -1
  38. data/lib/okf/skill/playbooks/maintain.md +7 -6
  39. data/lib/okf/skill/playbooks/menu.md +5 -4
  40. data/lib/okf/skill/playbooks/migrate.md +31 -8
  41. data/lib/okf/skill/playbooks/produce.md +16 -9
  42. data/lib/okf/skill/playbooks/search.md +2 -2
  43. data/lib/okf/skill/reference/SPEC.md +739 -187
  44. data/lib/okf/skill/reference/authoring.md +154 -35
  45. data/lib/okf/skill/reference/cli.md +155 -42
  46. data/lib/okf/skill/templates/attested-computation.md +41 -0
  47. data/lib/okf/skill/templates/concept.md +13 -6
  48. data/lib/okf/skill/templates/root-index.md +1 -1
  49. data/lib/okf/version.rb +1 -1
  50. data/lib/okf.rb +22 -2
  51. metadata +5 -1
data/lib/okf.rb CHANGED
@@ -16,7 +16,7 @@ module OKF
16
16
 
17
17
  # Blank in the frontmatter sense: nil, false, an empty/whitespace-only string,
18
18
  # or an empty collection. Numbers and other scalars are never blank. The one
19
- # domain-wide predicate behind "non-empty type" (§9.2) and the recommended-field
19
+ # domain-wide predicate behind "non-empty type" (§11 cond. 2) and the recommended-field
20
20
  # warnings, kept here so the gem needs no ActiveSupport.
21
21
  def self.blank?(value)
22
22
  return true if value.nil? || value == false
@@ -25,6 +25,18 @@ module OKF
25
25
  value.respond_to?(:empty?) ? value.empty? : false
26
26
  end
27
27
 
28
+ # A temporal value as ISO 8601 — the one serialization rule for
29
+ # generated_at/stale_after, shared by the catalog row and /node/meta so the
30
+ # served and baked pages cannot drift over one concept's dates. YAML hands
31
+ # over a Date or a Time for an unquoted value (whose default to_s is not
32
+ # ISO); a String passes through; a degenerate value serializes as its
33
+ # string, never as raw structure.
34
+ def self.iso8601(value)
35
+ return nil if value.nil?
36
+
37
+ value.respond_to?(:iso8601) ? value.iso8601 : value.to_s
38
+ end
39
+
28
40
  # The directory a concept lives in, derived from its §2 id: the id *is* the
29
41
  # path minus `.md`, so putting the suffix back and taking the dirname is the
30
42
  # definition rather than a parse of it. One home for it because three views
@@ -36,11 +48,17 @@ module OKF
36
48
 
37
49
  require "okf/version"
38
50
 
51
+ # The OKF spec version this gem targets — one declaration behind the validate
52
+ # header and its help row, so the version a bundle is judged against cannot
53
+ # be stated two ways. The gem still *reads* v0.1 (§13.1); this is what it
54
+ # validates for. Known readable versions: Concept::KNOWN_SPEC_VERSIONS.
55
+ SPEC_VERSION = "0.2"
56
+
39
57
  # ── kernel: cross-cutting primitives ──
40
58
  require "okf/path"
41
59
  require "okf/safe_read"
42
60
 
43
- # ── Markdown: parse structure out of a markdown document (§4/§5/§8) ──
61
+ # ── Markdown: parse structure out of a markdown document (§4/§6/§5.1) ──
44
62
  require "okf/markdown/frontmatter"
45
63
  require "okf/markdown/links"
46
64
  require "okf/markdown/citations"
@@ -49,6 +67,8 @@ module OKF
49
67
  require "okf/concept"
50
68
  require "okf/bundle"
51
69
  require "okf/bundle/graph"
70
+ require "okf/bundle/references"
71
+ require "okf/bundle/row_filter"
52
72
  require "okf/bundle/skeleton"
53
73
  require "okf/bundle/search"
54
74
  # These two lines ARE the engine preference order. Each engine registers itself
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Serradura
@@ -89,6 +89,8 @@ files:
89
89
  - lib/okf/bundle/linter.rb
90
90
  - lib/okf/bundle/linter/report.rb
91
91
  - lib/okf/bundle/reader.rb
92
+ - lib/okf/bundle/references.rb
93
+ - lib/okf/bundle/row_filter.rb
92
94
  - lib/okf/bundle/search.rb
93
95
  - lib/okf/bundle/search/index.rb
94
96
  - lib/okf/bundle/search/scan.rb
@@ -105,6 +107,7 @@ files:
105
107
  - lib/okf/cli/index.rb
106
108
  - lib/okf/cli/lint.rb
107
109
  - lib/okf/cli/loose.rb
110
+ - lib/okf/cli/references.rb
108
111
  - lib/okf/cli/registry.rb
109
112
  - lib/okf/cli/render.rb
110
113
  - lib/okf/cli/search.rb
@@ -143,6 +146,7 @@ files:
143
146
  - lib/okf/skill/reference/SPEC.md
144
147
  - lib/okf/skill/reference/authoring.md
145
148
  - lib/okf/skill/reference/cli.md
149
+ - lib/okf/skill/templates/attested-computation.md
146
150
  - lib/okf/skill/templates/concept.md
147
151
  - lib/okf/skill/templates/index.md
148
152
  - lib/okf/skill/templates/log.md