okf 1.12.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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +296 -0
  3. data/README.md +94 -466
  4. data/lib/okf/bundle/folder.rb +48 -3
  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 +47 -18
  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 +124 -8
  15. data/lib/okf/cli/catalog.rb +2 -2
  16. data/lib/okf/cli/command.rb +93 -19
  17. data/lib/okf/cli/dirs.rb +1 -1
  18. data/lib/okf/cli/files.rb +2 -2
  19. data/lib/okf/cli/index.rb +3 -3
  20. data/lib/okf/cli/lint.rb +70 -12
  21. data/lib/okf/cli/references.rb +97 -0
  22. data/lib/okf/cli/search.rb +23 -8
  23. data/lib/okf/cli/stats.rb +3 -39
  24. data/lib/okf/cli/tags.rb +6 -43
  25. data/lib/okf/cli/types.rb +1 -1
  26. data/lib/okf/cli/validate.rb +3 -3
  27. data/lib/okf/cli.rb +4 -1
  28. data/lib/okf/concept/file.rb +17 -2
  29. data/lib/okf/concept.rb +362 -10
  30. data/lib/okf/markdown/citations.rb +41 -4
  31. data/lib/okf/markdown/frontmatter.rb +1 -1
  32. data/lib/okf/markdown/links.rb +67 -7
  33. data/lib/okf/path.rb +17 -3
  34. data/lib/okf/render/graph/template.html.erb +173 -41
  35. data/lib/okf/render/graph.rb +11 -3
  36. data/lib/okf/safe_read.rb +50 -0
  37. data/lib/okf/server/app.rb +47 -15
  38. data/lib/okf/server/hub.rb +1 -1
  39. data/lib/okf/skill/SKILL.md +14 -12
  40. data/lib/okf/skill/playbooks/curate.md +8 -3
  41. data/lib/okf/skill/playbooks/doctor.md +3 -1
  42. data/lib/okf/skill/playbooks/maintain.md +7 -6
  43. data/lib/okf/skill/playbooks/menu.md +5 -4
  44. data/lib/okf/skill/playbooks/migrate.md +31 -8
  45. data/lib/okf/skill/playbooks/produce.md +16 -9
  46. data/lib/okf/skill/playbooks/search.md +2 -2
  47. data/lib/okf/skill/reference/SPEC.md +739 -187
  48. data/lib/okf/skill/reference/authoring.md +154 -35
  49. data/lib/okf/skill/reference/cli.md +160 -44
  50. data/lib/okf/skill/templates/attested-computation.md +41 -0
  51. data/lib/okf/skill/templates/concept.md +13 -6
  52. data/lib/okf/skill/templates/root-index.md +1 -1
  53. data/lib/okf/version.rb +1 -1
  54. data/lib/okf.rb +23 -2
  55. metadata +7 -3
  56. data/CODE_OF_CONDUCT.md +0 -10
data/lib/okf/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OKF
4
- VERSION = "1.12.0"
4
+ VERSION = "2.0.0"
5
5
  end
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,10 +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"
59
+ require "okf/safe_read"
41
60
 
42
- # ── Markdown: parse structure out of a markdown document (§4/§5/§8) ──
61
+ # ── Markdown: parse structure out of a markdown document (§4/§6/§5.1) ──
43
62
  require "okf/markdown/frontmatter"
44
63
  require "okf/markdown/links"
45
64
  require "okf/markdown/citations"
@@ -48,6 +67,8 @@ module OKF
48
67
  require "okf/concept"
49
68
  require "okf/bundle"
50
69
  require "okf/bundle/graph"
70
+ require "okf/bundle/references"
71
+ require "okf/bundle/row_filter"
51
72
  require "okf/bundle/skeleton"
52
73
  require "okf/bundle/search"
53
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.12.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Serradura
@@ -78,7 +78,6 @@ extensions: []
78
78
  extra_rdoc_files: []
79
79
  files:
80
80
  - CHANGELOG.md
81
- - CODE_OF_CONDUCT.md
82
81
  - LICENSE.txt
83
82
  - NOTICE
84
83
  - README.md
@@ -90,6 +89,8 @@ files:
90
89
  - lib/okf/bundle/linter.rb
91
90
  - lib/okf/bundle/linter/report.rb
92
91
  - lib/okf/bundle/reader.rb
92
+ - lib/okf/bundle/references.rb
93
+ - lib/okf/bundle/row_filter.rb
93
94
  - lib/okf/bundle/search.rb
94
95
  - lib/okf/bundle/search/index.rb
95
96
  - lib/okf/bundle/search/scan.rb
@@ -106,6 +107,7 @@ files:
106
107
  - lib/okf/cli/index.rb
107
108
  - lib/okf/cli/lint.rb
108
109
  - lib/okf/cli/loose.rb
110
+ - lib/okf/cli/references.rb
109
111
  - lib/okf/cli/registry.rb
110
112
  - lib/okf/cli/render.rb
111
113
  - lib/okf/cli/search.rb
@@ -124,6 +126,7 @@ files:
124
126
  - lib/okf/registry.rb
125
127
  - lib/okf/render/graph.rb
126
128
  - lib/okf/render/graph/template.html.erb
129
+ - lib/okf/safe_read.rb
127
130
  - lib/okf/server/app.rb
128
131
  - lib/okf/server/hub.rb
129
132
  - lib/okf/server/hub/not_found.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
@@ -155,7 +159,7 @@ metadata:
155
159
  allowed_push_host: https://rubygems.org
156
160
  homepage_uri: https://github.com/serradura/okf-gem
157
161
  source_code_uri: https://github.com/serradura/okf-gem
158
- changelog_uri: https://github.com/serradura/okf-gem/blob/main/CHANGELOG.md
162
+ changelog_uri: https://github.com/serradura/okf-gem/blob/main/okf/CHANGELOG.md
159
163
  rubygems_mfa_required: 'true'
160
164
  rdoc_options: []
161
165
  require_paths:
data/CODE_OF_CONDUCT.md DELETED
@@ -1,10 +0,0 @@
1
- # Code of Conduct
2
-
3
- "okf" follows [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct) in all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.):
4
-
5
- * Participants will be tolerant of opposing views.
6
- * Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
7
- * When interpreting the words and actions of others, participants should always assume good intentions.
8
- * Behaviour which can be reasonably considered harassment will not be tolerated.
9
-
10
- If you have any concerns about behaviour within this project, please contact us at ["rodrigo.serradura@gmail.com"](mailto:"rodrigo.serradura@gmail.com").