jekyll-theme-zer0 1.10.0 → 1.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e3dadf187dfaae9c1186aa1e0864f19ca74e9564cee0b0fa3136657fda6cf03
4
- data.tar.gz: '024782a85ed83017188dac310e4aa75ed22f41d604576758f4f7f49564cba984'
3
+ metadata.gz: bbe0013679e3fd31006811bfaafd9a011e3e21c2acdc892cefabc2968e5cc542
4
+ data.tar.gz: 678d6fba0883cbb6228d601d11880909ecbb34bf12c861d0ec9f0535ceeccf34
5
5
  SHA512:
6
- metadata.gz: 692271e54f6065325496b8bcfc9956194e085bd07d7a53f3c9adc108b146e846f712d126e5794b52cdbd1cad75e4dbfa91260767820fee2903894472b76af7a7
7
- data.tar.gz: f0dd37b5871364845af1f663f41f59910f5e9e4ed2d5a6c3033fe56433f9f5006d8e99bcd3054c1f4352b542d9857232082c1a219d15a7cb5f1a1defedc72ecc
6
+ metadata.gz: 8ae41e18796c02009349411e1e9ea45723fd383004560d781a4fcfa266db4fbc6f246755b275b6aabfc86abde0482dcc11380b7065cff0c7a945276f7b48797a
7
+ data.tar.gz: 28b154eda3a2405e6b0e506fb9a293c53956d731d7a4c8239cd1ca3d58a10b6ec28195640d2a8da96853ccd3ea0c5b2c13476ac28f422650bec5259412178ff5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.11.0] - 2026-06-01
4
+
5
+ ### Changed
6
+ - Version bump: minor release
7
+
8
+ ### Commits in this release
9
+ - 8a5ba7e2 feat(ci): add continuous-evolution backlog loop (#114)
10
+
11
+
12
+ ## [Unreleased]
13
+
14
+ ### Added
15
+ - **Continuous-evolution loop**: a self-sustaining backlog mechanism so AI agents can keep improving the repo between human sessions.
16
+ - `_data/backlog.yml` — tactical task queue (single source of truth), mirroring the `_data/roadmap.yml` pattern.
17
+ - `scripts/sync-backlog.rb` (+ `scripts/sync-backlog.sh`) — schema validator and GitHub Issues sync (idempotent via `<!-- backlog-id -->` markers).
18
+ - `.github/workflows/backlog-sync.yml` — syncs the backlog to issues on push to `main`; validates schema on PRs.
19
+ - `.github/workflows/auto-merge.yml` — enables native auto-merge for low-risk (`docs`/`deps`/`lint`) PRs once CI is green.
20
+ - `.github/prompts/repo-audit.prompt.md` (`/repo-audit`) and `.github/prompts/backlog-implement.prompt.md` (`/backlog-implement`) — the audit and implement routines.
21
+ - `.github/instructions/backlog.instructions.md` — file-scoped guidance for the backlog.
22
+ - `docs/systems/continuous-evolution.md` — full design, autonomy policy, and setup.
23
+ - `CLAUDE.md` — Claude Code pointer to `AGENTS.md` (per the documented convention).
3
24
  ## [1.10.0] - 2026-06-01
4
25
 
5
26
  ### Changed
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  title: zer0-mistakes
3
3
  sub-title: AI-Native Jekyll Theme
4
4
  description: AI-native Jekyll theme for GitHub Pages — Docker-first development, AI-powered installation, multi-agent integration (Copilot, Codex, Cursor, Claude), AI preview-image generation, and AIEO content optimization with Bootstrap 5.3.
5
- version: 1.10.0
5
+ version: 1.11.0
6
6
  layout: landing
7
7
  tags:
8
8
  - jekyll
@@ -20,7 +20,7 @@ categories:
20
20
  - bootstrap
21
21
  - ai-tooling
22
22
  created: 2024-02-10T23:51:11.480Z
23
- lastmod: 2026-06-01T03:29:07.000Z
23
+ lastmod: 2026-06-01T03:33:27.000Z
24
24
  draft: false
25
25
  permalink: /
26
26
  slug: zer0
@@ -901,7 +901,7 @@ git push origin feature/awesome-feature
901
901
 
902
902
  | Metric | Value |
903
903
  |--------|-------|
904
- | **Current Version** | 1.10.0 ([RubyGems](https://rubygems.org/gems/jekyll-theme-zer0), [CHANGELOG](/CHANGELOG)) |
904
+ | **Current Version** | 1.11.0 ([RubyGems](https://rubygems.org/gems/jekyll-theme-zer0), [CHANGELOG](/CHANGELOG)) |
905
905
  | **Documented Features** | 43 ([Feature Registry](https://github.com/bamr87/zer0-mistakes/blob/main/_data/features.yml)) |
906
906
  | **Setup Time** | 2-5 minutes ([install.sh benchmarks](https://github.com/bamr87/zer0-mistakes/blob/main/install.sh)) |
907
907
  | **Documentation Pages** | 70+ ([browse docs](https://zer0-mistakes.com/pages/)) |
@@ -956,6 +956,6 @@ And these AI partners that make zer0-mistakes truly AI-native:
956
956
 
957
957
  **Built with ❤️ — and a little help from our AI partners — for the Jekyll community**
958
958
 
959
- **v1.10.0** • [Changelog](CHANGELOG.md) • [License](LICENSE) • [Contributing](CONTRIBUTING.md) • [AI Agent Guide](AGENTS.md)
959
+ **v1.11.0** • [Changelog](CHANGELOG.md) • [License](LICENSE) • [Contributing](CONTRIBUTING.md) • [AI Agent Guide](AGENTS.md)
960
960
 
961
961
 
data/_data/backlog.yml ADDED
@@ -0,0 +1,161 @@
1
+ # =============================================================================
2
+ # zer0-mistakes Backlog — Tactical Task Queue (Single Source of Truth)
3
+ # =============================================================================
4
+ #
5
+ # This file is the canonical, machine-readable backlog of *tactical* tasks
6
+ # (the granular, pickup-able work items). It complements `_data/roadmap.yml`,
7
+ # which holds the *strategic* milestones.
8
+ #
9
+ # It powers the continuous-evolution loop:
10
+ #
11
+ # 1. The AUDIT routine (`.github/prompts/repo-audit.prompt.md`) appends new
12
+ # tasks here when it reviews the repo.
13
+ # 2. `scripts/sync-backlog.rb` (run by `.github/workflows/backlog-sync.yml`)
14
+ # mirrors each open task to a GitHub Issue and closes issues for tasks
15
+ # marked `done`.
16
+ # 3. The IMPLEMENT routine (`.github/prompts/backlog-implement.prompt.md`)
17
+ # picks the highest-priority open task, implements it, and opens a PR.
18
+ #
19
+ # See `docs/systems/continuous-evolution.md` for the full design.
20
+ #
21
+ # To add a task by hand:
22
+ # 1. Copy the schema block below; give it the next free `T-NNN` id.
23
+ # 2. Set status/priority/area/risk/effort/source and acceptance criteria.
24
+ # 3. Commit. The sync workflow creates the matching GitHub Issue on push.
25
+ #
26
+ # =============================================================================
27
+ # Schema
28
+ # =============================================================================
29
+ #
30
+ # meta:
31
+ # title: Display title
32
+ # updated: Last-reviewed date (YYYY-MM-DD)
33
+ # next_id: Next free task id number (the audit routine increments this)
34
+ #
35
+ # tasks:
36
+ # - id: Stable task id, "T-NNN" (never reused; matches the GitHub Issue)
37
+ # title: One line — becomes the GitHub Issue title
38
+ # status: open | in-progress | blocked | done
39
+ # priority: P0 (urgent) | P1 | P2 | P3 (nice-to-have)
40
+ # area: tests | docs | feat | infra | a11y | perf | deps | lint
41
+ # risk: low (auto-merge eligible) | standard (human review required)
42
+ # effort: S | M | L
43
+ # source: audit | roadmap | issue | user
44
+ # summary: 1–2 lines of context
45
+ # acceptance: List of checkable done-criteria the implement routine verifies
46
+ # links: { issue: <#|null>, pr: <#|null>, roadmap: "<version>|null" }
47
+ # created: YYYY-MM-DD
48
+ # updated: YYYY-MM-DD
49
+ #
50
+ # `risk: low` + area in {docs, deps, lint} makes a task auto-merge eligible once
51
+ # CI is green (see `.github/prompts/backlog-implement.prompt.md`). Everything
52
+ # else stays PR-only for human review.
53
+ #
54
+ # =============================================================================
55
+
56
+ meta:
57
+ title: "zer0-mistakes Backlog"
58
+ updated: 2026-05-31
59
+ next_id: 7
60
+
61
+ tasks:
62
+ # --- Housekeeping (seeded so the loop has work on day one) ------------------
63
+
64
+ - id: T-001
65
+ title: "Reconcile roadmap milestone numbering with the published gem version"
66
+ status: open
67
+ priority: P2
68
+ area: docs
69
+ risk: standard
70
+ effort: M
71
+ source: user
72
+ summary: >-
73
+ `_data/roadmap.yml` milestones run 0.17–1.0 while the gem ships as 1.9.9.
74
+ Decide on a single numbering scheme (or document the mapping) so the
75
+ roadmap, README, and RubyGems version no longer contradict each other.
76
+ acceptance:
77
+ - "Roadmap version line and gem version no longer contradict (either remapped or an explicit mapping note added to `_data/roadmap.yml` and `pages/roadmap.md`)."
78
+ - "`./scripts/generate-roadmap.sh --check` passes after the change."
79
+ - "No edit to `lib/jekyll-theme-zer0/version.rb`."
80
+ links: { issue: null, pr: null, roadmap: null }
81
+ created: 2026-05-31
82
+ updated: 2026-05-31
83
+
84
+ - id: T-002
85
+ title: "Refresh roadmap `updated:` date and review milestone statuses"
86
+ status: open
87
+ priority: P3
88
+ area: docs
89
+ risk: low
90
+ effort: S
91
+ source: user
92
+ summary: >-
93
+ `_data/roadmap.yml` `meta.updated` is 2026-04-18. Refresh it and confirm
94
+ the 0.22 "active" milestone still reflects reality.
95
+ acceptance:
96
+ - "`meta.updated` set to the current date."
97
+ - "Active/planned statuses reviewed against shipped work."
98
+ - "`./scripts/generate-roadmap.sh --check` passes."
99
+ links: { issue: null, pr: null, roadmap: null }
100
+ created: 2026-05-31
101
+ updated: 2026-05-31
102
+
103
+ - id: T-003
104
+ title: "Add GitHub issue templates and a pull-request template"
105
+ status: open
106
+ priority: P2
107
+ area: infra
108
+ risk: standard
109
+ effort: M
110
+ source: user
111
+ summary: >-
112
+ The repo has no `.github/ISSUE_TEMPLATE/` or PR template. Add a bug-report
113
+ and feature-request issue form plus a PR template that nudges contributors
114
+ toward conventional commits, CHANGELOG updates, and the test checklist.
115
+ acceptance:
116
+ - "`.github/ISSUE_TEMPLATE/bug_report.yml` and `feature_request.yml` exist and render."
117
+ - "`.github/pull_request_template.md` exists with a conventional-commit + CHANGELOG + tests checklist."
118
+ - "Agent-filed backlog issues remain compatible with the new templates (no broken automation)."
119
+ links: { issue: null, pr: null, roadmap: null }
120
+ created: 2026-05-31
121
+ updated: 2026-05-31
122
+
123
+ - id: T-004
124
+ title: "Docs-freshness sweep: reconcile docs/ ↔ pages/_docs/ and fix broken links"
125
+ status: open
126
+ priority: P2
127
+ area: docs
128
+ risk: low
129
+ effort: M
130
+ source: user
131
+ summary: >-
132
+ Run the markdown-link checker and audit the two-tier docs for drift,
133
+ stale dates/versions, and any user/technical pages that fell out of sync
134
+ after the recent alignment commit.
135
+ acceptance:
136
+ - "`markdown-link-check` (config in `.github/config/`) reports no broken internal links."
137
+ - "Any stale version/date references in `docs/` and `pages/_docs/` are corrected."
138
+ - "Cross-links between the user tier and technical tier resolve both ways."
139
+ links: { issue: null, pr: null, roadmap: null }
140
+ created: 2026-05-31
141
+ updated: 2026-05-31
142
+
143
+ - id: T-005
144
+ title: "Coverage baseline: identify the lowest-covered subsystems toward the v1.0 90% goal"
145
+ status: open
146
+ priority: P1
147
+ area: tests
148
+ risk: standard
149
+ effort: L
150
+ source: roadmap
151
+ summary: >-
152
+ The v1.0 milestone targets 90%+ automated test coverage. Produce a
153
+ coverage baseline and file follow-up tasks for the lowest-covered areas
154
+ (start with the modular installer and the Obsidian resolver paths).
155
+ acceptance:
156
+ - "A coverage baseline is recorded (test/coverage or a docs note)."
157
+ - "The 2–3 lowest-covered subsystems are identified and filed as new backlog tasks."
158
+ - "No reduction in existing passing tests (`./scripts/bin/test` stays green)."
159
+ links: { issue: null, pr: null, roadmap: "1.0" }
160
+ created: 2026-05-31
161
+ updated: 2026-05-31
@@ -0,0 +1,309 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # =============================================================================
5
+ # sync-backlog.rb
6
+ # =============================================================================
7
+ #
8
+ # Mirrors `_data/backlog.yml` (the tactical task queue) to GitHub Issues.
9
+ #
10
+ # - Each task with status open|in-progress|blocked -> an OPEN issue.
11
+ # - Each task with status done -> its issue is CLOSED.
12
+ #
13
+ # Issues are matched back to tasks idempotently by a hidden marker embedded in
14
+ # the issue body: `<!-- backlog-id: T-001 -->`. Re-running the sync updates the
15
+ # title/body/labels in place rather than creating duplicates.
16
+ #
17
+ # Managed labels (created with `gh label create --force` if missing):
18
+ # agent-ready · priority:P0..P3 · area:<area> · risk:<low|standard> · agent-hold
19
+ #
20
+ # Usage:
21
+ # ruby scripts/sync-backlog.rb # create/update/close issues via `gh`
22
+ # ruby scripts/sync-backlog.rb --check # validate schema only (no `gh`, CI/PR gate)
23
+ # ruby scripts/sync-backlog.rb --dry-run # print intended `gh` calls, make no changes
24
+ #
25
+ # Requires the `gh` CLI authenticated with `issues: write` for the write path.
26
+ # `--check` needs only Ruby stdlib (used as the pull-request gate).
27
+ # =============================================================================
28
+
29
+ require 'yaml'
30
+ require 'date'
31
+ require 'json'
32
+ require 'optparse'
33
+ require 'open3'
34
+ require 'shellwords'
35
+
36
+ ROOT = File.expand_path('..', __dir__)
37
+ DATA_FILE = File.join(ROOT, '_data', 'backlog.yml')
38
+
39
+ VALID_STATUS = %w[open in-progress blocked done].freeze
40
+ VALID_PRIORITY = %w[P0 P1 P2 P3].freeze
41
+ VALID_AREA = %w[tests docs feat infra a11y perf deps lint].freeze
42
+ VALID_RISK = %w[low standard].freeze
43
+ VALID_EFFORT = %w[S M L].freeze
44
+ VALID_SOURCE = %w[audit roadmap issue user].freeze
45
+
46
+ OPEN_STATUSES = %w[open in-progress blocked].freeze
47
+
48
+ # Labels this script owns. On each sync we reconcile a task's labels to exactly
49
+ # the managed set it should carry, leaving any human-applied labels untouched.
50
+ def managed_labels(task)
51
+ labels = ['agent-ready', "priority:#{task['priority']}", "area:#{task['area']}", "risk:#{task['risk']}"]
52
+ labels << 'agent-hold' if task['status'] == 'blocked'
53
+ labels
54
+ end
55
+
56
+ ALL_MANAGED_LABELS = (
57
+ ['agent-ready', 'agent-hold'] +
58
+ VALID_PRIORITY.map { |p| "priority:#{p}" } +
59
+ VALID_AREA.map { |a| "area:#{a}" } +
60
+ VALID_RISK.map { |r| "risk:#{r}" }
61
+ ).freeze
62
+
63
+ LABEL_COLORS = {
64
+ 'agent-ready' => '0e8a16',
65
+ 'agent-hold' => 'b60205'
66
+ }.freeze
67
+ PRIORITY_COLOR = 'd93f0b'
68
+ AREA_COLOR = '1d76db'
69
+ RISK_COLOR = 'fbca04'
70
+
71
+ # ---------------------------------------------------------------------------
72
+ # Load + validate
73
+ # ---------------------------------------------------------------------------
74
+
75
+ def load_data
76
+ # Mirror generate-roadmap.rb: permit Date/Time, and fall back for the older
77
+ # macOS system Ruby (2.6) whose safe loader signature differs.
78
+ begin
79
+ YAML.load_file(DATA_FILE, permitted_classes: [Date, Time])
80
+ rescue ArgumentError
81
+ YAML.safe_load(File.read(DATA_FILE), permitted_classes: [Date, Time], aliases: false)
82
+ end
83
+ end
84
+
85
+ def validate(data)
86
+ errors = []
87
+ errors << 'Missing top-level `meta:` mapping.' unless data.is_a?(Hash) && data['meta'].is_a?(Hash)
88
+ tasks = data.is_a?(Hash) ? data['tasks'] : nil
89
+ return ['Missing or empty `tasks:` list.'] unless tasks.is_a?(Array) && !tasks.empty?
90
+
91
+ seen_ids = {}
92
+ tasks.each_with_index do |task, i|
93
+ where = "tasks[#{i}]"
94
+ unless task.is_a?(Hash)
95
+ errors << "#{where}: each task must be a mapping."
96
+ next
97
+ end
98
+ id = task['id']
99
+ where = id ? "task #{id}" : where
100
+ errors << "#{where}: missing `id`." if id.to_s.empty?
101
+ errors << "#{where}: `id` must match T-NNN (got #{id.inspect})." if id && id !~ /\AT-\d{3,}\z/
102
+ if id && seen_ids[id]
103
+ errors << "#{where}: duplicate id #{id} (also at #{seen_ids[id]})."
104
+ elsif id
105
+ seen_ids[id] = where
106
+ end
107
+ errors << "#{where}: missing `title`." if task['title'].to_s.strip.empty?
108
+ check_enum(errors, where, task, 'status', VALID_STATUS)
109
+ check_enum(errors, where, task, 'priority', VALID_PRIORITY)
110
+ check_enum(errors, where, task, 'area', VALID_AREA)
111
+ check_enum(errors, where, task, 'risk', VALID_RISK)
112
+ check_enum(errors, where, task, 'effort', VALID_EFFORT) if task['effort']
113
+ check_enum(errors, where, task, 'source', VALID_SOURCE) if task['source']
114
+ unless task['acceptance'].is_a?(Array) && !task['acceptance'].empty?
115
+ errors << "#{where}: `acceptance` must be a non-empty list."
116
+ end
117
+ end
118
+ errors
119
+ end
120
+
121
+ def check_enum(errors, where, task, field, allowed)
122
+ value = task[field]
123
+ return if allowed.include?(value)
124
+
125
+ errors << "#{where}: `#{field}` must be one of #{allowed.join('|')} (got #{value.inspect})."
126
+ end
127
+
128
+ # ---------------------------------------------------------------------------
129
+ # Issue body rendering
130
+ # ---------------------------------------------------------------------------
131
+
132
+ def marker(id)
133
+ "<!-- backlog-id: #{id} -->"
134
+ end
135
+
136
+ def render_body(task)
137
+ accept = (task['acceptance'] || []).map { |a| "- [ ] #{a}" }.join("\n")
138
+ roadmap = task.dig('links', 'roadmap')
139
+ meta_row = [
140
+ "**Priority:** #{task['priority']}",
141
+ "**Area:** #{task['area']}",
142
+ "**Risk:** #{task['risk']}",
143
+ "**Effort:** #{task['effort']}",
144
+ "**Source:** #{task['source']}"
145
+ ].join(' · ')
146
+
147
+ <<~BODY.strip
148
+ #{marker(task['id'])}
149
+ > Auto-managed from [`_data/backlog.yml`](../blob/main/_data/backlog.yml) by `scripts/sync-backlog.rb`.
150
+ > Edit the backlog file, not this issue body — changes here are overwritten on the next sync.
151
+
152
+ #{meta_row}#{roadmap ? " · **Roadmap:** v#{roadmap}" : ''}
153
+
154
+ #{task['summary'].to_s.strip}
155
+
156
+ ## Acceptance criteria
157
+
158
+ #{accept}
159
+
160
+ ---
161
+ Picked up by the IMPLEMENT routine (`.github/prompts/backlog-implement.prompt.md`).
162
+ See [`docs/systems/continuous-evolution.md`](../blob/main/docs/systems/continuous-evolution.md).
163
+ BODY
164
+ end
165
+
166
+ # ---------------------------------------------------------------------------
167
+ # gh helpers
168
+ # ---------------------------------------------------------------------------
169
+
170
+ class Gh
171
+ def initialize(dry_run:)
172
+ @dry_run = dry_run
173
+ end
174
+
175
+ # Read-only call. Always executed (even in dry-run) so we can compute a diff;
176
+ # degrades to a default value if `gh` is unavailable/unauthenticated.
177
+ def read(args, default:)
178
+ out, _err, status = Open3.capture3('gh', *args)
179
+ return default unless status.success?
180
+
181
+ out
182
+ rescue Errno::ENOENT
183
+ default
184
+ end
185
+
186
+ # Mutating call. Printed (not executed) in dry-run mode.
187
+ def write(args)
188
+ if @dry_run
189
+ puts "DRY-RUN gh #{args.map { |a| a.to_s.include?(' ') ? a.inspect : a }.join(' ')}"
190
+ return true
191
+ end
192
+ _out, err, status = Open3.capture3('gh', *args)
193
+ warn "gh #{args.first} failed: #{err.strip}" unless status.success?
194
+ status.success?
195
+ end
196
+ end
197
+
198
+ def ensure_labels(gh)
199
+ LABEL_COLORS.each { |name, color| gh.write(['label', 'create', name, '--color', color, '--force']) }
200
+ VALID_PRIORITY.each { |p| gh.write(['label', 'create', "priority:#{p}", '--color', PRIORITY_COLOR, '--force']) }
201
+ VALID_AREA.each { |a| gh.write(['label', 'create', "area:#{a}", '--color', AREA_COLOR, '--force']) }
202
+ VALID_RISK.each { |r| gh.write(['label', 'create', "risk:#{r}", '--color', RISK_COLOR, '--force']) }
203
+ end
204
+
205
+ # Map of backlog id -> existing issue {number, state, labels} via the body marker.
206
+ def existing_issues(gh)
207
+ raw = gh.read(
208
+ ['issue', 'list', '--label', 'agent-ready', '--state', 'all', '--limit', '500',
209
+ '--json', 'number,body,state,labels'],
210
+ default: '[]'
211
+ )
212
+ index = {}
213
+ JSON.parse(raw).each do |issue|
214
+ next unless issue['body'] =~ /<!-- backlog-id: (T-\d+) -->/
215
+
216
+ index[Regexp.last_match(1)] = {
217
+ 'number' => issue['number'],
218
+ 'state' => issue['state'].to_s.downcase,
219
+ 'labels' => (issue['labels'] || []).map { |l| l['name'] }
220
+ }
221
+ end
222
+ index
223
+ rescue JSON::ParserError
224
+ {}
225
+ end
226
+
227
+ # ---------------------------------------------------------------------------
228
+ # Sync
229
+ # ---------------------------------------------------------------------------
230
+
231
+ def label_args(desired, current)
232
+ desired_set = desired
233
+ # Only remove labels we manage; never touch human-applied ones.
234
+ to_remove = (current & ALL_MANAGED_LABELS) - desired_set
235
+ to_add = desired_set - current
236
+ args = []
237
+ to_add.each { |l| args.push('--add-label', l) }
238
+ to_remove.each { |l| args.push('--remove-label', l) }
239
+ args
240
+ end
241
+
242
+ def sync(data, gh)
243
+ ensure_labels(gh)
244
+ index = existing_issues(gh)
245
+ created = updated = closed = 0
246
+
247
+ (data['tasks'] || []).each do |task|
248
+ id = task['id']
249
+ title = task['title']
250
+ body = render_body(task)
251
+ want_open = OPEN_STATUSES.include?(task['status'])
252
+ issue = index[id]
253
+
254
+ if issue.nil?
255
+ next unless want_open # never create an issue for an already-done task
256
+
257
+ args = ['issue', 'create', '--title', title, '--body', body]
258
+ managed_labels(task).each { |l| args.push('--label', l) }
259
+ created += 1 if gh.write(args)
260
+ next
261
+ end
262
+
263
+ number = issue['number'].to_s
264
+ gh.write(['issue', 'edit', number, '--title', title, '--body', body] +
265
+ label_args(managed_labels(task), issue['labels']))
266
+ updated += 1
267
+
268
+ if want_open && issue['state'] != 'open'
269
+ gh.write(['issue', 'reopen', number])
270
+ elsif !want_open && issue['state'] != 'closed'
271
+ gh.write(['issue', 'close', number, '--reason', 'completed'])
272
+ closed += 1
273
+ end
274
+ end
275
+
276
+ puts "Backlog sync complete: #{created} created, #{updated} updated, #{closed} closed."
277
+ 0
278
+ end
279
+
280
+ # ---------------------------------------------------------------------------
281
+ # Main
282
+ # ---------------------------------------------------------------------------
283
+
284
+ def main
285
+ mode = :sync
286
+ OptionParser.new do |opts|
287
+ opts.banner = 'Usage: sync-backlog.rb [--check|--dry-run]'
288
+ opts.on('--check', 'Validate schema only; make no gh calls') { mode = :check }
289
+ opts.on('--dry-run', 'Print intended gh calls without executing') { mode = :dry_run }
290
+ end.parse!
291
+
292
+ data = load_data
293
+ errors = validate(data)
294
+ unless errors.empty?
295
+ warn '✗ _data/backlog.yml failed validation:'
296
+ errors.each { |e| warn " - #{e}" }
297
+ return 1
298
+ end
299
+ task_count = (data['tasks'] || []).size
300
+
301
+ if mode == :check
302
+ puts "✓ _data/backlog.yml is valid (#{task_count} tasks)."
303
+ return 0
304
+ end
305
+
306
+ sync(data, Gh.new(dry_run: mode == :dry_run))
307
+ end
308
+
309
+ exit main if $PROGRAM_NAME == __FILE__
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+ # =============================================================================
3
+ # sync-backlog.sh
4
+ # =============================================================================
5
+ #
6
+ # Thin wrapper around scripts/sync-backlog.rb.
7
+ #
8
+ # Mirrors `_data/backlog.yml` (the tactical task queue) to GitHub Issues:
9
+ # open tasks become open issues; tasks marked `done` close their issue.
10
+ #
11
+ # Usage:
12
+ # ./scripts/sync-backlog.sh # create/update/close issues via gh
13
+ # ./scripts/sync-backlog.sh --check # validate schema only (CI/PR gate)
14
+ # ./scripts/sync-backlog.sh --dry-run # print intended gh calls only
15
+ #
16
+ # =============================================================================
17
+
18
+ set -euo pipefail
19
+
20
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
21
+ exec ruby "${SCRIPT_DIR}/sync-backlog.rb" "$@"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-zer0
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amr Abdel
@@ -79,6 +79,7 @@ files:
79
79
  - README.md
80
80
  - _data/README.md
81
81
  - _data/authors.yml
82
+ - _data/backlog.yml
82
83
  - _data/content_statistics.yml
83
84
  - _data/features.yml
84
85
  - _data/generate_statistics.rb
@@ -462,6 +463,8 @@ files:
462
463
  - scripts/post-template-setup.sh
463
464
  - scripts/release
464
465
  - scripts/setup.sh
466
+ - scripts/sync-backlog.rb
467
+ - scripts/sync-backlog.sh
465
468
  - scripts/test-auto-version.sh
466
469
  - scripts/test-mermaid.sh
467
470
  - scripts/test-notebook-conversion.sh